@treasuredata/tdx 2026.3.18 → 2026.3.20

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 (204) 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.d.ts.map +1 -1
  130. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  131. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  132. package/dist/sdk/segment/fields-display.js +1 -1
  133. package/dist/sdk/segment/file-discovery.js +1 -1
  134. package/dist/sdk/segment/journey-utils.js +1 -1
  135. package/dist/sdk/segment/journey-validator.js +1 -1
  136. package/dist/sdk/segment/journey-yaml.js +1 -1
  137. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  138. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  139. package/dist/sdk/segment/pull-workflow.js +1 -1
  140. package/dist/sdk/segment/push-recovery.js +1 -1
  141. package/dist/sdk/segment/push-workflow.js +1 -1
  142. package/dist/sdk/segment/resolution-context.js +1 -1
  143. package/dist/sdk/segment/segment-path-parser.js +1 -1
  144. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  145. package/dist/sdk/segment/segment-validator.js +1 -1
  146. package/dist/sdk/segment/segment-validator.js.map +1 -1
  147. package/dist/sdk/segment/target-resolution.js +1 -1
  148. package/dist/sdk/segment/tdx-config.js +1 -1
  149. package/dist/sdk/segment/types/activation-schema.js +1 -1
  150. package/dist/sdk/segment/types/journey-def.js +1 -1
  151. package/dist/sdk/segment/types/journey-schema.js +1 -1
  152. package/dist/sdk/segment/types/segment-def.js +1 -1
  153. package/dist/sdk/segment/types/segment-schema.js +1 -1
  154. package/dist/sdk/segment/validate-files.js +1 -1
  155. package/dist/sdk/segment/yaml-validator.js +1 -1
  156. package/dist/sdk/segment.js +1 -1
  157. package/dist/sdk/types/index.js +1 -1
  158. package/dist/sdk/types/progress.js +1 -1
  159. package/dist/sdk/user.js +1 -1
  160. package/dist/sdk/util/format-detector.js +1 -1
  161. package/dist/sdk/util/formatters.js +1 -1
  162. package/dist/sdk/util/index.js +1 -1
  163. package/dist/sdk/util/paginate.js +1 -1
  164. package/dist/sdk/util/tree-formatter.js +1 -1
  165. package/dist/sdk/workflow/archive-validation.js +1 -1
  166. package/dist/sdk/workflow/clone-workflow.js +1 -1
  167. package/dist/sdk/workflow/index.js +1 -1
  168. package/dist/sdk/workflow/pull-workflow.js +1 -1
  169. package/dist/sdk/workflow/push-workflow.js +1 -1
  170. package/dist/sdk/workflow/tdx-config.js +1 -1
  171. package/dist/sdk/workflow/workflow-utils.js +1 -1
  172. package/dist/test-utils/command-runner.js +1 -1
  173. package/dist/test-utils/factories.js +1 -1
  174. package/dist/test-utils/fixtures.js +1 -1
  175. package/dist/test-utils/http-mock.js +1 -1
  176. package/dist/test-utils/index.js +1 -1
  177. package/dist/utils/async.js +1 -1
  178. package/dist/utils/colors.js +1 -1
  179. package/dist/utils/diff.js +1 -1
  180. package/dist/utils/file-permissions.js +1 -1
  181. package/dist/utils/file-reader.js +1 -1
  182. package/dist/utils/github-releases.js +1 -1
  183. package/dist/utils/global-cache.js +1 -1
  184. package/dist/utils/json-loader.js +1 -1
  185. package/dist/utils/local-cache.js +1 -1
  186. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  187. package/dist/utils/logger/formatters/index.js +1 -1
  188. package/dist/utils/logger/handlers/console-handler.js +1 -1
  189. package/dist/utils/logger/handlers/file-handler.js +1 -1
  190. package/dist/utils/logger/handlers/index.js +1 -1
  191. package/dist/utils/logger/handlers/null-handler.js +1 -1
  192. package/dist/utils/logger/index.js +1 -1
  193. package/dist/utils/logger/logger.js +1 -1
  194. package/dist/utils/logger/types.js +1 -1
  195. package/dist/utils/option-validation.js +1 -1
  196. package/dist/utils/process.js +1 -1
  197. package/dist/utils/prompt.js +1 -1
  198. package/dist/utils/spinner.js +1 -1
  199. package/dist/utils/sse-parser.js +1 -1
  200. package/dist/utils/string-utils.js +1 -1
  201. package/dist/utils/table-ref-parser.js +1 -1
  202. package/dist/utils/tdx-logger.js +1 -1
  203. package/dist/utils/version-check.js +1 -1
  204. package/package.json +1 -1
