@treasuredata/tdx 2026.3.24 → 2026.3.26

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 (206) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/policy-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/connection-cache.js +1 -1
  59. package/dist/core/constants.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/oauth-keychain.js +1 -1
  64. package/dist/core/oauth.js +1 -1
  65. package/dist/core/profile.js +1 -1
  66. package/dist/core/project-config.js +1 -1
  67. package/dist/core/session.js +1 -1
  68. package/dist/core/user-cache.js +1 -1
  69. package/dist/core/version.js +1 -1
  70. package/dist/index.js +1 -1
  71. package/dist/mcp/server.js +1 -1
  72. package/dist/mcp/tools/index.js +1 -1
  73. package/dist/mcp/tools/tdx-run.js +1 -1
  74. package/dist/mcp/tools/tdx-search.js +1 -1
  75. package/dist/mcp/utils.js +1 -1
  76. package/dist/proxy/claude-usage-tracker.js +1 -1
  77. package/dist/proxy/passthrough-server.js +1 -1
  78. package/dist/proxy/sse-usage-parser.js +1 -1
  79. package/dist/sdk/agent/agent-config.js +1 -1
  80. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  81. package/dist/sdk/agent/agent-yaml.js +1 -1
  82. package/dist/sdk/agent/test/evaluator.js +1 -1
  83. package/dist/sdk/agent/test/executor.js +1 -1
  84. package/dist/sdk/agent/test/index.js +1 -1
  85. package/dist/sdk/agent/test/output.js +1 -1
  86. package/dist/sdk/agent/test/parser.js +1 -1
  87. package/dist/sdk/agent/tool-target-registry.js +1 -1
  88. package/dist/sdk/api.js +1 -1
  89. package/dist/sdk/client/cdp-api-client.js +1 -1
  90. package/dist/sdk/client/delivery-api-client.js +1 -1
  91. package/dist/sdk/client/endpoints.js +1 -1
  92. package/dist/sdk/client/engage-api-client.js +1 -1
  93. package/dist/sdk/client/http-client.js +1 -1
  94. package/dist/sdk/client/llm-api-client.js +1 -1
  95. package/dist/sdk/client/oauth-refresh.js +1 -1
  96. package/dist/sdk/client/rate-limiter.js +1 -1
  97. package/dist/sdk/client/td-api-client.js +1 -1
  98. package/dist/sdk/client/trino-api-client.js +1 -1
  99. package/dist/sdk/client/workflow-client.js +1 -1
  100. package/dist/sdk/connection-validator.js +1 -1
  101. package/dist/sdk/connection.js +1 -1
  102. package/dist/sdk/delivery.js +1 -1
  103. package/dist/sdk/engage/campaign-pull.js +1 -1
  104. package/dist/sdk/engage/campaign-push.js +1 -1
  105. package/dist/sdk/engage/campaign-validator.js +1 -1
  106. package/dist/sdk/engage/campaign-yaml.js +1 -1
  107. package/dist/sdk/engage/template-pull.js +1 -1
  108. package/dist/sdk/engage/template-push.js +1 -1
  109. package/dist/sdk/engage/template-validator.js +1 -1
  110. package/dist/sdk/engage/template-yaml.js +1 -1
  111. package/dist/sdk/engage/types/campaign-def.js +1 -1
  112. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  113. package/dist/sdk/engage/types/template-schema.js +1 -1
  114. package/dist/sdk/engage.js +1 -1
  115. package/dist/sdk/errors.js +1 -1
  116. package/dist/sdk/index.js +1 -1
  117. package/dist/sdk/io/index.js +1 -1
  118. package/dist/sdk/io/node-filesystem.js +1 -1
  119. package/dist/sdk/job.js +1 -1
  120. package/dist/sdk/journey.js +1 -1
  121. package/dist/sdk/llm/chat-cache.js +1 -1
  122. package/dist/sdk/llm/index.js +1 -1
  123. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  124. package/dist/sdk/llm/model-factors.js +1 -1
  125. package/dist/sdk/personalization.js +1 -1
  126. package/dist/sdk/policy.js +1 -1
  127. package/dist/sdk/query/index.js +1 -1
  128. package/dist/sdk/query/sql-parser.js +1 -1
  129. package/dist/sdk/realtime.js +1 -1
  130. package/dist/sdk/schedule.js +1 -1
  131. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  132. package/dist/sdk/segment/fields-display.js +1 -1
  133. package/dist/sdk/segment/file-discovery.js +1 -1
  134. package/dist/sdk/segment/journey-utils.js +1 -1
  135. package/dist/sdk/segment/journey-validator.js +1 -1
  136. package/dist/sdk/segment/journey-yaml.js +1 -1
  137. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  138. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  139. package/dist/sdk/segment/pull-workflow.js +1 -1
  140. package/dist/sdk/segment/push-recovery.js +1 -1
  141. package/dist/sdk/segment/push-workflow.js +1 -1
  142. package/dist/sdk/segment/resolution-context.js +1 -1
  143. package/dist/sdk/segment/segment-path-parser.js +1 -1
  144. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  145. package/dist/sdk/segment/segment-validator.js +1 -1
  146. package/dist/sdk/segment/target-resolution.js +1 -1
  147. package/dist/sdk/segment/tdx-config.js +1 -1
  148. package/dist/sdk/segment/types/activation-schema.js +1 -1
  149. package/dist/sdk/segment/types/journey-def.js +1 -1
  150. package/dist/sdk/segment/types/journey-schema.js +1 -1
  151. package/dist/sdk/segment/types/segment-def.js +1 -1
  152. package/dist/sdk/segment/types/segment-schema.js +1 -1
  153. package/dist/sdk/segment/validate-files.js +1 -1
  154. package/dist/sdk/segment/yaml-validator.js +1 -1
  155. package/dist/sdk/segment.d.ts +5 -0
  156. package/dist/sdk/segment.d.ts.map +1 -1
  157. package/dist/sdk/segment.js +1 -1
  158. package/dist/sdk/segment.js.map +1 -1
  159. package/dist/sdk/types/index.js +1 -1
  160. package/dist/sdk/types/progress.js +1 -1
  161. package/dist/sdk/user.js +1 -1
  162. package/dist/sdk/util/format-detector.js +1 -1
  163. package/dist/sdk/util/formatters.js +1 -1
  164. package/dist/sdk/util/index.js +1 -1
  165. package/dist/sdk/util/paginate.js +1 -1
  166. package/dist/sdk/util/tree-formatter.js +1 -1
  167. package/dist/sdk/workflow/archive-validation.js +1 -1
  168. package/dist/sdk/workflow/clone-workflow.js +1 -1
  169. package/dist/sdk/workflow/index.js +1 -1
  170. package/dist/sdk/workflow/pull-workflow.js +1 -1
  171. package/dist/sdk/workflow/push-workflow.js +1 -1
  172. package/dist/sdk/workflow/tdx-config.js +1 -1
  173. package/dist/sdk/workflow/workflow-utils.js +1 -1
  174. package/dist/test-utils/command-runner.js +1 -1
  175. package/dist/test-utils/factories.js +1 -1
  176. package/dist/test-utils/fixtures.js +1 -1
  177. package/dist/test-utils/http-mock.js +1 -1
  178. package/dist/test-utils/index.js +1 -1
  179. package/dist/utils/async.js +1 -1
  180. package/dist/utils/colors.js +1 -1
  181. package/dist/utils/diff.js +1 -1
  182. package/dist/utils/file-permissions.js +1 -1
  183. package/dist/utils/file-reader.js +1 -1
  184. package/dist/utils/github-releases.js +1 -1
  185. package/dist/utils/global-cache.js +1 -1
  186. package/dist/utils/json-loader.js +1 -1
  187. package/dist/utils/local-cache.js +1 -1
  188. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  189. package/dist/utils/logger/formatters/index.js +1 -1
  190. package/dist/utils/logger/handlers/console-handler.js +1 -1
  191. package/dist/utils/logger/handlers/file-handler.js +1 -1
  192. package/dist/utils/logger/handlers/index.js +1 -1
  193. package/dist/utils/logger/handlers/null-handler.js +1 -1
  194. package/dist/utils/logger/index.js +1 -1
  195. package/dist/utils/logger/logger.js +1 -1
  196. package/dist/utils/logger/types.js +1 -1
  197. package/dist/utils/option-validation.js +1 -1
  198. package/dist/utils/process.js +1 -1
  199. package/dist/utils/prompt.js +1 -1
  200. package/dist/utils/spinner.js +1 -1
  201. package/dist/utils/sse-parser.js +1 -1
  202. package/dist/utils/string-utils.js +1 -1
  203. package/dist/utils/table-ref-parser.js +1 -1
  204. package/dist/utils/tdx-logger.js +1 -1
  205. package/dist/utils/version-check.js +1 -1
  206. package/package.json +1 -1
