@treasuredata/tdx 2026.3.34 → 2026.3.36

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_0x28a51a=a58_0x549f;(function(_0x2ed353,_0x1b38e7){const _0x502caa=a58_0x549f,_0x18b8ac=_0x2ed353();while(!![]){try{const _0x1e2811=-parseInt(_0x502caa(0x19f))/0x1*(parseInt(_0x502caa(0x19c))/0x2)+-parseInt(_0x502caa(0x1d4))/0x3*(-parseInt(_0x502caa(0x1c5))/0x4)+-parseInt(_0x502caa(0x196))/0x5+-parseInt(_0x502caa(0x1a0))/0x6*(-parseInt(_0x502caa(0x195))/0x7)+-parseInt(_0x502caa(0x1b0))/0x8*(parseInt(_0x502caa(0x1d3))/0x9)+-parseInt(_0x502caa(0x1cb))/0xa*(parseInt(_0x502caa(0x19d))/0xb)+-parseInt(_0x502caa(0x1c2))/0xc*(-parseInt(_0x502caa(0x1aa))/0xd);if(_0x1e2811===_0x1b38e7)break;else _0x18b8ac['push'](_0x18b8ac['shift']());}catch(_0x1234fd){_0x18b8ac['push'](_0x18b8ac['shift']());}}}(a58_0x1410,0x92cc7));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a58_0x426f7d from'node:fs';import*as a58_0xde69b5 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_0x59b344 from'chalk';function a58_0x549f(_0x1529a9,_0xb4d9a7){_0x1529a9=_0x1529a9-0x18b;const _0x141092=a58_0x1410();let _0x549f20=_0x141092[_0x1529a9];return _0x549f20;}import{getGlobalCacheDir,createOptionalProfileCache}from'../utils/global-cache.js';export function getConfigDir(){const _0x3c0264=a58_0x549f;return process.env.TDX_CONFIG_DIR||join(homedir(),_0x3c0264(0x1ba),_0x3c0264(0x1a7));}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getConfigFilePath(_0x38f0f8){const _0x251d53=a58_0x549f,_0x3b94ec=getConfigDir();return _0x38f0f8?a58_0xde69b5['join'](_0x3b94ec,_0x251d53(0x1d5)+_0x38f0f8):getConfigFile();}export function getCacheDir(){return getGlobalCacheDir();}const llmProjectCache=createOptionalProfileCache(a58_0x28a51a(0x1af),a58_0x28a51a(0x191));export function getLLMProjectCacheFile(_0x4df875){const _0x509e16=a58_0x28a51a;return llmProjectCache[_0x509e16(0x193)](_0x4df875);}export function readCachedLLMProject(_0x4dba15){const _0x2b9b63=a58_0x28a51a,_0x884313=llmProjectCache['read'](_0x4dba15);if(_0x884313&&typeof _0x884313['id']===_0x2b9b63(0x1cd)&&typeof _0x884313[_0x2b9b63(0x194)]===_0x2b9b63(0x1cd))return _0x884313;return null;}export function writeCachedLLMProject(_0x10fa74,_0x1c69b2,_0x403b68){const _0x5d5546=a58_0x28a51a;try{llmProjectCache[_0x5d5546(0x1d9)]({'name':_0x10fa74,'id':_0x1c69b2},_0x403b68);}catch{}}const llmAgentCache=createOptionalProfileCache(a58_0x28a51a(0x18c),a58_0x28a51a(0x1a5));export function getLLMAgentCacheFile(_0x204a7e){const _0x5d1295=a58_0x28a51a;return llmAgentCache[_0x5d1295(0x193)](_0x204a7e);}export function readCachedLLMAgent(_0x555221){const _0x56936b=a58_0x28a51a,_0x11893=llmAgentCache[_0x56936b(0x1d2)](_0x555221);if(_0x11893&&typeof _0x11893['id']===_0x56936b(0x1cd)&&typeof _0x11893[_0x56936b(0x194)]===_0x56936b(0x1cd)&&typeof _0x11893[_0x56936b(0x1c9)]===_0x56936b(0x1cd))return _0x11893;return null;}export function writeCachedLLMAgent(_0x3bd382,_0x5bc305,_0x2ddac1,_0xc056b7){const _0x58a8b9=a58_0x28a51a;try{llmAgentCache[_0x58a8b9(0x1d9)]({'name':_0x3bd382,'id':_0x5bc305,'projectId':_0x2ddac1},_0xc056b7);}catch{}}export function clearCachedLLMAgent(_0x1877be){const _0xb04edc=a58_0x28a51a;try{llmAgentCache[_0xb04edc(0x1a9)](_0x1877be);}catch{}}const accountInfoCache=createOptionalProfileCache(a58_0x28a51a(0x1a6),'config/account-info',{'suffix':a58_0x28a51a(0x1bb)});export function getAccountInfoCacheFile(_0x22e404){const _0x51e085=a58_0x28a51a;return accountInfoCache[_0x51e085(0x193)](_0x22e404);}export function readCachedAccountInfo(_0x101c3a){const _0x559dba=a58_0x28a51a,_0x48d930=accountInfoCache['read'](_0x101c3a);if(_0x48d930&&typeof _0x48d930[_0x559dba(0x1bd)]===_0x559dba(0x1cd)&&typeof _0x48d930['accountId']===_0x559dba(0x1c8))return _0x48d930;return null;}export function writeCachedAccountInfo(_0x38d40a,_0x227b4d,_0x2b8b8b){const _0x815ba0=a58_0x28a51a;try{accountInfoCache['write']({'site':_0x38d40a,'accountId':_0x227b4d,'cachedAt':new Date()[_0x815ba0(0x1b6)]()},_0x2b8b8b);}catch{}}export function parseEnvFile(_0x75182d){const _0x2f2ed4=a58_0x28a51a,_0x4a3fb2={};for(const _0x1aec6e of _0x75182d[_0x2f2ed4(0x1c4)]('\x0a')){const _0x12c506=_0x1aec6e[_0x2f2ed4(0x1ad)]();if(!_0x12c506||_0x12c506[_0x2f2ed4(0x19e)]('#'))continue;const _0x15895a=_0x12c506[_0x2f2ed4(0x1a8)](/^([^=]+)=(.*)$/);if(_0x15895a){const _0x294ace=_0x15895a[0x1][_0x2f2ed4(0x1ad)]();let _0x34b36e=_0x15895a[0x2]['trim']();(_0x34b36e[_0x2f2ed4(0x19e)]('\x22')&&_0x34b36e[_0x2f2ed4(0x1c3)]('\x22')||_0x34b36e['startsWith']('\x27')&&_0x34b36e['endsWith']('\x27'))&&(_0x34b36e=_0x34b36e[_0x2f2ed4(0x1c1)](0x1,-0x1)),_0x4a3fb2[_0x294ace]=_0x34b36e;}}return _0x4a3fb2;}export function readUserConfig(){const _0x11b6b5=a58_0x28a51a,_0x5833bb=getConfigFile();if(!existsSync(_0x5833bb))return{};try{const _0x143f71=readFileSync(_0x5833bb,_0x11b6b5(0x1ae));return parseEnvFile(_0x143f71);}catch(_0x10b3cd){return console[_0x11b6b5(0x19b)](_0x11b6b5(0x19a)+_0x5833bb+':',_0x10b3cd),{};}}export function resolveSite(_0x497579){const _0xba00f0=a58_0x28a51a,_0x5db708=['us01',_0xba00f0(0x1ac),'eu01',_0xba00f0(0x1ce),'ap03','dev-us01',_0xba00f0(0x1d7),'stg-us01','stg-ap01',_0xba00f0(0x1a2)];if(_0x5db708[_0xba00f0(0x1a4)](_0x497579))return _0x497579;if(_0x497579 in SITE_ALIASES)return SITE_ALIASES[_0x497579];return console[_0xba00f0(0x19b)](_0xba00f0(0x1bc)+_0x497579+'\x27,\x20defaulting\x20to\x20us01'),'us01';}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}function a58_0x1410(){const _0x2d188b=['source','stg-ap03','stable','includes','config/llm-agent','account_info','tdx','match','clear','52HEinzn','next','ap01','trim','utf-8','llm_default_project','8QGCxSy','map','yellow','entries','stg-us01','some','toISOString','stringify','tdx.json','replace','.config','.json','Warning:\x20Unknown\x20site\x20\x27','site','ap03','release_channel','apiKeys','slice','6692916TtrpeI','endsWith','split','450764LzyvzZ','stg-ap01','toUpperCase','number','projectId','readFileSync','9380300qEQNwq','join','string','ap02','us01','TDX_API_KEY_','keychain\x20(profile:\x20','read','3339882vuNpRh','27GEFmzC','.env.','\x20env\x20var','dev-eu01','eu01','write','existsSync','apiKey','llm_default_agent','TDX_API_KEY\x20env\x20var','TDX_ACCESS_TOKEN\x20env\x20var','filter','TDX_ACCESS_TOKEN_','config/llm-project','accessToken','path','name','14aHgZMl','3998220MLHMMa','parse','proxy','keychain','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','warn','2305972jurFLt','11wgHwGW','startsWith','1lsyinu','1853562PrwRqs'];a58_0x1410=function(){return _0x2d188b;};return a58_0x1410();}export function clearConfigCache(){cachedUserConfig=null;}export function resolveAccessToken(_0x358263){const _0x4827a9=a58_0x28a51a,_0x109897=_0x358263||getActiveProfileName()||undefined;if(_0x109897){const _0x214450=_0x4827a9(0x190)+normalizeProfileForEnvVar(_0x109897);if(process.env[_0x214450])return{'accessToken':process.env[_0x214450],'source':_0x214450+_0x4827a9(0x1d6)};}if(process.env.TDX_ACCESS_TOKEN)return{'accessToken':process.env.TDX_ACCESS_TOKEN,'source':_0x4827a9(0x18e)};return null;}export function getAccessToken(_0x4f7b8b){const _0x5d3563=a58_0x28a51a;return resolveAccessToken(_0x4f7b8b)?.[_0x5d3563(0x192)];}export function getAPIKey(_0x1a237d){const _0x46843a=a58_0x28a51a,_0x1f21fd=_0x1a237d||getActiveProfileName();if(_0x1f21fd){const _0x89e794=_0x46843a(0x1d0)+normalizeProfileForEnvVar(_0x1f21fd);if(process.env[_0x89e794])return process.env[_0x89e794];}if(process.env.TDX_API_KEY)return process.env.TDX_API_KEY;return undefined;}export function normalizeProfileForEnvVar(_0x1a47e4){const _0x4474b1=a58_0x28a51a;return _0x1a47e4[_0x4474b1(0x1c7)]()[_0x4474b1(0x1b9)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x4c4447,_0x17a330){const _0x2596a0=a58_0x28a51a,_0x2c6317=resolveAccessToken(_0x17a330);if(_0x2c6317)return{'apiKey':_0x2c6317[_0x2596a0(0x192)],'source':_0x2c6317[_0x2596a0(0x1a1)],'isDeprecated':![]};const _0x2e7c71=_0x17a330||getActiveProfileName()||undefined;if(_0x2e7c71){const _0x216025=_0x2596a0(0x1d0)+normalizeProfileForEnvVar(_0x2e7c71);if(process.env[_0x216025])return{'apiKey':process.env[_0x216025],'source':_0x216025+_0x2596a0(0x1d6),'isDeprecated':![]};const _0x1ad3d1=getCachedCredential(_0x4c4447,_0x2e7c71);if(_0x1ad3d1)return{'apiKey':_0x1ad3d1,'source':_0x2596a0(0x1d1)+_0x2e7c71+')','isDeprecated':![]};const _0x230a98=await getKeychainAPIKey(_0x2e7c71);if(_0x230a98)return setCachedCredential(_0x230a98,_0x4c4447,_0x2e7c71),{'apiKey':_0x230a98,'source':_0x2596a0(0x1d1)+_0x2e7c71+')','isDeprecated':![]};}if(process.env.TDX_API_KEY)return{'apiKey':process.env.TDX_API_KEY,'source':_0x2596a0(0x18d),'isDeprecated':![]};if(!_0x2e7c71){const _0x2d65ba=getCachedCredential(_0x4c4447,undefined);if(_0x2d65ba)return{'apiKey':_0x2d65ba,'source':_0x2596a0(0x199),'isDeprecated':![]};const _0x2e3995=await getKeychainAPIKey(undefined);if(_0x2e3995)return setCachedCredential(_0x2e3995,_0x4c4447,undefined),{'apiKey':_0x2e3995,'source':_0x2596a0(0x199),'isDeprecated':![]};}return null;}export async function getAPIKeyAsync(_0x3d5a4b,_0x39bcc1){const _0x38ebe8=a58_0x28a51a,_0x4a9a5f=await resolveAPIKeyAsync(_0x3d5a4b,_0x39bcc1);return _0x4a9a5f?.[_0x38ebe8(0x18b)];}function cleanupLegacyEnvFile(_0x2e5a93){const _0x4b78b8=a58_0x28a51a;if(!existsSync(_0x2e5a93))return![];try{const _0x42f19f=readFileSync(_0x2e5a93,_0x4b78b8(0x1ae)),_0x4ad371=_0x42f19f['split']('\x0a'),_0x966782=_0x4ad371[_0x4b78b8(0x18f)](_0x32f89a=>{const _0x5b55a1=_0x4b78b8,_0x43eed5=_0x32f89a[_0x5b55a1(0x1ad)]();if(!_0x43eed5||_0x43eed5[_0x5b55a1(0x19e)]('#'))return!![];const [_0x524ee1]=_0x43eed5[_0x5b55a1(0x1c4)]('=');return!_0x524ee1[_0x5b55a1(0x19e)]('TD_API_KEY');}),_0xe1b0a=_0x966782[_0x4b78b8(0x1b5)](_0x53020a=>{const _0x5aca4c=_0x4b78b8,_0x12607a=_0x53020a[_0x5aca4c(0x1ad)]();return _0x12607a&&!_0x12607a[_0x5aca4c(0x19e)]('#');});if(!_0xe1b0a)return unlinkSync(_0x2e5a93),!![];return writeFileSync(_0x2e5a93,_0x966782[_0x4b78b8(0x1cc)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function getActiveProfileName(){const _0x10f192=a58_0x28a51a;if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x53d940=a58_0xde69b5[_0x10f192(0x1cc)](getConfigDir(),_0x10f192(0x1b8));if(!a58_0x426f7d['existsSync'](_0x53d940))return null;try{const _0x4d5c77=a58_0x426f7d[_0x10f192(0x1ca)](_0x53d940,_0x10f192(0x1ae)),_0x16aa21=JSON[_0x10f192(0x197)](_0x4d5c77);return _0x16aa21['profile']||null;}catch{return null;}}export function saveAPIKey(_0x58089a,_0x1bacd8,_0x1dc8a8){const _0x4f4edb=a58_0x28a51a,_0x44c2cf=getConfigDir(),_0x3558e0=getConfigFilePath(_0x1dc8a8);!existsSync(_0x44c2cf)&&mkdirSync(_0x44c2cf,{'recursive':!![],'mode':0x1c0});let _0x110879={};if(existsSync(_0x3558e0))try{const _0x121292=readFileSync(_0x3558e0,'utf-8');_0x110879=parseEnvFile(_0x121292);}catch(_0x5a8473){console['warn']('Warning:\x20Failed\x20to\x20read\x20'+_0x3558e0+':',_0x5a8473);}const _0x4c2c46=_0x58089a[_0x4f4edb(0x1c7)]()[_0x4f4edb(0x1b9)](/-/g,'_');_0x110879['TD_API_KEY_'+_0x4c2c46]=_0x1bacd8;const _0x1fe5ce=Object[_0x4f4edb(0x1b3)](_0x110879)[_0x4f4edb(0x1b1)](([_0x2235b6,_0x5dca11])=>_0x2235b6+'='+_0x5dca11);writeFileSync(_0x3558e0,_0x1fe5ce[_0x4f4edb(0x1cc)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x536a93,_0x3dbaf3,_0x1729f3){const _0x4d32e2=a58_0x28a51a;await saveKeychainAPIKey(_0x536a93,_0x1729f3),setCachedCredential(_0x536a93,_0x3dbaf3,_0x1729f3);const _0x123720=getConfigFilePath(_0x1729f3);cleanupLegacyEnvFile(_0x123720)&&console[_0x4d32e2(0x19b)](a58_0x59b344[_0x4d32e2(0x1b2)]('⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'));}export function loadConfig(){const _0x161f6e=a58_0x28a51a,_0x4b2f8d={'apiKeys':{},'defaultSite':_0x161f6e(0x1cf)},_0x4326d4=[_0x161f6e(0x1cf),'ap01',_0x161f6e(0x1d8),_0x161f6e(0x1ce),_0x161f6e(0x1be),'dev-us01','dev-eu01',_0x161f6e(0x1b4),_0x161f6e(0x1c6),'stg-ap03'],_0x1646b6=getAPIKey();if(_0x1646b6)for(const _0x23398 of _0x4326d4){_0x4b2f8d[_0x161f6e(0x1c0)][_0x23398]=_0x1646b6;}return _0x4b2f8d;}export function isExperimentalAvailable(){return!!process.env.TDX_EXPERIMENTAL;}export function loadGlobalProxy(){const _0x4b28b0=a58_0x28a51a,_0x21e51b=a58_0xde69b5[_0x4b28b0(0x1cc)](getConfigDir(),_0x4b28b0(0x1b8));if(!a58_0x426f7d[_0x4b28b0(0x1da)](_0x21e51b))return undefined;try{const _0x36bb04=a58_0x426f7d[_0x4b28b0(0x1ca)](_0x21e51b,_0x4b28b0(0x1ae)),_0x6d865a=JSON[_0x4b28b0(0x197)](_0x36bb04);return typeof _0x6d865a[_0x4b28b0(0x198)]===_0x4b28b0(0x1cd)?_0x6d865a[_0x4b28b0(0x198)]:undefined;}catch{return undefined;}}export function loadReleaseChannel(){const _0x391b02=a58_0x28a51a,_0x19186f=process.env.TDX_RELEASE_CHANNEL;if(_0x19186f===_0x391b02(0x1ab)||_0x19186f===_0x391b02(0x1a3))return _0x19186f;const _0x416fbb=a58_0xde69b5[_0x391b02(0x1cc)](getConfigDir(),_0x391b02(0x1b8));if(!a58_0x426f7d['existsSync'](_0x416fbb))return _0x391b02(0x1a3);try{const _0xc1dd07=a58_0x426f7d[_0x391b02(0x1ca)](_0x416fbb,_0x391b02(0x1ae)),_0x23a6ca=JSON['parse'](_0xc1dd07);if(_0x23a6ca[_0x391b02(0x1bf)]===_0x391b02(0x1ab))return _0x391b02(0x1ab);}catch{}return _0x391b02(0x1a3);}export function saveReleaseChannel(_0x56da6e){const _0x1964be=a58_0x28a51a,_0x2d2ab8=getConfigDir(),_0xf8b562=a58_0xde69b5[_0x1964be(0x1cc)](_0x2d2ab8,_0x1964be(0x1b8));!existsSync(_0x2d2ab8)&&mkdirSync(_0x2d2ab8,{'recursive':!![],'mode':0x1c0});let _0x2b89e0={};if(existsSync(_0xf8b562))try{const _0x1cd0dd=readFileSync(_0xf8b562,_0x1964be(0x1ae));_0x2b89e0=JSON[_0x1964be(0x197)](_0x1cd0dd);}catch{}_0x2b89e0[_0x1964be(0x1bf)]=_0x56da6e,writeFileSync(_0xf8b562,JSON[_0x1964be(0x1b7)](_0x2b89e0,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_0x135267=a59_0xf74e;(function(_0x1af6f2,_0x57148a){const _0x3fb5d2=a59_0xf74e,_0x13d442=_0x1af6f2();while(!![]){try{const _0x800771=parseInt(_0x3fb5d2(0x17b))/0x1*(parseInt(_0x3fb5d2(0x17e))/0x2)+-parseInt(_0x3fb5d2(0x17d))/0x3+parseInt(_0x3fb5d2(0x172))/0x4+parseInt(_0x3fb5d2(0x176))/0x5*(-parseInt(_0x3fb5d2(0x17c))/0x6)+-parseInt(_0x3fb5d2(0x17a))/0x7+parseInt(_0x3fb5d2(0x178))/0x8*(parseInt(_0x3fb5d2(0x171))/0x9)+parseInt(_0x3fb5d2(0x17f))/0xa;if(_0x800771===_0x57148a)break;else _0x13d442['push'](_0x13d442['shift']());}catch(_0x5c7f11){_0x13d442['push'](_0x13d442['shift']());}}}(a59_0x11f4,0x6d5bd));function a59_0x11f4(){const _0x4a2c48=['connections','400HgeTgS','clear','4879700kNBUVh','1rMgHTK','1587966FUqVEe','158367vLHQjB','242094MZXpeO','16695620WprqdZ','13779esFUlx','498584ZdNbfT','core/connection-cache','now','read','15PGmswz'];a59_0x11f4=function(){return _0x4a2c48;};return a59_0x11f4();}import{createProfileCache}from'../utils/global-cache.js';const connectionCache=createProfileCache('connections-{profile}.json',a59_0x135267(0x173));export function loadCachedConnections(_0x169b45){const _0xa8dc5f=a59_0x135267,_0x3e9c71=connectionCache[_0xa8dc5f(0x175)](_0x169b45);return _0x3e9c71?.[_0xa8dc5f(0x177)]??null;}export function saveCachedConnections(_0x22f20d,_0x5c9eb8){const _0x3d6b40=a59_0x135267;connectionCache['write'](_0x22f20d,{'connections':_0x5c9eb8,'cachedAt':Date[_0x3d6b40(0x174)]()});}function a59_0xf74e(_0x1168f5,_0x1d6a27){_0x1168f5=_0x1168f5-0x171;const _0x11f432=a59_0x11f4();let _0xf74e8c=_0x11f432[_0x1168f5];return _0xf74e8c;}export function clearConnectionCache(_0x38d25f){const _0x180ee5=a59_0x135267;connectionCache[_0x180ee5(0x179)](_0x38d25f);}
@@ -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_0x599cd7=a60_0x3413;function a60_0x1d96(){const _0x5b8f53=['1015292GkIptO','number','13777011vjgMqm','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','trim','ap02\x20-\x20Korea','ap02','test','Cancelled','jp\x20\x20\x20-\x20Japan','ap01','12ROdolS','2025960TXUYun','1794745gkKdrX','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','1Vmsqph','4091163eSKwuI','us01','push','6134240jAaVMO','us\x20\x20\x20-\x20United\x20States','log','Select\x20your\x20Treasure\x20Data\x20site:','select','customSite','eu\x20\x20\x20-\x20Europe','site','Enter\x20custom\x20site','553161errPlW'];a60_0x1d96=function(){return _0x5b8f53;};return a60_0x1d96();}(function(_0x6fd044,_0xf73f83){const _0x385069=a60_0x3413,_0x5b1060=_0x6fd044();while(!![]){try{const _0x17c420=parseInt(_0x385069(0x16a))/0x1*(parseInt(_0x385069(0x178))/0x2)+-parseInt(_0x385069(0x16b))/0x3+parseInt(_0x385069(0x166))/0x4*(-parseInt(_0x385069(0x168))/0x5)+parseInt(_0x385069(0x167))/0x6+parseInt(_0x385069(0x177))/0x7+parseInt(_0x385069(0x16e))/0x8+parseInt(_0x385069(0x15d))/0x9;if(_0x17c420===_0xf73f83)break;else _0x5b1060['push'](_0x5b1060['shift']());}catch(_0x5ba7c7){_0x5b1060['push'](_0x5b1060['shift']());}}}(a60_0x1d96,0xbec08));import a60_0x341d59 from'prompts';export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x1d23e8,_0x3f8480){const _0x360407=a60_0x3413;if(_0x1d23e8===undefined)return _0x3f8480;if(typeof _0x1d23e8===_0x360407(0x15c))return _0x1d23e8;return parseInt(_0x1d23e8,0xa);}export const STANDARD_SITE_CHOICES=[{'title':a60_0x599cd7(0x16f),'value':'us01'},{'title':a60_0x599cd7(0x164),'value':a60_0x599cd7(0x165)},{'title':a60_0x599cd7(0x174),'value':'eu01'},{'title':a60_0x599cd7(0x160),'value':a60_0x599cd7(0x161)}];export function buildSiteChoices(_0x1eff45){const _0x71a59a=a60_0x599cd7,_0x1f10d0=[...STANDARD_SITE_CHOICES];let _0x2ba7e6=_0x1f10d0['findIndex'](_0x96a4bf=>_0x96a4bf['value']===_0x1eff45);return _0x2ba7e6===-0x1&&_0x1eff45!==_0x71a59a(0x16c)&&(_0x1f10d0['push']({'title':_0x1eff45,'value':_0x1eff45}),_0x2ba7e6=_0x1f10d0['length']-0x1),_0x1f10d0[_0x71a59a(0x16d)]({'title':_0x71a59a(0x176),'value':'other'}),{'choices':_0x1f10d0,'initialIndex':_0x2ba7e6>=0x0?_0x2ba7e6:0x0};}function a60_0x3413(_0x38c98,_0x108ba5){_0x38c98=_0x38c98-0x15c;const _0x1d96d6=a60_0x1d96();let _0x341349=_0x1d96d6[_0x38c98];return _0x341349;}export async function promptSiteSelection(_0x5cbad7,_0x539112,_0x3198d6=a60_0x599cd7(0x163)){const _0x3b22b1=a60_0x599cd7,{choices:_0x52bbc6,initialIndex:_0x21daa7}=buildSiteChoices(_0x5cbad7),_0x3d3d0e=_0x539112?_0x3b22b1(0x15e)+_0x539112+'):':_0x3b22b1(0x171),_0x520350=await a60_0x341d59({'type':_0x3b22b1(0x172),'name':_0x3b22b1(0x175),'message':_0x3d3d0e,'choices':_0x52bbc6,'initial':_0x21daa7});if(!_0x520350['site'])return console[_0x3b22b1(0x170)]('\x0a'+_0x3198d6),null;if(_0x520350['site']!=='other')return _0x520350[_0x3b22b1(0x175)];const _0x5d0fe8=await a60_0x341d59({'type':'text','name':'customSite','message':'Enter\x20site\x20name:','initial':_0x3b22b1(0x16c),'validate':_0x5ce33b=>{const _0x6de3b7=_0x3b22b1;if(!_0x5ce33b||!_0x5ce33b[_0x6de3b7(0x15f)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/[_0x6de3b7(0x162)](_0x5ce33b[_0x6de3b7(0x15f)]()))return _0x6de3b7(0x169);return!![];}});if(!_0x5d0fe8[_0x3b22b1(0x173)])return console[_0x3b22b1(0x170)]('\x0a'+_0x3198d6),null;return _0x5d0fe8[_0x3b22b1(0x173)];}
@@ -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(_0x25dde4,_0x51d4a9){const _0x197bf4=a61_0x2e98,_0x262a9c=_0x25dde4();while(!![]){try{const _0x56861f=parseInt(_0x197bf4(0xbf))/0x1*(-parseInt(_0x197bf4(0xad))/0x2)+parseInt(_0x197bf4(0xae))/0x3*(-parseInt(_0x197bf4(0xb2))/0x4)+-parseInt(_0x197bf4(0xb1))/0x5*(-parseInt(_0x197bf4(0xb3))/0x6)+-parseInt(_0x197bf4(0xb4))/0x7*(parseInt(_0x197bf4(0xba))/0x8)+-parseInt(_0x197bf4(0xb9))/0x9+-parseInt(_0x197bf4(0xb8))/0xa+parseInt(_0x197bf4(0xbb))/0xb*(parseInt(_0x197bf4(0xbc))/0xc);if(_0x56861f===_0x51d4a9)break;else _0x262a9c['push'](_0x262a9c['shift']());}catch(_0x45b042){_0x262a9c['push'](_0x262a9c['shift']());}}}(a61_0x10d6,0x665d5));function a61_0x10d6(){const _0x494956=['4259568faiaQg','7kHFyVd','__default_site__','set','loadedAt','2722460ZpibuX','1047357xjHztU','3093416JISztQ','858yMjCiY','201648bhnuiN','now','delete','238283iMgpKa','2qzrzOC','192VKpZeG','apiKey','__default_profile__','5FWNBlh','36736EFqKmg'];a61_0x10d6=function(){return _0x494956;};return a61_0x10d6();}const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x5291f0,_0x51e558){const _0x3a1480=a61_0x2e98,_0x4080c4=_0x5291f0||_0x3a1480(0xb5),_0x457b57=_0x51e558||_0x3a1480(0xb0);return _0x4080c4+':'+_0x457b57;}function a61_0x2e98(_0x56d0c7,_0x3eca9e){_0x56d0c7=_0x56d0c7-0xad;const _0x10d645=a61_0x10d6();let _0x2e9850=_0x10d645[_0x56d0c7];return _0x2e9850;}export function getCachedCredential(_0x3b8805,_0x4ea205){const _0x44f768=a61_0x2e98,_0x3467ea=getCacheKey(_0x3b8805,_0x4ea205),_0x48a7b0=cache['get'](_0x3467ea);if(!_0x48a7b0)return null;if(Date['now']()-_0x48a7b0[_0x44f768(0xb7)]>CACHE_TTL_MS)return cache[_0x44f768(0xbe)](_0x3467ea),null;return _0x48a7b0[_0x44f768(0xaf)];}export function setCachedCredential(_0x3c82b7,_0x288db8,_0x45c9f7){const _0x4befbe=a61_0x2e98,_0x4a8a3e=getCacheKey(_0x288db8,_0x45c9f7);cache[_0x4befbe(0xb6)](_0x4a8a3e,{'apiKey':_0x3c82b7,'loadedAt':Date[_0x4befbe(0xbd)]()});}export function clearCredentialCache(){cache['clear']();}export function clearCachedCredential(_0x694444,_0x376697){const _0x16ed63=a61_0x2e98,_0x4118d1=getCacheKey(_0x694444,_0x376697);cache[_0x16ed63(0xbe)](_0x4118d1);}
@@ -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_0x507056=a62_0x3c57;(function(_0x2a6910,_0x538348){const _0x467802=a62_0x3c57,_0x455b1e=_0x2a6910();while(!![]){try{const _0x133e49=-parseInt(_0x467802(0xe7))/0x1*(-parseInt(_0x467802(0x104))/0x2)+parseInt(_0x467802(0xfc))/0x3*(parseInt(_0x467802(0x11c))/0x4)+-parseInt(_0x467802(0x107))/0x5*(-parseInt(_0x467802(0xf5))/0x6)+parseInt(_0x467802(0xe9))/0x7+parseInt(_0x467802(0xfd))/0x8*(parseInt(_0x467802(0x117))/0x9)+-parseInt(_0x467802(0xf3))/0xa+-parseInt(_0x467802(0x103))/0xb;if(_0x133e49===_0x538348)break;else _0x455b1e['push'](_0x455b1e['shift']());}catch(_0x34abde){_0x455b1e['push'](_0x455b1e['shift']());}}}(a62_0x107e,0x77fd6));function a62_0x3c57(_0x23a169,_0x52f1de){_0x23a169=_0x23a169-0xd8;const _0x107ec4=a62_0x107e();let _0x3c57c2=_0x107ec4[_0x23a169];return _0x3c57c2;}import{resolveSite,getAPIKey,getAccessToken,getAPIKeyAsync,getConfigDir}from'./config.js';import{getOAuthTokens}from'./oauth-keychain.js';import{loadSessionContext,getSessionID}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';import{loadProfile}from'./profile.js';import{LogLevel}from'../utils/logger/index.js';import*as a62_0x367651 from'node:fs';import*as a62_0x574022 from'node:path';import a62_0x198bcb from'chalk';function a62_0x107e(){const _0x483e42=['dim','Global','(using\x20session:\x20','cyan','llm_project','llmAgent','18lcmfOE','423288zGmibV','llm_agent','workflowProject','segmentPath','.json','string','23675740obdEFv','8954IbVcRc','Profile\x20Credentials','none','430wcMHBM','profileSource','session','Global\x20Credentials','parent_segment','cliFlags','profile','replace','sessions','us01','global','Project','existsSync','.env','access_token','segment_path','117EexfOt','configFiles','loadGlobalConfig','bold','join','426016cfKdCP','assign','workflow_project','composable_audience','cli','verbose','accessToken','apiKey','database','activeProfile','injectIntoOptions','[context]','llmProject','readFileSync','sessionId','composableAudience','tdx.json','resolveAPIKeyAsync','entries','config','parse','(session:\x20','proxy','logLevel','not\x20set','createAsync','displayWithSources','Session','163aZKQJc','project','6654613qTkEls','parentSegment','globalCredentials','default','layers','site','profile:\x20','profiles','getParameters','green','6419270UHVSmi','log','19428WPukVT'];a62_0x107e=function(){return _0x483e42;};return a62_0x107e();}export class GlobalContext{['site'];[a62_0x507056(0x124)];[a62_0x507056(0x10b)];[a62_0x507056(0x116)];[a62_0x507056(0xfa)];[a62_0x507056(0xfe)];['workflow_project'];[a62_0x507056(0x11f)];[a62_0x507056(0x123)];[a62_0x507056(0x122)];[a62_0x507056(0xe1)];[a62_0x507056(0x121)];[a62_0x507056(0xe2)];[a62_0x507056(0x10d)];[a62_0x507056(0x108)]=null;[a62_0x507056(0xed)];[a62_0x507056(0x125)];[a62_0x507056(0xd9)];[a62_0x507056(0x118)];constructor(_0x112d07){const _0x4630c0=a62_0x507056;this[_0x4630c0(0xd9)]=getSessionID(_0x112d07[_0x4630c0(0x109)]);const _0x5c3347=loadSessionContext(_0x112d07[_0x4630c0(0x109)]),_0xe98e19=loadProjectConfig(),_0x3425e2=this[_0x4630c0(0x119)]();if(_0x112d07[_0x4630c0(0x10d)])this[_0x4630c0(0x125)]=_0x112d07[_0x4630c0(0x10d)],this['profileSource']=_0x4630c0(0x120);else{if(_0x5c3347?.[_0x4630c0(0x10d)])this['activeProfile']=_0x5c3347[_0x4630c0(0x10d)],this['profileSource']=_0x4630c0(0x109);else{if(_0x3425e2[_0x4630c0(0x10d)])this[_0x4630c0(0x125)]=_0x3425e2[_0x4630c0(0x10d)],this[_0x4630c0(0x108)]=_0x4630c0(0xde);else process.env.TDX_PROFILE?(this['activeProfile']=process.env.TDX_PROFILE,this[_0x4630c0(0x108)]='env'):(this['activeProfile']=null,this['profileSource']=null);}}const _0x401a01=this['activeProfile']?loadProfile(this[_0x4630c0(0x125)]):null,_0x4b6a9c=_0x5bfdd8=>{const _0x16be42=_0x4630c0;if(!_0x5bfdd8)return{};const _0x549c25=_0x5bfdd8,_0x4efa28={};for(const [_0x692398,_0x27f3ab]of Object[_0x16be42(0xdd)](_0x549c25)){typeof _0x27f3ab===_0x16be42(0x102)&&(_0x4efa28[_0x692398]=_0x27f3ab);}return _0x4efa28;},_0x5bada9={},_0x1a74ad=(_0x32a2fb,_0x599ffc,_0x5bb586)=>{if(!_0x32a2fb)return![];if(_0x5bb586&&_0x32a2fb===_0x5bb586)return![];const _0x39104e=_0x5c3347,_0x4390f9=_0xe98e19,_0x28b8b6=_0x401a01?.['config'],_0x11fbfe=_0x3425e2,_0x5e9fa4=_0x39104e?.[_0x599ffc],_0x9d7195=_0x4390f9?.[_0x599ffc],_0x236de5=_0x28b8b6?.[_0x599ffc],_0x495861=_0x11fbfe[_0x599ffc];return _0x32a2fb!==_0x5e9fa4&&_0x32a2fb!==_0x9d7195&&_0x32a2fb!==_0x236de5&&_0x32a2fb!==_0x495861;},_0x1a442b=[{'optionKey':_0x4630c0(0xee),'contextKey':_0x4630c0(0xee),'defaultValue':_0x4630c0(0x110)},{'optionKey':_0x4630c0(0x124),'contextKey':'database'},{'optionKey':_0x4630c0(0xea),'contextKey':_0x4630c0(0x10b)},{'optionKey':_0x4630c0(0x128),'contextKey':_0x4630c0(0xfa)},{'optionKey':'llmAgent','contextKey':_0x4630c0(0xfe)},{'optionKey':'composableAudience','contextKey':'composable_audience'},{'optionKey':_0x4630c0(0x10d),'contextKey':_0x4630c0(0x10d)}];for(const {optionKey:_0x505e15,contextKey:_0x4486f9,defaultValue:_0x5ad3e4}of _0x1a442b){const _0xfd3866=_0x112d07[_0x505e15];_0x1a74ad(_0xfd3866,_0x4486f9,_0x5ad3e4)&&(_0x5bada9[_0x4486f9]=_0xfd3866);}this[_0x4630c0(0xed)]={'cliFlags':_0x5bada9,'session':_0x4b6a9c(_0x5c3347),'project':_0x4b6a9c(_0xe98e19),'profile':_0x4b6a9c(_0x401a01?.[_0x4630c0(0xde)]),'global':_0x4b6a9c(_0x3425e2)};const _0x530a01={...this[_0x4630c0(0xed)]['global'],...this[_0x4630c0(0xed)]['profile'],...this['layers']['project']};process.env.TDX_SITE&&!this['layers'][_0x4630c0(0x109)][_0x4630c0(0xee)]&&!this['layers'][_0x4630c0(0x10c)][_0x4630c0(0xee)]&&(_0x530a01[_0x4630c0(0xee)]=process.env.TDX_SITE);Object[_0x4630c0(0x11d)](_0x530a01,this[_0x4630c0(0xed)][_0x4630c0(0x109)]),Object[_0x4630c0(0x11d)](_0x530a01,this[_0x4630c0(0xed)][_0x4630c0(0x10c)]);const _0x183d76=_0x530a01[_0x4630c0(0xee)]||_0x4630c0(0x110);this['site']=resolveSite(_0x183d76),this[_0x4630c0(0x124)]=_0x530a01['database'],this['parent_segment']=_0x530a01['parent_segment'],this[_0x4630c0(0x116)]=_0x530a01[_0x4630c0(0x116)],this[_0x4630c0(0xfa)]=_0x530a01['llm_project'],this[_0x4630c0(0xfe)]=_0x530a01['llm_agent'],this[_0x4630c0(0x11e)]=_0x530a01[_0x4630c0(0x11e)],this['composable_audience']=_0x530a01[_0x4630c0(0x11f)],this[_0x4630c0(0x121)]=_0x112d07['verbose']||![],this[_0x4630c0(0xe2)]=_0x112d07[_0x4630c0(0xe2)]??LogLevel['INFO'],this[_0x4630c0(0x10d)]=this[_0x4630c0(0x125)]||undefined,this[_0x4630c0(0x122)]=getAccessToken(this['activeProfile']||undefined),this[_0x4630c0(0x123)]=getAPIKey(this[_0x4630c0(0x125)]||undefined);const _0x2eed80=typeof _0x3425e2['proxy']===_0x4630c0(0x102)?_0x3425e2['proxy']:undefined;this[_0x4630c0(0xe1)]=_0x2eed80||process.env.HTTPS_PROXY||process.env.HTTP_PROXY;const _0x577633=getConfigDir(),_0x1f2f6b=a62_0x574022['join'](_0x577633,_0x4630c0(0x10f),this[_0x4630c0(0xd9)]+_0x4630c0(0x101)),_0xd55bab=findProjectConfigPath(),_0x2b98ab=a62_0x574022[_0x4630c0(0x11b)](_0x577633,_0x4630c0(0xdb)),_0x32e046=a62_0x574022[_0x4630c0(0x11b)](_0x577633,_0x4630c0(0x114));let _0x521235=null,_0x4de2e0=null;this[_0x4630c0(0x125)]&&(_0x521235=a62_0x574022[_0x4630c0(0x11b)](_0x577633,_0x4630c0(0xf0),this[_0x4630c0(0x125)],_0x4630c0(0xdb)),_0x4de2e0=a62_0x574022[_0x4630c0(0x11b)](_0x577633,_0x4630c0(0xf0),this[_0x4630c0(0x125)],_0x4630c0(0x114))),this[_0x4630c0(0x118)]={'session':a62_0x367651[_0x4630c0(0x113)](_0x1f2f6b)?_0x1f2f6b:null,'project':_0xd55bab,'profile':_0x521235&&a62_0x367651['existsSync'](_0x521235)?_0x521235:null,'profileCredentials':_0x4de2e0&&a62_0x367651[_0x4630c0(0x113)](_0x4de2e0)?_0x4de2e0:null,'global':a62_0x367651[_0x4630c0(0x113)](_0x2b98ab)?_0x2b98ab:null,'globalCredentials':a62_0x367651[_0x4630c0(0x113)](_0x32e046)?_0x32e046:null};}['getSource'](_0xda76f5,_0x3811df){const _0x1ae1a8=a62_0x507056;if(!_0x3811df)return _0x1ae1a8(0xe3);const _0x1996ce=_0x3811df;if(this[_0x1ae1a8(0xed)]['cliFlags'][_0xda76f5]===_0x1996ce){if(_0xda76f5===_0x1ae1a8(0xee)&&_0x1996ce===_0x1ae1a8(0x110)&&!this[_0x1ae1a8(0xed)][_0x1ae1a8(0x109)][_0x1ae1a8(0xee)]&&!this[_0x1ae1a8(0xed)]['project'][_0x1ae1a8(0xee)]&&!this[_0x1ae1a8(0xed)]['profile'][_0x1ae1a8(0xee)]&&!this[_0x1ae1a8(0xed)]['global'][_0x1ae1a8(0xee)])return _0x1ae1a8(0xec);return'CLI\x20flag:\x20--'+_0xda76f5[_0x1ae1a8(0x10e)](/_/g,'-');}if(this[_0x1ae1a8(0xed)][_0x1ae1a8(0x109)][_0xda76f5]===_0x1996ce)return'session';if(this[_0x1ae1a8(0xed)]['project'][_0xda76f5]===_0x1996ce)return _0x1ae1a8(0xe8);if(this[_0x1ae1a8(0xed)][_0x1ae1a8(0x10d)][_0xda76f5]===_0x1996ce)return _0x1ae1a8(0xef)+this[_0x1ae1a8(0x125)];if(this[_0x1ae1a8(0xed)][_0x1ae1a8(0x111)][_0xda76f5]===_0x1996ce)return'global';return _0x1ae1a8(0xec);}['loadGlobalConfig'](){const _0x1b4319=a62_0x507056,_0x546c51=a62_0x574022[_0x1b4319(0x11b)](getConfigDir(),'tdx.json');if(!a62_0x367651['existsSync'](_0x546c51))return{};try{const _0x2ff943=a62_0x367651[_0x1b4319(0xd8)](_0x546c51,'utf-8');return JSON[_0x1b4319(0xdf)](_0x2ff943);}catch{return{};}}[a62_0x507056(0x126)](_0x55fddb){const _0x430ef4=a62_0x507056;_0x55fddb[_0x430ef4(0xee)]=this['site'],!_0x55fddb[_0x430ef4(0x124)]&&this[_0x430ef4(0x124)]&&(_0x55fddb[_0x430ef4(0x124)]=this[_0x430ef4(0x124)]),!_0x55fddb[_0x430ef4(0xea)]&&this[_0x430ef4(0x10b)]&&(_0x55fddb[_0x430ef4(0xea)]=this['parent_segment']),!_0x55fddb[_0x430ef4(0x100)]&&this[_0x430ef4(0x116)]&&(_0x55fddb[_0x430ef4(0x100)]=this[_0x430ef4(0x116)]),!_0x55fddb[_0x430ef4(0x128)]&&this[_0x430ef4(0xfa)]&&(_0x55fddb[_0x430ef4(0x128)]=this[_0x430ef4(0xfa)]),!_0x55fddb[_0x430ef4(0xfb)]&&this[_0x430ef4(0xfe)]&&(_0x55fddb['llmAgent']=this[_0x430ef4(0xfe)]),!_0x55fddb[_0x430ef4(0xff)]&&this[_0x430ef4(0x11e)]&&(_0x55fddb['workflowProject']=this['workflow_project']),!_0x55fddb[_0x430ef4(0xda)]&&this[_0x430ef4(0x11f)]&&(_0x55fddb[_0x430ef4(0xda)]=this['composable_audience']);}[a62_0x507056(0xf1)](){const _0x3709ce=a62_0x507056;return[{'key':_0x3709ce(0xee),'value':this[_0x3709ce(0xee)]},{'key':_0x3709ce(0x124),'value':this[_0x3709ce(0x124)]},{'key':_0x3709ce(0x10b),'value':this[_0x3709ce(0x10b)]},{'key':_0x3709ce(0x116),'value':this[_0x3709ce(0x116)]},{'key':_0x3709ce(0xfa),'value':this[_0x3709ce(0xfa)]},{'key':'llm_agent','value':this['llm_agent']},{'key':_0x3709ce(0x11e),'value':this[_0x3709ce(0x11e)]},{'key':'composable_audience','value':this[_0x3709ce(0x11f)]},{'key':_0x3709ce(0x10d),'value':this[_0x3709ce(0x125)]||undefined}];}['display'](){const _0x2e6b5d=a62_0x507056;console[_0x2e6b5d(0xf4)](a62_0x198bcb[_0x2e6b5d(0x11a)](_0x2e6b5d(0x127)));for(const {key:_0x411009,value:_0x257972}of this[_0x2e6b5d(0xf1)]()){_0x257972&&console['log'](a62_0x198bcb[_0x2e6b5d(0xf9)](_0x411009)+':\x20'+_0x257972);}}[a62_0x507056(0xe5)](){const _0x1d8496=a62_0x507056;console[_0x1d8496(0xf4)](a62_0x198bcb[_0x1d8496(0x11a)](_0x1d8496(0x127)));for(const {key:_0x1e6a1e,value:_0x30c6f1}of this[_0x1d8496(0xf1)]()){if(_0x30c6f1){const _0x40a22f=_0x1e6a1e===_0x1d8496(0x10d)?'(active)':'('+this['getSource'](_0x1e6a1e,_0x30c6f1)+')';console[_0x1d8496(0xf4)](a62_0x198bcb[_0x1d8496(0xf9)](_0x1e6a1e)+':\x20'+_0x30c6f1+'\x20'+a62_0x198bcb[_0x1d8496(0xf6)](_0x40a22f));}}console[_0x1d8496(0xf4)]('\x0a'+a62_0x198bcb[_0x1d8496(0x11a)]('[configuration\x20files]'));const _0x30d878=[{'label':'Session','path':this[_0x1d8496(0x118)][_0x1d8496(0x109)],'extra':_0x1d8496(0xe0)+this[_0x1d8496(0xd9)]+')'},{'label':'Project','path':this[_0x1d8496(0x118)][_0x1d8496(0xe8)]},{'label':'Profile','path':this[_0x1d8496(0x118)][_0x1d8496(0x10d)]},{'label':_0x1d8496(0x105),'path':this[_0x1d8496(0x118)]['profileCredentials']},{'label':_0x1d8496(0xf7),'path':this[_0x1d8496(0x118)][_0x1d8496(0x111)]},{'label':_0x1d8496(0x10a),'path':this['configFiles'][_0x1d8496(0xeb)]}];for(const {label:_0x1cb4cf,path:_0x3d24ff,extra:_0x4795fc}of _0x30d878){if(_0x3d24ff)console['log'](a62_0x198bcb[_0x1d8496(0xf9)](_0x1cb4cf)+':\x20'+_0x3d24ff+'\x20'+a62_0x198bcb[_0x1d8496(0xf2)]('✓')+(_0x4795fc?'\x20'+a62_0x198bcb['dim'](_0x4795fc):''));else{if(_0x1cb4cf===_0x1d8496(0xe6))console[_0x1d8496(0xf4)](a62_0x198bcb[_0x1d8496(0xf9)](_0x1cb4cf)+':\x20'+a62_0x198bcb[_0x1d8496(0xf6)](_0x1d8496(0x106))+'\x20'+a62_0x198bcb[_0x1d8496(0xf6)](_0x1d8496(0xf8)+this[_0x1d8496(0xd9)]+')'));else(_0x1cb4cf===_0x1d8496(0x112)||_0x1cb4cf===_0x1d8496(0xf7))&&console['log'](a62_0x198bcb[_0x1d8496(0xf9)](_0x1cb4cf)+':\x20'+a62_0x198bcb[_0x1d8496(0xf6)]('none'));}}}async[a62_0x507056(0xdc)](){const _0x47349d=a62_0x507056;if(!this[_0x47349d(0x122)]){const _0x3ac9d8=await getOAuthTokens(this[_0x47349d(0x125)]||undefined);if(_0x3ac9d8)return this['accessToken']=_0x3ac9d8[_0x47349d(0x115)],undefined;}return this[_0x47349d(0x123)]=await getAPIKeyAsync(this[_0x47349d(0xee)],this['activeProfile']||undefined),this[_0x47349d(0x123)];}static async[a62_0x507056(0xe4)](_0xe0aa71){const _0x1fd002=a62_0x507056,_0x5a6afc=new GlobalContext(_0xe0aa71);return await _0x5a6afc[_0x1fd002(0xdc)](),_0x5a6afc;}}
@@ -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
+ (function(_0x43465e,_0x18f6dc){const _0x2f13a2=a63_0x1f55,_0x48136e=_0x43465e();while(!![]){try{const _0x137c6f=-parseInt(_0x2f13a2(0xd3))/0x1+-parseInt(_0x2f13a2(0xc8))/0x2*(-parseInt(_0x2f13a2(0xe5))/0x3)+-parseInt(_0x2f13a2(0xdc))/0x4*(parseInt(_0x2f13a2(0xd2))/0x5)+-parseInt(_0x2f13a2(0xd1))/0x6*(parseInt(_0x2f13a2(0xdd))/0x7)+-parseInt(_0x2f13a2(0xcb))/0x8+parseInt(_0x2f13a2(0xe4))/0x9*(-parseInt(_0x2f13a2(0xd6))/0xa)+parseInt(_0x2f13a2(0xd4))/0xb;if(_0x137c6f===_0x18f6dc)break;else _0x48136e['push'](_0x48136e['shift']());}catch(_0x20452d){_0x48136e['push'](_0x48136e['shift']());}}}(a63_0x5213,0xd8362));const SERVICE_NAME='tdx';let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x2255c2=a63_0x1f55;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x19a1d7=await import(_0x2255c2(0xe6));return EntryClass=_0x19a1d7[_0x2255c2(0xd5)],EntryClass;}catch(_0x49d7dd){return keyringLoadError=_0x49d7dd instanceof Error?_0x49d7dd:new Error(String(_0x49d7dd)),null;}}function a63_0x1f55(_0x55c72e,_0x1e170d){_0x55c72e=_0x55c72e-0xc8;const _0x52130c=a63_0x5213();let _0x1f5575=_0x52130c[_0x55c72e];return _0x1f5575;}function getAccountName(_0x308a5f){const _0x2815ae=a63_0x1f55,_0x1dab3a=_0x308a5f||'';return _0x2815ae(0xea)+_0x1dab3a+_0x2815ae(0xec);}export async function getKeychainAPIKey(_0x1515ec){const _0x11eb82=a63_0x1f55,_0x4dbc03=await getKeychainAPIKeyWithStatus(_0x1515ec);if(_0x4dbc03['success'])return _0x4dbc03['value'];return _0x4dbc03[_0x11eb82(0xce)]==='access_denied'&&console[_0x11eb82(0xd9)]('Warning:\x20'+_0x4dbc03['message']),null;}export async function getKeychainAPIKeyWithStatus(_0x36b3b6){const _0x2fc5c3=a63_0x1f55;try{const _0x15bda7=await getEntryClass();if(!_0x15bda7)return{'success':![],'reason':_0x2fc5c3(0xe0)};const _0x3bdcf0=getAccountName(_0x36b3b6),_0x516e70=new _0x15bda7(SERVICE_NAME,_0x3bdcf0),_0x383430=_0x516e70[_0x2fc5c3(0xde)]();if(_0x383430)return{'success':!![],'value':_0x383430};return{'success':![],'reason':_0x2fc5c3(0xda)};}catch(_0x78e490){const _0x17e121=_0x78e490 instanceof Error?_0x78e490['message']:String(_0x78e490);if(_0x17e121[_0x2fc5c3(0xe1)]('-25300')||_0x17e121[_0x2fc5c3(0xeb)]()['includes'](_0x2fc5c3(0xdf))||_0x17e121[_0x2fc5c3(0xeb)]()['includes']('not\x20found')||_0x17e121[_0x2fc5c3(0xeb)]()['includes'](_0x2fc5c3(0xdb)))return{'success':![],'reason':_0x2fc5c3(0xda)};if(_0x17e121[_0x2fc5c3(0xe1)](_0x2fc5c3(0xe9))||_0x17e121[_0x2fc5c3(0xeb)]()[_0x2fc5c3(0xe1)](_0x2fc5c3(0xcd))||_0x17e121['toLowerCase']()['includes'](_0x2fc5c3(0xcc)))return{'success':![],'reason':_0x2fc5c3(0xd8),'message':_0x2fc5c3(0xc9)};return{'success':![],'reason':_0x2fc5c3(0xe0),'message':_0x17e121};}}export async function saveKeychainAPIKey(_0x19801d,_0x2da61a){const _0x3a8162=a63_0x1f55,_0x5029e5=await getEntryClass();if(!_0x5029e5)throw new Error(_0x3a8162(0xe8));const _0x3ddb18=getAccountName(_0x2da61a),_0x299f41=new _0x5029e5(SERVICE_NAME,_0x3ddb18);_0x299f41[_0x3a8162(0xe7)](_0x19801d);}export async function deleteKeychainAPIKey(_0x59a937){const _0x3c8db9=a63_0x1f55;try{const _0x4aafe0=await getEntryClass();if(!_0x4aafe0)return![];const _0x415c39=getAccountName(_0x59a937),_0x400471=new _0x4aafe0(SERVICE_NAME,_0x415c39);return _0x400471[_0x3c8db9(0xca)](),!![];}catch{return![];}}function a63_0x5213(){const _0x497429=['could\x20not\x20be\x20found','unavailable','includes','message','cannot\x20find','9EOaUAJ','2275149JiUjVu','@napi-rs/keyring','setPassword','System\x20keychain\x20is\x20not\x20available','-25293','profile:','toLowerCase',':api_key','2zUZBnR','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.','deleteCredential','7020112cvvtEa','access','restricted','reason','not\x20supported','__keychain_test__','186NEMLRo','94700haEfXu','283699QqTRGg','46440141WDKLcE','Entry','9111010bzPyNA','not\x20available','access_denied','error','not_found','no\x20matching\x20entry','72nXpWUr','379666oaneEO','getPassword'];a63_0x5213=function(){return _0x497429;};return a63_0x5213();}export async function isKeychainAvailable(){const _0x4c1d6b=a63_0x1f55;try{const _0x490306=await getEntryClass();if(!_0x490306)return![];const _0x377022=new _0x490306(SERVICE_NAME,_0x4c1d6b(0xd0));return _0x377022[_0x4c1d6b(0xde)](),!![];}catch(_0x2c14c3){const _0x4583ab=_0x2c14c3 instanceof Error?_0x2c14c3[_0x4c1d6b(0xe2)][_0x4c1d6b(0xeb)]():'';if(_0x4583ab['includes'](_0x4c1d6b(0xd7))||_0x4583ab[_0x4c1d6b(0xe1)](_0x4c1d6b(0xcf))||_0x4583ab['includes'](_0x4c1d6b(0xe3)))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_0x13e13f=a64_0x2c78;(function(_0x32aeaf,_0x419738){const _0x16e6a3=a64_0x2c78,_0x4eaa49=_0x32aeaf();while(!![]){try{const _0x1651a5=parseInt(_0x16e6a3(0x150))/0x1+parseInt(_0x16e6a3(0x155))/0x2+parseInt(_0x16e6a3(0x147))/0x3*(parseInt(_0x16e6a3(0x149))/0x4)+-parseInt(_0x16e6a3(0x14d))/0x5*(-parseInt(_0x16e6a3(0x14c))/0x6)+parseInt(_0x16e6a3(0x152))/0x7+-parseInt(_0x16e6a3(0x154))/0x8*(parseInt(_0x16e6a3(0x151))/0x9)+parseInt(_0x16e6a3(0x14b))/0xa*(-parseInt(_0x16e6a3(0x159))/0xb);if(_0x1651a5===_0x419738)break;else _0x4eaa49['push'](_0x4eaa49['shift']());}catch(_0x3e19ee){_0x4eaa49['push'](_0x4eaa49['shift']());}}}(a64_0x12e6,0x2f006));const SERVICE_NAME=a64_0x13e13f(0x148);let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x576744=a64_0x13e13f;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x38f7d9=await import(_0x576744(0x158));return EntryClass=_0x38f7d9[_0x576744(0x145)],EntryClass;}catch(_0x2f1139){return keyringLoadError=_0x2f1139 instanceof Error?_0x2f1139:new Error(String(_0x2f1139)),null;}}function a64_0x12e6(){const _0x13c3c1=['Entry','profile:','90408FBGzAZ','tdx','8bakqlU','System\x20keychain\x20is\x20not\x20available','40vlcMEJ','67074hpsfPC','15NNhabA','parse','getPassword','337318ujpArQ','9inZUVC','2251494UTozaT','deleteCredential','778704wFoaji','144918xMEuHM','stringify','setPassword','@napi-rs/keyring','1472273nUNpNc'];a64_0x12e6=function(){return _0x13c3c1;};return a64_0x12e6();}function getOAuthAccountName(_0x23a479){const _0x5685a7=a64_0x13e13f,_0x30eb4f=_0x23a479||'';return _0x5685a7(0x146)+_0x30eb4f+':oauth_tokens';}export async function saveOAuthTokens(_0x728bff,_0x214e17){const _0x3f42f0=a64_0x13e13f,_0x537a88=await getEntryClass();if(!_0x537a88)throw new Error(_0x3f42f0(0x14a));const _0x365b11=getOAuthAccountName(_0x214e17),_0x251da4=new _0x537a88(SERVICE_NAME,_0x365b11);_0x251da4[_0x3f42f0(0x157)](JSON[_0x3f42f0(0x156)](_0x728bff));}export async function getOAuthTokens(_0x575f76){const _0x528cab=a64_0x13e13f;try{const _0x553a0a=await getEntryClass();if(!_0x553a0a)return null;const _0x2cc437=getOAuthAccountName(_0x575f76),_0x3638f2=new _0x553a0a(SERVICE_NAME,_0x2cc437),_0x2be330=_0x3638f2[_0x528cab(0x14f)]();if(_0x2be330)return JSON[_0x528cab(0x14e)](_0x2be330);return null;}catch{return null;}}function a64_0x2c78(_0x1e64f8,_0x1c1e48){_0x1e64f8=_0x1e64f8-0x145;const _0x12e6c4=a64_0x12e6();let _0x2c78c9=_0x12e6c4[_0x1e64f8];return _0x2c78c9;}export async function deleteOAuthTokens(_0x4cbc38){const _0x3c09b0=a64_0x13e13f;try{const _0xcd9cbd=await getEntryClass();if(!_0xcd9cbd)return![];const _0x93c108=getOAuthAccountName(_0x4cbc38),_0x5371dc=new _0xcd9cbd(SERVICE_NAME,_0x93c108);return _0x5371dc[_0x3c09b0(0x153)](),!![];}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_0x1a713a=a65_0x36fb;(function(_0x357f11,_0x3d4b10){const _0x34f4fe=a65_0x36fb,_0x3009e1=_0x357f11();while(!![]){try{const _0x2d5f53=-parseInt(_0x34f4fe(0x195))/0x1+-parseInt(_0x34f4fe(0x1b5))/0x2+-parseInt(_0x34f4fe(0x1bc))/0x3*(parseInt(_0x34f4fe(0x1ca))/0x4)+parseInt(_0x34f4fe(0x1a2))/0x5+-parseInt(_0x34f4fe(0x1c4))/0x6+-parseInt(_0x34f4fe(0x1ad))/0x7+parseInt(_0x34f4fe(0x19b))/0x8;if(_0x2d5f53===_0x3d4b10)break;else _0x3009e1['push'](_0x3009e1['shift']());}catch(_0x75a5e6){_0x3009e1['push'](_0x3009e1['shift']());}}}(a65_0x3d5a,0x3b4ea));import*as a65_0x529023 from'node:crypto';function a65_0x36fb(_0x30f15b,_0x15f25a){_0x30f15b=_0x30f15b-0x195;const _0x3d5a06=a65_0x3d5a();let _0x36fb88=_0x3d5a06[_0x30f15b];return _0x36fb88;}import*as a65_0x48fa6c from'node:http';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a65_0x3d5a(){const _0x364417=['OAuth\x20callback\x20received\x20an\x20error\x20or\x20missing\x20parameters','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','base64url','OAuth\x20state\x20mismatch\x20—\x20possible\x20CSRF\x20attack','has','http://localhost:','stg-ap03','code_challenge','\x20is\x20already\x20in\x20use.\x20Stop\x20the\x20process\x20using\x20it\x20and\x20retry.','):\x20','3226748YKTPka','text/html','close','randomBytes','scope','Failed\x20to\x20start\x20OAuth\x20callback\x20server:\x20','sha256','hex','178758IvuuMT','stg-us01','stg-ap01','get','127.0.0.1','waitForCallback','createHash','279mmsweA','end','error','http://127.0.0.1','searchParams','application/x-www-form-urlencoded','text','state','2424210noKykM','OAuth\x20token\x20request\x20failed\x20(','Port\x20','codeChallenge','<html><body><h1>Authentication\x20Failed</h1><p>An\x20error\x20occurred\x20during\x20authentication.\x20Please\x20close\x20this\x20window\x20and\x20try\x20again.</p></body></html>','toString','7116zrtUgP','set','244093WCBueu','code_challenge_method','writeHead','Not\x20Found','message','listen','10523632vlGGXq','status','digest','/oauth/authorize','code','EADDRINUSE','/oauth/token','1456930qqPPRE'];a65_0x3d5a=function(){return _0x364417;};return a65_0x3d5a();}import{openBrowser}from'../utils/process.js';const OAUTH_SUPPORTED_SITES=new Set(['dev-us01','dev-eu01',a65_0x1a713a(0x1b6),a65_0x1a713a(0x1b7),a65_0x1a713a(0x1a9)]);export function isOAuthSupported(_0x170eed){const _0x56a85d=a65_0x1a713a;return OAUTH_SUPPORTED_SITES[_0x56a85d(0x1a7)](_0x170eed);}export const OAUTH_CALLBACK_PORT=0xaa4a;export const OAUTH_REDIRECT_URI=a65_0x1a713a(0x1a8)+OAUTH_CALLBACK_PORT+'/oauth/callback';export function getOAuthClientId(){return process.env.TD_OAUTH_CLIENT_ID||'tdx';}export function generatePKCEPair(){const _0x18eb4a=a65_0x1a713a,_0x6b5c13=a65_0x529023[_0x18eb4a(0x1b0)](0x20)[_0x18eb4a(0x1c9)](_0x18eb4a(0x1a5)),_0x3b6074=a65_0x529023[_0x18eb4a(0x1bb)](_0x18eb4a(0x1b3))['update'](_0x6b5c13)[_0x18eb4a(0x19d)]('base64url');return{'verifier':_0x6b5c13,'challenge':_0x3b6074};}export function buildAuthorizeURL(_0x5b49b8,_0x543dfb){const _0xb5021=a65_0x1a713a,_0x4b6211=new URL(_0xb5021(0x19e),_0x5b49b8);return _0x4b6211[_0xb5021(0x1c0)][_0xb5021(0x1cb)]('response_type','code'),_0x4b6211[_0xb5021(0x1c0)][_0xb5021(0x1cb)]('client_id',_0x543dfb['clientId']),_0x4b6211[_0xb5021(0x1c0)][_0xb5021(0x1cb)]('redirect_uri',_0x543dfb['redirectUri']),_0x4b6211['searchParams']['set']('state',_0x543dfb['state']),_0x4b6211[_0xb5021(0x1c0)][_0xb5021(0x1cb)](_0xb5021(0x1aa),_0x543dfb[_0xb5021(0x1c7)]),_0x4b6211[_0xb5021(0x1c0)][_0xb5021(0x1cb)](_0xb5021(0x196),'S256'),_0x543dfb['scope']&&_0x4b6211[_0xb5021(0x1c0)][_0xb5021(0x1cb)](_0xb5021(0x1b1),_0x543dfb[_0xb5021(0x1b1)]),_0x4b6211[_0xb5021(0x1c9)]();}export async function postTokenRequest(_0x3fe1d6,_0x27b592){const _0x2a30f0=a65_0x1a713a,_0x5b2144=new URLSearchParams(_0x27b592)[_0x2a30f0(0x1c9)](),_0x1a7b47=await fetch(_0x3fe1d6,{'method':'POST','headers':{'Content-Type':_0x2a30f0(0x1c1)},'body':_0x5b2144});if(!_0x1a7b47['ok']){const _0x15f446=await _0x1a7b47[_0x2a30f0(0x1c2)]();throw new Error(_0x2a30f0(0x1c5)+_0x1a7b47[_0x2a30f0(0x19c)]+_0x2a30f0(0x1ac)+_0x15f446);}return await _0x1a7b47['json']();}export async function exchangeCodeForTokens(_0x13c25d,_0x3b2f4e,_0x2e960c,_0x3b8083){const _0x2cf264=a65_0x1a713a,_0x303eb0=_0x13c25d+_0x2cf264(0x1a1);return postTokenRequest(_0x303eb0,{'grant_type':'authorization_code','client_id':getOAuthClientId(),'code':_0x3b2f4e,'code_verifier':_0x2e960c,'redirect_uri':_0x3b8083});}export function startLocalCallbackServer(){const _0x1cd363=a65_0x1a713a;let _0x3ba65d,_0x5b82db;const _0x101619=new Promise((_0x5d2c67,_0x4f6919)=>{_0x3ba65d=_0x5d2c67,_0x5b82db=_0x4f6919;}),_0x459154=a65_0x48fa6c['createServer']((_0x3e4ba5,_0x131981)=>{const _0x5354b4=a65_0x36fb,_0x2e4b41=new URL(_0x3e4ba5['url']||'/',_0x5354b4(0x1bf));if(_0x2e4b41['pathname']!=='/oauth/callback'){_0x131981[_0x5354b4(0x197)](0x194,{'Content-Type':'text/plain'}),_0x131981['end'](_0x5354b4(0x198));return;}const _0x5f1765=_0x2e4b41[_0x5354b4(0x1c0)][_0x5354b4(0x1b8)]('code'),_0xbe5bd5=_0x2e4b41[_0x5354b4(0x1c0)][_0x5354b4(0x1b8)](_0x5354b4(0x1c3)),_0x5055fe=_0x2e4b41[_0x5354b4(0x1c0)][_0x5354b4(0x1b8)]('error');if(_0x5055fe||!_0x5f1765||!_0xbe5bd5){_0x131981[_0x5354b4(0x197)](0x190,{'Content-Type':_0x5354b4(0x1ae)}),_0x131981[_0x5354b4(0x1bd)](_0x5354b4(0x1c8)),_0x5b82db(new Error(_0x5354b4(0x1a3)));return;}_0x131981[_0x5354b4(0x197)](0xc8,{'Content-Type':_0x5354b4(0x1ae)}),_0x131981[_0x5354b4(0x1bd)]('<html><body><h1>Authentication\x20Successful</h1><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>'),_0x3ba65d({'code':_0x5f1765,'state':_0xbe5bd5});});_0x459154['on'](_0x1cd363(0x1be),_0x2c7fdd=>{const _0x146853=_0x1cd363;_0x2c7fdd[_0x146853(0x19f)]===_0x146853(0x1a0)?_0x5b82db(new Error(_0x146853(0x1c6)+OAUTH_CALLBACK_PORT+_0x146853(0x1ab))):_0x5b82db(new Error(_0x146853(0x1b2)+_0x2c7fdd[_0x146853(0x199)]));}),_0x459154[_0x1cd363(0x19a)](OAUTH_CALLBACK_PORT,_0x1cd363(0x1b9));const _0x73dbfa=setTimeout(()=>{const _0x1dd3fd=_0x1cd363;_0x5b82db(new Error(_0x1dd3fd(0x1a4))),_0x459154[_0x1dd3fd(0x1af)]();},0x2*0x3c*0x3e8);return{'waitForCallback':()=>_0x101619,'close':()=>{const _0x114aa7=_0x1cd363;clearTimeout(_0x73dbfa),_0x459154[_0x114aa7(0x1af)]();}};}export async function startOAuthFlow(_0x317744){const _0x4ad090=a65_0x1a713a,_0x332d24=getConsoleUrl(_0x317744),_0x4f16aa=getOAuthClientId(),{verifier:_0x26ccf1,challenge:_0x373792}=generatePKCEPair(),_0x450d7e=a65_0x529023[_0x4ad090(0x1b0)](0x10)[_0x4ad090(0x1c9)](_0x4ad090(0x1b4)),_0x5838c8=startLocalCallbackServer();try{const _0x2f88b3=OAUTH_REDIRECT_URI,_0x42f3a1=buildAuthorizeURL(_0x332d24,{'clientId':_0x4f16aa,'redirectUri':_0x2f88b3,'state':_0x450d7e,'codeChallenge':_0x373792,'scope':'openid\x20email\x20profile'});openBrowser(_0x42f3a1);const _0x1379bd=await _0x5838c8[_0x4ad090(0x1ba)]();if(_0x1379bd[_0x4ad090(0x1c3)]!==_0x450d7e)throw new Error(_0x4ad090(0x1a6));return await exchangeCodeForTokens(_0x332d24,_0x1379bd[_0x4ad090(0x19f)],_0x26ccf1,_0x2f88b3);}finally{_0x5838c8[_0x4ad090(0x1af)]();}}
@@ -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
+ const a66_0x205575=a66_0x53d4;(function(_0x530e6a,_0x30cf90){const _0x45838b=a66_0x53d4,_0x3a3756=_0x530e6a();while(!![]){try{const _0x211af6=parseInt(_0x45838b(0x1c1))/0x1*(parseInt(_0x45838b(0x1a3))/0x2)+parseInt(_0x45838b(0x1bd))/0x3*(-parseInt(_0x45838b(0x1c6))/0x4)+-parseInt(_0x45838b(0x1d1))/0x5+parseInt(_0x45838b(0x1dd))/0x6+parseInt(_0x45838b(0x1a8))/0x7+-parseInt(_0x45838b(0x1ac))/0x8*(parseInt(_0x45838b(0x1dc))/0x9)+parseInt(_0x45838b(0x1a4))/0xa;if(_0x211af6===_0x30cf90)break;else _0x3a3756['push'](_0x3a3756['shift']());}catch(_0x3a2ebf){_0x3a3756['push'](_0x3a3756['shift']());}}}(a66_0x2668,0xe14c7));import*as a66_0x4385ca from'node:fs';import*as a66_0x34a48a 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_0x205575(0x19d);export function getProfileParams(_0x479832){const _0x2ad93a=a66_0x205575,_0xa50b06={};if(!_0x479832)return _0xa50b06;for(const [_0x425202,_0x45e4ac]of Object['entries'](_0x479832)){_0x425202!==_0x2ad93a(0x1e6)&&_0x45e4ac!==undefined&&(_0xa50b06[_0x425202]=_0x45e4ac);}return _0xa50b06;}function a66_0x53d4(_0x23c08d,_0x193aba){_0x23c08d=_0x23c08d-0x19d;const _0x26687d=a66_0x2668();let _0x53d44d=_0x26687d[_0x23c08d];return _0x53d44d;}export function getProfilesDir(){const _0x505466=a66_0x205575;return a66_0x34a48a[_0x505466(0x1c5)](getConfigDir(),_0x505466(0x1c2));}function getProfileDir(_0x10360d){const _0x33b1dd=a66_0x205575;return a66_0x34a48a[_0x33b1dd(0x1c5)](getProfilesDir(),_0x10360d);}function getProfileConfigPath(_0x35a8e8){const _0xef8c2c=a66_0x205575;return a66_0x34a48a[_0xef8c2c(0x1c5)](getProfileDir(_0x35a8e8),'tdx.json');}function getProfileEnvPath(_0x5c201b){return a66_0x34a48a['join'](getProfileDir(_0x5c201b),'.env');}function getGlobalConfigPath(){const _0x1d2109=a66_0x205575;return a66_0x34a48a['join'](getConfigDir(),_0x1d2109(0x1c0));}function validateProfileName(_0x56cea7){const _0x537c35=a66_0x205575;if(/^@?[a-zA-Z0-9_-]+$/['test'](_0x56cea7))return;if(/^@tdx-studio:[a-zA-Z0-9_-]+:\d+(:\d+)?$/['test'](_0x56cea7))return;throw new Error('Invalid\x20profile\x20name:\x20'+_0x56cea7+_0x537c35(0x1cd));}function a66_0x2668(){const _0x533117=['.env.','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','Warning:\x20Profile\x20\x27','3574470crDMpr','database','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','\x22\x20\x22','object','\x20\x20mv\x20\x22','\x27\x20will\x20be\x20ignored',',\x20creating\x20new\x20file','Profile\x20','length','9glqINt','5490282CaOvZJ','local','profile','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','stringify','localeCompare','parse','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','llm_project','description','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','\x27\x20not\x20found\x20in\x20user\x20configuration',':\x20Invalid\x20JSON\x20syntax','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','@tdx-studio','message','user','map','\x20does\x20not\x20exist','Warning:\x20Failed\x20to\x20parse\x20','2giMWAu','6975040HYJizz','utf-8','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','8038513iDgONM','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','keys','Error:\x20','11911192wuQeEO','string','Profile\x20\x27','INVALID_PROFILE_CONFIG','readdirSync','includes','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','has','.env','sort','values','toISOString','\x27:\x20config\x20must\x20be\x20an\x20object','find','site','filter','name','2661tbTSew','readFileSync','push','tdx.json','601648cfvBxX','profiles','warn','existsSync','join','1064Kajmqm','\x27:\x20unknown\x20config\x20key\x20\x27','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','isDirectory','llm_agent','To\x20migrate:','parent_segment','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20underscore,\x20and\x20optional\x20@\x20prefix\x20for\x20reserved\x20profiles.'];a66_0x2668=function(){return _0x533117;};return a66_0x2668();}function validateProfileConfig(_0xf9884e,_0x22657d){const _0x1d7200=a66_0x205575;if(typeof _0xf9884e!==_0x1d7200(0x1d6)||_0xf9884e===null)throw new SDKError(ErrorCode[_0x1d7200(0x1af)],'Profile\x20\x27'+_0x22657d+_0x1d7200(0x1b8));const _0x4d5009=['description',_0x1d7200(0x1ba),_0x1d7200(0x1d2),_0x1d7200(0x1cc),_0x1d7200(0x1e5),_0x1d7200(0x1ca),'user_info'],_0x33a7ea=_0xf9884e;for(const _0x4b5d6b of Object[_0x1d7200(0x1aa)](_0x33a7ea)){!_0x4d5009[_0x1d7200(0x1b1)](_0x4b5d6b)&&console[_0x1d7200(0x1c3)](_0x1d7200(0x1d0)+_0x22657d+_0x1d7200(0x1c7)+_0x4b5d6b+_0x1d7200(0x1d8));}if(_0x33a7ea['description']!==undefined&&typeof _0x33a7ea[_0x1d7200(0x1e6)]!=='string')throw new SDKError(ErrorCode[_0x1d7200(0x1af)],'Profile\x20\x27'+_0x22657d+'\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string');if(_0x33a7ea[_0x1d7200(0x1ba)]!==undefined&&typeof _0x33a7ea['site']!==_0x1d7200(0x1ad))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],'Profile\x20\x27'+_0x22657d+_0x1d7200(0x1e7));if(_0x33a7ea[_0x1d7200(0x1d2)]!==undefined&&typeof _0x33a7ea['database']!==_0x1d7200(0x1ad))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],'Profile\x20\x27'+_0x22657d+_0x1d7200(0x1a7));if(_0x33a7ea[_0x1d7200(0x1cc)]!==undefined&&typeof _0x33a7ea['parent_segment']!==_0x1d7200(0x1ad))throw new SDKError(ErrorCode[_0x1d7200(0x1af)],_0x1d7200(0x1ae)+_0x22657d+'\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string');if(_0x33a7ea[_0x1d7200(0x1e5)]!==undefined&&typeof _0x33a7ea[_0x1d7200(0x1e5)]!==_0x1d7200(0x1ad))throw new SDKError(ErrorCode[_0x1d7200(0x1af)],'Profile\x20\x27'+_0x22657d+_0x1d7200(0x1b2));if(_0x33a7ea[_0x1d7200(0x1ca)]!==undefined&&typeof _0x33a7ea['llm_agent']!==_0x1d7200(0x1ad))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],'Profile\x20\x27'+_0x22657d+_0x1d7200(0x1e0));return!![];}function loadProfilesFromTdxJson(_0x20dcbe,_0x10a5a0){const _0x5e3c8f=a66_0x205575;if(!a66_0x4385ca[_0x5e3c8f(0x1c4)](_0x20dcbe))return[];try{const _0x36f69b=a66_0x4385ca['readFileSync'](_0x20dcbe,'utf-8'),_0x395009=JSON[_0x5e3c8f(0x1e3)](_0x36f69b);if(!_0x395009[_0x5e3c8f(0x1c2)]||typeof _0x395009[_0x5e3c8f(0x1c2)]!==_0x5e3c8f(0x1d6))return[];const _0x212f3b=[];for(const [_0x1575ef,_0x281f35]of Object['entries'](_0x395009['profiles'])){try{validateProfileConfig(_0x281f35,_0x1575ef);const _0x342e09=getNewCredentialPath(_0x1575ef),_0x21dda0=getOldCredentialPath(_0x1575ef),_0x2a6408=a66_0x4385ca['existsSync'](_0x342e09)||a66_0x4385ca[_0x5e3c8f(0x1c4)](_0x21dda0);_0x212f3b[_0x5e3c8f(0x1bf)]({'name':_0x1575ef,'config':_0x281f35,'metadata':{'name':_0x1575ef,'createdAt':new Date()[_0x5e3c8f(0x1b7)]()},'hasCredentials':_0x2a6408,'scope':_0x10a5a0});}catch(_0x29a4c8){_0x29a4c8 instanceof Error&&(console[_0x5e3c8f(0x1c3)](_0x5e3c8f(0x1a9)+_0x20dcbe+':'),console[_0x5e3c8f(0x1c3)]('\x20\x20'+_0x29a4c8['message']+'\x0a'));}}return _0x212f3b;}catch(_0x189cc7){return _0x189cc7 instanceof SyntaxError?(console[_0x5e3c8f(0x1c3)]('\x0aWarning:\x20Failed\x20to\x20parse\x20'+_0x20dcbe+_0x5e3c8f(0x1e9)),console[_0x5e3c8f(0x1c3)](_0x5e3c8f(0x1ab)+_0x189cc7[_0x5e3c8f(0x19e)]+'\x0a')):console[_0x5e3c8f(0x1c3)](_0x5e3c8f(0x1ea)+_0x20dcbe+':\x20'+_0x189cc7+'\x0a'),[];}}export function getNewCredentialPath(_0x55349d){const _0x4dce5f=a66_0x205575;return a66_0x34a48a[_0x4dce5f(0x1c5)](getConfigDir(),_0x4dce5f(0x1ce)+_0x55349d);}function getOldCredentialPath(_0x149794){const _0x2b7fcc=a66_0x205575;return a66_0x34a48a[_0x2b7fcc(0x1c5)](getProfilesDir(),_0x149794,_0x2b7fcc(0x1b4));}function loadProfilesFromTdxJsonFiles(){const _0xa61bfa=a66_0x205575,_0x46f674=[],_0x4eee65=findProjectConfigPath();_0x4eee65&&_0x46f674['push'](...loadProfilesFromTdxJson(_0x4eee65,_0xa61bfa(0x1de)));const _0x87c557=a66_0x34a48a['join'](getConfigDir(),_0xa61bfa(0x1c0));return _0x46f674['push'](...loadProfilesFromTdxJson(_0x87c557,_0xa61bfa(0x19f))),_0x46f674;}function loadProfilesFromDirectories(){const _0xf10508=a66_0x205575,_0x39c91f=getProfilesDir();if(!a66_0x4385ca['existsSync'](_0x39c91f))return[];try{return a66_0x4385ca[_0xf10508(0x1b0)](_0x39c91f,{'withFileTypes':!![]})[_0xf10508(0x1bb)](_0x3fb8ad=>_0x3fb8ad[_0xf10508(0x1c9)]())[_0xf10508(0x1a0)](_0x1e3fa8=>_0x1e3fa8[_0xf10508(0x1bc)])['filter'](_0x468ed1=>{const _0x3ca36a=_0xf10508,_0x5ab66a=getProfileConfigPath(_0x468ed1),_0x2e8152=getProfileEnvPath(_0x468ed1);return a66_0x4385ca[_0x3ca36a(0x1c4)](_0x5ab66a)||a66_0x4385ca[_0x3ca36a(0x1c4)](_0x2e8152);})['map'](_0x34cb0a=>{const _0x448b78=loadProfileFromDirectory(_0x34cb0a);if(_0x448b78)return{..._0x448b78,'scope':'directory'};return null;})['filter'](_0x700f70=>_0x700f70!==null);}catch{return[];}}function loadProfileFromDirectory(_0x57753b){const _0x1cf1ef=a66_0x205575,_0x1cfc1b=getProfileConfigPath(_0x57753b),_0x1a3b43=getOldCredentialPath(_0x57753b);if(!a66_0x4385ca['existsSync'](_0x1cfc1b)&&!a66_0x4385ca[_0x1cf1ef(0x1c4)](_0x1a3b43))return null;let _0x42b620={},_0x783704={'name':_0x57753b,'createdAt':new Date()[_0x1cf1ef(0x1b7)]()};if(a66_0x4385ca[_0x1cf1ef(0x1c4)](_0x1cfc1b))try{const _0x59fbfb=a66_0x4385ca[_0x1cf1ef(0x1be)](_0x1cfc1b,_0x1cf1ef(0x1a5)),_0x577dac=JSON[_0x1cf1ef(0x1e3)](_0x59fbfb),{metadata:_0x4aabe1,..._0x58fe7f}=_0x577dac;_0x42b620=_0x58fe7f,_0x4aabe1&&(_0x783704=_0x4aabe1);}catch{}return{'name':_0x57753b,'config':_0x42b620,'metadata':_0x783704,'hasCredentials':a66_0x4385ca[_0x1cf1ef(0x1c4)](_0x1a3b43),'scope':'directory'};}export function listProfiles(){const _0x4d7a60=a66_0x205575,_0x45bfe2=loadProfilesFromTdxJsonFiles(),_0x1201b4=loadProfilesFromDirectories();if(_0x1201b4[_0x4d7a60(0x1db)]>0x0){const _0x3aa62b=_0x1201b4[_0x4d7a60(0x1a0)](_0x36b421=>_0x36b421[_0x4d7a60(0x1bc)])[_0x4d7a60(0x1c5)](',\x20'),_0x44f15c=getConfigDir();console['warn'](_0x4d7a60(0x1d4)+_0x3aa62b),console['warn'](_0x4d7a60(0x1e4)),console[_0x4d7a60(0x1c3)]('\x20\x201.\x20Edit:\x20'+a66_0x34a48a['join'](_0x44f15c,'tdx.json')),console[_0x4d7a60(0x1c3)](_0x4d7a60(0x1cf)),console['warn'](_0x4d7a60(0x1d3));}const _0x2225d2=[..._0x45bfe2,..._0x1201b4],_0x49f4cd=new Map();for(const _0x5cfeca of _0x2225d2){!_0x49f4cd[_0x4d7a60(0x1b3)](_0x5cfeca[_0x4d7a60(0x1bc)])&&_0x49f4cd['set'](_0x5cfeca[_0x4d7a60(0x1bc)],_0x5cfeca);}return Array['from'](_0x49f4cd[_0x4d7a60(0x1b6)]())[_0x4d7a60(0x1b5)]((_0x5268bd,_0x57ad37)=>_0x5268bd['name'][_0x4d7a60(0x1e2)](_0x57ad37['name']));}export function profileExists(_0x4468c1){const _0x4c580a=a66_0x205575,_0x270f08=listProfiles();return _0x270f08['some'](_0x2fed01=>_0x2fed01[_0x4c580a(0x1bc)]===_0x4468c1);}export function loadProfile(_0x47debc){const _0x334f7e=a66_0x205575;validateProfileName(_0x47debc);const _0x5a5e84=listProfiles(),_0x456c4e=_0x5a5e84[_0x334f7e(0x1b9)](_0x493c0a=>_0x493c0a[_0x334f7e(0x1bc)]===_0x47debc);return _0x456c4e||null;}export function saveProfile(_0x475207,_0x1c4d64,_0x51f747=![]){saveProfileToUserConfig(_0x475207,_0x1c4d64);}export function deleteProfile(_0x2d6fff){const _0x2ed28f=a66_0x205575;validateProfileName(_0x2d6fff);const _0x1a1b6f=getProfileDir(_0x2d6fff);if(!a66_0x4385ca[_0x2ed28f(0x1c4)](_0x1a1b6f))throw new Error(_0x2ed28f(0x1da)+_0x2d6fff+_0x2ed28f(0x1a1));a66_0x4385ca['rmSync'](_0x1a1b6f,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x8f9dd6,_0x31db37){const _0xf005a2=a66_0x205575;validateProfileName(_0x8f9dd6);const _0x190700=getGlobalConfigPath(),_0x49db29=getConfigDir();!a66_0x4385ca[_0xf005a2(0x1c4)](_0x49db29)&&createSecureDirectory(_0x49db29);let _0x44340c={};if(a66_0x4385ca['existsSync'](_0x190700))try{const _0x282e9a=a66_0x4385ca[_0xf005a2(0x1be)](_0x190700,_0xf005a2(0x1a5));_0x44340c=JSON[_0xf005a2(0x1e3)](_0x282e9a);}catch{console[_0xf005a2(0x1c3)](_0xf005a2(0x1a2)+_0x190700+',\x20creating\x20new\x20file');}!_0x44340c[_0xf005a2(0x1c2)]&&(_0x44340c[_0xf005a2(0x1c2)]={}),_0x44340c[_0xf005a2(0x1c2)][_0x8f9dd6]=_0x31db37,writeSecureFile(_0x190700,JSON[_0xf005a2(0x1e1)](_0x44340c,null,0x2));}export function removeProfileFromUserConfig(_0x2d73d1){const _0x4555d3=a66_0x205575;validateProfileName(_0x2d73d1);const _0x7ecbb5=getGlobalConfigPath();if(!a66_0x4385ca[_0x4555d3(0x1c4)](_0x7ecbb5))throw new Error(_0x4555d3(0x1ae)+_0x2d73d1+_0x4555d3(0x1e8));let _0x792fd={};try{const _0x3fe2a6=a66_0x4385ca[_0x4555d3(0x1be)](_0x7ecbb5,_0x4555d3(0x1a5));_0x792fd=JSON[_0x4555d3(0x1e3)](_0x3fe2a6);}catch{throw new Error('Failed\x20to\x20parse\x20'+_0x7ecbb5);}if(!_0x792fd['profiles']||!_0x792fd['profiles'][_0x2d73d1])throw new Error(_0x4555d3(0x1ae)+_0x2d73d1+'\x27\x20not\x20found\x20in\x20user\x20configuration');delete _0x792fd[_0x4555d3(0x1c2)][_0x2d73d1],_0x792fd[_0x4555d3(0x1df)]===_0x2d73d1&&delete _0x792fd[_0x4555d3(0x1df)],writeSecureFile(_0x7ecbb5,JSON['stringify'](_0x792fd,null,0x2));}export function getActiveProfile(){const _0x4ca85e=a66_0x205575,_0x16f110=loadSessionContext();if(_0x16f110?.[_0x4ca85e(0x1df)])return _0x16f110[_0x4ca85e(0x1df)];if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x5ea034=getGlobalConfigPath();if(!a66_0x4385ca[_0x4ca85e(0x1c4)](_0x5ea034))return null;try{const _0x28970d=a66_0x4385ca['readFileSync'](_0x5ea034,_0x4ca85e(0x1a5)),_0x337396=JSON['parse'](_0x28970d);return _0x337396['profile']||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x4a0b4d){const _0x5239e5=a66_0x205575,_0x4ab903=getGlobalConfigPath(),_0x320dab=getConfigDir();!a66_0x4385ca['existsSync'](_0x320dab)&&createSecureDirectory(_0x320dab);let _0x4cdba7={};if(a66_0x4385ca[_0x5239e5(0x1c4)](_0x4ab903))try{const _0x38d179=a66_0x4385ca['readFileSync'](_0x4ab903,_0x5239e5(0x1a5));_0x4cdba7=JSON['parse'](_0x38d179);}catch{console[_0x5239e5(0x1c3)]('Warning:\x20Failed\x20to\x20parse\x20'+_0x4ab903+_0x5239e5(0x1d9));}_0x4cdba7[_0x5239e5(0x1ba)]=_0x4a0b4d,writeSecureFile(_0x4ab903,JSON[_0x5239e5(0x1e1)](_0x4cdba7,null,0x2));}export function saveActiveProfileToUserConfig(_0x361b9d){const _0x6a943c=a66_0x205575;validateProfileName(_0x361b9d);const _0x8f2a8c=getGlobalConfigPath(),_0x53efef=getConfigDir();!a66_0x4385ca[_0x6a943c(0x1c4)](_0x53efef)&&createSecureDirectory(_0x53efef);let _0x75f4a7={};if(a66_0x4385ca[_0x6a943c(0x1c4)](_0x8f2a8c))try{const _0x42c5dc=a66_0x4385ca['readFileSync'](_0x8f2a8c,_0x6a943c(0x1a5));_0x75f4a7=JSON[_0x6a943c(0x1e3)](_0x42c5dc);}catch{console[_0x6a943c(0x1c3)](_0x6a943c(0x1a2)+_0x8f2a8c+_0x6a943c(0x1d9));}_0x75f4a7[_0x6a943c(0x1df)]=_0x361b9d,writeSecureFile(_0x8f2a8c,JSON[_0x6a943c(0x1e1)](_0x75f4a7,null,0x2));}function clearFieldFromUserConfig(_0x1e03af){const _0x52bc97=a66_0x205575,_0x3c58b1=getGlobalConfigPath();if(!a66_0x4385ca[_0x52bc97(0x1c4)](_0x3c58b1))return;let _0x5591eb={};try{const _0x1f9889=a66_0x4385ca['readFileSync'](_0x3c58b1,_0x52bc97(0x1a5));_0x5591eb=JSON['parse'](_0x1f9889);}catch{return;}delete _0x5591eb[_0x1e03af],writeSecureFile(_0x3c58b1,JSON[_0x52bc97(0x1e1)](_0x5591eb,null,0x2));}export function clearDefaultSiteFromUserConfig(){clearFieldFromUserConfig('site');}export function clearActiveProfileFromUserConfig(){clearFieldFromUserConfig('profile');}export function createProfile(_0x23235b,_0x5c18be){const _0x2d8f27=a66_0x205575;validateProfileName(_0x23235b);if(profileExists(_0x23235b))throw new Error(_0x2d8f27(0x1da)+_0x23235b+'\x20already\x20exists');saveProfile(_0x23235b,_0x5c18be);}export function saveProfileCredentials(_0x512d24,_0x306913){const _0x3d9b41=a66_0x205575;validateProfileName(_0x512d24);if(!profileExists(_0x512d24))throw new Error(_0x3d9b41(0x1da)+_0x512d24+_0x3d9b41(0x1a1));const _0x1fb118=getNewCredentialPath(_0x512d24);writeSecureFile(_0x1fb118,_0x306913);}export function loadProfileCredentials(_0x30d8c3){const _0x2bf22f=a66_0x205575;validateProfileName(_0x30d8c3);const _0x3d3d00=getNewCredentialPath(_0x30d8c3);if(a66_0x4385ca[_0x2bf22f(0x1c4)](_0x3d3d00))try{return a66_0x4385ca['readFileSync'](_0x3d3d00,_0x2bf22f(0x1a5));}catch{}const _0x116ad0=getOldCredentialPath(_0x30d8c3);if(a66_0x4385ca['existsSync'](_0x116ad0)){console[_0x2bf22f(0x1c3)](_0x2bf22f(0x1c8)+_0x30d8c3+'\x27'),console[_0x2bf22f(0x1c3)](_0x2bf22f(0x1cb)),console[_0x2bf22f(0x1c3)](_0x2bf22f(0x1d7)+_0x116ad0+_0x2bf22f(0x1d5)+_0x3d3d00+'\x22'),console[_0x2bf22f(0x1c3)](_0x2bf22f(0x1a6));try{return a66_0x4385ca[_0x2bf22f(0x1be)](_0x116ad0,_0x2bf22f(0x1a5));}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
+ const a67_0x17f27f=a67_0x5108;(function(_0x3adb12,_0x598a82){const _0x4bdd29=a67_0x5108,_0x53d6d0=_0x3adb12();while(!![]){try{const _0xf4dd78=-parseInt(_0x4bdd29(0x131))/0x1+-parseInt(_0x4bdd29(0x130))/0x2*(parseInt(_0x4bdd29(0x134))/0x3)+parseInt(_0x4bdd29(0x136))/0x4+-parseInt(_0x4bdd29(0x14c))/0x5*(-parseInt(_0x4bdd29(0x149))/0x6)+parseInt(_0x4bdd29(0x14d))/0x7*(-parseInt(_0x4bdd29(0x146))/0x8)+parseInt(_0x4bdd29(0x144))/0x9*(-parseInt(_0x4bdd29(0x12f))/0xa)+parseInt(_0x4bdd29(0x12c))/0xb*(parseInt(_0x4bdd29(0x139))/0xc);if(_0xf4dd78===_0x598a82)break;else _0x53d6d0['push'](_0x53d6d0['shift']());}catch(_0x362fb9){_0x53d6d0['push'](_0x53d6d0['shift']());}}}(a67_0x2d5f,0x22456));import*as a67_0x1e1ac1 from'node:fs';function a67_0x2d5f(){const _0x3bbf27=['parse','profile','api_key','warn','writeFileSync','apiKey','utf-8','dirname','Failed\x20to\x20load\x20project\x20config\x20from\x20','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','198IfXWSE','existsSync','167216PzyGKE','includes','TD_API_KEY','6wUQMev','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','559385ucDGiL','49dZrWOS','code','4420691cVSKqF','cwd','ENOENT','31490NfOeff','2klBJrq','95514qZhKTl','join',').\x20','602298nNbBkM','stringify','553952CTIyFb','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','tdx.json','12cYcCSa'];a67_0x2d5f=function(){return _0x3bbf27;};return a67_0x2d5f();}import*as a67_0x24a430 from'node:path';const PROJECT_CONFIG_FILENAME=a67_0x17f27f(0x138);function a67_0x5108(_0x5e9191,_0x3c64d3){_0x5e9191=_0x5e9191-0x12b;const _0x2d5f50=a67_0x2d5f();let _0x510845=_0x2d5f50[_0x5e9191];return _0x510845;}export function findProjectConfigPath(_0x12e34d){const _0x338913=a67_0x17f27f;let _0x25d4c1=_0x12e34d||process[_0x338913(0x12d)]();while(!![]){const _0x41adbc=a67_0x24a430[_0x338913(0x132)](_0x25d4c1,PROJECT_CONFIG_FILENAME);if(a67_0x1e1ac1[_0x338913(0x145)](_0x41adbc))return _0x41adbc;const _0x35de91=a67_0x24a430[_0x338913(0x141)](_0x25d4c1);if(_0x35de91===_0x25d4c1)return null;_0x25d4c1=_0x35de91;}}export function loadProjectConfig(_0x27e304){const _0x519765=a67_0x17f27f,_0x819f8=findProjectConfigPath(_0x27e304);if(!_0x819f8)return null;try{const _0x403327=a67_0x1e1ac1['readFileSync'](_0x819f8,_0x519765(0x140)),_0x5b099a=JSON[_0x519765(0x13a)](_0x403327),_0x1f4179=JSON[_0x519765(0x135)](_0x5b099a);if(_0x1f4179[_0x519765(0x147)](_0x519765(0x148))||_0x1f4179[_0x519765(0x147)]('apiKey')||_0x1f4179['includes'](_0x519765(0x13c)))throw new Error('Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20('+_0x819f8+_0x519765(0x133)+_0x519765(0x14b));const {metadata:_0x423bdb,profile:_0x1afa1e,..._0x412616}=_0x5b099a;return _0x1afa1e&&console[_0x519765(0x13d)]('Warning:\x20\x27profile\x27\x20field\x20in\x20'+_0x819f8+'\x20is\x20ignored.\x20'+_0x519765(0x137)),_0x412616;}catch(_0x25f512){if(_0x25f512 instanceof Error&&_0x519765(0x12b)in _0x25f512&&_0x25f512[_0x519765(0x12b)]===_0x519765(0x12e))return null;throw new Error(_0x519765(0x142)+_0x819f8+':\x20'+_0x25f512);}}export function saveProjectConfig(_0x36ca58,_0xb3a964){const _0x173b06=a67_0x17f27f,_0xdbe0e3=_0xb3a964||process[_0x173b06(0x12d)](),_0x269cc3=a67_0x24a430['join'](_0xdbe0e3,PROJECT_CONFIG_FILENAME),_0x44c0b8=JSON[_0x173b06(0x135)](_0x36ca58);if(_0x44c0b8[_0x173b06(0x147)]('TD_API_KEY')||_0x44c0b8[_0x173b06(0x147)](_0x173b06(0x13f))||_0x44c0b8['includes'](_0x173b06(0x13c)))throw new Error(_0x173b06(0x14a));if(_0x173b06(0x13b)in _0x36ca58)throw new Error(_0x173b06(0x143));a67_0x1e1ac1[_0x173b06(0x13e)](_0x269cc3,JSON[_0x173b06(0x135)](_0x36ca58,null,0x2));}export function hasProjectConfig(_0x56b6ca){return findProjectConfigPath(_0x56b6ca)!==null;}export function getProjectRoot(_0x27701f){const _0x2045d9=findProjectConfigPath(_0x27701f);return _0x2045d9?a67_0x24a430['dirname'](_0x2045d9):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(_0x2bab6b,_0x770d3d){const _0x436204=a68_0x4333,_0x3e716f=_0x2bab6b();while(!![]){try{const _0x51c735=-parseInt(_0x436204(0xc6))/0x1+-parseInt(_0x436204(0xbb))/0x2*(parseInt(_0x436204(0xaf))/0x3)+parseInt(_0x436204(0xc7))/0x4*(parseInt(_0x436204(0xc1))/0x5)+parseInt(_0x436204(0xb5))/0x6+-parseInt(_0x436204(0xbe))/0x7*(-parseInt(_0x436204(0xb4))/0x8)+-parseInt(_0x436204(0xa9))/0x9*(-parseInt(_0x436204(0xca))/0xa)+parseInt(_0x436204(0xb2))/0xb*(-parseInt(_0x436204(0xbd))/0xc);if(_0x51c735===_0x770d3d)break;else _0x3e716f['push'](_0x3e716f['shift']());}catch(_0x1a3bd8){_0x3e716f['push'](_0x3e716f['shift']());}}}(a68_0x5125,0x6bdc4));import*as a68_0x593f44 from'node:fs';import*as a68_0x102c60 from'node:path';import*as a68_0x1c5fff 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 _0x2c43c7=a68_0x4333,_0x5a46fe=process.env.TDX_CONFIG_DIR||a68_0x102c60[_0x2c43c7(0xcc)](a68_0x1c5fff[_0x2c43c7(0xa4)](),'.config',_0x2c43c7(0xa7));return a68_0x102c60[_0x2c43c7(0xcc)](_0x5a46fe,_0x2c43c7(0xc2));}function a68_0x5125(){const _0x36ee6b=['writeFileSync','utf-8','warn','.json','api_key','4kRZggy','getTime','17412NTutFh','7kfRfNm','push','sort','97415jDvCti','sessions','.\x20This\x20is\x20insecure.\x20Removing\x20session.','now','unlinkSync','221577YrVcfT','136liNZMN','test','apiKey','5640bxQaqI','parse','join','stringify','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','homedir','existsSync','readFileSync','tdx','TD_API_KEY','2421BVuSeY','toISOString','includes','createdAt','replace','endsWith','1291281dQMUEm','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','toString','2893FAmxDb','readdirSync','6440528NLKanH','1719816OCSGRM'];a68_0x5125=function(){return _0x36ee6b;};return a68_0x5125();}function getSessionPath(_0x1a5158){const _0x319c3b=a68_0x4333;return a68_0x102c60[_0x319c3b(0xcc)](getSessionsDir(),_0x1a5158+'.json');}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x1f6903){const _0x26d367=a68_0x4333;if(_0x1f6903)return _0x1f6903;if(process.env.TDX_SESSION)return process.env.TDX_SESSION;return getCurrentSessionPID()[_0x26d367(0xb1)]();}export function loadSessionContext(_0x898b7b){const _0x2192ae=getSessionID(_0x898b7b),_0x2c1966=/^\d+$/['test'](_0x2192ae)?parseInt(_0x2192ae,0xa):null;return _0x2c1966!==null?loadSessionContextByPID(_0x2c1966):loadSessionContextByString(_0x2192ae);}export function loadSessionContextByPID(_0x504ce7){const _0x42618a=a68_0x4333,_0x26b7db=getSessionPath(_0x504ce7);if(!a68_0x593f44[_0x42618a(0xa5)](_0x26b7db))return null;try{const _0x1f2595=a68_0x593f44[_0x42618a(0xa6)](_0x26b7db,'utf-8'),_0x42bf7e=JSON[_0x42618a(0xcb)](_0x1f2595),_0x35b7e3=new Date(_0x42bf7e[_0x42618a(0xac)])['getTime'](),_0x439424=Date['now']();if(_0x439424-_0x35b7e3>SESSION_EXPIRATION_MS)return a68_0x593f44['unlinkSync'](_0x26b7db),null;const _0x163bc1=JSON[_0x42618a(0xa2)](_0x42bf7e);if(_0x163bc1[_0x42618a(0xab)](_0x42618a(0xa8))||_0x163bc1[_0x42618a(0xab)](_0x42618a(0xc9))||_0x163bc1[_0x42618a(0xab)](_0x42618a(0xba)))return console[_0x42618a(0xb8)](_0x42618a(0xa3)+_0x26b7db+'.\x20This\x20is\x20insecure.\x20Removing\x20session.'),a68_0x593f44['unlinkSync'](_0x26b7db),null;return _0x42bf7e;}catch{try{a68_0x593f44[_0x42618a(0xc5)](_0x26b7db);}catch{}return null;}}function loadSessionContextByString(_0x4d6bb3){const _0x22a6f2=a68_0x4333,_0x189aff=a68_0x102c60['join'](getSessionsDir(),_0x4d6bb3+'.json');if(!a68_0x593f44['existsSync'](_0x189aff))return null;try{const _0x3c11fb=a68_0x593f44[_0x22a6f2(0xa6)](_0x189aff,'utf-8'),_0x48d635=JSON[_0x22a6f2(0xcb)](_0x3c11fb),_0x22bd78=new Date(_0x48d635[_0x22a6f2(0xac)])[_0x22a6f2(0xbc)](),_0x14f29b=Date[_0x22a6f2(0xc4)]();if(_0x14f29b-_0x22bd78>SESSION_EXPIRATION_MS)return a68_0x593f44[_0x22a6f2(0xc5)](_0x189aff),null;const _0x368512=JSON[_0x22a6f2(0xa2)](_0x48d635);if(_0x368512[_0x22a6f2(0xab)](_0x22a6f2(0xa8))||_0x368512['includes'](_0x22a6f2(0xc9))||_0x368512['includes'](_0x22a6f2(0xba)))return console[_0x22a6f2(0xb8)](_0x22a6f2(0xa3)+_0x189aff+_0x22a6f2(0xc3)),a68_0x593f44[_0x22a6f2(0xc5)](_0x189aff),null;return _0x48d635;}catch{try{a68_0x593f44[_0x22a6f2(0xc5)](_0x189aff);}catch{}return null;}}export function saveSessionContext(_0x199762,_0x40e6c1){const _0x18de80=a68_0x4333,_0x3e8dc8=getSessionID(_0x40e6c1),_0x5b425a=/^\d+$/[_0x18de80(0xc8)](_0x3e8dc8)?parseInt(_0x3e8dc8,0xa):getCurrentSessionPID(),_0x383d17=a68_0x102c60[_0x18de80(0xcc)](getSessionsDir(),_0x3e8dc8+_0x18de80(0xb9)),_0x3eb5ec=getSessionsDir();createSecureDirectory(_0x3eb5ec);const _0x4667d9=JSON[_0x18de80(0xa2)](_0x199762);if(_0x4667d9['includes'](_0x18de80(0xa8))||_0x4667d9[_0x18de80(0xab)]('apiKey')||_0x4667d9['includes'](_0x18de80(0xba)))throw new Error(_0x18de80(0xb0));let _0x112fdd;const _0x48b5fc=/^\d+$/['test'](_0x3e8dc8)?loadSessionContextByPID(parseInt(_0x3e8dc8,0xa)):loadSessionContextByString(_0x3e8dc8);_0x48b5fc?_0x112fdd={..._0x48b5fc,..._0x199762,'pid':_0x5b425a,'sessionId':_0x3e8dc8!==_0x5b425a[_0x18de80(0xb1)]()?_0x3e8dc8:undefined,'updatedAt':new Date()[_0x18de80(0xaa)]()}:_0x112fdd={'pid':_0x5b425a,'sessionId':_0x3e8dc8!==_0x5b425a[_0x18de80(0xb1)]()?_0x3e8dc8:undefined,..._0x199762,'createdAt':new Date()[_0x18de80(0xaa)](),'updatedAt':new Date()['toISOString']()},a68_0x593f44['writeFileSync'](_0x383d17,JSON[_0x18de80(0xa2)](_0x112fdd,null,0x2));}export function clearSessionContext(_0x3e212f){const _0x574836=a68_0x4333,_0x1248c2=getSessionID(_0x3e212f),_0x559ef5=a68_0x102c60[_0x574836(0xcc)](getSessionsDir(),_0x1248c2+_0x574836(0xb9));a68_0x593f44[_0x574836(0xa5)](_0x559ef5)&&a68_0x593f44[_0x574836(0xc5)](_0x559ef5);}export function clearSessionContextField(_0x26a6ed,_0x380bb6){const _0x1c5aea=a68_0x4333,_0x2b2eaf=getSessionID(_0x380bb6),_0xc7a04f=a68_0x102c60['join'](getSessionsDir(),_0x2b2eaf+_0x1c5aea(0xb9));if(!a68_0x593f44[_0x1c5aea(0xa5)](_0xc7a04f))return;try{const _0x254009=a68_0x593f44['readFileSync'](_0xc7a04f,'utf-8'),_0x4c998f=JSON[_0x1c5aea(0xcb)](_0x254009);delete _0x4c998f[_0x26a6ed],a68_0x593f44[_0x1c5aea(0xb6)](_0xc7a04f,JSON[_0x1c5aea(0xa2)](_0x4c998f,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x5adf99=a68_0x4333,_0x364dd1=getSessionsDir();if(!a68_0x593f44[_0x5adf99(0xa5)](_0x364dd1))return 0x0;let _0x350a3e=0x0;const _0x4a04ed=Date[_0x5adf99(0xc4)]();try{const _0x4a6061=a68_0x593f44[_0x5adf99(0xb3)](_0x364dd1);for(const _0x7dcb50 of _0x4a6061){if(!_0x7dcb50[_0x5adf99(0xae)]('.json'))continue;const _0x347535=a68_0x102c60['join'](_0x364dd1,_0x7dcb50),_0x4afd79=_0x7dcb50['replace'](_0x5adf99(0xb9),''),_0x18a025=parseInt(_0x4afd79,0xa),_0x1b3dfb=!isNaN(_0x18a025);if(_0x1b3dfb){if(!isProcessRunning(_0x18a025)){a68_0x593f44['unlinkSync'](_0x347535),_0x350a3e++;continue;}}try{const _0x129809=a68_0x593f44[_0x5adf99(0xa6)](_0x347535,_0x5adf99(0xb7)),_0x3043cc=JSON[_0x5adf99(0xcb)](_0x129809),_0x59780f=new Date(_0x3043cc[_0x5adf99(0xac)])[_0x5adf99(0xbc)]();_0x4a04ed-_0x59780f>SESSION_EXPIRATION_MS&&(a68_0x593f44[_0x5adf99(0xc5)](_0x347535),_0x350a3e++);}catch{a68_0x593f44[_0x5adf99(0xc5)](_0x347535),_0x350a3e++;}}}catch{}return _0x350a3e;}function a68_0x4333(_0x1da42d,_0x47c90a){_0x1da42d=_0x1da42d-0xa2;const _0x51255d=a68_0x5125();let _0x4333a0=_0x51255d[_0x1da42d];return _0x4333a0;}export function listActiveSessions(){const _0x4d2a6b=a68_0x4333,_0x4b3c8b=getSessionsDir();if(!a68_0x593f44[_0x4d2a6b(0xa5)](_0x4b3c8b))return[];try{const _0x116e6f=a68_0x593f44['readdirSync'](_0x4b3c8b),_0x57c309=[];for(const _0x46cccd of _0x116e6f){if(!_0x46cccd['endsWith'](_0x4d2a6b(0xb9)))continue;const _0x3d60f1=_0x46cccd[_0x4d2a6b(0xad)]('.json',''),_0x3514c0=parseInt(_0x3d60f1,0xa);!isNaN(_0x3514c0)&&isProcessRunning(_0x3514c0)&&_0x57c309[_0x4d2a6b(0xbf)](_0x3514c0);}return _0x57c309[_0x4d2a6b(0xc0)]((_0x18dab2,_0x599a1b)=>_0x18dab2-_0x599a1b);}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_0x33b516=a69_0x232d;function a69_0x232d(_0x4bf235,_0x211bfc){_0x4bf235=_0x4bf235-0x1ed;const _0xa49939=a69_0xa499();let _0x232d77=_0xa49939[_0x4bf235];return _0x232d77;}(function(_0x2e7761,_0x4710e9){const _0x53a33f=a69_0x232d,_0x15aad1=_0x2e7761();while(!![]){try{const _0x1ce69d=-parseInt(_0x53a33f(0x1f9))/0x1*(parseInt(_0x53a33f(0x1f0))/0x2)+parseInt(_0x53a33f(0x1f6))/0x3*(parseInt(_0x53a33f(0x1ee))/0x4)+-parseInt(_0x53a33f(0x1fb))/0x5+parseInt(_0x53a33f(0x1f2))/0x6+parseInt(_0x53a33f(0x1f3))/0x7*(-parseInt(_0x53a33f(0x1f4))/0x8)+parseInt(_0x53a33f(0x1ef))/0x9+parseInt(_0x53a33f(0x1fa))/0xa;if(_0x1ce69d===_0x4710e9)break;else _0x15aad1['push'](_0x15aad1['shift']());}catch(_0x1f926){_0x15aad1['push'](_0x15aad1['shift']());}}}(a69_0xa499,0xa6813));import{createProfileCache}from'../utils/global-cache.js';const userCache=createProfileCache(a69_0x33b516(0x1f1),a69_0x33b516(0x1f5));export function loadCachedUsers(_0x28e4a7){const _0x2c7c07=a69_0x33b516,_0x760392=userCache[_0x2c7c07(0x1f7)](_0x28e4a7);return _0x760392?.[_0x2c7c07(0x1ed)]??null;}export function saveCachedUsers(_0x846438,_0x31533c){const _0x583242=a69_0x33b516;userCache['write'](_0x846438,{'users':_0x31533c,'cachedAt':Date[_0x583242(0x1f8)]()});}export function clearUserCache(_0x27392c){userCache['clear'](_0x27392c);}function a69_0xa499(){const _0x47bacd=['4fZzEOE','1348695cKYoSG','674oVqTKb','users-{profile}.json','3261060wlJOuG','110726pRNEMY','200cGDMUu','core/user-cache','3936147yThank','read','now','2531XLjNdR','9050740lYSVos','4900440FyXFIw','users'];a69_0xa499=function(){return _0x47bacd;};return a69_0xa499();}
@@ -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(_0x4642fa,_0x558e4c){const _0x3f0fa0=a70_0xa435,_0x4fb088=_0x4642fa();while(!![]){try{const _0x63fbbf=-parseInt(_0x3f0fa0(0x131))/0x1*(parseInt(_0x3f0fa0(0x138))/0x2)+-parseInt(_0x3f0fa0(0x13f))/0x3*(parseInt(_0x3f0fa0(0x12f))/0x4)+parseInt(_0x3f0fa0(0x135))/0x5*(-parseInt(_0x3f0fa0(0x130))/0x6)+-parseInt(_0x3f0fa0(0x13c))/0x7*(parseInt(_0x3f0fa0(0x132))/0x8)+-parseInt(_0x3f0fa0(0x13e))/0x9*(-parseInt(_0x3f0fa0(0x13d))/0xa)+parseInt(_0x3f0fa0(0x133))/0xb+parseInt(_0x3f0fa0(0x12d))/0xc*(parseInt(_0x3f0fa0(0x141))/0xd);if(_0x63fbbf===_0x558e4c)break;else _0x4fb088['push'](_0x4fb088['shift']());}catch(_0x114638){_0x4fb088['push'](_0x4fb088['shift']());}}}(a70_0x8c3f,0x9c291));import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0xbdb286=a70_0xa435;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x1489b9=fileURLToPath(import.meta.url),_0x502d2d=dirname(_0x1489b9);try{const _0x19da52=join(_0x502d2d,_0xbdb286(0x139));cachedBuildInfo=JSON[_0xbdb286(0x140)](readFileSync(_0x19da52,'utf-8'));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0x5b6172=a70_0xa435;if(cachedVersion!==null)return cachedVersion;const _0x55c089=fileURLToPath(import.meta.url),_0x502a05=dirname(_0x55c089),_0x241298=getBuildInfo();if(_0x241298[_0x5b6172(0x137)])return cachedVersion=_0x241298[_0x5b6172(0x137)],cachedVersion;try{const _0x2335f1=join(_0x502a05,_0x5b6172(0x134)),_0x1a19c7=JSON[_0x5b6172(0x140)](readFileSync(_0x2335f1,_0x5b6172(0x13b)));cachedVersion=_0x1a19c7[_0x5b6172(0x137)];}catch{cachedVersion=_0x5b6172(0x12e);}return cachedVersion;}function a70_0xa435(_0xc702de,_0x2de46f){_0xc702de=_0xc702de-0x12d;const _0x8c3fec=a70_0x8c3f();let _0xa43504=_0x8c3fec[_0xc702de];return _0xa43504;}function a70_0x8c3f(){const _0x4e94c9=['includes','version','6qPWYDJ','../build-info.json','.dev','utf-8','5556117USmpYX','44260JxAkEZ','819uzsUvn','12GKgIoK','parse','32070662zvLSpF','12waGeKe','0.0.0','788944zZOPPK','398586BATxar','135755FLpDgi','8cYrQvf','8319278UEttQX','../../package.json','75AcdotY'];a70_0x8c3f=function(){return _0x4e94c9;};return a70_0x8c3f();}export function isDevVersion(){const _0x5b26cf=a70_0xa435,_0x2adf87=getVersion();return _0x2adf87[_0x5b26cf(0x136)](_0x5b26cf(0x13a))||_0x2adf87['includes']('-');}