@@ -1 +1 @@
1
- const a54_0x1e6f47=a54_0x25b1;(function(_0x315dea,_0x2d36fb){const _0x48e30f=a54_0x25b1,_0x56cd68=_0x315dea();while(!![]){try{const _0x4c2519=parseInt(_0x48e30f(0x119))/0x1*(parseInt(_0x48e30f(0x105))/0x2)+parseInt(_0x48e30f(0x104))/0x3*(parseInt(_0x48e30f(0x11b))/0x4)+parseInt(_0x48e30f(0x12f))/0x5*(-parseInt(_0x48e30f(0x12e))/0x6)+parseInt(_0x48e30f(0xe3))/0x7+-parseInt(_0x48e30f(0xe1))/0x8+parseInt(_0x48e30f(0x10e))/0x9*(parseInt(_0x48e30f(0xe9))/0xa)+parseInt(_0x48e30f(0xf1))/0xb*(-parseInt(_0x48e30f(0xf9))/0xc);if(_0x4c2519===_0x2d36fb)break;else _0x56cd68['push'](_0x56cd68['shift']());}catch(_0x47be4b){_0x56cd68['push'](_0x56cd68['shift']());}}}(a54_0x13ff,0x34ebc));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a54_0x76dbc2 from'node:fs';import*as a54_0x48bb51 from'node:path';import{SITE_ALIASES}from'../sdk/types/index.js';import{getKeychainAPIKey,saveKeychainAPIKey}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a54_0x3cac3d from'chalk';import{getGlobalCacheDir,createOptionalProfileCache}from'../utils/global-cache.js';export function getConfigDir(){const _0x12571a=a54_0x25b1;return process.env.TDX_CONFIG_DIR||join(homedir(),_0x12571a(0xf0),_0x12571a(0xf5));}function a54_0x13ff(){const _0xe7f516=['TD_API_KEY','source','some','string','.env','150wYKokO','includes','replace','startsWith','stg-us01','clear','\x27,\x20defaulting\x20to\x20us01','.config','346742XjIfrR','warn','llm_default_project','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','tdx','write','accountId','TDX_ACCESS_TOKEN\x20env\x20var','84jyXydo','config/llm-agent','filter','stg-ap01','stable','llm_default_agent','dev-us01','toUpperCase','keychain','.env.','existsSync','63012voxQfH','265966SvqOfD','stg-ap03','parse','projectId','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','release_channel','match','account_info','eu01','2007QoYCqf','join','ap03','map','profile','Warning:\x20Failed\x20to\x20read\x20','\x20env\x20var','proxy','utf-8','trim','read','3xnAcbE','slice','40DTcadw','TDX_ACCESS_TOKEN_','split','entries','config/account-info','name','tdx.json','keychain\x20(profile:\x20','ap01','number','site','path','accessToken','next','readFileSync','yellow','TDX_API_KEY\x20env\x20var','dev-eu01','us01','326562suIPvs','35PWWsZm','.json','TDX_API_KEY_','stringify','config/llm-project','175080JeLANg','ap02','1595706ilweLn'];a54_0x13ff=function(){return _0xe7f516;};return a54_0x13ff();}export function getConfigFile(){const _0x5952a4=a54_0x25b1;return join(getConfigDir(),_0x5952a4(0xe8));}export function getConfigFilePath(_0xb4a3f5){const _0x1928a8=a54_0x25b1,_0x4e94cb=getConfigDir();return _0xb4a3f5?a54_0x48bb51['join'](_0x4e94cb,_0x1928a8(0x102)+_0xb4a3f5):getConfigFile();}export function getCacheDir(){return getGlobalCacheDir();}const llmProjectCache=createOptionalProfileCache(a54_0x1e6f47(0xf3),a54_0x1e6f47(0xe0));export function getLLMProjectCacheFile(_0x1dc535){const _0x120071=a54_0x1e6f47;return llmProjectCache[_0x120071(0x126)](_0x1dc535);}export function readCachedLLMProject(_0xcfa52d){const _0x2cec05=a54_0x1e6f47,_0x2e85e3=llmProjectCache[_0x2cec05(0x118)](_0xcfa52d);if(_0x2e85e3&&typeof _0x2e85e3['id']==='string'&&typeof _0x2e85e3[_0x2cec05(0x120)]===_0x2cec05(0xe7))return _0x2e85e3;return null;}export function writeCachedLLMProject(_0x32d2d6,_0x1a7405,_0x47d908){try{llmProjectCache['write']({'name':_0x32d2d6,'id':_0x1a7405},_0x47d908);}catch{}}const llmAgentCache=createOptionalProfileCache(a54_0x1e6f47(0xfe),a54_0x1e6f47(0xfa));export function getLLMAgentCacheFile(_0x42928f){const _0x1a98a9=a54_0x1e6f47;return llmAgentCache[_0x1a98a9(0x126)](_0x42928f);}export function readCachedLLMAgent(_0x1318ab){const _0xbd3a1d=a54_0x1e6f47,_0x22af1c=llmAgentCache[_0xbd3a1d(0x118)](_0x1318ab);if(_0x22af1c&&typeof _0x22af1c['id']==='string'&&typeof _0x22af1c[_0xbd3a1d(0x120)]===_0xbd3a1d(0xe7)&&typeof _0x22af1c[_0xbd3a1d(0x108)]===_0xbd3a1d(0xe7))return _0x22af1c;return null;}export function writeCachedLLMAgent(_0x21198f,_0x1f7e11,_0x3ca32d,_0x209d1f){try{llmAgentCache['write']({'name':_0x21198f,'id':_0x1f7e11,'projectId':_0x3ca32d},_0x209d1f);}catch{}}export function clearCachedLLMAgent(_0x6b3f0f){const _0x387046=a54_0x1e6f47;try{llmAgentCache[_0x387046(0xee)](_0x6b3f0f);}catch{}}const accountInfoCache=createOptionalProfileCache(a54_0x1e6f47(0x10c),a54_0x1e6f47(0x11f),{'suffix':a54_0x1e6f47(0x130)});export function getAccountInfoCacheFile(_0x45287b){return accountInfoCache['path'](_0x45287b);}export function readCachedAccountInfo(_0x5da564){const _0x503810=a54_0x1e6f47,_0x21d960=accountInfoCache['read'](_0x5da564);if(_0x21d960&&typeof _0x21d960[_0x503810(0x125)]===_0x503810(0xe7)&&typeof _0x21d960[_0x503810(0xf7)]===_0x503810(0x124))return _0x21d960;return null;}export function writeCachedAccountInfo(_0x5bc0d2,_0x274825,_0x173763){const _0x5799a9=a54_0x1e6f47;try{accountInfoCache[_0x5799a9(0xf6)]({'site':_0x5bc0d2,'accountId':_0x274825,'cachedAt':new Date()['toISOString']()},_0x173763);}catch{}}export function parseEnvFile(_0x143280){const _0x1748d1=a54_0x1e6f47,_0x420622={};for(const _0x281737 of _0x143280[_0x1748d1(0x11d)]('\x0a')){const _0x4a6c54=_0x281737[_0x1748d1(0x117)]();if(!_0x4a6c54||_0x4a6c54[_0x1748d1(0xec)]('#'))continue;const _0x936bd1=_0x4a6c54[_0x1748d1(0x10b)](/^([^=]+)=(.*)$/);if(_0x936bd1){const _0x418def=_0x936bd1[0x1][_0x1748d1(0x117)]();let _0x1dd97b=_0x936bd1[0x2][_0x1748d1(0x117)]();(_0x1dd97b[_0x1748d1(0xec)]('\x22')&&_0x1dd97b['endsWith']('\x22')||_0x1dd97b[_0x1748d1(0xec)]('\x27')&&_0x1dd97b['endsWith']('\x27'))&&(_0x1dd97b=_0x1dd97b[_0x1748d1(0x11a)](0x1,-0x1)),_0x420622[_0x418def]=_0x1dd97b;}}return _0x420622;}export function readUserConfig(){const _0x4bf3dc=a54_0x1e6f47,_0x4c1bd3=getConfigFile();if(!existsSync(_0x4c1bd3))return{};try{const _0x396b56=readFileSync(_0x4c1bd3,_0x4bf3dc(0x116));return parseEnvFile(_0x396b56);}catch(_0x494303){return console[_0x4bf3dc(0xf2)](_0x4bf3dc(0xf4)+_0x4c1bd3+':',_0x494303),{};}}export function resolveSite(_0x5df4e3){const _0xc5af8=a54_0x1e6f47,_0x25e077=[_0xc5af8(0x12d),_0xc5af8(0x123),_0xc5af8(0x10d),_0xc5af8(0xe2),_0xc5af8(0x110),_0xc5af8(0xff),_0xc5af8(0x12c),_0xc5af8(0xed),_0xc5af8(0xfc),_0xc5af8(0x106)];if(_0x25e077[_0xc5af8(0xea)](_0x5df4e3))return _0x5df4e3;if(_0x5df4e3 in SITE_ALIASES)return SITE_ALIASES[_0x5df4e3];return console[_0xc5af8(0xf2)]('Warning:\x20Unknown\x20site\x20\x27'+_0x5df4e3+_0xc5af8(0xef)),_0xc5af8(0x12d);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function resolveAccessToken(_0x2c5650){const _0x24d556=a54_0x1e6f47,_0xc1514d=_0x2c5650||getActiveProfileName()||undefined;if(_0xc1514d){const _0x6da995=_0x24d556(0x11c)+normalizeProfileForEnvVar(_0xc1514d);if(process.env[_0x6da995])return{'accessToken':process.env[_0x6da995],'source':_0x6da995+'\x20env\x20var'};}if(process.env.TDX_ACCESS_TOKEN)return{'accessToken':process.env.TDX_ACCESS_TOKEN,'source':_0x24d556(0xf8)};return null;}export function getAccessToken(_0x1379a8){const _0x3f88e0=a54_0x1e6f47;return resolveAccessToken(_0x1379a8)?.[_0x3f88e0(0x127)];}export function getAPIKey(_0x2627ad){const _0x5ea907=a54_0x1e6f47,_0x322956=_0x2627ad||getActiveProfileName();if(_0x322956){const _0x2564b3=_0x5ea907(0x131)+normalizeProfileForEnvVar(_0x322956);if(process.env[_0x2564b3])return process.env[_0x2564b3];}if(process.env.TDX_API_KEY)return process.env.TDX_API_KEY;return undefined;}export function normalizeProfileForEnvVar(_0x369af6){const _0x3fe28b=a54_0x1e6f47;return _0x369af6[_0x3fe28b(0x100)]()[_0x3fe28b(0xeb)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x3f60b2,_0x25e117){const _0x11497e=a54_0x1e6f47,_0x47a1e8=resolveAccessToken(_0x25e117);if(_0x47a1e8)return{'apiKey':_0x47a1e8[_0x11497e(0x127)],'source':_0x47a1e8[_0x11497e(0xe5)],'isDeprecated':![]};const _0x3e1c0d=_0x25e117||getActiveProfileName()||undefined;if(_0x3e1c0d){const _0x4b56d3=_0x11497e(0x131)+normalizeProfileForEnvVar(_0x3e1c0d);if(process.env[_0x4b56d3])return{'apiKey':process.env[_0x4b56d3],'source':_0x4b56d3+_0x11497e(0x114),'isDeprecated':![]};const _0x4899ea=getCachedCredential(_0x3f60b2,_0x3e1c0d);if(_0x4899ea)return{'apiKey':_0x4899ea,'source':_0x11497e(0x122)+_0x3e1c0d+')','isDeprecated':![]};const _0x148b8e=await getKeychainAPIKey(_0x3e1c0d);if(_0x148b8e)return setCachedCredential(_0x148b8e,_0x3f60b2,_0x3e1c0d),{'apiKey':_0x148b8e,'source':_0x11497e(0x122)+_0x3e1c0d+')','isDeprecated':![]};}if(process.env.TDX_API_KEY)return{'apiKey':process.env.TDX_API_KEY,'source':_0x11497e(0x12b),'isDeprecated':![]};if(!_0x3e1c0d){const _0x449bb1=getCachedCredential(_0x3f60b2,undefined);if(_0x449bb1)return{'apiKey':_0x449bb1,'source':'keychain','isDeprecated':![]};const _0x127b50=await getKeychainAPIKey(undefined);if(_0x127b50)return setCachedCredential(_0x127b50,_0x3f60b2,undefined),{'apiKey':_0x127b50,'source':_0x11497e(0x101),'isDeprecated':![]};}return null;}export async function getAPIKeyAsync(_0x9194dd,_0x150cc3){const _0x3ee833=await resolveAPIKeyAsync(_0x9194dd,_0x150cc3);return _0x3ee833?.['apiKey'];}function cleanupLegacyEnvFile(_0x5cf032){const _0x5dd8e0=a54_0x1e6f47;if(!existsSync(_0x5cf032))return![];try{const _0x38394d=readFileSync(_0x5cf032,_0x5dd8e0(0x116)),_0x3b4cbd=_0x38394d[_0x5dd8e0(0x11d)]('\x0a'),_0xc39653=_0x3b4cbd[_0x5dd8e0(0xfb)](_0x3347fa=>{const _0x334711=_0x5dd8e0,_0x4eb697=_0x3347fa['trim']();if(!_0x4eb697||_0x4eb697['startsWith']('#'))return!![];const [_0x26c509]=_0x4eb697[_0x334711(0x11d)]('=');return!_0x26c509[_0x334711(0xec)](_0x334711(0xe4));}),_0x415a65=_0xc39653[_0x5dd8e0(0xe6)](_0x5af4ad=>{const _0x3ff8c5=_0x5dd8e0,_0x3696c7=_0x5af4ad[_0x3ff8c5(0x117)]();return _0x3696c7&&!_0x3696c7[_0x3ff8c5(0xec)]('#');});if(!_0x415a65)return unlinkSync(_0x5cf032),!![];return writeFileSync(_0x5cf032,_0xc39653[_0x5dd8e0(0x10f)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function a54_0x25b1(_0x3e7321,_0x18f6e1){_0x3e7321=_0x3e7321-0xdf;const _0x13ff32=a54_0x13ff();let _0x25b157=_0x13ff32[_0x3e7321];return _0x25b157;}function getActiveProfileName(){const _0x32ff11=a54_0x1e6f47;if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x40a6f7=a54_0x48bb51[_0x32ff11(0x10f)](getConfigDir(),_0x32ff11(0x121));if(!a54_0x76dbc2['existsSync'](_0x40a6f7))return null;try{const _0x2d1b7f=a54_0x76dbc2['readFileSync'](_0x40a6f7,_0x32ff11(0x116)),_0x234a0f=JSON[_0x32ff11(0x107)](_0x2d1b7f);return _0x234a0f[_0x32ff11(0x112)]||null;}catch{return null;}}export function saveAPIKey(_0x24f1f3,_0x12175f,_0x4846e7){const _0x3c4ece=a54_0x1e6f47,_0x2788bb=getConfigDir(),_0x5c0bb1=getConfigFilePath(_0x4846e7);!existsSync(_0x2788bb)&&mkdirSync(_0x2788bb,{'recursive':!![],'mode':0x1c0});let _0x2b6e09={};if(existsSync(_0x5c0bb1))try{const _0x392e68=readFileSync(_0x5c0bb1,_0x3c4ece(0x116));_0x2b6e09=parseEnvFile(_0x392e68);}catch(_0x4719ec){console[_0x3c4ece(0xf2)](_0x3c4ece(0x113)+_0x5c0bb1+':',_0x4719ec);}const _0x3e685e=_0x24f1f3[_0x3c4ece(0x100)]()['replace'](/-/g,'_');_0x2b6e09['TD_API_KEY_'+_0x3e685e]=_0x12175f;const _0x55ce06=Object[_0x3c4ece(0x11e)](_0x2b6e09)[_0x3c4ece(0x111)](([_0x3aa457,_0x5962f6])=>_0x3aa457+'='+_0x5962f6);writeFileSync(_0x5c0bb1,_0x55ce06[_0x3c4ece(0x10f)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x32f01d,_0x7918d9,_0x2051c7){const _0x4373c8=a54_0x1e6f47;await saveKeychainAPIKey(_0x32f01d,_0x2051c7),setCachedCredential(_0x32f01d,_0x7918d9,_0x2051c7);const _0x3d1380=getConfigFilePath(_0x2051c7);cleanupLegacyEnvFile(_0x3d1380)&&console[_0x4373c8(0xf2)](a54_0x3cac3d[_0x4373c8(0x12a)](_0x4373c8(0x109)));}export function loadConfig(){const _0x1a2edc=a54_0x1e6f47,_0xd31882={'apiKeys':{},'defaultSite':_0x1a2edc(0x12d)},_0x3a5c16=[_0x1a2edc(0x12d),_0x1a2edc(0x123),'eu01','ap02',_0x1a2edc(0x110),'dev-us01',_0x1a2edc(0x12c),_0x1a2edc(0xed),_0x1a2edc(0xfc),_0x1a2edc(0x106)],_0x52bc58=getAPIKey();if(_0x52bc58)for(const _0x2d5273 of _0x3a5c16){_0xd31882['apiKeys'][_0x2d5273]=_0x52bc58;}return _0xd31882;}export function isExperimentalAvailable(){return!!process.env.TDX_EXPERIMENTAL;}export function loadGlobalProxy(){const _0xe429cf=a54_0x1e6f47,_0x3e716c=a54_0x48bb51['join'](getConfigDir(),_0xe429cf(0x121));if(!a54_0x76dbc2[_0xe429cf(0x103)](_0x3e716c))return undefined;try{const _0x46f6f4=a54_0x76dbc2['readFileSync'](_0x3e716c,'utf-8'),_0x29e7aa=JSON['parse'](_0x46f6f4);return typeof _0x29e7aa[_0xe429cf(0x115)]===_0xe429cf(0xe7)?_0x29e7aa[_0xe429cf(0x115)]:undefined;}catch{return undefined;}}export function loadReleaseChannel(){const _0x174649=a54_0x1e6f47,_0x5a9f79=process.env.TDX_RELEASE_CHANNEL;if(_0x5a9f79===_0x174649(0x128)||_0x5a9f79===_0x174649(0xfd))return _0x5a9f79;const _0x5d1914=a54_0x48bb51[_0x174649(0x10f)](getConfigDir(),_0x174649(0x121));if(!a54_0x76dbc2[_0x174649(0x103)](_0x5d1914))return _0x174649(0xfd);try{const _0x4c24ca=a54_0x76dbc2[_0x174649(0x129)](_0x5d1914,_0x174649(0x116)),_0x437421=JSON['parse'](_0x4c24ca);if(_0x437421[_0x174649(0x10a)]===_0x174649(0x128))return _0x174649(0x128);}catch{}return'stable';}export function saveReleaseChannel(_0x4ecfe5){const _0x1c6240=a54_0x1e6f47,_0x408b34=getConfigDir(),_0x2420ef=a54_0x48bb51[_0x1c6240(0x10f)](_0x408b34,'tdx.json');!existsSync(_0x408b34)&&mkdirSync(_0x408b34,{'recursive':!![],'mode':0x1c0});let _0x35b79d={};if(existsSync(_0x2420ef))try{const _0x24547a=readFileSync(_0x2420ef,'utf-8');_0x35b79d=JSON['parse'](_0x24547a);}catch{}_0x35b79d[_0x1c6240(0x10a)]=_0x4ecfe5,writeFileSync(_0x2420ef,JSON[_0x1c6240(0xdf)](_0x35b79d,null,0x2),{'mode':0x180});}
1
+ const a54_0x35d6e9=a54_0xa539;(function(_0x4d6d5c,_0x233e7f){const _0x56a87f=a54_0xa539,_0x414819=_0x4d6d5c();while(!![]){try{const _0x251d57=-parseInt(_0x56a87f(0x12c))/0x1+parseInt(_0x56a87f(0xf1))/0x2+-parseInt(_0x56a87f(0xe1))/0x3*(-parseInt(_0x56a87f(0xeb))/0x4)+-parseInt(_0x56a87f(0x109))/0x5*(-parseInt(_0x56a87f(0x115))/0x6)+parseInt(_0x56a87f(0xe2))/0x7+parseInt(_0x56a87f(0x10e))/0x8+parseInt(_0x56a87f(0xfd))/0x9*(-parseInt(_0x56a87f(0x11b))/0xa);if(_0x251d57===_0x233e7f)break;else _0x414819['push'](_0x414819['shift']());}catch(_0x34fcae){_0x414819['push'](_0x414819['shift']());}}}(a54_0x16d4,0xe5944));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a54_0x161096 from'node:fs';import*as a54_0x9e867d 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_0x575e31 from'chalk';import{getGlobalCacheDir,createOptionalProfileCache}from'../utils/global-cache.js';export function getConfigDir(){const _0x18a712=a54_0xa539;return process.env.TDX_CONFIG_DIR||join(homedir(),_0x18a712(0x121),_0x18a712(0xee));}export function getConfigFile(){const _0x78cf53=a54_0xa539;return join(getConfigDir(),_0x78cf53(0x102));}function a54_0x16d4(){const _0x5194f4=['keychain','.env','projectId','stg-ap03','TD_API_KEY','config/account-info','replace','toUpperCase','6066905PcggFU','readFileSync','.json','stg-us01','llm_default_project','12521120FYqxzR','filter','map','split','dev-us01','warn','parse','6zXBeTN','match','read','keychain\x20(profile:\x20','accessToken','llm_default_agent','50sXaTMQ','slice','yellow','next','config/llm-agent','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','.config','TD_API_KEY_','entries','ap02','ap01','proxy','us01','number','Warning:\x20Unknown\x20site\x20\x27','TDX_ACCESS_TOKEN_','name','1117539VUMRwP','\x27,\x20defaulting\x20to\x20us01','release_channel','ap03','stg-ap01','4405977Wiaiqg','12218647paPfbX','accountId','endsWith','stringify','apiKeys','source','trim','TDX_API_KEY_','eu01','4TbwLYe','clear','join','tdx','stable','\x20env\x20var','2849158GzwZrm','Warning:\x20Failed\x20to\x20read\x20','string','.env.','path','utf-8','existsSync','toISOString','startsWith','write','includes','account_info','9646893CTKjVW','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','tdx.json','config/llm-project'];a54_0x16d4=function(){return _0x5194f4;};return a54_0x16d4();}export function getConfigFilePath(_0x33e412){const _0x1b4bf4=a54_0xa539,_0x452d71=getConfigDir();return _0x33e412?a54_0x9e867d['join'](_0x452d71,_0x1b4bf4(0xf4)+_0x33e412):getConfigFile();}export function getCacheDir(){return getGlobalCacheDir();}const llmProjectCache=createOptionalProfileCache(a54_0x35d6e9(0x10d),a54_0x35d6e9(0x100));export function getLLMProjectCacheFile(_0x22b49a){return llmProjectCache['path'](_0x22b49a);}export function readCachedLLMProject(_0x283fca){const _0x401251=a54_0x35d6e9,_0x1ee499=llmProjectCache['read'](_0x283fca);if(_0x1ee499&&typeof _0x1ee499['id']===_0x401251(0xf3)&&typeof _0x1ee499[_0x401251(0x12b)]===_0x401251(0xf3))return _0x1ee499;return null;}export function writeCachedLLMProject(_0x414980,_0x1b1ca1,_0x3098d7){const _0x332e05=a54_0x35d6e9;try{llmProjectCache[_0x332e05(0xfa)]({'name':_0x414980,'id':_0x1b1ca1},_0x3098d7);}catch{}}const llmAgentCache=createOptionalProfileCache(a54_0x35d6e9(0x11a),a54_0x35d6e9(0x11f));export function getLLMAgentCacheFile(_0x2be858){const _0xc44fb5=a54_0x35d6e9;return llmAgentCache[_0xc44fb5(0xf5)](_0x2be858);}export function readCachedLLMAgent(_0x3c323d){const _0x14d0f3=a54_0x35d6e9,_0x919543=llmAgentCache[_0x14d0f3(0x117)](_0x3c323d);if(_0x919543&&typeof _0x919543['id']===_0x14d0f3(0xf3)&&typeof _0x919543[_0x14d0f3(0x12b)]===_0x14d0f3(0xf3)&&typeof _0x919543[_0x14d0f3(0x103)]===_0x14d0f3(0xf3))return _0x919543;return null;}export function writeCachedLLMAgent(_0x51f8c8,_0x228475,_0x3cbef1,_0x3c2fae){const _0x4b796a=a54_0x35d6e9;try{llmAgentCache[_0x4b796a(0xfa)]({'name':_0x51f8c8,'id':_0x228475,'projectId':_0x3cbef1},_0x3c2fae);}catch{}}export function clearCachedLLMAgent(_0x364298){const _0x43cf68=a54_0x35d6e9;try{llmAgentCache[_0x43cf68(0xec)](_0x364298);}catch{}}const accountInfoCache=createOptionalProfileCache(a54_0x35d6e9(0xfc),a54_0x35d6e9(0x106),{'suffix':a54_0x35d6e9(0x10b)});export function getAccountInfoCacheFile(_0x33c66f){const _0x5a72d9=a54_0x35d6e9;return accountInfoCache[_0x5a72d9(0xf5)](_0x33c66f);}export function readCachedAccountInfo(_0x37892d){const _0x5dcaf5=a54_0x35d6e9,_0x5df100=accountInfoCache[_0x5dcaf5(0x117)](_0x37892d);if(_0x5df100&&typeof _0x5df100['site']===_0x5dcaf5(0xf3)&&typeof _0x5df100[_0x5dcaf5(0xe3)]===_0x5dcaf5(0x128))return _0x5df100;return null;}export function writeCachedAccountInfo(_0x49b34c,_0x48f513,_0x2f2268){const _0x3a30bd=a54_0x35d6e9;try{accountInfoCache[_0x3a30bd(0xfa)]({'site':_0x49b34c,'accountId':_0x48f513,'cachedAt':new Date()[_0x3a30bd(0xf8)]()},_0x2f2268);}catch{}}function a54_0xa539(_0x140bcc,_0x128166){_0x140bcc=_0x140bcc-0xdd;const _0x16d45a=a54_0x16d4();let _0xa539ba=_0x16d45a[_0x140bcc];return _0xa539ba;}export function parseEnvFile(_0x4ae21c){const _0x1aad6a=a54_0x35d6e9,_0x1eeb7={};for(const _0x6439b2 of _0x4ae21c[_0x1aad6a(0x111)]('\x0a')){const _0x43e187=_0x6439b2[_0x1aad6a(0xe8)]();if(!_0x43e187||_0x43e187[_0x1aad6a(0xf9)]('#'))continue;const _0x435aff=_0x43e187[_0x1aad6a(0x116)](/^([^=]+)=(.*)$/);if(_0x435aff){const _0x148cc6=_0x435aff[0x1]['trim']();let _0x275d76=_0x435aff[0x2][_0x1aad6a(0xe8)]();(_0x275d76[_0x1aad6a(0xf9)]('\x22')&&_0x275d76['endsWith']('\x22')||_0x275d76[_0x1aad6a(0xf9)]('\x27')&&_0x275d76[_0x1aad6a(0xe4)]('\x27'))&&(_0x275d76=_0x275d76[_0x1aad6a(0x11c)](0x1,-0x1)),_0x1eeb7[_0x148cc6]=_0x275d76;}}return _0x1eeb7;}export function readUserConfig(){const _0x453f20=a54_0x35d6e9,_0xccf94d=getConfigFile();if(!existsSync(_0xccf94d))return{};try{const _0x1af895=readFileSync(_0xccf94d,'utf-8');return parseEnvFile(_0x1af895);}catch(_0x1cc16f){return console[_0x453f20(0x113)](_0x453f20(0xfe)+_0xccf94d+':',_0x1cc16f),{};}}export function resolveSite(_0x5f1e30){const _0x211932=a54_0x35d6e9,_0x238a43=[_0x211932(0x127),_0x211932(0x125),_0x211932(0xea),_0x211932(0x124),_0x211932(0xdf),_0x211932(0x112),'dev-eu01',_0x211932(0x10c),'stg-ap01',_0x211932(0x104)];if(_0x238a43[_0x211932(0xfb)](_0x5f1e30))return _0x5f1e30;if(_0x5f1e30 in SITE_ALIASES)return SITE_ALIASES[_0x5f1e30];return console[_0x211932(0x113)](_0x211932(0x129)+_0x5f1e30+_0x211932(0xdd)),_0x211932(0x127);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function resolveAccessToken(_0x445f27){const _0x325e53=a54_0x35d6e9,_0x599916=_0x445f27||getActiveProfileName()||undefined;if(_0x599916){const _0x2297e9=_0x325e53(0x12a)+normalizeProfileForEnvVar(_0x599916);if(process.env[_0x2297e9])return{'accessToken':process.env[_0x2297e9],'source':_0x2297e9+_0x325e53(0xf0)};}if(process.env.TDX_ACCESS_TOKEN)return{'accessToken':process.env.TDX_ACCESS_TOKEN,'source':'TDX_ACCESS_TOKEN\x20env\x20var'};return null;}export function getAccessToken(_0x1ecfdf){const _0x3a9525=a54_0x35d6e9;return resolveAccessToken(_0x1ecfdf)?.[_0x3a9525(0x119)];}export function getAPIKey(_0x52f087){const _0x54d493=a54_0x35d6e9,_0x11f01e=_0x52f087||getActiveProfileName();if(_0x11f01e){const _0x37c27d=_0x54d493(0xe9)+normalizeProfileForEnvVar(_0x11f01e);if(process.env[_0x37c27d])return process.env[_0x37c27d];}if(process.env.TDX_API_KEY)return process.env.TDX_API_KEY;return undefined;}export function normalizeProfileForEnvVar(_0x514edc){const _0x5ccdf1=a54_0x35d6e9;return _0x514edc[_0x5ccdf1(0x108)]()[_0x5ccdf1(0x107)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x4918b1,_0x3946f3){const _0x129e24=a54_0x35d6e9,_0x12b797=resolveAccessToken(_0x3946f3);if(_0x12b797)return{'apiKey':_0x12b797[_0x129e24(0x119)],'source':_0x12b797[_0x129e24(0xe7)],'isDeprecated':![]};const _0x48b773=_0x3946f3||getActiveProfileName()||undefined;if(_0x48b773){const _0x30e812='TDX_API_KEY_'+normalizeProfileForEnvVar(_0x48b773);if(process.env[_0x30e812])return{'apiKey':process.env[_0x30e812],'source':_0x30e812+_0x129e24(0xf0),'isDeprecated':![]};const _0x398e0b=getCachedCredential(_0x4918b1,_0x48b773);if(_0x398e0b)return{'apiKey':_0x398e0b,'source':_0x129e24(0x118)+_0x48b773+')','isDeprecated':![]};const _0x29cca6=await getKeychainAPIKey(_0x48b773);if(_0x29cca6)return setCachedCredential(_0x29cca6,_0x4918b1,_0x48b773),{'apiKey':_0x29cca6,'source':_0x129e24(0x118)+_0x48b773+')','isDeprecated':![]};}if(process.env.TDX_API_KEY)return{'apiKey':process.env.TDX_API_KEY,'source':'TDX_API_KEY\x20env\x20var','isDeprecated':![]};if(!_0x48b773){const _0x789711=getCachedCredential(_0x4918b1,undefined);if(_0x789711)return{'apiKey':_0x789711,'source':'keychain','isDeprecated':![]};const _0x520782=await getKeychainAPIKey(undefined);if(_0x520782)return setCachedCredential(_0x520782,_0x4918b1,undefined),{'apiKey':_0x520782,'source':_0x129e24(0x101),'isDeprecated':![]};}return null;}export async function getAPIKeyAsync(_0x571e9c,_0x8cecc8){const _0x43ef7e=await resolveAPIKeyAsync(_0x571e9c,_0x8cecc8);return _0x43ef7e?.['apiKey'];}function cleanupLegacyEnvFile(_0x34d298){const _0x478326=a54_0x35d6e9;if(!existsSync(_0x34d298))return![];try{const _0x250d77=readFileSync(_0x34d298,_0x478326(0xf6)),_0x1826b0=_0x250d77['split']('\x0a'),_0x2dd899=_0x1826b0[_0x478326(0x10f)](_0x49b8bf=>{const _0xa54b62=_0x478326,_0x3903ec=_0x49b8bf[_0xa54b62(0xe8)]();if(!_0x3903ec||_0x3903ec[_0xa54b62(0xf9)]('#'))return!![];const [_0x170802]=_0x3903ec[_0xa54b62(0x111)]('=');return!_0x170802[_0xa54b62(0xf9)](_0xa54b62(0x105));}),_0x1969eb=_0x2dd899['some'](_0x2fad1a=>{const _0x34c71=_0x478326,_0xcaacbf=_0x2fad1a[_0x34c71(0xe8)]();return _0xcaacbf&&!_0xcaacbf[_0x34c71(0xf9)]('#');});if(!_0x1969eb)return unlinkSync(_0x34d298),!![];return writeFileSync(_0x34d298,_0x2dd899[_0x478326(0xed)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function getActiveProfileName(){const _0x8f02d2=a54_0x35d6e9;if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x530973=a54_0x9e867d[_0x8f02d2(0xed)](getConfigDir(),_0x8f02d2(0xff));if(!a54_0x161096['existsSync'](_0x530973))return null;try{const _0x49b102=a54_0x161096['readFileSync'](_0x530973,_0x8f02d2(0xf6)),_0x2ea4eb=JSON['parse'](_0x49b102);return _0x2ea4eb['profile']||null;}catch{return null;}}export function saveAPIKey(_0x563c80,_0x2b3b09,_0x32a3c9){const _0x26e731=a54_0x35d6e9,_0x34934e=getConfigDir(),_0x53c410=getConfigFilePath(_0x32a3c9);!existsSync(_0x34934e)&&mkdirSync(_0x34934e,{'recursive':!![],'mode':0x1c0});let _0x3a7b0c={};if(existsSync(_0x53c410))try{const _0x34a787=readFileSync(_0x53c410,_0x26e731(0xf6));_0x3a7b0c=parseEnvFile(_0x34a787);}catch(_0x3d00a8){console[_0x26e731(0x113)](_0x26e731(0xf2)+_0x53c410+':',_0x3d00a8);}const _0x4e753f=_0x563c80['toUpperCase']()[_0x26e731(0x107)](/-/g,'_');_0x3a7b0c[_0x26e731(0x122)+_0x4e753f]=_0x2b3b09;const _0x515213=Object[_0x26e731(0x123)](_0x3a7b0c)[_0x26e731(0x110)](([_0x54f595,_0x2474b1])=>_0x54f595+'='+_0x2474b1);writeFileSync(_0x53c410,_0x515213[_0x26e731(0xed)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x2c5441,_0x446443,_0x47dd3){const _0x374fca=a54_0x35d6e9;await saveKeychainAPIKey(_0x2c5441,_0x47dd3),setCachedCredential(_0x2c5441,_0x446443,_0x47dd3);const _0x274ad8=getConfigFilePath(_0x47dd3);cleanupLegacyEnvFile(_0x274ad8)&&console['warn'](a54_0x575e31[_0x374fca(0x11d)](_0x374fca(0x120)));}export function loadConfig(){const _0x2e2410=a54_0x35d6e9,_0x570c6e={'apiKeys':{},'defaultSite':_0x2e2410(0x127)},_0x3e65ad=[_0x2e2410(0x127),_0x2e2410(0x125),_0x2e2410(0xea),_0x2e2410(0x124),_0x2e2410(0xdf),_0x2e2410(0x112),'dev-eu01',_0x2e2410(0x10c),_0x2e2410(0xe0),_0x2e2410(0x104)],_0x26aeec=getAPIKey();if(_0x26aeec)for(const _0x2a9c00 of _0x3e65ad){_0x570c6e[_0x2e2410(0xe6)][_0x2a9c00]=_0x26aeec;}return _0x570c6e;}export function isExperimentalAvailable(){return!!process.env.TDX_EXPERIMENTAL;}export function loadGlobalProxy(){const _0x1b62e2=a54_0x35d6e9,_0x319e87=a54_0x9e867d[_0x1b62e2(0xed)](getConfigDir(),'tdx.json');if(!a54_0x161096[_0x1b62e2(0xf7)](_0x319e87))return undefined;try{const _0x4d0489=a54_0x161096['readFileSync'](_0x319e87,_0x1b62e2(0xf6)),_0x573cfc=JSON[_0x1b62e2(0x114)](_0x4d0489);return typeof _0x573cfc[_0x1b62e2(0x126)]==='string'?_0x573cfc[_0x1b62e2(0x126)]:undefined;}catch{return undefined;}}export function loadReleaseChannel(){const _0x2916b5=a54_0x35d6e9,_0x58130b=process.env.TDX_RELEASE_CHANNEL;if(_0x58130b===_0x2916b5(0x11e)||_0x58130b==='stable')return _0x58130b;const _0x29fa3f=a54_0x9e867d[_0x2916b5(0xed)](getConfigDir(),_0x2916b5(0xff));if(!a54_0x161096[_0x2916b5(0xf7)](_0x29fa3f))return'stable';try{const _0x24dd3d=a54_0x161096[_0x2916b5(0x10a)](_0x29fa3f,'utf-8'),_0x31d310=JSON['parse'](_0x24dd3d);if(_0x31d310[_0x2916b5(0xde)]===_0x2916b5(0x11e))return _0x2916b5(0x11e);}catch{}return _0x2916b5(0xef);}export function saveReleaseChannel(_0x4174fc){const _0xebd367=a54_0x35d6e9,_0x40b6c6=getConfigDir(),_0xa67e41=a54_0x9e867d['join'](_0x40b6c6,_0xebd367(0xff));!existsSync(_0x40b6c6)&&mkdirSync(_0x40b6c6,{'recursive':!![],'mode':0x1c0});let _0x1b1fa8={};if(existsSync(_0xa67e41))try{const _0x454044=readFileSync(_0xa67e41,_0xebd367(0xf6));_0x1b1fa8=JSON['parse'](_0x454044);}catch{}_0x1b1fa8[_0xebd367(0xde)]=_0x4174fc,writeFileSync(_0xa67e41,JSON[_0xebd367(0xe5)](_0x1b1fa8,null,0x2),{'mode':0x180});}
@@ -1 +1 @@
1
- const a55_0x338c43=a55_0x2532;(function(_0x3596da,_0x5eb3c6){const _0x1961db=a55_0x2532,_0x4921c2=_0x3596da();while(!![]){try{const _0x206ab8=parseInt(_0x1961db(0x157))/0x1*(parseInt(_0x1961db(0x150))/0x2)+-parseInt(_0x1961db(0x154))/0x3+-parseInt(_0x1961db(0x15e))/0x4*(parseInt(_0x1961db(0x156))/0x5)+parseInt(_0x1961db(0x152))/0x6*(-parseInt(_0x1961db(0x158))/0x7)+-parseInt(_0x1961db(0x153))/0x8+parseInt(_0x1961db(0x15b))/0x9+parseInt(_0x1961db(0x15a))/0xa*(parseInt(_0x1961db(0x15f))/0xb);if(_0x206ab8===_0x5eb3c6)break;else _0x4921c2['push'](_0x4921c2['shift']());}catch(_0x4e78e3){_0x4921c2['push'](_0x4921c2['shift']());}}}(a55_0x4fa6,0xf3f76));import{createProfileCache}from'../utils/global-cache.js';const connectionCache=createProfileCache(a55_0x338c43(0x155),a55_0x338c43(0x15d));function a55_0x4fa6(){const _0x16fb0c=['9004597kEaNyh','now','80690CxsxSt','17062713UBLtaO','clear','core/connection-cache','128ZNrbjQ','1771aboqxT','write','read','94OPEcil','connections','6yEPZzF','1360024qZfZkZ','1943565bGDbBH','connections-{profile}.json','203310eMODsp','25739kOSHsn'];a55_0x4fa6=function(){return _0x16fb0c;};return a55_0x4fa6();}export function loadCachedConnections(_0x55da9c){const _0x3d40c4=a55_0x338c43,_0x32c43b=connectionCache[_0x3d40c4(0x161)](_0x55da9c);return _0x32c43b?.[_0x3d40c4(0x151)]??null;}export function saveCachedConnections(_0x25947f,_0x397836){const _0x5f2421=a55_0x338c43;connectionCache[_0x5f2421(0x160)](_0x25947f,{'connections':_0x397836,'cachedAt':Date[_0x5f2421(0x159)]()});}function a55_0x2532(_0x558abe,_0x3bc231){_0x558abe=_0x558abe-0x150;const _0x4fa6b2=a55_0x4fa6();let _0x253261=_0x4fa6b2[_0x558abe];return _0x253261;}export function clearConnectionCache(_0x991f3b){const _0x549a38=a55_0x338c43;connectionCache[_0x549a38(0x15c)](_0x991f3b);}
1
+ const a55_0x1388e6=a55_0x4d53;function a55_0x5bd1(){const _0x3cfce8=['2275760rudZAv','44313yDdeVk','831456zLNQmb','795100ZZvKnF','read','10yCTrsk','40RtwcYK','22wBrPcx','4669119EEtHzV','8ggSlrT','5082417NHHSED','now','core/connection-cache','write','connections','215636dUZCxf','connections-{profile}.json'];a55_0x5bd1=function(){return _0x3cfce8;};return a55_0x5bd1();}(function(_0x19b5df,_0x1e766e){const _0x35f89d=a55_0x4d53,_0x5c7a7b=_0x19b5df();while(!![]){try{const _0x58dcd8=parseInt(_0x35f89d(0x152))/0x1+parseInt(_0x35f89d(0x15a))/0x2*(parseInt(_0x35f89d(0x155))/0x3)+-parseInt(_0x35f89d(0x157))/0x4+-parseInt(_0x35f89d(0x159))/0x5*(parseInt(_0x35f89d(0x156))/0x6)+-parseInt(_0x35f89d(0x15c))/0x7+-parseInt(_0x35f89d(0x15d))/0x8*(-parseInt(_0x35f89d(0x15e))/0x9)+-parseInt(_0x35f89d(0x154))/0xa*(-parseInt(_0x35f89d(0x15b))/0xb);if(_0x58dcd8===_0x1e766e)break;else _0x5c7a7b['push'](_0x5c7a7b['shift']());}catch(_0x278a71){_0x5c7a7b['push'](_0x5c7a7b['shift']());}}}(a55_0x5bd1,0x5eb89));import{createProfileCache}from'../utils/global-cache.js';const connectionCache=createProfileCache(a55_0x1388e6(0x153),a55_0x1388e6(0x160));function a55_0x4d53(_0x11b0f7,_0x3ea538){_0x11b0f7=_0x11b0f7-0x152;const _0x5bd1ce=a55_0x5bd1();let _0x4d53d5=_0x5bd1ce[_0x11b0f7];return _0x4d53d5;}export function loadCachedConnections(_0x4d6931){const _0x37476f=a55_0x1388e6,_0xeba317=connectionCache[_0x37476f(0x158)](_0x4d6931);return _0xeba317?.[_0x37476f(0x162)]??null;}export function saveCachedConnections(_0x14ce16,_0x364387){const _0x397f82=a55_0x1388e6;connectionCache[_0x397f82(0x161)](_0x14ce16,{'connections':_0x364387,'cachedAt':Date[_0x397f82(0x15f)]()});}export function clearConnectionCache(_0x2b715c){connectionCache['clear'](_0x2b715c);}
@@ -1 +1 @@
1
- const a56_0x973f98=a56_0x5efe;(function(_0x5687b0,_0x4243a6){const _0x3f0aca=a56_0x5efe,_0x41852b=_0x5687b0();while(!![]){try{const _0x3501c8=parseInt(_0x3f0aca(0xe5))/0x1*(parseInt(_0x3f0aca(0xec))/0x2)+-parseInt(_0x3f0aca(0xdb))/0x3*(parseInt(_0x3f0aca(0xf7))/0x4)+-parseInt(_0x3f0aca(0xf6))/0x5+parseInt(_0x3f0aca(0xdc))/0x6+parseInt(_0x3f0aca(0xf1))/0x7+parseInt(_0x3f0aca(0xe8))/0x8+-parseInt(_0x3f0aca(0xe2))/0x9*(parseInt(_0x3f0aca(0xea))/0xa);if(_0x3501c8===_0x4243a6)break;else _0x41852b['push'](_0x41852b['shift']());}catch(_0x4e9caf){_0x41852b['push'](_0x41852b['shift']());}}}(a56_0x4a6f,0x44204));import a56_0x299095 from'prompts';export const DEFAULT_DISPLAY_LIMIT=0x28;function a56_0x5efe(_0x4809d1,_0x112a66){_0x4809d1=_0x4809d1-0xdb;const _0x4a6f3c=a56_0x4a6f();let _0x5efe23=_0x4a6f3c[_0x4809d1];return _0x5efe23;}export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x10c45a,_0x582b3d){const _0x4b2572=a56_0x5efe;if(_0x10c45a===undefined)return _0x582b3d;if(typeof _0x10c45a===_0x4b2572(0xe3))return _0x10c45a;return parseInt(_0x10c45a,0xa);}export const STANDARD_SITE_CHOICES=[{'title':a56_0x973f98(0xe7),'value':a56_0x973f98(0xe1)},{'title':'jp\x20\x20\x20-\x20Japan','value':a56_0x973f98(0xdd)},{'title':'eu\x20\x20\x20-\x20Europe','value':a56_0x973f98(0xe9)},{'title':'ap02\x20-\x20Korea','value':a56_0x973f98(0xeb)}];export function buildSiteChoices(_0x1dc3ae){const _0xf8c626=a56_0x973f98,_0x5ac797=[...STANDARD_SITE_CHOICES];let _0x33efd1=_0x5ac797[_0xf8c626(0xf9)](_0x1d17c6=>_0x1d17c6[_0xf8c626(0xde)]===_0x1dc3ae);return _0x33efd1===-0x1&&_0x1dc3ae!=='us01'&&(_0x5ac797[_0xf8c626(0xef)]({'title':_0x1dc3ae,'value':_0x1dc3ae}),_0x33efd1=_0x5ac797['length']-0x1),_0x5ac797[_0xf8c626(0xef)]({'title':_0xf8c626(0xee),'value':_0xf8c626(0xdf)}),{'choices':_0x5ac797,'initialIndex':_0x33efd1>=0x0?_0x33efd1:0x0};}export async function promptSiteSelection(_0x5282e2,_0x2c2b4e,_0x487df8='Cancelled'){const _0x3adb96=a56_0x973f98,{choices:_0x9a6337,initialIndex:_0x16b65e}=buildSiteChoices(_0x5282e2),_0x98d100=_0x2c2b4e?_0x3adb96(0xf4)+_0x2c2b4e+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x15e190=await a56_0x299095({'type':_0x3adb96(0xf3),'name':'site','message':_0x98d100,'choices':_0x9a6337,'initial':_0x16b65e});if(!_0x15e190['site'])return console[_0x3adb96(0xf2)]('\x0a'+_0x487df8),null;if(_0x15e190[_0x3adb96(0xf8)]!==_0x3adb96(0xdf))return _0x15e190[_0x3adb96(0xf8)];const _0x53d3d2=await a56_0x299095({'type':_0x3adb96(0xf0),'name':'customSite','message':_0x3adb96(0xe6),'initial':_0x3adb96(0xe1),'validate':_0x412425=>{const _0x329f9e=_0x3adb96;if(!_0x412425||!_0x412425[_0x329f9e(0xf5)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/[_0x329f9e(0xed)](_0x412425[_0x329f9e(0xf5)]()))return _0x329f9e(0xe4);return!![];}});if(!_0x53d3d2['customSite'])return console['log']('\x0a'+_0x487df8),null;return _0x53d3d2[_0x3adb96(0xe0)];}function a56_0x4a6f(){const _0x27b173=['number','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','25237wQSxRs','Enter\x20site\x20name:','us\x20\x20\x20-\x20United\x20States','400072uyLmgN','eu01','130070cevMZU','ap02','26llWwpX','test','Enter\x20custom\x20site','push','text','2032338GeLBSI','log','select','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','trim','1372860vRvWMO','62272GqGHRS','site','findIndex','57RhmbsK','1163946gCBpCA','ap01','value','other','customSite','us01','9RYMzkf'];a56_0x4a6f=function(){return _0x27b173;};return a56_0x4a6f();}
1
+ const a56_0x2e2705=a56_0x3c8f;(function(_0x384566,_0x2ad936){const _0x5f4837=a56_0x3c8f,_0x38f78c=_0x384566();while(!![]){try{const _0x480508=-parseInt(_0x5f4837(0x144))/0x1+-parseInt(_0x5f4837(0x147))/0x2*(parseInt(_0x5f4837(0x13a))/0x3)+-parseInt(_0x5f4837(0x139))/0x4*(parseInt(_0x5f4837(0x134))/0x5)+-parseInt(_0x5f4837(0x12f))/0x6+parseInt(_0x5f4837(0x13f))/0x7+parseInt(_0x5f4837(0x130))/0x8*(-parseInt(_0x5f4837(0x132))/0x9)+parseInt(_0x5f4837(0x13e))/0xa;if(_0x480508===_0x2ad936)break;else _0x38f78c['push'](_0x38f78c['shift']());}catch(_0x363566){_0x38f78c['push'](_0x38f78c['shift']());}}}(a56_0x4e83,0x9e84d));import a56_0x3a99d2 from'prompts';export const DEFAULT_DISPLAY_LIMIT=0x28;function a56_0x3c8f(_0x2f7876,_0x39b7ea){_0x2f7876=_0x2f7876-0x126;const _0x4e83e3=a56_0x4e83();let _0x3c8fca=_0x4e83e3[_0x2f7876];return _0x3c8fca;}export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;function a56_0x4e83(){const _0x2d09e4=['value','294252LEXQXl','16UBNkNp','ap01','1351170aemGpe','Cancelled','145fxDwiy','findIndex','number','Enter\x20site\x20name:','length','140396ERvtWx','500427TcfFAz','trim','us01','us\x20\x20\x20-\x20United\x20States','31948490LgaCmq','1943298eunUzd','jp\x20\x20\x20-\x20Japan','text','ap02\x20-\x20Korea','customSite','955570miJcEm','log','site','6LQiCvz','Site\x20name\x20cannot\x20be\x20empty','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','ap02','other','push','test','Select\x20your\x20Treasure\x20Data\x20site:'];a56_0x4e83=function(){return _0x2d09e4;};return a56_0x4e83();}export function resolveLimit(_0x5d0599,_0x27955b){const _0x24d47f=a56_0x3c8f;if(_0x5d0599===undefined)return _0x27955b;if(typeof _0x5d0599===_0x24d47f(0x136))return _0x5d0599;return parseInt(_0x5d0599,0xa);}export const STANDARD_SITE_CHOICES=[{'title':a56_0x2e2705(0x13d),'value':a56_0x2e2705(0x13c)},{'title':a56_0x2e2705(0x140),'value':a56_0x2e2705(0x131)},{'title':'eu\x20\x20\x20-\x20Europe','value':'eu01'},{'title':a56_0x2e2705(0x142),'value':a56_0x2e2705(0x129)}];export function buildSiteChoices(_0x3aec24){const _0x276742=a56_0x2e2705,_0x564084=[...STANDARD_SITE_CHOICES];let _0x16f00a=_0x564084[_0x276742(0x135)](_0x2bf98d=>_0x2bf98d[_0x276742(0x12e)]===_0x3aec24);return _0x16f00a===-0x1&&_0x3aec24!==_0x276742(0x13c)&&(_0x564084[_0x276742(0x12b)]({'title':_0x3aec24,'value':_0x3aec24}),_0x16f00a=_0x564084[_0x276742(0x138)]-0x1),_0x564084['push']({'title':'Enter\x20custom\x20site','value':_0x276742(0x12a)}),{'choices':_0x564084,'initialIndex':_0x16f00a>=0x0?_0x16f00a:0x0};}export async function promptSiteSelection(_0x43f387,_0x538cb7,_0x22818b=a56_0x2e2705(0x133)){const _0x4aba1d=a56_0x2e2705,{choices:_0x42ef3f,initialIndex:_0x569288}=buildSiteChoices(_0x43f387),_0x24c474=_0x538cb7?_0x4aba1d(0x127)+_0x538cb7+'):':_0x4aba1d(0x12d),_0x5f28f9=await a56_0x3a99d2({'type':'select','name':_0x4aba1d(0x146),'message':_0x24c474,'choices':_0x42ef3f,'initial':_0x569288});if(!_0x5f28f9['site'])return console['log']('\x0a'+_0x22818b),null;if(_0x5f28f9['site']!==_0x4aba1d(0x12a))return _0x5f28f9[_0x4aba1d(0x146)];const _0x21e234=await a56_0x3a99d2({'type':_0x4aba1d(0x141),'name':'customSite','message':_0x4aba1d(0x137),'initial':_0x4aba1d(0x13c),'validate':_0x1abdf0=>{const _0x3ae642=_0x4aba1d;if(!_0x1abdf0||!_0x1abdf0[_0x3ae642(0x13b)]())return _0x3ae642(0x126);if(!/^[a-z0-9-]+$/[_0x3ae642(0x12c)](_0x1abdf0[_0x3ae642(0x13b)]()))return _0x3ae642(0x128);return!![];}});if(!_0x21e234[_0x4aba1d(0x143)])return console[_0x4aba1d(0x145)]('\x0a'+_0x22818b),null;return _0x21e234[_0x4aba1d(0x143)];}
@@ -1 +1 @@
1
- (function(_0x5019d1,_0x539f75){const _0x48e076=a57_0x51c0,_0x430f58=_0x5019d1();while(!![]){try{const _0x377d23=-parseInt(_0x48e076(0x180))/0x1+parseInt(_0x48e076(0x16f))/0x2*(parseInt(_0x48e076(0x17e))/0x3)+parseInt(_0x48e076(0x181))/0x4*(parseInt(_0x48e076(0x17f))/0x5)+parseInt(_0x48e076(0x179))/0x6*(-parseInt(_0x48e076(0x177))/0x7)+parseInt(_0x48e076(0x176))/0x8*(-parseInt(_0x48e076(0x170))/0x9)+-parseInt(_0x48e076(0x17c))/0xa+-parseInt(_0x48e076(0x173))/0xb*(-parseInt(_0x48e076(0x17a))/0xc);if(_0x377d23===_0x539f75)break;else _0x430f58['push'](_0x430f58['shift']());}catch(_0x47dc41){_0x430f58['push'](_0x430f58['shift']());}}}(a57_0x5b87,0x2f094));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function a57_0x51c0(_0x319f6c,_0x55154a){_0x319f6c=_0x319f6c-0x16f;const _0x5b8752=a57_0x5b87();let _0x51c0f6=_0x5b8752[_0x319f6c];return _0x51c0f6;}function getCacheKey(_0x2bc335,_0x923c19){const _0x337dd8=a57_0x51c0,_0x2cf3e5=_0x2bc335||'__default_site__',_0x535b29=_0x923c19||_0x337dd8(0x171);return _0x2cf3e5+':'+_0x535b29;}function a57_0x5b87(){const _0x5099e7=['2528460lUMhEE','loadedAt','5334sniiPK','2055mGdDam','60168kodNBz','752qWneQl','344ShrKDR','96318XgvXVx','__default_profile__','now','565444XMeISP','apiKey','delete','272wEmRIh','116599DrIsHN','set','84XNvDwk','168TYZboD','get'];a57_0x5b87=function(){return _0x5099e7;};return a57_0x5b87();}export function getCachedCredential(_0x4fb9b8,_0x164879){const _0x1fd4dc=a57_0x51c0,_0x446518=getCacheKey(_0x4fb9b8,_0x164879),_0x470d7a=cache[_0x1fd4dc(0x17b)](_0x446518);if(!_0x470d7a)return null;if(Date[_0x1fd4dc(0x172)]()-_0x470d7a[_0x1fd4dc(0x17d)]>CACHE_TTL_MS)return cache[_0x1fd4dc(0x175)](_0x446518),null;return _0x470d7a[_0x1fd4dc(0x174)];}export function setCachedCredential(_0x11ab6a,_0x506133,_0xcf14f1){const _0x1d747f=a57_0x51c0,_0x24b9b5=getCacheKey(_0x506133,_0xcf14f1);cache[_0x1d747f(0x178)](_0x24b9b5,{'apiKey':_0x11ab6a,'loadedAt':Date['now']()});}export function clearCredentialCache(){cache['clear']();}export function clearCachedCredential(_0x50b53f,_0xbb34a9){const _0x37db23=getCacheKey(_0x50b53f,_0xbb34a9);cache['delete'](_0x37db23);}
1
+ (function(_0x28a119,_0x42164a){const _0xcdead6=a57_0x5beb,_0x1dc266=_0x28a119();while(!![]){try{const _0x394482=parseInt(_0xcdead6(0x1f3))/0x1*(parseInt(_0xcdead6(0x1eb))/0x2)+parseInt(_0xcdead6(0x1f1))/0x3*(-parseInt(_0xcdead6(0x1e4))/0x4)+-parseInt(_0xcdead6(0x1f2))/0x5*(-parseInt(_0xcdead6(0x1f4))/0x6)+parseInt(_0xcdead6(0x1e3))/0x7+-parseInt(_0xcdead6(0x1ec))/0x8+-parseInt(_0xcdead6(0x1ea))/0x9*(parseInt(_0xcdead6(0x1f5))/0xa)+parseInt(_0xcdead6(0x1e5))/0xb;if(_0x394482===_0x42164a)break;else _0x1dc266['push'](_0x1dc266['shift']());}catch(_0x1a90ad){_0x1dc266['push'](_0x1dc266['shift']());}}}(a57_0x34d0,0x6800b));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x13d34b,_0x53be0d){const _0x3ee6d8=a57_0x5beb,_0x2f1203=_0x13d34b||_0x3ee6d8(0x1ef),_0x228384=_0x53be0d||_0x3ee6d8(0x1f0);return _0x2f1203+':'+_0x228384;}export function getCachedCredential(_0x4c3181,_0x34fa01){const _0x2d0152=a57_0x5beb,_0x4fb78a=getCacheKey(_0x4c3181,_0x34fa01),_0x352910=cache[_0x2d0152(0x1e7)](_0x4fb78a);if(!_0x352910)return null;if(Date[_0x2d0152(0x1ed)]()-_0x352910[_0x2d0152(0x1e6)]>CACHE_TTL_MS)return cache[_0x2d0152(0x1e9)](_0x4fb78a),null;return _0x352910['apiKey'];}export function setCachedCredential(_0x3c2d6f,_0x2f8aa2,_0x4e65e5){const _0x47172c=a57_0x5beb,_0xc7a52d=getCacheKey(_0x2f8aa2,_0x4e65e5);cache[_0x47172c(0x1e8)](_0xc7a52d,{'apiKey':_0x3c2d6f,'loadedAt':Date[_0x47172c(0x1ed)]()});}function a57_0x34d0(){const _0x4ea053=['delete','27LUtgZN','2vyjzuP','2836296pnDUcD','now','clear','__default_site__','__default_profile__','27465mPIeNf','885dCNymT','56873FeCMFu','13116UIaOwP','2172990uPhJYz','2797942zxChLK','292TdKuGU','13829673yWWges','loadedAt','get','set'];a57_0x34d0=function(){return _0x4ea053;};return a57_0x34d0();}export function clearCredentialCache(){const _0x4f5ba7=a57_0x5beb;cache[_0x4f5ba7(0x1ee)]();}function a57_0x5beb(_0x5d27a1,_0xeda740){_0x5d27a1=_0x5d27a1-0x1e3;const _0x34d079=a57_0x34d0();let _0x5beba9=_0x34d079[_0x5d27a1];return _0x5beba9;}export function clearCachedCredential(_0x2b0975,_0xdce9cf){const _0x5c33fe=a57_0x5beb,_0x25e741=getCacheKey(_0x2b0975,_0xdce9cf);cache[_0x5c33fe(0x1e9)](_0x25e741);}
@@ -1 +1 @@
1
- const a58_0x59b653=a58_0x38f1;(function(_0x3bdb90,_0x5f3626){const _0x5057d6=a58_0x38f1,_0x50dcf3=_0x3bdb90();while(!![]){try{const _0x3ff56a=parseInt(_0x5057d6(0x118))/0x1+parseInt(_0x5057d6(0x115))/0x2+-parseInt(_0x5057d6(0x11e))/0x3*(-parseInt(_0x5057d6(0x127))/0x4)+-parseInt(_0x5057d6(0x153))/0x5*(-parseInt(_0x5057d6(0x11f))/0x6)+parseInt(_0x5057d6(0x120))/0x7+parseInt(_0x5057d6(0x117))/0x8*(-parseInt(_0x5057d6(0x137))/0x9)+parseInt(_0x5057d6(0x13c))/0xa*(-parseInt(_0x5057d6(0x138))/0xb);if(_0x3ff56a===_0x5f3626)break;else _0x50dcf3['push'](_0x50dcf3['shift']());}catch(_0x355701){_0x50dcf3['push'](_0x50dcf3['shift']());}}}(a58_0x1b34,0xeda25));import{resolveSite,getAPIKey,getAccessToken,getAPIKeyAsync,getConfigDir}from'./config.js';import{getOAuthTokens}from'./oauth-keychain.js';import{loadSessionContext,getSessionID}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';function a58_0x1b34(){const _0x504ad5=['getSource','tdx.json','not\x20set','854739XZgasE','297Xgmulm','(using\x20session:\x20','project','existsSync','754990DeFHUh','Profile\x20Credentials','profiles','profileCredentials','config','loadGlobalConfig','accessToken','llm_project','createAsync','segmentPath','none','Global\x20Credentials','verbose','Project','CLI\x20flag:\x20--','session','database','llm_agent','replace','configFiles','global','site','[configuration\x20files]','114470LqHKzL','Session','us01','parent_segment','sessionId','readFileSync','layers','proxy','parentSegment','llmProject','apiKey','workflow_project','.env','bold','dim','displayWithSources','1422342yiblaA','Profile','120XkgvTq','1250048HfkkUE','join','.json','[context]','getParameters','cyan','39QusVEF','342oRHwHY','7770868EUfcMB','log','profile:\x20','assign','segment_path','display','resolveAPIKeyAsync','18488uyyjmb','string','logLevel','injectIntoOptions','default','cliFlags','profileSource','profile','Global','activeProfile','workflowProject','INFO','llmAgent'];a58_0x1b34=function(){return _0x504ad5;};return a58_0x1b34();}function a58_0x38f1(_0xf0fc6,_0x5df4c6){_0xf0fc6=_0xf0fc6-0x113;const _0x1b3484=a58_0x1b34();let _0x38f17a=_0x1b3484[_0xf0fc6];return _0x38f17a;}import{loadProfile}from'./profile.js';import{LogLevel}from'../utils/logger/index.js';import*as a58_0x346684 from'node:fs';import*as a58_0x5d6fb2 from'node:path';import a58_0x2bb306 from'chalk';export class GlobalContext{[a58_0x59b653(0x151)];[a58_0x59b653(0x14c)];[a58_0x59b653(0x156)];[a58_0x59b653(0x124)];[a58_0x59b653(0x143)];['llm_agent'];[a58_0x59b653(0x15e)];['apiKey'];['accessToken'];[a58_0x59b653(0x15a)];[a58_0x59b653(0x148)];['logLevel'];[a58_0x59b653(0x12e)];[a58_0x59b653(0x12d)]=null;[a58_0x59b653(0x159)];['activeProfile'];[a58_0x59b653(0x157)];['configFiles'];constructor(_0x5020ef){const _0x3b77ab=a58_0x59b653;this['sessionId']=getSessionID(_0x5020ef['session']);const _0x50a6d6=loadSessionContext(_0x5020ef['session']),_0x144d1b=loadProjectConfig(),_0x5f5bed=this['loadGlobalConfig']();if(_0x5020ef[_0x3b77ab(0x12e)])this[_0x3b77ab(0x130)]=_0x5020ef[_0x3b77ab(0x12e)],this[_0x3b77ab(0x12d)]='cli';else{if(_0x50a6d6?.[_0x3b77ab(0x12e)])this['activeProfile']=_0x50a6d6[_0x3b77ab(0x12e)],this[_0x3b77ab(0x12d)]=_0x3b77ab(0x14b);else{if(_0x5f5bed['profile'])this[_0x3b77ab(0x130)]=_0x5f5bed['profile'],this[_0x3b77ab(0x12d)]=_0x3b77ab(0x140);else process.env.TDX_PROFILE?(this[_0x3b77ab(0x130)]=process.env.TDX_PROFILE,this['profileSource']='env'):(this[_0x3b77ab(0x130)]=null,this[_0x3b77ab(0x12d)]=null);}}const _0x3fb021=this['activeProfile']?loadProfile(this[_0x3b77ab(0x130)]):null,_0x2bf7bd=_0x5c0cd4=>{const _0x578874=_0x3b77ab;if(!_0x5c0cd4)return{};const _0x27ccf6=_0x5c0cd4,_0x2c32d5={};for(const [_0x4b8c50,_0x421cf2]of Object['entries'](_0x27ccf6)){typeof _0x421cf2===_0x578874(0x128)&&(_0x2c32d5[_0x4b8c50]=_0x421cf2);}return _0x2c32d5;},_0xee9692={},_0x2b7df0=(_0x5b406f,_0x357b38,_0x6e746b)=>{if(!_0x5b406f)return![];if(_0x6e746b&&_0x5b406f===_0x6e746b)return![];const _0x5064c0=_0x50a6d6,_0x411d13=_0x144d1b,_0x4bcdcd=_0x3fb021?.['config'],_0x5aca66=_0x5f5bed,_0x4ff758=_0x5064c0?.[_0x357b38],_0x166a8f=_0x411d13?.[_0x357b38],_0x4bae39=_0x4bcdcd?.[_0x357b38],_0x2cb32a=_0x5aca66[_0x357b38];return _0x5b406f!==_0x4ff758&&_0x5b406f!==_0x166a8f&&_0x5b406f!==_0x4bae39&&_0x5b406f!==_0x2cb32a;},_0x289917=[{'optionKey':'site','contextKey':'site','defaultValue':'us01'},{'optionKey':_0x3b77ab(0x14c),'contextKey':_0x3b77ab(0x14c)},{'optionKey':_0x3b77ab(0x15b),'contextKey':_0x3b77ab(0x156)},{'optionKey':_0x3b77ab(0x15c),'contextKey':_0x3b77ab(0x143)},{'optionKey':_0x3b77ab(0x133),'contextKey':_0x3b77ab(0x14d)},{'optionKey':'profile','contextKey':_0x3b77ab(0x12e)}];for(const {optionKey:_0x5a0756,contextKey:_0x308302,defaultValue:_0x59c8c4}of _0x289917){const _0x158d7e=_0x5020ef[_0x5a0756];_0x2b7df0(_0x158d7e,_0x308302,_0x59c8c4)&&(_0xee9692[_0x308302]=_0x158d7e);}this[_0x3b77ab(0x159)]={'cliFlags':_0xee9692,'session':_0x2bf7bd(_0x50a6d6),'project':_0x2bf7bd(_0x144d1b),'profile':_0x2bf7bd(_0x3fb021?.[_0x3b77ab(0x140)]),'global':_0x2bf7bd(_0x5f5bed)};const _0x1a0338={...this[_0x3b77ab(0x159)]['global'],...this[_0x3b77ab(0x159)][_0x3b77ab(0x12e)],...this[_0x3b77ab(0x159)][_0x3b77ab(0x13a)]};process.env.TDX_SITE&&!this[_0x3b77ab(0x159)][_0x3b77ab(0x14b)][_0x3b77ab(0x151)]&&!this['layers'][_0x3b77ab(0x12c)][_0x3b77ab(0x151)]&&(_0x1a0338['site']=process.env.TDX_SITE);Object[_0x3b77ab(0x123)](_0x1a0338,this[_0x3b77ab(0x159)]['session']),Object[_0x3b77ab(0x123)](_0x1a0338,this[_0x3b77ab(0x159)]['cliFlags']);const _0x8baa27=_0x1a0338[_0x3b77ab(0x151)]||_0x3b77ab(0x155);this[_0x3b77ab(0x151)]=resolveSite(_0x8baa27),this[_0x3b77ab(0x14c)]=_0x1a0338[_0x3b77ab(0x14c)],this[_0x3b77ab(0x156)]=_0x1a0338[_0x3b77ab(0x156)],this[_0x3b77ab(0x124)]=_0x1a0338['segment_path'],this[_0x3b77ab(0x143)]=_0x1a0338[_0x3b77ab(0x143)],this['llm_agent']=_0x1a0338[_0x3b77ab(0x14d)],this[_0x3b77ab(0x15e)]=_0x1a0338[_0x3b77ab(0x15e)],this[_0x3b77ab(0x148)]=_0x5020ef[_0x3b77ab(0x148)]||![],this[_0x3b77ab(0x129)]=_0x5020ef[_0x3b77ab(0x129)]??LogLevel[_0x3b77ab(0x132)],this['profile']=this['activeProfile']||undefined,this[_0x3b77ab(0x142)]=getAccessToken(this['activeProfile']||undefined),this[_0x3b77ab(0x15d)]=getAPIKey(this['activeProfile']||undefined);const _0x18ab96=typeof _0x5f5bed[_0x3b77ab(0x15a)]===_0x3b77ab(0x128)?_0x5f5bed['proxy']:undefined;this[_0x3b77ab(0x15a)]=_0x18ab96||process.env.HTTPS_PROXY||process.env.HTTP_PROXY;const _0x1a49fc=getConfigDir(),_0x2e3488=a58_0x5d6fb2[_0x3b77ab(0x119)](_0x1a49fc,'sessions',this[_0x3b77ab(0x157)]+_0x3b77ab(0x11a)),_0x180bc0=findProjectConfigPath(),_0x157af8=a58_0x5d6fb2['join'](_0x1a49fc,_0x3b77ab(0x135)),_0x36ae83=a58_0x5d6fb2['join'](_0x1a49fc,'.env');let _0x5af897=null,_0xd1b9cd=null;this[_0x3b77ab(0x130)]&&(_0x5af897=a58_0x5d6fb2[_0x3b77ab(0x119)](_0x1a49fc,'profiles',this[_0x3b77ab(0x130)],_0x3b77ab(0x135)),_0xd1b9cd=a58_0x5d6fb2[_0x3b77ab(0x119)](_0x1a49fc,_0x3b77ab(0x13e),this['activeProfile'],_0x3b77ab(0x15f))),this['configFiles']={'session':a58_0x346684['existsSync'](_0x2e3488)?_0x2e3488:null,'project':_0x180bc0,'profile':_0x5af897&&a58_0x346684['existsSync'](_0x5af897)?_0x5af897:null,'profileCredentials':_0xd1b9cd&&a58_0x346684[_0x3b77ab(0x13b)](_0xd1b9cd)?_0xd1b9cd:null,'global':a58_0x346684[_0x3b77ab(0x13b)](_0x157af8)?_0x157af8:null,'globalCredentials':a58_0x346684[_0x3b77ab(0x13b)](_0x36ae83)?_0x36ae83:null};}[a58_0x59b653(0x134)](_0x2608a0,_0x1929f7){const _0x55288b=a58_0x59b653;if(!_0x1929f7)return _0x55288b(0x136);const _0x462d40=_0x1929f7;if(this[_0x55288b(0x159)][_0x55288b(0x12c)][_0x2608a0]===_0x462d40){if(_0x2608a0==='site'&&_0x462d40==='us01'&&!this[_0x55288b(0x159)][_0x55288b(0x14b)]['site']&&!this[_0x55288b(0x159)][_0x55288b(0x13a)][_0x55288b(0x151)]&&!this[_0x55288b(0x159)][_0x55288b(0x12e)]['site']&&!this[_0x55288b(0x159)][_0x55288b(0x150)][_0x55288b(0x151)])return'default';return _0x55288b(0x14a)+_0x2608a0[_0x55288b(0x14e)](/_/g,'-');}if(this[_0x55288b(0x159)][_0x55288b(0x14b)][_0x2608a0]===_0x462d40)return'session';if(this['layers'][_0x55288b(0x13a)][_0x2608a0]===_0x462d40)return _0x55288b(0x13a);if(this[_0x55288b(0x159)][_0x55288b(0x12e)][_0x2608a0]===_0x462d40)return _0x55288b(0x122)+this['activeProfile'];if(this[_0x55288b(0x159)][_0x55288b(0x150)][_0x2608a0]===_0x462d40)return _0x55288b(0x150);return _0x55288b(0x12b);}[a58_0x59b653(0x141)](){const _0x15b0ab=a58_0x59b653,_0x2dd548=a58_0x5d6fb2['join'](getConfigDir(),_0x15b0ab(0x135));if(!a58_0x346684[_0x15b0ab(0x13b)](_0x2dd548))return{};try{const _0x19245f=a58_0x346684[_0x15b0ab(0x158)](_0x2dd548,'utf-8');return JSON['parse'](_0x19245f);}catch{return{};}}[a58_0x59b653(0x12a)](_0x564fa6){const _0x543fd3=a58_0x59b653;_0x564fa6[_0x543fd3(0x151)]=this['site'],!_0x564fa6[_0x543fd3(0x14c)]&&this[_0x543fd3(0x14c)]&&(_0x564fa6['database']=this[_0x543fd3(0x14c)]),!_0x564fa6[_0x543fd3(0x15b)]&&this['parent_segment']&&(_0x564fa6[_0x543fd3(0x15b)]=this[_0x543fd3(0x156)]),!_0x564fa6[_0x543fd3(0x145)]&&this[_0x543fd3(0x124)]&&(_0x564fa6[_0x543fd3(0x145)]=this[_0x543fd3(0x124)]),!_0x564fa6[_0x543fd3(0x15c)]&&this['llm_project']&&(_0x564fa6[_0x543fd3(0x15c)]=this[_0x543fd3(0x143)]),!_0x564fa6[_0x543fd3(0x133)]&&this[_0x543fd3(0x14d)]&&(_0x564fa6[_0x543fd3(0x133)]=this[_0x543fd3(0x14d)]),!_0x564fa6[_0x543fd3(0x131)]&&this[_0x543fd3(0x15e)]&&(_0x564fa6['workflowProject']=this['workflow_project']);}['getParameters'](){const _0xf12cb5=a58_0x59b653;return[{'key':_0xf12cb5(0x151),'value':this[_0xf12cb5(0x151)]},{'key':_0xf12cb5(0x14c),'value':this['database']},{'key':_0xf12cb5(0x156),'value':this[_0xf12cb5(0x156)]},{'key':_0xf12cb5(0x124),'value':this[_0xf12cb5(0x124)]},{'key':_0xf12cb5(0x143),'value':this[_0xf12cb5(0x143)]},{'key':'llm_agent','value':this['llm_agent']},{'key':'workflow_project','value':this[_0xf12cb5(0x15e)]},{'key':_0xf12cb5(0x12e),'value':this[_0xf12cb5(0x130)]||undefined}];}[a58_0x59b653(0x125)](){const _0x27e5ba=a58_0x59b653;console['log'](a58_0x2bb306[_0x27e5ba(0x160)](_0x27e5ba(0x11b)));for(const {key:_0x40f79e,value:_0x2a2921}of this[_0x27e5ba(0x11c)]()){_0x2a2921&&console[_0x27e5ba(0x121)](a58_0x2bb306[_0x27e5ba(0x11d)](_0x40f79e)+':\x20'+_0x2a2921);}}[a58_0x59b653(0x114)](){const _0x170874=a58_0x59b653;console[_0x170874(0x121)](a58_0x2bb306[_0x170874(0x160)](_0x170874(0x11b)));for(const {key:_0x3c6e1e,value:_0x4751c9}of this['getParameters']()){if(_0x4751c9){const _0x2af61d=_0x3c6e1e===_0x170874(0x12e)?'(active)':'('+this[_0x170874(0x134)](_0x3c6e1e,_0x4751c9)+')';console['log'](a58_0x2bb306[_0x170874(0x11d)](_0x3c6e1e)+':\x20'+_0x4751c9+'\x20'+a58_0x2bb306[_0x170874(0x113)](_0x2af61d));}}console[_0x170874(0x121)]('\x0a'+a58_0x2bb306[_0x170874(0x160)](_0x170874(0x152)));const _0x5edd57=[{'label':_0x170874(0x154),'path':this[_0x170874(0x14f)][_0x170874(0x14b)],'extra':'(session:\x20'+this[_0x170874(0x157)]+')'},{'label':_0x170874(0x149),'path':this[_0x170874(0x14f)][_0x170874(0x13a)]},{'label':_0x170874(0x116),'path':this[_0x170874(0x14f)][_0x170874(0x12e)]},{'label':_0x170874(0x13d),'path':this[_0x170874(0x14f)][_0x170874(0x13f)]},{'label':_0x170874(0x12f),'path':this[_0x170874(0x14f)][_0x170874(0x150)]},{'label':_0x170874(0x147),'path':this[_0x170874(0x14f)]['globalCredentials']}];for(const {label:_0x4f523f,path:_0x10c5c4,extra:_0x761a2b}of _0x5edd57){if(_0x10c5c4)console['log'](a58_0x2bb306[_0x170874(0x11d)](_0x4f523f)+':\x20'+_0x10c5c4+'\x20'+a58_0x2bb306['green']('✓')+(_0x761a2b?'\x20'+a58_0x2bb306[_0x170874(0x113)](_0x761a2b):''));else{if(_0x4f523f===_0x170874(0x154))console['log'](a58_0x2bb306[_0x170874(0x11d)](_0x4f523f)+':\x20'+a58_0x2bb306['dim'](_0x170874(0x146))+'\x20'+a58_0x2bb306[_0x170874(0x113)](_0x170874(0x139)+this['sessionId']+')'));else(_0x4f523f===_0x170874(0x149)||_0x4f523f===_0x170874(0x12f))&&console[_0x170874(0x121)](a58_0x2bb306[_0x170874(0x11d)](_0x4f523f)+':\x20'+a58_0x2bb306['dim']('none'));}}}async['resolveAPIKeyAsync'](){const _0x44b06f=a58_0x59b653;if(!this[_0x44b06f(0x142)]){const _0x1a571a=await getOAuthTokens(this[_0x44b06f(0x130)]||undefined);if(_0x1a571a)return this[_0x44b06f(0x142)]=_0x1a571a['access_token'],undefined;}return this['apiKey']=await getAPIKeyAsync(this[_0x44b06f(0x151)],this[_0x44b06f(0x130)]||undefined),this['apiKey'];}static async[a58_0x59b653(0x144)](_0x5aaebb){const _0x4dc122=a58_0x59b653,_0x4dd324=new GlobalContext(_0x5aaebb);return await _0x4dd324[_0x4dc122(0x126)](),_0x4dd324;}}
1
+ function a58_0x3948(_0xc38a02,_0x471551){_0xc38a02=_0xc38a02-0x75;const _0x237f7e=a58_0x237f();let _0x394885=_0x237f7e[_0xc38a02];return _0x394885;}const a58_0x312f8d=a58_0x3948;(function(_0x24658b,_0x1879a6){const _0x47e7a3=a58_0x3948,_0x46e33c=_0x24658b();while(!![]){try{const _0x3a7703=parseInt(_0x47e7a3(0x96))/0x1+parseInt(_0x47e7a3(0x80))/0x2*(parseInt(_0x47e7a3(0x7f))/0x3)+parseInt(_0x47e7a3(0x87))/0x4*(parseInt(_0x47e7a3(0xa3))/0x5)+-parseInt(_0x47e7a3(0x88))/0x6+-parseInt(_0x47e7a3(0xa2))/0x7*(parseInt(_0x47e7a3(0xb1))/0x8)+-parseInt(_0x47e7a3(0x8c))/0x9+-parseInt(_0x47e7a3(0x79))/0xa*(-parseInt(_0x47e7a3(0x78))/0xb);if(_0x3a7703===_0x1879a6)break;else _0x46e33c['push'](_0x46e33c['shift']());}catch(_0x3ff484){_0x46e33c['push'](_0x46e33c['shift']());}}}(a58_0x237f,0x96a0e));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_0x6370b8 from'node:fs';function a58_0x237f(){const _0x1ac0a0=['profile','216JMQoiA','[context]','(session:\x20','session','site','Global','log','.env','profileCredentials','.json','assign','cyan','tdx.json','bold','existsSync','workflowProject','configFiles','cli','getParameters','cliFlags','profile:\x20','823559HdoTad','150irOLUL','display','verbose','green','segmentPath','displayWithSources','222GCMyfh','29902ydFIUt','profiles','layers','injectIntoOptions','workflow_project','llmAgent','database','176JtllXX','5272902bIoGOP','INFO','llmProject','getSource','5605371PPgQTn','Profile\x20Credentials','(using\x20session:\x20','accessToken','segment_path','parentSegment','dim','join','llm_project','resolveAPIKeyAsync','625328CRuZSB','Project','activeProfile','string','not\x20set','profileSource','proxy','sessionId','globalCredentials','parent_segment','env','Session','227283wUJQXs','15970TxZFUQ','apiKey','config','llm_agent','entries','global','us01','loadGlobalConfig','logLevel','parse','replace','project','readFileSync'];a58_0x237f=function(){return _0x1ac0a0;};return a58_0x237f();}import*as a58_0x2e434f from'node:path';import a58_0x558f5a from'chalk';export class GlobalContext{[a58_0x312f8d(0xb5)];[a58_0x312f8d(0x86)];[a58_0x312f8d(0x9f)];[a58_0x312f8d(0x90)];[a58_0x312f8d(0x94)];[a58_0x312f8d(0xa6)];[a58_0x312f8d(0x84)];[a58_0x312f8d(0xa4)];[a58_0x312f8d(0x8f)];[a58_0x312f8d(0x9c)];[a58_0x312f8d(0x7b)];[a58_0x312f8d(0xab)];[a58_0x312f8d(0xb0)];[a58_0x312f8d(0x9b)]=null;['layers'];[a58_0x312f8d(0x98)];['sessionId'];[a58_0x312f8d(0xc1)];constructor(_0x309cae){const _0x4427ba=a58_0x312f8d;this['sessionId']=getSessionID(_0x309cae[_0x4427ba(0xb4)]);const _0x297e55=loadSessionContext(_0x309cae[_0x4427ba(0xb4)]),_0x2469dd=loadProjectConfig(),_0x3a9e1d=this['loadGlobalConfig']();if(_0x309cae[_0x4427ba(0xb0)])this['activeProfile']=_0x309cae[_0x4427ba(0xb0)],this[_0x4427ba(0x9b)]=_0x4427ba(0xc2);else{if(_0x297e55?.['profile'])this[_0x4427ba(0x98)]=_0x297e55[_0x4427ba(0xb0)],this[_0x4427ba(0x9b)]=_0x4427ba(0xb4);else{if(_0x3a9e1d[_0x4427ba(0xb0)])this['activeProfile']=_0x3a9e1d['profile'],this['profileSource']=_0x4427ba(0xa5);else process.env.TDX_PROFILE?(this[_0x4427ba(0x98)]=process.env.TDX_PROFILE,this['profileSource']=_0x4427ba(0xa0)):(this[_0x4427ba(0x98)]=null,this[_0x4427ba(0x9b)]=null);}}const _0x5cee3b=this[_0x4427ba(0x98)]?loadProfile(this['activeProfile']):null,_0x3d3486=_0x18fdf4=>{const _0x4741b4=_0x4427ba;if(!_0x18fdf4)return{};const _0x1cb809=_0x18fdf4,_0x57c8d7={};for(const [_0x1c4f48,_0xa3fd33]of Object[_0x4741b4(0xa7)](_0x1cb809)){typeof _0xa3fd33===_0x4741b4(0x99)&&(_0x57c8d7[_0x1c4f48]=_0xa3fd33);}return _0x57c8d7;},_0xb6b211={},_0x3006e2=(_0x23f094,_0x3c00e1,_0x511422)=>{const _0x1d0df9=_0x4427ba;if(!_0x23f094)return![];if(_0x511422&&_0x23f094===_0x511422)return![];const _0x32a9d1=_0x297e55,_0x2a9269=_0x2469dd,_0x337449=_0x5cee3b?.[_0x1d0df9(0xa5)],_0x2fccca=_0x3a9e1d,_0x225747=_0x32a9d1?.[_0x3c00e1],_0x1978c3=_0x2a9269?.[_0x3c00e1],_0x5014e6=_0x337449?.[_0x3c00e1],_0x708c11=_0x2fccca[_0x3c00e1];return _0x23f094!==_0x225747&&_0x23f094!==_0x1978c3&&_0x23f094!==_0x5014e6&&_0x23f094!==_0x708c11;},_0x21cfd6=[{'optionKey':_0x4427ba(0xb5),'contextKey':_0x4427ba(0xb5),'defaultValue':'us01'},{'optionKey':'database','contextKey':'database'},{'optionKey':_0x4427ba(0x91),'contextKey':_0x4427ba(0x9f)},{'optionKey':'llmProject','contextKey':_0x4427ba(0x94)},{'optionKey':'llmAgent','contextKey':'llm_agent'},{'optionKey':_0x4427ba(0xb0),'contextKey':_0x4427ba(0xb0)}];for(const {optionKey:_0x587b58,contextKey:_0x36fa2f,defaultValue:_0x46487c}of _0x21cfd6){const _0x32dad7=_0x309cae[_0x587b58];_0x3006e2(_0x32dad7,_0x36fa2f,_0x46487c)&&(_0xb6b211[_0x36fa2f]=_0x32dad7);}this[_0x4427ba(0x82)]={'cliFlags':_0xb6b211,'session':_0x3d3486(_0x297e55),'project':_0x3d3486(_0x2469dd),'profile':_0x3d3486(_0x5cee3b?.['config']),'global':_0x3d3486(_0x3a9e1d)};const _0x1b4160={...this['layers']['global'],...this[_0x4427ba(0x82)][_0x4427ba(0xb0)],...this[_0x4427ba(0x82)][_0x4427ba(0xae)]};process.env.TDX_SITE&&!this[_0x4427ba(0x82)]['session'][_0x4427ba(0xb5)]&&!this['layers']['cliFlags']['site']&&(_0x1b4160['site']=process.env.TDX_SITE);Object[_0x4427ba(0xbb)](_0x1b4160,this['layers'][_0x4427ba(0xb4)]),Object[_0x4427ba(0xbb)](_0x1b4160,this[_0x4427ba(0x82)][_0x4427ba(0x76)]);const _0x21a3b9=_0x1b4160['site']||_0x4427ba(0xa9);this['site']=resolveSite(_0x21a3b9),this['database']=_0x1b4160[_0x4427ba(0x86)],this[_0x4427ba(0x9f)]=_0x1b4160[_0x4427ba(0x9f)],this[_0x4427ba(0x90)]=_0x1b4160['segment_path'],this[_0x4427ba(0x94)]=_0x1b4160['llm_project'],this[_0x4427ba(0xa6)]=_0x1b4160[_0x4427ba(0xa6)],this[_0x4427ba(0x84)]=_0x1b4160[_0x4427ba(0x84)],this[_0x4427ba(0x7b)]=_0x309cae['verbose']||![],this[_0x4427ba(0xab)]=_0x309cae[_0x4427ba(0xab)]??LogLevel[_0x4427ba(0x89)],this[_0x4427ba(0xb0)]=this[_0x4427ba(0x98)]||undefined,this[_0x4427ba(0x8f)]=getAccessToken(this[_0x4427ba(0x98)]||undefined),this[_0x4427ba(0xa4)]=getAPIKey(this[_0x4427ba(0x98)]||undefined);const _0x5e167c=typeof _0x3a9e1d[_0x4427ba(0x9c)]===_0x4427ba(0x99)?_0x3a9e1d[_0x4427ba(0x9c)]:undefined;this[_0x4427ba(0x9c)]=_0x5e167c||process.env.HTTPS_PROXY||process.env.HTTP_PROXY;const _0x3bc475=getConfigDir(),_0x476e55=a58_0x2e434f['join'](_0x3bc475,'sessions',this[_0x4427ba(0x9d)]+_0x4427ba(0xba)),_0x2c1409=findProjectConfigPath(),_0x55f86c=a58_0x2e434f[_0x4427ba(0x93)](_0x3bc475,_0x4427ba(0xbd)),_0x3a05d2=a58_0x2e434f[_0x4427ba(0x93)](_0x3bc475,_0x4427ba(0xb8));let _0x45b57d=null,_0x29ab9c=null;this[_0x4427ba(0x98)]&&(_0x45b57d=a58_0x2e434f[_0x4427ba(0x93)](_0x3bc475,_0x4427ba(0x81),this[_0x4427ba(0x98)],_0x4427ba(0xbd)),_0x29ab9c=a58_0x2e434f[_0x4427ba(0x93)](_0x3bc475,_0x4427ba(0x81),this[_0x4427ba(0x98)],_0x4427ba(0xb8))),this[_0x4427ba(0xc1)]={'session':a58_0x6370b8[_0x4427ba(0xbf)](_0x476e55)?_0x476e55:null,'project':_0x2c1409,'profile':_0x45b57d&&a58_0x6370b8[_0x4427ba(0xbf)](_0x45b57d)?_0x45b57d:null,'profileCredentials':_0x29ab9c&&a58_0x6370b8[_0x4427ba(0xbf)](_0x29ab9c)?_0x29ab9c:null,'global':a58_0x6370b8['existsSync'](_0x55f86c)?_0x55f86c:null,'globalCredentials':a58_0x6370b8[_0x4427ba(0xbf)](_0x3a05d2)?_0x3a05d2:null};}[a58_0x312f8d(0x8b)](_0x3b532c,_0xb70958){const _0x5b9e6f=a58_0x312f8d;if(!_0xb70958)return _0x5b9e6f(0x9a);const _0x590cdd=_0xb70958;if(this[_0x5b9e6f(0x82)][_0x5b9e6f(0x76)][_0x3b532c]===_0x590cdd){if(_0x3b532c===_0x5b9e6f(0xb5)&&_0x590cdd===_0x5b9e6f(0xa9)&&!this['layers'][_0x5b9e6f(0xb4)][_0x5b9e6f(0xb5)]&&!this[_0x5b9e6f(0x82)]['project']['site']&&!this[_0x5b9e6f(0x82)][_0x5b9e6f(0xb0)][_0x5b9e6f(0xb5)]&&!this['layers'][_0x5b9e6f(0xa8)][_0x5b9e6f(0xb5)])return'default';return'CLI\x20flag:\x20--'+_0x3b532c[_0x5b9e6f(0xad)](/_/g,'-');}if(this[_0x5b9e6f(0x82)][_0x5b9e6f(0xb4)][_0x3b532c]===_0x590cdd)return _0x5b9e6f(0xb4);if(this[_0x5b9e6f(0x82)]['project'][_0x3b532c]===_0x590cdd)return _0x5b9e6f(0xae);if(this[_0x5b9e6f(0x82)][_0x5b9e6f(0xb0)][_0x3b532c]===_0x590cdd)return _0x5b9e6f(0x77)+this[_0x5b9e6f(0x98)];if(this['layers'][_0x5b9e6f(0xa8)][_0x3b532c]===_0x590cdd)return _0x5b9e6f(0xa8);return'default';}[a58_0x312f8d(0xaa)](){const _0x5d1f54=a58_0x312f8d,_0x52199f=a58_0x2e434f['join'](getConfigDir(),_0x5d1f54(0xbd));if(!a58_0x6370b8[_0x5d1f54(0xbf)](_0x52199f))return{};try{const _0x35cf48=a58_0x6370b8[_0x5d1f54(0xaf)](_0x52199f,'utf-8');return JSON[_0x5d1f54(0xac)](_0x35cf48);}catch{return{};}}[a58_0x312f8d(0x83)](_0x17f2c9){const _0x52ad5b=a58_0x312f8d;_0x17f2c9[_0x52ad5b(0xb5)]=this[_0x52ad5b(0xb5)],!_0x17f2c9[_0x52ad5b(0x86)]&&this[_0x52ad5b(0x86)]&&(_0x17f2c9['database']=this['database']),!_0x17f2c9[_0x52ad5b(0x91)]&&this[_0x52ad5b(0x9f)]&&(_0x17f2c9[_0x52ad5b(0x91)]=this[_0x52ad5b(0x9f)]),!_0x17f2c9[_0x52ad5b(0x7d)]&&this[_0x52ad5b(0x90)]&&(_0x17f2c9[_0x52ad5b(0x7d)]=this['segment_path']),!_0x17f2c9[_0x52ad5b(0x8a)]&&this[_0x52ad5b(0x94)]&&(_0x17f2c9['llmProject']=this[_0x52ad5b(0x94)]),!_0x17f2c9[_0x52ad5b(0x85)]&&this['llm_agent']&&(_0x17f2c9[_0x52ad5b(0x85)]=this[_0x52ad5b(0xa6)]),!_0x17f2c9[_0x52ad5b(0xc0)]&&this['workflow_project']&&(_0x17f2c9[_0x52ad5b(0xc0)]=this[_0x52ad5b(0x84)]);}['getParameters'](){const _0xb8449f=a58_0x312f8d;return[{'key':_0xb8449f(0xb5),'value':this['site']},{'key':_0xb8449f(0x86),'value':this[_0xb8449f(0x86)]},{'key':_0xb8449f(0x9f),'value':this['parent_segment']},{'key':_0xb8449f(0x90),'value':this[_0xb8449f(0x90)]},{'key':_0xb8449f(0x94),'value':this[_0xb8449f(0x94)]},{'key':'llm_agent','value':this[_0xb8449f(0xa6)]},{'key':_0xb8449f(0x84),'value':this[_0xb8449f(0x84)]},{'key':'profile','value':this[_0xb8449f(0x98)]||undefined}];}[a58_0x312f8d(0x7a)](){const _0x4ae0d3=a58_0x312f8d;console[_0x4ae0d3(0xb7)](a58_0x558f5a[_0x4ae0d3(0xbe)](_0x4ae0d3(0xb2)));for(const {key:_0x2ea4da,value:_0x50e405}of this[_0x4ae0d3(0x75)]()){_0x50e405&&console[_0x4ae0d3(0xb7)](a58_0x558f5a[_0x4ae0d3(0xbc)](_0x2ea4da)+':\x20'+_0x50e405);}}[a58_0x312f8d(0x7e)](){const _0x7bbf7e=a58_0x312f8d;console[_0x7bbf7e(0xb7)](a58_0x558f5a[_0x7bbf7e(0xbe)](_0x7bbf7e(0xb2)));for(const {key:_0x3672d4,value:_0x227d86}of this[_0x7bbf7e(0x75)]()){if(_0x227d86){const _0x52e169=_0x3672d4===_0x7bbf7e(0xb0)?'(active)':'('+this[_0x7bbf7e(0x8b)](_0x3672d4,_0x227d86)+')';console[_0x7bbf7e(0xb7)](a58_0x558f5a[_0x7bbf7e(0xbc)](_0x3672d4)+':\x20'+_0x227d86+'\x20'+a58_0x558f5a[_0x7bbf7e(0x92)](_0x52e169));}}console[_0x7bbf7e(0xb7)]('\x0a'+a58_0x558f5a[_0x7bbf7e(0xbe)]('[configuration\x20files]'));const _0x3b8db2=[{'label':'Session','path':this[_0x7bbf7e(0xc1)]['session'],'extra':_0x7bbf7e(0xb3)+this[_0x7bbf7e(0x9d)]+')'},{'label':'Project','path':this[_0x7bbf7e(0xc1)][_0x7bbf7e(0xae)]},{'label':'Profile','path':this[_0x7bbf7e(0xc1)]['profile']},{'label':_0x7bbf7e(0x8d),'path':this[_0x7bbf7e(0xc1)][_0x7bbf7e(0xb9)]},{'label':'Global','path':this[_0x7bbf7e(0xc1)]['global']},{'label':'Global\x20Credentials','path':this[_0x7bbf7e(0xc1)][_0x7bbf7e(0x9e)]}];for(const {label:_0x48f421,path:_0x41310f,extra:_0x2064a7}of _0x3b8db2){if(_0x41310f)console[_0x7bbf7e(0xb7)](a58_0x558f5a[_0x7bbf7e(0xbc)](_0x48f421)+':\x20'+_0x41310f+'\x20'+a58_0x558f5a[_0x7bbf7e(0x7c)]('✓')+(_0x2064a7?'\x20'+a58_0x558f5a[_0x7bbf7e(0x92)](_0x2064a7):''));else{if(_0x48f421===_0x7bbf7e(0xa1))console['log'](a58_0x558f5a[_0x7bbf7e(0xbc)](_0x48f421)+':\x20'+a58_0x558f5a[_0x7bbf7e(0x92)]('none')+'\x20'+a58_0x558f5a[_0x7bbf7e(0x92)](_0x7bbf7e(0x8e)+this['sessionId']+')'));else(_0x48f421===_0x7bbf7e(0x97)||_0x48f421===_0x7bbf7e(0xb6))&&console[_0x7bbf7e(0xb7)](a58_0x558f5a['cyan'](_0x48f421)+':\x20'+a58_0x558f5a[_0x7bbf7e(0x92)]('none'));}}}async[a58_0x312f8d(0x95)](){const _0x3d8110=a58_0x312f8d;if(!this[_0x3d8110(0x8f)]){const _0x20a0ca=await getOAuthTokens(this[_0x3d8110(0x98)]||undefined);if(_0x20a0ca)return this[_0x3d8110(0x8f)]=_0x20a0ca['access_token'],undefined;}return this['apiKey']=await getAPIKeyAsync(this[_0x3d8110(0xb5)],this[_0x3d8110(0x98)]||undefined),this[_0x3d8110(0xa4)];}static async['createAsync'](_0x47bdd1){const _0x3c2013=a58_0x312f8d,_0x573ce5=new GlobalContext(_0x47bdd1);return await _0x573ce5[_0x3c2013(0x95)](),_0x573ce5;}}
@@ -1 +1 @@
1
- const a59_0xa7ebf0=a59_0x29ed;(function(_0x3b26e8,_0x5e068e){const _0x27ffee=a59_0x29ed,_0x12fa9c=_0x3b26e8();while(!![]){try{const _0x448b98=parseInt(_0x27ffee(0x13f))/0x1*(parseInt(_0x27ffee(0x13d))/0x2)+parseInt(_0x27ffee(0x137))/0x3*(parseInt(_0x27ffee(0x123))/0x4)+parseInt(_0x27ffee(0x13b))/0x5*(parseInt(_0x27ffee(0x147))/0x6)+parseInt(_0x27ffee(0x13a))/0x7+parseInt(_0x27ffee(0x131))/0x8*(parseInt(_0x27ffee(0x140))/0x9)+parseInt(_0x27ffee(0x130))/0xa*(-parseInt(_0x27ffee(0x129))/0xb)+-parseInt(_0x27ffee(0x12a))/0xc;if(_0x448b98===_0x5e068e)break;else _0x12fa9c['push'](_0x12fa9c['shift']());}catch(_0x430034){_0x12fa9c['push'](_0x12fa9c['shift']());}}}(a59_0x4079,0xdac10));const SERVICE_NAME=a59_0xa7ebf0(0x128);let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x1dd4f2=a59_0xa7ebf0;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x397f66=await import(_0x1dd4f2(0x124));return EntryClass=_0x397f66['Entry'],EntryClass;}catch(_0x8332a7){return keyringLoadError=_0x8332a7 instanceof Error?_0x8332a7:new Error(String(_0x8332a7)),null;}}function getAccountName(_0x28607b){const _0x507c37=a59_0xa7ebf0,_0x2ddc1c=_0x28607b||'';return _0x507c37(0x144)+_0x2ddc1c+_0x507c37(0x142);}function a59_0x29ed(_0x2fcffa,_0x123fb4){_0x2fcffa=_0x2fcffa-0x122;const _0x407900=a59_0x4079();let _0x29ed6c=_0x407900[_0x2fcffa];return _0x29ed6c;}function a59_0x4079(){const _0x342177=['-25300','includes','tdx','11UpPUop','21632688xwwShA','getPassword','reason','cannot\x20find','unavailable','-25293','213830LyzMam','373264jxmAGu','__keychain_test__','success','setPassword','no\x20matching\x20entry','not\x20found','23145GISlTl','System\x20keychain\x20is\x20not\x20available','message','6989311DSuOVa','20545XeTXdd','Keychain\x20access\x20denied.\x20The\x20API\x20key\x20exists\x20but\x20cannot\x20be\x20accessed.\x20Try\x20running\x20\x22tdx\x20auth\x20setup\x22\x20to\x20re-authenticate,\x20or\x20check\x20your\x20keychain\x20permissions\x20for\x20\x22tdx\x22.','57658WbMgmD','restricted','9DZZnlX','126uJeyYY','error',':api_key','not_found','profile:','access_denied','toLowerCase','618YKRbqf','access','not\x20available','200eXWjse','@napi-rs/keyring','value'];a59_0x4079=function(){return _0x342177;};return a59_0x4079();}export async function getKeychainAPIKey(_0x3619d8){const _0x2e3e9e=a59_0xa7ebf0,_0x2c4fbe=await getKeychainAPIKeyWithStatus(_0x3619d8);if(_0x2c4fbe[_0x2e3e9e(0x133)])return _0x2c4fbe[_0x2e3e9e(0x125)];return _0x2c4fbe[_0x2e3e9e(0x12c)]==='access_denied'&&console[_0x2e3e9e(0x141)]('Warning:\x20'+_0x2c4fbe[_0x2e3e9e(0x139)]),null;}export async function getKeychainAPIKeyWithStatus(_0x1b6228){const _0x3e974e=a59_0xa7ebf0;try{const _0x3225fe=await getEntryClass();if(!_0x3225fe)return{'success':![],'reason':_0x3e974e(0x12e)};const _0x37e885=getAccountName(_0x1b6228),_0x57cf60=new _0x3225fe(SERVICE_NAME,_0x37e885),_0x280403=_0x57cf60[_0x3e974e(0x12b)]();if(_0x280403)return{'success':!![],'value':_0x280403};return{'success':![],'reason':'not_found'};}catch(_0x5db451){const _0x1bac3c=_0x5db451 instanceof Error?_0x5db451[_0x3e974e(0x139)]:String(_0x5db451);if(_0x1bac3c['includes'](_0x3e974e(0x126))||_0x1bac3c[_0x3e974e(0x146)]()['includes']('could\x20not\x20be\x20found')||_0x1bac3c[_0x3e974e(0x146)]()[_0x3e974e(0x127)](_0x3e974e(0x136))||_0x1bac3c[_0x3e974e(0x146)]()['includes'](_0x3e974e(0x135)))return{'success':![],'reason':_0x3e974e(0x143)};if(_0x1bac3c[_0x3e974e(0x127)](_0x3e974e(0x12f))||_0x1bac3c['toLowerCase']()[_0x3e974e(0x127)](_0x3e974e(0x13e))||_0x1bac3c[_0x3e974e(0x146)]()[_0x3e974e(0x127)](_0x3e974e(0x148)))return{'success':![],'reason':_0x3e974e(0x145),'message':_0x3e974e(0x13c)};return{'success':![],'reason':_0x3e974e(0x12e),'message':_0x1bac3c};}}export async function saveKeychainAPIKey(_0x522257,_0x56f811){const _0x2a3409=a59_0xa7ebf0,_0x223d5b=await getEntryClass();if(!_0x223d5b)throw new Error(_0x2a3409(0x138));const _0x2996bb=getAccountName(_0x56f811),_0x7c0165=new _0x223d5b(SERVICE_NAME,_0x2996bb);_0x7c0165[_0x2a3409(0x134)](_0x522257);}export async function deleteKeychainAPIKey(_0x335a52){try{const _0x225262=await getEntryClass();if(!_0x225262)return![];const _0x4c4e5a=getAccountName(_0x335a52),_0x2dcf20=new _0x225262(SERVICE_NAME,_0x4c4e5a);return _0x2dcf20['deleteCredential'](),!![];}catch{return![];}}export async function isKeychainAvailable(){const _0xe87a53=a59_0xa7ebf0;try{const _0x414c9a=await getEntryClass();if(!_0x414c9a)return![];const _0x1fec2a=new _0x414c9a(SERVICE_NAME,_0xe87a53(0x132));return _0x1fec2a[_0xe87a53(0x12b)](),!![];}catch(_0x387303){const _0x3e1189=_0x387303 instanceof Error?_0x387303[_0xe87a53(0x139)][_0xe87a53(0x146)]():'';if(_0x3e1189[_0xe87a53(0x127)](_0xe87a53(0x122))||_0x3e1189[_0xe87a53(0x127)]('not\x20supported')||_0x3e1189['includes'](_0xe87a53(0x12d)))return![];return!![];}}
1
+ (function(_0x3172a8,_0x405d86){const _0x2cfd45=a59_0x7be4,_0x11a93d=_0x3172a8();while(!![]){try{const _0x23caa5=-parseInt(_0x2cfd45(0x172))/0x1+-parseInt(_0x2cfd45(0x185))/0x2*(parseInt(_0x2cfd45(0x183))/0x3)+parseInt(_0x2cfd45(0x17d))/0x4*(parseInt(_0x2cfd45(0x17b))/0x5)+-parseInt(_0x2cfd45(0x164))/0x6*(parseInt(_0x2cfd45(0x176))/0x7)+-parseInt(_0x2cfd45(0x173))/0x8+-parseInt(_0x2cfd45(0x17f))/0x9+parseInt(_0x2cfd45(0x184))/0xa;if(_0x23caa5===_0x405d86)break;else _0x11a93d['push'](_0x11a93d['shift']());}catch(_0x5172c7){_0x11a93d['push'](_0x11a93d['shift']());}}}(a59_0x1874,0x50682));const SERVICE_NAME='tdx';let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x778a64=a59_0x7be4;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x3df36b=await import(_0x778a64(0x16b));return EntryClass=_0x3df36b[_0x778a64(0x180)],EntryClass;}catch(_0x2fcd92){return keyringLoadError=_0x2fcd92 instanceof Error?_0x2fcd92:new Error(String(_0x2fcd92)),null;}}function getAccountName(_0x137f82){const _0x11bdf7=a59_0x7be4,_0x1513bf=_0x137f82||'';return _0x11bdf7(0x171)+_0x1513bf+':api_key';}function a59_0x1874(){const _0x500937=['-25300','restricted','49525bnEXDG','not\x20available','16mzLTXb','not\x20supported','1362177BAAjKe','Entry','__keychain_test__','-25293','2742ekwpiS','23139660dkhlGT','1218lrvSqU','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.','System\x20keychain\x20is\x20not\x20available','could\x20not\x20be\x20found','144jHWYQl','not_found','unavailable','toLowerCase','getPassword','message','setPassword','@napi-rs/keyring','access','includes','error','access_denied','deleteCredential','profile:','300769NRMKkA','4981088eTXaHy','success','no\x20matching\x20entry','114583YCRLPY','Warning:\x20','value'];a59_0x1874=function(){return _0x500937;};return a59_0x1874();}export async function getKeychainAPIKey(_0x33751a){const _0x4e3879=a59_0x7be4,_0x340c8d=await getKeychainAPIKeyWithStatus(_0x33751a);if(_0x340c8d[_0x4e3879(0x174)])return _0x340c8d[_0x4e3879(0x178)];return _0x340c8d['reason']==='access_denied'&&console[_0x4e3879(0x16e)](_0x4e3879(0x177)+_0x340c8d[_0x4e3879(0x169)]),null;}export async function getKeychainAPIKeyWithStatus(_0x2fbcc2){const _0x4f71e6=a59_0x7be4;try{const _0x47ad2d=await getEntryClass();if(!_0x47ad2d)return{'success':![],'reason':_0x4f71e6(0x166)};const _0x1aa8a1=getAccountName(_0x2fbcc2),_0x45b412=new _0x47ad2d(SERVICE_NAME,_0x1aa8a1),_0x44f6d3=_0x45b412[_0x4f71e6(0x168)]();if(_0x44f6d3)return{'success':!![],'value':_0x44f6d3};return{'success':![],'reason':_0x4f71e6(0x165)};}catch(_0x5142d2){const _0xd1e418=_0x5142d2 instanceof Error?_0x5142d2[_0x4f71e6(0x169)]:String(_0x5142d2);if(_0xd1e418[_0x4f71e6(0x16d)](_0x4f71e6(0x179))||_0xd1e418['toLowerCase']()[_0x4f71e6(0x16d)](_0x4f71e6(0x163))||_0xd1e418['toLowerCase']()[_0x4f71e6(0x16d)]('not\x20found')||_0xd1e418['toLowerCase']()[_0x4f71e6(0x16d)](_0x4f71e6(0x175)))return{'success':![],'reason':'not_found'};if(_0xd1e418['includes'](_0x4f71e6(0x182))||_0xd1e418[_0x4f71e6(0x167)]()[_0x4f71e6(0x16d)](_0x4f71e6(0x17a))||_0xd1e418[_0x4f71e6(0x167)]()[_0x4f71e6(0x16d)](_0x4f71e6(0x16c)))return{'success':![],'reason':_0x4f71e6(0x16f),'message':_0x4f71e6(0x186)};return{'success':![],'reason':'unavailable','message':_0xd1e418};}}export async function saveKeychainAPIKey(_0x1cb66f,_0x2536db){const _0x3ae9ba=a59_0x7be4,_0x6a7f88=await getEntryClass();if(!_0x6a7f88)throw new Error(_0x3ae9ba(0x162));const _0x2cbcc9=getAccountName(_0x2536db),_0x2be3ab=new _0x6a7f88(SERVICE_NAME,_0x2cbcc9);_0x2be3ab[_0x3ae9ba(0x16a)](_0x1cb66f);}function a59_0x7be4(_0x52ab80,_0x5e6c5a){_0x52ab80=_0x52ab80-0x162;const _0x1874f1=a59_0x1874();let _0x7be4c6=_0x1874f1[_0x52ab80];return _0x7be4c6;}export async function deleteKeychainAPIKey(_0x4fc182){const _0x338430=a59_0x7be4;try{const _0x4c0df7=await getEntryClass();if(!_0x4c0df7)return![];const _0x11e881=getAccountName(_0x4fc182),_0x485e55=new _0x4c0df7(SERVICE_NAME,_0x11e881);return _0x485e55[_0x338430(0x170)](),!![];}catch{return![];}}export async function isKeychainAvailable(){const _0x1df240=a59_0x7be4;try{const _0x262fe3=await getEntryClass();if(!_0x262fe3)return![];const _0x45fbd6=new _0x262fe3(SERVICE_NAME,_0x1df240(0x181));return _0x45fbd6[_0x1df240(0x168)](),!![];}catch(_0x5e5844){const _0xc3e2b4=_0x5e5844 instanceof Error?_0x5e5844[_0x1df240(0x169)]['toLowerCase']():'';if(_0xc3e2b4[_0x1df240(0x16d)](_0x1df240(0x17c))||_0xc3e2b4[_0x1df240(0x16d)](_0x1df240(0x17e))||_0xc3e2b4[_0x1df240(0x16d)]('cannot\x20find'))return![];return!![];}}
@@ -1 +1 @@
1
- const a60_0x468e11=a60_0x3eac;function a60_0x820a(){const _0x1ff9e9=['5lrzvtl','16120cpCjfd','deleteCredential','System\x20keychain\x20is\x20not\x20available','531TLDIlB','setPassword','76400LfjzkT','tdx','196kZPbzz','51PynUnQ','getPassword','parse','4427296exWKGS','1078816ZopRmx','13hhWgnk','profile:','@napi-rs/keyring','Entry','stringify','27293964ehumWo','9097gqecmS','15940LrlmMI',':oauth_tokens','43980LlaLPU'];a60_0x820a=function(){return _0x1ff9e9;};return a60_0x820a();}(function(_0x38ce9d,_0x2a8752){const _0x4f300e=a60_0x3eac,_0x2dac7c=_0x38ce9d();while(!![]){try{const _0x3a403c=parseInt(_0x4f300e(0x96))/0x1+parseInt(_0x4f300e(0x86))/0x2*(-parseInt(_0x4f300e(0x92))/0x3)+-parseInt(_0x4f300e(0x95))/0x4*(-parseInt(_0x4f300e(0x89))/0x5)+parseInt(_0x4f300e(0x88))/0x6*(parseInt(_0x4f300e(0x91))/0x7)+-parseInt(_0x4f300e(0x8f))/0x8*(parseInt(_0x4f300e(0x8d))/0x9)+parseInt(_0x4f300e(0x8a))/0xa*(parseInt(_0x4f300e(0x85))/0xb)+-parseInt(_0x4f300e(0x84))/0xc*(parseInt(_0x4f300e(0x7f))/0xd);if(_0x3a403c===_0x2a8752)break;else _0x2dac7c['push'](_0x2dac7c['shift']());}catch(_0x5e9786){_0x2dac7c['push'](_0x2dac7c['shift']());}}}(a60_0x820a,0xb73e7));const SERVICE_NAME=a60_0x468e11(0x90);let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0xc2da97=a60_0x468e11;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x2ffd73=await import(_0xc2da97(0x81));return EntryClass=_0x2ffd73[_0xc2da97(0x82)],EntryClass;}catch(_0x257e1a){return keyringLoadError=_0x257e1a instanceof Error?_0x257e1a:new Error(String(_0x257e1a)),null;}}function getOAuthAccountName(_0x1cf029){const _0x4c4476=a60_0x468e11,_0x374e71=_0x1cf029||'';return _0x4c4476(0x80)+_0x374e71+_0x4c4476(0x87);}export async function saveOAuthTokens(_0x4beb94,_0x115a2b){const _0x44c61b=a60_0x468e11,_0x50c611=await getEntryClass();if(!_0x50c611)throw new Error(_0x44c61b(0x8c));const _0x520e33=getOAuthAccountName(_0x115a2b),_0x5ef876=new _0x50c611(SERVICE_NAME,_0x520e33);_0x5ef876[_0x44c61b(0x8e)](JSON[_0x44c61b(0x83)](_0x4beb94));}export async function getOAuthTokens(_0x176ecb){const _0x59f9e5=a60_0x468e11;try{const _0x4eb1cf=await getEntryClass();if(!_0x4eb1cf)return null;const _0x56badd=getOAuthAccountName(_0x176ecb),_0x4b0b27=new _0x4eb1cf(SERVICE_NAME,_0x56badd),_0x5a95b4=_0x4b0b27[_0x59f9e5(0x93)]();if(_0x5a95b4)return JSON[_0x59f9e5(0x94)](_0x5a95b4);return null;}catch{return null;}}function a60_0x3eac(_0xabfdf6,_0x1b06fd){_0xabfdf6=_0xabfdf6-0x7f;const _0x820a28=a60_0x820a();let _0x3eac1d=_0x820a28[_0xabfdf6];return _0x3eac1d;}export async function deleteOAuthTokens(_0x2e56de){const _0x13bdcb=a60_0x468e11;try{const _0x1f09a5=await getEntryClass();if(!_0x1f09a5)return![];const _0x595cd9=getOAuthAccountName(_0x2e56de),_0x461750=new _0x1f09a5(SERVICE_NAME,_0x595cd9);return _0x461750[_0x13bdcb(0x8b)](),!![];}catch{return![];}}
1
+ const a60_0x56d6c8=a60_0x14aa;(function(_0x19df55,_0x17f559){const _0x1f1e00=a60_0x14aa,_0x520c2c=_0x19df55();while(!![]){try{const _0x3703aa=parseInt(_0x1f1e00(0x1f4))/0x1*(-parseInt(_0x1f1e00(0x1f3))/0x2)+-parseInt(_0x1f1e00(0x1f0))/0x3+parseInt(_0x1f1e00(0x1ea))/0x4*(parseInt(_0x1f1e00(0x1fa))/0x5)+parseInt(_0x1f1e00(0x1f8))/0x6*(parseInt(_0x1f1e00(0x1e9))/0x7)+parseInt(_0x1f1e00(0x1f7))/0x8+parseInt(_0x1f1e00(0x1fc))/0x9*(parseInt(_0x1f1e00(0x1f5))/0xa)+-parseInt(_0x1f1e00(0x1f9))/0xb;if(_0x3703aa===_0x17f559)break;else _0x520c2c['push'](_0x520c2c['shift']());}catch(_0xfe0b7a){_0x520c2c['push'](_0x520c2c['shift']());}}}(a60_0x1acc,0xeafbc));function a60_0x14aa(_0x221b27,_0x32e9d4){_0x221b27=_0x221b27-0x1e9;const _0x1acc30=a60_0x1acc();let _0x14aa40=_0x1acc30[_0x221b27];return _0x14aa40;}function a60_0x1acc(){const _0x2777e5=['profile:','298137LTXMpM','6313352aDdNqT','setPassword','stringify','getPassword','@napi-rs/keyring','deleteCredential','2156694dSPSCc','System\x20keychain\x20is\x20not\x20available',':oauth_tokens','2dLmLZn','396403bgdTBZ','32990YsapsE','tdx','5192016qJNXCx','6oqZkNj','22653092gNDWIl','5LUypsq','parse','5094PvGDWm'];a60_0x1acc=function(){return _0x2777e5;};return a60_0x1acc();}const SERVICE_NAME=a60_0x56d6c8(0x1f6);let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x197085=a60_0x56d6c8;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x1ca5a2=await import(_0x197085(0x1ee));return EntryClass=_0x1ca5a2['Entry'],EntryClass;}catch(_0x1c7e1f){return keyringLoadError=_0x1c7e1f instanceof Error?_0x1c7e1f:new Error(String(_0x1c7e1f)),null;}}function getOAuthAccountName(_0x4a12a2){const _0x2adfeb=a60_0x56d6c8,_0xb4d6de=_0x4a12a2||'';return _0x2adfeb(0x1fd)+_0xb4d6de+_0x2adfeb(0x1f2);}export async function saveOAuthTokens(_0x397674,_0x4e1a9c){const _0x4b9429=a60_0x56d6c8,_0x56a789=await getEntryClass();if(!_0x56a789)throw new Error(_0x4b9429(0x1f1));const _0x11beaa=getOAuthAccountName(_0x4e1a9c),_0x487e6a=new _0x56a789(SERVICE_NAME,_0x11beaa);_0x487e6a[_0x4b9429(0x1eb)](JSON[_0x4b9429(0x1ec)](_0x397674));}export async function getOAuthTokens(_0x3405d7){const _0x163ae6=a60_0x56d6c8;try{const _0x1e5b72=await getEntryClass();if(!_0x1e5b72)return null;const _0x4fa9e7=getOAuthAccountName(_0x3405d7),_0x510896=new _0x1e5b72(SERVICE_NAME,_0x4fa9e7),_0x2862a5=_0x510896[_0x163ae6(0x1ed)]();if(_0x2862a5)return JSON[_0x163ae6(0x1fb)](_0x2862a5);return null;}catch{return null;}}export async function deleteOAuthTokens(_0x463d69){const _0x2f6470=a60_0x56d6c8;try{const _0xc6c350=await getEntryClass();if(!_0xc6c350)return![];const _0x414e3e=getOAuthAccountName(_0x463d69),_0x490bdc=new _0xc6c350(SERVICE_NAME,_0x414e3e);return _0x490bdc[_0x2f6470(0x1ef)](),!![];}catch{return![];}}
@@ -1 +1 @@
1
- const a61_0x47bd15=a61_0x4538;(function(_0x1d246b,_0xa4a66b){const _0x50e0bb=a61_0x4538,_0x3de1b5=_0x1d246b();while(!![]){try{const _0x4697d1=parseInt(_0x50e0bb(0x1c4))/0x1+-parseInt(_0x50e0bb(0x1c8))/0x2+parseInt(_0x50e0bb(0x1b5))/0x3*(parseInt(_0x50e0bb(0x1d5))/0x4)+parseInt(_0x50e0bb(0x1ec))/0x5+parseInt(_0x50e0bb(0x1b4))/0x6+parseInt(_0x50e0bb(0x1c7))/0x7+-parseInt(_0x50e0bb(0x1b9))/0x8*(parseInt(_0x50e0bb(0x1d3))/0x9);if(_0x4697d1===_0xa4a66b)break;else _0x3de1b5['push'](_0x3de1b5['shift']());}catch(_0x41d99f){_0x3de1b5['push'](_0x3de1b5['shift']());}}}(a61_0x28b7,0xdd09e));import*as a61_0xd29f34 from'node:crypto';import*as a61_0x25c0ac from'node:http';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';const OAUTH_SUPPORTED_SITES=new Set(['dev-us01','dev-eu01',a61_0x47bd15(0x1cf),'stg-ap01','stg-ap03']);export function isOAuthSupported(_0x439587){const _0x311d05=a61_0x47bd15;return OAUTH_SUPPORTED_SITES[_0x311d05(0x1bf)](_0x439587);}export const OAUTH_CALLBACK_PORT=0xaa4a;export const OAUTH_REDIRECT_URI=a61_0x47bd15(0x1e2)+OAUTH_CALLBACK_PORT+a61_0x47bd15(0x1c1);function a61_0x4538(_0x277ea2,_0x56bcea){_0x277ea2=_0x277ea2-0x1b0;const _0x28b72d=a61_0x28b7();let _0x453825=_0x28b72d[_0x277ea2];return _0x453825;}export function getOAuthClientId(){const _0x4b86ed=a61_0x47bd15;return process.env.TD_OAUTH_CLIENT_ID||_0x4b86ed(0x1c6);}function a61_0x28b7(){const _0x5c6157=['redirectUri','12241278gnJiAb','Failed\x20to\x20start\x20OAuth\x20callback\x20server:\x20','259196jVMDrA','url','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','response_type','update','http://127.0.0.1','S256','state','code_challenge_method','randomBytes','\x20is\x20already\x20in\x20use.\x20Stop\x20the\x20process\x20using\x20it\x20and\x20retry.','end','):\x20','http://localhost:','text/html','writeHead','POST','clientId','OAuth\x20token\x20request\x20failed\x20(','scope','error','pathname','hex','2308850ppamXY','toString','code_challenge','json','<html><body><h1>Authentication\x20Successful</h1><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','3562926VXFXoU','39Yafjsu','/oauth/authorize','waitForCallback','127.0.0.1','16PrOwak','close','codeChallenge','set','get','base64url','has','Not\x20Found','/oauth/callback','listen','code','968892pQmPhH','text','tdx','5555312PYXHqv','69656yqJLLP','status','sha256','searchParams','createServer','authorization_code','EADDRINUSE','stg-us01','createHash','OAuth\x20callback\x20received\x20an\x20error\x20or\x20missing\x20parameters'];a61_0x28b7=function(){return _0x5c6157;};return a61_0x28b7();}export function generatePKCEPair(){const _0x4b27b3=a61_0x47bd15,_0x238258=a61_0xd29f34[_0x4b27b3(0x1de)](0x20)[_0x4b27b3(0x1b0)](_0x4b27b3(0x1be)),_0x1a61f3=a61_0xd29f34[_0x4b27b3(0x1d0)](_0x4b27b3(0x1ca))[_0x4b27b3(0x1d9)](_0x238258)['digest'](_0x4b27b3(0x1be));return{'verifier':_0x238258,'challenge':_0x1a61f3};}export function buildAuthorizeURL(_0x4917d9,_0xf62f74){const _0x5d88f2=a61_0x47bd15,_0x2b5bf6=new URL(_0x5d88f2(0x1b6),_0x4917d9);return _0x2b5bf6[_0x5d88f2(0x1cb)][_0x5d88f2(0x1bc)](_0x5d88f2(0x1d8),'code'),_0x2b5bf6['searchParams'][_0x5d88f2(0x1bc)]('client_id',_0xf62f74[_0x5d88f2(0x1e6)]),_0x2b5bf6[_0x5d88f2(0x1cb)][_0x5d88f2(0x1bc)]('redirect_uri',_0xf62f74[_0x5d88f2(0x1d2)]),_0x2b5bf6['searchParams'][_0x5d88f2(0x1bc)](_0x5d88f2(0x1dc),_0xf62f74['state']),_0x2b5bf6[_0x5d88f2(0x1cb)][_0x5d88f2(0x1bc)](_0x5d88f2(0x1b1),_0xf62f74[_0x5d88f2(0x1bb)]),_0x2b5bf6['searchParams'][_0x5d88f2(0x1bc)](_0x5d88f2(0x1dd),_0x5d88f2(0x1db)),_0xf62f74[_0x5d88f2(0x1e8)]&&_0x2b5bf6[_0x5d88f2(0x1cb)]['set'](_0x5d88f2(0x1e8),_0xf62f74[_0x5d88f2(0x1e8)]),_0x2b5bf6[_0x5d88f2(0x1b0)]();}export async function postTokenRequest(_0x3f4493,_0x13975f){const _0x4502b0=a61_0x47bd15,_0x26e349=new URLSearchParams(_0x13975f)[_0x4502b0(0x1b0)](),_0x175d56=await fetch(_0x3f4493,{'method':_0x4502b0(0x1e5),'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x26e349});if(!_0x175d56['ok']){const _0x436113=await _0x175d56[_0x4502b0(0x1c5)]();throw new Error(_0x4502b0(0x1e7)+_0x175d56[_0x4502b0(0x1c9)]+_0x4502b0(0x1e1)+_0x436113);}return await _0x175d56[_0x4502b0(0x1b2)]();}export async function exchangeCodeForTokens(_0x22a32c,_0x254d04,_0x3c9fcf,_0x5c3797){const _0x592167=a61_0x47bd15,_0x59ca9c=_0x22a32c+'/oauth/token';return postTokenRequest(_0x59ca9c,{'grant_type':_0x592167(0x1cd),'client_id':getOAuthClientId(),'code':_0x254d04,'code_verifier':_0x3c9fcf,'redirect_uri':_0x5c3797});}export function startLocalCallbackServer(){const _0x1787f9=a61_0x47bd15;let _0x13abee,_0x81f05f;const _0x2db2fd=new Promise((_0xa4b2cf,_0x419979)=>{_0x13abee=_0xa4b2cf,_0x81f05f=_0x419979;}),_0x411156=a61_0x25c0ac[_0x1787f9(0x1cc)]((_0x460d68,_0x2c4302)=>{const _0x244b82=_0x1787f9,_0x28d44c=new URL(_0x460d68[_0x244b82(0x1d6)]||'/',_0x244b82(0x1da));if(_0x28d44c[_0x244b82(0x1ea)]!==_0x244b82(0x1c1)){_0x2c4302[_0x244b82(0x1e4)](0x194,{'Content-Type':'text/plain'}),_0x2c4302[_0x244b82(0x1e0)](_0x244b82(0x1c0));return;}const _0x3af771=_0x28d44c['searchParams'][_0x244b82(0x1bd)](_0x244b82(0x1c3)),_0x25cdc9=_0x28d44c[_0x244b82(0x1cb)][_0x244b82(0x1bd)]('state'),_0x45010d=_0x28d44c[_0x244b82(0x1cb)][_0x244b82(0x1bd)](_0x244b82(0x1e9));if(_0x45010d||!_0x3af771||!_0x25cdc9){_0x2c4302[_0x244b82(0x1e4)](0x190,{'Content-Type':_0x244b82(0x1e3)}),_0x2c4302[_0x244b82(0x1e0)]('<html><body><h1>Authentication\x20Failed</h1><p>An\x20error\x20occurred\x20during\x20authentication.\x20Please\x20close\x20this\x20window\x20and\x20try\x20again.</p></body></html>'),_0x81f05f(new Error(_0x244b82(0x1d1)));return;}_0x2c4302[_0x244b82(0x1e4)](0xc8,{'Content-Type':_0x244b82(0x1e3)}),_0x2c4302[_0x244b82(0x1e0)](_0x244b82(0x1b3)),_0x13abee({'code':_0x3af771,'state':_0x25cdc9});});_0x411156['on']('error',_0x4cb2da=>{const _0x88ee49=_0x1787f9;_0x4cb2da[_0x88ee49(0x1c3)]===_0x88ee49(0x1ce)?_0x81f05f(new Error('Port\x20'+OAUTH_CALLBACK_PORT+_0x88ee49(0x1df))):_0x81f05f(new Error(_0x88ee49(0x1d4)+_0x4cb2da['message']));}),_0x411156[_0x1787f9(0x1c2)](OAUTH_CALLBACK_PORT,_0x1787f9(0x1b8));const _0x3aa1ee=setTimeout(()=>{const _0x119696=_0x1787f9;_0x81f05f(new Error(_0x119696(0x1d7))),_0x411156['close']();},0x2*0x3c*0x3e8);return{'waitForCallback':()=>_0x2db2fd,'close':()=>{const _0x1ab735=_0x1787f9;clearTimeout(_0x3aa1ee),_0x411156[_0x1ab735(0x1ba)]();}};}export async function startOAuthFlow(_0x388d0b){const _0xbb40f4=a61_0x47bd15,_0x4349fd=getConsoleUrl(_0x388d0b),_0x5686ff=getOAuthClientId(),{verifier:_0x5ebba0,challenge:_0x39fec8}=generatePKCEPair(),_0x15ec2f=a61_0xd29f34['randomBytes'](0x10)['toString'](_0xbb40f4(0x1eb)),_0x402ef9=startLocalCallbackServer();try{const _0x46d70a=OAUTH_REDIRECT_URI,_0x4c8b47=buildAuthorizeURL(_0x4349fd,{'clientId':_0x5686ff,'redirectUri':_0x46d70a,'state':_0x15ec2f,'codeChallenge':_0x39fec8});openBrowser(_0x4c8b47);const _0x2a1178=await _0x402ef9[_0xbb40f4(0x1b7)]();if(_0x2a1178['state']!==_0x15ec2f)throw new Error('OAuth\x20state\x20mismatch\x20—\x20possible\x20CSRF\x20attack');return await exchangeCodeForTokens(_0x4349fd,_0x2a1178[_0xbb40f4(0x1c3)],_0x5ebba0,_0x46d70a);}finally{_0x402ef9[_0xbb40f4(0x1ba)]();}}
1
+ const a61_0x271916=a61_0x4500;(function(_0x360efa,_0xf8de95){const _0x154a68=a61_0x4500,_0xf8125a=_0x360efa();while(!![]){try{const _0x360f9a=-parseInt(_0x154a68(0x19c))/0x1*(-parseInt(_0x154a68(0x1ac))/0x2)+-parseInt(_0x154a68(0x1b7))/0x3*(parseInt(_0x154a68(0x1c1))/0x4)+parseInt(_0x154a68(0x1d3))/0x5*(parseInt(_0x154a68(0x1ce))/0x6)+-parseInt(_0x154a68(0x1a8))/0x7+parseInt(_0x154a68(0x1ab))/0x8+-parseInt(_0x154a68(0x19e))/0x9+-parseInt(_0x154a68(0x1b4))/0xa*(-parseInt(_0x154a68(0x1a7))/0xb);if(_0x360f9a===_0xf8de95)break;else _0xf8125a['push'](_0xf8125a['shift']());}catch(_0x39abd3){_0xf8125a['push'](_0xf8125a['shift']());}}}(a61_0x99c4,0x5ce24));function a61_0x4500(_0x2dfd80,_0xa3197){_0x2dfd80=_0x2dfd80-0x197;const _0x99c438=a61_0x99c4();let _0x45000f=_0x99c438[_0x2dfd80];return _0x45000f;}import*as a61_0x21524d from'node:crypto';import*as a61_0x3ef7d4 from'node:http';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';const OAUTH_SUPPORTED_SITES=new Set([a61_0x271916(0x1a9),a61_0x271916(0x1ba),a61_0x271916(0x1b2),a61_0x271916(0x1cf),a61_0x271916(0x1cd)]);function a61_0x99c4(){const _0x4560b5=['message','8FJckJP','redirectUri','<html><body><h1>Authentication\x20Successful</h1><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','/oauth/token','randomBytes','end','scope','writeHead','S256','tdx','url','clientId','stg-ap03','3357294vmPAKz','stg-ap01','hex','error','redirect_uri','5ErtTFH','has','digest','base64url','searchParams','Failed\x20to\x20start\x20OAuth\x20callback\x20server:\x20','code_challenge','1AowIbQ','EADDRINUSE','4944663oNfzFR','/oauth/callback','listen','client_id','Port\x20','authorization_code','close','<html><body><h1>Authentication\x20Failed</h1><p>An\x20error\x20occurred\x20during\x20authentication.\x20Please\x20close\x20this\x20window\x20and\x20try\x20again.</p></body></html>','):\x20','11MEueCy','4814971YvKtmz','dev-us01','\x20is\x20already\x20in\x20use.\x20Stop\x20the\x20process\x20using\x20it\x20and\x20retry.','3674400lqzMoq','696934heepKK','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','status','get','text/html','127.0.0.1','stg-us01','codeChallenge','6319140uqfega','update','code','572277eKgANs','sha256','set','dev-eu01','text','waitForCallback','state','toString','Not\x20Found'];a61_0x99c4=function(){return _0x4560b5;};return a61_0x99c4();}export function isOAuthSupported(_0x3584a7){const _0x543760=a61_0x271916;return OAUTH_SUPPORTED_SITES[_0x543760(0x1d4)](_0x3584a7);}export const OAUTH_CALLBACK_PORT=0xaa4a;export const OAUTH_REDIRECT_URI='http://localhost:'+OAUTH_CALLBACK_PORT+a61_0x271916(0x19f);export function getOAuthClientId(){const _0x44c768=a61_0x271916;return process.env.TD_OAUTH_CLIENT_ID||_0x44c768(0x1ca);}export function generatePKCEPair(){const _0x1e1981=a61_0x271916,_0x19e5ab=a61_0x21524d[_0x1e1981(0x1c5)](0x20)[_0x1e1981(0x1be)](_0x1e1981(0x198)),_0x2b26f7=a61_0x21524d['createHash'](_0x1e1981(0x1b8))[_0x1e1981(0x1b5)](_0x19e5ab)[_0x1e1981(0x197)](_0x1e1981(0x198));return{'verifier':_0x19e5ab,'challenge':_0x2b26f7};}export function buildAuthorizeURL(_0x2580e4,_0xc7600e){const _0x16323d=a61_0x271916,_0x25c154=new URL('/oauth/authorize',_0x2580e4);return _0x25c154[_0x16323d(0x199)][_0x16323d(0x1b9)]('response_type',_0x16323d(0x1b6)),_0x25c154[_0x16323d(0x199)][_0x16323d(0x1b9)](_0x16323d(0x1a1),_0xc7600e[_0x16323d(0x1cc)]),_0x25c154[_0x16323d(0x199)][_0x16323d(0x1b9)](_0x16323d(0x1d2),_0xc7600e[_0x16323d(0x1c2)]),_0x25c154[_0x16323d(0x199)][_0x16323d(0x1b9)](_0x16323d(0x1bd),_0xc7600e['state']),_0x25c154[_0x16323d(0x199)]['set'](_0x16323d(0x19b),_0xc7600e[_0x16323d(0x1b3)]),_0x25c154[_0x16323d(0x199)][_0x16323d(0x1b9)]('code_challenge_method',_0x16323d(0x1c9)),_0xc7600e[_0x16323d(0x1c7)]&&_0x25c154['searchParams'][_0x16323d(0x1b9)](_0x16323d(0x1c7),_0xc7600e[_0x16323d(0x1c7)]),_0x25c154[_0x16323d(0x1be)]();}export async function postTokenRequest(_0x1128d2,_0x5dd8e8){const _0x4736d5=a61_0x271916,_0x5edcc8=new URLSearchParams(_0x5dd8e8)[_0x4736d5(0x1be)](),_0x37d2ae=await fetch(_0x1128d2,{'method':'POST','headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x5edcc8});if(!_0x37d2ae['ok']){const _0x57c140=await _0x37d2ae[_0x4736d5(0x1bb)]();throw new Error('OAuth\x20token\x20request\x20failed\x20('+_0x37d2ae[_0x4736d5(0x1ae)]+_0x4736d5(0x1a6)+_0x57c140);}return await _0x37d2ae['json']();}export async function exchangeCodeForTokens(_0x47923c,_0x3e4952,_0x363003,_0x3603ce){const _0x458b72=a61_0x271916,_0x2cdf06=_0x47923c+_0x458b72(0x1c4);return postTokenRequest(_0x2cdf06,{'grant_type':_0x458b72(0x1a3),'client_id':getOAuthClientId(),'code':_0x3e4952,'code_verifier':_0x363003,'redirect_uri':_0x3603ce});}export function startLocalCallbackServer(){const _0x3c8ef0=a61_0x271916;let _0x25b50f,_0x293d26;const _0x150003=new Promise((_0xb141a1,_0x11898c)=>{_0x25b50f=_0xb141a1,_0x293d26=_0x11898c;}),_0x382873=a61_0x3ef7d4['createServer']((_0x13a132,_0x595bda)=>{const _0x365e84=a61_0x4500,_0x554fa4=new URL(_0x13a132[_0x365e84(0x1cb)]||'/','http://127.0.0.1');if(_0x554fa4['pathname']!==_0x365e84(0x19f)){_0x595bda[_0x365e84(0x1c8)](0x194,{'Content-Type':'text/plain'}),_0x595bda[_0x365e84(0x1c6)](_0x365e84(0x1bf));return;}const _0x5d5d47=_0x554fa4[_0x365e84(0x199)][_0x365e84(0x1af)]('code'),_0x4b2918=_0x554fa4['searchParams']['get'](_0x365e84(0x1bd)),_0x26defa=_0x554fa4[_0x365e84(0x199)][_0x365e84(0x1af)](_0x365e84(0x1d1));if(_0x26defa||!_0x5d5d47||!_0x4b2918){_0x595bda[_0x365e84(0x1c8)](0x190,{'Content-Type':_0x365e84(0x1b0)}),_0x595bda[_0x365e84(0x1c6)](_0x365e84(0x1a5)),_0x293d26(new Error('OAuth\x20callback\x20received\x20an\x20error\x20or\x20missing\x20parameters'));return;}_0x595bda[_0x365e84(0x1c8)](0xc8,{'Content-Type':_0x365e84(0x1b0)}),_0x595bda['end'](_0x365e84(0x1c3)),_0x25b50f({'code':_0x5d5d47,'state':_0x4b2918});});_0x382873['on'](_0x3c8ef0(0x1d1),_0x5d3306=>{const _0x4a7667=_0x3c8ef0;_0x5d3306['code']===_0x4a7667(0x19d)?_0x293d26(new Error(_0x4a7667(0x1a2)+OAUTH_CALLBACK_PORT+_0x4a7667(0x1aa))):_0x293d26(new Error(_0x4a7667(0x19a)+_0x5d3306[_0x4a7667(0x1c0)]));}),_0x382873[_0x3c8ef0(0x1a0)](OAUTH_CALLBACK_PORT,_0x3c8ef0(0x1b1));const _0x23a24b=setTimeout(()=>{const _0x3df804=_0x3c8ef0;_0x293d26(new Error(_0x3df804(0x1ad))),_0x382873[_0x3df804(0x1a4)]();},0x2*0x3c*0x3e8);return{'waitForCallback':()=>_0x150003,'close':()=>{clearTimeout(_0x23a24b),_0x382873['close']();}};}export async function startOAuthFlow(_0x5308ae){const _0x2c7c24=a61_0x271916,_0x7a68dd=getConsoleUrl(_0x5308ae),_0x50f441=getOAuthClientId(),{verifier:_0x4d7c68,challenge:_0xc49c9d}=generatePKCEPair(),_0x35df7c=a61_0x21524d[_0x2c7c24(0x1c5)](0x10)[_0x2c7c24(0x1be)](_0x2c7c24(0x1d0)),_0x1abda3=startLocalCallbackServer();try{const _0x5ba2de=OAUTH_REDIRECT_URI,_0x5a3918=buildAuthorizeURL(_0x7a68dd,{'clientId':_0x50f441,'redirectUri':_0x5ba2de,'state':_0x35df7c,'codeChallenge':_0xc49c9d});openBrowser(_0x5a3918);const _0x2b2db9=await _0x1abda3[_0x2c7c24(0x1bc)]();if(_0x2b2db9[_0x2c7c24(0x1bd)]!==_0x35df7c)throw new Error('OAuth\x20state\x20mismatch\x20—\x20possible\x20CSRF\x20attack');return await exchangeCodeForTokens(_0x7a68dd,_0x2b2db9[_0x2c7c24(0x1b6)],_0x4d7c68,_0x5ba2de);}finally{_0x1abda3[_0x2c7c24(0x1a4)]();}}
@@ -1 +1 @@
1
- const a62_0x277d66=a62_0x80ce;(function(_0x345c52,_0x58d821){const _0x4c0cba=a62_0x80ce,_0x5bbc60=_0x345c52();while(!![]){try{const _0x384312=parseInt(_0x4c0cba(0xc8))/0x1*(-parseInt(_0x4c0cba(0xc6))/0x2)+-parseInt(_0x4c0cba(0xd7))/0x3+-parseInt(_0x4c0cba(0xd9))/0x4+parseInt(_0x4c0cba(0xf0))/0x5*(-parseInt(_0x4c0cba(0xb3))/0x6)+-parseInt(_0x4c0cba(0xd6))/0x7*(parseInt(_0x4c0cba(0xfb))/0x8)+parseInt(_0x4c0cba(0xa5))/0x9*(-parseInt(_0x4c0cba(0xdb))/0xa)+parseInt(_0x4c0cba(0xce))/0xb*(parseInt(_0x4c0cba(0xf7))/0xc);if(_0x384312===_0x58d821)break;else _0x5bbc60['push'](_0x5bbc60['shift']());}catch(_0x1d8d10){_0x5bbc60['push'](_0x5bbc60['shift']());}}}(a62_0x1a83,0xd31cb));import*as a62_0x4c969a from'node:fs';import*as a62_0x11d209 from'node:path';import{SDKError,ErrorCode}from'../sdk/errors.js';function a62_0x1a83(){const _0xed6e13=['207ZwLCyw','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','To\x20migrate:','database','set','object','Error:\x20','directory','profile','INVALID_PROFILE_CONFIG','\x20\x20mv\x20\x22','filter','user','12UjTtqI','Profile\x20','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','user_info','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','has','test','@tdx-studio','.env','Invalid\x20profile\x20name:\x20','parse','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','entries','\x22\x20\x22','utf-8','llm_project','warn','local','rmSync','8DJUSVx','map','373719ipRQul','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20',',\x20creating\x20new\x20file','some','\x27\x20not\x20found\x20in\x20user\x20configuration','localeCompare','69231030jsMQgU','site','length','description','string','Profile\x20\x27','.env.','Warning:\x20Failed\x20to\x20parse\x20','38710rVPWRL','2136036suxmis','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','176960jCRIRO','from','268810teGfkr','join','tdx.json','Failed\x20to\x20parse\x20','push','keys','name','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20underscore,\x20and\x20optional\x20@\x20prefix\x20for\x20reserved\x20profiles.','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','message','\x0aWarning:\x20Failed\x20to\x20parse\x20','\x20\x201.\x20Edit:\x20','sort','parent_segment','\x20does\x20not\x20exist','isDirectory','\x27:\x20unknown\x20config\x20key\x20\x27','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','profiles','Warning:\x20Profile\x20\x27','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','2306860yezRCL','\x27:\x20config\x20must\x20be\x20an\x20object','existsSync','includes','llm_agent','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','readFileSync','12gacbNG','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','stringify','\x27\x20will\x20be\x20ignored','2368DqyoMD'];a62_0x1a83=function(){return _0xed6e13;};return a62_0x1a83();}import{getConfigDir}from'./config.js';import{createSecureDirectory,writeSecureFile}from'../utils/file-permissions.js';import{findProjectConfigPath}from'./project-config.js';import{loadSessionContext}from'./session.js';export const STUDIO_PROFILE_NAME=a62_0x277d66(0xba);export function getProfileParams(_0x18d8f7){const _0xe596eb=a62_0x277d66,_0x28b2b0={};if(!_0x18d8f7)return _0x28b2b0;for(const [_0x3f4def,_0x8e290]of Object[_0xe596eb(0xbf)](_0x18d8f7)){_0x3f4def!==_0xe596eb(0xd1)&&_0x8e290!==undefined&&(_0x28b2b0[_0x3f4def]=_0x8e290);}return _0x28b2b0;}export function getProfilesDir(){const _0x451bda=a62_0x277d66;return a62_0x11d209[_0x451bda(0xdc)](getConfigDir(),'profiles');}function getProfileDir(_0x2cb2c8){const _0x396142=a62_0x277d66;return a62_0x11d209[_0x396142(0xdc)](getProfilesDir(),_0x2cb2c8);}function getProfileConfigPath(_0x25bedc){const _0x53fd84=a62_0x277d66;return a62_0x11d209[_0x53fd84(0xdc)](getProfileDir(_0x25bedc),'tdx.json');}function getProfileEnvPath(_0x20c031){const _0x4c4d7b=a62_0x277d66;return a62_0x11d209[_0x4c4d7b(0xdc)](getProfileDir(_0x20c031),_0x4c4d7b(0xbb));}function getGlobalConfigPath(){const _0x415a95=a62_0x277d66;return a62_0x11d209[_0x415a95(0xdc)](getConfigDir(),_0x415a95(0xdd));}function validateProfileName(_0x148842){const _0x546b48=a62_0x277d66;if(/^@?[a-zA-Z0-9_-]+$/[_0x546b48(0xb9)](_0x148842))return;if(/^@tdx-studio:[a-zA-Z0-9_-]+:\d+(:\d+)?$/[_0x546b48(0xb9)](_0x148842))return;throw new Error(_0x546b48(0xbc)+_0x148842+_0x546b48(0xe2));}function validateProfileConfig(_0xaa619e,_0x5ebdc7){const _0x4d2a9=a62_0x277d66;if(typeof _0xaa619e!==_0x4d2a9(0xab)||_0xaa619e===null)throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0x4d2a9(0xd3)+_0x5ebdc7+_0x4d2a9(0xf1));const _0x5903cd=['description',_0x4d2a9(0xcf),_0x4d2a9(0xa9),_0x4d2a9(0xe8),'llm_project',_0x4d2a9(0xf4),_0x4d2a9(0xb6)],_0x36cfeb=_0xaa619e;for(const _0x2cbf07 of Object[_0x4d2a9(0xe0)](_0x36cfeb)){!_0x5903cd[_0x4d2a9(0xf3)](_0x2cbf07)&&console['warn'](_0x4d2a9(0xee)+_0x5ebdc7+_0x4d2a9(0xeb)+_0x2cbf07+_0x4d2a9(0xfa));}if(_0x36cfeb[_0x4d2a9(0xd1)]!==undefined&&typeof _0x36cfeb[_0x4d2a9(0xd1)]!==_0x4d2a9(0xd2))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0x4d2a9(0xd3)+_0x5ebdc7+_0x4d2a9(0xbe));if(_0x36cfeb[_0x4d2a9(0xcf)]!==undefined&&typeof _0x36cfeb[_0x4d2a9(0xcf)]!==_0x4d2a9(0xd2))throw new SDKError(ErrorCode[_0x4d2a9(0xaf)],_0x4d2a9(0xd3)+_0x5ebdc7+_0x4d2a9(0xa6));if(_0x36cfeb[_0x4d2a9(0xa9)]!==undefined&&typeof _0x36cfeb[_0x4d2a9(0xa9)]!==_0x4d2a9(0xd2))throw new SDKError(ErrorCode[_0x4d2a9(0xaf)],'Profile\x20\x27'+_0x5ebdc7+_0x4d2a9(0xec));if(_0x36cfeb[_0x4d2a9(0xe8)]!==undefined&&typeof _0x36cfeb[_0x4d2a9(0xe8)]!==_0x4d2a9(0xd2))throw new SDKError(ErrorCode[_0x4d2a9(0xaf)],'Profile\x20\x27'+_0x5ebdc7+_0x4d2a9(0xf5));if(_0x36cfeb[_0x4d2a9(0xc2)]!==undefined&&typeof _0x36cfeb['llm_project']!==_0x4d2a9(0xd2))throw new SDKError(ErrorCode[_0x4d2a9(0xaf)],_0x4d2a9(0xd3)+_0x5ebdc7+_0x4d2a9(0xf8));if(_0x36cfeb[_0x4d2a9(0xf4)]!==undefined&&typeof _0x36cfeb[_0x4d2a9(0xf4)]!=='string')throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0x4d2a9(0xd3)+_0x5ebdc7+_0x4d2a9(0xef));return!![];}function loadProfilesFromTdxJson(_0x10c1b1,_0x4e859b){const _0x527f31=a62_0x277d66;if(!a62_0x4c969a[_0x527f31(0xf2)](_0x10c1b1))return[];try{const _0x542697=a62_0x4c969a[_0x527f31(0xf6)](_0x10c1b1,_0x527f31(0xc1)),_0x228975=JSON[_0x527f31(0xbd)](_0x542697);if(!_0x228975[_0x527f31(0xed)]||typeof _0x228975['profiles']!==_0x527f31(0xab))return[];const _0x358c85=[];for(const [_0x17fa57,_0x8b584d]of Object[_0x527f31(0xbf)](_0x228975[_0x527f31(0xed)])){try{validateProfileConfig(_0x8b584d,_0x17fa57);const _0x2ab397=getNewCredentialPath(_0x17fa57),_0x496520=getOldCredentialPath(_0x17fa57),_0x2247c0=a62_0x4c969a[_0x527f31(0xf2)](_0x2ab397)||a62_0x4c969a[_0x527f31(0xf2)](_0x496520);_0x358c85[_0x527f31(0xdf)]({'name':_0x17fa57,'config':_0x8b584d,'metadata':{'name':_0x17fa57,'createdAt':new Date()['toISOString']()},'hasCredentials':_0x2247c0,'scope':_0x4e859b});}catch(_0x1afc72){_0x1afc72 instanceof Error&&(console['warn'](_0x527f31(0xc9)+_0x10c1b1+':'),console[_0x527f31(0xc3)]('\x20\x20'+_0x1afc72[_0x527f31(0xe4)]+'\x0a'));}}return _0x358c85;}catch(_0x550a3e){return _0x550a3e instanceof SyntaxError?(console[_0x527f31(0xc3)](_0x527f31(0xe5)+_0x10c1b1+':\x20Invalid\x20JSON\x20syntax'),console['warn'](_0x527f31(0xac)+_0x550a3e['message']+'\x0a')):console[_0x527f31(0xc3)](_0x527f31(0xb5)+_0x10c1b1+':\x20'+_0x550a3e+'\x0a'),[];}}export function getNewCredentialPath(_0x5f2adc){const _0x795ac5=a62_0x277d66;return a62_0x11d209['join'](getConfigDir(),_0x795ac5(0xd4)+_0x5f2adc);}function getOldCredentialPath(_0x2c0a95){const _0x522501=a62_0x277d66;return a62_0x11d209[_0x522501(0xdc)](getProfilesDir(),_0x2c0a95,_0x522501(0xbb));}function loadProfilesFromTdxJsonFiles(){const _0x1bea5f=a62_0x277d66,_0x531288=[],_0x277dfd=findProjectConfigPath();_0x277dfd&&_0x531288[_0x1bea5f(0xdf)](...loadProfilesFromTdxJson(_0x277dfd,_0x1bea5f(0xc4)));const _0x326e34=a62_0x11d209[_0x1bea5f(0xdc)](getConfigDir(),_0x1bea5f(0xdd));return _0x531288['push'](...loadProfilesFromTdxJson(_0x326e34,_0x1bea5f(0xb2))),_0x531288;}function loadProfilesFromDirectories(){const _0x63a139=a62_0x277d66,_0x1d126d=getProfilesDir();if(!a62_0x4c969a[_0x63a139(0xf2)](_0x1d126d))return[];try{return a62_0x4c969a['readdirSync'](_0x1d126d,{'withFileTypes':!![]})['filter'](_0x415b33=>_0x415b33[_0x63a139(0xea)]())[_0x63a139(0xc7)](_0xc6d685=>_0xc6d685[_0x63a139(0xe1)])[_0x63a139(0xb1)](_0x33b688=>{const _0x184c5a=_0x63a139,_0x499e02=getProfileConfigPath(_0x33b688),_0x4f42ee=getProfileEnvPath(_0x33b688);return a62_0x4c969a[_0x184c5a(0xf2)](_0x499e02)||a62_0x4c969a[_0x184c5a(0xf2)](_0x4f42ee);})[_0x63a139(0xc7)](_0x521ae8=>{const _0x4eef97=loadProfileFromDirectory(_0x521ae8);if(_0x4eef97)return{..._0x4eef97,'scope':'directory'};return null;})['filter'](_0x2b93fc=>_0x2b93fc!==null);}catch{return[];}}function loadProfileFromDirectory(_0x54ea4a){const _0xdf83d0=a62_0x277d66,_0x5b0598=getProfileConfigPath(_0x54ea4a),_0x47bb23=getOldCredentialPath(_0x54ea4a);if(!a62_0x4c969a[_0xdf83d0(0xf2)](_0x5b0598)&&!a62_0x4c969a['existsSync'](_0x47bb23))return null;let _0x42333b={},_0x352349={'name':_0x54ea4a,'createdAt':new Date()['toISOString']()};if(a62_0x4c969a['existsSync'](_0x5b0598))try{const _0x178933=a62_0x4c969a[_0xdf83d0(0xf6)](_0x5b0598,_0xdf83d0(0xc1)),_0x1d26d8=JSON[_0xdf83d0(0xbd)](_0x178933),{metadata:_0x1df147,..._0x31a97c}=_0x1d26d8;_0x42333b=_0x31a97c,_0x1df147&&(_0x352349=_0x1df147);}catch{}return{'name':_0x54ea4a,'config':_0x42333b,'metadata':_0x352349,'hasCredentials':a62_0x4c969a[_0xdf83d0(0xf2)](_0x47bb23),'scope':_0xdf83d0(0xad)};}export function listProfiles(){const _0x4c1cfa=a62_0x277d66,_0x49fde1=loadProfilesFromTdxJsonFiles(),_0x529238=loadProfilesFromDirectories();if(_0x529238[_0x4c1cfa(0xd0)]>0x0){const _0x90fccc=_0x529238[_0x4c1cfa(0xc7)](_0x3c20de=>_0x3c20de[_0x4c1cfa(0xe1)])[_0x4c1cfa(0xdc)](',\x20'),_0x1f5431=getConfigDir();console[_0x4c1cfa(0xc3)]('\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20'+_0x90fccc),console[_0x4c1cfa(0xc3)]('Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:'),console['warn'](_0x4c1cfa(0xe6)+a62_0x11d209['join'](_0x1f5431,_0x4c1cfa(0xdd))),console['warn'](_0x4c1cfa(0xd8)),console[_0x4c1cfa(0xc3)](_0x4c1cfa(0xe3));}const _0x1fe195=[..._0x49fde1,..._0x529238],_0x419a46=new Map();for(const _0x2ba47d of _0x1fe195){!_0x419a46[_0x4c1cfa(0xb8)](_0x2ba47d['name'])&&_0x419a46[_0x4c1cfa(0xaa)](_0x2ba47d[_0x4c1cfa(0xe1)],_0x2ba47d);}return Array[_0x4c1cfa(0xda)](_0x419a46['values']())[_0x4c1cfa(0xe7)]((_0x350357,_0x428774)=>_0x350357[_0x4c1cfa(0xe1)][_0x4c1cfa(0xcd)](_0x428774[_0x4c1cfa(0xe1)]));}export function profileExists(_0x2d3105){const _0x177f0c=a62_0x277d66,_0xd0276d=listProfiles();return _0xd0276d[_0x177f0c(0xcb)](_0x229503=>_0x229503[_0x177f0c(0xe1)]===_0x2d3105);}export function loadProfile(_0x542989){const _0x54ff79=a62_0x277d66;validateProfileName(_0x542989);const _0x35bd79=listProfiles(),_0x4aabb2=_0x35bd79['find'](_0x4461fe=>_0x4461fe[_0x54ff79(0xe1)]===_0x542989);return _0x4aabb2||null;}export function saveProfile(_0x86938a,_0x300512,_0xe18848=![]){saveProfileToUserConfig(_0x86938a,_0x300512);}export function deleteProfile(_0x4360e7){const _0x34954d=a62_0x277d66;validateProfileName(_0x4360e7);const _0x29099b=getProfileDir(_0x4360e7);if(!a62_0x4c969a[_0x34954d(0xf2)](_0x29099b))throw new Error(_0x34954d(0xb4)+_0x4360e7+_0x34954d(0xe9));a62_0x4c969a[_0x34954d(0xc5)](_0x29099b,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x503195,_0x554af1){const _0x1398bd=a62_0x277d66;validateProfileName(_0x503195);const _0x2340d0=getGlobalConfigPath(),_0x2d1698=getConfigDir();!a62_0x4c969a[_0x1398bd(0xf2)](_0x2d1698)&&createSecureDirectory(_0x2d1698);let _0x5d91c8={};if(a62_0x4c969a[_0x1398bd(0xf2)](_0x2340d0))try{const _0x37686b=a62_0x4c969a[_0x1398bd(0xf6)](_0x2340d0,_0x1398bd(0xc1));_0x5d91c8=JSON[_0x1398bd(0xbd)](_0x37686b);}catch{console[_0x1398bd(0xc3)](_0x1398bd(0xd5)+_0x2340d0+_0x1398bd(0xca));}!_0x5d91c8[_0x1398bd(0xed)]&&(_0x5d91c8[_0x1398bd(0xed)]={}),_0x5d91c8[_0x1398bd(0xed)][_0x503195]=_0x554af1,writeSecureFile(_0x2340d0,JSON[_0x1398bd(0xf9)](_0x5d91c8,null,0x2));}export function removeProfileFromUserConfig(_0x516301){const _0x2efec0=a62_0x277d66;validateProfileName(_0x516301);const _0x4d5e32=getGlobalConfigPath();if(!a62_0x4c969a[_0x2efec0(0xf2)](_0x4d5e32))throw new Error(_0x2efec0(0xd3)+_0x516301+_0x2efec0(0xcc));let _0x39522c={};try{const _0xe8cf79=a62_0x4c969a[_0x2efec0(0xf6)](_0x4d5e32,'utf-8');_0x39522c=JSON[_0x2efec0(0xbd)](_0xe8cf79);}catch{throw new Error(_0x2efec0(0xde)+_0x4d5e32);}if(!_0x39522c['profiles']||!_0x39522c[_0x2efec0(0xed)][_0x516301])throw new Error(_0x2efec0(0xd3)+_0x516301+_0x2efec0(0xcc));delete _0x39522c['profiles'][_0x516301],_0x39522c['profile']===_0x516301&&delete _0x39522c[_0x2efec0(0xae)],writeSecureFile(_0x4d5e32,JSON[_0x2efec0(0xf9)](_0x39522c,null,0x2));}export function getActiveProfile(){const _0x4b3d9b=a62_0x277d66,_0x43d031=loadSessionContext();if(_0x43d031?.[_0x4b3d9b(0xae)])return _0x43d031[_0x4b3d9b(0xae)];if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x172a7d=getGlobalConfigPath();if(!a62_0x4c969a[_0x4b3d9b(0xf2)](_0x172a7d))return null;try{const _0x1569f5=a62_0x4c969a[_0x4b3d9b(0xf6)](_0x172a7d,_0x4b3d9b(0xc1)),_0x3a38ab=JSON[_0x4b3d9b(0xbd)](_0x1569f5);return _0x3a38ab[_0x4b3d9b(0xae)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x4a88e2){const _0x1bd428=a62_0x277d66,_0x355b1a=getGlobalConfigPath(),_0x3c5f9d=getConfigDir();!a62_0x4c969a['existsSync'](_0x3c5f9d)&&createSecureDirectory(_0x3c5f9d);let _0x2ebc4d={};if(a62_0x4c969a[_0x1bd428(0xf2)](_0x355b1a))try{const _0x592e4e=a62_0x4c969a[_0x1bd428(0xf6)](_0x355b1a,_0x1bd428(0xc1));_0x2ebc4d=JSON[_0x1bd428(0xbd)](_0x592e4e);}catch{console['warn'](_0x1bd428(0xd5)+_0x355b1a+',\x20creating\x20new\x20file');}_0x2ebc4d[_0x1bd428(0xcf)]=_0x4a88e2,writeSecureFile(_0x355b1a,JSON[_0x1bd428(0xf9)](_0x2ebc4d,null,0x2));}export function saveActiveProfileToUserConfig(_0x4c1d85){const _0x39810f=a62_0x277d66;validateProfileName(_0x4c1d85);const _0x5b1c0c=getGlobalConfigPath(),_0x50c87c=getConfigDir();!a62_0x4c969a['existsSync'](_0x50c87c)&&createSecureDirectory(_0x50c87c);let _0x3a5366={};if(a62_0x4c969a[_0x39810f(0xf2)](_0x5b1c0c))try{const _0x59e4c5=a62_0x4c969a['readFileSync'](_0x5b1c0c,'utf-8');_0x3a5366=JSON[_0x39810f(0xbd)](_0x59e4c5);}catch{console[_0x39810f(0xc3)](_0x39810f(0xd5)+_0x5b1c0c+',\x20creating\x20new\x20file');}_0x3a5366[_0x39810f(0xae)]=_0x4c1d85,writeSecureFile(_0x5b1c0c,JSON[_0x39810f(0xf9)](_0x3a5366,null,0x2));}function clearFieldFromUserConfig(_0x587e06){const _0x198354=a62_0x277d66,_0x42c9f6=getGlobalConfigPath();if(!a62_0x4c969a[_0x198354(0xf2)](_0x42c9f6))return;let _0x41ddaa={};try{const _0x4a29b8=a62_0x4c969a[_0x198354(0xf6)](_0x42c9f6,_0x198354(0xc1));_0x41ddaa=JSON[_0x198354(0xbd)](_0x4a29b8);}catch{return;}delete _0x41ddaa[_0x587e06],writeSecureFile(_0x42c9f6,JSON[_0x198354(0xf9)](_0x41ddaa,null,0x2));}export function clearDefaultSiteFromUserConfig(){const _0x9fcb26=a62_0x277d66;clearFieldFromUserConfig(_0x9fcb26(0xcf));}function a62_0x80ce(_0x28cd55,_0x57ad2b){_0x28cd55=_0x28cd55-0xa5;const _0x1a83b7=a62_0x1a83();let _0x80ceb9=_0x1a83b7[_0x28cd55];return _0x80ceb9;}export function clearActiveProfileFromUserConfig(){const _0x314968=a62_0x277d66;clearFieldFromUserConfig(_0x314968(0xae));}export function createProfile(_0x412893,_0x46c174){const _0x5175b0=a62_0x277d66;validateProfileName(_0x412893);if(profileExists(_0x412893))throw new Error(_0x5175b0(0xb4)+_0x412893+'\x20already\x20exists');saveProfile(_0x412893,_0x46c174);}export function saveProfileCredentials(_0x2ba801,_0x44bd5e){const _0x1006b5=a62_0x277d66;validateProfileName(_0x2ba801);if(!profileExists(_0x2ba801))throw new Error(_0x1006b5(0xb4)+_0x2ba801+_0x1006b5(0xe9));const _0x14f7c8=getNewCredentialPath(_0x2ba801);writeSecureFile(_0x14f7c8,_0x44bd5e);}export function loadProfileCredentials(_0x336a78){const _0x4814fc=a62_0x277d66;validateProfileName(_0x336a78);const _0x124138=getNewCredentialPath(_0x336a78);if(a62_0x4c969a[_0x4814fc(0xf2)](_0x124138))try{return a62_0x4c969a[_0x4814fc(0xf6)](_0x124138,_0x4814fc(0xc1));}catch{}const _0x40bede=getOldCredentialPath(_0x336a78);if(a62_0x4c969a[_0x4814fc(0xf2)](_0x40bede)){console[_0x4814fc(0xc3)](_0x4814fc(0xb7)+_0x336a78+'\x27'),console['warn'](_0x4814fc(0xa8)),console[_0x4814fc(0xc3)](_0x4814fc(0xb0)+_0x40bede+_0x4814fc(0xc0)+_0x124138+'\x22'),console[_0x4814fc(0xc3)](_0x4814fc(0xa7));try{return a62_0x4c969a['readFileSync'](_0x40bede,_0x4814fc(0xc1));}catch{return null;}}return null;}
1
+ const a62_0x12c943=a62_0x5319;(function(_0x1019cf,_0xda144b){const _0x1ad6a8=a62_0x5319,_0x50a1df=_0x1019cf();while(!![]){try{const _0x565f81=-parseInt(_0x1ad6a8(0x157))/0x1+parseInt(_0x1ad6a8(0x19c))/0x2*(-parseInt(_0x1ad6a8(0x17f))/0x3)+parseInt(_0x1ad6a8(0x198))/0x4*(-parseInt(_0x1ad6a8(0x1a0))/0x5)+parseInt(_0x1ad6a8(0x176))/0x6*(parseInt(_0x1ad6a8(0x163))/0x7)+-parseInt(_0x1ad6a8(0x15a))/0x8*(parseInt(_0x1ad6a8(0x194))/0x9)+-parseInt(_0x1ad6a8(0x18a))/0xa*(-parseInt(_0x1ad6a8(0x18f))/0xb)+-parseInt(_0x1ad6a8(0x164))/0xc*(parseInt(_0x1ad6a8(0x18e))/0xd);if(_0x565f81===_0xda144b)break;else _0x50a1df['push'](_0x50a1df['shift']());}catch(_0x40bd40){_0x50a1df['push'](_0x50a1df['shift']());}}}(a62_0x272c,0xc8192));import*as a62_0x3fa0a7 from'node:fs';import*as a62_0x1afde8 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_0x12c943(0x1a1);export function getProfileParams(_0xfb80dd){const _0x5b5bd1=a62_0x12c943,_0x4fe07b={};if(!_0xfb80dd)return _0x4fe07b;for(const [_0x2d2403,_0x4ec3fc]of Object[_0x5b5bd1(0x169)](_0xfb80dd)){_0x2d2403!==_0x5b5bd1(0x16f)&&_0x4ec3fc!==undefined&&(_0x4fe07b[_0x2d2403]=_0x4ec3fc);}return _0x4fe07b;}export function getProfilesDir(){const _0xc3c128=a62_0x12c943;return a62_0x1afde8[_0xc3c128(0x15d)](getConfigDir(),_0xc3c128(0x19d));}function a62_0x5319(_0x2f4cfa,_0x29e5c4){_0x2f4cfa=_0x2f4cfa-0x14f;const _0x272ca4=a62_0x272c();let _0x5319fa=_0x272ca4[_0x2f4cfa];return _0x5319fa;}function getProfileDir(_0x33ffd9){const _0x12b79c=a62_0x12c943;return a62_0x1afde8[_0x12b79c(0x15d)](getProfilesDir(),_0x33ffd9);}function a62_0x272c(){const _0x2a4c98=['site',',\x20creating\x20new\x20file','has','existsSync','16204250HkBHZq','length','llm_project','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20underscore,\x20and\x20optional\x20@\x20prefix\x20for\x20reserved\x20profiles.','3581734fQBCDE','11TxLUZY','set','warn','isDirectory','string','50769tuEXJR','user','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','\x27:\x20unknown\x20config\x20key\x20\x27','12FYZLBf','database','readFileSync','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','2tfGtnG','profiles','\x27\x20will\x20be\x20ignored','directory','25595pwlrQN','@tdx-studio','parse','user_info','push','object','tdx.json','.env.','\x22\x20\x22','test','Error:\x20','values','\x0aWarning:\x20Failed\x20to\x20parse\x20','localeCompare','3878Xwlxco','\x27\x20not\x20found\x20in\x20user\x20configuration','Profile\x20','24kFDJhS','Failed\x20to\x20parse\x20','stringify','join','utf-8','Warning:\x20Profile\x20\x27','INVALID_PROFILE_CONFIG','llm_agent','name','39137aEzJNm','12xaAkZt','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','from','entries','map',':\x20Invalid\x20JSON\x20syntax','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','description','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','find','readdirSync','.env','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','toISOString','114MiOtqy','sort','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','Profile\x20\x27','Invalid\x20profile\x20name:\x20','To\x20migrate:','filter','parent_segment','profile','1786128EDXeyx','Warning:\x20Failed\x20to\x20parse\x20','\x20does\x20not\x20exist','includes','\x20\x20mv\x20\x22','keys','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string'];a62_0x272c=function(){return _0x2a4c98;};return a62_0x272c();}function getProfileConfigPath(_0x43dce7){const _0x4a9f8b=a62_0x12c943;return a62_0x1afde8['join'](getProfileDir(_0x43dce7),_0x4a9f8b(0x14f));}function getProfileEnvPath(_0x50080f){return a62_0x1afde8['join'](getProfileDir(_0x50080f),'.env');}function getGlobalConfigPath(){return a62_0x1afde8['join'](getConfigDir(),'tdx.json');}function validateProfileName(_0x2bf95d){const _0x5f0e21=a62_0x12c943;if(/^@?[a-zA-Z0-9_-]+$/[_0x5f0e21(0x152)](_0x2bf95d))return;if(/^@tdx-studio:[a-zA-Z0-9_-]+:\d+(:\d+)?$/[_0x5f0e21(0x152)](_0x2bf95d))return;throw new Error(_0x5f0e21(0x17a)+_0x2bf95d+_0x5f0e21(0x18d));}function validateProfileConfig(_0x216a63,_0xfc7389){const _0x54ecae=a62_0x12c943;if(typeof _0x216a63!=='object'||_0x216a63===null)throw new SDKError(ErrorCode[_0x54ecae(0x160)],_0x54ecae(0x179)+_0xfc7389+'\x27:\x20config\x20must\x20be\x20an\x20object');const _0xaecf00=[_0x54ecae(0x16f),_0x54ecae(0x186),_0x54ecae(0x199),_0x54ecae(0x17d),_0x54ecae(0x18c),'llm_agent',_0x54ecae(0x1a3)],_0x59cfa9=_0x216a63;for(const _0x206229 of Object[_0x54ecae(0x184)](_0x59cfa9)){!_0xaecf00[_0x54ecae(0x182)](_0x206229)&&console[_0x54ecae(0x191)](_0x54ecae(0x15f)+_0xfc7389+_0x54ecae(0x197)+_0x206229+_0x54ecae(0x19e));}if(_0x59cfa9[_0x54ecae(0x16f)]!==undefined&&typeof _0x59cfa9[_0x54ecae(0x16f)]!==_0x54ecae(0x193))throw new SDKError(ErrorCode[_0x54ecae(0x160)],_0x54ecae(0x179)+_0xfc7389+_0x54ecae(0x165));if(_0x59cfa9[_0x54ecae(0x186)]!==undefined&&typeof _0x59cfa9[_0x54ecae(0x186)]!=='string')throw new SDKError(ErrorCode[_0x54ecae(0x160)],'Profile\x20\x27'+_0xfc7389+_0x54ecae(0x16e));if(_0x59cfa9[_0x54ecae(0x199)]!==undefined&&typeof _0x59cfa9[_0x54ecae(0x199)]!==_0x54ecae(0x193))throw new SDKError(ErrorCode[_0x54ecae(0x160)],_0x54ecae(0x179)+_0xfc7389+'\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string');if(_0x59cfa9[_0x54ecae(0x17d)]!==undefined&&typeof _0x59cfa9['parent_segment']!=='string')throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],'Profile\x20\x27'+_0xfc7389+_0x54ecae(0x174));if(_0x59cfa9[_0x54ecae(0x18c)]!==undefined&&typeof _0x59cfa9['llm_project']!==_0x54ecae(0x193))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],'Profile\x20\x27'+_0xfc7389+_0x54ecae(0x16c));if(_0x59cfa9[_0x54ecae(0x161)]!==undefined&&typeof _0x59cfa9[_0x54ecae(0x161)]!==_0x54ecae(0x193))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0x54ecae(0x179)+_0xfc7389+_0x54ecae(0x185));return!![];}function loadProfilesFromTdxJson(_0x52ffcd,_0x58bb0b){const _0x3a3683=a62_0x12c943;if(!a62_0x3fa0a7[_0x3a3683(0x189)](_0x52ffcd))return[];try{const _0x44fe4f=a62_0x3fa0a7[_0x3a3683(0x19a)](_0x52ffcd,_0x3a3683(0x15e)),_0x2928ac=JSON[_0x3a3683(0x1a2)](_0x44fe4f);if(!_0x2928ac[_0x3a3683(0x19d)]||typeof _0x2928ac[_0x3a3683(0x19d)]!==_0x3a3683(0x1a5))return[];const _0x1c249b=[];for(const [_0x320f8c,_0x5e724a]of Object[_0x3a3683(0x169)](_0x2928ac[_0x3a3683(0x19d)])){try{validateProfileConfig(_0x5e724a,_0x320f8c);const _0x480023=getNewCredentialPath(_0x320f8c),_0x1ae1a2=getOldCredentialPath(_0x320f8c),_0x123ccc=a62_0x3fa0a7[_0x3a3683(0x189)](_0x480023)||a62_0x3fa0a7[_0x3a3683(0x189)](_0x1ae1a2);_0x1c249b[_0x3a3683(0x1a4)]({'name':_0x320f8c,'config':_0x5e724a,'metadata':{'name':_0x320f8c,'createdAt':new Date()[_0x3a3683(0x175)]()},'hasCredentials':_0x123ccc,'scope':_0x58bb0b});}catch(_0x141b16){_0x141b16 instanceof Error&&(console['warn'](_0x3a3683(0x19b)+_0x52ffcd+':'),console[_0x3a3683(0x191)]('\x20\x20'+_0x141b16['message']+'\x0a'));}}return _0x1c249b;}catch(_0x112aa0){return _0x112aa0 instanceof SyntaxError?(console[_0x3a3683(0x191)](_0x3a3683(0x155)+_0x52ffcd+_0x3a3683(0x16b)),console[_0x3a3683(0x191)](_0x3a3683(0x153)+_0x112aa0['message']+'\x0a')):console[_0x3a3683(0x191)](_0x3a3683(0x167)+_0x52ffcd+':\x20'+_0x112aa0+'\x0a'),[];}}export function getNewCredentialPath(_0x490458){const _0x27fe8e=a62_0x12c943;return a62_0x1afde8['join'](getConfigDir(),_0x27fe8e(0x150)+_0x490458);}function getOldCredentialPath(_0x1c9018){const _0x1b419f=a62_0x12c943;return a62_0x1afde8[_0x1b419f(0x15d)](getProfilesDir(),_0x1c9018,_0x1b419f(0x173));}function loadProfilesFromTdxJsonFiles(){const _0xc54644=a62_0x12c943,_0x38f494=[],_0x26b357=findProjectConfigPath();_0x26b357&&_0x38f494[_0xc54644(0x1a4)](...loadProfilesFromTdxJson(_0x26b357,'local'));const _0x1a53cb=a62_0x1afde8[_0xc54644(0x15d)](getConfigDir(),_0xc54644(0x14f));return _0x38f494[_0xc54644(0x1a4)](...loadProfilesFromTdxJson(_0x1a53cb,_0xc54644(0x195))),_0x38f494;}function loadProfilesFromDirectories(){const _0xc13d31=a62_0x12c943,_0x111b87=getProfilesDir();if(!a62_0x3fa0a7[_0xc13d31(0x189)](_0x111b87))return[];try{return a62_0x3fa0a7[_0xc13d31(0x172)](_0x111b87,{'withFileTypes':!![]})[_0xc13d31(0x17c)](_0xee6f42=>_0xee6f42[_0xc13d31(0x192)]())[_0xc13d31(0x16a)](_0x26d962=>_0x26d962[_0xc13d31(0x162)])[_0xc13d31(0x17c)](_0x20a313=>{const _0x5ddd37=_0xc13d31,_0x4ad775=getProfileConfigPath(_0x20a313),_0x16c4f8=getProfileEnvPath(_0x20a313);return a62_0x3fa0a7['existsSync'](_0x4ad775)||a62_0x3fa0a7[_0x5ddd37(0x189)](_0x16c4f8);})[_0xc13d31(0x16a)](_0x29d1b1=>{const _0x458db2=_0xc13d31,_0x177405=loadProfileFromDirectory(_0x29d1b1);if(_0x177405)return{..._0x177405,'scope':_0x458db2(0x19f)};return null;})[_0xc13d31(0x17c)](_0x5211da=>_0x5211da!==null);}catch{return[];}}function loadProfileFromDirectory(_0x4320a3){const _0x29739b=a62_0x12c943,_0xfe9e98=getProfileConfigPath(_0x4320a3),_0x499288=getOldCredentialPath(_0x4320a3);if(!a62_0x3fa0a7[_0x29739b(0x189)](_0xfe9e98)&&!a62_0x3fa0a7[_0x29739b(0x189)](_0x499288))return null;let _0x397911={},_0x1febcc={'name':_0x4320a3,'createdAt':new Date()[_0x29739b(0x175)]()};if(a62_0x3fa0a7[_0x29739b(0x189)](_0xfe9e98))try{const _0x30e150=a62_0x3fa0a7[_0x29739b(0x19a)](_0xfe9e98,_0x29739b(0x15e)),_0x1d3f8d=JSON[_0x29739b(0x1a2)](_0x30e150),{metadata:_0x48bed2,..._0x7dc93c}=_0x1d3f8d;_0x397911=_0x7dc93c,_0x48bed2&&(_0x1febcc=_0x48bed2);}catch{}return{'name':_0x4320a3,'config':_0x397911,'metadata':_0x1febcc,'hasCredentials':a62_0x3fa0a7[_0x29739b(0x189)](_0x499288),'scope':_0x29739b(0x19f)};}export function listProfiles(){const _0x2ffe3b=a62_0x12c943,_0x446687=loadProfilesFromTdxJsonFiles(),_0x4edbf6=loadProfilesFromDirectories();if(_0x4edbf6[_0x2ffe3b(0x18b)]>0x0){const _0x914fe4=_0x4edbf6['map'](_0x511ebc=>_0x511ebc[_0x2ffe3b(0x162)])[_0x2ffe3b(0x15d)](',\x20'),_0x3bc943=getConfigDir();console['warn'](_0x2ffe3b(0x166)+_0x914fe4),console[_0x2ffe3b(0x191)](_0x2ffe3b(0x170)),console[_0x2ffe3b(0x191)]('\x20\x201.\x20Edit:\x20'+a62_0x1afde8[_0x2ffe3b(0x15d)](_0x3bc943,_0x2ffe3b(0x14f))),console[_0x2ffe3b(0x191)](_0x2ffe3b(0x16d)),console['warn'](_0x2ffe3b(0x196));}const _0x39aa07=[..._0x446687,..._0x4edbf6],_0x59226f=new Map();for(const _0x192b1b of _0x39aa07){!_0x59226f[_0x2ffe3b(0x188)](_0x192b1b[_0x2ffe3b(0x162)])&&_0x59226f[_0x2ffe3b(0x190)](_0x192b1b[_0x2ffe3b(0x162)],_0x192b1b);}return Array[_0x2ffe3b(0x168)](_0x59226f[_0x2ffe3b(0x154)]())[_0x2ffe3b(0x177)]((_0x27c8b5,_0x4c47ff)=>_0x27c8b5[_0x2ffe3b(0x162)][_0x2ffe3b(0x156)](_0x4c47ff[_0x2ffe3b(0x162)]));}export function profileExists(_0x383b56){const _0x156b22=a62_0x12c943,_0x115c4d=listProfiles();return _0x115c4d['some'](_0x47a37f=>_0x47a37f[_0x156b22(0x162)]===_0x383b56);}export function loadProfile(_0x4acf73){const _0x46ed94=a62_0x12c943;validateProfileName(_0x4acf73);const _0x3d28d5=listProfiles(),_0x55c497=_0x3d28d5[_0x46ed94(0x171)](_0x54576d=>_0x54576d[_0x46ed94(0x162)]===_0x4acf73);return _0x55c497||null;}export function saveProfile(_0x24e00a,_0x58c400,_0x1a2e41=![]){saveProfileToUserConfig(_0x24e00a,_0x58c400);}export function deleteProfile(_0x10585c){const _0x507889=a62_0x12c943;validateProfileName(_0x10585c);const _0x49c454=getProfileDir(_0x10585c);if(!a62_0x3fa0a7[_0x507889(0x189)](_0x49c454))throw new Error(_0x507889(0x159)+_0x10585c+_0x507889(0x181));a62_0x3fa0a7['rmSync'](_0x49c454,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x1d23e2,_0x254d18){const _0x2320a0=a62_0x12c943;validateProfileName(_0x1d23e2);const _0x4cd05d=getGlobalConfigPath(),_0x4fcdd0=getConfigDir();!a62_0x3fa0a7[_0x2320a0(0x189)](_0x4fcdd0)&&createSecureDirectory(_0x4fcdd0);let _0xa9458e={};if(a62_0x3fa0a7['existsSync'](_0x4cd05d))try{const _0x45fb59=a62_0x3fa0a7['readFileSync'](_0x4cd05d,_0x2320a0(0x15e));_0xa9458e=JSON[_0x2320a0(0x1a2)](_0x45fb59);}catch{console[_0x2320a0(0x191)](_0x2320a0(0x180)+_0x4cd05d+_0x2320a0(0x187));}!_0xa9458e[_0x2320a0(0x19d)]&&(_0xa9458e[_0x2320a0(0x19d)]={}),_0xa9458e['profiles'][_0x1d23e2]=_0x254d18,writeSecureFile(_0x4cd05d,JSON[_0x2320a0(0x15c)](_0xa9458e,null,0x2));}export function removeProfileFromUserConfig(_0xe6d263){const _0x5cb2a1=a62_0x12c943;validateProfileName(_0xe6d263);const _0x371258=getGlobalConfigPath();if(!a62_0x3fa0a7[_0x5cb2a1(0x189)](_0x371258))throw new Error(_0x5cb2a1(0x179)+_0xe6d263+'\x27\x20not\x20found\x20in\x20user\x20configuration');let _0x53af8d={};try{const _0x15b326=a62_0x3fa0a7[_0x5cb2a1(0x19a)](_0x371258,'utf-8');_0x53af8d=JSON[_0x5cb2a1(0x1a2)](_0x15b326);}catch{throw new Error(_0x5cb2a1(0x15b)+_0x371258);}if(!_0x53af8d[_0x5cb2a1(0x19d)]||!_0x53af8d[_0x5cb2a1(0x19d)][_0xe6d263])throw new Error(_0x5cb2a1(0x179)+_0xe6d263+_0x5cb2a1(0x158));delete _0x53af8d[_0x5cb2a1(0x19d)][_0xe6d263],_0x53af8d['profile']===_0xe6d263&&delete _0x53af8d[_0x5cb2a1(0x17e)],writeSecureFile(_0x371258,JSON[_0x5cb2a1(0x15c)](_0x53af8d,null,0x2));}export function getActiveProfile(){const _0x52853a=a62_0x12c943,_0x32ab60=loadSessionContext();if(_0x32ab60?.[_0x52853a(0x17e)])return _0x32ab60[_0x52853a(0x17e)];if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x51b0be=getGlobalConfigPath();if(!a62_0x3fa0a7[_0x52853a(0x189)](_0x51b0be))return null;try{const _0x2e1419=a62_0x3fa0a7[_0x52853a(0x19a)](_0x51b0be,_0x52853a(0x15e)),_0x5975be=JSON['parse'](_0x2e1419);return _0x5975be[_0x52853a(0x17e)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x164a26){const _0x32a46a=a62_0x12c943,_0x7fbaf0=getGlobalConfigPath(),_0x4a1d4a=getConfigDir();!a62_0x3fa0a7['existsSync'](_0x4a1d4a)&&createSecureDirectory(_0x4a1d4a);let _0x44dc4b={};if(a62_0x3fa0a7[_0x32a46a(0x189)](_0x7fbaf0))try{const _0xa94b6=a62_0x3fa0a7[_0x32a46a(0x19a)](_0x7fbaf0,_0x32a46a(0x15e));_0x44dc4b=JSON[_0x32a46a(0x1a2)](_0xa94b6);}catch{console[_0x32a46a(0x191)](_0x32a46a(0x180)+_0x7fbaf0+_0x32a46a(0x187));}_0x44dc4b[_0x32a46a(0x186)]=_0x164a26,writeSecureFile(_0x7fbaf0,JSON['stringify'](_0x44dc4b,null,0x2));}export function saveActiveProfileToUserConfig(_0x903268){const _0x381486=a62_0x12c943;validateProfileName(_0x903268);const _0x4c40a6=getGlobalConfigPath(),_0x1f7ec3=getConfigDir();!a62_0x3fa0a7[_0x381486(0x189)](_0x1f7ec3)&&createSecureDirectory(_0x1f7ec3);let _0x517eb0={};if(a62_0x3fa0a7[_0x381486(0x189)](_0x4c40a6))try{const _0x1e073e=a62_0x3fa0a7['readFileSync'](_0x4c40a6,'utf-8');_0x517eb0=JSON[_0x381486(0x1a2)](_0x1e073e);}catch{console[_0x381486(0x191)]('Warning:\x20Failed\x20to\x20parse\x20'+_0x4c40a6+_0x381486(0x187));}_0x517eb0[_0x381486(0x17e)]=_0x903268,writeSecureFile(_0x4c40a6,JSON[_0x381486(0x15c)](_0x517eb0,null,0x2));}function clearFieldFromUserConfig(_0x3f310f){const _0x2c16e0=a62_0x12c943,_0x100b6=getGlobalConfigPath();if(!a62_0x3fa0a7['existsSync'](_0x100b6))return;let _0x3bdae7={};try{const _0x4cd971=a62_0x3fa0a7[_0x2c16e0(0x19a)](_0x100b6,_0x2c16e0(0x15e));_0x3bdae7=JSON[_0x2c16e0(0x1a2)](_0x4cd971);}catch{return;}delete _0x3bdae7[_0x3f310f],writeSecureFile(_0x100b6,JSON[_0x2c16e0(0x15c)](_0x3bdae7,null,0x2));}export function clearDefaultSiteFromUserConfig(){clearFieldFromUserConfig('site');}export function clearActiveProfileFromUserConfig(){const _0x16b0b7=a62_0x12c943;clearFieldFromUserConfig(_0x16b0b7(0x17e));}export function createProfile(_0x55deb5,_0x2ab87e){const _0x21d79f=a62_0x12c943;validateProfileName(_0x55deb5);if(profileExists(_0x55deb5))throw new Error(_0x21d79f(0x159)+_0x55deb5+'\x20already\x20exists');saveProfile(_0x55deb5,_0x2ab87e);}export function saveProfileCredentials(_0x2b6f49,_0x31912b){const _0x451950=a62_0x12c943;validateProfileName(_0x2b6f49);if(!profileExists(_0x2b6f49))throw new Error(_0x451950(0x159)+_0x2b6f49+_0x451950(0x181));const _0x812e1=getNewCredentialPath(_0x2b6f49);writeSecureFile(_0x812e1,_0x31912b);}export function loadProfileCredentials(_0x2fe783){const _0x898afc=a62_0x12c943;validateProfileName(_0x2fe783);const _0x52930a=getNewCredentialPath(_0x2fe783);if(a62_0x3fa0a7['existsSync'](_0x52930a))try{return a62_0x3fa0a7['readFileSync'](_0x52930a,_0x898afc(0x15e));}catch{}const _0x58a121=getOldCredentialPath(_0x2fe783);if(a62_0x3fa0a7[_0x898afc(0x189)](_0x58a121)){console[_0x898afc(0x191)]('\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27'+_0x2fe783+'\x27'),console['warn'](_0x898afc(0x17b)),console[_0x898afc(0x191)](_0x898afc(0x183)+_0x58a121+_0x898afc(0x151)+_0x52930a+'\x22'),console[_0x898afc(0x191)](_0x898afc(0x178));try{return a62_0x3fa0a7[_0x898afc(0x19a)](_0x58a121,'utf-8');}catch{return null;}}return null;}
@@ -1 +1 @@
1
- (function(_0x5efa74,_0x237e90){const _0x51eb1f=a63_0x14d9,_0x1232c3=_0x5efa74();while(!![]){try{const _0x560650=-parseInt(_0x51eb1f(0xb6))/0x1*(parseInt(_0x51eb1f(0xc4))/0x2)+-parseInt(_0x51eb1f(0xa7))/0x3*(-parseInt(_0x51eb1f(0xc1))/0x4)+-parseInt(_0x51eb1f(0xae))/0x5+parseInt(_0x51eb1f(0xab))/0x6*(parseInt(_0x51eb1f(0xac))/0x7)+-parseInt(_0x51eb1f(0xb7))/0x8+-parseInt(_0x51eb1f(0xbf))/0x9*(parseInt(_0x51eb1f(0xad))/0xa)+parseInt(_0x51eb1f(0xb2))/0xb*(parseInt(_0x51eb1f(0xbc))/0xc);if(_0x560650===_0x237e90)break;else _0x1232c3['push'](_0x1232c3['shift']());}catch(_0x146da2){_0x1232c3['push'](_0x1232c3['shift']());}}}(a63_0x4693,0xa32fe));function a63_0x14d9(_0x5c5b81,_0x2de7a6){_0x5c5b81=_0x5c5b81-0xa7;const _0x46934d=a63_0x4693();let _0x14d935=_0x46934d[_0x5c5b81];return _0x14d935;}import*as a63_0x579c82 from'node:fs';import*as a63_0xec9186 from'node:path';const PROJECT_CONFIG_FILENAME='tdx.json';export function findProjectConfigPath(_0x127bdc){const _0x3bfb87=a63_0x14d9;let _0x41c7d6=_0x127bdc||process[_0x3bfb87(0xbd)]();while(!![]){const _0x4a6d74=a63_0xec9186[_0x3bfb87(0xb8)](_0x41c7d6,PROJECT_CONFIG_FILENAME);if(a63_0x579c82[_0x3bfb87(0xa9)](_0x4a6d74))return _0x4a6d74;const _0xfda61d=a63_0xec9186[_0x3bfb87(0xba)](_0x41c7d6);if(_0xfda61d===_0x41c7d6)return null;_0x41c7d6=_0xfda61d;}}export function loadProjectConfig(_0x34d161){const _0x4847fe=a63_0x14d9,_0x5b9cd2=findProjectConfigPath(_0x34d161);if(!_0x5b9cd2)return null;try{const _0x309b33=a63_0x579c82['readFileSync'](_0x5b9cd2,_0x4847fe(0xb0)),_0x239f94=JSON[_0x4847fe(0xbb)](_0x309b33),_0x7c0949=JSON[_0x4847fe(0xc3)](_0x239f94);if(_0x7c0949[_0x4847fe(0xb3)]('TD_API_KEY')||_0x7c0949[_0x4847fe(0xb3)]('apiKey')||_0x7c0949[_0x4847fe(0xb3)](_0x4847fe(0xaa)))throw new Error(_0x4847fe(0xb1)+_0x5b9cd2+').\x20'+'Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.');const {metadata:_0x454376,profile:_0x17f38d,..._0x3a0b02}=_0x239f94;return _0x17f38d&&console[_0x4847fe(0xaf)]('Warning:\x20\x27profile\x27\x20field\x20in\x20'+_0x5b9cd2+_0x4847fe(0xa8)+'Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json'),_0x3a0b02;}catch(_0x1d6dba){if(_0x1d6dba instanceof Error&&_0x4847fe(0xc5)in _0x1d6dba&&_0x1d6dba[_0x4847fe(0xc5)]==='ENOENT')return null;throw new Error(_0x4847fe(0xbe)+_0x5b9cd2+':\x20'+_0x1d6dba);}}export function saveProjectConfig(_0x523b33,_0x6036f2){const _0x1d22f6=a63_0x14d9,_0x2d60d4=_0x6036f2||process[_0x1d22f6(0xbd)](),_0x4eadab=a63_0xec9186['join'](_0x2d60d4,PROJECT_CONFIG_FILENAME),_0x36eb3d=JSON[_0x1d22f6(0xc3)](_0x523b33);if(_0x36eb3d[_0x1d22f6(0xb3)](_0x1d22f6(0xc0))||_0x36eb3d[_0x1d22f6(0xb3)]('apiKey')||_0x36eb3d[_0x1d22f6(0xb3)]('api_key'))throw new Error(_0x1d22f6(0xc2));if(_0x1d22f6(0xb9)in _0x523b33)throw new Error(_0x1d22f6(0xb4));a63_0x579c82[_0x1d22f6(0xb5)](_0x4eadab,JSON[_0x1d22f6(0xc3)](_0x523b33,null,0x2));}export function hasProjectConfig(_0x4f60c3){return findProjectConfigPath(_0x4f60c3)!==null;}export function getProjectRoot(_0x3698a4){const _0x96e350=findProjectConfigPath(_0x3698a4);return _0x96e350?a63_0xec9186['dirname'](_0x96e350):null;}function a63_0x4693(){const _0x3d0dc4=['12SWcXeO','cwd','Failed\x20to\x20load\x20project\x20config\x20from\x20','96804AiPTXE','TD_API_KEY','744404VHSGBO','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','stringify','4ztimsp','code','9PrQywO','\x20is\x20ignored.\x20','existsSync','api_key','13074lMjEbT','1106GVDNyQ','980GqQMeH','5708685okvRTE','warn','utf-8','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','39165929CenSXD','includes','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','writeFileSync','207814cTSsUF','9466056ipSEmR','join','profile','dirname','parse'];a63_0x4693=function(){return _0x3d0dc4;};return a63_0x4693();}
1
+ function a63_0x2d4f(_0x49792b,_0x3c1494){_0x49792b=_0x49792b-0x1b9;const _0x89952=a63_0x8995();let _0x2d4ff0=_0x89952[_0x49792b];return _0x2d4ff0;}const a63_0x31e863=a63_0x2d4f;function a63_0x8995(){const _0x34a0fd=['165492zlGncq','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','warn','125GbkBlP','dirname','242645fysRwu','7XPVnpZ','includes','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','readFileSync','existsSync','30wRQkvl','tdx.json','ENOENT','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','stringify','api_key','2204502idyMni','944688wJdIhB','3YCuZGP','writeFileSync','TD_API_KEY','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','code','join','664FURzfE','apiKey','677844RtzHot','utf-8','12739133rnjnob','\x20is\x20ignored.\x20','cwd'];a63_0x8995=function(){return _0x34a0fd;};return a63_0x8995();}(function(_0x4e923d,_0x56c546){const _0x3577cf=a63_0x2d4f,_0x4a1bb3=_0x4e923d();while(!![]){try{const _0xf77cee=-parseInt(_0x3577cf(0x1c9))/0x1+parseInt(_0x3577cf(0x1bf))/0x2*(-parseInt(_0x3577cf(0x1d7))/0x3)+parseInt(_0x3577cf(0x1bd))/0x4*(-parseInt(_0x3577cf(0x1c7))/0x5)+parseInt(_0x3577cf(0x1d5))/0x6*(-parseInt(_0x3577cf(0x1ca))/0x7)+parseInt(_0x3577cf(0x1d6))/0x8+-parseInt(_0x3577cf(0x1c4))/0x9*(parseInt(_0x3577cf(0x1cf))/0xa)+parseInt(_0x3577cf(0x1c1))/0xb;if(_0xf77cee===_0x56c546)break;else _0x4a1bb3['push'](_0x4a1bb3['shift']());}catch(_0x2c5286){_0x4a1bb3['push'](_0x4a1bb3['shift']());}}}(a63_0x8995,0x41673));import*as a63_0x3480e7 from'node:fs';import*as a63_0x5f5bcd from'node:path';const PROJECT_CONFIG_FILENAME=a63_0x31e863(0x1d0);export function findProjectConfigPath(_0x4dba60){const _0x2f6a98=a63_0x31e863;let _0x244dfe=_0x4dba60||process['cwd']();while(!![]){const _0x47197b=a63_0x5f5bcd[_0x2f6a98(0x1bc)](_0x244dfe,PROJECT_CONFIG_FILENAME);if(a63_0x3480e7[_0x2f6a98(0x1ce)](_0x47197b))return _0x47197b;const _0xa82d4a=a63_0x5f5bcd[_0x2f6a98(0x1c8)](_0x244dfe);if(_0xa82d4a===_0x244dfe)return null;_0x244dfe=_0xa82d4a;}}export function loadProjectConfig(_0x23c143){const _0x4bb0d1=a63_0x31e863,_0x130bf7=findProjectConfigPath(_0x23c143);if(!_0x130bf7)return null;try{const _0x2a3448=a63_0x3480e7[_0x4bb0d1(0x1cd)](_0x130bf7,_0x4bb0d1(0x1c0)),_0x1ad268=JSON['parse'](_0x2a3448),_0x3ac559=JSON['stringify'](_0x1ad268);if(_0x3ac559[_0x4bb0d1(0x1cb)](_0x4bb0d1(0x1b9))||_0x3ac559['includes']('apiKey')||_0x3ac559[_0x4bb0d1(0x1cb)]('api_key'))throw new Error(_0x4bb0d1(0x1c5)+_0x130bf7+').\x20'+'Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.');const {metadata:_0x333d94,profile:_0x38ee0d,..._0xe956b}=_0x1ad268;return _0x38ee0d&&console[_0x4bb0d1(0x1c6)]('Warning:\x20\x27profile\x27\x20field\x20in\x20'+_0x130bf7+_0x4bb0d1(0x1c2)+_0x4bb0d1(0x1ba)),_0xe956b;}catch(_0x393665){if(_0x393665 instanceof Error&&_0x4bb0d1(0x1bb)in _0x393665&&_0x393665[_0x4bb0d1(0x1bb)]===_0x4bb0d1(0x1d1))return null;throw new Error('Failed\x20to\x20load\x20project\x20config\x20from\x20'+_0x130bf7+':\x20'+_0x393665);}}export function saveProjectConfig(_0x1eacb1,_0x49458d){const _0x1a9252=a63_0x31e863,_0x13b506=_0x49458d||process[_0x1a9252(0x1c3)](),_0x125f7c=a63_0x5f5bcd[_0x1a9252(0x1bc)](_0x13b506,PROJECT_CONFIG_FILENAME),_0x553468=JSON[_0x1a9252(0x1d3)](_0x1eacb1);if(_0x553468['includes'](_0x1a9252(0x1b9))||_0x553468[_0x1a9252(0x1cb)](_0x1a9252(0x1be))||_0x553468[_0x1a9252(0x1cb)](_0x1a9252(0x1d4)))throw new Error(_0x1a9252(0x1d2));if('profile'in _0x1eacb1)throw new Error(_0x1a9252(0x1cc));a63_0x3480e7[_0x1a9252(0x1d8)](_0x125f7c,JSON[_0x1a9252(0x1d3)](_0x1eacb1,null,0x2));}export function hasProjectConfig(_0xb7ebb4){return findProjectConfigPath(_0xb7ebb4)!==null;}export function getProjectRoot(_0x148c5c){const _0x5dada3=a63_0x31e863,_0x3e251d=findProjectConfigPath(_0x148c5c);return _0x3e251d?a63_0x5f5bcd[_0x5dada3(0x1c8)](_0x3e251d):null;}
@@ -1 +1 @@
1
- function a64_0x1796(_0x17d0f3,_0x238722){_0x17d0f3=_0x17d0f3-0xa8;const _0x364eba=a64_0x364e();let _0x179641=_0x364eba[_0x17d0f3];return _0x179641;}(function(_0x3c9071,_0x8f1e06){const _0x42364=a64_0x1796,_0x2fa70d=_0x3c9071();while(!![]){try{const _0x59e380=-parseInt(_0x42364(0xb4))/0x1*(parseInt(_0x42364(0xb2))/0x2)+-parseInt(_0x42364(0xce))/0x3*(-parseInt(_0x42364(0xc0))/0x4)+parseInt(_0x42364(0xab))/0x5+parseInt(_0x42364(0xaa))/0x6*(parseInt(_0x42364(0xbf))/0x7)+-parseInt(_0x42364(0xac))/0x8+-parseInt(_0x42364(0xcf))/0x9+parseInt(_0x42364(0xbb))/0xa*(parseInt(_0x42364(0xc1))/0xb);if(_0x59e380===_0x8f1e06)break;else _0x2fa70d['push'](_0x2fa70d['shift']());}catch(_0x4ca7a4){_0x2fa70d['push'](_0x2fa70d['shift']());}}}(a64_0x364e,0x8c2dd));import*as a64_0x5a4fb4 from'node:fs';import*as a64_0xdf1ae4 from'node:path';function a64_0x364e(){const _0x1ddd10=['2746300qImyrN','3288768atPwLI','warn','now','readFileSync','homedir','.\x20This\x20is\x20insecure.\x20Removing\x20session.','64BtalWF','stringify','5848pqPeYk','existsSync','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','toString','readdirSync','unlinkSync','.json','320HfoYpx','includes','toISOString','TD_API_KEY','245175pBacyZ','10624jKDKJy','192467SSkDOV','replace','join','createdAt','sessions','sort','endsWith','test','api_key','writeFileSync','getTime','parse','apiKey','3aZLmvE','1030860rgXPyk','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','utf-8','30HmPONe'];a64_0x364e=function(){return _0x1ddd10;};return a64_0x364e();}import*as a64_0xf26ded from'node:os';import{getPPID,isProcessRunning}from'../utils/process.js';import{createSecureDirectory}from'../utils/file-permissions.js';const SESSION_EXPIRATION_MS=0x18*0x3c*0x3c*0x3e8;function getSessionsDir(){const _0x59bfc2=a64_0x1796,_0x41141c=process.env.TDX_CONFIG_DIR||a64_0xdf1ae4[_0x59bfc2(0xc3)](a64_0xf26ded[_0x59bfc2(0xb0)](),'.config','tdx');return a64_0xdf1ae4['join'](_0x41141c,_0x59bfc2(0xc5));}function getSessionPath(_0x64faa1){const _0x2cfbe7=a64_0x1796;return a64_0xdf1ae4['join'](getSessionsDir(),_0x64faa1+_0x2cfbe7(0xba));}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x55ac70){const _0x393b90=a64_0x1796;if(_0x55ac70)return _0x55ac70;if(process.env.TDX_SESSION)return process.env.TDX_SESSION;return getCurrentSessionPID()[_0x393b90(0xb7)]();}export function loadSessionContext(_0xc9416d){const _0x1e9ca9=a64_0x1796,_0x107775=getSessionID(_0xc9416d),_0x4a9e81=/^\d+$/[_0x1e9ca9(0xc8)](_0x107775)?parseInt(_0x107775,0xa):null;return _0x4a9e81!==null?loadSessionContextByPID(_0x4a9e81):loadSessionContextByString(_0x107775);}export function loadSessionContextByPID(_0x4a232b){const _0x4d856e=a64_0x1796,_0x3f1457=getSessionPath(_0x4a232b);if(!a64_0x5a4fb4['existsSync'](_0x3f1457))return null;try{const _0x204bbd=a64_0x5a4fb4[_0x4d856e(0xaf)](_0x3f1457,_0x4d856e(0xa9)),_0x47f005=JSON[_0x4d856e(0xcc)](_0x204bbd),_0x310321=new Date(_0x47f005[_0x4d856e(0xc4)])['getTime'](),_0x196b9c=Date['now']();if(_0x196b9c-_0x310321>SESSION_EXPIRATION_MS)return a64_0x5a4fb4[_0x4d856e(0xb9)](_0x3f1457),null;const _0x361fe=JSON[_0x4d856e(0xb3)](_0x47f005);if(_0x361fe[_0x4d856e(0xbc)](_0x4d856e(0xbe))||_0x361fe[_0x4d856e(0xbc)]('apiKey')||_0x361fe[_0x4d856e(0xbc)]('api_key'))return console['warn']('Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20'+_0x3f1457+_0x4d856e(0xb1)),a64_0x5a4fb4[_0x4d856e(0xb9)](_0x3f1457),null;return _0x47f005;}catch{try{a64_0x5a4fb4['unlinkSync'](_0x3f1457);}catch{}return null;}}function loadSessionContextByString(_0x519953){const _0x2c2071=a64_0x1796,_0x4263d6=a64_0xdf1ae4['join'](getSessionsDir(),_0x519953+_0x2c2071(0xba));if(!a64_0x5a4fb4[_0x2c2071(0xb5)](_0x4263d6))return null;try{const _0x5b4226=a64_0x5a4fb4[_0x2c2071(0xaf)](_0x4263d6,'utf-8'),_0x1320b7=JSON[_0x2c2071(0xcc)](_0x5b4226),_0x56dbb2=new Date(_0x1320b7[_0x2c2071(0xc4)])['getTime'](),_0x136568=Date['now']();if(_0x136568-_0x56dbb2>SESSION_EXPIRATION_MS)return a64_0x5a4fb4[_0x2c2071(0xb9)](_0x4263d6),null;const _0x45c947=JSON[_0x2c2071(0xb3)](_0x1320b7);if(_0x45c947[_0x2c2071(0xbc)](_0x2c2071(0xbe))||_0x45c947[_0x2c2071(0xbc)](_0x2c2071(0xcd))||_0x45c947[_0x2c2071(0xbc)](_0x2c2071(0xc9)))return console[_0x2c2071(0xad)](_0x2c2071(0xb6)+_0x4263d6+'.\x20This\x20is\x20insecure.\x20Removing\x20session.'),a64_0x5a4fb4[_0x2c2071(0xb9)](_0x4263d6),null;return _0x1320b7;}catch{try{a64_0x5a4fb4['unlinkSync'](_0x4263d6);}catch{}return null;}}export function saveSessionContext(_0x52fb71,_0x444aca){const _0x1487af=a64_0x1796,_0x30421e=getSessionID(_0x444aca),_0x246b3b=/^\d+$/[_0x1487af(0xc8)](_0x30421e)?parseInt(_0x30421e,0xa):getCurrentSessionPID(),_0x421668=a64_0xdf1ae4[_0x1487af(0xc3)](getSessionsDir(),_0x30421e+_0x1487af(0xba)),_0x689245=getSessionsDir();createSecureDirectory(_0x689245);const _0x48669d=JSON['stringify'](_0x52fb71);if(_0x48669d[_0x1487af(0xbc)](_0x1487af(0xbe))||_0x48669d[_0x1487af(0xbc)](_0x1487af(0xcd))||_0x48669d[_0x1487af(0xbc)](_0x1487af(0xc9)))throw new Error(_0x1487af(0xa8));let _0x118080;const _0x11580d=/^\d+$/[_0x1487af(0xc8)](_0x30421e)?loadSessionContextByPID(parseInt(_0x30421e,0xa)):loadSessionContextByString(_0x30421e);_0x11580d?_0x118080={..._0x11580d,..._0x52fb71,'pid':_0x246b3b,'sessionId':_0x30421e!==_0x246b3b['toString']()?_0x30421e:undefined,'updatedAt':new Date()[_0x1487af(0xbd)]()}:_0x118080={'pid':_0x246b3b,'sessionId':_0x30421e!==_0x246b3b[_0x1487af(0xb7)]()?_0x30421e:undefined,..._0x52fb71,'createdAt':new Date()[_0x1487af(0xbd)](),'updatedAt':new Date()['toISOString']()},a64_0x5a4fb4[_0x1487af(0xca)](_0x421668,JSON[_0x1487af(0xb3)](_0x118080,null,0x2));}export function clearSessionContext(_0x138758){const _0x2f3e58=a64_0x1796,_0x31a776=getSessionID(_0x138758),_0x22b270=a64_0xdf1ae4[_0x2f3e58(0xc3)](getSessionsDir(),_0x31a776+'.json');a64_0x5a4fb4[_0x2f3e58(0xb5)](_0x22b270)&&a64_0x5a4fb4[_0x2f3e58(0xb9)](_0x22b270);}export function clearSessionContextField(_0x10c205,_0x59eb94){const _0x3e3f03=a64_0x1796,_0x193f64=getSessionID(_0x59eb94),_0x298575=a64_0xdf1ae4[_0x3e3f03(0xc3)](getSessionsDir(),_0x193f64+_0x3e3f03(0xba));if(!a64_0x5a4fb4['existsSync'](_0x298575))return;try{const _0x29d161=a64_0x5a4fb4['readFileSync'](_0x298575,_0x3e3f03(0xa9)),_0x5ef560=JSON[_0x3e3f03(0xcc)](_0x29d161);delete _0x5ef560[_0x10c205],a64_0x5a4fb4['writeFileSync'](_0x298575,JSON[_0x3e3f03(0xb3)](_0x5ef560,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x6dfc5d=a64_0x1796,_0x48cad9=getSessionsDir();if(!a64_0x5a4fb4['existsSync'](_0x48cad9))return 0x0;let _0x4ec3c6=0x0;const _0x4a8696=Date[_0x6dfc5d(0xae)]();try{const _0x32fabd=a64_0x5a4fb4[_0x6dfc5d(0xb8)](_0x48cad9);for(const _0x216d0a of _0x32fabd){if(!_0x216d0a[_0x6dfc5d(0xc7)](_0x6dfc5d(0xba)))continue;const _0x3b968b=a64_0xdf1ae4[_0x6dfc5d(0xc3)](_0x48cad9,_0x216d0a),_0x243c12=_0x216d0a[_0x6dfc5d(0xc2)]('.json',''),_0x57d812=parseInt(_0x243c12,0xa),_0x45bd2=!isNaN(_0x57d812);if(_0x45bd2){if(!isProcessRunning(_0x57d812)){a64_0x5a4fb4['unlinkSync'](_0x3b968b),_0x4ec3c6++;continue;}}try{const _0x24c933=a64_0x5a4fb4['readFileSync'](_0x3b968b,_0x6dfc5d(0xa9)),_0x55a922=JSON[_0x6dfc5d(0xcc)](_0x24c933),_0x330c40=new Date(_0x55a922[_0x6dfc5d(0xc4)])[_0x6dfc5d(0xcb)]();_0x4a8696-_0x330c40>SESSION_EXPIRATION_MS&&(a64_0x5a4fb4[_0x6dfc5d(0xb9)](_0x3b968b),_0x4ec3c6++);}catch{a64_0x5a4fb4[_0x6dfc5d(0xb9)](_0x3b968b),_0x4ec3c6++;}}}catch{}return _0x4ec3c6;}export function listActiveSessions(){const _0x550db0=a64_0x1796,_0x17b95b=getSessionsDir();if(!a64_0x5a4fb4['existsSync'](_0x17b95b))return[];try{const _0x463218=a64_0x5a4fb4[_0x550db0(0xb8)](_0x17b95b),_0x2ac6c7=[];for(const _0x4f67a6 of _0x463218){if(!_0x4f67a6[_0x550db0(0xc7)](_0x550db0(0xba)))continue;const _0x5d95e8=_0x4f67a6[_0x550db0(0xc2)](_0x550db0(0xba),''),_0x596f05=parseInt(_0x5d95e8,0xa);!isNaN(_0x596f05)&&isProcessRunning(_0x596f05)&&_0x2ac6c7['push'](_0x596f05);}return _0x2ac6c7[_0x550db0(0xc6)]((_0x30489d,_0x174e6c)=>_0x30489d-_0x174e6c);}catch{return[];}}
1
+ (function(_0x4b3df1,_0x218216){const _0x15d5df=a64_0x40a1,_0x405a4b=_0x4b3df1();while(!![]){try{const _0x60dc67=parseInt(_0x15d5df(0x1ba))/0x1*(parseInt(_0x15d5df(0x1ac))/0x2)+-parseInt(_0x15d5df(0x1ab))/0x3+-parseInt(_0x15d5df(0x1bc))/0x4*(-parseInt(_0x15d5df(0x1b1))/0x5)+parseInt(_0x15d5df(0x1be))/0x6+-parseInt(_0x15d5df(0x1cc))/0x7+parseInt(_0x15d5df(0x1b6))/0x8*(-parseInt(_0x15d5df(0x1ce))/0x9)+parseInt(_0x15d5df(0x1c4))/0xa;if(_0x60dc67===_0x218216)break;else _0x405a4b['push'](_0x405a4b['shift']());}catch(_0x58573f){_0x405a4b['push'](_0x405a4b['shift']());}}}(a64_0x16aa,0xe76d4));import*as a64_0x5d9cdf from'node:fs';import*as a64_0x2c1848 from'node:path';import*as a64_0x12351a 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 _0x196a80=a64_0x40a1,_0x3d665b=process.env.TDX_CONFIG_DIR||a64_0x2c1848[_0x196a80(0x1bf)](a64_0x12351a[_0x196a80(0x1b8)](),_0x196a80(0x1c2),'tdx');return a64_0x2c1848['join'](_0x3d665b,_0x196a80(0x1cd));}function getSessionPath(_0x5dc015){const _0x2e6cdf=a64_0x40a1;return a64_0x2c1848[_0x2e6cdf(0x1bf)](getSessionsDir(),_0x5dc015+_0x2e6cdf(0x1c9));}function a64_0x40a1(_0x33abc3,_0x5bba28){_0x33abc3=_0x33abc3-0x1ab;const _0x16aaf5=a64_0x16aa();let _0x40a152=_0x16aaf5[_0x33abc3];return _0x40a152;}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x59f73f){const _0x3e5766=a64_0x40a1;if(_0x59f73f)return _0x59f73f;if(process.env.TDX_SESSION)return process.env.TDX_SESSION;return getCurrentSessionPID()[_0x3e5766(0x1c7)]();}export function loadSessionContext(_0x55ff2d){const _0x43b686=getSessionID(_0x55ff2d),_0x134dc0=/^\d+$/['test'](_0x43b686)?parseInt(_0x43b686,0xa):null;return _0x134dc0!==null?loadSessionContextByPID(_0x134dc0):loadSessionContextByString(_0x43b686);}export function loadSessionContextByPID(_0x44886c){const _0x163e85=a64_0x40a1,_0x58d376=getSessionPath(_0x44886c);if(!a64_0x5d9cdf[_0x163e85(0x1b7)](_0x58d376))return null;try{const _0x1f8e78=a64_0x5d9cdf[_0x163e85(0x1b9)](_0x58d376,_0x163e85(0x1c6)),_0x229d3c=JSON[_0x163e85(0x1bb)](_0x1f8e78),_0x1f271e=new Date(_0x229d3c[_0x163e85(0x1c0)])[_0x163e85(0x1b0)](),_0x3a7079=Date[_0x163e85(0x1ca)]();if(_0x3a7079-_0x1f271e>SESSION_EXPIRATION_MS)return a64_0x5d9cdf[_0x163e85(0x1b2)](_0x58d376),null;const _0x2d5dca=JSON[_0x163e85(0x1cf)](_0x229d3c);if(_0x2d5dca[_0x163e85(0x1c1)](_0x163e85(0x1b3))||_0x2d5dca['includes']('apiKey')||_0x2d5dca['includes'](_0x163e85(0x1d0)))return console[_0x163e85(0x1bd)](_0x163e85(0x1ad)+_0x58d376+'.\x20This\x20is\x20insecure.\x20Removing\x20session.'),a64_0x5d9cdf[_0x163e85(0x1b2)](_0x58d376),null;return _0x229d3c;}catch{try{a64_0x5d9cdf[_0x163e85(0x1b2)](_0x58d376);}catch{}return null;}}function a64_0x16aa(){const _0x340473=['existsSync','homedir','readFileSync','4NEEklO','parse','1960916PFOmlO','warn','2707500AwTCGd','join','createdAt','includes','.config','writeFileSync','43666830abkQdm','apiKey','utf-8','toString','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','.json','now','test','8733389Eadaka','sessions','27zfLurT','stringify','api_key','5506419uehkKX','20246oOQKKy','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','sort','readdirSync','getTime','5hlKZjb','unlinkSync','TD_API_KEY','toISOString','endsWith','3513680uqtTGK'];a64_0x16aa=function(){return _0x340473;};return a64_0x16aa();}function loadSessionContextByString(_0x6656b5){const _0x3e454a=a64_0x40a1,_0x584adf=a64_0x2c1848[_0x3e454a(0x1bf)](getSessionsDir(),_0x6656b5+_0x3e454a(0x1c9));if(!a64_0x5d9cdf[_0x3e454a(0x1b7)](_0x584adf))return null;try{const _0x41f80b=a64_0x5d9cdf[_0x3e454a(0x1b9)](_0x584adf,'utf-8'),_0x203295=JSON[_0x3e454a(0x1bb)](_0x41f80b),_0x5e2dc7=new Date(_0x203295[_0x3e454a(0x1c0)])[_0x3e454a(0x1b0)](),_0x56f235=Date[_0x3e454a(0x1ca)]();if(_0x56f235-_0x5e2dc7>SESSION_EXPIRATION_MS)return a64_0x5d9cdf[_0x3e454a(0x1b2)](_0x584adf),null;const _0x90edf3=JSON[_0x3e454a(0x1cf)](_0x203295);if(_0x90edf3[_0x3e454a(0x1c1)]('TD_API_KEY')||_0x90edf3[_0x3e454a(0x1c1)]('apiKey')||_0x90edf3[_0x3e454a(0x1c1)](_0x3e454a(0x1d0)))return console[_0x3e454a(0x1bd)](_0x3e454a(0x1ad)+_0x584adf+'.\x20This\x20is\x20insecure.\x20Removing\x20session.'),a64_0x5d9cdf['unlinkSync'](_0x584adf),null;return _0x203295;}catch{try{a64_0x5d9cdf['unlinkSync'](_0x584adf);}catch{}return null;}}export function saveSessionContext(_0x3e7f6b,_0x305b84){const _0x3b859e=a64_0x40a1,_0x736e79=getSessionID(_0x305b84),_0x2c9530=/^\d+$/[_0x3b859e(0x1cb)](_0x736e79)?parseInt(_0x736e79,0xa):getCurrentSessionPID(),_0x3bf29f=a64_0x2c1848[_0x3b859e(0x1bf)](getSessionsDir(),_0x736e79+'.json'),_0x27aa08=getSessionsDir();createSecureDirectory(_0x27aa08);const _0x4d1cb5=JSON[_0x3b859e(0x1cf)](_0x3e7f6b);if(_0x4d1cb5[_0x3b859e(0x1c1)]('TD_API_KEY')||_0x4d1cb5[_0x3b859e(0x1c1)](_0x3b859e(0x1c5))||_0x4d1cb5[_0x3b859e(0x1c1)]('api_key'))throw new Error(_0x3b859e(0x1c8));let _0x17ce57;const _0x4aa44d=/^\d+$/[_0x3b859e(0x1cb)](_0x736e79)?loadSessionContextByPID(parseInt(_0x736e79,0xa)):loadSessionContextByString(_0x736e79);_0x4aa44d?_0x17ce57={..._0x4aa44d,..._0x3e7f6b,'pid':_0x2c9530,'sessionId':_0x736e79!==_0x2c9530[_0x3b859e(0x1c7)]()?_0x736e79:undefined,'updatedAt':new Date()[_0x3b859e(0x1b4)]()}:_0x17ce57={'pid':_0x2c9530,'sessionId':_0x736e79!==_0x2c9530[_0x3b859e(0x1c7)]()?_0x736e79:undefined,..._0x3e7f6b,'createdAt':new Date()[_0x3b859e(0x1b4)](),'updatedAt':new Date()[_0x3b859e(0x1b4)]()},a64_0x5d9cdf[_0x3b859e(0x1c3)](_0x3bf29f,JSON['stringify'](_0x17ce57,null,0x2));}export function clearSessionContext(_0xc3630a){const _0xfea9d=a64_0x40a1,_0x4a22e5=getSessionID(_0xc3630a),_0x3fb274=a64_0x2c1848['join'](getSessionsDir(),_0x4a22e5+_0xfea9d(0x1c9));a64_0x5d9cdf[_0xfea9d(0x1b7)](_0x3fb274)&&a64_0x5d9cdf[_0xfea9d(0x1b2)](_0x3fb274);}export function clearSessionContextField(_0x406b21,_0x598c0b){const _0xfe80c4=a64_0x40a1,_0x3f3c1f=getSessionID(_0x598c0b),_0x3501a9=a64_0x2c1848[_0xfe80c4(0x1bf)](getSessionsDir(),_0x3f3c1f+_0xfe80c4(0x1c9));if(!a64_0x5d9cdf[_0xfe80c4(0x1b7)](_0x3501a9))return;try{const _0x3c88cc=a64_0x5d9cdf[_0xfe80c4(0x1b9)](_0x3501a9,_0xfe80c4(0x1c6)),_0x37f2a3=JSON['parse'](_0x3c88cc);delete _0x37f2a3[_0x406b21],a64_0x5d9cdf[_0xfe80c4(0x1c3)](_0x3501a9,JSON[_0xfe80c4(0x1cf)](_0x37f2a3,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0xe14056=a64_0x40a1,_0x4f9092=getSessionsDir();if(!a64_0x5d9cdf['existsSync'](_0x4f9092))return 0x0;let _0x2840fa=0x0;const _0x376c0f=Date[_0xe14056(0x1ca)]();try{const _0x23ad31=a64_0x5d9cdf[_0xe14056(0x1af)](_0x4f9092);for(const _0xacb772 of _0x23ad31){if(!_0xacb772[_0xe14056(0x1b5)](_0xe14056(0x1c9)))continue;const _0x5a69a9=a64_0x2c1848['join'](_0x4f9092,_0xacb772),_0x4fac69=_0xacb772['replace'](_0xe14056(0x1c9),''),_0x3d57fa=parseInt(_0x4fac69,0xa),_0x204751=!isNaN(_0x3d57fa);if(_0x204751){if(!isProcessRunning(_0x3d57fa)){a64_0x5d9cdf['unlinkSync'](_0x5a69a9),_0x2840fa++;continue;}}try{const _0x5cc869=a64_0x5d9cdf['readFileSync'](_0x5a69a9,_0xe14056(0x1c6)),_0x149028=JSON[_0xe14056(0x1bb)](_0x5cc869),_0x14b143=new Date(_0x149028[_0xe14056(0x1c0)])[_0xe14056(0x1b0)]();_0x376c0f-_0x14b143>SESSION_EXPIRATION_MS&&(a64_0x5d9cdf['unlinkSync'](_0x5a69a9),_0x2840fa++);}catch{a64_0x5d9cdf[_0xe14056(0x1b2)](_0x5a69a9),_0x2840fa++;}}}catch{}return _0x2840fa;}export function listActiveSessions(){const _0x5bf964=a64_0x40a1,_0x2fe886=getSessionsDir();if(!a64_0x5d9cdf[_0x5bf964(0x1b7)](_0x2fe886))return[];try{const _0x4311ed=a64_0x5d9cdf[_0x5bf964(0x1af)](_0x2fe886),_0x54c051=[];for(const _0x38b8b6 of _0x4311ed){if(!_0x38b8b6['endsWith'](_0x5bf964(0x1c9)))continue;const _0x342dc7=_0x38b8b6['replace']('.json',''),_0x5d8d53=parseInt(_0x342dc7,0xa);!isNaN(_0x5d8d53)&&isProcessRunning(_0x5d8d53)&&_0x54c051['push'](_0x5d8d53);}return _0x54c051[_0x5bf964(0x1ae)]((_0x28dd8f,_0x4153c3)=>_0x28dd8f-_0x4153c3);}catch{return[];}}
@@ -1 +1 @@
1
- function a65_0x1e52(){const _0xe43f95=['9DdQLOR','1287884WAzmSg','users','clear','16333624ikJYGG','2123336xNKCbr','3556885RGKmHw','core/user-cache','4856156ksZxvf','2387182GZgFjW','344328LPmUlz','3hoKIYf'];a65_0x1e52=function(){return _0xe43f95;};return a65_0x1e52();}const a65_0x22f437=a65_0x2ed9;(function(_0x89f5b0,_0x1a4f56){const _0x4d51ec=a65_0x2ed9,_0x5c33cf=_0x89f5b0();while(!![]){try{const _0x311b23=parseInt(_0x4d51ec(0x165))/0x1+-parseInt(_0x4d51ec(0x169))/0x2+-parseInt(_0x4d51ec(0x16f))/0x3*(parseInt(_0x4d51ec(0x16c))/0x4)+-parseInt(_0x4d51ec(0x16a))/0x5+parseInt(_0x4d51ec(0x16e))/0x6+parseInt(_0x4d51ec(0x16d))/0x7+-parseInt(_0x4d51ec(0x168))/0x8*(-parseInt(_0x4d51ec(0x164))/0x9);if(_0x311b23===_0x1a4f56)break;else _0x5c33cf['push'](_0x5c33cf['shift']());}catch(_0x242e6a){_0x5c33cf['push'](_0x5c33cf['shift']());}}}(a65_0x1e52,0xb4e35));import{createProfileCache}from'../utils/global-cache.js';const userCache=createProfileCache('users-{profile}.json',a65_0x22f437(0x16b));function a65_0x2ed9(_0x378f5f,_0x33327d){_0x378f5f=_0x378f5f-0x164;const _0x1e5265=a65_0x1e52();let _0x2ed98b=_0x1e5265[_0x378f5f];return _0x2ed98b;}export function loadCachedUsers(_0x3f7d67){const _0x483dd1=a65_0x22f437,_0xbe03eb=userCache['read'](_0x3f7d67);return _0xbe03eb?.[_0x483dd1(0x166)]??null;}export function saveCachedUsers(_0x4955fe,_0x447c7b){userCache['write'](_0x4955fe,{'users':_0x447c7b,'cachedAt':Date['now']()});}export function clearUserCache(_0x57b37b){const _0x3b01c6=a65_0x22f437;userCache[_0x3b01c6(0x167)](_0x57b37b);}
1
+ const a65_0x56552e=a65_0x1a74;(function(_0x177c9d,_0x3a9e34){const _0x4cfc0e=a65_0x1a74,_0x1611d3=_0x177c9d();while(!![]){try{const _0x4cd308=parseInt(_0x4cfc0e(0x163))/0x1+parseInt(_0x4cfc0e(0x160))/0x2*(parseInt(_0x4cfc0e(0x161))/0x3)+-parseInt(_0x4cfc0e(0x15e))/0x4*(-parseInt(_0x4cfc0e(0x155))/0x5)+-parseInt(_0x4cfc0e(0x15f))/0x6*(-parseInt(_0x4cfc0e(0x156))/0x7)+parseInt(_0x4cfc0e(0x159))/0x8+parseInt(_0x4cfc0e(0x15a))/0x9+-parseInt(_0x4cfc0e(0x157))/0xa;if(_0x4cd308===_0x3a9e34)break;else _0x1611d3['push'](_0x1611d3['shift']());}catch(_0x41ea88){_0x1611d3['push'](_0x1611d3['shift']());}}}(a65_0x5ebf,0x2e84e));function a65_0x5ebf(){const _0x430b7a=['366039kUTawP','5020kYWwNa','7gFWjkv','9900080IaEGgv','clear','1257296NXzKrQ','2255571CITljJ','read','write','core/user-cache','1228XZOnkm','292674RlOBua','38vGJgGH','7851YaOqKQ','users'];a65_0x5ebf=function(){return _0x430b7a;};return a65_0x5ebf();}import{createProfileCache}from'../utils/global-cache.js';const userCache=createProfileCache('users-{profile}.json',a65_0x56552e(0x15d));export function loadCachedUsers(_0x290a0d){const _0x29105c=a65_0x56552e,_0xfdff2e=userCache[_0x29105c(0x15b)](_0x290a0d);return _0xfdff2e?.[_0x29105c(0x162)]??null;}export function saveCachedUsers(_0x337c79,_0x10cd52){const _0x3e87cc=a65_0x56552e;userCache[_0x3e87cc(0x15c)](_0x337c79,{'users':_0x10cd52,'cachedAt':Date['now']()});}function a65_0x1a74(_0x30db38,_0x2734f6){_0x30db38=_0x30db38-0x155;const _0x5ebf5a=a65_0x5ebf();let _0x1a74b5=_0x5ebf5a[_0x30db38];return _0x1a74b5;}export function clearUserCache(_0x299273){const _0x2bd3e=a65_0x56552e;userCache[_0x2bd3e(0x158)](_0x299273);}
@@ -1 +1 @@
1
- (function(_0x3d1f26,_0x23a76b){const _0x17930f=a66_0x3c3b,_0x14158a=_0x3d1f26();while(!![]){try{const _0x1099de=-parseInt(_0x17930f(0x178))/0x1+-parseInt(_0x17930f(0x174))/0x2*(parseInt(_0x17930f(0x17c))/0x3)+parseInt(_0x17930f(0x16d))/0x4*(parseInt(_0x17930f(0x175))/0x5)+-parseInt(_0x17930f(0x176))/0x6*(-parseInt(_0x17930f(0x172))/0x7)+-parseInt(_0x17930f(0x16e))/0x8*(parseInt(_0x17930f(0x170))/0x9)+parseInt(_0x17930f(0x17b))/0xa+parseInt(_0x17930f(0x17a))/0xb;if(_0x1099de===_0x23a76b)break;else _0x14158a['push'](_0x14158a['shift']());}catch(_0x1edeb5){_0x14158a['push'](_0x14158a['shift']());}}}(a66_0x501e,0xab35f));import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0xacbdd0=a66_0x3c3b;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x5ae960=fileURLToPath(import.meta.url),_0x1c32e6=dirname(_0x5ae960);try{const _0x43e8e5=join(_0x1c32e6,_0xacbdd0(0x16c));cachedBuildInfo=JSON[_0xacbdd0(0x17d)](readFileSync(_0x43e8e5,'utf-8'));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0x13a79c=a66_0x3c3b;if(cachedVersion!==null)return cachedVersion;const _0x53a742=fileURLToPath(import.meta.url),_0x1ce0ef=dirname(_0x53a742),_0x50c3c8=getBuildInfo();if(_0x50c3c8[_0x13a79c(0x173)])return cachedVersion=_0x50c3c8[_0x13a79c(0x173)],cachedVersion;try{const _0x4e3c97=join(_0x1ce0ef,_0x13a79c(0x179)),_0x1fe56d=JSON['parse'](readFileSync(_0x4e3c97,'utf-8'));cachedVersion=_0x1fe56d[_0x13a79c(0x173)];}catch{cachedVersion=_0x13a79c(0x177);}return cachedVersion;}function a66_0x3c3b(_0x17ed4a,_0x4e19bc){_0x17ed4a=_0x17ed4a-0x16c;const _0x501e34=a66_0x501e();let _0x3c3b2e=_0x501e34[_0x17ed4a];return _0x3c3b2e;}export function isDevVersion(){const _0x51f8f5=a66_0x3c3b,_0x1ac446=getVersion();return _0x1ac446[_0x51f8f5(0x16f)](_0x51f8f5(0x171))||_0x1ac446[_0x51f8f5(0x16f)]('-');}function a66_0x501e(){const _0x126205=['../build-info.json','28VVCUWF','184RgcsfM','includes','499689bYmsWH','.dev','14BFvQPJ','version','3346HOuqAH','239495JnuDOL','1880058LNAEod','0.0.0','669798LiCvHV','../../package.json','21538792tHztEt','8221510YqaXCy','1962lAzHnb','parse'];a66_0x501e=function(){return _0x126205;};return a66_0x501e();}
1
+ (function(_0x211e37,_0x337eda){const _0x5267f8=a66_0xea19,_0x3e89f5=_0x211e37();while(!![]){try{const _0x233515=parseInt(_0x5267f8(0x10c))/0x1+-parseInt(_0x5267f8(0x101))/0x2*(-parseInt(_0x5267f8(0x108))/0x3)+-parseInt(_0x5267f8(0x102))/0x4*(-parseInt(_0x5267f8(0x103))/0x5)+-parseInt(_0x5267f8(0x106))/0x6*(parseInt(_0x5267f8(0x10b))/0x7)+parseInt(_0x5267f8(0x10a))/0x8+parseInt(_0x5267f8(0x107))/0x9*(-parseInt(_0x5267f8(0x105))/0xa)+parseInt(_0x5267f8(0x111))/0xb*(parseInt(_0x5267f8(0x100))/0xc);if(_0x233515===_0x337eda)break;else _0x3e89f5['push'](_0x3e89f5['shift']());}catch(_0x391486){_0x3e89f5['push'](_0x3e89f5['shift']());}}}(a66_0x4704,0x5a1db));import{readFileSync}from'fs';function a66_0xea19(_0x2bc449,_0x2b16b5){_0x2bc449=_0x2bc449-0x100;const _0x4704d8=a66_0x4704();let _0xea1956=_0x4704d8[_0x2bc449];return _0xea1956;}import{fileURLToPath}from'url';function a66_0x4704(){const _0xa5c368=['1979706nJQUCM','9OsAuRQ','6BwWvvL','utf-8','1362984qTVwEG','7IWqktg','361448PHSovg','version','../../package.json','.dev','0.0.0','80399tMcKoY','parse','636ZsmZls','26468dpBcIp','43964UwQHHq','70TbNhHL','../build-info.json','4004740kjWyPr'];a66_0x4704=function(){return _0xa5c368;};return a66_0x4704();}import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0x475e57=a66_0xea19;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x2f2011=fileURLToPath(import.meta.url),_0x4475f9=dirname(_0x2f2011);try{const _0x21f15b=join(_0x4475f9,_0x475e57(0x104));cachedBuildInfo=JSON[_0x475e57(0x112)](readFileSync(_0x21f15b,_0x475e57(0x109)));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0x1c8274=a66_0xea19;if(cachedVersion!==null)return cachedVersion;const _0x3aa808=fileURLToPath(import.meta.url),_0x555fff=dirname(_0x3aa808),_0x446149=getBuildInfo();if(_0x446149[_0x1c8274(0x10d)])return cachedVersion=_0x446149[_0x1c8274(0x10d)],cachedVersion;try{const _0x2aaa2f=join(_0x555fff,_0x1c8274(0x10e)),_0xff5902=JSON[_0x1c8274(0x112)](readFileSync(_0x2aaa2f,_0x1c8274(0x109)));cachedVersion=_0xff5902[_0x1c8274(0x10d)];}catch{cachedVersion=_0x1c8274(0x110);}return cachedVersion;}export function isDevVersion(){const _0x1693cf=a66_0xea19,_0x4ff18c=getVersion();return _0x4ff18c['includes'](_0x1693cf(0x10f))||_0x4ff18c['includes']('-');}