@@ -1 +1 @@
1
- const a55_0x2d6b3c=a55_0x4484;(function(_0x9cefb9,_0x287151){const _0x44d02a=a55_0x4484,_0x4a919e=_0x9cefb9();while(!![]){try{const _0x50ba35=parseInt(_0x44d02a(0xdb))/0x1+-parseInt(_0x44d02a(0xbb))/0x2*(-parseInt(_0x44d02a(0xac))/0x3)+-parseInt(_0x44d02a(0xd1))/0x4+parseInt(_0x44d02a(0xca))/0x5+parseInt(_0x44d02a(0xe4))/0x6*(-parseInt(_0x44d02a(0xc9))/0x7)+parseInt(_0x44d02a(0xf5))/0x8*(parseInt(_0x44d02a(0xe2))/0x9)+parseInt(_0x44d02a(0xaf))/0xa*(-parseInt(_0x44d02a(0xad))/0xb);if(_0x50ba35===_0x287151)break;else _0x4a919e['push'](_0x4a919e['shift']());}catch(_0x36c7f9){_0x4a919e['push'](_0x4a919e['shift']());}}}(a55_0x1040,0xbfff4));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';function a55_0x4484(_0x218842,_0x2d0c99){_0x218842=_0x218842-0xac;const _0x1040b5=a55_0x1040();let _0x448401=_0x1040b5[_0x218842];return _0x448401;}import*as a55_0x1985b9 from'node:fs';import*as a55_0x4e992e from'node:path';import{SITE_ALIASES}from'../sdk/types/index.js';import{getKeychainAPIKey,saveKeychainAPIKey}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a55_0x5d9f38 from'chalk';import{getGlobalCacheDir,createOptionalProfileCache}from'../utils/global-cache.js';export function getConfigDir(){const _0x538cf7=a55_0x4484;return process.env.TDX_CONFIG_DIR||join(homedir(),_0x538cf7(0xbf),_0x538cf7(0xd5));}export function getConfigFile(){const _0x3be707=a55_0x4484;return join(getConfigDir(),_0x3be707(0xd8));}export function getConfigFilePath(_0x3f7f55){const _0x15a3d6=a55_0x4484,_0xf1bd1f=getConfigDir();return _0x3f7f55?a55_0x4e992e[_0x15a3d6(0xb0)](_0xf1bd1f,'.env.'+_0x3f7f55):getConfigFile();}export function getCacheDir(){return getGlobalCacheDir();}const llmProjectCache=createOptionalProfileCache(a55_0x2d6b3c(0xe8),'config/llm-project');export function getLLMProjectCacheFile(_0x29305a){const _0x14fe78=a55_0x2d6b3c;return llmProjectCache[_0x14fe78(0xbc)](_0x29305a);}export function readCachedLLMProject(_0x58fa5b){const _0x2d0259=a55_0x2d6b3c,_0x57bc67=llmProjectCache[_0x2d0259(0xd0)](_0x58fa5b);if(_0x57bc67&&typeof _0x57bc67['id']===_0x2d0259(0xd6)&&typeof _0x57bc67[_0x2d0259(0xd7)]===_0x2d0259(0xd6))return _0x57bc67;return null;}export function writeCachedLLMProject(_0x288360,_0x61901f,_0x1c7f95){const _0x234068=a55_0x2d6b3c;try{llmProjectCache[_0x234068(0xef)]({'name':_0x288360,'id':_0x61901f},_0x1c7f95);}catch{}}const llmAgentCache=createOptionalProfileCache(a55_0x2d6b3c(0xf2),a55_0x2d6b3c(0xde));export function getLLMAgentCacheFile(_0x462251){const _0x3d218e=a55_0x2d6b3c;return llmAgentCache[_0x3d218e(0xbc)](_0x462251);}export function readCachedLLMAgent(_0x24f371){const _0x24b252=a55_0x2d6b3c,_0x4111cb=llmAgentCache['read'](_0x24f371);if(_0x4111cb&&typeof _0x4111cb['id']==='string'&&typeof _0x4111cb[_0x24b252(0xd7)]==='string'&&typeof _0x4111cb[_0x24b252(0xcd)]===_0x24b252(0xd6))return _0x4111cb;return null;}export function writeCachedLLMAgent(_0x19a104,_0x74d4e6,_0x292bd6,_0x163227){const _0x5822f9=a55_0x2d6b3c;try{llmAgentCache[_0x5822f9(0xef)]({'name':_0x19a104,'id':_0x74d4e6,'projectId':_0x292bd6},_0x163227);}catch{}}export function clearCachedLLMAgent(_0x1170e1){const _0x2651a7=a55_0x2d6b3c;try{llmAgentCache[_0x2651a7(0xe5)](_0x1170e1);}catch{}}const accountInfoCache=createOptionalProfileCache(a55_0x2d6b3c(0xb8),'config/account-info',{'suffix':a55_0x2d6b3c(0xf0)});export function getAccountInfoCacheFile(_0xe55990){const _0xaf5f6b=a55_0x2d6b3c;return accountInfoCache[_0xaf5f6b(0xbc)](_0xe55990);}export function readCachedAccountInfo(_0x4716a6){const _0x5215ff=a55_0x2d6b3c,_0xf5d073=accountInfoCache[_0x5215ff(0xd0)](_0x4716a6);if(_0xf5d073&&typeof _0xf5d073[_0x5215ff(0xc0)]==='string'&&typeof _0xf5d073['accountId']==='number')return _0xf5d073;return null;}export function writeCachedAccountInfo(_0x117e2d,_0x43219e,_0x2cc9fa){const _0x19e493=a55_0x2d6b3c;try{accountInfoCache[_0x19e493(0xef)]({'site':_0x117e2d,'accountId':_0x43219e,'cachedAt':new Date()[_0x19e493(0xb6)]()},_0x2cc9fa);}catch{}}export function parseEnvFile(_0x46e937){const _0x52e29f=a55_0x2d6b3c,_0xcaeb1d={};for(const _0x5d5f7f of _0x46e937[_0x52e29f(0xf6)]('\x0a')){const _0xed765d=_0x5d5f7f['trim']();if(!_0xed765d||_0xed765d[_0x52e29f(0xc1)]('#'))continue;const _0x49bb58=_0xed765d['match'](/^([^=]+)=(.*)$/);if(_0x49bb58){const _0x37169d=_0x49bb58[0x1][_0x52e29f(0xf4)]();let _0x271fb8=_0x49bb58[0x2][_0x52e29f(0xf4)]();(_0x271fb8['startsWith']('\x22')&&_0x271fb8[_0x52e29f(0xf3)]('\x22')||_0x271fb8[_0x52e29f(0xc1)]('\x27')&&_0x271fb8[_0x52e29f(0xf3)]('\x27'))&&(_0x271fb8=_0x271fb8['slice'](0x1,-0x1)),_0xcaeb1d[_0x37169d]=_0x271fb8;}}return _0xcaeb1d;}export function readUserConfig(){const _0x233144=a55_0x2d6b3c,_0x27d7cb=getConfigFile();if(!existsSync(_0x27d7cb))return{};try{const _0x3fbf44=readFileSync(_0x27d7cb,'utf-8');return parseEnvFile(_0x3fbf44);}catch(_0x4b2c84){return console[_0x233144(0xd3)]('Warning:\x20Failed\x20to\x20read\x20config\x20file\x20'+_0x27d7cb+':',_0x4b2c84),{};}}export function resolveSite(_0x1fd7f5){const _0x49b290=a55_0x2d6b3c,_0x2e8eff=[_0x49b290(0xbd),_0x49b290(0xe9),_0x49b290(0xdc),'ap02',_0x49b290(0xb4),'dev-us01',_0x49b290(0xc8),'stg-us01','stg-ap01',_0x49b290(0xee)];if(_0x2e8eff[_0x49b290(0xb1)](_0x1fd7f5))return _0x1fd7f5;if(_0x1fd7f5 in SITE_ALIASES)return SITE_ALIASES[_0x1fd7f5];return console[_0x49b290(0xd3)](_0x49b290(0xd2)+_0x1fd7f5+_0x49b290(0xea)),_0x49b290(0xbd);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function resolveAccessToken(_0x3be725){const _0x22174c=a55_0x2d6b3c,_0x3398eb=_0x3be725||getActiveProfileName()||undefined;if(_0x3398eb){const _0x199261=_0x22174c(0xc6)+normalizeProfileForEnvVar(_0x3398eb);if(process.env[_0x199261])return{'accessToken':process.env[_0x199261],'source':_0x199261+_0x22174c(0xd4)};}if(process.env.TDX_ACCESS_TOKEN)return{'accessToken':process.env.TDX_ACCESS_TOKEN,'source':'TDX_ACCESS_TOKEN\x20env\x20var'};return null;}export function getAccessToken(_0x280ab8){const _0x5eb758=a55_0x2d6b3c;return resolveAccessToken(_0x280ab8)?.[_0x5eb758(0xb7)];}export function getAPIKey(_0x299d6b){const _0x145ed2=a55_0x2d6b3c,_0x535df9=_0x299d6b||getActiveProfileName();if(_0x535df9){const _0x55d19d=_0x145ed2(0xc5)+normalizeProfileForEnvVar(_0x535df9);if(process.env[_0x55d19d])return process.env[_0x55d19d];}if(process.env.TDX_API_KEY)return process.env.TDX_API_KEY;return undefined;}export function normalizeProfileForEnvVar(_0x2d837b){const _0x536401=a55_0x2d6b3c;return _0x2d837b[_0x536401(0xe0)]()[_0x536401(0xc4)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x388bc2,_0x25bf96){const _0x4ac3c0=a55_0x2d6b3c,_0x776b9c=resolveAccessToken(_0x25bf96);if(_0x776b9c)return{'apiKey':_0x776b9c[_0x4ac3c0(0xb7)],'source':_0x776b9c[_0x4ac3c0(0xc2)],'isDeprecated':![]};const _0xdcaf5=_0x25bf96||getActiveProfileName()||undefined;if(_0xdcaf5){const _0x55df5d=_0x4ac3c0(0xc5)+normalizeProfileForEnvVar(_0xdcaf5);if(process.env[_0x55df5d])return{'apiKey':process.env[_0x55df5d],'source':_0x55df5d+_0x4ac3c0(0xd4),'isDeprecated':![]};const _0xaf1f26=getCachedCredential(_0x388bc2,_0xdcaf5);if(_0xaf1f26)return{'apiKey':_0xaf1f26,'source':'keychain\x20(profile:\x20'+_0xdcaf5+')','isDeprecated':![]};const _0x4e6d24=await getKeychainAPIKey(_0xdcaf5);if(_0x4e6d24)return setCachedCredential(_0x4e6d24,_0x388bc2,_0xdcaf5),{'apiKey':_0x4e6d24,'source':_0x4ac3c0(0xb9)+_0xdcaf5+')','isDeprecated':![]};}if(process.env.TDX_API_KEY)return{'apiKey':process.env.TDX_API_KEY,'source':_0x4ac3c0(0xdf),'isDeprecated':![]};if(!_0xdcaf5){const _0x415c21=getCachedCredential(_0x388bc2,undefined);if(_0x415c21)return{'apiKey':_0x415c21,'source':_0x4ac3c0(0xd9),'isDeprecated':![]};const _0x1c506b=await getKeychainAPIKey(undefined);if(_0x1c506b)return setCachedCredential(_0x1c506b,_0x388bc2,undefined),{'apiKey':_0x1c506b,'source':_0x4ac3c0(0xd9),'isDeprecated':![]};}return null;}export async function getAPIKeyAsync(_0x130e14,_0x146b95){const _0x16c44b=a55_0x2d6b3c,_0x59824c=await resolveAPIKeyAsync(_0x130e14,_0x146b95);return _0x59824c?.[_0x16c44b(0xba)];}function cleanupLegacyEnvFile(_0x20b714){const _0x1f6b67=a55_0x2d6b3c;if(!existsSync(_0x20b714))return![];try{const _0x1912a1=readFileSync(_0x20b714,_0x1f6b67(0xb5)),_0x4c5169=_0x1912a1[_0x1f6b67(0xf6)]('\x0a'),_0x12aaef=_0x4c5169[_0x1f6b67(0xdd)](_0x340054=>{const _0x30593a=_0x1f6b67,_0x318f50=_0x340054[_0x30593a(0xf4)]();if(!_0x318f50||_0x318f50['startsWith']('#'))return!![];const [_0x5b5b69]=_0x318f50[_0x30593a(0xf6)]('=');return!_0x5b5b69[_0x30593a(0xc1)]('TD_API_KEY');}),_0x5d3d4e=_0x12aaef['some'](_0x48447e=>{const _0x50aa0b=_0x1f6b67,_0x58b5bd=_0x48447e[_0x50aa0b(0xf4)]();return _0x58b5bd&&!_0x58b5bd[_0x50aa0b(0xc1)]('#');});if(!_0x5d3d4e)return unlinkSync(_0x20b714),!![];return writeFileSync(_0x20b714,_0x12aaef[_0x1f6b67(0xb0)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function getActiveProfileName(){const _0xbaf0af=a55_0x2d6b3c;if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x20890b=a55_0x4e992e[_0xbaf0af(0xb0)](getConfigDir(),_0xbaf0af(0xb3));if(!a55_0x1985b9[_0xbaf0af(0xe6)](_0x20890b))return null;try{const _0x10a466=a55_0x1985b9[_0xbaf0af(0xcb)](_0x20890b,_0xbaf0af(0xb5)),_0x1098c6=JSON['parse'](_0x10a466);return _0x1098c6['profile']||null;}catch{return null;}}export function saveAPIKey(_0x2f0186,_0x44421f,_0x56629d){const _0x2854bf=a55_0x2d6b3c,_0x40dbd0=getConfigDir(),_0x1d3e67=getConfigFilePath(_0x56629d);!existsSync(_0x40dbd0)&&mkdirSync(_0x40dbd0,{'recursive':!![],'mode':0x1c0});let _0xfbcbf3={};if(existsSync(_0x1d3e67))try{const _0x5570e9=readFileSync(_0x1d3e67,'utf-8');_0xfbcbf3=parseEnvFile(_0x5570e9);}catch(_0x3a5486){console[_0x2854bf(0xd3)](_0x2854bf(0xce)+_0x1d3e67+':',_0x3a5486);}const _0x377a70=_0x2f0186['toUpperCase']()['replace'](/-/g,'_');_0xfbcbf3[_0x2854bf(0xae)+_0x377a70]=_0x44421f;const _0x15f2c0=Object[_0x2854bf(0xeb)](_0xfbcbf3)[_0x2854bf(0xe3)](([_0x50f4e1,_0x36e6e4])=>_0x50f4e1+'='+_0x36e6e4);writeFileSync(_0x1d3e67,_0x15f2c0[_0x2854bf(0xb0)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x2800a6,_0x5278bf,_0x4d5f19){const _0x6438f3=a55_0x2d6b3c;await saveKeychainAPIKey(_0x2800a6,_0x4d5f19),setCachedCredential(_0x2800a6,_0x5278bf,_0x4d5f19);const _0x5d6f43=getConfigFilePath(_0x4d5f19);cleanupLegacyEnvFile(_0x5d6f43)&&console['warn'](a55_0x5d9f38[_0x6438f3(0xcc)](_0x6438f3(0xed)));}export function loadConfig(){const _0x51a15a=a55_0x2d6b3c,_0xe68b7e={'apiKeys':{},'defaultSite':_0x51a15a(0xbd)},_0x730c51=['us01',_0x51a15a(0xe9),_0x51a15a(0xdc),_0x51a15a(0xec),_0x51a15a(0xb4),'dev-us01',_0x51a15a(0xc8),_0x51a15a(0xc7),_0x51a15a(0xcf),_0x51a15a(0xee)],_0x1eb6b8=getAPIKey();if(_0x1eb6b8)for(const _0x27a480 of _0x730c51){_0xe68b7e[_0x51a15a(0xe7)][_0x27a480]=_0x1eb6b8;}return _0xe68b7e;}export function isExperimentalAvailable(){return!!process.env.TDX_EXPERIMENTAL;}export function loadGlobalProxy(){const _0x11f29a=a55_0x2d6b3c,_0xc2fbe4=a55_0x4e992e[_0x11f29a(0xb0)](getConfigDir(),'tdx.json');if(!a55_0x1985b9[_0x11f29a(0xe6)](_0xc2fbe4))return undefined;try{const _0x142655=a55_0x1985b9[_0x11f29a(0xcb)](_0xc2fbe4,'utf-8'),_0x173cdc=JSON[_0x11f29a(0xb2)](_0x142655);return typeof _0x173cdc[_0x11f29a(0xbe)]===_0x11f29a(0xd6)?_0x173cdc[_0x11f29a(0xbe)]:undefined;}catch{return undefined;}}function a55_0x1040(){const _0x2a873e=['Warning:\x20Unknown\x20site\x20\x27','warn','\x20env\x20var','tdx','string','name','.env','keychain','release_channel','1506137hKQSYk','eu01','filter','config/llm-agent','TDX_API_KEY\x20env\x20var','toUpperCase','stringify','45uVhkrd','map','15018bxthtT','clear','existsSync','apiKeys','llm_default_project','ap01','\x27,\x20defaulting\x20to\x20us01','entries','ap02','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','stg-ap03','write','.json','stable','llm_default_agent','endsWith','trim','1445416aWoSWy','split','45QDJXWr','253SKjhXS','TD_API_KEY_','1198460ftZyyb','join','includes','parse','tdx.json','ap03','utf-8','toISOString','accessToken','account_info','keychain\x20(profile:\x20','apiKey','144438JAqOEV','path','us01','proxy','.config','site','startsWith','source','next','replace','TDX_API_KEY_','TDX_ACCESS_TOKEN_','stg-us01','dev-eu01','21nmlvHF','1968930uHbYrv','readFileSync','yellow','projectId','Warning:\x20Failed\x20to\x20read\x20','stg-ap01','read','1344824ljifHZ'];a55_0x1040=function(){return _0x2a873e;};return a55_0x1040();}export function loadReleaseChannel(){const _0x1a5162=a55_0x2d6b3c,_0x3db55d=process.env.TDX_RELEASE_CHANNEL;if(_0x3db55d===_0x1a5162(0xc3)||_0x3db55d===_0x1a5162(0xf1))return _0x3db55d;const _0x9e1436=a55_0x4e992e[_0x1a5162(0xb0)](getConfigDir(),_0x1a5162(0xb3));if(!a55_0x1985b9[_0x1a5162(0xe6)](_0x9e1436))return _0x1a5162(0xf1);try{const _0x2b4bbc=a55_0x1985b9[_0x1a5162(0xcb)](_0x9e1436,_0x1a5162(0xb5)),_0x394c07=JSON['parse'](_0x2b4bbc);if(_0x394c07[_0x1a5162(0xda)]==='next')return _0x1a5162(0xc3);}catch{}return _0x1a5162(0xf1);}export function saveReleaseChannel(_0x174804){const _0x4ac696=a55_0x2d6b3c,_0x5e6b6f=getConfigDir(),_0x411896=a55_0x4e992e[_0x4ac696(0xb0)](_0x5e6b6f,_0x4ac696(0xb3));!existsSync(_0x5e6b6f)&&mkdirSync(_0x5e6b6f,{'recursive':!![],'mode':0x1c0});let _0x520a04={};if(existsSync(_0x411896))try{const _0x3f91f9=readFileSync(_0x411896,_0x4ac696(0xb5));_0x520a04=JSON[_0x4ac696(0xb2)](_0x3f91f9);}catch{}_0x520a04['release_channel']=_0x174804,writeFileSync(_0x411896,JSON[_0x4ac696(0xe1)](_0x520a04,null,0x2),{'mode':0x180});}
1
+ const a55_0x201238=a55_0x564d;(function(_0x1c7cc2,_0x3c3ac6){const _0x250119=a55_0x564d,_0x5b7f4d=_0x1c7cc2();while(!![]){try{const _0x4dceb6=parseInt(_0x250119(0x1b5))/0x1*(parseInt(_0x250119(0x1b3))/0x2)+parseInt(_0x250119(0x179))/0x3+-parseInt(_0x250119(0x1ae))/0x4+parseInt(_0x250119(0x1aa))/0x5*(-parseInt(_0x250119(0x199))/0x6)+parseInt(_0x250119(0x17e))/0x7+-parseInt(_0x250119(0x1a4))/0x8+parseInt(_0x250119(0x16c))/0x9;if(_0x4dceb6===_0x3c3ac6)break;else _0x5b7f4d['push'](_0x5b7f4d['shift']());}catch(_0x470028){_0x5b7f4d['push'](_0x5b7f4d['shift']());}}}(a55_0x3908,0xb6102));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a55_0x4703ad from'node:fs';import*as a55_0x17c0bc from'node:path';import{SITE_ALIASES}from'../sdk/types/index.js';import{getKeychainAPIKey,saveKeychainAPIKey}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a55_0x3d5738 from'chalk';import{getGlobalCacheDir,createOptionalProfileCache}from'../utils/global-cache.js';export function getConfigDir(){const _0x4b3dcb=a55_0x564d;return process.env.TDX_CONFIG_DIR||join(homedir(),'.config',_0x4b3dcb(0x184));}function a55_0x564d(_0x2d65b9,_0x5778e0){_0x2d65b9=_0x2d65b9-0x16b;const _0x390845=a55_0x3908();let _0x564d29=_0x390845[_0x2d65b9];return _0x564d29;}export function getConfigFile(){const _0x477100=a55_0x564d;return join(getConfigDir(),_0x477100(0x188));}export function getConfigFilePath(_0x109771){const _0x22dcf3=a55_0x564d,_0x15dff9=getConfigDir();return _0x109771?a55_0x17c0bc['join'](_0x15dff9,_0x22dcf3(0x176)+_0x109771):getConfigFile();}export function getCacheDir(){return getGlobalCacheDir();}const llmProjectCache=createOptionalProfileCache('llm_default_project',a55_0x201238(0x178));export function getLLMProjectCacheFile(_0x328c18){const _0x42f55a=a55_0x201238;return llmProjectCache[_0x42f55a(0x16d)](_0x328c18);}export function readCachedLLMProject(_0x34f80b){const _0x7affd3=a55_0x201238,_0x52d5ab=llmProjectCache[_0x7affd3(0x18b)](_0x34f80b);if(_0x52d5ab&&typeof _0x52d5ab['id']===_0x7affd3(0x1a2)&&typeof _0x52d5ab['name']===_0x7affd3(0x1a2))return _0x52d5ab;return null;}export function writeCachedLLMProject(_0x56e059,_0x18483d,_0x2cdbcc){const _0x502381=a55_0x201238;try{llmProjectCache[_0x502381(0x19a)]({'name':_0x56e059,'id':_0x18483d},_0x2cdbcc);}catch{}}const llmAgentCache=createOptionalProfileCache(a55_0x201238(0x18a),a55_0x201238(0x1ad));export function getLLMAgentCacheFile(_0x81b8b2){const _0x1b81ab=a55_0x201238;return llmAgentCache[_0x1b81ab(0x16d)](_0x81b8b2);}export function readCachedLLMAgent(_0x2bc543){const _0x13cc4e=a55_0x201238,_0x5e6b9d=llmAgentCache[_0x13cc4e(0x18b)](_0x2bc543);if(_0x5e6b9d&&typeof _0x5e6b9d['id']==='string'&&typeof _0x5e6b9d[_0x13cc4e(0x181)]==='string'&&typeof _0x5e6b9d[_0x13cc4e(0x16b)]===_0x13cc4e(0x1a2))return _0x5e6b9d;return null;}export function writeCachedLLMAgent(_0x2ac67c,_0x5a850a,_0x531c45,_0x4422d4){const _0x40328f=a55_0x201238;try{llmAgentCache[_0x40328f(0x19a)]({'name':_0x2ac67c,'id':_0x5a850a,'projectId':_0x531c45},_0x4422d4);}catch{}}export function clearCachedLLMAgent(_0x128b0f){const _0x1b3a28=a55_0x201238;try{llmAgentCache[_0x1b3a28(0x170)](_0x128b0f);}catch{}}const accountInfoCache=createOptionalProfileCache(a55_0x201238(0x193),a55_0x201238(0x1ab),{'suffix':a55_0x201238(0x182)});export function getAccountInfoCacheFile(_0x664361){const _0x160cb2=a55_0x201238;return accountInfoCache[_0x160cb2(0x16d)](_0x664361);}export function readCachedAccountInfo(_0x389704){const _0x4b138e=a55_0x201238,_0x35daef=accountInfoCache[_0x4b138e(0x18b)](_0x389704);if(_0x35daef&&typeof _0x35daef[_0x4b138e(0x19c)]===_0x4b138e(0x1a2)&&typeof _0x35daef[_0x4b138e(0x174)]===_0x4b138e(0x1b4))return _0x35daef;return null;}export function writeCachedAccountInfo(_0x5512b2,_0x3d7abe,_0x2f651e){const _0x14798b=a55_0x201238;try{accountInfoCache[_0x14798b(0x19a)]({'site':_0x5512b2,'accountId':_0x3d7abe,'cachedAt':new Date()[_0x14798b(0x198)]()},_0x2f651e);}catch{}}export function parseEnvFile(_0x165d97){const _0x144cec=a55_0x201238,_0x1168b2={};for(const _0x3fb716 of _0x165d97[_0x144cec(0x1a8)]('\x0a')){const _0x4cca24=_0x3fb716['trim']();if(!_0x4cca24||_0x4cca24['startsWith']('#'))continue;const _0x41b65c=_0x4cca24[_0x144cec(0x171)](/^([^=]+)=(.*)$/);if(_0x41b65c){const _0x104d20=_0x41b65c[0x1]['trim']();let _0x3aba83=_0x41b65c[0x2][_0x144cec(0x1b1)]();(_0x3aba83[_0x144cec(0x17d)]('\x22')&&_0x3aba83[_0x144cec(0x173)]('\x22')||_0x3aba83[_0x144cec(0x17d)]('\x27')&&_0x3aba83['endsWith']('\x27'))&&(_0x3aba83=_0x3aba83[_0x144cec(0x1b0)](0x1,-0x1)),_0x1168b2[_0x104d20]=_0x3aba83;}}return _0x1168b2;}export function readUserConfig(){const _0x87a52f=a55_0x201238,_0x6bcc26=getConfigFile();if(!existsSync(_0x6bcc26))return{};try{const _0xf98b9=readFileSync(_0x6bcc26,_0x87a52f(0x17b));return parseEnvFile(_0xf98b9);}catch(_0x3bf012){return console['warn'](_0x87a52f(0x185)+_0x6bcc26+':',_0x3bf012),{};}}export function resolveSite(_0x428be1){const _0x49151f=a55_0x201238,_0x1d048b=['us01',_0x49151f(0x197),'eu01',_0x49151f(0x186),'ap03',_0x49151f(0x175),'dev-eu01',_0x49151f(0x16f),_0x49151f(0x19e),_0x49151f(0x180)];if(_0x1d048b['includes'](_0x428be1))return _0x428be1;if(_0x428be1 in SITE_ALIASES)return SITE_ALIASES[_0x428be1];return console['warn'](_0x49151f(0x1a9)+_0x428be1+'\x27,\x20defaulting\x20to\x20us01'),_0x49151f(0x1a5);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function resolveAccessToken(_0x10074f){const _0x4e391b=a55_0x201238,_0x2f3a5a=_0x10074f||getActiveProfileName()||undefined;if(_0x2f3a5a){const _0x55ffa8=_0x4e391b(0x177)+normalizeProfileForEnvVar(_0x2f3a5a);if(process.env[_0x55ffa8])return{'accessToken':process.env[_0x55ffa8],'source':_0x55ffa8+_0x4e391b(0x192)};}if(process.env.TDX_ACCESS_TOKEN)return{'accessToken':process.env.TDX_ACCESS_TOKEN,'source':_0x4e391b(0x17c)};return null;}export function getAccessToken(_0x12a30d){const _0x1f0ed9=a55_0x201238;return resolveAccessToken(_0x12a30d)?.[_0x1f0ed9(0x1a3)];}export function getAPIKey(_0x3479e8){const _0x271cc2=a55_0x201238,_0xc674c8=_0x3479e8||getActiveProfileName();if(_0xc674c8){const _0x38f9a1=_0x271cc2(0x17a)+normalizeProfileForEnvVar(_0xc674c8);if(process.env[_0x38f9a1])return process.env[_0x38f9a1];}if(process.env.TDX_API_KEY)return process.env.TDX_API_KEY;return undefined;}export function normalizeProfileForEnvVar(_0x19c91c){const _0x1dac6f=a55_0x201238;return _0x19c91c[_0x1dac6f(0x195)]()[_0x1dac6f(0x18c)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x431230,_0x58a678){const _0x399e88=a55_0x201238,_0x1aa13a=resolveAccessToken(_0x58a678);if(_0x1aa13a)return{'apiKey':_0x1aa13a['accessToken'],'source':_0x1aa13a['source'],'isDeprecated':![]};const _0x43abb1=_0x58a678||getActiveProfileName()||undefined;if(_0x43abb1){const _0x2ce0c5=_0x399e88(0x17a)+normalizeProfileForEnvVar(_0x43abb1);if(process.env[_0x2ce0c5])return{'apiKey':process.env[_0x2ce0c5],'source':_0x2ce0c5+_0x399e88(0x192),'isDeprecated':![]};const _0x45c469=getCachedCredential(_0x431230,_0x43abb1);if(_0x45c469)return{'apiKey':_0x45c469,'source':_0x399e88(0x183)+_0x43abb1+')','isDeprecated':![]};const _0x2e13f4=await getKeychainAPIKey(_0x43abb1);if(_0x2e13f4)return setCachedCredential(_0x2e13f4,_0x431230,_0x43abb1),{'apiKey':_0x2e13f4,'source':_0x399e88(0x183)+_0x43abb1+')','isDeprecated':![]};}if(process.env.TDX_API_KEY)return{'apiKey':process.env.TDX_API_KEY,'source':'TDX_API_KEY\x20env\x20var','isDeprecated':![]};if(!_0x43abb1){const _0x39fb72=getCachedCredential(_0x431230,undefined);if(_0x39fb72)return{'apiKey':_0x39fb72,'source':'keychain','isDeprecated':![]};const _0x1c4d3b=await getKeychainAPIKey(undefined);if(_0x1c4d3b)return setCachedCredential(_0x1c4d3b,_0x431230,undefined),{'apiKey':_0x1c4d3b,'source':_0x399e88(0x1a6),'isDeprecated':![]};}return null;}export async function getAPIKeyAsync(_0x578d32,_0x1242e1){const _0x3f6491=a55_0x201238,_0x48bee7=await resolveAPIKeyAsync(_0x578d32,_0x1242e1);return _0x48bee7?.[_0x3f6491(0x19d)];}function cleanupLegacyEnvFile(_0x2ca36f){const _0x1ba79f=a55_0x201238;if(!existsSync(_0x2ca36f))return![];try{const _0x332e47=readFileSync(_0x2ca36f,_0x1ba79f(0x17b)),_0x51001c=_0x332e47[_0x1ba79f(0x1a8)]('\x0a'),_0x4e66f5=_0x51001c[_0x1ba79f(0x19f)](_0x3f9e6e=>{const _0x20210d=_0x1ba79f,_0x335f2f=_0x3f9e6e['trim']();if(!_0x335f2f||_0x335f2f[_0x20210d(0x17d)]('#'))return!![];const [_0x4ceb5b]=_0x335f2f[_0x20210d(0x1a8)]('=');return!_0x4ceb5b['startsWith']('TD_API_KEY');}),_0x4553f2=_0x4e66f5[_0x1ba79f(0x17f)](_0x589ac1=>{const _0x410829=_0x1ba79f,_0x516fdc=_0x589ac1[_0x410829(0x1b1)]();return _0x516fdc&&!_0x516fdc[_0x410829(0x17d)]('#');});if(!_0x4553f2)return unlinkSync(_0x2ca36f),!![];return writeFileSync(_0x2ca36f,_0x4e66f5[_0x1ba79f(0x1a0)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function getActiveProfileName(){const _0x1b0f44=a55_0x201238;if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x154c69=a55_0x17c0bc[_0x1b0f44(0x1a0)](getConfigDir(),_0x1b0f44(0x189));if(!a55_0x4703ad[_0x1b0f44(0x1a7)](_0x154c69))return null;try{const _0x1a301b=a55_0x4703ad[_0x1b0f44(0x18e)](_0x154c69,_0x1b0f44(0x17b)),_0x57afbb=JSON[_0x1b0f44(0x196)](_0x1a301b);return _0x57afbb[_0x1b0f44(0x187)]||null;}catch{return null;}}export function saveAPIKey(_0x436e84,_0x3a929b,_0x2e804){const _0x2cf8a7=a55_0x201238,_0x2d96ff=getConfigDir(),_0x422c77=getConfigFilePath(_0x2e804);!existsSync(_0x2d96ff)&&mkdirSync(_0x2d96ff,{'recursive':!![],'mode':0x1c0});let _0x24fcf={};if(existsSync(_0x422c77))try{const _0x19371a=readFileSync(_0x422c77,'utf-8');_0x24fcf=parseEnvFile(_0x19371a);}catch(_0x25be00){console[_0x2cf8a7(0x1b2)](_0x2cf8a7(0x1ac)+_0x422c77+':',_0x25be00);}const _0x3fb5c3=_0x436e84[_0x2cf8a7(0x195)]()[_0x2cf8a7(0x18c)](/-/g,'_');_0x24fcf[_0x2cf8a7(0x16e)+_0x3fb5c3]=_0x3a929b;const _0x3b3aa1=Object['entries'](_0x24fcf)[_0x2cf8a7(0x18d)](([_0x202a7b,_0xe900fe])=>_0x202a7b+'='+_0xe900fe);writeFileSync(_0x422c77,_0x3b3aa1[_0x2cf8a7(0x1a0)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0xdf9f63,_0x102e2e,_0x55dc1e){const _0x507ba2=a55_0x201238;await saveKeychainAPIKey(_0xdf9f63,_0x55dc1e),setCachedCredential(_0xdf9f63,_0x102e2e,_0x55dc1e);const _0x16e44c=getConfigFilePath(_0x55dc1e);cleanupLegacyEnvFile(_0x16e44c)&&console[_0x507ba2(0x1b2)](a55_0x3d5738['yellow']('⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'));}export function loadConfig(){const _0x589415=a55_0x201238,_0x49ea8f={'apiKeys':{},'defaultSite':_0x589415(0x1a5)},_0x31806e=[_0x589415(0x1a5),_0x589415(0x197),'eu01',_0x589415(0x186),_0x589415(0x191),_0x589415(0x175),_0x589415(0x18f),_0x589415(0x16f),_0x589415(0x19e),_0x589415(0x180)],_0x2ecfc9=getAPIKey();if(_0x2ecfc9)for(const _0x2401d3 of _0x31806e){_0x49ea8f[_0x589415(0x172)][_0x2401d3]=_0x2ecfc9;}return _0x49ea8f;}export function isExperimentalAvailable(){return!!process.env.TDX_EXPERIMENTAL;}export function loadGlobalProxy(){const _0x4b2593=a55_0x201238,_0x8e3681=a55_0x17c0bc[_0x4b2593(0x1a0)](getConfigDir(),_0x4b2593(0x189));if(!a55_0x4703ad[_0x4b2593(0x1a7)](_0x8e3681))return undefined;try{const _0x58721e=a55_0x4703ad[_0x4b2593(0x18e)](_0x8e3681,_0x4b2593(0x17b)),_0x392e93=JSON['parse'](_0x58721e);return typeof _0x392e93[_0x4b2593(0x194)]===_0x4b2593(0x1a2)?_0x392e93[_0x4b2593(0x194)]:undefined;}catch{return undefined;}}export function loadReleaseChannel(){const _0x47f7d8=a55_0x201238,_0x32c2cc=process.env.TDX_RELEASE_CHANNEL;if(_0x32c2cc===_0x47f7d8(0x19b)||_0x32c2cc===_0x47f7d8(0x1a1))return _0x32c2cc;const _0xa85889=a55_0x17c0bc['join'](getConfigDir(),'tdx.json');if(!a55_0x4703ad[_0x47f7d8(0x1a7)](_0xa85889))return'stable';try{const _0xc660b1=a55_0x4703ad['readFileSync'](_0xa85889,_0x47f7d8(0x17b)),_0x2eed52=JSON[_0x47f7d8(0x196)](_0xc660b1);if(_0x2eed52[_0x47f7d8(0x190)]===_0x47f7d8(0x19b))return'next';}catch{}return _0x47f7d8(0x1a1);}function a55_0x3908(){const _0x45d03e=['.json','keychain\x20(profile:\x20','tdx','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','ap02','profile','.env','tdx.json','llm_default_agent','read','replace','map','readFileSync','dev-eu01','release_channel','ap03','\x20env\x20var','account_info','proxy','toUpperCase','parse','ap01','toISOString','3972354pLXlII','write','next','site','apiKey','stg-ap01','filter','join','stable','string','accessToken','11162856VTIuRh','us01','keychain','existsSync','split','Warning:\x20Unknown\x20site\x20\x27','10gqlcaN','config/account-info','Warning:\x20Failed\x20to\x20read\x20','config/llm-agent','3499604lUNUlB','stringify','slice','trim','warn','1096496tIbqsH','number','2XrFLEX','projectId','19794951gGXimZ','path','TD_API_KEY_','stg-us01','clear','match','apiKeys','endsWith','accountId','dev-us01','.env.','TDX_ACCESS_TOKEN_','config/llm-project','1836EidBQV','TDX_API_KEY_','utf-8','TDX_ACCESS_TOKEN\x20env\x20var','startsWith','7304913UxwrRT','some','stg-ap03','name'];a55_0x3908=function(){return _0x45d03e;};return a55_0x3908();}export function saveReleaseChannel(_0x16a97b){const _0xfb727b=a55_0x201238,_0x5ad2d0=getConfigDir(),_0x342d10=a55_0x17c0bc['join'](_0x5ad2d0,'tdx.json');!existsSync(_0x5ad2d0)&&mkdirSync(_0x5ad2d0,{'recursive':!![],'mode':0x1c0});let _0x334261={};if(existsSync(_0x342d10))try{const _0x386074=readFileSync(_0x342d10,_0xfb727b(0x17b));_0x334261=JSON[_0xfb727b(0x196)](_0x386074);}catch{}_0x334261[_0xfb727b(0x190)]=_0x16a97b,writeFileSync(_0x342d10,JSON[_0xfb727b(0x1af)](_0x334261,null,0x2),{'mode':0x180});}
@@ -1 +1 @@
1
- const a56_0x54c74d=a56_0x245e;(function(_0x266878,_0x4900d9){const _0x2bc0e9=a56_0x245e,_0x41529b=_0x266878();while(!![]){try{const _0x584a9c=parseInt(_0x2bc0e9(0x160))/0x1+parseInt(_0x2bc0e9(0x167))/0x2+-parseInt(_0x2bc0e9(0x16c))/0x3+parseInt(_0x2bc0e9(0x16b))/0x4*(parseInt(_0x2bc0e9(0x168))/0x5)+-parseInt(_0x2bc0e9(0x169))/0x6+-parseInt(_0x2bc0e9(0x161))/0x7*(parseInt(_0x2bc0e9(0x165))/0x8)+parseInt(_0x2bc0e9(0x162))/0x9;if(_0x584a9c===_0x4900d9)break;else _0x41529b['push'](_0x41529b['shift']());}catch(_0x45eb80){_0x41529b['push'](_0x41529b['shift']());}}}(a56_0x2d44,0x68b42));import{createProfileCache}from'../utils/global-cache.js';function a56_0x2d44(){const _0x1ab70e=['3060756dlpDJZ','write','214728ohxXeN','479247HkbUOJ','read','611940KbrsgU','7CMlTZy','5054076OdSrDO','clear','now','4517080fWLHXi','connections-{profile}.json','765016UPINls','10KUnCII'];a56_0x2d44=function(){return _0x1ab70e;};return a56_0x2d44();}const connectionCache=createProfileCache(a56_0x54c74d(0x166),'core/connection-cache');function a56_0x245e(_0x144a89,_0x4b4f3e){_0x144a89=_0x144a89-0x15f;const _0x2d4455=a56_0x2d44();let _0x245e84=_0x2d4455[_0x144a89];return _0x245e84;}export function loadCachedConnections(_0x51cfe0){const _0x1662df=a56_0x54c74d,_0x2ce109=connectionCache[_0x1662df(0x15f)](_0x51cfe0);return _0x2ce109?.['connections']??null;}export function saveCachedConnections(_0xb5a11b,_0x3ae2f1){const _0x2dc84d=a56_0x54c74d;connectionCache[_0x2dc84d(0x16a)](_0xb5a11b,{'connections':_0x3ae2f1,'cachedAt':Date[_0x2dc84d(0x164)]()});}export function clearConnectionCache(_0x328b14){const _0x5c618b=a56_0x54c74d;connectionCache[_0x5c618b(0x163)](_0x328b14);}
1
+ const a56_0x3c96d7=a56_0x36fe;(function(_0x39dc68,_0x2404b7){const _0x1f571b=a56_0x36fe,_0x580c83=_0x39dc68();while(!![]){try{const _0x5e7a6c=parseInt(_0x1f571b(0x125))/0x1+parseInt(_0x1f571b(0x11d))/0x2+parseInt(_0x1f571b(0x124))/0x3+-parseInt(_0x1f571b(0x11e))/0x4+parseInt(_0x1f571b(0x127))/0x5*(parseInt(_0x1f571b(0x11f))/0x6)+parseInt(_0x1f571b(0x128))/0x7+-parseInt(_0x1f571b(0x122))/0x8;if(_0x5e7a6c===_0x2404b7)break;else _0x580c83['push'](_0x580c83['shift']());}catch(_0x228216){_0x580c83['push'](_0x580c83['shift']());}}}(a56_0x3962,0x1a67a));import{createProfileCache}from'../utils/global-cache.js';function a56_0x36fe(_0x104402,_0x41874e){_0x104402=_0x104402-0x11c;const _0x39627f=a56_0x3962();let _0x36fefd=_0x39627f[_0x104402];return _0x36fefd;}const connectionCache=createProfileCache(a56_0x3c96d7(0x121),a56_0x3c96d7(0x129));function a56_0x3962(){const _0xffc5f7=['connections','5RnTzrK','469784fAdauL','core/connection-cache','read','361230KEmcRy','842884tTwBkR','595326XBImEL','write','connections-{profile}.json','1171880qEvLBy','clear','148902MPePpT','68778xehWud'];a56_0x3962=function(){return _0xffc5f7;};return a56_0x3962();}export function loadCachedConnections(_0xc90a7){const _0x2f0489=a56_0x3c96d7,_0x5b06aa=connectionCache[_0x2f0489(0x11c)](_0xc90a7);return _0x5b06aa?.[_0x2f0489(0x126)]??null;}export function saveCachedConnections(_0x328c85,_0x3436b1){const _0x3c2b70=a56_0x3c96d7;connectionCache[_0x3c2b70(0x120)](_0x328c85,{'connections':_0x3436b1,'cachedAt':Date['now']()});}export function clearConnectionCache(_0x3c3c0a){const _0xa09af9=a56_0x3c96d7;connectionCache[_0xa09af9(0x123)](_0x3c3c0a);}
@@ -1 +1 @@
1
- const a57_0x27e3fc=a57_0x438f;(function(_0x5a62a7,_0x5c44c0){const _0x3296bd=a57_0x438f,_0x1ed8f0=_0x5a62a7();while(!![]){try{const _0xe2db6b=parseInt(_0x3296bd(0x124))/0x1*(parseInt(_0x3296bd(0x131))/0x2)+-parseInt(_0x3296bd(0x13a))/0x3*(parseInt(_0x3296bd(0x12e))/0x4)+parseInt(_0x3296bd(0x12c))/0x5+parseInt(_0x3296bd(0x132))/0x6+parseInt(_0x3296bd(0x138))/0x7+parseInt(_0x3296bd(0x127))/0x8+-parseInt(_0x3296bd(0x13e))/0x9;if(_0xe2db6b===_0x5c44c0)break;else _0x1ed8f0['push'](_0x1ed8f0['shift']());}catch(_0x4d62ea){_0x1ed8f0['push'](_0x1ed8f0['shift']());}}}(a57_0x5a73,0xe5b35));import a57_0x277da7 from'prompts';function a57_0x5a73(){const _0x362527=['other','select','9762053jsFNFI','us01','408lfLGMW','length','Enter\x20custom\x20site','eu\x20\x20\x20-\x20Europe','31374054GlALiA','push','us\x20\x20\x20-\x20United\x20States','log','findIndex','site','number','68371qpgGdL','ap02','trim','13785504mKNASH','value','Enter\x20site\x20name:','ap02\x20-\x20Korea','ap01','2411985kyJiJI','Select\x20your\x20Treasure\x20Data\x20site:','38752KEbwvQ','eu01','customSite','28cfAahB','7122414AwzCYl','text','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','jp\x20\x20\x20-\x20Japan'];a57_0x5a73=function(){return _0x362527;};return a57_0x5a73();}export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0xc7c59c,_0x283a7f){const _0x4c8336=a57_0x438f;if(_0xc7c59c===undefined)return _0x283a7f;if(typeof _0xc7c59c===_0x4c8336(0x123))return _0xc7c59c;return parseInt(_0xc7c59c,0xa);}export const STANDARD_SITE_CHOICES=[{'title':a57_0x27e3fc(0x140),'value':a57_0x27e3fc(0x139)},{'title':a57_0x27e3fc(0x135),'value':a57_0x27e3fc(0x12b)},{'title':a57_0x27e3fc(0x13d),'value':a57_0x27e3fc(0x12f)},{'title':a57_0x27e3fc(0x12a),'value':a57_0x27e3fc(0x125)}];function a57_0x438f(_0x3b06ea,_0x50aaaf){_0x3b06ea=_0x3b06ea-0x122;const _0x5a73e8=a57_0x5a73();let _0x438f95=_0x5a73e8[_0x3b06ea];return _0x438f95;}export function buildSiteChoices(_0x3a657b){const _0x29a2a6=a57_0x27e3fc,_0x5c4aac=[...STANDARD_SITE_CHOICES];let _0xb7dbd3=_0x5c4aac[_0x29a2a6(0x142)](_0x59c5b8=>_0x59c5b8[_0x29a2a6(0x128)]===_0x3a657b);return _0xb7dbd3===-0x1&&_0x3a657b!==_0x29a2a6(0x139)&&(_0x5c4aac[_0x29a2a6(0x13f)]({'title':_0x3a657b,'value':_0x3a657b}),_0xb7dbd3=_0x5c4aac[_0x29a2a6(0x13b)]-0x1),_0x5c4aac[_0x29a2a6(0x13f)]({'title':_0x29a2a6(0x13c),'value':_0x29a2a6(0x136)}),{'choices':_0x5c4aac,'initialIndex':_0xb7dbd3>=0x0?_0xb7dbd3:0x0};}export async function promptSiteSelection(_0x99181b,_0x372257,_0x400513='Cancelled'){const _0x512dbf=a57_0x27e3fc,{choices:_0xab50f9,initialIndex:_0x439432}=buildSiteChoices(_0x99181b),_0x407359=_0x372257?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x372257+'):':_0x512dbf(0x12d),_0x2029d6=await a57_0x277da7({'type':_0x512dbf(0x137),'name':_0x512dbf(0x122),'message':_0x407359,'choices':_0xab50f9,'initial':_0x439432});if(!_0x2029d6[_0x512dbf(0x122)])return console[_0x512dbf(0x141)]('\x0a'+_0x400513),null;if(_0x2029d6[_0x512dbf(0x122)]!==_0x512dbf(0x136))return _0x2029d6[_0x512dbf(0x122)];const _0x5ee2cc=await a57_0x277da7({'type':_0x512dbf(0x133),'name':_0x512dbf(0x130),'message':_0x512dbf(0x129),'initial':'us01','validate':_0xf30f92=>{const _0x349982=_0x512dbf;if(!_0xf30f92||!_0xf30f92[_0x349982(0x126)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/['test'](_0xf30f92[_0x349982(0x126)]()))return _0x349982(0x134);return!![];}});if(!_0x5ee2cc[_0x512dbf(0x130)])return console[_0x512dbf(0x141)]('\x0a'+_0x400513),null;return _0x5ee2cc['customSite'];}
1
+ const a57_0xf0575a=a57_0x3849;(function(_0x1e20ee,_0x39e2db){const _0x184081=a57_0x3849,_0x4d6da6=_0x1e20ee();while(!![]){try{const _0x537af6=-parseInt(_0x184081(0x155))/0x1*(parseInt(_0x184081(0x14b))/0x2)+parseInt(_0x184081(0x145))/0x3*(-parseInt(_0x184081(0x13e))/0x4)+parseInt(_0x184081(0x139))/0x5*(-parseInt(_0x184081(0x152))/0x6)+-parseInt(_0x184081(0x135))/0x7*(-parseInt(_0x184081(0x141))/0x8)+parseInt(_0x184081(0x154))/0x9+-parseInt(_0x184081(0x146))/0xa+-parseInt(_0x184081(0x136))/0xb*(-parseInt(_0x184081(0x14d))/0xc);if(_0x537af6===_0x39e2db)break;else _0x4d6da6['push'](_0x4d6da6['shift']());}catch(_0x2a30a5){_0x4d6da6['push'](_0x4d6da6['shift']());}}}(a57_0xe8f1,0x7b212));import a57_0x2896f5 from'prompts';export const DEFAULT_DISPLAY_LIMIT=0x28;function a57_0xe8f1(){const _0x4690f5=['other','push','us\x20\x20\x20-\x20United\x20States','6054ZWFbNw','log','7957944EtaQqw','19phfJAK','Site\x20name\x20cannot\x20be\x20empty','site','136304GgoaKe','66aYcjek','eu\x20\x20\x20-\x20Europe','length','3205aGyVlz','test','us01','number','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','52664HsqnTw','value','Enter\x20custom\x20site','64XvGQEW','findIndex','select','ap02\x20-\x20Korea','138UuGKsC','7555160JiCYIz','ap01','trim','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','ap02','101330uSvJtf','Enter\x20site\x20name:','4869804cQxIiM','customSite'];a57_0xe8f1=function(){return _0x4690f5;};return a57_0xe8f1();}export const DEFAULT_LISTING_LIMIT=0x2710;function a57_0x3849(_0x53f1d2,_0x41c501){_0x53f1d2=_0x53f1d2-0x133;const _0xe8f1a4=a57_0xe8f1();let _0x384985=_0xe8f1a4[_0x53f1d2];return _0x384985;}export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0xf3f2be,_0x515873){const _0x25429f=a57_0x3849;if(_0xf3f2be===undefined)return _0x515873;if(typeof _0xf3f2be===_0x25429f(0x13c))return _0xf3f2be;return parseInt(_0xf3f2be,0xa);}export const STANDARD_SITE_CHOICES=[{'title':a57_0xf0575a(0x151),'value':a57_0xf0575a(0x13b)},{'title':'jp\x20\x20\x20-\x20Japan','value':a57_0xf0575a(0x147)},{'title':a57_0xf0575a(0x137),'value':'eu01'},{'title':a57_0xf0575a(0x144),'value':a57_0xf0575a(0x14a)}];export function buildSiteChoices(_0x35ad13){const _0x178462=a57_0xf0575a,_0x3859eb=[...STANDARD_SITE_CHOICES];let _0x374ac4=_0x3859eb[_0x178462(0x142)](_0xbe4497=>_0xbe4497[_0x178462(0x13f)]===_0x35ad13);return _0x374ac4===-0x1&&_0x35ad13!==_0x178462(0x13b)&&(_0x3859eb[_0x178462(0x150)]({'title':_0x35ad13,'value':_0x35ad13}),_0x374ac4=_0x3859eb[_0x178462(0x138)]-0x1),_0x3859eb['push']({'title':_0x178462(0x140),'value':'other'}),{'choices':_0x3859eb,'initialIndex':_0x374ac4>=0x0?_0x374ac4:0x0};}export async function promptSiteSelection(_0x4f1dd3,_0x1852c6,_0x440122='Cancelled'){const _0x4a35be=a57_0xf0575a,{choices:_0x3048ba,initialIndex:_0x5212eb}=buildSiteChoices(_0x4f1dd3),_0x38bff6=_0x1852c6?_0x4a35be(0x13d)+_0x1852c6+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x2e038b=await a57_0x2896f5({'type':_0x4a35be(0x143),'name':_0x4a35be(0x134),'message':_0x38bff6,'choices':_0x3048ba,'initial':_0x5212eb});if(!_0x2e038b[_0x4a35be(0x134)])return console['log']('\x0a'+_0x440122),null;if(_0x2e038b[_0x4a35be(0x134)]!==_0x4a35be(0x14f))return _0x2e038b[_0x4a35be(0x134)];const _0x28574e=await a57_0x2896f5({'type':'text','name':_0x4a35be(0x14e),'message':_0x4a35be(0x14c),'initial':_0x4a35be(0x13b),'validate':_0x2e0c2f=>{const _0x31b8d1=_0x4a35be;if(!_0x2e0c2f||!_0x2e0c2f[_0x31b8d1(0x148)]())return _0x31b8d1(0x133);if(!/^[a-z0-9-]+$/[_0x31b8d1(0x13a)](_0x2e0c2f[_0x31b8d1(0x148)]()))return _0x31b8d1(0x149);return!![];}});if(!_0x28574e['customSite'])return console[_0x4a35be(0x153)]('\x0a'+_0x440122),null;return _0x28574e[_0x4a35be(0x14e)];}
@@ -1 +1 @@
1
- (function(_0x2e6e06,_0x2d8393){const _0x2259bb=a58_0x2eaa,_0x2d0af0=_0x2e6e06();while(!![]){try{const _0x2be44e=-parseInt(_0x2259bb(0xfe))/0x1+-parseInt(_0x2259bb(0xf5))/0x2+parseInt(_0x2259bb(0xfb))/0x3*(parseInt(_0x2259bb(0xfc))/0x4)+parseInt(_0x2259bb(0xf4))/0x5*(-parseInt(_0x2259bb(0x102))/0x6)+-parseInt(_0x2259bb(0xf2))/0x7*(parseInt(_0x2259bb(0x100))/0x8)+-parseInt(_0x2259bb(0x101))/0x9+parseInt(_0x2259bb(0xff))/0xa;if(_0x2be44e===_0x2d8393)break;else _0x2d0af0['push'](_0x2d0af0['shift']());}catch(_0x249a29){_0x2d0af0['push'](_0x2d0af0['shift']());}}}(a58_0x54bf,0x626cf));function a58_0x2eaa(_0x552d83,_0x397a3b){_0x552d83=_0x552d83-0xf1;const _0x54bf5e=a58_0x54bf();let _0x2eaae2=_0x54bf5e[_0x552d83];return _0x2eaae2;}const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x17137f,_0x449f1d){const _0x2efc06=a58_0x2eaa,_0x6272f9=_0x17137f||_0x2efc06(0xf8),_0x5a2d88=_0x449f1d||'__default_profile__';return _0x6272f9+':'+_0x5a2d88;}export function getCachedCredential(_0x13c9be,_0x2d0a47){const _0x5bd231=a58_0x2eaa,_0x2d5c07=getCacheKey(_0x13c9be,_0x2d0a47),_0x2f5125=cache[_0x5bd231(0xfd)](_0x2d5c07);if(!_0x2f5125)return null;if(Date[_0x5bd231(0xf1)]()-_0x2f5125[_0x5bd231(0xf3)]>CACHE_TTL_MS)return cache['delete'](_0x2d5c07),null;return _0x2f5125[_0x5bd231(0xfa)];}function a58_0x54bf(){const _0x526e77=['loadedAt','516955xWWBFg','1579402juZsdR','set','delete','__default_site__','clear','apiKey','899733pCtgGt','8PoZBOy','get','105995eVFeuO','17193280ZnXEhb','1688952oXmMJe','6352137rFKuLu','6yKPNlF','now','7rIUWAL'];a58_0x54bf=function(){return _0x526e77;};return a58_0x54bf();}export function setCachedCredential(_0x56ab07,_0x39dfb3,_0x3eb1d4){const _0x2f6938=a58_0x2eaa,_0xb778d6=getCacheKey(_0x39dfb3,_0x3eb1d4);cache[_0x2f6938(0xf6)](_0xb778d6,{'apiKey':_0x56ab07,'loadedAt':Date[_0x2f6938(0xf1)]()});}export function clearCredentialCache(){const _0xe2bcf2=a58_0x2eaa;cache[_0xe2bcf2(0xf9)]();}export function clearCachedCredential(_0x386d17,_0x16678e){const _0x448ef1=a58_0x2eaa,_0x394dda=getCacheKey(_0x386d17,_0x16678e);cache[_0x448ef1(0xf7)](_0x394dda);}
1
+ (function(_0xb999f1,_0x563914){const _0x3cfdc3=a58_0x31a1,_0x43cab2=_0xb999f1();while(!![]){try{const _0x3f45e3=-parseInt(_0x3cfdc3(0xaf))/0x1+parseInt(_0x3cfdc3(0xbb))/0x2*(parseInt(_0x3cfdc3(0xb6))/0x3)+parseInt(_0x3cfdc3(0xb1))/0x4*(parseInt(_0x3cfdc3(0xad))/0x5)+-parseInt(_0x3cfdc3(0xab))/0x6+-parseInt(_0x3cfdc3(0xb5))/0x7*(parseInt(_0x3cfdc3(0xaa))/0x8)+parseInt(_0x3cfdc3(0xb0))/0x9*(parseInt(_0x3cfdc3(0xbc))/0xa)+parseInt(_0x3cfdc3(0xb4))/0xb;if(_0x3f45e3===_0x563914)break;else _0x43cab2['push'](_0x43cab2['shift']());}catch(_0x4580b8){_0x43cab2['push'](_0x43cab2['shift']());}}}(a58_0x3b87,0x3221b));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function a58_0x31a1(_0x45fda9,_0x12d146){_0x45fda9=_0x45fda9-0xaa;const _0x3b87bd=a58_0x3b87();let _0x31a1e5=_0x3b87bd[_0x45fda9];return _0x31a1e5;}function getCacheKey(_0x13a15c,_0x4770d7){const _0x29be14=a58_0x31a1,_0x56a6f7=_0x13a15c||_0x29be14(0xb7),_0x371360=_0x4770d7||_0x29be14(0xac);return _0x56a6f7+':'+_0x371360;}export function getCachedCredential(_0x5e7fa0,_0x5d242a){const _0x309f31=a58_0x31a1,_0x387f98=getCacheKey(_0x5e7fa0,_0x5d242a),_0x54c92d=cache[_0x309f31(0xb2)](_0x387f98);if(!_0x54c92d)return null;if(Date[_0x309f31(0xb9)]()-_0x54c92d[_0x309f31(0xb3)]>CACHE_TTL_MS)return cache[_0x309f31(0xae)](_0x387f98),null;return _0x54c92d['apiKey'];}function a58_0x3b87(){const _0x4ad389=['579750YyjAsK','__default_profile__','298945jjvytY','delete','369730ujnDnY','2723661ljzuae','20fCqYkq','get','loadedAt','1252889CEtyug','175LbEcAo','37041sHAmPQ','__default_site__','set','now','clear','36EowPss','10pdPRHG','85128ZtCKFt'];a58_0x3b87=function(){return _0x4ad389;};return a58_0x3b87();}export function setCachedCredential(_0x5a2c96,_0x4da05e,_0x5b2b77){const _0x57277f=a58_0x31a1,_0x24aa0d=getCacheKey(_0x4da05e,_0x5b2b77);cache[_0x57277f(0xb8)](_0x24aa0d,{'apiKey':_0x5a2c96,'loadedAt':Date[_0x57277f(0xb9)]()});}export function clearCredentialCache(){const _0x313679=a58_0x31a1;cache[_0x313679(0xba)]();}export function clearCachedCredential(_0xeb7512,_0x394b14){const _0x5dbe62=a58_0x31a1,_0x5e0070=getCacheKey(_0xeb7512,_0x394b14);cache[_0x5dbe62(0xae)](_0x5e0070);}
@@ -1 +1 @@
1
- const a59_0x4ffc4a=a59_0x3159;(function(_0x2778c0,_0x46eb32){const _0x374a7f=a59_0x3159,_0x36b10f=_0x2778c0();while(!![]){try{const _0x532a46=-parseInt(_0x374a7f(0x152))/0x1*(-parseInt(_0x374a7f(0x165))/0x2)+parseInt(_0x374a7f(0x158))/0x3+-parseInt(_0x374a7f(0x170))/0x4*(parseInt(_0x374a7f(0x147))/0x5)+parseInt(_0x374a7f(0x15b))/0x6+-parseInt(_0x374a7f(0x159))/0x7*(-parseInt(_0x374a7f(0x15e))/0x8)+parseInt(_0x374a7f(0x17b))/0x9+parseInt(_0x374a7f(0x144))/0xa*(-parseInt(_0x374a7f(0x155))/0xb);if(_0x532a46===_0x46eb32)break;else _0x36b10f['push'](_0x36b10f['shift']());}catch(_0x34961f){_0x36b10f['push'](_0x36b10f['shift']());}}}(a59_0x55df,0x3fde2));import{resolveSite,getAPIKey,getAccessToken,getAPIKeyAsync,getConfigDir}from'./config.js';import{getOAuthTokens}from'./oauth-keychain.js';function a59_0x3159(_0x18f3a9,_0x30691a){_0x18f3a9=_0x18f3a9-0x135;const _0x55df22=a59_0x55df();let _0x31593c=_0x55df22[_0x18f3a9];return _0x31593c;}import{loadSessionContext,getSessionID}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';import{loadProfile}from'./profile.js';import{LogLevel}from'../utils/logger/index.js';import*as a59_0xe5a51b from'node:fs';function a59_0x55df(){const _0x2a03d0=['createAsync','layers','apiKey','utf-8','join','[context]','1604eawsbx','displayWithSources','segment_path','logLevel','cli','proxy','getParameters','(using\x20session:\x20','profileCredentials','parse','replace','4613193JyQniO','workflow_project','cyan','getSource','entries','string','parentSegment','Project','env','none','resolveAPIKeyAsync','Profile','verbose','access_token','Profile\x20Credentials','INFO','profile','site','Global','profile:\x20','profiles','database','session','sessionId','globalCredentials','readFileSync','existsSync','log','us01','loadGlobalConfig','llm_project','14123930oYdmHa','Session','[configuration\x20files]','695AYrBRb','activeProfile','cliFlags','workflowProject','project','green','segmentPath','not\x20set','bold','config','profileSource','7lyExhh','configFiles','assign','11XYtAIj','accessToken','default','1275672XYvita','1380589TiwkNZ','llm_agent','1480656LDfyId','(session:\x20','dim','16zWOAWI','sessions','tdx.json','injectIntoOptions','Global\x20Credentials','(active)','llmProject','43058StMnRE','parent_segment','llmAgent','.env','global'];a59_0x55df=function(){return _0x2a03d0;};return a59_0x55df();}import*as a59_0x3dee48 from'node:path';import a59_0x14f5a0 from'chalk';export class GlobalContext{[a59_0x4ffc4a(0x136)];[a59_0x4ffc4a(0x13a)];[a59_0x4ffc4a(0x166)];[a59_0x4ffc4a(0x172)];[a59_0x4ffc4a(0x143)];[a59_0x4ffc4a(0x15a)];[a59_0x4ffc4a(0x17c)];[a59_0x4ffc4a(0x16c)];[a59_0x4ffc4a(0x156)];[a59_0x4ffc4a(0x175)];['verbose'];['logLevel'];['profile'];['profileSource']=null;['layers'];[a59_0x4ffc4a(0x148)];[a59_0x4ffc4a(0x13c)];['configFiles'];constructor(_0x29b702){const _0x37d789=a59_0x4ffc4a;this['sessionId']=getSessionID(_0x29b702[_0x37d789(0x13b)]);const _0xb89991=loadSessionContext(_0x29b702[_0x37d789(0x13b)]),_0x80d502=loadProjectConfig(),_0x3a0d0d=this[_0x37d789(0x142)]();if(_0x29b702['profile'])this[_0x37d789(0x148)]=_0x29b702[_0x37d789(0x135)],this[_0x37d789(0x151)]=_0x37d789(0x174);else{if(_0xb89991?.['profile'])this[_0x37d789(0x148)]=_0xb89991[_0x37d789(0x135)],this[_0x37d789(0x151)]='session';else{if(_0x3a0d0d['profile'])this[_0x37d789(0x148)]=_0x3a0d0d[_0x37d789(0x135)],this['profileSource']='config';else process.env.TDX_PROFILE?(this[_0x37d789(0x148)]=process.env.TDX_PROFILE,this[_0x37d789(0x151)]=_0x37d789(0x183)):(this[_0x37d789(0x148)]=null,this[_0x37d789(0x151)]=null);}}const _0x3812be=this['activeProfile']?loadProfile(this[_0x37d789(0x148)]):null,_0x2bf0a2=_0x5cfe5b=>{const _0x3d6d24=_0x37d789;if(!_0x5cfe5b)return{};const _0x31ab9c=_0x5cfe5b,_0x43cba5={};for(const [_0xd07be8,_0x52a8b9]of Object[_0x3d6d24(0x17f)](_0x31ab9c)){typeof _0x52a8b9===_0x3d6d24(0x180)&&(_0x43cba5[_0xd07be8]=_0x52a8b9);}return _0x43cba5;},_0x30b10b={},_0x2229a8=(_0x3752d7,_0x47feba,_0x3e55f0)=>{const _0x44a6a0=_0x37d789;if(!_0x3752d7)return![];if(_0x3e55f0&&_0x3752d7===_0x3e55f0)return![];const _0x334cf4=_0xb89991,_0x357ee0=_0x80d502,_0x1efebc=_0x3812be?.[_0x44a6a0(0x150)],_0x342286=_0x3a0d0d,_0x2a4333=_0x334cf4?.[_0x47feba],_0x26318d=_0x357ee0?.[_0x47feba],_0x4ee04b=_0x1efebc?.[_0x47feba],_0x334868=_0x342286[_0x47feba];return _0x3752d7!==_0x2a4333&&_0x3752d7!==_0x26318d&&_0x3752d7!==_0x4ee04b&&_0x3752d7!==_0x334868;},_0x18c3e8=[{'optionKey':_0x37d789(0x136),'contextKey':'site','defaultValue':'us01'},{'optionKey':_0x37d789(0x13a),'contextKey':_0x37d789(0x13a)},{'optionKey':_0x37d789(0x181),'contextKey':_0x37d789(0x166)},{'optionKey':_0x37d789(0x164),'contextKey':_0x37d789(0x143)},{'optionKey':_0x37d789(0x167),'contextKey':'llm_agent'},{'optionKey':_0x37d789(0x135),'contextKey':_0x37d789(0x135)}];for(const {optionKey:_0x3d263a,contextKey:_0x5c39b2,defaultValue:_0x3f3a69}of _0x18c3e8){const _0x590391=_0x29b702[_0x3d263a];_0x2229a8(_0x590391,_0x5c39b2,_0x3f3a69)&&(_0x30b10b[_0x5c39b2]=_0x590391);}this[_0x37d789(0x16b)]={'cliFlags':_0x30b10b,'session':_0x2bf0a2(_0xb89991),'project':_0x2bf0a2(_0x80d502),'profile':_0x2bf0a2(_0x3812be?.[_0x37d789(0x150)]),'global':_0x2bf0a2(_0x3a0d0d)};const _0x1f5685={...this[_0x37d789(0x16b)][_0x37d789(0x169)],...this[_0x37d789(0x16b)][_0x37d789(0x135)],...this['layers'][_0x37d789(0x14b)]};process.env.TDX_SITE&&!this[_0x37d789(0x16b)][_0x37d789(0x13b)][_0x37d789(0x136)]&&!this['layers'][_0x37d789(0x149)][_0x37d789(0x136)]&&(_0x1f5685[_0x37d789(0x136)]=process.env.TDX_SITE);Object[_0x37d789(0x154)](_0x1f5685,this['layers'][_0x37d789(0x13b)]),Object[_0x37d789(0x154)](_0x1f5685,this[_0x37d789(0x16b)][_0x37d789(0x149)]);const _0x1a2020=_0x1f5685[_0x37d789(0x136)]||_0x37d789(0x141);this['site']=resolveSite(_0x1a2020),this[_0x37d789(0x13a)]=_0x1f5685['database'],this[_0x37d789(0x166)]=_0x1f5685[_0x37d789(0x166)],this['segment_path']=_0x1f5685[_0x37d789(0x172)],this[_0x37d789(0x143)]=_0x1f5685[_0x37d789(0x143)],this[_0x37d789(0x15a)]=_0x1f5685['llm_agent'],this[_0x37d789(0x17c)]=_0x1f5685[_0x37d789(0x17c)],this[_0x37d789(0x187)]=_0x29b702['verbose']||![],this[_0x37d789(0x173)]=_0x29b702[_0x37d789(0x173)]??LogLevel[_0x37d789(0x18a)],this['profile']=this[_0x37d789(0x148)]||undefined,this[_0x37d789(0x156)]=getAccessToken(this['activeProfile']||undefined),this[_0x37d789(0x16c)]=getAPIKey(this[_0x37d789(0x148)]||undefined);const _0x573f05=typeof _0x3a0d0d[_0x37d789(0x175)]==='string'?_0x3a0d0d[_0x37d789(0x175)]:undefined;this[_0x37d789(0x175)]=_0x573f05||process.env.HTTPS_PROXY||process.env.HTTP_PROXY;const _0xb7437b=getConfigDir(),_0x108463=a59_0x3dee48[_0x37d789(0x16e)](_0xb7437b,_0x37d789(0x15f),this[_0x37d789(0x13c)]+'.json'),_0x3e3c05=findProjectConfigPath(),_0x1d9ee7=a59_0x3dee48[_0x37d789(0x16e)](_0xb7437b,'tdx.json'),_0x292fe2=a59_0x3dee48[_0x37d789(0x16e)](_0xb7437b,_0x37d789(0x168));let _0x4488f2=null,_0x39e133=null;this[_0x37d789(0x148)]&&(_0x4488f2=a59_0x3dee48[_0x37d789(0x16e)](_0xb7437b,_0x37d789(0x139),this[_0x37d789(0x148)],_0x37d789(0x160)),_0x39e133=a59_0x3dee48['join'](_0xb7437b,_0x37d789(0x139),this[_0x37d789(0x148)],'.env')),this['configFiles']={'session':a59_0xe5a51b[_0x37d789(0x13f)](_0x108463)?_0x108463:null,'project':_0x3e3c05,'profile':_0x4488f2&&a59_0xe5a51b[_0x37d789(0x13f)](_0x4488f2)?_0x4488f2:null,'profileCredentials':_0x39e133&&a59_0xe5a51b[_0x37d789(0x13f)](_0x39e133)?_0x39e133:null,'global':a59_0xe5a51b[_0x37d789(0x13f)](_0x1d9ee7)?_0x1d9ee7:null,'globalCredentials':a59_0xe5a51b['existsSync'](_0x292fe2)?_0x292fe2:null};}[a59_0x4ffc4a(0x17e)](_0x1dd6a1,_0x2912ec){const _0x3c14e2=a59_0x4ffc4a;if(!_0x2912ec)return _0x3c14e2(0x14e);const _0x2c5bb0=_0x2912ec;if(this['layers']['cliFlags'][_0x1dd6a1]===_0x2c5bb0){if(_0x1dd6a1===_0x3c14e2(0x136)&&_0x2c5bb0===_0x3c14e2(0x141)&&!this[_0x3c14e2(0x16b)][_0x3c14e2(0x13b)]['site']&&!this[_0x3c14e2(0x16b)][_0x3c14e2(0x14b)][_0x3c14e2(0x136)]&&!this[_0x3c14e2(0x16b)][_0x3c14e2(0x135)][_0x3c14e2(0x136)]&&!this[_0x3c14e2(0x16b)][_0x3c14e2(0x169)][_0x3c14e2(0x136)])return _0x3c14e2(0x157);return'CLI\x20flag:\x20--'+_0x1dd6a1[_0x3c14e2(0x17a)](/_/g,'-');}if(this[_0x3c14e2(0x16b)][_0x3c14e2(0x13b)][_0x1dd6a1]===_0x2c5bb0)return _0x3c14e2(0x13b);if(this[_0x3c14e2(0x16b)]['project'][_0x1dd6a1]===_0x2c5bb0)return'project';if(this[_0x3c14e2(0x16b)][_0x3c14e2(0x135)][_0x1dd6a1]===_0x2c5bb0)return _0x3c14e2(0x138)+this[_0x3c14e2(0x148)];if(this[_0x3c14e2(0x16b)][_0x3c14e2(0x169)][_0x1dd6a1]===_0x2c5bb0)return _0x3c14e2(0x169);return'default';}[a59_0x4ffc4a(0x142)](){const _0x18a1f9=a59_0x4ffc4a,_0x3337a7=a59_0x3dee48['join'](getConfigDir(),_0x18a1f9(0x160));if(!a59_0xe5a51b[_0x18a1f9(0x13f)](_0x3337a7))return{};try{const _0x42ad8e=a59_0xe5a51b[_0x18a1f9(0x13e)](_0x3337a7,_0x18a1f9(0x16d));return JSON[_0x18a1f9(0x179)](_0x42ad8e);}catch{return{};}}[a59_0x4ffc4a(0x161)](_0xfb0747){const _0x420512=a59_0x4ffc4a;_0xfb0747['site']=this[_0x420512(0x136)],!_0xfb0747[_0x420512(0x13a)]&&this[_0x420512(0x13a)]&&(_0xfb0747[_0x420512(0x13a)]=this[_0x420512(0x13a)]),!_0xfb0747[_0x420512(0x181)]&&this[_0x420512(0x166)]&&(_0xfb0747[_0x420512(0x181)]=this[_0x420512(0x166)]),!_0xfb0747[_0x420512(0x14d)]&&this[_0x420512(0x172)]&&(_0xfb0747[_0x420512(0x14d)]=this[_0x420512(0x172)]),!_0xfb0747['llmProject']&&this[_0x420512(0x143)]&&(_0xfb0747['llmProject']=this['llm_project']),!_0xfb0747[_0x420512(0x167)]&&this[_0x420512(0x15a)]&&(_0xfb0747[_0x420512(0x167)]=this['llm_agent']),!_0xfb0747[_0x420512(0x14a)]&&this['workflow_project']&&(_0xfb0747['workflowProject']=this[_0x420512(0x17c)]);}[a59_0x4ffc4a(0x176)](){const _0x21d449=a59_0x4ffc4a;return[{'key':_0x21d449(0x136),'value':this[_0x21d449(0x136)]},{'key':_0x21d449(0x13a),'value':this[_0x21d449(0x13a)]},{'key':'parent_segment','value':this[_0x21d449(0x166)]},{'key':'segment_path','value':this[_0x21d449(0x172)]},{'key':_0x21d449(0x143),'value':this[_0x21d449(0x143)]},{'key':_0x21d449(0x15a),'value':this[_0x21d449(0x15a)]},{'key':_0x21d449(0x17c),'value':this[_0x21d449(0x17c)]},{'key':_0x21d449(0x135),'value':this[_0x21d449(0x148)]||undefined}];}['display'](){const _0x3e9207=a59_0x4ffc4a;console[_0x3e9207(0x140)](a59_0x14f5a0['bold']('[context]'));for(const {key:_0x4a75db,value:_0x446063}of this[_0x3e9207(0x176)]()){_0x446063&&console['log'](a59_0x14f5a0['cyan'](_0x4a75db)+':\x20'+_0x446063);}}[a59_0x4ffc4a(0x171)](){const _0x108e95=a59_0x4ffc4a;console[_0x108e95(0x140)](a59_0x14f5a0[_0x108e95(0x14f)](_0x108e95(0x16f)));for(const {key:_0x589fbf,value:_0x649653}of this[_0x108e95(0x176)]()){if(_0x649653){const _0x1bacab=_0x589fbf===_0x108e95(0x135)?_0x108e95(0x163):'('+this[_0x108e95(0x17e)](_0x589fbf,_0x649653)+')';console[_0x108e95(0x140)](a59_0x14f5a0['cyan'](_0x589fbf)+':\x20'+_0x649653+'\x20'+a59_0x14f5a0[_0x108e95(0x15d)](_0x1bacab));}}console[_0x108e95(0x140)]('\x0a'+a59_0x14f5a0[_0x108e95(0x14f)](_0x108e95(0x146)));const _0x455eb0=[{'label':_0x108e95(0x145),'path':this[_0x108e95(0x153)][_0x108e95(0x13b)],'extra':_0x108e95(0x15c)+this[_0x108e95(0x13c)]+')'},{'label':_0x108e95(0x182),'path':this[_0x108e95(0x153)][_0x108e95(0x14b)]},{'label':_0x108e95(0x186),'path':this['configFiles'][_0x108e95(0x135)]},{'label':_0x108e95(0x189),'path':this[_0x108e95(0x153)][_0x108e95(0x178)]},{'label':_0x108e95(0x137),'path':this[_0x108e95(0x153)][_0x108e95(0x169)]},{'label':_0x108e95(0x162),'path':this[_0x108e95(0x153)][_0x108e95(0x13d)]}];for(const {label:_0x2c9eaa,path:_0x1b47e5,extra:_0x1d8232}of _0x455eb0){if(_0x1b47e5)console['log'](a59_0x14f5a0[_0x108e95(0x17d)](_0x2c9eaa)+':\x20'+_0x1b47e5+'\x20'+a59_0x14f5a0[_0x108e95(0x14c)]('✓')+(_0x1d8232?'\x20'+a59_0x14f5a0[_0x108e95(0x15d)](_0x1d8232):''));else{if(_0x2c9eaa===_0x108e95(0x145))console[_0x108e95(0x140)](a59_0x14f5a0['cyan'](_0x2c9eaa)+':\x20'+a59_0x14f5a0[_0x108e95(0x15d)](_0x108e95(0x184))+'\x20'+a59_0x14f5a0[_0x108e95(0x15d)](_0x108e95(0x177)+this['sessionId']+')'));else(_0x2c9eaa===_0x108e95(0x182)||_0x2c9eaa==='Global')&&console[_0x108e95(0x140)](a59_0x14f5a0[_0x108e95(0x17d)](_0x2c9eaa)+':\x20'+a59_0x14f5a0[_0x108e95(0x15d)](_0x108e95(0x184)));}}}async['resolveAPIKeyAsync'](){const _0x4d05e9=a59_0x4ffc4a;if(!this[_0x4d05e9(0x156)]){const _0x13e30f=await getOAuthTokens(this['activeProfile']||undefined);if(_0x13e30f)return this['accessToken']=_0x13e30f[_0x4d05e9(0x188)],undefined;}return this[_0x4d05e9(0x16c)]=await getAPIKeyAsync(this[_0x4d05e9(0x136)],this[_0x4d05e9(0x148)]||undefined),this['apiKey'];}static async[a59_0x4ffc4a(0x16a)](_0x5c71f2){const _0x5a3efb=a59_0x4ffc4a,_0x3c09b9=new GlobalContext(_0x5c71f2);return await _0x3c09b9[_0x5a3efb(0x185)](),_0x3c09b9;}}
1
+ const a59_0x37dbb2=a59_0x1e29;(function(_0x54d404,_0x48a3eb){const _0x43d5b1=a59_0x1e29,_0x42f5b4=_0x54d404();while(!![]){try{const _0x52a2f8=-parseInt(_0x43d5b1(0x1ec))/0x1*(-parseInt(_0x43d5b1(0x1d0))/0x2)+-parseInt(_0x43d5b1(0x1e2))/0x3+parseInt(_0x43d5b1(0x217))/0x4*(parseInt(_0x43d5b1(0x1e5))/0x5)+-parseInt(_0x43d5b1(0x1f0))/0x6*(parseInt(_0x43d5b1(0x210))/0x7)+parseInt(_0x43d5b1(0x20f))/0x8+-parseInt(_0x43d5b1(0x218))/0x9+-parseInt(_0x43d5b1(0x1e0))/0xa*(-parseInt(_0x43d5b1(0x220))/0xb);if(_0x52a2f8===_0x48a3eb)break;else _0x42f5b4['push'](_0x42f5b4['shift']());}catch(_0x37f836){_0x42f5b4['push'](_0x42f5b4['shift']());}}}(a59_0x4de7,0x44a70));import{resolveSite,getAPIKey,getAccessToken,getAPIKeyAsync,getConfigDir}from'./config.js';import{getOAuthTokens}from'./oauth-keychain.js';function a59_0x4de7(){const _0x3f94ea=['global','cli','log','workflow_project','[configuration\x20files]','assign','llmAgent','dim','none','profiles','utf-8','verbose','sessionId','globalCredentials','apiKey','project','activeProfile','accessToken','displayWithSources','[context]','llm_project','Global','proxy','workflowProject','cyan','segment_path','INFO','green','parent_segment','site','3709736UqHRRv','126QUPpgO','logLevel','getSource','getParameters','(active)','config','bold','4gmvBzR','4441770ZmKKgo','Profile\x20Credentials','llmProject','(session:\x20','Profile','string','tdx.json','layers','1490786jdGQFF','loadGlobalConfig','13534BzrDrR','display','not\x20set','cliFlags','parentSegment','default','.json','createAsync','resolveAPIKeyAsync','(using\x20session:\x20','injectIntoOptions','database','session','profile','join','Global\x20Credentials','60sGiwJn','readFileSync','1021686rJqYrb','replace','access_token','1360910TuvaOh','Project','existsSync','profileSource','CLI\x20flag:\x20--','segmentPath','entries','17zmHVDS','us01','llm_agent','configFiles','182934ouqCno'];a59_0x4de7=function(){return _0x3f94ea;};return a59_0x4de7();}import{loadSessionContext,getSessionID}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';import{loadProfile}from'./profile.js';import{LogLevel}from'../utils/logger/index.js';import*as a59_0x1c0e83 from'node:fs';function a59_0x1e29(_0x18eee7,_0x555936){_0x18eee7=_0x18eee7-0x1cf;const _0x4de7a3=a59_0x4de7();let _0x1e29a6=_0x4de7a3[_0x18eee7];return _0x1e29a6;}import*as a59_0x250027 from'node:path';import a59_0x4e14be from'chalk';export class GlobalContext{[a59_0x37dbb2(0x20e)];['database'];[a59_0x37dbb2(0x20d)];[a59_0x37dbb2(0x20a)];[a59_0x37dbb2(0x205)];[a59_0x37dbb2(0x1ee)];[a59_0x37dbb2(0x1f4)];[a59_0x37dbb2(0x1ff)];[a59_0x37dbb2(0x202)];['proxy'];[a59_0x37dbb2(0x1fc)];[a59_0x37dbb2(0x211)];['profile'];[a59_0x37dbb2(0x1e8)]=null;[a59_0x37dbb2(0x21f)];[a59_0x37dbb2(0x201)];['sessionId'];[a59_0x37dbb2(0x1ef)];constructor(_0x2f0598){const _0x33654f=a59_0x37dbb2;this[_0x33654f(0x1fd)]=getSessionID(_0x2f0598[_0x33654f(0x1dc)]);const _0x519815=loadSessionContext(_0x2f0598[_0x33654f(0x1dc)]),_0x25f6fb=loadProjectConfig(),_0x713a43=this['loadGlobalConfig']();if(_0x2f0598[_0x33654f(0x1dd)])this['activeProfile']=_0x2f0598[_0x33654f(0x1dd)],this[_0x33654f(0x1e8)]=_0x33654f(0x1f2);else{if(_0x519815?.[_0x33654f(0x1dd)])this[_0x33654f(0x201)]=_0x519815[_0x33654f(0x1dd)],this['profileSource']=_0x33654f(0x1dc);else{if(_0x713a43[_0x33654f(0x1dd)])this[_0x33654f(0x201)]=_0x713a43[_0x33654f(0x1dd)],this[_0x33654f(0x1e8)]='config';else process.env.TDX_PROFILE?(this['activeProfile']=process.env.TDX_PROFILE,this[_0x33654f(0x1e8)]='env'):(this['activeProfile']=null,this[_0x33654f(0x1e8)]=null);}}const _0x28eafa=this[_0x33654f(0x201)]?loadProfile(this[_0x33654f(0x201)]):null,_0x2d0c49=_0x32f384=>{const _0x2dd916=_0x33654f;if(!_0x32f384)return{};const _0x30a5c3=_0x32f384,_0x25fa66={};for(const [_0x29eaad,_0x12a750]of Object[_0x2dd916(0x1eb)](_0x30a5c3)){typeof _0x12a750==='string'&&(_0x25fa66[_0x29eaad]=_0x12a750);}return _0x25fa66;},_0x3e4647={},_0x4a52e6=(_0x34db85,_0x410273,_0x1945ae)=>{const _0x32e7e0=_0x33654f;if(!_0x34db85)return![];if(_0x1945ae&&_0x34db85===_0x1945ae)return![];const _0x1c9fee=_0x519815,_0x7d7d87=_0x25f6fb,_0x48408c=_0x28eafa?.[_0x32e7e0(0x215)],_0x1fa983=_0x713a43,_0x2c1739=_0x1c9fee?.[_0x410273],_0x5b4201=_0x7d7d87?.[_0x410273],_0x2aaf98=_0x48408c?.[_0x410273],_0x3e25be=_0x1fa983[_0x410273];return _0x34db85!==_0x2c1739&&_0x34db85!==_0x5b4201&&_0x34db85!==_0x2aaf98&&_0x34db85!==_0x3e25be;},_0x2d3ef4=[{'optionKey':_0x33654f(0x20e),'contextKey':'site','defaultValue':_0x33654f(0x1ed)},{'optionKey':_0x33654f(0x1db),'contextKey':_0x33654f(0x1db)},{'optionKey':_0x33654f(0x1d4),'contextKey':_0x33654f(0x20d)},{'optionKey':'llmProject','contextKey':_0x33654f(0x205)},{'optionKey':_0x33654f(0x1f7),'contextKey':_0x33654f(0x1ee)},{'optionKey':_0x33654f(0x1dd),'contextKey':_0x33654f(0x1dd)}];for(const {optionKey:_0x155f29,contextKey:_0xa470f4,defaultValue:_0x3c0689}of _0x2d3ef4){const _0x2775fd=_0x2f0598[_0x155f29];_0x4a52e6(_0x2775fd,_0xa470f4,_0x3c0689)&&(_0x3e4647[_0xa470f4]=_0x2775fd);}this['layers']={'cliFlags':_0x3e4647,'session':_0x2d0c49(_0x519815),'project':_0x2d0c49(_0x25f6fb),'profile':_0x2d0c49(_0x28eafa?.[_0x33654f(0x215)]),'global':_0x2d0c49(_0x713a43)};const _0x2864a9={...this[_0x33654f(0x21f)][_0x33654f(0x1f1)],...this[_0x33654f(0x21f)][_0x33654f(0x1dd)],...this[_0x33654f(0x21f)]['project']};process.env.TDX_SITE&&!this[_0x33654f(0x21f)]['session']['site']&&!this['layers']['cliFlags'][_0x33654f(0x20e)]&&(_0x2864a9['site']=process.env.TDX_SITE);Object[_0x33654f(0x1f6)](_0x2864a9,this['layers'][_0x33654f(0x1dc)]),Object[_0x33654f(0x1f6)](_0x2864a9,this['layers'][_0x33654f(0x1d3)]);const _0x24de26=_0x2864a9[_0x33654f(0x20e)]||_0x33654f(0x1ed);this['site']=resolveSite(_0x24de26),this['database']=_0x2864a9[_0x33654f(0x1db)],this[_0x33654f(0x20d)]=_0x2864a9[_0x33654f(0x20d)],this[_0x33654f(0x20a)]=_0x2864a9[_0x33654f(0x20a)],this[_0x33654f(0x205)]=_0x2864a9[_0x33654f(0x205)],this[_0x33654f(0x1ee)]=_0x2864a9[_0x33654f(0x1ee)],this[_0x33654f(0x1f4)]=_0x2864a9[_0x33654f(0x1f4)],this[_0x33654f(0x1fc)]=_0x2f0598['verbose']||![],this[_0x33654f(0x211)]=_0x2f0598[_0x33654f(0x211)]??LogLevel[_0x33654f(0x20b)],this[_0x33654f(0x1dd)]=this['activeProfile']||undefined,this[_0x33654f(0x202)]=getAccessToken(this[_0x33654f(0x201)]||undefined),this[_0x33654f(0x1ff)]=getAPIKey(this[_0x33654f(0x201)]||undefined);const _0x62293c=typeof _0x713a43[_0x33654f(0x207)]===_0x33654f(0x21d)?_0x713a43[_0x33654f(0x207)]:undefined;this['proxy']=_0x62293c||process.env.HTTPS_PROXY||process.env.HTTP_PROXY;const _0x26175e=getConfigDir(),_0x1bcbda=a59_0x250027[_0x33654f(0x1de)](_0x26175e,'sessions',this['sessionId']+_0x33654f(0x1d6)),_0x133047=findProjectConfigPath(),_0x2b889d=a59_0x250027[_0x33654f(0x1de)](_0x26175e,_0x33654f(0x21e)),_0x5f03c0=a59_0x250027[_0x33654f(0x1de)](_0x26175e,'.env');let _0x5eea0c=null,_0x468b3d=null;this[_0x33654f(0x201)]&&(_0x5eea0c=a59_0x250027[_0x33654f(0x1de)](_0x26175e,'profiles',this[_0x33654f(0x201)],_0x33654f(0x21e)),_0x468b3d=a59_0x250027[_0x33654f(0x1de)](_0x26175e,_0x33654f(0x1fa),this[_0x33654f(0x201)],'.env')),this['configFiles']={'session':a59_0x1c0e83[_0x33654f(0x1e7)](_0x1bcbda)?_0x1bcbda:null,'project':_0x133047,'profile':_0x5eea0c&&a59_0x1c0e83[_0x33654f(0x1e7)](_0x5eea0c)?_0x5eea0c:null,'profileCredentials':_0x468b3d&&a59_0x1c0e83['existsSync'](_0x468b3d)?_0x468b3d:null,'global':a59_0x1c0e83['existsSync'](_0x2b889d)?_0x2b889d:null,'globalCredentials':a59_0x1c0e83[_0x33654f(0x1e7)](_0x5f03c0)?_0x5f03c0:null};}[a59_0x37dbb2(0x212)](_0x337c10,_0x4fd006){const _0x7ea1f=a59_0x37dbb2;if(!_0x4fd006)return _0x7ea1f(0x1d2);const _0x1ff6c7=_0x4fd006;if(this[_0x7ea1f(0x21f)][_0x7ea1f(0x1d3)][_0x337c10]===_0x1ff6c7){if(_0x337c10==='site'&&_0x1ff6c7===_0x7ea1f(0x1ed)&&!this['layers'][_0x7ea1f(0x1dc)][_0x7ea1f(0x20e)]&&!this['layers']['project'][_0x7ea1f(0x20e)]&&!this[_0x7ea1f(0x21f)][_0x7ea1f(0x1dd)][_0x7ea1f(0x20e)]&&!this['layers'][_0x7ea1f(0x1f1)]['site'])return'default';return _0x7ea1f(0x1e9)+_0x337c10[_0x7ea1f(0x1e3)](/_/g,'-');}if(this['layers'][_0x7ea1f(0x1dc)][_0x337c10]===_0x1ff6c7)return'session';if(this[_0x7ea1f(0x21f)][_0x7ea1f(0x200)][_0x337c10]===_0x1ff6c7)return'project';if(this[_0x7ea1f(0x21f)][_0x7ea1f(0x1dd)][_0x337c10]===_0x1ff6c7)return'profile:\x20'+this[_0x7ea1f(0x201)];if(this[_0x7ea1f(0x21f)]['global'][_0x337c10]===_0x1ff6c7)return _0x7ea1f(0x1f1);return _0x7ea1f(0x1d5);}[a59_0x37dbb2(0x1cf)](){const _0x59bd9f=a59_0x37dbb2,_0x234f30=a59_0x250027[_0x59bd9f(0x1de)](getConfigDir(),'tdx.json');if(!a59_0x1c0e83[_0x59bd9f(0x1e7)](_0x234f30))return{};try{const _0x55a0cf=a59_0x1c0e83[_0x59bd9f(0x1e1)](_0x234f30,_0x59bd9f(0x1fb));return JSON['parse'](_0x55a0cf);}catch{return{};}}[a59_0x37dbb2(0x1da)](_0xa7322d){const _0x539db5=a59_0x37dbb2;_0xa7322d[_0x539db5(0x20e)]=this['site'],!_0xa7322d[_0x539db5(0x1db)]&&this['database']&&(_0xa7322d['database']=this['database']),!_0xa7322d[_0x539db5(0x1d4)]&&this['parent_segment']&&(_0xa7322d[_0x539db5(0x1d4)]=this['parent_segment']),!_0xa7322d[_0x539db5(0x1ea)]&&this[_0x539db5(0x20a)]&&(_0xa7322d[_0x539db5(0x1ea)]=this[_0x539db5(0x20a)]),!_0xa7322d[_0x539db5(0x21a)]&&this[_0x539db5(0x205)]&&(_0xa7322d['llmProject']=this[_0x539db5(0x205)]),!_0xa7322d[_0x539db5(0x1f7)]&&this['llm_agent']&&(_0xa7322d[_0x539db5(0x1f7)]=this[_0x539db5(0x1ee)]),!_0xa7322d['workflowProject']&&this[_0x539db5(0x1f4)]&&(_0xa7322d[_0x539db5(0x208)]=this[_0x539db5(0x1f4)]);}['getParameters'](){const _0x2de38f=a59_0x37dbb2;return[{'key':'site','value':this[_0x2de38f(0x20e)]},{'key':_0x2de38f(0x1db),'value':this[_0x2de38f(0x1db)]},{'key':_0x2de38f(0x20d),'value':this['parent_segment']},{'key':_0x2de38f(0x20a),'value':this[_0x2de38f(0x20a)]},{'key':_0x2de38f(0x205),'value':this[_0x2de38f(0x205)]},{'key':_0x2de38f(0x1ee),'value':this['llm_agent']},{'key':_0x2de38f(0x1f4),'value':this[_0x2de38f(0x1f4)]},{'key':_0x2de38f(0x1dd),'value':this[_0x2de38f(0x201)]||undefined}];}[a59_0x37dbb2(0x1d1)](){const _0x3231eb=a59_0x37dbb2;console[_0x3231eb(0x1f3)](a59_0x4e14be[_0x3231eb(0x216)](_0x3231eb(0x204)));for(const {key:_0x382188,value:_0x301763}of this[_0x3231eb(0x213)]()){_0x301763&&console[_0x3231eb(0x1f3)](a59_0x4e14be['cyan'](_0x382188)+':\x20'+_0x301763);}}[a59_0x37dbb2(0x203)](){const _0x212a50=a59_0x37dbb2;console[_0x212a50(0x1f3)](a59_0x4e14be[_0x212a50(0x216)](_0x212a50(0x204)));for(const {key:_0x173339,value:_0x404f7d}of this[_0x212a50(0x213)]()){if(_0x404f7d){const _0x2a2756=_0x173339===_0x212a50(0x1dd)?_0x212a50(0x214):'('+this[_0x212a50(0x212)](_0x173339,_0x404f7d)+')';console[_0x212a50(0x1f3)](a59_0x4e14be[_0x212a50(0x209)](_0x173339)+':\x20'+_0x404f7d+'\x20'+a59_0x4e14be[_0x212a50(0x1f8)](_0x2a2756));}}console[_0x212a50(0x1f3)]('\x0a'+a59_0x4e14be[_0x212a50(0x216)](_0x212a50(0x1f5)));const _0xab1516=[{'label':'Session','path':this[_0x212a50(0x1ef)][_0x212a50(0x1dc)],'extra':_0x212a50(0x21b)+this[_0x212a50(0x1fd)]+')'},{'label':_0x212a50(0x1e6),'path':this[_0x212a50(0x1ef)][_0x212a50(0x200)]},{'label':_0x212a50(0x21c),'path':this[_0x212a50(0x1ef)][_0x212a50(0x1dd)]},{'label':_0x212a50(0x219),'path':this['configFiles']['profileCredentials']},{'label':_0x212a50(0x206),'path':this[_0x212a50(0x1ef)][_0x212a50(0x1f1)]},{'label':_0x212a50(0x1df),'path':this[_0x212a50(0x1ef)][_0x212a50(0x1fe)]}];for(const {label:_0x5c2031,path:_0x41d339,extra:_0x56368c}of _0xab1516){if(_0x41d339)console[_0x212a50(0x1f3)](a59_0x4e14be[_0x212a50(0x209)](_0x5c2031)+':\x20'+_0x41d339+'\x20'+a59_0x4e14be[_0x212a50(0x20c)]('✓')+(_0x56368c?'\x20'+a59_0x4e14be[_0x212a50(0x1f8)](_0x56368c):''));else{if(_0x5c2031==='Session')console[_0x212a50(0x1f3)](a59_0x4e14be[_0x212a50(0x209)](_0x5c2031)+':\x20'+a59_0x4e14be[_0x212a50(0x1f8)](_0x212a50(0x1f9))+'\x20'+a59_0x4e14be['dim'](_0x212a50(0x1d9)+this[_0x212a50(0x1fd)]+')'));else(_0x5c2031===_0x212a50(0x1e6)||_0x5c2031===_0x212a50(0x206))&&console[_0x212a50(0x1f3)](a59_0x4e14be[_0x212a50(0x209)](_0x5c2031)+':\x20'+a59_0x4e14be['dim'](_0x212a50(0x1f9)));}}}async[a59_0x37dbb2(0x1d8)](){const _0x2d341a=a59_0x37dbb2;if(!this['accessToken']){const _0x14e6a6=await getOAuthTokens(this[_0x2d341a(0x201)]||undefined);if(_0x14e6a6)return this[_0x2d341a(0x202)]=_0x14e6a6[_0x2d341a(0x1e4)],undefined;}return this['apiKey']=await getAPIKeyAsync(this[_0x2d341a(0x20e)],this[_0x2d341a(0x201)]||undefined),this['apiKey'];}static async[a59_0x37dbb2(0x1d7)](_0x179fcf){const _0x2bee10=new GlobalContext(_0x179fcf);return await _0x2bee10['resolveAPIKeyAsync'](),_0x2bee10;}}
@@ -1 +1 @@
1
- const a60_0x33db85=a60_0x272e;(function(_0x4c52aa,_0x57b92f){const _0x117be7=a60_0x272e,_0x8c34d7=_0x4c52aa();while(!![]){try{const _0x1983f9=parseInt(_0x117be7(0x1a6))/0x1+parseInt(_0x117be7(0x1a4))/0x2+parseInt(_0x117be7(0x1b4))/0x3*(parseInt(_0x117be7(0x1b3))/0x4)+parseInt(_0x117be7(0x1b1))/0x5+parseInt(_0x117be7(0x1ad))/0x6+parseInt(_0x117be7(0x1af))/0x7*(-parseInt(_0x117be7(0x1a1))/0x8)+parseInt(_0x117be7(0x19b))/0x9*(-parseInt(_0x117be7(0x1ae))/0xa);if(_0x1983f9===_0x57b92f)break;else _0x8c34d7['push'](_0x8c34d7['shift']());}catch(_0x2f12e1){_0x8c34d7['push'](_0x8c34d7['shift']());}}}(a60_0x57f0,0x1d295));const SERVICE_NAME=a60_0x33db85(0x1a0);let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x41ccc2=a60_0x33db85;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x39922c=await import(_0x41ccc2(0x197));return EntryClass=_0x39922c[_0x41ccc2(0x1a5)],EntryClass;}catch(_0x27619b){return keyringLoadError=_0x27619b instanceof Error?_0x27619b:new Error(String(_0x27619b)),null;}}function getAccountName(_0x7bf61a){const _0x3185d4=a60_0x33db85,_0x491dd6=_0x7bf61a||'';return'profile:'+_0x491dd6+_0x3185d4(0x1b7);}export async function getKeychainAPIKey(_0x2b81a6){const _0x4d380a=a60_0x33db85,_0x14ad8f=await getKeychainAPIKeyWithStatus(_0x2b81a6);if(_0x14ad8f[_0x4d380a(0x1a2)])return _0x14ad8f[_0x4d380a(0x198)];return _0x14ad8f[_0x4d380a(0x1ab)]===_0x4d380a(0x1a7)&&console[_0x4d380a(0x1a3)](_0x4d380a(0x196)+_0x14ad8f[_0x4d380a(0x1b2)]),null;}export async function getKeychainAPIKeyWithStatus(_0x27d53d){const _0x56e2ad=a60_0x33db85;try{const _0x1a0b50=await getEntryClass();if(!_0x1a0b50)return{'success':![],'reason':_0x56e2ad(0x19f)};const _0xe1e333=getAccountName(_0x27d53d),_0x477cb1=new _0x1a0b50(SERVICE_NAME,_0xe1e333),_0x3faf22=_0x477cb1['getPassword']();if(_0x3faf22)return{'success':!![],'value':_0x3faf22};return{'success':![],'reason':_0x56e2ad(0x199)};}catch(_0x29c79b){const _0x1c6073=_0x29c79b instanceof Error?_0x29c79b[_0x56e2ad(0x1b2)]:String(_0x29c79b);if(_0x1c6073[_0x56e2ad(0x1a9)](_0x56e2ad(0x1a8))||_0x1c6073[_0x56e2ad(0x1b0)]()[_0x56e2ad(0x1a9)](_0x56e2ad(0x1ac))||_0x1c6073[_0x56e2ad(0x1b0)]()[_0x56e2ad(0x1a9)]('not\x20found')||_0x1c6073[_0x56e2ad(0x1b0)]()[_0x56e2ad(0x1a9)](_0x56e2ad(0x19c)))return{'success':![],'reason':_0x56e2ad(0x199)};if(_0x1c6073[_0x56e2ad(0x1a9)]('-25293')||_0x1c6073[_0x56e2ad(0x1b0)]()[_0x56e2ad(0x1a9)]('restricted')||_0x1c6073['toLowerCase']()['includes'](_0x56e2ad(0x195)))return{'success':![],'reason':_0x56e2ad(0x1a7),'message':_0x56e2ad(0x1b5)};return{'success':![],'reason':_0x56e2ad(0x19f),'message':_0x1c6073};}}export async function saveKeychainAPIKey(_0xba9c68,_0x1892b6){const _0x53ce31=a60_0x33db85,_0x1a2c53=await getEntryClass();if(!_0x1a2c53)throw new Error(_0x53ce31(0x19d));const _0x2d73a8=getAccountName(_0x1892b6),_0x26a07e=new _0x1a2c53(SERVICE_NAME,_0x2d73a8);_0x26a07e['setPassword'](_0xba9c68);}export async function deleteKeychainAPIKey(_0x5b25eb){try{const _0x26272b=await getEntryClass();if(!_0x26272b)return![];const _0xe861ed=getAccountName(_0x5b25eb),_0x3bfaf0=new _0x26272b(SERVICE_NAME,_0xe861ed);return _0x3bfaf0['deleteCredential'](),!![];}catch{return![];}}function a60_0x272e(_0x51d678,_0x1e28b3){_0x51d678=_0x51d678-0x195;const _0x57f022=a60_0x57f0();let _0x272e8a=_0x57f022[_0x51d678];return _0x272e8a;}export async function isKeychainAvailable(){const _0x553a3a=a60_0x33db85;try{const _0x13b503=await getEntryClass();if(!_0x13b503)return![];const _0x4a32ec=new _0x13b503(SERVICE_NAME,'__keychain_test__');return _0x4a32ec[_0x553a3a(0x1b6)](),!![];}catch(_0xf7cbb6){const _0x2f348c=_0xf7cbb6 instanceof Error?_0xf7cbb6[_0x553a3a(0x1b2)]['toLowerCase']():'';if(_0x2f348c[_0x553a3a(0x1a9)](_0x553a3a(0x19e))||_0x2f348c[_0x553a3a(0x1a9)](_0x553a3a(0x19a))||_0x2f348c[_0x553a3a(0x1a9)](_0x553a3a(0x1aa)))return![];return!![];}}function a60_0x57f0(){const _0x5c1d2a=['cannot\x20find','reason','could\x20not\x20be\x20found','284664bDlfVZ','10peSXyf','7oeSQOy','toLowerCase','739325bHKUXG','message','253844VsXYQi','3OfXQHw','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.','getPassword',':api_key','access','Warning:\x20','@napi-rs/keyring','value','not_found','not\x20supported','2236797ErBYeV','no\x20matching\x20entry','System\x20keychain\x20is\x20not\x20available','not\x20available','unavailable','tdx','279992ibKUiR','success','error','238454gPtdtS','Entry','24980nXAqCN','access_denied','-25300','includes'];a60_0x57f0=function(){return _0x5c1d2a;};return a60_0x57f0();}
1
+ (function(_0x53a3e6,_0x20951b){const _0x38f251=a60_0x5f55,_0x502640=_0x53a3e6();while(!![]){try{const _0x30c6b3=parseInt(_0x38f251(0x12a))/0x1+-parseInt(_0x38f251(0x12b))/0x2*(parseInt(_0x38f251(0x13e))/0x3)+-parseInt(_0x38f251(0x13f))/0x4*(parseInt(_0x38f251(0x12d))/0x5)+parseInt(_0x38f251(0x140))/0x6*(parseInt(_0x38f251(0x135))/0x7)+-parseInt(_0x38f251(0x13b))/0x8+-parseInt(_0x38f251(0x141))/0x9+parseInt(_0x38f251(0x138))/0xa;if(_0x30c6b3===_0x20951b)break;else _0x502640['push'](_0x502640['shift']());}catch(_0x1e2be7){_0x502640['push'](_0x502640['shift']());}}}(a60_0x444c,0xa982e));function a60_0x5f55(_0x4a4159,_0x40bae0){_0x4a4159=_0x4a4159-0x129;const _0x444c65=a60_0x444c();let _0x5f5569=_0x444c65[_0x4a4159];return _0x5f5569;}const SERVICE_NAME='tdx';let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x11df0b=a60_0x5f55;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x199d14=await import('@napi-rs/keyring');return EntryClass=_0x199d14[_0x11df0b(0x132)],EntryClass;}catch(_0x144141){return keyringLoadError=_0x144141 instanceof Error?_0x144141:new Error(String(_0x144141)),null;}}function getAccountName(_0x3a26cb){const _0x38b908=a60_0x5f55,_0x5d60d4=_0x3a26cb||'';return _0x38b908(0x143)+_0x5d60d4+_0x38b908(0x13d);}export async function getKeychainAPIKey(_0x5e242b){const _0x5e4b9e=a60_0x5f55,_0x4c5e96=await getKeychainAPIKeyWithStatus(_0x5e242b);if(_0x4c5e96[_0x5e4b9e(0x129)])return _0x4c5e96[_0x5e4b9e(0x136)];return _0x4c5e96[_0x5e4b9e(0x130)]===_0x5e4b9e(0x13c)&&console[_0x5e4b9e(0x142)]('Warning:\x20'+_0x4c5e96[_0x5e4b9e(0x149)]),null;}export async function getKeychainAPIKeyWithStatus(_0x19cde0){const _0x55cc52=a60_0x5f55;try{const _0x23ae6b=await getEntryClass();if(!_0x23ae6b)return{'success':![],'reason':_0x55cc52(0x12e)};const _0x5a9852=getAccountName(_0x19cde0),_0x161f14=new _0x23ae6b(SERVICE_NAME,_0x5a9852),_0x59dc62=_0x161f14[_0x55cc52(0x148)]();if(_0x59dc62)return{'success':!![],'value':_0x59dc62};return{'success':![],'reason':_0x55cc52(0x145)};}catch(_0x20de50){const _0x3a3c3f=_0x20de50 instanceof Error?_0x20de50[_0x55cc52(0x149)]:String(_0x20de50);if(_0x3a3c3f[_0x55cc52(0x139)]('-25300')||_0x3a3c3f[_0x55cc52(0x131)]()[_0x55cc52(0x139)]('could\x20not\x20be\x20found')||_0x3a3c3f['toLowerCase']()[_0x55cc52(0x139)](_0x55cc52(0x133))||_0x3a3c3f[_0x55cc52(0x131)]()[_0x55cc52(0x139)](_0x55cc52(0x13a)))return{'success':![],'reason':_0x55cc52(0x145)};if(_0x3a3c3f[_0x55cc52(0x139)](_0x55cc52(0x12f))||_0x3a3c3f[_0x55cc52(0x131)]()[_0x55cc52(0x139)](_0x55cc52(0x137))||_0x3a3c3f['toLowerCase']()[_0x55cc52(0x139)](_0x55cc52(0x146)))return{'success':![],'reason':'access_denied','message':_0x55cc52(0x134)};return{'success':![],'reason':_0x55cc52(0x12e),'message':_0x3a3c3f};}}export async function saveKeychainAPIKey(_0x503e11,_0x3eea94){const _0x44988f=a60_0x5f55,_0x359f5f=await getEntryClass();if(!_0x359f5f)throw new Error(_0x44988f(0x12c));const _0x2bb2c6=getAccountName(_0x3eea94),_0x4aa2b4=new _0x359f5f(SERVICE_NAME,_0x2bb2c6);_0x4aa2b4['setPassword'](_0x503e11);}function a60_0x444c(){const _0x19ce95=['3VNcfsa','351324BwohJU','6sMMnZf','930501BBTKAE','error','profile:','__keychain_test__','not_found','access','not\x20available','getPassword','message','not\x20supported','success','1033478PTIcDn','680122MJtsLq','System\x20keychain\x20is\x20not\x20available','15giPWBq','unavailable','-25293','reason','toLowerCase','Entry','not\x20found','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.','4592364KBgtal','value','restricted','7846530smFGfQ','includes','no\x20matching\x20entry','8583376PvwMzz','access_denied',':api_key'];a60_0x444c=function(){return _0x19ce95;};return a60_0x444c();}export async function deleteKeychainAPIKey(_0x39a341){try{const _0x6952a4=await getEntryClass();if(!_0x6952a4)return![];const _0xc89afb=getAccountName(_0x39a341),_0x502c18=new _0x6952a4(SERVICE_NAME,_0xc89afb);return _0x502c18['deleteCredential'](),!![];}catch{return![];}}export async function isKeychainAvailable(){const _0x1f3d6d=a60_0x5f55;try{const _0x5f887e=await getEntryClass();if(!_0x5f887e)return![];const _0x3aa86e=new _0x5f887e(SERVICE_NAME,_0x1f3d6d(0x144));return _0x3aa86e[_0x1f3d6d(0x148)](),!![];}catch(_0x12ecb8){const _0x182b42=_0x12ecb8 instanceof Error?_0x12ecb8[_0x1f3d6d(0x149)]['toLowerCase']():'';if(_0x182b42['includes'](_0x1f3d6d(0x147))||_0x182b42[_0x1f3d6d(0x139)](_0x1f3d6d(0x14a))||_0x182b42[_0x1f3d6d(0x139)]('cannot\x20find'))return![];return!![];}}
@@ -1 +1 @@
1
- const a61_0x2846e1=a61_0x48e0;(function(_0x45705e,_0x1fc735){const _0x1d0428=a61_0x48e0,_0xfc7683=_0x45705e();while(!![]){try{const _0x396cb9=-parseInt(_0x1d0428(0xe6))/0x1*(-parseInt(_0x1d0428(0xdc))/0x2)+-parseInt(_0x1d0428(0xe7))/0x3+parseInt(_0x1d0428(0xdd))/0x4+parseInt(_0x1d0428(0xe8))/0x5*(-parseInt(_0x1d0428(0xe3))/0x6)+parseInt(_0x1d0428(0xe4))/0x7*(parseInt(_0x1d0428(0xe1))/0x8)+parseInt(_0x1d0428(0xda))/0x9+-parseInt(_0x1d0428(0xdb))/0xa;if(_0x396cb9===_0x1fc735)break;else _0xfc7683['push'](_0xfc7683['shift']());}catch(_0x272935){_0xfc7683['push'](_0xfc7683['shift']());}}}(a61_0x34c9,0x1eba8));const SERVICE_NAME=a61_0x2846e1(0xe5);let EntryClass=null,keyringLoadError=null;function a61_0x48e0(_0x44eb04,_0x4aec28){_0x44eb04=_0x44eb04-0xd8;const _0x34c970=a61_0x34c9();let _0x48e09c=_0x34c970[_0x44eb04];return _0x48e09c;}async function getEntryClass(){const _0x43b015=a61_0x2846e1;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x31e818=await import(_0x43b015(0xd8));return EntryClass=_0x31e818[_0x43b015(0xe9)],EntryClass;}catch(_0x4619aa){return keyringLoadError=_0x4619aa instanceof Error?_0x4619aa:new Error(String(_0x4619aa)),null;}}function getOAuthAccountName(_0x556a70){const _0x4283d5=a61_0x2846e1,_0x592201=_0x556a70||'';return _0x4283d5(0xde)+_0x592201+':oauth_tokens';}export async function saveOAuthTokens(_0x52cd05,_0x47f559){const _0xd3ea25=a61_0x2846e1,_0x27d67b=await getEntryClass();if(!_0x27d67b)throw new Error(_0xd3ea25(0xd9));const _0x4be7f9=getOAuthAccountName(_0x47f559),_0x3f7375=new _0x27d67b(SERVICE_NAME,_0x4be7f9);_0x3f7375['setPassword'](JSON['stringify'](_0x52cd05));}export async function getOAuthTokens(_0x2016c1){const _0x38bb5c=a61_0x2846e1;try{const _0x1c6380=await getEntryClass();if(!_0x1c6380)return null;const _0x3fc0d7=getOAuthAccountName(_0x2016c1),_0x54887b=new _0x1c6380(SERVICE_NAME,_0x3fc0d7),_0xb953a5=_0x54887b[_0x38bb5c(0xdf)]();if(_0xb953a5)return JSON[_0x38bb5c(0xe0)](_0xb953a5);return null;}catch{return null;}}export async function deleteOAuthTokens(_0x7ffa48){const _0x1ec3d1=a61_0x2846e1;try{const _0x2e20c9=await getEntryClass();if(!_0x2e20c9)return![];const _0x58d1f4=getOAuthAccountName(_0x7ffa48),_0x4f61ab=new _0x2e20c9(SERVICE_NAME,_0x58d1f4);return _0x4f61ab[_0x1ec3d1(0xe2)](),!![];}catch{return![];}}function a61_0x34c9(){const _0x55fcbb=['142101pHryyf','4910zGQGUm','Entry','@napi-rs/keyring','System\x20keychain\x20is\x20not\x20available','102096ZyOjId','3989540PeVjIS','85926ZZilnW','902008jKMIdr','profile:','getPassword','parse','176RRMwuE','deleteCredential','600YQDVGM','69594hhtGIi','tdx','5OJiLhS'];a61_0x34c9=function(){return _0x55fcbb;};return a61_0x34c9();}
1
+ function a61_0x33da(_0xc6d64e,_0x15b3a2){_0xc6d64e=_0xc6d64e-0x15a;const _0x560366=a61_0x5603();let _0x33dac7=_0x560366[_0xc6d64e];return _0x33dac7;}const a61_0x2d3b22=a61_0x33da;(function(_0x3c1f57,_0xfa802e){const _0x48ac28=a61_0x33da,_0x174dca=_0x3c1f57();while(!![]){try{const _0x378bd6=-parseInt(_0x48ac28(0x169))/0x1*(-parseInt(_0x48ac28(0x15e))/0x2)+-parseInt(_0x48ac28(0x16c))/0x3*(parseInt(_0x48ac28(0x162))/0x4)+parseInt(_0x48ac28(0x166))/0x5+parseInt(_0x48ac28(0x15c))/0x6+parseInt(_0x48ac28(0x15d))/0x7*(parseInt(_0x48ac28(0x164))/0x8)+parseInt(_0x48ac28(0x16b))/0x9*(parseInt(_0x48ac28(0x16e))/0xa)+parseInt(_0x48ac28(0x161))/0xb*(-parseInt(_0x48ac28(0x168))/0xc);if(_0x378bd6===_0xfa802e)break;else _0x174dca['push'](_0x174dca['shift']());}catch(_0x33770b){_0x174dca['push'](_0x174dca['shift']());}}}(a61_0x5603,0xb90c2));function a61_0x5603(){const _0x4acf77=['stringify','6762535PScMHc','deleteCredential','82608aFEkVl','91296kHWoSP','getPassword','397629aljuPf','24Lrxhrf',':oauth_tokens','190wWicbq','System\x20keychain\x20is\x20not\x20available','profile:','1485630Ynrllz','3398437xyyiCx','4XvMilt','@napi-rs/keyring','parse','2266HczKKd','465788IgGnQm','tdx','8PmGOhi'];a61_0x5603=function(){return _0x4acf77;};return a61_0x5603();}const SERVICE_NAME=a61_0x2d3b22(0x163);let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x212b34=a61_0x2d3b22;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x55d936=await import(_0x212b34(0x15f));return EntryClass=_0x55d936['Entry'],EntryClass;}catch(_0x4929d8){return keyringLoadError=_0x4929d8 instanceof Error?_0x4929d8:new Error(String(_0x4929d8)),null;}}function getOAuthAccountName(_0x26d610){const _0x4ec358=a61_0x2d3b22,_0x83689e=_0x26d610||'';return _0x4ec358(0x15b)+_0x83689e+_0x4ec358(0x16d);}export async function saveOAuthTokens(_0x13f190,_0x41a520){const _0x226698=a61_0x2d3b22,_0x478b5d=await getEntryClass();if(!_0x478b5d)throw new Error(_0x226698(0x15a));const _0x54f8a6=getOAuthAccountName(_0x41a520),_0x16d7ea=new _0x478b5d(SERVICE_NAME,_0x54f8a6);_0x16d7ea['setPassword'](JSON[_0x226698(0x165)](_0x13f190));}export async function getOAuthTokens(_0x724163){const _0xa803d8=a61_0x2d3b22;try{const _0x32c6eb=await getEntryClass();if(!_0x32c6eb)return null;const _0x185181=getOAuthAccountName(_0x724163),_0x451c3c=new _0x32c6eb(SERVICE_NAME,_0x185181),_0x156ee6=_0x451c3c[_0xa803d8(0x16a)]();if(_0x156ee6)return JSON[_0xa803d8(0x160)](_0x156ee6);return null;}catch{return null;}}export async function deleteOAuthTokens(_0x5a6aec){const _0x3dae13=a61_0x2d3b22;try{const _0x138f4b=await getEntryClass();if(!_0x138f4b)return![];const _0x409554=getOAuthAccountName(_0x5a6aec),_0x822c10=new _0x138f4b(SERVICE_NAME,_0x409554);return _0x822c10[_0x3dae13(0x167)](),!![];}catch{return![];}}
@@ -1 +1 @@
1
- const a62_0xf6c08d=a62_0x2e4f;function a62_0x2e4f(_0x37ad76,_0x41b308){_0x37ad76=_0x37ad76-0x92;const _0x1f2bab=a62_0x1f2b();let _0x2e4ff7=_0x1f2bab[_0x37ad76];return _0x2e4ff7;}(function(_0x46a322,_0x407b1d){const _0x591e73=a62_0x2e4f,_0x3d3961=_0x46a322();while(!![]){try{const _0x367832=parseInt(_0x591e73(0x9d))/0x1+parseInt(_0x591e73(0xb4))/0x2+parseInt(_0x591e73(0xc4))/0x3*(-parseInt(_0x591e73(0xb9))/0x4)+-parseInt(_0x591e73(0xce))/0x5+-parseInt(_0x591e73(0xb0))/0x6*(parseInt(_0x591e73(0xd1))/0x7)+parseInt(_0x591e73(0xb2))/0x8+parseInt(_0x591e73(0xcc))/0x9*(-parseInt(_0x591e73(0x95))/0xa);if(_0x367832===_0x407b1d)break;else _0x3d3961['push'](_0x3d3961['shift']());}catch(_0x301adf){_0x3d3961['push'](_0x3d3961['shift']());}}}(a62_0x1f2b,0xdb78b));import*as a62_0x38d92f from'node:crypto';import*as a62_0x1f9797 from'node:http';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';const OAUTH_SUPPORTED_SITES=new Set([a62_0xf6c08d(0xae),a62_0xf6c08d(0xd2),a62_0xf6c08d(0xca),a62_0xf6c08d(0xad),'stg-ap03']);export function isOAuthSupported(_0xc88a50){const _0x219d88=a62_0xf6c08d;return OAUTH_SUPPORTED_SITES[_0x219d88(0xb1)](_0xc88a50);}export const OAUTH_CALLBACK_PORT=0xaa4a;export const OAUTH_REDIRECT_URI=a62_0xf6c08d(0xb5)+OAUTH_CALLBACK_PORT+'/oauth/callback';export function getOAuthClientId(){const _0x51d429=a62_0xf6c08d;return process.env.TD_OAUTH_CLIENT_ID||_0x51d429(0x97);}export function generatePKCEPair(){const _0x33339f=a62_0xf6c08d,_0x149b9b=a62_0x38d92f[_0x33339f(0x9f)](0x20)['toString'](_0x33339f(0xaf)),_0x55f613=a62_0x38d92f[_0x33339f(0x9e)]('sha256')['update'](_0x149b9b)[_0x33339f(0xbf)](_0x33339f(0xaf));return{'verifier':_0x149b9b,'challenge':_0x55f613};}export function buildAuthorizeURL(_0x178c4c,_0x181b99){const _0xf480ca=a62_0xf6c08d,_0x2b25e1=new URL(_0xf480ca(0xa0),_0x178c4c);return _0x2b25e1['searchParams']['set'](_0xf480ca(0xa5),_0xf480ca(0xa4)),_0x2b25e1['searchParams'][_0xf480ca(0xba)]('client_id',_0x181b99[_0xf480ca(0xa2)]),_0x2b25e1[_0xf480ca(0x93)][_0xf480ca(0xba)](_0xf480ca(0xab),_0x181b99[_0xf480ca(0x9b)]),_0x2b25e1[_0xf480ca(0x93)][_0xf480ca(0xba)]('state',_0x181b99[_0xf480ca(0xbb)]),_0x2b25e1[_0xf480ca(0x93)]['set'](_0xf480ca(0xa6),_0x181b99[_0xf480ca(0xa3)]),_0x2b25e1['searchParams'][_0xf480ca(0xba)](_0xf480ca(0xc2),_0xf480ca(0xc0)),_0x181b99['scope']&&_0x2b25e1[_0xf480ca(0x93)][_0xf480ca(0xba)](_0xf480ca(0xc3),_0x181b99[_0xf480ca(0xc3)]),_0x2b25e1['toString']();}export async function postTokenRequest(_0x86c50d,_0x687add){const _0x2b4cfc=a62_0xf6c08d,_0x3c5256=new URLSearchParams(_0x687add)[_0x2b4cfc(0xb7)](),_0xf5567f=await fetch(_0x86c50d,{'method':_0x2b4cfc(0x98),'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x3c5256});if(!_0xf5567f['ok']){const _0x1ff13a=await _0xf5567f['text']();throw new Error(_0x2b4cfc(0xb3)+_0xf5567f[_0x2b4cfc(0xc1)]+_0x2b4cfc(0x9a)+_0x1ff13a);}return await _0xf5567f[_0x2b4cfc(0xcf)]();}export async function exchangeCodeForTokens(_0x5c3476,_0x454337,_0x424002,_0x5b22c4){const _0x33f3d0=a62_0xf6c08d,_0x1983e7=_0x5c3476+_0x33f3d0(0xc5);return postTokenRequest(_0x1983e7,{'grant_type':_0x33f3d0(0xac),'client_id':getOAuthClientId(),'code':_0x454337,'code_verifier':_0x424002,'redirect_uri':_0x5b22c4});}export function startLocalCallbackServer(){const _0x326be3=a62_0xf6c08d;let _0x315eb0,_0x26d251;const _0x1ad856=new Promise((_0x318170,_0x27bd2f)=>{_0x315eb0=_0x318170,_0x26d251=_0x27bd2f;}),_0x5bc079=a62_0x1f9797[_0x326be3(0x94)]((_0x358faf,_0xf2476f)=>{const _0x33c9cc=_0x326be3,_0x2e7df2=new URL(_0x358faf[_0x33c9cc(0xa9)]||'/',_0x33c9cc(0xc8));if(_0x2e7df2['pathname']!==_0x33c9cc(0xc6)){_0xf2476f[_0x33c9cc(0xb6)](0x194,{'Content-Type':_0x33c9cc(0xb8)}),_0xf2476f[_0x33c9cc(0xa7)](_0x33c9cc(0xbd));return;}const _0x131930=_0x2e7df2['searchParams'][_0x33c9cc(0xcd)](_0x33c9cc(0xa4)),_0x5ab23b=_0x2e7df2[_0x33c9cc(0x93)][_0x33c9cc(0xcd)](_0x33c9cc(0xbb)),_0x2dfa4a=_0x2e7df2[_0x33c9cc(0x93)][_0x33c9cc(0xcd)]('error');if(_0x2dfa4a||!_0x131930||!_0x5ab23b){_0xf2476f[_0x33c9cc(0xb6)](0x190,{'Content-Type':_0x33c9cc(0xd0)}),_0xf2476f['end'](_0x33c9cc(0x9c)),_0x26d251(new Error('OAuth\x20callback\x20received\x20an\x20error\x20or\x20missing\x20parameters'));return;}_0xf2476f[_0x33c9cc(0xb6)](0xc8,{'Content-Type':_0x33c9cc(0xd0)}),_0xf2476f['end']('<html><body><h1>Authentication\x20Successful</h1><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>'),_0x315eb0({'code':_0x131930,'state':_0x5ab23b});});_0x5bc079['on']('error',_0x3ec2b9=>{const _0x27070b=_0x326be3;_0x3ec2b9[_0x27070b(0xa4)]===_0x27070b(0xa1)?_0x26d251(new Error(_0x27070b(0xc9)+OAUTH_CALLBACK_PORT+_0x27070b(0x96))):_0x26d251(new Error(_0x27070b(0xa8)+_0x3ec2b9[_0x27070b(0xaa)]));}),_0x5bc079[_0x326be3(0xc7)](OAUTH_CALLBACK_PORT,_0x326be3(0xcb));const _0x12d196=setTimeout(()=>{const _0xe6d8c4=_0x326be3;_0x26d251(new Error(_0xe6d8c4(0x99))),_0x5bc079[_0xe6d8c4(0xbc)]();},0x2*0x3c*0x3e8);return{'waitForCallback':()=>_0x1ad856,'close':()=>{const _0x7a29be=_0x326be3;clearTimeout(_0x12d196),_0x5bc079[_0x7a29be(0xbc)]();}};}function a62_0x1f2b(){const _0x17ffef=['text/plain','460oGudyD','set','state','close','Not\x20Found','waitForCallback','digest','S256','status','code_challenge_method','scope','42843nlIgeZ','/oauth/token','/oauth/callback','listen','http://127.0.0.1','Port\x20','stg-us01','127.0.0.1','51849YOgNeQ','get','4089655UrXvVq','json','text/html','7WYvtAV','dev-eu01','OAuth\x20state\x20mismatch\x20—\x20possible\x20CSRF\x20attack','searchParams','createServer','170OlAjdK','\x20is\x20already\x20in\x20use.\x20Stop\x20the\x20process\x20using\x20it\x20and\x20retry.','tdx','POST','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','):\x20','redirectUri','<html><body><h1>Authentication\x20Failed</h1><p>An\x20error\x20occurred\x20during\x20authentication.\x20Please\x20close\x20this\x20window\x20and\x20try\x20again.</p></body></html>','1142875alujpF','createHash','randomBytes','/oauth/authorize','EADDRINUSE','clientId','codeChallenge','code','response_type','code_challenge','end','Failed\x20to\x20start\x20OAuth\x20callback\x20server:\x20','url','message','redirect_uri','authorization_code','stg-ap01','dev-us01','base64url','147672fVhaka','has','8113544pXukNv','OAuth\x20token\x20request\x20failed\x20(','2649364oqxnzb','http://localhost:','writeHead','toString'];a62_0x1f2b=function(){return _0x17ffef;};return a62_0x1f2b();}export async function startOAuthFlow(_0x346176){const _0x59f70a=a62_0xf6c08d,_0x2d4239=getConsoleUrl(_0x346176),_0x4cb7e2=getOAuthClientId(),{verifier:_0x53b24a,challenge:_0x3c0414}=generatePKCEPair(),_0x1f0f31=a62_0x38d92f['randomBytes'](0x10)[_0x59f70a(0xb7)]('hex'),_0x1f1d74=startLocalCallbackServer();try{const _0x3baf10=OAUTH_REDIRECT_URI,_0x50f202=buildAuthorizeURL(_0x2d4239,{'clientId':_0x4cb7e2,'redirectUri':_0x3baf10,'state':_0x1f0f31,'codeChallenge':_0x3c0414});openBrowser(_0x50f202);const _0xd95576=await _0x1f1d74[_0x59f70a(0xbe)]();if(_0xd95576[_0x59f70a(0xbb)]!==_0x1f0f31)throw new Error(_0x59f70a(0x92));return await exchangeCodeForTokens(_0x2d4239,_0xd95576[_0x59f70a(0xa4)],_0x53b24a,_0x3baf10);}finally{_0x1f1d74[_0x59f70a(0xbc)]();}}
1
+ const a62_0x14be23=a62_0x41d8;(function(_0x103c2b,_0x5a7729){const _0x4f0865=a62_0x41d8,_0x168a81=_0x103c2b();while(!![]){try{const _0x356a24=parseInt(_0x4f0865(0x140))/0x1+parseInt(_0x4f0865(0x11c))/0x2*(-parseInt(_0x4f0865(0x122))/0x3)+parseInt(_0x4f0865(0x11e))/0x4+-parseInt(_0x4f0865(0x108))/0x5+parseInt(_0x4f0865(0x117))/0x6*(parseInt(_0x4f0865(0x10f))/0x7)+-parseInt(_0x4f0865(0x118))/0x8*(parseInt(_0x4f0865(0x123))/0x9)+parseInt(_0x4f0865(0x116))/0xa*(parseInt(_0x4f0865(0x109))/0xb);if(_0x356a24===_0x5a7729)break;else _0x168a81['push'](_0x168a81['shift']());}catch(_0x34fd10){_0x168a81['push'](_0x168a81['shift']());}}}(a62_0x3d5d,0xd7e20));import*as a62_0x430ddf from'node:crypto';import*as a62_0x4a7e25 from'node:http';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';const OAUTH_SUPPORTED_SITES=new Set(['dev-us01',a62_0x14be23(0x130),a62_0x14be23(0x126),'stg-ap01',a62_0x14be23(0x111)]);export function isOAuthSupported(_0x544c22){return OAUTH_SUPPORTED_SITES['has'](_0x544c22);}export const OAUTH_CALLBACK_PORT=0xaa4a;export const OAUTH_REDIRECT_URI=a62_0x14be23(0x12f)+OAUTH_CALLBACK_PORT+a62_0x14be23(0x114);export function getOAuthClientId(){const _0x29f3e4=a62_0x14be23;return process.env.TD_OAUTH_CLIENT_ID||_0x29f3e4(0x12a);}export function generatePKCEPair(){const _0x566f22=a62_0x14be23,_0x581842=a62_0x430ddf[_0x566f22(0x128)](0x20)[_0x566f22(0x134)](_0x566f22(0x115)),_0x3b2ced=a62_0x430ddf[_0x566f22(0x133)]('sha256')[_0x566f22(0x142)](_0x581842)[_0x566f22(0x10a)](_0x566f22(0x115));return{'verifier':_0x581842,'challenge':_0x3b2ced};}export function buildAuthorizeURL(_0x622cb1,_0x41041d){const _0x2da370=a62_0x14be23,_0x246d3b=new URL(_0x2da370(0x11b),_0x622cb1);return _0x246d3b[_0x2da370(0x120)]['set'](_0x2da370(0x119),_0x2da370(0x12d)),_0x246d3b[_0x2da370(0x120)][_0x2da370(0x141)]('client_id',_0x41041d['clientId']),_0x246d3b[_0x2da370(0x120)][_0x2da370(0x141)](_0x2da370(0x13e),_0x41041d[_0x2da370(0x105)]),_0x246d3b['searchParams'][_0x2da370(0x141)](_0x2da370(0x113),_0x41041d[_0x2da370(0x113)]),_0x246d3b['searchParams'][_0x2da370(0x141)]('code_challenge',_0x41041d[_0x2da370(0x112)]),_0x246d3b[_0x2da370(0x120)][_0x2da370(0x141)](_0x2da370(0x131),_0x2da370(0x107)),_0x41041d[_0x2da370(0x136)]&&_0x246d3b[_0x2da370(0x120)][_0x2da370(0x141)]('scope',_0x41041d[_0x2da370(0x136)]),_0x246d3b[_0x2da370(0x134)]();}function a62_0x3d5d(){const _0x5c5b6c=['close','createHash','toString','Failed\x20to\x20start\x20OAuth\x20callback\x20server:\x20','scope','OAuth\x20token\x20request\x20failed\x20(','json','127.0.0.1','application/x-www-form-urlencoded','hex','listen','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','redirect_uri','text/html','840926CaCPuq','set','update','redirectUri','http://127.0.0.1','S256','8463035fwpuHE','286uVXYMT','digest','Not\x20Found','error','<html><body><h1>Authentication\x20Failed</h1><p>An\x20error\x20occurred\x20during\x20authentication.\x20Please\x20close\x20this\x20window\x20and\x20try\x20again.</p></body></html>','):\x20','2370865MunOXJ','end','stg-ap03','codeChallenge','state','/oauth/callback','base64url','885870gguAIs','24jRYGna','8gInQuu','response_type','OAuth\x20callback\x20received\x20an\x20error\x20or\x20missing\x20parameters','/oauth/authorize','2396IBDYAn','EADDRINUSE','2430996vrFXjv','writeHead','searchParams','text/plain','3285EaXfly','10962396HsoBWK','status','text','stg-us01','Port\x20','randomBytes','/oauth/token','tdx','\x20is\x20already\x20in\x20use.\x20Stop\x20the\x20process\x20using\x20it\x20and\x20retry.','waitForCallback','code','<html><body><h1>Authentication\x20Successful</h1><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','http://localhost:','dev-eu01','code_challenge_method'];a62_0x3d5d=function(){return _0x5c5b6c;};return a62_0x3d5d();}function a62_0x41d8(_0xf374f8,_0x11b70f){_0xf374f8=_0xf374f8-0x105;const _0x3d5d49=a62_0x3d5d();let _0x41d867=_0x3d5d49[_0xf374f8];return _0x41d867;}export async function postTokenRequest(_0x152a47,_0x1fb023){const _0x1b2c2f=a62_0x14be23,_0xa7afb5=new URLSearchParams(_0x1fb023)[_0x1b2c2f(0x134)](),_0x3af045=await fetch(_0x152a47,{'method':'POST','headers':{'Content-Type':_0x1b2c2f(0x13a)},'body':_0xa7afb5});if(!_0x3af045['ok']){const _0x1f1d39=await _0x3af045[_0x1b2c2f(0x125)]();throw new Error(_0x1b2c2f(0x137)+_0x3af045[_0x1b2c2f(0x124)]+_0x1b2c2f(0x10e)+_0x1f1d39);}return await _0x3af045[_0x1b2c2f(0x138)]();}export async function exchangeCodeForTokens(_0x41ccdb,_0x2106e2,_0x2cfc6b,_0x975146){const _0x115e04=a62_0x14be23,_0xa56662=_0x41ccdb+_0x115e04(0x129);return postTokenRequest(_0xa56662,{'grant_type':'authorization_code','client_id':getOAuthClientId(),'code':_0x2106e2,'code_verifier':_0x2cfc6b,'redirect_uri':_0x975146});}export function startLocalCallbackServer(){const _0xebc669=a62_0x14be23;let _0x23e9fe,_0x3434f3;const _0x3e9049=new Promise((_0xb487f5,_0x57ebf8)=>{_0x23e9fe=_0xb487f5,_0x3434f3=_0x57ebf8;}),_0x560e8f=a62_0x4a7e25['createServer']((_0x1ab720,_0x17aa4b)=>{const _0x12a0d6=a62_0x41d8,_0x58ca8c=new URL(_0x1ab720['url']||'/',_0x12a0d6(0x106));if(_0x58ca8c['pathname']!==_0x12a0d6(0x114)){_0x17aa4b['writeHead'](0x194,{'Content-Type':_0x12a0d6(0x121)}),_0x17aa4b[_0x12a0d6(0x110)](_0x12a0d6(0x10b));return;}const _0x47432a=_0x58ca8c[_0x12a0d6(0x120)]['get']('code'),_0x3cf01a=_0x58ca8c[_0x12a0d6(0x120)]['get'](_0x12a0d6(0x113)),_0x3583bc=_0x58ca8c[_0x12a0d6(0x120)]['get'](_0x12a0d6(0x10c));if(_0x3583bc||!_0x47432a||!_0x3cf01a){_0x17aa4b[_0x12a0d6(0x11f)](0x190,{'Content-Type':'text/html'}),_0x17aa4b[_0x12a0d6(0x110)](_0x12a0d6(0x10d)),_0x3434f3(new Error(_0x12a0d6(0x11a)));return;}_0x17aa4b[_0x12a0d6(0x11f)](0xc8,{'Content-Type':_0x12a0d6(0x13f)}),_0x17aa4b[_0x12a0d6(0x110)](_0x12a0d6(0x12e)),_0x23e9fe({'code':_0x47432a,'state':_0x3cf01a});});_0x560e8f['on'](_0xebc669(0x10c),_0x59568a=>{const _0x162d58=_0xebc669;_0x59568a[_0x162d58(0x12d)]===_0x162d58(0x11d)?_0x3434f3(new Error(_0x162d58(0x127)+OAUTH_CALLBACK_PORT+_0x162d58(0x12b))):_0x3434f3(new Error(_0x162d58(0x135)+_0x59568a['message']));}),_0x560e8f[_0xebc669(0x13c)](OAUTH_CALLBACK_PORT,_0xebc669(0x139));const _0x227863=setTimeout(()=>{const _0x44dd19=_0xebc669;_0x3434f3(new Error(_0x44dd19(0x13d))),_0x560e8f[_0x44dd19(0x132)]();},0x2*0x3c*0x3e8);return{'waitForCallback':()=>_0x3e9049,'close':()=>{const _0x1d8ffb=_0xebc669;clearTimeout(_0x227863),_0x560e8f[_0x1d8ffb(0x132)]();}};}export async function startOAuthFlow(_0x5ec936){const _0x4c4f7c=a62_0x14be23,_0x6dad3b=getConsoleUrl(_0x5ec936),_0x91b0a=getOAuthClientId(),{verifier:_0x445821,challenge:_0x4d2f99}=generatePKCEPair(),_0x59437b=a62_0x430ddf['randomBytes'](0x10)[_0x4c4f7c(0x134)](_0x4c4f7c(0x13b)),_0x46e1e7=startLocalCallbackServer();try{const _0x21f355=OAUTH_REDIRECT_URI,_0x1d2e43=buildAuthorizeURL(_0x6dad3b,{'clientId':_0x91b0a,'redirectUri':_0x21f355,'state':_0x59437b,'codeChallenge':_0x4d2f99});openBrowser(_0x1d2e43);const _0x38b572=await _0x46e1e7[_0x4c4f7c(0x12c)]();if(_0x38b572[_0x4c4f7c(0x113)]!==_0x59437b)throw new Error('OAuth\x20state\x20mismatch\x20—\x20possible\x20CSRF\x20attack');return await exchangeCodeForTokens(_0x6dad3b,_0x38b572[_0x4c4f7c(0x12d)],_0x445821,_0x21f355);}finally{_0x46e1e7[_0x4c4f7c(0x132)]();}}
@@ -1 +1 @@
1
- const a63_0x44d7b1=a63_0x1177;(function(_0x518f58,_0x41fcce){const _0x2e3449=a63_0x1177,_0xb37c5b=_0x518f58();while(!![]){try{const _0x5b234d=parseInt(_0x2e3449(0xc2))/0x1*(parseInt(_0x2e3449(0xd8))/0x2)+parseInt(_0x2e3449(0xdd))/0x3*(parseInt(_0x2e3449(0xc4))/0x4)+-parseInt(_0x2e3449(0xa4))/0x5*(-parseInt(_0x2e3449(0xe0))/0x6)+-parseInt(_0x2e3449(0xc8))/0x7*(-parseInt(_0x2e3449(0xe2))/0x8)+parseInt(_0x2e3449(0xa8))/0x9+-parseInt(_0x2e3449(0xd5))/0xa*(parseInt(_0x2e3449(0xa7))/0xb)+-parseInt(_0x2e3449(0xd4))/0xc*(parseInt(_0x2e3449(0xd9))/0xd);if(_0x5b234d===_0x41fcce)break;else _0xb37c5b['push'](_0xb37c5b['shift']());}catch(_0x284a7e){_0xb37c5b['push'](_0xb37c5b['shift']());}}}(a63_0x116d,0x79582));import*as a63_0x9c8e39 from'node:fs';import*as a63_0x359ac8 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=a63_0x44d7b1(0x9c);export function getProfileParams(_0x1f1fd4){const _0x785694=a63_0x44d7b1,_0x2b1008={};if(!_0x1f1fd4)return _0x2b1008;for(const [_0x3af757,_0x36740d]of Object[_0x785694(0x9a)](_0x1f1fd4)){_0x3af757!=='description'&&_0x36740d!==undefined&&(_0x2b1008[_0x3af757]=_0x36740d);}return _0x2b1008;}export function getProfilesDir(){const _0x465c2d=a63_0x44d7b1;return a63_0x359ac8[_0x465c2d(0x9d)](getConfigDir(),_0x465c2d(0x9b));}function getProfileDir(_0x1dcdec){const _0x4e8f63=a63_0x44d7b1;return a63_0x359ac8[_0x4e8f63(0x9d)](getProfilesDir(),_0x1dcdec);}function getProfileConfigPath(_0x582205){const _0x51ac1b=a63_0x44d7b1;return a63_0x359ac8[_0x51ac1b(0x9d)](getProfileDir(_0x582205),'tdx.json');}function getProfileEnvPath(_0x15f1f0){const _0x1f5cbe=a63_0x44d7b1;return a63_0x359ac8[_0x1f5cbe(0x9d)](getProfileDir(_0x15f1f0),_0x1f5cbe(0xd0));}function getGlobalConfigPath(){const _0x36d09d=a63_0x44d7b1;return a63_0x359ac8[_0x36d09d(0x9d)](getConfigDir(),'tdx.json');}function validateProfileName(_0x831a63){const _0x198338=a63_0x44d7b1;if(/^@?[a-zA-Z0-9_-]+$/[_0x198338(0xbc)](_0x831a63))return;if(/^@tdx-studio:[a-zA-Z0-9_-]+:\d+(:\d+)?$/[_0x198338(0xbc)](_0x831a63))return;throw new Error('Invalid\x20profile\x20name:\x20'+_0x831a63+'.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20underscore,\x20and\x20optional\x20@\x20prefix\x20for\x20reserved\x20profiles.');}function validateProfileConfig(_0x3ebfde,_0x14ca6){const _0x43600e=a63_0x44d7b1;if(typeof _0x3ebfde!==_0x43600e(0x96)||_0x3ebfde===null)throw new SDKError(ErrorCode[_0x43600e(0xcb)],_0x43600e(0x94)+_0x14ca6+_0x43600e(0xb3));const _0x490970=[_0x43600e(0xac),'site','database','parent_segment',_0x43600e(0xaf),_0x43600e(0xbe),_0x43600e(0x9e)],_0x4a39a3=_0x3ebfde;for(const _0x4439be of Object[_0x43600e(0xdc)](_0x4a39a3)){!_0x490970['includes'](_0x4439be)&&console[_0x43600e(0xb0)](_0x43600e(0xda)+_0x14ca6+_0x43600e(0xae)+_0x4439be+'\x27\x20will\x20be\x20ignored');}if(_0x4a39a3['description']!==undefined&&typeof _0x4a39a3[_0x43600e(0xac)]!=='string')throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0x43600e(0x94)+_0x14ca6+'\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string');if(_0x4a39a3[_0x43600e(0xcd)]!==undefined&&typeof _0x4a39a3['site']!=='string')throw new SDKError(ErrorCode[_0x43600e(0xcb)],_0x43600e(0x94)+_0x14ca6+_0x43600e(0xc3));if(_0x4a39a3[_0x43600e(0xce)]!==undefined&&typeof _0x4a39a3[_0x43600e(0xce)]!==_0x43600e(0xc7))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0x43600e(0x94)+_0x14ca6+_0x43600e(0xb2));if(_0x4a39a3[_0x43600e(0xbb)]!==undefined&&typeof _0x4a39a3[_0x43600e(0xbb)]!==_0x43600e(0xc7))throw new SDKError(ErrorCode[_0x43600e(0xcb)],'Profile\x20\x27'+_0x14ca6+_0x43600e(0xa0));if(_0x4a39a3[_0x43600e(0xaf)]!==undefined&&typeof _0x4a39a3['llm_project']!=='string')throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0x43600e(0x94)+_0x14ca6+'\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string');if(_0x4a39a3[_0x43600e(0xbe)]!==undefined&&typeof _0x4a39a3[_0x43600e(0xbe)]!=='string')throw new SDKError(ErrorCode[_0x43600e(0xcb)],_0x43600e(0x94)+_0x14ca6+_0x43600e(0xbd));return!![];}function a63_0x1177(_0x4add87,_0x24ed0c){_0x4add87=_0x4add87-0x92;const _0x116d43=a63_0x116d();let _0x1177d8=_0x116d43[_0x4add87];return _0x1177d8;}function loadProfilesFromTdxJson(_0x39278e,_0x2fee73){const _0x3d754b=a63_0x44d7b1;if(!a63_0x9c8e39[_0x3d754b(0xab)](_0x39278e))return[];try{const _0x4bb0cb=a63_0x9c8e39['readFileSync'](_0x39278e,'utf-8'),_0x11ffbc=JSON[_0x3d754b(0xd7)](_0x4bb0cb);if(!_0x11ffbc[_0x3d754b(0x9b)]||typeof _0x11ffbc[_0x3d754b(0x9b)]!==_0x3d754b(0x96))return[];const _0x1a90f9=[];for(const [_0x389bac,_0x791d7d]of Object[_0x3d754b(0x9a)](_0x11ffbc[_0x3d754b(0x9b)])){try{validateProfileConfig(_0x791d7d,_0x389bac);const _0x39bd2a=getNewCredentialPath(_0x389bac),_0x1e7326=getOldCredentialPath(_0x389bac),_0x56314d=a63_0x9c8e39[_0x3d754b(0xab)](_0x39bd2a)||a63_0x9c8e39[_0x3d754b(0xab)](_0x1e7326);_0x1a90f9[_0x3d754b(0xa1)]({'name':_0x389bac,'config':_0x791d7d,'metadata':{'name':_0x389bac,'createdAt':new Date()['toISOString']()},'hasCredentials':_0x56314d,'scope':_0x2fee73});}catch(_0x13c5a6){_0x13c5a6 instanceof Error&&(console[_0x3d754b(0xb0)]('\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20'+_0x39278e+':'),console[_0x3d754b(0xb0)]('\x20\x20'+_0x13c5a6[_0x3d754b(0xa9)]+'\x0a'));}}return _0x1a90f9;}catch(_0x3c9723){return _0x3c9723 instanceof SyntaxError?(console[_0x3d754b(0xb0)](_0x3d754b(0x95)+_0x39278e+_0x3d754b(0xb6)),console[_0x3d754b(0xb0)](_0x3d754b(0xb8)+_0x3c9723[_0x3d754b(0xa9)]+'\x0a')):console[_0x3d754b(0xb0)]('\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20'+_0x39278e+':\x20'+_0x3c9723+'\x0a'),[];}}export function getNewCredentialPath(_0x33ab03){const _0x32251a=a63_0x44d7b1;return a63_0x359ac8[_0x32251a(0x9d)](getConfigDir(),_0x32251a(0xb9)+_0x33ab03);}function getOldCredentialPath(_0x12fe47){const _0x42b521=a63_0x44d7b1;return a63_0x359ac8[_0x42b521(0x9d)](getProfilesDir(),_0x12fe47,'.env');}function loadProfilesFromTdxJsonFiles(){const _0x31b8b6=a63_0x44d7b1,_0x1d54e7=[],_0x2ea12e=findProjectConfigPath();_0x2ea12e&&_0x1d54e7['push'](...loadProfilesFromTdxJson(_0x2ea12e,_0x31b8b6(0xe1)));const _0x1868c5=a63_0x359ac8[_0x31b8b6(0x9d)](getConfigDir(),'tdx.json');return _0x1d54e7['push'](...loadProfilesFromTdxJson(_0x1868c5,'user')),_0x1d54e7;}function loadProfilesFromDirectories(){const _0x472511=a63_0x44d7b1,_0x1aad55=getProfilesDir();if(!a63_0x9c8e39[_0x472511(0xab)](_0x1aad55))return[];try{return a63_0x9c8e39[_0x472511(0xe3)](_0x1aad55,{'withFileTypes':!![]})[_0x472511(0xb1)](_0x2efc4f=>_0x2efc4f[_0x472511(0xdf)]())[_0x472511(0xc0)](_0x407a3b=>_0x407a3b[_0x472511(0xc6)])['filter'](_0x668687=>{const _0x496bd7=_0x472511,_0x563a59=getProfileConfigPath(_0x668687),_0x2458a=getProfileEnvPath(_0x668687);return a63_0x9c8e39[_0x496bd7(0xab)](_0x563a59)||a63_0x9c8e39['existsSync'](_0x2458a);})[_0x472511(0xc0)](_0x123c5b=>{const _0x159d11=loadProfileFromDirectory(_0x123c5b);if(_0x159d11)return{..._0x159d11,'scope':'directory'};return null;})[_0x472511(0xb1)](_0x2353e6=>_0x2353e6!==null);}catch{return[];}}function loadProfileFromDirectory(_0x4e3950){const _0x58b6cb=a63_0x44d7b1,_0x1b8d13=getProfileConfigPath(_0x4e3950),_0x50da21=getOldCredentialPath(_0x4e3950);if(!a63_0x9c8e39[_0x58b6cb(0xab)](_0x1b8d13)&&!a63_0x9c8e39[_0x58b6cb(0xab)](_0x50da21))return null;let _0x2a1a4c={},_0x58d789={'name':_0x4e3950,'createdAt':new Date()[_0x58b6cb(0xa2)]()};if(a63_0x9c8e39[_0x58b6cb(0xab)](_0x1b8d13))try{const _0x55459d=a63_0x9c8e39[_0x58b6cb(0x99)](_0x1b8d13,_0x58b6cb(0xa3)),_0x225493=JSON[_0x58b6cb(0xd7)](_0x55459d),{metadata:_0x4e9567,..._0x2ebca1}=_0x225493;_0x2a1a4c=_0x2ebca1,_0x4e9567&&(_0x58d789=_0x4e9567);}catch{}return{'name':_0x4e3950,'config':_0x2a1a4c,'metadata':_0x58d789,'hasCredentials':a63_0x9c8e39['existsSync'](_0x50da21),'scope':_0x58b6cb(0xba)};}export function listProfiles(){const _0x4e4825=a63_0x44d7b1,_0x290ce5=loadProfilesFromTdxJsonFiles(),_0x565cae=loadProfilesFromDirectories();if(_0x565cae[_0x4e4825(0x9f)]>0x0){const _0x1c41ea=_0x565cae['map'](_0x123b78=>_0x123b78['name'])['join'](',\x20'),_0x596a42=getConfigDir();console[_0x4e4825(0xb0)]('\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20'+_0x1c41ea),console[_0x4e4825(0xb0)](_0x4e4825(0x98)),console[_0x4e4825(0xb0)](_0x4e4825(0xc1)+a63_0x359ac8['join'](_0x596a42,'tdx.json')),console[_0x4e4825(0xb0)](_0x4e4825(0xc9)),console[_0x4e4825(0xb0)](_0x4e4825(0xcc));}const _0x4b531d=[..._0x290ce5,..._0x565cae],_0xab1980=new Map();for(const _0x45d28b of _0x4b531d){!_0xab1980[_0x4e4825(0xaa)](_0x45d28b['name'])&&_0xab1980[_0x4e4825(0x92)](_0x45d28b[_0x4e4825(0xc6)],_0x45d28b);}return Array['from'](_0xab1980[_0x4e4825(0xd3)]())[_0x4e4825(0xc5)]((_0x592891,_0x18a0c7)=>_0x592891[_0x4e4825(0xc6)][_0x4e4825(0xa6)](_0x18a0c7[_0x4e4825(0xc6)]));}export function profileExists(_0x4ff117){const _0x3a094a=a63_0x44d7b1,_0x3aa4e4=listProfiles();return _0x3aa4e4[_0x3a094a(0xad)](_0x517838=>_0x517838[_0x3a094a(0xc6)]===_0x4ff117);}function a63_0x116d(){const _0x2fd54d=['database','Warning:\x20Failed\x20to\x20parse\x20','.env','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','Profile\x20','values','24Gffpiu','20JZxhGM','find','parse','93326TUvdWU','14117246zWePPD','Warning:\x20Profile\x20\x27','rmSync','keys','15UhAoXB','stringify','isDirectory','18wfhvYv','local','479008pCvjVs','readdirSync','set','\x20\x20mv\x20\x22','Profile\x20\x27','\x0aWarning:\x20Failed\x20to\x20parse\x20','object','\x27\x20not\x20found\x20in\x20user\x20configuration','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','readFileSync','entries','profiles','@tdx-studio','join','user_info','length','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','push','toISOString','utf-8','1166045ZPOAiL','Failed\x20to\x20parse\x20','localeCompare','4397833kxOyjg','2291679lXzkYG','message','has','existsSync','description','some','\x27:\x20unknown\x20config\x20key\x20\x27','llm_project','warn','filter','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','\x27:\x20config\x20must\x20be\x20an\x20object','profile','\x20does\x20not\x20exist',':\x20Invalid\x20JSON\x20syntax','\x20already\x20exists','Error:\x20','.env.','directory','parent_segment','test','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','llm_agent',',\x20creating\x20new\x20file','map','\x20\x201.\x20Edit:\x20','21eDWZxR','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','748460TadZhU','sort','name','string','70chCPkJ','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','INVALID_PROFILE_CONFIG','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','site'];a63_0x116d=function(){return _0x2fd54d;};return a63_0x116d();}export function loadProfile(_0xb9c3c5){const _0x137bbd=a63_0x44d7b1;validateProfileName(_0xb9c3c5);const _0xd1c16b=listProfiles(),_0x122c24=_0xd1c16b[_0x137bbd(0xd6)](_0x42db54=>_0x42db54[_0x137bbd(0xc6)]===_0xb9c3c5);return _0x122c24||null;}export function saveProfile(_0x56c918,_0x470c7a,_0x5749bb=![]){saveProfileToUserConfig(_0x56c918,_0x470c7a);}export function deleteProfile(_0xa49c8){const _0x52973d=a63_0x44d7b1;validateProfileName(_0xa49c8);const _0x33a2ed=getProfileDir(_0xa49c8);if(!a63_0x9c8e39[_0x52973d(0xab)](_0x33a2ed))throw new Error(_0x52973d(0xd2)+_0xa49c8+_0x52973d(0xb5));a63_0x9c8e39[_0x52973d(0xdb)](_0x33a2ed,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x329b75,_0x30613e){const _0x2267cc=a63_0x44d7b1;validateProfileName(_0x329b75);const _0x243a48=getGlobalConfigPath(),_0x21f150=getConfigDir();!a63_0x9c8e39['existsSync'](_0x21f150)&&createSecureDirectory(_0x21f150);let _0xc76505={};if(a63_0x9c8e39[_0x2267cc(0xab)](_0x243a48))try{const _0x4559e0=a63_0x9c8e39[_0x2267cc(0x99)](_0x243a48,_0x2267cc(0xa3));_0xc76505=JSON['parse'](_0x4559e0);}catch{console[_0x2267cc(0xb0)](_0x2267cc(0xcf)+_0x243a48+',\x20creating\x20new\x20file');}!_0xc76505[_0x2267cc(0x9b)]&&(_0xc76505[_0x2267cc(0x9b)]={}),_0xc76505[_0x2267cc(0x9b)][_0x329b75]=_0x30613e,writeSecureFile(_0x243a48,JSON[_0x2267cc(0xde)](_0xc76505,null,0x2));}export function removeProfileFromUserConfig(_0x18b865){const _0x2abf23=a63_0x44d7b1;validateProfileName(_0x18b865);const _0x25c399=getGlobalConfigPath();if(!a63_0x9c8e39[_0x2abf23(0xab)](_0x25c399))throw new Error(_0x2abf23(0x94)+_0x18b865+_0x2abf23(0x97));let _0xd799bb={};try{const _0x22488a=a63_0x9c8e39['readFileSync'](_0x25c399,'utf-8');_0xd799bb=JSON[_0x2abf23(0xd7)](_0x22488a);}catch{throw new Error(_0x2abf23(0xa5)+_0x25c399);}if(!_0xd799bb['profiles']||!_0xd799bb['profiles'][_0x18b865])throw new Error(_0x2abf23(0x94)+_0x18b865+_0x2abf23(0x97));delete _0xd799bb[_0x2abf23(0x9b)][_0x18b865],_0xd799bb[_0x2abf23(0xb4)]===_0x18b865&&delete _0xd799bb['profile'],writeSecureFile(_0x25c399,JSON[_0x2abf23(0xde)](_0xd799bb,null,0x2));}export function getActiveProfile(){const _0x1d0a8f=a63_0x44d7b1,_0x540c7a=loadSessionContext();if(_0x540c7a?.['profile'])return _0x540c7a['profile'];if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x2b3968=getGlobalConfigPath();if(!a63_0x9c8e39[_0x1d0a8f(0xab)](_0x2b3968))return null;try{const _0x3e00e6=a63_0x9c8e39[_0x1d0a8f(0x99)](_0x2b3968,_0x1d0a8f(0xa3)),_0x508a67=JSON[_0x1d0a8f(0xd7)](_0x3e00e6);return _0x508a67[_0x1d0a8f(0xb4)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x3c225c){const _0xa56f2f=a63_0x44d7b1,_0x3adfc4=getGlobalConfigPath(),_0x37040a=getConfigDir();!a63_0x9c8e39[_0xa56f2f(0xab)](_0x37040a)&&createSecureDirectory(_0x37040a);let _0x110a3a={};if(a63_0x9c8e39[_0xa56f2f(0xab)](_0x3adfc4))try{const _0x586017=a63_0x9c8e39[_0xa56f2f(0x99)](_0x3adfc4,_0xa56f2f(0xa3));_0x110a3a=JSON['parse'](_0x586017);}catch{console[_0xa56f2f(0xb0)](_0xa56f2f(0xcf)+_0x3adfc4+_0xa56f2f(0xbf));}_0x110a3a['site']=_0x3c225c,writeSecureFile(_0x3adfc4,JSON[_0xa56f2f(0xde)](_0x110a3a,null,0x2));}export function saveActiveProfileToUserConfig(_0x14a8d1){const _0x517341=a63_0x44d7b1;validateProfileName(_0x14a8d1);const _0x252c6b=getGlobalConfigPath(),_0x22a9ac=getConfigDir();!a63_0x9c8e39['existsSync'](_0x22a9ac)&&createSecureDirectory(_0x22a9ac);let _0x514a1b={};if(a63_0x9c8e39[_0x517341(0xab)](_0x252c6b))try{const _0x4c6c44=a63_0x9c8e39['readFileSync'](_0x252c6b,_0x517341(0xa3));_0x514a1b=JSON['parse'](_0x4c6c44);}catch{console[_0x517341(0xb0)](_0x517341(0xcf)+_0x252c6b+_0x517341(0xbf));}_0x514a1b['profile']=_0x14a8d1,writeSecureFile(_0x252c6b,JSON[_0x517341(0xde)](_0x514a1b,null,0x2));}function clearFieldFromUserConfig(_0x3751cf){const _0x14d983=a63_0x44d7b1,_0x4082e5=getGlobalConfigPath();if(!a63_0x9c8e39[_0x14d983(0xab)](_0x4082e5))return;let _0x3da792={};try{const _0x373dac=a63_0x9c8e39[_0x14d983(0x99)](_0x4082e5,'utf-8');_0x3da792=JSON[_0x14d983(0xd7)](_0x373dac);}catch{return;}delete _0x3da792[_0x3751cf],writeSecureFile(_0x4082e5,JSON['stringify'](_0x3da792,null,0x2));}export function clearDefaultSiteFromUserConfig(){const _0x2a3ea5=a63_0x44d7b1;clearFieldFromUserConfig(_0x2a3ea5(0xcd));}export function clearActiveProfileFromUserConfig(){clearFieldFromUserConfig('profile');}export function createProfile(_0x6b589a,_0x3d6b8e){const _0x58f37a=a63_0x44d7b1;validateProfileName(_0x6b589a);if(profileExists(_0x6b589a))throw new Error(_0x58f37a(0xd2)+_0x6b589a+_0x58f37a(0xb7));saveProfile(_0x6b589a,_0x3d6b8e);}export function saveProfileCredentials(_0x4772f7,_0x261de0){const _0x3ba7af=a63_0x44d7b1;validateProfileName(_0x4772f7);if(!profileExists(_0x4772f7))throw new Error('Profile\x20'+_0x4772f7+_0x3ba7af(0xb5));const _0x1ea861=getNewCredentialPath(_0x4772f7);writeSecureFile(_0x1ea861,_0x261de0);}export function loadProfileCredentials(_0x805cc8){const _0x37a348=a63_0x44d7b1;validateProfileName(_0x805cc8);const _0x55d8aa=getNewCredentialPath(_0x805cc8);if(a63_0x9c8e39[_0x37a348(0xab)](_0x55d8aa))try{return a63_0x9c8e39[_0x37a348(0x99)](_0x55d8aa,_0x37a348(0xa3));}catch{}const _0x1d63ee=getOldCredentialPath(_0x805cc8);if(a63_0x9c8e39['existsSync'](_0x1d63ee)){console[_0x37a348(0xb0)](_0x37a348(0xd1)+_0x805cc8+'\x27'),console[_0x37a348(0xb0)]('To\x20migrate:'),console[_0x37a348(0xb0)](_0x37a348(0x93)+_0x1d63ee+'\x22\x20\x22'+_0x55d8aa+'\x22'),console[_0x37a348(0xb0)](_0x37a348(0xca));try{return a63_0x9c8e39['readFileSync'](_0x1d63ee,_0x37a348(0xa3));}catch{return null;}}return null;}
1
+ const a63_0x36fd12=a63_0x318e;(function(_0x1d60cd,_0x3c0ab7){const _0x504a9a=a63_0x318e,_0x174840=_0x1d60cd();while(!![]){try{const _0x12d76e=parseInt(_0x504a9a(0xfc))/0x1*(parseInt(_0x504a9a(0xfb))/0x2)+-parseInt(_0x504a9a(0xe2))/0x3+-parseInt(_0x504a9a(0xd1))/0x4+parseInt(_0x504a9a(0xc2))/0x5+parseInt(_0x504a9a(0xf7))/0x6+parseInt(_0x504a9a(0x10e))/0x7+-parseInt(_0x504a9a(0x10c))/0x8*(parseInt(_0x504a9a(0x107))/0x9);if(_0x12d76e===_0x3c0ab7)break;else _0x174840['push'](_0x174840['shift']());}catch(_0x167070){_0x174840['push'](_0x174840['shift']());}}}(a63_0x3f0e,0x190dc));import*as a63_0x3d23b9 from'node:fs';import*as a63_0x45ed01 from'node:path';import{SDKError,ErrorCode}from'../sdk/errors.js';import{getConfigDir}from'./config.js';function a63_0x3f0e(){const _0x115440=['182595pzodNF','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20underscore,\x20and\x20optional\x20@\x20prefix\x20for\x20reserved\x20profiles.','\x20does\x20not\x20exist','832385MLPDwn','parent_segment','length','utf-8','profile','some',',\x20creating\x20new\x20file','database','To\x20migrate:','Profile\x20','from','\x20\x20mv\x20\x22','profiles','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','557820pRprCa','isDirectory','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','object','warn','set','localeCompare','.env.','user','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','llm_agent','name','\x0aWarning:\x20Failed\x20to\x20parse\x20','push','existsSync','72639ApsJHs','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','llm_project','entries','user_info','\x20already\x20exists','Profile\x20\x27','message','INVALID_PROFILE_CONFIG','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','stringify','site','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','\x27\x20not\x20found\x20in\x20user\x20configuration','\x27:\x20unknown\x20config\x20key\x20\x27','Invalid\x20profile\x20name:\x20','sort','find','Failed\x20to\x20parse\x20','@tdx-studio','keys','334572ItoGtx','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','tdx.json','readdirSync','264uuvTkX','863lDfAal','includes','Warning:\x20Profile\x20\x27','string','.env','test','\x27:\x20config\x20must\x20be\x20an\x20object','description','Warning:\x20Failed\x20to\x20parse\x20',':\x20Invalid\x20JSON\x20syntax','join','216cDrmyZ','readFileSync','toISOString','filter','parse','31984ooRcyP','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string'];a63_0x3f0e=function(){return _0x115440;};return a63_0x3f0e();}import{createSecureDirectory,writeSecureFile}from'../utils/file-permissions.js';import{findProjectConfigPath}from'./project-config.js';import{loadSessionContext}from'./session.js';export const STUDIO_PROFILE_NAME=a63_0x36fd12(0xf5);export function getProfileParams(_0x478a89){const _0x57a518=a63_0x36fd12,_0x9f6e66={};if(!_0x478a89)return _0x9f6e66;for(const [_0x2c0fbd,_0x5e77e9]of Object[_0x57a518(0xe5)](_0x478a89)){_0x2c0fbd!==_0x57a518(0x103)&&_0x5e77e9!==undefined&&(_0x9f6e66[_0x2c0fbd]=_0x5e77e9);}return _0x9f6e66;}export function getProfilesDir(){const _0x79c8c6=a63_0x36fd12;return a63_0x45ed01[_0x79c8c6(0x106)](getConfigDir(),_0x79c8c6(0xce));}function getProfileDir(_0x493661){return a63_0x45ed01['join'](getProfilesDir(),_0x493661);}function a63_0x318e(_0x33fa32,_0x7f5c45){_0x33fa32=_0x33fa32-0xc2;const _0x3f0ee9=a63_0x3f0e();let _0x318e5a=_0x3f0ee9[_0x33fa32];return _0x318e5a;}function getProfileConfigPath(_0x3b1e59){const _0x4d16b2=a63_0x36fd12;return a63_0x45ed01[_0x4d16b2(0x106)](getProfileDir(_0x3b1e59),_0x4d16b2(0xf9));}function getProfileEnvPath(_0x292680){const _0x93d5b3=a63_0x36fd12;return a63_0x45ed01[_0x93d5b3(0x106)](getProfileDir(_0x292680),'.env');}function getGlobalConfigPath(){const _0x3e1d1f=a63_0x36fd12;return a63_0x45ed01['join'](getConfigDir(),_0x3e1d1f(0xf9));}function validateProfileName(_0x2c88df){const _0x1da581=a63_0x36fd12;if(/^@?[a-zA-Z0-9_-]+$/[_0x1da581(0x101)](_0x2c88df))return;if(/^@tdx-studio:[a-zA-Z0-9_-]+:\d+(:\d+)?$/[_0x1da581(0x101)](_0x2c88df))return;throw new Error(_0x1da581(0xf1)+_0x2c88df+_0x1da581(0x10f));}function validateProfileConfig(_0x249e5e,_0x587677){const _0x470583=a63_0x36fd12;if(typeof _0x249e5e!==_0x470583(0xd4)||_0x249e5e===null)throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],'Profile\x20\x27'+_0x587677+_0x470583(0x102));const _0x7d64c3=[_0x470583(0x103),_0x470583(0xed),_0x470583(0xc9),_0x470583(0xc3),_0x470583(0xe4),_0x470583(0xdd),_0x470583(0xe6)],_0x3e5956=_0x249e5e;for(const _0x235ae2 of Object[_0x470583(0xf6)](_0x3e5956)){!_0x7d64c3[_0x470583(0xfd)](_0x235ae2)&&console['warn'](_0x470583(0xfe)+_0x587677+_0x470583(0xf0)+_0x235ae2+'\x27\x20will\x20be\x20ignored');}if(_0x3e5956[_0x470583(0x103)]!==undefined&&typeof _0x3e5956[_0x470583(0x103)]!=='string')throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],'Profile\x20\x27'+_0x587677+_0x470583(0xeb));if(_0x3e5956[_0x470583(0xed)]!==undefined&&typeof _0x3e5956['site']!==_0x470583(0xff))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],'Profile\x20\x27'+_0x587677+'\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string');if(_0x3e5956[_0x470583(0xc9)]!==undefined&&typeof _0x3e5956['database']!==_0x470583(0xff))throw new SDKError(ErrorCode[_0x470583(0xea)],_0x470583(0xe8)+_0x587677+'\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string');if(_0x3e5956[_0x470583(0xc3)]!==undefined&&typeof _0x3e5956[_0x470583(0xc3)]!==_0x470583(0xff))throw new SDKError(ErrorCode[_0x470583(0xea)],'Profile\x20\x27'+_0x587677+_0x470583(0x10d));if(_0x3e5956[_0x470583(0xe4)]!==undefined&&typeof _0x3e5956['llm_project']!==_0x470583(0xff))throw new SDKError(ErrorCode[_0x470583(0xea)],_0x470583(0xe8)+_0x587677+'\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string');if(_0x3e5956[_0x470583(0xdd)]!==undefined&&typeof _0x3e5956[_0x470583(0xdd)]!==_0x470583(0xff))throw new SDKError(ErrorCode[_0x470583(0xea)],'Profile\x20\x27'+_0x587677+_0x470583(0xdc));return!![];}function loadProfilesFromTdxJson(_0xaaf63e,_0x4ea194){const _0x516cc9=a63_0x36fd12;if(!a63_0x3d23b9[_0x516cc9(0xe1)](_0xaaf63e))return[];try{const _0x57f742=a63_0x3d23b9[_0x516cc9(0x108)](_0xaaf63e,_0x516cc9(0xc5)),_0x354e3c=JSON[_0x516cc9(0x10b)](_0x57f742);if(!_0x354e3c['profiles']||typeof _0x354e3c['profiles']!==_0x516cc9(0xd4))return[];const _0xf16f81=[];for(const [_0x2e5181,_0x125bd8]of Object[_0x516cc9(0xe5)](_0x354e3c[_0x516cc9(0xce)])){try{validateProfileConfig(_0x125bd8,_0x2e5181);const _0x3f9ffe=getNewCredentialPath(_0x2e5181),_0x44e1ab=getOldCredentialPath(_0x2e5181),_0x504177=a63_0x3d23b9[_0x516cc9(0xe1)](_0x3f9ffe)||a63_0x3d23b9[_0x516cc9(0xe1)](_0x44e1ab);_0xf16f81[_0x516cc9(0xe0)]({'name':_0x2e5181,'config':_0x125bd8,'metadata':{'name':_0x2e5181,'createdAt':new Date()[_0x516cc9(0x109)]()},'hasCredentials':_0x504177,'scope':_0x4ea194});}catch(_0x470efe){_0x470efe instanceof Error&&(console[_0x516cc9(0xd5)](_0x516cc9(0xdb)+_0xaaf63e+':'),console[_0x516cc9(0xd5)]('\x20\x20'+_0x470efe['message']+'\x0a'));}}return _0xf16f81;}catch(_0x331cc7){return _0x331cc7 instanceof SyntaxError?(console[_0x516cc9(0xd5)](_0x516cc9(0xdf)+_0xaaf63e+_0x516cc9(0x105)),console['warn']('Error:\x20'+_0x331cc7[_0x516cc9(0xe9)]+'\x0a')):console['warn'](_0x516cc9(0xf8)+_0xaaf63e+':\x20'+_0x331cc7+'\x0a'),[];}}export function getNewCredentialPath(_0x57d424){const _0x270a71=a63_0x36fd12;return a63_0x45ed01[_0x270a71(0x106)](getConfigDir(),_0x270a71(0xd8)+_0x57d424);}function getOldCredentialPath(_0x12b369){const _0xf9ea4a=a63_0x36fd12;return a63_0x45ed01[_0xf9ea4a(0x106)](getProfilesDir(),_0x12b369,_0xf9ea4a(0x100));}function loadProfilesFromTdxJsonFiles(){const _0x5666c4=a63_0x36fd12,_0x247db5=[],_0x1a266c=findProjectConfigPath();_0x1a266c&&_0x247db5[_0x5666c4(0xe0)](...loadProfilesFromTdxJson(_0x1a266c,'local'));const _0x565e60=a63_0x45ed01['join'](getConfigDir(),'tdx.json');return _0x247db5[_0x5666c4(0xe0)](...loadProfilesFromTdxJson(_0x565e60,_0x5666c4(0xd9))),_0x247db5;}function loadProfilesFromDirectories(){const _0xa38560=a63_0x36fd12,_0x57cf37=getProfilesDir();if(!a63_0x3d23b9[_0xa38560(0xe1)](_0x57cf37))return[];try{return a63_0x3d23b9[_0xa38560(0xfa)](_0x57cf37,{'withFileTypes':!![]})['filter'](_0x408664=>_0x408664[_0xa38560(0xd2)]())['map'](_0x329a44=>_0x329a44[_0xa38560(0xde)])[_0xa38560(0x10a)](_0xde1ee6=>{const _0x1a9605=_0xa38560,_0x88b864=getProfileConfigPath(_0xde1ee6),_0x57d2d=getProfileEnvPath(_0xde1ee6);return a63_0x3d23b9[_0x1a9605(0xe1)](_0x88b864)||a63_0x3d23b9['existsSync'](_0x57d2d);})['map'](_0x2f4ce1=>{const _0x24efc8=loadProfileFromDirectory(_0x2f4ce1);if(_0x24efc8)return{..._0x24efc8,'scope':'directory'};return null;})[_0xa38560(0x10a)](_0x580182=>_0x580182!==null);}catch{return[];}}function loadProfileFromDirectory(_0x2004e2){const _0x90f3c9=a63_0x36fd12,_0x4e1b4a=getProfileConfigPath(_0x2004e2),_0x6341ad=getOldCredentialPath(_0x2004e2);if(!a63_0x3d23b9['existsSync'](_0x4e1b4a)&&!a63_0x3d23b9[_0x90f3c9(0xe1)](_0x6341ad))return null;let _0x4bf658={},_0x2dc41f={'name':_0x2004e2,'createdAt':new Date()[_0x90f3c9(0x109)]()};if(a63_0x3d23b9['existsSync'](_0x4e1b4a))try{const _0x36fe77=a63_0x3d23b9['readFileSync'](_0x4e1b4a,_0x90f3c9(0xc5)),_0x1563c0=JSON['parse'](_0x36fe77),{metadata:_0x1544a4,..._0x2aa37f}=_0x1563c0;_0x4bf658=_0x2aa37f,_0x1544a4&&(_0x2dc41f=_0x1544a4);}catch{}return{'name':_0x2004e2,'config':_0x4bf658,'metadata':_0x2dc41f,'hasCredentials':a63_0x3d23b9[_0x90f3c9(0xe1)](_0x6341ad),'scope':'directory'};}export function listProfiles(){const _0x5c597f=a63_0x36fd12,_0x20589e=loadProfilesFromTdxJsonFiles(),_0x4c8598=loadProfilesFromDirectories();if(_0x4c8598[_0x5c597f(0xc4)]>0x0){const _0x401375=_0x4c8598['map'](_0x7cb758=>_0x7cb758[_0x5c597f(0xde)])['join'](',\x20'),_0x2d059d=getConfigDir();console['warn'](_0x5c597f(0xd0)+_0x401375),console[_0x5c597f(0xd5)](_0x5c597f(0xda)),console['warn']('\x20\x201.\x20Edit:\x20'+a63_0x45ed01[_0x5c597f(0x106)](_0x2d059d,_0x5c597f(0xf9))),console[_0x5c597f(0xd5)](_0x5c597f(0xcf)),console['warn'](_0x5c597f(0xee));}const _0x528054=[..._0x20589e,..._0x4c8598],_0x2668e7=new Map();for(const _0x1a1c1f of _0x528054){!_0x2668e7['has'](_0x1a1c1f[_0x5c597f(0xde)])&&_0x2668e7[_0x5c597f(0xd6)](_0x1a1c1f[_0x5c597f(0xde)],_0x1a1c1f);}return Array[_0x5c597f(0xcc)](_0x2668e7['values']())[_0x5c597f(0xf2)]((_0x87b6cb,_0x2e7e5a)=>_0x87b6cb['name'][_0x5c597f(0xd7)](_0x2e7e5a['name']));}export function profileExists(_0x93f974){const _0x4f8d44=a63_0x36fd12,_0xe0aa7e=listProfiles();return _0xe0aa7e[_0x4f8d44(0xc7)](_0x55bc04=>_0x55bc04[_0x4f8d44(0xde)]===_0x93f974);}export function loadProfile(_0x334487){const _0x4f0f89=a63_0x36fd12;validateProfileName(_0x334487);const _0x4e09c5=listProfiles(),_0x4e8556=_0x4e09c5[_0x4f0f89(0xf3)](_0x427481=>_0x427481[_0x4f0f89(0xde)]===_0x334487);return _0x4e8556||null;}export function saveProfile(_0x11e9f9,_0x344206,_0x5b7e29=![]){saveProfileToUserConfig(_0x11e9f9,_0x344206);}export function deleteProfile(_0x1b3607){const _0x12207e=a63_0x36fd12;validateProfileName(_0x1b3607);const _0x316c02=getProfileDir(_0x1b3607);if(!a63_0x3d23b9[_0x12207e(0xe1)](_0x316c02))throw new Error(_0x12207e(0xcb)+_0x1b3607+_0x12207e(0x110));a63_0x3d23b9['rmSync'](_0x316c02,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x2db35f,_0x40252a){const _0x4b8ee7=a63_0x36fd12;validateProfileName(_0x2db35f);const _0xcf135b=getGlobalConfigPath(),_0x1a3f79=getConfigDir();!a63_0x3d23b9[_0x4b8ee7(0xe1)](_0x1a3f79)&&createSecureDirectory(_0x1a3f79);let _0x1eef4a={};if(a63_0x3d23b9['existsSync'](_0xcf135b))try{const _0x212acc=a63_0x3d23b9[_0x4b8ee7(0x108)](_0xcf135b,'utf-8');_0x1eef4a=JSON[_0x4b8ee7(0x10b)](_0x212acc);}catch{console['warn'](_0x4b8ee7(0x104)+_0xcf135b+_0x4b8ee7(0xc8));}!_0x1eef4a[_0x4b8ee7(0xce)]&&(_0x1eef4a[_0x4b8ee7(0xce)]={}),_0x1eef4a[_0x4b8ee7(0xce)][_0x2db35f]=_0x40252a,writeSecureFile(_0xcf135b,JSON[_0x4b8ee7(0xec)](_0x1eef4a,null,0x2));}export function removeProfileFromUserConfig(_0x1ebc10){const _0x48feeb=a63_0x36fd12;validateProfileName(_0x1ebc10);const _0x21a6db=getGlobalConfigPath();if(!a63_0x3d23b9[_0x48feeb(0xe1)](_0x21a6db))throw new Error(_0x48feeb(0xe8)+_0x1ebc10+'\x27\x20not\x20found\x20in\x20user\x20configuration');let _0x2f6a67={};try{const _0x473029=a63_0x3d23b9['readFileSync'](_0x21a6db,_0x48feeb(0xc5));_0x2f6a67=JSON[_0x48feeb(0x10b)](_0x473029);}catch{throw new Error(_0x48feeb(0xf4)+_0x21a6db);}if(!_0x2f6a67[_0x48feeb(0xce)]||!_0x2f6a67[_0x48feeb(0xce)][_0x1ebc10])throw new Error('Profile\x20\x27'+_0x1ebc10+_0x48feeb(0xef));delete _0x2f6a67[_0x48feeb(0xce)][_0x1ebc10],_0x2f6a67[_0x48feeb(0xc6)]===_0x1ebc10&&delete _0x2f6a67['profile'],writeSecureFile(_0x21a6db,JSON[_0x48feeb(0xec)](_0x2f6a67,null,0x2));}export function getActiveProfile(){const _0x508d8a=a63_0x36fd12,_0x305688=loadSessionContext();if(_0x305688?.[_0x508d8a(0xc6)])return _0x305688[_0x508d8a(0xc6)];if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x2d5096=getGlobalConfigPath();if(!a63_0x3d23b9['existsSync'](_0x2d5096))return null;try{const _0x2e6636=a63_0x3d23b9[_0x508d8a(0x108)](_0x2d5096,_0x508d8a(0xc5)),_0x5c10fd=JSON['parse'](_0x2e6636);return _0x5c10fd[_0x508d8a(0xc6)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x14cb34){const _0x13b3fe=a63_0x36fd12,_0x412bd5=getGlobalConfigPath(),_0x270256=getConfigDir();!a63_0x3d23b9[_0x13b3fe(0xe1)](_0x270256)&&createSecureDirectory(_0x270256);let _0x2e2408={};if(a63_0x3d23b9['existsSync'](_0x412bd5))try{const _0x1defcd=a63_0x3d23b9['readFileSync'](_0x412bd5,_0x13b3fe(0xc5));_0x2e2408=JSON['parse'](_0x1defcd);}catch{console[_0x13b3fe(0xd5)](_0x13b3fe(0x104)+_0x412bd5+_0x13b3fe(0xc8));}_0x2e2408['site']=_0x14cb34,writeSecureFile(_0x412bd5,JSON[_0x13b3fe(0xec)](_0x2e2408,null,0x2));}export function saveActiveProfileToUserConfig(_0x23eabc){const _0x4b1d77=a63_0x36fd12;validateProfileName(_0x23eabc);const _0x3e4310=getGlobalConfigPath(),_0x21010b=getConfigDir();!a63_0x3d23b9[_0x4b1d77(0xe1)](_0x21010b)&&createSecureDirectory(_0x21010b);let _0x58080e={};if(a63_0x3d23b9[_0x4b1d77(0xe1)](_0x3e4310))try{const _0x3a4c3c=a63_0x3d23b9[_0x4b1d77(0x108)](_0x3e4310,_0x4b1d77(0xc5));_0x58080e=JSON[_0x4b1d77(0x10b)](_0x3a4c3c);}catch{console['warn'](_0x4b1d77(0x104)+_0x3e4310+_0x4b1d77(0xc8));}_0x58080e[_0x4b1d77(0xc6)]=_0x23eabc,writeSecureFile(_0x3e4310,JSON[_0x4b1d77(0xec)](_0x58080e,null,0x2));}function clearFieldFromUserConfig(_0x4a9ee8){const _0x44553d=a63_0x36fd12,_0x5c6984=getGlobalConfigPath();if(!a63_0x3d23b9['existsSync'](_0x5c6984))return;let _0x27978c={};try{const _0x1d8b7b=a63_0x3d23b9[_0x44553d(0x108)](_0x5c6984,_0x44553d(0xc5));_0x27978c=JSON[_0x44553d(0x10b)](_0x1d8b7b);}catch{return;}delete _0x27978c[_0x4a9ee8],writeSecureFile(_0x5c6984,JSON[_0x44553d(0xec)](_0x27978c,null,0x2));}export function clearDefaultSiteFromUserConfig(){clearFieldFromUserConfig('site');}export function clearActiveProfileFromUserConfig(){const _0x2934df=a63_0x36fd12;clearFieldFromUserConfig(_0x2934df(0xc6));}export function createProfile(_0xd0aa41,_0x2d0bd1){const _0x3f7597=a63_0x36fd12;validateProfileName(_0xd0aa41);if(profileExists(_0xd0aa41))throw new Error(_0x3f7597(0xcb)+_0xd0aa41+_0x3f7597(0xe7));saveProfile(_0xd0aa41,_0x2d0bd1);}export function saveProfileCredentials(_0x398f64,_0x5574d4){const _0x46867e=a63_0x36fd12;validateProfileName(_0x398f64);if(!profileExists(_0x398f64))throw new Error(_0x46867e(0xcb)+_0x398f64+_0x46867e(0x110));const _0x8652c4=getNewCredentialPath(_0x398f64);writeSecureFile(_0x8652c4,_0x5574d4);}export function loadProfileCredentials(_0x12cca5){const _0x52b5d8=a63_0x36fd12;validateProfileName(_0x12cca5);const _0x3811eb=getNewCredentialPath(_0x12cca5);if(a63_0x3d23b9[_0x52b5d8(0xe1)](_0x3811eb))try{return a63_0x3d23b9['readFileSync'](_0x3811eb,_0x52b5d8(0xc5));}catch{}const _0x23a2b8=getOldCredentialPath(_0x12cca5);if(a63_0x3d23b9[_0x52b5d8(0xe1)](_0x23a2b8)){console['warn'](_0x52b5d8(0xd3)+_0x12cca5+'\x27'),console['warn'](_0x52b5d8(0xca)),console[_0x52b5d8(0xd5)](_0x52b5d8(0xcd)+_0x23a2b8+'\x22\x20\x22'+_0x3811eb+'\x22'),console[_0x52b5d8(0xd5)](_0x52b5d8(0xe3));try{return a63_0x3d23b9[_0x52b5d8(0x108)](_0x23a2b8,_0x52b5d8(0xc5));}catch{return null;}}return null;}
@@ -1 +1 @@
1
- const a64_0x1d5abd=a64_0x2283;(function(_0x43b78f,_0x2ef72f){const _0x197642=a64_0x2283,_0x3b1065=_0x43b78f();while(!![]){try{const _0xec0fdd=parseInt(_0x197642(0x1bd))/0x1*(-parseInt(_0x197642(0x1ad))/0x2)+parseInt(_0x197642(0x1be))/0x3*(-parseInt(_0x197642(0x1c4))/0x4)+-parseInt(_0x197642(0x1cb))/0x5*(-parseInt(_0x197642(0x1c2))/0x6)+parseInt(_0x197642(0x1b1))/0x7*(parseInt(_0x197642(0x1bb))/0x8)+parseInt(_0x197642(0x1cc))/0x9+parseInt(_0x197642(0x1af))/0xa*(-parseInt(_0x197642(0x1bf))/0xb)+-parseInt(_0x197642(0x1c7))/0xc*(-parseInt(_0x197642(0x1ca))/0xd);if(_0xec0fdd===_0x2ef72f)break;else _0x3b1065['push'](_0x3b1065['shift']());}catch(_0x535662){_0x3b1065['push'](_0x3b1065['shift']());}}}(a64_0x4ce9,0xc0edc));import*as a64_0x13b771 from'node:fs';import*as a64_0x5444d8 from'node:path';function a64_0x2283(_0xbfcb51,_0x18a407){_0xbfcb51=_0xbfcb51-0x1ab;const _0x4ce927=a64_0x4ce9();let _0x22836a=_0x4ce927[_0xbfcb51];return _0x22836a;}const PROJECT_CONFIG_FILENAME=a64_0x1d5abd(0x1bc);export function findProjectConfigPath(_0x682632){const _0x39c122=a64_0x1d5abd;let _0x5cbd38=_0x682632||process[_0x39c122(0x1c1)]();while(!![]){const _0x3f9083=a64_0x5444d8['join'](_0x5cbd38,PROJECT_CONFIG_FILENAME);if(a64_0x13b771[_0x39c122(0x1c9)](_0x3f9083))return _0x3f9083;const _0x507972=a64_0x5444d8[_0x39c122(0x1ba)](_0x5cbd38);if(_0x507972===_0x5cbd38)return null;_0x5cbd38=_0x507972;}}export function loadProjectConfig(_0x4d576c){const _0xfc2f92=a64_0x1d5abd,_0xa7c58d=findProjectConfigPath(_0x4d576c);if(!_0xa7c58d)return null;try{const _0x4d75e4=a64_0x13b771[_0xfc2f92(0x1c6)](_0xa7c58d,'utf-8'),_0xe0b68=JSON[_0xfc2f92(0x1c0)](_0x4d75e4),_0x5277ec=JSON[_0xfc2f92(0x1ac)](_0xe0b68);if(_0x5277ec[_0xfc2f92(0x1c8)](_0xfc2f92(0x1c5))||_0x5277ec[_0xfc2f92(0x1c8)](_0xfc2f92(0x1b4))||_0x5277ec[_0xfc2f92(0x1c8)](_0xfc2f92(0x1b9)))throw new Error(_0xfc2f92(0x1b8)+_0xa7c58d+').\x20'+_0xfc2f92(0x1b3));const {metadata:_0x2af098,profile:_0x571d68,..._0x38b286}=_0xe0b68;return _0x571d68&&console[_0xfc2f92(0x1ab)](_0xfc2f92(0x1b7)+_0xa7c58d+'\x20is\x20ignored.\x20'+'Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json'),_0x38b286;}catch(_0x1472fd){if(_0x1472fd instanceof Error&&'code'in _0x1472fd&&_0x1472fd[_0xfc2f92(0x1b6)]==='ENOENT')return null;throw new Error('Failed\x20to\x20load\x20project\x20config\x20from\x20'+_0xa7c58d+':\x20'+_0x1472fd);}}function a64_0x4ce9(){const _0x212e00=['66Wztcgx','join','8INhFTi','TD_API_KEY','readFileSync','168JdTVLY','includes','existsSync','103558VEcDgQ','451495oUlvDf','8149896lgFDmF','warn','stringify','2LXVTUf','writeFileSync','60cXpjOc','profile','188986RSuJCx','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','apiKey','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','code','Warning:\x20\x27profile\x27\x20field\x20in\x20','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','api_key','dirname','56xuKRuT','tdx.json','525309meYrzx','902094ZfhPgL','517737eeUsTb','parse','cwd'];a64_0x4ce9=function(){return _0x212e00;};return a64_0x4ce9();}export function saveProjectConfig(_0x562e9f,_0x595dd2){const _0x590f41=a64_0x1d5abd,_0xa71925=_0x595dd2||process[_0x590f41(0x1c1)](),_0x22fbbe=a64_0x5444d8[_0x590f41(0x1c3)](_0xa71925,PROJECT_CONFIG_FILENAME),_0x4c9374=JSON[_0x590f41(0x1ac)](_0x562e9f);if(_0x4c9374[_0x590f41(0x1c8)](_0x590f41(0x1c5))||_0x4c9374['includes'](_0x590f41(0x1b4))||_0x4c9374[_0x590f41(0x1c8)]('api_key'))throw new Error(_0x590f41(0x1b2));if(_0x590f41(0x1b0)in _0x562e9f)throw new Error(_0x590f41(0x1b5));a64_0x13b771[_0x590f41(0x1ae)](_0x22fbbe,JSON[_0x590f41(0x1ac)](_0x562e9f,null,0x2));}export function hasProjectConfig(_0x481a43){return findProjectConfigPath(_0x481a43)!==null;}export function getProjectRoot(_0x5ef712){const _0x2aa605=a64_0x1d5abd,_0x236d3d=findProjectConfigPath(_0x5ef712);return _0x236d3d?a64_0x5444d8[_0x2aa605(0x1ba)](_0x236d3d):null;}
1
+ const a64_0x2cf919=a64_0x129a;(function(_0x44523b,_0x268645){const _0x545ba8=a64_0x129a,_0x52444a=_0x44523b();while(!![]){try{const _0x5c066f=-parseInt(_0x545ba8(0x1bd))/0x1+parseInt(_0x545ba8(0x1c4))/0x2+parseInt(_0x545ba8(0x1d5))/0x3+parseInt(_0x545ba8(0x1d4))/0x4*(-parseInt(_0x545ba8(0x1c6))/0x5)+parseInt(_0x545ba8(0x1cd))/0x6*(parseInt(_0x545ba8(0x1ce))/0x7)+parseInt(_0x545ba8(0x1cb))/0x8*(-parseInt(_0x545ba8(0x1c9))/0x9)+parseInt(_0x545ba8(0x1c8))/0xa;if(_0x5c066f===_0x268645)break;else _0x52444a['push'](_0x52444a['shift']());}catch(_0x1177b9){_0x52444a['push'](_0x52444a['shift']());}}}(a64_0x376d,0x52aab));function a64_0x129a(_0x5a53e1,_0x43f2a1){_0x5a53e1=_0x5a53e1-0x1b9;const _0x376da4=a64_0x376d();let _0x129af6=_0x376da4[_0x5a53e1];return _0x129af6;}import*as a64_0x19fe1f from'node:fs';import*as a64_0x57c60b from'node:path';const PROJECT_CONFIG_FILENAME=a64_0x2cf919(0x1d3);export function findProjectConfigPath(_0x3c1383){const _0x5aba7d=a64_0x2cf919;let _0x157d97=_0x3c1383||process[_0x5aba7d(0x1d2)]();while(!![]){const _0x2ef933=a64_0x57c60b[_0x5aba7d(0x1d9)](_0x157d97,PROJECT_CONFIG_FILENAME);if(a64_0x19fe1f[_0x5aba7d(0x1cf)](_0x2ef933))return _0x2ef933;const _0x1560ff=a64_0x57c60b[_0x5aba7d(0x1c1)](_0x157d97);if(_0x1560ff===_0x157d97)return null;_0x157d97=_0x1560ff;}}export function loadProjectConfig(_0x501171){const _0x5a69d3=a64_0x2cf919,_0x41f141=findProjectConfigPath(_0x501171);if(!_0x41f141)return null;try{const _0x22d8ee=a64_0x19fe1f['readFileSync'](_0x41f141,_0x5a69d3(0x1cc)),_0x168d0d=JSON[_0x5a69d3(0x1c2)](_0x22d8ee),_0x28c428=JSON[_0x5a69d3(0x1bf)](_0x168d0d);if(_0x28c428['includes']('TD_API_KEY')||_0x28c428[_0x5a69d3(0x1bb)]('apiKey')||_0x28c428[_0x5a69d3(0x1bb)]('api_key'))throw new Error(_0x5a69d3(0x1d6)+_0x41f141+_0x5a69d3(0x1b9)+_0x5a69d3(0x1c0));const {metadata:_0x5d24b0,profile:_0x2be153,..._0x4056c6}=_0x168d0d;return _0x2be153&&console[_0x5a69d3(0x1c3)]('Warning:\x20\x27profile\x27\x20field\x20in\x20'+_0x41f141+_0x5a69d3(0x1d8)+'Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json'),_0x4056c6;}catch(_0x9f1b6f){if(_0x9f1b6f instanceof Error&&_0x5a69d3(0x1ca)in _0x9f1b6f&&_0x9f1b6f[_0x5a69d3(0x1ca)]===_0x5a69d3(0x1bc))return null;throw new Error(_0x5a69d3(0x1c7)+_0x41f141+':\x20'+_0x9f1b6f);}}export function saveProjectConfig(_0x5692dc,_0xf81ed){const _0x23a41f=a64_0x2cf919,_0x13ba01=_0xf81ed||process[_0x23a41f(0x1d2)](),_0x2a413f=a64_0x57c60b[_0x23a41f(0x1d9)](_0x13ba01,PROJECT_CONFIG_FILENAME),_0x11756b=JSON[_0x23a41f(0x1bf)](_0x5692dc);if(_0x11756b[_0x23a41f(0x1bb)](_0x23a41f(0x1ba))||_0x11756b[_0x23a41f(0x1bb)](_0x23a41f(0x1be))||_0x11756b[_0x23a41f(0x1bb)](_0x23a41f(0x1d7)))throw new Error(_0x23a41f(0x1d0));if(_0x23a41f(0x1c5)in _0x5692dc)throw new Error(_0x23a41f(0x1d1));a64_0x19fe1f['writeFileSync'](_0x2a413f,JSON[_0x23a41f(0x1bf)](_0x5692dc,null,0x2));}export function hasProjectConfig(_0x289b98){return findProjectConfigPath(_0x289b98)!==null;}export function getProjectRoot(_0x4afd49){const _0x45cfb5=a64_0x2cf919,_0x3b0f1e=findProjectConfigPath(_0x4afd49);return _0x3b0f1e?a64_0x57c60b[_0x45cfb5(0x1c1)](_0x3b0f1e):null;}function a64_0x376d(){const _0x549707=['8510aVBxvE','Failed\x20to\x20load\x20project\x20config\x20from\x20','7265270INmQYI','15354SYLELV','code','2984IdxLHe','utf-8','553290KYkHld','49fuuGYE','existsSync','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','cwd','tdx.json','1060EGsOjH','409548LSEtzC','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','api_key','\x20is\x20ignored.\x20','join',').\x20','TD_API_KEY','includes','ENOENT','265251GbasPN','apiKey','stringify','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','dirname','parse','warn','365348rflgfg','profile'];a64_0x376d=function(){return _0x549707;};return a64_0x376d();}
@@ -1 +1 @@
1
- (function(_0x12f01f,_0x230cf4){const _0x18d46c=a65_0x1030,_0x16b77b=_0x12f01f();while(!![]){try{const _0x13fee1=parseInt(_0x18d46c(0x7e))/0x1*(parseInt(_0x18d46c(0x76))/0x2)+-parseInt(_0x18d46c(0x6f))/0x3+-parseInt(_0x18d46c(0x74))/0x4+parseInt(_0x18d46c(0x80))/0x5*(parseInt(_0x18d46c(0x95))/0x6)+parseInt(_0x18d46c(0x78))/0x7+-parseInt(_0x18d46c(0x7f))/0x8+parseInt(_0x18d46c(0x7c))/0x9;if(_0x13fee1===_0x230cf4)break;else _0x16b77b['push'](_0x16b77b['shift']());}catch(_0x437507){_0x16b77b['push'](_0x16b77b['shift']());}}}(a65_0x2897,0xac55b));import*as a65_0x3c6bcc from'node:fs';import*as a65_0x36fee6 from'node:path';import*as a65_0x5ae886 from'node:os';function a65_0x1030(_0x1295b7,_0x461d39){_0x1295b7=_0x1295b7-0x6e;const _0x2897f1=a65_0x2897();let _0x10301a=_0x2897f1[_0x1295b7];return _0x10301a;}import{getPPID,isProcessRunning}from'../utils/process.js';function a65_0x2897(){const _0x2cae88=['6180848CfhJQA','1055lLdcXo','createdAt','.\x20This\x20is\x20insecure.\x20Removing\x20session.','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','parse','writeFileSync','stringify','.json','readFileSync','join','homedir','now','test','toISOString','includes','utf-8','warn','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','readdirSync','TD_API_KEY','endsWith','2892FPdPMd','unlinkSync','tdx','1131753qfxVmp','replace','apiKey','sessions','api_key','2147432RVzDVP','.config','6cMqvHr','sort','2870868YLjuSl','toString','existsSync','push','9891585xgzFjM','getTime','260569fEtakM'];a65_0x2897=function(){return _0x2cae88;};return a65_0x2897();}import{createSecureDirectory}from'../utils/file-permissions.js';const SESSION_EXPIRATION_MS=0x18*0x3c*0x3c*0x3e8;function getSessionsDir(){const _0x222c2c=a65_0x1030,_0x2fa2e0=process.env.TDX_CONFIG_DIR||a65_0x36fee6[_0x222c2c(0x89)](a65_0x5ae886[_0x222c2c(0x8a)](),_0x222c2c(0x75),_0x222c2c(0x6e));return a65_0x36fee6[_0x222c2c(0x89)](_0x2fa2e0,_0x222c2c(0x72));}function getSessionPath(_0x45cee6){const _0x4416b1=a65_0x1030;return a65_0x36fee6[_0x4416b1(0x89)](getSessionsDir(),_0x45cee6+'.json');}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x56031e){const _0x3515b1=a65_0x1030;if(_0x56031e)return _0x56031e;if(process.env.TDX_SESSION)return process.env.TDX_SESSION;return getCurrentSessionPID()[_0x3515b1(0x79)]();}export function loadSessionContext(_0x105182){const _0x594f33=getSessionID(_0x105182),_0x1006e2=/^\d+$/['test'](_0x594f33)?parseInt(_0x594f33,0xa):null;return _0x1006e2!==null?loadSessionContextByPID(_0x1006e2):loadSessionContextByString(_0x594f33);}export function loadSessionContextByPID(_0x3ed0b4){const _0x350032=a65_0x1030,_0x12ad0a=getSessionPath(_0x3ed0b4);if(!a65_0x3c6bcc[_0x350032(0x7a)](_0x12ad0a))return null;try{const _0x3311b2=a65_0x3c6bcc[_0x350032(0x88)](_0x12ad0a,_0x350032(0x8f)),_0x44f8ec=JSON[_0x350032(0x84)](_0x3311b2),_0x4d479f=new Date(_0x44f8ec[_0x350032(0x81)])[_0x350032(0x7d)](),_0x23a971=Date[_0x350032(0x8b)]();if(_0x23a971-_0x4d479f>SESSION_EXPIRATION_MS)return a65_0x3c6bcc[_0x350032(0x96)](_0x12ad0a),null;const _0x5864a3=JSON['stringify'](_0x44f8ec);if(_0x5864a3[_0x350032(0x8e)]('TD_API_KEY')||_0x5864a3[_0x350032(0x8e)](_0x350032(0x71))||_0x5864a3['includes']('api_key'))return console[_0x350032(0x90)](_0x350032(0x83)+_0x12ad0a+'.\x20This\x20is\x20insecure.\x20Removing\x20session.'),a65_0x3c6bcc['unlinkSync'](_0x12ad0a),null;return _0x44f8ec;}catch{try{a65_0x3c6bcc[_0x350032(0x96)](_0x12ad0a);}catch{}return null;}}function loadSessionContextByString(_0x3cf834){const _0x4f5030=a65_0x1030,_0x59acee=a65_0x36fee6[_0x4f5030(0x89)](getSessionsDir(),_0x3cf834+_0x4f5030(0x87));if(!a65_0x3c6bcc[_0x4f5030(0x7a)](_0x59acee))return null;try{const _0x19fefa=a65_0x3c6bcc[_0x4f5030(0x88)](_0x59acee,_0x4f5030(0x8f)),_0x8d3e58=JSON[_0x4f5030(0x84)](_0x19fefa),_0x1e9adf=new Date(_0x8d3e58[_0x4f5030(0x81)])[_0x4f5030(0x7d)](),_0x161f05=Date['now']();if(_0x161f05-_0x1e9adf>SESSION_EXPIRATION_MS)return a65_0x3c6bcc[_0x4f5030(0x96)](_0x59acee),null;const _0xf25919=JSON[_0x4f5030(0x86)](_0x8d3e58);if(_0xf25919[_0x4f5030(0x8e)]('TD_API_KEY')||_0xf25919[_0x4f5030(0x8e)]('apiKey')||_0xf25919[_0x4f5030(0x8e)](_0x4f5030(0x73)))return console[_0x4f5030(0x90)]('Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20'+_0x59acee+_0x4f5030(0x82)),a65_0x3c6bcc[_0x4f5030(0x96)](_0x59acee),null;return _0x8d3e58;}catch{try{a65_0x3c6bcc[_0x4f5030(0x96)](_0x59acee);}catch{}return null;}}export function saveSessionContext(_0x1413df,_0x57ad9a){const _0x5609ce=a65_0x1030,_0x4fd2ce=getSessionID(_0x57ad9a),_0xcd0876=/^\d+$/[_0x5609ce(0x8c)](_0x4fd2ce)?parseInt(_0x4fd2ce,0xa):getCurrentSessionPID(),_0x59dadb=a65_0x36fee6['join'](getSessionsDir(),_0x4fd2ce+_0x5609ce(0x87)),_0xb9d963=getSessionsDir();createSecureDirectory(_0xb9d963);const _0x92e87f=JSON[_0x5609ce(0x86)](_0x1413df);if(_0x92e87f[_0x5609ce(0x8e)](_0x5609ce(0x93))||_0x92e87f[_0x5609ce(0x8e)](_0x5609ce(0x71))||_0x92e87f[_0x5609ce(0x8e)](_0x5609ce(0x73)))throw new Error(_0x5609ce(0x91));let _0x304378;const _0x25ec3c=/^\d+$/[_0x5609ce(0x8c)](_0x4fd2ce)?loadSessionContextByPID(parseInt(_0x4fd2ce,0xa)):loadSessionContextByString(_0x4fd2ce);_0x25ec3c?_0x304378={..._0x25ec3c,..._0x1413df,'pid':_0xcd0876,'sessionId':_0x4fd2ce!==_0xcd0876['toString']()?_0x4fd2ce:undefined,'updatedAt':new Date()[_0x5609ce(0x8d)]()}:_0x304378={'pid':_0xcd0876,'sessionId':_0x4fd2ce!==_0xcd0876[_0x5609ce(0x79)]()?_0x4fd2ce:undefined,..._0x1413df,'createdAt':new Date()[_0x5609ce(0x8d)](),'updatedAt':new Date()[_0x5609ce(0x8d)]()},a65_0x3c6bcc[_0x5609ce(0x85)](_0x59dadb,JSON[_0x5609ce(0x86)](_0x304378,null,0x2));}export function clearSessionContext(_0x5124c0){const _0x2e1216=a65_0x1030,_0x51cc6b=getSessionID(_0x5124c0),_0xc4a647=a65_0x36fee6[_0x2e1216(0x89)](getSessionsDir(),_0x51cc6b+_0x2e1216(0x87));a65_0x3c6bcc[_0x2e1216(0x7a)](_0xc4a647)&&a65_0x3c6bcc[_0x2e1216(0x96)](_0xc4a647);}export function clearSessionContextField(_0x381b1c,_0x40ab4e){const _0x147d93=a65_0x1030,_0x576c34=getSessionID(_0x40ab4e),_0x3d8610=a65_0x36fee6[_0x147d93(0x89)](getSessionsDir(),_0x576c34+_0x147d93(0x87));if(!a65_0x3c6bcc[_0x147d93(0x7a)](_0x3d8610))return;try{const _0x3bb080=a65_0x3c6bcc[_0x147d93(0x88)](_0x3d8610,'utf-8'),_0x4e21c9=JSON[_0x147d93(0x84)](_0x3bb080);delete _0x4e21c9[_0x381b1c],a65_0x3c6bcc[_0x147d93(0x85)](_0x3d8610,JSON[_0x147d93(0x86)](_0x4e21c9,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x3275cb=a65_0x1030,_0xe97134=getSessionsDir();if(!a65_0x3c6bcc['existsSync'](_0xe97134))return 0x0;let _0x34f90d=0x0;const _0x5084d6=Date[_0x3275cb(0x8b)]();try{const _0x55adfd=a65_0x3c6bcc[_0x3275cb(0x92)](_0xe97134);for(const _0x24013c of _0x55adfd){if(!_0x24013c[_0x3275cb(0x94)]('.json'))continue;const _0x5b7bc1=a65_0x36fee6[_0x3275cb(0x89)](_0xe97134,_0x24013c),_0x1a82c8=_0x24013c['replace']('.json',''),_0x7a8d56=parseInt(_0x1a82c8,0xa),_0x3943b1=!isNaN(_0x7a8d56);if(_0x3943b1){if(!isProcessRunning(_0x7a8d56)){a65_0x3c6bcc[_0x3275cb(0x96)](_0x5b7bc1),_0x34f90d++;continue;}}try{const _0x2eea02=a65_0x3c6bcc['readFileSync'](_0x5b7bc1,_0x3275cb(0x8f)),_0x42b94a=JSON[_0x3275cb(0x84)](_0x2eea02),_0x1505d8=new Date(_0x42b94a[_0x3275cb(0x81)])[_0x3275cb(0x7d)]();_0x5084d6-_0x1505d8>SESSION_EXPIRATION_MS&&(a65_0x3c6bcc[_0x3275cb(0x96)](_0x5b7bc1),_0x34f90d++);}catch{a65_0x3c6bcc[_0x3275cb(0x96)](_0x5b7bc1),_0x34f90d++;}}}catch{}return _0x34f90d;}export function listActiveSessions(){const _0x32ab8=a65_0x1030,_0x4519cf=getSessionsDir();if(!a65_0x3c6bcc[_0x32ab8(0x7a)](_0x4519cf))return[];try{const _0x508f57=a65_0x3c6bcc[_0x32ab8(0x92)](_0x4519cf),_0x56e74d=[];for(const _0x3afa21 of _0x508f57){if(!_0x3afa21['endsWith']('.json'))continue;const _0x8dab36=_0x3afa21[_0x32ab8(0x70)]('.json',''),_0x5de4f5=parseInt(_0x8dab36,0xa);!isNaN(_0x5de4f5)&&isProcessRunning(_0x5de4f5)&&_0x56e74d[_0x32ab8(0x7b)](_0x5de4f5);}return _0x56e74d[_0x32ab8(0x77)]((_0x297954,_0x132cfb)=>_0x297954-_0x132cfb);}catch{return[];}}
1
+ (function(_0x2d6c9c,_0x3128ea){const _0x1344d0=a65_0x49ce,_0x1aa091=_0x2d6c9c();while(!![]){try{const _0xf20dc1=parseInt(_0x1344d0(0x1aa))/0x1+parseInt(_0x1344d0(0x195))/0x2+parseInt(_0x1344d0(0x19f))/0x3*(-parseInt(_0x1344d0(0x1ad))/0x4)+parseInt(_0x1344d0(0x193))/0x5+-parseInt(_0x1344d0(0x198))/0x6+parseInt(_0x1344d0(0x1a7))/0x7+-parseInt(_0x1344d0(0x19b))/0x8;if(_0xf20dc1===_0x3128ea)break;else _0x1aa091['push'](_0x1aa091['shift']());}catch(_0x3ba2e7){_0x1aa091['push'](_0x1aa091['shift']());}}}(a65_0x5d96,0x37086));import*as a65_0x22eebe from'node:fs';import*as a65_0xe5081 from'node:path';function a65_0x5d96(){const _0x40f46d=['toISOString','endsWith','join','257920TeHnkg','apiKey','137228rbueXV','homedir','now','2149896kbkCoB','stringify','toString','1705120PNBaAm','api_key','getTime','TD_API_KEY','15mEqilu','readFileSync','warn','readdirSync','writeFileSync','.config','parse','sort','2693978usIMsc','.\x20This\x20is\x20insecure.\x20Removing\x20session.','includes','367473gOQpaC','replace','test','60524VsXhwx','push','unlinkSync','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','.json','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','tdx','existsSync','utf-8','createdAt'];a65_0x5d96=function(){return _0x40f46d;};return a65_0x5d96();}import*as a65_0x5575b4 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 _0xbc70e9=a65_0x49ce,_0x6b80d=process.env.TDX_CONFIG_DIR||a65_0xe5081[_0xbc70e9(0x192)](a65_0x5575b4[_0xbc70e9(0x196)](),_0xbc70e9(0x1a4),_0xbc70e9(0x18c));return a65_0xe5081[_0xbc70e9(0x192)](_0x6b80d,'sessions');}function getSessionPath(_0x512a1e){const _0x157d0e=a65_0x49ce;return a65_0xe5081[_0x157d0e(0x192)](getSessionsDir(),_0x512a1e+_0x157d0e(0x1b1));}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x4dd25b){const _0x50c9dd=a65_0x49ce;if(_0x4dd25b)return _0x4dd25b;if(process.env.TDX_SESSION)return process.env.TDX_SESSION;return getCurrentSessionPID()[_0x50c9dd(0x19a)]();}export function loadSessionContext(_0x3c0082){const _0x162d3b=a65_0x49ce,_0x14da49=getSessionID(_0x3c0082),_0x121b73=/^\d+$/[_0x162d3b(0x1ac)](_0x14da49)?parseInt(_0x14da49,0xa):null;return _0x121b73!==null?loadSessionContextByPID(_0x121b73):loadSessionContextByString(_0x14da49);}export function loadSessionContextByPID(_0x4d41e1){const _0x22ff68=a65_0x49ce,_0x504dad=getSessionPath(_0x4d41e1);if(!a65_0x22eebe[_0x22ff68(0x18d)](_0x504dad))return null;try{const _0x468c3b=a65_0x22eebe[_0x22ff68(0x1a0)](_0x504dad,_0x22ff68(0x18e)),_0x439323=JSON[_0x22ff68(0x1a5)](_0x468c3b),_0x325a33=new Date(_0x439323[_0x22ff68(0x18f)])['getTime'](),_0xe8f342=Date[_0x22ff68(0x197)]();if(_0xe8f342-_0x325a33>SESSION_EXPIRATION_MS)return a65_0x22eebe[_0x22ff68(0x1af)](_0x504dad),null;const _0x5131c2=JSON['stringify'](_0x439323);if(_0x5131c2['includes'](_0x22ff68(0x19e))||_0x5131c2['includes']('apiKey')||_0x5131c2[_0x22ff68(0x1a9)](_0x22ff68(0x19c)))return console[_0x22ff68(0x1a1)](_0x22ff68(0x1b0)+_0x504dad+_0x22ff68(0x1a8)),a65_0x22eebe[_0x22ff68(0x1af)](_0x504dad),null;return _0x439323;}catch{try{a65_0x22eebe[_0x22ff68(0x1af)](_0x504dad);}catch{}return null;}}function loadSessionContextByString(_0x39b5ee){const _0x4d2323=a65_0x49ce,_0x1a2b6d=a65_0xe5081[_0x4d2323(0x192)](getSessionsDir(),_0x39b5ee+'.json');if(!a65_0x22eebe['existsSync'](_0x1a2b6d))return null;try{const _0x13996a=a65_0x22eebe[_0x4d2323(0x1a0)](_0x1a2b6d,_0x4d2323(0x18e)),_0x5b8b69=JSON['parse'](_0x13996a),_0x421382=new Date(_0x5b8b69[_0x4d2323(0x18f)])[_0x4d2323(0x19d)](),_0x16ee6f=Date[_0x4d2323(0x197)]();if(_0x16ee6f-_0x421382>SESSION_EXPIRATION_MS)return a65_0x22eebe[_0x4d2323(0x1af)](_0x1a2b6d),null;const _0x3f031e=JSON['stringify'](_0x5b8b69);if(_0x3f031e[_0x4d2323(0x1a9)](_0x4d2323(0x19e))||_0x3f031e['includes'](_0x4d2323(0x194))||_0x3f031e[_0x4d2323(0x1a9)](_0x4d2323(0x19c)))return console[_0x4d2323(0x1a1)](_0x4d2323(0x1b0)+_0x1a2b6d+'.\x20This\x20is\x20insecure.\x20Removing\x20session.'),a65_0x22eebe['unlinkSync'](_0x1a2b6d),null;return _0x5b8b69;}catch{try{a65_0x22eebe[_0x4d2323(0x1af)](_0x1a2b6d);}catch{}return null;}}export function saveSessionContext(_0x333cf3,_0x38eb0d){const _0x1d2e08=a65_0x49ce,_0x9c6d61=getSessionID(_0x38eb0d),_0x3bf2c1=/^\d+$/[_0x1d2e08(0x1ac)](_0x9c6d61)?parseInt(_0x9c6d61,0xa):getCurrentSessionPID(),_0x14f29f=a65_0xe5081[_0x1d2e08(0x192)](getSessionsDir(),_0x9c6d61+'.json'),_0x3daae3=getSessionsDir();createSecureDirectory(_0x3daae3);const _0x2220a7=JSON[_0x1d2e08(0x199)](_0x333cf3);if(_0x2220a7['includes'](_0x1d2e08(0x19e))||_0x2220a7[_0x1d2e08(0x1a9)]('apiKey')||_0x2220a7[_0x1d2e08(0x1a9)](_0x1d2e08(0x19c)))throw new Error(_0x1d2e08(0x18b));let _0x2eeebc;const _0xa1b1f=/^\d+$/[_0x1d2e08(0x1ac)](_0x9c6d61)?loadSessionContextByPID(parseInt(_0x9c6d61,0xa)):loadSessionContextByString(_0x9c6d61);_0xa1b1f?_0x2eeebc={..._0xa1b1f,..._0x333cf3,'pid':_0x3bf2c1,'sessionId':_0x9c6d61!==_0x3bf2c1[_0x1d2e08(0x19a)]()?_0x9c6d61:undefined,'updatedAt':new Date()[_0x1d2e08(0x190)]()}:_0x2eeebc={'pid':_0x3bf2c1,'sessionId':_0x9c6d61!==_0x3bf2c1[_0x1d2e08(0x19a)]()?_0x9c6d61:undefined,..._0x333cf3,'createdAt':new Date()[_0x1d2e08(0x190)](),'updatedAt':new Date()[_0x1d2e08(0x190)]()},a65_0x22eebe[_0x1d2e08(0x1a3)](_0x14f29f,JSON[_0x1d2e08(0x199)](_0x2eeebc,null,0x2));}function a65_0x49ce(_0x24b626,_0x1408c6){_0x24b626=_0x24b626-0x18b;const _0x5d968e=a65_0x5d96();let _0x49ceac=_0x5d968e[_0x24b626];return _0x49ceac;}export function clearSessionContext(_0x26ddb5){const _0xb801e7=a65_0x49ce,_0x4fc1e7=getSessionID(_0x26ddb5),_0x5f13f1=a65_0xe5081[_0xb801e7(0x192)](getSessionsDir(),_0x4fc1e7+_0xb801e7(0x1b1));a65_0x22eebe[_0xb801e7(0x18d)](_0x5f13f1)&&a65_0x22eebe[_0xb801e7(0x1af)](_0x5f13f1);}export function clearSessionContextField(_0x5d9795,_0x1ec571){const _0x19a12b=a65_0x49ce,_0x4445bf=getSessionID(_0x1ec571),_0x438d62=a65_0xe5081[_0x19a12b(0x192)](getSessionsDir(),_0x4445bf+'.json');if(!a65_0x22eebe['existsSync'](_0x438d62))return;try{const _0x2621ae=a65_0x22eebe[_0x19a12b(0x1a0)](_0x438d62,_0x19a12b(0x18e)),_0x30edfa=JSON[_0x19a12b(0x1a5)](_0x2621ae);delete _0x30edfa[_0x5d9795],a65_0x22eebe['writeFileSync'](_0x438d62,JSON[_0x19a12b(0x199)](_0x30edfa,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x2313e8=a65_0x49ce,_0x19de91=getSessionsDir();if(!a65_0x22eebe['existsSync'](_0x19de91))return 0x0;let _0x4aa6e1=0x0;const _0x311c8e=Date[_0x2313e8(0x197)]();try{const _0x35aa1f=a65_0x22eebe[_0x2313e8(0x1a2)](_0x19de91);for(const _0x526d2d of _0x35aa1f){if(!_0x526d2d[_0x2313e8(0x191)]('.json'))continue;const _0x2f7ec5=a65_0xe5081['join'](_0x19de91,_0x526d2d),_0x15d7a7=_0x526d2d[_0x2313e8(0x1ab)](_0x2313e8(0x1b1),''),_0x48c1ce=parseInt(_0x15d7a7,0xa),_0x19eb87=!isNaN(_0x48c1ce);if(_0x19eb87){if(!isProcessRunning(_0x48c1ce)){a65_0x22eebe[_0x2313e8(0x1af)](_0x2f7ec5),_0x4aa6e1++;continue;}}try{const _0x48b516=a65_0x22eebe[_0x2313e8(0x1a0)](_0x2f7ec5,_0x2313e8(0x18e)),_0x17e2c8=JSON[_0x2313e8(0x1a5)](_0x48b516),_0x5833dc=new Date(_0x17e2c8[_0x2313e8(0x18f)])['getTime']();_0x311c8e-_0x5833dc>SESSION_EXPIRATION_MS&&(a65_0x22eebe[_0x2313e8(0x1af)](_0x2f7ec5),_0x4aa6e1++);}catch{a65_0x22eebe[_0x2313e8(0x1af)](_0x2f7ec5),_0x4aa6e1++;}}}catch{}return _0x4aa6e1;}export function listActiveSessions(){const _0xd65fc6=a65_0x49ce,_0x546552=getSessionsDir();if(!a65_0x22eebe[_0xd65fc6(0x18d)](_0x546552))return[];try{const _0x1dd5b0=a65_0x22eebe[_0xd65fc6(0x1a2)](_0x546552),_0x39a639=[];for(const _0x172f4e of _0x1dd5b0){if(!_0x172f4e[_0xd65fc6(0x191)](_0xd65fc6(0x1b1)))continue;const _0x3151ca=_0x172f4e['replace'](_0xd65fc6(0x1b1),''),_0x2846df=parseInt(_0x3151ca,0xa);!isNaN(_0x2846df)&&isProcessRunning(_0x2846df)&&_0x39a639[_0xd65fc6(0x1ae)](_0x2846df);}return _0x39a639[_0xd65fc6(0x1a6)]((_0x3a0bba,_0x1de3f4)=>_0x3a0bba-_0x1de3f4);}catch{return[];}}
@@ -1 +1 @@
1
- const a66_0x6bccdf=a66_0x4ac2;(function(_0x5e5905,_0x3cef71){const _0x475aef=a66_0x4ac2,_0x4a0171=_0x5e5905();while(!![]){try{const _0x513e4d=parseInt(_0x475aef(0x16f))/0x1+-parseInt(_0x475aef(0x165))/0x2*(parseInt(_0x475aef(0x16d))/0x3)+parseInt(_0x475aef(0x16a))/0x4*(parseInt(_0x475aef(0x168))/0x5)+-parseInt(_0x475aef(0x16c))/0x6*(-parseInt(_0x475aef(0x170))/0x7)+-parseInt(_0x475aef(0x163))/0x8*(parseInt(_0x475aef(0x16b))/0x9)+-parseInt(_0x475aef(0x162))/0xa*(parseInt(_0x475aef(0x166))/0xb)+parseInt(_0x475aef(0x164))/0xc*(-parseInt(_0x475aef(0x167))/0xd);if(_0x513e4d===_0x3cef71)break;else _0x4a0171['push'](_0x4a0171['shift']());}catch(_0x1f1a98){_0x4a0171['push'](_0x4a0171['shift']());}}}(a66_0x156f,0x77683));import{createProfileCache}from'../utils/global-cache.js';const userCache=createProfileCache('users-{profile}.json',a66_0x6bccdf(0x171));function a66_0x156f(){const _0x31a7c0=['451717FtEeoy','core/user-cache','users','write','clear','109890NfkvXa','1643040gpwoKm','485292uMYtBX','2BvzMLy','66WghGwv','143wGWGCG','145IJOTAH','read','6124bPWuST','9CGhrcP','66wnkeqL','1110351HdDsxx','now','821133AuAyKY'];a66_0x156f=function(){return _0x31a7c0;};return a66_0x156f();}function a66_0x4ac2(_0x180142,_0x9e0a3e){_0x180142=_0x180142-0x161;const _0x156f07=a66_0x156f();let _0x4ac23a=_0x156f07[_0x180142];return _0x4ac23a;}export function loadCachedUsers(_0x341286){const _0x54dff6=a66_0x6bccdf,_0x5d5e4e=userCache[_0x54dff6(0x169)](_0x341286);return _0x5d5e4e?.[_0x54dff6(0x172)]??null;}export function saveCachedUsers(_0x4f470a,_0x1751e2){const _0x191b99=a66_0x6bccdf;userCache[_0x191b99(0x173)](_0x4f470a,{'users':_0x1751e2,'cachedAt':Date[_0x191b99(0x16e)]()});}export function clearUserCache(_0x3fd7c9){const _0x5a0b34=a66_0x6bccdf;userCache[_0x5a0b34(0x161)](_0x3fd7c9);}
1
+ function a66_0x57fc(){const _0xc6ea1=['now','read','12RcFQfD','1735984ltlhjn','10EZnzkt','write','86185GCLLbt','3037347qYdWHj','74922vFCVid','users','7aygROn','323802DmMwHF','users-{profile}.json','clear','core/user-cache','1677624FFUdEE','352754mUJIMe'];a66_0x57fc=function(){return _0xc6ea1;};return a66_0x57fc();}function a66_0x45ff(_0x4cd6aa,_0x13c6c0){_0x4cd6aa=_0x4cd6aa-0xb4;const _0x57fc21=a66_0x57fc();let _0x45ff88=_0x57fc21[_0x4cd6aa];return _0x45ff88;}const a66_0x55e5be=a66_0x45ff;(function(_0x363771,_0x123fe7){const _0x3309af=a66_0x45ff,_0x228d5e=_0x363771();while(!![]){try{const _0x49a0c7=parseInt(_0x3309af(0xb9))/0x1+-parseInt(_0x3309af(0xc1))/0x2+-parseInt(_0x3309af(0xbc))/0x3+-parseInt(_0x3309af(0xc4))/0x4*(-parseInt(_0x3309af(0xb7))/0x5)+parseInt(_0x3309af(0xc0))/0x6+parseInt(_0x3309af(0xbb))/0x7*(-parseInt(_0x3309af(0xb4))/0x8)+-parseInt(_0x3309af(0xb8))/0x9*(-parseInt(_0x3309af(0xb5))/0xa);if(_0x49a0c7===_0x123fe7)break;else _0x228d5e['push'](_0x228d5e['shift']());}catch(_0x1ae355){_0x228d5e['push'](_0x228d5e['shift']());}}}(a66_0x57fc,0x3b2eb));import{createProfileCache}from'../utils/global-cache.js';const userCache=createProfileCache(a66_0x55e5be(0xbd),a66_0x55e5be(0xbf));export function loadCachedUsers(_0x2390e0){const _0x3e718f=a66_0x55e5be,_0xf46097=userCache[_0x3e718f(0xc3)](_0x2390e0);return _0xf46097?.[_0x3e718f(0xba)]??null;}export function saveCachedUsers(_0x55fb68,_0x41eacc){const _0x549172=a66_0x55e5be;userCache[_0x549172(0xb6)](_0x55fb68,{'users':_0x41eacc,'cachedAt':Date[_0x549172(0xc2)]()});}export function clearUserCache(_0x39be51){const _0x37a561=a66_0x55e5be;userCache[_0x37a561(0xbe)](_0x39be51);}
@@ -1 +1 @@
1
- (function(_0xe74b,_0x4ce535){const _0x59eafe=a67_0x2cc9,_0x5b8c99=_0xe74b();while(!![]){try{const _0x2ada80=parseInt(_0x59eafe(0x1f7))/0x1+-parseInt(_0x59eafe(0x1eb))/0x2+-parseInt(_0x59eafe(0x1f5))/0x3+parseInt(_0x59eafe(0x1f4))/0x4*(parseInt(_0x59eafe(0x1ec))/0x5)+parseInt(_0x59eafe(0x1ee))/0x6*(parseInt(_0x59eafe(0x1f8))/0x7)+-parseInt(_0x59eafe(0x1f6))/0x8+parseInt(_0x59eafe(0x1e9))/0x9;if(_0x2ada80===_0x4ce535)break;else _0x5b8c99['push'](_0x5b8c99['shift']());}catch(_0x1eceea){_0x5b8c99['push'](_0x5b8c99['shift']());}}}(a67_0x512a,0x900db));import{readFileSync}from'fs';import{fileURLToPath}from'url';function a67_0x512a(){const _0x28cdef=['../../package.json','parse','includes','../build-info.json','utf-8','308mEOiEw','425613lyJYXJ','3831824LZidAD','835909wAuSsB','6797mxVLnI','2937231bitkVj','version','1107912enNQTF','9305IbCvgE','0.0.0','2838bHPhdX'];a67_0x512a=function(){return _0x28cdef;};return a67_0x512a();}import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0x149f45=a67_0x2cc9;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x32459b=fileURLToPath(import.meta.url),_0x1fc681=dirname(_0x32459b);try{const _0x4db3d2=join(_0x1fc681,_0x149f45(0x1f2));cachedBuildInfo=JSON[_0x149f45(0x1f0)](readFileSync(_0x4db3d2,_0x149f45(0x1f3)));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0x50da9d=a67_0x2cc9;if(cachedVersion!==null)return cachedVersion;const _0x1d364d=fileURLToPath(import.meta.url),_0x2fd419=dirname(_0x1d364d),_0x2816d5=getBuildInfo();if(_0x2816d5[_0x50da9d(0x1ea)])return cachedVersion=_0x2816d5['version'],cachedVersion;try{const _0x409960=join(_0x2fd419,_0x50da9d(0x1ef)),_0x1dfb77=JSON[_0x50da9d(0x1f0)](readFileSync(_0x409960,_0x50da9d(0x1f3)));cachedVersion=_0x1dfb77['version'];}catch{cachedVersion=_0x50da9d(0x1ed);}return cachedVersion;}function a67_0x2cc9(_0x561de2,_0x36b99b){_0x561de2=_0x561de2-0x1e9;const _0x512a1e=a67_0x512a();let _0x2cc9f4=_0x512a1e[_0x561de2];return _0x2cc9f4;}export function isDevVersion(){const _0x323f46=a67_0x2cc9,_0x27fd0c=getVersion();return _0x27fd0c[_0x323f46(0x1f1)]('.dev')||_0x27fd0c[_0x323f46(0x1f1)]('-');}
1
+ (function(_0x461448,_0x2cda70){const _0x23953a=a67_0x27a1,_0x248bda=_0x461448();while(!![]){try{const _0x34871a=-parseInt(_0x23953a(0x8c))/0x1+parseInt(_0x23953a(0x81))/0x2*(parseInt(_0x23953a(0x8a))/0x3)+parseInt(_0x23953a(0x87))/0x4+-parseInt(_0x23953a(0x8f))/0x5*(parseInt(_0x23953a(0x89))/0x6)+parseInt(_0x23953a(0x80))/0x7*(parseInt(_0x23953a(0x82))/0x8)+parseInt(_0x23953a(0x84))/0x9*(parseInt(_0x23953a(0x8e))/0xa)+-parseInt(_0x23953a(0x8b))/0xb;if(_0x34871a===_0x2cda70)break;else _0x248bda['push'](_0x248bda['shift']());}catch(_0x1adb17){_0x248bda['push'](_0x248bda['shift']());}}}(a67_0xe632,0x41a3d));import{readFileSync}from'fs';import{fileURLToPath}from'url';function a67_0xe632(){const _0x31aeb9=['0.0.0','1257114zexalZ','33UVxnen','7379273JaIEoZ','86743DNtFTQ','utf-8','1816510SpdYCo','5yxmXYi','parse','613739CRnuzH','90582vBidTR','40ziCTXG','includes','9TWPnJU','version','.dev','470916dmnLMY'];a67_0xe632=function(){return _0x31aeb9;};return a67_0xe632();}import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0x2ea31e=a67_0x27a1;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0xc2f19=fileURLToPath(import.meta.url),_0x44f6e0=dirname(_0xc2f19);try{const _0x6dcf97=join(_0x44f6e0,'../build-info.json');cachedBuildInfo=JSON[_0x2ea31e(0x90)](readFileSync(_0x6dcf97,_0x2ea31e(0x8d)));}catch{cachedBuildInfo={};}return cachedBuildInfo;}function a67_0x27a1(_0xc3f9d6,_0x2389b1){_0xc3f9d6=_0xc3f9d6-0x80;const _0xe632f8=a67_0xe632();let _0x27a1c7=_0xe632f8[_0xc3f9d6];return _0x27a1c7;}export function getVersion(){const _0x4ac006=a67_0x27a1;if(cachedVersion!==null)return cachedVersion;const _0x53e20d=fileURLToPath(import.meta.url),_0x2055c2=dirname(_0x53e20d),_0x2cd89b=getBuildInfo();if(_0x2cd89b[_0x4ac006(0x85)])return cachedVersion=_0x2cd89b[_0x4ac006(0x85)],cachedVersion;try{const _0x12b54c=join(_0x2055c2,'../../package.json'),_0x3d7803=JSON[_0x4ac006(0x90)](readFileSync(_0x12b54c,_0x4ac006(0x8d)));cachedVersion=_0x3d7803[_0x4ac006(0x85)];}catch{cachedVersion=_0x4ac006(0x88);}return cachedVersion;}export function isDevVersion(){const _0x2a067c=a67_0x27a1,_0x30c98f=getVersion();return _0x30c98f[_0x2a067c(0x83)](_0x2a067c(0x86))||_0x30c98f[_0x2a067c(0x83)]('-');}