@treasuredata/tdx 2026.3.14 → 2026.3.16

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 (202) hide show
  1. package/README.md +9 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/commands/activations.js +1 -1
  7. package/dist/commands/agent-command.js +1 -1
  8. package/dist/commands/agent-test-command.js +1 -1
  9. package/dist/commands/api-command.js +1 -1
  10. package/dist/commands/auth-command.js +1 -1
  11. package/dist/commands/auth-login-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-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/query/index.js +1 -1
  127. package/dist/sdk/query/sql-parser.js +1 -1
  128. package/dist/sdk/realtime.js +1 -1
  129. package/dist/sdk/schedule.js +1 -1
  130. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  131. package/dist/sdk/segment/fields-display.js +1 -1
  132. package/dist/sdk/segment/file-discovery.js +1 -1
  133. package/dist/sdk/segment/journey-utils.js +1 -1
  134. package/dist/sdk/segment/journey-validator.js +1 -1
  135. package/dist/sdk/segment/journey-yaml.js +1 -1
  136. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  137. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  138. package/dist/sdk/segment/pull-workflow.js +1 -1
  139. package/dist/sdk/segment/push-recovery.js +1 -1
  140. package/dist/sdk/segment/push-workflow.js +1 -1
  141. package/dist/sdk/segment/resolution-context.js +1 -1
  142. package/dist/sdk/segment/segment-path-parser.js +1 -1
  143. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  144. package/dist/sdk/segment/segment-validator.js +1 -1
  145. package/dist/sdk/segment/target-resolution.js +1 -1
  146. package/dist/sdk/segment/tdx-config.js +1 -1
  147. package/dist/sdk/segment/types/activation-schema.js +1 -1
  148. package/dist/sdk/segment/types/journey-def.js +1 -1
  149. package/dist/sdk/segment/types/journey-schema.js +1 -1
  150. package/dist/sdk/segment/types/segment-def.js +1 -1
  151. package/dist/sdk/segment/types/segment-schema.js +1 -1
  152. package/dist/sdk/segment/validate-files.js +1 -1
  153. package/dist/sdk/segment/yaml-validator.js +1 -1
  154. package/dist/sdk/segment.js +1 -1
  155. package/dist/sdk/types/index.js +1 -1
  156. package/dist/sdk/types/progress.js +1 -1
  157. package/dist/sdk/user.js +1 -1
  158. package/dist/sdk/util/format-detector.js +1 -1
  159. package/dist/sdk/util/formatters.js +1 -1
  160. package/dist/sdk/util/index.js +1 -1
  161. package/dist/sdk/util/paginate.js +1 -1
  162. package/dist/sdk/util/tree-formatter.js +1 -1
  163. package/dist/sdk/workflow/archive-validation.js +1 -1
  164. package/dist/sdk/workflow/clone-workflow.js +1 -1
  165. package/dist/sdk/workflow/index.js +1 -1
  166. package/dist/sdk/workflow/pull-workflow.js +1 -1
  167. package/dist/sdk/workflow/push-workflow.js +1 -1
  168. package/dist/sdk/workflow/tdx-config.js +1 -1
  169. package/dist/sdk/workflow/workflow-utils.js +1 -1
  170. package/dist/test-utils/command-runner.js +1 -1
  171. package/dist/test-utils/factories.js +1 -1
  172. package/dist/test-utils/fixtures.js +1 -1
  173. package/dist/test-utils/http-mock.js +1 -1
  174. package/dist/test-utils/index.js +1 -1
  175. package/dist/utils/async.js +1 -1
  176. package/dist/utils/colors.js +1 -1
  177. package/dist/utils/diff.js +1 -1
  178. package/dist/utils/file-permissions.js +1 -1
  179. package/dist/utils/file-reader.js +1 -1
  180. package/dist/utils/github-releases.js +1 -1
  181. package/dist/utils/global-cache.js +1 -1
  182. package/dist/utils/json-loader.js +1 -1
  183. package/dist/utils/local-cache.js +1 -1
  184. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  185. package/dist/utils/logger/formatters/index.js +1 -1
  186. package/dist/utils/logger/handlers/console-handler.js +1 -1
  187. package/dist/utils/logger/handlers/file-handler.js +1 -1
  188. package/dist/utils/logger/handlers/index.js +1 -1
  189. package/dist/utils/logger/handlers/null-handler.js +1 -1
  190. package/dist/utils/logger/index.js +1 -1
  191. package/dist/utils/logger/logger.js +1 -1
  192. package/dist/utils/logger/types.js +1 -1
  193. package/dist/utils/option-validation.js +1 -1
  194. package/dist/utils/process.js +1 -1
  195. package/dist/utils/prompt.js +1 -1
  196. package/dist/utils/spinner.js +1 -1
  197. package/dist/utils/sse-parser.js +1 -1
  198. package/dist/utils/string-utils.js +1 -1
  199. package/dist/utils/table-ref-parser.js +1 -1
  200. package/dist/utils/tdx-logger.js +1 -1
  201. package/dist/utils/version-check.js +1 -1
  202. package/package.json +2 -2
