@treasuredata/tdx 2026.3.18 → 2026.3.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/profile-command.js +1 -1
  34. package/dist/commands/profiles-command.js +1 -1
  35. package/dist/commands/query-command.js +1 -1
  36. package/dist/commands/schedule-command.js +1 -1
  37. package/dist/commands/segment-command.js +1 -1
  38. package/dist/commands/segment-create-command.js +1 -1
  39. package/dist/commands/segment-fields-command.js +1 -1
  40. package/dist/commands/segment-pull-command.js +1 -1
  41. package/dist/commands/segment-push-command.js +1 -1
  42. package/dist/commands/segment-update-command.js +1 -1
  43. package/dist/commands/segment-use-command.js +1 -1
  44. package/dist/commands/segment-validate-command.js +1 -1
  45. package/dist/commands/segments.js +1 -1
  46. package/dist/commands/show.js +1 -1
  47. package/dist/commands/status-command.js +1 -1
  48. package/dist/commands/tables.js +1 -1
  49. package/dist/commands/unset-command.js +1 -1
  50. package/dist/commands/upgrade-command.js +1 -1
  51. package/dist/commands/use-command.js +1 -1
  52. package/dist/commands/user-command.js +1 -1
  53. package/dist/commands/workflow-command.js +1 -1
  54. package/dist/core/auth.js +1 -1
  55. package/dist/core/command-output.js +1 -1
  56. package/dist/core/config.js +1 -1
  57. package/dist/core/connection-cache.js +1 -1
  58. package/dist/core/constants.js +1 -1
  59. package/dist/core/credential-cache.js +1 -1
  60. package/dist/core/global-context.js +1 -1
  61. package/dist/core/keychain.js +1 -1
  62. package/dist/core/oauth-keychain.js +1 -1
  63. package/dist/core/oauth.js +1 -1
  64. package/dist/core/profile.js +1 -1
  65. package/dist/core/project-config.js +1 -1
  66. package/dist/core/session.js +1 -1
  67. package/dist/core/user-cache.js +1 -1
  68. package/dist/core/version.js +1 -1
  69. package/dist/index.js +1 -1
  70. package/dist/mcp/server.js +1 -1
  71. package/dist/mcp/tools/index.js +1 -1
  72. package/dist/mcp/tools/tdx-run.js +1 -1
  73. package/dist/mcp/tools/tdx-search.js +1 -1
  74. package/dist/mcp/utils.js +1 -1
  75. package/dist/proxy/claude-usage-tracker.js +1 -1
  76. package/dist/proxy/passthrough-server.js +1 -1
  77. package/dist/proxy/sse-usage-parser.js +1 -1
  78. package/dist/sdk/agent/agent-config.js +1 -1
  79. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  80. package/dist/sdk/agent/agent-yaml.js +1 -1
  81. package/dist/sdk/agent/test/evaluator.js +1 -1
  82. package/dist/sdk/agent/test/executor.js +1 -1
  83. package/dist/sdk/agent/test/index.js +1 -1
  84. package/dist/sdk/agent/test/output.js +1 -1
  85. package/dist/sdk/agent/test/parser.js +1 -1
  86. package/dist/sdk/agent/tool-target-registry.js +1 -1
  87. package/dist/sdk/api.js +1 -1
  88. package/dist/sdk/client/cdp-api-client.js +1 -1
  89. package/dist/sdk/client/delivery-api-client.js +1 -1
  90. package/dist/sdk/client/endpoints.js +1 -1
  91. package/dist/sdk/client/engage-api-client.js +1 -1
  92. package/dist/sdk/client/http-client.js +1 -1
  93. package/dist/sdk/client/llm-api-client.js +1 -1
  94. package/dist/sdk/client/oauth-refresh.js +1 -1
  95. package/dist/sdk/client/rate-limiter.js +1 -1
  96. package/dist/sdk/client/td-api-client.js +1 -1
  97. package/dist/sdk/client/trino-api-client.js +1 -1
  98. package/dist/sdk/client/workflow-client.js +1 -1
  99. package/dist/sdk/connection-validator.js +1 -1
  100. package/dist/sdk/connection.js +1 -1
  101. package/dist/sdk/delivery.js +1 -1
  102. package/dist/sdk/engage/campaign-pull.js +1 -1
  103. package/dist/sdk/engage/campaign-push.js +1 -1
  104. package/dist/sdk/engage/campaign-validator.js +1 -1
  105. package/dist/sdk/engage/campaign-yaml.js +1 -1
  106. package/dist/sdk/engage/template-pull.js +1 -1
  107. package/dist/sdk/engage/template-push.js +1 -1
  108. package/dist/sdk/engage/template-validator.js +1 -1
  109. package/dist/sdk/engage/template-yaml.js +1 -1
  110. package/dist/sdk/engage/types/campaign-def.js +1 -1
  111. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  112. package/dist/sdk/engage/types/template-schema.js +1 -1
  113. package/dist/sdk/engage.js +1 -1
  114. package/dist/sdk/errors.js +1 -1
  115. package/dist/sdk/index.js +1 -1
  116. package/dist/sdk/io/index.js +1 -1
  117. package/dist/sdk/io/node-filesystem.js +1 -1
  118. package/dist/sdk/job.js +1 -1
  119. package/dist/sdk/journey.js +1 -1
  120. package/dist/sdk/llm/chat-cache.js +1 -1
  121. package/dist/sdk/llm/index.js +1 -1
  122. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  123. package/dist/sdk/llm/model-factors.js +1 -1
  124. package/dist/sdk/personalization.js +1 -1
  125. package/dist/sdk/query/index.js +1 -1
  126. package/dist/sdk/query/sql-parser.js +1 -1
  127. package/dist/sdk/realtime.js +1 -1
  128. package/dist/sdk/schedule.js +1 -1
  129. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  130. package/dist/sdk/segment/fields-display.js +1 -1
  131. package/dist/sdk/segment/file-discovery.js +1 -1
  132. package/dist/sdk/segment/journey-utils.js +1 -1
  133. package/dist/sdk/segment/journey-validator.js +1 -1
  134. package/dist/sdk/segment/journey-yaml.js +1 -1
  135. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  136. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  137. package/dist/sdk/segment/pull-workflow.js +1 -1
  138. package/dist/sdk/segment/push-recovery.js +1 -1
  139. package/dist/sdk/segment/push-workflow.js +1 -1
  140. package/dist/sdk/segment/resolution-context.js +1 -1
  141. package/dist/sdk/segment/segment-path-parser.js +1 -1
  142. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  143. package/dist/sdk/segment/segment-validator.js +1 -1
  144. package/dist/sdk/segment/target-resolution.js +1 -1
  145. package/dist/sdk/segment/tdx-config.js +1 -1
  146. package/dist/sdk/segment/types/activation-schema.js +1 -1
  147. package/dist/sdk/segment/types/journey-def.js +1 -1
  148. package/dist/sdk/segment/types/journey-schema.js +1 -1
  149. package/dist/sdk/segment/types/segment-def.js +1 -1
  150. package/dist/sdk/segment/types/segment-schema.js +1 -1
  151. package/dist/sdk/segment/validate-files.js +1 -1
  152. package/dist/sdk/segment/yaml-validator.js +1 -1
  153. package/dist/sdk/segment.js +1 -1
  154. package/dist/sdk/types/index.js +1 -1
  155. package/dist/sdk/types/progress.js +1 -1
  156. package/dist/sdk/user.js +1 -1
  157. package/dist/sdk/util/format-detector.js +1 -1
  158. package/dist/sdk/util/formatters.js +1 -1
  159. package/dist/sdk/util/index.js +1 -1
  160. package/dist/sdk/util/paginate.js +1 -1
  161. package/dist/sdk/util/tree-formatter.js +1 -1
  162. package/dist/sdk/workflow/archive-validation.js +1 -1
  163. package/dist/sdk/workflow/clone-workflow.js +1 -1
  164. package/dist/sdk/workflow/index.js +1 -1
  165. package/dist/sdk/workflow/pull-workflow.js +1 -1
  166. package/dist/sdk/workflow/push-workflow.js +1 -1
  167. package/dist/sdk/workflow/tdx-config.js +1 -1
  168. package/dist/sdk/workflow/workflow-utils.js +1 -1
  169. package/dist/test-utils/command-runner.js +1 -1
  170. package/dist/test-utils/factories.js +1 -1
  171. package/dist/test-utils/fixtures.js +1 -1
  172. package/dist/test-utils/http-mock.js +1 -1
  173. package/dist/test-utils/index.js +1 -1
  174. package/dist/utils/async.js +1 -1
  175. package/dist/utils/colors.js +1 -1
  176. package/dist/utils/diff.js +1 -1
  177. package/dist/utils/file-permissions.js +1 -1
  178. package/dist/utils/file-reader.js +1 -1
  179. package/dist/utils/github-releases.js +1 -1
  180. package/dist/utils/global-cache.js +1 -1
  181. package/dist/utils/json-loader.js +1 -1
  182. package/dist/utils/local-cache.js +1 -1
  183. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  184. package/dist/utils/logger/formatters/index.js +1 -1
  185. package/dist/utils/logger/handlers/console-handler.js +1 -1
  186. package/dist/utils/logger/handlers/file-handler.js +1 -1
  187. package/dist/utils/logger/handlers/index.js +1 -1
  188. package/dist/utils/logger/handlers/null-handler.js +1 -1
  189. package/dist/utils/logger/index.js +1 -1
  190. package/dist/utils/logger/logger.js +1 -1
  191. package/dist/utils/logger/types.js +1 -1
  192. package/dist/utils/option-validation.js +1 -1
  193. package/dist/utils/process.js +1 -1
  194. package/dist/utils/prompt.js +1 -1
  195. package/dist/utils/spinner.js +1 -1
  196. package/dist/utils/sse-parser.js +1 -1
  197. package/dist/utils/string-utils.js +1 -1
  198. package/dist/utils/table-ref-parser.js +1 -1
  199. package/dist/utils/tdx-logger.js +1 -1
  200. package/dist/utils/version-check.js +1 -1
  201. package/package.json +1 -1
