@treasuredata/tdx 2026.3.34 → 2026.3.35

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 (219) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/cas-command.js +1 -1
  12. package/dist/commands/cas-segment-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/delivery-command.js +1 -1
  21. package/dist/commands/describe.js +1 -1
  22. package/dist/commands/engage-campaign-pull-command.js +1 -1
  23. package/dist/commands/engage-campaign-push-command.js +1 -1
  24. package/dist/commands/engage-campaign-validate-command.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/engage-template-pull-command.js +1 -1
  27. package/dist/commands/engage-template-push-command.js +1 -1
  28. package/dist/commands/engage-template-validate-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.js +1 -1
  31. package/dist/commands/journey-validate-command.js +1 -1
  32. package/dist/commands/llm-command.js +1 -1
  33. package/dist/commands/mcp-command.js +1 -1
  34. package/dist/commands/parent-segment-command.js +1 -1
  35. package/dist/commands/policy-command.js +1 -1
  36. package/dist/commands/profile-command.js +1 -1
  37. package/dist/commands/profiles-command.js +1 -1
  38. package/dist/commands/query-command.js +1 -1
  39. package/dist/commands/schedule-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/status-command.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/work-command.js +1 -1
  57. package/dist/commands/workflow-command.js +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/command-output.js +1 -1
  60. package/dist/core/config.js +1 -1
  61. package/dist/core/connection-cache.js +1 -1
  62. package/dist/core/constants.js +1 -1
  63. package/dist/core/credential-cache.js +1 -1
  64. package/dist/core/global-context.js +1 -1
  65. package/dist/core/keychain.js +1 -1
  66. package/dist/core/oauth-keychain.js +1 -1
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/tools/index.js +1 -1
  76. package/dist/mcp/tools/tdx-run.js +1 -1
  77. package/dist/mcp/tools/tdx-search.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/frontmatter.js +1 -1
  182. package/dist/sdk/workspace/git.js +1 -1
  183. package/dist/sdk/workspace/index.js +1 -1
  184. package/dist/sdk/workspace/templates.js +1 -1
  185. package/dist/sdk/workspace/weekly.js +1 -1
  186. package/dist/sdk/workspace/wikilinks.js +1 -1
  187. package/dist/test-utils/command-runner.js +1 -1
  188. package/dist/test-utils/factories.js +1 -1
  189. package/dist/test-utils/fixtures.js +1 -1
  190. package/dist/test-utils/http-mock.js +1 -1
  191. package/dist/test-utils/index.js +1 -1
  192. package/dist/utils/async.js +1 -1
  193. package/dist/utils/colors.js +1 -1
  194. package/dist/utils/diff.js +1 -1
  195. package/dist/utils/file-permissions.js +1 -1
  196. package/dist/utils/file-reader.js +1 -1
  197. package/dist/utils/github-releases.js +1 -1
  198. package/dist/utils/global-cache.js +1 -1
  199. package/dist/utils/json-loader.js +1 -1
  200. package/dist/utils/local-cache.js +1 -1
  201. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  202. package/dist/utils/logger/formatters/index.js +1 -1
  203. package/dist/utils/logger/handlers/console-handler.js +1 -1
  204. package/dist/utils/logger/handlers/file-handler.js +1 -1
  205. package/dist/utils/logger/handlers/index.js +1 -1
  206. package/dist/utils/logger/handlers/null-handler.js +1 -1
  207. package/dist/utils/logger/index.js +1 -1
  208. package/dist/utils/logger/logger.js +1 -1
  209. package/dist/utils/logger/types.js +1 -1
  210. package/dist/utils/option-validation.js +1 -1
  211. package/dist/utils/process.js +1 -1
  212. package/dist/utils/prompt.js +1 -1
  213. package/dist/utils/spinner.js +1 -1
  214. package/dist/utils/sse-parser.js +1 -1
  215. package/dist/utils/string-utils.js +1 -1
  216. package/dist/utils/table-ref-parser.js +1 -1
  217. package/dist/utils/tdx-logger.js +1 -1
  218. package/dist/utils/version-check.js +1 -1
  219. package/package.json +1 -1