@@ -1 +1 @@
1
- const a54_0x25f646=a54_0x5dab;(function(_0x33f5e,_0x320685){const _0x4e0273=a54_0x5dab,_0x1fe76f=_0x33f5e();while(!![]){try{const _0x43f0c8=-parseInt(_0x4e0273(0x7e))/0x1+-parseInt(_0x4e0273(0x7b))/0x2+-parseInt(_0x4e0273(0x87))/0x3*(-parseInt(_0x4e0273(0x92))/0x4)+-parseInt(_0x4e0273(0xa1))/0x5+-parseInt(_0x4e0273(0x98))/0x6*(-parseInt(_0x4e0273(0x72))/0x7)+parseInt(_0x4e0273(0x91))/0x8*(-parseInt(_0x4e0273(0x73))/0x9)+parseInt(_0x4e0273(0x83))/0xa;if(_0x43f0c8===_0x320685)break;else _0x1fe76f['push'](_0x1fe76f['shift']());}catch(_0x199b6e){_0x1fe76f['push'](_0x1fe76f['shift']());}}}(a54_0x1652,0x26524));function a54_0x5dab(_0x4f1107,_0x2839b0){_0x4f1107=_0x4f1107-0x6b;const _0x1652a9=a54_0x1652();let _0x5dab92=_0x1652a9[_0x4f1107];return _0x5dab92;}import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a54_0x4bf65e from'node:fs';import*as a54_0xeec917 from'node:path';import{SITE_ALIASES}from'../sdk/types/index.js';import{getKeychainAPIKey,saveKeychainAPIKey}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a54_0x2e31d3 from'chalk';import{getGlobalCacheDir,createOptionalProfileCache}from'../utils/global-cache.js';export function getConfigDir(){const _0x5a2d83=a54_0x5dab;return process.env.TDX_CONFIG_DIR||join(homedir(),_0x5a2d83(0x86),_0x5a2d83(0xa2));}export function getConfigFile(){const _0x4a3862=a54_0x5dab;return join(getConfigDir(),_0x4a3862(0x7a));}export function getConfigFilePath(_0x321d90){const _0x29a2f1=a54_0x5dab,_0x3ca9d4=getConfigDir();return _0x321d90?a54_0xeec917['join'](_0x3ca9d4,_0x29a2f1(0xab)+_0x321d90):getConfigFile();}export function getCacheDir(){return getGlobalCacheDir();}const llmProjectCache=createOptionalProfileCache(a54_0x25f646(0x6f),a54_0x25f646(0xb6));export function getLLMProjectCacheFile(_0x140bc6){return llmProjectCache['path'](_0x140bc6);}export function readCachedLLMProject(_0xcc6212){const _0x288e8d=a54_0x25f646,_0x2eef5f=llmProjectCache[_0x288e8d(0x6d)](_0xcc6212);if(_0x2eef5f&&typeof _0x2eef5f['id']===_0x288e8d(0x8d)&&typeof _0x2eef5f[_0x288e8d(0x94)]===_0x288e8d(0x8d))return _0x2eef5f;return null;}export function writeCachedLLMProject(_0xdabcba,_0x4124fc,_0x4d095e){const _0x25aa57=a54_0x25f646;try{llmProjectCache[_0x25aa57(0xaa)]({'name':_0xdabcba,'id':_0x4124fc},_0x4d095e);}catch{}}const llmAgentCache=createOptionalProfileCache(a54_0x25f646(0x75),a54_0x25f646(0x71));export function getLLMAgentCacheFile(_0x531b0e){const _0x49cce6=a54_0x25f646;return llmAgentCache[_0x49cce6(0x84)](_0x531b0e);}export function readCachedLLMAgent(_0x51021f){const _0x57453f=a54_0x25f646,_0x150942=llmAgentCache['read'](_0x51021f);if(_0x150942&&typeof _0x150942['id']==='string'&&typeof _0x150942[_0x57453f(0x94)]==='string'&&typeof _0x150942['projectId']===_0x57453f(0x8d))return _0x150942;return null;}export function writeCachedLLMAgent(_0x302b39,_0x5da555,_0x928821,_0x37d6ad){const _0x1953cf=a54_0x25f646;try{llmAgentCache[_0x1953cf(0xaa)]({'name':_0x302b39,'id':_0x5da555,'projectId':_0x928821},_0x37d6ad);}catch{}}export function clearCachedLLMAgent(_0x520700){const _0x11a6be=a54_0x25f646;try{llmAgentCache[_0x11a6be(0x70)](_0x520700);}catch{}}const accountInfoCache=createOptionalProfileCache(a54_0x25f646(0x99),a54_0x25f646(0x8e),{'suffix':a54_0x25f646(0xa4)});export function getAccountInfoCacheFile(_0x49f25f){const _0x394803=a54_0x25f646;return accountInfoCache[_0x394803(0x84)](_0x49f25f);}export function readCachedAccountInfo(_0x2aa534){const _0x41ff1d=a54_0x25f646,_0x448cc8=accountInfoCache[_0x41ff1d(0x6d)](_0x2aa534);if(_0x448cc8&&typeof _0x448cc8[_0x41ff1d(0x77)]==='string'&&typeof _0x448cc8[_0x41ff1d(0x8b)]===_0x41ff1d(0x9a))return _0x448cc8;return null;}export function writeCachedAccountInfo(_0x46e9eb,_0x483a1f,_0x442edc){const _0xf75455=a54_0x25f646;try{accountInfoCache[_0xf75455(0xaa)]({'site':_0x46e9eb,'accountId':_0x483a1f,'cachedAt':new Date()['toISOString']()},_0x442edc);}catch{}}export function parseEnvFile(_0x1d57b6){const _0x3ca5b7=a54_0x25f646,_0x41ab27={};for(const _0xf07fff of _0x1d57b6[_0x3ca5b7(0xa8)]('\x0a')){const _0x5e1eb0=_0xf07fff['trim']();if(!_0x5e1eb0||_0x5e1eb0['startsWith']('#'))continue;const _0x434e35=_0x5e1eb0[_0x3ca5b7(0x9c)](/^([^=]+)=(.*)$/);if(_0x434e35){const _0x561995=_0x434e35[0x1][_0x3ca5b7(0x95)]();let _0x4b3907=_0x434e35[0x2][_0x3ca5b7(0x95)]();(_0x4b3907[_0x3ca5b7(0x9e)]('\x22')&&_0x4b3907[_0x3ca5b7(0xb1)]('\x22')||_0x4b3907[_0x3ca5b7(0x9e)]('\x27')&&_0x4b3907[_0x3ca5b7(0xb1)]('\x27'))&&(_0x4b3907=_0x4b3907['slice'](0x1,-0x1)),_0x41ab27[_0x561995]=_0x4b3907;}}return _0x41ab27;}export function readUserConfig(){const _0x3a9f5c=a54_0x25f646,_0x241175=getConfigFile();if(!existsSync(_0x241175))return{};try{const _0x4b85f9=readFileSync(_0x241175,_0x3a9f5c(0x6e));return parseEnvFile(_0x4b85f9);}catch(_0x5241e9){return console['warn'](_0x3a9f5c(0xb3)+_0x241175+':',_0x5241e9),{};}}export function resolveSite(_0x11291d){const _0x58505b=a54_0x25f646,_0x33abc8=['us01',_0x58505b(0x90),_0x58505b(0x85),'ap02',_0x58505b(0x88),'dev-us01',_0x58505b(0xaf),_0x58505b(0xb2),_0x58505b(0xa9),_0x58505b(0x7c)];if(_0x33abc8['includes'](_0x11291d))return _0x11291d;if(_0x11291d in SITE_ALIASES)return SITE_ALIASES[_0x11291d];return console['warn']('Warning:\x20Unknown\x20site\x20\x27'+_0x11291d+'\x27,\x20defaulting\x20to\x20us01'),_0x58505b(0xa0);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function resolveAccessToken(_0x5e7869){const _0x4c0ab4=a54_0x25f646,_0x1eb324=_0x5e7869||getActiveProfileName()||undefined;if(_0x1eb324){const _0x4bd770=_0x4c0ab4(0x78)+normalizeProfileForEnvVar(_0x1eb324);if(process.env[_0x4bd770])return{'accessToken':process.env[_0x4bd770],'source':_0x4bd770+_0x4c0ab4(0x93)};}if(process.env.TDX_ACCESS_TOKEN)return{'accessToken':process.env.TDX_ACCESS_TOKEN,'source':_0x4c0ab4(0x79)};return null;}export function getAccessToken(_0x314874){return resolveAccessToken(_0x314874)?.['accessToken'];}export function getAPIKey(_0x3b3f75){const _0x2f4ef6=_0x3b3f75||getActiveProfileName();if(_0x2f4ef6){const _0x664927='TDX_API_KEY_'+normalizeProfileForEnvVar(_0x2f4ef6);if(process.env[_0x664927])return process.env[_0x664927];}if(process.env.TDX_API_KEY)return process.env.TDX_API_KEY;return undefined;}export function normalizeProfileForEnvVar(_0xc553d0){const _0x2bc434=a54_0x25f646;return _0xc553d0[_0x2bc434(0xad)]()[_0x2bc434(0x6b)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x256f63,_0x1a7ac4){const _0x324a76=a54_0x25f646,_0x2219e4=resolveAccessToken(_0x1a7ac4);if(_0x2219e4)return{'apiKey':_0x2219e4[_0x324a76(0x7f)],'source':_0x2219e4['source'],'isDeprecated':![]};const _0x39f109=_0x1a7ac4||getActiveProfileName()||undefined;if(_0x39f109){const _0x542832='TDX_API_KEY_'+normalizeProfileForEnvVar(_0x39f109);if(process.env[_0x542832])return{'apiKey':process.env[_0x542832],'source':_0x542832+'\x20env\x20var','isDeprecated':![]};const _0x1b7f20=getCachedCredential(_0x256f63,_0x39f109);if(_0x1b7f20)return{'apiKey':_0x1b7f20,'source':_0x324a76(0xae)+_0x39f109+')','isDeprecated':![]};const _0x28ea5a=await getKeychainAPIKey(_0x39f109);if(_0x28ea5a)return setCachedCredential(_0x28ea5a,_0x256f63,_0x39f109),{'apiKey':_0x28ea5a,'source':_0x324a76(0xae)+_0x39f109+')','isDeprecated':![]};}if(process.env.TDX_API_KEY)return{'apiKey':process.env.TDX_API_KEY,'source':_0x324a76(0xb5),'isDeprecated':![]};if(!_0x39f109){const _0xe040b8=getCachedCredential(_0x256f63,undefined);if(_0xe040b8)return{'apiKey':_0xe040b8,'source':_0x324a76(0xa3),'isDeprecated':![]};const _0x4264e5=await getKeychainAPIKey(undefined);if(_0x4264e5)return setCachedCredential(_0x4264e5,_0x256f63,undefined),{'apiKey':_0x4264e5,'source':'keychain','isDeprecated':![]};}return null;}export async function getAPIKeyAsync(_0x93d3b2,_0x2fa3d7){const _0x38fa26=a54_0x25f646,_0x11fd82=await resolveAPIKeyAsync(_0x93d3b2,_0x2fa3d7);return _0x11fd82?.[_0x38fa26(0x74)];}function cleanupLegacyEnvFile(_0x11eee8){const _0x280529=a54_0x25f646;if(!existsSync(_0x11eee8))return![];try{const _0x52d3f5=readFileSync(_0x11eee8,_0x280529(0x6e)),_0x7d45b7=_0x52d3f5[_0x280529(0xa8)]('\x0a'),_0x1e230c=_0x7d45b7[_0x280529(0x80)](_0x57205b=>{const _0x37263f=_0x280529,_0x5af0ce=_0x57205b['trim']();if(!_0x5af0ce||_0x5af0ce[_0x37263f(0x9e)]('#'))return!![];const [_0x5c95c8]=_0x5af0ce[_0x37263f(0xa8)]('=');return!_0x5c95c8['startsWith'](_0x37263f(0xb4));}),_0x3730ca=_0x1e230c[_0x280529(0x96)](_0x244f5c=>{const _0x6705c8=_0x280529,_0x17f279=_0x244f5c['trim']();return _0x17f279&&!_0x17f279[_0x6705c8(0x9e)]('#');});if(!_0x3730ca)return unlinkSync(_0x11eee8),!![];return writeFileSync(_0x11eee8,_0x1e230c[_0x280529(0x76)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function getActiveProfileName(){const _0x28a940=a54_0x25f646;if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x50b607=a54_0xeec917[_0x28a940(0x76)](getConfigDir(),_0x28a940(0x8a));if(!a54_0x4bf65e[_0x28a940(0x97)](_0x50b607))return null;try{const _0x11baf8=a54_0x4bf65e[_0x28a940(0x9f)](_0x50b607,_0x28a940(0x6e)),_0x3cf653=JSON[_0x28a940(0xa6)](_0x11baf8);return _0x3cf653[_0x28a940(0x9d)]||null;}catch{return null;}}export function saveAPIKey(_0x10d66e,_0x3a108f,_0x1406cc){const _0x3532e9=a54_0x25f646,_0xc2d6bd=getConfigDir(),_0x60b326=getConfigFilePath(_0x1406cc);!existsSync(_0xc2d6bd)&&mkdirSync(_0xc2d6bd,{'recursive':!![],'mode':0x1c0});let _0x40c958={};if(existsSync(_0x60b326))try{const _0x1f54c8=readFileSync(_0x60b326,'utf-8');_0x40c958=parseEnvFile(_0x1f54c8);}catch(_0x3857af){console[_0x3532e9(0xa5)](_0x3532e9(0x81)+_0x60b326+':',_0x3857af);}const _0x410395=_0x10d66e[_0x3532e9(0xad)]()['replace'](/-/g,'_');_0x40c958['TD_API_KEY_'+_0x410395]=_0x3a108f;const _0x264efd=Object['entries'](_0x40c958)[_0x3532e9(0x8c)](([_0x117e7d,_0x50a14e])=>_0x117e7d+'='+_0x50a14e);writeFileSync(_0x60b326,_0x264efd[_0x3532e9(0x76)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x55ba0b,_0x1cffea,_0x467787){const _0x365370=a54_0x25f646;await saveKeychainAPIKey(_0x55ba0b,_0x467787),setCachedCredential(_0x55ba0b,_0x1cffea,_0x467787);const _0x5c1870=getConfigFilePath(_0x467787);cleanupLegacyEnvFile(_0x5c1870)&&console[_0x365370(0xa5)](a54_0x2e31d3[_0x365370(0x8f)]('⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'));}export function loadConfig(){const _0x411aa3=a54_0x25f646,_0x332028={'apiKeys':{},'defaultSite':_0x411aa3(0xa0)},_0x7a81f9=[_0x411aa3(0xa0),_0x411aa3(0x90),_0x411aa3(0x85),_0x411aa3(0x89),_0x411aa3(0x88),_0x411aa3(0xb0),'dev-eu01',_0x411aa3(0xb2),_0x411aa3(0xa9),_0x411aa3(0x7c)],_0x435008=getAPIKey();if(_0x435008)for(const _0x2e0fc9 of _0x7a81f9){_0x332028[_0x411aa3(0x7d)][_0x2e0fc9]=_0x435008;}return _0x332028;}function a54_0x1652(){const _0x3085e2=['existsSync','19338SLUPnu','account_info','number','stringify','match','profile','startsWith','readFileSync','us01','257970Vqojjq','tdx','keychain','.json','warn','parse','next','split','stg-ap01','write','.env.','proxy','toUpperCase','keychain\x20(profile:\x20','dev-eu01','dev-us01','endsWith','stg-us01','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','TD_API_KEY','TDX_API_KEY\x20env\x20var','config/llm-project','replace','release_channel','read','utf-8','llm_default_project','clear','config/llm-agent','133wfVtcS','1969119KrKfQs','apiKey','llm_default_agent','join','site','TDX_ACCESS_TOKEN_','TDX_ACCESS_TOKEN\x20env\x20var','.env','226446JviWAj','stg-ap03','apiKeys','111815DgXAYc','accessToken','filter','Warning:\x20Failed\x20to\x20read\x20','stable','4276420ASfuYj','path','eu01','.config','123psCKMs','ap03','ap02','tdx.json','accountId','map','string','config/account-info','yellow','ap01','8FRsRWT','15952EcHGZO','\x20env\x20var','name','trim','some'];a54_0x1652=function(){return _0x3085e2;};return a54_0x1652();}export function isExperimentalAvailable(){return!!process.env.TDX_EXPERIMENTAL;}export function loadGlobalProxy(){const _0x14130b=a54_0x25f646,_0x56cd28=a54_0xeec917[_0x14130b(0x76)](getConfigDir(),_0x14130b(0x8a));if(!a54_0x4bf65e[_0x14130b(0x97)](_0x56cd28))return undefined;try{const _0x405def=a54_0x4bf65e[_0x14130b(0x9f)](_0x56cd28,_0x14130b(0x6e)),_0x13105d=JSON[_0x14130b(0xa6)](_0x405def);return typeof _0x13105d[_0x14130b(0xac)]===_0x14130b(0x8d)?_0x13105d[_0x14130b(0xac)]:undefined;}catch{return undefined;}}export function loadReleaseChannel(){const _0x13fc1d=a54_0x25f646,_0x1f047d=process.env.TDX_RELEASE_CHANNEL;if(_0x1f047d===_0x13fc1d(0xa7)||_0x1f047d==='stable')return _0x1f047d;const _0x12eee2=a54_0xeec917[_0x13fc1d(0x76)](getConfigDir(),_0x13fc1d(0x8a));if(!a54_0x4bf65e[_0x13fc1d(0x97)](_0x12eee2))return'stable';try{const _0x33812f=a54_0x4bf65e['readFileSync'](_0x12eee2,_0x13fc1d(0x6e)),_0x487574=JSON['parse'](_0x33812f);if(_0x487574[_0x13fc1d(0x6c)]===_0x13fc1d(0xa7))return _0x13fc1d(0xa7);}catch{}return _0x13fc1d(0x82);}export function saveReleaseChannel(_0x462675){const _0x2b9453=a54_0x25f646,_0x2645c7=getConfigDir(),_0xdd413d=a54_0xeec917[_0x2b9453(0x76)](_0x2645c7,_0x2b9453(0x8a));!existsSync(_0x2645c7)&&mkdirSync(_0x2645c7,{'recursive':!![],'mode':0x1c0});let _0x38e679={};if(existsSync(_0xdd413d))try{const _0x5b95ed=readFileSync(_0xdd413d,'utf-8');_0x38e679=JSON[_0x2b9453(0xa6)](_0x5b95ed);}catch{}_0x38e679[_0x2b9453(0x6c)]=_0x462675,writeFileSync(_0xdd413d,JSON[_0x2b9453(0x9b)](_0x38e679,null,0x2),{'mode':0x180});}
1
+ const a54_0x459471=a54_0xab3c;(function(_0x25bde7,_0x4ab037){const _0x3d41eb=a54_0xab3c,_0x441b62=_0x25bde7();while(!![]){try{const _0x51b180=-parseInt(_0x3d41eb(0x158))/0x1+-parseInt(_0x3d41eb(0x16d))/0x2+parseInt(_0x3d41eb(0x15b))/0x3*(-parseInt(_0x3d41eb(0x167))/0x4)+-parseInt(_0x3d41eb(0x162))/0x5+parseInt(_0x3d41eb(0x164))/0x6+parseInt(_0x3d41eb(0x154))/0x7*(-parseInt(_0x3d41eb(0x151))/0x8)+parseInt(_0x3d41eb(0x14f))/0x9;if(_0x51b180===_0x4ab037)break;else _0x441b62['push'](_0x441b62['shift']());}catch(_0x45ff4d){_0x441b62['push'](_0x441b62['shift']());}}}(a54_0x1e86,0xb82b0));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';function a54_0xab3c(_0x56bf49,_0x2a5777){_0x56bf49=_0x56bf49-0x140;const _0x1e864b=a54_0x1e86();let _0xab3c97=_0x1e864b[_0x56bf49];return _0xab3c97;}import*as a54_0x5a8858 from'node:fs';import*as a54_0x2dfb6b from'node:path';import{SITE_ALIASES}from'../sdk/types/index.js';import{getKeychainAPIKey,saveKeychainAPIKey}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a54_0x21774f from'chalk';import{getGlobalCacheDir,createOptionalProfileCache}from'../utils/global-cache.js';export function getConfigDir(){const _0x1bbb5d=a54_0xab3c;return process.env.TDX_CONFIG_DIR||join(homedir(),_0x1bbb5d(0x14c),_0x1bbb5d(0x157));}export function getConfigFile(){const _0x837bf1=a54_0xab3c;return join(getConfigDir(),_0x837bf1(0x16a));}export function getConfigFilePath(_0x3d065e){const _0x179cab=a54_0xab3c,_0x1f190b=getConfigDir();return _0x3d065e?a54_0x2dfb6b['join'](_0x1f190b,_0x179cab(0x170)+_0x3d065e):getConfigFile();}export function getCacheDir(){return getGlobalCacheDir();}const llmProjectCache=createOptionalProfileCache(a54_0x459471(0x168),a54_0x459471(0x14b));export function getLLMProjectCacheFile(_0x568f28){const _0x40cfcd=a54_0x459471;return llmProjectCache[_0x40cfcd(0x175)](_0x568f28);}export function readCachedLLMProject(_0x268494){const _0x916486=a54_0x459471,_0x5e0654=llmProjectCache[_0x916486(0x177)](_0x268494);if(_0x5e0654&&typeof _0x5e0654['id']===_0x916486(0x180)&&typeof _0x5e0654[_0x916486(0x17a)]===_0x916486(0x180))return _0x5e0654;return null;}export function writeCachedLLMProject(_0x4c515a,_0x4cfd08,_0x505a4e){try{llmProjectCache['write']({'name':_0x4c515a,'id':_0x4cfd08},_0x505a4e);}catch{}}const llmAgentCache=createOptionalProfileCache(a54_0x459471(0x160),a54_0x459471(0x169));export function getLLMAgentCacheFile(_0x17b55d){const _0x58377c=a54_0x459471;return llmAgentCache[_0x58377c(0x175)](_0x17b55d);}export function readCachedLLMAgent(_0x27adfa){const _0x5df8e5=a54_0x459471,_0x241e37=llmAgentCache[_0x5df8e5(0x177)](_0x27adfa);if(_0x241e37&&typeof _0x241e37['id']==='string'&&typeof _0x241e37[_0x5df8e5(0x17a)]===_0x5df8e5(0x180)&&typeof _0x241e37[_0x5df8e5(0x144)]==='string')return _0x241e37;return null;}export function writeCachedLLMAgent(_0x353068,_0x5e7fc9,_0x1a8428,_0xf91bed){const _0x1c4f89=a54_0x459471;try{llmAgentCache[_0x1c4f89(0x161)]({'name':_0x353068,'id':_0x5e7fc9,'projectId':_0x1a8428},_0xf91bed);}catch{}}export function clearCachedLLMAgent(_0x59ef12){const _0x2e1132=a54_0x459471;try{llmAgentCache[_0x2e1132(0x15d)](_0x59ef12);}catch{}}const accountInfoCache=createOptionalProfileCache(a54_0x459471(0x14e),'config/account-info',{'suffix':'.json'});export function getAccountInfoCacheFile(_0x558f30){return accountInfoCache['path'](_0x558f30);}export function readCachedAccountInfo(_0x3ed19a){const _0x49e03e=a54_0x459471,_0x391e2a=accountInfoCache['read'](_0x3ed19a);if(_0x391e2a&&typeof _0x391e2a[_0x49e03e(0x15c)]===_0x49e03e(0x180)&&typeof _0x391e2a['accountId']==='number')return _0x391e2a;return null;}export function writeCachedAccountInfo(_0x5eb687,_0x4bd730,_0x4aec7b){const _0x21f0ea=a54_0x459471;try{accountInfoCache[_0x21f0ea(0x161)]({'site':_0x5eb687,'accountId':_0x4bd730,'cachedAt':new Date()[_0x21f0ea(0x181)]()},_0x4aec7b);}catch{}}export function parseEnvFile(_0x256449){const _0x26264e=a54_0x459471,_0x443367={};for(const _0x474dde of _0x256449[_0x26264e(0x16f)]('\x0a')){const _0xb222c4=_0x474dde[_0x26264e(0x178)]();if(!_0xb222c4||_0xb222c4[_0x26264e(0x172)]('#'))continue;const _0x22f48f=_0xb222c4['match'](/^([^=]+)=(.*)$/);if(_0x22f48f){const _0x27ba7f=_0x22f48f[0x1][_0x26264e(0x178)]();let _0x4a37d5=_0x22f48f[0x2][_0x26264e(0x178)]();(_0x4a37d5[_0x26264e(0x172)]('\x22')&&_0x4a37d5['endsWith']('\x22')||_0x4a37d5[_0x26264e(0x172)]('\x27')&&_0x4a37d5[_0x26264e(0x17b)]('\x27'))&&(_0x4a37d5=_0x4a37d5[_0x26264e(0x156)](0x1,-0x1)),_0x443367[_0x27ba7f]=_0x4a37d5;}}return _0x443367;}export function readUserConfig(){const _0x4316cd=a54_0x459471,_0x5cb469=getConfigFile();if(!existsSync(_0x5cb469))return{};try{const _0x68bc88=readFileSync(_0x5cb469,_0x4316cd(0x16b));return parseEnvFile(_0x68bc88);}catch(_0x33c313){return console['warn']('Warning:\x20Failed\x20to\x20read\x20config\x20file\x20'+_0x5cb469+':',_0x33c313),{};}}export function resolveSite(_0x2f174b){const _0x3be7de=a54_0x459471,_0x5f5d73=['us01',_0x3be7de(0x150),'eu01',_0x3be7de(0x143),_0x3be7de(0x17e),_0x3be7de(0x142),'dev-eu01',_0x3be7de(0x17f),_0x3be7de(0x15f),_0x3be7de(0x174)];if(_0x5f5d73[_0x3be7de(0x155)](_0x2f174b))return _0x2f174b;if(_0x2f174b in SITE_ALIASES)return SITE_ALIASES[_0x2f174b];return console[_0x3be7de(0x159)](_0x3be7de(0x15a)+_0x2f174b+_0x3be7de(0x14a)),_0x3be7de(0x146);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function resolveAccessToken(_0x36d8ec){const _0x4e0e26=a54_0x459471,_0x56d5ba=_0x36d8ec||getActiveProfileName()||undefined;if(_0x56d5ba){const _0x5f5a50='TDX_ACCESS_TOKEN_'+normalizeProfileForEnvVar(_0x56d5ba);if(process.env[_0x5f5a50])return{'accessToken':process.env[_0x5f5a50],'source':_0x5f5a50+_0x4e0e26(0x149)};}if(process.env.TDX_ACCESS_TOKEN)return{'accessToken':process.env.TDX_ACCESS_TOKEN,'source':_0x4e0e26(0x148)};return null;}export function getAccessToken(_0x360950){const _0x4fc17d=a54_0x459471;return resolveAccessToken(_0x360950)?.[_0x4fc17d(0x165)];}export function getAPIKey(_0x4195e6){const _0x2e7e7d=a54_0x459471,_0x4ded36=_0x4195e6||getActiveProfileName();if(_0x4ded36){const _0x54ef0c=_0x2e7e7d(0x171)+normalizeProfileForEnvVar(_0x4ded36);if(process.env[_0x54ef0c])return process.env[_0x54ef0c];}if(process.env.TDX_API_KEY)return process.env.TDX_API_KEY;return undefined;}export function normalizeProfileForEnvVar(_0x283f5e){return _0x283f5e['toUpperCase']()['replace'](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x456f66,_0x15dce9){const _0x3a9ffd=a54_0x459471,_0x252d73=resolveAccessToken(_0x15dce9);if(_0x252d73)return{'apiKey':_0x252d73[_0x3a9ffd(0x165)],'source':_0x252d73['source'],'isDeprecated':![]};const _0xf8f151=_0x15dce9||getActiveProfileName()||undefined;if(_0xf8f151){const _0x1c5e29=_0x3a9ffd(0x171)+normalizeProfileForEnvVar(_0xf8f151);if(process.env[_0x1c5e29])return{'apiKey':process.env[_0x1c5e29],'source':_0x1c5e29+_0x3a9ffd(0x149),'isDeprecated':![]};const _0x1a3f43=getCachedCredential(_0x456f66,_0xf8f151);if(_0x1a3f43)return{'apiKey':_0x1a3f43,'source':'keychain\x20(profile:\x20'+_0xf8f151+')','isDeprecated':![]};const _0xa5a154=await getKeychainAPIKey(_0xf8f151);if(_0xa5a154)return setCachedCredential(_0xa5a154,_0x456f66,_0xf8f151),{'apiKey':_0xa5a154,'source':'keychain\x20(profile:\x20'+_0xf8f151+')','isDeprecated':![]};}if(process.env.TDX_API_KEY)return{'apiKey':process.env.TDX_API_KEY,'source':_0x3a9ffd(0x140),'isDeprecated':![]};if(!_0xf8f151){const _0x1b5fe0=getCachedCredential(_0x456f66,undefined);if(_0x1b5fe0)return{'apiKey':_0x1b5fe0,'source':'keychain','isDeprecated':![]};const _0x4ef59a=await getKeychainAPIKey(undefined);if(_0x4ef59a)return setCachedCredential(_0x4ef59a,_0x456f66,undefined),{'apiKey':_0x4ef59a,'source':'keychain','isDeprecated':![]};}return null;}export async function getAPIKeyAsync(_0x26d62e,_0x5286fc){const _0xa411d7=await resolveAPIKeyAsync(_0x26d62e,_0x5286fc);return _0xa411d7?.['apiKey'];}function cleanupLegacyEnvFile(_0x4f53d3){const _0x454e0a=a54_0x459471;if(!existsSync(_0x4f53d3))return![];try{const _0x3f0e44=readFileSync(_0x4f53d3,_0x454e0a(0x16b)),_0x311950=_0x3f0e44[_0x454e0a(0x16f)]('\x0a'),_0x570526=_0x311950[_0x454e0a(0x152)](_0x4be093=>{const _0x5d7314=_0x454e0a,_0x1e3bb9=_0x4be093['trim']();if(!_0x1e3bb9||_0x1e3bb9[_0x5d7314(0x172)]('#'))return!![];const [_0x1c3e45]=_0x1e3bb9['split']('=');return!_0x1c3e45[_0x5d7314(0x172)](_0x5d7314(0x145));}),_0x50135c=_0x570526['some'](_0x501b92=>{const _0x18b5e5=_0x454e0a,_0x4a9d7d=_0x501b92[_0x18b5e5(0x178)]();return _0x4a9d7d&&!_0x4a9d7d['startsWith']('#');});if(!_0x50135c)return unlinkSync(_0x4f53d3),!![];return writeFileSync(_0x4f53d3,_0x570526[_0x454e0a(0x163)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function getActiveProfileName(){const _0x2a99e5=a54_0x459471;if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x3ee87d=a54_0x2dfb6b[_0x2a99e5(0x163)](getConfigDir(),_0x2a99e5(0x153));if(!a54_0x5a8858[_0x2a99e5(0x182)](_0x3ee87d))return null;try{const _0x41b66c=a54_0x5a8858['readFileSync'](_0x3ee87d,_0x2a99e5(0x16b)),_0x2aaf4b=JSON['parse'](_0x41b66c);return _0x2aaf4b[_0x2a99e5(0x176)]||null;}catch{return null;}}export function saveAPIKey(_0x22a5b6,_0x263f2e,_0x32b8b8){const _0x271aed=a54_0x459471,_0x2caba5=getConfigDir(),_0x2efce2=getConfigFilePath(_0x32b8b8);!existsSync(_0x2caba5)&&mkdirSync(_0x2caba5,{'recursive':!![],'mode':0x1c0});let _0x1a5268={};if(existsSync(_0x2efce2))try{const _0x3d7e9f=readFileSync(_0x2efce2,_0x271aed(0x16b));_0x1a5268=parseEnvFile(_0x3d7e9f);}catch(_0x336806){console[_0x271aed(0x159)](_0x271aed(0x147)+_0x2efce2+':',_0x336806);}const _0x62d632=_0x22a5b6['toUpperCase']()['replace'](/-/g,'_');_0x1a5268['TD_API_KEY_'+_0x62d632]=_0x263f2e;const _0x27f683=Object['entries'](_0x1a5268)[_0x271aed(0x17d)](([_0x5675aa,_0x309a8a])=>_0x5675aa+'='+_0x309a8a);writeFileSync(_0x2efce2,_0x27f683['join']('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x5433a4,_0x4b62ba,_0x5f22c3){const _0x1a78f7=a54_0x459471;await saveKeychainAPIKey(_0x5433a4,_0x5f22c3),setCachedCredential(_0x5433a4,_0x4b62ba,_0x5f22c3);const _0x1045ab=getConfigFilePath(_0x5f22c3);cleanupLegacyEnvFile(_0x1045ab)&&console[_0x1a78f7(0x159)](a54_0x21774f[_0x1a78f7(0x183)](_0x1a78f7(0x17c)));}export function loadConfig(){const _0x4d01de=a54_0x459471,_0x24f74c={'apiKeys':{},'defaultSite':_0x4d01de(0x146)},_0x2c78e5=[_0x4d01de(0x146),_0x4d01de(0x150),'eu01','ap02',_0x4d01de(0x17e),_0x4d01de(0x142),_0x4d01de(0x15e),_0x4d01de(0x17f),_0x4d01de(0x15f),_0x4d01de(0x174)],_0x52bbbb=getAPIKey();if(_0x52bbbb)for(const _0x873a24 of _0x2c78e5){_0x24f74c[_0x4d01de(0x16c)][_0x873a24]=_0x52bbbb;}return _0x24f74c;}export function isExperimentalAvailable(){return!!process.env.TDX_EXPERIMENTAL;}export function loadGlobalProxy(){const _0x3e0412=a54_0x459471,_0x258f9b=a54_0x2dfb6b[_0x3e0412(0x163)](getConfigDir(),'tdx.json');if(!a54_0x5a8858[_0x3e0412(0x182)](_0x258f9b))return undefined;try{const _0x378267=a54_0x5a8858['readFileSync'](_0x258f9b,_0x3e0412(0x16b)),_0xb82a8=JSON[_0x3e0412(0x16e)](_0x378267);return typeof _0xb82a8[_0x3e0412(0x14d)]===_0x3e0412(0x180)?_0xb82a8['proxy']:undefined;}catch{return undefined;}}function a54_0x1e86(){const _0x4b0f8b=['llm_default_agent','write','4196640LgxCcc','join','8035302xsfYag','accessToken','readFileSync','13340oVtKKA','llm_default_project','config/llm-agent','.env','utf-8','apiKeys','49904giKPvs','parse','split','.env.','TDX_API_KEY_','startsWith','stable','stg-ap03','path','profile','read','trim','next','name','endsWith','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','map','ap03','stg-us01','string','toISOString','existsSync','yellow','TDX_API_KEY\x20env\x20var','stringify','dev-us01','ap02','projectId','TD_API_KEY','us01','Warning:\x20Failed\x20to\x20read\x20','TDX_ACCESS_TOKEN\x20env\x20var','\x20env\x20var','\x27,\x20defaulting\x20to\x20us01','config/llm-project','.config','proxy','account_info','36603936tzvxVo','ap01','12042456FHQDng','filter','tdx.json','7IzAFtE','includes','slice','tdx','1238527mEBPsk','warn','Warning:\x20Unknown\x20site\x20\x27','939XBwFwI','site','clear','dev-eu01','stg-ap01'];a54_0x1e86=function(){return _0x4b0f8b;};return a54_0x1e86();}export function loadReleaseChannel(){const _0xb62938=a54_0x459471,_0x55d764=process.env.TDX_RELEASE_CHANNEL;if(_0x55d764===_0xb62938(0x179)||_0x55d764===_0xb62938(0x173))return _0x55d764;const _0x3be9bf=a54_0x2dfb6b['join'](getConfigDir(),_0xb62938(0x153));if(!a54_0x5a8858['existsSync'](_0x3be9bf))return'stable';try{const _0x38dd26=a54_0x5a8858[_0xb62938(0x166)](_0x3be9bf,_0xb62938(0x16b)),_0x18640c=JSON[_0xb62938(0x16e)](_0x38dd26);if(_0x18640c['release_channel']==='next')return _0xb62938(0x179);}catch{}return _0xb62938(0x173);}export function saveReleaseChannel(_0x344884){const _0x209942=a54_0x459471,_0x45c9ce=getConfigDir(),_0x283104=a54_0x2dfb6b[_0x209942(0x163)](_0x45c9ce,_0x209942(0x153));!existsSync(_0x45c9ce)&&mkdirSync(_0x45c9ce,{'recursive':!![],'mode':0x1c0});let _0x1d2e6b={};if(existsSync(_0x283104))try{const _0x14a2a9=readFileSync(_0x283104,_0x209942(0x16b));_0x1d2e6b=JSON[_0x209942(0x16e)](_0x14a2a9);}catch{}_0x1d2e6b['release_channel']=_0x344884,writeFileSync(_0x283104,JSON[_0x209942(0x141)](_0x1d2e6b,null,0x2),{'mode':0x180});}
@@ -1 +1 @@
1
- const a55_0xda8167=a55_0x1d97;(function(_0x520b88,_0x10aa78){const _0x30cd8c=a55_0x1d97,_0x1f84c2=_0x520b88();while(!![]){try{const _0x29e95c=-parseInt(_0x30cd8c(0x133))/0x1*(parseInt(_0x30cd8c(0x135))/0x2)+parseInt(_0x30cd8c(0x139))/0x3+parseInt(_0x30cd8c(0x137))/0x4+-parseInt(_0x30cd8c(0x138))/0x5*(-parseInt(_0x30cd8c(0x13b))/0x6)+-parseInt(_0x30cd8c(0x13a))/0x7*(parseInt(_0x30cd8c(0x130))/0x8)+-parseInt(_0x30cd8c(0x136))/0x9*(-parseInt(_0x30cd8c(0x134))/0xa)+-parseInt(_0x30cd8c(0x13d))/0xb;if(_0x29e95c===_0x10aa78)break;else _0x1f84c2['push'](_0x1f84c2['shift']());}catch(_0x1c72d1){_0x1f84c2['push'](_0x1f84c2['shift']());}}}(a55_0x170f,0x3be2a));import{createProfileCache}from'../utils/global-cache.js';const connectionCache=createProfileCache(a55_0xda8167(0x12d),'core/connection-cache');function a55_0x170f(){const _0x3269c1=['2185566SNUcdc','write','1783584mYtNGf','connections-{profile}.json','connections','read','871048gjbZos','clear','now','69kEJyth','70pKWmRk','3646GWTpRL','340173hzjSDu','280740brzDbP','5EHKPxq','482517UmyrHY','21plrOkx'];a55_0x170f=function(){return _0x3269c1;};return a55_0x170f();}function a55_0x1d97(_0x481582,_0x156704){_0x481582=_0x481582-0x12d;const _0x170fe9=a55_0x170f();let _0x1d9748=_0x170fe9[_0x481582];return _0x1d9748;}export function loadCachedConnections(_0x5d48d5){const _0x3cabe1=a55_0xda8167,_0x323e1d=connectionCache[_0x3cabe1(0x12f)](_0x5d48d5);return _0x323e1d?.[_0x3cabe1(0x12e)]??null;}export function saveCachedConnections(_0x1c17c1,_0x335aec){const _0x3660cc=a55_0xda8167;connectionCache[_0x3660cc(0x13c)](_0x1c17c1,{'connections':_0x335aec,'cachedAt':Date[_0x3660cc(0x132)]()});}export function clearConnectionCache(_0x960071){const _0x7b8220=a55_0xda8167;connectionCache[_0x7b8220(0x131)](_0x960071);}
1
+ const a55_0x1f564b=a55_0x5177;(function(_0x25ee73,_0x473108){const _0x66b2fc=a55_0x5177,_0x64c474=_0x25ee73();while(!![]){try{const _0x2831c5=-parseInt(_0x66b2fc(0xf9))/0x1+parseInt(_0x66b2fc(0xed))/0x2*(-parseInt(_0x66b2fc(0xf1))/0x3)+parseInt(_0x66b2fc(0xec))/0x4+-parseInt(_0x66b2fc(0xf7))/0x5*(parseInt(_0x66b2fc(0xf4))/0x6)+parseInt(_0x66b2fc(0xe9))/0x7+parseInt(_0x66b2fc(0xea))/0x8*(-parseInt(_0x66b2fc(0xf8))/0x9)+parseInt(_0x66b2fc(0xf2))/0xa*(parseInt(_0x66b2fc(0xee))/0xb);if(_0x2831c5===_0x473108)break;else _0x64c474['push'](_0x64c474['shift']());}catch(_0x50ad57){_0x64c474['push'](_0x64c474['shift']());}}}(a55_0x44c5,0x1a15b));import{createProfileCache}from'../utils/global-cache.js';const connectionCache=createProfileCache(a55_0x1f564b(0xeb),a55_0x1f564b(0xf6));export function loadCachedConnections(_0x6df785){const _0x416192=a55_0x1f564b,_0x51a2d6=connectionCache[_0x416192(0xef)](_0x6df785);return _0x51a2d6?.[_0x416192(0xf3)]??null;}function a55_0x5177(_0x172e0a,_0x2fddc0){_0x172e0a=_0x172e0a-0xe9;const _0x44c53a=a55_0x44c5();let _0x517785=_0x44c53a[_0x172e0a];return _0x517785;}export function saveCachedConnections(_0x1791f6,_0x51819f){const _0x18452c=a55_0x1f564b;connectionCache[_0x18452c(0xf5)](_0x1791f6,{'connections':_0x51819f,'cachedAt':Date[_0x18452c(0xf0)]()});}export function clearConnectionCache(_0x58d173){connectionCache['clear'](_0x58d173);}function a55_0x44c5(){const _0x1ad291=['1619144OFCDqf','connections-{profile}.json','31356YBcqkh','6520IWTPgc','11qumXFA','read','now','24nCTTOF','4594290XJmaMT','connections','3558NukzcH','write','core/connection-cache','5yJtBkp','9rRFsYf','132072JsgIkX','4991oKgrYt'];a55_0x44c5=function(){return _0x1ad291;};return a55_0x44c5();}
@@ -1 +1 @@
1
- const a56_0x27a2ba=a56_0x4df9;function a56_0x8c3d(){const _0x160670=['trim','200206nLZVFu','eu\x20\x20\x20-\x20Europe','11jeSFZR','Enter\x20custom\x20site','5403530LqgLAq','us01','1982232sjVaZu','45bFVzSj','select','17NZizHi','Site\x20name\x20cannot\x20be\x20empty','log','customSite','push','5273049isImwL','site','2007453EwsTyQ','11061906GzEZeI','Select\x20your\x20Treasure\x20Data\x20site:','eu01','other','1594136krudlb','value','ap02','findIndex','ap02\x20-\x20Korea','test','length','Cancelled','5JzrNWF','ap01'];a56_0x8c3d=function(){return _0x160670;};return a56_0x8c3d();}(function(_0x1a52a0,_0x3e1dc5){const _0x1e304c=a56_0x4df9,_0x121683=_0x1a52a0();while(!![]){try{const _0x3e6bb8=parseInt(_0x1e304c(0x19a))/0x1*(parseInt(_0x1e304c(0x191))/0x2)+parseInt(_0x1e304c(0x19f))/0x3+-parseInt(_0x1e304c(0x197))/0x4*(parseInt(_0x1e304c(0x18e))/0x5)+-parseInt(_0x1e304c(0x1a2))/0x6+parseInt(_0x1e304c(0x1a1))/0x7+parseInt(_0x1e304c(0x1a6))/0x8*(-parseInt(_0x1e304c(0x198))/0x9)+parseInt(_0x1e304c(0x195))/0xa*(parseInt(_0x1e304c(0x193))/0xb);if(_0x3e6bb8===_0x3e1dc5)break;else _0x121683['push'](_0x121683['shift']());}catch(_0x4ab59b){_0x121683['push'](_0x121683['shift']());}}}(a56_0x8c3d,0xe82ee));function a56_0x4df9(_0x947e8f,_0x313f82){_0x947e8f=_0x947e8f-0x188;const _0x8c3d70=a56_0x8c3d();let _0x4df939=_0x8c3d70[_0x947e8f];return _0x4df939;}import a56_0x2d884b from'prompts';export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x400920,_0x1f03ad){if(_0x400920===undefined)return _0x1f03ad;if(typeof _0x400920==='number')return _0x400920;return parseInt(_0x400920,0xa);}export const STANDARD_SITE_CHOICES=[{'title':'us\x20\x20\x20-\x20United\x20States','value':a56_0x27a2ba(0x196)},{'title':'jp\x20\x20\x20-\x20Japan','value':a56_0x27a2ba(0x18f)},{'title':a56_0x27a2ba(0x192),'value':a56_0x27a2ba(0x1a4)},{'title':a56_0x27a2ba(0x18a),'value':a56_0x27a2ba(0x188)}];export function buildSiteChoices(_0x241e28){const _0x2eee1e=a56_0x27a2ba,_0x931237=[...STANDARD_SITE_CHOICES];let _0x49cdcd=_0x931237[_0x2eee1e(0x189)](_0x570bba=>_0x570bba[_0x2eee1e(0x1a7)]===_0x241e28);return _0x49cdcd===-0x1&&_0x241e28!==_0x2eee1e(0x196)&&(_0x931237[_0x2eee1e(0x19e)]({'title':_0x241e28,'value':_0x241e28}),_0x49cdcd=_0x931237[_0x2eee1e(0x18c)]-0x1),_0x931237[_0x2eee1e(0x19e)]({'title':_0x2eee1e(0x194),'value':_0x2eee1e(0x1a5)}),{'choices':_0x931237,'initialIndex':_0x49cdcd>=0x0?_0x49cdcd:0x0};}export async function promptSiteSelection(_0x34e2c3,_0x5acf8c,_0x469911=a56_0x27a2ba(0x18d)){const _0x3af0f4=a56_0x27a2ba,{choices:_0x15f343,initialIndex:_0x137b28}=buildSiteChoices(_0x34e2c3),_0x4b07ef=_0x5acf8c?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x5acf8c+'):':_0x3af0f4(0x1a3),_0x5f4dca=await a56_0x2d884b({'type':_0x3af0f4(0x199),'name':_0x3af0f4(0x1a0),'message':_0x4b07ef,'choices':_0x15f343,'initial':_0x137b28});if(!_0x5f4dca['site'])return console[_0x3af0f4(0x19c)]('\x0a'+_0x469911),null;if(_0x5f4dca[_0x3af0f4(0x1a0)]!==_0x3af0f4(0x1a5))return _0x5f4dca[_0x3af0f4(0x1a0)];const _0x125e17=await a56_0x2d884b({'type':'text','name':_0x3af0f4(0x19d),'message':'Enter\x20site\x20name:','initial':'us01','validate':_0x4490eb=>{const _0x5f5573=_0x3af0f4;if(!_0x4490eb||!_0x4490eb[_0x5f5573(0x190)]())return _0x5f5573(0x19b);if(!/^[a-z0-9-]+$/[_0x5f5573(0x18b)](_0x4490eb[_0x5f5573(0x190)]()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x125e17[_0x3af0f4(0x19d)])return console[_0x3af0f4(0x19c)]('\x0a'+_0x469911),null;return _0x125e17[_0x3af0f4(0x19d)];}
1
+ function a56_0x5b42(_0x20f000,_0x382878){_0x20f000=_0x20f000-0x76;const _0x181517=a56_0x1815();let _0x5b42c7=_0x181517[_0x20f000];return _0x5b42c7;}const a56_0x3dbf04=a56_0x5b42;(function(_0xb0cb45,_0x152045){const _0x158695=a56_0x5b42,_0x5019bd=_0xb0cb45();while(!![]){try{const _0x3f38cd=-parseInt(_0x158695(0x89))/0x1*(-parseInt(_0x158695(0x88))/0x2)+-parseInt(_0x158695(0x9b))/0x3*(-parseInt(_0x158695(0x9c))/0x4)+-parseInt(_0x158695(0x8e))/0x5*(-parseInt(_0x158695(0x98))/0x6)+-parseInt(_0x158695(0x95))/0x7*(parseInt(_0x158695(0x76))/0x8)+parseInt(_0x158695(0x83))/0x9*(parseInt(_0x158695(0x77))/0xa)+-parseInt(_0x158695(0x97))/0xb*(parseInt(_0x158695(0x99))/0xc)+parseInt(_0x158695(0x7d))/0xd*(-parseInt(_0x158695(0x7e))/0xe);if(_0x3f38cd===_0x152045)break;else _0x5019bd['push'](_0x5019bd['shift']());}catch(_0x1229ef){_0x5019bd['push'](_0x5019bd['shift']());}}}(a56_0x1815,0x7e5cd));import a56_0x4f80da from'prompts';export const DEFAULT_DISPLAY_LIMIT=0x28;function a56_0x1815(){const _0x274e69=['855zuHuXJ','Enter\x20custom\x20site','trim','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','findIndex','1136avnKnB','1313WavwKc','select','other','ap02','length','190060WbVLbN','jp\x20\x20\x20-\x20Japan','number','Select\x20your\x20Treasure\x20Data\x20site:','value','customSite','eu01','1776775dxGKSw','eu\x20\x20\x20-\x20Europe','83908KYcEQa','102QBpiTz','744txocWY','text','3YccFCW','647176EYVRuE','8BgXTAu','6670cQahZc','site','Cancelled','push','us01','log','13KWpMGa','5219270WnQhaJ','us\x20\x20\x20-\x20United\x20States','ap02\x20-\x20Korea','Site\x20name\x20cannot\x20be\x20empty','Enter\x20site\x20name:'];a56_0x1815=function(){return _0x274e69;};return a56_0x1815();}export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x3e8290,_0x20e622){const _0x4b5078=a56_0x5b42;if(_0x3e8290===undefined)return _0x20e622;if(typeof _0x3e8290===_0x4b5078(0x90))return _0x3e8290;return parseInt(_0x3e8290,0xa);}export const STANDARD_SITE_CHOICES=[{'title':a56_0x3dbf04(0x7f),'value':'us01'},{'title':a56_0x3dbf04(0x8f),'value':'ap01'},{'title':a56_0x3dbf04(0x96),'value':a56_0x3dbf04(0x94)},{'title':a56_0x3dbf04(0x80),'value':a56_0x3dbf04(0x8c)}];export function buildSiteChoices(_0x490c16){const _0x14853d=a56_0x3dbf04,_0x58b3d5=[...STANDARD_SITE_CHOICES];let _0x1556d5=_0x58b3d5[_0x14853d(0x87)](_0x191be0=>_0x191be0[_0x14853d(0x92)]===_0x490c16);return _0x1556d5===-0x1&&_0x490c16!==_0x14853d(0x7b)&&(_0x58b3d5[_0x14853d(0x7a)]({'title':_0x490c16,'value':_0x490c16}),_0x1556d5=_0x58b3d5[_0x14853d(0x8d)]-0x1),_0x58b3d5[_0x14853d(0x7a)]({'title':_0x14853d(0x84),'value':_0x14853d(0x8b)}),{'choices':_0x58b3d5,'initialIndex':_0x1556d5>=0x0?_0x1556d5:0x0};}export async function promptSiteSelection(_0x2c82d5,_0x3691bf,_0x4115bb=a56_0x3dbf04(0x79)){const _0x47f05b=a56_0x3dbf04,{choices:_0x50394c,initialIndex:_0x2970b4}=buildSiteChoices(_0x2c82d5),_0x571f8e=_0x3691bf?_0x47f05b(0x86)+_0x3691bf+'):':_0x47f05b(0x91),_0x232d33=await a56_0x4f80da({'type':_0x47f05b(0x8a),'name':_0x47f05b(0x78),'message':_0x571f8e,'choices':_0x50394c,'initial':_0x2970b4});if(!_0x232d33['site'])return console[_0x47f05b(0x7c)]('\x0a'+_0x4115bb),null;if(_0x232d33[_0x47f05b(0x78)]!==_0x47f05b(0x8b))return _0x232d33['site'];const _0x3606f2=await a56_0x4f80da({'type':_0x47f05b(0x9a),'name':_0x47f05b(0x93),'message':_0x47f05b(0x82),'initial':_0x47f05b(0x7b),'validate':_0xd21ec2=>{const _0x3d2bbf=_0x47f05b;if(!_0xd21ec2||!_0xd21ec2['trim']())return _0x3d2bbf(0x81);if(!/^[a-z0-9-]+$/['test'](_0xd21ec2[_0x3d2bbf(0x85)]()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x3606f2[_0x47f05b(0x93)])return console[_0x47f05b(0x7c)]('\x0a'+_0x4115bb),null;return _0x3606f2[_0x47f05b(0x93)];}
@@ -1 +1 @@
1
- (function(_0x5d3d0e,_0x4b7b12){const _0x5c04d8=a57_0x231a,_0x3736dc=_0x5d3d0e();while(!![]){try{const _0x5d3de0=-parseInt(_0x5c04d8(0x1d6))/0x1+parseInt(_0x5c04d8(0x1cf))/0x2*(-parseInt(_0x5c04d8(0x1c8))/0x3)+-parseInt(_0x5c04d8(0x1d7))/0x4*(parseInt(_0x5c04d8(0x1cc))/0x5)+-parseInt(_0x5c04d8(0x1c7))/0x6+parseInt(_0x5c04d8(0x1d0))/0x7*(-parseInt(_0x5c04d8(0x1c9))/0x8)+-parseInt(_0x5c04d8(0x1cb))/0x9+parseInt(_0x5c04d8(0x1ce))/0xa;if(_0x5d3de0===_0x4b7b12)break;else _0x3736dc['push'](_0x3736dc['shift']());}catch(_0x480911){_0x3736dc['push'](_0x3736dc['shift']());}}}(a57_0xd44a,0x35eb0));function a57_0xd44a(){const _0x5ab706=['1185344izXJHX','2029410PRCJNF','321SdQkSM','2315064unOViP','loadedAt','2607615BOCYoa','5qmSoth','set','17737390LPsCew','3862AkdtAJ','7ZYLVKd','clear','__default_site__','now','delete','__default_profile__','132585UBJBVr'];a57_0xd44a=function(){return _0x5ab706;};return a57_0xd44a();}const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x3d66f9,_0x547b29){const _0x23fe7c=a57_0x231a,_0x3a9787=_0x3d66f9||_0x23fe7c(0x1d2),_0x7cc601=_0x547b29||_0x23fe7c(0x1d5);return _0x3a9787+':'+_0x7cc601;}function a57_0x231a(_0x564a59,_0x234588){_0x564a59=_0x564a59-0x1c7;const _0xd44af4=a57_0xd44a();let _0x231aa4=_0xd44af4[_0x564a59];return _0x231aa4;}export function getCachedCredential(_0x4d7f14,_0xdd351e){const _0x2f59a1=a57_0x231a,_0x417681=getCacheKey(_0x4d7f14,_0xdd351e),_0x5cc499=cache['get'](_0x417681);if(!_0x5cc499)return null;if(Date['now']()-_0x5cc499[_0x2f59a1(0x1ca)]>CACHE_TTL_MS)return cache[_0x2f59a1(0x1d4)](_0x417681),null;return _0x5cc499['apiKey'];}export function setCachedCredential(_0x54a9f5,_0x22424b,_0x1df425){const _0x594451=a57_0x231a,_0x1fe70c=getCacheKey(_0x22424b,_0x1df425);cache[_0x594451(0x1cd)](_0x1fe70c,{'apiKey':_0x54a9f5,'loadedAt':Date[_0x594451(0x1d3)]()});}export function clearCredentialCache(){const _0x4332a7=a57_0x231a;cache[_0x4332a7(0x1d1)]();}export function clearCachedCredential(_0x4c93a2,_0x52f7bd){const _0x3c2ccc=a57_0x231a,_0x23d552=getCacheKey(_0x4c93a2,_0x52f7bd);cache[_0x3c2ccc(0x1d4)](_0x23d552);}
1
+ (function(_0x2d87c9,_0x210419){const _0x40d2a2=a57_0x6c9b,_0x43ffe3=_0x2d87c9();while(!![]){try{const _0x103008=-parseInt(_0x40d2a2(0x1de))/0x1*(-parseInt(_0x40d2a2(0x1d4))/0x2)+-parseInt(_0x40d2a2(0x1d5))/0x3+parseInt(_0x40d2a2(0x1cf))/0x4*(-parseInt(_0x40d2a2(0x1d1))/0x5)+-parseInt(_0x40d2a2(0x1d2))/0x6*(parseInt(_0x40d2a2(0x1d3))/0x7)+parseInt(_0x40d2a2(0x1df))/0x8*(parseInt(_0x40d2a2(0x1d0))/0x9)+-parseInt(_0x40d2a2(0x1dd))/0xa*(parseInt(_0x40d2a2(0x1dc))/0xb)+parseInt(_0x40d2a2(0x1d8))/0xc;if(_0x103008===_0x210419)break;else _0x43ffe3['push'](_0x43ffe3['shift']());}catch(_0x593581){_0x43ffe3['push'](_0x43ffe3['shift']());}}}(a57_0x425c,0x7488e));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x3f2f09,_0x18c6ba){const _0x5b3dc6=a57_0x6c9b,_0x5d77a1=_0x3f2f09||_0x5b3dc6(0x1da),_0x469941=_0x18c6ba||_0x5b3dc6(0x1e0);return _0x5d77a1+':'+_0x469941;}export function getCachedCredential(_0x42c271,_0x43e690){const _0x4b0197=a57_0x6c9b,_0x2e355d=getCacheKey(_0x42c271,_0x43e690),_0x105055=cache[_0x4b0197(0x1d9)](_0x2e355d);if(!_0x105055)return null;if(Date['now']()-_0x105055['loadedAt']>CACHE_TTL_MS)return cache[_0x4b0197(0x1e1)](_0x2e355d),null;return _0x105055[_0x4b0197(0x1db)];}function a57_0x425c(){const _0x3784e1=['401LvsDUK','152lHiwEm','__default_profile__','delete','4XUffYT','106857PHDtpc','1317805DEQuGY','116322wOUyPB','259ishtjt','2142ilfJLP','347910KJDpmi','clear','set','13117080ypustn','get','__default_site__','apiKey','671LlcNmn','28520EqrOQc'];a57_0x425c=function(){return _0x3784e1;};return a57_0x425c();}export function setCachedCredential(_0xb6e96a,_0x3ac17b,_0x74a6d3){const _0x58d051=a57_0x6c9b,_0x2376ee=getCacheKey(_0x3ac17b,_0x74a6d3);cache[_0x58d051(0x1d7)](_0x2376ee,{'apiKey':_0xb6e96a,'loadedAt':Date['now']()});}export function clearCredentialCache(){const _0x4d1d5a=a57_0x6c9b;cache[_0x4d1d5a(0x1d6)]();}function a57_0x6c9b(_0x5671fc,_0x899fc0){_0x5671fc=_0x5671fc-0x1cf;const _0x425c33=a57_0x425c();let _0x6c9b57=_0x425c33[_0x5671fc];return _0x6c9b57;}export function clearCachedCredential(_0x3cb8dd,_0x19b4ad){const _0x16e531=a57_0x6c9b,_0x56aa7a=getCacheKey(_0x3cb8dd,_0x19b4ad);cache[_0x16e531(0x1e1)](_0x56aa7a);}
@@ -1 +1 @@
1
- const a58_0x68b67a=a58_0x5ddc;(function(_0xaf2721,_0x47f1a4){const _0x146b1f=a58_0x5ddc,_0x296486=_0xaf2721();while(!![]){try{const _0x3e8834=parseInt(_0x146b1f(0xe6))/0x1*(parseInt(_0x146b1f(0x121))/0x2)+parseInt(_0x146b1f(0xf1))/0x3+parseInt(_0x146b1f(0x120))/0x4*(parseInt(_0x146b1f(0xde))/0x5)+parseInt(_0x146b1f(0xf2))/0x6+-parseInt(_0x146b1f(0x10e))/0x7+parseInt(_0x146b1f(0xe8))/0x8+parseInt(_0x146b1f(0xe3))/0x9*(-parseInt(_0x146b1f(0x104))/0xa);if(_0x3e8834===_0x47f1a4)break;else _0x296486['push'](_0x296486['shift']());}catch(_0x311f1d){_0x296486['push'](_0x296486['shift']());}}}(a58_0x1c88,0xd7b67));import{resolveSite,getAPIKey,getAccessToken,getAPIKeyAsync,getConfigDir}from'./config.js';import{getOAuthTokens}from'./oauth-keychain.js';import{loadSessionContext,getSessionID}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';import{loadProfile}from'./profile.js';import{LogLevel}from'../utils/logger/index.js';import*as a58_0x6d8126 from'node:fs';function a58_0x1c88(){const _0x1f56ba=['workflow_project','INFO','join','llm_project','display','logLevel','cliFlags','100FElzos','62WFyAmd','activeProfile','existsSync','none','sessionId','dim','sessions','cyan','(using\x20session:\x20','tdx.json','profileSource','utf-8','project','displayWithSources','entries','Project','configFiles','loadGlobalConfig','154195oCSABc','createAsync','layers','accessToken','bold','426879Ztkbti','green','.json','44687QSMKJo','session','9808928wYfalG','llmProject','Global\x20Credentials','llm_agent','Profile','getSource','apiKey','us01','profiles','2290560hQRcvz','1039554biofBn','global','resolveAPIKeyAsync','not\x20set','workflowProject','string','[configuration\x20files]','site','profile:\x20','segment_path','proxy','injectIntoOptions','database','log','Profile\x20Credentials','default','access_token','parent_segment','680MpesjT','getParameters','Session','cli','env','[context]','profileCredentials','.env','(session:\x20','segmentPath','1472100jbtNWS','Global','parse','llmAgent','parentSegment','config','CLI\x20flag:\x20--','verbose','profile','globalCredentials','assign'];a58_0x1c88=function(){return _0x1f56ba;};return a58_0x1c88();}import*as a58_0x1a8fe4 from'node:path';function a58_0x5ddc(_0x271c0f,_0x5ec64e){_0x271c0f=_0x271c0f-0xd8;const _0x1c8824=a58_0x1c88();let _0x5ddc6b=_0x1c8824[_0x271c0f];return _0x5ddc6b;}import a58_0x1821de from'chalk';export class GlobalContext{[a58_0x68b67a(0xf9)];[a58_0x68b67a(0xfe)];['parent_segment'];[a58_0x68b67a(0xfb)];['llm_project'];[a58_0x68b67a(0xeb)];['workflow_project'];[a58_0x68b67a(0xee)];['accessToken'];[a58_0x68b67a(0xfc)];[a58_0x68b67a(0x115)];[a58_0x68b67a(0x11e)];[a58_0x68b67a(0x116)];[a58_0x68b67a(0x12b)]=null;[a58_0x68b67a(0xe0)];[a58_0x68b67a(0x122)];['sessionId'];[a58_0x68b67a(0xdc)];constructor(_0x13458d){const _0x1a61e5=a58_0x68b67a;this[_0x1a61e5(0x125)]=getSessionID(_0x13458d[_0x1a61e5(0xe7)]);const _0x24f4e7=loadSessionContext(_0x13458d[_0x1a61e5(0xe7)]),_0x23c1d1=loadProjectConfig(),_0x5e557f=this[_0x1a61e5(0xdd)]();if(_0x13458d[_0x1a61e5(0x116)])this[_0x1a61e5(0x122)]=_0x13458d['profile'],this[_0x1a61e5(0x12b)]=_0x1a61e5(0x107);else{if(_0x24f4e7?.[_0x1a61e5(0x116)])this['activeProfile']=_0x24f4e7[_0x1a61e5(0x116)],this[_0x1a61e5(0x12b)]=_0x1a61e5(0xe7);else{if(_0x5e557f[_0x1a61e5(0x116)])this[_0x1a61e5(0x122)]=_0x5e557f[_0x1a61e5(0x116)],this['profileSource']=_0x1a61e5(0x113);else process.env.TDX_PROFILE?(this['activeProfile']=process.env.TDX_PROFILE,this[_0x1a61e5(0x12b)]=_0x1a61e5(0x108)):(this[_0x1a61e5(0x122)]=null,this[_0x1a61e5(0x12b)]=null);}}const _0x59a53d=this[_0x1a61e5(0x122)]?loadProfile(this['activeProfile']):null,_0x3033b2=_0x252a94=>{const _0x81a408=_0x1a61e5;if(!_0x252a94)return{};const _0x58fb9c=_0x252a94,_0x2f6d55={};for(const [_0x4b9d98,_0x170a19]of Object[_0x81a408(0xda)](_0x58fb9c)){typeof _0x170a19===_0x81a408(0xf7)&&(_0x2f6d55[_0x4b9d98]=_0x170a19);}return _0x2f6d55;},_0x255f49={},_0x2e67e0=(_0x146b1b,_0x21ecf2,_0x2aa595)=>{const _0x5af281=_0x1a61e5;if(!_0x146b1b)return![];if(_0x2aa595&&_0x146b1b===_0x2aa595)return![];const _0x4cf16d=_0x24f4e7,_0x3485ad=_0x23c1d1,_0xd627d4=_0x59a53d?.[_0x5af281(0x113)],_0x2a7f7c=_0x5e557f,_0x14ed99=_0x4cf16d?.[_0x21ecf2],_0xb138cd=_0x3485ad?.[_0x21ecf2],_0x1ccc27=_0xd627d4?.[_0x21ecf2],_0x5e4a7e=_0x2a7f7c[_0x21ecf2];return _0x146b1b!==_0x14ed99&&_0x146b1b!==_0xb138cd&&_0x146b1b!==_0x1ccc27&&_0x146b1b!==_0x5e4a7e;},_0x3d10b0=[{'optionKey':_0x1a61e5(0xf9),'contextKey':_0x1a61e5(0xf9),'defaultValue':'us01'},{'optionKey':'database','contextKey':_0x1a61e5(0xfe)},{'optionKey':_0x1a61e5(0x112),'contextKey':_0x1a61e5(0x103)},{'optionKey':_0x1a61e5(0xe9),'contextKey':_0x1a61e5(0x11c)},{'optionKey':_0x1a61e5(0x111),'contextKey':_0x1a61e5(0xeb)},{'optionKey':'profile','contextKey':_0x1a61e5(0x116)}];for(const {optionKey:_0x18482e,contextKey:_0x51bd7a,defaultValue:_0x209b16}of _0x3d10b0){const _0x2b1156=_0x13458d[_0x18482e];_0x2e67e0(_0x2b1156,_0x51bd7a,_0x209b16)&&(_0x255f49[_0x51bd7a]=_0x2b1156);}this[_0x1a61e5(0xe0)]={'cliFlags':_0x255f49,'session':_0x3033b2(_0x24f4e7),'project':_0x3033b2(_0x23c1d1),'profile':_0x3033b2(_0x59a53d?.['config']),'global':_0x3033b2(_0x5e557f)};const _0x404531={...this[_0x1a61e5(0xe0)][_0x1a61e5(0xf3)],...this[_0x1a61e5(0xe0)][_0x1a61e5(0x116)],...this[_0x1a61e5(0xe0)][_0x1a61e5(0xd8)]};process.env.TDX_SITE&&!this[_0x1a61e5(0xe0)]['session'][_0x1a61e5(0xf9)]&&!this[_0x1a61e5(0xe0)][_0x1a61e5(0x11f)][_0x1a61e5(0xf9)]&&(_0x404531[_0x1a61e5(0xf9)]=process.env.TDX_SITE);Object[_0x1a61e5(0x118)](_0x404531,this[_0x1a61e5(0xe0)]['session']),Object[_0x1a61e5(0x118)](_0x404531,this[_0x1a61e5(0xe0)][_0x1a61e5(0x11f)]);const _0x37f80c=_0x404531['site']||_0x1a61e5(0xef);this['site']=resolveSite(_0x37f80c),this[_0x1a61e5(0xfe)]=_0x404531[_0x1a61e5(0xfe)],this[_0x1a61e5(0x103)]=_0x404531[_0x1a61e5(0x103)],this[_0x1a61e5(0xfb)]=_0x404531[_0x1a61e5(0xfb)],this[_0x1a61e5(0x11c)]=_0x404531['llm_project'],this[_0x1a61e5(0xeb)]=_0x404531[_0x1a61e5(0xeb)],this[_0x1a61e5(0x119)]=_0x404531[_0x1a61e5(0x119)],this[_0x1a61e5(0x115)]=_0x13458d[_0x1a61e5(0x115)]||![],this[_0x1a61e5(0x11e)]=_0x13458d[_0x1a61e5(0x11e)]??LogLevel[_0x1a61e5(0x11a)],this[_0x1a61e5(0x116)]=this['activeProfile']||undefined,this[_0x1a61e5(0xe1)]=getAccessToken(this[_0x1a61e5(0x122)]||undefined),this['apiKey']=getAPIKey(this[_0x1a61e5(0x122)]||undefined);const _0x1681a8=typeof _0x5e557f[_0x1a61e5(0xfc)]===_0x1a61e5(0xf7)?_0x5e557f['proxy']:undefined;this[_0x1a61e5(0xfc)]=_0x1681a8||process.env.HTTPS_PROXY||process.env.HTTP_PROXY;const _0x15080a=getConfigDir(),_0xd04f20=a58_0x1a8fe4['join'](_0x15080a,_0x1a61e5(0x127),this['sessionId']+_0x1a61e5(0xe5)),_0x4aec07=findProjectConfigPath(),_0xf32ae2=a58_0x1a8fe4['join'](_0x15080a,_0x1a61e5(0x12a)),_0x12018a=a58_0x1a8fe4['join'](_0x15080a,_0x1a61e5(0x10b));let _0x4c3ddd=null,_0x1d7737=null;this['activeProfile']&&(_0x4c3ddd=a58_0x1a8fe4[_0x1a61e5(0x11b)](_0x15080a,'profiles',this[_0x1a61e5(0x122)],_0x1a61e5(0x12a)),_0x1d7737=a58_0x1a8fe4[_0x1a61e5(0x11b)](_0x15080a,_0x1a61e5(0xf0),this[_0x1a61e5(0x122)],_0x1a61e5(0x10b))),this['configFiles']={'session':a58_0x6d8126['existsSync'](_0xd04f20)?_0xd04f20:null,'project':_0x4aec07,'profile':_0x4c3ddd&&a58_0x6d8126[_0x1a61e5(0x123)](_0x4c3ddd)?_0x4c3ddd:null,'profileCredentials':_0x1d7737&&a58_0x6d8126[_0x1a61e5(0x123)](_0x1d7737)?_0x1d7737:null,'global':a58_0x6d8126[_0x1a61e5(0x123)](_0xf32ae2)?_0xf32ae2:null,'globalCredentials':a58_0x6d8126[_0x1a61e5(0x123)](_0x12018a)?_0x12018a:null};}[a58_0x68b67a(0xed)](_0x5609e7,_0x13fd73){const _0x4a3fa3=a58_0x68b67a;if(!_0x13fd73)return _0x4a3fa3(0xf5);const _0x22d8c6=_0x13fd73;if(this[_0x4a3fa3(0xe0)][_0x4a3fa3(0x11f)][_0x5609e7]===_0x22d8c6){if(_0x5609e7===_0x4a3fa3(0xf9)&&_0x22d8c6===_0x4a3fa3(0xef)&&!this[_0x4a3fa3(0xe0)]['session'][_0x4a3fa3(0xf9)]&&!this[_0x4a3fa3(0xe0)]['project'][_0x4a3fa3(0xf9)]&&!this['layers'][_0x4a3fa3(0x116)][_0x4a3fa3(0xf9)]&&!this[_0x4a3fa3(0xe0)][_0x4a3fa3(0xf3)][_0x4a3fa3(0xf9)])return _0x4a3fa3(0x101);return _0x4a3fa3(0x114)+_0x5609e7['replace'](/_/g,'-');}if(this[_0x4a3fa3(0xe0)]['session'][_0x5609e7]===_0x22d8c6)return _0x4a3fa3(0xe7);if(this['layers'][_0x4a3fa3(0xd8)][_0x5609e7]===_0x22d8c6)return _0x4a3fa3(0xd8);if(this['layers']['profile'][_0x5609e7]===_0x22d8c6)return _0x4a3fa3(0xfa)+this[_0x4a3fa3(0x122)];if(this['layers'][_0x4a3fa3(0xf3)][_0x5609e7]===_0x22d8c6)return'global';return'default';}[a58_0x68b67a(0xdd)](){const _0x444aa0=a58_0x68b67a,_0x912bc=a58_0x1a8fe4[_0x444aa0(0x11b)](getConfigDir(),_0x444aa0(0x12a));if(!a58_0x6d8126['existsSync'](_0x912bc))return{};try{const _0x52113b=a58_0x6d8126['readFileSync'](_0x912bc,_0x444aa0(0x12c));return JSON[_0x444aa0(0x110)](_0x52113b);}catch{return{};}}[a58_0x68b67a(0xfd)](_0x57da0b){const _0x589ed9=a58_0x68b67a;_0x57da0b[_0x589ed9(0xf9)]=this[_0x589ed9(0xf9)],!_0x57da0b['database']&&this['database']&&(_0x57da0b[_0x589ed9(0xfe)]=this[_0x589ed9(0xfe)]),!_0x57da0b[_0x589ed9(0x112)]&&this[_0x589ed9(0x103)]&&(_0x57da0b[_0x589ed9(0x112)]=this[_0x589ed9(0x103)]),!_0x57da0b[_0x589ed9(0x10d)]&&this[_0x589ed9(0xfb)]&&(_0x57da0b[_0x589ed9(0x10d)]=this['segment_path']),!_0x57da0b['llmProject']&&this[_0x589ed9(0x11c)]&&(_0x57da0b['llmProject']=this[_0x589ed9(0x11c)]),!_0x57da0b[_0x589ed9(0x111)]&&this['llm_agent']&&(_0x57da0b['llmAgent']=this['llm_agent']),!_0x57da0b['workflowProject']&&this[_0x589ed9(0x119)]&&(_0x57da0b[_0x589ed9(0xf6)]=this[_0x589ed9(0x119)]);}[a58_0x68b67a(0x105)](){const _0x55f497=a58_0x68b67a;return[{'key':_0x55f497(0xf9),'value':this['site']},{'key':_0x55f497(0xfe),'value':this[_0x55f497(0xfe)]},{'key':_0x55f497(0x103),'value':this[_0x55f497(0x103)]},{'key':'segment_path','value':this[_0x55f497(0xfb)]},{'key':_0x55f497(0x11c),'value':this[_0x55f497(0x11c)]},{'key':'llm_agent','value':this[_0x55f497(0xeb)]},{'key':_0x55f497(0x119),'value':this[_0x55f497(0x119)]},{'key':_0x55f497(0x116),'value':this['activeProfile']||undefined}];}[a58_0x68b67a(0x11d)](){const _0xebbe2b=a58_0x68b67a;console[_0xebbe2b(0xff)](a58_0x1821de[_0xebbe2b(0xe2)](_0xebbe2b(0x109)));for(const {key:_0x568eb7,value:_0x124c12}of this[_0xebbe2b(0x105)]()){_0x124c12&&console[_0xebbe2b(0xff)](a58_0x1821de['cyan'](_0x568eb7)+':\x20'+_0x124c12);}}[a58_0x68b67a(0xd9)](){const _0x432af0=a58_0x68b67a;console[_0x432af0(0xff)](a58_0x1821de['bold'](_0x432af0(0x109)));for(const {key:_0x46b37a,value:_0x3bf4f4}of this[_0x432af0(0x105)]()){if(_0x3bf4f4){const _0x5ed9ea=_0x46b37a===_0x432af0(0x116)?'(active)':'('+this[_0x432af0(0xed)](_0x46b37a,_0x3bf4f4)+')';console[_0x432af0(0xff)](a58_0x1821de[_0x432af0(0x128)](_0x46b37a)+':\x20'+_0x3bf4f4+'\x20'+a58_0x1821de['dim'](_0x5ed9ea));}}console[_0x432af0(0xff)]('\x0a'+a58_0x1821de['bold'](_0x432af0(0xf8)));const _0x25a22f=[{'label':_0x432af0(0x106),'path':this['configFiles']['session'],'extra':_0x432af0(0x10c)+this[_0x432af0(0x125)]+')'},{'label':'Project','path':this[_0x432af0(0xdc)]['project']},{'label':_0x432af0(0xec),'path':this['configFiles'][_0x432af0(0x116)]},{'label':_0x432af0(0x100),'path':this['configFiles'][_0x432af0(0x10a)]},{'label':_0x432af0(0x10f),'path':this[_0x432af0(0xdc)]['global']},{'label':_0x432af0(0xea),'path':this[_0x432af0(0xdc)][_0x432af0(0x117)]}];for(const {label:_0x540b64,path:_0x14748b,extra:_0x29b084}of _0x25a22f){if(_0x14748b)console[_0x432af0(0xff)](a58_0x1821de['cyan'](_0x540b64)+':\x20'+_0x14748b+'\x20'+a58_0x1821de[_0x432af0(0xe4)]('✓')+(_0x29b084?'\x20'+a58_0x1821de['dim'](_0x29b084):''));else{if(_0x540b64==='Session')console[_0x432af0(0xff)](a58_0x1821de[_0x432af0(0x128)](_0x540b64)+':\x20'+a58_0x1821de[_0x432af0(0x126)](_0x432af0(0x124))+'\x20'+a58_0x1821de[_0x432af0(0x126)](_0x432af0(0x129)+this[_0x432af0(0x125)]+')'));else(_0x540b64===_0x432af0(0xdb)||_0x540b64===_0x432af0(0x10f))&&console[_0x432af0(0xff)](a58_0x1821de[_0x432af0(0x128)](_0x540b64)+':\x20'+a58_0x1821de[_0x432af0(0x126)](_0x432af0(0x124)));}}}async[a58_0x68b67a(0xf4)](){const _0x4b68dc=a58_0x68b67a;if(!this[_0x4b68dc(0xe1)]){const _0x53de05=await getOAuthTokens(this[_0x4b68dc(0x122)]||undefined);if(_0x53de05)return this[_0x4b68dc(0xe1)]=_0x53de05[_0x4b68dc(0x102)],undefined;}return this[_0x4b68dc(0xee)]=await getAPIKeyAsync(this[_0x4b68dc(0xf9)],this[_0x4b68dc(0x122)]||undefined),this[_0x4b68dc(0xee)];}static async[a58_0x68b67a(0xdf)](_0x359305){const _0x466308=new GlobalContext(_0x359305);return await _0x466308['resolveAPIKeyAsync'](),_0x466308;}}
1
+ const a58_0x5b28a4=a58_0x225c;(function(_0x465e3c,_0xedd4ef){const _0x566a6a=a58_0x225c,_0x2bd60d=_0x465e3c();while(!![]){try{const _0x47fa56=parseInt(_0x566a6a(0x157))/0x1*(parseInt(_0x566a6a(0x123))/0x2)+-parseInt(_0x566a6a(0x14d))/0x3+parseInt(_0x566a6a(0x14b))/0x4*(-parseInt(_0x566a6a(0x13f))/0x5)+parseInt(_0x566a6a(0x136))/0x6+parseInt(_0x566a6a(0x11b))/0x7*(-parseInt(_0x566a6a(0x151))/0x8)+parseInt(_0x566a6a(0x124))/0x9*(parseInt(_0x566a6a(0x141))/0xa)+parseInt(_0x566a6a(0x158))/0xb;if(_0x47fa56===_0xedd4ef)break;else _0x2bd60d['push'](_0x2bd60d['shift']());}catch(_0x26616d){_0x2bd60d['push'](_0x2bd60d['shift']());}}}(a58_0x3f05,0xd0fde));import{resolveSite,getAPIKey,getAccessToken,getAPIKeyAsync,getConfigDir}from'./config.js';import{getOAuthTokens}from'./oauth-keychain.js';import{loadSessionContext,getSessionID}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';import{loadProfile}from'./profile.js';import{LogLevel}from'../utils/logger/index.js';function a58_0x225c(_0x457fac,_0x229109){_0x457fac=_0x457fac-0x110;const _0x3f0505=a58_0x3f05();let _0x225ca8=_0x3f0505[_0x457fac];return _0x225ca8;}import*as a58_0x39b4ff from'node:fs';import*as a58_0x216c18 from'node:path';import a58_0x171b33 from'chalk';function a58_0x3f05(){const _0x53189b=['.json','profile:\x20','5912275koRYaq','utf-8','6693580ElgQEA','project','globalCredentials','green','llm_agent','accessToken','llmAgent','profiles','env','cli','4lNWMgm','parentSegment','3118137sUljnY','site','Profile\x20Credentials','(using\x20session:\x20','13016ykeqDD','parse','not\x20set','segment_path','CLI\x20flag:\x20--','cyan','170jubJpY','9719930jvSKtL','createAsync','injectIntoOptions','llmProject','displayWithSources','display','proxy','profileCredentials','Project','(session:\x20','logLevel','config','entries','loadGlobalConfig','profile','access_token','segmentPath','database','workflow_project','activeProfile','Global','INFO','getParameters','Global\x20Credentials','sessionId','4781mkZOxs','dim','getSource','workflowProject','us01','configFiles','log','cliFlags','12458aRkadd','18DyOhjo','apiKey','sessions','profileSource','[configuration\x20files]','parent_segment','string','existsSync','none','verbose','join','resolveAPIKeyAsync','.env','bold','(active)','Session','llm_project','tdx.json','5446974SqKwRj','readFileSync','[context]','assign','layers','session','global'];a58_0x3f05=function(){return _0x53189b;};return a58_0x3f05();}export class GlobalContext{[a58_0x5b28a4(0x14e)];[a58_0x5b28a4(0x113)];['parent_segment'];[a58_0x5b28a4(0x154)];[a58_0x5b28a4(0x134)];[a58_0x5b28a4(0x145)];['workflow_project'];['apiKey'];[a58_0x5b28a4(0x146)];['proxy'];[a58_0x5b28a4(0x12d)];[a58_0x5b28a4(0x162)];[a58_0x5b28a4(0x110)];[a58_0x5b28a4(0x127)]=null;[a58_0x5b28a4(0x13a)];[a58_0x5b28a4(0x115)];['sessionId'];[a58_0x5b28a4(0x120)];constructor(_0x3f6191){const _0x1454c8=a58_0x5b28a4;this[_0x1454c8(0x11a)]=getSessionID(_0x3f6191[_0x1454c8(0x13b)]);const _0x37233d=loadSessionContext(_0x3f6191['session']),_0x188443=loadProjectConfig(),_0x24a27c=this['loadGlobalConfig']();if(_0x3f6191[_0x1454c8(0x110)])this[_0x1454c8(0x115)]=_0x3f6191[_0x1454c8(0x110)],this[_0x1454c8(0x127)]=_0x1454c8(0x14a);else{if(_0x37233d?.[_0x1454c8(0x110)])this[_0x1454c8(0x115)]=_0x37233d[_0x1454c8(0x110)],this[_0x1454c8(0x127)]=_0x1454c8(0x13b);else{if(_0x24a27c[_0x1454c8(0x110)])this['activeProfile']=_0x24a27c[_0x1454c8(0x110)],this['profileSource']=_0x1454c8(0x163);else process.env.TDX_PROFILE?(this['activeProfile']=process.env.TDX_PROFILE,this['profileSource']=_0x1454c8(0x149)):(this['activeProfile']=null,this[_0x1454c8(0x127)]=null);}}const _0x5976b8=this[_0x1454c8(0x115)]?loadProfile(this['activeProfile']):null,_0x31d6d0=_0xace763=>{const _0x1b934b=_0x1454c8;if(!_0xace763)return{};const _0x28e139=_0xace763,_0x57a04e={};for(const [_0x3c8167,_0x21bf05]of Object[_0x1b934b(0x164)](_0x28e139)){typeof _0x21bf05===_0x1b934b(0x12a)&&(_0x57a04e[_0x3c8167]=_0x21bf05);}return _0x57a04e;},_0x15974d={},_0x2ba271=(_0x43e0df,_0x14c742,_0x33d931)=>{const _0x2e3310=_0x1454c8;if(!_0x43e0df)return![];if(_0x33d931&&_0x43e0df===_0x33d931)return![];const _0x9f89dc=_0x37233d,_0x4bb7e0=_0x188443,_0x156b7e=_0x5976b8?.[_0x2e3310(0x163)],_0x368345=_0x24a27c,_0x2f2dfe=_0x9f89dc?.[_0x14c742],_0x2c33d0=_0x4bb7e0?.[_0x14c742],_0x185ad0=_0x156b7e?.[_0x14c742],_0x540b6c=_0x368345[_0x14c742];return _0x43e0df!==_0x2f2dfe&&_0x43e0df!==_0x2c33d0&&_0x43e0df!==_0x185ad0&&_0x43e0df!==_0x540b6c;},_0x54b127=[{'optionKey':_0x1454c8(0x14e),'contextKey':'site','defaultValue':_0x1454c8(0x11f)},{'optionKey':_0x1454c8(0x113),'contextKey':_0x1454c8(0x113)},{'optionKey':_0x1454c8(0x14c),'contextKey':_0x1454c8(0x129)},{'optionKey':_0x1454c8(0x15b),'contextKey':_0x1454c8(0x134)},{'optionKey':_0x1454c8(0x147),'contextKey':_0x1454c8(0x145)},{'optionKey':_0x1454c8(0x110),'contextKey':_0x1454c8(0x110)}];for(const {optionKey:_0x171d96,contextKey:_0xd19947,defaultValue:_0xbc0a28}of _0x54b127){const _0x1f6004=_0x3f6191[_0x171d96];_0x2ba271(_0x1f6004,_0xd19947,_0xbc0a28)&&(_0x15974d[_0xd19947]=_0x1f6004);}this[_0x1454c8(0x13a)]={'cliFlags':_0x15974d,'session':_0x31d6d0(_0x37233d),'project':_0x31d6d0(_0x188443),'profile':_0x31d6d0(_0x5976b8?.['config']),'global':_0x31d6d0(_0x24a27c)};const _0x471135={...this['layers'][_0x1454c8(0x13c)],...this['layers'][_0x1454c8(0x110)],...this[_0x1454c8(0x13a)][_0x1454c8(0x142)]};process.env.TDX_SITE&&!this[_0x1454c8(0x13a)][_0x1454c8(0x13b)][_0x1454c8(0x14e)]&&!this['layers'][_0x1454c8(0x122)][_0x1454c8(0x14e)]&&(_0x471135[_0x1454c8(0x14e)]=process.env.TDX_SITE);Object['assign'](_0x471135,this['layers'][_0x1454c8(0x13b)]),Object[_0x1454c8(0x139)](_0x471135,this[_0x1454c8(0x13a)][_0x1454c8(0x122)]);const _0xde3083=_0x471135[_0x1454c8(0x14e)]||_0x1454c8(0x11f);this['site']=resolveSite(_0xde3083),this[_0x1454c8(0x113)]=_0x471135[_0x1454c8(0x113)],this[_0x1454c8(0x129)]=_0x471135[_0x1454c8(0x129)],this[_0x1454c8(0x154)]=_0x471135[_0x1454c8(0x154)],this[_0x1454c8(0x134)]=_0x471135[_0x1454c8(0x134)],this[_0x1454c8(0x145)]=_0x471135[_0x1454c8(0x145)],this[_0x1454c8(0x114)]=_0x471135['workflow_project'],this[_0x1454c8(0x12d)]=_0x3f6191[_0x1454c8(0x12d)]||![],this[_0x1454c8(0x162)]=_0x3f6191['logLevel']??LogLevel[_0x1454c8(0x117)],this[_0x1454c8(0x110)]=this[_0x1454c8(0x115)]||undefined,this[_0x1454c8(0x146)]=getAccessToken(this['activeProfile']||undefined),this[_0x1454c8(0x125)]=getAPIKey(this[_0x1454c8(0x115)]||undefined);const _0x5b3442=typeof _0x24a27c['proxy']===_0x1454c8(0x12a)?_0x24a27c['proxy']:undefined;this[_0x1454c8(0x15e)]=_0x5b3442||process.env.HTTPS_PROXY||process.env.HTTP_PROXY;const _0x513f53=getConfigDir(),_0x23bb9f=a58_0x216c18[_0x1454c8(0x12e)](_0x513f53,_0x1454c8(0x126),this[_0x1454c8(0x11a)]+_0x1454c8(0x13d)),_0x3f598a=findProjectConfigPath(),_0x11117a=a58_0x216c18['join'](_0x513f53,_0x1454c8(0x135)),_0x3512d7=a58_0x216c18['join'](_0x513f53,_0x1454c8(0x130));let _0x604225=null,_0xce3a1e=null;this[_0x1454c8(0x115)]&&(_0x604225=a58_0x216c18[_0x1454c8(0x12e)](_0x513f53,_0x1454c8(0x148),this[_0x1454c8(0x115)],'tdx.json'),_0xce3a1e=a58_0x216c18[_0x1454c8(0x12e)](_0x513f53,_0x1454c8(0x148),this[_0x1454c8(0x115)],'.env')),this['configFiles']={'session':a58_0x39b4ff[_0x1454c8(0x12b)](_0x23bb9f)?_0x23bb9f:null,'project':_0x3f598a,'profile':_0x604225&&a58_0x39b4ff[_0x1454c8(0x12b)](_0x604225)?_0x604225:null,'profileCredentials':_0xce3a1e&&a58_0x39b4ff[_0x1454c8(0x12b)](_0xce3a1e)?_0xce3a1e:null,'global':a58_0x39b4ff[_0x1454c8(0x12b)](_0x11117a)?_0x11117a:null,'globalCredentials':a58_0x39b4ff[_0x1454c8(0x12b)](_0x3512d7)?_0x3512d7:null};}[a58_0x5b28a4(0x11d)](_0x4cdf74,_0x39d173){const _0x18247f=a58_0x5b28a4;if(!_0x39d173)return _0x18247f(0x153);const _0x39499e=_0x39d173;if(this[_0x18247f(0x13a)]['cliFlags'][_0x4cdf74]===_0x39499e){if(_0x4cdf74===_0x18247f(0x14e)&&_0x39499e===_0x18247f(0x11f)&&!this[_0x18247f(0x13a)]['session'][_0x18247f(0x14e)]&&!this['layers'][_0x18247f(0x142)][_0x18247f(0x14e)]&&!this[_0x18247f(0x13a)][_0x18247f(0x110)][_0x18247f(0x14e)]&&!this['layers']['global'][_0x18247f(0x14e)])return'default';return _0x18247f(0x155)+_0x4cdf74['replace'](/_/g,'-');}if(this['layers'][_0x18247f(0x13b)][_0x4cdf74]===_0x39499e)return _0x18247f(0x13b);if(this[_0x18247f(0x13a)][_0x18247f(0x142)][_0x4cdf74]===_0x39499e)return _0x18247f(0x142);if(this['layers'][_0x18247f(0x110)][_0x4cdf74]===_0x39499e)return _0x18247f(0x13e)+this[_0x18247f(0x115)];if(this[_0x18247f(0x13a)][_0x18247f(0x13c)][_0x4cdf74]===_0x39499e)return _0x18247f(0x13c);return'default';}[a58_0x5b28a4(0x165)](){const _0x426601=a58_0x5b28a4,_0x564c50=a58_0x216c18[_0x426601(0x12e)](getConfigDir(),_0x426601(0x135));if(!a58_0x39b4ff[_0x426601(0x12b)](_0x564c50))return{};try{const _0x359034=a58_0x39b4ff[_0x426601(0x137)](_0x564c50,_0x426601(0x140));return JSON[_0x426601(0x152)](_0x359034);}catch{return{};}}[a58_0x5b28a4(0x15a)](_0x2f3644){const _0x2ba32e=a58_0x5b28a4;_0x2f3644[_0x2ba32e(0x14e)]=this['site'],!_0x2f3644[_0x2ba32e(0x113)]&&this['database']&&(_0x2f3644[_0x2ba32e(0x113)]=this['database']),!_0x2f3644[_0x2ba32e(0x14c)]&&this[_0x2ba32e(0x129)]&&(_0x2f3644['parentSegment']=this[_0x2ba32e(0x129)]),!_0x2f3644['segmentPath']&&this[_0x2ba32e(0x154)]&&(_0x2f3644[_0x2ba32e(0x112)]=this[_0x2ba32e(0x154)]),!_0x2f3644['llmProject']&&this[_0x2ba32e(0x134)]&&(_0x2f3644['llmProject']=this[_0x2ba32e(0x134)]),!_0x2f3644[_0x2ba32e(0x147)]&&this[_0x2ba32e(0x145)]&&(_0x2f3644[_0x2ba32e(0x147)]=this[_0x2ba32e(0x145)]),!_0x2f3644['workflowProject']&&this[_0x2ba32e(0x114)]&&(_0x2f3644[_0x2ba32e(0x11e)]=this[_0x2ba32e(0x114)]);}[a58_0x5b28a4(0x118)](){const _0x152298=a58_0x5b28a4;return[{'key':'site','value':this['site']},{'key':_0x152298(0x113),'value':this['database']},{'key':'parent_segment','value':this[_0x152298(0x129)]},{'key':'segment_path','value':this[_0x152298(0x154)]},{'key':_0x152298(0x134),'value':this[_0x152298(0x134)]},{'key':_0x152298(0x145),'value':this['llm_agent']},{'key':_0x152298(0x114),'value':this[_0x152298(0x114)]},{'key':_0x152298(0x110),'value':this[_0x152298(0x115)]||undefined}];}[a58_0x5b28a4(0x15d)](){const _0x2f5e10=a58_0x5b28a4;console[_0x2f5e10(0x121)](a58_0x171b33[_0x2f5e10(0x131)](_0x2f5e10(0x138)));for(const {key:_0x12838f,value:_0x2af410}of this['getParameters']()){_0x2af410&&console[_0x2f5e10(0x121)](a58_0x171b33['cyan'](_0x12838f)+':\x20'+_0x2af410);}}[a58_0x5b28a4(0x15c)](){const _0x544b61=a58_0x5b28a4;console[_0x544b61(0x121)](a58_0x171b33['bold'](_0x544b61(0x138)));for(const {key:_0x6f07b0,value:_0x262aac}of this[_0x544b61(0x118)]()){if(_0x262aac){const _0x5da0da=_0x6f07b0===_0x544b61(0x110)?_0x544b61(0x132):'('+this[_0x544b61(0x11d)](_0x6f07b0,_0x262aac)+')';console['log'](a58_0x171b33['cyan'](_0x6f07b0)+':\x20'+_0x262aac+'\x20'+a58_0x171b33[_0x544b61(0x11c)](_0x5da0da));}}console[_0x544b61(0x121)]('\x0a'+a58_0x171b33[_0x544b61(0x131)](_0x544b61(0x128)));const _0xa8303b=[{'label':'Session','path':this['configFiles'][_0x544b61(0x13b)],'extra':_0x544b61(0x161)+this[_0x544b61(0x11a)]+')'},{'label':'Project','path':this[_0x544b61(0x120)][_0x544b61(0x142)]},{'label':'Profile','path':this[_0x544b61(0x120)][_0x544b61(0x110)]},{'label':_0x544b61(0x14f),'path':this[_0x544b61(0x120)][_0x544b61(0x15f)]},{'label':_0x544b61(0x116),'path':this['configFiles'][_0x544b61(0x13c)]},{'label':_0x544b61(0x119),'path':this[_0x544b61(0x120)][_0x544b61(0x143)]}];for(const {label:_0xfaf4aa,path:_0x4b0fdc,extra:_0x6553cc}of _0xa8303b){if(_0x4b0fdc)console['log'](a58_0x171b33[_0x544b61(0x156)](_0xfaf4aa)+':\x20'+_0x4b0fdc+'\x20'+a58_0x171b33[_0x544b61(0x144)]('✓')+(_0x6553cc?'\x20'+a58_0x171b33[_0x544b61(0x11c)](_0x6553cc):''));else{if(_0xfaf4aa===_0x544b61(0x133))console['log'](a58_0x171b33[_0x544b61(0x156)](_0xfaf4aa)+':\x20'+a58_0x171b33['dim'](_0x544b61(0x12c))+'\x20'+a58_0x171b33[_0x544b61(0x11c)](_0x544b61(0x150)+this['sessionId']+')'));else(_0xfaf4aa===_0x544b61(0x160)||_0xfaf4aa===_0x544b61(0x116))&&console[_0x544b61(0x121)](a58_0x171b33[_0x544b61(0x156)](_0xfaf4aa)+':\x20'+a58_0x171b33[_0x544b61(0x11c)](_0x544b61(0x12c)));}}}async[a58_0x5b28a4(0x12f)](){const _0x45df5e=a58_0x5b28a4;if(!this[_0x45df5e(0x146)]){const _0x528e6e=await getOAuthTokens(this[_0x45df5e(0x115)]||undefined);if(_0x528e6e)return this[_0x45df5e(0x146)]=_0x528e6e[_0x45df5e(0x111)],undefined;}return this[_0x45df5e(0x125)]=await getAPIKeyAsync(this[_0x45df5e(0x14e)],this[_0x45df5e(0x115)]||undefined),this[_0x45df5e(0x125)];}static async[a58_0x5b28a4(0x159)](_0x52706d){const _0x1589df=a58_0x5b28a4,_0x18239f=new GlobalContext(_0x52706d);return await _0x18239f[_0x1589df(0x12f)](),_0x18239f;}}
@@ -1 +1 @@
1
- const a59_0x372af8=a59_0x4a18;(function(_0x3233cb,_0x462fce){const _0x2a5f18=a59_0x4a18,_0x5196bb=_0x3233cb();while(!![]){try{const _0x46e61a=-parseInt(_0x2a5f18(0xd5))/0x1*(-parseInt(_0x2a5f18(0xd8))/0x2)+parseInt(_0x2a5f18(0xe8))/0x3+-parseInt(_0x2a5f18(0xe4))/0x4*(parseInt(_0x2a5f18(0xe6))/0x5)+-parseInt(_0x2a5f18(0xea))/0x6*(parseInt(_0x2a5f18(0xdf))/0x7)+parseInt(_0x2a5f18(0xe5))/0x8+-parseInt(_0x2a5f18(0xf2))/0x9+parseInt(_0x2a5f18(0xdd))/0xa*(parseInt(_0x2a5f18(0xf1))/0xb);if(_0x46e61a===_0x462fce)break;else _0x5196bb['push'](_0x5196bb['shift']());}catch(_0x17efc8){_0x5196bb['push'](_0x5196bb['shift']());}}}(a59_0x22a7,0x65772));const SERVICE_NAME=a59_0x372af8(0xdc);let EntryClass=null,keyringLoadError=null;function a59_0x22a7(){const _0x136811=['error','restricted','__keychain_test__','not\x20available','access_denied','profile:','286QWfbJM','5572386jLxrer','not\x20found','@napi-rs/keyring','System\x20keychain\x20is\x20not\x20available','Entry',':api_key','getPassword','-25300','Warning:\x20','543JqUQsA','setPassword','toLowerCase','522GCLRkO','includes','no\x20matching\x20entry','reason','tdx','106550tNrJpi','unavailable','7RJrZcY','value','success','not_found','access','22228nBcFnd','6409616WrtvSq','25arIwHw','message','599403fBuNwk','cannot\x20find','2143290fHqqEE'];a59_0x22a7=function(){return _0x136811;};return a59_0x22a7();}async function getEntryClass(){const _0x16088d=a59_0x372af8;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x345577=await import(_0x16088d(0xf4));return EntryClass=_0x345577[_0x16088d(0xf6)],EntryClass;}catch(_0x4d7e3e){return keyringLoadError=_0x4d7e3e instanceof Error?_0x4d7e3e:new Error(String(_0x4d7e3e)),null;}}function getAccountName(_0xa31fc7){const _0x1e7503=a59_0x372af8,_0x4965af=_0xa31fc7||'';return _0x1e7503(0xf0)+_0x4965af+_0x1e7503(0xf7);}export async function getKeychainAPIKey(_0x5ba53d){const _0x4ddfae=a59_0x372af8,_0x46f719=await getKeychainAPIKeyWithStatus(_0x5ba53d);if(_0x46f719[_0x4ddfae(0xe1)])return _0x46f719[_0x4ddfae(0xe0)];return _0x46f719[_0x4ddfae(0xdb)]===_0x4ddfae(0xef)&&console[_0x4ddfae(0xeb)](_0x4ddfae(0xd4)+_0x46f719[_0x4ddfae(0xe7)]),null;}export async function getKeychainAPIKeyWithStatus(_0x3a5701){const _0x5702b0=a59_0x372af8;try{const _0x244bd0=await getEntryClass();if(!_0x244bd0)return{'success':![],'reason':'unavailable'};const _0x21834e=getAccountName(_0x3a5701),_0x2c644b=new _0x244bd0(SERVICE_NAME,_0x21834e),_0x261503=_0x2c644b[_0x5702b0(0xf8)]();if(_0x261503)return{'success':!![],'value':_0x261503};return{'success':![],'reason':'not_found'};}catch(_0x32acc6){const _0x3ab10f=_0x32acc6 instanceof Error?_0x32acc6[_0x5702b0(0xe7)]:String(_0x32acc6);if(_0x3ab10f[_0x5702b0(0xd9)](_0x5702b0(0xf9))||_0x3ab10f['toLowerCase']()[_0x5702b0(0xd9)]('could\x20not\x20be\x20found')||_0x3ab10f['toLowerCase']()[_0x5702b0(0xd9)](_0x5702b0(0xf3))||_0x3ab10f[_0x5702b0(0xd7)]()['includes'](_0x5702b0(0xda)))return{'success':![],'reason':_0x5702b0(0xe2)};if(_0x3ab10f[_0x5702b0(0xd9)]('-25293')||_0x3ab10f[_0x5702b0(0xd7)]()[_0x5702b0(0xd9)](_0x5702b0(0xec))||_0x3ab10f[_0x5702b0(0xd7)]()['includes'](_0x5702b0(0xe3)))return{'success':![],'reason':'access_denied','message':'Keychain\x20access\x20denied.\x20The\x20API\x20key\x20exists\x20but\x20cannot\x20be\x20accessed.\x20Try\x20running\x20\x22tdx\x20auth\x20setup\x22\x20to\x20re-authenticate,\x20or\x20check\x20your\x20keychain\x20permissions\x20for\x20\x22tdx\x22.'};return{'success':![],'reason':_0x5702b0(0xde),'message':_0x3ab10f};}}export async function saveKeychainAPIKey(_0x4cdbd,_0x4743a6){const _0x48daf7=a59_0x372af8,_0x18a9ae=await getEntryClass();if(!_0x18a9ae)throw new Error(_0x48daf7(0xf5));const _0x4a0e58=getAccountName(_0x4743a6),_0x4b72b2=new _0x18a9ae(SERVICE_NAME,_0x4a0e58);_0x4b72b2[_0x48daf7(0xd6)](_0x4cdbd);}function a59_0x4a18(_0xf4a54e,_0x45fef1){_0xf4a54e=_0xf4a54e-0xd4;const _0x22a76d=a59_0x22a7();let _0x4a1834=_0x22a76d[_0xf4a54e];return _0x4a1834;}export async function deleteKeychainAPIKey(_0xd3a993){try{const _0x4efe36=await getEntryClass();if(!_0x4efe36)return![];const _0xaa264b=getAccountName(_0xd3a993),_0x281ca2=new _0x4efe36(SERVICE_NAME,_0xaa264b);return _0x281ca2['deleteCredential'](),!![];}catch{return![];}}export async function isKeychainAvailable(){const _0x3818c5=a59_0x372af8;try{const _0x49217b=await getEntryClass();if(!_0x49217b)return![];const _0x50ec15=new _0x49217b(SERVICE_NAME,_0x3818c5(0xed));return _0x50ec15['getPassword'](),!![];}catch(_0x37f5d6){const _0x1e523e=_0x37f5d6 instanceof Error?_0x37f5d6[_0x3818c5(0xe7)][_0x3818c5(0xd7)]():'';if(_0x1e523e[_0x3818c5(0xd9)](_0x3818c5(0xee))||_0x1e523e[_0x3818c5(0xd9)]('not\x20supported')||_0x1e523e['includes'](_0x3818c5(0xe9)))return![];return!![];}}
1
+ const a59_0x419215=a59_0x8a31;(function(_0x329e4a,_0x43b0bb){const _0x3897ac=a59_0x8a31,_0x4145c1=_0x329e4a();while(!![]){try{const _0x28d22c=parseInt(_0x3897ac(0x81))/0x1+-parseInt(_0x3897ac(0x90))/0x2+-parseInt(_0x3897ac(0x8d))/0x3+-parseInt(_0x3897ac(0x98))/0x4*(parseInt(_0x3897ac(0x96))/0x5)+-parseInt(_0x3897ac(0x7a))/0x6+-parseInt(_0x3897ac(0x91))/0x7*(parseInt(_0x3897ac(0x85))/0x8)+parseInt(_0x3897ac(0x99))/0x9;if(_0x28d22c===_0x43b0bb)break;else _0x4145c1['push'](_0x4145c1['shift']());}catch(_0x27554e){_0x4145c1['push'](_0x4145c1['shift']());}}}(a59_0xfbea,0xb12e2));function a59_0xfbea(){const _0x5dcf49=['1950084qJBHOu','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.','-25293','tdx','could\x20not\x20be\x20found','message',':api_key','844015SDWIal','access_denied','setPassword','System\x20keychain\x20is\x20not\x20available','534472lJmIBe','cannot\x20find','Entry','restricted','error','deleteCredential','toLowerCase','Warning:\x20','2789973IvWlZw','value','not\x20found','1960736lnOuXb','112uJeduk','reason','includes','@napi-rs/keyring','no\x20matching\x20entry','40975TGzSFF','__keychain_test__','200FBjFpZ','32362038pgnKXA','not\x20supported','unavailable'];a59_0xfbea=function(){return _0x5dcf49;};return a59_0xfbea();}const SERVICE_NAME=a59_0x419215(0x7d);let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x1b2cb6=a59_0x419215;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x38b654=await import(_0x1b2cb6(0x94));return EntryClass=_0x38b654[_0x1b2cb6(0x87)],EntryClass;}catch(_0x2a38e3){return keyringLoadError=_0x2a38e3 instanceof Error?_0x2a38e3:new Error(String(_0x2a38e3)),null;}}function getAccountName(_0x3f6f16){const _0x1166c0=a59_0x419215,_0x3fc05f=_0x3f6f16||'';return'profile:'+_0x3fc05f+_0x1166c0(0x80);}export async function getKeychainAPIKey(_0x36f4c1){const _0x3c9267=a59_0x419215,_0x5aca90=await getKeychainAPIKeyWithStatus(_0x36f4c1);if(_0x5aca90['success'])return _0x5aca90[_0x3c9267(0x8e)];return _0x5aca90[_0x3c9267(0x92)]===_0x3c9267(0x82)&&console[_0x3c9267(0x89)](_0x3c9267(0x8c)+_0x5aca90[_0x3c9267(0x7f)]),null;}export async function getKeychainAPIKeyWithStatus(_0x4ad3f2){const _0x281d52=a59_0x419215;try{const _0x2e6cf8=await getEntryClass();if(!_0x2e6cf8)return{'success':![],'reason':_0x281d52(0x79)};const _0x12a261=getAccountName(_0x4ad3f2),_0x3b6f85=new _0x2e6cf8(SERVICE_NAME,_0x12a261),_0x279c1d=_0x3b6f85['getPassword']();if(_0x279c1d)return{'success':!![],'value':_0x279c1d};return{'success':![],'reason':'not_found'};}catch(_0x46e787){const _0xa6f1aa=_0x46e787 instanceof Error?_0x46e787[_0x281d52(0x7f)]:String(_0x46e787);if(_0xa6f1aa[_0x281d52(0x93)]('-25300')||_0xa6f1aa['toLowerCase']()[_0x281d52(0x93)](_0x281d52(0x7e))||_0xa6f1aa[_0x281d52(0x8b)]()[_0x281d52(0x93)](_0x281d52(0x8f))||_0xa6f1aa[_0x281d52(0x8b)]()['includes'](_0x281d52(0x95)))return{'success':![],'reason':'not_found'};if(_0xa6f1aa[_0x281d52(0x93)](_0x281d52(0x7c))||_0xa6f1aa['toLowerCase']()[_0x281d52(0x93)](_0x281d52(0x88))||_0xa6f1aa[_0x281d52(0x8b)]()[_0x281d52(0x93)]('access'))return{'success':![],'reason':_0x281d52(0x82),'message':_0x281d52(0x7b)};return{'success':![],'reason':'unavailable','message':_0xa6f1aa};}}export async function saveKeychainAPIKey(_0x3da427,_0x250efa){const _0x19ca75=a59_0x419215,_0x228549=await getEntryClass();if(!_0x228549)throw new Error(_0x19ca75(0x84));const _0x15912b=getAccountName(_0x250efa),_0x766991=new _0x228549(SERVICE_NAME,_0x15912b);_0x766991[_0x19ca75(0x83)](_0x3da427);}export async function deleteKeychainAPIKey(_0x34bb14){const _0x326e6b=a59_0x419215;try{const _0x2fefb6=await getEntryClass();if(!_0x2fefb6)return![];const _0x27d357=getAccountName(_0x34bb14),_0x31e37e=new _0x2fefb6(SERVICE_NAME,_0x27d357);return _0x31e37e[_0x326e6b(0x8a)](),!![];}catch{return![];}}function a59_0x8a31(_0x4898e1,_0x45ae71){_0x4898e1=_0x4898e1-0x78;const _0xfbea3=a59_0xfbea();let _0x8a317a=_0xfbea3[_0x4898e1];return _0x8a317a;}export async function isKeychainAvailable(){const _0x5a26ac=a59_0x419215;try{const _0x33a369=await getEntryClass();if(!_0x33a369)return![];const _0x1764fd=new _0x33a369(SERVICE_NAME,_0x5a26ac(0x97));return _0x1764fd['getPassword'](),!![];}catch(_0xa106a3){const _0x318454=_0xa106a3 instanceof Error?_0xa106a3['message'][_0x5a26ac(0x8b)]():'';if(_0x318454[_0x5a26ac(0x93)]('not\x20available')||_0x318454['includes'](_0x5a26ac(0x78))||_0x318454[_0x5a26ac(0x93)](_0x5a26ac(0x86)))return![];return!![];}}
@@ -1 +1 @@
1
- const a60_0x2ff146=a60_0x7783;(function(_0x40d470,_0x1bc6bc){const _0x59db1b=a60_0x7783,_0x208b70=_0x40d470();while(!![]){try{const _0x4ff01d=parseInt(_0x59db1b(0x10b))/0x1*(parseInt(_0x59db1b(0x107))/0x2)+-parseInt(_0x59db1b(0x108))/0x3+-parseInt(_0x59db1b(0x102))/0x4+parseInt(_0x59db1b(0x106))/0x5*(-parseInt(_0x59db1b(0xfc))/0x6)+-parseInt(_0x59db1b(0x100))/0x7+-parseInt(_0x59db1b(0x10a))/0x8*(-parseInt(_0x59db1b(0x10c))/0x9)+-parseInt(_0x59db1b(0x104))/0xa*(-parseInt(_0x59db1b(0x101))/0xb);if(_0x4ff01d===_0x1bc6bc)break;else _0x208b70['push'](_0x208b70['shift']());}catch(_0xa2b653){_0x208b70['push'](_0x208b70['shift']());}}}(a60_0x3792,0x6f5fc));function a60_0x3792(){const _0x40ba63=['@napi-rs/keyring','298434gjEYmI','Entry','parse','stringify','338303GIAtVj','22fMoRMT','3245776WxMVVA','tdx','7187170LoyHTS','profile:','25OelXhg','496246JeLGak','1850691JUfMbd','setPassword','1983984KdAaCf','1GYUBsP','18wbkALn'];a60_0x3792=function(){return _0x40ba63;};return a60_0x3792();}const SERVICE_NAME=a60_0x2ff146(0x103);let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x54ad8c=a60_0x2ff146;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x3eb8ee=await import(_0x54ad8c(0x10d));return EntryClass=_0x3eb8ee[_0x54ad8c(0xfd)],EntryClass;}catch(_0x4a777a){return keyringLoadError=_0x4a777a instanceof Error?_0x4a777a:new Error(String(_0x4a777a)),null;}}function getOAuthAccountName(_0x1d7b93){const _0x14b0d9=a60_0x2ff146,_0x13f7ea=_0x1d7b93||'';return _0x14b0d9(0x105)+_0x13f7ea+':oauth_tokens';}export async function saveOAuthTokens(_0x532116,_0x4b5494){const _0x18b9e9=a60_0x2ff146,_0x1d3e7a=await getEntryClass();if(!_0x1d3e7a)throw new Error('System\x20keychain\x20is\x20not\x20available');const _0x355846=getOAuthAccountName(_0x4b5494),_0x7f1048=new _0x1d3e7a(SERVICE_NAME,_0x355846);_0x7f1048[_0x18b9e9(0x109)](JSON[_0x18b9e9(0xff)](_0x532116));}function a60_0x7783(_0x5affe0,_0x545b6f){_0x5affe0=_0x5affe0-0xfc;const _0x3792e9=a60_0x3792();let _0x7783d0=_0x3792e9[_0x5affe0];return _0x7783d0;}export async function getOAuthTokens(_0x249fe2){const _0x90d5f8=a60_0x2ff146;try{const _0x2c9417=await getEntryClass();if(!_0x2c9417)return null;const _0x4dd24f=getOAuthAccountName(_0x249fe2),_0x276b16=new _0x2c9417(SERVICE_NAME,_0x4dd24f),_0x20e90f=_0x276b16['getPassword']();if(_0x20e90f)return JSON[_0x90d5f8(0xfe)](_0x20e90f);return null;}catch{return null;}}export async function deleteOAuthTokens(_0x19347d){try{const _0x54ffe5=await getEntryClass();if(!_0x54ffe5)return![];const _0x23a3e9=getOAuthAccountName(_0x19347d),_0x1d905f=new _0x54ffe5(SERVICE_NAME,_0x23a3e9);return _0x1d905f['deleteCredential'](),!![];}catch{return![];}}
1
+ const a60_0x1966d6=a60_0x5c15;(function(_0x3f7184,_0x4446cb){const _0x2ae0a6=a60_0x5c15,_0x1cc053=_0x3f7184();while(!![]){try{const _0x402cdc=parseInt(_0x2ae0a6(0x100))/0x1*(parseInt(_0x2ae0a6(0x101))/0x2)+parseInt(_0x2ae0a6(0x10a))/0x3*(parseInt(_0x2ae0a6(0xfe))/0x4)+parseInt(_0x2ae0a6(0xfd))/0x5*(parseInt(_0x2ae0a6(0x109))/0x6)+-parseInt(_0x2ae0a6(0x104))/0x7*(parseInt(_0x2ae0a6(0x108))/0x8)+parseInt(_0x2ae0a6(0xfa))/0x9+-parseInt(_0x2ae0a6(0x10b))/0xa*(-parseInt(_0x2ae0a6(0x10c))/0xb)+-parseInt(_0x2ae0a6(0xfb))/0xc;if(_0x402cdc===_0x4446cb)break;else _0x1cc053['push'](_0x1cc053['shift']());}catch(_0x5e13d5){_0x1cc053['push'](_0x1cc053['shift']());}}}(a60_0x5d56,0x727a9));const SERVICE_NAME=a60_0x1966d6(0x105);let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x4cb712=a60_0x1966d6;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x43b568=await import('@napi-rs/keyring');return EntryClass=_0x43b568[_0x4cb712(0xfc)],EntryClass;}catch(_0x45c48a){return keyringLoadError=_0x45c48a instanceof Error?_0x45c48a:new Error(String(_0x45c48a)),null;}}function getOAuthAccountName(_0x3d80da){const _0x699af0=a60_0x1966d6,_0x468942=_0x3d80da||'';return _0x699af0(0x10d)+_0x468942+':oauth_tokens';}export async function saveOAuthTokens(_0x1c1779,_0x17dad8){const _0x2fde72=a60_0x1966d6,_0x220577=await getEntryClass();if(!_0x220577)throw new Error(_0x2fde72(0x103));const _0x8c426c=getOAuthAccountName(_0x17dad8),_0x26bb4c=new _0x220577(SERVICE_NAME,_0x8c426c);_0x26bb4c[_0x2fde72(0x107)](JSON[_0x2fde72(0xff)](_0x1c1779));}export async function getOAuthTokens(_0x3d4614){const _0xe9f95b=a60_0x1966d6;try{const _0xb21c1c=await getEntryClass();if(!_0xb21c1c)return null;const _0x246791=getOAuthAccountName(_0x3d4614),_0x116ff9=new _0xb21c1c(SERVICE_NAME,_0x246791),_0x40e73d=_0x116ff9[_0xe9f95b(0x106)]();if(_0x40e73d)return JSON['parse'](_0x40e73d);return null;}catch{return null;}}export async function deleteOAuthTokens(_0x278e5b){const _0x4cfb38=a60_0x1966d6;try{const _0x31d38f=await getEntryClass();if(!_0x31d38f)return![];const _0x17fa7b=getOAuthAccountName(_0x278e5b),_0x362933=new _0x31d38f(SERVICE_NAME,_0x17fa7b);return _0x362933[_0x4cfb38(0x102)](),!![];}catch{return![];}}function a60_0x5c15(_0x9a9a81,_0x4e080d){_0x9a9a81=_0x9a9a81-0xfa;const _0x5d5639=a60_0x5d56();let _0x5c15ea=_0x5d5639[_0x9a9a81];return _0x5c15ea;}function a60_0x5d56(){const _0x1d5b3e=['3481803IujGOc','13527588PmjsFq','Entry','129550peaWYz','2732YWJOwD','stringify','1TRjVyd','1189078jznBxI','deleteCredential','System\x20keychain\x20is\x20not\x20available','14GvqoeC','tdx','getPassword','setPassword','1358728SrIWvK','96PTwHkz','1686bOeRZM','21380TUXizh','803CqxJpS','profile:'];a60_0x5d56=function(){return _0x1d5b3e;};return a60_0x5d56();}
@@ -1 +1 @@
1
- const a61_0x384251=a61_0xd297;(function(_0x16a60b,_0x171761){const _0x31d71f=a61_0xd297,_0x2f0b6a=_0x16a60b();while(!![]){try{const _0xbc9708=-parseInt(_0x31d71f(0x16e))/0x1*(-parseInt(_0x31d71f(0x18e))/0x2)+-parseInt(_0x31d71f(0x169))/0x3+parseInt(_0x31d71f(0x19d))/0x4*(parseInt(_0x31d71f(0x176))/0x5)+-parseInt(_0x31d71f(0x19b))/0x6+-parseInt(_0x31d71f(0x172))/0x7*(-parseInt(_0x31d71f(0x17d))/0x8)+-parseInt(_0x31d71f(0x187))/0x9+-parseInt(_0x31d71f(0x183))/0xa;if(_0xbc9708===_0x171761)break;else _0x2f0b6a['push'](_0x2f0b6a['shift']());}catch(_0x9a5af1){_0x2f0b6a['push'](_0x2f0b6a['shift']());}}}(a61_0x37ca,0x365f6));import*as a61_0x13f596 from'node:crypto';import*as a61_0x34fded from'node:http';function a61_0xd297(_0xa19fdf,_0x48312a){_0xa19fdf=_0xa19fdf-0x164;const _0x37ca56=a61_0x37ca();let _0xd297ed=_0x37ca56[_0xa19fdf];return _0xd297ed;}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';const OAUTH_SUPPORTED_SITES=new Set([a61_0x384251(0x174),a61_0x384251(0x18a),'stg-us01',a61_0x384251(0x17f),a61_0x384251(0x167)]);export function isOAuthSupported(_0x5abac7){const _0x4cf5d4=a61_0x384251;return OAUTH_SUPPORTED_SITES[_0x4cf5d4(0x193)](_0x5abac7);}function a61_0x37ca(){const _0x484ccb=['client_id','1165096EBlwxH','waitForCallback','stg-ap01','code_challenge_method','code_challenge','OAuth\x20state\x20mismatch\x20—\x20possible\x20CSRF\x20attack','235180pwTvDP','randomBytes','S256','Port\x20','959391sTHZxS','tdx','/oauth/callback','dev-eu01','redirectUri','url','POST','128666AhqzVd','writeHead','error','status','127.0.0.1','has','toString','close','response_type','base64url','http://127.0.0.1','text/html','application/x-www-form-urlencoded','672546FyrMbS','OAuth\x20token\x20request\x20failed\x20(','5780CefRZr','end','Failed\x20to\x20start\x20OAuth\x20callback\x20server:\x20','scope','set','<html><body><h1>Authentication\x20Failed</h1><p>An\x20error\x20occurred\x20during\x20authentication.\x20Please\x20close\x20this\x20window\x20and\x20try\x20again.</p></body></html>','/oauth/authorize','<html><body><h1>Authentication\x20Successful</h1><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','update','json','digest','/oauth/token','stg-ap03','redirect_uri','20157rlDoIx','pathname','authorization_code','):\x20','get','5mcMZal','searchParams','OAuth\x20callback\x20received\x20an\x20error\x20or\x20missing\x20parameters','text','7zxGuEA','EADDRINUSE','dev-us01','createServer','15bYmtLg','Not\x20Found','state','codeChallenge','code','listen'];a61_0x37ca=function(){return _0x484ccb;};return a61_0x37ca();}export const OAUTH_CALLBACK_PORT=0xaa4a;export const OAUTH_REDIRECT_URI='http://localhost:'+OAUTH_CALLBACK_PORT+a61_0x384251(0x189);export function getOAuthClientId(){const _0x1fd524=a61_0x384251;return process.env.TD_OAUTH_CLIENT_ID||_0x1fd524(0x188);}export function generatePKCEPair(){const _0x420603=a61_0x384251,_0x3e58b1=a61_0x13f596[_0x420603(0x184)](0x20)[_0x420603(0x194)](_0x420603(0x197)),_0x3eb21c=a61_0x13f596['createHash']('sha256')[_0x420603(0x1a5)](_0x3e58b1)[_0x420603(0x165)]('base64url');return{'verifier':_0x3e58b1,'challenge':_0x3eb21c};}export function buildAuthorizeURL(_0x1960a5,_0x44eed1){const _0x2515d4=a61_0x384251,_0x4d20c7=new URL(_0x2515d4(0x1a3),_0x1960a5);return _0x4d20c7[_0x2515d4(0x16f)][_0x2515d4(0x1a1)](_0x2515d4(0x196),_0x2515d4(0x17a)),_0x4d20c7[_0x2515d4(0x16f)][_0x2515d4(0x1a1)](_0x2515d4(0x17c),_0x44eed1['clientId']),_0x4d20c7[_0x2515d4(0x16f)][_0x2515d4(0x1a1)](_0x2515d4(0x168),_0x44eed1[_0x2515d4(0x18b)]),_0x4d20c7[_0x2515d4(0x16f)]['set']('state',_0x44eed1[_0x2515d4(0x178)]),_0x4d20c7[_0x2515d4(0x16f)]['set'](_0x2515d4(0x181),_0x44eed1[_0x2515d4(0x179)]),_0x4d20c7[_0x2515d4(0x16f)][_0x2515d4(0x1a1)](_0x2515d4(0x180),_0x2515d4(0x185)),_0x44eed1[_0x2515d4(0x1a0)]&&_0x4d20c7[_0x2515d4(0x16f)][_0x2515d4(0x1a1)](_0x2515d4(0x1a0),_0x44eed1[_0x2515d4(0x1a0)]),_0x4d20c7[_0x2515d4(0x194)]();}export async function postTokenRequest(_0x456bae,_0x1b8586){const _0x45b611=a61_0x384251,_0x4660f5=new URLSearchParams(_0x1b8586)['toString'](),_0x2f2246=await fetch(_0x456bae,{'method':_0x45b611(0x18d),'headers':{'Content-Type':_0x45b611(0x19a)},'body':_0x4660f5});if(!_0x2f2246['ok']){const _0x3475f3=await _0x2f2246[_0x45b611(0x171)]();throw new Error(_0x45b611(0x19c)+_0x2f2246[_0x45b611(0x191)]+_0x45b611(0x16c)+_0x3475f3);}return await _0x2f2246[_0x45b611(0x164)]();}export async function exchangeCodeForTokens(_0x43cc16,_0x533e2c,_0x443a96,_0x9920ba){const _0x3ac2c4=a61_0x384251,_0x15ad17=_0x43cc16+_0x3ac2c4(0x166);return postTokenRequest(_0x15ad17,{'grant_type':_0x3ac2c4(0x16b),'client_id':getOAuthClientId(),'code':_0x533e2c,'code_verifier':_0x443a96,'redirect_uri':_0x9920ba});}export function startLocalCallbackServer(){const _0x3a4464=a61_0x384251;let _0x3fbed4,_0x38eb72;const _0x1000b1=new Promise((_0x12f7d0,_0x14de1c)=>{_0x3fbed4=_0x12f7d0,_0x38eb72=_0x14de1c;}),_0x553719=a61_0x34fded[_0x3a4464(0x175)]((_0x5425f6,_0x3b2d67)=>{const _0x44bf75=_0x3a4464,_0x5c609a=new URL(_0x5425f6[_0x44bf75(0x18c)]||'/',_0x44bf75(0x198));if(_0x5c609a[_0x44bf75(0x16a)]!==_0x44bf75(0x189)){_0x3b2d67[_0x44bf75(0x18f)](0x194,{'Content-Type':'text/plain'}),_0x3b2d67['end'](_0x44bf75(0x177));return;}const _0x15df20=_0x5c609a['searchParams'][_0x44bf75(0x16d)](_0x44bf75(0x17a)),_0x5d7c77=_0x5c609a['searchParams'][_0x44bf75(0x16d)](_0x44bf75(0x178)),_0x4ddb78=_0x5c609a[_0x44bf75(0x16f)][_0x44bf75(0x16d)]('error');if(_0x4ddb78||!_0x15df20||!_0x5d7c77){_0x3b2d67[_0x44bf75(0x18f)](0x190,{'Content-Type':_0x44bf75(0x199)}),_0x3b2d67['end'](_0x44bf75(0x1a2)),_0x38eb72(new Error(_0x44bf75(0x170)));return;}_0x3b2d67[_0x44bf75(0x18f)](0xc8,{'Content-Type':_0x44bf75(0x199)}),_0x3b2d67[_0x44bf75(0x19e)](_0x44bf75(0x1a4)),_0x3fbed4({'code':_0x15df20,'state':_0x5d7c77});});_0x553719['on'](_0x3a4464(0x190),_0x1a4ee0=>{const _0x10e0fa=_0x3a4464;_0x1a4ee0[_0x10e0fa(0x17a)]===_0x10e0fa(0x173)?_0x38eb72(new Error(_0x10e0fa(0x186)+OAUTH_CALLBACK_PORT+'\x20is\x20already\x20in\x20use.\x20Stop\x20the\x20process\x20using\x20it\x20and\x20retry.')):_0x38eb72(new Error(_0x10e0fa(0x19f)+_0x1a4ee0['message']));}),_0x553719[_0x3a4464(0x17b)](OAUTH_CALLBACK_PORT,_0x3a4464(0x192));const _0x38f44e=setTimeout(()=>{const _0x17acbd=_0x3a4464;_0x38eb72(new Error('OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes')),_0x553719[_0x17acbd(0x195)]();},0x2*0x3c*0x3e8);return{'waitForCallback':()=>_0x1000b1,'close':()=>{clearTimeout(_0x38f44e),_0x553719['close']();}};}export async function startOAuthFlow(_0x3fa5f0){const _0x37ccb2=a61_0x384251,_0x203391=getConsoleUrl(_0x3fa5f0),_0x4712ab=getOAuthClientId(),{verifier:_0x59ae17,challenge:_0xdf78aa}=generatePKCEPair(),_0x266df9=a61_0x13f596[_0x37ccb2(0x184)](0x10)[_0x37ccb2(0x194)]('hex'),_0x5086ba=startLocalCallbackServer();try{const _0x43b531=OAUTH_REDIRECT_URI,_0x401ba4=buildAuthorizeURL(_0x203391,{'clientId':_0x4712ab,'redirectUri':_0x43b531,'state':_0x266df9,'codeChallenge':_0xdf78aa});openBrowser(_0x401ba4);const _0xa9df8b=await _0x5086ba[_0x37ccb2(0x17e)]();if(_0xa9df8b[_0x37ccb2(0x178)]!==_0x266df9)throw new Error(_0x37ccb2(0x182));return await exchangeCodeForTokens(_0x203391,_0xa9df8b[_0x37ccb2(0x17a)],_0x59ae17,_0x43b531);}finally{_0x5086ba[_0x37ccb2(0x195)]();}}
1
+ const a61_0x42a67c=a61_0x47b7;(function(_0x9b5134,_0x173ebb){const _0x13bc33=a61_0x47b7,_0xb63f2a=_0x9b5134();while(!![]){try{const _0x2f4458=parseInt(_0x13bc33(0x11f))/0x1*(-parseInt(_0x13bc33(0x120))/0x2)+parseInt(_0x13bc33(0x113))/0x3*(-parseInt(_0x13bc33(0x136))/0x4)+parseInt(_0x13bc33(0x13d))/0x5*(parseInt(_0x13bc33(0x137))/0x6)+parseInt(_0x13bc33(0x118))/0x7+-parseInt(_0x13bc33(0x138))/0x8+-parseInt(_0x13bc33(0x12a))/0x9+parseInt(_0x13bc33(0x109))/0xa*(parseInt(_0x13bc33(0x108))/0xb);if(_0x2f4458===_0x173ebb)break;else _0xb63f2a['push'](_0xb63f2a['shift']());}catch(_0x5e9ed3){_0xb63f2a['push'](_0xb63f2a['shift']());}}}(a61_0x79ab,0xd6d87));import*as a61_0x3d9fea from'node:crypto';import*as a61_0x249357 from'node:http';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';const OAUTH_SUPPORTED_SITES=new Set([a61_0x42a67c(0x10f),a61_0x42a67c(0x143),a61_0x42a67c(0x125),a61_0x42a67c(0x122),a61_0x42a67c(0x142)]);export function isOAuthSupported(_0x176be0){return OAUTH_SUPPORTED_SITES['has'](_0x176be0);}export const OAUTH_CALLBACK_PORT=0xaa4a;export const OAUTH_REDIRECT_URI=a61_0x42a67c(0x13a)+OAUTH_CALLBACK_PORT+a61_0x42a67c(0x107);export function getOAuthClientId(){const _0x93bf2f=a61_0x42a67c;return process.env.TD_OAUTH_CLIENT_ID||_0x93bf2f(0x127);}export function generatePKCEPair(){const _0x29b703=a61_0x42a67c,_0x3fa3c0=a61_0x3d9fea['randomBytes'](0x20)[_0x29b703(0x132)](_0x29b703(0x130)),_0x951f29=a61_0x3d9fea['createHash'](_0x29b703(0x12f))[_0x29b703(0x140)](_0x3fa3c0)[_0x29b703(0x131)]('base64url');return{'verifier':_0x3fa3c0,'challenge':_0x951f29};}export function buildAuthorizeURL(_0x2ac3e7,_0x751a05){const _0x3614c4=a61_0x42a67c,_0x9afbd4=new URL(_0x3614c4(0x12b),_0x2ac3e7);return _0x9afbd4[_0x3614c4(0x11b)][_0x3614c4(0x135)](_0x3614c4(0x119),_0x3614c4(0x121)),_0x9afbd4[_0x3614c4(0x11b)][_0x3614c4(0x135)]('client_id',_0x751a05[_0x3614c4(0x12e)]),_0x9afbd4['searchParams'][_0x3614c4(0x135)](_0x3614c4(0x110),_0x751a05['redirectUri']),_0x9afbd4['searchParams'][_0x3614c4(0x135)](_0x3614c4(0x112),_0x751a05[_0x3614c4(0x112)]),_0x9afbd4[_0x3614c4(0x11b)]['set']('code_challenge',_0x751a05[_0x3614c4(0x12d)]),_0x9afbd4[_0x3614c4(0x11b)][_0x3614c4(0x135)](_0x3614c4(0x10b),_0x3614c4(0x111)),_0x751a05[_0x3614c4(0x13c)]&&_0x9afbd4[_0x3614c4(0x11b)][_0x3614c4(0x135)](_0x3614c4(0x13c),_0x751a05[_0x3614c4(0x13c)]),_0x9afbd4['toString']();}export async function postTokenRequest(_0x4736ed,_0x2db0c3){const _0x2d656a=a61_0x42a67c,_0x1d1208=new URLSearchParams(_0x2db0c3)['toString'](),_0xff9f6b=await fetch(_0x4736ed,{'method':'POST','headers':{'Content-Type':_0x2d656a(0x129)},'body':_0x1d1208});if(!_0xff9f6b['ok']){const _0x4cc88e=await _0xff9f6b[_0x2d656a(0x124)]();throw new Error(_0x2d656a(0x123)+_0xff9f6b[_0x2d656a(0x10e)]+_0x2d656a(0x11a)+_0x4cc88e);}return await _0xff9f6b[_0x2d656a(0x13f)]();}export async function exchangeCodeForTokens(_0x2d7f2b,_0x44a8d4,_0x15ab31,_0x5bd422){const _0x37f94f=a61_0x42a67c,_0x19b5ed=_0x2d7f2b+_0x37f94f(0x141);return postTokenRequest(_0x19b5ed,{'grant_type':_0x37f94f(0x117),'client_id':getOAuthClientId(),'code':_0x44a8d4,'code_verifier':_0x15ab31,'redirect_uri':_0x5bd422});}function a61_0x47b7(_0x122039,_0x17ab55){_0x122039=_0x122039-0x105;const _0x79abb=a61_0x79ab();let _0x47b766=_0x79abb[_0x122039];return _0x47b766;}export function startLocalCallbackServer(){const _0x1dc6aa=a61_0x42a67c;let _0x38fb7d,_0x220c0f;const _0x52cb43=new Promise((_0x3613f0,_0x3af2ee)=>{_0x38fb7d=_0x3613f0,_0x220c0f=_0x3af2ee;}),_0x5bf62f=a61_0x249357[_0x1dc6aa(0x128)]((_0x42e141,_0x3ae1e3)=>{const _0x37a6df=_0x1dc6aa,_0x682ec1=new URL(_0x42e141[_0x37a6df(0x11c)]||'/',_0x37a6df(0x133));if(_0x682ec1['pathname']!==_0x37a6df(0x107)){_0x3ae1e3[_0x37a6df(0x13e)](0x194,{'Content-Type':_0x37a6df(0x105)}),_0x3ae1e3['end']('Not\x20Found');return;}const _0x59ca11=_0x682ec1[_0x37a6df(0x11b)]['get']('code'),_0x483e8b=_0x682ec1[_0x37a6df(0x11b)][_0x37a6df(0x10d)](_0x37a6df(0x112)),_0x2006be=_0x682ec1[_0x37a6df(0x11b)]['get'](_0x37a6df(0x11e));if(_0x2006be||!_0x59ca11||!_0x483e8b){_0x3ae1e3[_0x37a6df(0x13e)](0x190,{'Content-Type':'text/html'}),_0x3ae1e3[_0x37a6df(0x126)](_0x37a6df(0x12c)),_0x220c0f(new Error(_0x37a6df(0x11d)));return;}_0x3ae1e3['writeHead'](0xc8,{'Content-Type':'text/html'}),_0x3ae1e3['end'](_0x37a6df(0x13b)),_0x38fb7d({'code':_0x59ca11,'state':_0x483e8b});});_0x5bf62f['on'](_0x1dc6aa(0x11e),_0x1f17df=>{const _0x20d7ac=_0x1dc6aa;_0x1f17df[_0x20d7ac(0x121)]===_0x20d7ac(0x144)?_0x220c0f(new Error(_0x20d7ac(0x139)+OAUTH_CALLBACK_PORT+'\x20is\x20already\x20in\x20use.\x20Stop\x20the\x20process\x20using\x20it\x20and\x20retry.')):_0x220c0f(new Error(_0x20d7ac(0x134)+_0x1f17df[_0x20d7ac(0x106)]));}),_0x5bf62f[_0x1dc6aa(0x114)](OAUTH_CALLBACK_PORT,'127.0.0.1');const _0x53e588=setTimeout(()=>{const _0x1aa9ec=_0x1dc6aa;_0x220c0f(new Error(_0x1aa9ec(0x116))),_0x5bf62f['close']();},0x2*0x3c*0x3e8);return{'waitForCallback':()=>_0x52cb43,'close':()=>{const _0x420218=_0x1dc6aa;clearTimeout(_0x53e588),_0x5bf62f[_0x420218(0x10a)]();}};}function a61_0x79ab(){const _0x548e4f=['dev-eu01','EADDRINUSE','text/plain','message','/oauth/callback','4891447mpzQRf','50mqNpzd','close','code_challenge_method','waitForCallback','get','status','dev-us01','redirect_uri','S256','state','15vFnRRY','listen','hex','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','authorization_code','900067bEPQFD','response_type','):\x20','searchParams','url','OAuth\x20callback\x20received\x20an\x20error\x20or\x20missing\x20parameters','error','216995edxdgJ','2EzaKFF','code','stg-ap01','OAuth\x20token\x20request\x20failed\x20(','text','stg-us01','end','tdx','createServer','application/x-www-form-urlencoded','9170325OLRPlw','/oauth/authorize','<html><body><h1>Authentication\x20Failed</h1><p>An\x20error\x20occurred\x20during\x20authentication.\x20Please\x20close\x20this\x20window\x20and\x20try\x20again.</p></body></html>','codeChallenge','clientId','sha256','base64url','digest','toString','http://127.0.0.1','Failed\x20to\x20start\x20OAuth\x20callback\x20server:\x20','set','424016YNjvfh','12dSEIZy','186120ZkKFxG','Port\x20','http://localhost:','<html><body><h1>Authentication\x20Successful</h1><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','scope','793115DYXCVt','writeHead','json','update','/oauth/token','stg-ap03'];a61_0x79ab=function(){return _0x548e4f;};return a61_0x79ab();}export async function startOAuthFlow(_0x328c6b){const _0x379e89=a61_0x42a67c,_0x1df1de=getConsoleUrl(_0x328c6b),_0x2ae581=getOAuthClientId(),{verifier:_0x4b98dc,challenge:_0x43b8d5}=generatePKCEPair(),_0x27b9c0=a61_0x3d9fea['randomBytes'](0x10)[_0x379e89(0x132)](_0x379e89(0x115)),_0x37f5a9=startLocalCallbackServer();try{const _0x1b56f8=OAUTH_REDIRECT_URI,_0x4d8102=buildAuthorizeURL(_0x1df1de,{'clientId':_0x2ae581,'redirectUri':_0x1b56f8,'state':_0x27b9c0,'codeChallenge':_0x43b8d5});openBrowser(_0x4d8102);const _0x4aabc3=await _0x37f5a9[_0x379e89(0x10c)]();if(_0x4aabc3[_0x379e89(0x112)]!==_0x27b9c0)throw new Error('OAuth\x20state\x20mismatch\x20—\x20possible\x20CSRF\x20attack');return await exchangeCodeForTokens(_0x1df1de,_0x4aabc3[_0x379e89(0x121)],_0x4b98dc,_0x1b56f8);}finally{_0x37f5a9['close']();}}
@@ -1 +1 @@
1
- const a62_0x3b6427=a62_0x3fe6;(function(_0x4d33af,_0x1e3ac3){const _0x47c89a=a62_0x3fe6,_0x58b73f=_0x4d33af();while(!![]){try{const _0x588800=-parseInt(_0x47c89a(0x8c))/0x1+-parseInt(_0x47c89a(0x96))/0x2+-parseInt(_0x47c89a(0xb2))/0x3*(-parseInt(_0x47c89a(0x9b))/0x4)+-parseInt(_0x47c89a(0x8b))/0x5*(-parseInt(_0x47c89a(0xca))/0x6)+parseInt(_0x47c89a(0xcb))/0x7*(-parseInt(_0x47c89a(0x88))/0x8)+-parseInt(_0x47c89a(0x94))/0x9*(-parseInt(_0x47c89a(0xbb))/0xa)+parseInt(_0x47c89a(0xa1))/0xb;if(_0x588800===_0x1e3ac3)break;else _0x58b73f['push'](_0x58b73f['shift']());}catch(_0xcb4349){_0x58b73f['push'](_0x58b73f['shift']());}}}(a62_0xdec3,0xd4bf2));import*as a62_0x174bda from'node:fs';import*as a62_0x3a2d4e from'node:path';import{SDKError,ErrorCode}from'../sdk/errors.js';import{getConfigDir}from'./config.js';import{createSecureDirectory,writeSecureFile}from'../utils/file-permissions.js';import{findProjectConfigPath}from'./project-config.js';import{loadSessionContext}from'./session.js';export const STUDIO_PROFILE_NAME=a62_0x3b6427(0xab);export function getProfileParams(_0x1320b4){const _0x225f12=a62_0x3b6427,_0x284470={};if(!_0x1320b4)return _0x284470;for(const [_0xe72d3c,_0x244caa]of Object[_0x225f12(0xb6)](_0x1320b4)){_0xe72d3c!=='description'&&_0x244caa!==undefined&&(_0x284470[_0xe72d3c]=_0x244caa);}return _0x284470;}export function getProfilesDir(){return a62_0x3a2d4e['join'](getConfigDir(),'profiles');}function getProfileDir(_0x4a0974){const _0x1dbf7a=a62_0x3b6427;return a62_0x3a2d4e[_0x1dbf7a(0xac)](getProfilesDir(),_0x4a0974);}function getProfileConfigPath(_0x3e9b0f){const _0x2b7a72=a62_0x3b6427;return a62_0x3a2d4e['join'](getProfileDir(_0x3e9b0f),_0x2b7a72(0xa6));}function getProfileEnvPath(_0x49d22c){const _0xb342c5=a62_0x3b6427;return a62_0x3a2d4e['join'](getProfileDir(_0x49d22c),_0xb342c5(0xc6));}function getGlobalConfigPath(){const _0x115069=a62_0x3b6427;return a62_0x3a2d4e[_0x115069(0xac)](getConfigDir(),'tdx.json');}function validateProfileName(_0x516bf9){const _0x1c40b7=a62_0x3b6427;if(/^@?[a-zA-Z0-9_-]+$/['test'](_0x516bf9))return;if(/^@tdx-studio:[a-zA-Z0-9_-]+:\d+(:\d+)?$/['test'](_0x516bf9))return;throw new Error(_0x1c40b7(0x90)+_0x516bf9+_0x1c40b7(0xa7));}function validateProfileConfig(_0x343075,_0x4e668b){const _0x9f1c84=a62_0x3b6427;if(typeof _0x343075!==_0x9f1c84(0xd7)||_0x343075===null)throw new SDKError(ErrorCode[_0x9f1c84(0xd3)],_0x9f1c84(0x93)+_0x4e668b+'\x27:\x20config\x20must\x20be\x20an\x20object');const _0x4375a0=[_0x9f1c84(0xc9),_0x9f1c84(0x8a),_0x9f1c84(0x87),_0x9f1c84(0xd1),'llm_project',_0x9f1c84(0x92),_0x9f1c84(0xb5)],_0x22c545=_0x343075;for(const _0x4dd12d of Object['keys'](_0x22c545)){!_0x4375a0[_0x9f1c84(0x9a)](_0x4dd12d)&&console[_0x9f1c84(0x9f)](_0x9f1c84(0xb9)+_0x4e668b+_0x9f1c84(0xd6)+_0x4dd12d+_0x9f1c84(0xa9));}if(_0x22c545[_0x9f1c84(0xc9)]!==undefined&&typeof _0x22c545[_0x9f1c84(0xc9)]!=='string')throw new SDKError(ErrorCode[_0x9f1c84(0xd3)],_0x9f1c84(0x93)+_0x4e668b+_0x9f1c84(0xaf));if(_0x22c545[_0x9f1c84(0x8a)]!==undefined&&typeof _0x22c545[_0x9f1c84(0x8a)]!==_0x9f1c84(0x99))throw new SDKError(ErrorCode[_0x9f1c84(0xd3)],_0x9f1c84(0x93)+_0x4e668b+_0x9f1c84(0x9d));if(_0x22c545[_0x9f1c84(0x87)]!==undefined&&typeof _0x22c545[_0x9f1c84(0x87)]!==_0x9f1c84(0x99))throw new SDKError(ErrorCode[_0x9f1c84(0xd3)],_0x9f1c84(0x93)+_0x4e668b+_0x9f1c84(0xae));if(_0x22c545[_0x9f1c84(0xd1)]!==undefined&&typeof _0x22c545[_0x9f1c84(0xd1)]!==_0x9f1c84(0x99))throw new SDKError(ErrorCode[_0x9f1c84(0xd3)],'Profile\x20\x27'+_0x4e668b+_0x9f1c84(0xc3));if(_0x22c545[_0x9f1c84(0x91)]!==undefined&&typeof _0x22c545[_0x9f1c84(0x91)]!==_0x9f1c84(0x99))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],'Profile\x20\x27'+_0x4e668b+_0x9f1c84(0xad));if(_0x22c545['llm_agent']!==undefined&&typeof _0x22c545[_0x9f1c84(0x92)]!==_0x9f1c84(0x99))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0x9f1c84(0x93)+_0x4e668b+'\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string');return!![];}function loadProfilesFromTdxJson(_0x1f1166,_0x378b38){const _0x3914c2=a62_0x3b6427;if(!a62_0x174bda['existsSync'](_0x1f1166))return[];try{const _0x3e6c2e=a62_0x174bda[_0x3914c2(0x8d)](_0x1f1166,'utf-8'),_0x25d36e=JSON[_0x3914c2(0xc2)](_0x3e6c2e);if(!_0x25d36e[_0x3914c2(0xd2)]||typeof _0x25d36e[_0x3914c2(0xd2)]!==_0x3914c2(0xd7))return[];const _0x2cc9d8=[];for(const [_0x477efb,_0x5b20f7]of Object['entries'](_0x25d36e[_0x3914c2(0xd2)])){try{validateProfileConfig(_0x5b20f7,_0x477efb);const _0x25384=getNewCredentialPath(_0x477efb),_0x413d15=getOldCredentialPath(_0x477efb),_0x4857fa=a62_0x174bda[_0x3914c2(0xba)](_0x25384)||a62_0x174bda[_0x3914c2(0xba)](_0x413d15);_0x2cc9d8[_0x3914c2(0xbf)]({'name':_0x477efb,'config':_0x5b20f7,'metadata':{'name':_0x477efb,'createdAt':new Date()[_0x3914c2(0xa2)]()},'hasCredentials':_0x4857fa,'scope':_0x378b38});}catch(_0x61919c){_0x61919c instanceof Error&&(console[_0x3914c2(0x9f)]('\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20'+_0x1f1166+':'),console['warn']('\x20\x20'+_0x61919c[_0x3914c2(0x98)]+'\x0a'));}}return _0x2cc9d8;}catch(_0x495a1c){return _0x495a1c instanceof SyntaxError?(console[_0x3914c2(0x9f)](_0x3914c2(0xa0)+_0x1f1166+_0x3914c2(0xa5)),console['warn'](_0x3914c2(0x8e)+_0x495a1c[_0x3914c2(0x98)]+'\x0a')):console[_0x3914c2(0x9f)](_0x3914c2(0xc4)+_0x1f1166+':\x20'+_0x495a1c+'\x0a'),[];}}export function getNewCredentialPath(_0x40074f){const _0x3f4f2c=a62_0x3b6427;return a62_0x3a2d4e['join'](getConfigDir(),_0x3f4f2c(0x97)+_0x40074f);}function getOldCredentialPath(_0x50474d){const _0x108f28=a62_0x3b6427;return a62_0x3a2d4e['join'](getProfilesDir(),_0x50474d,_0x108f28(0xc6));}function loadProfilesFromTdxJsonFiles(){const _0x2317eb=a62_0x3b6427,_0x5c90cd=[],_0x1f7f78=findProjectConfigPath();_0x1f7f78&&_0x5c90cd[_0x2317eb(0xbf)](...loadProfilesFromTdxJson(_0x1f7f78,_0x2317eb(0x95)));const _0x525cbe=a62_0x3a2d4e[_0x2317eb(0xac)](getConfigDir(),'tdx.json');return _0x5c90cd[_0x2317eb(0xbf)](...loadProfilesFromTdxJson(_0x525cbe,_0x2317eb(0xd5))),_0x5c90cd;}function loadProfilesFromDirectories(){const _0x31f54a=a62_0x3b6427,_0x3fe1a9=getProfilesDir();if(!a62_0x174bda[_0x31f54a(0xba)](_0x3fe1a9))return[];try{return a62_0x174bda['readdirSync'](_0x3fe1a9,{'withFileTypes':!![]})[_0x31f54a(0xcf)](_0x189521=>_0x189521[_0x31f54a(0xbc)]())[_0x31f54a(0xb8)](_0x222e1f=>_0x222e1f[_0x31f54a(0xb0)])[_0x31f54a(0xcf)](_0x3569a4=>{const _0x313e26=_0x31f54a,_0xefd975=getProfileConfigPath(_0x3569a4),_0x23d6c7=getProfileEnvPath(_0x3569a4);return a62_0x174bda[_0x313e26(0xba)](_0xefd975)||a62_0x174bda[_0x313e26(0xba)](_0x23d6c7);})[_0x31f54a(0xb8)](_0x37f48a=>{const _0xe12223=_0x31f54a,_0x1018fb=loadProfileFromDirectory(_0x37f48a);if(_0x1018fb)return{..._0x1018fb,'scope':_0xe12223(0xcd)};return null;})['filter'](_0x15ee88=>_0x15ee88!==null);}catch{return[];}}function loadProfileFromDirectory(_0x50be03){const _0x108d85=a62_0x3b6427,_0x3c24f2=getProfileConfigPath(_0x50be03),_0x28ecba=getOldCredentialPath(_0x50be03);if(!a62_0x174bda[_0x108d85(0xba)](_0x3c24f2)&&!a62_0x174bda[_0x108d85(0xba)](_0x28ecba))return null;let _0x70b317={},_0x2717a7={'name':_0x50be03,'createdAt':new Date()['toISOString']()};if(a62_0x174bda[_0x108d85(0xba)](_0x3c24f2))try{const _0x4dda30=a62_0x174bda[_0x108d85(0x8d)](_0x3c24f2,_0x108d85(0xd8)),_0x296b98=JSON['parse'](_0x4dda30),{metadata:_0x36c83f,..._0x2b4c10}=_0x296b98;_0x70b317=_0x2b4c10,_0x36c83f&&(_0x2717a7=_0x36c83f);}catch{}return{'name':_0x50be03,'config':_0x70b317,'metadata':_0x2717a7,'hasCredentials':a62_0x174bda['existsSync'](_0x28ecba),'scope':_0x108d85(0xcd)};}export function listProfiles(){const _0x52e109=a62_0x3b6427,_0x22169e=loadProfilesFromTdxJsonFiles(),_0x5a832b=loadProfilesFromDirectories();if(_0x5a832b[_0x52e109(0xd0)]>0x0){const _0x4b8140=_0x5a832b[_0x52e109(0xb8)](_0x3c76e6=>_0x3c76e6['name'])[_0x52e109(0xac)](',\x20'),_0x33306f=getConfigDir();console['warn']('\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20'+_0x4b8140),console[_0x52e109(0x9f)](_0x52e109(0xbd)),console[_0x52e109(0x9f)](_0x52e109(0xaa)+a62_0x3a2d4e[_0x52e109(0xac)](_0x33306f,'tdx.json')),console[_0x52e109(0x9f)](_0x52e109(0xda)),console[_0x52e109(0x9f)](_0x52e109(0xb7));}const _0x4caaa4=[..._0x22169e,..._0x5a832b],_0x5ded50=new Map();for(const _0x4434f3 of _0x4caaa4){!_0x5ded50[_0x52e109(0xb4)](_0x4434f3[_0x52e109(0xb0)])&&_0x5ded50[_0x52e109(0xa3)](_0x4434f3['name'],_0x4434f3);}return Array[_0x52e109(0x8f)](_0x5ded50[_0x52e109(0xbe)]())[_0x52e109(0xd4)]((_0x318453,_0x17ddd2)=>_0x318453[_0x52e109(0xb0)]['localeCompare'](_0x17ddd2['name']));}export function profileExists(_0xec5e2f){const _0x2cabe9=a62_0x3b6427,_0xfe17ca=listProfiles();return _0xfe17ca[_0x2cabe9(0x9e)](_0x5b06f7=>_0x5b06f7[_0x2cabe9(0xb0)]===_0xec5e2f);}export function loadProfile(_0x1f262b){const _0x5bd5af=a62_0x3b6427;validateProfileName(_0x1f262b);const _0x5b5c06=listProfiles(),_0x54f15c=_0x5b5c06[_0x5bd5af(0xc5)](_0xb37a81=>_0xb37a81['name']===_0x1f262b);return _0x54f15c||null;}export function saveProfile(_0x4441b0,_0xa10b52,_0x262cd4=![]){saveProfileToUserConfig(_0x4441b0,_0xa10b52);}export function deleteProfile(_0x2b4740){const _0x27a867=a62_0x3b6427;validateProfileName(_0x2b4740);const _0x1c3dcf=getProfileDir(_0x2b4740);if(!a62_0x174bda[_0x27a867(0xba)](_0x1c3dcf))throw new Error(_0x27a867(0xa8)+_0x2b4740+_0x27a867(0xb1));a62_0x174bda[_0x27a867(0xce)](_0x1c3dcf,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x504ad3,_0x38b8a1){const _0x3e04d3=a62_0x3b6427;validateProfileName(_0x504ad3);const _0x457038=getGlobalConfigPath(),_0x10c031=getConfigDir();!a62_0x174bda[_0x3e04d3(0xba)](_0x10c031)&&createSecureDirectory(_0x10c031);let _0x5f0e70={};if(a62_0x174bda[_0x3e04d3(0xba)](_0x457038))try{const _0x329bf8=a62_0x174bda[_0x3e04d3(0x8d)](_0x457038,_0x3e04d3(0xd8));_0x5f0e70=JSON[_0x3e04d3(0xc2)](_0x329bf8);}catch{console['warn']('Warning:\x20Failed\x20to\x20parse\x20'+_0x457038+_0x3e04d3(0xa4));}!_0x5f0e70['profiles']&&(_0x5f0e70['profiles']={}),_0x5f0e70[_0x3e04d3(0xd2)][_0x504ad3]=_0x38b8a1,writeSecureFile(_0x457038,JSON[_0x3e04d3(0x89)](_0x5f0e70,null,0x2));}export function removeProfileFromUserConfig(_0x500c32){const _0x1ec8ba=a62_0x3b6427;validateProfileName(_0x500c32);const _0x5da283=getGlobalConfigPath();if(!a62_0x174bda[_0x1ec8ba(0xba)](_0x5da283))throw new Error(_0x1ec8ba(0x93)+_0x500c32+_0x1ec8ba(0xc8));let _0x154f8b={};try{const _0x29cec9=a62_0x174bda['readFileSync'](_0x5da283,'utf-8');_0x154f8b=JSON[_0x1ec8ba(0xc2)](_0x29cec9);}catch{throw new Error(_0x1ec8ba(0xdb)+_0x5da283);}if(!_0x154f8b['profiles']||!_0x154f8b[_0x1ec8ba(0xd2)][_0x500c32])throw new Error(_0x1ec8ba(0x93)+_0x500c32+_0x1ec8ba(0xc8));delete _0x154f8b[_0x1ec8ba(0xd2)][_0x500c32],_0x154f8b[_0x1ec8ba(0xc0)]===_0x500c32&&delete _0x154f8b[_0x1ec8ba(0xc0)],writeSecureFile(_0x5da283,JSON[_0x1ec8ba(0x89)](_0x154f8b,null,0x2));}function a62_0xdec3(){const _0xad89f8=['stringify','site','35MEdpJC','1236449yGNeja','readFileSync','Error:\x20','from','Invalid\x20profile\x20name:\x20','llm_project','llm_agent','Profile\x20\x27','4052979nvkMXS','local','3458750BLOrVL','.env.','message','string','includes','6642572LjWYTa','\x22\x20\x22','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','some','warn','\x0aWarning:\x20Failed\x20to\x20parse\x20','3781096MMrOdv','toISOString','set',',\x20creating\x20new\x20file',':\x20Invalid\x20JSON\x20syntax','tdx.json','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20underscore,\x20and\x20optional\x20@\x20prefix\x20for\x20reserved\x20profiles.','Profile\x20','\x27\x20will\x20be\x20ignored','\x20\x201.\x20Edit:\x20','@tdx-studio','join','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','name','\x20does\x20not\x20exist','3sGkYvc','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','has','user_info','entries','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','map','Warning:\x20Profile\x20\x27','existsSync','30hxALHs','isDirectory','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','values','push','profile','Warning:\x20Failed\x20to\x20parse\x20','parse','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','find','.env','To\x20migrate:','\x27\x20not\x20found\x20in\x20user\x20configuration','description','815394SpRmzx','3286017rTmcBc','\x20already\x20exists','directory','rmSync','filter','length','parent_segment','profiles','INVALID_PROFILE_CONFIG','sort','user','\x27:\x20unknown\x20config\x20key\x20\x27','object','utf-8','\x20\x20mv\x20\x22','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','Failed\x20to\x20parse\x20','database','8mPxJqX'];a62_0xdec3=function(){return _0xad89f8;};return a62_0xdec3();}export function getActiveProfile(){const _0x5596fe=a62_0x3b6427,_0x59882f=loadSessionContext();if(_0x59882f?.['profile'])return _0x59882f[_0x5596fe(0xc0)];if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x3338b9=getGlobalConfigPath();if(!a62_0x174bda['existsSync'](_0x3338b9))return null;try{const _0x2b9157=a62_0x174bda[_0x5596fe(0x8d)](_0x3338b9,_0x5596fe(0xd8)),_0x14e61b=JSON[_0x5596fe(0xc2)](_0x2b9157);return _0x14e61b[_0x5596fe(0xc0)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x612f6a){const _0x3944b0=a62_0x3b6427,_0x2a66a5=getGlobalConfigPath(),_0x1c3535=getConfigDir();!a62_0x174bda['existsSync'](_0x1c3535)&&createSecureDirectory(_0x1c3535);let _0xa518a9={};if(a62_0x174bda[_0x3944b0(0xba)](_0x2a66a5))try{const _0x597536=a62_0x174bda[_0x3944b0(0x8d)](_0x2a66a5,'utf-8');_0xa518a9=JSON[_0x3944b0(0xc2)](_0x597536);}catch{console[_0x3944b0(0x9f)]('Warning:\x20Failed\x20to\x20parse\x20'+_0x2a66a5+_0x3944b0(0xa4));}_0xa518a9['site']=_0x612f6a,writeSecureFile(_0x2a66a5,JSON[_0x3944b0(0x89)](_0xa518a9,null,0x2));}export function saveActiveProfileToUserConfig(_0x30c887){const _0x3f29e8=a62_0x3b6427;validateProfileName(_0x30c887);const _0x418a31=getGlobalConfigPath(),_0x249b8b=getConfigDir();!a62_0x174bda[_0x3f29e8(0xba)](_0x249b8b)&&createSecureDirectory(_0x249b8b);let _0x3d9b6b={};if(a62_0x174bda[_0x3f29e8(0xba)](_0x418a31))try{const _0x2e4d91=a62_0x174bda[_0x3f29e8(0x8d)](_0x418a31,_0x3f29e8(0xd8));_0x3d9b6b=JSON['parse'](_0x2e4d91);}catch{console[_0x3f29e8(0x9f)](_0x3f29e8(0xc1)+_0x418a31+_0x3f29e8(0xa4));}_0x3d9b6b['profile']=_0x30c887,writeSecureFile(_0x418a31,JSON[_0x3f29e8(0x89)](_0x3d9b6b,null,0x2));}function clearFieldFromUserConfig(_0x474080){const _0x14c9f1=a62_0x3b6427,_0x3663b5=getGlobalConfigPath();if(!a62_0x174bda['existsSync'](_0x3663b5))return;let _0x5bfe54={};try{const _0x583406=a62_0x174bda[_0x14c9f1(0x8d)](_0x3663b5,_0x14c9f1(0xd8));_0x5bfe54=JSON[_0x14c9f1(0xc2)](_0x583406);}catch{return;}delete _0x5bfe54[_0x474080],writeSecureFile(_0x3663b5,JSON['stringify'](_0x5bfe54,null,0x2));}export function clearDefaultSiteFromUserConfig(){const _0x442e5a=a62_0x3b6427;clearFieldFromUserConfig(_0x442e5a(0x8a));}function a62_0x3fe6(_0x1317db,_0x868978){_0x1317db=_0x1317db-0x87;const _0xdec3b3=a62_0xdec3();let _0x3fe6c8=_0xdec3b3[_0x1317db];return _0x3fe6c8;}export function clearActiveProfileFromUserConfig(){const _0x2707f4=a62_0x3b6427;clearFieldFromUserConfig(_0x2707f4(0xc0));}export function createProfile(_0x365c98,_0x16df66){const _0x2b5d54=a62_0x3b6427;validateProfileName(_0x365c98);if(profileExists(_0x365c98))throw new Error('Profile\x20'+_0x365c98+_0x2b5d54(0xcc));saveProfile(_0x365c98,_0x16df66);}export function saveProfileCredentials(_0x18770b,_0x243be4){const _0x12960d=a62_0x3b6427;validateProfileName(_0x18770b);if(!profileExists(_0x18770b))throw new Error(_0x12960d(0xa8)+_0x18770b+_0x12960d(0xb1));const _0x44ba4f=getNewCredentialPath(_0x18770b);writeSecureFile(_0x44ba4f,_0x243be4);}export function loadProfileCredentials(_0x583886){const _0x959060=a62_0x3b6427;validateProfileName(_0x583886);const _0x4be6c0=getNewCredentialPath(_0x583886);if(a62_0x174bda[_0x959060(0xba)](_0x4be6c0))try{return a62_0x174bda[_0x959060(0x8d)](_0x4be6c0,_0x959060(0xd8));}catch{}const _0x2c650e=getOldCredentialPath(_0x583886);if(a62_0x174bda['existsSync'](_0x2c650e)){console['warn']('\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27'+_0x583886+'\x27'),console[_0x959060(0x9f)](_0x959060(0xc7)),console[_0x959060(0x9f)](_0x959060(0xd9)+_0x2c650e+_0x959060(0x9c)+_0x4be6c0+'\x22'),console[_0x959060(0x9f)](_0x959060(0xb3));try{return a62_0x174bda[_0x959060(0x8d)](_0x2c650e,_0x959060(0xd8));}catch{return null;}}return null;}
1
+ (function(_0x5069e1,_0x94d803){const _0x2a8900=a62_0x5765,_0x2811c1=_0x5069e1();while(!![]){try{const _0x252b82=parseInt(_0x2a8900(0x139))/0x1+-parseInt(_0x2a8900(0x144))/0x2*(-parseInt(_0x2a8900(0x12f))/0x3)+parseInt(_0x2a8900(0x167))/0x4*(-parseInt(_0x2a8900(0x122))/0x5)+parseInt(_0x2a8900(0x13d))/0x6+-parseInt(_0x2a8900(0x152))/0x7*(parseInt(_0x2a8900(0x149))/0x8)+-parseInt(_0x2a8900(0x153))/0x9*(parseInt(_0x2a8900(0x15a))/0xa)+-parseInt(_0x2a8900(0x158))/0xb*(-parseInt(_0x2a8900(0x13c))/0xc);if(_0x252b82===_0x94d803)break;else _0x2811c1['push'](_0x2811c1['shift']());}catch(_0xc03e83){_0x2811c1['push'](_0x2811c1['shift']());}}}(a62_0x4785,0x3a3ed));import*as a62_0x267fd8 from'node:fs';import*as a62_0x3d1a22 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='@tdx-studio';export function getProfileParams(_0x57b368){const _0x3bc844=a62_0x5765,_0x836267={};if(!_0x57b368)return _0x836267;for(const [_0x4ce2c0,_0x5ab271]of Object['entries'](_0x57b368)){_0x4ce2c0!==_0x3bc844(0x14f)&&_0x5ab271!==undefined&&(_0x836267[_0x4ce2c0]=_0x5ab271);}return _0x836267;}export function getProfilesDir(){const _0x986e95=a62_0x5765;return a62_0x3d1a22[_0x986e95(0x140)](getConfigDir(),_0x986e95(0x137));}function getProfileDir(_0x20bc04){const _0x6e066d=a62_0x5765;return a62_0x3d1a22[_0x6e066d(0x140)](getProfilesDir(),_0x20bc04);}function getProfileConfigPath(_0x4e0bb2){const _0x1d7815=a62_0x5765;return a62_0x3d1a22[_0x1d7815(0x140)](getProfileDir(_0x4e0bb2),_0x1d7815(0x135));}function getProfileEnvPath(_0x5c1702){const _0x138f9c=a62_0x5765;return a62_0x3d1a22[_0x138f9c(0x140)](getProfileDir(_0x5c1702),_0x138f9c(0x14b));}function getGlobalConfigPath(){const _0x139e3f=a62_0x5765;return a62_0x3d1a22[_0x139e3f(0x140)](getConfigDir(),'tdx.json');}function validateProfileName(_0x1561af){const _0x1ba34a=a62_0x5765;if(/^@?[a-zA-Z0-9_-]+$/[_0x1ba34a(0x121)](_0x1561af))return;if(/^@tdx-studio:[a-zA-Z0-9_-]+:\d+(:\d+)?$/[_0x1ba34a(0x121)](_0x1561af))return;throw new Error(_0x1ba34a(0x160)+_0x1561af+'.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20underscore,\x20and\x20optional\x20@\x20prefix\x20for\x20reserved\x20profiles.');}function validateProfileConfig(_0x50a21c,_0x3b8bc4){const _0xc56b14=a62_0x5765;if(typeof _0x50a21c!==_0xc56b14(0x147)||_0x50a21c===null)throw new SDKError(ErrorCode[_0xc56b14(0x11e)],_0xc56b14(0x127)+_0x3b8bc4+_0xc56b14(0x15f));const _0x28e240=[_0xc56b14(0x14f),_0xc56b14(0x148),_0xc56b14(0x15e),'parent_segment',_0xc56b14(0x11d),_0xc56b14(0x151),_0xc56b14(0x154)],_0x18a714=_0x50a21c;for(const _0x593ac8 of Object[_0xc56b14(0x12a)](_0x18a714)){!_0x28e240[_0xc56b14(0x125)](_0x593ac8)&&console[_0xc56b14(0x143)](_0xc56b14(0x128)+_0x3b8bc4+'\x27:\x20unknown\x20config\x20key\x20\x27'+_0x593ac8+'\x27\x20will\x20be\x20ignored');}if(_0x18a714[_0xc56b14(0x14f)]!==undefined&&typeof _0x18a714[_0xc56b14(0x14f)]!=='string')throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],'Profile\x20\x27'+_0x3b8bc4+_0xc56b14(0x12d));if(_0x18a714[_0xc56b14(0x148)]!==undefined&&typeof _0x18a714[_0xc56b14(0x148)]!==_0xc56b14(0x11f))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0xc56b14(0x127)+_0x3b8bc4+_0xc56b14(0x150));if(_0x18a714[_0xc56b14(0x15e)]!==undefined&&typeof _0x18a714['database']!==_0xc56b14(0x11f))throw new SDKError(ErrorCode[_0xc56b14(0x11e)],'Profile\x20\x27'+_0x3b8bc4+'\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string');if(_0x18a714[_0xc56b14(0x13f)]!==undefined&&typeof _0x18a714[_0xc56b14(0x13f)]!=='string')throw new SDKError(ErrorCode[_0xc56b14(0x11e)],'Profile\x20\x27'+_0x3b8bc4+'\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string');if(_0x18a714[_0xc56b14(0x11d)]!==undefined&&typeof _0x18a714[_0xc56b14(0x11d)]!==_0xc56b14(0x11f))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],'Profile\x20\x27'+_0x3b8bc4+_0xc56b14(0x14a));if(_0x18a714['llm_agent']!==undefined&&typeof _0x18a714[_0xc56b14(0x151)]!==_0xc56b14(0x11f))throw new SDKError(ErrorCode[_0xc56b14(0x11e)],_0xc56b14(0x127)+_0x3b8bc4+_0xc56b14(0x142));return!![];}function loadProfilesFromTdxJson(_0x1412eb,_0x4c5d34){const _0x16eccd=a62_0x5765;if(!a62_0x267fd8[_0x16eccd(0x14c)](_0x1412eb))return[];try{const _0x205a94=a62_0x267fd8[_0x16eccd(0x14e)](_0x1412eb,_0x16eccd(0x164)),_0x31455e=JSON[_0x16eccd(0x155)](_0x205a94);if(!_0x31455e[_0x16eccd(0x137)]||typeof _0x31455e['profiles']!==_0x16eccd(0x147))return[];const _0x42831e=[];for(const [_0x59d929,_0x61edbc]of Object[_0x16eccd(0x12c)](_0x31455e[_0x16eccd(0x137)])){try{validateProfileConfig(_0x61edbc,_0x59d929);const _0x5951d9=getNewCredentialPath(_0x59d929),_0x20d6bb=getOldCredentialPath(_0x59d929),_0x386b0a=a62_0x267fd8[_0x16eccd(0x14c)](_0x5951d9)||a62_0x267fd8[_0x16eccd(0x14c)](_0x20d6bb);_0x42831e[_0x16eccd(0x13e)]({'name':_0x59d929,'config':_0x61edbc,'metadata':{'name':_0x59d929,'createdAt':new Date()[_0x16eccd(0x134)]()},'hasCredentials':_0x386b0a,'scope':_0x4c5d34});}catch(_0x47c87a){_0x47c87a instanceof Error&&(console[_0x16eccd(0x143)]('\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20'+_0x1412eb+':'),console[_0x16eccd(0x143)]('\x20\x20'+_0x47c87a[_0x16eccd(0x166)]+'\x0a'));}}return _0x42831e;}catch(_0x2ef255){return _0x2ef255 instanceof SyntaxError?(console['warn'](_0x16eccd(0x12b)+_0x1412eb+_0x16eccd(0x165)),console[_0x16eccd(0x143)]('Error:\x20'+_0x2ef255[_0x16eccd(0x166)]+'\x0a')):console['warn'](_0x16eccd(0x156)+_0x1412eb+':\x20'+_0x2ef255+'\x0a'),[];}}export function getNewCredentialPath(_0x5a904f){const _0x208ceb=a62_0x5765;return a62_0x3d1a22[_0x208ceb(0x140)](getConfigDir(),_0x208ceb(0x12e)+_0x5a904f);}function getOldCredentialPath(_0x52c236){const _0x103645=a62_0x5765;return a62_0x3d1a22[_0x103645(0x140)](getProfilesDir(),_0x52c236,_0x103645(0x14b));}function loadProfilesFromTdxJsonFiles(){const _0x90767a=a62_0x5765,_0x5281f8=[],_0x5062b2=findProjectConfigPath();_0x5062b2&&_0x5281f8['push'](...loadProfilesFromTdxJson(_0x5062b2,_0x90767a(0x161)));const _0x4ec2c4=a62_0x3d1a22[_0x90767a(0x140)](getConfigDir(),'tdx.json');return _0x5281f8[_0x90767a(0x13e)](...loadProfilesFromTdxJson(_0x4ec2c4,'user')),_0x5281f8;}function loadProfilesFromDirectories(){const _0x3f002c=a62_0x5765,_0x182492=getProfilesDir();if(!a62_0x267fd8['existsSync'](_0x182492))return[];try{return a62_0x267fd8['readdirSync'](_0x182492,{'withFileTypes':!![]})['filter'](_0x254a12=>_0x254a12['isDirectory']())['map'](_0x3491ed=>_0x3491ed['name'])[_0x3f002c(0x138)](_0x1069b2=>{const _0x3bc72d=_0x3f002c,_0x5444e5=getProfileConfigPath(_0x1069b2),_0x3428b3=getProfileEnvPath(_0x1069b2);return a62_0x267fd8['existsSync'](_0x5444e5)||a62_0x267fd8[_0x3bc72d(0x14c)](_0x3428b3);})[_0x3f002c(0x15b)](_0x41f5bd=>{const _0x103c56=loadProfileFromDirectory(_0x41f5bd);if(_0x103c56)return{..._0x103c56,'scope':'directory'};return null;})['filter'](_0x54a27f=>_0x54a27f!==null);}catch{return[];}}function loadProfileFromDirectory(_0x28483c){const _0x34e149=a62_0x5765,_0x57756f=getProfileConfigPath(_0x28483c),_0x253e14=getOldCredentialPath(_0x28483c);if(!a62_0x267fd8['existsSync'](_0x57756f)&&!a62_0x267fd8[_0x34e149(0x14c)](_0x253e14))return null;let _0x47e28d={},_0x90b86f={'name':_0x28483c,'createdAt':new Date()[_0x34e149(0x134)]()};if(a62_0x267fd8[_0x34e149(0x14c)](_0x57756f))try{const _0x20cd4b=a62_0x267fd8[_0x34e149(0x14e)](_0x57756f,'utf-8'),_0x3d8550=JSON['parse'](_0x20cd4b),{metadata:_0x17f369,..._0x242658}=_0x3d8550;_0x47e28d=_0x242658,_0x17f369&&(_0x90b86f=_0x17f369);}catch{}return{'name':_0x28483c,'config':_0x47e28d,'metadata':_0x90b86f,'hasCredentials':a62_0x267fd8[_0x34e149(0x14c)](_0x253e14),'scope':_0x34e149(0x120)};}export function listProfiles(){const _0x344f90=a62_0x5765,_0x3dcbd7=loadProfilesFromTdxJsonFiles(),_0x335439=loadProfilesFromDirectories();if(_0x335439['length']>0x0){const _0x5f0251=_0x335439[_0x344f90(0x15b)](_0xf8475d=>_0xf8475d[_0x344f90(0x13b)])[_0x344f90(0x140)](',\x20'),_0x485f3f=getConfigDir();console['warn'](_0x344f90(0x14d)+_0x5f0251),console[_0x344f90(0x143)]('Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:'),console[_0x344f90(0x143)](_0x344f90(0x129)+a62_0x3d1a22[_0x344f90(0x140)](_0x485f3f,'tdx.json')),console[_0x344f90(0x143)]('\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)'),console[_0x344f90(0x143)](_0x344f90(0x131));}const _0x194f93=[..._0x3dcbd7,..._0x335439],_0x64278c=new Map();for(const _0x2a5aac of _0x194f93){!_0x64278c[_0x344f90(0x124)](_0x2a5aac[_0x344f90(0x13b)])&&_0x64278c[_0x344f90(0x133)](_0x2a5aac['name'],_0x2a5aac);}return Array[_0x344f90(0x130)](_0x64278c['values']())['sort']((_0x46bb68,_0x37d203)=>_0x46bb68[_0x344f90(0x13b)][_0x344f90(0x123)](_0x37d203[_0x344f90(0x13b)]));}export function profileExists(_0x473f99){const _0x137546=a62_0x5765,_0x4bb4a5=listProfiles();return _0x4bb4a5[_0x137546(0x13a)](_0x315928=>_0x315928[_0x137546(0x13b)]===_0x473f99);}export function loadProfile(_0x247e3a){const _0x3645ba=a62_0x5765;validateProfileName(_0x247e3a);const _0x19f892=listProfiles(),_0xbf4b93=_0x19f892[_0x3645ba(0x126)](_0x42c2ec=>_0x42c2ec[_0x3645ba(0x13b)]===_0x247e3a);return _0xbf4b93||null;}export function saveProfile(_0x53b95e,_0x1acd05,_0x190edf=![]){saveProfileToUserConfig(_0x53b95e,_0x1acd05);}export function deleteProfile(_0x299024){const _0x31a33d=a62_0x5765;validateProfileName(_0x299024);const _0x73b52e=getProfileDir(_0x299024);if(!a62_0x267fd8[_0x31a33d(0x14c)](_0x73b52e))throw new Error('Profile\x20'+_0x299024+_0x31a33d(0x15c));a62_0x267fd8[_0x31a33d(0x162)](_0x73b52e,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x4a59d9,_0x4dc94d){const _0x1d957f=a62_0x5765;validateProfileName(_0x4a59d9);const _0x5675ce=getGlobalConfigPath(),_0x344ba1=getConfigDir();!a62_0x267fd8[_0x1d957f(0x14c)](_0x344ba1)&&createSecureDirectory(_0x344ba1);let _0x57e0e2={};if(a62_0x267fd8['existsSync'](_0x5675ce))try{const _0x43af7c=a62_0x267fd8[_0x1d957f(0x14e)](_0x5675ce,_0x1d957f(0x164));_0x57e0e2=JSON[_0x1d957f(0x155)](_0x43af7c);}catch{console[_0x1d957f(0x143)]('Warning:\x20Failed\x20to\x20parse\x20'+_0x5675ce+_0x1d957f(0x136));}!_0x57e0e2[_0x1d957f(0x137)]&&(_0x57e0e2[_0x1d957f(0x137)]={}),_0x57e0e2[_0x1d957f(0x137)][_0x4a59d9]=_0x4dc94d,writeSecureFile(_0x5675ce,JSON[_0x1d957f(0x11c)](_0x57e0e2,null,0x2));}export function removeProfileFromUserConfig(_0x145df0){const _0x70f059=a62_0x5765;validateProfileName(_0x145df0);const _0x1c92d8=getGlobalConfigPath();if(!a62_0x267fd8[_0x70f059(0x14c)](_0x1c92d8))throw new Error('Profile\x20\x27'+_0x145df0+'\x27\x20not\x20found\x20in\x20user\x20configuration');let _0xbab507={};try{const _0x46be8c=a62_0x267fd8[_0x70f059(0x14e)](_0x1c92d8,_0x70f059(0x164));_0xbab507=JSON[_0x70f059(0x155)](_0x46be8c);}catch{throw new Error(_0x70f059(0x141)+_0x1c92d8);}if(!_0xbab507['profiles']||!_0xbab507[_0x70f059(0x137)][_0x145df0])throw new Error('Profile\x20\x27'+_0x145df0+_0x70f059(0x163));delete _0xbab507[_0x70f059(0x137)][_0x145df0],_0xbab507[_0x70f059(0x15d)]===_0x145df0&&delete _0xbab507[_0x70f059(0x15d)],writeSecureFile(_0x1c92d8,JSON[_0x70f059(0x11c)](_0xbab507,null,0x2));}export function getActiveProfile(){const _0x414efc=a62_0x5765,_0x55783e=loadSessionContext();if(_0x55783e?.[_0x414efc(0x15d)])return _0x55783e['profile'];if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x3c4b39=getGlobalConfigPath();if(!a62_0x267fd8['existsSync'](_0x3c4b39))return null;try{const _0x2c8d15=a62_0x267fd8[_0x414efc(0x14e)](_0x3c4b39,_0x414efc(0x164)),_0x582e2b=JSON[_0x414efc(0x155)](_0x2c8d15);return _0x582e2b['profile']||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x418695){const _0x185087=a62_0x5765,_0x45c4dc=getGlobalConfigPath(),_0x23bd41=getConfigDir();!a62_0x267fd8[_0x185087(0x14c)](_0x23bd41)&&createSecureDirectory(_0x23bd41);let _0x24f2cc={};if(a62_0x267fd8['existsSync'](_0x45c4dc))try{const _0x35b2de=a62_0x267fd8[_0x185087(0x14e)](_0x45c4dc,_0x185087(0x164));_0x24f2cc=JSON[_0x185087(0x155)](_0x35b2de);}catch{console['warn'](_0x185087(0x146)+_0x45c4dc+_0x185087(0x136));}_0x24f2cc['site']=_0x418695,writeSecureFile(_0x45c4dc,JSON['stringify'](_0x24f2cc,null,0x2));}export function saveActiveProfileToUserConfig(_0xb5c4f7){const _0x4fa240=a62_0x5765;validateProfileName(_0xb5c4f7);const _0x244668=getGlobalConfigPath(),_0x4f1ea3=getConfigDir();!a62_0x267fd8[_0x4fa240(0x14c)](_0x4f1ea3)&&createSecureDirectory(_0x4f1ea3);let _0x52f1a9={};if(a62_0x267fd8[_0x4fa240(0x14c)](_0x244668))try{const _0x17d1c3=a62_0x267fd8['readFileSync'](_0x244668,_0x4fa240(0x164));_0x52f1a9=JSON[_0x4fa240(0x155)](_0x17d1c3);}catch{console['warn'](_0x4fa240(0x146)+_0x244668+_0x4fa240(0x136));}_0x52f1a9[_0x4fa240(0x15d)]=_0xb5c4f7,writeSecureFile(_0x244668,JSON['stringify'](_0x52f1a9,null,0x2));}function clearFieldFromUserConfig(_0x5d1f0f){const _0xa9f523=a62_0x5765,_0x1b8171=getGlobalConfigPath();if(!a62_0x267fd8[_0xa9f523(0x14c)](_0x1b8171))return;let _0x4828ce={};try{const _0x18904c=a62_0x267fd8[_0xa9f523(0x14e)](_0x1b8171,_0xa9f523(0x164));_0x4828ce=JSON['parse'](_0x18904c);}catch{return;}delete _0x4828ce[_0x5d1f0f],writeSecureFile(_0x1b8171,JSON['stringify'](_0x4828ce,null,0x2));}function a62_0x5765(_0x80632b,_0x19f863){_0x80632b=_0x80632b-0x11c;const _0x4785f0=a62_0x4785();let _0x5765e6=_0x4785f0[_0x80632b];return _0x5765e6;}export function clearDefaultSiteFromUserConfig(){const _0x4cf5b2=a62_0x5765;clearFieldFromUserConfig(_0x4cf5b2(0x148));}function a62_0x4785(){const _0x1a98f6=['object','site','70920DNoxeq','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','.env','existsSync','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','readFileSync','description','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','llm_agent','357GcjihR','31167aqaQVQ','user_info','parse','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','\x20\x20mv\x20\x22','11JbHrkT','\x22\x20\x22','30xZfBQH','map','\x20does\x20not\x20exist','profile','database','\x27:\x20config\x20must\x20be\x20an\x20object','Invalid\x20profile\x20name:\x20','local','rmSync','\x27\x20not\x20found\x20in\x20user\x20configuration','utf-8',':\x20Invalid\x20JSON\x20syntax','message','36fFFhoI','stringify','llm_project','INVALID_PROFILE_CONFIG','string','directory','test','106115YbMztx','localeCompare','has','includes','find','Profile\x20\x27','Warning:\x20Profile\x20\x27','\x20\x201.\x20Edit:\x20','keys','\x0aWarning:\x20Failed\x20to\x20parse\x20','entries','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','.env.','1227489yYrFZx','from','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','To\x20migrate:','set','toISOString','tdx.json',',\x20creating\x20new\x20file','profiles','filter','111733kqlmAz','some','name','1830036TaIKur','1312110UUXkFp','push','parent_segment','join','Failed\x20to\x20parse\x20','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','warn','2DVtcZb','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','Warning:\x20Failed\x20to\x20parse\x20'];a62_0x4785=function(){return _0x1a98f6;};return a62_0x4785();}export function clearActiveProfileFromUserConfig(){clearFieldFromUserConfig('profile');}export function createProfile(_0x5ee41c,_0x203d97){validateProfileName(_0x5ee41c);if(profileExists(_0x5ee41c))throw new Error('Profile\x20'+_0x5ee41c+'\x20already\x20exists');saveProfile(_0x5ee41c,_0x203d97);}export function saveProfileCredentials(_0x16987b,_0x49e4d6){validateProfileName(_0x16987b);if(!profileExists(_0x16987b))throw new Error('Profile\x20'+_0x16987b+'\x20does\x20not\x20exist');const _0x3f436d=getNewCredentialPath(_0x16987b);writeSecureFile(_0x3f436d,_0x49e4d6);}export function loadProfileCredentials(_0x66085a){const _0x1cf47e=a62_0x5765;validateProfileName(_0x66085a);const _0x2a0e6d=getNewCredentialPath(_0x66085a);if(a62_0x267fd8[_0x1cf47e(0x14c)](_0x2a0e6d))try{return a62_0x267fd8[_0x1cf47e(0x14e)](_0x2a0e6d,'utf-8');}catch{}const _0x140bd9=getOldCredentialPath(_0x66085a);if(a62_0x267fd8[_0x1cf47e(0x14c)](_0x140bd9)){console[_0x1cf47e(0x143)](_0x1cf47e(0x145)+_0x66085a+'\x27'),console['warn'](_0x1cf47e(0x132)),console[_0x1cf47e(0x143)](_0x1cf47e(0x157)+_0x140bd9+_0x1cf47e(0x159)+_0x2a0e6d+'\x22'),console[_0x1cf47e(0x143)]('Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a');try{return a62_0x267fd8[_0x1cf47e(0x14e)](_0x140bd9,_0x1cf47e(0x164));}catch{return null;}}return null;}
@@ -1 +1 @@
1
- const a63_0xbbec3c=a63_0x4ec7;(function(_0x368a0e,_0x1fde2b){const _0x2f18ee=a63_0x4ec7,_0x3908d6=_0x368a0e();while(!![]){try{const _0x33d10f=-parseInt(_0x2f18ee(0x189))/0x1+-parseInt(_0x2f18ee(0x18e))/0x2*(-parseInt(_0x2f18ee(0x181))/0x3)+parseInt(_0x2f18ee(0x17e))/0x4*(parseInt(_0x2f18ee(0x18f))/0x5)+parseInt(_0x2f18ee(0x194))/0x6*(-parseInt(_0x2f18ee(0x199))/0x7)+parseInt(_0x2f18ee(0x19a))/0x8*(-parseInt(_0x2f18ee(0x184))/0x9)+-parseInt(_0x2f18ee(0x187))/0xa+parseInt(_0x2f18ee(0x19b))/0xb*(parseInt(_0x2f18ee(0x193))/0xc);if(_0x33d10f===_0x1fde2b)break;else _0x3908d6['push'](_0x3908d6['shift']());}catch(_0x31425d){_0x3908d6['push'](_0x3908d6['shift']());}}}(a63_0xbfde,0xa8208));import*as a63_0x39eba0 from'node:fs';import*as a63_0x18e9d0 from'node:path';const PROJECT_CONFIG_FILENAME=a63_0xbbec3c(0x18a);export function findProjectConfigPath(_0x2503ac){const _0x215132=a63_0xbbec3c;let _0x263fdb=_0x2503ac||process[_0x215132(0x196)]();while(!![]){const _0x1fdb91=a63_0x18e9d0[_0x215132(0x185)](_0x263fdb,PROJECT_CONFIG_FILENAME);if(a63_0x39eba0[_0x215132(0x182)](_0x1fdb91))return _0x1fdb91;const _0x24e81c=a63_0x18e9d0[_0x215132(0x191)](_0x263fdb);if(_0x24e81c===_0x263fdb)return null;_0x263fdb=_0x24e81c;}}function a63_0xbfde(){const _0xe3cd0d=['1101122ScIDSG','tdx.json','Failed\x20to\x20load\x20project\x20config\x20from\x20','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','parse','867778rJaDix','1361690weFWZF','ENOENT','dirname','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','31959324LImJHa','1523964WNtIVv','code','cwd','stringify','includes','7fhBNOJ','136kgDvDA','11reWwtn','apiKey','8kTgRWC','readFileSync','Warning:\x20\x27profile\x27\x20field\x20in\x20','3RiWItv','existsSync',').\x20','722862BQdRYx','join','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','2326720RnsxNp','writeFileSync'];a63_0xbfde=function(){return _0xe3cd0d;};return a63_0xbfde();}export function loadProjectConfig(_0x143f6f){const _0x5db841=a63_0xbbec3c,_0x21010c=findProjectConfigPath(_0x143f6f);if(!_0x21010c)return null;try{const _0x4298a7=a63_0x39eba0[_0x5db841(0x17f)](_0x21010c,'utf-8'),_0x1aa467=JSON[_0x5db841(0x18d)](_0x4298a7),_0x5a6c08=JSON[_0x5db841(0x197)](_0x1aa467);if(_0x5a6c08[_0x5db841(0x198)]('TD_API_KEY')||_0x5a6c08[_0x5db841(0x198)]('apiKey')||_0x5a6c08[_0x5db841(0x198)]('api_key'))throw new Error(_0x5db841(0x186)+_0x21010c+_0x5db841(0x183)+_0x5db841(0x18c));const {metadata:_0x3c486d,profile:_0x413a14,..._0x4045d1}=_0x1aa467;return _0x413a14&&console['warn'](_0x5db841(0x180)+_0x21010c+'\x20is\x20ignored.\x20'+'Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json'),_0x4045d1;}catch(_0x1a7e25){if(_0x1a7e25 instanceof Error&&_0x5db841(0x195)in _0x1a7e25&&_0x1a7e25['code']===_0x5db841(0x190))return null;throw new Error(_0x5db841(0x18b)+_0x21010c+':\x20'+_0x1a7e25);}}function a63_0x4ec7(_0x4be06b,_0x1c7b60){_0x4be06b=_0x4be06b-0x17d;const _0xbfde58=a63_0xbfde();let _0x4ec74c=_0xbfde58[_0x4be06b];return _0x4ec74c;}export function saveProjectConfig(_0x26ad10,_0x41f8e3){const _0xa344db=a63_0xbbec3c,_0x29a690=_0x41f8e3||process[_0xa344db(0x196)](),_0x58dd3a=a63_0x18e9d0[_0xa344db(0x185)](_0x29a690,PROJECT_CONFIG_FILENAME),_0x83a3be=JSON['stringify'](_0x26ad10);if(_0x83a3be[_0xa344db(0x198)]('TD_API_KEY')||_0x83a3be['includes'](_0xa344db(0x17d))||_0x83a3be[_0xa344db(0x198)]('api_key'))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.');if('profile'in _0x26ad10)throw new Error(_0xa344db(0x192));a63_0x39eba0[_0xa344db(0x188)](_0x58dd3a,JSON[_0xa344db(0x197)](_0x26ad10,null,0x2));}export function hasProjectConfig(_0x56e998){return findProjectConfigPath(_0x56e998)!==null;}export function getProjectRoot(_0x1536bb){const _0x1df522=a63_0xbbec3c,_0x5ca3ad=findProjectConfigPath(_0x1536bb);return _0x5ca3ad?a63_0x18e9d0[_0x1df522(0x191)](_0x5ca3ad):null;}
1
+ (function(_0x47b859,_0x5ba4ff){const _0x1242c9=a63_0x3027,_0xd6db5c=_0x47b859();while(!![]){try{const _0x424115=parseInt(_0x1242c9(0xa6))/0x1+parseInt(_0x1242c9(0xad))/0x2*(-parseInt(_0x1242c9(0xc3))/0x3)+parseInt(_0x1242c9(0xb3))/0x4*(parseInt(_0x1242c9(0xbb))/0x5)+parseInt(_0x1242c9(0xab))/0x6+parseInt(_0x1242c9(0xac))/0x7*(parseInt(_0x1242c9(0xbf))/0x8)+parseInt(_0x1242c9(0xb2))/0x9+-parseInt(_0x1242c9(0xa9))/0xa*(parseInt(_0x1242c9(0xb7))/0xb);if(_0x424115===_0x5ba4ff)break;else _0xd6db5c['push'](_0xd6db5c['shift']());}catch(_0x10ad6b){_0xd6db5c['push'](_0xd6db5c['shift']());}}}(a63_0x4d53,0xce106));function a63_0x4d53(){const _0x3a5908=['31101QBQNVt','existsSync','writeFileSync','770eEcLhY','ENOENT','5845614PTePBm','7WpHloT','3161278pYzMyD','\x20is\x20ignored.\x20','warn','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','utf-8','14365008vCEyYZ','3170548ARryVD',').\x20','api_key','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','301543CGGwCh','code','apiKey','Failed\x20to\x20load\x20project\x20config\x20from\x20','5gMHRrs','cwd','dirname','TD_API_KEY','9130872cXNWfr','includes','Warning:\x20\x27profile\x27\x20field\x20in\x20','join','3bRInZD','stringify','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20('];a63_0x4d53=function(){return _0x3a5908;};return a63_0x4d53();}import*as a63_0x1023cd from'node:fs';import*as a63_0x15db73 from'node:path';const PROJECT_CONFIG_FILENAME='tdx.json';export function findProjectConfigPath(_0x5a8e58){const _0x5cc741=a63_0x3027;let _0x2cd1bb=_0x5a8e58||process[_0x5cc741(0xbc)]();while(!![]){const _0x28dc87=a63_0x15db73[_0x5cc741(0xc2)](_0x2cd1bb,PROJECT_CONFIG_FILENAME);if(a63_0x1023cd[_0x5cc741(0xa7)](_0x28dc87))return _0x28dc87;const _0x34500d=a63_0x15db73[_0x5cc741(0xbd)](_0x2cd1bb);if(_0x34500d===_0x2cd1bb)return null;_0x2cd1bb=_0x34500d;}}function a63_0x3027(_0x5a2b29,_0x5697d3){_0x5a2b29=_0x5a2b29-0xa6;const _0x4d53d8=a63_0x4d53();let _0x302739=_0x4d53d8[_0x5a2b29];return _0x302739;}export function loadProjectConfig(_0x60e64c){const _0x13d8a8=a63_0x3027,_0x5eac42=findProjectConfigPath(_0x60e64c);if(!_0x5eac42)return null;try{const _0x2247d2=a63_0x1023cd['readFileSync'](_0x5eac42,_0x13d8a8(0xb1)),_0x2b54ab=JSON['parse'](_0x2247d2),_0x310a28=JSON[_0x13d8a8(0xc4)](_0x2b54ab);if(_0x310a28[_0x13d8a8(0xc0)](_0x13d8a8(0xbe))||_0x310a28[_0x13d8a8(0xc0)](_0x13d8a8(0xb9))||_0x310a28[_0x13d8a8(0xc0)](_0x13d8a8(0xb5)))throw new Error(_0x13d8a8(0xc5)+_0x5eac42+_0x13d8a8(0xb4)+_0x13d8a8(0xb6));const {metadata:_0x24bfdb,profile:_0x33933e,..._0x3a5030}=_0x2b54ab;return _0x33933e&&console[_0x13d8a8(0xaf)](_0x13d8a8(0xc1)+_0x5eac42+_0x13d8a8(0xae)+_0x13d8a8(0xb0)),_0x3a5030;}catch(_0x483f8e){if(_0x483f8e instanceof Error&&_0x13d8a8(0xb8)in _0x483f8e&&_0x483f8e[_0x13d8a8(0xb8)]===_0x13d8a8(0xaa))return null;throw new Error(_0x13d8a8(0xba)+_0x5eac42+':\x20'+_0x483f8e);}}export function saveProjectConfig(_0x6ded4f,_0x4d2565){const _0x39a085=a63_0x3027,_0x48d293=_0x4d2565||process[_0x39a085(0xbc)](),_0x38c00a=a63_0x15db73[_0x39a085(0xc2)](_0x48d293,PROJECT_CONFIG_FILENAME),_0x3927cc=JSON['stringify'](_0x6ded4f);if(_0x3927cc['includes'](_0x39a085(0xbe))||_0x3927cc['includes'](_0x39a085(0xb9))||_0x3927cc[_0x39a085(0xc0)](_0x39a085(0xb5)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.');if('profile'in _0x6ded4f)throw new Error('\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.');a63_0x1023cd[_0x39a085(0xa8)](_0x38c00a,JSON['stringify'](_0x6ded4f,null,0x2));}export function hasProjectConfig(_0x3efbf8){return findProjectConfigPath(_0x3efbf8)!==null;}export function getProjectRoot(_0x3bd98a){const _0x4f6e0c=a63_0x3027,_0x5b7fa5=findProjectConfigPath(_0x3bd98a);return _0x5b7fa5?a63_0x15db73[_0x4f6e0c(0xbd)](_0x5b7fa5):null;}
@@ -1 +1 @@
1
- (function(_0x1f8d5d,_0x55f22d){const _0x1485a9=a64_0x15fe,_0x2e92a1=_0x1f8d5d();while(!![]){try{const _0x5e4b9f=-parseInt(_0x1485a9(0x16c))/0x1*(-parseInt(_0x1485a9(0x160))/0x2)+-parseInt(_0x1485a9(0x174))/0x3*(-parseInt(_0x1485a9(0x178))/0x4)+-parseInt(_0x1485a9(0x16b))/0x5+-parseInt(_0x1485a9(0x172))/0x6*(parseInt(_0x1485a9(0x171))/0x7)+parseInt(_0x1485a9(0x179))/0x8*(parseInt(_0x1485a9(0x180))/0x9)+parseInt(_0x1485a9(0x186))/0xa*(parseInt(_0x1485a9(0x177))/0xb)+-parseInt(_0x1485a9(0x161))/0xc*(parseInt(_0x1485a9(0x166))/0xd);if(_0x5e4b9f===_0x55f22d)break;else _0x2e92a1['push'](_0x2e92a1['shift']());}catch(_0x15cfa8){_0x2e92a1['push'](_0x2e92a1['shift']());}}}(a64_0x1573,0xc44fa));import*as a64_0x49ae3a from'node:fs';import*as a64_0x40c9d4 from'node:path';import*as a64_0x2c0048 from'node:os';function a64_0x15fe(_0x144851,_0x14418d){_0x144851=_0x144851-0x15f;const _0x157325=a64_0x1573();let _0x15fecf=_0x157325[_0x144851];return _0x15fecf;}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 _0x54a776=a64_0x15fe,_0x44a71a=process.env.TDX_CONFIG_DIR||a64_0x40c9d4[_0x54a776(0x168)](a64_0x2c0048[_0x54a776(0x16f)](),'.config','tdx');return a64_0x40c9d4[_0x54a776(0x168)](_0x44a71a,_0x54a776(0x181));}function getSessionPath(_0x282b47){const _0x46ba5a=a64_0x15fe;return a64_0x40c9d4[_0x46ba5a(0x168)](getSessionsDir(),_0x282b47+'.json');}function a64_0x1573(){const _0x2d10e0=['.json','warn','1346njyEJO','313428WEKPBS','.\x20This\x20is\x20insecure.\x20Removing\x20session.','api_key','apiKey','TD_API_KEY','949tAYlfw','readdirSync','join','toISOString','replace','2319050jRHNWA','1415FllVGm','getTime','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','homedir','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','63zVWirZ','471276awXcOP','writeFileSync','2706nvVMdV','utf-8','now','790185DBeFLV','5636KGknht','6944824Viyorm','parse','test','includes','readFileSync','stringify','endsWith','9bjRXMi','sessions','unlinkSync','existsSync','sort','createdAt','110RFbAsQ','toString'];a64_0x1573=function(){return _0x2d10e0;};return a64_0x1573();}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x10863f){const _0x3cf2a6=a64_0x15fe;if(_0x10863f)return _0x10863f;if(process.env.TDX_SESSION)return process.env.TDX_SESSION;return getCurrentSessionPID()[_0x3cf2a6(0x187)]();}export function loadSessionContext(_0x44685e){const _0x143e93=a64_0x15fe,_0x50fa41=getSessionID(_0x44685e),_0x342116=/^\d+$/[_0x143e93(0x17b)](_0x50fa41)?parseInt(_0x50fa41,0xa):null;return _0x342116!==null?loadSessionContextByPID(_0x342116):loadSessionContextByString(_0x50fa41);}export function loadSessionContextByPID(_0x4025fb){const _0x3c6e69=a64_0x15fe,_0x6cebbf=getSessionPath(_0x4025fb);if(!a64_0x49ae3a[_0x3c6e69(0x183)](_0x6cebbf))return null;try{const _0x4d7814=a64_0x49ae3a[_0x3c6e69(0x17d)](_0x6cebbf,'utf-8'),_0x459484=JSON[_0x3c6e69(0x17a)](_0x4d7814),_0x1dadd7=new Date(_0x459484['createdAt'])[_0x3c6e69(0x16d)](),_0x59e6ef=Date[_0x3c6e69(0x176)]();if(_0x59e6ef-_0x1dadd7>SESSION_EXPIRATION_MS)return a64_0x49ae3a['unlinkSync'](_0x6cebbf),null;const _0x46dfef=JSON['stringify'](_0x459484);if(_0x46dfef[_0x3c6e69(0x17c)](_0x3c6e69(0x165))||_0x46dfef[_0x3c6e69(0x17c)](_0x3c6e69(0x164))||_0x46dfef[_0x3c6e69(0x17c)](_0x3c6e69(0x163)))return console[_0x3c6e69(0x15f)]('Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20'+_0x6cebbf+_0x3c6e69(0x162)),a64_0x49ae3a[_0x3c6e69(0x182)](_0x6cebbf),null;return _0x459484;}catch{try{a64_0x49ae3a[_0x3c6e69(0x182)](_0x6cebbf);}catch{}return null;}}function loadSessionContextByString(_0x2e4c29){const _0x5570eb=a64_0x15fe,_0x545746=a64_0x40c9d4[_0x5570eb(0x168)](getSessionsDir(),_0x2e4c29+_0x5570eb(0x188));if(!a64_0x49ae3a['existsSync'](_0x545746))return null;try{const _0x4f83f3=a64_0x49ae3a[_0x5570eb(0x17d)](_0x545746,'utf-8'),_0x26f8d5=JSON['parse'](_0x4f83f3),_0x2381d5=new Date(_0x26f8d5[_0x5570eb(0x185)])['getTime'](),_0x49dd5c=Date[_0x5570eb(0x176)]();if(_0x49dd5c-_0x2381d5>SESSION_EXPIRATION_MS)return a64_0x49ae3a[_0x5570eb(0x182)](_0x545746),null;const _0x2c4a42=JSON[_0x5570eb(0x17e)](_0x26f8d5);if(_0x2c4a42[_0x5570eb(0x17c)](_0x5570eb(0x165))||_0x2c4a42[_0x5570eb(0x17c)](_0x5570eb(0x164))||_0x2c4a42[_0x5570eb(0x17c)](_0x5570eb(0x163)))return console['warn'](_0x5570eb(0x170)+_0x545746+_0x5570eb(0x162)),a64_0x49ae3a[_0x5570eb(0x182)](_0x545746),null;return _0x26f8d5;}catch{try{a64_0x49ae3a[_0x5570eb(0x182)](_0x545746);}catch{}return null;}}export function saveSessionContext(_0x9776e7,_0x5cbcad){const _0x414f4c=a64_0x15fe,_0x26a345=getSessionID(_0x5cbcad),_0x1492b3=/^\d+$/[_0x414f4c(0x17b)](_0x26a345)?parseInt(_0x26a345,0xa):getCurrentSessionPID(),_0x4dabff=a64_0x40c9d4['join'](getSessionsDir(),_0x26a345+_0x414f4c(0x188)),_0x4c9744=getSessionsDir();createSecureDirectory(_0x4c9744);const _0x44ab57=JSON[_0x414f4c(0x17e)](_0x9776e7);if(_0x44ab57['includes'](_0x414f4c(0x165))||_0x44ab57[_0x414f4c(0x17c)](_0x414f4c(0x164))||_0x44ab57[_0x414f4c(0x17c)](_0x414f4c(0x163)))throw new Error(_0x414f4c(0x16e));let _0x1c078a;const _0x3cbb3e=/^\d+$/[_0x414f4c(0x17b)](_0x26a345)?loadSessionContextByPID(parseInt(_0x26a345,0xa)):loadSessionContextByString(_0x26a345);_0x3cbb3e?_0x1c078a={..._0x3cbb3e,..._0x9776e7,'pid':_0x1492b3,'sessionId':_0x26a345!==_0x1492b3[_0x414f4c(0x187)]()?_0x26a345:undefined,'updatedAt':new Date()['toISOString']()}:_0x1c078a={'pid':_0x1492b3,'sessionId':_0x26a345!==_0x1492b3[_0x414f4c(0x187)]()?_0x26a345:undefined,..._0x9776e7,'createdAt':new Date()['toISOString'](),'updatedAt':new Date()[_0x414f4c(0x169)]()},a64_0x49ae3a[_0x414f4c(0x173)](_0x4dabff,JSON['stringify'](_0x1c078a,null,0x2));}export function clearSessionContext(_0x9a98fe){const _0x3d6af4=a64_0x15fe,_0xd111e4=getSessionID(_0x9a98fe),_0x273d6c=a64_0x40c9d4[_0x3d6af4(0x168)](getSessionsDir(),_0xd111e4+_0x3d6af4(0x188));a64_0x49ae3a['existsSync'](_0x273d6c)&&a64_0x49ae3a[_0x3d6af4(0x182)](_0x273d6c);}export function clearSessionContextField(_0x332599,_0xbdcfcc){const _0x3fae9e=a64_0x15fe,_0x897d=getSessionID(_0xbdcfcc),_0x846575=a64_0x40c9d4[_0x3fae9e(0x168)](getSessionsDir(),_0x897d+_0x3fae9e(0x188));if(!a64_0x49ae3a[_0x3fae9e(0x183)](_0x846575))return;try{const _0x2e916b=a64_0x49ae3a[_0x3fae9e(0x17d)](_0x846575,_0x3fae9e(0x175)),_0x4f1d4f=JSON[_0x3fae9e(0x17a)](_0x2e916b);delete _0x4f1d4f[_0x332599],a64_0x49ae3a[_0x3fae9e(0x173)](_0x846575,JSON[_0x3fae9e(0x17e)](_0x4f1d4f,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x498e85=a64_0x15fe,_0x767df8=getSessionsDir();if(!a64_0x49ae3a[_0x498e85(0x183)](_0x767df8))return 0x0;let _0x598501=0x0;const _0x4c2d85=Date['now']();try{const _0x32417c=a64_0x49ae3a[_0x498e85(0x167)](_0x767df8);for(const _0x4e66ef of _0x32417c){if(!_0x4e66ef[_0x498e85(0x17f)]('.json'))continue;const _0x1616ac=a64_0x40c9d4[_0x498e85(0x168)](_0x767df8,_0x4e66ef),_0x3539af=_0x4e66ef[_0x498e85(0x16a)](_0x498e85(0x188),''),_0x206059=parseInt(_0x3539af,0xa),_0x48fc54=!isNaN(_0x206059);if(_0x48fc54){if(!isProcessRunning(_0x206059)){a64_0x49ae3a['unlinkSync'](_0x1616ac),_0x598501++;continue;}}try{const _0x545d0e=a64_0x49ae3a['readFileSync'](_0x1616ac,_0x498e85(0x175)),_0x2def7a=JSON[_0x498e85(0x17a)](_0x545d0e),_0x3bb83e=new Date(_0x2def7a[_0x498e85(0x185)])['getTime']();_0x4c2d85-_0x3bb83e>SESSION_EXPIRATION_MS&&(a64_0x49ae3a[_0x498e85(0x182)](_0x1616ac),_0x598501++);}catch{a64_0x49ae3a[_0x498e85(0x182)](_0x1616ac),_0x598501++;}}}catch{}return _0x598501;}export function listActiveSessions(){const _0x15aec1=a64_0x15fe,_0x48eb32=getSessionsDir();if(!a64_0x49ae3a[_0x15aec1(0x183)](_0x48eb32))return[];try{const _0x385c10=a64_0x49ae3a[_0x15aec1(0x167)](_0x48eb32),_0x4127f0=[];for(const _0xa6a559 of _0x385c10){if(!_0xa6a559['endsWith'](_0x15aec1(0x188)))continue;const _0xb9336d=_0xa6a559[_0x15aec1(0x16a)](_0x15aec1(0x188),''),_0x1f4015=parseInt(_0xb9336d,0xa);!isNaN(_0x1f4015)&&isProcessRunning(_0x1f4015)&&_0x4127f0['push'](_0x1f4015);}return _0x4127f0[_0x15aec1(0x184)]((_0x76b531,_0x30e065)=>_0x76b531-_0x30e065);}catch{return[];}}
1
+ (function(_0x3771eb,_0x5de729){const _0x55463c=a64_0x4960,_0x2270b4=_0x3771eb();while(!![]){try{const _0x418653=parseInt(_0x55463c(0x1d1))/0x1+parseInt(_0x55463c(0x1c8))/0x2*(parseInt(_0x55463c(0x1c6))/0x3)+parseInt(_0x55463c(0x1ca))/0x4+parseInt(_0x55463c(0x1ae))/0x5*(-parseInt(_0x55463c(0x1ad))/0x6)+-parseInt(_0x55463c(0x1b7))/0x7+-parseInt(_0x55463c(0x1c9))/0x8+-parseInt(_0x55463c(0x1c4))/0x9*(-parseInt(_0x55463c(0x1cd))/0xa);if(_0x418653===_0x5de729)break;else _0x2270b4['push'](_0x2270b4['shift']());}catch(_0x236a48){_0x2270b4['push'](_0x2270b4['shift']());}}}(a64_0x41ef,0xeb36f));import*as a64_0x595ded from'node:fs';import*as a64_0x5c578b from'node:path';import*as a64_0x507f6f 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 _0x2977d1=a64_0x4960,_0x143546=process.env.TDX_CONFIG_DIR||a64_0x5c578b[_0x2977d1(0x1b5)](a64_0x507f6f[_0x2977d1(0x1b0)](),_0x2977d1(0x1be),_0x2977d1(0x1a9));return a64_0x5c578b[_0x2977d1(0x1b5)](_0x143546,'sessions');}function getSessionPath(_0x54ec00){const _0x187b66=a64_0x4960;return a64_0x5c578b[_0x187b66(0x1b5)](getSessionsDir(),_0x54ec00+_0x187b66(0x1cc));}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x55f56a){if(_0x55f56a)return _0x55f56a;if(process.env.TDX_SESSION)return process.env.TDX_SESSION;return getCurrentSessionPID()['toString']();}export function loadSessionContext(_0x5c9b39){const _0xbf726a=a64_0x4960,_0x40c641=getSessionID(_0x5c9b39),_0x1647de=/^\d+$/[_0xbf726a(0x1ce)](_0x40c641)?parseInt(_0x40c641,0xa):null;return _0x1647de!==null?loadSessionContextByPID(_0x1647de):loadSessionContextByString(_0x40c641);}export function loadSessionContextByPID(_0x53ca83){const _0x145e02=a64_0x4960,_0x1b3fd9=getSessionPath(_0x53ca83);if(!a64_0x595ded[_0x145e02(0x1c5)](_0x1b3fd9))return null;try{const _0x30a4b3=a64_0x595ded[_0x145e02(0x1bb)](_0x1b3fd9,_0x145e02(0x1cf)),_0x17e852=JSON[_0x145e02(0x1bf)](_0x30a4b3),_0x55d3df=new Date(_0x17e852['createdAt'])['getTime'](),_0x53a4f4=Date[_0x145e02(0x1ac)]();if(_0x53a4f4-_0x55d3df>SESSION_EXPIRATION_MS)return a64_0x595ded[_0x145e02(0x1b3)](_0x1b3fd9),null;const _0x188fc4=JSON[_0x145e02(0x1aa)](_0x17e852);if(_0x188fc4['includes'](_0x145e02(0x1b9))||_0x188fc4['includes'](_0x145e02(0x1bd))||_0x188fc4[_0x145e02(0x1b6)]('api_key'))return console[_0x145e02(0x1ba)]('Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20'+_0x1b3fd9+_0x145e02(0x1c7)),a64_0x595ded[_0x145e02(0x1b3)](_0x1b3fd9),null;return _0x17e852;}catch{try{a64_0x595ded['unlinkSync'](_0x1b3fd9);}catch{}return null;}}function loadSessionContextByString(_0x557dd6){const _0x5c3abc=a64_0x4960,_0x5df22a=a64_0x5c578b[_0x5c3abc(0x1b5)](getSessionsDir(),_0x557dd6+'.json');if(!a64_0x595ded[_0x5c3abc(0x1c5)](_0x5df22a))return null;try{const _0x332a61=a64_0x595ded['readFileSync'](_0x5df22a,'utf-8'),_0x569392=JSON[_0x5c3abc(0x1bf)](_0x332a61),_0x18cc73=new Date(_0x569392[_0x5c3abc(0x1b1)])[_0x5c3abc(0x1af)](),_0x2f42ff=Date[_0x5c3abc(0x1ac)]();if(_0x2f42ff-_0x18cc73>SESSION_EXPIRATION_MS)return a64_0x595ded[_0x5c3abc(0x1b3)](_0x5df22a),null;const _0x4b2438=JSON[_0x5c3abc(0x1aa)](_0x569392);if(_0x4b2438[_0x5c3abc(0x1b6)](_0x5c3abc(0x1b9))||_0x4b2438[_0x5c3abc(0x1b6)](_0x5c3abc(0x1bd))||_0x4b2438[_0x5c3abc(0x1b6)](_0x5c3abc(0x1c1)))return console[_0x5c3abc(0x1ba)](_0x5c3abc(0x1b4)+_0x5df22a+_0x5c3abc(0x1c7)),a64_0x595ded[_0x5c3abc(0x1b3)](_0x5df22a),null;return _0x569392;}catch{try{a64_0x595ded[_0x5c3abc(0x1b3)](_0x5df22a);}catch{}return null;}}export function saveSessionContext(_0x309d03,_0x564f79){const _0x2f9e65=a64_0x4960,_0x47216f=getSessionID(_0x564f79),_0xc2fcef=/^\d+$/[_0x2f9e65(0x1ce)](_0x47216f)?parseInt(_0x47216f,0xa):getCurrentSessionPID(),_0x48556c=a64_0x5c578b[_0x2f9e65(0x1b5)](getSessionsDir(),_0x47216f+'.json'),_0x1bae35=getSessionsDir();createSecureDirectory(_0x1bae35);const _0x4c05ec=JSON['stringify'](_0x309d03);if(_0x4c05ec[_0x2f9e65(0x1b6)](_0x2f9e65(0x1b9))||_0x4c05ec[_0x2f9e65(0x1b6)]('apiKey')||_0x4c05ec['includes'](_0x2f9e65(0x1c1)))throw new Error(_0x2f9e65(0x1bc));let _0x4dc3d6;const _0x214525=/^\d+$/[_0x2f9e65(0x1ce)](_0x47216f)?loadSessionContextByPID(parseInt(_0x47216f,0xa)):loadSessionContextByString(_0x47216f);_0x214525?_0x4dc3d6={..._0x214525,..._0x309d03,'pid':_0xc2fcef,'sessionId':_0x47216f!==_0xc2fcef['toString']()?_0x47216f:undefined,'updatedAt':new Date()[_0x2f9e65(0x1c2)]()}:_0x4dc3d6={'pid':_0xc2fcef,'sessionId':_0x47216f!==_0xc2fcef[_0x2f9e65(0x1d0)]()?_0x47216f:undefined,..._0x309d03,'createdAt':new Date()[_0x2f9e65(0x1c2)](),'updatedAt':new Date()[_0x2f9e65(0x1c2)]()},a64_0x595ded['writeFileSync'](_0x48556c,JSON[_0x2f9e65(0x1aa)](_0x4dc3d6,null,0x2));}function a64_0x41ef(){const _0x319bcb=['.config','parse','endsWith','api_key','toISOString','writeFileSync','2175516hkBWvJ','existsSync','21pxCBYw','.\x20This\x20is\x20insecure.\x20Removing\x20session.','542926nTeRsW','13628240yvkYIc','5191880cDfhuv','readdirSync','.json','10KXznRq','test','utf-8','toString','1226781TKwhUx','tdx','stringify','replace','now','7645164XaEtSs','5jpmtyV','getTime','homedir','createdAt','sort','unlinkSync','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','join','includes','5078871NufpeD','push','TD_API_KEY','warn','readFileSync','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','apiKey'];a64_0x41ef=function(){return _0x319bcb;};return a64_0x41ef();}export function clearSessionContext(_0x1b3b14){const _0x5316f9=a64_0x4960,_0x2cdafc=getSessionID(_0x1b3b14),_0x5ced5f=a64_0x5c578b[_0x5316f9(0x1b5)](getSessionsDir(),_0x2cdafc+_0x5316f9(0x1cc));a64_0x595ded['existsSync'](_0x5ced5f)&&a64_0x595ded[_0x5316f9(0x1b3)](_0x5ced5f);}export function clearSessionContextField(_0x4104a7,_0x4a63c6){const _0xf73367=a64_0x4960,_0x140c5d=getSessionID(_0x4a63c6),_0x479ba6=a64_0x5c578b['join'](getSessionsDir(),_0x140c5d+_0xf73367(0x1cc));if(!a64_0x595ded[_0xf73367(0x1c5)](_0x479ba6))return;try{const _0xcddcb9=a64_0x595ded['readFileSync'](_0x479ba6,_0xf73367(0x1cf)),_0x29b801=JSON[_0xf73367(0x1bf)](_0xcddcb9);delete _0x29b801[_0x4104a7],a64_0x595ded[_0xf73367(0x1c3)](_0x479ba6,JSON[_0xf73367(0x1aa)](_0x29b801,null,0x2));}catch{}}function a64_0x4960(_0x430c12,_0x4d6029){_0x430c12=_0x430c12-0x1a9;const _0x41ef61=a64_0x41ef();let _0x4960ae=_0x41ef61[_0x430c12];return _0x4960ae;}export function cleanExpiredSessions(){const _0x2edd9d=a64_0x4960,_0x240443=getSessionsDir();if(!a64_0x595ded['existsSync'](_0x240443))return 0x0;let _0x382ebb=0x0;const _0x4a97f4=Date[_0x2edd9d(0x1ac)]();try{const _0x18f3df=a64_0x595ded[_0x2edd9d(0x1cb)](_0x240443);for(const _0x56d14c of _0x18f3df){if(!_0x56d14c['endsWith'](_0x2edd9d(0x1cc)))continue;const _0x2cec33=a64_0x5c578b[_0x2edd9d(0x1b5)](_0x240443,_0x56d14c),_0x5c4aaa=_0x56d14c[_0x2edd9d(0x1ab)](_0x2edd9d(0x1cc),''),_0x215aef=parseInt(_0x5c4aaa,0xa),_0x1cd9e6=!isNaN(_0x215aef);if(_0x1cd9e6){if(!isProcessRunning(_0x215aef)){a64_0x595ded[_0x2edd9d(0x1b3)](_0x2cec33),_0x382ebb++;continue;}}try{const _0x2f39d4=a64_0x595ded[_0x2edd9d(0x1bb)](_0x2cec33,'utf-8'),_0x5c78f6=JSON[_0x2edd9d(0x1bf)](_0x2f39d4),_0x489731=new Date(_0x5c78f6[_0x2edd9d(0x1b1)])[_0x2edd9d(0x1af)]();_0x4a97f4-_0x489731>SESSION_EXPIRATION_MS&&(a64_0x595ded[_0x2edd9d(0x1b3)](_0x2cec33),_0x382ebb++);}catch{a64_0x595ded[_0x2edd9d(0x1b3)](_0x2cec33),_0x382ebb++;}}}catch{}return _0x382ebb;}export function listActiveSessions(){const _0x3a630a=a64_0x4960,_0x29ba5e=getSessionsDir();if(!a64_0x595ded[_0x3a630a(0x1c5)](_0x29ba5e))return[];try{const _0x26faa8=a64_0x595ded[_0x3a630a(0x1cb)](_0x29ba5e),_0x356a9e=[];for(const _0x12574d of _0x26faa8){if(!_0x12574d[_0x3a630a(0x1c0)]('.json'))continue;const _0x3a4752=_0x12574d[_0x3a630a(0x1ab)](_0x3a630a(0x1cc),''),_0x2ea369=parseInt(_0x3a4752,0xa);!isNaN(_0x2ea369)&&isProcessRunning(_0x2ea369)&&_0x356a9e[_0x3a630a(0x1b8)](_0x2ea369);}return _0x356a9e[_0x3a630a(0x1b2)]((_0x526e68,_0x5aa196)=>_0x526e68-_0x5aa196);}catch{return[];}}
@@ -1 +1 @@
1
- function a65_0x1722(){const _0x7f2dc4=['8091016wQMkKb','9044895bruHYb','read','clear','users','write','136862YUcMaI','36XrYIRy','5057229dkgVrs','users-{profile}.json','2122332Jgdzsa','3365052gkuXSc','now','8799525wWGttM','7ObXKot'];a65_0x1722=function(){return _0x7f2dc4;};return a65_0x1722();}const a65_0x4fec01=a65_0x3446;(function(_0x2f2fb8,_0x5643e2){const _0x496a28=a65_0x3446,_0x15e207=_0x2f2fb8();while(!![]){try{const _0x19baf0=parseInt(_0x496a28(0x1a6))/0x1*(-parseInt(_0x496a28(0x1ad))/0x2)+parseInt(_0x496a28(0x1af))/0x3+-parseInt(_0x496a28(0x1b2))/0x4+-parseInt(_0x496a28(0x1a8))/0x5+-parseInt(_0x496a28(0x1b1))/0x6+-parseInt(_0x496a28(0x1a5))/0x7+parseInt(_0x496a28(0x1a7))/0x8*(parseInt(_0x496a28(0x1ae))/0x9);if(_0x19baf0===_0x5643e2)break;else _0x15e207['push'](_0x15e207['shift']());}catch(_0x538a9f){_0x15e207['push'](_0x15e207['shift']());}}}(a65_0x1722,0xf1fdb));import{createProfileCache}from'../utils/global-cache.js';const userCache=createProfileCache(a65_0x4fec01(0x1b0),'core/user-cache');function a65_0x3446(_0x453eb7,_0xc3a4c6){_0x453eb7=_0x453eb7-0x1a5;const _0x1722e2=a65_0x1722();let _0x3446b5=_0x1722e2[_0x453eb7];return _0x3446b5;}export function loadCachedUsers(_0x3fc991){const _0x361e27=a65_0x4fec01,_0x1d50a4=userCache[_0x361e27(0x1a9)](_0x3fc991);return _0x1d50a4?.[_0x361e27(0x1ab)]??null;}export function saveCachedUsers(_0x256acc,_0x1be0f9){const _0x41e1dd=a65_0x4fec01;userCache[_0x41e1dd(0x1ac)](_0x256acc,{'users':_0x1be0f9,'cachedAt':Date[_0x41e1dd(0x1b3)]()});}export function clearUserCache(_0x4b484b){const _0x350f07=a65_0x4fec01;userCache[_0x350f07(0x1aa)](_0x4b484b);}
1
+ const a65_0x32de38=a65_0x2bcd;(function(_0x5a3f7d,_0x5e21a8){const _0x51dc4f=a65_0x2bcd,_0x2b6aa1=_0x5a3f7d();while(!![]){try{const _0x3139b4=parseInt(_0x51dc4f(0x8d))/0x1*(parseInt(_0x51dc4f(0x8f))/0x2)+parseInt(_0x51dc4f(0x9a))/0x3+parseInt(_0x51dc4f(0x95))/0x4+-parseInt(_0x51dc4f(0x93))/0x5*(parseInt(_0x51dc4f(0x92))/0x6)+parseInt(_0x51dc4f(0x96))/0x7+parseInt(_0x51dc4f(0x8e))/0x8+parseInt(_0x51dc4f(0x97))/0x9*(-parseInt(_0x51dc4f(0x91))/0xa);if(_0x3139b4===_0x5e21a8)break;else _0x2b6aa1['push'](_0x2b6aa1['shift']());}catch(_0x3f9fdf){_0x2b6aa1['push'](_0x2b6aa1['shift']());}}}(a65_0x261c,0xe44ed));import{createProfileCache}from'../utils/global-cache.js';const userCache=createProfileCache(a65_0x32de38(0x94),a65_0x32de38(0x9b));export function loadCachedUsers(_0x1ce514){const _0x2877df=a65_0x32de38,_0x2de220=userCache[_0x2877df(0x90)](_0x1ce514);return _0x2de220?.[_0x2877df(0x99)]??null;}export function saveCachedUsers(_0x327afe,_0x1946f2){userCache['write'](_0x327afe,{'users':_0x1946f2,'cachedAt':Date['now']()});}function a65_0x261c(){const _0x33ec96=['core/user-cache','151252WTFTfV','6771184DDBfjO','10uuIiEk','read','10UfKwAb','445986gelhov','45YbaYxi','users-{profile}.json','3751832HVDDsx','13060558TxJWSh','32071590cYCUSp','clear','users','2283684QLeMhv'];a65_0x261c=function(){return _0x33ec96;};return a65_0x261c();}function a65_0x2bcd(_0x213d32,_0x3d8da0){_0x213d32=_0x213d32-0x8d;const _0x261ca3=a65_0x261c();let _0x2bcded=_0x261ca3[_0x213d32];return _0x2bcded;}export function clearUserCache(_0x264ba6){const _0xfe9f85=a65_0x32de38;userCache[_0xfe9f85(0x98)](_0x264ba6);}
@@ -1 +1 @@
1
- (function(_0x249f40,_0x1dff6a){const _0x22ed48=a66_0x3a9b,_0x3c7161=_0x249f40();while(!![]){try{const _0x9c4af1=-parseInt(_0x22ed48(0x1c6))/0x1*(-parseInt(_0x22ed48(0x1d1))/0x2)+-parseInt(_0x22ed48(0x1ca))/0x3+-parseInt(_0x22ed48(0x1c3))/0x4*(-parseInt(_0x22ed48(0x1d5))/0x5)+parseInt(_0x22ed48(0x1cb))/0x6*(parseInt(_0x22ed48(0x1ce))/0x7)+-parseInt(_0x22ed48(0x1c4))/0x8*(parseInt(_0x22ed48(0x1c7))/0x9)+parseInt(_0x22ed48(0x1cf))/0xa+-parseInt(_0x22ed48(0x1c9))/0xb;if(_0x9c4af1===_0x1dff6a)break;else _0x3c7161['push'](_0x3c7161['shift']());}catch(_0x4395f0){_0x3c7161['push'](_0x3c7161['shift']());}}}(a66_0x2341,0x2be95));import{readFileSync}from'fs';function a66_0x3a9b(_0x457004,_0x38e56d){_0x457004=_0x457004-0x1c3;const _0x2341e8=a66_0x2341();let _0x3a9b26=_0x2341e8[_0x457004];return _0x3a9b26;}import{fileURLToPath}from'url';import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0x36788b=a66_0x3a9b;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x2a667a=fileURLToPath(import.meta.url),_0x3a504d=dirname(_0x2a667a);try{const _0x121847=join(_0x3a504d,_0x36788b(0x1d4));cachedBuildInfo=JSON['parse'](readFileSync(_0x121847,'utf-8'));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0xd63440=a66_0x3a9b;if(cachedVersion!==null)return cachedVersion;const _0x1de49e=fileURLToPath(import.meta.url),_0x416e69=dirname(_0x1de49e),_0x53656d=getBuildInfo();if(_0x53656d[_0xd63440(0x1cd)])return cachedVersion=_0x53656d[_0xd63440(0x1cd)],cachedVersion;try{const _0x380594=join(_0x416e69,_0xd63440(0x1c8)),_0x2bd40d=JSON[_0xd63440(0x1cc)](readFileSync(_0x380594,_0xd63440(0x1d0)));cachedVersion=_0x2bd40d['version'];}catch{cachedVersion=_0xd63440(0x1d3);}return cachedVersion;}export function isDevVersion(){const _0x48a1c2=a66_0x3a9b,_0x1d398d=getVersion();return _0x1d398d['includes'](_0x48a1c2(0x1d2))||_0x1d398d[_0x48a1c2(0x1c5)]('-');}function a66_0x2341(){const _0x18d412=['63MXJywW','../../package.json','3326125ixHzFA','819378dhvxic','1670982puJXbw','parse','version','7MOlAzR','1362200uRJsRK','utf-8','84826iFCdrU','.dev','0.0.0','../build-info.json','42885uIZAUM','92KPoEZq','30032jyXVsh','includes','4KankOd'];a66_0x2341=function(){return _0x18d412;};return a66_0x2341();}
1
+ (function(_0x4920aa,_0x1c3e26){const _0x23f21f=a66_0x8326,_0x5c088d=_0x4920aa();while(!![]){try{const _0x59d4d6=-parseInt(_0x23f21f(0x1b8))/0x1+-parseInt(_0x23f21f(0x1b2))/0x2+-parseInt(_0x23f21f(0x1ad))/0x3+parseInt(_0x23f21f(0x1b4))/0x4+-parseInt(_0x23f21f(0x1b1))/0x5+-parseInt(_0x23f21f(0x1ae))/0x6+parseInt(_0x23f21f(0x1b3))/0x7;if(_0x59d4d6===_0x1c3e26)break;else _0x5c088d['push'](_0x5c088d['shift']());}catch(_0x36bebe){_0x5c088d['push'](_0x5c088d['shift']());}}}(a66_0x1149,0xc5cb3));import{readFileSync}from'fs';import{fileURLToPath}from'url';function a66_0x8326(_0xdcfebf,_0x3342f2){_0xdcfebf=_0xdcfebf-0x1ad;const _0x114990=a66_0x1149();let _0x832612=_0x114990[_0xdcfebf];return _0x832612;}import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0x4dbc14=a66_0x8326;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x404450=fileURLToPath(import.meta.url),_0x393335=dirname(_0x404450);try{const _0x50be7a=join(_0x393335,'../build-info.json');cachedBuildInfo=JSON[_0x4dbc14(0x1b7)](readFileSync(_0x50be7a,'utf-8'));}catch{cachedBuildInfo={};}return cachedBuildInfo;}function a66_0x1149(){const _0x434657=['parse','1236673FUBKvA','2237784mXPgfK','6978180YUJLFW','.dev','utf-8','4047965LXsBPt','912202goIqia','26244372RNbtHD','5889168yXZtCo','version','0.0.0'];a66_0x1149=function(){return _0x434657;};return a66_0x1149();}export function getVersion(){const _0x108444=a66_0x8326;if(cachedVersion!==null)return cachedVersion;const _0x4ed5ef=fileURLToPath(import.meta.url),_0x4986ce=dirname(_0x4ed5ef),_0x31a10c=getBuildInfo();if(_0x31a10c['version'])return cachedVersion=_0x31a10c[_0x108444(0x1b5)],cachedVersion;try{const _0x5b7003=join(_0x4986ce,'../../package.json'),_0x235bf9=JSON[_0x108444(0x1b7)](readFileSync(_0x5b7003,_0x108444(0x1b0)));cachedVersion=_0x235bf9[_0x108444(0x1b5)];}catch{cachedVersion=_0x108444(0x1b6);}return cachedVersion;}export function isDevVersion(){const _0x38c292=a66_0x8326,_0x134f35=getVersion();return _0x134f35['includes'](_0x38c292(0x1af))||_0x134f35['includes']('-');}