@@ -1 +1 @@
1
- const a54_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_0x45d3b1=a54_0x4089;(function(_0x11124c,_0x2d79ed){const _0xa24e87=a54_0x4089,_0x195208=_0x11124c();while(!![]){try{const _0x33579a=parseInt(_0xa24e87(0x17d))/0x1+parseInt(_0xa24e87(0x1af))/0x2*(-parseInt(_0xa24e87(0x190))/0x3)+parseInt(_0xa24e87(0x1a2))/0x4*(parseInt(_0xa24e87(0x1b8))/0x5)+-parseInt(_0xa24e87(0x19b))/0x6*(parseInt(_0xa24e87(0x1a5))/0x7)+-parseInt(_0xa24e87(0x19c))/0x8*(parseInt(_0xa24e87(0x170))/0x9)+parseInt(_0xa24e87(0x19a))/0xa*(parseInt(_0xa24e87(0x191))/0xb)+parseInt(_0xa24e87(0x187))/0xc*(parseInt(_0xa24e87(0x1b2))/0xd);if(_0x33579a===_0x2d79ed)break;else _0x195208['push'](_0x195208['shift']());}catch(_0x423120){_0x195208['push'](_0x195208['shift']());}}}(a54_0x40ca,0x37396));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a54_0x596604 from'node:fs';import*as a54_0x28b4c0 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_0x1e71eb from'chalk';import{getGlobalCacheDir,createOptionalProfileCache}from'../utils/global-cache.js';export function getConfigDir(){const _0x351651=a54_0x4089;return process.env.TDX_CONFIG_DIR||join(homedir(),_0x351651(0x1ac),_0x351651(0x1b0));}export function getConfigFile(){const _0xcefad0=a54_0x4089;return join(getConfigDir(),_0xcefad0(0x1b3));}export function getConfigFilePath(_0x3468f5){const _0x236d5b=a54_0x4089,_0x40b0c5=getConfigDir();return _0x3468f5?a54_0x28b4c0['join'](_0x40b0c5,_0x236d5b(0x172)+_0x3468f5):getConfigFile();}export function getCacheDir(){return getGlobalCacheDir();}const llmProjectCache=createOptionalProfileCache(a54_0x45d3b1(0x18c),a54_0x45d3b1(0x16d));export function getLLMProjectCacheFile(_0x37ab9b){return llmProjectCache['path'](_0x37ab9b);}export function readCachedLLMProject(_0x5c0b72){const _0x4c2fe2=a54_0x45d3b1,_0x1e47f6=llmProjectCache['read'](_0x5c0b72);if(_0x1e47f6&&typeof _0x1e47f6['id']===_0x4c2fe2(0x1a1)&&typeof _0x1e47f6['name']==='string')return _0x1e47f6;return null;}export function writeCachedLLMProject(_0xc056f,_0x5c0be4,_0x215959){const _0x2fdb0d=a54_0x45d3b1;try{llmProjectCache[_0x2fdb0d(0x19d)]({'name':_0xc056f,'id':_0x5c0be4},_0x215959);}catch{}}const llmAgentCache=createOptionalProfileCache(a54_0x45d3b1(0x19f),a54_0x45d3b1(0x16e));export function getLLMAgentCacheFile(_0x3d8fb0){const _0x279f84=a54_0x45d3b1;return llmAgentCache[_0x279f84(0x17c)](_0x3d8fb0);}export function readCachedLLMAgent(_0x419b18){const _0x181ce7=a54_0x45d3b1,_0x160132=llmAgentCache['read'](_0x419b18);if(_0x160132&&typeof _0x160132['id']==='string'&&typeof _0x160132['name']===_0x181ce7(0x1a1)&&typeof _0x160132[_0x181ce7(0x195)]==='string')return _0x160132;return null;}function a54_0x4089(_0x3ec4f0,_0x425fcf){_0x3ec4f0=_0x3ec4f0-0x16a;const _0x40cae7=a54_0x40ca();let _0x40891f=_0x40cae7[_0x3ec4f0];return _0x40891f;}export function writeCachedLLMAgent(_0x4fc759,_0x5ac964,_0x366868,_0x4cab39){const _0x80912f=a54_0x45d3b1;try{llmAgentCache[_0x80912f(0x19d)]({'name':_0x4fc759,'id':_0x5ac964,'projectId':_0x366868},_0x4cab39);}catch{}}export function clearCachedLLMAgent(_0x1b35b8){try{llmAgentCache['clear'](_0x1b35b8);}catch{}}const accountInfoCache=createOptionalProfileCache(a54_0x45d3b1(0x1a8),a54_0x45d3b1(0x174),{'suffix':a54_0x45d3b1(0x182)});export function getAccountInfoCacheFile(_0x103e35){return accountInfoCache['path'](_0x103e35);}export function readCachedAccountInfo(_0x1a3b2f){const _0x1eef74=a54_0x45d3b1,_0x220172=accountInfoCache[_0x1eef74(0x192)](_0x1a3b2f);if(_0x220172&&typeof _0x220172['site']===_0x1eef74(0x1a1)&&typeof _0x220172['accountId']===_0x1eef74(0x1a0))return _0x220172;return null;}export function writeCachedAccountInfo(_0x1953aa,_0x17489b,_0x497edf){const _0x46f39a=a54_0x45d3b1;try{accountInfoCache['write']({'site':_0x1953aa,'accountId':_0x17489b,'cachedAt':new Date()[_0x46f39a(0x18f)]()},_0x497edf);}catch{}}export function parseEnvFile(_0x52ca7b){const _0x2cb0ba=a54_0x45d3b1,_0x5eb788={};for(const _0x34dbc7 of _0x52ca7b[_0x2cb0ba(0x19e)]('\x0a')){const _0x48247b=_0x34dbc7[_0x2cb0ba(0x1b4)]();if(!_0x48247b||_0x48247b['startsWith']('#'))continue;const _0x3849d5=_0x48247b['match'](/^([^=]+)=(.*)$/);if(_0x3849d5){const _0x2e3cf9=_0x3849d5[0x1][_0x2cb0ba(0x1b4)]();let _0x2c750e=_0x3849d5[0x2][_0x2cb0ba(0x1b4)]();(_0x2c750e['startsWith']('\x22')&&_0x2c750e[_0x2cb0ba(0x189)]('\x22')||_0x2c750e[_0x2cb0ba(0x1ae)]('\x27')&&_0x2c750e[_0x2cb0ba(0x189)]('\x27'))&&(_0x2c750e=_0x2c750e['slice'](0x1,-0x1)),_0x5eb788[_0x2e3cf9]=_0x2c750e;}}return _0x5eb788;}export function readUserConfig(){const _0x2a4930=a54_0x45d3b1,_0x2e9b6c=getConfigFile();if(!existsSync(_0x2e9b6c))return{};try{const _0x2e12ff=readFileSync(_0x2e9b6c,'utf-8');return parseEnvFile(_0x2e12ff);}catch(_0x4fbef0){return console[_0x2a4930(0x171)](_0x2a4930(0x186)+_0x2e9b6c+':',_0x4fbef0),{};}}export function resolveSite(_0x3bdfc0){const _0x123dfb=a54_0x45d3b1,_0x3d5b1c=['us01',_0x123dfb(0x175),'eu01','ap02',_0x123dfb(0x18a),_0x123dfb(0x185),_0x123dfb(0x198),_0x123dfb(0x177),_0x123dfb(0x1ab),_0x123dfb(0x179)];if(_0x3d5b1c[_0x123dfb(0x1a4)](_0x3bdfc0))return _0x3bdfc0;if(_0x3bdfc0 in SITE_ALIASES)return SITE_ALIASES[_0x3bdfc0];return console[_0x123dfb(0x171)]('Warning:\x20Unknown\x20site\x20\x27'+_0x3bdfc0+_0x123dfb(0x16a)),_0x123dfb(0x188);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function resolveAccessToken(_0x322684){const _0x55e1e8=a54_0x45d3b1,_0x4c3f21=_0x322684||getActiveProfileName()||undefined;if(_0x4c3f21){const _0x4f631a=_0x55e1e8(0x16f)+normalizeProfileForEnvVar(_0x4c3f21);if(process.env[_0x4f631a])return{'accessToken':process.env[_0x4f631a],'source':_0x4f631a+_0x55e1e8(0x17a)};}if(process.env.TDX_ACCESS_TOKEN)return{'accessToken':process.env.TDX_ACCESS_TOKEN,'source':'TDX_ACCESS_TOKEN\x20env\x20var'};return null;}export function getAccessToken(_0x4873e9){const _0x5931e8=a54_0x45d3b1;return resolveAccessToken(_0x4873e9)?.[_0x5931e8(0x1aa)];}export function getAPIKey(_0x1bbc7b){const _0x1cb6fc=a54_0x45d3b1,_0x4062f9=_0x1bbc7b||getActiveProfileName();if(_0x4062f9){const _0x3e22e7=_0x1cb6fc(0x17b)+normalizeProfileForEnvVar(_0x4062f9);if(process.env[_0x3e22e7])return process.env[_0x3e22e7];}if(process.env.TDX_API_KEY)return process.env.TDX_API_KEY;return undefined;}export function normalizeProfileForEnvVar(_0x5548b7){const _0x3fc794=a54_0x45d3b1;return _0x5548b7[_0x3fc794(0x176)]()['replace'](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x1a62d7,_0x4ee73d){const _0x14b658=a54_0x45d3b1,_0x51e694=resolveAccessToken(_0x4ee73d);if(_0x51e694)return{'apiKey':_0x51e694[_0x14b658(0x1aa)],'source':_0x51e694[_0x14b658(0x183)],'isDeprecated':![]};const _0x56f3b6=_0x4ee73d||getActiveProfileName()||undefined;if(_0x56f3b6){const _0x559587=_0x14b658(0x17b)+normalizeProfileForEnvVar(_0x56f3b6);if(process.env[_0x559587])return{'apiKey':process.env[_0x559587],'source':_0x559587+_0x14b658(0x17a),'isDeprecated':![]};const _0x4b2cd3=getCachedCredential(_0x1a62d7,_0x56f3b6);if(_0x4b2cd3)return{'apiKey':_0x4b2cd3,'source':_0x14b658(0x180)+_0x56f3b6+')','isDeprecated':![]};const _0x1d637e=await getKeychainAPIKey(_0x56f3b6);if(_0x1d637e)return setCachedCredential(_0x1d637e,_0x1a62d7,_0x56f3b6),{'apiKey':_0x1d637e,'source':_0x14b658(0x180)+_0x56f3b6+')','isDeprecated':![]};}if(process.env.TDX_API_KEY)return{'apiKey':process.env.TDX_API_KEY,'source':_0x14b658(0x194),'isDeprecated':![]};if(!_0x56f3b6){const _0x7f6b4e=getCachedCredential(_0x1a62d7,undefined);if(_0x7f6b4e)return{'apiKey':_0x7f6b4e,'source':_0x14b658(0x184),'isDeprecated':![]};const _0x3ccd0b=await getKeychainAPIKey(undefined);if(_0x3ccd0b)return setCachedCredential(_0x3ccd0b,_0x1a62d7,undefined),{'apiKey':_0x3ccd0b,'source':_0x14b658(0x184),'isDeprecated':![]};}return null;}export async function getAPIKeyAsync(_0x5aad42,_0x197226){const _0x39059e=a54_0x45d3b1,_0x463f63=await resolveAPIKeyAsync(_0x5aad42,_0x197226);return _0x463f63?.[_0x39059e(0x18e)];}function cleanupLegacyEnvFile(_0x20d9db){const _0x271c53=a54_0x45d3b1;if(!existsSync(_0x20d9db))return![];try{const _0xdca1e9=readFileSync(_0x20d9db,'utf-8'),_0x356a75=_0xdca1e9[_0x271c53(0x19e)]('\x0a'),_0x13939e=_0x356a75['filter'](_0x56fcdf=>{const _0x41230f=_0x271c53,_0x349eb7=_0x56fcdf['trim']();if(!_0x349eb7||_0x349eb7[_0x41230f(0x1ae)]('#'))return!![];const [_0x3e28ac]=_0x349eb7[_0x41230f(0x19e)]('=');return!_0x3e28ac['startsWith'](_0x41230f(0x18b));}),_0x198392=_0x13939e[_0x271c53(0x18d)](_0x4ccf81=>{const _0x1cc8b4=_0x271c53,_0x1b8d0a=_0x4ccf81[_0x1cc8b4(0x1b4)]();return _0x1b8d0a&&!_0x1b8d0a[_0x1cc8b4(0x1ae)]('#');});if(!_0x198392)return unlinkSync(_0x20d9db),!![];return writeFileSync(_0x20d9db,_0x13939e[_0x271c53(0x199)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function getActiveProfileName(){const _0xfd0ec1=a54_0x45d3b1;if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x24ad86=a54_0x28b4c0[_0xfd0ec1(0x199)](getConfigDir(),_0xfd0ec1(0x17f));if(!a54_0x596604['existsSync'](_0x24ad86))return null;try{const _0x531d5b=a54_0x596604[_0xfd0ec1(0x193)](_0x24ad86,_0xfd0ec1(0x16b)),_0x49f586=JSON[_0xfd0ec1(0x1a9)](_0x531d5b);return _0x49f586['profile']||null;}catch{return null;}}export function saveAPIKey(_0x1ede05,_0x4bd3ce,_0x3ed428){const _0x542ba2=a54_0x45d3b1,_0x2840dc=getConfigDir(),_0x275425=getConfigFilePath(_0x3ed428);!existsSync(_0x2840dc)&&mkdirSync(_0x2840dc,{'recursive':!![],'mode':0x1c0});let _0x31ac39={};if(existsSync(_0x275425))try{const _0x592392=readFileSync(_0x275425,'utf-8');_0x31ac39=parseEnvFile(_0x592392);}catch(_0x38a409){console[_0x542ba2(0x171)](_0x542ba2(0x1a6)+_0x275425+':',_0x38a409);}const _0x19d5bd=_0x1ede05[_0x542ba2(0x176)]()[_0x542ba2(0x1b7)](/-/g,'_');_0x31ac39[_0x542ba2(0x17e)+_0x19d5bd]=_0x4bd3ce;const _0x51b39f=Object['entries'](_0x31ac39)[_0x542ba2(0x173)](([_0xe49184,_0x46659a])=>_0xe49184+'='+_0x46659a);writeFileSync(_0x275425,_0x51b39f[_0x542ba2(0x199)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x27b00d,_0xa0ab36,_0x2ba31c){const _0x33a581=a54_0x45d3b1;await saveKeychainAPIKey(_0x27b00d,_0x2ba31c),setCachedCredential(_0x27b00d,_0xa0ab36,_0x2ba31c);const _0x35653c=getConfigFilePath(_0x2ba31c);cleanupLegacyEnvFile(_0x35653c)&&console[_0x33a581(0x171)](a54_0x1e71eb[_0x33a581(0x1b6)](_0x33a581(0x1b5)));}export function loadConfig(){const _0xce3588=a54_0x45d3b1,_0x107166={'apiKeys':{},'defaultSite':_0xce3588(0x188)},_0x559031=[_0xce3588(0x188),'ap01',_0xce3588(0x1a3),_0xce3588(0x1a7),_0xce3588(0x18a),_0xce3588(0x185),'dev-eu01','stg-us01','stg-ap01',_0xce3588(0x179)],_0x25caf6=getAPIKey();if(_0x25caf6)for(const _0x509abb of _0x559031){_0x107166[_0xce3588(0x178)][_0x509abb]=_0x25caf6;}return _0x107166;}export function isExperimentalAvailable(){return!!process.env.TDX_EXPERIMENTAL;}function a54_0x40ca(){const _0x5de984=['join','70pyRzfc','20742EuEcZw','16XfqJVE','write','split','llm_default_agent','number','string','4lmeLWX','eu01','includes','721fzzysD','Warning:\x20Failed\x20to\x20read\x20','ap02','account_info','parse','accessToken','stg-ap01','.config','existsSync','startsWith','745132vAOknR','tdx','next','1586390fShCSa','.env','trim','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','yellow','replace','1280845fTlQMM','\x27,\x20defaulting\x20to\x20us01','utf-8','stringify','config/llm-project','config/llm-agent','TDX_ACCESS_TOKEN_','863640LRuSDt','warn','.env.','map','config/account-info','ap01','toUpperCase','stg-us01','apiKeys','stg-ap03','\x20env\x20var','TDX_API_KEY_','path','226857JZIXWT','TD_API_KEY_','tdx.json','keychain\x20(profile:\x20','stable','.json','source','keychain','dev-us01','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','48JeifUv','us01','endsWith','ap03','TD_API_KEY','llm_default_project','some','apiKey','toISOString','3lxaOLF','275957GFPFLC','read','readFileSync','TDX_API_KEY\x20env\x20var','projectId','release_channel','proxy','dev-eu01'];a54_0x40ca=function(){return _0x5de984;};return a54_0x40ca();}export function loadGlobalProxy(){const _0x576940=a54_0x45d3b1,_0x2d8e2e=a54_0x28b4c0[_0x576940(0x199)](getConfigDir(),_0x576940(0x17f));if(!a54_0x596604[_0x576940(0x1ad)](_0x2d8e2e))return undefined;try{const _0x54cfc8=a54_0x596604[_0x576940(0x193)](_0x2d8e2e,_0x576940(0x16b)),_0x6cb8f9=JSON[_0x576940(0x1a9)](_0x54cfc8);return typeof _0x6cb8f9[_0x576940(0x197)]===_0x576940(0x1a1)?_0x6cb8f9[_0x576940(0x197)]:undefined;}catch{return undefined;}}export function loadReleaseChannel(){const _0x54bc87=a54_0x45d3b1,_0x4200ba=process.env.TDX_RELEASE_CHANNEL;if(_0x4200ba===_0x54bc87(0x1b1)||_0x4200ba==='stable')return _0x4200ba;const _0x375b05=a54_0x28b4c0[_0x54bc87(0x199)](getConfigDir(),_0x54bc87(0x17f));if(!a54_0x596604['existsSync'](_0x375b05))return _0x54bc87(0x181);try{const _0x54c6b3=a54_0x596604[_0x54bc87(0x193)](_0x375b05,_0x54bc87(0x16b)),_0x4d6712=JSON[_0x54bc87(0x1a9)](_0x54c6b3);if(_0x4d6712[_0x54bc87(0x196)]===_0x54bc87(0x1b1))return _0x54bc87(0x1b1);}catch{}return'stable';}export function saveReleaseChannel(_0x180dc1){const _0x1d57c3=a54_0x45d3b1,_0x380f77=getConfigDir(),_0x18a767=a54_0x28b4c0['join'](_0x380f77,_0x1d57c3(0x17f));!existsSync(_0x380f77)&&mkdirSync(_0x380f77,{'recursive':!![],'mode':0x1c0});let _0x1664d0={};if(existsSync(_0x18a767))try{const _0x146465=readFileSync(_0x18a767,_0x1d57c3(0x16b));_0x1664d0=JSON[_0x1d57c3(0x1a9)](_0x146465);}catch{}_0x1664d0[_0x1d57c3(0x196)]=_0x180dc1,writeFileSync(_0x18a767,JSON[_0x1d57c3(0x16c)](_0x1664d0,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_0x2965a0=a55_0x2217;function a55_0x1d6e(){const _0x546cac=['7046746UkgwPr','connections','10CXtevG','20837696xStspQ','3035877carGAN','63376kHadlu','write','159552wEAYcd','657180DAyjro','now','core/connection-cache','3923092EDJRfQ','28MXsqGS','30yVwkbf','54sMCfUG'];a55_0x1d6e=function(){return _0x546cac;};return a55_0x1d6e();}function a55_0x2217(_0x59090b,_0x3e68d3){_0x59090b=_0x59090b-0x95;const _0x1d6ef3=a55_0x1d6e();let _0x2217ec=_0x1d6ef3[_0x59090b];return _0x2217ec;}(function(_0x2e5f40,_0x3b44c8){const _0xba1fb1=a55_0x2217,_0x852f33=_0x2e5f40();while(!![]){try{const _0x517e80=-parseInt(_0xba1fb1(0xa0))/0x1*(-parseInt(_0xba1fb1(0x98))/0x2)+parseInt(_0xba1fb1(0x9f))/0x3+-parseInt(_0xba1fb1(0x97))/0x4+-parseInt(_0xba1fb1(0xa3))/0x5*(-parseInt(_0xba1fb1(0x99))/0x6)+parseInt(_0xba1fb1(0x9b))/0x7+parseInt(_0xba1fb1(0xa2))/0x8*(-parseInt(_0xba1fb1(0x9a))/0x9)+-parseInt(_0xba1fb1(0x9d))/0xa*(parseInt(_0xba1fb1(0x9e))/0xb);if(_0x517e80===_0x3b44c8)break;else _0x852f33['push'](_0x852f33['shift']());}catch(_0x16890e){_0x852f33['push'](_0x852f33['shift']());}}}(a55_0x1d6e,0x8abf4));import{createProfileCache}from'../utils/global-cache.js';const connectionCache=createProfileCache('connections-{profile}.json',a55_0x2965a0(0x96));export function loadCachedConnections(_0x364177){const _0x469feb=a55_0x2965a0,_0x502b6d=connectionCache['read'](_0x364177);return _0x502b6d?.[_0x469feb(0x9c)]??null;}export function saveCachedConnections(_0x53d2a1,_0x4b11e6){const _0x55da7f=a55_0x2965a0;connectionCache[_0x55da7f(0xa1)](_0x53d2a1,{'connections':_0x4b11e6,'cachedAt':Date[_0x55da7f(0x95)]()});}export function clearConnectionCache(_0x58cd47){connectionCache['clear'](_0x58cd47);}
@@ -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_0x413f39=a56_0x1bd0;function a56_0x590d(){const _0x2ad6a3=['Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','18nBXstJ','5540064lgxDKU','select','jp\x20\x20\x20-\x20Japan','text','us01','5200769FtywIi','other','eu01','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','1382529GeZzBn','5wBTUfV','findIndex','478004KrFkbC','Enter\x20site\x20name:','value','us\x20\x20\x20-\x20United\x20States','ap02\x20-\x20Korea','log','Enter\x20custom\x20site','371152hwQEZW','Cancelled','Select\x20your\x20Treasure\x20Data\x20site:','customSite','eu\x20\x20\x20-\x20Europe','trim','push','number','1335224vcOsAm','726288syWjZS','site','ap01'];a56_0x590d=function(){return _0x2ad6a3;};return a56_0x590d();}(function(_0x3ae69c,_0x5464fc){const _0x4505ab=a56_0x1bd0,_0x2eba3b=_0x3ae69c();while(!![]){try{const _0x14fa36=parseInt(_0x4505ab(0x1c8))/0x1+-parseInt(_0x4505ab(0x1e0))/0x2+-parseInt(_0x4505ab(0x1d6))/0x3+parseInt(_0x4505ab(0x1d9))/0x4*(-parseInt(_0x4505ab(0x1d7))/0x5)+parseInt(_0x4505ab(0x1cd))/0x6+-parseInt(_0x4505ab(0x1d2))/0x7+parseInt(_0x4505ab(0x1c7))/0x8*(parseInt(_0x4505ab(0x1cc))/0x9);if(_0x14fa36===_0x5464fc)break;else _0x2eba3b['push'](_0x2eba3b['shift']());}catch(_0x82a31e){_0x2eba3b['push'](_0x2eba3b['shift']());}}}(a56_0x590d,0x73db7));import a56_0x2b32bf from'prompts';export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;function a56_0x1bd0(_0x2ba2a3,_0x91b797){_0x2ba2a3=_0x2ba2a3-0x1c3;const _0x590d43=a56_0x590d();let _0x1bd05e=_0x590d43[_0x2ba2a3];return _0x1bd05e;}export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x5bea91,_0x2159c9){const _0x4a43ab=a56_0x1bd0;if(_0x5bea91===undefined)return _0x2159c9;if(typeof _0x5bea91===_0x4a43ab(0x1c6))return _0x5bea91;return parseInt(_0x5bea91,0xa);}export const STANDARD_SITE_CHOICES=[{'title':a56_0x413f39(0x1dc),'value':a56_0x413f39(0x1d1)},{'title':a56_0x413f39(0x1cf),'value':a56_0x413f39(0x1ca)},{'title':a56_0x413f39(0x1c3),'value':a56_0x413f39(0x1d4)},{'title':a56_0x413f39(0x1dd),'value':'ap02'}];export function buildSiteChoices(_0x46a5e1){const _0x4d4a6f=a56_0x413f39,_0x2c77b6=[...STANDARD_SITE_CHOICES];let _0x49e400=_0x2c77b6[_0x4d4a6f(0x1d8)](_0x46c433=>_0x46c433[_0x4d4a6f(0x1db)]===_0x46a5e1);return _0x49e400===-0x1&&_0x46a5e1!==_0x4d4a6f(0x1d1)&&(_0x2c77b6[_0x4d4a6f(0x1c5)]({'title':_0x46a5e1,'value':_0x46a5e1}),_0x49e400=_0x2c77b6['length']-0x1),_0x2c77b6[_0x4d4a6f(0x1c5)]({'title':_0x4d4a6f(0x1df),'value':_0x4d4a6f(0x1d3)}),{'choices':_0x2c77b6,'initialIndex':_0x49e400>=0x0?_0x49e400:0x0};}export async function promptSiteSelection(_0x270176,_0x3a5200,_0x35fc07=a56_0x413f39(0x1e1)){const _0x201995=a56_0x413f39,{choices:_0x24ab28,initialIndex:_0x5550fe}=buildSiteChoices(_0x270176),_0x40ad96=_0x3a5200?_0x201995(0x1cb)+_0x3a5200+'):':_0x201995(0x1e2),_0x70567f=await a56_0x2b32bf({'type':_0x201995(0x1ce),'name':_0x201995(0x1c9),'message':_0x40ad96,'choices':_0x24ab28,'initial':_0x5550fe});if(!_0x70567f[_0x201995(0x1c9)])return console['log']('\x0a'+_0x35fc07),null;if(_0x70567f[_0x201995(0x1c9)]!=='other')return _0x70567f[_0x201995(0x1c9)];const _0x356e82=await a56_0x2b32bf({'type':_0x201995(0x1d0),'name':_0x201995(0x1e3),'message':_0x201995(0x1da),'initial':'us01','validate':_0x1bd3bd=>{const _0x253d9c=_0x201995;if(!_0x1bd3bd||!_0x1bd3bd[_0x253d9c(0x1c4)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/['test'](_0x1bd3bd['trim']()))return _0x253d9c(0x1d5);return!![];}});if(!_0x356e82['customSite'])return console[_0x201995(0x1de)]('\x0a'+_0x35fc07),null;return _0x356e82[_0x201995(0x1e3)];}
@@ -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(_0x38bd3a,_0x338b19){const _0x4fb04f=a57_0xbfb1,_0x355274=_0x38bd3a();while(!![]){try{const _0x3baa63=-parseInt(_0x4fb04f(0x136))/0x1+-parseInt(_0x4fb04f(0x12c))/0x2*(parseInt(_0x4fb04f(0x133))/0x3)+-parseInt(_0x4fb04f(0x138))/0x4*(-parseInt(_0x4fb04f(0x12a))/0x5)+parseInt(_0x4fb04f(0x129))/0x6*(parseInt(_0x4fb04f(0x128))/0x7)+parseInt(_0x4fb04f(0x12f))/0x8*(-parseInt(_0x4fb04f(0x12e))/0x9)+parseInt(_0x4fb04f(0x127))/0xa*(-parseInt(_0x4fb04f(0x126))/0xb)+parseInt(_0x4fb04f(0x131))/0xc*(parseInt(_0x4fb04f(0x135))/0xd);if(_0x3baa63===_0x338b19)break;else _0x355274['push'](_0x355274['shift']());}catch(_0x171e2c){_0x355274['push'](_0x355274['shift']());}}}(a57_0x47e0,0x2b81a));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function a57_0xbfb1(_0x4b63ee,_0x18d6b9){_0x4b63ee=_0x4b63ee-0x125;const _0x47e05e=a57_0x47e0();let _0xbfb113=_0x47e05e[_0x4b63ee];return _0xbfb113;}function getCacheKey(_0x5370dd,_0x514b2a){const _0x5718c8=a57_0xbfb1,_0xfc1335=_0x5370dd||_0x5718c8(0x12b),_0x2de6f1=_0x514b2a||_0x5718c8(0x137);return _0xfc1335+':'+_0x2de6f1;}export function getCachedCredential(_0x5c7711,_0x5aada9){const _0x44efaf=a57_0xbfb1,_0x566645=getCacheKey(_0x5c7711,_0x5aada9),_0x387fe3=cache[_0x44efaf(0x134)](_0x566645);if(!_0x387fe3)return null;if(Date[_0x44efaf(0x132)]()-_0x387fe3[_0x44efaf(0x12d)]>CACHE_TTL_MS)return cache[_0x44efaf(0x125)](_0x566645),null;return _0x387fe3['apiKey'];}export function setCachedCredential(_0x1e764f,_0x10dc8d,_0x49b606){const _0x578ee1=a57_0xbfb1,_0xb2d15f=getCacheKey(_0x10dc8d,_0x49b606);cache['set'](_0xb2d15f,{'apiKey':_0x1e764f,'loadedAt':Date[_0x578ee1(0x132)]()});}function a57_0x47e0(){const _0x3c2473=['6993156qtjWgJ','now','15COHcQt','get','13hZMckX','253104yxtWZv','__default_profile__','184SVAJhj','delete','577599hkrXrZ','20rTAEin','1971529wSPmix','6sMJTZy','23390hOtKIT','__default_site__','87050yTbSya','loadedAt','2930841VNPiqg','8zLzxMx','clear'];a57_0x47e0=function(){return _0x3c2473;};return a57_0x47e0();}export function clearCredentialCache(){const _0x312d68=a57_0xbfb1;cache[_0x312d68(0x130)]();}export function clearCachedCredential(_0x5bf260,_0x284a13){const _0x4a72cc=a57_0xbfb1,_0x5e4678=getCacheKey(_0x5bf260,_0x284a13);cache[_0x4a72cc(0x125)](_0x5e4678);}
@@ -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
+ const a58_0x26cdc7=a58_0x8fc3;(function(_0x261513,_0x5915c1){const _0x5e6e1f=a58_0x8fc3,_0x31a9e8=_0x261513();while(!![]){try{const _0x58964f=parseInt(_0x5e6e1f(0x1a6))/0x1+parseInt(_0x5e6e1f(0x1a2))/0x2*(parseInt(_0x5e6e1f(0x181))/0x3)+parseInt(_0x5e6e1f(0x191))/0x4+parseInt(_0x5e6e1f(0x176))/0x5+-parseInt(_0x5e6e1f(0x169))/0x6*(parseInt(_0x5e6e1f(0x18a))/0x7)+-parseInt(_0x5e6e1f(0x16a))/0x8*(-parseInt(_0x5e6e1f(0x1a3))/0x9)+parseInt(_0x5e6e1f(0x188))/0xa*(-parseInt(_0x5e6e1f(0x194))/0xb);if(_0x58964f===_0x5915c1)break;else _0x31a9e8['push'](_0x31a9e8['shift']());}catch(_0x4f54b5){_0x31a9e8['push'](_0x31a9e8['shift']());}}}(a58_0xe5c8,0x8a8b1));import{resolveSite,getAPIKey,getAccessToken,getAPIKeyAsync,getConfigDir}from'./config.js';import{getOAuthTokens}from'./oauth-keychain.js';function a58_0xe5c8(){const _0x182f8f=['getParameters','profiles','parentSegment','60wduJDA','configFiles','49ICpwQC','segment_path','dim','string','profile','global','sessions','2674152yWJqos','(session:\x20','entries','3056482rjWKEm','CLI\x20flag:\x20--','bold','resolveAPIKeyAsync','not\x20set','Session','llmProject','access_token','Global','replace','workflowProject','Global\x20Credentials','logLevel','llm_agent','174xuhehf','9LiTjdr','INFO','(using\x20session:\x20','436167afTrnD','default','workflow_project','join','cliFlags','assign','verbose','log','Profile','parse','session','proxy','activeProfile','accessToken','getSource','site','(active)','none','.env','cli','926694BPshPG','3018640LtQVyz','us01','[context]','config','sessionId','display','env','green','Project','project','segmentPath','profileCredentials','4246740hkNlIq','loadGlobalConfig','profileSource','apiKey','tdx.json','cyan','[configuration\x20files]','llm_project','existsSync','layers','llmAgent','33945IWyuFC','database','injectIntoOptions','parent_segment'];a58_0xe5c8=function(){return _0x182f8f;};return a58_0xe5c8();}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_0x6915f7 from'node:fs';function a58_0x8fc3(_0x230b8c,_0x427221){_0x230b8c=_0x230b8c-0x15c;const _0xe5c8f7=a58_0xe5c8();let _0x8fc30=_0xe5c8f7[_0x230b8c];return _0x8fc30;}import*as a58_0x52efaf from'node:path';import a58_0x1e03d8 from'chalk';export class GlobalContext{[a58_0x26cdc7(0x164)];[a58_0x26cdc7(0x182)];[a58_0x26cdc7(0x184)];['segment_path'];[a58_0x26cdc7(0x17d)];['llm_agent'];[a58_0x26cdc7(0x1a8)];[a58_0x26cdc7(0x179)];[a58_0x26cdc7(0x162)];[a58_0x26cdc7(0x160)];[a58_0x26cdc7(0x1ac)];['logLevel'];[a58_0x26cdc7(0x18e)];[a58_0x26cdc7(0x178)]=null;['layers'];[a58_0x26cdc7(0x161)];[a58_0x26cdc7(0x16e)];[a58_0x26cdc7(0x189)];constructor(_0x3ada5c){const _0x523d70=a58_0x26cdc7;this[_0x523d70(0x16e)]=getSessionID(_0x3ada5c[_0x523d70(0x15f)]);const _0x51991c=loadSessionContext(_0x3ada5c['session']),_0x3d4d58=loadProjectConfig(),_0x5b5342=this[_0x523d70(0x177)]();if(_0x3ada5c[_0x523d70(0x18e)])this[_0x523d70(0x161)]=_0x3ada5c[_0x523d70(0x18e)],this['profileSource']=_0x523d70(0x168);else{if(_0x51991c?.[_0x523d70(0x18e)])this[_0x523d70(0x161)]=_0x51991c[_0x523d70(0x18e)],this['profileSource']=_0x523d70(0x15f);else{if(_0x5b5342[_0x523d70(0x18e)])this[_0x523d70(0x161)]=_0x5b5342[_0x523d70(0x18e)],this[_0x523d70(0x178)]=_0x523d70(0x16d);else process.env.TDX_PROFILE?(this[_0x523d70(0x161)]=process.env.TDX_PROFILE,this[_0x523d70(0x178)]=_0x523d70(0x170)):(this[_0x523d70(0x161)]=null,this['profileSource']=null);}}const _0x49a286=this[_0x523d70(0x161)]?loadProfile(this[_0x523d70(0x161)]):null,_0x120a4f=_0x54a14d=>{const _0x324dc6=_0x523d70;if(!_0x54a14d)return{};const _0x2ece6f=_0x54a14d,_0x328664={};for(const [_0x2a5cbb,_0x358600]of Object[_0x324dc6(0x193)](_0x2ece6f)){typeof _0x358600===_0x324dc6(0x18d)&&(_0x328664[_0x2a5cbb]=_0x358600);}return _0x328664;},_0x5090e5={},_0x5d0840=(_0x5d3b48,_0x33e70f,_0x373735)=>{const _0x79636c=_0x523d70;if(!_0x5d3b48)return![];if(_0x373735&&_0x5d3b48===_0x373735)return![];const _0x4f0d62=_0x51991c,_0x28d673=_0x3d4d58,_0x807454=_0x49a286?.[_0x79636c(0x16d)],_0x2c5b52=_0x5b5342,_0x52cdc7=_0x4f0d62?.[_0x33e70f],_0x595eed=_0x28d673?.[_0x33e70f],_0x2c9ef0=_0x807454?.[_0x33e70f],_0x3d2f54=_0x2c5b52[_0x33e70f];return _0x5d3b48!==_0x52cdc7&&_0x5d3b48!==_0x595eed&&_0x5d3b48!==_0x2c9ef0&&_0x5d3b48!==_0x3d2f54;},_0x47ee4c=[{'optionKey':'site','contextKey':_0x523d70(0x164),'defaultValue':'us01'},{'optionKey':_0x523d70(0x182),'contextKey':_0x523d70(0x182)},{'optionKey':_0x523d70(0x187),'contextKey':_0x523d70(0x184)},{'optionKey':_0x523d70(0x19a),'contextKey':_0x523d70(0x17d)},{'optionKey':'llmAgent','contextKey':_0x523d70(0x1a1)},{'optionKey':'profile','contextKey':_0x523d70(0x18e)}];for(const {optionKey:_0x4d28de,contextKey:_0x51418e,defaultValue:_0x46ea2b}of _0x47ee4c){const _0x710db3=_0x3ada5c[_0x4d28de];_0x5d0840(_0x710db3,_0x51418e,_0x46ea2b)&&(_0x5090e5[_0x51418e]=_0x710db3);}this['layers']={'cliFlags':_0x5090e5,'session':_0x120a4f(_0x51991c),'project':_0x120a4f(_0x3d4d58),'profile':_0x120a4f(_0x49a286?.[_0x523d70(0x16d)]),'global':_0x120a4f(_0x5b5342)};const _0x142f3f={...this[_0x523d70(0x17f)][_0x523d70(0x18f)],...this[_0x523d70(0x17f)][_0x523d70(0x18e)],...this[_0x523d70(0x17f)][_0x523d70(0x173)]};process.env.TDX_SITE&&!this[_0x523d70(0x17f)][_0x523d70(0x15f)][_0x523d70(0x164)]&&!this[_0x523d70(0x17f)]['cliFlags'][_0x523d70(0x164)]&&(_0x142f3f['site']=process.env.TDX_SITE);Object[_0x523d70(0x1ab)](_0x142f3f,this[_0x523d70(0x17f)][_0x523d70(0x15f)]),Object[_0x523d70(0x1ab)](_0x142f3f,this['layers'][_0x523d70(0x1aa)]);const _0x2df4df=_0x142f3f['site']||_0x523d70(0x16b);this[_0x523d70(0x164)]=resolveSite(_0x2df4df),this[_0x523d70(0x182)]=_0x142f3f[_0x523d70(0x182)],this[_0x523d70(0x184)]=_0x142f3f[_0x523d70(0x184)],this[_0x523d70(0x18b)]=_0x142f3f[_0x523d70(0x18b)],this[_0x523d70(0x17d)]=_0x142f3f['llm_project'],this[_0x523d70(0x1a1)]=_0x142f3f['llm_agent'],this[_0x523d70(0x1a8)]=_0x142f3f['workflow_project'],this[_0x523d70(0x1ac)]=_0x3ada5c['verbose']||![],this[_0x523d70(0x1a0)]=_0x3ada5c['logLevel']??LogLevel[_0x523d70(0x1a4)],this[_0x523d70(0x18e)]=this[_0x523d70(0x161)]||undefined,this[_0x523d70(0x162)]=getAccessToken(this[_0x523d70(0x161)]||undefined),this[_0x523d70(0x179)]=getAPIKey(this[_0x523d70(0x161)]||undefined);const _0x326bee=typeof _0x5b5342[_0x523d70(0x160)]===_0x523d70(0x18d)?_0x5b5342[_0x523d70(0x160)]:undefined;this['proxy']=_0x326bee||process.env.HTTPS_PROXY||process.env.HTTP_PROXY;const _0x5b6dd3=getConfigDir(),_0x20864c=a58_0x52efaf[_0x523d70(0x1a9)](_0x5b6dd3,_0x523d70(0x190),this[_0x523d70(0x16e)]+'.json'),_0x33a00b=findProjectConfigPath(),_0x33e62e=a58_0x52efaf[_0x523d70(0x1a9)](_0x5b6dd3,_0x523d70(0x17a)),_0x26b2e7=a58_0x52efaf['join'](_0x5b6dd3,_0x523d70(0x167));let _0x2c5bea=null,_0x1dc369=null;this['activeProfile']&&(_0x2c5bea=a58_0x52efaf[_0x523d70(0x1a9)](_0x5b6dd3,_0x523d70(0x186),this[_0x523d70(0x161)],_0x523d70(0x17a)),_0x1dc369=a58_0x52efaf[_0x523d70(0x1a9)](_0x5b6dd3,_0x523d70(0x186),this['activeProfile'],_0x523d70(0x167))),this['configFiles']={'session':a58_0x6915f7[_0x523d70(0x17e)](_0x20864c)?_0x20864c:null,'project':_0x33a00b,'profile':_0x2c5bea&&a58_0x6915f7['existsSync'](_0x2c5bea)?_0x2c5bea:null,'profileCredentials':_0x1dc369&&a58_0x6915f7[_0x523d70(0x17e)](_0x1dc369)?_0x1dc369:null,'global':a58_0x6915f7[_0x523d70(0x17e)](_0x33e62e)?_0x33e62e:null,'globalCredentials':a58_0x6915f7['existsSync'](_0x26b2e7)?_0x26b2e7:null};}[a58_0x26cdc7(0x163)](_0x76bd74,_0x39cfda){const _0x5ab6f1=a58_0x26cdc7;if(!_0x39cfda)return _0x5ab6f1(0x198);const _0x4fb903=_0x39cfda;if(this[_0x5ab6f1(0x17f)][_0x5ab6f1(0x1aa)][_0x76bd74]===_0x4fb903){if(_0x76bd74===_0x5ab6f1(0x164)&&_0x4fb903===_0x5ab6f1(0x16b)&&!this['layers'][_0x5ab6f1(0x15f)][_0x5ab6f1(0x164)]&&!this[_0x5ab6f1(0x17f)][_0x5ab6f1(0x173)][_0x5ab6f1(0x164)]&&!this[_0x5ab6f1(0x17f)]['profile'][_0x5ab6f1(0x164)]&&!this[_0x5ab6f1(0x17f)][_0x5ab6f1(0x18f)][_0x5ab6f1(0x164)])return'default';return _0x5ab6f1(0x195)+_0x76bd74[_0x5ab6f1(0x19d)](/_/g,'-');}if(this[_0x5ab6f1(0x17f)][_0x5ab6f1(0x15f)][_0x76bd74]===_0x4fb903)return _0x5ab6f1(0x15f);if(this[_0x5ab6f1(0x17f)][_0x5ab6f1(0x173)][_0x76bd74]===_0x4fb903)return _0x5ab6f1(0x173);if(this['layers'][_0x5ab6f1(0x18e)][_0x76bd74]===_0x4fb903)return'profile:\x20'+this[_0x5ab6f1(0x161)];if(this['layers'][_0x5ab6f1(0x18f)][_0x76bd74]===_0x4fb903)return _0x5ab6f1(0x18f);return _0x5ab6f1(0x1a7);}[a58_0x26cdc7(0x177)](){const _0x73be15=a58_0x26cdc7,_0x25da70=a58_0x52efaf['join'](getConfigDir(),_0x73be15(0x17a));if(!a58_0x6915f7[_0x73be15(0x17e)](_0x25da70))return{};try{const _0x4fda5c=a58_0x6915f7['readFileSync'](_0x25da70,'utf-8');return JSON[_0x73be15(0x15e)](_0x4fda5c);}catch{return{};}}[a58_0x26cdc7(0x183)](_0x695a95){const _0x27f922=a58_0x26cdc7;_0x695a95[_0x27f922(0x164)]=this['site'],!_0x695a95['database']&&this[_0x27f922(0x182)]&&(_0x695a95[_0x27f922(0x182)]=this[_0x27f922(0x182)]),!_0x695a95['parentSegment']&&this[_0x27f922(0x184)]&&(_0x695a95[_0x27f922(0x187)]=this[_0x27f922(0x184)]),!_0x695a95[_0x27f922(0x174)]&&this[_0x27f922(0x18b)]&&(_0x695a95[_0x27f922(0x174)]=this['segment_path']),!_0x695a95[_0x27f922(0x19a)]&&this[_0x27f922(0x17d)]&&(_0x695a95[_0x27f922(0x19a)]=this[_0x27f922(0x17d)]),!_0x695a95[_0x27f922(0x180)]&&this[_0x27f922(0x1a1)]&&(_0x695a95[_0x27f922(0x180)]=this[_0x27f922(0x1a1)]),!_0x695a95[_0x27f922(0x19e)]&&this[_0x27f922(0x1a8)]&&(_0x695a95[_0x27f922(0x19e)]=this[_0x27f922(0x1a8)]);}[a58_0x26cdc7(0x185)](){const _0x11daad=a58_0x26cdc7;return[{'key':_0x11daad(0x164),'value':this['site']},{'key':_0x11daad(0x182),'value':this[_0x11daad(0x182)]},{'key':'parent_segment','value':this[_0x11daad(0x184)]},{'key':_0x11daad(0x18b),'value':this[_0x11daad(0x18b)]},{'key':'llm_project','value':this['llm_project']},{'key':_0x11daad(0x1a1),'value':this[_0x11daad(0x1a1)]},{'key':_0x11daad(0x1a8),'value':this[_0x11daad(0x1a8)]},{'key':_0x11daad(0x18e),'value':this[_0x11daad(0x161)]||undefined}];}[a58_0x26cdc7(0x16f)](){const _0x122ff2=a58_0x26cdc7;console['log'](a58_0x1e03d8[_0x122ff2(0x196)](_0x122ff2(0x16c)));for(const {key:_0x46b4c3,value:_0x5d0e10}of this[_0x122ff2(0x185)]()){_0x5d0e10&&console[_0x122ff2(0x15c)](a58_0x1e03d8['cyan'](_0x46b4c3)+':\x20'+_0x5d0e10);}}['displayWithSources'](){const _0x393b4c=a58_0x26cdc7;console['log'](a58_0x1e03d8['bold'](_0x393b4c(0x16c)));for(const {key:_0x2b686b,value:_0x1f2ec9}of this['getParameters']()){if(_0x1f2ec9){const _0x2550a8=_0x2b686b===_0x393b4c(0x18e)?_0x393b4c(0x165):'('+this[_0x393b4c(0x163)](_0x2b686b,_0x1f2ec9)+')';console[_0x393b4c(0x15c)](a58_0x1e03d8['cyan'](_0x2b686b)+':\x20'+_0x1f2ec9+'\x20'+a58_0x1e03d8['dim'](_0x2550a8));}}console['log']('\x0a'+a58_0x1e03d8[_0x393b4c(0x196)](_0x393b4c(0x17c)));const _0x2b89c1=[{'label':_0x393b4c(0x199),'path':this[_0x393b4c(0x189)][_0x393b4c(0x15f)],'extra':_0x393b4c(0x192)+this[_0x393b4c(0x16e)]+')'},{'label':_0x393b4c(0x172),'path':this[_0x393b4c(0x189)][_0x393b4c(0x173)]},{'label':_0x393b4c(0x15d),'path':this[_0x393b4c(0x189)][_0x393b4c(0x18e)]},{'label':'Profile\x20Credentials','path':this['configFiles'][_0x393b4c(0x175)]},{'label':_0x393b4c(0x19c),'path':this['configFiles'][_0x393b4c(0x18f)]},{'label':_0x393b4c(0x19f),'path':this['configFiles']['globalCredentials']}];for(const {label:_0xf4a9d,path:_0x4767cf,extra:_0x222381}of _0x2b89c1){if(_0x4767cf)console[_0x393b4c(0x15c)](a58_0x1e03d8['cyan'](_0xf4a9d)+':\x20'+_0x4767cf+'\x20'+a58_0x1e03d8[_0x393b4c(0x171)]('✓')+(_0x222381?'\x20'+a58_0x1e03d8[_0x393b4c(0x18c)](_0x222381):''));else{if(_0xf4a9d===_0x393b4c(0x199))console[_0x393b4c(0x15c)](a58_0x1e03d8['cyan'](_0xf4a9d)+':\x20'+a58_0x1e03d8['dim'](_0x393b4c(0x166))+'\x20'+a58_0x1e03d8[_0x393b4c(0x18c)](_0x393b4c(0x1a5)+this[_0x393b4c(0x16e)]+')'));else(_0xf4a9d===_0x393b4c(0x172)||_0xf4a9d==='Global')&&console[_0x393b4c(0x15c)](a58_0x1e03d8[_0x393b4c(0x17b)](_0xf4a9d)+':\x20'+a58_0x1e03d8['dim'](_0x393b4c(0x166)));}}}async['resolveAPIKeyAsync'](){const _0x333202=a58_0x26cdc7;if(!this['accessToken']){const _0x3a85e4=await getOAuthTokens(this[_0x333202(0x161)]||undefined);if(_0x3a85e4)return this['accessToken']=_0x3a85e4[_0x333202(0x19b)],undefined;}return this[_0x333202(0x179)]=await getAPIKeyAsync(this['site'],this[_0x333202(0x161)]||undefined),this[_0x333202(0x179)];}static async['createAsync'](_0x5d32b4){const _0x2a8333=a58_0x26cdc7,_0x55943e=new GlobalContext(_0x5d32b4);return await _0x55943e[_0x2a8333(0x197)](),_0x55943e;}}
@@ -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
+ const a59_0x3b2963=a59_0x5345;(function(_0x5613d6,_0x1e1563){const _0xf066f8=a59_0x5345,_0x1db4e6=_0x5613d6();while(!![]){try{const _0x4c8de3=parseInt(_0xf066f8(0x103))/0x1+parseInt(_0xf066f8(0x10e))/0x2+parseInt(_0xf066f8(0x105))/0x3*(parseInt(_0xf066f8(0xf1))/0x4)+-parseInt(_0xf066f8(0x108))/0x5*(parseInt(_0xf066f8(0xf0))/0x6)+-parseInt(_0xf066f8(0x112))/0x7+parseInt(_0xf066f8(0x101))/0x8*(parseInt(_0xf066f8(0x111))/0x9)+-parseInt(_0xf066f8(0x107))/0xa;if(_0x4c8de3===_0x1e1563)break;else _0x1db4e6['push'](_0x1db4e6['shift']());}catch(_0x3e3a13){_0x1db4e6['push'](_0x1db4e6['shift']());}}}(a59_0x4b8d,0x19055));function a59_0x4b8d(){const _0x3faaac=['access','System\x20keychain\x20is\x20not\x20available','8iunlML','error','203180JiSBue','@napi-rs/keyring','9291uDcbpQ','setPassword','3292010qgCuud','5NVnxUH','deleteCredential','value','unavailable','access_denied','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.','329400KiZICj','includes','Warning:\x20','1823589vmiYHu','822668RNwclp','success','could\x20not\x20be\x20found','257820phSouC','28eeICrk','not\x20supported','restricted',':api_key','-25300','reason','getPassword','tdx','profile:','Entry','message','no\x20matching\x20entry','cannot\x20find','toLowerCase'];a59_0x4b8d=function(){return _0x3faaac;};return a59_0x4b8d();}const SERVICE_NAME=a59_0x3b2963(0xf8);let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x134ac8=a59_0x3b2963;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x5da8c7=await import(_0x134ac8(0x104));return EntryClass=_0x5da8c7[_0x134ac8(0xfa)],EntryClass;}catch(_0x41b1ca){return keyringLoadError=_0x41b1ca instanceof Error?_0x41b1ca:new Error(String(_0x41b1ca)),null;}}function getAccountName(_0x14b276){const _0x427af7=a59_0x3b2963,_0x43714f=_0x14b276||'';return _0x427af7(0xf9)+_0x43714f+_0x427af7(0xf4);}export async function getKeychainAPIKey(_0x57a045){const _0x8dad66=a59_0x3b2963,_0x133b65=await getKeychainAPIKeyWithStatus(_0x57a045);if(_0x133b65[_0x8dad66(0xee)])return _0x133b65[_0x8dad66(0x10a)];return _0x133b65[_0x8dad66(0xf6)]===_0x8dad66(0x10c)&&console[_0x8dad66(0x102)](_0x8dad66(0x110)+_0x133b65[_0x8dad66(0xfb)]),null;}function a59_0x5345(_0x3c475d,_0x43a2d5){_0x3c475d=_0x3c475d-0xee;const _0x4b8d4d=a59_0x4b8d();let _0x5345be=_0x4b8d4d[_0x3c475d];return _0x5345be;}export async function getKeychainAPIKeyWithStatus(_0x53e041){const _0x52557d=a59_0x3b2963;try{const _0x132d5a=await getEntryClass();if(!_0x132d5a)return{'success':![],'reason':'unavailable'};const _0x2da4b1=getAccountName(_0x53e041),_0x3c99e1=new _0x132d5a(SERVICE_NAME,_0x2da4b1),_0x2611d8=_0x3c99e1[_0x52557d(0xf7)]();if(_0x2611d8)return{'success':!![],'value':_0x2611d8};return{'success':![],'reason':'not_found'};}catch(_0x2dd279){const _0x53a24c=_0x2dd279 instanceof Error?_0x2dd279[_0x52557d(0xfb)]:String(_0x2dd279);if(_0x53a24c[_0x52557d(0x10f)](_0x52557d(0xf5))||_0x53a24c[_0x52557d(0xfe)]()[_0x52557d(0x10f)](_0x52557d(0xef))||_0x53a24c['toLowerCase']()[_0x52557d(0x10f)]('not\x20found')||_0x53a24c[_0x52557d(0xfe)]()['includes'](_0x52557d(0xfc)))return{'success':![],'reason':'not_found'};if(_0x53a24c['includes']('-25293')||_0x53a24c[_0x52557d(0xfe)]()['includes'](_0x52557d(0xf3))||_0x53a24c[_0x52557d(0xfe)]()[_0x52557d(0x10f)](_0x52557d(0xff)))return{'success':![],'reason':'access_denied','message':_0x52557d(0x10d)};return{'success':![],'reason':_0x52557d(0x10b),'message':_0x53a24c};}}export async function saveKeychainAPIKey(_0x4570a0,_0x3b7718){const _0x341526=a59_0x3b2963,_0x342cc9=await getEntryClass();if(!_0x342cc9)throw new Error(_0x341526(0x100));const _0x263d07=getAccountName(_0x3b7718),_0x162e35=new _0x342cc9(SERVICE_NAME,_0x263d07);_0x162e35[_0x341526(0x106)](_0x4570a0);}export async function deleteKeychainAPIKey(_0x250e2f){const _0x3d6e92=a59_0x3b2963;try{const _0x5708e2=await getEntryClass();if(!_0x5708e2)return![];const _0x3576a0=getAccountName(_0x250e2f),_0x471c64=new _0x5708e2(SERVICE_NAME,_0x3576a0);return _0x471c64[_0x3d6e92(0x109)](),!![];}catch{return![];}}export async function isKeychainAvailable(){const _0x22a61a=a59_0x3b2963;try{const _0x3e9573=await getEntryClass();if(!_0x3e9573)return![];const _0x1f55d8=new _0x3e9573(SERVICE_NAME,'__keychain_test__');return _0x1f55d8['getPassword'](),!![];}catch(_0x30b974){const _0x28bf80=_0x30b974 instanceof Error?_0x30b974['message'][_0x22a61a(0xfe)]():'';if(_0x28bf80[_0x22a61a(0x10f)]('not\x20available')||_0x28bf80[_0x22a61a(0x10f)](_0x22a61a(0xf2))||_0x28bf80['includes'](_0x22a61a(0xfd)))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
+ (function(_0x2632f2,_0x5c07bf){const _0x41615c=a60_0x53d0,_0x54fe82=_0x2632f2();while(!![]){try{const _0x1648ad=parseInt(_0x41615c(0x76))/0x1*(-parseInt(_0x41615c(0x6c))/0x2)+-parseInt(_0x41615c(0x6a))/0x3+-parseInt(_0x41615c(0x74))/0x4+parseInt(_0x41615c(0x75))/0x5*(parseInt(_0x41615c(0x73))/0x6)+-parseInt(_0x41615c(0x6b))/0x7+-parseInt(_0x41615c(0x70))/0x8+-parseInt(_0x41615c(0x69))/0x9*(-parseInt(_0x41615c(0x71))/0xa);if(_0x1648ad===_0x5c07bf)break;else _0x54fe82['push'](_0x54fe82['shift']());}catch(_0x1b9e24){_0x54fe82['push'](_0x54fe82['shift']());}}}(a60_0x151a,0x3fabe));const SERVICE_NAME='tdx';let EntryClass=null,keyringLoadError=null;function a60_0x53d0(_0x26fb09,_0x212948){_0x26fb09=_0x26fb09-0x68;const _0x151ae6=a60_0x151a();let _0x53d060=_0x151ae6[_0x26fb09];return _0x53d060;}async function getEntryClass(){const _0x3411a0=a60_0x53d0;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x16ea27=await import(_0x3411a0(0x68));return EntryClass=_0x16ea27['Entry'],EntryClass;}catch(_0x40923f){return keyringLoadError=_0x40923f instanceof Error?_0x40923f:new Error(String(_0x40923f)),null;}}function getOAuthAccountName(_0x4611e1){const _0x530d86=a60_0x53d0,_0x5dba5a=_0x4611e1||'';return'profile:'+_0x5dba5a+_0x530d86(0x72);}export async function saveOAuthTokens(_0x323fbc,_0x419d2d){const _0x346130=a60_0x53d0,_0x5b5e42=await getEntryClass();if(!_0x5b5e42)throw new Error(_0x346130(0x6e));const _0x53829c=getOAuthAccountName(_0x419d2d),_0x496396=new _0x5b5e42(SERVICE_NAME,_0x53829c);_0x496396['setPassword'](JSON['stringify'](_0x323fbc));}function a60_0x151a(){const _0x2829cc=['43190tKPhtp','259988dOFUAY','@napi-rs/keyring','181800rtEYIz','622350CQiNix','497350KiZkkM','2MeAdGw','getPassword','System\x20keychain\x20is\x20not\x20available','deleteCredential','2472432OZTcxz','590bsGbIY',':oauth_tokens','132xPFQeZ','1093984GkObQL'];a60_0x151a=function(){return _0x2829cc;};return a60_0x151a();}export async function getOAuthTokens(_0x3cd6bd){const _0x5a33b3=a60_0x53d0;try{const _0x3a4d62=await getEntryClass();if(!_0x3a4d62)return null;const _0x1b72e0=getOAuthAccountName(_0x3cd6bd),_0x1fceb5=new _0x3a4d62(SERVICE_NAME,_0x1b72e0),_0x3af0db=_0x1fceb5[_0x5a33b3(0x6d)]();if(_0x3af0db)return JSON['parse'](_0x3af0db);return null;}catch{return null;}}export async function deleteOAuthTokens(_0x47644e){const _0x4ecc7c=a60_0x53d0;try{const _0x3536b1=await getEntryClass();if(!_0x3536b1)return![];const _0x42d22e=getOAuthAccountName(_0x47644e),_0x1cdf6a=new _0x3536b1(SERVICE_NAME,_0x42d22e);return _0x1cdf6a[_0x4ecc7c(0x6f)](),!![];}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
+ function a61_0xe682(){const _0x50b9e1=['OAuth\x20callback\x20received\x20an\x20error\x20or\x20missing\x20parameters','OAuth\x20token\x20request\x20failed\x20(','code','text','Failed\x20to\x20start\x20OAuth\x20callback\x20server:\x20','response_type','base64url','4010993FdTUWd','Not\x20Found','text/html','redirect_uri','\x20is\x20already\x20in\x20use.\x20Stop\x20the\x20process\x20using\x20it\x20and\x20retry.','Port\x20','tdx','sha256','5260GbWwdm','randomBytes','9LCcPMZ','EADDRINUSE','update','706388pBbOPD','stg-ap01','pathname','29928LdUjvN','/oauth/token','598Frwfhu','5234455pxZfkf','http://127.0.0.1','scope','toString','547YETlmA','<html><body><h1>Authentication\x20Successful</h1><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','state','20aKZBRR','stg-us01','writeHead','/oauth/authorize','/oauth/callback','dev-us01','):\x20','get','7402978SdWBrx','close','3544728XyNvXB','clientId','waitForCallback','application/x-www-form-urlencoded','text/plain','authorization_code','codeChallenge','OAuth\x20state\x20mismatch\x20—\x20possible\x20CSRF\x20attack','dev-eu01','S256','createServer','end','set','listen','POST','searchParams','<html><body><h1>Authentication\x20Failed</h1><p>An\x20error\x20occurred\x20during\x20authentication.\x20Please\x20close\x20this\x20window\x20and\x20try\x20again.</p></body></html>','url','9LMYmdK','createHash','http://localhost:','client_id','stg-ap03','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','127.0.0.1','6IrcKjK','error'];a61_0xe682=function(){return _0x50b9e1;};return a61_0xe682();}const a61_0x3fbd96=a61_0x56f3;(function(_0x14f709,_0x4bfdcb){const _0x347fc5=a61_0x56f3,_0xf4bfe8=_0x14f709();while(!![]){try{const _0x30ab93=-parseInt(_0x347fc5(0x1de))/0x1*(-parseInt(_0x347fc5(0x1cf))/0x2)+parseInt(_0x347fc5(0x1d1))/0x3*(parseInt(_0x347fc5(0x1d4))/0x4)+parseInt(_0x347fc5(0x1da))/0x5+parseInt(_0x347fc5(0x1be))/0x6*(-parseInt(_0x347fc5(0x1c7))/0x7)+parseInt(_0x347fc5(0x1a5))/0x8*(-parseInt(_0x347fc5(0x1b7))/0x9)+-parseInt(_0x347fc5(0x1e1))/0xa*(parseInt(_0x347fc5(0x1a3))/0xb)+-parseInt(_0x347fc5(0x1d7))/0xc*(-parseInt(_0x347fc5(0x1d9))/0xd);if(_0x30ab93===_0x4bfdcb)break;else _0xf4bfe8['push'](_0xf4bfe8['shift']());}catch(_0x1cbbc5){_0xf4bfe8['push'](_0xf4bfe8['shift']());}}}(a61_0xe682,0xbb7ba));import*as a61_0x32374d from'node:crypto';import*as a61_0x217941 from'node:http';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a61_0x56f3(_0x3d7240,_0x459ddf){_0x3d7240=_0x3d7240-0x1a0;const _0xe68243=a61_0xe682();let _0x56f3ec=_0xe68243[_0x3d7240];return _0x56f3ec;}import{openBrowser}from'../utils/process.js';const OAUTH_SUPPORTED_SITES=new Set([a61_0x3fbd96(0x1a0),a61_0x3fbd96(0x1ad),a61_0x3fbd96(0x1e2),a61_0x3fbd96(0x1d5),a61_0x3fbd96(0x1bb)]);export function isOAuthSupported(_0x1f2232){return OAUTH_SUPPORTED_SITES['has'](_0x1f2232);}export const OAUTH_CALLBACK_PORT=0xaa4a;export const OAUTH_REDIRECT_URI=a61_0x3fbd96(0x1b9)+OAUTH_CALLBACK_PORT+a61_0x3fbd96(0x1e5);export function getOAuthClientId(){const _0x2929fc=a61_0x3fbd96;return process.env.TD_OAUTH_CLIENT_ID||_0x2929fc(0x1cd);}export function generatePKCEPair(){const _0x1dcc49=a61_0x3fbd96,_0x802585=a61_0x32374d['randomBytes'](0x20)[_0x1dcc49(0x1dd)](_0x1dcc49(0x1c6)),_0x451b59=a61_0x32374d[_0x1dcc49(0x1b8)](_0x1dcc49(0x1ce))[_0x1dcc49(0x1d3)](_0x802585)['digest']('base64url');return{'verifier':_0x802585,'challenge':_0x451b59};}export function buildAuthorizeURL(_0xa81594,_0x188c72){const _0x4beae3=a61_0x3fbd96,_0x114cc5=new URL(_0x4beae3(0x1e4),_0xa81594);return _0x114cc5[_0x4beae3(0x1b4)][_0x4beae3(0x1b1)](_0x4beae3(0x1c5),'code'),_0x114cc5[_0x4beae3(0x1b4)][_0x4beae3(0x1b1)](_0x4beae3(0x1ba),_0x188c72[_0x4beae3(0x1a6)]),_0x114cc5[_0x4beae3(0x1b4)][_0x4beae3(0x1b1)](_0x4beae3(0x1ca),_0x188c72['redirectUri']),_0x114cc5[_0x4beae3(0x1b4)][_0x4beae3(0x1b1)](_0x4beae3(0x1e0),_0x188c72[_0x4beae3(0x1e0)]),_0x114cc5[_0x4beae3(0x1b4)][_0x4beae3(0x1b1)]('code_challenge',_0x188c72[_0x4beae3(0x1ab)]),_0x114cc5[_0x4beae3(0x1b4)]['set']('code_challenge_method',_0x4beae3(0x1ae)),_0x188c72['scope']&&_0x114cc5[_0x4beae3(0x1b4)]['set'](_0x4beae3(0x1dc),_0x188c72[_0x4beae3(0x1dc)]),_0x114cc5[_0x4beae3(0x1dd)]();}export async function postTokenRequest(_0x1b6bb1,_0x512bd0){const _0x2f5bc0=a61_0x3fbd96,_0x37c88b=new URLSearchParams(_0x512bd0)[_0x2f5bc0(0x1dd)](),_0x591769=await fetch(_0x1b6bb1,{'method':_0x2f5bc0(0x1b3),'headers':{'Content-Type':_0x2f5bc0(0x1a8)},'body':_0x37c88b});if(!_0x591769['ok']){const _0x1f97b5=await _0x591769[_0x2f5bc0(0x1c3)]();throw new Error(_0x2f5bc0(0x1c1)+_0x591769['status']+_0x2f5bc0(0x1a1)+_0x1f97b5);}return await _0x591769['json']();}export async function exchangeCodeForTokens(_0x36e6cb,_0x2610e6,_0x38dcf6,_0x7fad21){const _0x5b6142=a61_0x3fbd96,_0x41aebb=_0x36e6cb+_0x5b6142(0x1d8);return postTokenRequest(_0x41aebb,{'grant_type':_0x5b6142(0x1aa),'client_id':getOAuthClientId(),'code':_0x2610e6,'code_verifier':_0x38dcf6,'redirect_uri':_0x7fad21});}export function startLocalCallbackServer(){const _0x599374=a61_0x3fbd96;let _0x4407c6,_0x2a2866;const _0x45ea99=new Promise((_0x20673b,_0x2f67ed)=>{_0x4407c6=_0x20673b,_0x2a2866=_0x2f67ed;}),_0x580daf=a61_0x217941[_0x599374(0x1af)]((_0x42b54d,_0x45e388)=>{const _0x2d2318=_0x599374,_0x282ce0=new URL(_0x42b54d[_0x2d2318(0x1b6)]||'/',_0x2d2318(0x1db));if(_0x282ce0[_0x2d2318(0x1d6)]!==_0x2d2318(0x1e5)){_0x45e388[_0x2d2318(0x1e3)](0x194,{'Content-Type':_0x2d2318(0x1a9)}),_0x45e388[_0x2d2318(0x1b0)](_0x2d2318(0x1c8));return;}const _0x26287d=_0x282ce0[_0x2d2318(0x1b4)][_0x2d2318(0x1a2)](_0x2d2318(0x1c2)),_0x3cd540=_0x282ce0[_0x2d2318(0x1b4)]['get'](_0x2d2318(0x1e0)),_0x72b65e=_0x282ce0[_0x2d2318(0x1b4)][_0x2d2318(0x1a2)](_0x2d2318(0x1bf));if(_0x72b65e||!_0x26287d||!_0x3cd540){_0x45e388[_0x2d2318(0x1e3)](0x190,{'Content-Type':_0x2d2318(0x1c9)}),_0x45e388[_0x2d2318(0x1b0)](_0x2d2318(0x1b5)),_0x2a2866(new Error(_0x2d2318(0x1c0)));return;}_0x45e388['writeHead'](0xc8,{'Content-Type':_0x2d2318(0x1c9)}),_0x45e388[_0x2d2318(0x1b0)](_0x2d2318(0x1df)),_0x4407c6({'code':_0x26287d,'state':_0x3cd540});});_0x580daf['on'](_0x599374(0x1bf),_0x18397c=>{const _0xd88fcf=_0x599374;_0x18397c[_0xd88fcf(0x1c2)]===_0xd88fcf(0x1d2)?_0x2a2866(new Error(_0xd88fcf(0x1cc)+OAUTH_CALLBACK_PORT+_0xd88fcf(0x1cb))):_0x2a2866(new Error(_0xd88fcf(0x1c4)+_0x18397c['message']));}),_0x580daf[_0x599374(0x1b2)](OAUTH_CALLBACK_PORT,_0x599374(0x1bd));const _0x5c45f2=setTimeout(()=>{const _0x120adc=_0x599374;_0x2a2866(new Error(_0x120adc(0x1bc))),_0x580daf[_0x120adc(0x1a4)]();},0x2*0x3c*0x3e8);return{'waitForCallback':()=>_0x45ea99,'close':()=>{const _0x4ea747=_0x599374;clearTimeout(_0x5c45f2),_0x580daf[_0x4ea747(0x1a4)]();}};}export async function startOAuthFlow(_0x1726d7){const _0x315d43=a61_0x3fbd96,_0x3599fd=getConsoleUrl(_0x1726d7),_0x1d4782=getOAuthClientId(),{verifier:_0x28a985,challenge:_0x565148}=generatePKCEPair(),_0xb12f5e=a61_0x32374d[_0x315d43(0x1d0)](0x10)[_0x315d43(0x1dd)]('hex'),_0x4c89a3=startLocalCallbackServer();try{const _0x210722=OAUTH_REDIRECT_URI,_0x41dca0=buildAuthorizeURL(_0x3599fd,{'clientId':_0x1d4782,'redirectUri':_0x210722,'state':_0xb12f5e,'codeChallenge':_0x565148});openBrowser(_0x41dca0);const _0x846fcf=await _0x4c89a3[_0x315d43(0x1a7)]();if(_0x846fcf[_0x315d43(0x1e0)]!==_0xb12f5e)throw new Error(_0x315d43(0x1ac));return await exchangeCodeForTokens(_0x3599fd,_0x846fcf[_0x315d43(0x1c2)],_0x28a985,_0x210722);}finally{_0x4c89a3['close']();}}
@@ -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_0x46fe5d=a62_0x4a3a;(function(_0x5ec36e,_0x432519){const _0x4c7df1=a62_0x4a3a,_0x180842=_0x5ec36e();while(!![]){try{const _0x58392a=parseInt(_0x4c7df1(0x1ef))/0x1+parseInt(_0x4c7df1(0x1d8))/0x2+parseInt(_0x4c7df1(0x1e0))/0x3+parseInt(_0x4c7df1(0x1dc))/0x4*(parseInt(_0x4c7df1(0x1d0))/0x5)+parseInt(_0x4c7df1(0x1e1))/0x6+parseInt(_0x4c7df1(0x20a))/0x7*(parseInt(_0x4c7df1(0x1cf))/0x8)+-parseInt(_0x4c7df1(0x1d3))/0x9*(parseInt(_0x4c7df1(0x208))/0xa);if(_0x58392a===_0x432519)break;else _0x180842['push'](_0x180842['shift']());}catch(_0xb7e72d){_0x180842['push'](_0x180842['shift']());}}}(a62_0x46d9,0x916ea));import*as a62_0x3456cd from'node:fs';import*as a62_0x3e38cb 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_0x46fe5d(0x1c2);export function getProfileParams(_0x2bbefd){const _0x100036=a62_0x46fe5d,_0xb51c81={};if(!_0x2bbefd)return _0xb51c81;for(const [_0x2855c8,_0x37a03a]of Object[_0x100036(0x1ff)](_0x2bbefd)){_0x2855c8!==_0x100036(0x206)&&_0x37a03a!==undefined&&(_0xb51c81[_0x2855c8]=_0x37a03a);}return _0xb51c81;}export function getProfilesDir(){const _0x97a91a=a62_0x46fe5d;return a62_0x3e38cb[_0x97a91a(0x1c7)](getConfigDir(),'profiles');}function getProfileDir(_0x5d7753){const _0x183784=a62_0x46fe5d;return a62_0x3e38cb[_0x183784(0x1c7)](getProfilesDir(),_0x5d7753);}function getProfileConfigPath(_0xc4a337){const _0x183ac8=a62_0x46fe5d;return a62_0x3e38cb[_0x183ac8(0x1c7)](getProfileDir(_0xc4a337),_0x183ac8(0x1ed));}function getProfileEnvPath(_0x18d5b3){const _0x2d12d8=a62_0x46fe5d;return a62_0x3e38cb[_0x2d12d8(0x1c7)](getProfileDir(_0x18d5b3),_0x2d12d8(0x1df));}function getGlobalConfigPath(){const _0x26e65c=a62_0x46fe5d;return a62_0x3e38cb[_0x26e65c(0x1c7)](getConfigDir(),_0x26e65c(0x1ed));}function validateProfileName(_0xb6629a){const _0x1cf877=a62_0x46fe5d;if(/^@?[a-zA-Z0-9_-]+$/[_0x1cf877(0x1e4)](_0xb6629a))return;if(/^@tdx-studio:[a-zA-Z0-9_-]+:\d+(:\d+)?$/[_0x1cf877(0x1e4)](_0xb6629a))return;throw new Error(_0x1cf877(0x1d2)+_0xb6629a+_0x1cf877(0x1cd));}function validateProfileConfig(_0x3cb244,_0x82e381){const _0x2cec4c=a62_0x46fe5d;if(typeof _0x3cb244!=='object'||_0x3cb244===null)throw new SDKError(ErrorCode[_0x2cec4c(0x1e5)],_0x2cec4c(0x1d1)+_0x82e381+_0x2cec4c(0x1e8));const _0x139a81=[_0x2cec4c(0x206),_0x2cec4c(0x209),_0x2cec4c(0x1ea),'parent_segment',_0x2cec4c(0x1fc),_0x2cec4c(0x1ee),_0x2cec4c(0x1e9)],_0x11086a=_0x3cb244;for(const _0x47e779 of Object[_0x2cec4c(0x1c8)](_0x11086a)){!_0x139a81[_0x2cec4c(0x20c)](_0x47e779)&&console[_0x2cec4c(0x1cb)](_0x2cec4c(0x1fd)+_0x82e381+_0x2cec4c(0x1c6)+_0x47e779+_0x2cec4c(0x1d7));}if(_0x11086a[_0x2cec4c(0x206)]!==undefined&&typeof _0x11086a[_0x2cec4c(0x206)]!==_0x2cec4c(0x1f6))throw new SDKError(ErrorCode[_0x2cec4c(0x1e5)],_0x2cec4c(0x1d1)+_0x82e381+_0x2cec4c(0x200));if(_0x11086a[_0x2cec4c(0x209)]!==undefined&&typeof _0x11086a[_0x2cec4c(0x209)]!==_0x2cec4c(0x1f6))throw new SDKError(ErrorCode[_0x2cec4c(0x1e5)],_0x2cec4c(0x1d1)+_0x82e381+_0x2cec4c(0x1ec));if(_0x11086a['database']!==undefined&&typeof _0x11086a[_0x2cec4c(0x1ea)]!=='string')throw new SDKError(ErrorCode[_0x2cec4c(0x1e5)],_0x2cec4c(0x1d1)+_0x82e381+_0x2cec4c(0x1f8));if(_0x11086a[_0x2cec4c(0x1c1)]!==undefined&&typeof _0x11086a[_0x2cec4c(0x1c1)]!=='string')throw new SDKError(ErrorCode[_0x2cec4c(0x1e5)],_0x2cec4c(0x1d1)+_0x82e381+_0x2cec4c(0x205));if(_0x11086a['llm_project']!==undefined&&typeof _0x11086a[_0x2cec4c(0x1fc)]!==_0x2cec4c(0x1f6))throw new SDKError(ErrorCode[_0x2cec4c(0x1e5)],_0x2cec4c(0x1d1)+_0x82e381+_0x2cec4c(0x1fe));if(_0x11086a[_0x2cec4c(0x1ee)]!==undefined&&typeof _0x11086a['llm_agent']!==_0x2cec4c(0x1f6))throw new SDKError(ErrorCode[_0x2cec4c(0x1e5)],_0x2cec4c(0x1d1)+_0x82e381+'\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string');return!![];}function loadProfilesFromTdxJson(_0x32d57b,_0x41606e){const _0x3ef5b6=a62_0x46fe5d;if(!a62_0x3456cd[_0x3ef5b6(0x1f3)](_0x32d57b))return[];try{const _0xc66929=a62_0x3456cd[_0x3ef5b6(0x1c3)](_0x32d57b,'utf-8'),_0x2da2ee=JSON[_0x3ef5b6(0x20d)](_0xc66929);if(!_0x2da2ee[_0x3ef5b6(0x1ca)]||typeof _0x2da2ee['profiles']!==_0x3ef5b6(0x204))return[];const _0x2621a1=[];for(const [_0x429a6d,_0x3acc03]of Object[_0x3ef5b6(0x1ff)](_0x2da2ee[_0x3ef5b6(0x1ca)])){try{validateProfileConfig(_0x3acc03,_0x429a6d);const _0x31cb89=getNewCredentialPath(_0x429a6d),_0xb981b0=getOldCredentialPath(_0x429a6d),_0x186eda=a62_0x3456cd['existsSync'](_0x31cb89)||a62_0x3456cd[_0x3ef5b6(0x1f3)](_0xb981b0);_0x2621a1['push']({'name':_0x429a6d,'config':_0x3acc03,'metadata':{'name':_0x429a6d,'createdAt':new Date()[_0x3ef5b6(0x1f9)]()},'hasCredentials':_0x186eda,'scope':_0x41606e});}catch(_0x1b6038){_0x1b6038 instanceof Error&&(console[_0x3ef5b6(0x1cb)]('\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20'+_0x32d57b+':'),console['warn']('\x20\x20'+_0x1b6038[_0x3ef5b6(0x1bf)]+'\x0a'));}}return _0x2621a1;}catch(_0x2dd3b2){return _0x2dd3b2 instanceof SyntaxError?(console[_0x3ef5b6(0x1cb)](_0x3ef5b6(0x202)+_0x32d57b+_0x3ef5b6(0x1f4)),console[_0x3ef5b6(0x1cb)]('Error:\x20'+_0x2dd3b2[_0x3ef5b6(0x1bf)]+'\x0a')):console[_0x3ef5b6(0x1cb)](_0x3ef5b6(0x1db)+_0x32d57b+':\x20'+_0x2dd3b2+'\x0a'),[];}}export function getNewCredentialPath(_0x48f249){const _0x276a31=a62_0x46fe5d;return a62_0x3e38cb[_0x276a31(0x1c7)](getConfigDir(),_0x276a31(0x1eb)+_0x48f249);}function getOldCredentialPath(_0x5f021d){const _0x34d9d1=a62_0x46fe5d;return a62_0x3e38cb[_0x34d9d1(0x1c7)](getProfilesDir(),_0x5f021d,_0x34d9d1(0x1df));}function loadProfilesFromTdxJsonFiles(){const _0xa114b2=a62_0x46fe5d,_0x40e4ee=[],_0x848e79=findProjectConfigPath();_0x848e79&&_0x40e4ee['push'](...loadProfilesFromTdxJson(_0x848e79,_0xa114b2(0x1c0)));const _0x2aa916=a62_0x3e38cb[_0xa114b2(0x1c7)](getConfigDir(),_0xa114b2(0x1ed));return _0x40e4ee[_0xa114b2(0x1f7)](...loadProfilesFromTdxJson(_0x2aa916,_0xa114b2(0x207))),_0x40e4ee;}function loadProfilesFromDirectories(){const _0x1edace=a62_0x46fe5d,_0xb76774=getProfilesDir();if(!a62_0x3456cd[_0x1edace(0x1f3)](_0xb76774))return[];try{return a62_0x3456cd[_0x1edace(0x1cc)](_0xb76774,{'withFileTypes':!![]})['filter'](_0x5d84e5=>_0x5d84e5['isDirectory']())[_0x1edace(0x203)](_0x399cf9=>_0x399cf9[_0x1edace(0x1f5)])['filter'](_0x441eb1=>{const _0x497fd0=getProfileConfigPath(_0x441eb1),_0x19ff3c=getProfileEnvPath(_0x441eb1);return a62_0x3456cd['existsSync'](_0x497fd0)||a62_0x3456cd['existsSync'](_0x19ff3c);})['map'](_0x17ee93=>{const _0x4a808d=_0x1edace,_0x305bd1=loadProfileFromDirectory(_0x17ee93);if(_0x305bd1)return{..._0x305bd1,'scope':_0x4a808d(0x20b)};return null;})[_0x1edace(0x1d5)](_0x4d58c8=>_0x4d58c8!==null);}catch{return[];}}function loadProfileFromDirectory(_0x47b06c){const _0x4d35fc=a62_0x46fe5d,_0x15d637=getProfileConfigPath(_0x47b06c),_0x342e25=getOldCredentialPath(_0x47b06c);if(!a62_0x3456cd[_0x4d35fc(0x1f3)](_0x15d637)&&!a62_0x3456cd['existsSync'](_0x342e25))return null;let _0x45b8bd={},_0x1a9705={'name':_0x47b06c,'createdAt':new Date()[_0x4d35fc(0x1f9)]()};if(a62_0x3456cd[_0x4d35fc(0x1f3)](_0x15d637))try{const _0x426119=a62_0x3456cd[_0x4d35fc(0x1c3)](_0x15d637,_0x4d35fc(0x1d4)),_0x49341e=JSON['parse'](_0x426119),{metadata:_0x396d3a,..._0x30da8d}=_0x49341e;_0x45b8bd=_0x30da8d,_0x396d3a&&(_0x1a9705=_0x396d3a);}catch{}return{'name':_0x47b06c,'config':_0x45b8bd,'metadata':_0x1a9705,'hasCredentials':a62_0x3456cd['existsSync'](_0x342e25),'scope':_0x4d35fc(0x20b)};}export function listProfiles(){const _0xd5f209=a62_0x46fe5d,_0x178de7=loadProfilesFromTdxJsonFiles(),_0x54d8ba=loadProfilesFromDirectories();if(_0x54d8ba['length']>0x0){const _0x29378b=_0x54d8ba[_0xd5f209(0x203)](_0x212930=>_0x212930[_0xd5f209(0x1f5)])['join'](',\x20'),_0x5abd52=getConfigDir();console[_0xd5f209(0x1cb)](_0xd5f209(0x1f2)+_0x29378b),console['warn'](_0xd5f209(0x1ce)),console[_0xd5f209(0x1cb)](_0xd5f209(0x1c4)+a62_0x3e38cb[_0xd5f209(0x1c7)](_0x5abd52,_0xd5f209(0x1ed))),console[_0xd5f209(0x1cb)]('\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)'),console[_0xd5f209(0x1cb)]('\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a');}const _0x295a89=[..._0x178de7,..._0x54d8ba],_0x48fc7d=new Map();for(const _0x1d36ea of _0x295a89){!_0x48fc7d['has'](_0x1d36ea[_0xd5f209(0x1f5)])&&_0x48fc7d[_0xd5f209(0x1d6)](_0x1d36ea[_0xd5f209(0x1f5)],_0x1d36ea);}return Array[_0xd5f209(0x1e6)](_0x48fc7d[_0xd5f209(0x1de)]())[_0xd5f209(0x201)]((_0x41e8ef,_0x1372e5)=>_0x41e8ef[_0xd5f209(0x1f5)][_0xd5f209(0x1f0)](_0x1372e5[_0xd5f209(0x1f5)]));}function a62_0x46d9(){const _0x28ab54=['\x27\x20will\x20be\x20ignored','857580OXRBxm','To\x20migrate:','\x20\x20mv\x20\x22','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','1624atyoun','stringify','values','.env','389736uXlVHJ','471054qvIMGf','Profile\x20','profile','test','INVALID_PROFILE_CONFIG','from','some','\x27:\x20config\x20must\x20be\x20an\x20object','user_info','database','.env.','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','tdx.json','llm_agent','293635aTDdLR','localeCompare','Failed\x20to\x20parse\x20','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','existsSync',':\x20Invalid\x20JSON\x20syntax','name','string','push','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','toISOString','rmSync',',\x20creating\x20new\x20file','llm_project','Warning:\x20Profile\x20\x27','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','entries','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','sort','\x0aWarning:\x20Failed\x20to\x20parse\x20','map','object','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','description','user','929700HtvmKO','site','56MhZmxc','directory','includes','parse','message','local','parent_segment','@tdx-studio','readFileSync','\x20\x201.\x20Edit:\x20','Warning:\x20Failed\x20to\x20parse\x20','\x27:\x20unknown\x20config\x20key\x20\x27','join','keys','\x27\x20not\x20found\x20in\x20user\x20configuration','profiles','warn','readdirSync','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20underscore,\x20and\x20optional\x20@\x20prefix\x20for\x20reserved\x20profiles.','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','10712JDBhzc','8335SxEWRj','Profile\x20\x27','Invalid\x20profile\x20name:\x20','99HQkLYz','utf-8','filter','set'];a62_0x46d9=function(){return _0x28ab54;};return a62_0x46d9();}export function profileExists(_0x19e410){const _0x510c56=a62_0x46fe5d,_0x11d8a7=listProfiles();return _0x11d8a7[_0x510c56(0x1e7)](_0x45febc=>_0x45febc[_0x510c56(0x1f5)]===_0x19e410);}export function loadProfile(_0xba8ccd){const _0x26f0da=a62_0x46fe5d;validateProfileName(_0xba8ccd);const _0x2a3a1d=listProfiles(),_0x339c99=_0x2a3a1d['find'](_0x123494=>_0x123494[_0x26f0da(0x1f5)]===_0xba8ccd);return _0x339c99||null;}export function saveProfile(_0x1b9a7b,_0x4a98ca,_0x44b0da=![]){saveProfileToUserConfig(_0x1b9a7b,_0x4a98ca);}export function deleteProfile(_0x4bd4c1){const _0x6a26cf=a62_0x46fe5d;validateProfileName(_0x4bd4c1);const _0x450313=getProfileDir(_0x4bd4c1);if(!a62_0x3456cd[_0x6a26cf(0x1f3)](_0x450313))throw new Error(_0x6a26cf(0x1e2)+_0x4bd4c1+'\x20does\x20not\x20exist');a62_0x3456cd[_0x6a26cf(0x1fa)](_0x450313,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x6400d4,_0x18cba1){const _0xc8110e=a62_0x46fe5d;validateProfileName(_0x6400d4);const _0x1ce673=getGlobalConfigPath(),_0x4d31f4=getConfigDir();!a62_0x3456cd[_0xc8110e(0x1f3)](_0x4d31f4)&&createSecureDirectory(_0x4d31f4);let _0x33e9f3={};if(a62_0x3456cd['existsSync'](_0x1ce673))try{const _0x20aeba=a62_0x3456cd[_0xc8110e(0x1c3)](_0x1ce673,_0xc8110e(0x1d4));_0x33e9f3=JSON[_0xc8110e(0x20d)](_0x20aeba);}catch{console[_0xc8110e(0x1cb)](_0xc8110e(0x1c5)+_0x1ce673+',\x20creating\x20new\x20file');}!_0x33e9f3[_0xc8110e(0x1ca)]&&(_0x33e9f3[_0xc8110e(0x1ca)]={}),_0x33e9f3[_0xc8110e(0x1ca)][_0x6400d4]=_0x18cba1,writeSecureFile(_0x1ce673,JSON['stringify'](_0x33e9f3,null,0x2));}export function removeProfileFromUserConfig(_0x4c3e4a){const _0x1e7e31=a62_0x46fe5d;validateProfileName(_0x4c3e4a);const _0x5d7020=getGlobalConfigPath();if(!a62_0x3456cd[_0x1e7e31(0x1f3)](_0x5d7020))throw new Error(_0x1e7e31(0x1d1)+_0x4c3e4a+_0x1e7e31(0x1c9));let _0x40bbf1={};try{const _0x53fe51=a62_0x3456cd[_0x1e7e31(0x1c3)](_0x5d7020,_0x1e7e31(0x1d4));_0x40bbf1=JSON[_0x1e7e31(0x20d)](_0x53fe51);}catch{throw new Error(_0x1e7e31(0x1f1)+_0x5d7020);}if(!_0x40bbf1['profiles']||!_0x40bbf1[_0x1e7e31(0x1ca)][_0x4c3e4a])throw new Error(_0x1e7e31(0x1d1)+_0x4c3e4a+_0x1e7e31(0x1c9));delete _0x40bbf1[_0x1e7e31(0x1ca)][_0x4c3e4a],_0x40bbf1[_0x1e7e31(0x1e3)]===_0x4c3e4a&&delete _0x40bbf1[_0x1e7e31(0x1e3)],writeSecureFile(_0x5d7020,JSON[_0x1e7e31(0x1dd)](_0x40bbf1,null,0x2));}export function getActiveProfile(){const _0x269c9b=a62_0x46fe5d,_0x297c22=loadSessionContext();if(_0x297c22?.[_0x269c9b(0x1e3)])return _0x297c22['profile'];if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0xed9b31=getGlobalConfigPath();if(!a62_0x3456cd[_0x269c9b(0x1f3)](_0xed9b31))return null;try{const _0x4ef194=a62_0x3456cd[_0x269c9b(0x1c3)](_0xed9b31,'utf-8'),_0x2ce3f7=JSON[_0x269c9b(0x20d)](_0x4ef194);return _0x2ce3f7[_0x269c9b(0x1e3)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x364c2e){const _0x19fa44=a62_0x46fe5d,_0x20b132=getGlobalConfigPath(),_0x4b9fb9=getConfigDir();!a62_0x3456cd[_0x19fa44(0x1f3)](_0x4b9fb9)&&createSecureDirectory(_0x4b9fb9);let _0x6b1894={};if(a62_0x3456cd['existsSync'](_0x20b132))try{const _0x27453c=a62_0x3456cd[_0x19fa44(0x1c3)](_0x20b132,'utf-8');_0x6b1894=JSON[_0x19fa44(0x20d)](_0x27453c);}catch{console[_0x19fa44(0x1cb)](_0x19fa44(0x1c5)+_0x20b132+_0x19fa44(0x1fb));}_0x6b1894[_0x19fa44(0x209)]=_0x364c2e,writeSecureFile(_0x20b132,JSON[_0x19fa44(0x1dd)](_0x6b1894,null,0x2));}export function saveActiveProfileToUserConfig(_0x21321f){const _0x351d01=a62_0x46fe5d;validateProfileName(_0x21321f);const _0x544ced=getGlobalConfigPath(),_0x491286=getConfigDir();!a62_0x3456cd[_0x351d01(0x1f3)](_0x491286)&&createSecureDirectory(_0x491286);let _0x5d12dd={};if(a62_0x3456cd[_0x351d01(0x1f3)](_0x544ced))try{const _0x4a3334=a62_0x3456cd[_0x351d01(0x1c3)](_0x544ced,_0x351d01(0x1d4));_0x5d12dd=JSON['parse'](_0x4a3334);}catch{console[_0x351d01(0x1cb)](_0x351d01(0x1c5)+_0x544ced+',\x20creating\x20new\x20file');}_0x5d12dd[_0x351d01(0x1e3)]=_0x21321f,writeSecureFile(_0x544ced,JSON[_0x351d01(0x1dd)](_0x5d12dd,null,0x2));}function clearFieldFromUserConfig(_0x16e4a5){const _0x237923=a62_0x46fe5d,_0x35a51f=getGlobalConfigPath();if(!a62_0x3456cd['existsSync'](_0x35a51f))return;let _0x161842={};try{const _0x58c264=a62_0x3456cd[_0x237923(0x1c3)](_0x35a51f,_0x237923(0x1d4));_0x161842=JSON[_0x237923(0x20d)](_0x58c264);}catch{return;}delete _0x161842[_0x16e4a5],writeSecureFile(_0x35a51f,JSON[_0x237923(0x1dd)](_0x161842,null,0x2));}export function clearDefaultSiteFromUserConfig(){const _0xaed6f8=a62_0x46fe5d;clearFieldFromUserConfig(_0xaed6f8(0x209));}export function clearActiveProfileFromUserConfig(){clearFieldFromUserConfig('profile');}export function createProfile(_0x319234,_0xe209aa){const _0x1bffd8=a62_0x46fe5d;validateProfileName(_0x319234);if(profileExists(_0x319234))throw new Error(_0x1bffd8(0x1e2)+_0x319234+'\x20already\x20exists');saveProfile(_0x319234,_0xe209aa);}function a62_0x4a3a(_0x599ae0,_0x11d380){_0x599ae0=_0x599ae0-0x1bf;const _0x46d976=a62_0x46d9();let _0x4a3ae7=_0x46d976[_0x599ae0];return _0x4a3ae7;}export function saveProfileCredentials(_0x51c109,_0x2df75d){validateProfileName(_0x51c109);if(!profileExists(_0x51c109))throw new Error('Profile\x20'+_0x51c109+'\x20does\x20not\x20exist');const _0xfc1665=getNewCredentialPath(_0x51c109);writeSecureFile(_0xfc1665,_0x2df75d);}export function loadProfileCredentials(_0x42017c){const _0x50eb4a=a62_0x46fe5d;validateProfileName(_0x42017c);const _0x299a6=getNewCredentialPath(_0x42017c);if(a62_0x3456cd[_0x50eb4a(0x1f3)](_0x299a6))try{return a62_0x3456cd[_0x50eb4a(0x1c3)](_0x299a6,_0x50eb4a(0x1d4));}catch{}const _0x624c6c=getOldCredentialPath(_0x42017c);if(a62_0x3456cd[_0x50eb4a(0x1f3)](_0x624c6c)){console[_0x50eb4a(0x1cb)]('\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27'+_0x42017c+'\x27'),console[_0x50eb4a(0x1cb)](_0x50eb4a(0x1d9)),console[_0x50eb4a(0x1cb)](_0x50eb4a(0x1da)+_0x624c6c+'\x22\x20\x22'+_0x299a6+'\x22'),console['warn']('Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a');try{return a62_0x3456cd[_0x50eb4a(0x1c3)](_0x624c6c,_0x50eb4a(0x1d4));}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
+ const a63_0x47d5e3=a63_0x1e4c;(function(_0x142908,_0x4f8e7f){const _0xcb3ead=a63_0x1e4c,_0x21e78c=_0x142908();while(!![]){try{const _0x22f3b3=-parseInt(_0xcb3ead(0x15f))/0x1+parseInt(_0xcb3ead(0x15d))/0x2*(parseInt(_0xcb3ead(0x15a))/0x3)+parseInt(_0xcb3ead(0x161))/0x4*(parseInt(_0xcb3ead(0x168))/0x5)+-parseInt(_0xcb3ead(0x165))/0x6*(parseInt(_0xcb3ead(0x150))/0x7)+-parseInt(_0xcb3ead(0x169))/0x8*(parseInt(_0xcb3ead(0x14c))/0x9)+parseInt(_0xcb3ead(0x166))/0xa*(parseInt(_0xcb3ead(0x152))/0xb)+parseInt(_0xcb3ead(0x14e))/0xc;if(_0x22f3b3===_0x4f8e7f)break;else _0x21e78c['push'](_0x21e78c['shift']());}catch(_0x336e3f){_0x21e78c['push'](_0x21e78c['shift']());}}}(a63_0x1013,0xdb362));import*as a63_0x4c6430 from'node:fs';import*as a63_0x3e50c0 from'node:path';function a63_0x1013(){const _0x371411=['4165bilAbn','16504hJoQZH','Warning:\x20\x27profile\x27\x20field\x20in\x20','stringify','writeFileSync','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','tdx.json',').\x20','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','4833kPoWhA','TD_API_KEY','7214436OVDvwU','api_key','162883lsVIcn','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','11nQEeJK','cwd','\x20is\x20ignored.\x20','join','profile','parse','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','includes','9894vkHkgN','code','apiKey','94pEZZNj','ENOENT','397437WBzQIi','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','1988JKcDQb','dirname','readFileSync','warn','54SHTPpW','14423690WxAFUx','Failed\x20to\x20load\x20project\x20config\x20from\x20'];a63_0x1013=function(){return _0x371411;};return a63_0x1013();}const PROJECT_CONFIG_FILENAME=a63_0x47d5e3(0x149);export function findProjectConfigPath(_0x3810fe){const _0x94cae9=a63_0x47d5e3;let _0x2b284e=_0x3810fe||process[_0x94cae9(0x153)]();while(!![]){const _0x51daf4=a63_0x3e50c0[_0x94cae9(0x155)](_0x2b284e,PROJECT_CONFIG_FILENAME);if(a63_0x4c6430['existsSync'](_0x51daf4))return _0x51daf4;const _0x37f094=a63_0x3e50c0[_0x94cae9(0x162)](_0x2b284e);if(_0x37f094===_0x2b284e)return null;_0x2b284e=_0x37f094;}}export function loadProjectConfig(_0x2930af){const _0x1c6314=a63_0x47d5e3,_0xcce393=findProjectConfigPath(_0x2930af);if(!_0xcce393)return null;try{const _0x4d7be0=a63_0x4c6430[_0x1c6314(0x163)](_0xcce393,'utf-8'),_0x38af67=JSON[_0x1c6314(0x157)](_0x4d7be0),_0x1be53f=JSON[_0x1c6314(0x16b)](_0x38af67);if(_0x1be53f['includes']('TD_API_KEY')||_0x1be53f[_0x1c6314(0x159)](_0x1c6314(0x15c))||_0x1be53f[_0x1c6314(0x159)](_0x1c6314(0x14f)))throw new Error(_0x1c6314(0x148)+_0xcce393+_0x1c6314(0x14a)+_0x1c6314(0x160));const {metadata:_0x185df4,profile:_0x3c2310,..._0x301c61}=_0x38af67;return _0x3c2310&&console[_0x1c6314(0x164)](_0x1c6314(0x16a)+_0xcce393+_0x1c6314(0x154)+_0x1c6314(0x14b)),_0x301c61;}catch(_0x4b08c8){if(_0x4b08c8 instanceof Error&&'code'in _0x4b08c8&&_0x4b08c8[_0x1c6314(0x15b)]===_0x1c6314(0x15e))return null;throw new Error(_0x1c6314(0x167)+_0xcce393+':\x20'+_0x4b08c8);}}export function saveProjectConfig(_0x47553d,_0x17964e){const _0x1ad366=a63_0x47d5e3,_0x34deed=_0x17964e||process[_0x1ad366(0x153)](),_0x5ac969=a63_0x3e50c0[_0x1ad366(0x155)](_0x34deed,PROJECT_CONFIG_FILENAME),_0x421efb=JSON[_0x1ad366(0x16b)](_0x47553d);if(_0x421efb['includes'](_0x1ad366(0x14d))||_0x421efb['includes'](_0x1ad366(0x15c))||_0x421efb[_0x1ad366(0x159)](_0x1ad366(0x14f)))throw new Error(_0x1ad366(0x151));if(_0x1ad366(0x156)in _0x47553d)throw new Error(_0x1ad366(0x158));a63_0x4c6430[_0x1ad366(0x147)](_0x5ac969,JSON['stringify'](_0x47553d,null,0x2));}export function hasProjectConfig(_0x30c9fc){return findProjectConfigPath(_0x30c9fc)!==null;}function a63_0x1e4c(_0xad5c6e,_0x17ddc9){_0xad5c6e=_0xad5c6e-0x147;const _0x10130b=a63_0x1013();let _0x1e4c49=_0x10130b[_0xad5c6e];return _0x1e4c49;}export function getProjectRoot(_0x2a2f7b){const _0xd68420=a63_0x47d5e3,_0x1ca69f=findProjectConfigPath(_0x2a2f7b);return _0x1ca69f?a63_0x3e50c0[_0xd68420(0x162)](_0x1ca69f):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(_0x8db08f,_0x151ac0){const _0x495fde=a64_0x2034,_0x3eeb93=_0x8db08f();while(!![]){try{const _0x524c3b=-parseInt(_0x495fde(0xd6))/0x1+-parseInt(_0x495fde(0xe7))/0x2+-parseInt(_0x495fde(0xd3))/0x3+parseInt(_0x495fde(0xe3))/0x4*(parseInt(_0x495fde(0xc3))/0x5)+-parseInt(_0x495fde(0xca))/0x6*(-parseInt(_0x495fde(0xe2))/0x7)+-parseInt(_0x495fde(0xd5))/0x8*(-parseInt(_0x495fde(0xce))/0x9)+-parseInt(_0x495fde(0xc2))/0xa*(parseInt(_0x495fde(0xdd))/0xb);if(_0x524c3b===_0x151ac0)break;else _0x3eeb93['push'](_0x3eeb93['shift']());}catch(_0x40e4bd){_0x3eeb93['push'](_0x3eeb93['shift']());}}}(a64_0x3fb7,0x4c3bd));import*as a64_0x4dcfa3 from'node:fs';import*as a64_0x3b0ed3 from'node:path';import*as a64_0x430ac3 from'node:os';import{getPPID,isProcessRunning}from'../utils/process.js';function a64_0x2034(_0x2bfcdb,_0x212d68){_0x2bfcdb=_0x2bfcdb-0xc1;const _0x3fb7c7=a64_0x3fb7();let _0x203492=_0x3fb7c7[_0x2bfcdb];return _0x203492;}import{createSecureDirectory}from'../utils/file-permissions.js';const SESSION_EXPIRATION_MS=0x18*0x3c*0x3c*0x3e8;function getSessionsDir(){const _0x1648ac=a64_0x2034,_0x1f83bd=process.env.TDX_CONFIG_DIR||a64_0x3b0ed3[_0x1648ac(0xe0)](a64_0x430ac3['homedir'](),_0x1648ac(0xd9),'tdx');return a64_0x3b0ed3[_0x1648ac(0xe0)](_0x1f83bd,_0x1648ac(0xcb));}function getSessionPath(_0x5ad3e7){const _0x5c86a5=a64_0x2034;return a64_0x3b0ed3[_0x5c86a5(0xe0)](getSessionsDir(),_0x5ad3e7+_0x5c86a5(0xcd));}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x41af8c){const _0x106578=a64_0x2034;if(_0x41af8c)return _0x41af8c;if(process.env.TDX_SESSION)return process.env.TDX_SESSION;return getCurrentSessionPID()[_0x106578(0xd8)]();}function a64_0x3fb7(){const _0x51c351=['369MjMgin','utf-8','sort','TD_API_KEY','test','1627629znspoW','unlinkSync','83616ByFuhK','261782ihXRew','stringify','toString','.config','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','existsSync','parse','55eordSl','getTime','createdAt','join','apiKey','286531UwCNCI','796kYMnqY','api_key','readFileSync','replace','752424BhjaNm','toISOString','75370NIemjr','12260xwciUs','writeFileSync','now','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','readdirSync','endsWith','.\x20This\x20is\x20insecure.\x20Removing\x20session.','90JXCNvE','sessions','includes','.json'];a64_0x3fb7=function(){return _0x51c351;};return a64_0x3fb7();}export function loadSessionContext(_0xc67c3b){const _0x1105ea=a64_0x2034,_0x299aa4=getSessionID(_0xc67c3b),_0x22a465=/^\d+$/[_0x1105ea(0xd2)](_0x299aa4)?parseInt(_0x299aa4,0xa):null;return _0x22a465!==null?loadSessionContextByPID(_0x22a465):loadSessionContextByString(_0x299aa4);}export function loadSessionContextByPID(_0x310cc4){const _0x3eb3f0=a64_0x2034,_0xae6cb3=getSessionPath(_0x310cc4);if(!a64_0x4dcfa3[_0x3eb3f0(0xdb)](_0xae6cb3))return null;try{const _0x1aed9=a64_0x4dcfa3[_0x3eb3f0(0xe5)](_0xae6cb3,_0x3eb3f0(0xcf)),_0x378993=JSON['parse'](_0x1aed9),_0x43f548=new Date(_0x378993[_0x3eb3f0(0xdf)])[_0x3eb3f0(0xde)](),_0x57f15c=Date['now']();if(_0x57f15c-_0x43f548>SESSION_EXPIRATION_MS)return a64_0x4dcfa3[_0x3eb3f0(0xd4)](_0xae6cb3),null;const _0x64abb8=JSON['stringify'](_0x378993);if(_0x64abb8['includes'](_0x3eb3f0(0xd1))||_0x64abb8[_0x3eb3f0(0xcc)](_0x3eb3f0(0xe1))||_0x64abb8[_0x3eb3f0(0xcc)](_0x3eb3f0(0xe4)))return console['warn'](_0x3eb3f0(0xc6)+_0xae6cb3+'.\x20This\x20is\x20insecure.\x20Removing\x20session.'),a64_0x4dcfa3[_0x3eb3f0(0xd4)](_0xae6cb3),null;return _0x378993;}catch{try{a64_0x4dcfa3[_0x3eb3f0(0xd4)](_0xae6cb3);}catch{}return null;}}function loadSessionContextByString(_0x464698){const _0x161bee=a64_0x2034,_0x3aaaac=a64_0x3b0ed3[_0x161bee(0xe0)](getSessionsDir(),_0x464698+_0x161bee(0xcd));if(!a64_0x4dcfa3[_0x161bee(0xdb)](_0x3aaaac))return null;try{const _0x164355=a64_0x4dcfa3[_0x161bee(0xe5)](_0x3aaaac,'utf-8'),_0x47a457=JSON[_0x161bee(0xdc)](_0x164355),_0x536861=new Date(_0x47a457['createdAt'])[_0x161bee(0xde)](),_0x477dec=Date[_0x161bee(0xc5)]();if(_0x477dec-_0x536861>SESSION_EXPIRATION_MS)return a64_0x4dcfa3[_0x161bee(0xd4)](_0x3aaaac),null;const _0x1654cd=JSON['stringify'](_0x47a457);if(_0x1654cd['includes'](_0x161bee(0xd1))||_0x1654cd[_0x161bee(0xcc)](_0x161bee(0xe1))||_0x1654cd[_0x161bee(0xcc)](_0x161bee(0xe4)))return console['warn'](_0x161bee(0xc6)+_0x3aaaac+_0x161bee(0xc9)),a64_0x4dcfa3[_0x161bee(0xd4)](_0x3aaaac),null;return _0x47a457;}catch{try{a64_0x4dcfa3[_0x161bee(0xd4)](_0x3aaaac);}catch{}return null;}}export function saveSessionContext(_0x28e3b3,_0x1342d1){const _0x230603=a64_0x2034,_0x52d660=getSessionID(_0x1342d1),_0x15d85e=/^\d+$/[_0x230603(0xd2)](_0x52d660)?parseInt(_0x52d660,0xa):getCurrentSessionPID(),_0x13b240=a64_0x3b0ed3[_0x230603(0xe0)](getSessionsDir(),_0x52d660+'.json'),_0x1e33d2=getSessionsDir();createSecureDirectory(_0x1e33d2);const _0x2a6c30=JSON[_0x230603(0xd7)](_0x28e3b3);if(_0x2a6c30[_0x230603(0xcc)]('TD_API_KEY')||_0x2a6c30[_0x230603(0xcc)](_0x230603(0xe1))||_0x2a6c30[_0x230603(0xcc)](_0x230603(0xe4)))throw new Error(_0x230603(0xda));let _0x16b553;const _0x1381f9=/^\d+$/[_0x230603(0xd2)](_0x52d660)?loadSessionContextByPID(parseInt(_0x52d660,0xa)):loadSessionContextByString(_0x52d660);_0x1381f9?_0x16b553={..._0x1381f9,..._0x28e3b3,'pid':_0x15d85e,'sessionId':_0x52d660!==_0x15d85e[_0x230603(0xd8)]()?_0x52d660:undefined,'updatedAt':new Date()[_0x230603(0xc1)]()}:_0x16b553={'pid':_0x15d85e,'sessionId':_0x52d660!==_0x15d85e[_0x230603(0xd8)]()?_0x52d660:undefined,..._0x28e3b3,'createdAt':new Date()[_0x230603(0xc1)](),'updatedAt':new Date()[_0x230603(0xc1)]()},a64_0x4dcfa3[_0x230603(0xc4)](_0x13b240,JSON['stringify'](_0x16b553,null,0x2));}export function clearSessionContext(_0x28d3c0){const _0x4ce479=a64_0x2034,_0x1ef307=getSessionID(_0x28d3c0),_0xebc1e6=a64_0x3b0ed3['join'](getSessionsDir(),_0x1ef307+'.json');a64_0x4dcfa3['existsSync'](_0xebc1e6)&&a64_0x4dcfa3[_0x4ce479(0xd4)](_0xebc1e6);}export function clearSessionContextField(_0x20ee97,_0x388a7b){const _0x5e493a=a64_0x2034,_0x215abf=getSessionID(_0x388a7b),_0x1ca0b7=a64_0x3b0ed3[_0x5e493a(0xe0)](getSessionsDir(),_0x215abf+_0x5e493a(0xcd));if(!a64_0x4dcfa3[_0x5e493a(0xdb)](_0x1ca0b7))return;try{const _0x536913=a64_0x4dcfa3['readFileSync'](_0x1ca0b7,_0x5e493a(0xcf)),_0x40769d=JSON['parse'](_0x536913);delete _0x40769d[_0x20ee97],a64_0x4dcfa3[_0x5e493a(0xc4)](_0x1ca0b7,JSON[_0x5e493a(0xd7)](_0x40769d,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x2258a2=a64_0x2034,_0x41a6e6=getSessionsDir();if(!a64_0x4dcfa3['existsSync'](_0x41a6e6))return 0x0;let _0x181b6d=0x0;const _0x564c6b=Date[_0x2258a2(0xc5)]();try{const _0x17f2d1=a64_0x4dcfa3['readdirSync'](_0x41a6e6);for(const _0x1e1203 of _0x17f2d1){if(!_0x1e1203[_0x2258a2(0xc8)]('.json'))continue;const _0x3da295=a64_0x3b0ed3[_0x2258a2(0xe0)](_0x41a6e6,_0x1e1203),_0x22f631=_0x1e1203[_0x2258a2(0xe6)](_0x2258a2(0xcd),''),_0x19f872=parseInt(_0x22f631,0xa),_0x1a0a3b=!isNaN(_0x19f872);if(_0x1a0a3b){if(!isProcessRunning(_0x19f872)){a64_0x4dcfa3['unlinkSync'](_0x3da295),_0x181b6d++;continue;}}try{const _0x5cfe12=a64_0x4dcfa3['readFileSync'](_0x3da295,_0x2258a2(0xcf)),_0x2b8ca6=JSON[_0x2258a2(0xdc)](_0x5cfe12),_0xdc2b14=new Date(_0x2b8ca6[_0x2258a2(0xdf)])[_0x2258a2(0xde)]();_0x564c6b-_0xdc2b14>SESSION_EXPIRATION_MS&&(a64_0x4dcfa3['unlinkSync'](_0x3da295),_0x181b6d++);}catch{a64_0x4dcfa3[_0x2258a2(0xd4)](_0x3da295),_0x181b6d++;}}}catch{}return _0x181b6d;}export function listActiveSessions(){const _0x637467=a64_0x2034,_0x49ccbe=getSessionsDir();if(!a64_0x4dcfa3[_0x637467(0xdb)](_0x49ccbe))return[];try{const _0x1302a6=a64_0x4dcfa3[_0x637467(0xc7)](_0x49ccbe),_0xb41748=[];for(const _0x4d3b5a of _0x1302a6){if(!_0x4d3b5a['endsWith']('.json'))continue;const _0x15f89a=_0x4d3b5a[_0x637467(0xe6)](_0x637467(0xcd),''),_0x2a2398=parseInt(_0x15f89a,0xa);!isNaN(_0x2a2398)&&isProcessRunning(_0x2a2398)&&_0xb41748['push'](_0x2a2398);}return _0xb41748[_0x637467(0xd0)]((_0x2e038b,_0x3a2ed8)=>_0x2e038b-_0x3a2ed8);}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_0x468d6b=a65_0x2216;(function(_0x3e945b,_0x16aa4a){const _0x532401=a65_0x2216,_0x185e3c=_0x3e945b();while(!![]){try{const _0x2dc993=-parseInt(_0x532401(0x1c6))/0x1+-parseInt(_0x532401(0x1cc))/0x2+-parseInt(_0x532401(0x1c8))/0x3+-parseInt(_0x532401(0x1cf))/0x4*(parseInt(_0x532401(0x1cd))/0x5)+parseInt(_0x532401(0x1ca))/0x6+-parseInt(_0x532401(0x1ce))/0x7+parseInt(_0x532401(0x1c3))/0x8;if(_0x2dc993===_0x16aa4a)break;else _0x185e3c['push'](_0x185e3c['shift']());}catch(_0xe91ca){_0x185e3c['push'](_0x185e3c['shift']());}}}(a65_0xe960,0xb4487));function a65_0xe960(){const _0x5ef1e3=['3520413STsEom','users','7381368PQIjWB','core/user-cache','278100DnOBDh','61615OkdyBC','6669173JyyYdT','208IhNHbR','27493600xEVubu','users-{profile}.json','write','1022433QgHCEf','read'];a65_0xe960=function(){return _0x5ef1e3;};return a65_0xe960();}import{createProfileCache}from'../utils/global-cache.js';const userCache=createProfileCache(a65_0x468d6b(0x1c4),a65_0x468d6b(0x1cb));export function loadCachedUsers(_0x3a0d98){const _0xf10fa5=a65_0x468d6b,_0x20f204=userCache[_0xf10fa5(0x1c7)](_0x3a0d98);return _0x20f204?.[_0xf10fa5(0x1c9)]??null;}export function saveCachedUsers(_0x11187d,_0x32be6b){const _0x451b6e=a65_0x468d6b;userCache[_0x451b6e(0x1c5)](_0x11187d,{'users':_0x32be6b,'cachedAt':Date['now']()});}function a65_0x2216(_0x5e3521,_0xfd1e55){_0x5e3521=_0x5e3521-0x1c3;const _0xe96040=a65_0xe960();let _0x221600=_0xe96040[_0x5e3521];return _0x221600;}export function clearUserCache(_0x467462){userCache['clear'](_0x467462);}
@@ -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(_0x113e61,_0xd9e0bb){const _0x254ae6=a66_0x2e1b,_0x1953a5=_0x113e61();while(!![]){try{const _0x3b5c71=-parseInt(_0x254ae6(0x127))/0x1+-parseInt(_0x254ae6(0x123))/0x2+parseInt(_0x254ae6(0x11f))/0x3+-parseInt(_0x254ae6(0x11e))/0x4*(parseInt(_0x254ae6(0x11d))/0x5)+parseInt(_0x254ae6(0x11b))/0x6*(-parseInt(_0x254ae6(0x122))/0x7)+-parseInt(_0x254ae6(0x11a))/0x8+-parseInt(_0x254ae6(0x124))/0x9*(-parseInt(_0x254ae6(0x126))/0xa);if(_0x3b5c71===_0xd9e0bb)break;else _0x1953a5['push'](_0x1953a5['shift']());}catch(_0x336802){_0x1953a5['push'](_0x1953a5['shift']());}}}(a66_0x23a8,0xc2d7a));import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';function a66_0x23a8(){const _0x8d1a0d=['118989fXthGZ','version','3530KZmlPq','1110590HnFdvI','9311288OFWUfb','37578VKQMoJ','includes','2156225TPyGSK','4xBeCjq','4134951jeYghR','parse','../build-info.json','1778CFVuyK','1901416ASqkoY'];a66_0x23a8=function(){return _0x8d1a0d;};return a66_0x23a8();}let cachedBuildInfo=null,cachedVersion=null;function a66_0x2e1b(_0xefb5e7,_0x45eb31){_0xefb5e7=_0xefb5e7-0x11a;const _0x23a84b=a66_0x23a8();let _0x2e1baa=_0x23a84b[_0xefb5e7];return _0x2e1baa;}export function getBuildInfo(){const _0x3b4106=a66_0x2e1b;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x525ec9=fileURLToPath(import.meta.url),_0x214605=dirname(_0x525ec9);try{const _0x146757=join(_0x214605,_0x3b4106(0x121));cachedBuildInfo=JSON[_0x3b4106(0x120)](readFileSync(_0x146757,'utf-8'));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0x18e2c7=a66_0x2e1b;if(cachedVersion!==null)return cachedVersion;const _0x4905e7=fileURLToPath(import.meta.url),_0x125e20=dirname(_0x4905e7),_0x5796dc=getBuildInfo();if(_0x5796dc[_0x18e2c7(0x125)])return cachedVersion=_0x5796dc[_0x18e2c7(0x125)],cachedVersion;try{const _0x1db671=join(_0x125e20,'../../package.json'),_0x4645fc=JSON[_0x18e2c7(0x120)](readFileSync(_0x1db671,'utf-8'));cachedVersion=_0x4645fc[_0x18e2c7(0x125)];}catch{cachedVersion='0.0.0';}return cachedVersion;}export function isDevVersion(){const _0xe1231b=a66_0x2e1b,_0xf179ba=getVersion();return _0xf179ba[_0xe1231b(0x11c)]('.dev')||_0xf179ba[_0xe1231b(0x11c)]('-');}