@@ -1 +1 @@
1
- const a58_0x1d3d0e=a58_0x1e97;(function(_0x11b682,_0x50c6a2){const _0x19ed5a=a58_0x1e97,_0x5a85f3=_0x11b682();while(!![]){try{const _0x49bee0=parseInt(_0x19ed5a(0xdc))/0x1*(parseInt(_0x19ed5a(0xa5))/0x2)+-parseInt(_0x19ed5a(0xb1))/0x3*(-parseInt(_0x19ed5a(0xe2))/0x4)+-parseInt(_0x19ed5a(0xb2))/0x5+parseInt(_0x19ed5a(0xc5))/0x6*(-parseInt(_0x19ed5a(0xd9))/0x7)+-parseInt(_0x19ed5a(0xe3))/0x8*(-parseInt(_0x19ed5a(0xc0))/0x9)+-parseInt(_0x19ed5a(0xa6))/0xa+-parseInt(_0x19ed5a(0xab))/0xb*(-parseInt(_0x19ed5a(0xb9))/0xc);if(_0x49bee0===_0x50c6a2)break;else _0x5a85f3['push'](_0x5a85f3['shift']());}catch(_0x5d0cc5){_0x5a85f3['push'](_0x5a85f3['shift']());}}}(a58_0x2eb5,0x1abef));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a58_0x549536 from'node:fs';import*as a58_0x35f5c2 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 a58_0x2bec6c from'chalk';import{getGlobalCacheDir,createOptionalProfileCache}from'../utils/global-cache.js';export function getConfigDir(){const _0x2b3926=a58_0x1e97;return process.env.TDX_CONFIG_DIR||join(homedir(),_0x2b3926(0xd0),_0x2b3926(0xbf));}export function getConfigFile(){const _0x474d28=a58_0x1e97;return join(getConfigDir(),_0x474d28(0xd4));}export function getConfigFilePath(_0x383b82){const _0x2fb952=a58_0x1e97,_0x2f820e=getConfigDir();return _0x383b82?a58_0x35f5c2[_0x2fb952(0xdb)](_0x2f820e,_0x2fb952(0xd1)+_0x383b82):getConfigFile();}export function getCacheDir(){return getGlobalCacheDir();}const llmProjectCache=createOptionalProfileCache(a58_0x1d3d0e(0xa1),'config/llm-project');export function getLLMProjectCacheFile(_0x4787e4){const _0x320cae=a58_0x1d3d0e;return llmProjectCache[_0x320cae(0xcb)](_0x4787e4);}export function readCachedLLMProject(_0x5ecd46){const _0x507139=a58_0x1d3d0e,_0x23208d=llmProjectCache[_0x507139(0xad)](_0x5ecd46);if(_0x23208d&&typeof _0x23208d['id']===_0x507139(0xaf)&&typeof _0x23208d['name']==='string')return _0x23208d;return null;}export function writeCachedLLMProject(_0x3afd7f,_0xdf5f93,_0x39eb00){const _0x3da4a8=a58_0x1d3d0e;try{llmProjectCache[_0x3da4a8(0xe8)]({'name':_0x3afd7f,'id':_0xdf5f93},_0x39eb00);}catch{}}const llmAgentCache=createOptionalProfileCache('llm_default_agent',a58_0x1d3d0e(0xb4));export function getLLMAgentCacheFile(_0x39548a){const _0x25c798=a58_0x1d3d0e;return llmAgentCache[_0x25c798(0xcb)](_0x39548a);}export function readCachedLLMAgent(_0x1750aa){const _0x178498=a58_0x1d3d0e,_0x425dfd=llmAgentCache[_0x178498(0xad)](_0x1750aa);if(_0x425dfd&&typeof _0x425dfd['id']===_0x178498(0xaf)&&typeof _0x425dfd['name']===_0x178498(0xaf)&&typeof _0x425dfd['projectId']===_0x178498(0xaf))return _0x425dfd;return null;}export function writeCachedLLMAgent(_0x30ff9f,_0x132111,_0x9f28cf,_0x45fb12){const _0x242bfd=a58_0x1d3d0e;try{llmAgentCache[_0x242bfd(0xe8)]({'name':_0x30ff9f,'id':_0x132111,'projectId':_0x9f28cf},_0x45fb12);}catch{}}export function clearCachedLLMAgent(_0x11c300){const _0x34b8c0=a58_0x1d3d0e;try{llmAgentCache[_0x34b8c0(0xe5)](_0x11c300);}catch{}}const accountInfoCache=createOptionalProfileCache(a58_0x1d3d0e(0xb5),a58_0x1d3d0e(0xcf),{'suffix':a58_0x1d3d0e(0xb6)});export function getAccountInfoCacheFile(_0xf4c06b){const _0x233685=a58_0x1d3d0e;return accountInfoCache[_0x233685(0xcb)](_0xf4c06b);}export function readCachedAccountInfo(_0x1fbc8f){const _0x5c72d5=a58_0x1d3d0e,_0x5d5c4b=accountInfoCache[_0x5c72d5(0xad)](_0x1fbc8f);if(_0x5d5c4b&&typeof _0x5d5c4b['site']==='string'&&typeof _0x5d5c4b[_0x5c72d5(0xc3)]==='number')return _0x5d5c4b;return null;}export function writeCachedAccountInfo(_0x1d5962,_0x1bd319,_0x4bd2a6){const _0x128631=a58_0x1d3d0e;try{accountInfoCache[_0x128631(0xe8)]({'site':_0x1d5962,'accountId':_0x1bd319,'cachedAt':new Date()[_0x128631(0xe6)]()},_0x4bd2a6);}catch{}}export function parseEnvFile(_0x430c9b){const _0x364d9b=a58_0x1d3d0e,_0x41e398={};for(const _0xd63471 of _0x430c9b[_0x364d9b(0xe0)]('\x0a')){const _0x38ebb7=_0xd63471[_0x364d9b(0xc9)]();if(!_0x38ebb7||_0x38ebb7['startsWith']('#'))continue;const _0x7d0277=_0x38ebb7['match'](/^([^=]+)=(.*)$/);if(_0x7d0277){const _0x3925c8=_0x7d0277[0x1][_0x364d9b(0xc9)]();let _0x2ad325=_0x7d0277[0x2][_0x364d9b(0xc9)]();(_0x2ad325[_0x364d9b(0xac)]('\x22')&&_0x2ad325[_0x364d9b(0xc1)]('\x22')||_0x2ad325[_0x364d9b(0xac)]('\x27')&&_0x2ad325[_0x364d9b(0xc1)]('\x27'))&&(_0x2ad325=_0x2ad325[_0x364d9b(0xba)](0x1,-0x1)),_0x41e398[_0x3925c8]=_0x2ad325;}}return _0x41e398;}export function readUserConfig(){const _0x401c3a=a58_0x1d3d0e,_0x46fd3a=getConfigFile();if(!existsSync(_0x46fd3a))return{};try{const _0x512e72=readFileSync(_0x46fd3a,'utf-8');return parseEnvFile(_0x512e72);}catch(_0x2d85fe){return console[_0x401c3a(0xce)]('Warning:\x20Failed\x20to\x20read\x20config\x20file\x20'+_0x46fd3a+':',_0x2d85fe),{};}}export function resolveSite(_0x51d6e7){const _0x4af8c7=a58_0x1d3d0e,_0x3ccc62=[_0x4af8c7(0xbe),_0x4af8c7(0xe9),_0x4af8c7(0xd2),_0x4af8c7(0xbb),'ap03','dev-us01',_0x4af8c7(0xb3),'stg-us01',_0x4af8c7(0xd3),'stg-ap03'];if(_0x3ccc62['includes'](_0x51d6e7))return _0x51d6e7;if(_0x51d6e7 in SITE_ALIASES)return SITE_ALIASES[_0x51d6e7];return console[_0x4af8c7(0xce)](_0x4af8c7(0xde)+_0x51d6e7+_0x4af8c7(0xc2)),_0x4af8c7(0xbe);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}function a58_0x1e97(_0x519647,_0x19b7d2){_0x519647=_0x519647-0x9f;const _0x2eb5a9=a58_0x2eb5();let _0x1e973f=_0x2eb5a9[_0x519647];return _0x1e973f;}export function resolveAccessToken(_0x241028){const _0x51fc66=a58_0x1d3d0e,_0xb637d6=_0x241028||getActiveProfileName()||undefined;if(_0xb637d6){const _0x2c0a73=_0x51fc66(0xae)+normalizeProfileForEnvVar(_0xb637d6);if(process.env[_0x2c0a73])return{'accessToken':process.env[_0x2c0a73],'source':_0x2c0a73+_0x51fc66(0xb8)};}if(process.env.TDX_ACCESS_TOKEN)return{'accessToken':process.env.TDX_ACCESS_TOKEN,'source':_0x51fc66(0x9f)};return null;}export function getAccessToken(_0x281a23){return resolveAccessToken(_0x281a23)?.['accessToken'];}export function getAPIKey(_0x41af03){const _0x2db729=_0x41af03||getActiveProfileName();if(_0x2db729){const _0x4a2716='TDX_API_KEY_'+normalizeProfileForEnvVar(_0x2db729);if(process.env[_0x4a2716])return process.env[_0x4a2716];}if(process.env.TDX_API_KEY)return process.env.TDX_API_KEY;return undefined;}export function normalizeProfileForEnvVar(_0x24c99){const _0x3c3906=a58_0x1d3d0e;return _0x24c99[_0x3c3906(0xa8)]()[_0x3c3906(0xa9)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x26a523,_0x512eef){const _0x37c60f=a58_0x1d3d0e,_0x3ccaa9=resolveAccessToken(_0x512eef);if(_0x3ccaa9)return{'apiKey':_0x3ccaa9[_0x37c60f(0xd8)],'source':_0x3ccaa9[_0x37c60f(0xb7)],'isDeprecated':![]};const _0x13273e=_0x512eef||getActiveProfileName()||undefined;if(_0x13273e){const _0x49230d=_0x37c60f(0xdf)+normalizeProfileForEnvVar(_0x13273e);if(process.env[_0x49230d])return{'apiKey':process.env[_0x49230d],'source':_0x49230d+_0x37c60f(0xb8),'isDeprecated':![]};const _0x4dc971=getCachedCredential(_0x26a523,_0x13273e);if(_0x4dc971)return{'apiKey':_0x4dc971,'source':'keychain\x20(profile:\x20'+_0x13273e+')','isDeprecated':![]};const _0x3a78a4=await getKeychainAPIKey(_0x13273e);if(_0x3a78a4)return setCachedCredential(_0x3a78a4,_0x26a523,_0x13273e),{'apiKey':_0x3a78a4,'source':_0x37c60f(0xc4)+_0x13273e+')','isDeprecated':![]};}if(process.env.TDX_API_KEY)return{'apiKey':process.env.TDX_API_KEY,'source':'TDX_API_KEY\x20env\x20var','isDeprecated':![]};if(!_0x13273e){const _0x421dc0=getCachedCredential(_0x26a523,undefined);if(_0x421dc0)return{'apiKey':_0x421dc0,'source':_0x37c60f(0xc8),'isDeprecated':![]};const _0x58eb1f=await getKeychainAPIKey(undefined);if(_0x58eb1f)return setCachedCredential(_0x58eb1f,_0x26a523,undefined),{'apiKey':_0x58eb1f,'source':_0x37c60f(0xc8),'isDeprecated':![]};}return null;}export async function getAPIKeyAsync(_0x41436d,_0x5420f9){const _0x3c8c06=a58_0x1d3d0e,_0x3d5087=await resolveAPIKeyAsync(_0x41436d,_0x5420f9);return _0x3d5087?.[_0x3c8c06(0xc6)];}function cleanupLegacyEnvFile(_0x594160){const _0xf0bc27=a58_0x1d3d0e;if(!existsSync(_0x594160))return![];try{const _0x3d7bb8=readFileSync(_0x594160,_0xf0bc27(0xda)),_0x52dc4d=_0x3d7bb8[_0xf0bc27(0xe0)]('\x0a'),_0x91ffcb=_0x52dc4d[_0xf0bc27(0xa0)](_0x2a66c2=>{const _0x9f927a=_0xf0bc27,_0x31d3c7=_0x2a66c2['trim']();if(!_0x31d3c7||_0x31d3c7[_0x9f927a(0xac)]('#'))return!![];const [_0x555392]=_0x31d3c7[_0x9f927a(0xe0)]('=');return!_0x555392[_0x9f927a(0xac)](_0x9f927a(0xcc));}),_0x5b0963=_0x91ffcb['some'](_0x5cf80b=>{const _0x16a1c0=_0x5cf80b['trim']();return _0x16a1c0&&!_0x16a1c0['startsWith']('#');});if(!_0x5b0963)return unlinkSync(_0x594160),!![];return writeFileSync(_0x594160,_0x91ffcb[_0xf0bc27(0xdb)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function getActiveProfileName(){const _0x2f80a3=a58_0x1d3d0e;if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x371cee=a58_0x35f5c2[_0x2f80a3(0xdb)](getConfigDir(),_0x2f80a3(0xd6));if(!a58_0x549536[_0x2f80a3(0xd7)](_0x371cee))return null;try{const _0x30b34a=a58_0x549536[_0x2f80a3(0xb0)](_0x371cee,_0x2f80a3(0xda)),_0x4569e6=JSON[_0x2f80a3(0xa3)](_0x30b34a);return _0x4569e6['profile']||null;}catch{return null;}}export function saveAPIKey(_0x2b906d,_0x125abc,_0x4c56c2){const _0x502264=a58_0x1d3d0e,_0x453728=getConfigDir(),_0x58bdc0=getConfigFilePath(_0x4c56c2);!existsSync(_0x453728)&&mkdirSync(_0x453728,{'recursive':!![],'mode':0x1c0});let _0x544680={};if(existsSync(_0x58bdc0))try{const _0x2670c4=readFileSync(_0x58bdc0,_0x502264(0xda));_0x544680=parseEnvFile(_0x2670c4);}catch(_0x5f5864){console[_0x502264(0xce)](_0x502264(0xc7)+_0x58bdc0+':',_0x5f5864);}const _0x58324d=_0x2b906d[_0x502264(0xa8)]()['replace'](/-/g,'_');_0x544680[_0x502264(0xa4)+_0x58324d]=_0x125abc;const _0x1ad504=Object[_0x502264(0xe1)](_0x544680)[_0x502264(0xd5)](([_0x39a657,_0x109922])=>_0x39a657+'='+_0x109922);writeFileSync(_0x58bdc0,_0x1ad504['join']('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0xf8c1d1,_0x3e425e,_0x1696ef){const _0x45aa64=a58_0x1d3d0e;await saveKeychainAPIKey(_0xf8c1d1,_0x1696ef),setCachedCredential(_0xf8c1d1,_0x3e425e,_0x1696ef);const _0x2741f5=getConfigFilePath(_0x1696ef);cleanupLegacyEnvFile(_0x2741f5)&&console['warn'](a58_0x2bec6c[_0x45aa64(0xaa)](_0x45aa64(0xa2)));}export function loadConfig(){const _0x53fdde=a58_0x1d3d0e,_0xa491a6={'apiKeys':{},'defaultSite':_0x53fdde(0xbe)},_0x168a43=[_0x53fdde(0xbe),'ap01',_0x53fdde(0xd2),'ap02',_0x53fdde(0xbd),_0x53fdde(0xca),'dev-eu01','stg-us01','stg-ap01',_0x53fdde(0xdd)],_0x17e7ca=getAPIKey();if(_0x17e7ca)for(const _0x2193d7 of _0x168a43){_0xa491a6['apiKeys'][_0x2193d7]=_0x17e7ca;}return _0xa491a6;}export function isExperimentalAvailable(){return!!process.env.TDX_EXPERIMENTAL;}function a58_0x2eb5(){const _0x3ce506=['toUpperCase','replace','yellow','868681mkpIUM','startsWith','read','TDX_ACCESS_TOKEN_','string','readFileSync','4458VbNqHQ','552430gjDSBR','dev-eu01','config/llm-agent','account_info','.json','source','\x20env\x20var','36qHaLUl','slice','ap02','stringify','ap03','us01','tdx','291465jHDxoc','endsWith','\x27,\x20defaulting\x20to\x20us01','accountId','keychain\x20(profile:\x20','312XyKktN','apiKey','Warning:\x20Failed\x20to\x20read\x20','keychain','trim','dev-us01','path','TD_API_KEY','proxy','warn','config/account-info','.config','.env.','eu01','stg-ap01','.env','map','tdx.json','existsSync','accessToken','8197ZqwZkP','utf-8','join','4cEYfQY','stg-ap03','Warning:\x20Unknown\x20site\x20\x27','TDX_API_KEY_','split','entries','408EAiMVd','8xTzoBe','stable','clear','toISOString','release_channel','write','ap01','TDX_ACCESS_TOKEN\x20env\x20var','filter','llm_default_project','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','parse','TD_API_KEY_','32174VQqkgi','2042890iEfxiw','next'];a58_0x2eb5=function(){return _0x3ce506;};return a58_0x2eb5();}export function loadGlobalProxy(){const _0x38abf=a58_0x1d3d0e,_0x1b5dc2=a58_0x35f5c2[_0x38abf(0xdb)](getConfigDir(),_0x38abf(0xd6));if(!a58_0x549536[_0x38abf(0xd7)](_0x1b5dc2))return undefined;try{const _0x2b727e=a58_0x549536[_0x38abf(0xb0)](_0x1b5dc2,_0x38abf(0xda)),_0x29137a=JSON[_0x38abf(0xa3)](_0x2b727e);return typeof _0x29137a[_0x38abf(0xcd)]===_0x38abf(0xaf)?_0x29137a[_0x38abf(0xcd)]:undefined;}catch{return undefined;}}export function loadReleaseChannel(){const _0x31aef3=a58_0x1d3d0e,_0x1bf522=process.env.TDX_RELEASE_CHANNEL;if(_0x1bf522===_0x31aef3(0xa7)||_0x1bf522===_0x31aef3(0xe4))return _0x1bf522;const _0x2525fe=a58_0x35f5c2[_0x31aef3(0xdb)](getConfigDir(),_0x31aef3(0xd6));if(!a58_0x549536['existsSync'](_0x2525fe))return'stable';try{const _0x1f7f0c=a58_0x549536[_0x31aef3(0xb0)](_0x2525fe,_0x31aef3(0xda)),_0x27cd00=JSON[_0x31aef3(0xa3)](_0x1f7f0c);if(_0x27cd00['release_channel']===_0x31aef3(0xa7))return _0x31aef3(0xa7);}catch{}return'stable';}export function saveReleaseChannel(_0x24e81b){const _0x5dea85=a58_0x1d3d0e,_0x36a234=getConfigDir(),_0x5290c6=a58_0x35f5c2[_0x5dea85(0xdb)](_0x36a234,_0x5dea85(0xd6));!existsSync(_0x36a234)&&mkdirSync(_0x36a234,{'recursive':!![],'mode':0x1c0});let _0x39a7b6={};if(existsSync(_0x5290c6))try{const _0x18c8b7=readFileSync(_0x5290c6,_0x5dea85(0xda));_0x39a7b6=JSON[_0x5dea85(0xa3)](_0x18c8b7);}catch{}_0x39a7b6[_0x5dea85(0xe7)]=_0x24e81b,writeFileSync(_0x5290c6,JSON[_0x5dea85(0xbc)](_0x39a7b6,null,0x2),{'mode':0x180});}
1
+ const a58_0x535864=a58_0x6300;(function(_0x4af0c5,_0x1061df){const _0x366744=a58_0x6300,_0x3bec4d=_0x4af0c5();while(!![]){try{const _0x3f23bf=parseInt(_0x366744(0xec))/0x1+-parseInt(_0x366744(0xc3))/0x2*(-parseInt(_0x366744(0xfa))/0x3)+parseInt(_0x366744(0xc6))/0x4*(-parseInt(_0x366744(0xeb))/0x5)+-parseInt(_0x366744(0xfc))/0x6+parseInt(_0x366744(0xce))/0x7+-parseInt(_0x366744(0xea))/0x8+parseInt(_0x366744(0xd6))/0x9;if(_0x3f23bf===_0x1061df)break;else _0x3bec4d['push'](_0x3bec4d['shift']());}catch(_0x2651ef){_0x3bec4d['push'](_0x3bec4d['shift']());}}}(a58_0x38c1,0xe08c1));function a58_0x6300(_0x4ea97e,_0x2929bb){_0x4ea97e=_0x4ea97e-0xbd;const _0x38c18a=a58_0x38c1();let _0x6300ef=_0x38c18a[_0x4ea97e];return _0x6300ef;}import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a58_0x3f76f9 from'node:fs';import*as a58_0x4b7b91 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 a58_0x371643 from'chalk';import{getGlobalCacheDir,createOptionalProfileCache}from'../utils/global-cache.js';export function getConfigDir(){const _0x1da9ec=a58_0x6300;return process.env.TDX_CONFIG_DIR||join(homedir(),_0x1da9ec(0xfb),_0x1da9ec(0xd5));}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getConfigFilePath(_0x26c629){const _0xf3b3d8=a58_0x6300,_0x227688=getConfigDir();return _0x26c629?a58_0x4b7b91[_0xf3b3d8(0xe9)](_0x227688,_0xf3b3d8(0xde)+_0x26c629):getConfigFile();}export function getCacheDir(){return getGlobalCacheDir();}const llmProjectCache=createOptionalProfileCache(a58_0x535864(0xca),'config/llm-project');export function getLLMProjectCacheFile(_0x407b66){const _0x1067b4=a58_0x535864;return llmProjectCache[_0x1067b4(0xd8)](_0x407b66);}export function readCachedLLMProject(_0x27f753){const _0x37ff55=a58_0x535864,_0x2983a0=llmProjectCache[_0x37ff55(0xe0)](_0x27f753);if(_0x2983a0&&typeof _0x2983a0['id']===_0x37ff55(0xc5)&&typeof _0x2983a0['name']===_0x37ff55(0xc5))return _0x2983a0;return null;}export function writeCachedLLMProject(_0x3c4654,_0x3de817,_0x32c72d){try{llmProjectCache['write']({'name':_0x3c4654,'id':_0x3de817},_0x32c72d);}catch{}}const llmAgentCache=createOptionalProfileCache(a58_0x535864(0xd7),'config/llm-agent');export function getLLMAgentCacheFile(_0x501de1){return llmAgentCache['path'](_0x501de1);}export function readCachedLLMAgent(_0x4c73f0){const _0x4add41=a58_0x535864,_0x4ea668=llmAgentCache[_0x4add41(0xe0)](_0x4c73f0);if(_0x4ea668&&typeof _0x4ea668['id']==='string'&&typeof _0x4ea668[_0x4add41(0xf1)]===_0x4add41(0xc5)&&typeof _0x4ea668[_0x4add41(0xfe)]==='string')return _0x4ea668;return null;}export function writeCachedLLMAgent(_0x2a9171,_0x113da7,_0x135922,_0x2a1ae2){try{llmAgentCache['write']({'name':_0x2a9171,'id':_0x113da7,'projectId':_0x135922},_0x2a1ae2);}catch{}}export function clearCachedLLMAgent(_0x1193cc){const _0x16952e=a58_0x535864;try{llmAgentCache[_0x16952e(0xf9)](_0x1193cc);}catch{}}const accountInfoCache=createOptionalProfileCache(a58_0x535864(0xc1),a58_0x535864(0xdc),{'suffix':a58_0x535864(0xe6)});export function getAccountInfoCacheFile(_0x29135c){const _0x14cc6a=a58_0x535864;return accountInfoCache[_0x14cc6a(0xd8)](_0x29135c);}export function readCachedAccountInfo(_0x1234c1){const _0x1af83b=a58_0x535864,_0x4c725e=accountInfoCache['read'](_0x1234c1);if(_0x4c725e&&typeof _0x4c725e['site']===_0x1af83b(0xc5)&&typeof _0x4c725e['accountId']==='number')return _0x4c725e;return null;}export function writeCachedAccountInfo(_0x2309e8,_0x5a3896,_0x5512c1){const _0x366538=a58_0x535864;try{accountInfoCache['write']({'site':_0x2309e8,'accountId':_0x5a3896,'cachedAt':new Date()[_0x366538(0xcb)]()},_0x5512c1);}catch{}}export function parseEnvFile(_0x58e02d){const _0xe2b40c=a58_0x535864,_0x17f311={};for(const _0x2481d9 of _0x58e02d[_0xe2b40c(0xf0)]('\x0a')){const _0x365003=_0x2481d9[_0xe2b40c(0xf5)]();if(!_0x365003||_0x365003[_0xe2b40c(0xee)]('#'))continue;const _0x464860=_0x365003[_0xe2b40c(0xe5)](/^([^=]+)=(.*)$/);if(_0x464860){const _0x341453=_0x464860[0x1]['trim']();let _0x3e7690=_0x464860[0x2][_0xe2b40c(0xf5)]();(_0x3e7690[_0xe2b40c(0xee)]('\x22')&&_0x3e7690[_0xe2b40c(0xef)]('\x22')||_0x3e7690[_0xe2b40c(0xee)]('\x27')&&_0x3e7690['endsWith']('\x27'))&&(_0x3e7690=_0x3e7690['slice'](0x1,-0x1)),_0x17f311[_0x341453]=_0x3e7690;}}return _0x17f311;}export function readUserConfig(){const _0x59dcc1=a58_0x535864,_0x419143=getConfigFile();if(!existsSync(_0x419143))return{};try{const _0x3cfbc7=readFileSync(_0x419143,'utf-8');return parseEnvFile(_0x3cfbc7);}catch(_0x187036){return console[_0x59dcc1(0xf6)](_0x59dcc1(0xc4)+_0x419143+':',_0x187036),{};}}export function resolveSite(_0x5b9e73){const _0x4b48c7=a58_0x535864,_0x5aa7bc=[_0x4b48c7(0xe8),_0x4b48c7(0xd1),'eu01',_0x4b48c7(0xe4),_0x4b48c7(0xcd),_0x4b48c7(0xf4),_0x4b48c7(0xd2),_0x4b48c7(0xd9),_0x4b48c7(0xf8),'stg-ap03'];if(_0x5aa7bc['includes'](_0x5b9e73))return _0x5b9e73;if(_0x5b9e73 in SITE_ALIASES)return SITE_ALIASES[_0x5b9e73];return console['warn']('Warning:\x20Unknown\x20site\x20\x27'+_0x5b9e73+'\x27,\x20defaulting\x20to\x20us01'),_0x4b48c7(0xe8);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function resolveAccessToken(_0x114129){const _0x5c1af3=a58_0x535864,_0x4755c2=_0x114129||getActiveProfileName()||undefined;if(_0x4755c2){const _0x4002df=_0x5c1af3(0xdd)+normalizeProfileForEnvVar(_0x4755c2);if(process.env[_0x4002df])return{'accessToken':process.env[_0x4002df],'source':_0x4002df+_0x5c1af3(0xc9)};}if(process.env.TDX_ACCESS_TOKEN)return{'accessToken':process.env.TDX_ACCESS_TOKEN,'source':'TDX_ACCESS_TOKEN\x20env\x20var'};return null;}export function getAccessToken(_0x1f871b){const _0x34a38e=a58_0x535864;return resolveAccessToken(_0x1f871b)?.[_0x34a38e(0xff)];}function a58_0x38c1(){const _0x588e46=['profile','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','entries','readFileSync','account_info','parse','1412nDCFhV','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','string','5154124fAXKMh','replace','some','\x20env\x20var','llm_default_project','toISOString','existsSync','ap03','3743439DsrpHz','source','stable','ap01','dev-eu01','stringify','TDX_API_KEY_','tdx','42480dvgqJx','llm_default_agent','path','stg-us01','release_channel','filter','config/account-info','TDX_ACCESS_TOKEN_','.env.','apiKey','read','next','utf-8','TDX_API_KEY\x20env\x20var','ap02','match','.json','proxy','us01','join','1316096ppKsKx','5wumKvh','881897WaWQgp','apiKeys','startsWith','endsWith','split','name','tdx.json','keychain\x20(profile:\x20','dev-us01','trim','warn','TD_API_KEY','stg-ap01','clear','7773CuCIcJ','.config','5267112iZEfoy','toUpperCase','projectId','accessToken'];a58_0x38c1=function(){return _0x588e46;};return a58_0x38c1();}export function getAPIKey(_0x263778){const _0x7d1bc8=a58_0x535864,_0x3b8d61=_0x263778||getActiveProfileName();if(_0x3b8d61){const _0x4c45aa=_0x7d1bc8(0xd4)+normalizeProfileForEnvVar(_0x3b8d61);if(process.env[_0x4c45aa])return process.env[_0x4c45aa];}if(process.env.TDX_API_KEY)return process.env.TDX_API_KEY;return undefined;}export function normalizeProfileForEnvVar(_0x3dbf9f){return _0x3dbf9f['toUpperCase']()['replace'](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x2591e7,_0x4ed452){const _0x286fc1=a58_0x535864,_0x251b67=resolveAccessToken(_0x4ed452);if(_0x251b67)return{'apiKey':_0x251b67['accessToken'],'source':_0x251b67[_0x286fc1(0xcf)],'isDeprecated':![]};const _0x195a1b=_0x4ed452||getActiveProfileName()||undefined;if(_0x195a1b){const _0x1835d2=_0x286fc1(0xd4)+normalizeProfileForEnvVar(_0x195a1b);if(process.env[_0x1835d2])return{'apiKey':process.env[_0x1835d2],'source':_0x1835d2+_0x286fc1(0xc9),'isDeprecated':![]};const _0x2d679c=getCachedCredential(_0x2591e7,_0x195a1b);if(_0x2d679c)return{'apiKey':_0x2d679c,'source':_0x286fc1(0xf3)+_0x195a1b+')','isDeprecated':![]};const _0x1f36f1=await getKeychainAPIKey(_0x195a1b);if(_0x1f36f1)return setCachedCredential(_0x1f36f1,_0x2591e7,_0x195a1b),{'apiKey':_0x1f36f1,'source':_0x286fc1(0xf3)+_0x195a1b+')','isDeprecated':![]};}if(process.env.TDX_API_KEY)return{'apiKey':process.env.TDX_API_KEY,'source':_0x286fc1(0xe3),'isDeprecated':![]};if(!_0x195a1b){const _0x30b8f2=getCachedCredential(_0x2591e7,undefined);if(_0x30b8f2)return{'apiKey':_0x30b8f2,'source':'keychain','isDeprecated':![]};const _0x106955=await getKeychainAPIKey(undefined);if(_0x106955)return setCachedCredential(_0x106955,_0x2591e7,undefined),{'apiKey':_0x106955,'source':'keychain','isDeprecated':![]};}return null;}export async function getAPIKeyAsync(_0x66cd61,_0x13b0b0){const _0x316d49=a58_0x535864,_0x5cf299=await resolveAPIKeyAsync(_0x66cd61,_0x13b0b0);return _0x5cf299?.[_0x316d49(0xdf)];}function cleanupLegacyEnvFile(_0x415421){const _0x38945d=a58_0x535864;if(!existsSync(_0x415421))return![];try{const _0x375557=readFileSync(_0x415421,_0x38945d(0xe2)),_0x425d66=_0x375557['split']('\x0a'),_0x59658e=_0x425d66[_0x38945d(0xdb)](_0x405ca1=>{const _0x2052ee=_0x38945d,_0x1b45a6=_0x405ca1[_0x2052ee(0xf5)]();if(!_0x1b45a6||_0x1b45a6[_0x2052ee(0xee)]('#'))return!![];const [_0x494600]=_0x1b45a6[_0x2052ee(0xf0)]('=');return!_0x494600['startsWith'](_0x2052ee(0xf7));}),_0x93e901=_0x59658e[_0x38945d(0xc8)](_0x582ae9=>{const _0x48519d=_0x38945d,_0xa88a7f=_0x582ae9['trim']();return _0xa88a7f&&!_0xa88a7f[_0x48519d(0xee)]('#');});if(!_0x93e901)return unlinkSync(_0x415421),!![];return writeFileSync(_0x415421,_0x59658e[_0x38945d(0xe9)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function getActiveProfileName(){const _0x75ba98=a58_0x535864;if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x533c5b=a58_0x4b7b91[_0x75ba98(0xe9)](getConfigDir(),_0x75ba98(0xf2));if(!a58_0x3f76f9['existsSync'](_0x533c5b))return null;try{const _0x1323c2=a58_0x3f76f9[_0x75ba98(0xc0)](_0x533c5b,_0x75ba98(0xe2)),_0x37ec04=JSON[_0x75ba98(0xc2)](_0x1323c2);return _0x37ec04[_0x75ba98(0xbd)]||null;}catch{return null;}}export function saveAPIKey(_0x1158cb,_0x75cf8f,_0x3131c8){const _0x240852=a58_0x535864,_0x560b92=getConfigDir(),_0x5ad413=getConfigFilePath(_0x3131c8);!existsSync(_0x560b92)&&mkdirSync(_0x560b92,{'recursive':!![],'mode':0x1c0});let _0x16ee08={};if(existsSync(_0x5ad413))try{const _0x1f21a3=readFileSync(_0x5ad413,_0x240852(0xe2));_0x16ee08=parseEnvFile(_0x1f21a3);}catch(_0x29aae8){console['warn']('Warning:\x20Failed\x20to\x20read\x20'+_0x5ad413+':',_0x29aae8);}const _0x14288a=_0x1158cb[_0x240852(0xfd)]()[_0x240852(0xc7)](/-/g,'_');_0x16ee08['TD_API_KEY_'+_0x14288a]=_0x75cf8f;const _0x382de6=Object[_0x240852(0xbf)](_0x16ee08)['map'](([_0x42a94e,_0x4e44dd])=>_0x42a94e+'='+_0x4e44dd);writeFileSync(_0x5ad413,_0x382de6['join']('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x46263e,_0x27ae15,_0x25905e){const _0xbcfcba=a58_0x535864;await saveKeychainAPIKey(_0x46263e,_0x25905e),setCachedCredential(_0x46263e,_0x27ae15,_0x25905e);const _0x2812c4=getConfigFilePath(_0x25905e);cleanupLegacyEnvFile(_0x2812c4)&&console[_0xbcfcba(0xf6)](a58_0x371643['yellow'](_0xbcfcba(0xbe)));}export function loadConfig(){const _0x39a0a0=a58_0x535864,_0x3df997={'apiKeys':{},'defaultSite':_0x39a0a0(0xe8)},_0x3649b4=[_0x39a0a0(0xe8),_0x39a0a0(0xd1),'eu01',_0x39a0a0(0xe4),'ap03','dev-us01','dev-eu01',_0x39a0a0(0xd9),_0x39a0a0(0xf8),'stg-ap03'],_0x406424=getAPIKey();if(_0x406424)for(const _0x361876 of _0x3649b4){_0x3df997[_0x39a0a0(0xed)][_0x361876]=_0x406424;}return _0x3df997;}export function isExperimentalAvailable(){return!!process.env.TDX_EXPERIMENTAL;}export function loadGlobalProxy(){const _0x4de1dd=a58_0x535864,_0x1f307f=a58_0x4b7b91[_0x4de1dd(0xe9)](getConfigDir(),_0x4de1dd(0xf2));if(!a58_0x3f76f9['existsSync'](_0x1f307f))return undefined;try{const _0x284dc2=a58_0x3f76f9[_0x4de1dd(0xc0)](_0x1f307f,_0x4de1dd(0xe2)),_0x4b7df8=JSON[_0x4de1dd(0xc2)](_0x284dc2);return typeof _0x4b7df8[_0x4de1dd(0xe7)]===_0x4de1dd(0xc5)?_0x4b7df8['proxy']:undefined;}catch{return undefined;}}export function loadReleaseChannel(){const _0x40ce7d=a58_0x535864,_0x32a69b=process.env.TDX_RELEASE_CHANNEL;if(_0x32a69b==='next'||_0x32a69b===_0x40ce7d(0xd0))return _0x32a69b;const _0x562335=a58_0x4b7b91['join'](getConfigDir(),_0x40ce7d(0xf2));if(!a58_0x3f76f9[_0x40ce7d(0xcc)](_0x562335))return _0x40ce7d(0xd0);try{const _0x4565ff=a58_0x3f76f9[_0x40ce7d(0xc0)](_0x562335,_0x40ce7d(0xe2)),_0x491eab=JSON[_0x40ce7d(0xc2)](_0x4565ff);if(_0x491eab[_0x40ce7d(0xda)]===_0x40ce7d(0xe1))return _0x40ce7d(0xe1);}catch{}return _0x40ce7d(0xd0);}export function saveReleaseChannel(_0x416536){const _0x3d0c2f=a58_0x535864,_0x584402=getConfigDir(),_0x90903b=a58_0x4b7b91[_0x3d0c2f(0xe9)](_0x584402,'tdx.json');!existsSync(_0x584402)&&mkdirSync(_0x584402,{'recursive':!![],'mode':0x1c0});let _0x59af79={};if(existsSync(_0x90903b))try{const _0x6aa777=readFileSync(_0x90903b,_0x3d0c2f(0xe2));_0x59af79=JSON[_0x3d0c2f(0xc2)](_0x6aa777);}catch{}_0x59af79['release_channel']=_0x416536,writeFileSync(_0x90903b,JSON[_0x3d0c2f(0xd3)](_0x59af79,null,0x2),{'mode':0x180});}
@@ -1 +1 @@
1
- const a59_0x25c027=a59_0x399e;(function(_0x429cc7,_0x108e9b){const _0x2f5845=a59_0x399e,_0x28c05e=_0x429cc7();while(!![]){try{const _0x1720f6=parseInt(_0x2f5845(0xf3))/0x1*(parseInt(_0x2f5845(0xf4))/0x2)+-parseInt(_0x2f5845(0xf1))/0x3+-parseInt(_0x2f5845(0xfb))/0x4*(-parseInt(_0x2f5845(0xf9))/0x5)+parseInt(_0x2f5845(0x100))/0x6*(-parseInt(_0x2f5845(0xf8))/0x7)+-parseInt(_0x2f5845(0xfc))/0x8*(parseInt(_0x2f5845(0xf7))/0x9)+-parseInt(_0x2f5845(0xf0))/0xa*(-parseInt(_0x2f5845(0xf6))/0xb)+parseInt(_0x2f5845(0xff))/0xc*(parseInt(_0x2f5845(0xf5))/0xd);if(_0x1720f6===_0x108e9b)break;else _0x28c05e['push'](_0x28c05e['shift']());}catch(_0x10a820){_0x28c05e['push'](_0x28c05e['shift']());}}}(a59_0x1e14,0x4c4bd));import{createProfileCache}from'../utils/global-cache.js';const connectionCache=createProfileCache(a59_0x25c027(0xfd),a59_0x25c027(0xfa));function a59_0x399e(_0x5e967b,_0x3204b3){_0x5e967b=_0x5e967b-0xf0;const _0x1e1493=a59_0x1e14();let _0x399e44=_0x1e1493[_0x5e967b];return _0x399e44;}export function loadCachedConnections(_0x366fee){const _0x6d2a3e=a59_0x25c027,_0x46c862=connectionCache[_0x6d2a3e(0xfe)](_0x366fee);return _0x46c862?.['connections']??null;}export function saveCachedConnections(_0x312019,_0x22f2a3){connectionCache['write'](_0x312019,{'connections':_0x22f2a3,'cachedAt':Date['now']()});}function a59_0x1e14(){const _0x400212=['1045eyHpnz','387OVkWLb','4473pDJLuE','2100515xXlRzJ','core/connection-cache','4YvoMpi','72328UVcvyc','connections-{profile}.json','read','24XmOmBZ','2502zIEFnG','3980mNxSfS','801930ojgdYV','clear','152zIusgI','4516Ldnxbc','2820454yOhlcp'];a59_0x1e14=function(){return _0x400212;};return a59_0x1e14();}export function clearConnectionCache(_0x48495f){const _0x48b637=a59_0x25c027;connectionCache[_0x48b637(0xf2)](_0x48495f);}
1
+ const a59_0x474fa4=a59_0x4b54;function a59_0x4b54(_0xada2f8,_0x221ce0){_0xada2f8=_0xada2f8-0x114;const _0x1d6919=a59_0x1d69();let _0x4b543e=_0x1d6919[_0xada2f8];return _0x4b543e;}(function(_0x26c63f,_0x2d44fe){const _0x126851=a59_0x4b54,_0x46d2af=_0x26c63f();while(!![]){try{const _0x50f014=-parseInt(_0x126851(0x11d))/0x1+-parseInt(_0x126851(0x119))/0x2+-parseInt(_0x126851(0x114))/0x3*(-parseInt(_0x126851(0x11c))/0x4)+parseInt(_0x126851(0x120))/0x5+-parseInt(_0x126851(0x11f))/0x6+parseInt(_0x126851(0x11e))/0x7*(-parseInt(_0x126851(0x11b))/0x8)+parseInt(_0x126851(0x11a))/0x9;if(_0x50f014===_0x2d44fe)break;else _0x46d2af['push'](_0x46d2af['shift']());}catch(_0x1369f7){_0x46d2af['push'](_0x46d2af['shift']());}}}(a59_0x1d69,0x2ec75));import{createProfileCache}from'../utils/global-cache.js';const connectionCache=createProfileCache(a59_0x474fa4(0x116),'core/connection-cache');export function loadCachedConnections(_0x1265af){const _0x59893a=a59_0x474fa4,_0xc06d5=connectionCache[_0x59893a(0x118)](_0x1265af);return _0xc06d5?.['connections']??null;}export function saveCachedConnections(_0x381f1d,_0x2b299a){const _0x6a26b4=a59_0x474fa4;connectionCache[_0x6a26b4(0x115)](_0x381f1d,{'connections':_0x2b299a,'cachedAt':Date[_0x6a26b4(0x117)]()});}function a59_0x1d69(){const _0x262551=['6329169JofpRp','2668336xQbJSo','1166908KWSLpE','243133XIRGhy','7KewRfT','349818CyBODc','621905ZjqJmn','clear','3djSlRJ','write','connections-{profile}.json','now','read','585532JxrIzp'];a59_0x1d69=function(){return _0x262551;};return a59_0x1d69();}export function clearConnectionCache(_0x45b061){const _0x44b96f=a59_0x474fa4;connectionCache[_0x44b96f(0x121)](_0x45b061);}
@@ -1 +1 @@
1
- const a60_0x3d90fe=a60_0xf16c;(function(_0x3e5f1d,_0x76d482){const _0x1614a7=a60_0xf16c,_0x16b8c6=_0x3e5f1d();while(!![]){try{const _0x1b7899=parseInt(_0x1614a7(0x10c))/0x1+-parseInt(_0x1614a7(0x10e))/0x2*(parseInt(_0x1614a7(0x117))/0x3)+parseInt(_0x1614a7(0x101))/0x4+-parseInt(_0x1614a7(0x107))/0x5*(parseInt(_0x1614a7(0x116))/0x6)+parseInt(_0x1614a7(0x100))/0x7+-parseInt(_0x1614a7(0xff))/0x8*(-parseInt(_0x1614a7(0x105))/0x9)+parseInt(_0x1614a7(0xfb))/0xa*(-parseInt(_0x1614a7(0x114))/0xb);if(_0x1b7899===_0x76d482)break;else _0x16b8c6['push'](_0x16b8c6['shift']());}catch(_0x1993e3){_0x16b8c6['push'](_0x16b8c6['shift']());}}}(a60_0x5da9,0x6b0f9));import a60_0x154fba from'prompts';export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x27e562,_0xf6b3c7){const _0x2f1074=a60_0xf16c;if(_0x27e562===undefined)return _0xf6b3c7;if(typeof _0x27e562===_0x2f1074(0x112))return _0x27e562;return parseInt(_0x27e562,0xa);}function a60_0xf16c(_0x504d1a,_0x90c381){_0x504d1a=_0x504d1a-0xfa;const _0x5da90e=a60_0x5da9();let _0xf16cc6=_0x5da90e[_0x504d1a];return _0xf16cc6;}export const STANDARD_SITE_CHOICES=[{'title':'us\x20\x20\x20-\x20United\x20States','value':a60_0x3d90fe(0x115)},{'title':a60_0x3d90fe(0x119),'value':a60_0x3d90fe(0x108)},{'title':a60_0x3d90fe(0x103),'value':a60_0x3d90fe(0x10d)},{'title':a60_0x3d90fe(0x113),'value':a60_0x3d90fe(0x110)}];function a60_0x5da9(){const _0x592b01=['616349jvQmIc','eu01','6320TNnPsg','text','ap02','Enter\x20site\x20name:','number','ap02\x20-\x20Korea','1223959ybqtzB','us01','12VyUzdc','360pRWhPI','push','jp\x20\x20\x20-\x20Japan','findIndex','40yPgcTf','site','log','trim','16yWxKMN','1089403sdqWiT','994796idrvoI','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','eu\x20\x20\x20-\x20Europe','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','1154673PAWUYR','Cancelled','36185OJFjiR','ap01','customSite','other','select'];a60_0x5da9=function(){return _0x592b01;};return a60_0x5da9();}export function buildSiteChoices(_0x15016f){const _0x33be6b=a60_0x3d90fe,_0x4e0489=[...STANDARD_SITE_CHOICES];let _0x301d08=_0x4e0489[_0x33be6b(0xfa)](_0x30824d=>_0x30824d['value']===_0x15016f);return _0x301d08===-0x1&&_0x15016f!==_0x33be6b(0x115)&&(_0x4e0489[_0x33be6b(0x118)]({'title':_0x15016f,'value':_0x15016f}),_0x301d08=_0x4e0489['length']-0x1),_0x4e0489[_0x33be6b(0x118)]({'title':'Enter\x20custom\x20site','value':_0x33be6b(0x10a)}),{'choices':_0x4e0489,'initialIndex':_0x301d08>=0x0?_0x301d08:0x0};}export async function promptSiteSelection(_0x2b32a3,_0x52332d,_0x1c72f2=a60_0x3d90fe(0x106)){const _0x2133f9=a60_0x3d90fe,{choices:_0x5f36ce,initialIndex:_0x48796f}=buildSiteChoices(_0x2b32a3),_0x3295d8=_0x52332d?_0x2133f9(0x104)+_0x52332d+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x17de80=await a60_0x154fba({'type':_0x2133f9(0x10b),'name':_0x2133f9(0xfc),'message':_0x3295d8,'choices':_0x5f36ce,'initial':_0x48796f});if(!_0x17de80['site'])return console[_0x2133f9(0xfd)]('\x0a'+_0x1c72f2),null;if(_0x17de80[_0x2133f9(0xfc)]!==_0x2133f9(0x10a))return _0x17de80['site'];const _0xb914fd=await a60_0x154fba({'type':_0x2133f9(0x10f),'name':_0x2133f9(0x109),'message':_0x2133f9(0x111),'initial':'us01','validate':_0x557419=>{const _0x464560=_0x2133f9;if(!_0x557419||!_0x557419[_0x464560(0xfe)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/['test'](_0x557419[_0x464560(0xfe)]()))return _0x464560(0x102);return!![];}});if(!_0xb914fd[_0x2133f9(0x109)])return console[_0x2133f9(0xfd)]('\x0a'+_0x1c72f2),null;return _0xb914fd[_0x2133f9(0x109)];}
1
+ const a60_0x4c4dac=a60_0x480a;(function(_0x5454e3,_0x19ee77){const _0x58f77c=a60_0x480a,_0x337f93=_0x5454e3();while(!![]){try{const _0x2915bc=-parseInt(_0x58f77c(0x76))/0x1*(parseInt(_0x58f77c(0x91))/0x2)+parseInt(_0x58f77c(0x88))/0x3*(-parseInt(_0x58f77c(0x8c))/0x4)+-parseInt(_0x58f77c(0x7a))/0x5*(-parseInt(_0x58f77c(0x85))/0x6)+parseInt(_0x58f77c(0x73))/0x7+-parseInt(_0x58f77c(0x94))/0x8*(parseInt(_0x58f77c(0x86))/0x9)+-parseInt(_0x58f77c(0x80))/0xa*(parseInt(_0x58f77c(0x74))/0xb)+parseInt(_0x58f77c(0x78))/0xc;if(_0x2915bc===_0x19ee77)break;else _0x337f93['push'](_0x337f93['shift']());}catch(_0x52b9da){_0x337f93['push'](_0x337f93['shift']());}}}(a60_0x1046,0xa40a7));function a60_0x480a(_0x396c05,_0x23b7cd){_0x396c05=_0x396c05-0x73;const _0x104640=a60_0x1046();let _0x480ac3=_0x104640[_0x396c05];return _0x480ac3;}import a60_0x4c0a10 from'prompts';export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;function a60_0x1046(){const _0x1c2268=['105ASkWXZ','Select\x20your\x20Treasure\x20Data\x20site:','eu01','value','trim','findIndex','40iMDHMa','text','ap02\x20-\x20Korea','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','ap01','15204oWVTDQ','9EerCnB','site','15030lwYCTr','jp\x20\x20\x20-\x20Japan','us\x20\x20\x20-\x20United\x20States','customSite','308fcsCHJ','Site\x20name\x20cannot\x20be\x20empty','ap02','log','other','53624ftKWbe','number','us01','3363504isrtTM','304150uvVgzS','1728903XhMsrw','select','41DHrLBy','length','37313268MXZFIz','push'];a60_0x1046=function(){return _0x1c2268;};return a60_0x1046();}export function resolveLimit(_0x2f2ee0,_0x432ae4){const _0x148c29=a60_0x480a;if(_0x2f2ee0===undefined)return _0x432ae4;if(typeof _0x2f2ee0===_0x148c29(0x92))return _0x2f2ee0;return parseInt(_0x2f2ee0,0xa);}export const STANDARD_SITE_CHOICES=[{'title':a60_0x4c4dac(0x8a),'value':'us01'},{'title':a60_0x4c4dac(0x89),'value':a60_0x4c4dac(0x84)},{'title':'eu\x20\x20\x20-\x20Europe','value':a60_0x4c4dac(0x7c)},{'title':a60_0x4c4dac(0x82),'value':a60_0x4c4dac(0x8e)}];export function buildSiteChoices(_0xb99e42){const _0x533e49=a60_0x4c4dac,_0x46411d=[...STANDARD_SITE_CHOICES];let _0x53fc0e=_0x46411d[_0x533e49(0x7f)](_0x4b545c=>_0x4b545c[_0x533e49(0x7d)]===_0xb99e42);return _0x53fc0e===-0x1&&_0xb99e42!==_0x533e49(0x93)&&(_0x46411d[_0x533e49(0x79)]({'title':_0xb99e42,'value':_0xb99e42}),_0x53fc0e=_0x46411d[_0x533e49(0x77)]-0x1),_0x46411d['push']({'title':'Enter\x20custom\x20site','value':_0x533e49(0x90)}),{'choices':_0x46411d,'initialIndex':_0x53fc0e>=0x0?_0x53fc0e:0x0};}export async function promptSiteSelection(_0x188937,_0x1f82ab,_0x6e5968='Cancelled'){const _0x2392a8=a60_0x4c4dac,{choices:_0xa120df,initialIndex:_0x2954a4}=buildSiteChoices(_0x188937),_0x5667b0=_0x1f82ab?_0x2392a8(0x83)+_0x1f82ab+'):':_0x2392a8(0x7b),_0x31f4d8=await a60_0x4c0a10({'type':_0x2392a8(0x75),'name':'site','message':_0x5667b0,'choices':_0xa120df,'initial':_0x2954a4});if(!_0x31f4d8[_0x2392a8(0x87)])return console['log']('\x0a'+_0x6e5968),null;if(_0x31f4d8[_0x2392a8(0x87)]!==_0x2392a8(0x90))return _0x31f4d8[_0x2392a8(0x87)];const _0x5f2006=await a60_0x4c0a10({'type':_0x2392a8(0x81),'name':_0x2392a8(0x8b),'message':'Enter\x20site\x20name:','initial':_0x2392a8(0x93),'validate':_0x53f931=>{const _0x28ca92=_0x2392a8;if(!_0x53f931||!_0x53f931['trim']())return _0x28ca92(0x8d);if(!/^[a-z0-9-]+$/['test'](_0x53f931[_0x28ca92(0x7e)]()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x5f2006[_0x2392a8(0x8b)])return console[_0x2392a8(0x8f)]('\x0a'+_0x6e5968),null;return _0x5f2006['customSite'];}
@@ -1 +1 @@
1
- (function(_0x234b2a,_0x335ab6){const _0x15f2a8=a61_0x5d86,_0x2cf9e4=_0x234b2a();while(!![]){try{const _0x350f9a=-parseInt(_0x15f2a8(0xa3))/0x1*(-parseInt(_0x15f2a8(0xaa))/0x2)+-parseInt(_0x15f2a8(0xb1))/0x3*(-parseInt(_0x15f2a8(0xab))/0x4)+-parseInt(_0x15f2a8(0xb3))/0x5+-parseInt(_0x15f2a8(0xa7))/0x6*(parseInt(_0x15f2a8(0xb4))/0x7)+-parseInt(_0x15f2a8(0xa9))/0x8+-parseInt(_0x15f2a8(0xa6))/0x9+-parseInt(_0x15f2a8(0xa8))/0xa*(-parseInt(_0x15f2a8(0xb0))/0xb);if(_0x350f9a===_0x335ab6)break;else _0x2cf9e4['push'](_0x2cf9e4['shift']());}catch(_0x4538e2){_0x2cf9e4['push'](_0x2cf9e4['shift']());}}}(a61_0x394c,0xac30e));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x3a03b6,_0x280ec7){const _0x1ec78e=a61_0x5d86,_0x139120=_0x3a03b6||_0x1ec78e(0xae),_0x37c370=_0x280ec7||_0x1ec78e(0xac);return _0x139120+':'+_0x37c370;}export function getCachedCredential(_0x22792f,_0xc4dad0){const _0x1f5bdb=a61_0x5d86,_0x3db225=getCacheKey(_0x22792f,_0xc4dad0),_0x1838bd=cache[_0x1f5bdb(0xb2)](_0x3db225);if(!_0x1838bd)return null;if(Date['now']()-_0x1838bd[_0x1f5bdb(0xa5)]>CACHE_TTL_MS)return cache[_0x1f5bdb(0xaf)](_0x3db225),null;return _0x1838bd[_0x1f5bdb(0xa2)];}export function setCachedCredential(_0x2df3d3,_0x48a249,_0x1cf803){const _0x560f68=a61_0x5d86,_0x115111=getCacheKey(_0x48a249,_0x1cf803);cache['set'](_0x115111,{'apiKey':_0x2df3d3,'loadedAt':Date[_0x560f68(0xa4)]()});}function a61_0x5d86(_0x19b20a,_0x2dbeed){_0x19b20a=_0x19b20a-0xa2;const _0x394c35=a61_0x394c();let _0x5d86ce=_0x394c35[_0x19b20a];return _0x5d86ce;}function a61_0x394c(){const _0x2c0e3f=['get','4723120Gkjzjv','56mwGiJS','apiKey','22109kIzNeZ','now','loadedAt','5495526pJRJCE','282912IOAPOD','25742630iwyBdM','8552560LUBVWL','94ljcXzH','1632MWsSHp','__default_profile__','clear','__default_site__','delete','11IGbYxi','687CFDomS'];a61_0x394c=function(){return _0x2c0e3f;};return a61_0x394c();}export function clearCredentialCache(){const _0x1b7bea=a61_0x5d86;cache[_0x1b7bea(0xad)]();}export function clearCachedCredential(_0x106cf2,_0x5475c6){const _0x2ce913=getCacheKey(_0x106cf2,_0x5475c6);cache['delete'](_0x2ce913);}
1
+ function a61_0xc853(){const _0x46321b=['now','get','647999gBJHZO','1676uxUEom','set','590LUEJER','delete','__default_site__','1IyggwZ','3079014ULIRWK','11835171aLyGYc','clear','3407726RSdxau','__default_profile__','4328472VsZHBk','8WilTMs','8590FeuwCY','apiKey','9672594ObBUsr'];a61_0xc853=function(){return _0x46321b;};return a61_0xc853();}(function(_0x5d7503,_0x1aaa04){const _0x19592f=a61_0x3960,_0x4c74ae=_0x5d7503();while(!![]){try{const _0x4ad26e=parseInt(_0x19592f(0x7d))/0x1*(parseInt(_0x19592f(0x7e))/0x2)+-parseInt(_0x19592f(0x83))/0x3+parseInt(_0x19592f(0x78))/0x4*(parseInt(_0x19592f(0x72))/0x5)+-parseInt(_0x19592f(0x74))/0x6+-parseInt(_0x19592f(0x81))/0x7+-parseInt(_0x19592f(0x84))/0x8*(parseInt(_0x19592f(0x7f))/0x9)+-parseInt(_0x19592f(0x7a))/0xa*(-parseInt(_0x19592f(0x77))/0xb);if(_0x4ad26e===_0x1aaa04)break;else _0x4c74ae['push'](_0x4c74ae['shift']());}catch(_0x483d7d){_0x4c74ae['push'](_0x4c74ae['shift']());}}}(a61_0xc853,0xd668c));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x5566ea,_0x582cdb){const _0x302ae6=a61_0x3960,_0x17a7d4=_0x5566ea||_0x302ae6(0x7c),_0x584c9a=_0x582cdb||_0x302ae6(0x82);return _0x17a7d4+':'+_0x584c9a;}export function getCachedCredential(_0x46bc66,_0x3b65cb){const _0x59beec=a61_0x3960,_0x5085d8=getCacheKey(_0x46bc66,_0x3b65cb),_0x34f682=cache[_0x59beec(0x76)](_0x5085d8);if(!_0x34f682)return null;if(Date[_0x59beec(0x75)]()-_0x34f682['loadedAt']>CACHE_TTL_MS)return cache[_0x59beec(0x7b)](_0x5085d8),null;return _0x34f682[_0x59beec(0x73)];}export function setCachedCredential(_0x49d8ae,_0x3520a5,_0xe3942b){const _0x59ac59=a61_0x3960,_0x2038bf=getCacheKey(_0x3520a5,_0xe3942b);cache[_0x59ac59(0x79)](_0x2038bf,{'apiKey':_0x49d8ae,'loadedAt':Date[_0x59ac59(0x75)]()});}function a61_0x3960(_0x4a1229,_0x5993e9){_0x4a1229=_0x4a1229-0x72;const _0xc853d4=a61_0xc853();let _0x39602e=_0xc853d4[_0x4a1229];return _0x39602e;}export function clearCredentialCache(){const _0x2dc0ff=a61_0x3960;cache[_0x2dc0ff(0x80)]();}export function clearCachedCredential(_0x3ee5ee,_0xb13558){const _0x5ca982=getCacheKey(_0x3ee5ee,_0xb13558);cache['delete'](_0x5ca982);}
@@ -1 +1 @@
1
- const a62_0x8a67b6=a62_0x20c7;(function(_0x2a107f,_0x2e9e02){const _0x481bbc=a62_0x20c7,_0x364a98=_0x2a107f();while(!![]){try{const _0x3ba9ca=-parseInt(_0x481bbc(0x12f))/0x1+parseInt(_0x481bbc(0xfb))/0x2*(parseInt(_0x481bbc(0x10e))/0x3)+-parseInt(_0x481bbc(0xf4))/0x4*(-parseInt(_0x481bbc(0x13e))/0x5)+-parseInt(_0x481bbc(0xf6))/0x6*(parseInt(_0x481bbc(0x131))/0x7)+-parseInt(_0x481bbc(0x138))/0x8+-parseInt(_0x481bbc(0x103))/0x9*(-parseInt(_0x481bbc(0x111))/0xa)+parseInt(_0x481bbc(0x114))/0xb*(parseInt(_0x481bbc(0x11b))/0xc);if(_0x3ba9ca===_0x2e9e02)break;else _0x364a98['push'](_0x364a98['shift']());}catch(_0x4fb081){_0x364a98['push'](_0x364a98['shift']());}}}(a62_0x5083,0x9fe78));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';function a62_0x20c7(_0x3c3689,_0x492d5a){_0x3c3689=_0x3c3689-0xee;const _0x508316=a62_0x5083();let _0x20c77e=_0x508316[_0x3c3689];return _0x20c77e;}import{LogLevel}from'../utils/logger/index.js';function a62_0x5083(){const _0x20b7b2=['workflow_project','Profile','profileCredentials','layers','profileSource','3cESLlD','proxy','Project','20pDWrTI','getSource','llm_project','407nxaMiE','llmProject','resolveAPIKeyAsync','Profile\x20Credentials','profile','parent_segment','[configuration\x20files]','403296LubHrV','workflowProject','project','cliFlags','Session','session','entries','activeProfile','Global\x20Credentials','parentSegment','utf-8','green','site','.env','bold','default','existsSync','Global','display','loadGlobalConfig','1132078bZEBoa','readFileSync','126ZOnTSi','configFiles','(session:\x20','llm_agent','string','[context]','cyan','2008200WgUsAB','createAsync','cli','us01','env','database','85zSMUGH','assign','join','INFO','CLI\x20flag:\x20--','not\x20set','verbose','tdx.json','global','parse','191972WZHHJv','sessionId','119994typFsp','profiles','globalCredentials','access_token','segmentPath','70496aZscon','(using\x20session:\x20','log','composableAudience','segment_path','accessToken','apiKey','logLevel','1365426qSpLYg','dim','config','getParameters','llmAgent','composable_audience'];a62_0x5083=function(){return _0x20b7b2;};return a62_0x5083();}import*as a62_0x1ac377 from'node:fs';import*as a62_0x1f9f15 from'node:path';import a62_0x1e9b53 from'chalk';export class GlobalContext{[a62_0x8a67b6(0x127)];[a62_0x8a67b6(0x13d)];[a62_0x8a67b6(0x119)];[a62_0x8a67b6(0xff)];[a62_0x8a67b6(0x113)];['llm_agent'];['workflow_project'];['composable_audience'];[a62_0x8a67b6(0x101)];[a62_0x8a67b6(0x100)];[a62_0x8a67b6(0x10f)];['verbose'];[a62_0x8a67b6(0x102)];['profile'];[a62_0x8a67b6(0x10d)]=null;[a62_0x8a67b6(0x10c)];[a62_0x8a67b6(0x122)];[a62_0x8a67b6(0xf5)];[a62_0x8a67b6(0x132)];constructor(_0x562628){const _0x31b19c=a62_0x8a67b6;this[_0x31b19c(0xf5)]=getSessionID(_0x562628[_0x31b19c(0x120)]);const _0x4f0371=loadSessionContext(_0x562628[_0x31b19c(0x120)]),_0x3f222e=loadProjectConfig(),_0x4475df=this[_0x31b19c(0x12e)]();if(_0x562628['profile'])this[_0x31b19c(0x122)]=_0x562628['profile'],this[_0x31b19c(0x10d)]=_0x31b19c(0x13a);else{if(_0x4f0371?.[_0x31b19c(0x118)])this['activeProfile']=_0x4f0371['profile'],this[_0x31b19c(0x10d)]=_0x31b19c(0x120);else{if(_0x4475df[_0x31b19c(0x118)])this[_0x31b19c(0x122)]=_0x4475df[_0x31b19c(0x118)],this['profileSource']=_0x31b19c(0x105);else process.env.TDX_PROFILE?(this['activeProfile']=process.env.TDX_PROFILE,this[_0x31b19c(0x10d)]=_0x31b19c(0x13c)):(this[_0x31b19c(0x122)]=null,this['profileSource']=null);}}const _0x573d71=this['activeProfile']?loadProfile(this['activeProfile']):null,_0x2b52e9=_0x562246=>{const _0x6fca4d=_0x31b19c;if(!_0x562246)return{};const _0x24f1ae=_0x562246,_0x29b787={};for(const [_0x2e8796,_0x5571c8]of Object[_0x6fca4d(0x121)](_0x24f1ae)){typeof _0x5571c8==='string'&&(_0x29b787[_0x2e8796]=_0x5571c8);}return _0x29b787;},_0x4c861b={},_0xd0d1ac=(_0x50486c,_0x20d4ca,_0x1d56e9)=>{const _0x3f9b3c=_0x31b19c;if(!_0x50486c)return![];if(_0x1d56e9&&_0x50486c===_0x1d56e9)return![];const _0x3db1bc=_0x4f0371,_0x28c333=_0x3f222e,_0xf5c71d=_0x573d71?.[_0x3f9b3c(0x105)],_0x36297d=_0x4475df,_0x4f6dc9=_0x3db1bc?.[_0x20d4ca],_0x6a329d=_0x28c333?.[_0x20d4ca],_0x302513=_0xf5c71d?.[_0x20d4ca],_0x32dae5=_0x36297d[_0x20d4ca];return _0x50486c!==_0x4f6dc9&&_0x50486c!==_0x6a329d&&_0x50486c!==_0x302513&&_0x50486c!==_0x32dae5;},_0x3cd103=[{'optionKey':'site','contextKey':'site','defaultValue':_0x31b19c(0x13b)},{'optionKey':_0x31b19c(0x13d),'contextKey':_0x31b19c(0x13d)},{'optionKey':'parentSegment','contextKey':_0x31b19c(0x119)},{'optionKey':_0x31b19c(0x115),'contextKey':_0x31b19c(0x113)},{'optionKey':_0x31b19c(0x107),'contextKey':_0x31b19c(0x134)},{'optionKey':'composableAudience','contextKey':_0x31b19c(0x108)},{'optionKey':'profile','contextKey':'profile'}];for(const {optionKey:_0x1ef2aa,contextKey:_0x5e1e14,defaultValue:_0x9815fd}of _0x3cd103){const _0x21ab9e=_0x562628[_0x1ef2aa];_0xd0d1ac(_0x21ab9e,_0x5e1e14,_0x9815fd)&&(_0x4c861b[_0x5e1e14]=_0x21ab9e);}this['layers']={'cliFlags':_0x4c861b,'session':_0x2b52e9(_0x4f0371),'project':_0x2b52e9(_0x3f222e),'profile':_0x2b52e9(_0x573d71?.['config']),'global':_0x2b52e9(_0x4475df)};const _0x12896a={...this['layers'][_0x31b19c(0xf2)],...this[_0x31b19c(0x10c)][_0x31b19c(0x118)],...this[_0x31b19c(0x10c)][_0x31b19c(0x11d)]};process.env.TDX_SITE&&!this[_0x31b19c(0x10c)][_0x31b19c(0x120)][_0x31b19c(0x127)]&&!this['layers'][_0x31b19c(0x11e)][_0x31b19c(0x127)]&&(_0x12896a[_0x31b19c(0x127)]=process.env.TDX_SITE);Object[_0x31b19c(0x13f)](_0x12896a,this[_0x31b19c(0x10c)]['session']),Object[_0x31b19c(0x13f)](_0x12896a,this['layers'][_0x31b19c(0x11e)]);const _0x481330=_0x12896a[_0x31b19c(0x127)]||'us01';this[_0x31b19c(0x127)]=resolveSite(_0x481330),this[_0x31b19c(0x13d)]=_0x12896a[_0x31b19c(0x13d)],this[_0x31b19c(0x119)]=_0x12896a[_0x31b19c(0x119)],this[_0x31b19c(0xff)]=_0x12896a[_0x31b19c(0xff)],this['llm_project']=_0x12896a[_0x31b19c(0x113)],this[_0x31b19c(0x134)]=_0x12896a[_0x31b19c(0x134)],this['workflow_project']=_0x12896a[_0x31b19c(0x109)],this[_0x31b19c(0x108)]=_0x12896a['composable_audience'],this['verbose']=_0x562628[_0x31b19c(0xf0)]||![],this['logLevel']=_0x562628['logLevel']??LogLevel[_0x31b19c(0x141)],this[_0x31b19c(0x118)]=this[_0x31b19c(0x122)]||undefined,this[_0x31b19c(0x100)]=getAccessToken(this[_0x31b19c(0x122)]||undefined),this['apiKey']=getAPIKey(this[_0x31b19c(0x122)]||undefined);const _0x4fff00=typeof _0x4475df[_0x31b19c(0x10f)]===_0x31b19c(0x135)?_0x4475df[_0x31b19c(0x10f)]:undefined;this[_0x31b19c(0x10f)]=_0x4fff00||process.env.HTTPS_PROXY||process.env.HTTP_PROXY;const _0x2c0c61=getConfigDir(),_0x3c6374=a62_0x1f9f15[_0x31b19c(0x140)](_0x2c0c61,'sessions',this[_0x31b19c(0xf5)]+'.json'),_0x57ecc7=findProjectConfigPath(),_0x374041=a62_0x1f9f15[_0x31b19c(0x140)](_0x2c0c61,_0x31b19c(0xf1)),_0x33254d=a62_0x1f9f15[_0x31b19c(0x140)](_0x2c0c61,_0x31b19c(0x128));let _0xec3ba4=null,_0x3a2ced=null;this[_0x31b19c(0x122)]&&(_0xec3ba4=a62_0x1f9f15['join'](_0x2c0c61,_0x31b19c(0xf7),this[_0x31b19c(0x122)],_0x31b19c(0xf1)),_0x3a2ced=a62_0x1f9f15['join'](_0x2c0c61,_0x31b19c(0xf7),this['activeProfile'],_0x31b19c(0x128))),this['configFiles']={'session':a62_0x1ac377[_0x31b19c(0x12b)](_0x3c6374)?_0x3c6374:null,'project':_0x57ecc7,'profile':_0xec3ba4&&a62_0x1ac377['existsSync'](_0xec3ba4)?_0xec3ba4:null,'profileCredentials':_0x3a2ced&&a62_0x1ac377[_0x31b19c(0x12b)](_0x3a2ced)?_0x3a2ced:null,'global':a62_0x1ac377['existsSync'](_0x374041)?_0x374041:null,'globalCredentials':a62_0x1ac377['existsSync'](_0x33254d)?_0x33254d:null};}[a62_0x8a67b6(0x112)](_0x578042,_0x291416){const _0x502ebe=a62_0x8a67b6;if(!_0x291416)return _0x502ebe(0xef);const _0x5426c3=_0x291416;if(this[_0x502ebe(0x10c)][_0x502ebe(0x11e)][_0x578042]===_0x5426c3){if(_0x578042===_0x502ebe(0x127)&&_0x5426c3===_0x502ebe(0x13b)&&!this[_0x502ebe(0x10c)]['session']['site']&&!this[_0x502ebe(0x10c)][_0x502ebe(0x11d)][_0x502ebe(0x127)]&&!this[_0x502ebe(0x10c)][_0x502ebe(0x118)][_0x502ebe(0x127)]&&!this[_0x502ebe(0x10c)][_0x502ebe(0xf2)]['site'])return _0x502ebe(0x12a);return _0x502ebe(0xee)+_0x578042['replace'](/_/g,'-');}if(this['layers']['session'][_0x578042]===_0x5426c3)return _0x502ebe(0x120);if(this['layers'][_0x502ebe(0x11d)][_0x578042]===_0x5426c3)return _0x502ebe(0x11d);if(this[_0x502ebe(0x10c)][_0x502ebe(0x118)][_0x578042]===_0x5426c3)return'profile:\x20'+this[_0x502ebe(0x122)];if(this[_0x502ebe(0x10c)][_0x502ebe(0xf2)][_0x578042]===_0x5426c3)return _0x502ebe(0xf2);return _0x502ebe(0x12a);}[a62_0x8a67b6(0x12e)](){const _0x12d91c=a62_0x8a67b6,_0x495fe0=a62_0x1f9f15[_0x12d91c(0x140)](getConfigDir(),_0x12d91c(0xf1));if(!a62_0x1ac377[_0x12d91c(0x12b)](_0x495fe0))return{};try{const _0x234423=a62_0x1ac377[_0x12d91c(0x130)](_0x495fe0,_0x12d91c(0x125));return JSON[_0x12d91c(0xf3)](_0x234423);}catch{return{};}}['injectIntoOptions'](_0xb452a8){const _0x258d72=a62_0x8a67b6;_0xb452a8[_0x258d72(0x127)]=this[_0x258d72(0x127)],!_0xb452a8[_0x258d72(0x13d)]&&this[_0x258d72(0x13d)]&&(_0xb452a8[_0x258d72(0x13d)]=this[_0x258d72(0x13d)]),!_0xb452a8[_0x258d72(0x124)]&&this['parent_segment']&&(_0xb452a8[_0x258d72(0x124)]=this[_0x258d72(0x119)]),!_0xb452a8['segmentPath']&&this['segment_path']&&(_0xb452a8[_0x258d72(0xfa)]=this[_0x258d72(0xff)]),!_0xb452a8[_0x258d72(0x115)]&&this[_0x258d72(0x113)]&&(_0xb452a8[_0x258d72(0x115)]=this[_0x258d72(0x113)]),!_0xb452a8[_0x258d72(0x107)]&&this[_0x258d72(0x134)]&&(_0xb452a8[_0x258d72(0x107)]=this[_0x258d72(0x134)]),!_0xb452a8['workflowProject']&&this[_0x258d72(0x109)]&&(_0xb452a8[_0x258d72(0x11c)]=this[_0x258d72(0x109)]),!_0xb452a8[_0x258d72(0xfe)]&&this['composable_audience']&&(_0xb452a8[_0x258d72(0xfe)]=this[_0x258d72(0x108)]);}[a62_0x8a67b6(0x106)](){const _0x4cf024=a62_0x8a67b6;return[{'key':'site','value':this[_0x4cf024(0x127)]},{'key':'database','value':this[_0x4cf024(0x13d)]},{'key':_0x4cf024(0x119),'value':this['parent_segment']},{'key':'segment_path','value':this['segment_path']},{'key':_0x4cf024(0x113),'value':this[_0x4cf024(0x113)]},{'key':'llm_agent','value':this['llm_agent']},{'key':_0x4cf024(0x109),'value':this['workflow_project']},{'key':_0x4cf024(0x108),'value':this[_0x4cf024(0x108)]},{'key':'profile','value':this[_0x4cf024(0x122)]||undefined}];}[a62_0x8a67b6(0x12d)](){const _0x4d0ed3=a62_0x8a67b6;console[_0x4d0ed3(0xfd)](a62_0x1e9b53[_0x4d0ed3(0x129)]('[context]'));for(const {key:_0x2167af,value:_0x3bcd0d}of this[_0x4d0ed3(0x106)]()){_0x3bcd0d&&console[_0x4d0ed3(0xfd)](a62_0x1e9b53[_0x4d0ed3(0x137)](_0x2167af)+':\x20'+_0x3bcd0d);}}['displayWithSources'](){const _0x5b8e22=a62_0x8a67b6;console[_0x5b8e22(0xfd)](a62_0x1e9b53[_0x5b8e22(0x129)](_0x5b8e22(0x136)));for(const {key:_0x385da6,value:_0x3cb492}of this[_0x5b8e22(0x106)]()){if(_0x3cb492){const _0x242e4a=_0x385da6===_0x5b8e22(0x118)?'(active)':'('+this[_0x5b8e22(0x112)](_0x385da6,_0x3cb492)+')';console[_0x5b8e22(0xfd)](a62_0x1e9b53['cyan'](_0x385da6)+':\x20'+_0x3cb492+'\x20'+a62_0x1e9b53[_0x5b8e22(0x104)](_0x242e4a));}}console['log']('\x0a'+a62_0x1e9b53['bold'](_0x5b8e22(0x11a)));const _0x40bfde=[{'label':_0x5b8e22(0x11f),'path':this[_0x5b8e22(0x132)][_0x5b8e22(0x120)],'extra':_0x5b8e22(0x133)+this[_0x5b8e22(0xf5)]+')'},{'label':'Project','path':this[_0x5b8e22(0x132)][_0x5b8e22(0x11d)]},{'label':_0x5b8e22(0x10a),'path':this[_0x5b8e22(0x132)][_0x5b8e22(0x118)]},{'label':_0x5b8e22(0x117),'path':this[_0x5b8e22(0x132)][_0x5b8e22(0x10b)]},{'label':_0x5b8e22(0x12c),'path':this[_0x5b8e22(0x132)]['global']},{'label':_0x5b8e22(0x123),'path':this[_0x5b8e22(0x132)][_0x5b8e22(0xf8)]}];for(const {label:_0x3e354b,path:_0x2c7674,extra:_0x12a81c}of _0x40bfde){if(_0x2c7674)console['log'](a62_0x1e9b53[_0x5b8e22(0x137)](_0x3e354b)+':\x20'+_0x2c7674+'\x20'+a62_0x1e9b53[_0x5b8e22(0x126)]('✓')+(_0x12a81c?'\x20'+a62_0x1e9b53[_0x5b8e22(0x104)](_0x12a81c):''));else{if(_0x3e354b===_0x5b8e22(0x11f))console[_0x5b8e22(0xfd)](a62_0x1e9b53['cyan'](_0x3e354b)+':\x20'+a62_0x1e9b53[_0x5b8e22(0x104)]('none')+'\x20'+a62_0x1e9b53['dim'](_0x5b8e22(0xfc)+this[_0x5b8e22(0xf5)]+')'));else(_0x3e354b===_0x5b8e22(0x110)||_0x3e354b==='Global')&&console[_0x5b8e22(0xfd)](a62_0x1e9b53[_0x5b8e22(0x137)](_0x3e354b)+':\x20'+a62_0x1e9b53[_0x5b8e22(0x104)]('none'));}}}async[a62_0x8a67b6(0x116)](){const _0x536e82=a62_0x8a67b6;if(!this[_0x536e82(0x100)]){const _0x1c9f65=await getOAuthTokens(this[_0x536e82(0x122)]||undefined);if(_0x1c9f65)return this['accessToken']=_0x1c9f65[_0x536e82(0xf9)],undefined;}return this['apiKey']=await getAPIKeyAsync(this[_0x536e82(0x127)],this[_0x536e82(0x122)]||undefined),this[_0x536e82(0x101)];}static async[a62_0x8a67b6(0x139)](_0x3e01f5){const _0x1617fb=a62_0x8a67b6,_0x2422cf=new GlobalContext(_0x3e01f5);return await _0x2422cf[_0x1617fb(0x116)](),_0x2422cf;}}
1
+ const a62_0x10f951=a62_0x1b04;(function(_0x569e60,_0x333f65){const _0x833bf8=a62_0x1b04,_0x5d6467=_0x569e60();while(!![]){try{const _0x2b2df0=-parseInt(_0x833bf8(0xf3))/0x1*(-parseInt(_0x833bf8(0xfb))/0x2)+-parseInt(_0x833bf8(0xcc))/0x3+parseInt(_0x833bf8(0xc8))/0x4+-parseInt(_0x833bf8(0xf1))/0x5*(parseInt(_0x833bf8(0x106))/0x6)+-parseInt(_0x833bf8(0xdf))/0x7*(parseInt(_0x833bf8(0xc0))/0x8)+parseInt(_0x833bf8(0x10a))/0x9*(-parseInt(_0x833bf8(0xd8))/0xa)+parseInt(_0x833bf8(0xbe))/0xb;if(_0x2b2df0===_0x333f65)break;else _0x5d6467['push'](_0x5d6467['shift']());}catch(_0x5c7b70){_0x5d6467['push'](_0x5d6467['shift']());}}}(a62_0x45c7,0x476c3));import{resolveSite,getAPIKey,getAccessToken,getAPIKeyAsync,getConfigDir}from'./config.js';import{getOAuthTokens}from'./oauth-keychain.js';import{loadSessionContext,getSessionID}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';function a62_0x45c7(){const _0x4d326c=['profile:\x20','getParameters','[context]','workflowProject','configFiles','102970LxvZsM','resolveAPIKeyAsync','6114EiNwkC','dim','site','cliFlags','verbose','Project','parent_segment','getSource','82RznBAb','(using\x20session:\x20','Profile\x20Credentials','(active)','loadGlobalConfig','createAsync','.json','config','apiKey','layers','bold','150vBMkqK','llm_agent','parentSegment','global','609183NqlezM','llmAgent','string','activeProfile','profile','sessionId','us01','none','segment_path','7121609VsmOjC','accessToken','8eifQLw','llm_project','access_token','composableAudience','project','parse','database','tdx.json','2328160HdlzmB','entries','Profile','injectIntoOptions','550494APEYQN','profiles','utf-8','displayWithSources','existsSync','cli','proxy','profileSource','(session:\x20','llmProject','display','session','30VZUPNe','env','cyan','segmentPath','profileCredentials','log','[configuration\x20files]','2003239FKHUAI','composable_audience','globalCredentials','.env','replace','join','green','assign','logLevel','Session','sessions','default','workflow_project'];a62_0x45c7=function(){return _0x4d326c;};return a62_0x45c7();}import{loadProfile}from'./profile.js';import{LogLevel}from'../utils/logger/index.js';import*as a62_0x11cde9 from'node:fs';import*as a62_0x53177c from'node:path';import a62_0x24cc9a from'chalk';function a62_0x1b04(_0x46bd55,_0x5e0e09){_0x46bd55=_0x46bd55-0xb6;const _0x45c700=a62_0x45c7();let _0x1b0422=_0x45c700[_0x46bd55];return _0x1b0422;}export class GlobalContext{[a62_0x10f951(0xf5)];['database'];[a62_0x10f951(0xf9)];[a62_0x10f951(0xbd)];[a62_0x10f951(0xc1)];[a62_0x10f951(0x107)];[a62_0x10f951(0xeb)];[a62_0x10f951(0xe0)];[a62_0x10f951(0x103)];[a62_0x10f951(0xbf)];[a62_0x10f951(0xd2)];[a62_0x10f951(0xf7)];['logLevel'];[a62_0x10f951(0xb9)];[a62_0x10f951(0xd3)]=null;[a62_0x10f951(0x104)];[a62_0x10f951(0xb8)];[a62_0x10f951(0xba)];['configFiles'];constructor(_0x65473b){const _0x15f8b2=a62_0x10f951;this[_0x15f8b2(0xba)]=getSessionID(_0x65473b[_0x15f8b2(0xd7)]);const _0x5c33a0=loadSessionContext(_0x65473b[_0x15f8b2(0xd7)]),_0x3143fe=loadProjectConfig(),_0x5d95b9=this[_0x15f8b2(0xff)]();if(_0x65473b['profile'])this[_0x15f8b2(0xb8)]=_0x65473b[_0x15f8b2(0xb9)],this[_0x15f8b2(0xd3)]=_0x15f8b2(0xd1);else{if(_0x5c33a0?.['profile'])this[_0x15f8b2(0xb8)]=_0x5c33a0[_0x15f8b2(0xb9)],this[_0x15f8b2(0xd3)]=_0x15f8b2(0xd7);else{if(_0x5d95b9[_0x15f8b2(0xb9)])this['activeProfile']=_0x5d95b9['profile'],this[_0x15f8b2(0xd3)]=_0x15f8b2(0x102);else process.env.TDX_PROFILE?(this['activeProfile']=process.env.TDX_PROFILE,this[_0x15f8b2(0xd3)]=_0x15f8b2(0xd9)):(this['activeProfile']=null,this['profileSource']=null);}}const _0x1a6aab=this['activeProfile']?loadProfile(this['activeProfile']):null,_0xa3840a=_0x141d15=>{const _0xf28a32=_0x15f8b2;if(!_0x141d15)return{};const _0x387b37=_0x141d15,_0x2e8d8a={};for(const [_0x35f9b2,_0x5d6338]of Object[_0xf28a32(0xc9)](_0x387b37)){typeof _0x5d6338==='string'&&(_0x2e8d8a[_0x35f9b2]=_0x5d6338);}return _0x2e8d8a;},_0x47e2b2={},_0x512e8f=(_0x58b71a,_0x41749d,_0x4ae8ea)=>{if(!_0x58b71a)return![];if(_0x4ae8ea&&_0x58b71a===_0x4ae8ea)return![];const _0x45ed1f=_0x5c33a0,_0x245914=_0x3143fe,_0x3a3979=_0x1a6aab?.['config'],_0x1552e0=_0x5d95b9,_0xa5935=_0x45ed1f?.[_0x41749d],_0x197b33=_0x245914?.[_0x41749d],_0x5c3a58=_0x3a3979?.[_0x41749d],_0x16441e=_0x1552e0[_0x41749d];return _0x58b71a!==_0xa5935&&_0x58b71a!==_0x197b33&&_0x58b71a!==_0x5c3a58&&_0x58b71a!==_0x16441e;},_0x559fb6=[{'optionKey':'site','contextKey':'site','defaultValue':_0x15f8b2(0xbb)},{'optionKey':_0x15f8b2(0xc6),'contextKey':'database'},{'optionKey':'parentSegment','contextKey':_0x15f8b2(0xf9)},{'optionKey':_0x15f8b2(0xd5),'contextKey':'llm_project'},{'optionKey':_0x15f8b2(0xb6),'contextKey':_0x15f8b2(0x107)},{'optionKey':_0x15f8b2(0xc3),'contextKey':_0x15f8b2(0xe0)},{'optionKey':_0x15f8b2(0xb9),'contextKey':'profile'}];for(const {optionKey:_0x2ef106,contextKey:_0x500867,defaultValue:_0x390ef7}of _0x559fb6){const _0x3c4acd=_0x65473b[_0x2ef106];_0x512e8f(_0x3c4acd,_0x500867,_0x390ef7)&&(_0x47e2b2[_0x500867]=_0x3c4acd);}this['layers']={'cliFlags':_0x47e2b2,'session':_0xa3840a(_0x5c33a0),'project':_0xa3840a(_0x3143fe),'profile':_0xa3840a(_0x1a6aab?.[_0x15f8b2(0x102)]),'global':_0xa3840a(_0x5d95b9)};const _0x5b17c5={...this['layers']['global'],...this[_0x15f8b2(0x104)][_0x15f8b2(0xb9)],...this[_0x15f8b2(0x104)][_0x15f8b2(0xc4)]};process.env.TDX_SITE&&!this[_0x15f8b2(0x104)][_0x15f8b2(0xd7)][_0x15f8b2(0xf5)]&&!this[_0x15f8b2(0x104)][_0x15f8b2(0xf6)]['site']&&(_0x5b17c5[_0x15f8b2(0xf5)]=process.env.TDX_SITE);Object[_0x15f8b2(0xe6)](_0x5b17c5,this[_0x15f8b2(0x104)][_0x15f8b2(0xd7)]),Object[_0x15f8b2(0xe6)](_0x5b17c5,this[_0x15f8b2(0x104)][_0x15f8b2(0xf6)]);const _0x7906e4=_0x5b17c5[_0x15f8b2(0xf5)]||_0x15f8b2(0xbb);this[_0x15f8b2(0xf5)]=resolveSite(_0x7906e4),this['database']=_0x5b17c5[_0x15f8b2(0xc6)],this[_0x15f8b2(0xf9)]=_0x5b17c5['parent_segment'],this[_0x15f8b2(0xbd)]=_0x5b17c5['segment_path'],this[_0x15f8b2(0xc1)]=_0x5b17c5[_0x15f8b2(0xc1)],this[_0x15f8b2(0x107)]=_0x5b17c5[_0x15f8b2(0x107)],this[_0x15f8b2(0xeb)]=_0x5b17c5[_0x15f8b2(0xeb)],this['composable_audience']=_0x5b17c5['composable_audience'],this[_0x15f8b2(0xf7)]=_0x65473b[_0x15f8b2(0xf7)]||![],this[_0x15f8b2(0xe7)]=_0x65473b[_0x15f8b2(0xe7)]??LogLevel['INFO'],this[_0x15f8b2(0xb9)]=this[_0x15f8b2(0xb8)]||undefined,this[_0x15f8b2(0xbf)]=getAccessToken(this[_0x15f8b2(0xb8)]||undefined),this['apiKey']=getAPIKey(this['activeProfile']||undefined);const _0x20344b=typeof _0x5d95b9[_0x15f8b2(0xd2)]===_0x15f8b2(0xb7)?_0x5d95b9[_0x15f8b2(0xd2)]:undefined;this['proxy']=_0x20344b||process.env.HTTPS_PROXY||process.env.HTTP_PROXY;const _0x415f47=getConfigDir(),_0x28a828=a62_0x53177c[_0x15f8b2(0xe4)](_0x415f47,_0x15f8b2(0xe9),this[_0x15f8b2(0xba)]+_0x15f8b2(0x101)),_0xd241db=findProjectConfigPath(),_0x270bab=a62_0x53177c['join'](_0x415f47,_0x15f8b2(0xc7)),_0x577024=a62_0x53177c[_0x15f8b2(0xe4)](_0x415f47,_0x15f8b2(0xe2));let _0x11f6fe=null,_0xa9264f=null;this[_0x15f8b2(0xb8)]&&(_0x11f6fe=a62_0x53177c[_0x15f8b2(0xe4)](_0x415f47,'profiles',this[_0x15f8b2(0xb8)],'tdx.json'),_0xa9264f=a62_0x53177c[_0x15f8b2(0xe4)](_0x415f47,_0x15f8b2(0xcd),this[_0x15f8b2(0xb8)],'.env')),this[_0x15f8b2(0xf0)]={'session':a62_0x11cde9[_0x15f8b2(0xd0)](_0x28a828)?_0x28a828:null,'project':_0xd241db,'profile':_0x11f6fe&&a62_0x11cde9[_0x15f8b2(0xd0)](_0x11f6fe)?_0x11f6fe:null,'profileCredentials':_0xa9264f&&a62_0x11cde9[_0x15f8b2(0xd0)](_0xa9264f)?_0xa9264f:null,'global':a62_0x11cde9[_0x15f8b2(0xd0)](_0x270bab)?_0x270bab:null,'globalCredentials':a62_0x11cde9['existsSync'](_0x577024)?_0x577024:null};}[a62_0x10f951(0xfa)](_0xb2de2b,_0x398089){const _0x2decff=a62_0x10f951;if(!_0x398089)return'not\x20set';const _0x2ba75e=_0x398089;if(this[_0x2decff(0x104)]['cliFlags'][_0xb2de2b]===_0x2ba75e){if(_0xb2de2b==='site'&&_0x2ba75e===_0x2decff(0xbb)&&!this[_0x2decff(0x104)][_0x2decff(0xd7)][_0x2decff(0xf5)]&&!this[_0x2decff(0x104)][_0x2decff(0xc4)][_0x2decff(0xf5)]&&!this[_0x2decff(0x104)][_0x2decff(0xb9)][_0x2decff(0xf5)]&&!this[_0x2decff(0x104)]['global'][_0x2decff(0xf5)])return'default';return'CLI\x20flag:\x20--'+_0xb2de2b[_0x2decff(0xe3)](/_/g,'-');}if(this[_0x2decff(0x104)][_0x2decff(0xd7)][_0xb2de2b]===_0x2ba75e)return _0x2decff(0xd7);if(this['layers'][_0x2decff(0xc4)][_0xb2de2b]===_0x2ba75e)return _0x2decff(0xc4);if(this[_0x2decff(0x104)]['profile'][_0xb2de2b]===_0x2ba75e)return _0x2decff(0xec)+this[_0x2decff(0xb8)];if(this[_0x2decff(0x104)][_0x2decff(0x109)][_0xb2de2b]===_0x2ba75e)return'global';return _0x2decff(0xea);}['loadGlobalConfig'](){const _0x545d7f=a62_0x10f951,_0x4e8d87=a62_0x53177c[_0x545d7f(0xe4)](getConfigDir(),_0x545d7f(0xc7));if(!a62_0x11cde9['existsSync'](_0x4e8d87))return{};try{const _0x5b52b3=a62_0x11cde9['readFileSync'](_0x4e8d87,_0x545d7f(0xce));return JSON[_0x545d7f(0xc5)](_0x5b52b3);}catch{return{};}}[a62_0x10f951(0xcb)](_0x18a8bf){const _0x1be59b=a62_0x10f951;_0x18a8bf['site']=this[_0x1be59b(0xf5)],!_0x18a8bf[_0x1be59b(0xc6)]&&this[_0x1be59b(0xc6)]&&(_0x18a8bf['database']=this[_0x1be59b(0xc6)]),!_0x18a8bf['parentSegment']&&this[_0x1be59b(0xf9)]&&(_0x18a8bf[_0x1be59b(0x108)]=this[_0x1be59b(0xf9)]),!_0x18a8bf[_0x1be59b(0xdb)]&&this[_0x1be59b(0xbd)]&&(_0x18a8bf['segmentPath']=this[_0x1be59b(0xbd)]),!_0x18a8bf[_0x1be59b(0xd5)]&&this[_0x1be59b(0xc1)]&&(_0x18a8bf[_0x1be59b(0xd5)]=this['llm_project']),!_0x18a8bf[_0x1be59b(0xb6)]&&this[_0x1be59b(0x107)]&&(_0x18a8bf['llmAgent']=this[_0x1be59b(0x107)]),!_0x18a8bf[_0x1be59b(0xef)]&&this[_0x1be59b(0xeb)]&&(_0x18a8bf[_0x1be59b(0xef)]=this[_0x1be59b(0xeb)]),!_0x18a8bf['composableAudience']&&this['composable_audience']&&(_0x18a8bf[_0x1be59b(0xc3)]=this[_0x1be59b(0xe0)]);}[a62_0x10f951(0xed)](){const _0xe5808d=a62_0x10f951;return[{'key':_0xe5808d(0xf5),'value':this[_0xe5808d(0xf5)]},{'key':'database','value':this['database']},{'key':'parent_segment','value':this[_0xe5808d(0xf9)]},{'key':'segment_path','value':this['segment_path']},{'key':'llm_project','value':this[_0xe5808d(0xc1)]},{'key':'llm_agent','value':this[_0xe5808d(0x107)]},{'key':_0xe5808d(0xeb),'value':this[_0xe5808d(0xeb)]},{'key':_0xe5808d(0xe0),'value':this['composable_audience']},{'key':'profile','value':this[_0xe5808d(0xb8)]||undefined}];}[a62_0x10f951(0xd6)](){const _0x4a903f=a62_0x10f951;console[_0x4a903f(0xdd)](a62_0x24cc9a['bold'](_0x4a903f(0xee)));for(const {key:_0x4c5263,value:_0x4ca1f6}of this[_0x4a903f(0xed)]()){_0x4ca1f6&&console['log'](a62_0x24cc9a[_0x4a903f(0xda)](_0x4c5263)+':\x20'+_0x4ca1f6);}}[a62_0x10f951(0xcf)](){const _0x239e5d=a62_0x10f951;console[_0x239e5d(0xdd)](a62_0x24cc9a[_0x239e5d(0x105)](_0x239e5d(0xee)));for(const {key:_0x3d08ad,value:_0x5bf628}of this[_0x239e5d(0xed)]()){if(_0x5bf628){const _0x1cbf5a=_0x3d08ad===_0x239e5d(0xb9)?_0x239e5d(0xfe):'('+this[_0x239e5d(0xfa)](_0x3d08ad,_0x5bf628)+')';console[_0x239e5d(0xdd)](a62_0x24cc9a[_0x239e5d(0xda)](_0x3d08ad)+':\x20'+_0x5bf628+'\x20'+a62_0x24cc9a[_0x239e5d(0xf4)](_0x1cbf5a));}}console[_0x239e5d(0xdd)]('\x0a'+a62_0x24cc9a['bold'](_0x239e5d(0xde)));const _0x1f4f9c=[{'label':_0x239e5d(0xe8),'path':this[_0x239e5d(0xf0)][_0x239e5d(0xd7)],'extra':_0x239e5d(0xd4)+this[_0x239e5d(0xba)]+')'},{'label':_0x239e5d(0xf8),'path':this[_0x239e5d(0xf0)][_0x239e5d(0xc4)]},{'label':_0x239e5d(0xca),'path':this['configFiles'][_0x239e5d(0xb9)]},{'label':_0x239e5d(0xfd),'path':this[_0x239e5d(0xf0)][_0x239e5d(0xdc)]},{'label':'Global','path':this[_0x239e5d(0xf0)][_0x239e5d(0x109)]},{'label':'Global\x20Credentials','path':this[_0x239e5d(0xf0)][_0x239e5d(0xe1)]}];for(const {label:_0x232aa0,path:_0x1b9fd0,extra:_0x8560a3}of _0x1f4f9c){if(_0x1b9fd0)console[_0x239e5d(0xdd)](a62_0x24cc9a[_0x239e5d(0xda)](_0x232aa0)+':\x20'+_0x1b9fd0+'\x20'+a62_0x24cc9a[_0x239e5d(0xe5)]('✓')+(_0x8560a3?'\x20'+a62_0x24cc9a[_0x239e5d(0xf4)](_0x8560a3):''));else{if(_0x232aa0==='Session')console[_0x239e5d(0xdd)](a62_0x24cc9a[_0x239e5d(0xda)](_0x232aa0)+':\x20'+a62_0x24cc9a[_0x239e5d(0xf4)](_0x239e5d(0xbc))+'\x20'+a62_0x24cc9a[_0x239e5d(0xf4)](_0x239e5d(0xfc)+this[_0x239e5d(0xba)]+')'));else(_0x232aa0===_0x239e5d(0xf8)||_0x232aa0==='Global')&&console[_0x239e5d(0xdd)](a62_0x24cc9a[_0x239e5d(0xda)](_0x232aa0)+':\x20'+a62_0x24cc9a[_0x239e5d(0xf4)](_0x239e5d(0xbc)));}}}async[a62_0x10f951(0xf2)](){const _0x1c742b=a62_0x10f951;if(!this['accessToken']){const _0x5f157d=await getOAuthTokens(this[_0x1c742b(0xb8)]||undefined);if(_0x5f157d)return this[_0x1c742b(0xbf)]=_0x5f157d[_0x1c742b(0xc2)],undefined;}return this[_0x1c742b(0x103)]=await getAPIKeyAsync(this[_0x1c742b(0xf5)],this[_0x1c742b(0xb8)]||undefined),this[_0x1c742b(0x103)];}static async[a62_0x10f951(0x100)](_0x1725e5){const _0x55e142=a62_0x10f951,_0x144943=new GlobalContext(_0x1725e5);return await _0x144943[_0x55e142(0xf2)](),_0x144943;}}
@@ -1 +1 @@
1
- const a63_0x1bf2fd=a63_0x4a46;(function(_0x1ac80f,_0x3ca847){const _0x3cefdb=a63_0x4a46,_0x15c40c=_0x1ac80f();while(!![]){try{const _0x591611=parseInt(_0x3cefdb(0x107))/0x1+-parseInt(_0x3cefdb(0x106))/0x2*(parseInt(_0x3cefdb(0x10a))/0x3)+parseInt(_0x3cefdb(0x105))/0x4*(-parseInt(_0x3cefdb(0xf6))/0x5)+-parseInt(_0x3cefdb(0x10f))/0x6+parseInt(_0x3cefdb(0xfd))/0x7*(-parseInt(_0x3cefdb(0xf1))/0x8)+-parseInt(_0x3cefdb(0x108))/0x9+parseInt(_0x3cefdb(0xf7))/0xa;if(_0x591611===_0x3ca847)break;else _0x15c40c['push'](_0x15c40c['shift']());}catch(_0x50a319){_0x15c40c['push'](_0x15c40c['shift']());}}}(a63_0x10d4,0xde920));const SERVICE_NAME=a63_0x1bf2fd(0x111);let EntryClass=null,keyringLoadError=null;function a63_0x4a46(_0x2e10e4,_0x38abb6){_0x2e10e4=_0x2e10e4-0xef;const _0x10d4b3=a63_0x10d4();let _0x4a460b=_0x10d4b3[_0x2e10e4];return _0x4a460b;}async function getEntryClass(){const _0x4e591e=a63_0x1bf2fd;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x142387=await import(_0x4e591e(0x101));return EntryClass=_0x142387[_0x4e591e(0x104)],EntryClass;}catch(_0x3f30db){return keyringLoadError=_0x3f30db instanceof Error?_0x3f30db:new Error(String(_0x3f30db)),null;}}function getAccountName(_0xc7f51e){const _0x411f5c=a63_0x1bf2fd,_0xeef382=_0xc7f51e||'';return _0x411f5c(0xfc)+_0xeef382+_0x411f5c(0x102);}export async function getKeychainAPIKey(_0x70186d){const _0x1ccee7=a63_0x1bf2fd,_0x204f88=await getKeychainAPIKeyWithStatus(_0x70186d);if(_0x204f88[_0x1ccee7(0x110)])return _0x204f88['value'];return _0x204f88[_0x1ccee7(0xf0)]===_0x1ccee7(0xfb)&&console[_0x1ccee7(0x100)](_0x1ccee7(0xf8)+_0x204f88[_0x1ccee7(0x10e)]),null;}export async function getKeychainAPIKeyWithStatus(_0xafdb15){const _0x54da8f=a63_0x1bf2fd;try{const _0x2a9715=await getEntryClass();if(!_0x2a9715)return{'success':![],'reason':'unavailable'};const _0x5a8bc4=getAccountName(_0xafdb15),_0xff930e=new _0x2a9715(SERVICE_NAME,_0x5a8bc4),_0x274499=_0xff930e[_0x54da8f(0xf4)]();if(_0x274499)return{'success':!![],'value':_0x274499};return{'success':![],'reason':_0x54da8f(0xf3)};}catch(_0x1bd130){const _0x5ee0a5=_0x1bd130 instanceof Error?_0x1bd130['message']:String(_0x1bd130);if(_0x5ee0a5[_0x54da8f(0xff)](_0x54da8f(0xf9))||_0x5ee0a5[_0x54da8f(0xf2)]()['includes'](_0x54da8f(0x109))||_0x5ee0a5[_0x54da8f(0xf2)]()[_0x54da8f(0xff)]('not\x20found')||_0x5ee0a5[_0x54da8f(0xf2)]()[_0x54da8f(0xff)]('no\x20matching\x20entry'))return{'success':![],'reason':_0x54da8f(0xf3)};if(_0x5ee0a5[_0x54da8f(0xff)](_0x54da8f(0xef))||_0x5ee0a5[_0x54da8f(0xf2)]()[_0x54da8f(0xff)]('restricted')||_0x5ee0a5[_0x54da8f(0xf2)]()['includes'](_0x54da8f(0x10d)))return{'success':![],'reason':'access_denied','message':_0x54da8f(0x112)};return{'success':![],'reason':'unavailable','message':_0x5ee0a5};}}export async function saveKeychainAPIKey(_0x1528ad,_0x184e42){const _0xc97b01=a63_0x1bf2fd,_0x97268b=await getEntryClass();if(!_0x97268b)throw new Error(_0xc97b01(0x103));const _0x18d074=getAccountName(_0x184e42),_0x520637=new _0x97268b(SERVICE_NAME,_0x18d074);_0x520637[_0xc97b01(0xfe)](_0x1528ad);}export async function deleteKeychainAPIKey(_0x1cb243){const _0x9ee0ec=a63_0x1bf2fd;try{const _0x4da14d=await getEntryClass();if(!_0x4da14d)return![];const _0x68ecdc=getAccountName(_0x1cb243),_0x106b0e=new _0x4da14d(SERVICE_NAME,_0x68ecdc);return _0x106b0e[_0x9ee0ec(0xf5)](),!![];}catch{return![];}}function a63_0x10d4(){const _0x1e1dfe=['getPassword','deleteCredential','5609500hQFIDa','57910020kHkllz','Warning:\x20','-25300','cannot\x20find','access_denied','profile:','7fkEtVN','setPassword','includes','error','@napi-rs/keyring',':api_key','System\x20keychain\x20is\x20not\x20available','Entry','4ZtpAQB','1701368twtSPy','545856thXTUt','11562417pJnRQf','could\x20not\x20be\x20found','3PiWxnD','__keychain_test__','not\x20supported','access','message','7330932lVWDFy','success','tdx','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','reason','7568728DGfjWT','toLowerCase','not_found'];a63_0x10d4=function(){return _0x1e1dfe;};return a63_0x10d4();}export async function isKeychainAvailable(){const _0x73d291=a63_0x1bf2fd;try{const _0x50a27b=await getEntryClass();if(!_0x50a27b)return![];const _0x516102=new _0x50a27b(SERVICE_NAME,_0x73d291(0x10b));return _0x516102['getPassword'](),!![];}catch(_0x2ddddd){const _0x5b3798=_0x2ddddd instanceof Error?_0x2ddddd[_0x73d291(0x10e)][_0x73d291(0xf2)]():'';if(_0x5b3798[_0x73d291(0xff)]('not\x20available')||_0x5b3798[_0x73d291(0xff)](_0x73d291(0x10c))||_0x5b3798[_0x73d291(0xff)](_0x73d291(0xfa)))return![];return!![];}}
1
+ const a63_0x18a00c=a63_0x34eb;(function(_0xa594af,_0x58a68d){const _0x4222c5=a63_0x34eb,_0x5d2793=_0xa594af();while(!![]){try{const _0x314260=parseInt(_0x4222c5(0xd1))/0x1+parseInt(_0x4222c5(0xd6))/0x2+parseInt(_0x4222c5(0xca))/0x3*(parseInt(_0x4222c5(0xe3))/0x4)+parseInt(_0x4222c5(0xd7))/0x5*(parseInt(_0x4222c5(0xd2))/0x6)+parseInt(_0x4222c5(0xc9))/0x7*(parseInt(_0x4222c5(0xcf))/0x8)+-parseInt(_0x4222c5(0xc8))/0x9+parseInt(_0x4222c5(0xc5))/0xa*(-parseInt(_0x4222c5(0xd8))/0xb);if(_0x314260===_0x58a68d)break;else _0x5d2793['push'](_0x5d2793['shift']());}catch(_0x34b434){_0x5d2793['push'](_0x5d2793['shift']());}}}(a63_0x51c6,0xa2078));const SERVICE_NAME=a63_0x18a00c(0xe5);let EntryClass=null,keyringLoadError=null;async function getEntryClass(){if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x1cf54d=await import('@napi-rs/keyring');return EntryClass=_0x1cf54d['Entry'],EntryClass;}catch(_0x5c8de3){return keyringLoadError=_0x5c8de3 instanceof Error?_0x5c8de3:new Error(String(_0x5c8de3)),null;}}function getAccountName(_0x137257){const _0x1df6f9=a63_0x18a00c,_0x462ed5=_0x137257||'';return _0x1df6f9(0xc6)+_0x462ed5+':api_key';}function a63_0x34eb(_0xe30c43,_0x67901a){_0xe30c43=_0xe30c43-0xc3;const _0x51c688=a63_0x51c6();let _0x34ebda=_0x51c688[_0xe30c43];return _0x34ebda;}export async function getKeychainAPIKey(_0x24016e){const _0x3940ad=a63_0x18a00c,_0x1bf47e=await getKeychainAPIKeyWithStatus(_0x24016e);if(_0x1bf47e[_0x3940ad(0xde)])return _0x1bf47e[_0x3940ad(0xe4)];return _0x1bf47e[_0x3940ad(0xe1)]===_0x3940ad(0xdf)&&console['error'](_0x3940ad(0xcc)+_0x1bf47e[_0x3940ad(0xc7)]),null;}export async function getKeychainAPIKeyWithStatus(_0x3e62fd){const _0x3b9191=a63_0x18a00c;try{const _0x36ac0a=await getEntryClass();if(!_0x36ac0a)return{'success':![],'reason':_0x3b9191(0xd3)};const _0x3cab5b=getAccountName(_0x3e62fd),_0x29b0b2=new _0x36ac0a(SERVICE_NAME,_0x3cab5b),_0x52824e=_0x29b0b2[_0x3b9191(0xd0)]();if(_0x52824e)return{'success':!![],'value':_0x52824e};return{'success':![],'reason':_0x3b9191(0xce)};}catch(_0xac19db){const _0x2ee4f3=_0xac19db instanceof Error?_0xac19db[_0x3b9191(0xc7)]:String(_0xac19db);if(_0x2ee4f3[_0x3b9191(0xda)](_0x3b9191(0xe6))||_0x2ee4f3['toLowerCase']()['includes'](_0x3b9191(0xd5))||_0x2ee4f3[_0x3b9191(0xc4)]()[_0x3b9191(0xda)](_0x3b9191(0xdb))||_0x2ee4f3[_0x3b9191(0xc4)]()['includes'](_0x3b9191(0xcd)))return{'success':![],'reason':_0x3b9191(0xce)};if(_0x2ee4f3['includes'](_0x3b9191(0xcb))||_0x2ee4f3[_0x3b9191(0xc4)]()['includes']('restricted')||_0x2ee4f3['toLowerCase']()[_0x3b9191(0xda)](_0x3b9191(0xc3)))return{'success':![],'reason':'access_denied','message':_0x3b9191(0xd4)};return{'success':![],'reason':'unavailable','message':_0x2ee4f3};}}function a63_0x51c6(){const _0x2a3282=['39115GvBEFa','138083PBGwDz','__keychain_test__','includes','not\x20found','not\x20available','System\x20keychain\x20is\x20not\x20available','success','access_denied','setPassword','reason','not\x20supported','4084952RxHmuv','value','tdx','-25300','deleteCredential','cannot\x20find','access','toLowerCase','2510fKbkdn','profile:','message','2970378aFczDA','258713NQpUFA','3kvSBAu','-25293','Warning:\x20','no\x20matching\x20entry','not_found','152oCEHbN','getPassword','827836tVtymt','648uCaTZf','unavailable','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.','could\x20not\x20be\x20found','1496676EyzuyV'];a63_0x51c6=function(){return _0x2a3282;};return a63_0x51c6();}export async function saveKeychainAPIKey(_0x13ff76,_0x4381a5){const _0x264558=a63_0x18a00c,_0xff56ca=await getEntryClass();if(!_0xff56ca)throw new Error(_0x264558(0xdd));const _0x54f26b=getAccountName(_0x4381a5),_0x58b67d=new _0xff56ca(SERVICE_NAME,_0x54f26b);_0x58b67d[_0x264558(0xe0)](_0x13ff76);}export async function deleteKeychainAPIKey(_0x458eb5){const _0x55d230=a63_0x18a00c;try{const _0x280d8b=await getEntryClass();if(!_0x280d8b)return![];const _0x15da6f=getAccountName(_0x458eb5),_0x365db8=new _0x280d8b(SERVICE_NAME,_0x15da6f);return _0x365db8[_0x55d230(0xe7)](),!![];}catch{return![];}}export async function isKeychainAvailable(){const _0xbcfc7d=a63_0x18a00c;try{const _0x67e298=await getEntryClass();if(!_0x67e298)return![];const _0x4d4a13=new _0x67e298(SERVICE_NAME,_0xbcfc7d(0xd9));return _0x4d4a13[_0xbcfc7d(0xd0)](),!![];}catch(_0x51cbcb){const _0x5499be=_0x51cbcb instanceof Error?_0x51cbcb[_0xbcfc7d(0xc7)][_0xbcfc7d(0xc4)]():'';if(_0x5499be['includes'](_0xbcfc7d(0xdc))||_0x5499be[_0xbcfc7d(0xda)](_0xbcfc7d(0xe2))||_0x5499be['includes'](_0xbcfc7d(0xe8)))return![];return!![];}}
@@ -1 +1 @@
1
- function a64_0x7d22(){const _0x562b17=['1516440QSpKRW','parse','14240GQFNOw','profile:','44261hdJwqi','stringify','90WTVEHv','deleteCredential','504543vBYykE','4SvZnel','1140426CmYOYZ','tdx','2290666zAfcEe','6IZGNyY','System\x20keychain\x20is\x20not\x20available','@napi-rs/keyring','521095DTHFtM','getPassword','setPassword'];a64_0x7d22=function(){return _0x562b17;};return a64_0x7d22();}const a64_0x11b926=a64_0x4089;(function(_0x2c0f03,_0x1bf77b){const _0xbaab0b=a64_0x4089,_0x30aa43=_0x2c0f03();while(!![]){try{const _0x7f2614=-parseInt(_0xbaab0b(0xf9))/0x1+parseInt(_0xbaab0b(0xff))/0x2+parseInt(_0xbaab0b(0xfd))/0x3*(-parseInt(_0xbaab0b(0xfe))/0x4)+parseInt(_0xbaab0b(0x105))/0x5+-parseInt(_0xbaab0b(0x102))/0x6*(parseInt(_0xbaab0b(0x101))/0x7)+parseInt(_0xbaab0b(0xf5))/0x8+-parseInt(_0xbaab0b(0xfb))/0x9*(parseInt(_0xbaab0b(0xf7))/0xa);if(_0x7f2614===_0x1bf77b)break;else _0x30aa43['push'](_0x30aa43['shift']());}catch(_0x21b17b){_0x30aa43['push'](_0x30aa43['shift']());}}}(a64_0x7d22,0x4bb33));const SERVICE_NAME=a64_0x11b926(0x100);function a64_0x4089(_0xb54d80,_0x37fe8a){_0xb54d80=_0xb54d80-0xf4;const _0x7d22bc=a64_0x7d22();let _0x4089c6=_0x7d22bc[_0xb54d80];return _0x4089c6;}let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x29abef=a64_0x11b926;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x48a041=await import(_0x29abef(0x104));return EntryClass=_0x48a041['Entry'],EntryClass;}catch(_0x27f794){return keyringLoadError=_0x27f794 instanceof Error?_0x27f794:new Error(String(_0x27f794)),null;}}function getOAuthAccountName(_0x9a00ce){const _0x1da286=a64_0x11b926,_0x30acc0=_0x9a00ce||'';return _0x1da286(0xf8)+_0x30acc0+':oauth_tokens';}export async function saveOAuthTokens(_0x1e2ddd,_0x54f64a){const _0xa21166=a64_0x11b926,_0xade211=await getEntryClass();if(!_0xade211)throw new Error(_0xa21166(0x103));const _0x115146=getOAuthAccountName(_0x54f64a),_0x59ed4a=new _0xade211(SERVICE_NAME,_0x115146);_0x59ed4a[_0xa21166(0xf4)](JSON[_0xa21166(0xfa)](_0x1e2ddd));}export async function getOAuthTokens(_0x527334){const _0x24e85b=a64_0x11b926;try{const _0x4d3cf3=await getEntryClass();if(!_0x4d3cf3)return null;const _0x224ec6=getOAuthAccountName(_0x527334),_0x40100=new _0x4d3cf3(SERVICE_NAME,_0x224ec6),_0x1a2c5b=_0x40100[_0x24e85b(0x106)]();if(_0x1a2c5b)return JSON[_0x24e85b(0xf6)](_0x1a2c5b);return null;}catch{return null;}}export async function deleteOAuthTokens(_0x4b268f){const _0x1bc917=a64_0x11b926;try{const _0xb33a34=await getEntryClass();if(!_0xb33a34)return![];const _0x2e4fec=getOAuthAccountName(_0x4b268f),_0xa350af=new _0xb33a34(SERVICE_NAME,_0x2e4fec);return _0xa350af[_0x1bc917(0xfc)](),!![];}catch{return![];}}
1
+ const a64_0x3e6999=a64_0x334c;(function(_0xd0e906,_0x35afb6){const _0x502c71=a64_0x334c,_0x5bba53=_0xd0e906();while(!![]){try{const _0x11474c=parseInt(_0x502c71(0x156))/0x1*(-parseInt(_0x502c71(0x149))/0x2)+-parseInt(_0x502c71(0x14b))/0x3*(parseInt(_0x502c71(0x150))/0x4)+-parseInt(_0x502c71(0x157))/0x5+parseInt(_0x502c71(0x154))/0x6+-parseInt(_0x502c71(0x151))/0x7*(parseInt(_0x502c71(0x147))/0x8)+parseInt(_0x502c71(0x14a))/0x9+parseInt(_0x502c71(0x155))/0xa;if(_0x11474c===_0x35afb6)break;else _0x5bba53['push'](_0x5bba53['shift']());}catch(_0x2e082d){_0x5bba53['push'](_0x5bba53['shift']());}}}(a64_0x2be7,0xb16c9));const SERVICE_NAME=a64_0x3e6999(0x152);let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x2841d9=a64_0x3e6999;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x1105a4=await import(_0x2841d9(0x14f));return EntryClass=_0x1105a4[_0x2841d9(0x158)],EntryClass;}catch(_0x4f81c1){return keyringLoadError=_0x4f81c1 instanceof Error?_0x4f81c1:new Error(String(_0x4f81c1)),null;}}function a64_0x334c(_0x46f8c0,_0x245d64){_0x46f8c0=_0x46f8c0-0x147;const _0x2be78f=a64_0x2be7();let _0x334cd5=_0x2be78f[_0x46f8c0];return _0x334cd5;}function getOAuthAccountName(_0x2e18a2){const _0x5540b8=a64_0x3e6999,_0x10d564=_0x2e18a2||'';return _0x5540b8(0x14d)+_0x10d564+_0x5540b8(0x14e);}function a64_0x2be7(){const _0x56774b=['Entry','deleteCredential','getPassword','4192TlSkcq','stringify','8GQiPqA','8472672qQYCwg','21yCIuuK','parse','profile:',':oauth_tokens','@napi-rs/keyring','544868yGSkKH','6461pfGLYb','tdx','setPassword','424470mXXLkU','26765230PIjDuE','182089iSeQFo','3982100oHJESP'];a64_0x2be7=function(){return _0x56774b;};return a64_0x2be7();}export async function saveOAuthTokens(_0x387311,_0x2de88a){const _0x59ff3b=a64_0x3e6999,_0xb1d977=await getEntryClass();if(!_0xb1d977)throw new Error('System\x20keychain\x20is\x20not\x20available');const _0xeece21=getOAuthAccountName(_0x2de88a),_0x58cee1=new _0xb1d977(SERVICE_NAME,_0xeece21);_0x58cee1[_0x59ff3b(0x153)](JSON[_0x59ff3b(0x148)](_0x387311));}export async function getOAuthTokens(_0x239c95){const _0x40a056=a64_0x3e6999;try{const _0x24365d=await getEntryClass();if(!_0x24365d)return null;const _0x5d1a87=getOAuthAccountName(_0x239c95),_0x5361c1=new _0x24365d(SERVICE_NAME,_0x5d1a87),_0xfb47e4=_0x5361c1[_0x40a056(0x15a)]();if(_0xfb47e4)return JSON[_0x40a056(0x14c)](_0xfb47e4);return null;}catch{return null;}}export async function deleteOAuthTokens(_0x462af8){const _0x320c2c=a64_0x3e6999;try{const _0x4f9ced=await getEntryClass();if(!_0x4f9ced)return![];const _0x36a228=getOAuthAccountName(_0x462af8),_0x27c255=new _0x4f9ced(SERVICE_NAME,_0x36a228);return _0x27c255[_0x320c2c(0x159)](),!![];}catch{return![];}}
@@ -1 +1 @@
1
- const a65_0xc44a5c=a65_0x4afc;(function(_0x137924,_0x160536){const _0x3d6254=a65_0x4afc,_0x2cf134=_0x137924();while(!![]){try{const _0x55fd05=parseInt(_0x3d6254(0x176))/0x1+parseInt(_0x3d6254(0x19a))/0x2*(-parseInt(_0x3d6254(0x186))/0x3)+parseInt(_0x3d6254(0x177))/0x4+parseInt(_0x3d6254(0x17e))/0x5*(parseInt(_0x3d6254(0x173))/0x6)+parseInt(_0x3d6254(0x18d))/0x7+-parseInt(_0x3d6254(0x193))/0x8*(parseInt(_0x3d6254(0x163))/0x9)+parseInt(_0x3d6254(0x169))/0xa*(parseInt(_0x3d6254(0x17f))/0xb);if(_0x55fd05===_0x160536)break;else _0x2cf134['push'](_0x2cf134['shift']());}catch(_0x165dc3){_0x2cf134['push'](_0x2cf134['shift']());}}}(a65_0x2b98,0xf2725));import*as a65_0x496326 from'node:crypto';function a65_0x2b98(){const _0x36c042=['127.0.0.1','):\x20','code','1279210RPjDhJ','randomBytes','get','text/html','code_challenge','error','stg-ap01','OAuth\x20token\x20request\x20failed\x20(','authorization_code','redirect_uri','/oauth/callback','dev-eu01','4467258BBIYJg','searchParams','text/plain','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','stg-us01','hex','410kLbJTO','tdx','url','http://127.0.0.1','Port\x20','toString','openid\x20email\x20profile','OAuth\x20callback\x20received\x20an\x20error\x20or\x20missing\x20parameters','update','stg-ap03','6XQpDDV','set','<html><body><h1>Authentication\x20Failed</h1><p>An\x20error\x20occurred\x20during\x20authentication.\x20Please\x20close\x20this\x20window\x20and\x20try\x20again.</p></body></html>','201966ZyVdei','3398592aaSVRo','state','sha256','json','close','base64url','createHash','3808445xUWztL','252351StpcVL','status','createServer','Not\x20Found','writeHead','dev-us01','http://localhost:','6XIjoGu','pathname','codeChallenge','application/x-www-form-urlencoded','scope','redirectUri','EADDRINUSE','7052311DAzhnP','/oauth/authorize','end','S256','client_id','Failed\x20to\x20start\x20OAuth\x20callback\x20server:\x20','24jETCrA','\x20is\x20already\x20in\x20use.\x20Stop\x20the\x20process\x20using\x20it\x20and\x20retry.','text','message'];a65_0x2b98=function(){return _0x36c042;};return a65_0x2b98();}import*as a65_0x364237 from'node:http';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';function a65_0x4afc(_0x422084,_0x229612){_0x422084=_0x422084-0x161;const _0x2b98c1=a65_0x2b98();let _0x4afca6=_0x2b98c1[_0x422084];return _0x4afca6;}const OAUTH_SUPPORTED_SITES=new Set([a65_0xc44a5c(0x184),a65_0xc44a5c(0x162),a65_0xc44a5c(0x167),a65_0xc44a5c(0x1a0),a65_0xc44a5c(0x172)]);export function isOAuthSupported(_0x41ac42){return OAUTH_SUPPORTED_SITES['has'](_0x41ac42);}export const OAUTH_CALLBACK_PORT=0xaa4a;export const OAUTH_REDIRECT_URI=a65_0xc44a5c(0x185)+OAUTH_CALLBACK_PORT+a65_0xc44a5c(0x161);export function getOAuthClientId(){const _0x2a5a53=a65_0xc44a5c;return process.env.TD_OAUTH_CLIENT_ID||_0x2a5a53(0x16a);}export function generatePKCEPair(){const _0x1fca2e=a65_0xc44a5c,_0x1417fb=a65_0x496326[_0x1fca2e(0x19b)](0x20)[_0x1fca2e(0x16e)](_0x1fca2e(0x17c)),_0x214e7f=a65_0x496326[_0x1fca2e(0x17d)](_0x1fca2e(0x179))[_0x1fca2e(0x171)](_0x1417fb)['digest'](_0x1fca2e(0x17c));return{'verifier':_0x1417fb,'challenge':_0x214e7f};}export function buildAuthorizeURL(_0x12f137,_0x5ca57e){const _0xc003f8=a65_0xc44a5c,_0x3aa8e0=new URL(_0xc003f8(0x18e),_0x12f137);return _0x3aa8e0[_0xc003f8(0x164)][_0xc003f8(0x174)]('response_type','code'),_0x3aa8e0[_0xc003f8(0x164)]['set'](_0xc003f8(0x191),_0x5ca57e['clientId']),_0x3aa8e0['searchParams']['set'](_0xc003f8(0x1a3),_0x5ca57e[_0xc003f8(0x18b)]),_0x3aa8e0[_0xc003f8(0x164)][_0xc003f8(0x174)]('state',_0x5ca57e[_0xc003f8(0x178)]),_0x3aa8e0[_0xc003f8(0x164)][_0xc003f8(0x174)](_0xc003f8(0x19e),_0x5ca57e[_0xc003f8(0x188)]),_0x3aa8e0[_0xc003f8(0x164)]['set']('code_challenge_method',_0xc003f8(0x190)),_0x5ca57e[_0xc003f8(0x18a)]&&_0x3aa8e0['searchParams'][_0xc003f8(0x174)]('scope',_0x5ca57e['scope']),_0x3aa8e0[_0xc003f8(0x16e)]();}export async function postTokenRequest(_0x4de2c4,_0xc5dd46){const _0x36aed8=a65_0xc44a5c,_0x7b29c0=new URLSearchParams(_0xc5dd46)[_0x36aed8(0x16e)](),_0x4f05b6=await fetch(_0x4de2c4,{'method':'POST','headers':{'Content-Type':_0x36aed8(0x189)},'body':_0x7b29c0});if(!_0x4f05b6['ok']){const _0x3bb36e=await _0x4f05b6[_0x36aed8(0x195)]();throw new Error(_0x36aed8(0x1a1)+_0x4f05b6[_0x36aed8(0x180)]+_0x36aed8(0x198)+_0x3bb36e);}return await _0x4f05b6[_0x36aed8(0x17a)]();}export async function exchangeCodeForTokens(_0x402c6d,_0x2152ee,_0x27ccfd,_0x2e2b09){const _0x4d97c1=a65_0xc44a5c,_0x206377=_0x402c6d+'/oauth/token';return postTokenRequest(_0x206377,{'grant_type':_0x4d97c1(0x1a2),'client_id':getOAuthClientId(),'code':_0x2152ee,'code_verifier':_0x27ccfd,'redirect_uri':_0x2e2b09});}export function startLocalCallbackServer(){const _0x340751=a65_0xc44a5c;let _0x2e874b,_0x5719ae;const _0x24ab3f=new Promise((_0x427ede,_0x493a5c)=>{_0x2e874b=_0x427ede,_0x5719ae=_0x493a5c;}),_0x48b3e0=a65_0x364237[_0x340751(0x181)]((_0x5c45a7,_0x18e5b6)=>{const _0x323a50=_0x340751,_0x5b47ff=new URL(_0x5c45a7[_0x323a50(0x16b)]||'/',_0x323a50(0x16c));if(_0x5b47ff[_0x323a50(0x187)]!==_0x323a50(0x161)){_0x18e5b6[_0x323a50(0x183)](0x194,{'Content-Type':_0x323a50(0x165)}),_0x18e5b6[_0x323a50(0x18f)](_0x323a50(0x182));return;}const _0x3127bb=_0x5b47ff[_0x323a50(0x164)][_0x323a50(0x19c)]('code'),_0x5b4c6b=_0x5b47ff[_0x323a50(0x164)][_0x323a50(0x19c)](_0x323a50(0x178)),_0x1fd415=_0x5b47ff[_0x323a50(0x164)][_0x323a50(0x19c)](_0x323a50(0x19f));if(_0x1fd415||!_0x3127bb||!_0x5b4c6b){_0x18e5b6[_0x323a50(0x183)](0x190,{'Content-Type':_0x323a50(0x19d)}),_0x18e5b6[_0x323a50(0x18f)](_0x323a50(0x175)),_0x5719ae(new Error(_0x323a50(0x170)));return;}_0x18e5b6[_0x323a50(0x183)](0xc8,{'Content-Type':_0x323a50(0x19d)}),_0x18e5b6['end']('<html><body><h1>Authentication\x20Successful</h1><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>'),_0x2e874b({'code':_0x3127bb,'state':_0x5b4c6b});});_0x48b3e0['on'](_0x340751(0x19f),_0x17e1c7=>{const _0x31b30e=_0x340751;_0x17e1c7['code']===_0x31b30e(0x18c)?_0x5719ae(new Error(_0x31b30e(0x16d)+OAUTH_CALLBACK_PORT+_0x31b30e(0x194))):_0x5719ae(new Error(_0x31b30e(0x192)+_0x17e1c7[_0x31b30e(0x196)]));}),_0x48b3e0['listen'](OAUTH_CALLBACK_PORT,_0x340751(0x197));const _0x3ec340=setTimeout(()=>{const _0xbe285=_0x340751;_0x5719ae(new Error(_0xbe285(0x166))),_0x48b3e0[_0xbe285(0x17b)]();},0x2*0x3c*0x3e8);return{'waitForCallback':()=>_0x24ab3f,'close':()=>{const _0x29eeb9=_0x340751;clearTimeout(_0x3ec340),_0x48b3e0[_0x29eeb9(0x17b)]();}};}export async function startOAuthFlow(_0x46c6fb){const _0x3ec676=a65_0xc44a5c,_0x4b2312=getConsoleUrl(_0x46c6fb),_0x43a680=getOAuthClientId(),{verifier:_0x7570e0,challenge:_0x23b4be}=generatePKCEPair(),_0x44505b=a65_0x496326[_0x3ec676(0x19b)](0x10)['toString'](_0x3ec676(0x168)),_0x4a9051=startLocalCallbackServer();try{const _0x10b132=OAUTH_REDIRECT_URI,_0x2eb691=buildAuthorizeURL(_0x4b2312,{'clientId':_0x43a680,'redirectUri':_0x10b132,'state':_0x44505b,'codeChallenge':_0x23b4be,'scope':_0x3ec676(0x16f)});openBrowser(_0x2eb691);const _0x1918ab=await _0x4a9051['waitForCallback']();if(_0x1918ab[_0x3ec676(0x178)]!==_0x44505b)throw new Error('OAuth\x20state\x20mismatch\x20—\x20possible\x20CSRF\x20attack');return await exchangeCodeForTokens(_0x4b2312,_0x1918ab[_0x3ec676(0x199)],_0x7570e0,_0x10b132);}finally{_0x4a9051[_0x3ec676(0x17b)]();}}
1
+ const a65_0x5a17c7=a65_0x20d1;(function(_0x1b0beb,_0x610fc2){const _0x2f8173=a65_0x20d1,_0x4e3674=_0x1b0beb();while(!![]){try{const _0x1d580b=parseInt(_0x2f8173(0x1b1))/0x1*(parseInt(_0x2f8173(0x188))/0x2)+-parseInt(_0x2f8173(0x17e))/0x3+-parseInt(_0x2f8173(0x19d))/0x4+-parseInt(_0x2f8173(0x176))/0x5+-parseInt(_0x2f8173(0x18c))/0x6*(parseInt(_0x2f8173(0x1a8))/0x7)+-parseInt(_0x2f8173(0x1b2))/0x8+-parseInt(_0x2f8173(0x178))/0x9*(-parseInt(_0x2f8173(0x18b))/0xa);if(_0x1d580b===_0x610fc2)break;else _0x4e3674['push'](_0x4e3674['shift']());}catch(_0x1730dd){_0x4e3674['push'](_0x4e3674['shift']());}}}(a65_0x24aa,0xceee5));import*as a65_0x387d83 from'node:crypto';import*as a65_0xe05c2c from'node:http';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';const OAUTH_SUPPORTED_SITES=new Set([a65_0x5a17c7(0x1b0),a65_0x5a17c7(0x1a2),a65_0x5a17c7(0x17d),a65_0x5a17c7(0x1a0),a65_0x5a17c7(0x198)]);export function isOAuthSupported(_0x1be52e){const _0x4fbef3=a65_0x5a17c7;return OAUTH_SUPPORTED_SITES[_0x4fbef3(0x1ae)](_0x1be52e);}export const OAUTH_CALLBACK_PORT=0xaa4a;export const OAUTH_REDIRECT_URI=a65_0x5a17c7(0x175)+OAUTH_CALLBACK_PORT+'/oauth/callback';export function getOAuthClientId(){return process.env.TD_OAUTH_CLIENT_ID||'tdx';}export function generatePKCEPair(){const _0x14956e=a65_0x5a17c7,_0x3ed5ca=a65_0x387d83[_0x14956e(0x193)](0x20)[_0x14956e(0x192)](_0x14956e(0x182)),_0x290874=a65_0x387d83['createHash'](_0x14956e(0x17c))['update'](_0x3ed5ca)[_0x14956e(0x1b3)](_0x14956e(0x182));return{'verifier':_0x3ed5ca,'challenge':_0x290874};}function a65_0x24aa(){const _0x1f1261=['1077444aeeVRJ','POST','error','writeHead','base64url','end','Not\x20Found','searchParams','/oauth/callback','state','15866cRrhzF','text/plain','text','82090mmjWHN','5831634UbBXnb','127.0.0.1','pathname','code_challenge_method','hex','redirect_uri','toString','randomBytes','redirectUri','createServer','<html><body><h1>Authentication\x20Successful</h1><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','/oauth/token','stg-ap03','close','authorization_code','url','response_type','1994288oEMgBE','code','set','stg-ap01','http://127.0.0.1','dev-eu01','Failed\x20to\x20start\x20OAuth\x20callback\x20server:\x20','OAuth\x20state\x20mismatch\x20—\x20possible\x20CSRF\x20attack','waitForCallback','listen','status','7cfOMFx','code_challenge','OAuth\x20token\x20request\x20failed\x20(','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','json','text/html','has','client_id','dev-us01','194NMJxob','2672736DWxRBA','digest','http://localhost:','2365975OsNFos','get','2133zCpTvS','):\x20','scope','OAuth\x20callback\x20received\x20an\x20error\x20or\x20missing\x20parameters','sha256','stg-us01'];a65_0x24aa=function(){return _0x1f1261;};return a65_0x24aa();}export function buildAuthorizeURL(_0x4a8399,_0x18f0d9){const _0x58e901=a65_0x5a17c7,_0x29c034=new URL('/oauth/authorize',_0x4a8399);return _0x29c034[_0x58e901(0x185)]['set'](_0x58e901(0x19c),_0x58e901(0x19e)),_0x29c034[_0x58e901(0x185)]['set'](_0x58e901(0x1af),_0x18f0d9['clientId']),_0x29c034[_0x58e901(0x185)][_0x58e901(0x19f)](_0x58e901(0x191),_0x18f0d9[_0x58e901(0x194)]),_0x29c034[_0x58e901(0x185)][_0x58e901(0x19f)](_0x58e901(0x187),_0x18f0d9[_0x58e901(0x187)]),_0x29c034[_0x58e901(0x185)]['set'](_0x58e901(0x1a9),_0x18f0d9['codeChallenge']),_0x29c034[_0x58e901(0x185)][_0x58e901(0x19f)](_0x58e901(0x18f),'S256'),_0x18f0d9[_0x58e901(0x17a)]&&_0x29c034[_0x58e901(0x185)][_0x58e901(0x19f)](_0x58e901(0x17a),_0x18f0d9[_0x58e901(0x17a)]),_0x29c034[_0x58e901(0x192)]();}export async function postTokenRequest(_0x45a6d9,_0x3a4bb5){const _0xe22ce2=a65_0x5a17c7,_0xae8ae=new URLSearchParams(_0x3a4bb5)[_0xe22ce2(0x192)](),_0x16cb52=await fetch(_0x45a6d9,{'method':_0xe22ce2(0x17f),'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0xae8ae});if(!_0x16cb52['ok']){const _0x1d7517=await _0x16cb52[_0xe22ce2(0x18a)]();throw new Error(_0xe22ce2(0x1aa)+_0x16cb52[_0xe22ce2(0x1a7)]+_0xe22ce2(0x179)+_0x1d7517);}return await _0x16cb52[_0xe22ce2(0x1ac)]();}export async function exchangeCodeForTokens(_0x2f5ea9,_0x143c93,_0x4b1f24,_0x163875){const _0x302989=a65_0x5a17c7,_0x312888=_0x2f5ea9+_0x302989(0x197);return postTokenRequest(_0x312888,{'grant_type':_0x302989(0x19a),'client_id':getOAuthClientId(),'code':_0x143c93,'code_verifier':_0x4b1f24,'redirect_uri':_0x163875});}export function startLocalCallbackServer(){const _0x3c5ed4=a65_0x5a17c7;let _0x44f5a4,_0x26cdb2;const _0x483689=new Promise((_0x2d12ad,_0x36db68)=>{_0x44f5a4=_0x2d12ad,_0x26cdb2=_0x36db68;}),_0x490d9a=a65_0xe05c2c[_0x3c5ed4(0x195)]((_0x8beb39,_0x1e225d)=>{const _0x11d6ff=_0x3c5ed4,_0x31afb8=new URL(_0x8beb39[_0x11d6ff(0x19b)]||'/',_0x11d6ff(0x1a1));if(_0x31afb8[_0x11d6ff(0x18e)]!==_0x11d6ff(0x186)){_0x1e225d['writeHead'](0x194,{'Content-Type':_0x11d6ff(0x189)}),_0x1e225d[_0x11d6ff(0x183)](_0x11d6ff(0x184));return;}const _0x4a991f=_0x31afb8[_0x11d6ff(0x185)][_0x11d6ff(0x177)]('code'),_0x460b2a=_0x31afb8[_0x11d6ff(0x185)]['get'](_0x11d6ff(0x187)),_0x13eef8=_0x31afb8[_0x11d6ff(0x185)]['get'](_0x11d6ff(0x180));if(_0x13eef8||!_0x4a991f||!_0x460b2a){_0x1e225d[_0x11d6ff(0x181)](0x190,{'Content-Type':_0x11d6ff(0x1ad)}),_0x1e225d['end']('<html><body><h1>Authentication\x20Failed</h1><p>An\x20error\x20occurred\x20during\x20authentication.\x20Please\x20close\x20this\x20window\x20and\x20try\x20again.</p></body></html>'),_0x26cdb2(new Error(_0x11d6ff(0x17b)));return;}_0x1e225d['writeHead'](0xc8,{'Content-Type':_0x11d6ff(0x1ad)}),_0x1e225d[_0x11d6ff(0x183)](_0x11d6ff(0x196)),_0x44f5a4({'code':_0x4a991f,'state':_0x460b2a});});_0x490d9a['on'](_0x3c5ed4(0x180),_0x171d8a=>{const _0x14835d=_0x3c5ed4;_0x171d8a[_0x14835d(0x19e)]==='EADDRINUSE'?_0x26cdb2(new Error('Port\x20'+OAUTH_CALLBACK_PORT+'\x20is\x20already\x20in\x20use.\x20Stop\x20the\x20process\x20using\x20it\x20and\x20retry.')):_0x26cdb2(new Error(_0x14835d(0x1a3)+_0x171d8a['message']));}),_0x490d9a[_0x3c5ed4(0x1a6)](OAUTH_CALLBACK_PORT,_0x3c5ed4(0x18d));const _0x1ae33b=setTimeout(()=>{const _0x2ffc3b=_0x3c5ed4;_0x26cdb2(new Error(_0x2ffc3b(0x1ab))),_0x490d9a[_0x2ffc3b(0x199)]();},0x2*0x3c*0x3e8);return{'waitForCallback':()=>_0x483689,'close':()=>{const _0x311004=_0x3c5ed4;clearTimeout(_0x1ae33b),_0x490d9a[_0x311004(0x199)]();}};}function a65_0x20d1(_0x3e7ad8,_0x2fa44f){_0x3e7ad8=_0x3e7ad8-0x175;const _0x24aa5a=a65_0x24aa();let _0x20d128=_0x24aa5a[_0x3e7ad8];return _0x20d128;}export async function startOAuthFlow(_0x24d4c7){const _0x350ad4=a65_0x5a17c7,_0x314c2a=getConsoleUrl(_0x24d4c7),_0x49b55=getOAuthClientId(),{verifier:_0x5a6170,challenge:_0x24ec29}=generatePKCEPair(),_0x28f433=a65_0x387d83[_0x350ad4(0x193)](0x10)['toString'](_0x350ad4(0x190)),_0x317dc0=startLocalCallbackServer();try{const _0x2a494a=OAUTH_REDIRECT_URI,_0x16d665=buildAuthorizeURL(_0x314c2a,{'clientId':_0x49b55,'redirectUri':_0x2a494a,'state':_0x28f433,'codeChallenge':_0x24ec29,'scope':'openid\x20email\x20profile'});openBrowser(_0x16d665);const _0x43c58b=await _0x317dc0[_0x350ad4(0x1a5)]();if(_0x43c58b[_0x350ad4(0x187)]!==_0x28f433)throw new Error(_0x350ad4(0x1a4));return await exchangeCodeForTokens(_0x314c2a,_0x43c58b[_0x350ad4(0x19e)],_0x5a6170,_0x2a494a);}finally{_0x317dc0['close']();}}
@@ -1 +1 @@
1
- const a66_0x31bf93=a66_0x3c5e;(function(_0x3b75b0,_0x2657b6){const _0x3edcf3=a66_0x3c5e,_0x223a2c=_0x3b75b0();while(!![]){try{const _0x570c0e=parseInt(_0x3edcf3(0x172))/0x1*(-parseInt(_0x3edcf3(0x14d))/0x2)+-parseInt(_0x3edcf3(0x15f))/0x3+-parseInt(_0x3edcf3(0x154))/0x4+parseInt(_0x3edcf3(0x164))/0x5+-parseInt(_0x3edcf3(0x148))/0x6*(parseInt(_0x3edcf3(0x186))/0x7)+parseInt(_0x3edcf3(0x17d))/0x8+parseInt(_0x3edcf3(0x145))/0x9;if(_0x570c0e===_0x2657b6)break;else _0x223a2c['push'](_0x223a2c['shift']());}catch(_0x5d992a){_0x223a2c['push'](_0x223a2c['shift']());}}}(a66_0x32ce,0xac4da));import*as a66_0x40d815 from'node:fs';import*as a66_0x50be57 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=a66_0x31bf93(0x14f);export function getProfileParams(_0x2a2600){const _0x5b5b50={};if(!_0x2a2600)return _0x5b5b50;for(const [_0x45ce44,_0xc10aea]of Object['entries'](_0x2a2600)){_0x45ce44!=='description'&&_0xc10aea!==undefined&&(_0x5b5b50[_0x45ce44]=_0xc10aea);}return _0x5b5b50;}export function getProfilesDir(){const _0x1a88da=a66_0x31bf93;return a66_0x50be57[_0x1a88da(0x15d)](getConfigDir(),'profiles');}function getProfileDir(_0x4af84a){const _0x37497d=a66_0x31bf93;return a66_0x50be57[_0x37497d(0x15d)](getProfilesDir(),_0x4af84a);}function getProfileConfigPath(_0x2c5d29){const _0x3f8f20=a66_0x31bf93;return a66_0x50be57[_0x3f8f20(0x15d)](getProfileDir(_0x2c5d29),_0x3f8f20(0x14e));}function getProfileEnvPath(_0x5c02ca){return a66_0x50be57['join'](getProfileDir(_0x5c02ca),'.env');}function getGlobalConfigPath(){const _0x4e6f8f=a66_0x31bf93;return a66_0x50be57[_0x4e6f8f(0x15d)](getConfigDir(),_0x4e6f8f(0x14e));}function validateProfileName(_0x1665a5){const _0x2469f6=a66_0x31bf93;if(/^@?[a-zA-Z0-9_-]+$/[_0x2469f6(0x176)](_0x1665a5))return;if(/^@tdx-studio:[a-zA-Z0-9_-]+:\d+(:\d+)?$/[_0x2469f6(0x176)](_0x1665a5))return;throw new Error(_0x2469f6(0x16a)+_0x1665a5+_0x2469f6(0x165));}function validateProfileConfig(_0x1cb4d4,_0x5449d1){const _0x4bb759=a66_0x31bf93;if(typeof _0x1cb4d4!==_0x4bb759(0x151)||_0x1cb4d4===null)throw new SDKError(ErrorCode[_0x4bb759(0x179)],_0x4bb759(0x13a)+_0x5449d1+_0x4bb759(0x152));const _0x3927c4=[_0x4bb759(0x15b),_0x4bb759(0x14b),'database','parent_segment',_0x4bb759(0x155),'llm_agent',_0x4bb759(0x163)],_0x220e1f=_0x1cb4d4;for(const _0x346f03 of Object[_0x4bb759(0x15c)](_0x220e1f)){!_0x3927c4['includes'](_0x346f03)&&console[_0x4bb759(0x178)](_0x4bb759(0x153)+_0x5449d1+_0x4bb759(0x162)+_0x346f03+_0x4bb759(0x16c));}if(_0x220e1f['description']!==undefined&&typeof _0x220e1f['description']!==_0x4bb759(0x140))throw new SDKError(ErrorCode[_0x4bb759(0x179)],_0x4bb759(0x13a)+_0x5449d1+'\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string');if(_0x220e1f[_0x4bb759(0x14b)]!==undefined&&typeof _0x220e1f[_0x4bb759(0x14b)]!==_0x4bb759(0x140))throw new SDKError(ErrorCode[_0x4bb759(0x179)],_0x4bb759(0x13a)+_0x5449d1+_0x4bb759(0x174));if(_0x220e1f[_0x4bb759(0x181)]!==undefined&&typeof _0x220e1f[_0x4bb759(0x181)]!==_0x4bb759(0x140))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0x4bb759(0x13a)+_0x5449d1+_0x4bb759(0x144));if(_0x220e1f[_0x4bb759(0x16d)]!==undefined&&typeof _0x220e1f[_0x4bb759(0x16d)]!=='string')throw new SDKError(ErrorCode[_0x4bb759(0x179)],_0x4bb759(0x13a)+_0x5449d1+_0x4bb759(0x17a));if(_0x220e1f[_0x4bb759(0x155)]!==undefined&&typeof _0x220e1f[_0x4bb759(0x155)]!==_0x4bb759(0x140))throw new SDKError(ErrorCode[_0x4bb759(0x179)],_0x4bb759(0x13a)+_0x5449d1+_0x4bb759(0x16e));if(_0x220e1f[_0x4bb759(0x15e)]!==undefined&&typeof _0x220e1f[_0x4bb759(0x15e)]!=='string')throw new SDKError(ErrorCode[_0x4bb759(0x179)],_0x4bb759(0x13a)+_0x5449d1+'\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string');return!![];}function loadProfilesFromTdxJson(_0x5d9708,_0x34d8f4){const _0x2edc3b=a66_0x31bf93;if(!a66_0x40d815['existsSync'](_0x5d9708))return[];try{const _0x5251f4=a66_0x40d815[_0x2edc3b(0x160)](_0x5d9708,'utf-8'),_0x1a09cc=JSON[_0x2edc3b(0x170)](_0x5251f4);if(!_0x1a09cc['profiles']||typeof _0x1a09cc[_0x2edc3b(0x167)]!==_0x2edc3b(0x151))return[];const _0x14dac0=[];for(const [_0xf646cb,_0x1fb518]of Object[_0x2edc3b(0x16b)](_0x1a09cc[_0x2edc3b(0x167)])){try{validateProfileConfig(_0x1fb518,_0xf646cb);const _0x41eb50=getNewCredentialPath(_0xf646cb),_0x1d0d12=getOldCredentialPath(_0xf646cb),_0x1b4c3d=a66_0x40d815[_0x2edc3b(0x173)](_0x41eb50)||a66_0x40d815[_0x2edc3b(0x173)](_0x1d0d12);_0x14dac0[_0x2edc3b(0x142)]({'name':_0xf646cb,'config':_0x1fb518,'metadata':{'name':_0xf646cb,'createdAt':new Date()['toISOString']()},'hasCredentials':_0x1b4c3d,'scope':_0x34d8f4});}catch(_0x2bcf3e){_0x2bcf3e instanceof Error&&(console[_0x2edc3b(0x178)](_0x2edc3b(0x158)+_0x5d9708+':'),console[_0x2edc3b(0x178)]('\x20\x20'+_0x2bcf3e[_0x2edc3b(0x185)]+'\x0a'));}}return _0x14dac0;}catch(_0x42e31e){return _0x42e31e instanceof SyntaxError?(console['warn'](_0x2edc3b(0x14a)+_0x5d9708+':\x20Invalid\x20JSON\x20syntax'),console[_0x2edc3b(0x178)](_0x2edc3b(0x183)+_0x42e31e[_0x2edc3b(0x185)]+'\x0a')):console['warn'](_0x2edc3b(0x150)+_0x5d9708+':\x20'+_0x42e31e+'\x0a'),[];}}export function getNewCredentialPath(_0x564c6b){const _0x32b0e1=a66_0x31bf93;return a66_0x50be57[_0x32b0e1(0x15d)](getConfigDir(),'.env.'+_0x564c6b);}function getOldCredentialPath(_0x46112b){const _0xe812d7=a66_0x31bf93;return a66_0x50be57[_0xe812d7(0x15d)](getProfilesDir(),_0x46112b,_0xe812d7(0x13e));}function loadProfilesFromTdxJsonFiles(){const _0x1fba0a=a66_0x31bf93,_0x5138e2=[],_0xe76404=findProjectConfigPath();_0xe76404&&_0x5138e2[_0x1fba0a(0x142)](...loadProfilesFromTdxJson(_0xe76404,_0x1fba0a(0x146)));const _0x26827a=a66_0x50be57['join'](getConfigDir(),_0x1fba0a(0x14e));return _0x5138e2['push'](...loadProfilesFromTdxJson(_0x26827a,'user')),_0x5138e2;}function loadProfilesFromDirectories(){const _0x41c277=a66_0x31bf93,_0x12ac3f=getProfilesDir();if(!a66_0x40d815[_0x41c277(0x173)](_0x12ac3f))return[];try{return a66_0x40d815[_0x41c277(0x168)](_0x12ac3f,{'withFileTypes':!![]})[_0x41c277(0x14c)](_0x3d1877=>_0x3d1877[_0x41c277(0x171)]())[_0x41c277(0x157)](_0x1c41a9=>_0x1c41a9[_0x41c277(0x149)])['filter'](_0x571e8a=>{const _0x10a6df=_0x41c277,_0x3661ec=getProfileConfigPath(_0x571e8a),_0x515612=getProfileEnvPath(_0x571e8a);return a66_0x40d815[_0x10a6df(0x173)](_0x3661ec)||a66_0x40d815[_0x10a6df(0x173)](_0x515612);})[_0x41c277(0x157)](_0x20fc00=>{const _0x53ee8f=loadProfileFromDirectory(_0x20fc00);if(_0x53ee8f)return{..._0x53ee8f,'scope':'directory'};return null;})[_0x41c277(0x14c)](_0x437f67=>_0x437f67!==null);}catch{return[];}}function loadProfileFromDirectory(_0x4b35f2){const _0x210667=a66_0x31bf93,_0x4deee5=getProfileConfigPath(_0x4b35f2),_0x14cd54=getOldCredentialPath(_0x4b35f2);if(!a66_0x40d815['existsSync'](_0x4deee5)&&!a66_0x40d815[_0x210667(0x173)](_0x14cd54))return null;let _0x225e2e={},_0x1490d0={'name':_0x4b35f2,'createdAt':new Date()[_0x210667(0x161)]()};if(a66_0x40d815[_0x210667(0x173)](_0x4deee5))try{const _0x2d4cf2=a66_0x40d815[_0x210667(0x160)](_0x4deee5,_0x210667(0x180)),_0x1a6f37=JSON[_0x210667(0x170)](_0x2d4cf2),{metadata:_0x1486b6,..._0x4080df}=_0x1a6f37;_0x225e2e=_0x4080df,_0x1486b6&&(_0x1490d0=_0x1486b6);}catch{}return{'name':_0x4b35f2,'config':_0x225e2e,'metadata':_0x1490d0,'hasCredentials':a66_0x40d815[_0x210667(0x173)](_0x14cd54),'scope':_0x210667(0x159)};}export function listProfiles(){const _0x355742=a66_0x31bf93,_0x5063b5=loadProfilesFromTdxJsonFiles(),_0x40ae2f=loadProfilesFromDirectories();if(_0x40ae2f[_0x355742(0x17b)]>0x0){const _0x28a78e=_0x40ae2f[_0x355742(0x157)](_0x7c3ba8=>_0x7c3ba8[_0x355742(0x149)])[_0x355742(0x15d)](',\x20'),_0x1452c4=getConfigDir();console['warn'](_0x355742(0x184)+_0x28a78e),console['warn']('Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:'),console['warn'](_0x355742(0x13b)+a66_0x50be57[_0x355742(0x15d)](_0x1452c4,_0x355742(0x14e))),console['warn']('\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)'),console[_0x355742(0x178)](_0x355742(0x169));}const _0x5c75c4=[..._0x5063b5,..._0x40ae2f],_0xa56ec4=new Map();for(const _0x261181 of _0x5c75c4){!_0xa56ec4[_0x355742(0x13c)](_0x261181[_0x355742(0x149)])&&_0xa56ec4[_0x355742(0x182)](_0x261181[_0x355742(0x149)],_0x261181);}return Array['from'](_0xa56ec4[_0x355742(0x16f)]())[_0x355742(0x141)]((_0x46f217,_0x33d18e)=>_0x46f217[_0x355742(0x149)][_0x355742(0x147)](_0x33d18e[_0x355742(0x149)]));}export function profileExists(_0x375348){const _0x5ad09c=a66_0x31bf93,_0x486beb=listProfiles();return _0x486beb[_0x5ad09c(0x156)](_0x2f8a66=>_0x2f8a66[_0x5ad09c(0x149)]===_0x375348);}export function loadProfile(_0x5e0d33){const _0x5885d2=a66_0x31bf93;validateProfileName(_0x5e0d33);const _0x10ec38=listProfiles(),_0x97b8a5=_0x10ec38['find'](_0x44d884=>_0x44d884[_0x5885d2(0x149)]===_0x5e0d33);return _0x97b8a5||null;}export function saveProfile(_0x5451a7,_0x59a614,_0xc01dea=![]){saveProfileToUserConfig(_0x5451a7,_0x59a614);}export function deleteProfile(_0x2cf738){const _0x21ddae=a66_0x31bf93;validateProfileName(_0x2cf738);const _0x5a831f=getProfileDir(_0x2cf738);if(!a66_0x40d815[_0x21ddae(0x173)](_0x5a831f))throw new Error(_0x21ddae(0x13f)+_0x2cf738+'\x20does\x20not\x20exist');a66_0x40d815[_0x21ddae(0x175)](_0x5a831f,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x37f911,_0x441e76){const _0x36d976=a66_0x31bf93;validateProfileName(_0x37f911);const _0x4374cf=getGlobalConfigPath(),_0x584d2a=getConfigDir();!a66_0x40d815['existsSync'](_0x584d2a)&&createSecureDirectory(_0x584d2a);let _0x4f30b5={};if(a66_0x40d815[_0x36d976(0x173)](_0x4374cf))try{const _0x41c233=a66_0x40d815[_0x36d976(0x160)](_0x4374cf,_0x36d976(0x180));_0x4f30b5=JSON[_0x36d976(0x170)](_0x41c233);}catch{console[_0x36d976(0x178)](_0x36d976(0x17c)+_0x4374cf+',\x20creating\x20new\x20file');}!_0x4f30b5[_0x36d976(0x167)]&&(_0x4f30b5[_0x36d976(0x167)]={}),_0x4f30b5['profiles'][_0x37f911]=_0x441e76,writeSecureFile(_0x4374cf,JSON[_0x36d976(0x177)](_0x4f30b5,null,0x2));}export function removeProfileFromUserConfig(_0xdd1a40){const _0x11d498=a66_0x31bf93;validateProfileName(_0xdd1a40);const _0x26179e=getGlobalConfigPath();if(!a66_0x40d815[_0x11d498(0x173)](_0x26179e))throw new Error('Profile\x20\x27'+_0xdd1a40+'\x27\x20not\x20found\x20in\x20user\x20configuration');let _0x10ccde={};try{const _0x24362e=a66_0x40d815['readFileSync'](_0x26179e,_0x11d498(0x180));_0x10ccde=JSON[_0x11d498(0x170)](_0x24362e);}catch{throw new Error('Failed\x20to\x20parse\x20'+_0x26179e);}if(!_0x10ccde['profiles']||!_0x10ccde[_0x11d498(0x167)][_0xdd1a40])throw new Error(_0x11d498(0x13a)+_0xdd1a40+_0x11d498(0x15a));delete _0x10ccde[_0x11d498(0x167)][_0xdd1a40],_0x10ccde['profile']===_0xdd1a40&&delete _0x10ccde['profile'],writeSecureFile(_0x26179e,JSON[_0x11d498(0x177)](_0x10ccde,null,0x2));}export function getActiveProfile(){const _0xa8e06e=a66_0x31bf93,_0x36bef3=loadSessionContext();if(_0x36bef3?.[_0xa8e06e(0x143)])return _0x36bef3[_0xa8e06e(0x143)];if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x3e0125=getGlobalConfigPath();if(!a66_0x40d815[_0xa8e06e(0x173)](_0x3e0125))return null;try{const _0x5b269f=a66_0x40d815[_0xa8e06e(0x160)](_0x3e0125,_0xa8e06e(0x180)),_0x1ea784=JSON[_0xa8e06e(0x170)](_0x5b269f);return _0x1ea784['profile']||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x171dab){const _0x2cd34e=a66_0x31bf93,_0xcae1c3=getGlobalConfigPath(),_0x57b6d0=getConfigDir();!a66_0x40d815[_0x2cd34e(0x173)](_0x57b6d0)&&createSecureDirectory(_0x57b6d0);let _0x4b1093={};if(a66_0x40d815['existsSync'](_0xcae1c3))try{const _0x4539fe=a66_0x40d815[_0x2cd34e(0x160)](_0xcae1c3,_0x2cd34e(0x180));_0x4b1093=JSON[_0x2cd34e(0x170)](_0x4539fe);}catch{console[_0x2cd34e(0x178)](_0x2cd34e(0x17c)+_0xcae1c3+_0x2cd34e(0x13d));}_0x4b1093['site']=_0x171dab,writeSecureFile(_0xcae1c3,JSON[_0x2cd34e(0x177)](_0x4b1093,null,0x2));}export function saveActiveProfileToUserConfig(_0x225c38){const _0x30fb48=a66_0x31bf93;validateProfileName(_0x225c38);const _0x19dd30=getGlobalConfigPath(),_0x247042=getConfigDir();!a66_0x40d815['existsSync'](_0x247042)&&createSecureDirectory(_0x247042);let _0x5148cb={};if(a66_0x40d815[_0x30fb48(0x173)](_0x19dd30))try{const _0x170e1b=a66_0x40d815[_0x30fb48(0x160)](_0x19dd30,'utf-8');_0x5148cb=JSON[_0x30fb48(0x170)](_0x170e1b);}catch{console[_0x30fb48(0x178)](_0x30fb48(0x17c)+_0x19dd30+_0x30fb48(0x13d));}_0x5148cb[_0x30fb48(0x143)]=_0x225c38,writeSecureFile(_0x19dd30,JSON[_0x30fb48(0x177)](_0x5148cb,null,0x2));}function clearFieldFromUserConfig(_0x383c83){const _0x5e182d=a66_0x31bf93,_0x4b9aea=getGlobalConfigPath();if(!a66_0x40d815[_0x5e182d(0x173)](_0x4b9aea))return;let _0x526c0a={};try{const _0x47f91e=a66_0x40d815[_0x5e182d(0x160)](_0x4b9aea,'utf-8');_0x526c0a=JSON[_0x5e182d(0x170)](_0x47f91e);}catch{return;}delete _0x526c0a[_0x383c83],writeSecureFile(_0x4b9aea,JSON[_0x5e182d(0x177)](_0x526c0a,null,0x2));}export function clearDefaultSiteFromUserConfig(){clearFieldFromUserConfig('site');}export function clearActiveProfileFromUserConfig(){const _0x5405c3=a66_0x31bf93;clearFieldFromUserConfig(_0x5405c3(0x143));}export function createProfile(_0x22b3e6,_0x290141){const _0x181aa1=a66_0x31bf93;validateProfileName(_0x22b3e6);if(profileExists(_0x22b3e6))throw new Error(_0x181aa1(0x13f)+_0x22b3e6+'\x20already\x20exists');saveProfile(_0x22b3e6,_0x290141);}export function saveProfileCredentials(_0x5a5584,_0x4c906d){const _0x5f47cb=a66_0x31bf93;validateProfileName(_0x5a5584);if(!profileExists(_0x5a5584))throw new Error(_0x5f47cb(0x13f)+_0x5a5584+_0x5f47cb(0x166));const _0x1cd95c=getNewCredentialPath(_0x5a5584);writeSecureFile(_0x1cd95c,_0x4c906d);}function a66_0x3c5e(_0x181cce,_0x1f7b3c){_0x181cce=_0x181cce-0x13a;const _0x32cec1=a66_0x32ce();let _0x3c5ea7=_0x32cec1[_0x181cce];return _0x3c5ea7;}export function loadProfileCredentials(_0x206e0f){const _0x20d68a=a66_0x31bf93;validateProfileName(_0x206e0f);const _0x447e43=getNewCredentialPath(_0x206e0f);if(a66_0x40d815[_0x20d68a(0x173)](_0x447e43))try{return a66_0x40d815['readFileSync'](_0x447e43,'utf-8');}catch{}const _0x32de0b=getOldCredentialPath(_0x206e0f);if(a66_0x40d815['existsSync'](_0x32de0b)){console[_0x20d68a(0x178)]('\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27'+_0x206e0f+'\x27'),console[_0x20d68a(0x178)](_0x20d68a(0x187)),console[_0x20d68a(0x178)](_0x20d68a(0x17e)+_0x32de0b+_0x20d68a(0x17f)+_0x447e43+'\x22'),console[_0x20d68a(0x178)]('Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a');try{return a66_0x40d815[_0x20d68a(0x160)](_0x32de0b,_0x20d68a(0x180));}catch{return null;}}return null;}function a66_0x32ce(){const _0x46a1d7=['profiles','readdirSync','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','Invalid\x20profile\x20name:\x20','entries','\x27\x20will\x20be\x20ignored','parent_segment','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','values','parse','isDirectory','9BBqgiz','existsSync','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','rmSync','test','stringify','warn','INVALID_PROFILE_CONFIG','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','length','Warning:\x20Failed\x20to\x20parse\x20','10067824IrgxYz','\x20\x20mv\x20\x22','\x22\x20\x22','utf-8','database','set','Error:\x20','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','message','49ERCbFr','To\x20migrate:','Profile\x20\x27','\x20\x201.\x20Edit:\x20','has',',\x20creating\x20new\x20file','.env','Profile\x20','string','sort','push','profile','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','4329477vvmiKk','local','localeCompare','42348TtBpqk','name','\x0aWarning:\x20Failed\x20to\x20parse\x20','site','filter','144034wAhMEy','tdx.json','@tdx-studio','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','object','\x27:\x20config\x20must\x20be\x20an\x20object','Warning:\x20Profile\x20\x27','4894196nndlcC','llm_project','some','map','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','directory','\x27\x20not\x20found\x20in\x20user\x20configuration','description','keys','join','llm_agent','926517GNjwSA','readFileSync','toISOString','\x27:\x20unknown\x20config\x20key\x20\x27','user_info','5980850vnbHcX','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20underscore,\x20and\x20optional\x20@\x20prefix\x20for\x20reserved\x20profiles.','\x20does\x20not\x20exist'];a66_0x32ce=function(){return _0x46a1d7;};return a66_0x32ce();}
1
+ (function(_0x39d06e,_0x3b34cb){const _0x45c457=a66_0x915a,_0x130037=_0x39d06e();while(!![]){try{const _0x54d058=parseInt(_0x45c457(0x111))/0x1+-parseInt(_0x45c457(0x137))/0x2*(parseInt(_0x45c457(0xed))/0x3)+-parseInt(_0x45c457(0x10b))/0x4*(parseInt(_0x45c457(0xee))/0x5)+-parseInt(_0x45c457(0x116))/0x6*(-parseInt(_0x45c457(0x10e))/0x7)+-parseInt(_0x45c457(0x135))/0x8+parseInt(_0x45c457(0xef))/0x9+-parseInt(_0x45c457(0xf6))/0xa*(-parseInt(_0x45c457(0x109))/0xb);if(_0x54d058===_0x3b34cb)break;else _0x130037['push'](_0x130037['shift']());}catch(_0x18af3b){_0x130037['push'](_0x130037['shift']());}}}(a66_0x3b5d,0x37d3f));import*as a66_0x41950c from'node:fs';import*as a66_0x5e1a11 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(_0x450af2){const _0x275d74=a66_0x915a,_0x105b24={};if(!_0x450af2)return _0x105b24;for(const [_0x23d539,_0x5a3f71]of Object[_0x275d74(0xe5)](_0x450af2)){_0x23d539!==_0x275d74(0x117)&&_0x5a3f71!==undefined&&(_0x105b24[_0x23d539]=_0x5a3f71);}return _0x105b24;}export function getProfilesDir(){const _0x5ecf7f=a66_0x915a;return a66_0x5e1a11['join'](getConfigDir(),_0x5ecf7f(0x101));}function getProfileDir(_0x799ed8){const _0x469ec6=a66_0x915a;return a66_0x5e1a11[_0x469ec6(0x106)](getProfilesDir(),_0x799ed8);}function getProfileConfigPath(_0x190be3){const _0x482b78=a66_0x915a;return a66_0x5e1a11[_0x482b78(0x106)](getProfileDir(_0x190be3),_0x482b78(0xf0));}function getProfileEnvPath(_0x5b45bf){const _0x31c232=a66_0x915a;return a66_0x5e1a11[_0x31c232(0x106)](getProfileDir(_0x5b45bf),'.env');}function getGlobalConfigPath(){const _0x1c83dd=a66_0x915a;return a66_0x5e1a11['join'](getConfigDir(),_0x1c83dd(0xf0));}function validateProfileName(_0x3be189){const _0x25f8b8=a66_0x915a;if(/^@?[a-zA-Z0-9_-]+$/[_0x25f8b8(0x121)](_0x3be189))return;if(/^@tdx-studio:[a-zA-Z0-9_-]+:\d+(:\d+)?$/[_0x25f8b8(0x121)](_0x3be189))return;throw new Error(_0x25f8b8(0x110)+_0x3be189+'.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20underscore,\x20and\x20optional\x20@\x20prefix\x20for\x20reserved\x20profiles.');}function validateProfileConfig(_0x54dcdf,_0x516b48){const _0x3b959c=a66_0x915a;if(typeof _0x54dcdf!==_0x3b959c(0xf1)||_0x54dcdf===null)throw new SDKError(ErrorCode[_0x3b959c(0xec)],_0x3b959c(0x10a)+_0x516b48+_0x3b959c(0xf9));const _0x181325=[_0x3b959c(0x117),_0x3b959c(0x12a),_0x3b959c(0xe8),_0x3b959c(0x12c),'llm_project',_0x3b959c(0x118),'user_info'],_0x134d1a=_0x54dcdf;for(const _0x19c296 of Object['keys'](_0x134d1a)){!_0x181325[_0x3b959c(0xf8)](_0x19c296)&&console[_0x3b959c(0x133)](_0x3b959c(0x11c)+_0x516b48+'\x27:\x20unknown\x20config\x20key\x20\x27'+_0x19c296+_0x3b959c(0x129));}if(_0x134d1a[_0x3b959c(0x117)]!==undefined&&typeof _0x134d1a[_0x3b959c(0x117)]!==_0x3b959c(0x107))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0x3b959c(0x10a)+_0x516b48+_0x3b959c(0x11e));if(_0x134d1a[_0x3b959c(0x12a)]!==undefined&&typeof _0x134d1a[_0x3b959c(0x12a)]!==_0x3b959c(0x107))throw new SDKError(ErrorCode[_0x3b959c(0xec)],_0x3b959c(0x10a)+_0x516b48+_0x3b959c(0x108));if(_0x134d1a['database']!==undefined&&typeof _0x134d1a[_0x3b959c(0xe8)]!=='string')throw new SDKError(ErrorCode[_0x3b959c(0xec)],_0x3b959c(0x10a)+_0x516b48+_0x3b959c(0x114));if(_0x134d1a[_0x3b959c(0x12c)]!==undefined&&typeof _0x134d1a[_0x3b959c(0x12c)]!==_0x3b959c(0x107))throw new SDKError(ErrorCode[_0x3b959c(0xec)],_0x3b959c(0x10a)+_0x516b48+_0x3b959c(0xeb));if(_0x134d1a[_0x3b959c(0xf5)]!==undefined&&typeof _0x134d1a[_0x3b959c(0xf5)]!==_0x3b959c(0x107))throw new SDKError(ErrorCode[_0x3b959c(0xec)],_0x3b959c(0x10a)+_0x516b48+_0x3b959c(0xfd));if(_0x134d1a[_0x3b959c(0x118)]!==undefined&&typeof _0x134d1a[_0x3b959c(0x118)]!=='string')throw new SDKError(ErrorCode[_0x3b959c(0xec)],_0x3b959c(0x10a)+_0x516b48+_0x3b959c(0x130));return!![];}function loadProfilesFromTdxJson(_0x5ab262,_0x117f9e){const _0x48a79c=a66_0x915a;if(!a66_0x41950c[_0x48a79c(0x102)](_0x5ab262))return[];try{const _0x548420=a66_0x41950c[_0x48a79c(0x11f)](_0x5ab262,_0x48a79c(0x10f)),_0xe311eb=JSON[_0x48a79c(0x128)](_0x548420);if(!_0xe311eb[_0x48a79c(0x101)]||typeof _0xe311eb[_0x48a79c(0x101)]!==_0x48a79c(0xf1))return[];const _0x4975ec=[];for(const [_0x510405,_0x13f5cb]of Object['entries'](_0xe311eb['profiles'])){try{validateProfileConfig(_0x13f5cb,_0x510405);const _0x5afef1=getNewCredentialPath(_0x510405),_0x39e473=getOldCredentialPath(_0x510405),_0xec30dc=a66_0x41950c[_0x48a79c(0x102)](_0x5afef1)||a66_0x41950c['existsSync'](_0x39e473);_0x4975ec[_0x48a79c(0xe6)]({'name':_0x510405,'config':_0x13f5cb,'metadata':{'name':_0x510405,'createdAt':new Date()[_0x48a79c(0x105)]()},'hasCredentials':_0xec30dc,'scope':_0x117f9e});}catch(_0x563e04){_0x563e04 instanceof Error&&(console['warn'](_0x48a79c(0x10c)+_0x5ab262+':'),console[_0x48a79c(0x133)]('\x20\x20'+_0x563e04[_0x48a79c(0xfa)]+'\x0a'));}}return _0x4975ec;}catch(_0x399a47){return _0x399a47 instanceof SyntaxError?(console[_0x48a79c(0x133)](_0x48a79c(0xf4)+_0x5ab262+_0x48a79c(0x11a)),console['warn'](_0x48a79c(0x11d)+_0x399a47['message']+'\x0a')):console[_0x48a79c(0x133)](_0x48a79c(0x126)+_0x5ab262+':\x20'+_0x399a47+'\x0a'),[];}}export function getNewCredentialPath(_0x10a467){const _0xee1e85=a66_0x915a;return a66_0x5e1a11[_0xee1e85(0x106)](getConfigDir(),_0xee1e85(0xfe)+_0x10a467);}function getOldCredentialPath(_0x1e37bc){const _0x319633=a66_0x915a;return a66_0x5e1a11['join'](getProfilesDir(),_0x1e37bc,_0x319633(0x12e));}function loadProfilesFromTdxJsonFiles(){const _0x171821=a66_0x915a,_0x6ec00d=[],_0x236a9e=findProjectConfigPath();_0x236a9e&&_0x6ec00d['push'](...loadProfilesFromTdxJson(_0x236a9e,_0x171821(0xfc)));const _0x51173c=a66_0x5e1a11['join'](getConfigDir(),'tdx.json');return _0x6ec00d[_0x171821(0xe6)](...loadProfilesFromTdxJson(_0x51173c,_0x171821(0x112))),_0x6ec00d;}function loadProfilesFromDirectories(){const _0x2f367b=a66_0x915a,_0x5e871e=getProfilesDir();if(!a66_0x41950c[_0x2f367b(0x102)](_0x5e871e))return[];try{return a66_0x41950c[_0x2f367b(0x132)](_0x5e871e,{'withFileTypes':!![]})['filter'](_0x545da2=>_0x545da2[_0x2f367b(0x125)]())['map'](_0x164e27=>_0x164e27[_0x2f367b(0x120)])[_0x2f367b(0xea)](_0x36755b=>{const _0x4fbf9e=_0x2f367b,_0x31a28c=getProfileConfigPath(_0x36755b),_0xa3dec1=getProfileEnvPath(_0x36755b);return a66_0x41950c[_0x4fbf9e(0x102)](_0x31a28c)||a66_0x41950c[_0x4fbf9e(0x102)](_0xa3dec1);})[_0x2f367b(0x115)](_0x7d8524=>{const _0x553c5d=_0x2f367b,_0x5a43ec=loadProfileFromDirectory(_0x7d8524);if(_0x5a43ec)return{..._0x5a43ec,'scope':_0x553c5d(0xe9)};return null;})[_0x2f367b(0xea)](_0x385351=>_0x385351!==null);}catch{return[];}}function loadProfileFromDirectory(_0x5d7db5){const _0xbda86=a66_0x915a,_0x54e3d7=getProfileConfigPath(_0x5d7db5),_0x28ac2a=getOldCredentialPath(_0x5d7db5);if(!a66_0x41950c[_0xbda86(0x102)](_0x54e3d7)&&!a66_0x41950c[_0xbda86(0x102)](_0x28ac2a))return null;let _0x270a3d={},_0x157fde={'name':_0x5d7db5,'createdAt':new Date()[_0xbda86(0x105)]()};if(a66_0x41950c[_0xbda86(0x102)](_0x54e3d7))try{const _0x262f1b=a66_0x41950c[_0xbda86(0x11f)](_0x54e3d7,_0xbda86(0x10f)),_0x1e3934=JSON[_0xbda86(0x128)](_0x262f1b),{metadata:_0x4cfc7b,..._0x57096a}=_0x1e3934;_0x270a3d=_0x57096a,_0x4cfc7b&&(_0x157fde=_0x4cfc7b);}catch{}return{'name':_0x5d7db5,'config':_0x270a3d,'metadata':_0x157fde,'hasCredentials':a66_0x41950c[_0xbda86(0x102)](_0x28ac2a),'scope':_0xbda86(0xe9)};}export function listProfiles(){const _0x15c385=a66_0x915a,_0x148318=loadProfilesFromTdxJsonFiles(),_0x4373b5=loadProfilesFromDirectories();if(_0x4373b5[_0x15c385(0x10d)]>0x0){const _0xfcce7c=_0x4373b5[_0x15c385(0x115)](_0x3f83a5=>_0x3f83a5[_0x15c385(0x120)])['join'](',\x20'),_0x241cc9=getConfigDir();console[_0x15c385(0x133)]('\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20'+_0xfcce7c),console[_0x15c385(0x133)](_0x15c385(0x124)),console[_0x15c385(0x133)](_0x15c385(0x103)+a66_0x5e1a11[_0x15c385(0x106)](_0x241cc9,_0x15c385(0xf0))),console[_0x15c385(0x133)](_0x15c385(0xff)),console[_0x15c385(0x133)](_0x15c385(0x127));}const _0x249f49=[..._0x148318,..._0x4373b5],_0x46f085=new Map();for(const _0xe31fa3 of _0x249f49){!_0x46f085[_0x15c385(0x123)](_0xe31fa3['name'])&&_0x46f085[_0x15c385(0x134)](_0xe31fa3[_0x15c385(0x120)],_0xe31fa3);}return Array[_0x15c385(0xfb)](_0x46f085[_0x15c385(0xe7)]())['sort']((_0x502c79,_0x2e6c43)=>_0x502c79[_0x15c385(0x120)][_0x15c385(0xf2)](_0x2e6c43['name']));}export function profileExists(_0x5cf08b){const _0x3825c2=a66_0x915a,_0x30a7e5=listProfiles();return _0x30a7e5[_0x3825c2(0x131)](_0x3e04f4=>_0x3e04f4[_0x3825c2(0x120)]===_0x5cf08b);}export function loadProfile(_0x1b9750){const _0x5920b5=a66_0x915a;validateProfileName(_0x1b9750);const _0x420757=listProfiles(),_0x4fd469=_0x420757[_0x5920b5(0x136)](_0x21ef30=>_0x21ef30[_0x5920b5(0x120)]===_0x1b9750);return _0x4fd469||null;}export function saveProfile(_0x44a386,_0x3e891e,_0x31fa16=![]){saveProfileToUserConfig(_0x44a386,_0x3e891e);}export function deleteProfile(_0x49cca9){const _0x2e915b=a66_0x915a;validateProfileName(_0x49cca9);const _0x36470d=getProfileDir(_0x49cca9);if(!a66_0x41950c[_0x2e915b(0x102)](_0x36470d))throw new Error('Profile\x20'+_0x49cca9+_0x2e915b(0xf7));a66_0x41950c[_0x2e915b(0x122)](_0x36470d,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x456292,_0x2628cb){const _0x554dfc=a66_0x915a;validateProfileName(_0x456292);const _0x44d1fc=getGlobalConfigPath(),_0x1cdf0c=getConfigDir();!a66_0x41950c['existsSync'](_0x1cdf0c)&&createSecureDirectory(_0x1cdf0c);let _0x48691d={};if(a66_0x41950c[_0x554dfc(0x102)](_0x44d1fc))try{const _0x17a435=a66_0x41950c[_0x554dfc(0x11f)](_0x44d1fc,_0x554dfc(0x10f));_0x48691d=JSON['parse'](_0x17a435);}catch{console['warn'](_0x554dfc(0x12b)+_0x44d1fc+',\x20creating\x20new\x20file');}!_0x48691d['profiles']&&(_0x48691d[_0x554dfc(0x101)]={}),_0x48691d[_0x554dfc(0x101)][_0x456292]=_0x2628cb,writeSecureFile(_0x44d1fc,JSON[_0x554dfc(0x119)](_0x48691d,null,0x2));}export function removeProfileFromUserConfig(_0x151649){const _0x5bf063=a66_0x915a;validateProfileName(_0x151649);const _0x5b95e9=getGlobalConfigPath();if(!a66_0x41950c[_0x5bf063(0x102)](_0x5b95e9))throw new Error(_0x5bf063(0x10a)+_0x151649+_0x5bf063(0x12d));let _0x559333={};try{const _0x2acb53=a66_0x41950c[_0x5bf063(0x11f)](_0x5b95e9,_0x5bf063(0x10f));_0x559333=JSON[_0x5bf063(0x128)](_0x2acb53);}catch{throw new Error(_0x5bf063(0xf3)+_0x5b95e9);}if(!_0x559333[_0x5bf063(0x101)]||!_0x559333[_0x5bf063(0x101)][_0x151649])throw new Error(_0x5bf063(0x10a)+_0x151649+_0x5bf063(0x12d));delete _0x559333[_0x5bf063(0x101)][_0x151649],_0x559333[_0x5bf063(0x12f)]===_0x151649&&delete _0x559333[_0x5bf063(0x12f)],writeSecureFile(_0x5b95e9,JSON[_0x5bf063(0x119)](_0x559333,null,0x2));}export function getActiveProfile(){const _0x3a91e1=a66_0x915a,_0x4bce0d=loadSessionContext();if(_0x4bce0d?.[_0x3a91e1(0x12f)])return _0x4bce0d['profile'];if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0xc0605d=getGlobalConfigPath();if(!a66_0x41950c[_0x3a91e1(0x102)](_0xc0605d))return null;try{const _0x5ec28d=a66_0x41950c[_0x3a91e1(0x11f)](_0xc0605d,_0x3a91e1(0x10f)),_0x151431=JSON[_0x3a91e1(0x128)](_0x5ec28d);return _0x151431[_0x3a91e1(0x12f)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x20c928){const _0x3303e5=a66_0x915a,_0x4d835e=getGlobalConfigPath(),_0x2bd309=getConfigDir();!a66_0x41950c[_0x3303e5(0x102)](_0x2bd309)&&createSecureDirectory(_0x2bd309);let _0x9e6a6e={};if(a66_0x41950c[_0x3303e5(0x102)](_0x4d835e))try{const _0x2d711f=a66_0x41950c['readFileSync'](_0x4d835e,_0x3303e5(0x10f));_0x9e6a6e=JSON[_0x3303e5(0x128)](_0x2d711f);}catch{console[_0x3303e5(0x133)](_0x3303e5(0x12b)+_0x4d835e+_0x3303e5(0x100));}_0x9e6a6e[_0x3303e5(0x12a)]=_0x20c928,writeSecureFile(_0x4d835e,JSON[_0x3303e5(0x119)](_0x9e6a6e,null,0x2));}export function saveActiveProfileToUserConfig(_0x216fb7){const _0x1e1742=a66_0x915a;validateProfileName(_0x216fb7);const _0x57b01a=getGlobalConfigPath(),_0x24afb9=getConfigDir();!a66_0x41950c[_0x1e1742(0x102)](_0x24afb9)&&createSecureDirectory(_0x24afb9);let _0x64ae79={};if(a66_0x41950c[_0x1e1742(0x102)](_0x57b01a))try{const _0x25318f=a66_0x41950c[_0x1e1742(0x11f)](_0x57b01a,'utf-8');_0x64ae79=JSON[_0x1e1742(0x128)](_0x25318f);}catch{console[_0x1e1742(0x133)](_0x1e1742(0x12b)+_0x57b01a+_0x1e1742(0x100));}_0x64ae79['profile']=_0x216fb7,writeSecureFile(_0x57b01a,JSON[_0x1e1742(0x119)](_0x64ae79,null,0x2));}function a66_0x915a(_0x69546c,_0x186677){_0x69546c=_0x69546c-0xe5;const _0x3b5dbf=a66_0x3b5d();let _0x915a68=_0x3b5dbf[_0x69546c];return _0x915a68;}function clearFieldFromUserConfig(_0x262b01){const _0x53463e=a66_0x915a,_0x4af0e8=getGlobalConfigPath();if(!a66_0x41950c[_0x53463e(0x102)](_0x4af0e8))return;let _0x5b5127={};try{const _0x54abd1=a66_0x41950c[_0x53463e(0x11f)](_0x4af0e8,'utf-8');_0x5b5127=JSON[_0x53463e(0x128)](_0x54abd1);}catch{return;}delete _0x5b5127[_0x262b01],writeSecureFile(_0x4af0e8,JSON[_0x53463e(0x119)](_0x5b5127,null,0x2));}function a66_0x3b5d(){const _0x775422=['\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','some','readdirSync','warn','set','1921912aHCmrR','find','12QQAGeD','entries','push','values','database','directory','filter','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','INVALID_PROFILE_CONFIG','185862aLMxli','689205uirTLg','3016512nUFnNH','tdx.json','object','localeCompare','Failed\x20to\x20parse\x20','\x0aWarning:\x20Failed\x20to\x20parse\x20','llm_project','160nRmhnW','\x20does\x20not\x20exist','includes','\x27:\x20config\x20must\x20be\x20an\x20object','message','from','local','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','.env.','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)',',\x20creating\x20new\x20file','profiles','existsSync','\x20\x201.\x20Edit:\x20','\x20already\x20exists','toISOString','join','string','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','442508AebUgq','Profile\x20\x27','12DMuCQk','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','length','6055MOVOjX','utf-8','Invalid\x20profile\x20name:\x20','33141WRTdOb','user','To\x20migrate:','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','map','1680PIFlSm','description','llm_agent','stringify',':\x20Invalid\x20JSON\x20syntax','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','Warning:\x20Profile\x20\x27','Error:\x20','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','readFileSync','name','test','rmSync','has','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','isDirectory','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','parse','\x27\x20will\x20be\x20ignored','site','Warning:\x20Failed\x20to\x20parse\x20','parent_segment','\x27\x20not\x20found\x20in\x20user\x20configuration','.env','profile'];a66_0x3b5d=function(){return _0x775422;};return a66_0x3b5d();}export function clearDefaultSiteFromUserConfig(){const _0x15ba1a=a66_0x915a;clearFieldFromUserConfig(_0x15ba1a(0x12a));}export function clearActiveProfileFromUserConfig(){const _0xfa4375=a66_0x915a;clearFieldFromUserConfig(_0xfa4375(0x12f));}export function createProfile(_0x4ffef6,_0x29a5fd){const _0x47a98c=a66_0x915a;validateProfileName(_0x4ffef6);if(profileExists(_0x4ffef6))throw new Error('Profile\x20'+_0x4ffef6+_0x47a98c(0x104));saveProfile(_0x4ffef6,_0x29a5fd);}export function saveProfileCredentials(_0xb535d9,_0xd3682){const _0x1c884a=a66_0x915a;validateProfileName(_0xb535d9);if(!profileExists(_0xb535d9))throw new Error('Profile\x20'+_0xb535d9+_0x1c884a(0xf7));const _0x23e2c5=getNewCredentialPath(_0xb535d9);writeSecureFile(_0x23e2c5,_0xd3682);}export function loadProfileCredentials(_0x33c4da){const _0x24adca=a66_0x915a;validateProfileName(_0x33c4da);const _0x15e938=getNewCredentialPath(_0x33c4da);if(a66_0x41950c['existsSync'](_0x15e938))try{return a66_0x41950c[_0x24adca(0x11f)](_0x15e938,_0x24adca(0x10f));}catch{}const _0x234093=getOldCredentialPath(_0x33c4da);if(a66_0x41950c[_0x24adca(0x102)](_0x234093)){console[_0x24adca(0x133)](_0x24adca(0x11b)+_0x33c4da+'\x27'),console[_0x24adca(0x133)](_0x24adca(0x113)),console['warn']('\x20\x20mv\x20\x22'+_0x234093+'\x22\x20\x22'+_0x15e938+'\x22'),console[_0x24adca(0x133)]('Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a');try{return a66_0x41950c[_0x24adca(0x11f)](_0x234093,_0x24adca(0x10f));}catch{return null;}}return null;}
@@ -1 +1 @@
1
- const a67_0x3fba1a=a67_0x198f;(function(_0x251bea,_0x5e1f6d){const _0x1410a3=a67_0x198f,_0x511da3=_0x251bea();while(!![]){try{const _0x21c1fd=-parseInt(_0x1410a3(0x14a))/0x1+-parseInt(_0x1410a3(0x156))/0x2+parseInt(_0x1410a3(0x159))/0x3+parseInt(_0x1410a3(0x142))/0x4+-parseInt(_0x1410a3(0x140))/0x5+-parseInt(_0x1410a3(0x145))/0x6+-parseInt(_0x1410a3(0x148))/0x7*(-parseInt(_0x1410a3(0x147))/0x8);if(_0x21c1fd===_0x5e1f6d)break;else _0x511da3['push'](_0x511da3['shift']());}catch(_0x1de739){_0x511da3['push'](_0x511da3['shift']());}}}(a67_0x2950,0xd67ff));import*as a67_0x26ad1c from'node:fs';import*as a67_0x17713a from'node:path';const PROJECT_CONFIG_FILENAME=a67_0x3fba1a(0x155);export function findProjectConfigPath(_0x4891ea){const _0x50a0b5=a67_0x3fba1a;let _0x207029=_0x4891ea||process[_0x50a0b5(0x141)]();while(!![]){const _0x44f0d5=a67_0x17713a[_0x50a0b5(0x143)](_0x207029,PROJECT_CONFIG_FILENAME);if(a67_0x26ad1c[_0x50a0b5(0x14b)](_0x44f0d5))return _0x44f0d5;const _0x4c310e=a67_0x17713a[_0x50a0b5(0x14e)](_0x207029);if(_0x4c310e===_0x207029)return null;_0x207029=_0x4c310e;}}export function loadProjectConfig(_0x38249e){const _0x27f9de=a67_0x3fba1a,_0x3ef729=findProjectConfigPath(_0x38249e);if(!_0x3ef729)return null;try{const _0x3f0772=a67_0x26ad1c[_0x27f9de(0x146)](_0x3ef729,_0x27f9de(0x154)),_0x3aec4c=JSON[_0x27f9de(0x14d)](_0x3f0772),_0x972c8b=JSON['stringify'](_0x3aec4c);if(_0x972c8b[_0x27f9de(0x144)](_0x27f9de(0x13d))||_0x972c8b[_0x27f9de(0x144)](_0x27f9de(0x149))||_0x972c8b[_0x27f9de(0x144)](_0x27f9de(0x158)))throw new Error(_0x27f9de(0x14f)+_0x3ef729+').\x20'+'Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.');const {metadata:_0x294988,profile:_0x2e543a,..._0x388a06}=_0x3aec4c;return _0x2e543a&&console[_0x27f9de(0x152)](_0x27f9de(0x153)+_0x3ef729+_0x27f9de(0x15b)+_0x27f9de(0x13f)),_0x388a06;}catch(_0x288e56){if(_0x288e56 instanceof Error&&_0x27f9de(0x13e)in _0x288e56&&_0x288e56[_0x27f9de(0x13e)]===_0x27f9de(0x151))return null;throw new Error(_0x27f9de(0x14c)+_0x3ef729+':\x20'+_0x288e56);}}export function saveProjectConfig(_0x275d43,_0xb425c2){const _0x175df5=a67_0x3fba1a,_0x1b613e=_0xb425c2||process[_0x175df5(0x141)](),_0x3b4e38=a67_0x17713a['join'](_0x1b613e,PROJECT_CONFIG_FILENAME),_0x2e9fa5=JSON[_0x175df5(0x157)](_0x275d43);if(_0x2e9fa5[_0x175df5(0x144)](_0x175df5(0x13d))||_0x2e9fa5[_0x175df5(0x144)](_0x175df5(0x149))||_0x2e9fa5['includes'](_0x175df5(0x158)))throw new Error(_0x175df5(0x15a));if('profile'in _0x275d43)throw new Error(_0x175df5(0x150));a67_0x26ad1c[_0x175df5(0x15c)](_0x3b4e38,JSON[_0x175df5(0x157)](_0x275d43,null,0x2));}export function hasProjectConfig(_0x3555e3){return findProjectConfigPath(_0x3555e3)!==null;}function a67_0x2950(){const _0x38100c=['stringify','api_key','2067351irggQR','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','\x20is\x20ignored.\x20','writeFileSync','TD_API_KEY','code','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','5955570ERkQPR','cwd','4299240ttLWdB','join','includes','529920nobcCG','readFileSync','808QVDEAo','211414nanWgb','apiKey','1475608nPAXgo','existsSync','Failed\x20to\x20load\x20project\x20config\x20from\x20','parse','dirname','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','ENOENT','warn','Warning:\x20\x27profile\x27\x20field\x20in\x20','utf-8','tdx.json','2361392bNlEYA'];a67_0x2950=function(){return _0x38100c;};return a67_0x2950();}function a67_0x198f(_0x4fbe7f,_0x3d3df5){_0x4fbe7f=_0x4fbe7f-0x13d;const _0x2950e5=a67_0x2950();let _0x198f28=_0x2950e5[_0x4fbe7f];return _0x198f28;}export function getProjectRoot(_0x3be14b){const _0x1d7708=a67_0x3fba1a,_0x491cf2=findProjectConfigPath(_0x3be14b);return _0x491cf2?a67_0x17713a[_0x1d7708(0x14e)](_0x491cf2):null;}
1
+ (function(_0x3f2046,_0x413269){const _0x262150=a67_0x5c24,_0x3e8f8d=_0x3f2046();while(!![]){try{const _0x5d5fe7=parseInt(_0x262150(0x1d9))/0x1+parseInt(_0x262150(0x1d5))/0x2+parseInt(_0x262150(0x1e6))/0x3+-parseInt(_0x262150(0x1cd))/0x4+-parseInt(_0x262150(0x1db))/0x5*(-parseInt(_0x262150(0x1d3))/0x6)+-parseInt(_0x262150(0x1e4))/0x7*(parseInt(_0x262150(0x1d0))/0x8)+-parseInt(_0x262150(0x1d2))/0x9*(parseInt(_0x262150(0x1d8))/0xa);if(_0x5d5fe7===_0x413269)break;else _0x3e8f8d['push'](_0x3e8f8d['shift']());}catch(_0x40788c){_0x3e8f8d['push'](_0x3e8f8d['shift']());}}}(a67_0x2de3,0x949e8));import*as a67_0x1f35cb from'node:fs';function a67_0x5c24(_0x332d33,_0x39e3bc){_0x332d33=_0x332d33-0x1cc;const _0x2de33a=a67_0x2de3();let _0x5c24d0=_0x2de33a[_0x332d33];return _0x5c24d0;}import*as a67_0x336d2e from'node:path';const PROJECT_CONFIG_FILENAME='tdx.json';export function findProjectConfigPath(_0x25942b){const _0x5d73a6=a67_0x5c24;let _0x53c9ac=_0x25942b||process[_0x5d73a6(0x1e7)]();while(!![]){const _0x2a17fb=a67_0x336d2e[_0x5d73a6(0x1d1)](_0x53c9ac,PROJECT_CONFIG_FILENAME);if(a67_0x1f35cb['existsSync'](_0x2a17fb))return _0x2a17fb;const _0xec2a11=a67_0x336d2e[_0x5d73a6(0x1e9)](_0x53c9ac);if(_0xec2a11===_0x53c9ac)return null;_0x53c9ac=_0xec2a11;}}export function loadProjectConfig(_0x27e6bf){const _0x1dc138=a67_0x5c24,_0x27cdeb=findProjectConfigPath(_0x27e6bf);if(!_0x27cdeb)return null;try{const _0x49d96d=a67_0x1f35cb[_0x1dc138(0x1dc)](_0x27cdeb,_0x1dc138(0x1e2)),_0xa44a29=JSON['parse'](_0x49d96d),_0xb97a30=JSON[_0x1dc138(0x1d4)](_0xa44a29);if(_0xb97a30['includes']('TD_API_KEY')||_0xb97a30['includes'](_0x1dc138(0x1d6))||_0xb97a30['includes']('api_key'))throw new Error(_0x1dc138(0x1cc)+_0x27cdeb+_0x1dc138(0x1dd)+'Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.');const {metadata:_0x243209,profile:_0x127934,..._0x2baa21}=_0xa44a29;return _0x127934&&console[_0x1dc138(0x1e5)]('Warning:\x20\x27profile\x27\x20field\x20in\x20'+_0x27cdeb+_0x1dc138(0x1de)+'Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json'),_0x2baa21;}catch(_0x315c31){if(_0x315c31 instanceof Error&&_0x1dc138(0x1e0)in _0x315c31&&_0x315c31[_0x1dc138(0x1e0)]===_0x1dc138(0x1da))return null;throw new Error(_0x1dc138(0x1d7)+_0x27cdeb+':\x20'+_0x315c31);}}function a67_0x2de3(){const _0x3ba65a=['241263VNzehE','25062MaVOgX','stringify','1519414sMQNZe','apiKey','Failed\x20to\x20load\x20project\x20config\x20from\x20','330DoFkRo','706491CWFJpk','ENOENT','1255PRkOnn','readFileSync',').\x20','\x20is\x20ignored.\x20','TD_API_KEY','code','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','utf-8','profile','1285585nXGFeo','warn','524571fFggWd','cwd','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','dirname','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','3315188ArwMzl','writeFileSync','includes','16ipEyef','join'];a67_0x2de3=function(){return _0x3ba65a;};return a67_0x2de3();}export function saveProjectConfig(_0x5f0bd5,_0x26a508){const _0x5bbc9b=a67_0x5c24,_0x45202c=_0x26a508||process[_0x5bbc9b(0x1e7)](),_0x118915=a67_0x336d2e[_0x5bbc9b(0x1d1)](_0x45202c,PROJECT_CONFIG_FILENAME),_0x465358=JSON[_0x5bbc9b(0x1d4)](_0x5f0bd5);if(_0x465358[_0x5bbc9b(0x1cf)](_0x5bbc9b(0x1df))||_0x465358[_0x5bbc9b(0x1cf)](_0x5bbc9b(0x1d6))||_0x465358[_0x5bbc9b(0x1cf)]('api_key'))throw new Error(_0x5bbc9b(0x1e8));if(_0x5bbc9b(0x1e3)in _0x5f0bd5)throw new Error(_0x5bbc9b(0x1e1));a67_0x1f35cb[_0x5bbc9b(0x1ce)](_0x118915,JSON[_0x5bbc9b(0x1d4)](_0x5f0bd5,null,0x2));}export function hasProjectConfig(_0x54e818){return findProjectConfigPath(_0x54e818)!==null;}export function getProjectRoot(_0x19e6a3){const _0xc3948e=a67_0x5c24,_0x54e4ff=findProjectConfigPath(_0x19e6a3);return _0x54e4ff?a67_0x336d2e[_0xc3948e(0x1e9)](_0x54e4ff):null;}
@@ -1 +1 @@
1
- (function(_0x2db90c,_0x3bb72f){const _0x6612ba=a68_0x266e,_0x527deb=_0x2db90c();while(!![]){try{const _0x355d55=parseInt(_0x6612ba(0x1f8))/0x1*(parseInt(_0x6612ba(0x1f1))/0x2)+parseInt(_0x6612ba(0x1e7))/0x3+-parseInt(_0x6612ba(0x20b))/0x4*(parseInt(_0x6612ba(0x1f6))/0x5)+-parseInt(_0x6612ba(0x1ff))/0x6+parseInt(_0x6612ba(0x204))/0x7*(parseInt(_0x6612ba(0x1e9))/0x8)+parseInt(_0x6612ba(0x1f5))/0x9+parseInt(_0x6612ba(0x207))/0xa;if(_0x355d55===_0x3bb72f)break;else _0x527deb['push'](_0x527deb['shift']());}catch(_0x3f9c5e){_0x527deb['push'](_0x527deb['shift']());}}}(a68_0xbf5e,0xa58cd));import*as a68_0x2ab8e9 from'node:fs';import*as a68_0x3f7051 from'node:path';import*as a68_0x2f20e8 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 _0x457b0b=a68_0x266e,_0x147aa2=process.env.TDX_CONFIG_DIR||a68_0x3f7051[_0x457b0b(0x1eb)](a68_0x2f20e8[_0x457b0b(0x203)](),_0x457b0b(0x1fa),'tdx');return a68_0x3f7051[_0x457b0b(0x1eb)](_0x147aa2,'sessions');}function getSessionPath(_0x3258e5){const _0x10cb03=a68_0x266e;return a68_0x3f7051[_0x10cb03(0x1eb)](getSessionsDir(),_0x3258e5+'.json');}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x1e73ed){const _0x18d065=a68_0x266e;if(_0x1e73ed)return _0x1e73ed;if(process.env.TDX_SESSION)return process.env.TDX_SESSION;return getCurrentSessionPID()[_0x18d065(0x205)]();}export function loadSessionContext(_0x23cc31){const _0x51ad0d=a68_0x266e,_0x1a2ec2=getSessionID(_0x23cc31),_0x219d82=/^\d+$/[_0x51ad0d(0x206)](_0x1a2ec2)?parseInt(_0x1a2ec2,0xa):null;return _0x219d82!==null?loadSessionContextByPID(_0x219d82):loadSessionContextByString(_0x1a2ec2);}export function loadSessionContextByPID(_0x5846ff){const _0x507807=a68_0x266e,_0x2fce47=getSessionPath(_0x5846ff);if(!a68_0x2ab8e9[_0x507807(0x1fb)](_0x2fce47))return null;try{const _0x406c03=a68_0x2ab8e9[_0x507807(0x1f4)](_0x2fce47,_0x507807(0x1ef)),_0x22d3a4=JSON[_0x507807(0x1ec)](_0x406c03),_0x40ea3b=new Date(_0x22d3a4[_0x507807(0x1f2)])[_0x507807(0x1f3)](),_0xc9a087=Date[_0x507807(0x1fe)]();if(_0xc9a087-_0x40ea3b>SESSION_EXPIRATION_MS)return a68_0x2ab8e9['unlinkSync'](_0x2fce47),null;const _0x40b13=JSON[_0x507807(0x1f9)](_0x22d3a4);if(_0x40b13[_0x507807(0x201)](_0x507807(0x1e8))||_0x40b13['includes'](_0x507807(0x1ed))||_0x40b13[_0x507807(0x201)](_0x507807(0x1f0)))return console['warn']('Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20'+_0x2fce47+_0x507807(0x1ea)),a68_0x2ab8e9[_0x507807(0x1f7)](_0x2fce47),null;return _0x22d3a4;}catch{try{a68_0x2ab8e9[_0x507807(0x1f7)](_0x2fce47);}catch{}return null;}}function loadSessionContextByString(_0x17600d){const _0x143d07=a68_0x266e,_0x53697a=a68_0x3f7051[_0x143d07(0x1eb)](getSessionsDir(),_0x17600d+_0x143d07(0x1fc));if(!a68_0x2ab8e9[_0x143d07(0x1fb)](_0x53697a))return null;try{const _0x1ee2b6=a68_0x2ab8e9[_0x143d07(0x1f4)](_0x53697a,'utf-8'),_0x2db435=JSON['parse'](_0x1ee2b6),_0xddfe9f=new Date(_0x2db435[_0x143d07(0x1f2)])[_0x143d07(0x1f3)](),_0x141f64=Date[_0x143d07(0x1fe)]();if(_0x141f64-_0xddfe9f>SESSION_EXPIRATION_MS)return a68_0x2ab8e9[_0x143d07(0x1f7)](_0x53697a),null;const _0x3df3fe=JSON[_0x143d07(0x1f9)](_0x2db435);if(_0x3df3fe['includes'](_0x143d07(0x1e8))||_0x3df3fe[_0x143d07(0x201)]('apiKey')||_0x3df3fe[_0x143d07(0x201)](_0x143d07(0x1f0)))return console[_0x143d07(0x1fd)](_0x143d07(0x20c)+_0x53697a+'.\x20This\x20is\x20insecure.\x20Removing\x20session.'),a68_0x2ab8e9[_0x143d07(0x1f7)](_0x53697a),null;return _0x2db435;}catch{try{a68_0x2ab8e9['unlinkSync'](_0x53697a);}catch{}return null;}}function a68_0xbf5e(){const _0x5dbda8=['replace','homedir','354263gRpzjy','toString','test','10664620Dwznxf','endsWith','toISOString','writeFileSync','32qIXGmr','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','push','2352729arznfY','TD_API_KEY','88zXrVQB','.\x20This\x20is\x20insecure.\x20Removing\x20session.','join','parse','apiKey','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','utf-8','api_key','878630gzEfsk','createdAt','getTime','readFileSync','4493934uhgdTx','831860lCDYAQ','unlinkSync','1yZDnQU','stringify','.config','existsSync','.json','warn','now','8021856FBSUlI','readdirSync','includes'];a68_0xbf5e=function(){return _0x5dbda8;};return a68_0xbf5e();}export function saveSessionContext(_0x238e52,_0x1c1fac){const _0x4c0fa5=a68_0x266e,_0x4ed1a7=getSessionID(_0x1c1fac),_0x50e2b7=/^\d+$/[_0x4c0fa5(0x206)](_0x4ed1a7)?parseInt(_0x4ed1a7,0xa):getCurrentSessionPID(),_0x4107f7=a68_0x3f7051[_0x4c0fa5(0x1eb)](getSessionsDir(),_0x4ed1a7+_0x4c0fa5(0x1fc)),_0xbd4680=getSessionsDir();createSecureDirectory(_0xbd4680);const _0x7ae660=JSON[_0x4c0fa5(0x1f9)](_0x238e52);if(_0x7ae660[_0x4c0fa5(0x201)]('TD_API_KEY')||_0x7ae660[_0x4c0fa5(0x201)](_0x4c0fa5(0x1ed))||_0x7ae660[_0x4c0fa5(0x201)](_0x4c0fa5(0x1f0)))throw new Error(_0x4c0fa5(0x1ee));let _0x401c6f;const _0x456691=/^\d+$/[_0x4c0fa5(0x206)](_0x4ed1a7)?loadSessionContextByPID(parseInt(_0x4ed1a7,0xa)):loadSessionContextByString(_0x4ed1a7);_0x456691?_0x401c6f={..._0x456691,..._0x238e52,'pid':_0x50e2b7,'sessionId':_0x4ed1a7!==_0x50e2b7[_0x4c0fa5(0x205)]()?_0x4ed1a7:undefined,'updatedAt':new Date()['toISOString']()}:_0x401c6f={'pid':_0x50e2b7,'sessionId':_0x4ed1a7!==_0x50e2b7[_0x4c0fa5(0x205)]()?_0x4ed1a7:undefined,..._0x238e52,'createdAt':new Date()[_0x4c0fa5(0x209)](),'updatedAt':new Date()['toISOString']()},a68_0x2ab8e9['writeFileSync'](_0x4107f7,JSON[_0x4c0fa5(0x1f9)](_0x401c6f,null,0x2));}export function clearSessionContext(_0x319daf){const _0x1675bf=a68_0x266e,_0x108add=getSessionID(_0x319daf),_0x19e7ed=a68_0x3f7051[_0x1675bf(0x1eb)](getSessionsDir(),_0x108add+_0x1675bf(0x1fc));a68_0x2ab8e9[_0x1675bf(0x1fb)](_0x19e7ed)&&a68_0x2ab8e9['unlinkSync'](_0x19e7ed);}export function clearSessionContextField(_0x4de883,_0x322f8b){const _0x2cc60b=a68_0x266e,_0x8499fd=getSessionID(_0x322f8b),_0x3082f4=a68_0x3f7051['join'](getSessionsDir(),_0x8499fd+_0x2cc60b(0x1fc));if(!a68_0x2ab8e9[_0x2cc60b(0x1fb)](_0x3082f4))return;try{const _0x30b43f=a68_0x2ab8e9['readFileSync'](_0x3082f4,_0x2cc60b(0x1ef)),_0x2baf7b=JSON[_0x2cc60b(0x1ec)](_0x30b43f);delete _0x2baf7b[_0x4de883],a68_0x2ab8e9[_0x2cc60b(0x20a)](_0x3082f4,JSON[_0x2cc60b(0x1f9)](_0x2baf7b,null,0x2));}catch{}}function a68_0x266e(_0x32abe4,_0x5604a6){_0x32abe4=_0x32abe4-0x1e6;const _0xbf5ea6=a68_0xbf5e();let _0x266e22=_0xbf5ea6[_0x32abe4];return _0x266e22;}export function cleanExpiredSessions(){const _0x578e1a=a68_0x266e,_0x5f15d8=getSessionsDir();if(!a68_0x2ab8e9['existsSync'](_0x5f15d8))return 0x0;let _0x2910ec=0x0;const _0x5d8d4e=Date[_0x578e1a(0x1fe)]();try{const _0x38e4a0=a68_0x2ab8e9[_0x578e1a(0x200)](_0x5f15d8);for(const _0x488883 of _0x38e4a0){if(!_0x488883[_0x578e1a(0x208)](_0x578e1a(0x1fc)))continue;const _0x506a34=a68_0x3f7051[_0x578e1a(0x1eb)](_0x5f15d8,_0x488883),_0x5e3dc5=_0x488883[_0x578e1a(0x202)]('.json',''),_0x1d7b89=parseInt(_0x5e3dc5,0xa),_0x3b3451=!isNaN(_0x1d7b89);if(_0x3b3451){if(!isProcessRunning(_0x1d7b89)){a68_0x2ab8e9['unlinkSync'](_0x506a34),_0x2910ec++;continue;}}try{const _0x27a357=a68_0x2ab8e9[_0x578e1a(0x1f4)](_0x506a34,'utf-8'),_0x46b349=JSON[_0x578e1a(0x1ec)](_0x27a357),_0x204443=new Date(_0x46b349[_0x578e1a(0x1f2)])[_0x578e1a(0x1f3)]();_0x5d8d4e-_0x204443>SESSION_EXPIRATION_MS&&(a68_0x2ab8e9[_0x578e1a(0x1f7)](_0x506a34),_0x2910ec++);}catch{a68_0x2ab8e9[_0x578e1a(0x1f7)](_0x506a34),_0x2910ec++;}}}catch{}return _0x2910ec;}export function listActiveSessions(){const _0x5bc64b=a68_0x266e,_0x1ffd8d=getSessionsDir();if(!a68_0x2ab8e9[_0x5bc64b(0x1fb)](_0x1ffd8d))return[];try{const _0x42ac9c=a68_0x2ab8e9[_0x5bc64b(0x200)](_0x1ffd8d),_0x4da9e0=[];for(const _0x15c5b0 of _0x42ac9c){if(!_0x15c5b0['endsWith'](_0x5bc64b(0x1fc)))continue;const _0x319634=_0x15c5b0[_0x5bc64b(0x202)](_0x5bc64b(0x1fc),''),_0x459190=parseInt(_0x319634,0xa);!isNaN(_0x459190)&&isProcessRunning(_0x459190)&&_0x4da9e0[_0x5bc64b(0x1e6)](_0x459190);}return _0x4da9e0['sort']((_0xa36b6d,_0x11a4b1)=>_0xa36b6d-_0x11a4b1);}catch{return[];}}
1
+ (function(_0x131f6d,_0x4ec1c2){const _0x44ed9=a68_0x2df4,_0x2eeb5f=_0x131f6d();while(!![]){try{const _0x1dfa04=parseInt(_0x44ed9(0x1de))/0x1+-parseInt(_0x44ed9(0x1f3))/0x2+-parseInt(_0x44ed9(0x1e9))/0x3+parseInt(_0x44ed9(0x1e3))/0x4*(-parseInt(_0x44ed9(0x1dd))/0x5)+-parseInt(_0x44ed9(0x1e8))/0x6+-parseInt(_0x44ed9(0x1f8))/0x7+parseInt(_0x44ed9(0x1e2))/0x8*(parseInt(_0x44ed9(0x1f5))/0x9);if(_0x1dfa04===_0x4ec1c2)break;else _0x2eeb5f['push'](_0x2eeb5f['shift']());}catch(_0xff2ed7){_0x2eeb5f['push'](_0x2eeb5f['shift']());}}}(a68_0x31a9,0x2bc58));import*as a68_0x3f83e4 from'node:fs';import*as a68_0x316109 from'node:path';import*as a68_0x2e465b 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 _0xbcbedc=a68_0x2df4,_0x75eea2=process.env.TDX_CONFIG_DIR||a68_0x316109[_0xbcbedc(0x1d7)](a68_0x2e465b[_0xbcbedc(0x1f4)](),_0xbcbedc(0x1f9),'tdx');return a68_0x316109[_0xbcbedc(0x1d7)](_0x75eea2,_0xbcbedc(0x1e0));}function getSessionPath(_0x264431){return a68_0x316109['join'](getSessionsDir(),_0x264431+'.json');}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x13dabb){const _0x5943c7=a68_0x2df4;if(_0x13dabb)return _0x13dabb;if(process.env.TDX_SESSION)return process.env.TDX_SESSION;return getCurrentSessionPID()[_0x5943c7(0x1d8)]();}function a68_0x2df4(_0x1eafb5,_0x5b2688){_0x1eafb5=_0x1eafb5-0x1d5;const _0x31a916=a68_0x31a9();let _0x2df48f=_0x31a916[_0x1eafb5];return _0x2df48f;}export function loadSessionContext(_0x14a6d0){const _0x11b83b=getSessionID(_0x14a6d0),_0x30355a=/^\d+$/['test'](_0x11b83b)?parseInt(_0x11b83b,0xa):null;return _0x30355a!==null?loadSessionContextByPID(_0x30355a):loadSessionContextByString(_0x11b83b);}function a68_0x31a9(){const _0x44f02a=['319436gJahbi','homedir','27AIkgbm','stringify','unlinkSync','389326fAxJQP','.config','sort','.\x20This\x20is\x20insecure.\x20Removing\x20session.','TD_API_KEY','.json','join','toString','existsSync','readFileSync','api_key','readdirSync','745YsrTnF','332527ESMgXd','parse','sessions','test','1380240ZHVNMx','3788fJMZgb','writeFileSync','now','includes','replace','573276jMNuRa','656532VKNOXS','apiKey','warn','createdAt','toISOString','endsWith','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','utf-8','push','getTime'];a68_0x31a9=function(){return _0x44f02a;};return a68_0x31a9();}export function loadSessionContextByPID(_0x52ca34){const _0x5a6251=a68_0x2df4,_0x562e5e=getSessionPath(_0x52ca34);if(!a68_0x3f83e4[_0x5a6251(0x1d9)](_0x562e5e))return null;try{const _0x3c4002=a68_0x3f83e4['readFileSync'](_0x562e5e,_0x5a6251(0x1f0)),_0x11aeb9=JSON['parse'](_0x3c4002),_0x21228f=new Date(_0x11aeb9['createdAt'])['getTime'](),_0x115967=Date[_0x5a6251(0x1e5)]();if(_0x115967-_0x21228f>SESSION_EXPIRATION_MS)return a68_0x3f83e4['unlinkSync'](_0x562e5e),null;const _0x4d0e76=JSON[_0x5a6251(0x1f6)](_0x11aeb9);if(_0x4d0e76[_0x5a6251(0x1e6)](_0x5a6251(0x1d5))||_0x4d0e76['includes'](_0x5a6251(0x1ea))||_0x4d0e76['includes'](_0x5a6251(0x1db)))return console[_0x5a6251(0x1eb)](_0x5a6251(0x1ef)+_0x562e5e+_0x5a6251(0x1fb)),a68_0x3f83e4[_0x5a6251(0x1f7)](_0x562e5e),null;return _0x11aeb9;}catch{try{a68_0x3f83e4['unlinkSync'](_0x562e5e);}catch{}return null;}}function loadSessionContextByString(_0x2b9567){const _0x473c29=a68_0x2df4,_0x51aa44=a68_0x316109['join'](getSessionsDir(),_0x2b9567+_0x473c29(0x1d6));if(!a68_0x3f83e4[_0x473c29(0x1d9)](_0x51aa44))return null;try{const _0x5bcc88=a68_0x3f83e4['readFileSync'](_0x51aa44,_0x473c29(0x1f0)),_0x102eb8=JSON[_0x473c29(0x1df)](_0x5bcc88),_0x54b684=new Date(_0x102eb8[_0x473c29(0x1ec)])['getTime'](),_0x49462c=Date['now']();if(_0x49462c-_0x54b684>SESSION_EXPIRATION_MS)return a68_0x3f83e4[_0x473c29(0x1f7)](_0x51aa44),null;const _0x200dba=JSON[_0x473c29(0x1f6)](_0x102eb8);if(_0x200dba['includes'](_0x473c29(0x1d5))||_0x200dba[_0x473c29(0x1e6)](_0x473c29(0x1ea))||_0x200dba[_0x473c29(0x1e6)]('api_key'))return console[_0x473c29(0x1eb)](_0x473c29(0x1ef)+_0x51aa44+_0x473c29(0x1fb)),a68_0x3f83e4[_0x473c29(0x1f7)](_0x51aa44),null;return _0x102eb8;}catch{try{a68_0x3f83e4[_0x473c29(0x1f7)](_0x51aa44);}catch{}return null;}}export function saveSessionContext(_0x3e7735,_0x24129e){const _0x236d33=a68_0x2df4,_0x224801=getSessionID(_0x24129e),_0x115e8f=/^\d+$/['test'](_0x224801)?parseInt(_0x224801,0xa):getCurrentSessionPID(),_0x48ee38=a68_0x316109[_0x236d33(0x1d7)](getSessionsDir(),_0x224801+_0x236d33(0x1d6)),_0x1ee5e8=getSessionsDir();createSecureDirectory(_0x1ee5e8);const _0x4d376a=JSON[_0x236d33(0x1f6)](_0x3e7735);if(_0x4d376a['includes'](_0x236d33(0x1d5))||_0x4d376a[_0x236d33(0x1e6)](_0x236d33(0x1ea))||_0x4d376a[_0x236d33(0x1e6)](_0x236d33(0x1db)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.');let _0x4110f0;const _0x41faba=/^\d+$/[_0x236d33(0x1e1)](_0x224801)?loadSessionContextByPID(parseInt(_0x224801,0xa)):loadSessionContextByString(_0x224801);_0x41faba?_0x4110f0={..._0x41faba,..._0x3e7735,'pid':_0x115e8f,'sessionId':_0x224801!==_0x115e8f['toString']()?_0x224801:undefined,'updatedAt':new Date()[_0x236d33(0x1ed)]()}:_0x4110f0={'pid':_0x115e8f,'sessionId':_0x224801!==_0x115e8f[_0x236d33(0x1d8)]()?_0x224801:undefined,..._0x3e7735,'createdAt':new Date()[_0x236d33(0x1ed)](),'updatedAt':new Date()[_0x236d33(0x1ed)]()},a68_0x3f83e4[_0x236d33(0x1e4)](_0x48ee38,JSON['stringify'](_0x4110f0,null,0x2));}export function clearSessionContext(_0x329232){const _0x47353c=a68_0x2df4,_0x225d0c=getSessionID(_0x329232),_0x13d7a0=a68_0x316109['join'](getSessionsDir(),_0x225d0c+_0x47353c(0x1d6));a68_0x3f83e4['existsSync'](_0x13d7a0)&&a68_0x3f83e4[_0x47353c(0x1f7)](_0x13d7a0);}export function clearSessionContextField(_0x1cb369,_0x1105ac){const _0x224be4=a68_0x2df4,_0x23c8b1=getSessionID(_0x1105ac),_0x4ce7bf=a68_0x316109['join'](getSessionsDir(),_0x23c8b1+'.json');if(!a68_0x3f83e4[_0x224be4(0x1d9)](_0x4ce7bf))return;try{const _0x2eb887=a68_0x3f83e4['readFileSync'](_0x4ce7bf,_0x224be4(0x1f0)),_0x5f1c1b=JSON['parse'](_0x2eb887);delete _0x5f1c1b[_0x1cb369],a68_0x3f83e4[_0x224be4(0x1e4)](_0x4ce7bf,JSON[_0x224be4(0x1f6)](_0x5f1c1b,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x2ee17b=a68_0x2df4,_0x2118d2=getSessionsDir();if(!a68_0x3f83e4[_0x2ee17b(0x1d9)](_0x2118d2))return 0x0;let _0x2730ab=0x0;const _0x2bc9cc=Date[_0x2ee17b(0x1e5)]();try{const _0x58fd17=a68_0x3f83e4[_0x2ee17b(0x1dc)](_0x2118d2);for(const _0x5c3392 of _0x58fd17){if(!_0x5c3392[_0x2ee17b(0x1ee)](_0x2ee17b(0x1d6)))continue;const _0x4ebbe5=a68_0x316109[_0x2ee17b(0x1d7)](_0x2118d2,_0x5c3392),_0x321c55=_0x5c3392[_0x2ee17b(0x1e7)](_0x2ee17b(0x1d6),''),_0x4c609a=parseInt(_0x321c55,0xa),_0x4797e3=!isNaN(_0x4c609a);if(_0x4797e3){if(!isProcessRunning(_0x4c609a)){a68_0x3f83e4[_0x2ee17b(0x1f7)](_0x4ebbe5),_0x2730ab++;continue;}}try{const _0x55d35c=a68_0x3f83e4[_0x2ee17b(0x1da)](_0x4ebbe5,_0x2ee17b(0x1f0)),_0x4c6e3f=JSON[_0x2ee17b(0x1df)](_0x55d35c),_0x1d3e60=new Date(_0x4c6e3f[_0x2ee17b(0x1ec)])[_0x2ee17b(0x1f2)]();_0x2bc9cc-_0x1d3e60>SESSION_EXPIRATION_MS&&(a68_0x3f83e4['unlinkSync'](_0x4ebbe5),_0x2730ab++);}catch{a68_0x3f83e4[_0x2ee17b(0x1f7)](_0x4ebbe5),_0x2730ab++;}}}catch{}return _0x2730ab;}export function listActiveSessions(){const _0x402f28=a68_0x2df4,_0x55663c=getSessionsDir();if(!a68_0x3f83e4['existsSync'](_0x55663c))return[];try{const _0x1d3be9=a68_0x3f83e4['readdirSync'](_0x55663c),_0x4e572d=[];for(const _0x5e2e75 of _0x1d3be9){if(!_0x5e2e75['endsWith'](_0x402f28(0x1d6)))continue;const _0x21c9ce=_0x5e2e75[_0x402f28(0x1e7)]('.json',''),_0x5b590d=parseInt(_0x21c9ce,0xa);!isNaN(_0x5b590d)&&isProcessRunning(_0x5b590d)&&_0x4e572d[_0x402f28(0x1f1)](_0x5b590d);}return _0x4e572d[_0x402f28(0x1fa)]((_0x5a04d3,_0x2e1570)=>_0x5a04d3-_0x2e1570);}catch{return[];}}
@@ -1 +1 @@
1
- const a69_0x163c93=a69_0x2f3f;(function(_0x4c0bef,_0x5bb776){const _0x5074d9=a69_0x2f3f,_0x40984c=_0x4c0bef();while(!![]){try{const _0x3cfa33=parseInt(_0x5074d9(0xb4))/0x1*(-parseInt(_0x5074d9(0xa5))/0x2)+parseInt(_0x5074d9(0xa6))/0x3*(-parseInt(_0x5074d9(0xa8))/0x4)+-parseInt(_0x5074d9(0xb1))/0x5*(parseInt(_0x5074d9(0xa9))/0x6)+-parseInt(_0x5074d9(0xad))/0x7*(parseInt(_0x5074d9(0xb2))/0x8)+-parseInt(_0x5074d9(0xac))/0x9+parseInt(_0x5074d9(0xa7))/0xa*(parseInt(_0x5074d9(0xaa))/0xb)+-parseInt(_0x5074d9(0xaf))/0xc*(-parseInt(_0x5074d9(0xa4))/0xd);if(_0x3cfa33===_0x5bb776)break;else _0x40984c['push'](_0x40984c['shift']());}catch(_0x508769){_0x40984c['push'](_0x40984c['shift']());}}}(a69_0x2418,0xc4ecb));import{createProfileCache}from'../utils/global-cache.js';const userCache=createProfileCache(a69_0x163c93(0xb3),a69_0x163c93(0xab));function a69_0x2f3f(_0x37f62a,_0x53a0b7){_0x37f62a=_0x37f62a-0xa4;const _0x241872=a69_0x2418();let _0x2f3fd7=_0x241872[_0x37f62a];return _0x2f3fd7;}function a69_0x2418(){const _0x13108a=['13MhvmMa','982552bwEKqy','894876tipPSg','42460dYziji','8mijVGD','93582YccjpQ','1089vfbvFO','core/user-cache','2693097hnFwPi','7931EZUZXm','write','31360548CPJCWr','clear','55vnqpOF','4720TIUQbD','users-{profile}.json','1JSTCAC'];a69_0x2418=function(){return _0x13108a;};return a69_0x2418();}export function loadCachedUsers(_0x115c27){const _0x165580=userCache['read'](_0x115c27);return _0x165580?.['users']??null;}export function saveCachedUsers(_0x4876d9,_0x3595b9){const _0x48be5c=a69_0x163c93;userCache[_0x48be5c(0xae)](_0x4876d9,{'users':_0x3595b9,'cachedAt':Date['now']()});}export function clearUserCache(_0x46fcbf){const _0x3eee80=a69_0x163c93;userCache[_0x3eee80(0xb0)](_0x46fcbf);}
1
+ const a69_0xb76021=a69_0x1142;function a69_0x1142(_0xa6e2b,_0x8d00){_0xa6e2b=_0xa6e2b-0x68;const _0x48a567=a69_0x48a5();let _0x11423e=_0x48a567[_0xa6e2b];return _0x11423e;}function a69_0x48a5(){const _0x5b8364=['34152152KrADNW','1728892IwWBsF','now','clear','356308LTukCK','55NymShe','1477379CiWCGl','129324LhkRAx','users','8582161xpoSpD','4530555GauPov','users-{profile}.json','core/user-cache'];a69_0x48a5=function(){return _0x5b8364;};return a69_0x48a5();}(function(_0x37c3bd,_0x1c2d23){const _0x39b342=a69_0x1142,_0x4e61ee=_0x37c3bd();while(!![]){try{const _0x2f5a9a=-parseInt(_0x39b342(0x6d))/0x1+parseInt(_0x39b342(0x68))/0x2+-parseInt(_0x39b342(0x71))/0x3+parseInt(_0x39b342(0x6b))/0x4+-parseInt(_0x39b342(0x6c))/0x5*(parseInt(_0x39b342(0x6e))/0x6)+-parseInt(_0x39b342(0x70))/0x7+parseInt(_0x39b342(0x74))/0x8;if(_0x2f5a9a===_0x1c2d23)break;else _0x4e61ee['push'](_0x4e61ee['shift']());}catch(_0x34d612){_0x4e61ee['push'](_0x4e61ee['shift']());}}}(a69_0x48a5,0xbc715));import{createProfileCache}from'../utils/global-cache.js';const userCache=createProfileCache(a69_0xb76021(0x72),a69_0xb76021(0x73));export function loadCachedUsers(_0x362b0c){const _0x28067d=a69_0xb76021,_0x5dd7cd=userCache['read'](_0x362b0c);return _0x5dd7cd?.[_0x28067d(0x6f)]??null;}export function saveCachedUsers(_0x12988a,_0x55761f){const _0x13857d=a69_0xb76021;userCache['write'](_0x12988a,{'users':_0x55761f,'cachedAt':Date[_0x13857d(0x69)]()});}export function clearUserCache(_0x366f3e){const _0x5ddb0a=a69_0xb76021;userCache[_0x5ddb0a(0x6a)](_0x366f3e);}
@@ -1 +1 @@
1
- (function(_0x4ffbc1,_0x17496f){const _0x4a48e2=a70_0x567f,_0x5d12ad=_0x4ffbc1();while(!![]){try{const _0x52a104=parseInt(_0x4a48e2(0x1a6))/0x1*(-parseInt(_0x4a48e2(0x1a8))/0x2)+-parseInt(_0x4a48e2(0x19f))/0x3+parseInt(_0x4a48e2(0x1ae))/0x4+parseInt(_0x4a48e2(0x1aa))/0x5+parseInt(_0x4a48e2(0x1a2))/0x6+parseInt(_0x4a48e2(0x1a4))/0x7+parseInt(_0x4a48e2(0x1a0))/0x8;if(_0x52a104===_0x17496f)break;else _0x5d12ad['push'](_0x5d12ad['shift']());}catch(_0x4c7b33){_0x5d12ad['push'](_0x5d12ad['shift']());}}}(a70_0x4138,0x90e75));import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;function a70_0x567f(_0x42c08b,_0x1c9ac8){_0x42c08b=_0x42c08b-0x19f;const _0x41384a=a70_0x4138();let _0x567fe9=_0x41384a[_0x42c08b];return _0x567fe9;}export function getBuildInfo(){const _0xbb4c0=a70_0x567f;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x4e8625=fileURLToPath(import.meta.url),_0x684fc6=dirname(_0x4e8625);try{const _0x137952=join(_0x684fc6,_0xbb4c0(0x1ad));cachedBuildInfo=JSON[_0xbb4c0(0x1ac)](readFileSync(_0x137952,_0xbb4c0(0x1a7)));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0x4b5506=a70_0x567f;if(cachedVersion!==null)return cachedVersion;const _0x1799d6=fileURLToPath(import.meta.url),_0x106761=dirname(_0x1799d6),_0x4d1db7=getBuildInfo();if(_0x4d1db7[_0x4b5506(0x1a5)])return cachedVersion=_0x4d1db7['version'],cachedVersion;try{const _0x3d13f4=join(_0x106761,_0x4b5506(0x1a9)),_0x20354d=JSON[_0x4b5506(0x1ac)](readFileSync(_0x3d13f4,_0x4b5506(0x1a7)));cachedVersion=_0x20354d[_0x4b5506(0x1a5)];}catch{cachedVersion=_0x4b5506(0x1a1);}return cachedVersion;}export function isDevVersion(){const _0x348669=a70_0x567f,_0x3f3081=getVersion();return _0x3f3081[_0x348669(0x1a3)](_0x348669(0x1ab))||_0x3f3081[_0x348669(0x1a3)]('-');}function a70_0x4138(){const _0x3dbf56=['5294247mnEdDz','version','293662KFjTXO','utf-8','8vDRjBP','../../package.json','2482385RLUilC','.dev','parse','../build-info.json','2239728gmdfEe','2334780hBBiNC','5722720nOJDbg','0.0.0','110178FsxGEu','includes'];a70_0x4138=function(){return _0x3dbf56;};return a70_0x4138();}
1
+ (function(_0x549c03,_0x468848){const _0x2bbbde=a70_0x8221,_0x2b2ab3=_0x549c03();while(!![]){try{const _0x3ba396=parseInt(_0x2bbbde(0x169))/0x1*(-parseInt(_0x2bbbde(0x163))/0x2)+-parseInt(_0x2bbbde(0x175))/0x3*(-parseInt(_0x2bbbde(0x174))/0x4)+parseInt(_0x2bbbde(0x16e))/0x5*(parseInt(_0x2bbbde(0x165))/0x6)+parseInt(_0x2bbbde(0x172))/0x7*(-parseInt(_0x2bbbde(0x16d))/0x8)+-parseInt(_0x2bbbde(0x16a))/0x9*(-parseInt(_0x2bbbde(0x16f))/0xa)+-parseInt(_0x2bbbde(0x171))/0xb+parseInt(_0x2bbbde(0x167))/0xc*(parseInt(_0x2bbbde(0x16b))/0xd);if(_0x3ba396===_0x468848)break;else _0x2b2ab3['push'](_0x2b2ab3['shift']());}catch(_0x15e262){_0x2b2ab3['push'](_0x2b2ab3['shift']());}}}(a70_0x78d8,0xa03c2));import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;function a70_0x8221(_0x2abf48,_0x1307df){_0x2abf48=_0x2abf48-0x163;const _0x78d80d=a70_0x78d8();let _0x822122=_0x78d80d[_0x2abf48];return _0x822122;}export function getBuildInfo(){const _0x5b1d8f=a70_0x8221;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x335654=fileURLToPath(import.meta.url),_0x2db74f=dirname(_0x335654);try{const _0x1f814b=join(_0x2db74f,_0x5b1d8f(0x177));cachedBuildInfo=JSON[_0x5b1d8f(0x166)](readFileSync(_0x1f814b,_0x5b1d8f(0x173)));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0x467b00=a70_0x8221;if(cachedVersion!==null)return cachedVersion;const _0x5dc7f9=fileURLToPath(import.meta.url),_0x5d145e=dirname(_0x5dc7f9),_0x15a0de=getBuildInfo();if(_0x15a0de[_0x467b00(0x164)])return cachedVersion=_0x15a0de[_0x467b00(0x164)],cachedVersion;try{const _0x109bd3=join(_0x5d145e,_0x467b00(0x170)),_0x1a393d=JSON[_0x467b00(0x166)](readFileSync(_0x109bd3,_0x467b00(0x173)));cachedVersion=_0x1a393d['version'];}catch{cachedVersion=_0x467b00(0x176);}return cachedVersion;}export function isDevVersion(){const _0xcb831b=a70_0x8221,_0x4c472f=getVersion();return _0x4c472f[_0xcb831b(0x168)](_0xcb831b(0x16c))||_0x4c472f[_0xcb831b(0x168)]('-');}function a70_0x78d8(){const _0x224033=['12MyWnUL','879723AdgzHG','0.0.0','../build-info.json','5742YpJMRg','version','186XHdJPC','parse','1527540ezOuQd','includes','277uczUvn','2737386ZShrHx','143woiGMo','.dev','5095968xeExsD','81550ZfGzIY','10LHnUPR','../../package.json','11012617wVsMZu','7QCWXcN','utf-8'];a70_0x78d8=function(){return _0x224033;};return a70_0x78d8();}