@treasuredata/tdx 0.25.1 → 0.25.2

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 (163) 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/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/mcp-command.js +1 -1
  24. package/dist/commands/parent-segment-command.js +1 -1
  25. package/dist/commands/profile-command.js +1 -1
  26. package/dist/commands/profiles-command.js +1 -1
  27. package/dist/commands/query-command.js +1 -1
  28. package/dist/commands/schedule-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/status-command.js +1 -1
  40. package/dist/commands/tables.js +1 -1
  41. package/dist/commands/unset-command.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/core/version.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/mcp/server.js +1 -1
  60. package/dist/mcp/tools/index.js +1 -1
  61. package/dist/mcp/tools/tdx-run.js +1 -1
  62. package/dist/mcp/tools/tdx-search.js +1 -1
  63. package/dist/mcp/utils.js +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/passthrough-server.js +1 -1
  66. package/dist/proxy/sse-usage-parser.js +1 -1
  67. package/dist/sdk/agent/agent-config.js +1 -1
  68. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  69. package/dist/sdk/agent/agent-yaml.js +1 -1
  70. package/dist/sdk/agent/test/evaluator.js +1 -1
  71. package/dist/sdk/agent/test/executor.js +1 -1
  72. package/dist/sdk/agent/test/index.js +1 -1
  73. package/dist/sdk/agent/test/output.js +1 -1
  74. package/dist/sdk/agent/test/parser.js +1 -1
  75. package/dist/sdk/api.js +1 -1
  76. package/dist/sdk/client/cdp-api-client.js +1 -1
  77. package/dist/sdk/client/endpoints.js +1 -1
  78. package/dist/sdk/client/engage-api-client.js +1 -1
  79. package/dist/sdk/client/http-client.js +1 -1
  80. package/dist/sdk/client/llm-api-client.js +1 -1
  81. package/dist/sdk/client/rate-limiter.js +1 -1
  82. package/dist/sdk/client/td-api-client.js +1 -1
  83. package/dist/sdk/client/trino-api-client.js +1 -1
  84. package/dist/sdk/client/workflow-client.js +1 -1
  85. package/dist/sdk/connection-validator.js +1 -1
  86. package/dist/sdk/connection.js +1 -1
  87. package/dist/sdk/engage.js +1 -1
  88. package/dist/sdk/errors.js +1 -1
  89. package/dist/sdk/index.js +1 -1
  90. package/dist/sdk/io/index.js +1 -1
  91. package/dist/sdk/io/node-filesystem.js +1 -1
  92. package/dist/sdk/job.js +1 -1
  93. package/dist/sdk/journey.js +1 -1
  94. package/dist/sdk/llm/chat-cache.js +1 -1
  95. package/dist/sdk/llm/index.js +1 -1
  96. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  97. package/dist/sdk/llm/model-factors.js +1 -1
  98. package/dist/sdk/query/index.js +1 -1
  99. package/dist/sdk/query/sql-parser.js +1 -1
  100. package/dist/sdk/schedule.js +1 -1
  101. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  102. package/dist/sdk/segment/fields-display.js +1 -1
  103. package/dist/sdk/segment/file-discovery.js +1 -1
  104. package/dist/sdk/segment/journey-utils.js +1 -1
  105. package/dist/sdk/segment/journey-yaml.js +1 -1
  106. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  107. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  108. package/dist/sdk/segment/pull-workflow.js +1 -1
  109. package/dist/sdk/segment/push-workflow.js +1 -1
  110. package/dist/sdk/segment/resolution-context.js +1 -1
  111. package/dist/sdk/segment/segment-path-parser.js +1 -1
  112. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  113. package/dist/sdk/segment/target-resolution.js +1 -1
  114. package/dist/sdk/segment/tdx-config.js +1 -1
  115. package/dist/sdk/segment/validate-files.js +1 -1
  116. package/dist/sdk/segment/yaml-validator.js +1 -1
  117. package/dist/sdk/segment.js +1 -1
  118. package/dist/sdk/types/index.js +1 -1
  119. package/dist/sdk/types/progress.js +1 -1
  120. package/dist/sdk/user.js +1 -1
  121. package/dist/sdk/util/format-detector.js +1 -1
  122. package/dist/sdk/util/formatters.js +1 -1
  123. package/dist/sdk/util/index.js +1 -1
  124. package/dist/sdk/util/tree-formatter.js +1 -1
  125. package/dist/sdk/workflow/archive-validation.js +1 -1
  126. package/dist/sdk/workflow/clone-workflow.js +1 -1
  127. package/dist/sdk/workflow/index.js +1 -1
  128. package/dist/sdk/workflow/pull-workflow.js +1 -1
  129. package/dist/sdk/workflow/push-workflow.js +1 -1
  130. package/dist/sdk/workflow/tdx-config.js +1 -1
  131. package/dist/sdk/workflow/workflow-utils.js +1 -1
  132. package/dist/test-utils/command-runner.js +1 -1
  133. package/dist/test-utils/factories.js +1 -1
  134. package/dist/test-utils/fixtures.js +1 -1
  135. package/dist/test-utils/http-mock.js +1 -1
  136. package/dist/test-utils/index.js +1 -1
  137. package/dist/utils/async.js +1 -1
  138. package/dist/utils/colors.js +1 -1
  139. package/dist/utils/diff.js +1 -1
  140. package/dist/utils/file-permissions.js +1 -1
  141. package/dist/utils/global-cache.js +1 -1
  142. package/dist/utils/json-loader.js +1 -1
  143. package/dist/utils/local-cache.js +1 -1
  144. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  145. package/dist/utils/logger/formatters/index.js +1 -1
  146. package/dist/utils/logger/handlers/console-handler.js +1 -1
  147. package/dist/utils/logger/handlers/file-handler.js +1 -1
  148. package/dist/utils/logger/handlers/index.js +1 -1
  149. package/dist/utils/logger/handlers/null-handler.js +1 -1
  150. package/dist/utils/logger/index.js +1 -1
  151. package/dist/utils/logger/logger.js +1 -1
  152. package/dist/utils/logger/types.js +1 -1
  153. package/dist/utils/option-validation.js +1 -1
  154. package/dist/utils/port.js +1 -1
  155. package/dist/utils/process.js +1 -1
  156. package/dist/utils/prompt.js +1 -1
  157. package/dist/utils/spinner.js +1 -1
  158. package/dist/utils/sse-parser.js +1 -1
  159. package/dist/utils/string-utils.js +1 -1
  160. package/dist/utils/table-ref-parser.js +1 -1
  161. package/dist/utils/tdx-logger.js +1 -1
  162. package/dist/utils/version-check.js +1 -1
  163. package/package.json +1 -1
@@ -1 +1 @@
1
- const a45_0x4eff13=a45_0x5468;(function(_0x295fa8,_0x4f6446){const _0x17d5a4=a45_0x5468,_0x33b653=_0x295fa8();while(!![]){try{const _0x20c289=parseInt(_0x17d5a4(0x164))/0x1+-parseInt(_0x17d5a4(0x162))/0x2+parseInt(_0x17d5a4(0x14b))/0x3*(parseInt(_0x17d5a4(0x15a))/0x4)+-parseInt(_0x17d5a4(0x158))/0x5+parseInt(_0x17d5a4(0x172))/0x6+parseInt(_0x17d5a4(0x161))/0x7+-parseInt(_0x17d5a4(0x15c))/0x8*(parseInt(_0x17d5a4(0x17f))/0x9);if(_0x20c289===_0x4f6446)break;else _0x33b653['push'](_0x33b653['shift']());}catch(_0x310e6e){_0x33b653['push'](_0x33b653['shift']());}}}(a45_0x4dea,0xad9dd));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a45_0x48c835 from'node:fs';import*as a45_0x287a33 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 a45_0x5b4577 from'chalk';import{getGlobalCacheDir,createOptionalProfileCache}from'../utils/global-cache.js';export function getConfigDir(){const _0x1adfbe=a45_0x5468;return process.env.TDX_CONFIG_DIR||join(homedir(),'.config',_0x1adfbe(0x17e));}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getConfigFilePath(_0x36fd49){const _0x556ee1=a45_0x5468,_0x22f130=getConfigDir();return _0x36fd49?a45_0x287a33[_0x556ee1(0x159)](_0x22f130,_0x556ee1(0x15e)+_0x36fd49):getConfigFile();}export function getCacheDir(){return getGlobalCacheDir();}const llmProjectCache=createOptionalProfileCache(a45_0x4eff13(0x16f),a45_0x4eff13(0x149));export function getLLMProjectCacheFile(_0x138b07){const _0x27f31c=a45_0x4eff13;return llmProjectCache[_0x27f31c(0x14f)](_0x138b07);}export function readCachedLLMProject(_0x334570){const _0x39e86e=a45_0x4eff13,_0x1c01d0=llmProjectCache[_0x39e86e(0x155)](_0x334570);if(_0x1c01d0&&typeof _0x1c01d0['id']===_0x39e86e(0x174)&&typeof _0x1c01d0['name']===_0x39e86e(0x174))return _0x1c01d0;return null;}function a45_0x5468(_0x2ea9f1,_0x24c051){_0x2ea9f1=_0x2ea9f1-0x145;const _0x4dea97=a45_0x4dea();let _0x5468be=_0x4dea97[_0x2ea9f1];return _0x5468be;}export function writeCachedLLMProject(_0x2ad31a,_0x304a65,_0x2468e8){const _0x3a9d50=a45_0x4eff13;try{llmProjectCache[_0x3a9d50(0x171)]({'name':_0x2ad31a,'id':_0x304a65},_0x2468e8);}catch{}}const llmAgentCache=createOptionalProfileCache(a45_0x4eff13(0x169),a45_0x4eff13(0x166));export function getLLMAgentCacheFile(_0x45e0e1){const _0x10c528=a45_0x4eff13;return llmAgentCache[_0x10c528(0x14f)](_0x45e0e1);}export function readCachedLLMAgent(_0x2d7aa9){const _0x331983=a45_0x4eff13,_0x32bde2=llmAgentCache[_0x331983(0x155)](_0x2d7aa9);if(_0x32bde2&&typeof _0x32bde2['id']==='string'&&typeof _0x32bde2[_0x331983(0x17c)]==='string'&&typeof _0x32bde2['projectId']===_0x331983(0x174))return _0x32bde2;return null;}export function writeCachedLLMAgent(_0x46cb64,_0x121216,_0x4857ff,_0x2bbe08){const _0x24db42=a45_0x4eff13;try{llmAgentCache[_0x24db42(0x171)]({'name':_0x46cb64,'id':_0x121216,'projectId':_0x4857ff},_0x2bbe08);}catch{}}export function clearCachedLLMAgent(_0x8c030f){const _0x58173a=a45_0x4eff13;try{llmAgentCache[_0x58173a(0x160)](_0x8c030f);}catch{}}const accountInfoCache=createOptionalProfileCache(a45_0x4eff13(0x185),a45_0x4eff13(0x14e),{'suffix':a45_0x4eff13(0x16b)});export function getAccountInfoCacheFile(_0x44a699){const _0x583586=a45_0x4eff13;return accountInfoCache[_0x583586(0x14f)](_0x44a699);}export function readCachedAccountInfo(_0x1b8df4){const _0x1abc3c=a45_0x4eff13,_0x274891=accountInfoCache[_0x1abc3c(0x155)](_0x1b8df4);if(_0x274891&&typeof _0x274891[_0x1abc3c(0x16a)]===_0x1abc3c(0x174)&&typeof _0x274891[_0x1abc3c(0x181)]===_0x1abc3c(0x156))return _0x274891;return null;}export function writeCachedAccountInfo(_0x52f1d6,_0x26269b,_0x596cf6){const _0x11450c=a45_0x4eff13;try{accountInfoCache[_0x11450c(0x171)]({'site':_0x52f1d6,'accountId':_0x26269b,'cachedAt':new Date()[_0x11450c(0x167)]()},_0x596cf6);}catch{}}export function parseEnvFile(_0x2d9fb6){const _0x272b57=a45_0x4eff13,_0x48423d={};for(const _0x5692dc of _0x2d9fb6[_0x272b57(0x15f)]('\x0a')){const _0x21f6f1=_0x5692dc[_0x272b57(0x17a)]();if(!_0x21f6f1||_0x21f6f1['startsWith']('#'))continue;const _0x1030e9=_0x21f6f1[_0x272b57(0x148)](/^([^=]+)=(.*)$/);if(_0x1030e9){const _0x3d5151=_0x1030e9[0x1][_0x272b57(0x17a)]();let _0x5b739a=_0x1030e9[0x2][_0x272b57(0x17a)]();(_0x5b739a['startsWith']('\x22')&&_0x5b739a['endsWith']('\x22')||_0x5b739a[_0x272b57(0x170)]('\x27')&&_0x5b739a[_0x272b57(0x153)]('\x27'))&&(_0x5b739a=_0x5b739a[_0x272b57(0x173)](0x1,-0x1)),_0x48423d[_0x3d5151]=_0x5b739a;}}return _0x48423d;}export function readUserConfig(){const _0x29f484=a45_0x4eff13,_0xd7158d=getConfigFile();if(!existsSync(_0xd7158d))return{};try{const _0x1b7392=readFileSync(_0xd7158d,'utf-8');return parseEnvFile(_0x1b7392);}catch(_0x3d967e){return console[_0x29f484(0x187)](_0x29f484(0x177)+_0xd7158d+':',_0x3d967e),{};}}export function resolveSite(_0x281226){const _0x43577b=a45_0x4eff13,_0x23f27b=[_0x43577b(0x151),_0x43577b(0x165),_0x43577b(0x14d),_0x43577b(0x184),_0x43577b(0x154),'dev-us01',_0x43577b(0x17d),'stg-us01','stg-jp01',_0x43577b(0x146)];if(_0x23f27b[_0x43577b(0x175)](_0x281226))return _0x281226;if(_0x281226 in SITE_ALIASES)return SITE_ALIASES[_0x281226];return console['warn'](_0x43577b(0x180)+_0x281226+_0x43577b(0x14c)),_0x43577b(0x151);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}function a45_0x4dea(){const _0xbe9077=['toISOString','\x20env\x20var','llm_default_agent','site','.json','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','utf-8','proxy','llm_default_project','startsWith','write','1173270jlVbyo','slice','string','includes','yellow','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','stg-jp01','tdx.json','trim','toUpperCase','name','dev-eu01','tdx','801eqfFIF','Warning:\x20Unknown\x20site\x20\x27','accountId','filter','parse','ap02','account_info','dev-us01','warn','TD_API_KEY','stg-ap03','profile','match','config/llm-project','readFileSync','464907OghSwg','\x27,\x20defaulting\x20to\x20us01','eu01','config/account-info','path','TDX_API_KEY\x20env\x20var','us01','TD_API_KEY_','endsWith','ap03','read','number','keychain','5589985yuqlwi','join','36FBMxyF','keychain\x20(profile:\x20','3208pbFlfg','TDX_API_KEY_','.env.','split','clear','6636091HgFEDA','1351048WZgPOa','replace','2064EwLtEz','jp01','config/llm-agent'];a45_0x4dea=function(){return _0xbe9077;};return a45_0x4dea();}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x496e76){const _0x1ed488=a45_0x4eff13,_0x4e090d=_0x496e76||getActiveProfileName();if(_0x4e090d){const _0x200149=_0x1ed488(0x15d)+normalizeProfileForEnvVar(_0x4e090d);if(process.env[_0x200149])return process.env[_0x200149];}if(process.env.TDX_API_KEY)return process.env.TDX_API_KEY;return undefined;}export function normalizeProfileForEnvVar(_0x38a6a6){const _0x4e4cfb=a45_0x4eff13;return _0x38a6a6[_0x4e4cfb(0x17b)]()[_0x4e4cfb(0x163)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x38a316,_0x295b40){const _0x1f39b4=a45_0x4eff13,_0x4790a7=_0x295b40||getActiveProfileName()||undefined;if(_0x4790a7){const _0x43adec=_0x1f39b4(0x15d)+normalizeProfileForEnvVar(_0x4790a7);if(process.env[_0x43adec])return{'apiKey':process.env[_0x43adec],'source':_0x43adec+_0x1f39b4(0x168),'isDeprecated':![]};const _0x1c5648=getCachedCredential(_0x38a316,_0x4790a7);if(_0x1c5648)return{'apiKey':_0x1c5648,'source':_0x1f39b4(0x15b)+_0x4790a7+')','isDeprecated':![]};const _0x1f85bc=await getKeychainAPIKey(_0x4790a7);if(_0x1f85bc)return setCachedCredential(_0x1f85bc,_0x38a316,_0x4790a7),{'apiKey':_0x1f85bc,'source':_0x1f39b4(0x15b)+_0x4790a7+')','isDeprecated':![]};}if(process.env.TDX_API_KEY)return{'apiKey':process.env.TDX_API_KEY,'source':_0x1f39b4(0x150),'isDeprecated':![]};if(!_0x4790a7){const _0x9217d=getCachedCredential(_0x38a316,undefined);if(_0x9217d)return{'apiKey':_0x9217d,'source':_0x1f39b4(0x157),'isDeprecated':![]};const _0x221e00=await getKeychainAPIKey(undefined);if(_0x221e00)return setCachedCredential(_0x221e00,_0x38a316,undefined),{'apiKey':_0x221e00,'source':_0x1f39b4(0x157),'isDeprecated':![]};}return null;}export async function getAPIKeyAsync(_0x3511a3,_0x8943ae){const _0x38e510=await resolveAPIKeyAsync(_0x3511a3,_0x8943ae);return _0x38e510?.['apiKey'];}function cleanupLegacyEnvFile(_0x2558d1){const _0x7b50ee=a45_0x4eff13;if(!existsSync(_0x2558d1))return![];try{const _0x5dc446=readFileSync(_0x2558d1,_0x7b50ee(0x16d)),_0x1611a0=_0x5dc446['split']('\x0a'),_0x548a6a=_0x1611a0[_0x7b50ee(0x182)](_0x591329=>{const _0x2938c9=_0x7b50ee,_0x5b8cc3=_0x591329['trim']();if(!_0x5b8cc3||_0x5b8cc3[_0x2938c9(0x170)]('#'))return!![];const [_0x3bc544]=_0x5b8cc3['split']('=');return!_0x3bc544[_0x2938c9(0x170)](_0x2938c9(0x145));}),_0x1ee048=_0x548a6a['some'](_0x369afc=>{const _0x79b92a=_0x7b50ee,_0x2027ba=_0x369afc[_0x79b92a(0x17a)]();return _0x2027ba&&!_0x2027ba[_0x79b92a(0x170)]('#');});if(!_0x1ee048)return unlinkSync(_0x2558d1),!![];return writeFileSync(_0x2558d1,_0x548a6a['join']('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function getActiveProfileName(){const _0x247140=a45_0x4eff13;if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x161cdd=a45_0x287a33[_0x247140(0x159)](getConfigDir(),_0x247140(0x179));if(!a45_0x48c835['existsSync'](_0x161cdd))return null;try{const _0x3a01db=a45_0x48c835[_0x247140(0x14a)](_0x161cdd,_0x247140(0x16d)),_0x454768=JSON[_0x247140(0x183)](_0x3a01db);return _0x454768[_0x247140(0x147)]||null;}catch{return null;}}export function saveAPIKey(_0x4196ab,_0x5816c4,_0x4cdcf4){const _0x2c7b24=a45_0x4eff13,_0x2859a1=getConfigDir(),_0x4c9765=getConfigFilePath(_0x4cdcf4);!existsSync(_0x2859a1)&&mkdirSync(_0x2859a1,{'recursive':!![],'mode':0x1c0});let _0x3c9f87={};if(existsSync(_0x4c9765))try{const _0x10e188=readFileSync(_0x4c9765,_0x2c7b24(0x16d));_0x3c9f87=parseEnvFile(_0x10e188);}catch(_0x3ece25){console[_0x2c7b24(0x187)]('Warning:\x20Failed\x20to\x20read\x20'+_0x4c9765+':',_0x3ece25);}const _0xf2b2a5=_0x4196ab['toUpperCase']()[_0x2c7b24(0x163)](/-/g,'_');_0x3c9f87[_0x2c7b24(0x152)+_0xf2b2a5]=_0x5816c4;const _0x59194c=Object['entries'](_0x3c9f87)['map'](([_0x220d29,_0x135fdd])=>_0x220d29+'='+_0x135fdd);writeFileSync(_0x4c9765,_0x59194c[_0x2c7b24(0x159)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x3dc01c,_0x4ad41a,_0x1a8a8c){const _0x54125d=a45_0x4eff13;await saveKeychainAPIKey(_0x3dc01c,_0x1a8a8c),setCachedCredential(_0x3dc01c,_0x4ad41a,_0x1a8a8c);const _0x1bb178=getConfigFilePath(_0x1a8a8c);cleanupLegacyEnvFile(_0x1bb178)&&console[_0x54125d(0x187)](a45_0x5b4577[_0x54125d(0x176)](_0x54125d(0x16c)));}export function loadConfig(){const _0x1ad468=a45_0x4eff13,_0x533a3c={'apiKeys':{},'defaultSite':_0x1ad468(0x151)},_0x179405=[_0x1ad468(0x151),_0x1ad468(0x165),_0x1ad468(0x14d),_0x1ad468(0x184),_0x1ad468(0x154),_0x1ad468(0x186),_0x1ad468(0x17d),'stg-us01',_0x1ad468(0x178),_0x1ad468(0x146)],_0x1693ef=getAPIKey();if(_0x1693ef)for(const _0x34bf14 of _0x179405){_0x533a3c['apiKeys'][_0x34bf14]=_0x1693ef;}return _0x533a3c;}export function isExperimentalAvailable(){return!!process.env.TDX_EXPERIMENTAL;}export function loadGlobalProxy(){const _0x3151b3=a45_0x4eff13,_0x491267=a45_0x287a33[_0x3151b3(0x159)](getConfigDir(),_0x3151b3(0x179));if(!a45_0x48c835['existsSync'](_0x491267))return undefined;try{const _0x5a2076=a45_0x48c835[_0x3151b3(0x14a)](_0x491267,_0x3151b3(0x16d)),_0x1bb58f=JSON[_0x3151b3(0x183)](_0x5a2076);return typeof _0x1bb58f['proxy']===_0x3151b3(0x174)?_0x1bb58f[_0x3151b3(0x16e)]:undefined;}catch{return undefined;}}
1
+ const a45_0x28316e=a45_0x549f;(function(_0x2ecc33,_0x544d4b){const _0x1f6b00=a45_0x549f,_0x3bd318=_0x2ecc33();while(!![]){try{const _0x34e897=-parseInt(_0x1f6b00(0x14a))/0x1*(parseInt(_0x1f6b00(0x151))/0x2)+parseInt(_0x1f6b00(0x15c))/0x3*(-parseInt(_0x1f6b00(0x161))/0x4)+parseInt(_0x1f6b00(0x130))/0x5+parseInt(_0x1f6b00(0x132))/0x6+parseInt(_0x1f6b00(0x120))/0x7+parseInt(_0x1f6b00(0x156))/0x8+-parseInt(_0x1f6b00(0x129))/0x9;if(_0x34e897===_0x544d4b)break;else _0x3bd318['push'](_0x3bd318['shift']());}catch(_0x50fcc5){_0x3bd318['push'](_0x3bd318['shift']());}}}(a45_0x37b1,0xe3079));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a45_0x152dcf from'node:fs';import*as a45_0x46a739 from'node:path';import{SITE_ALIASES}from'../sdk/types/index.js';import{getKeychainAPIKey,saveKeychainAPIKey}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';function a45_0x549f(_0x2ad198,_0x6e5ea1){_0x2ad198=_0x2ad198-0x11c;const _0x37b14a=a45_0x37b1();let _0x549fad=_0x37b14a[_0x2ad198];return _0x549fad;}import a45_0x504e6a from'chalk';import{getGlobalCacheDir,createOptionalProfileCache}from'../utils/global-cache.js';export function getConfigDir(){const _0x4df734=a45_0x549f;return process.env.TDX_CONFIG_DIR||join(homedir(),_0x4df734(0x139),_0x4df734(0x126));}export function getConfigFile(){const _0xc35207=a45_0x549f;return join(getConfigDir(),_0xc35207(0x12e));}export function getConfigFilePath(_0x274056){const _0x46064f=a45_0x549f,_0x5a88be=getConfigDir();return _0x274056?a45_0x46a739[_0x46064f(0x153)](_0x5a88be,_0x46064f(0x146)+_0x274056):getConfigFile();}export function getCacheDir(){return getGlobalCacheDir();}const llmProjectCache=createOptionalProfileCache('llm_default_project','config/llm-project');export function getLLMProjectCacheFile(_0x2fc591){const _0x79ed2c=a45_0x549f;return llmProjectCache[_0x79ed2c(0x157)](_0x2fc591);}export function readCachedLLMProject(_0x31f26e){const _0x3e28d6=a45_0x549f,_0x559305=llmProjectCache[_0x3e28d6(0x158)](_0x31f26e);if(_0x559305&&typeof _0x559305['id']===_0x3e28d6(0x11e)&&typeof _0x559305[_0x3e28d6(0x148)]===_0x3e28d6(0x11e))return _0x559305;return null;}export function writeCachedLLMProject(_0x573e7c,_0x1978ba,_0x5bbd4b){const _0x458c53=a45_0x549f;try{llmProjectCache[_0x458c53(0x128)]({'name':_0x573e7c,'id':_0x1978ba},_0x5bbd4b);}catch{}}const llmAgentCache=createOptionalProfileCache(a45_0x28316e(0x15b),a45_0x28316e(0x160));export function getLLMAgentCacheFile(_0x124b24){return llmAgentCache['path'](_0x124b24);}export function readCachedLLMAgent(_0xf82d92){const _0x585fe9=a45_0x28316e,_0x4d5870=llmAgentCache[_0x585fe9(0x158)](_0xf82d92);if(_0x4d5870&&typeof _0x4d5870['id']==='string'&&typeof _0x4d5870[_0x585fe9(0x148)]===_0x585fe9(0x11e)&&typeof _0x4d5870[_0x585fe9(0x127)]===_0x585fe9(0x11e))return _0x4d5870;return null;}export function writeCachedLLMAgent(_0x42c483,_0x1a83ec,_0x252a98,_0x39be34){const _0x143966=a45_0x28316e;try{llmAgentCache[_0x143966(0x128)]({'name':_0x42c483,'id':_0x1a83ec,'projectId':_0x252a98},_0x39be34);}catch{}}export function clearCachedLLMAgent(_0x163277){const _0x3ba262=a45_0x28316e;try{llmAgentCache[_0x3ba262(0x152)](_0x163277);}catch{}}const accountInfoCache=createOptionalProfileCache(a45_0x28316e(0x14c),a45_0x28316e(0x14f),{'suffix':a45_0x28316e(0x12d)});export function getAccountInfoCacheFile(_0x5cdb58){const _0x3f94ef=a45_0x28316e;return accountInfoCache[_0x3f94ef(0x157)](_0x5cdb58);}export function readCachedAccountInfo(_0x127571){const _0x50bd2c=a45_0x28316e,_0x473335=accountInfoCache[_0x50bd2c(0x158)](_0x127571);if(_0x473335&&typeof _0x473335['site']===_0x50bd2c(0x11e)&&typeof _0x473335[_0x50bd2c(0x136)]===_0x50bd2c(0x155))return _0x473335;return null;}export function writeCachedAccountInfo(_0x32b0c3,_0x210e70,_0x4552d2){const _0x3d449e=a45_0x28316e;try{accountInfoCache[_0x3d449e(0x128)]({'site':_0x32b0c3,'accountId':_0x210e70,'cachedAt':new Date()[_0x3d449e(0x138)]()},_0x4552d2);}catch{}}export function parseEnvFile(_0x553632){const _0x1e8d28=a45_0x28316e,_0x3e5184={};for(const _0x395fa4 of _0x553632['split']('\x0a')){const _0xd35096=_0x395fa4[_0x1e8d28(0x140)]();if(!_0xd35096||_0xd35096['startsWith']('#'))continue;const _0x2e6b1c=_0xd35096['match'](/^([^=]+)=(.*)$/);if(_0x2e6b1c){const _0x539c14=_0x2e6b1c[0x1]['trim']();let _0x46f113=_0x2e6b1c[0x2][_0x1e8d28(0x140)]();(_0x46f113[_0x1e8d28(0x122)]('\x22')&&_0x46f113[_0x1e8d28(0x145)]('\x22')||_0x46f113[_0x1e8d28(0x122)]('\x27')&&_0x46f113['endsWith']('\x27'))&&(_0x46f113=_0x46f113[_0x1e8d28(0x125)](0x1,-0x1)),_0x3e5184[_0x539c14]=_0x46f113;}}return _0x3e5184;}export function readUserConfig(){const _0x3fc0c5=a45_0x28316e,_0x474bd6=getConfigFile();if(!existsSync(_0x474bd6))return{};try{const _0x4270ad=readFileSync(_0x474bd6,_0x3fc0c5(0x12c));return parseEnvFile(_0x4270ad);}catch(_0x2eae4b){return console['warn'](_0x3fc0c5(0x123)+_0x474bd6+':',_0x2eae4b),{};}}export function resolveSite(_0x4f2093){const _0x15cf3e=a45_0x28316e,_0x38ff65=[_0x15cf3e(0x159),_0x15cf3e(0x11c),_0x15cf3e(0x11d),_0x15cf3e(0x149),'ap03','dev-us01',_0x15cf3e(0x13f),_0x15cf3e(0x11f),_0x15cf3e(0x133),'stg-ap03'];if(_0x38ff65[_0x15cf3e(0x13d)](_0x4f2093))return _0x4f2093;if(_0x4f2093 in SITE_ALIASES)return SITE_ALIASES[_0x4f2093];return console[_0x15cf3e(0x141)](_0x15cf3e(0x13e)+_0x4f2093+_0x15cf3e(0x150)),_0x15cf3e(0x159);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x229352){const _0x2bc10c=a45_0x28316e,_0x3902de=_0x229352||getActiveProfileName();if(_0x3902de){const _0x424d1a=_0x2bc10c(0x147)+normalizeProfileForEnvVar(_0x3902de);if(process.env[_0x424d1a])return process.env[_0x424d1a];}if(process.env.TDX_API_KEY)return process.env.TDX_API_KEY;return undefined;}export function normalizeProfileForEnvVar(_0x557b4a){const _0x3199fe=a45_0x28316e;return _0x557b4a[_0x3199fe(0x142)]()[_0x3199fe(0x15a)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x3b27a6,_0x12bdbd){const _0x34580e=a45_0x28316e,_0x4af18c=_0x12bdbd||getActiveProfileName()||undefined;if(_0x4af18c){const _0x499e45='TDX_API_KEY_'+normalizeProfileForEnvVar(_0x4af18c);if(process.env[_0x499e45])return{'apiKey':process.env[_0x499e45],'source':_0x499e45+_0x34580e(0x143),'isDeprecated':![]};const _0x46f2ea=getCachedCredential(_0x3b27a6,_0x4af18c);if(_0x46f2ea)return{'apiKey':_0x46f2ea,'source':_0x34580e(0x12f)+_0x4af18c+')','isDeprecated':![]};const _0x4fad4b=await getKeychainAPIKey(_0x4af18c);if(_0x4fad4b)return setCachedCredential(_0x4fad4b,_0x3b27a6,_0x4af18c),{'apiKey':_0x4fad4b,'source':_0x34580e(0x12f)+_0x4af18c+')','isDeprecated':![]};}if(process.env.TDX_API_KEY)return{'apiKey':process.env.TDX_API_KEY,'source':'TDX_API_KEY\x20env\x20var','isDeprecated':![]};if(!_0x4af18c){const _0x4a4935=getCachedCredential(_0x3b27a6,undefined);if(_0x4a4935)return{'apiKey':_0x4a4935,'source':'keychain','isDeprecated':![]};const _0x27519b=await getKeychainAPIKey(undefined);if(_0x27519b)return setCachedCredential(_0x27519b,_0x3b27a6,undefined),{'apiKey':_0x27519b,'source':_0x34580e(0x14d),'isDeprecated':![]};}return null;}export async function getAPIKeyAsync(_0x26ab77,_0x2e741b){const _0x258ebc=a45_0x28316e,_0x597dff=await resolveAPIKeyAsync(_0x26ab77,_0x2e741b);return _0x597dff?.[_0x258ebc(0x124)];}function cleanupLegacyEnvFile(_0x120d5f){const _0x547033=a45_0x28316e;if(!existsSync(_0x120d5f))return![];try{const _0x46d388=readFileSync(_0x120d5f,_0x547033(0x12c)),_0x19bd55=_0x46d388[_0x547033(0x137)]('\x0a'),_0x183424=_0x19bd55[_0x547033(0x13b)](_0x275410=>{const _0x48663d=_0x547033,_0x376616=_0x275410['trim']();if(!_0x376616||_0x376616[_0x48663d(0x122)]('#'))return!![];const [_0x137698]=_0x376616[_0x48663d(0x137)]('=');return!_0x137698['startsWith'](_0x48663d(0x162));}),_0x18889f=_0x183424[_0x547033(0x13a)](_0x5b3b36=>{const _0x55f419=_0x547033,_0x290afd=_0x5b3b36[_0x55f419(0x140)]();return _0x290afd&&!_0x290afd['startsWith']('#');});if(!_0x18889f)return unlinkSync(_0x120d5f),!![];return writeFileSync(_0x120d5f,_0x183424['join']('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function getActiveProfileName(){const _0x3d4f4f=a45_0x28316e;if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x4a0a2b=a45_0x46a739[_0x3d4f4f(0x153)](getConfigDir(),_0x3d4f4f(0x12a));if(!a45_0x152dcf[_0x3d4f4f(0x15f)](_0x4a0a2b))return null;try{const _0xcf499=a45_0x152dcf[_0x3d4f4f(0x144)](_0x4a0a2b,_0x3d4f4f(0x12c)),_0x566667=JSON[_0x3d4f4f(0x135)](_0xcf499);return _0x566667[_0x3d4f4f(0x12b)]||null;}catch{return null;}}export function saveAPIKey(_0x10ee64,_0xe3bab7,_0x5184df){const _0x18bf94=a45_0x28316e,_0x179183=getConfigDir(),_0x28a8f8=getConfigFilePath(_0x5184df);!existsSync(_0x179183)&&mkdirSync(_0x179183,{'recursive':!![],'mode':0x1c0});let _0x3a7943={};if(existsSync(_0x28a8f8))try{const _0x138189=readFileSync(_0x28a8f8,_0x18bf94(0x12c));_0x3a7943=parseEnvFile(_0x138189);}catch(_0x43c4d0){console[_0x18bf94(0x141)](_0x18bf94(0x15d)+_0x28a8f8+':',_0x43c4d0);}const _0x416b68=_0x10ee64[_0x18bf94(0x142)]()['replace'](/-/g,'_');_0x3a7943[_0x18bf94(0x163)+_0x416b68]=_0xe3bab7;const _0x4fd863=Object[_0x18bf94(0x154)](_0x3a7943)[_0x18bf94(0x14e)](([_0x3de78d,_0x37332a])=>_0x3de78d+'='+_0x37332a);writeFileSync(_0x28a8f8,_0x4fd863['join']('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0xa7f3a5,_0x2f20ec,_0x4d925c){const _0x2ce6a5=a45_0x28316e;await saveKeychainAPIKey(_0xa7f3a5,_0x4d925c),setCachedCredential(_0xa7f3a5,_0x2f20ec,_0x4d925c);const _0x1d64f3=getConfigFilePath(_0x4d925c);cleanupLegacyEnvFile(_0x1d64f3)&&console[_0x2ce6a5(0x141)](a45_0x504e6a['yellow'](_0x2ce6a5(0x13c)));}export function loadConfig(){const _0x30abdb=a45_0x28316e,_0x269721={'apiKeys':{},'defaultSite':'us01'},_0x248f28=['us01',_0x30abdb(0x11c),_0x30abdb(0x11d),_0x30abdb(0x149),_0x30abdb(0x14b),_0x30abdb(0x134),_0x30abdb(0x13f),_0x30abdb(0x11f),'stg-jp01',_0x30abdb(0x121)],_0x15a849=getAPIKey();if(_0x15a849)for(const _0xdbd87f of _0x248f28){_0x269721[_0x30abdb(0x131)][_0xdbd87f]=_0x15a849;}return _0x269721;}export function isExperimentalAvailable(){return!!process.env.TDX_EXPERIMENTAL;}function a45_0x37b1(){const _0x4b02d4=['map','config/account-info','\x27,\x20defaulting\x20to\x20us01','592358fxSADt','clear','join','entries','number','4654096TjYWaV','path','read','us01','replace','llm_default_agent','532242zLQXEA','Warning:\x20Failed\x20to\x20read\x20','proxy','existsSync','config/llm-agent','12YxFrka','TD_API_KEY','TD_API_KEY_','jp01','eu01','string','stg-us01','10556140odzWOM','stg-ap03','startsWith','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','apiKey','slice','tdx','projectId','write','13845402TpqTJR','tdx.json','profile','utf-8','.json','.env','keychain\x20(profile:\x20','4357030gQkSga','apiKeys','2013144rbFumx','stg-jp01','dev-us01','parse','accountId','split','toISOString','.config','some','filter','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','includes','Warning:\x20Unknown\x20site\x20\x27','dev-eu01','trim','warn','toUpperCase','\x20env\x20var','readFileSync','endsWith','.env.','TDX_API_KEY_','name','ap02','1ZQornW','ap03','account_info','keychain'];a45_0x37b1=function(){return _0x4b02d4;};return a45_0x37b1();}export function loadGlobalProxy(){const _0x217368=a45_0x28316e,_0x4ab0b5=a45_0x46a739[_0x217368(0x153)](getConfigDir(),_0x217368(0x12a));if(!a45_0x152dcf['existsSync'](_0x4ab0b5))return undefined;try{const _0x262699=a45_0x152dcf[_0x217368(0x144)](_0x4ab0b5,'utf-8'),_0xb14c6c=JSON[_0x217368(0x135)](_0x262699);return typeof _0xb14c6c['proxy']===_0x217368(0x11e)?_0xb14c6c[_0x217368(0x15e)]:undefined;}catch{return undefined;}}
@@ -1 +1 @@
1
- const a46_0x426fa0=a46_0x28ab;(function(_0x3bdc3f,_0x41fd23){const _0x1e52b4=a46_0x28ab,_0x2315ee=_0x3bdc3f();while(!![]){try{const _0x167c24=-parseInt(_0x1e52b4(0x179))/0x1+-parseInt(_0x1e52b4(0x171))/0x2*(parseInt(_0x1e52b4(0x175))/0x3)+parseInt(_0x1e52b4(0x170))/0x4+-parseInt(_0x1e52b4(0x174))/0x5*(parseInt(_0x1e52b4(0x17a))/0x6)+-parseInt(_0x1e52b4(0x172))/0x7+parseInt(_0x1e52b4(0x17c))/0x8+parseInt(_0x1e52b4(0x16f))/0x9;if(_0x167c24===_0x41fd23)break;else _0x2315ee['push'](_0x2315ee['shift']());}catch(_0x2041f4){_0x2315ee['push'](_0x2315ee['shift']());}}}(a46_0x3079,0x4d0f9));function a46_0x3079(){const _0x103158=['10495125XxCawU','1020596UdjINq','74eHNOkS','3134845UyKKzj','core/connection-cache','10AArGky','10029FeWbyi','connections-{profile}.json','clear','connections','477446lfdCIu','1651206SzKqgz','write','3949928mDWhVD'];a46_0x3079=function(){return _0x103158;};return a46_0x3079();}import{createProfileCache}from'../utils/global-cache.js';const connectionCache=createProfileCache(a46_0x426fa0(0x176),a46_0x426fa0(0x173));function a46_0x28ab(_0x35be1a,_0x2630bb){_0x35be1a=_0x35be1a-0x16f;const _0x3079e9=a46_0x3079();let _0x28abdf=_0x3079e9[_0x35be1a];return _0x28abdf;}export function loadCachedConnections(_0xd1cd7c){const _0x5c17c9=a46_0x426fa0,_0x45d9fa=connectionCache['read'](_0xd1cd7c);return _0x45d9fa?.[_0x5c17c9(0x178)]??null;}export function saveCachedConnections(_0x3030f8,_0x14f2db){const _0x6107d=a46_0x426fa0;connectionCache[_0x6107d(0x17b)](_0x3030f8,{'connections':_0x14f2db,'cachedAt':Date['now']()});}export function clearConnectionCache(_0x5a2a5c){const _0x5967a8=a46_0x426fa0;connectionCache[_0x5967a8(0x177)](_0x5a2a5c);}
1
+ const a46_0x1c1090=a46_0x4cda;(function(_0x57b96a,_0x3d3312){const _0x4c8072=a46_0x4cda,_0x4f1fc9=_0x57b96a();while(!![]){try{const _0x414cd2=-parseInt(_0x4c8072(0x1db))/0x1+-parseInt(_0x4c8072(0x1d4))/0x2+-parseInt(_0x4c8072(0x1d6))/0x3*(parseInt(_0x4c8072(0x1dc))/0x4)+-parseInt(_0x4c8072(0x1de))/0x5+-parseInt(_0x4c8072(0x1d7))/0x6+parseInt(_0x4c8072(0x1d3))/0x7*(-parseInt(_0x4c8072(0x1dd))/0x8)+-parseInt(_0x4c8072(0x1d5))/0x9*(-parseInt(_0x4c8072(0x1d9))/0xa);if(_0x414cd2===_0x3d3312)break;else _0x4f1fc9['push'](_0x4f1fc9['shift']());}catch(_0x18e18d){_0x4f1fc9['push'](_0x4f1fc9['shift']());}}}(a46_0x5f31,0xa79be));import{createProfileCache}from'../utils/global-cache.js';const connectionCache=createProfileCache(a46_0x1c1090(0x1d8),'core/connection-cache');function a46_0x4cda(_0x492b71,_0x4df3ae){_0x492b71=_0x492b71-0x1d3;const _0x5f3181=a46_0x5f31();let _0x4cda81=_0x5f3181[_0x492b71];return _0x4cda81;}export function loadCachedConnections(_0x2f5c9f){const _0x29bd06=a46_0x1c1090,_0x5f3651=connectionCache['read'](_0x2f5c9f);return _0x5f3651?.[_0x29bd06(0x1da)]??null;}function a46_0x5f31(){const _0x264f6d=['4VUOgxR','213320rMYSxf','6677845oNbkuC','write','273QZxwVJ','254640zzMQCQ','17571726eJpGTJ','2907123bzVfQV','5119284kxGWnU','connections-{profile}.json','30xobNdG','connections','845637CUZKbr'];a46_0x5f31=function(){return _0x264f6d;};return a46_0x5f31();}export function saveCachedConnections(_0x1f9344,_0xb3f093){const _0x3a2a12=a46_0x1c1090;connectionCache[_0x3a2a12(0x1df)](_0x1f9344,{'connections':_0xb3f093,'cachedAt':Date['now']()});}export function clearConnectionCache(_0x56b473){connectionCache['clear'](_0x56b473);}
@@ -1 +1 @@
1
- const a47_0x23daef=a47_0x8077;(function(_0x4cd09c,_0xd76825){const _0x1331d8=a47_0x8077,_0x5452fd=_0x4cd09c();while(!![]){try{const _0x3c46ef=-parseInt(_0x1331d8(0x171))/0x1+-parseInt(_0x1331d8(0x165))/0x2+-parseInt(_0x1331d8(0x167))/0x3+parseInt(_0x1331d8(0x16a))/0x4+-parseInt(_0x1331d8(0x166))/0x5*(-parseInt(_0x1331d8(0x16f))/0x6)+-parseInt(_0x1331d8(0x176))/0x7*(-parseInt(_0x1331d8(0x172))/0x8)+-parseInt(_0x1331d8(0x16c))/0x9*(-parseInt(_0x1331d8(0x175))/0xa);if(_0x3c46ef===_0xd76825)break;else _0x5452fd['push'](_0x5452fd['shift']());}catch(_0xf873f1){_0x5452fd['push'](_0x5452fd['shift']());}}}(a47_0x1035,0xb5bf5));export const DEFAULT_DISPLAY_LIMIT=0x28;function a47_0x8077(_0x36ad3a,_0x1ab6f3){_0x36ad3a=_0x36ad3a-0x164;const _0x1035d0=a47_0x1035();let _0x807715=_0x1035d0[_0x36ad3a];return _0x807715;}export const DEFAULT_LISTING_LIMIT=0x2710;function a47_0x1035(){const _0x21f1d3=['findIndex','8320DLWNsA','372442MoqICV','us01','jp\x20\x20\x20-\x20Japan','1392174BjFfYh','625QcPsMR','3196983QxgjFT','number','other','2825824LdooWT','length','8838DBruiD','value','jp01','39906kcMdtx','push','646760EzdTNd','120VraHgd','ap02\x20-\x20Korea'];a47_0x1035=function(){return _0x21f1d3;};return a47_0x1035();}export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x433022,_0x48cc3e){const _0x2b293c=a47_0x8077;if(_0x433022===undefined)return _0x48cc3e;if(typeof _0x433022===_0x2b293c(0x168))return _0x433022;return parseInt(_0x433022,0xa);}export const STANDARD_SITE_CHOICES=[{'title':'us\x20\x20\x20-\x20United\x20States','value':'us01'},{'title':a47_0x23daef(0x164),'value':a47_0x23daef(0x16e)},{'title':'eu\x20\x20\x20-\x20Europe','value':'eu01'},{'title':a47_0x23daef(0x173),'value':'ap02'}];export function buildSiteChoices(_0x5c412c){const _0x500272=a47_0x23daef,_0x23a94f=[...STANDARD_SITE_CHOICES];let _0x774555=_0x23a94f[_0x500272(0x174)](_0x174b41=>_0x174b41[_0x500272(0x16d)]===_0x5c412c);return _0x774555===-0x1&&_0x5c412c!==_0x500272(0x177)&&(_0x23a94f['push']({'title':_0x5c412c,'value':_0x5c412c}),_0x774555=_0x23a94f[_0x500272(0x16b)]-0x1),_0x23a94f[_0x500272(0x170)]({'title':'Enter\x20custom\x20site','value':_0x500272(0x169)}),{'choices':_0x23a94f,'initialIndex':_0x774555>=0x0?_0x774555:0x0};}
1
+ const a47_0x58ac28=a47_0x42a2;function a47_0x1e66(){const _0x136cca=['us01','push','eu01','1051944cZPORK','12548GhteXm','Enter\x20custom\x20site','eu\x20\x20\x20-\x20Europe','ap02','15216VhriVR','us\x20\x20\x20-\x20United\x20States','1716588gPgiBo','jp01','4502632kjQzUw','1914jycUIJ','26109tlANNB','246HhkrwB','5070UKXEyh','length','findIndex','6174290quSdcG','number','6FCOysk','7JGDnNZ'];a47_0x1e66=function(){return _0x136cca;};return a47_0x1e66();}(function(_0x427efc,_0x1a21ec){const _0x48a3df=a47_0x42a2,_0x19e3e4=_0x427efc();while(!![]){try{const _0x5bb6c7=-parseInt(_0x48a3df(0xdf))/0x1+parseInt(_0x48a3df(0xef))/0x2+-parseInt(_0x48a3df(0xe4))/0x3*(parseInt(_0x48a3df(0xf0))/0x4)+-parseInt(_0x48a3df(0xe8))/0x5*(-parseInt(_0x48a3df(0xea))/0x6)+parseInt(_0x48a3df(0xeb))/0x7*(-parseInt(_0x48a3df(0xe1))/0x8)+parseInt(_0x48a3df(0xe3))/0x9*(parseInt(_0x48a3df(0xe5))/0xa)+parseInt(_0x48a3df(0xe2))/0xb*(parseInt(_0x48a3df(0xf4))/0xc);if(_0x5bb6c7===_0x1a21ec)break;else _0x19e3e4['push'](_0x19e3e4['shift']());}catch(_0x3d5da3){_0x19e3e4['push'](_0x19e3e4['shift']());}}}(a47_0x1e66,0xdf8a2));export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;function a47_0x42a2(_0x64d360,_0x239077){_0x64d360=_0x64d360-0xde;const _0x1e66a2=a47_0x1e66();let _0x42a237=_0x1e66a2[_0x64d360];return _0x42a237;}export function resolveLimit(_0x52e87d,_0x4f8488){const _0x4fd3fc=a47_0x42a2;if(_0x52e87d===undefined)return _0x4f8488;if(typeof _0x52e87d===_0x4fd3fc(0xe9))return _0x52e87d;return parseInt(_0x52e87d,0xa);}export const STANDARD_SITE_CHOICES=[{'title':a47_0x58ac28(0xde),'value':'us01'},{'title':'jp\x20\x20\x20-\x20Japan','value':a47_0x58ac28(0xe0)},{'title':a47_0x58ac28(0xf2),'value':a47_0x58ac28(0xee)},{'title':'ap02\x20-\x20Korea','value':a47_0x58ac28(0xf3)}];export function buildSiteChoices(_0x1f617c){const _0x2c21f1=a47_0x58ac28,_0x1528fc=[...STANDARD_SITE_CHOICES];let _0x4375ef=_0x1528fc[_0x2c21f1(0xe7)](_0x15f73e=>_0x15f73e['value']===_0x1f617c);return _0x4375ef===-0x1&&_0x1f617c!==_0x2c21f1(0xec)&&(_0x1528fc['push']({'title':_0x1f617c,'value':_0x1f617c}),_0x4375ef=_0x1528fc[_0x2c21f1(0xe6)]-0x1),_0x1528fc[_0x2c21f1(0xed)]({'title':_0x2c21f1(0xf1),'value':'other'}),{'choices':_0x1528fc,'initialIndex':_0x4375ef>=0x0?_0x4375ef:0x0};}
@@ -1 +1 @@
1
- (function(_0xbc934,_0x562b67){const _0xa088=a48_0x4338,_0x27f2da=_0xbc934();while(!![]){try{const _0x49785e=parseInt(_0xa088(0x159))/0x1+parseInt(_0xa088(0x163))/0x2+parseInt(_0xa088(0x160))/0x3*(-parseInt(_0xa088(0x15d))/0x4)+parseInt(_0xa088(0x155))/0x5+parseInt(_0xa088(0x15e))/0x6*(parseInt(_0xa088(0x15c))/0x7)+-parseInt(_0xa088(0x158))/0x8*(-parseInt(_0xa088(0x15b))/0x9)+-parseInt(_0xa088(0x161))/0xa;if(_0x49785e===_0x562b67)break;else _0x27f2da['push'](_0x27f2da['shift']());}catch(_0x1475eb){_0x27f2da['push'](_0x27f2da['shift']());}}}(a48_0x24aa,0x68af6));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0xc1856,_0x10d8ac){const _0x2c719e=a48_0x4338,_0x35f96f=_0xc1856||_0x2c719e(0x164),_0x2db354=_0x10d8ac||_0x2c719e(0x165);return _0x35f96f+':'+_0x2db354;}export function getCachedCredential(_0x32ddd6,_0x5de7f7){const _0x4631ee=a48_0x4338,_0x59702b=getCacheKey(_0x32ddd6,_0x5de7f7),_0x36c220=cache[_0x4631ee(0x15a)](_0x59702b);if(!_0x36c220)return null;if(Date['now']()-_0x36c220['loadedAt']>CACHE_TTL_MS)return cache[_0x4631ee(0x162)](_0x59702b),null;return _0x36c220[_0x4631ee(0x156)];}export function setCachedCredential(_0x5424ba,_0x251f0b,_0x4350da){const _0x2252c7=a48_0x4338,_0x13351a=getCacheKey(_0x251f0b,_0x4350da);cache[_0x2252c7(0x157)](_0x13351a,{'apiKey':_0x5424ba,'loadedAt':Date['now']()});}export function clearCredentialCache(){const _0x52ff9e=a48_0x4338;cache[_0x52ff9e(0x15f)]();}export function clearCachedCredential(_0xb6eded,_0x4b9cb7){const _0x55b0be=getCacheKey(_0xb6eded,_0x4b9cb7);cache['delete'](_0x55b0be);}function a48_0x4338(_0x3ddf2f,_0x5d7c60){_0x3ddf2f=_0x3ddf2f-0x155;const _0x24aac0=a48_0x24aa();let _0x4338f8=_0x24aac0[_0x3ddf2f];return _0x4338f8;}function a48_0x24aa(){const _0x5c9764=['1238415WfGNEH','12690040yfwHIK','delete','556164EeceHz','__default_site__','__default_profile__','2121005EgPalN','apiKey','set','368FVtTAx','112494JapWGg','get','117234ATxNJL','20489wUsoYr','4yKdaWy','1428EyYaFl','clear'];a48_0x24aa=function(){return _0x5c9764;};return a48_0x24aa();}
1
+ (function(_0x39fccf,_0xed0f7c){const _0x34ffd2=a48_0x1c0f,_0xddaa21=_0x39fccf();while(!![]){try{const _0x48780e=parseInt(_0x34ffd2(0x13c))/0x1*(-parseInt(_0x34ffd2(0x149))/0x2)+parseInt(_0x34ffd2(0x13b))/0x3+parseInt(_0x34ffd2(0x142))/0x4+parseInt(_0x34ffd2(0x13d))/0x5*(parseInt(_0x34ffd2(0x140))/0x6)+parseInt(_0x34ffd2(0x141))/0x7*(parseInt(_0x34ffd2(0x14b))/0x8)+parseInt(_0x34ffd2(0x14a))/0x9+-parseInt(_0x34ffd2(0x13f))/0xa*(parseInt(_0x34ffd2(0x13e))/0xb);if(_0x48780e===_0xed0f7c)break;else _0xddaa21['push'](_0xddaa21['shift']());}catch(_0x48b328){_0xddaa21['push'](_0xddaa21['shift']());}}}(a48_0x236f,0x731bb));function a48_0x1c0f(_0x8f218a,_0x8520e3){_0x8f218a=_0x8f218a-0x13a;const _0x236f18=a48_0x236f();let _0x1c0f4a=_0x236f18[_0x8f218a];return _0x1c0f4a;}const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x392733,_0x4d0280){const _0x3def6b=a48_0x1c0f,_0x18b6ad=_0x392733||'__default_site__',_0x57c08a=_0x4d0280||_0x3def6b(0x13a);return _0x18b6ad+':'+_0x57c08a;}function a48_0x236f(){const _0xb99e31=['__default_profile__','2743164PvJnpL','629117CyCYdu','220tRjMOm','12683RQsHlH','17110zSXrqB','50928VoQQBH','85911oergQD','3039128PTnjms','loadedAt','get','set','apiKey','delete','now','2euDXUn','1057851vlZiRO','592codLzK'];a48_0x236f=function(){return _0xb99e31;};return a48_0x236f();}export function getCachedCredential(_0x2c5dec,_0x316be6){const _0x22e60d=a48_0x1c0f,_0xaa63e0=getCacheKey(_0x2c5dec,_0x316be6),_0x5d1ef1=cache[_0x22e60d(0x144)](_0xaa63e0);if(!_0x5d1ef1)return null;if(Date[_0x22e60d(0x148)]()-_0x5d1ef1[_0x22e60d(0x143)]>CACHE_TTL_MS)return cache[_0x22e60d(0x147)](_0xaa63e0),null;return _0x5d1ef1[_0x22e60d(0x146)];}export function setCachedCredential(_0x46c88d,_0x324aee,_0x351948){const _0xf10f8=a48_0x1c0f,_0x252b56=getCacheKey(_0x324aee,_0x351948);cache[_0xf10f8(0x145)](_0x252b56,{'apiKey':_0x46c88d,'loadedAt':Date['now']()});}export function clearCredentialCache(){cache['clear']();}export function clearCachedCredential(_0x32b777,_0x362ed8){const _0x4f50cb=a48_0x1c0f,_0xf2bfa4=getCacheKey(_0x32b777,_0x362ed8);cache[_0x4f50cb(0x147)](_0xf2bfa4);}
@@ -1 +1 @@
1
- const a49_0x2264ec=a49_0x1ae5;(function(_0x4a9ea6,_0x11b32f){const _0x1e3b75=a49_0x1ae5,_0x1e4ca3=_0x4a9ea6();while(!![]){try{const _0x19aaba=-parseInt(_0x1e3b75(0x16f))/0x1+parseInt(_0x1e3b75(0x159))/0x2+-parseInt(_0x1e3b75(0x16b))/0x3+parseInt(_0x1e3b75(0x18d))/0x4*(-parseInt(_0x1e3b75(0x178))/0x5)+parseInt(_0x1e3b75(0x15a))/0x6*(-parseInt(_0x1e3b75(0x14b))/0x7)+parseInt(_0x1e3b75(0x158))/0x8+parseInt(_0x1e3b75(0x155))/0x9;if(_0x19aaba===_0x11b32f)break;else _0x1e4ca3['push'](_0x1e4ca3['shift']());}catch(_0x252b09){_0x1e4ca3['push'](_0x1e4ca3['shift']());}}}(a49_0x4a0b,0xf03f5));import{resolveSite,getAPIKey,getAPIKeyAsync,getConfigDir}from'./config.js';function a49_0x4a0b(){const _0x51a493=['18buTAYs','cyan','verbose','profiles','join','INFO','bold','sessions','segment_path','existsSync','[context]','project','configFiles','logLevel','apiKey','default','llm_project','1298364nAwTyD','none','injectIntoOptions','Global','1132109amBtcG','parentSegment','global','sessionId','cli','tdx.json','profileCredentials','replace','readFileSync','9380755fJTaLZ','getParameters','site','profile','.env','log','profileSource','utf-8','activeProfile','getSource','[configuration\x20files]','llmAgent','profile:\x20','cliFlags','Profile\x20Credentials','entries','config','database','Session','loadGlobalConfig','globalCredentials','4GnqwZm','workflow_project','layers','llm_agent','Global\x20Credentials','us01','assign','CLI\x20flag:\x20--','displayWithSources','Project','.json','parent_segment','dim','346017TSHReV','resolveAPIKeyAsync','createAsync','env','Profile','(using\x20session:\x20','display','proxy','session','(session:\x20','15462783oiEUUD','llmProject','string','7399768hLDazM','3860672BbdsUW'];a49_0x4a0b=function(){return _0x51a493;};return a49_0x4a0b();}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 a49_0x25b9d9 from'node:fs';function a49_0x1ae5(_0xf944f0,_0xfc64a1){_0xf944f0=_0xf944f0-0x145;const _0x4a0b11=a49_0x4a0b();let _0x1ae560=_0x4a0b11[_0xf944f0];return _0x1ae560;}import*as a49_0x4c86c8 from'node:path';import a49_0x3c43bf from'chalk';export class GlobalContext{[a49_0x2264ec(0x17a)];[a49_0x2264ec(0x189)];[a49_0x2264ec(0x149)];[a49_0x2264ec(0x162)];[a49_0x2264ec(0x16a)];[a49_0x2264ec(0x190)];[a49_0x2264ec(0x18e)];[a49_0x2264ec(0x168)];[a49_0x2264ec(0x152)];[a49_0x2264ec(0x15c)];[a49_0x2264ec(0x167)];['profile'];['profileSource']=null;[a49_0x2264ec(0x18f)];[a49_0x2264ec(0x180)];[a49_0x2264ec(0x172)];[a49_0x2264ec(0x166)];constructor(_0x351ae0){const _0x5151aa=a49_0x2264ec;this[_0x5151aa(0x172)]=getSessionID(_0x351ae0[_0x5151aa(0x153)]);const _0x4f32af=loadSessionContext(_0x351ae0['session']),_0x205a03=loadProjectConfig(),_0x24db5d=this[_0x5151aa(0x18b)]();if(_0x351ae0['profile'])this[_0x5151aa(0x180)]=_0x351ae0['profile'],this[_0x5151aa(0x17e)]=_0x5151aa(0x173);else{if(_0x4f32af?.[_0x5151aa(0x17b)])this[_0x5151aa(0x180)]=_0x4f32af[_0x5151aa(0x17b)],this[_0x5151aa(0x17e)]=_0x5151aa(0x153);else{if(_0x24db5d[_0x5151aa(0x17b)])this['activeProfile']=_0x24db5d[_0x5151aa(0x17b)],this[_0x5151aa(0x17e)]=_0x5151aa(0x188);else process.env.TDX_PROFILE?(this[_0x5151aa(0x180)]=process.env.TDX_PROFILE,this[_0x5151aa(0x17e)]=_0x5151aa(0x14e)):(this[_0x5151aa(0x180)]=null,this[_0x5151aa(0x17e)]=null);}}const _0x487344=this[_0x5151aa(0x180)]?loadProfile(this[_0x5151aa(0x180)]):null,_0x36eaac=_0x4f5ddb=>{const _0x4c0623=_0x5151aa;if(!_0x4f5ddb)return{};const _0x1ac56a=_0x4f5ddb,_0x4784f3={};for(const [_0x1d511c,_0x25bcbc]of Object[_0x4c0623(0x187)](_0x1ac56a)){typeof _0x25bcbc===_0x4c0623(0x157)&&(_0x4784f3[_0x1d511c]=_0x25bcbc);}return _0x4784f3;},_0x5b121d={},_0x45523f=(_0x11bb7e,_0x49cc6e,_0x1bb098)=>{const _0x555723=_0x5151aa;if(!_0x11bb7e)return![];if(_0x1bb098&&_0x11bb7e===_0x1bb098)return![];const _0x5e58c0=_0x4f32af,_0x12c9fa=_0x205a03,_0xfb846a=_0x487344?.[_0x555723(0x188)],_0x530972=_0x24db5d,_0x4c4f7c=_0x5e58c0?.[_0x49cc6e],_0x4cc98a=_0x12c9fa?.[_0x49cc6e],_0x530087=_0xfb846a?.[_0x49cc6e],_0x5c1dee=_0x530972[_0x49cc6e];return _0x11bb7e!==_0x4c4f7c&&_0x11bb7e!==_0x4cc98a&&_0x11bb7e!==_0x530087&&_0x11bb7e!==_0x5c1dee;},_0x4e8df4=[{'optionKey':_0x5151aa(0x17a),'contextKey':_0x5151aa(0x17a),'defaultValue':_0x5151aa(0x192)},{'optionKey':_0x5151aa(0x189),'contextKey':'database'},{'optionKey':_0x5151aa(0x170),'contextKey':_0x5151aa(0x149)},{'optionKey':_0x5151aa(0x156),'contextKey':_0x5151aa(0x16a)},{'optionKey':_0x5151aa(0x183),'contextKey':_0x5151aa(0x190)},{'optionKey':_0x5151aa(0x17b),'contextKey':'profile'}];for(const {optionKey:_0x55ee6a,contextKey:_0x3ee681,defaultValue:_0x60ba3b}of _0x4e8df4){const _0x9390b5=_0x351ae0[_0x55ee6a];_0x45523f(_0x9390b5,_0x3ee681,_0x60ba3b)&&(_0x5b121d[_0x3ee681]=_0x9390b5);}this[_0x5151aa(0x18f)]={'cliFlags':_0x5b121d,'session':_0x36eaac(_0x4f32af),'project':_0x36eaac(_0x205a03),'profile':_0x36eaac(_0x487344?.[_0x5151aa(0x188)]),'global':_0x36eaac(_0x24db5d)};const _0x417b5b={...this[_0x5151aa(0x18f)]['global'],...this[_0x5151aa(0x18f)][_0x5151aa(0x17b)],...this[_0x5151aa(0x18f)][_0x5151aa(0x165)]};process.env.TDX_SITE&&!this['layers'][_0x5151aa(0x153)][_0x5151aa(0x17a)]&&!this['layers'][_0x5151aa(0x185)][_0x5151aa(0x17a)]&&(_0x417b5b['site']=process.env.TDX_SITE);Object[_0x5151aa(0x193)](_0x417b5b,this[_0x5151aa(0x18f)]['session']),Object[_0x5151aa(0x193)](_0x417b5b,this['layers']['cliFlags']);const _0x4c448d=_0x417b5b[_0x5151aa(0x17a)]||_0x5151aa(0x192);this[_0x5151aa(0x17a)]=resolveSite(_0x4c448d),this[_0x5151aa(0x189)]=_0x417b5b[_0x5151aa(0x189)],this[_0x5151aa(0x149)]=_0x417b5b[_0x5151aa(0x149)],this[_0x5151aa(0x162)]=_0x417b5b['segment_path'],this[_0x5151aa(0x16a)]=_0x417b5b[_0x5151aa(0x16a)],this[_0x5151aa(0x190)]=_0x417b5b[_0x5151aa(0x190)],this['workflow_project']=_0x417b5b[_0x5151aa(0x18e)],this['verbose']=_0x351ae0[_0x5151aa(0x15c)]||![],this[_0x5151aa(0x167)]=_0x351ae0[_0x5151aa(0x167)]??LogLevel[_0x5151aa(0x15f)],this[_0x5151aa(0x17b)]=this[_0x5151aa(0x180)]||undefined,this['apiKey']=getAPIKey(this[_0x5151aa(0x180)]||undefined);const _0x1cb532=typeof _0x24db5d['proxy']===_0x5151aa(0x157)?_0x24db5d[_0x5151aa(0x152)]:undefined;this[_0x5151aa(0x152)]=_0x1cb532||process.env.HTTPS_PROXY||process.env.HTTP_PROXY;const _0x42e45e=getConfigDir(),_0x2fa20a=a49_0x4c86c8[_0x5151aa(0x15e)](_0x42e45e,_0x5151aa(0x161),this[_0x5151aa(0x172)]+_0x5151aa(0x148)),_0x2ecb1c=findProjectConfigPath(),_0x33da32=a49_0x4c86c8[_0x5151aa(0x15e)](_0x42e45e,_0x5151aa(0x174)),_0x5cdfdf=a49_0x4c86c8[_0x5151aa(0x15e)](_0x42e45e,_0x5151aa(0x17c));let _0x2328fe=null,_0x84bef0=null;this['activeProfile']&&(_0x2328fe=a49_0x4c86c8[_0x5151aa(0x15e)](_0x42e45e,_0x5151aa(0x15d),this['activeProfile'],'tdx.json'),_0x84bef0=a49_0x4c86c8[_0x5151aa(0x15e)](_0x42e45e,_0x5151aa(0x15d),this[_0x5151aa(0x180)],'.env')),this[_0x5151aa(0x166)]={'session':a49_0x25b9d9[_0x5151aa(0x163)](_0x2fa20a)?_0x2fa20a:null,'project':_0x2ecb1c,'profile':_0x2328fe&&a49_0x25b9d9[_0x5151aa(0x163)](_0x2328fe)?_0x2328fe:null,'profileCredentials':_0x84bef0&&a49_0x25b9d9['existsSync'](_0x84bef0)?_0x84bef0:null,'global':a49_0x25b9d9[_0x5151aa(0x163)](_0x33da32)?_0x33da32:null,'globalCredentials':a49_0x25b9d9[_0x5151aa(0x163)](_0x5cdfdf)?_0x5cdfdf:null};}['getSource'](_0x2c01b7,_0x44ace3){const _0x2328dd=a49_0x2264ec;if(!_0x44ace3)return'not\x20set';const _0x1db380=_0x44ace3;if(this[_0x2328dd(0x18f)][_0x2328dd(0x185)][_0x2c01b7]===_0x1db380){if(_0x2c01b7===_0x2328dd(0x17a)&&_0x1db380===_0x2328dd(0x192)&&!this['layers']['session'][_0x2328dd(0x17a)]&&!this[_0x2328dd(0x18f)][_0x2328dd(0x165)]['site']&&!this[_0x2328dd(0x18f)]['profile'][_0x2328dd(0x17a)]&&!this[_0x2328dd(0x18f)]['global'][_0x2328dd(0x17a)])return _0x2328dd(0x169);return _0x2328dd(0x145)+_0x2c01b7[_0x2328dd(0x176)](/_/g,'-');}if(this[_0x2328dd(0x18f)]['session'][_0x2c01b7]===_0x1db380)return'session';if(this[_0x2328dd(0x18f)]['project'][_0x2c01b7]===_0x1db380)return _0x2328dd(0x165);if(this[_0x2328dd(0x18f)]['profile'][_0x2c01b7]===_0x1db380)return _0x2328dd(0x184)+this[_0x2328dd(0x180)];if(this[_0x2328dd(0x18f)][_0x2328dd(0x171)][_0x2c01b7]===_0x1db380)return _0x2328dd(0x171);return _0x2328dd(0x169);}[a49_0x2264ec(0x18b)](){const _0xa933ed=a49_0x2264ec,_0x19b0f8=a49_0x4c86c8[_0xa933ed(0x15e)](getConfigDir(),_0xa933ed(0x174));if(!a49_0x25b9d9[_0xa933ed(0x163)](_0x19b0f8))return{};try{const _0x3cfed5=a49_0x25b9d9[_0xa933ed(0x177)](_0x19b0f8,_0xa933ed(0x17f));return JSON['parse'](_0x3cfed5);}catch{return{};}}[a49_0x2264ec(0x16d)](_0x454e54){const _0x54bef5=a49_0x2264ec;_0x454e54[_0x54bef5(0x17a)]=this[_0x54bef5(0x17a)],!_0x454e54['database']&&this['database']&&(_0x454e54[_0x54bef5(0x189)]=this[_0x54bef5(0x189)]),!_0x454e54[_0x54bef5(0x170)]&&this[_0x54bef5(0x149)]&&(_0x454e54[_0x54bef5(0x170)]=this['parent_segment']),!_0x454e54['segmentPath']&&this[_0x54bef5(0x162)]&&(_0x454e54['segmentPath']=this[_0x54bef5(0x162)]),!_0x454e54['llmProject']&&this[_0x54bef5(0x16a)]&&(_0x454e54[_0x54bef5(0x156)]=this[_0x54bef5(0x16a)]),!_0x454e54['llmAgent']&&this[_0x54bef5(0x190)]&&(_0x454e54[_0x54bef5(0x183)]=this[_0x54bef5(0x190)]),!_0x454e54['workflowProject']&&this[_0x54bef5(0x18e)]&&(_0x454e54['workflowProject']=this['workflow_project']);}[a49_0x2264ec(0x179)](){const _0x34dc73=a49_0x2264ec;return[{'key':'site','value':this[_0x34dc73(0x17a)]},{'key':_0x34dc73(0x189),'value':this['database']},{'key':_0x34dc73(0x149),'value':this[_0x34dc73(0x149)]},{'key':_0x34dc73(0x162),'value':this['segment_path']},{'key':_0x34dc73(0x16a),'value':this[_0x34dc73(0x16a)]},{'key':'llm_agent','value':this['llm_agent']},{'key':'workflow_project','value':this['workflow_project']},{'key':_0x34dc73(0x17b),'value':this['activeProfile']||undefined}];}[a49_0x2264ec(0x151)](){const _0x17cc3b=a49_0x2264ec;console[_0x17cc3b(0x17d)](a49_0x3c43bf[_0x17cc3b(0x160)](_0x17cc3b(0x164)));for(const {key:_0x1467f1,value:_0x5566ed}of this[_0x17cc3b(0x179)]()){_0x5566ed&&console[_0x17cc3b(0x17d)](a49_0x3c43bf[_0x17cc3b(0x15b)](_0x1467f1)+':\x20'+_0x5566ed);}}[a49_0x2264ec(0x146)](){const _0x113253=a49_0x2264ec;console[_0x113253(0x17d)](a49_0x3c43bf[_0x113253(0x160)](_0x113253(0x164)));for(const {key:_0x4f3859,value:_0x4a463d}of this[_0x113253(0x179)]()){if(_0x4a463d){const _0x3a12df=_0x4f3859===_0x113253(0x17b)?'(active)':'('+this[_0x113253(0x181)](_0x4f3859,_0x4a463d)+')';console[_0x113253(0x17d)](a49_0x3c43bf[_0x113253(0x15b)](_0x4f3859)+':\x20'+_0x4a463d+'\x20'+a49_0x3c43bf[_0x113253(0x14a)](_0x3a12df));}}console[_0x113253(0x17d)]('\x0a'+a49_0x3c43bf['bold'](_0x113253(0x182)));const _0x4ae182=[{'label':_0x113253(0x18a),'path':this[_0x113253(0x166)][_0x113253(0x153)],'extra':_0x113253(0x154)+this[_0x113253(0x172)]+')'},{'label':'Project','path':this['configFiles']['project']},{'label':_0x113253(0x14f),'path':this[_0x113253(0x166)][_0x113253(0x17b)]},{'label':_0x113253(0x186),'path':this[_0x113253(0x166)][_0x113253(0x175)]},{'label':_0x113253(0x16e),'path':this[_0x113253(0x166)][_0x113253(0x171)]},{'label':_0x113253(0x191),'path':this[_0x113253(0x166)][_0x113253(0x18c)]}];for(const {label:_0x4b0851,path:_0x317d55,extra:_0x13bb8a}of _0x4ae182){if(_0x317d55)console[_0x113253(0x17d)](a49_0x3c43bf[_0x113253(0x15b)](_0x4b0851)+':\x20'+_0x317d55+'\x20'+a49_0x3c43bf['green']('✓')+(_0x13bb8a?'\x20'+a49_0x3c43bf[_0x113253(0x14a)](_0x13bb8a):''));else{if(_0x4b0851===_0x113253(0x18a))console[_0x113253(0x17d)](a49_0x3c43bf[_0x113253(0x15b)](_0x4b0851)+':\x20'+a49_0x3c43bf[_0x113253(0x14a)](_0x113253(0x16c))+'\x20'+a49_0x3c43bf['dim'](_0x113253(0x150)+this[_0x113253(0x172)]+')'));else(_0x4b0851===_0x113253(0x147)||_0x4b0851==='Global')&&console[_0x113253(0x17d)](a49_0x3c43bf[_0x113253(0x15b)](_0x4b0851)+':\x20'+a49_0x3c43bf[_0x113253(0x14a)]('none'));}}}async[a49_0x2264ec(0x14c)](){const _0x3e45ae=a49_0x2264ec;return this[_0x3e45ae(0x168)]=await getAPIKeyAsync(this[_0x3e45ae(0x17a)],this['activeProfile']||undefined),this[_0x3e45ae(0x168)];}static async[a49_0x2264ec(0x14d)](_0x121884){const _0x4b2419=new GlobalContext(_0x121884);return await _0x4b2419['resolveAPIKeyAsync'](),_0x4b2419;}}
1
+ const a49_0x361b4f=a49_0x37d5;(function(_0x3026e4,_0x5191c3){const _0x30aa33=a49_0x37d5,_0x9719c9=_0x3026e4();while(!![]){try{const _0x2359fe=-parseInt(_0x30aa33(0x21d))/0x1*(parseInt(_0x30aa33(0x205))/0x2)+-parseInt(_0x30aa33(0x1ea))/0x3*(-parseInt(_0x30aa33(0x20b))/0x4)+parseInt(_0x30aa33(0x225))/0x5+-parseInt(_0x30aa33(0x234))/0x6*(-parseInt(_0x30aa33(0x220))/0x7)+-parseInt(_0x30aa33(0x20e))/0x8*(parseInt(_0x30aa33(0x1ff))/0x9)+parseInt(_0x30aa33(0x20a))/0xa*(parseInt(_0x30aa33(0x226))/0xb)+parseInt(_0x30aa33(0x20c))/0xc;if(_0x2359fe===_0x5191c3)break;else _0x9719c9['push'](_0x9719c9['shift']());}catch(_0x7702c5){_0x9719c9['push'](_0x9719c9['shift']());}}}(a49_0x5915,0x4a0db));import{resolveSite,getAPIKey,getAPIKeyAsync,getConfigDir}from'./config.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 a49_0x1c560b from'node:fs';import*as a49_0x165a67 from'node:path';import a49_0x46386f from'chalk';function a49_0x5915(){const _0x35e066=['1MVlIWU','bold','llmAgent','7rXelPP','[configuration\x20files]','profiles','config','segmentPath','1899335eGtKpX','52558PHGVuT','profile','session','configFiles','workflowProject','createAsync','(using\x20session:\x20','dim','llm_agent','cyan','[context]','profileCredentials','apiKey','CLI\x20flag:\x20--','1367646KTxMJl','globalCredentials','Session','.env','llmProject','none','parse','6GjuneE','cliFlags','parentSegment','Global\x20Credentials','tdx.json','string','sessions','Global','llm_project','cli','logLevel','assign','Project','(session:\x20','(active)','layers','us01','default','getParameters','workflow_project','proxy','1089xaCNej','activeProfile','site','parent_segment','profileSource','verbose','1147830Avwgbv','utf-8','display','join','log','430WnQgvP','524856gwyksC','2140104kMVRmx','existsSync','24912OukPmS','injectIntoOptions','loadGlobalConfig','segment_path','global','displayWithSources','replace','profile:\x20','resolveAPIKeyAsync','INFO','database','env','green','sessionId','project'];a49_0x5915=function(){return _0x35e066;};return a49_0x5915();}function a49_0x37d5(_0x169b53,_0x63f5fe){_0x169b53=_0x169b53-0x1ea;const _0x591594=a49_0x5915();let _0x37d5bf=_0x591594[_0x169b53];return _0x37d5bf;}export class GlobalContext{[a49_0x361b4f(0x201)];[a49_0x361b4f(0x218)];['parent_segment'];['segment_path'];[a49_0x361b4f(0x1f2)];['llm_agent'];[a49_0x361b4f(0x1fd)];['apiKey'];[a49_0x361b4f(0x1fe)];[a49_0x361b4f(0x204)];[a49_0x361b4f(0x1f4)];[a49_0x361b4f(0x227)];[a49_0x361b4f(0x203)]=null;[a49_0x361b4f(0x1f9)];[a49_0x361b4f(0x200)];['sessionId'];[a49_0x361b4f(0x229)];constructor(_0x212592){const _0x5eef38=a49_0x361b4f;this[_0x5eef38(0x21b)]=getSessionID(_0x212592[_0x5eef38(0x228)]);const _0x42a396=loadSessionContext(_0x212592[_0x5eef38(0x228)]),_0xd279bd=loadProjectConfig(),_0x532b45=this[_0x5eef38(0x210)]();if(_0x212592[_0x5eef38(0x227)])this[_0x5eef38(0x200)]=_0x212592[_0x5eef38(0x227)],this[_0x5eef38(0x203)]=_0x5eef38(0x1f3);else{if(_0x42a396?.[_0x5eef38(0x227)])this[_0x5eef38(0x200)]=_0x42a396['profile'],this[_0x5eef38(0x203)]=_0x5eef38(0x228);else{if(_0x532b45[_0x5eef38(0x227)])this['activeProfile']=_0x532b45['profile'],this['profileSource']='config';else process.env.TDX_PROFILE?(this[_0x5eef38(0x200)]=process.env.TDX_PROFILE,this[_0x5eef38(0x203)]=_0x5eef38(0x219)):(this[_0x5eef38(0x200)]=null,this[_0x5eef38(0x203)]=null);}}const _0x1a6784=this[_0x5eef38(0x200)]?loadProfile(this[_0x5eef38(0x200)]):null,_0x28c3ae=_0x35c463=>{const _0x37b6c9=_0x5eef38;if(!_0x35c463)return{};const _0x1e00ef=_0x35c463,_0x3cf5bf={};for(const [_0x182f95,_0x5a8b3e]of Object['entries'](_0x1e00ef)){typeof _0x5a8b3e===_0x37b6c9(0x1ef)&&(_0x3cf5bf[_0x182f95]=_0x5a8b3e);}return _0x3cf5bf;},_0x3bacf6={},_0x5b7b9d=(_0x5b70de,_0x3eae69,_0xb27f2e)=>{const _0x2dfde6=_0x5eef38;if(!_0x5b70de)return![];if(_0xb27f2e&&_0x5b70de===_0xb27f2e)return![];const _0x6663b7=_0x42a396,_0x463079=_0xd279bd,_0x4981de=_0x1a6784?.[_0x2dfde6(0x223)],_0x2e3d72=_0x532b45,_0x4f40ff=_0x6663b7?.[_0x3eae69],_0x1d70d0=_0x463079?.[_0x3eae69],_0x1e304f=_0x4981de?.[_0x3eae69],_0x14ec49=_0x2e3d72[_0x3eae69];return _0x5b70de!==_0x4f40ff&&_0x5b70de!==_0x1d70d0&&_0x5b70de!==_0x1e304f&&_0x5b70de!==_0x14ec49;},_0x531c2d=[{'optionKey':_0x5eef38(0x201),'contextKey':_0x5eef38(0x201),'defaultValue':_0x5eef38(0x1fa)},{'optionKey':'database','contextKey':_0x5eef38(0x218)},{'optionKey':_0x5eef38(0x1ec),'contextKey':_0x5eef38(0x202)},{'optionKey':_0x5eef38(0x238),'contextKey':_0x5eef38(0x1f2)},{'optionKey':'llmAgent','contextKey':_0x5eef38(0x22e)},{'optionKey':_0x5eef38(0x227),'contextKey':'profile'}];for(const {optionKey:_0x24627d,contextKey:_0x5492e7,defaultValue:_0x4cdb47}of _0x531c2d){const _0x55a531=_0x212592[_0x24627d];_0x5b7b9d(_0x55a531,_0x5492e7,_0x4cdb47)&&(_0x3bacf6[_0x5492e7]=_0x55a531);}this[_0x5eef38(0x1f9)]={'cliFlags':_0x3bacf6,'session':_0x28c3ae(_0x42a396),'project':_0x28c3ae(_0xd279bd),'profile':_0x28c3ae(_0x1a6784?.[_0x5eef38(0x223)]),'global':_0x28c3ae(_0x532b45)};const _0x5acfcc={...this[_0x5eef38(0x1f9)]['global'],...this[_0x5eef38(0x1f9)][_0x5eef38(0x227)],...this['layers'][_0x5eef38(0x21c)]};process.env.TDX_SITE&&!this[_0x5eef38(0x1f9)]['session']['site']&&!this[_0x5eef38(0x1f9)][_0x5eef38(0x1eb)][_0x5eef38(0x201)]&&(_0x5acfcc['site']=process.env.TDX_SITE);Object[_0x5eef38(0x1f5)](_0x5acfcc,this['layers'][_0x5eef38(0x228)]),Object['assign'](_0x5acfcc,this[_0x5eef38(0x1f9)][_0x5eef38(0x1eb)]);const _0x37381e=_0x5acfcc[_0x5eef38(0x201)]||_0x5eef38(0x1fa);this['site']=resolveSite(_0x37381e),this[_0x5eef38(0x218)]=_0x5acfcc[_0x5eef38(0x218)],this[_0x5eef38(0x202)]=_0x5acfcc[_0x5eef38(0x202)],this[_0x5eef38(0x211)]=_0x5acfcc[_0x5eef38(0x211)],this[_0x5eef38(0x1f2)]=_0x5acfcc[_0x5eef38(0x1f2)],this[_0x5eef38(0x22e)]=_0x5acfcc['llm_agent'],this['workflow_project']=_0x5acfcc[_0x5eef38(0x1fd)],this[_0x5eef38(0x204)]=_0x212592['verbose']||![],this[_0x5eef38(0x1f4)]=_0x212592[_0x5eef38(0x1f4)]??LogLevel[_0x5eef38(0x217)],this[_0x5eef38(0x227)]=this[_0x5eef38(0x200)]||undefined,this[_0x5eef38(0x232)]=getAPIKey(this[_0x5eef38(0x200)]||undefined);const _0x349790=typeof _0x532b45[_0x5eef38(0x1fe)]===_0x5eef38(0x1ef)?_0x532b45[_0x5eef38(0x1fe)]:undefined;this[_0x5eef38(0x1fe)]=_0x349790||process.env.HTTPS_PROXY||process.env.HTTP_PROXY;const _0x579e06=getConfigDir(),_0x496998=a49_0x165a67[_0x5eef38(0x208)](_0x579e06,_0x5eef38(0x1f0),this[_0x5eef38(0x21b)]+'.json'),_0x586eae=findProjectConfigPath(),_0x575b40=a49_0x165a67['join'](_0x579e06,_0x5eef38(0x1ee)),_0x915fdc=a49_0x165a67[_0x5eef38(0x208)](_0x579e06,_0x5eef38(0x237));let _0x569661=null,_0x55f97d=null;this['activeProfile']&&(_0x569661=a49_0x165a67[_0x5eef38(0x208)](_0x579e06,_0x5eef38(0x222),this[_0x5eef38(0x200)],_0x5eef38(0x1ee)),_0x55f97d=a49_0x165a67[_0x5eef38(0x208)](_0x579e06,'profiles',this[_0x5eef38(0x200)],_0x5eef38(0x237))),this[_0x5eef38(0x229)]={'session':a49_0x1c560b[_0x5eef38(0x20d)](_0x496998)?_0x496998:null,'project':_0x586eae,'profile':_0x569661&&a49_0x1c560b[_0x5eef38(0x20d)](_0x569661)?_0x569661:null,'profileCredentials':_0x55f97d&&a49_0x1c560b[_0x5eef38(0x20d)](_0x55f97d)?_0x55f97d:null,'global':a49_0x1c560b['existsSync'](_0x575b40)?_0x575b40:null,'globalCredentials':a49_0x1c560b[_0x5eef38(0x20d)](_0x915fdc)?_0x915fdc:null};}['getSource'](_0x452646,_0x2cc212){const _0x215896=a49_0x361b4f;if(!_0x2cc212)return'not\x20set';const _0x511314=_0x2cc212;if(this['layers'][_0x215896(0x1eb)][_0x452646]===_0x511314){if(_0x452646==='site'&&_0x511314===_0x215896(0x1fa)&&!this['layers']['session']['site']&&!this[_0x215896(0x1f9)][_0x215896(0x21c)][_0x215896(0x201)]&&!this['layers']['profile'][_0x215896(0x201)]&&!this[_0x215896(0x1f9)][_0x215896(0x212)][_0x215896(0x201)])return _0x215896(0x1fb);return _0x215896(0x233)+_0x452646[_0x215896(0x214)](/_/g,'-');}if(this[_0x215896(0x1f9)][_0x215896(0x228)][_0x452646]===_0x511314)return _0x215896(0x228);if(this[_0x215896(0x1f9)][_0x215896(0x21c)][_0x452646]===_0x511314)return'project';if(this[_0x215896(0x1f9)]['profile'][_0x452646]===_0x511314)return _0x215896(0x215)+this[_0x215896(0x200)];if(this['layers']['global'][_0x452646]===_0x511314)return _0x215896(0x212);return _0x215896(0x1fb);}['loadGlobalConfig'](){const _0x3055b3=a49_0x361b4f,_0x4ab0ce=a49_0x165a67[_0x3055b3(0x208)](getConfigDir(),_0x3055b3(0x1ee));if(!a49_0x1c560b[_0x3055b3(0x20d)](_0x4ab0ce))return{};try{const _0x317151=a49_0x1c560b['readFileSync'](_0x4ab0ce,_0x3055b3(0x206));return JSON[_0x3055b3(0x23a)](_0x317151);}catch{return{};}}[a49_0x361b4f(0x20f)](_0x109833){const _0x18fd3e=a49_0x361b4f;_0x109833[_0x18fd3e(0x201)]=this[_0x18fd3e(0x201)],!_0x109833[_0x18fd3e(0x218)]&&this[_0x18fd3e(0x218)]&&(_0x109833[_0x18fd3e(0x218)]=this[_0x18fd3e(0x218)]),!_0x109833[_0x18fd3e(0x1ec)]&&this[_0x18fd3e(0x202)]&&(_0x109833[_0x18fd3e(0x1ec)]=this['parent_segment']),!_0x109833[_0x18fd3e(0x224)]&&this[_0x18fd3e(0x211)]&&(_0x109833[_0x18fd3e(0x224)]=this[_0x18fd3e(0x211)]),!_0x109833[_0x18fd3e(0x238)]&&this[_0x18fd3e(0x1f2)]&&(_0x109833[_0x18fd3e(0x238)]=this['llm_project']),!_0x109833[_0x18fd3e(0x21f)]&&this[_0x18fd3e(0x22e)]&&(_0x109833[_0x18fd3e(0x21f)]=this[_0x18fd3e(0x22e)]),!_0x109833[_0x18fd3e(0x22a)]&&this[_0x18fd3e(0x1fd)]&&(_0x109833['workflowProject']=this[_0x18fd3e(0x1fd)]);}[a49_0x361b4f(0x1fc)](){const _0x4ece1b=a49_0x361b4f;return[{'key':'site','value':this['site']},{'key':_0x4ece1b(0x218),'value':this[_0x4ece1b(0x218)]},{'key':_0x4ece1b(0x202),'value':this[_0x4ece1b(0x202)]},{'key':'segment_path','value':this['segment_path']},{'key':_0x4ece1b(0x1f2),'value':this['llm_project']},{'key':_0x4ece1b(0x22e),'value':this[_0x4ece1b(0x22e)]},{'key':'workflow_project','value':this[_0x4ece1b(0x1fd)]},{'key':_0x4ece1b(0x227),'value':this[_0x4ece1b(0x200)]||undefined}];}[a49_0x361b4f(0x207)](){const _0x3f53f4=a49_0x361b4f;console[_0x3f53f4(0x209)](a49_0x46386f[_0x3f53f4(0x21e)]('[context]'));for(const {key:_0x2d8152,value:_0x1f4848}of this[_0x3f53f4(0x1fc)]()){_0x1f4848&&console[_0x3f53f4(0x209)](a49_0x46386f['cyan'](_0x2d8152)+':\x20'+_0x1f4848);}}[a49_0x361b4f(0x213)](){const _0x35fb9b=a49_0x361b4f;console[_0x35fb9b(0x209)](a49_0x46386f[_0x35fb9b(0x21e)](_0x35fb9b(0x230)));for(const {key:_0x438bd1,value:_0x19758c}of this[_0x35fb9b(0x1fc)]()){if(_0x19758c){const _0x177c42=_0x438bd1===_0x35fb9b(0x227)?_0x35fb9b(0x1f8):'('+this['getSource'](_0x438bd1,_0x19758c)+')';console[_0x35fb9b(0x209)](a49_0x46386f[_0x35fb9b(0x22f)](_0x438bd1)+':\x20'+_0x19758c+'\x20'+a49_0x46386f[_0x35fb9b(0x22d)](_0x177c42));}}console[_0x35fb9b(0x209)]('\x0a'+a49_0x46386f[_0x35fb9b(0x21e)](_0x35fb9b(0x221)));const _0x235be9=[{'label':_0x35fb9b(0x236),'path':this[_0x35fb9b(0x229)][_0x35fb9b(0x228)],'extra':_0x35fb9b(0x1f7)+this[_0x35fb9b(0x21b)]+')'},{'label':_0x35fb9b(0x1f6),'path':this[_0x35fb9b(0x229)][_0x35fb9b(0x21c)]},{'label':'Profile','path':this[_0x35fb9b(0x229)][_0x35fb9b(0x227)]},{'label':'Profile\x20Credentials','path':this[_0x35fb9b(0x229)][_0x35fb9b(0x231)]},{'label':_0x35fb9b(0x1f1),'path':this[_0x35fb9b(0x229)][_0x35fb9b(0x212)]},{'label':_0x35fb9b(0x1ed),'path':this[_0x35fb9b(0x229)][_0x35fb9b(0x235)]}];for(const {label:_0x399cb7,path:_0x5a804c,extra:_0x40598a}of _0x235be9){if(_0x5a804c)console[_0x35fb9b(0x209)](a49_0x46386f[_0x35fb9b(0x22f)](_0x399cb7)+':\x20'+_0x5a804c+'\x20'+a49_0x46386f[_0x35fb9b(0x21a)]('✓')+(_0x40598a?'\x20'+a49_0x46386f['dim'](_0x40598a):''));else{if(_0x399cb7==='Session')console[_0x35fb9b(0x209)](a49_0x46386f[_0x35fb9b(0x22f)](_0x399cb7)+':\x20'+a49_0x46386f[_0x35fb9b(0x22d)]('none')+'\x20'+a49_0x46386f['dim'](_0x35fb9b(0x22c)+this[_0x35fb9b(0x21b)]+')'));else(_0x399cb7==='Project'||_0x399cb7==='Global')&&console[_0x35fb9b(0x209)](a49_0x46386f[_0x35fb9b(0x22f)](_0x399cb7)+':\x20'+a49_0x46386f[_0x35fb9b(0x22d)](_0x35fb9b(0x239)));}}}async['resolveAPIKeyAsync'](){const _0x4c942d=a49_0x361b4f;return this[_0x4c942d(0x232)]=await getAPIKeyAsync(this[_0x4c942d(0x201)],this[_0x4c942d(0x200)]||undefined),this[_0x4c942d(0x232)];}static async[a49_0x361b4f(0x22b)](_0x1aa1cc){const _0x23372d=a49_0x361b4f,_0x223690=new GlobalContext(_0x1aa1cc);return await _0x223690[_0x23372d(0x216)](),_0x223690;}}
@@ -1 +1 @@
1
- const a50_0xcd2d3e=a50_0x5dc6;(function(_0x401746,_0x3a6b6a){const _0x303e1d=a50_0x5dc6,_0x37818f=_0x401746();while(!![]){try{const _0x411b21=parseInt(_0x303e1d(0x1fd))/0x1+-parseInt(_0x303e1d(0x1e7))/0x2+-parseInt(_0x303e1d(0x1f5))/0x3+parseInt(_0x303e1d(0x1fe))/0x4*(-parseInt(_0x303e1d(0x1e3))/0x5)+parseInt(_0x303e1d(0x1da))/0x6+parseInt(_0x303e1d(0x1df))/0x7*(-parseInt(_0x303e1d(0x1e4))/0x8)+parseInt(_0x303e1d(0x1e0))/0x9*(parseInt(_0x303e1d(0x1f0))/0xa);if(_0x411b21===_0x3a6b6a)break;else _0x37818f['push'](_0x37818f['shift']());}catch(_0x2c47ba){_0x37818f['push'](_0x37818f['shift']());}}}(a50_0xff77,0x6f072));const SERVICE_NAME=a50_0xcd2d3e(0x1db);let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x2e6d20=a50_0xcd2d3e;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x4531e1=await import('@napi-rs/keyring');return EntryClass=_0x4531e1[_0x2e6d20(0x1ec)],EntryClass;}catch(_0x31d69c){return keyringLoadError=_0x31d69c instanceof Error?_0x31d69c:new Error(String(_0x31d69c)),null;}}function getAccountName(_0x4ee0e6){const _0xb7b7f6=a50_0xcd2d3e,_0x11d2c8=_0x4ee0e6||'';return _0xb7b7f6(0x1f1)+_0x11d2c8+_0xb7b7f6(0x1dd);}export async function getKeychainAPIKey(_0x1ed660){const _0x3425ec=a50_0xcd2d3e,_0x9208d5=await getKeychainAPIKeyWithStatus(_0x1ed660);if(_0x9208d5['success'])return _0x9208d5[_0x3425ec(0x1e6)];return _0x9208d5[_0x3425ec(0x1e1)]==='access_denied'&&console[_0x3425ec(0x1f3)]('Warning:\x20'+_0x9208d5[_0x3425ec(0x1f9)]),null;}function a50_0x5dc6(_0x401366,_0x308d00){_0x401366=_0x401366-0x1da;const _0xff77ff=a50_0xff77();let _0x5dc6e4=_0xff77ff[_0x401366];return _0x5dc6e4;}export async function getKeychainAPIKeyWithStatus(_0x744c3e){const _0x26ec28=a50_0xcd2d3e;try{const _0x6fa5f1=await getEntryClass();if(!_0x6fa5f1)return{'success':![],'reason':_0x26ec28(0x1f2)};const _0x5ec414=getAccountName(_0x744c3e),_0x201321=new _0x6fa5f1(SERVICE_NAME,_0x5ec414),_0x1ea991=_0x201321[_0x26ec28(0x1de)]();if(_0x1ea991)return{'success':!![],'value':_0x1ea991};return{'success':![],'reason':_0x26ec28(0x1dc)};}catch(_0x437b5f){const _0x2e9dce=_0x437b5f instanceof Error?_0x437b5f[_0x26ec28(0x1f9)]:String(_0x437b5f);if(_0x2e9dce[_0x26ec28(0x1fb)]('-25300')||_0x2e9dce[_0x26ec28(0x1f7)]()[_0x26ec28(0x1fb)](_0x26ec28(0x1ea))||_0x2e9dce['toLowerCase']()['includes'](_0x26ec28(0x1f6))||_0x2e9dce[_0x26ec28(0x1f7)]()[_0x26ec28(0x1fb)](_0x26ec28(0x1e5)))return{'success':![],'reason':_0x26ec28(0x1dc)};if(_0x2e9dce[_0x26ec28(0x1fb)](_0x26ec28(0x1f4))||_0x2e9dce['toLowerCase']()['includes'](_0x26ec28(0x1eb))||_0x2e9dce[_0x26ec28(0x1f7)]()[_0x26ec28(0x1fb)](_0x26ec28(0x1ef)))return{'success':![],'reason':_0x26ec28(0x1ed),'message':_0x26ec28(0x1fa)};return{'success':![],'reason':_0x26ec28(0x1f2),'message':_0x2e9dce};}}export async function saveKeychainAPIKey(_0xe31d12,_0x448451){const _0x73be88=a50_0xcd2d3e,_0x1fc8c4=await getEntryClass();if(!_0x1fc8c4)throw new Error('System\x20keychain\x20is\x20not\x20available');const _0x4a06b9=getAccountName(_0x448451),_0x5c599c=new _0x1fc8c4(SERVICE_NAME,_0x4a06b9);_0x5c599c[_0x73be88(0x1e8)](_0xe31d12);}export async function deleteKeychainAPIKey(_0x287a84){const _0x43b623=a50_0xcd2d3e;try{const _0x5c7bc5=await getEntryClass();if(!_0x5c7bc5)return![];const _0x5b560f=getAccountName(_0x287a84),_0x4c378b=new _0x5c7bc5(SERVICE_NAME,_0x5b560f);return _0x4c378b[_0x43b623(0x1e9)](),!![];}catch{return![];}}function a50_0xff77(){const _0xfeea3b=['deleteCredential','could\x20not\x20be\x20found','restricted','Entry','access_denied','not\x20supported','access','780EQKAOG','profile:','unavailable','error','-25293','2082255BqQrEW','not\x20found','toLowerCase','__keychain_test__','message','Keychain\x20access\x20denied.\x20The\x20API\x20key\x20exists\x20but\x20cannot\x20be\x20accessed.\x20Try\x20running\x20\x22tdx\x20auth\x20setup\x22\x20to\x20re-authenticate,\x20or\x20check\x20your\x20keychain\x20permissions\x20for\x20\x22tdx\x22.','includes','not\x20available','500157HLmHSd','24ItdhuS','304542NgnLRm','tdx','not_found',':api_key','getPassword','1656263DICHsd','250911NyxXcI','reason','cannot\x20find','328665hZipyU','16vlVAKZ','no\x20matching\x20entry','value','1418010ATKuwz','setPassword'];a50_0xff77=function(){return _0xfeea3b;};return a50_0xff77();}export async function isKeychainAvailable(){const _0x4dee36=a50_0xcd2d3e;try{const _0x283e86=await getEntryClass();if(!_0x283e86)return![];const _0xdfbdb1=new _0x283e86(SERVICE_NAME,_0x4dee36(0x1f8));return _0xdfbdb1[_0x4dee36(0x1de)](),!![];}catch(_0x9dc718){const _0x522dff=_0x9dc718 instanceof Error?_0x9dc718['message'][_0x4dee36(0x1f7)]():'';if(_0x522dff[_0x4dee36(0x1fb)](_0x4dee36(0x1fc))||_0x522dff[_0x4dee36(0x1fb)](_0x4dee36(0x1ee))||_0x522dff[_0x4dee36(0x1fb)](_0x4dee36(0x1e2)))return![];return!![];}}
1
+ const a50_0x4ca0a7=a50_0x14fc;function a50_0x5f3f(){const _0x2a8019=['Warning:\x20','@napi-rs/keyring','could\x20not\x20be\x20found','cannot\x20find','restricted','32236Ptabag','getPassword','17832segvNk','message','16355999UDNPDn','528636ZobSAC','Entry','access_denied','error','System\x20keychain\x20is\x20not\x20available','no\x20matching\x20entry','not\x20found','2937210GydXIK',':api_key','includes','unavailable','675JUYHDE','-25293','value','reason','203048qSokar','5cVCXgL','54250ynIpGF','success','1379fWoedY','24BHIyXC','toLowerCase','tdx','not_found'];a50_0x5f3f=function(){return _0x2a8019;};return a50_0x5f3f();}(function(_0x3df7f1,_0x3a0850){const _0x16d171=a50_0x14fc,_0x1d51f9=_0x3df7f1();while(!![]){try{const _0x54814d=parseInt(_0x16d171(0x130))/0x1+parseInt(_0x16d171(0x13e))/0x2*(parseInt(_0x16d171(0x135))/0x3)+parseInt(_0x16d171(0x121))/0x4+parseInt(_0x16d171(0x131))/0x5*(parseInt(_0x16d171(0x128))/0x6)+parseInt(_0x16d171(0x134))/0x7*(parseInt(_0x16d171(0x11e))/0x8)+-parseInt(_0x16d171(0x12c))/0x9*(-parseInt(_0x16d171(0x132))/0xa)+-parseInt(_0x16d171(0x120))/0xb;if(_0x54814d===_0x3a0850)break;else _0x1d51f9['push'](_0x1d51f9['shift']());}catch(_0x4e655d){_0x1d51f9['push'](_0x1d51f9['shift']());}}}(a50_0x5f3f,0x4c5bd));const SERVICE_NAME=a50_0x4ca0a7(0x137);let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x38dfa0=a50_0x4ca0a7;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x312bb7=await import(_0x38dfa0(0x13a));return EntryClass=_0x312bb7[_0x38dfa0(0x122)],EntryClass;}catch(_0x1fb36b){return keyringLoadError=_0x1fb36b instanceof Error?_0x1fb36b:new Error(String(_0x1fb36b)),null;}}function getAccountName(_0x2108b8){const _0x3cdc79=a50_0x4ca0a7,_0x5c24ac=_0x2108b8||'';return'profile:'+_0x5c24ac+_0x3cdc79(0x129);}export async function getKeychainAPIKey(_0x4ae4f9){const _0x2fd23b=a50_0x4ca0a7,_0x584b7c=await getKeychainAPIKeyWithStatus(_0x4ae4f9);if(_0x584b7c[_0x2fd23b(0x133)])return _0x584b7c[_0x2fd23b(0x12e)];return _0x584b7c[_0x2fd23b(0x12f)]===_0x2fd23b(0x123)&&console[_0x2fd23b(0x124)](_0x2fd23b(0x139)+_0x584b7c[_0x2fd23b(0x11f)]),null;}export async function getKeychainAPIKeyWithStatus(_0x2fae5f){const _0x8e4d9a=a50_0x4ca0a7;try{const _0x25196c=await getEntryClass();if(!_0x25196c)return{'success':![],'reason':_0x8e4d9a(0x12b)};const _0xc7fac9=getAccountName(_0x2fae5f),_0x48a96a=new _0x25196c(SERVICE_NAME,_0xc7fac9),_0x3864ad=_0x48a96a[_0x8e4d9a(0x13f)]();if(_0x3864ad)return{'success':!![],'value':_0x3864ad};return{'success':![],'reason':_0x8e4d9a(0x138)};}catch(_0x3115f4){const _0x43eed1=_0x3115f4 instanceof Error?_0x3115f4[_0x8e4d9a(0x11f)]:String(_0x3115f4);if(_0x43eed1[_0x8e4d9a(0x12a)]('-25300')||_0x43eed1[_0x8e4d9a(0x136)]()[_0x8e4d9a(0x12a)](_0x8e4d9a(0x13b))||_0x43eed1[_0x8e4d9a(0x136)]()['includes'](_0x8e4d9a(0x127))||_0x43eed1[_0x8e4d9a(0x136)]()[_0x8e4d9a(0x12a)](_0x8e4d9a(0x126)))return{'success':![],'reason':_0x8e4d9a(0x138)};if(_0x43eed1[_0x8e4d9a(0x12a)](_0x8e4d9a(0x12d))||_0x43eed1[_0x8e4d9a(0x136)]()[_0x8e4d9a(0x12a)](_0x8e4d9a(0x13d))||_0x43eed1[_0x8e4d9a(0x136)]()[_0x8e4d9a(0x12a)]('access'))return{'success':![],'reason':_0x8e4d9a(0x123),'message':'Keychain\x20access\x20denied.\x20The\x20API\x20key\x20exists\x20but\x20cannot\x20be\x20accessed.\x20Try\x20running\x20\x22tdx\x20auth\x20setup\x22\x20to\x20re-authenticate,\x20or\x20check\x20your\x20keychain\x20permissions\x20for\x20\x22tdx\x22.'};return{'success':![],'reason':_0x8e4d9a(0x12b),'message':_0x43eed1};}}export async function saveKeychainAPIKey(_0x48fad8,_0x25f798){const _0x41ca9e=a50_0x4ca0a7,_0x3b5dc8=await getEntryClass();if(!_0x3b5dc8)throw new Error(_0x41ca9e(0x125));const _0x6f99d5=getAccountName(_0x25f798),_0x1663e6=new _0x3b5dc8(SERVICE_NAME,_0x6f99d5);_0x1663e6['setPassword'](_0x48fad8);}function a50_0x14fc(_0x388c28,_0x80e994){_0x388c28=_0x388c28-0x11e;const _0x5f3f2a=a50_0x5f3f();let _0x14fc84=_0x5f3f2a[_0x388c28];return _0x14fc84;}export async function deleteKeychainAPIKey(_0xf6377e){try{const _0x310e7c=await getEntryClass();if(!_0x310e7c)return![];const _0x8f1497=getAccountName(_0xf6377e),_0x22babb=new _0x310e7c(SERVICE_NAME,_0x8f1497);return _0x22babb['deleteCredential'](),!![];}catch{return![];}}export async function isKeychainAvailable(){const _0x4e1f59=a50_0x4ca0a7;try{const _0x48d85a=await getEntryClass();if(!_0x48d85a)return![];const _0x15bd34=new _0x48d85a(SERVICE_NAME,'__keychain_test__');return _0x15bd34[_0x4e1f59(0x13f)](),!![];}catch(_0x5699d3){const _0x1d92c7=_0x5699d3 instanceof Error?_0x5699d3[_0x4e1f59(0x11f)][_0x4e1f59(0x136)]():'';if(_0x1d92c7[_0x4e1f59(0x12a)]('not\x20available')||_0x1d92c7[_0x4e1f59(0x12a)]('not\x20supported')||_0x1d92c7[_0x4e1f59(0x12a)](_0x4e1f59(0x13c)))return![];return!![];}}
@@ -1 +1 @@
1
- (function(_0x422b75,_0x13a4d7){const _0x11ea0e=a51_0x4f91,_0x354b20=_0x422b75();while(!![]){try{const _0x47f188=parseInt(_0x11ea0e(0x10c))/0x1+parseInt(_0x11ea0e(0x102))/0x2+-parseInt(_0x11ea0e(0x113))/0x3*(parseInt(_0x11ea0e(0x132))/0x4)+-parseInt(_0x11ea0e(0x133))/0x5+parseInt(_0x11ea0e(0x119))/0x6+parseInt(_0x11ea0e(0x130))/0x7+-parseInt(_0x11ea0e(0x109))/0x8*(parseInt(_0x11ea0e(0x10d))/0x9);if(_0x47f188===_0x13a4d7)break;else _0x354b20['push'](_0x354b20['shift']());}catch(_0x326cc8){_0x354b20['push'](_0x354b20['shift']());}}}(a51_0xf247,0x2d303));import*as a51_0x176d23 from'node:fs';import*as a51_0x420cfb from'node:path';import{SDKError,ErrorCode}from'../sdk/errors.js';import{getConfigDir}from'./config.js';function a51_0x4f91(_0x37638c,_0x49c0e3){_0x37638c=_0x37638c-0xf2;const _0xf247c=a51_0xf247();let _0x4f91e1=_0xf247c[_0x37638c];return _0x4f91e1;}import{createSecureDirectory,writeSecureFile}from'../utils/file-permissions.js';import{findProjectConfigPath}from'./project-config.js';function a51_0xf247(){const _0x392a8d=['warn','string','\x27:\x20config\x20must\x20be\x20an\x20object','profile','Error:\x20','keys','Invalid\x20profile\x20name:\x20','utf-8','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','parse','set','Warning:\x20Profile\x20\x27','INVALID_PROFILE_CONFIG','values','description','77270mESdlF','rmSync','directory','\x27:\x20unknown\x20config\x20key\x20\x27','\x27\x20will\x20be\x20ignored','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','profiles','12064gMKXAA','name','sort','111624mgRCVI','576OdBbxG','existsSync','readFileSync','localeCompare','Profile\x20','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','360kAawvO','map','\x20\x201.\x20Edit:\x20','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','site','includes','1467918EpPqCw','test','message','llm_agent','parent_segment','user','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20underscore,\x20and\x20optional\x20@\x20prefix\x20for\x20reserved\x20profiles.','filter',':\x20Invalid\x20JSON\x20syntax','stringify','\x27\x20not\x20found\x20in\x20user\x20configuration','readdirSync','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','.env','\x20does\x20not\x20exist','Failed\x20to\x20parse\x20','\x22\x20\x22','push','toISOString','Warning:\x20Failed\x20to\x20parse\x20','from','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','Profile\x20\x27','2202333eDpopJ','\x20already\x20exists','2456yUotlz','1771240PUVSQv','llm_project','database','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','tdx.json','.env.','join','find',',\x20creating\x20new\x20file'];a51_0xf247=function(){return _0x392a8d;};return a51_0xf247();}import{loadSessionContext}from'./session.js';export const STUDIO_PROFILE_NAME='@tdx-studio';export function getProfileParams(_0x21a67c){const _0x162a23=a51_0x4f91,_0x537ce5={};if(!_0x21a67c)return _0x537ce5;for(const [_0x1e375d,_0x34a585]of Object['entries'](_0x21a67c)){_0x1e375d!==_0x162a23(0x101)&&_0x34a585!==undefined&&(_0x537ce5[_0x1e375d]=_0x34a585);}return _0x537ce5;}export function getProfilesDir(){const _0x1275f8=a51_0x4f91;return a51_0x420cfb[_0x1275f8(0x139)](getConfigDir(),_0x1275f8(0x108));}function getProfileDir(_0x2f67b8){const _0x46c636=a51_0x4f91;return a51_0x420cfb[_0x46c636(0x139)](getProfilesDir(),_0x2f67b8);}function getProfileConfigPath(_0x5c50e9){const _0x126dbe=a51_0x4f91;return a51_0x420cfb[_0x126dbe(0x139)](getProfileDir(_0x5c50e9),_0x126dbe(0x137));}function getProfileEnvPath(_0x2c8445){return a51_0x420cfb['join'](getProfileDir(_0x2c8445),'.env');}function getGlobalConfigPath(){const _0x2a5852=a51_0x4f91;return a51_0x420cfb[_0x2a5852(0x139)](getConfigDir(),_0x2a5852(0x137));}function validateProfileName(_0x3e345b){const _0x1ece4c=a51_0x4f91;if(/^@?[a-zA-Z0-9_-]+$/[_0x1ece4c(0x11a)](_0x3e345b))return;if(/^@tdx-studio:[a-zA-Z0-9_-]+:\d+$/['test'](_0x3e345b))return;throw new Error(_0x1ece4c(0xf9)+_0x3e345b+_0x1ece4c(0x11f));}function validateProfileConfig(_0x2df987,_0x34a811){const _0x43520e=a51_0x4f91;if(typeof _0x2df987!=='object'||_0x2df987===null)throw new SDKError(ErrorCode[_0x43520e(0xff)],'Profile\x20\x27'+_0x34a811+_0x43520e(0xf5));const _0x157b30=['description',_0x43520e(0x117),_0x43520e(0x135),'parent_segment','llm_project',_0x43520e(0x11c),'user_info'],_0x30602d=_0x2df987;for(const _0x155085 of Object[_0x43520e(0xf8)](_0x30602d)){!_0x157b30[_0x43520e(0x118)](_0x155085)&&console[_0x43520e(0xf3)](_0x43520e(0xfe)+_0x34a811+_0x43520e(0x105)+_0x155085+_0x43520e(0x106));}if(_0x30602d[_0x43520e(0x101)]!==undefined&&typeof _0x30602d['description']!==_0x43520e(0xf4))throw new SDKError(ErrorCode[_0x43520e(0xff)],'Profile\x20\x27'+_0x34a811+_0x43520e(0x136));if(_0x30602d[_0x43520e(0x117)]!==undefined&&typeof _0x30602d['site']!==_0x43520e(0xf4))throw new SDKError(ErrorCode[_0x43520e(0xff)],_0x43520e(0x12f)+_0x34a811+'\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string');if(_0x30602d['database']!==undefined&&typeof _0x30602d['database']!==_0x43520e(0xf4))throw new SDKError(ErrorCode[_0x43520e(0xff)],_0x43520e(0x12f)+_0x34a811+'\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string');if(_0x30602d['parent_segment']!==undefined&&typeof _0x30602d[_0x43520e(0x11d)]!==_0x43520e(0xf4))throw new SDKError(ErrorCode[_0x43520e(0xff)],_0x43520e(0x12f)+_0x34a811+'\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string');if(_0x30602d[_0x43520e(0x134)]!==undefined&&typeof _0x30602d['llm_project']!==_0x43520e(0xf4))throw new SDKError(ErrorCode[_0x43520e(0xff)],_0x43520e(0x12f)+_0x34a811+_0x43520e(0x12e));if(_0x30602d['llm_agent']!==undefined&&typeof _0x30602d['llm_agent']!==_0x43520e(0xf4))throw new SDKError(ErrorCode[_0x43520e(0xff)],_0x43520e(0x12f)+_0x34a811+_0x43520e(0xfb));return!![];}function loadProfilesFromTdxJson(_0x109309,_0x572501){const _0x441b6a=a51_0x4f91;if(!a51_0x176d23[_0x441b6a(0x10e)](_0x109309))return[];try{const _0x11a032=a51_0x176d23['readFileSync'](_0x109309,_0x441b6a(0xfa)),_0x4f9daa=JSON[_0x441b6a(0xfc)](_0x11a032);if(!_0x4f9daa[_0x441b6a(0x108)]||typeof _0x4f9daa[_0x441b6a(0x108)]!=='object')return[];const _0x3ba36d=[];for(const [_0x3ecf6e,_0x1984bf]of Object['entries'](_0x4f9daa[_0x441b6a(0x108)])){try{validateProfileConfig(_0x1984bf,_0x3ecf6e);const _0x5e69c4=getNewCredentialPath(_0x3ecf6e),_0x4024c9=getOldCredentialPath(_0x3ecf6e),_0x4d164b=a51_0x176d23[_0x441b6a(0x10e)](_0x5e69c4)||a51_0x176d23[_0x441b6a(0x10e)](_0x4024c9);_0x3ba36d[_0x441b6a(0x12a)]({'name':_0x3ecf6e,'config':_0x1984bf,'metadata':{'name':_0x3ecf6e,'createdAt':new Date()[_0x441b6a(0x12b)]()},'hasCredentials':_0x4d164b,'scope':_0x572501});}catch(_0x487104){_0x487104 instanceof Error&&(console[_0x441b6a(0xf3)](_0x441b6a(0x107)+_0x109309+':'),console[_0x441b6a(0xf3)]('\x20\x20'+_0x487104[_0x441b6a(0x11b)]+'\x0a'));}}return _0x3ba36d;}catch(_0xb993ae){return _0xb993ae instanceof SyntaxError?(console[_0x441b6a(0xf3)]('\x0aWarning:\x20Failed\x20to\x20parse\x20'+_0x109309+_0x441b6a(0x121)),console[_0x441b6a(0xf3)](_0x441b6a(0xf7)+_0xb993ae[_0x441b6a(0x11b)]+'\x0a')):console[_0x441b6a(0xf3)]('\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20'+_0x109309+':\x20'+_0xb993ae+'\x0a'),[];}}export function getNewCredentialPath(_0x140cd7){const _0x5ca75c=a51_0x4f91;return a51_0x420cfb[_0x5ca75c(0x139)](getConfigDir(),_0x5ca75c(0x138)+_0x140cd7);}function getOldCredentialPath(_0x458cd6){const _0x46ab66=a51_0x4f91;return a51_0x420cfb[_0x46ab66(0x139)](getProfilesDir(),_0x458cd6,_0x46ab66(0x126));}function loadProfilesFromTdxJsonFiles(){const _0x5b9f2e=a51_0x4f91,_0x4a1ab8=[],_0x79ff3=findProjectConfigPath();_0x79ff3&&_0x4a1ab8[_0x5b9f2e(0x12a)](...loadProfilesFromTdxJson(_0x79ff3,'local'));const _0xf7d4cd=a51_0x420cfb[_0x5b9f2e(0x139)](getConfigDir(),_0x5b9f2e(0x137));return _0x4a1ab8['push'](...loadProfilesFromTdxJson(_0xf7d4cd,_0x5b9f2e(0x11e))),_0x4a1ab8;}function loadProfilesFromDirectories(){const _0x4529e4=a51_0x4f91,_0x23a77b=getProfilesDir();if(!a51_0x176d23[_0x4529e4(0x10e)](_0x23a77b))return[];try{return a51_0x176d23[_0x4529e4(0x124)](_0x23a77b,{'withFileTypes':!![]})[_0x4529e4(0x120)](_0x34fdaf=>_0x34fdaf['isDirectory']())[_0x4529e4(0x114)](_0x40bb76=>_0x40bb76['name'])[_0x4529e4(0x120)](_0x350966=>{const _0x29ad95=_0x4529e4,_0x4e4960=getProfileConfigPath(_0x350966),_0x548337=getProfileEnvPath(_0x350966);return a51_0x176d23[_0x29ad95(0x10e)](_0x4e4960)||a51_0x176d23[_0x29ad95(0x10e)](_0x548337);})['map'](_0x43523f=>{const _0x4401c2=loadProfileFromDirectory(_0x43523f);if(_0x4401c2)return{..._0x4401c2,'scope':'directory'};return null;})[_0x4529e4(0x120)](_0x1266c4=>_0x1266c4!==null);}catch{return[];}}function loadProfileFromDirectory(_0x5a934e){const _0x4386d8=a51_0x4f91,_0x1f09eb=getProfileConfigPath(_0x5a934e),_0x52547e=getOldCredentialPath(_0x5a934e);if(!a51_0x176d23['existsSync'](_0x1f09eb)&&!a51_0x176d23[_0x4386d8(0x10e)](_0x52547e))return null;let _0x5ab47b={},_0x3ae5d5={'name':_0x5a934e,'createdAt':new Date()[_0x4386d8(0x12b)]()};if(a51_0x176d23['existsSync'](_0x1f09eb))try{const _0x36df70=a51_0x176d23[_0x4386d8(0x10f)](_0x1f09eb,'utf-8'),_0x35a11b=JSON[_0x4386d8(0xfc)](_0x36df70),{metadata:_0x10fe3f,..._0x180e12}=_0x35a11b;_0x5ab47b=_0x180e12,_0x10fe3f&&(_0x3ae5d5=_0x10fe3f);}catch{}return{'name':_0x5a934e,'config':_0x5ab47b,'metadata':_0x3ae5d5,'hasCredentials':a51_0x176d23[_0x4386d8(0x10e)](_0x52547e),'scope':_0x4386d8(0x104)};}export function listProfiles(){const _0x46bcf4=a51_0x4f91,_0x4f4c44=loadProfilesFromTdxJsonFiles(),_0x3843f6=loadProfilesFromDirectories();if(_0x3843f6['length']>0x0){const _0x573eb2=_0x3843f6[_0x46bcf4(0x114)](_0x5e8210=>_0x5e8210[_0x46bcf4(0x10a)])[_0x46bcf4(0x139)](',\x20'),_0x4e2841=getConfigDir();console['warn']('\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20'+_0x573eb2),console[_0x46bcf4(0xf3)](_0x46bcf4(0x125)),console[_0x46bcf4(0xf3)](_0x46bcf4(0x115)+a51_0x420cfb['join'](_0x4e2841,_0x46bcf4(0x137))),console['warn'](_0x46bcf4(0x116)),console['warn']('\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a');}const _0x481a32=[..._0x4f4c44,..._0x3843f6],_0x22f63e=new Map();for(const _0x4b4f74 of _0x481a32){!_0x22f63e['has'](_0x4b4f74[_0x46bcf4(0x10a)])&&_0x22f63e[_0x46bcf4(0xfd)](_0x4b4f74['name'],_0x4b4f74);}return Array[_0x46bcf4(0x12d)](_0x22f63e[_0x46bcf4(0x100)]())[_0x46bcf4(0x10b)]((_0xfd5697,_0x314f9c)=>_0xfd5697[_0x46bcf4(0x10a)][_0x46bcf4(0x110)](_0x314f9c[_0x46bcf4(0x10a)]));}export function profileExists(_0x28c6d1){const _0x4b3d6a=a51_0x4f91,_0x2a5724=listProfiles();return _0x2a5724['some'](_0x564615=>_0x564615[_0x4b3d6a(0x10a)]===_0x28c6d1);}export function loadProfile(_0x28448d){const _0x26c4e0=a51_0x4f91;validateProfileName(_0x28448d);const _0x39077f=listProfiles(),_0x174844=_0x39077f[_0x26c4e0(0x13a)](_0x2ee50a=>_0x2ee50a[_0x26c4e0(0x10a)]===_0x28448d);return _0x174844||null;}export function saveProfile(_0x1c58b0,_0x25dd31,_0xe33eb9=![]){saveProfileToUserConfig(_0x1c58b0,_0x25dd31);}export function deleteProfile(_0x522fd9){const _0x8e9f27=a51_0x4f91;validateProfileName(_0x522fd9);const _0x4f5703=getProfileDir(_0x522fd9);if(!a51_0x176d23[_0x8e9f27(0x10e)](_0x4f5703))throw new Error(_0x8e9f27(0x111)+_0x522fd9+_0x8e9f27(0x127));a51_0x176d23[_0x8e9f27(0x103)](_0x4f5703,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x16e53a,_0x1472c3){const _0x1b4c19=a51_0x4f91;validateProfileName(_0x16e53a);const _0x1d98d4=getGlobalConfigPath(),_0x21ee1=getConfigDir();!a51_0x176d23[_0x1b4c19(0x10e)](_0x21ee1)&&createSecureDirectory(_0x21ee1);let _0x4be211={};if(a51_0x176d23[_0x1b4c19(0x10e)](_0x1d98d4))try{const _0x28e61b=a51_0x176d23[_0x1b4c19(0x10f)](_0x1d98d4,_0x1b4c19(0xfa));_0x4be211=JSON[_0x1b4c19(0xfc)](_0x28e61b);}catch{console[_0x1b4c19(0xf3)](_0x1b4c19(0x12c)+_0x1d98d4+_0x1b4c19(0xf2));}!_0x4be211[_0x1b4c19(0x108)]&&(_0x4be211[_0x1b4c19(0x108)]={}),_0x4be211[_0x1b4c19(0x108)][_0x16e53a]=_0x1472c3,writeSecureFile(_0x1d98d4,JSON[_0x1b4c19(0x122)](_0x4be211,null,0x2));}export function removeProfileFromUserConfig(_0x3be3c3){const _0x27496e=a51_0x4f91;validateProfileName(_0x3be3c3);const _0x4131a2=getGlobalConfigPath();if(!a51_0x176d23['existsSync'](_0x4131a2))throw new Error(_0x27496e(0x12f)+_0x3be3c3+_0x27496e(0x123));let _0x2acced={};try{const _0x1c82a0=a51_0x176d23[_0x27496e(0x10f)](_0x4131a2,_0x27496e(0xfa));_0x2acced=JSON[_0x27496e(0xfc)](_0x1c82a0);}catch{throw new Error(_0x27496e(0x128)+_0x4131a2);}if(!_0x2acced['profiles']||!_0x2acced[_0x27496e(0x108)][_0x3be3c3])throw new Error(_0x27496e(0x12f)+_0x3be3c3+_0x27496e(0x123));delete _0x2acced['profiles'][_0x3be3c3],_0x2acced['profile']===_0x3be3c3&&delete _0x2acced[_0x27496e(0xf6)],writeSecureFile(_0x4131a2,JSON[_0x27496e(0x122)](_0x2acced,null,0x2));}export function getActiveProfile(){const _0x22d623=a51_0x4f91,_0x4475f4=loadSessionContext();if(_0x4475f4?.[_0x22d623(0xf6)])return _0x4475f4[_0x22d623(0xf6)];if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x10942b=getGlobalConfigPath();if(!a51_0x176d23[_0x22d623(0x10e)](_0x10942b))return null;try{const _0x354814=a51_0x176d23['readFileSync'](_0x10942b,_0x22d623(0xfa)),_0x3da8c4=JSON[_0x22d623(0xfc)](_0x354814);return _0x3da8c4['profile']||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x293231){const _0x2ab117=a51_0x4f91,_0x4ac1db=getGlobalConfigPath(),_0x54bbd6=getConfigDir();!a51_0x176d23[_0x2ab117(0x10e)](_0x54bbd6)&&createSecureDirectory(_0x54bbd6);let _0xdfa284={};if(a51_0x176d23[_0x2ab117(0x10e)](_0x4ac1db))try{const _0x448147=a51_0x176d23[_0x2ab117(0x10f)](_0x4ac1db,_0x2ab117(0xfa));_0xdfa284=JSON[_0x2ab117(0xfc)](_0x448147);}catch{console[_0x2ab117(0xf3)](_0x2ab117(0x12c)+_0x4ac1db+',\x20creating\x20new\x20file');}_0xdfa284[_0x2ab117(0x117)]=_0x293231,writeSecureFile(_0x4ac1db,JSON[_0x2ab117(0x122)](_0xdfa284,null,0x2));}export function saveActiveProfileToUserConfig(_0x264aa2){const _0x4c5d55=a51_0x4f91;validateProfileName(_0x264aa2);const _0x433835=getGlobalConfigPath(),_0x45cc93=getConfigDir();!a51_0x176d23[_0x4c5d55(0x10e)](_0x45cc93)&&createSecureDirectory(_0x45cc93);let _0x3de928={};if(a51_0x176d23[_0x4c5d55(0x10e)](_0x433835))try{const _0x2a3329=a51_0x176d23['readFileSync'](_0x433835,_0x4c5d55(0xfa));_0x3de928=JSON[_0x4c5d55(0xfc)](_0x2a3329);}catch{console['warn']('Warning:\x20Failed\x20to\x20parse\x20'+_0x433835+_0x4c5d55(0xf2));}_0x3de928[_0x4c5d55(0xf6)]=_0x264aa2,writeSecureFile(_0x433835,JSON['stringify'](_0x3de928,null,0x2));}function clearFieldFromUserConfig(_0x266b4f){const _0x245cff=a51_0x4f91,_0x5e0738=getGlobalConfigPath();if(!a51_0x176d23[_0x245cff(0x10e)](_0x5e0738))return;let _0x1ac012={};try{const _0x58c0f0=a51_0x176d23['readFileSync'](_0x5e0738,_0x245cff(0xfa));_0x1ac012=JSON[_0x245cff(0xfc)](_0x58c0f0);}catch{return;}delete _0x1ac012[_0x266b4f],writeSecureFile(_0x5e0738,JSON[_0x245cff(0x122)](_0x1ac012,null,0x2));}export function clearDefaultSiteFromUserConfig(){const _0x1431e8=a51_0x4f91;clearFieldFromUserConfig(_0x1431e8(0x117));}export function clearActiveProfileFromUserConfig(){const _0x4949d3=a51_0x4f91;clearFieldFromUserConfig(_0x4949d3(0xf6));}export function createProfile(_0x2c1218,_0x1f7707){const _0x2a95a8=a51_0x4f91;validateProfileName(_0x2c1218);if(profileExists(_0x2c1218))throw new Error(_0x2a95a8(0x111)+_0x2c1218+_0x2a95a8(0x131));saveProfile(_0x2c1218,_0x1f7707);}export function saveProfileCredentials(_0x3b1d86,_0x7e7ed7){const _0x198bd8=a51_0x4f91;validateProfileName(_0x3b1d86);if(!profileExists(_0x3b1d86))throw new Error(_0x198bd8(0x111)+_0x3b1d86+_0x198bd8(0x127));const _0x549e61=getNewCredentialPath(_0x3b1d86);writeSecureFile(_0x549e61,_0x7e7ed7);}export function loadProfileCredentials(_0x21b127){const _0x6199c0=a51_0x4f91;validateProfileName(_0x21b127);const _0x1a1e07=getNewCredentialPath(_0x21b127);if(a51_0x176d23['existsSync'](_0x1a1e07))try{return a51_0x176d23[_0x6199c0(0x10f)](_0x1a1e07,_0x6199c0(0xfa));}catch{}const _0x43f58d=getOldCredentialPath(_0x21b127);if(a51_0x176d23[_0x6199c0(0x10e)](_0x43f58d)){console[_0x6199c0(0xf3)](_0x6199c0(0x112)+_0x21b127+'\x27'),console[_0x6199c0(0xf3)]('To\x20migrate:'),console[_0x6199c0(0xf3)]('\x20\x20mv\x20\x22'+_0x43f58d+_0x6199c0(0x129)+_0x1a1e07+'\x22'),console['warn']('Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a');try{return a51_0x176d23['readFileSync'](_0x43f58d,_0x6199c0(0xfa));}catch{return null;}}return null;}
1
+ (function(_0x1e64b7,_0x40100d){const _0x1fe0b0=a51_0x3c0f,_0x4d6400=_0x1e64b7();while(!![]){try{const _0xa32118=parseInt(_0x1fe0b0(0x16b))/0x1+parseInt(_0x1fe0b0(0x18c))/0x2*(parseInt(_0x1fe0b0(0x180))/0x3)+parseInt(_0x1fe0b0(0x151))/0x4*(-parseInt(_0x1fe0b0(0x187))/0x5)+-parseInt(_0x1fe0b0(0x185))/0x6*(parseInt(_0x1fe0b0(0x17f))/0x7)+parseInt(_0x1fe0b0(0x15f))/0x8+-parseInt(_0x1fe0b0(0x176))/0x9+parseInt(_0x1fe0b0(0x188))/0xa;if(_0xa32118===_0x40100d)break;else _0x4d6400['push'](_0x4d6400['shift']());}catch(_0x777714){_0x4d6400['push'](_0x4d6400['shift']());}}}(a51_0x4fe6,0xd87ca));import*as a51_0x593b85 from'node:fs';import*as a51_0x5e329d from'node:path';import{SDKError,ErrorCode}from'../sdk/errors.js';import{getConfigDir}from'./config.js';import{createSecureDirectory,writeSecureFile}from'../utils/file-permissions.js';import{findProjectConfigPath}from'./project-config.js';import{loadSessionContext}from'./session.js';export const STUDIO_PROFILE_NAME='@tdx-studio';export function getProfileParams(_0x5149da){const _0x390982={};if(!_0x5149da)return _0x390982;for(const [_0x536b54,_0x1b3eef]of Object['entries'](_0x5149da)){_0x536b54!=='description'&&_0x1b3eef!==undefined&&(_0x390982[_0x536b54]=_0x1b3eef);}return _0x390982;}export function getProfilesDir(){const _0x2ece78=a51_0x3c0f;return a51_0x5e329d[_0x2ece78(0x158)](getConfigDir(),'profiles');}function getProfileDir(_0x521b5d){return a51_0x5e329d['join'](getProfilesDir(),_0x521b5d);}function getProfileConfigPath(_0x4e335b){const _0x1e0df0=a51_0x3c0f;return a51_0x5e329d[_0x1e0df0(0x158)](getProfileDir(_0x4e335b),_0x1e0df0(0x177));}function getProfileEnvPath(_0xb76a1){return a51_0x5e329d['join'](getProfileDir(_0xb76a1),'.env');}function getGlobalConfigPath(){const _0x15223a=a51_0x3c0f;return a51_0x5e329d['join'](getConfigDir(),_0x15223a(0x177));}function validateProfileName(_0x3e87c1){const _0xe2548b=a51_0x3c0f;if(/^@?[a-zA-Z0-9_-]+$/['test'](_0x3e87c1))return;if(/^@tdx-studio:[a-zA-Z0-9_-]+:\d+$/[_0xe2548b(0x181)](_0x3e87c1))return;throw new Error('Invalid\x20profile\x20name:\x20'+_0x3e87c1+'.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20underscore,\x20and\x20optional\x20@\x20prefix\x20for\x20reserved\x20profiles.');}function validateProfileConfig(_0x2eacb7,_0x5be5e9){const _0x51494d=a51_0x3c0f;if(typeof _0x2eacb7!==_0x51494d(0x190)||_0x2eacb7===null)throw new SDKError(ErrorCode[_0x51494d(0x17c)],_0x51494d(0x18b)+_0x5be5e9+'\x27:\x20config\x20must\x20be\x20an\x20object');const _0x2adb87=['description',_0x51494d(0x195),_0x51494d(0x18f),'parent_segment',_0x51494d(0x15c),_0x51494d(0x168),_0x51494d(0x197)],_0x579ea7=_0x2eacb7;for(const _0x52ebd0 of Object[_0x51494d(0x192)](_0x579ea7)){!_0x2adb87[_0x51494d(0x160)](_0x52ebd0)&&console[_0x51494d(0x167)](_0x51494d(0x16f)+_0x5be5e9+_0x51494d(0x172)+_0x52ebd0+'\x27\x20will\x20be\x20ignored');}if(_0x579ea7[_0x51494d(0x16d)]!==undefined&&typeof _0x579ea7[_0x51494d(0x16d)]!==_0x51494d(0x171))throw new SDKError(ErrorCode[_0x51494d(0x17c)],_0x51494d(0x18b)+_0x5be5e9+'\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string');if(_0x579ea7[_0x51494d(0x195)]!==undefined&&typeof _0x579ea7[_0x51494d(0x195)]!=='string')throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0x51494d(0x18b)+_0x5be5e9+_0x51494d(0x179));if(_0x579ea7['database']!==undefined&&typeof _0x579ea7[_0x51494d(0x18f)]!==_0x51494d(0x171))throw new SDKError(ErrorCode[_0x51494d(0x17c)],_0x51494d(0x18b)+_0x5be5e9+_0x51494d(0x150));if(_0x579ea7['parent_segment']!==undefined&&typeof _0x579ea7['parent_segment']!==_0x51494d(0x171))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0x51494d(0x18b)+_0x5be5e9+_0x51494d(0x17d));if(_0x579ea7['llm_project']!==undefined&&typeof _0x579ea7[_0x51494d(0x15c)]!==_0x51494d(0x171))throw new SDKError(ErrorCode[_0x51494d(0x17c)],_0x51494d(0x18b)+_0x5be5e9+'\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string');if(_0x579ea7[_0x51494d(0x168)]!==undefined&&typeof _0x579ea7[_0x51494d(0x168)]!==_0x51494d(0x171))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0x51494d(0x18b)+_0x5be5e9+_0x51494d(0x166));return!![];}function loadProfilesFromTdxJson(_0x54235b,_0x5f0dc5){const _0x5ae45b=a51_0x3c0f;if(!a51_0x593b85[_0x5ae45b(0x15b)](_0x54235b))return[];try{const _0x4c750a=a51_0x593b85['readFileSync'](_0x54235b,'utf-8'),_0x9a7066=JSON[_0x5ae45b(0x153)](_0x4c750a);if(!_0x9a7066[_0x5ae45b(0x170)]||typeof _0x9a7066[_0x5ae45b(0x170)]!==_0x5ae45b(0x190))return[];const _0xde4d04=[];for(const [_0x40f274,_0x2ceede]of Object[_0x5ae45b(0x165)](_0x9a7066['profiles'])){try{validateProfileConfig(_0x2ceede,_0x40f274);const _0x2d6941=getNewCredentialPath(_0x40f274),_0x379622=getOldCredentialPath(_0x40f274),_0x3a81ae=a51_0x593b85['existsSync'](_0x2d6941)||a51_0x593b85[_0x5ae45b(0x15b)](_0x379622);_0xde4d04[_0x5ae45b(0x169)]({'name':_0x40f274,'config':_0x2ceede,'metadata':{'name':_0x40f274,'createdAt':new Date()['toISOString']()},'hasCredentials':_0x3a81ae,'scope':_0x5f0dc5});}catch(_0x39f947){_0x39f947 instanceof Error&&(console[_0x5ae45b(0x167)](_0x5ae45b(0x163)+_0x54235b+':'),console[_0x5ae45b(0x167)]('\x20\x20'+_0x39f947[_0x5ae45b(0x161)]+'\x0a'));}}return _0xde4d04;}catch(_0x1b358a){return _0x1b358a instanceof SyntaxError?(console[_0x5ae45b(0x167)](_0x5ae45b(0x16c)+_0x54235b+_0x5ae45b(0x18a)),console[_0x5ae45b(0x167)](_0x5ae45b(0x18d)+_0x1b358a['message']+'\x0a')):console['warn'](_0x5ae45b(0x15a)+_0x54235b+':\x20'+_0x1b358a+'\x0a'),[];}}export function getNewCredentialPath(_0x44118d){const _0x526e58=a51_0x3c0f;return a51_0x5e329d[_0x526e58(0x158)](getConfigDir(),'.env.'+_0x44118d);}function getOldCredentialPath(_0x5a5fa2){const _0x538a8e=a51_0x3c0f;return a51_0x5e329d[_0x538a8e(0x158)](getProfilesDir(),_0x5a5fa2,'.env');}function loadProfilesFromTdxJsonFiles(){const _0x12dda7=a51_0x3c0f,_0xb059f7=[],_0x1bd1e2=findProjectConfigPath();_0x1bd1e2&&_0xb059f7[_0x12dda7(0x169)](...loadProfilesFromTdxJson(_0x1bd1e2,'local'));const _0xd781ae=a51_0x5e329d[_0x12dda7(0x158)](getConfigDir(),_0x12dda7(0x177));return _0xb059f7[_0x12dda7(0x169)](...loadProfilesFromTdxJson(_0xd781ae,_0x12dda7(0x156))),_0xb059f7;}function loadProfilesFromDirectories(){const _0x5ae0d3=a51_0x3c0f,_0x28a0d1=getProfilesDir();if(!a51_0x593b85[_0x5ae0d3(0x15b)](_0x28a0d1))return[];try{return a51_0x593b85[_0x5ae0d3(0x193)](_0x28a0d1,{'withFileTypes':!![]})[_0x5ae0d3(0x178)](_0x24b466=>_0x24b466['isDirectory']())[_0x5ae0d3(0x184)](_0x3402ab=>_0x3402ab['name'])[_0x5ae0d3(0x178)](_0x366f43=>{const _0x3a2844=_0x5ae0d3,_0x3d71ca=getProfileConfigPath(_0x366f43),_0x563e0f=getProfileEnvPath(_0x366f43);return a51_0x593b85[_0x3a2844(0x15b)](_0x3d71ca)||a51_0x593b85[_0x3a2844(0x15b)](_0x563e0f);})['map'](_0xe36e63=>{const _0x408171=_0x5ae0d3,_0x195636=loadProfileFromDirectory(_0xe36e63);if(_0x195636)return{..._0x195636,'scope':_0x408171(0x196)};return null;})['filter'](_0x5a7d16=>_0x5a7d16!==null);}catch{return[];}}function loadProfileFromDirectory(_0x1ecde0){const _0x2ffeba=a51_0x3c0f,_0x27919e=getProfileConfigPath(_0x1ecde0),_0x35ef22=getOldCredentialPath(_0x1ecde0);if(!a51_0x593b85[_0x2ffeba(0x15b)](_0x27919e)&&!a51_0x593b85[_0x2ffeba(0x15b)](_0x35ef22))return null;let _0x27f8d1={},_0xdd92c3={'name':_0x1ecde0,'createdAt':new Date()['toISOString']()};if(a51_0x593b85[_0x2ffeba(0x15b)](_0x27919e))try{const _0x130719=a51_0x593b85['readFileSync'](_0x27919e,_0x2ffeba(0x17a)),_0x15e38a=JSON[_0x2ffeba(0x153)](_0x130719),{metadata:_0x418b6c,..._0x3a7c6a}=_0x15e38a;_0x27f8d1=_0x3a7c6a,_0x418b6c&&(_0xdd92c3=_0x418b6c);}catch{}return{'name':_0x1ecde0,'config':_0x27f8d1,'metadata':_0xdd92c3,'hasCredentials':a51_0x593b85[_0x2ffeba(0x15b)](_0x35ef22),'scope':_0x2ffeba(0x196)};}export function listProfiles(){const _0x324a1e=a51_0x3c0f,_0x16ceb5=loadProfilesFromTdxJsonFiles(),_0x12b0b5=loadProfilesFromDirectories();if(_0x12b0b5[_0x324a1e(0x17e)]>0x0){const _0x41fbca=_0x12b0b5[_0x324a1e(0x184)](_0x3e6e3a=>_0x3e6e3a[_0x324a1e(0x175)])[_0x324a1e(0x158)](',\x20'),_0x256bd6=getConfigDir();console['warn'](_0x324a1e(0x189)+_0x41fbca),console[_0x324a1e(0x167)](_0x324a1e(0x182)),console[_0x324a1e(0x167)](_0x324a1e(0x159)+a51_0x5e329d[_0x324a1e(0x158)](_0x256bd6,_0x324a1e(0x177))),console['warn']('\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)'),console[_0x324a1e(0x167)](_0x324a1e(0x15e));}const _0x31536d=[..._0x16ceb5,..._0x12b0b5],_0xa09d10=new Map();for(const _0x55771d of _0x31536d){!_0xa09d10[_0x324a1e(0x186)](_0x55771d[_0x324a1e(0x175)])&&_0xa09d10['set'](_0x55771d[_0x324a1e(0x175)],_0x55771d);}return Array[_0x324a1e(0x14f)](_0xa09d10[_0x324a1e(0x16a)]())[_0x324a1e(0x152)]((_0x2e203a,_0x5dcbfc)=>_0x2e203a[_0x324a1e(0x175)][_0x324a1e(0x162)](_0x5dcbfc[_0x324a1e(0x175)]));}export function profileExists(_0x1541fa){const _0x171c9e=a51_0x3c0f,_0x18f5dc=listProfiles();return _0x18f5dc[_0x171c9e(0x198)](_0x53c6e6=>_0x53c6e6[_0x171c9e(0x175)]===_0x1541fa);}export function loadProfile(_0x3e4b96){const _0x487017=a51_0x3c0f;validateProfileName(_0x3e4b96);const _0x2beb32=listProfiles(),_0x1ea6fa=_0x2beb32[_0x487017(0x154)](_0x1e2182=>_0x1e2182[_0x487017(0x175)]===_0x3e4b96);return _0x1ea6fa||null;}export function saveProfile(_0x50a9d1,_0x2283f1,_0xaedb80=![]){saveProfileToUserConfig(_0x50a9d1,_0x2283f1);}export function deleteProfile(_0x37942c){const _0x52f7c0=a51_0x3c0f;validateProfileName(_0x37942c);const _0x1fae02=getProfileDir(_0x37942c);if(!a51_0x593b85['existsSync'](_0x1fae02))throw new Error(_0x52f7c0(0x194)+_0x37942c+'\x20does\x20not\x20exist');a51_0x593b85[_0x52f7c0(0x191)](_0x1fae02,{'recursive':!![],'force':!![]});}function a51_0x3c0f(_0x27576a,_0x45564d){_0x27576a=_0x27576a-0x14f;const _0x4fe615=a51_0x4fe6();let _0x3c0f0b=_0x4fe615[_0x27576a];return _0x3c0f0b;}export function saveProfileToUserConfig(_0x4d0a95,_0xbb907){const _0x1c74e6=a51_0x3c0f;validateProfileName(_0x4d0a95);const _0x300ed1=getGlobalConfigPath(),_0xf3794e=getConfigDir();!a51_0x593b85[_0x1c74e6(0x15b)](_0xf3794e)&&createSecureDirectory(_0xf3794e);let _0x153b23={};if(a51_0x593b85[_0x1c74e6(0x15b)](_0x300ed1))try{const _0x1360fb=a51_0x593b85[_0x1c74e6(0x15d)](_0x300ed1,_0x1c74e6(0x17a));_0x153b23=JSON[_0x1c74e6(0x153)](_0x1360fb);}catch{console['warn']('Warning:\x20Failed\x20to\x20parse\x20'+_0x300ed1+_0x1c74e6(0x16e));}!_0x153b23[_0x1c74e6(0x170)]&&(_0x153b23[_0x1c74e6(0x170)]={}),_0x153b23['profiles'][_0x4d0a95]=_0xbb907,writeSecureFile(_0x300ed1,JSON['stringify'](_0x153b23,null,0x2));}function a51_0x4fe6(){const _0x18bc1a=['test','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','\x27\x20not\x20found\x20in\x20user\x20configuration','map','8151018jZkmiK','has','4365TFXyFF','4227000kvqnmj','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20',':\x20Invalid\x20JSON\x20syntax','Profile\x20\x27','4OVoAyi','Error:\x20','\x20\x20mv\x20\x22','database','object','rmSync','keys','readdirSync','Profile\x20','site','directory','user_info','some','from','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','12pEyBDK','sort','parse','find','Warning:\x20Failed\x20to\x20parse\x20','user','profile','join','\x20\x201.\x20Edit:\x20','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','existsSync','llm_project','readFileSync','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','9739096GtvxUm','includes','message','localeCompare','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','To\x20migrate:','entries','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','warn','llm_agent','push','values','1231885kCebgy','\x0aWarning:\x20Failed\x20to\x20parse\x20','description',',\x20creating\x20new\x20file','Warning:\x20Profile\x20\x27','profiles','string','\x27:\x20unknown\x20config\x20key\x20\x27','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','\x20already\x20exists','name','12767202DeEzJb','tdx.json','filter','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','utf-8','stringify','INVALID_PROFILE_CONFIG','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','length','7rzFhbT','1191687IjUlrC'];a51_0x4fe6=function(){return _0x18bc1a;};return a51_0x4fe6();}export function removeProfileFromUserConfig(_0xece101){const _0x36699f=a51_0x3c0f;validateProfileName(_0xece101);const _0x127e86=getGlobalConfigPath();if(!a51_0x593b85[_0x36699f(0x15b)](_0x127e86))throw new Error(_0x36699f(0x18b)+_0xece101+_0x36699f(0x183));let _0x114f4d={};try{const _0x1b28c6=a51_0x593b85['readFileSync'](_0x127e86,_0x36699f(0x17a));_0x114f4d=JSON[_0x36699f(0x153)](_0x1b28c6);}catch{throw new Error('Failed\x20to\x20parse\x20'+_0x127e86);}if(!_0x114f4d[_0x36699f(0x170)]||!_0x114f4d[_0x36699f(0x170)][_0xece101])throw new Error(_0x36699f(0x18b)+_0xece101+_0x36699f(0x183));delete _0x114f4d[_0x36699f(0x170)][_0xece101],_0x114f4d[_0x36699f(0x157)]===_0xece101&&delete _0x114f4d[_0x36699f(0x157)],writeSecureFile(_0x127e86,JSON[_0x36699f(0x17b)](_0x114f4d,null,0x2));}export function getActiveProfile(){const _0x16a5f0=a51_0x3c0f,_0x4f35e7=loadSessionContext();if(_0x4f35e7?.[_0x16a5f0(0x157)])return _0x4f35e7[_0x16a5f0(0x157)];if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x50c3fe=getGlobalConfigPath();if(!a51_0x593b85[_0x16a5f0(0x15b)](_0x50c3fe))return null;try{const _0x43bf3e=a51_0x593b85['readFileSync'](_0x50c3fe,'utf-8'),_0x1f5f85=JSON[_0x16a5f0(0x153)](_0x43bf3e);return _0x1f5f85['profile']||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x4d1b6b){const _0x1997d4=a51_0x3c0f,_0x50a647=getGlobalConfigPath(),_0xd5477a=getConfigDir();!a51_0x593b85[_0x1997d4(0x15b)](_0xd5477a)&&createSecureDirectory(_0xd5477a);let _0x2717d7={};if(a51_0x593b85[_0x1997d4(0x15b)](_0x50a647))try{const _0x30a902=a51_0x593b85[_0x1997d4(0x15d)](_0x50a647,_0x1997d4(0x17a));_0x2717d7=JSON[_0x1997d4(0x153)](_0x30a902);}catch{console[_0x1997d4(0x167)](_0x1997d4(0x155)+_0x50a647+_0x1997d4(0x16e));}_0x2717d7[_0x1997d4(0x195)]=_0x4d1b6b,writeSecureFile(_0x50a647,JSON[_0x1997d4(0x17b)](_0x2717d7,null,0x2));}export function saveActiveProfileToUserConfig(_0x156b34){const _0xd6a795=a51_0x3c0f;validateProfileName(_0x156b34);const _0x2af29d=getGlobalConfigPath(),_0x3efe83=getConfigDir();!a51_0x593b85[_0xd6a795(0x15b)](_0x3efe83)&&createSecureDirectory(_0x3efe83);let _0x147efa={};if(a51_0x593b85[_0xd6a795(0x15b)](_0x2af29d))try{const _0x2c68ab=a51_0x593b85[_0xd6a795(0x15d)](_0x2af29d,_0xd6a795(0x17a));_0x147efa=JSON[_0xd6a795(0x153)](_0x2c68ab);}catch{console['warn'](_0xd6a795(0x155)+_0x2af29d+_0xd6a795(0x16e));}_0x147efa[_0xd6a795(0x157)]=_0x156b34,writeSecureFile(_0x2af29d,JSON[_0xd6a795(0x17b)](_0x147efa,null,0x2));}function clearFieldFromUserConfig(_0x3fa70e){const _0x1ba221=a51_0x3c0f,_0xba7e3a=getGlobalConfigPath();if(!a51_0x593b85['existsSync'](_0xba7e3a))return;let _0xe684af={};try{const _0x9f7e66=a51_0x593b85[_0x1ba221(0x15d)](_0xba7e3a,_0x1ba221(0x17a));_0xe684af=JSON['parse'](_0x9f7e66);}catch{return;}delete _0xe684af[_0x3fa70e],writeSecureFile(_0xba7e3a,JSON[_0x1ba221(0x17b)](_0xe684af,null,0x2));}export function clearDefaultSiteFromUserConfig(){const _0x6d6628=a51_0x3c0f;clearFieldFromUserConfig(_0x6d6628(0x195));}export function clearActiveProfileFromUserConfig(){clearFieldFromUserConfig('profile');}export function createProfile(_0x46f65c,_0x57206a){const _0xa13da2=a51_0x3c0f;validateProfileName(_0x46f65c);if(profileExists(_0x46f65c))throw new Error(_0xa13da2(0x194)+_0x46f65c+_0xa13da2(0x174));saveProfile(_0x46f65c,_0x57206a);}export function saveProfileCredentials(_0x3706dc,_0x4e9da8){const _0xe5a65f=a51_0x3c0f;validateProfileName(_0x3706dc);if(!profileExists(_0x3706dc))throw new Error(_0xe5a65f(0x194)+_0x3706dc+'\x20does\x20not\x20exist');const _0x560146=getNewCredentialPath(_0x3706dc);writeSecureFile(_0x560146,_0x4e9da8);}export function loadProfileCredentials(_0x49a5e2){const _0x1ff61e=a51_0x3c0f;validateProfileName(_0x49a5e2);const _0x48d14b=getNewCredentialPath(_0x49a5e2);if(a51_0x593b85[_0x1ff61e(0x15b)](_0x48d14b))try{return a51_0x593b85[_0x1ff61e(0x15d)](_0x48d14b,_0x1ff61e(0x17a));}catch{}const _0x1f8f42=getOldCredentialPath(_0x49a5e2);if(a51_0x593b85[_0x1ff61e(0x15b)](_0x1f8f42)){console['warn']('\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27'+_0x49a5e2+'\x27'),console[_0x1ff61e(0x167)](_0x1ff61e(0x164)),console[_0x1ff61e(0x167)](_0x1ff61e(0x18e)+_0x1f8f42+'\x22\x20\x22'+_0x48d14b+'\x22'),console[_0x1ff61e(0x167)](_0x1ff61e(0x173));try{return a51_0x593b85[_0x1ff61e(0x15d)](_0x1f8f42,'utf-8');}catch{return null;}}return null;}
@@ -1 +1 @@
1
- (function(_0x4a9747,_0x26af52){const _0x1006cc=a52_0x12b7,_0x56c82a=_0x4a9747();while(!![]){try{const _0x57808f=parseInt(_0x1006cc(0xba))/0x1+parseInt(_0x1006cc(0xb9))/0x2+parseInt(_0x1006cc(0xbf))/0x3+parseInt(_0x1006cc(0xab))/0x4*(parseInt(_0x1006cc(0xb1))/0x5)+-parseInt(_0x1006cc(0xb8))/0x6*(parseInt(_0x1006cc(0xa9))/0x7)+parseInt(_0x1006cc(0xb5))/0x8+-parseInt(_0x1006cc(0xaf))/0x9*(parseInt(_0x1006cc(0xb4))/0xa);if(_0x57808f===_0x26af52)break;else _0x56c82a['push'](_0x56c82a['shift']());}catch(_0xff7bab){_0x56c82a['push'](_0x56c82a['shift']());}}}(a52_0x1a32,0x8faf7));function a52_0x12b7(_0x11d0ee,_0x82f82e){_0x11d0ee=_0x11d0ee-0xa5;const _0x1a32e6=a52_0x1a32();let _0x12b7a6=_0x1a32e6[_0x11d0ee];return _0x12b7a6;}import*as a52_0x288746 from'node:fs';import*as a52_0x4f8632 from'node:path';function a52_0x1a32(){const _0x5149fe=['2347608kxETMH','873200zsVLJS','existsSync','apiKey','ENOENT','TD_API_KEY','2578974rYalRx','stringify','includes','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','profile','join','7FaFOLl','parse','28324joFokN','warn','dirname','readFileSync','10779894OUBVWu','cwd','475eVgSuL','Warning:\x20\x27profile\x27\x20field\x20in\x20','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','20hJZmtk','1478048NQBplk','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','code','4680276bsWGGl'];a52_0x1a32=function(){return _0x5149fe;};return a52_0x1a32();}const PROJECT_CONFIG_FILENAME='tdx.json';export function findProjectConfigPath(_0x51f1b8){const _0x3656d0=a52_0x12b7;let _0x46e40c=_0x51f1b8||process['cwd']();while(!![]){const _0x4ebb80=a52_0x4f8632[_0x3656d0(0xa8)](_0x46e40c,PROJECT_CONFIG_FILENAME);if(a52_0x288746[_0x3656d0(0xbb)](_0x4ebb80))return _0x4ebb80;const _0x4a9f75=a52_0x4f8632[_0x3656d0(0xad)](_0x46e40c);if(_0x4a9f75===_0x46e40c)return null;_0x46e40c=_0x4a9f75;}}export function loadProjectConfig(_0x46c21a){const _0x2b4d8e=a52_0x12b7,_0x22ebe6=findProjectConfigPath(_0x46c21a);if(!_0x22ebe6)return null;try{const _0x3a8e22=a52_0x288746[_0x2b4d8e(0xae)](_0x22ebe6,'utf-8'),_0x4cd489=JSON[_0x2b4d8e(0xaa)](_0x3a8e22),_0x14cfdb=JSON[_0x2b4d8e(0xc0)](_0x4cd489);if(_0x14cfdb[_0x2b4d8e(0xa5)](_0x2b4d8e(0xbe))||_0x14cfdb[_0x2b4d8e(0xa5)]('apiKey')||_0x14cfdb[_0x2b4d8e(0xa5)]('api_key'))throw new Error(_0x2b4d8e(0xb6)+_0x22ebe6+').\x20'+'Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.');const {metadata:_0x4393e3,profile:_0x1b252f,..._0x4caf87}=_0x4cd489;return _0x1b252f&&console[_0x2b4d8e(0xac)](_0x2b4d8e(0xb2)+_0x22ebe6+'\x20is\x20ignored.\x20'+_0x2b4d8e(0xb3)),_0x4caf87;}catch(_0x2913c6){if(_0x2913c6 instanceof Error&&_0x2b4d8e(0xb7)in _0x2913c6&&_0x2913c6[_0x2b4d8e(0xb7)]===_0x2b4d8e(0xbd))return null;throw new Error('Failed\x20to\x20load\x20project\x20config\x20from\x20'+_0x22ebe6+':\x20'+_0x2913c6);}}export function saveProjectConfig(_0x5a8afa,_0x340c06){const _0x35d174=a52_0x12b7,_0x54f3f5=_0x340c06||process[_0x35d174(0xb0)](),_0x25ea76=a52_0x4f8632['join'](_0x54f3f5,PROJECT_CONFIG_FILENAME),_0xd81904=JSON[_0x35d174(0xc0)](_0x5a8afa);if(_0xd81904[_0x35d174(0xa5)]('TD_API_KEY')||_0xd81904[_0x35d174(0xa5)](_0x35d174(0xbc))||_0xd81904['includes']('api_key'))throw new Error(_0x35d174(0xa6));if(_0x35d174(0xa7)in _0x5a8afa)throw new Error('\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.');a52_0x288746['writeFileSync'](_0x25ea76,JSON[_0x35d174(0xc0)](_0x5a8afa,null,0x2));}export function hasProjectConfig(_0x231b96){return findProjectConfigPath(_0x231b96)!==null;}export function getProjectRoot(_0x314d7a){const _0x260d5b=a52_0x12b7,_0x20f056=findProjectConfigPath(_0x314d7a);return _0x20f056?a52_0x4f8632[_0x260d5b(0xad)](_0x20f056):null;}
1
+ (function(_0x408410,_0xeb1d2a){const _0x135134=a52_0x2e12,_0x5858c6=_0x408410();while(!![]){try{const _0x145ca7=-parseInt(_0x135134(0x83))/0x1+parseInt(_0x135134(0x80))/0x2*(-parseInt(_0x135134(0x8d))/0x3)+-parseInt(_0x135134(0x77))/0x4*(parseInt(_0x135134(0x6f))/0x5)+-parseInt(_0x135134(0x71))/0x6+-parseInt(_0x135134(0x75))/0x7+parseInt(_0x135134(0x82))/0x8*(-parseInt(_0x135134(0x7d))/0x9)+parseInt(_0x135134(0x73))/0xa;if(_0x145ca7===_0xeb1d2a)break;else _0x5858c6['push'](_0x5858c6['shift']());}catch(_0x4c8636){_0x5858c6['push'](_0x5858c6['shift']());}}}(a52_0x5a0b,0xda167));import*as a52_0x4bd245 from'node:fs';import*as a52_0x2e5bba from'node:path';const PROJECT_CONFIG_FILENAME='tdx.json';export function findProjectConfigPath(_0x38a60d){const _0x39303b=a52_0x2e12;let _0x2593d5=_0x38a60d||process[_0x39303b(0x7b)]();while(!![]){const _0x18378d=a52_0x2e5bba[_0x39303b(0x89)](_0x2593d5,PROJECT_CONFIG_FILENAME);if(a52_0x4bd245[_0x39303b(0x72)](_0x18378d))return _0x18378d;const _0x5c4b5c=a52_0x2e5bba[_0x39303b(0x70)](_0x2593d5);if(_0x5c4b5c===_0x2593d5)return null;_0x2593d5=_0x5c4b5c;}}function a52_0x5a0b(){const _0x4267d5=['writeFileSync','readFileSync','cwd','apiKey','4194ZikkTF','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','\x20is\x20ignored.\x20','2380CDYATa','profile','11624LsLIFF','987008ZabpHV','warn','api_key','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','includes','stringify','join','ENOENT','TD_API_KEY','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','39GnaMUa','Warning:\x20\x27profile\x27\x20field\x20in\x20','513055JKQGfT','dirname','4653198VDhaLs','existsSync','61229030tuNCkm','utf-8','10802225fDPhLt','code','48UckyzV','Failed\x20to\x20load\x20project\x20config\x20from\x20'];a52_0x5a0b=function(){return _0x4267d5;};return a52_0x5a0b();}export function loadProjectConfig(_0x18539f){const _0x3160c9=a52_0x2e12,_0x336f02=findProjectConfigPath(_0x18539f);if(!_0x336f02)return null;try{const _0x39812c=a52_0x4bd245[_0x3160c9(0x7a)](_0x336f02,_0x3160c9(0x74)),_0x5c4070=JSON['parse'](_0x39812c),_0x37c1b4=JSON[_0x3160c9(0x88)](_0x5c4070);if(_0x37c1b4['includes'](_0x3160c9(0x8b))||_0x37c1b4[_0x3160c9(0x87)](_0x3160c9(0x7c))||_0x37c1b4[_0x3160c9(0x87)]('api_key'))throw new Error(_0x3160c9(0x8c)+_0x336f02+').\x20'+'Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.');const {metadata:_0x229397,profile:_0x40573a,..._0x315072}=_0x5c4070;return _0x40573a&&console[_0x3160c9(0x84)](_0x3160c9(0x8e)+_0x336f02+_0x3160c9(0x7f)+'Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json'),_0x315072;}catch(_0x18acc3){if(_0x18acc3 instanceof Error&&'code'in _0x18acc3&&_0x18acc3[_0x3160c9(0x76)]===_0x3160c9(0x8a))return null;throw new Error(_0x3160c9(0x78)+_0x336f02+':\x20'+_0x18acc3);}}export function saveProjectConfig(_0x2d6158,_0xe42e17){const _0xd15c82=a52_0x2e12,_0x31b6cc=_0xe42e17||process[_0xd15c82(0x7b)](),_0x249700=a52_0x2e5bba[_0xd15c82(0x89)](_0x31b6cc,PROJECT_CONFIG_FILENAME),_0x36641e=JSON[_0xd15c82(0x88)](_0x2d6158);if(_0x36641e[_0xd15c82(0x87)]('TD_API_KEY')||_0x36641e[_0xd15c82(0x87)](_0xd15c82(0x7c))||_0x36641e[_0xd15c82(0x87)](_0xd15c82(0x85)))throw new Error(_0xd15c82(0x7e));if(_0xd15c82(0x81)in _0x2d6158)throw new Error(_0xd15c82(0x86));a52_0x4bd245[_0xd15c82(0x79)](_0x249700,JSON[_0xd15c82(0x88)](_0x2d6158,null,0x2));}export function hasProjectConfig(_0x1becac){return findProjectConfigPath(_0x1becac)!==null;}function a52_0x2e12(_0x13eead,_0x49ec83){_0x13eead=_0x13eead-0x6f;const _0x5a0b18=a52_0x5a0b();let _0x2e12bc=_0x5a0b18[_0x13eead];return _0x2e12bc;}export function getProjectRoot(_0x5ce1bc){const _0x37875e=findProjectConfigPath(_0x5ce1bc);return _0x37875e?a52_0x2e5bba['dirname'](_0x37875e):null;}
@@ -1 +1 @@
1
- (function(_0x4fd6e0,_0x2dad7e){const _0x1c5018=a53_0x2305,_0x49a9cd=_0x4fd6e0();while(!![]){try{const _0x3802cc=parseInt(_0x1c5018(0xfd))/0x1+parseInt(_0x1c5018(0xfa))/0x2*(-parseInt(_0x1c5018(0xe8))/0x3)+-parseInt(_0x1c5018(0x100))/0x4+-parseInt(_0x1c5018(0xe7))/0x5+-parseInt(_0x1c5018(0x101))/0x6+parseInt(_0x1c5018(0xe3))/0x7*(parseInt(_0x1c5018(0xef))/0x8)+parseInt(_0x1c5018(0xf7))/0x9;if(_0x3802cc===_0x2dad7e)break;else _0x49a9cd['push'](_0x49a9cd['shift']());}catch(_0x14e73d){_0x49a9cd['push'](_0x49a9cd['shift']());}}}(a53_0x48dc,0xd0efe));import*as a53_0x323a98 from'node:fs';import*as a53_0x1599e6 from'node:path';import*as a53_0x20cd24 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 _0x305207=a53_0x2305,_0x4d3521=process.env.TDX_CONFIG_DIR||a53_0x1599e6[_0x305207(0xff)](a53_0x20cd24[_0x305207(0xf2)](),_0x305207(0xe4),_0x305207(0xe6));return a53_0x1599e6[_0x305207(0xff)](_0x4d3521,_0x305207(0xf0));}function getSessionPath(_0x1ccef9){const _0x3e6026=a53_0x2305;return a53_0x1599e6[_0x3e6026(0xff)](getSessionsDir(),_0x1ccef9+_0x3e6026(0xeb));}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x22e534){if(_0x22e534)return _0x22e534;if(process.env.TDX_SESSION)return process.env.TDX_SESSION;return getCurrentSessionPID()['toString']();}export function loadSessionContext(_0x23cd39){const _0x430685=a53_0x2305,_0x464374=getSessionID(_0x23cd39),_0x2bcb00=/^\d+$/[_0x430685(0xf3)](_0x464374)?parseInt(_0x464374,0xa):null;return _0x2bcb00!==null?loadSessionContextByPID(_0x2bcb00):loadSessionContextByString(_0x464374);}export function loadSessionContextByPID(_0x1c28ed){const _0xcebacd=a53_0x2305,_0x175b16=getSessionPath(_0x1c28ed);if(!a53_0x323a98[_0xcebacd(0xf1)](_0x175b16))return null;try{const _0x30e393=a53_0x323a98[_0xcebacd(0xdf)](_0x175b16,_0xcebacd(0xf4)),_0x465045=JSON['parse'](_0x30e393),_0x14dcde=new Date(_0x465045[_0xcebacd(0xe2)])[_0xcebacd(0xf5)](),_0x2efd70=Date[_0xcebacd(0xf6)]();if(_0x2efd70-_0x14dcde>SESSION_EXPIRATION_MS)return a53_0x323a98['unlinkSync'](_0x175b16),null;const _0x1e24e5=JSON[_0xcebacd(0xf8)](_0x465045);if(_0x1e24e5[_0xcebacd(0xed)](_0xcebacd(0xe5))||_0x1e24e5[_0xcebacd(0xed)](_0xcebacd(0x102))||_0x1e24e5[_0xcebacd(0xed)]('api_key'))return console[_0xcebacd(0xe0)](_0xcebacd(0xfb)+_0x175b16+_0xcebacd(0xde)),a53_0x323a98[_0xcebacd(0xfc)](_0x175b16),null;return _0x465045;}catch{try{a53_0x323a98[_0xcebacd(0xfc)](_0x175b16);}catch{}return null;}}function loadSessionContextByString(_0x2bcead){const _0x376073=a53_0x2305,_0x7efb2b=a53_0x1599e6[_0x376073(0xff)](getSessionsDir(),_0x2bcead+'.json');if(!a53_0x323a98[_0x376073(0xf1)](_0x7efb2b))return null;try{const _0x57c5e6=a53_0x323a98[_0x376073(0xdf)](_0x7efb2b,_0x376073(0xf4)),_0x45ecfd=JSON[_0x376073(0xe1)](_0x57c5e6),_0x1cfefc=new Date(_0x45ecfd[_0x376073(0xe2)])[_0x376073(0xf5)](),_0x3c3152=Date[_0x376073(0xf6)]();if(_0x3c3152-_0x1cfefc>SESSION_EXPIRATION_MS)return a53_0x323a98['unlinkSync'](_0x7efb2b),null;const _0x4571f6=JSON[_0x376073(0xf8)](_0x45ecfd);if(_0x4571f6[_0x376073(0xed)](_0x376073(0xe5))||_0x4571f6['includes'](_0x376073(0x102))||_0x4571f6[_0x376073(0xed)](_0x376073(0xdc)))return console[_0x376073(0xe0)](_0x376073(0xfb)+_0x7efb2b+_0x376073(0xde)),a53_0x323a98[_0x376073(0xfc)](_0x7efb2b),null;return _0x45ecfd;}catch{try{a53_0x323a98[_0x376073(0xfc)](_0x7efb2b);}catch{}return null;}}function a53_0x48dc(){const _0xe344b7=['tdx','836925jtBVqn','3ltxfuE','endsWith','writeFileSync','.json','toISOString','includes','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','8xwOlBU','sessions','existsSync','homedir','test','utf-8','getTime','now','15229458GZSCCq','stringify','toString','2443538gmTRny','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','unlinkSync','1064662WEkmVp','push','join','468960CgYcCS','6794184PmgoAA','apiKey','readdirSync','api_key','replace','.\x20This\x20is\x20insecure.\x20Removing\x20session.','readFileSync','warn','parse','createdAt','5164180bmGEcM','.config','TD_API_KEY'];a53_0x48dc=function(){return _0xe344b7;};return a53_0x48dc();}export function saveSessionContext(_0xd65b60,_0x181107){const _0x3286d9=a53_0x2305,_0x2897bd=getSessionID(_0x181107),_0x438c95=/^\d+$/[_0x3286d9(0xf3)](_0x2897bd)?parseInt(_0x2897bd,0xa):getCurrentSessionPID(),_0x3c66c4=a53_0x1599e6['join'](getSessionsDir(),_0x2897bd+_0x3286d9(0xeb)),_0x3155b5=getSessionsDir();createSecureDirectory(_0x3155b5);const _0x215b4f=JSON[_0x3286d9(0xf8)](_0xd65b60);if(_0x215b4f[_0x3286d9(0xed)](_0x3286d9(0xe5))||_0x215b4f[_0x3286d9(0xed)](_0x3286d9(0x102))||_0x215b4f[_0x3286d9(0xed)]('api_key'))throw new Error(_0x3286d9(0xee));let _0x611a76;const _0x3bd91b=/^\d+$/[_0x3286d9(0xf3)](_0x2897bd)?loadSessionContextByPID(parseInt(_0x2897bd,0xa)):loadSessionContextByString(_0x2897bd);_0x3bd91b?_0x611a76={..._0x3bd91b,..._0xd65b60,'pid':_0x438c95,'sessionId':_0x2897bd!==_0x438c95[_0x3286d9(0xf9)]()?_0x2897bd:undefined,'updatedAt':new Date()[_0x3286d9(0xec)]()}:_0x611a76={'pid':_0x438c95,'sessionId':_0x2897bd!==_0x438c95['toString']()?_0x2897bd:undefined,..._0xd65b60,'createdAt':new Date()[_0x3286d9(0xec)](),'updatedAt':new Date()['toISOString']()},a53_0x323a98['writeFileSync'](_0x3c66c4,JSON[_0x3286d9(0xf8)](_0x611a76,null,0x2));}export function clearSessionContext(_0x2e4a18){const _0x3cc66b=a53_0x2305,_0x59d186=getSessionID(_0x2e4a18),_0x572027=a53_0x1599e6[_0x3cc66b(0xff)](getSessionsDir(),_0x59d186+_0x3cc66b(0xeb));a53_0x323a98['existsSync'](_0x572027)&&a53_0x323a98[_0x3cc66b(0xfc)](_0x572027);}export function clearSessionContextField(_0x521096,_0x106d70){const _0x129241=a53_0x2305,_0x22ed97=getSessionID(_0x106d70),_0xadd82f=a53_0x1599e6[_0x129241(0xff)](getSessionsDir(),_0x22ed97+_0x129241(0xeb));if(!a53_0x323a98[_0x129241(0xf1)](_0xadd82f))return;try{const _0x37a79e=a53_0x323a98[_0x129241(0xdf)](_0xadd82f,_0x129241(0xf4)),_0x42240b=JSON[_0x129241(0xe1)](_0x37a79e);delete _0x42240b[_0x521096],a53_0x323a98[_0x129241(0xea)](_0xadd82f,JSON['stringify'](_0x42240b,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x1da2af=a53_0x2305,_0x313ea7=getSessionsDir();if(!a53_0x323a98[_0x1da2af(0xf1)](_0x313ea7))return 0x0;let _0x2dee87=0x0;const _0x16b8d1=Date[_0x1da2af(0xf6)]();try{const _0x3833bc=a53_0x323a98[_0x1da2af(0x103)](_0x313ea7);for(const _0x5548ed of _0x3833bc){if(!_0x5548ed[_0x1da2af(0xe9)](_0x1da2af(0xeb)))continue;const _0x2c7650=a53_0x1599e6[_0x1da2af(0xff)](_0x313ea7,_0x5548ed),_0xf35a5f=_0x5548ed[_0x1da2af(0xdd)](_0x1da2af(0xeb),''),_0x43dfd3=parseInt(_0xf35a5f,0xa),_0x14f0a2=!isNaN(_0x43dfd3);if(_0x14f0a2){if(!isProcessRunning(_0x43dfd3)){a53_0x323a98['unlinkSync'](_0x2c7650),_0x2dee87++;continue;}}try{const _0x3fb2f4=a53_0x323a98[_0x1da2af(0xdf)](_0x2c7650,'utf-8'),_0x5abfef=JSON['parse'](_0x3fb2f4),_0x7cf9d9=new Date(_0x5abfef[_0x1da2af(0xe2)])['getTime']();_0x16b8d1-_0x7cf9d9>SESSION_EXPIRATION_MS&&(a53_0x323a98[_0x1da2af(0xfc)](_0x2c7650),_0x2dee87++);}catch{a53_0x323a98[_0x1da2af(0xfc)](_0x2c7650),_0x2dee87++;}}}catch{}return _0x2dee87;}function a53_0x2305(_0x53a173,_0x276975){_0x53a173=_0x53a173-0xdc;const _0x48dc08=a53_0x48dc();let _0x23057d=_0x48dc08[_0x53a173];return _0x23057d;}export function listActiveSessions(){const _0x5802c0=a53_0x2305,_0x1e40c3=getSessionsDir();if(!a53_0x323a98['existsSync'](_0x1e40c3))return[];try{const _0x1bdb8c=a53_0x323a98[_0x5802c0(0x103)](_0x1e40c3),_0x23548f=[];for(const _0x371197 of _0x1bdb8c){if(!_0x371197[_0x5802c0(0xe9)]('.json'))continue;const _0x16eda2=_0x371197[_0x5802c0(0xdd)]('.json',''),_0x432bc4=parseInt(_0x16eda2,0xa);!isNaN(_0x432bc4)&&isProcessRunning(_0x432bc4)&&_0x23548f[_0x5802c0(0xfe)](_0x432bc4);}return _0x23548f['sort']((_0x501535,_0xb73521)=>_0x501535-_0xb73521);}catch{return[];}}
1
+ (function(_0x1e2d02,_0x2adf83){const _0x242d26=a53_0x1e39,_0x5a253c=_0x1e2d02();while(!![]){try{const _0x490cd4=-parseInt(_0x242d26(0x1d0))/0x1+parseInt(_0x242d26(0x1b2))/0x2+parseInt(_0x242d26(0x1c1))/0x3+parseInt(_0x242d26(0x1be))/0x4*(-parseInt(_0x242d26(0x1ca))/0x5)+-parseInt(_0x242d26(0x1ce))/0x6*(parseInt(_0x242d26(0x1c4))/0x7)+parseInt(_0x242d26(0x1c2))/0x8*(parseInt(_0x242d26(0x1c3))/0x9)+-parseInt(_0x242d26(0x1bd))/0xa;if(_0x490cd4===_0x2adf83)break;else _0x5a253c['push'](_0x5a253c['shift']());}catch(_0xf447ea){_0x5a253c['push'](_0x5a253c['shift']());}}}(a53_0x6d8a,0xd178d));import*as a53_0x1f0b5b from'node:fs';import*as a53_0xddb8aa from'node:path';import*as a53_0xba229c 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 _0x2e0d3a=a53_0x1e39,_0x1e77d4=process.env.TDX_CONFIG_DIR||a53_0xddb8aa['join'](a53_0xba229c[_0x2e0d3a(0x1c8)](),'.config',_0x2e0d3a(0x1cd));return a53_0xddb8aa[_0x2e0d3a(0x1d2)](_0x1e77d4,_0x2e0d3a(0x1d4));}function getSessionPath(_0x425d37){const _0x5ea33d=a53_0x1e39;return a53_0xddb8aa[_0x5ea33d(0x1d2)](getSessionsDir(),_0x425d37+'.json');}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x5252c9){if(_0x5252c9)return _0x5252c9;if(process.env.TDX_SESSION)return process.env.TDX_SESSION;return getCurrentSessionPID()['toString']();}export function loadSessionContext(_0x440377){const _0x4c8ead=a53_0x1e39,_0x35b49a=getSessionID(_0x440377),_0x6e030b=/^\d+$/[_0x4c8ead(0x1b3)](_0x35b49a)?parseInt(_0x35b49a,0xa):null;return _0x6e030b!==null?loadSessionContextByPID(_0x6e030b):loadSessionContextByString(_0x35b49a);}export function loadSessionContextByPID(_0x10d8b1){const _0x42370c=a53_0x1e39,_0x3f316c=getSessionPath(_0x10d8b1);if(!a53_0x1f0b5b[_0x42370c(0x1b9)](_0x3f316c))return null;try{const _0x4f85e9=a53_0x1f0b5b[_0x42370c(0x1b8)](_0x3f316c,_0x42370c(0x1bf)),_0x2f8e3d=JSON[_0x42370c(0x1b5)](_0x4f85e9),_0xa1df05=new Date(_0x2f8e3d[_0x42370c(0x1d3)])[_0x42370c(0x1c9)](),_0x514c39=Date[_0x42370c(0x1b7)]();if(_0x514c39-_0xa1df05>SESSION_EXPIRATION_MS)return a53_0x1f0b5b[_0x42370c(0x1cb)](_0x3f316c),null;const _0x175960=JSON[_0x42370c(0x1b6)](_0x2f8e3d);if(_0x175960[_0x42370c(0x1c6)](_0x42370c(0x1d1))||_0x175960['includes']('apiKey')||_0x175960[_0x42370c(0x1c6)]('api_key'))return console['warn'](_0x42370c(0x1c0)+_0x3f316c+_0x42370c(0x1ba)),a53_0x1f0b5b['unlinkSync'](_0x3f316c),null;return _0x2f8e3d;}catch{try{a53_0x1f0b5b[_0x42370c(0x1cb)](_0x3f316c);}catch{}return null;}}function loadSessionContextByString(_0x1b913b){const _0x4bdbfe=a53_0x1e39,_0x431fba=a53_0xddb8aa['join'](getSessionsDir(),_0x1b913b+_0x4bdbfe(0x1d6));if(!a53_0x1f0b5b[_0x4bdbfe(0x1b9)](_0x431fba))return null;try{const _0x25a436=a53_0x1f0b5b[_0x4bdbfe(0x1b8)](_0x431fba,_0x4bdbfe(0x1bf)),_0x11f9df=JSON['parse'](_0x25a436),_0x322594=new Date(_0x11f9df[_0x4bdbfe(0x1d3)])[_0x4bdbfe(0x1c9)](),_0x36e9fb=Date[_0x4bdbfe(0x1b7)]();if(_0x36e9fb-_0x322594>SESSION_EXPIRATION_MS)return a53_0x1f0b5b[_0x4bdbfe(0x1cb)](_0x431fba),null;const _0x35632c=JSON['stringify'](_0x11f9df);if(_0x35632c[_0x4bdbfe(0x1c6)](_0x4bdbfe(0x1d1))||_0x35632c[_0x4bdbfe(0x1c6)](_0x4bdbfe(0x1b4))||_0x35632c[_0x4bdbfe(0x1c6)](_0x4bdbfe(0x1c5)))return console['warn'](_0x4bdbfe(0x1c0)+_0x431fba+_0x4bdbfe(0x1ba)),a53_0x1f0b5b[_0x4bdbfe(0x1cb)](_0x431fba),null;return _0x11f9df;}catch{try{a53_0x1f0b5b[_0x4bdbfe(0x1cb)](_0x431fba);}catch{}return null;}}export function saveSessionContext(_0x461b8b,_0xc98001){const _0x2314c6=a53_0x1e39,_0x51f443=getSessionID(_0xc98001),_0x3f4aee=/^\d+$/['test'](_0x51f443)?parseInt(_0x51f443,0xa):getCurrentSessionPID(),_0x2887d8=a53_0xddb8aa['join'](getSessionsDir(),_0x51f443+_0x2314c6(0x1d6)),_0x16ba39=getSessionsDir();createSecureDirectory(_0x16ba39);const _0x2a6672=JSON[_0x2314c6(0x1b6)](_0x461b8b);if(_0x2a6672['includes']('TD_API_KEY')||_0x2a6672[_0x2314c6(0x1c6)](_0x2314c6(0x1b4))||_0x2a6672[_0x2314c6(0x1c6)](_0x2314c6(0x1c5)))throw new Error(_0x2314c6(0x1cf));let _0x6bb0b8;const _0x46e9e2=/^\d+$/[_0x2314c6(0x1b3)](_0x51f443)?loadSessionContextByPID(parseInt(_0x51f443,0xa)):loadSessionContextByString(_0x51f443);_0x46e9e2?_0x6bb0b8={..._0x46e9e2,..._0x461b8b,'pid':_0x3f4aee,'sessionId':_0x51f443!==_0x3f4aee[_0x2314c6(0x1cc)]()?_0x51f443:undefined,'updatedAt':new Date()[_0x2314c6(0x1bb)]()}:_0x6bb0b8={'pid':_0x3f4aee,'sessionId':_0x51f443!==_0x3f4aee[_0x2314c6(0x1cc)]()?_0x51f443:undefined,..._0x461b8b,'createdAt':new Date()[_0x2314c6(0x1bb)](),'updatedAt':new Date()[_0x2314c6(0x1bb)]()},a53_0x1f0b5b[_0x2314c6(0x1d8)](_0x2887d8,JSON[_0x2314c6(0x1b6)](_0x6bb0b8,null,0x2));}export function clearSessionContext(_0x1158dc){const _0x637be9=a53_0x1e39,_0x23174d=getSessionID(_0x1158dc),_0x25f64f=a53_0xddb8aa['join'](getSessionsDir(),_0x23174d+_0x637be9(0x1d6));a53_0x1f0b5b[_0x637be9(0x1b9)](_0x25f64f)&&a53_0x1f0b5b[_0x637be9(0x1cb)](_0x25f64f);}export function clearSessionContextField(_0x5e897a,_0x3acfba){const _0x66ce2f=a53_0x1e39,_0x454477=getSessionID(_0x3acfba),_0x231d03=a53_0xddb8aa[_0x66ce2f(0x1d2)](getSessionsDir(),_0x454477+_0x66ce2f(0x1d6));if(!a53_0x1f0b5b['existsSync'](_0x231d03))return;try{const _0x590b0d=a53_0x1f0b5b[_0x66ce2f(0x1b8)](_0x231d03,'utf-8'),_0x33ce1b=JSON[_0x66ce2f(0x1b5)](_0x590b0d);delete _0x33ce1b[_0x5e897a],a53_0x1f0b5b[_0x66ce2f(0x1d8)](_0x231d03,JSON['stringify'](_0x33ce1b,null,0x2));}catch{}}function a53_0x1e39(_0x2e470d,_0x16703e){_0x2e470d=_0x2e470d-0x1b2;const _0x6d8af9=a53_0x6d8a();let _0x1e3996=_0x6d8af9[_0x2e470d];return _0x1e3996;}function a53_0x6d8a(){const _0x4ee652=['TD_API_KEY','join','createdAt','sessions','push','.json','replace','writeFileSync','2762348nJaIDJ','test','apiKey','parse','stringify','now','readFileSync','existsSync','.\x20This\x20is\x20insecure.\x20Removing\x20session.','toISOString','endsWith','2823860ebXYNn','815876jXdTGy','utf-8','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','4582545uVLkyn','8oxVcON','4198275jGFWBL','189SzpjNw','api_key','includes','sort','homedir','getTime','25SkAZgf','unlinkSync','toString','tdx','33534ZTHOKQ','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','1064033aNaLoe'];a53_0x6d8a=function(){return _0x4ee652;};return a53_0x6d8a();}export function cleanExpiredSessions(){const _0x554e60=a53_0x1e39,_0x36e9ca=getSessionsDir();if(!a53_0x1f0b5b[_0x554e60(0x1b9)](_0x36e9ca))return 0x0;let _0x3e866e=0x0;const _0x1e3fdb=Date[_0x554e60(0x1b7)]();try{const _0x15baa6=a53_0x1f0b5b['readdirSync'](_0x36e9ca);for(const _0x3242ac of _0x15baa6){if(!_0x3242ac[_0x554e60(0x1bc)](_0x554e60(0x1d6)))continue;const _0x5d1ddf=a53_0xddb8aa[_0x554e60(0x1d2)](_0x36e9ca,_0x3242ac),_0x4a3895=_0x3242ac[_0x554e60(0x1d7)](_0x554e60(0x1d6),''),_0x506a9d=parseInt(_0x4a3895,0xa),_0x575c44=!isNaN(_0x506a9d);if(_0x575c44){if(!isProcessRunning(_0x506a9d)){a53_0x1f0b5b[_0x554e60(0x1cb)](_0x5d1ddf),_0x3e866e++;continue;}}try{const _0x412f93=a53_0x1f0b5b[_0x554e60(0x1b8)](_0x5d1ddf,_0x554e60(0x1bf)),_0x234dd6=JSON[_0x554e60(0x1b5)](_0x412f93),_0x533b2f=new Date(_0x234dd6[_0x554e60(0x1d3)])[_0x554e60(0x1c9)]();_0x1e3fdb-_0x533b2f>SESSION_EXPIRATION_MS&&(a53_0x1f0b5b['unlinkSync'](_0x5d1ddf),_0x3e866e++);}catch{a53_0x1f0b5b['unlinkSync'](_0x5d1ddf),_0x3e866e++;}}}catch{}return _0x3e866e;}export function listActiveSessions(){const _0x490748=a53_0x1e39,_0x3a41d4=getSessionsDir();if(!a53_0x1f0b5b['existsSync'](_0x3a41d4))return[];try{const _0x5417c6=a53_0x1f0b5b['readdirSync'](_0x3a41d4),_0x2c88f4=[];for(const _0x403238 of _0x5417c6){if(!_0x403238[_0x490748(0x1bc)](_0x490748(0x1d6)))continue;const _0x48c15e=_0x403238[_0x490748(0x1d7)](_0x490748(0x1d6),''),_0x59fbe5=parseInt(_0x48c15e,0xa);!isNaN(_0x59fbe5)&&isProcessRunning(_0x59fbe5)&&_0x2c88f4[_0x490748(0x1d5)](_0x59fbe5);}return _0x2c88f4[_0x490748(0x1c7)]((_0x39788e,_0x4e902c)=>_0x39788e-_0x4e902c);}catch{return[];}}
@@ -1 +1 @@
1
- const a54_0x157d0b=a54_0x2871;function a54_0x2871(_0x4d91df,_0xc2c452){_0x4d91df=_0x4d91df-0x1bf;const _0x562636=a54_0x5626();let _0x2871fa=_0x562636[_0x4d91df];return _0x2871fa;}(function(_0x216965,_0x3bcd1b){const _0x2ebc42=a54_0x2871,_0x106a9b=_0x216965();while(!![]){try{const _0x322d4c=parseInt(_0x2ebc42(0x1cc))/0x1+parseInt(_0x2ebc42(0x1c3))/0x2*(-parseInt(_0x2ebc42(0x1c2))/0x3)+-parseInt(_0x2ebc42(0x1c6))/0x4+-parseInt(_0x2ebc42(0x1c1))/0x5*(parseInt(_0x2ebc42(0x1cd))/0x6)+-parseInt(_0x2ebc42(0x1c0))/0x7+-parseInt(_0x2ebc42(0x1c7))/0x8+parseInt(_0x2ebc42(0x1c4))/0x9*(parseInt(_0x2ebc42(0x1c8))/0xa);if(_0x322d4c===_0x3bcd1b)break;else _0x106a9b['push'](_0x106a9b['shift']());}catch(_0x5baeeb){_0x106a9b['push'](_0x106a9b['shift']());}}}(a54_0x5626,0xcd028));import{createProfileCache}from'../utils/global-cache.js';const userCache=createProfileCache(a54_0x157d0b(0x1c5),a54_0x157d0b(0x1bf));export function loadCachedUsers(_0x30b199){const _0x8e1c2a=a54_0x157d0b,_0x3a21e0=userCache[_0x8e1c2a(0x1cb)](_0x30b199);return _0x3a21e0?.[_0x8e1c2a(0x1c9)]??null;}export function saveCachedUsers(_0x4adcf1,_0x5093a6){const _0x17ecdd=a54_0x157d0b;userCache[_0x17ecdd(0x1ca)](_0x4adcf1,{'users':_0x5093a6,'cachedAt':Date[_0x17ecdd(0x1ce)]()});}export function clearUserCache(_0x905172){userCache['clear'](_0x905172);}function a54_0x5626(){const _0x1d8db3=['1062911HWIFdJ','12CnptVo','now','core/user-cache','8261988xQzPVZ','651155eEzIwt','9IGDJKZ','12646TgXQbq','9sFupVV','users-{profile}.json','4203312aHcggX','7676040LubZMP','32468570IeViLS','users','write','read'];a54_0x5626=function(){return _0x1d8db3;};return a54_0x5626();}
1
+ const a54_0x46ce11=a54_0x2222;(function(_0x527fc2,_0x263030){const _0x57c530=a54_0x2222,_0x5cfe23=_0x527fc2();while(!![]){try{const _0x46f0a7=-parseInt(_0x57c530(0x11e))/0x1*(parseInt(_0x57c530(0x125))/0x2)+-parseInt(_0x57c530(0x11d))/0x3*(parseInt(_0x57c530(0x123))/0x4)+parseInt(_0x57c530(0x11f))/0x5*(parseInt(_0x57c530(0x129))/0x6)+-parseInt(_0x57c530(0x126))/0x7*(-parseInt(_0x57c530(0x128))/0x8)+-parseInt(_0x57c530(0x12c))/0x9*(parseInt(_0x57c530(0x120))/0xa)+parseInt(_0x57c530(0x122))/0xb*(-parseInt(_0x57c530(0x12b))/0xc)+-parseInt(_0x57c530(0x121))/0xd*(-parseInt(_0x57c530(0x127))/0xe);if(_0x46f0a7===_0x263030)break;else _0x5cfe23['push'](_0x5cfe23['shift']());}catch(_0x3f4b5c){_0x5cfe23['push'](_0x5cfe23['shift']());}}}(a54_0x13e8,0xbde49));function a54_0x13e8(){const _0xc44b1b=['users','now','4156602KcsLRi','432844yYBnJX','171725beInly','2979270qhfrsx','4849MVFJOT','671aDTSBq','4znqdJe','users-{profile}.json','6xFegcL','5341749LqOcNe','160790sBtcIr','8CpBTNB','30cGAnQH','clear','169788IUPVJg','27OpIUen','read'];a54_0x13e8=function(){return _0xc44b1b;};return a54_0x13e8();}import{createProfileCache}from'../utils/global-cache.js';const userCache=createProfileCache(a54_0x46ce11(0x124),'core/user-cache');function a54_0x2222(_0x5065d3,_0x38d950){_0x5065d3=_0x5065d3-0x11d;const _0x13e8e6=a54_0x13e8();let _0x2222ca=_0x13e8e6[_0x5065d3];return _0x2222ca;}export function loadCachedUsers(_0x29f41d){const _0x1181e3=a54_0x46ce11,_0xb2e770=userCache[_0x1181e3(0x12d)](_0x29f41d);return _0xb2e770?.[_0x1181e3(0x12e)]??null;}export function saveCachedUsers(_0x3592c8,_0x334375){const _0x570b69=a54_0x46ce11;userCache['write'](_0x3592c8,{'users':_0x334375,'cachedAt':Date[_0x570b69(0x12f)]()});}export function clearUserCache(_0x9c32a1){const _0x735c51=a54_0x46ce11;userCache[_0x735c51(0x12a)](_0x9c32a1);}
@@ -1 +1 @@
1
- (function(_0xc47c0b,_0x19cf6){const _0x31d37a=a55_0x2a5c,_0x18c16c=_0xc47c0b();while(!![]){try{const _0x27dbfa=-parseInt(_0x31d37a(0xba))/0x1*(-parseInt(_0x31d37a(0xbb))/0x2)+-parseInt(_0x31d37a(0xad))/0x3+-parseInt(_0x31d37a(0xb5))/0x4*(parseInt(_0x31d37a(0xb7))/0x5)+parseInt(_0x31d37a(0xab))/0x6+parseInt(_0x31d37a(0xb4))/0x7*(parseInt(_0x31d37a(0xaa))/0x8)+parseInt(_0x31d37a(0xb9))/0x9*(-parseInt(_0x31d37a(0xa9))/0xa)+-parseInt(_0x31d37a(0xae))/0xb*(-parseInt(_0x31d37a(0xb3))/0xc);if(_0x27dbfa===_0x19cf6)break;else _0x18c16c['push'](_0x18c16c['shift']());}catch(_0x1334bb){_0x18c16c['push'](_0x18c16c['shift']());}}}(a55_0x4180,0xdd206));import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0x1b7e67=a55_0x2a5c;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x3a5d83=fileURLToPath(import.meta.url),_0x113346=dirname(_0x3a5d83);try{const _0x68024c=join(_0x113346,_0x1b7e67(0xac));cachedBuildInfo=JSON[_0x1b7e67(0xaf)](readFileSync(_0x68024c,_0x1b7e67(0xb8)));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0xc27c0e=a55_0x2a5c;if(cachedVersion!==null)return cachedVersion;const _0x4a2a59=fileURLToPath(import.meta.url),_0x109e04=dirname(_0x4a2a59),_0x45cca8=getBuildInfo();if(_0x45cca8[_0xc27c0e(0xb1)])return cachedVersion=_0x45cca8[_0xc27c0e(0xb1)],cachedVersion;try{const _0x4e68ec=join(_0x109e04,_0xc27c0e(0xb2)),_0x1ed209=JSON[_0xc27c0e(0xaf)](readFileSync(_0x4e68ec,'utf-8'));cachedVersion=_0x1ed209[_0xc27c0e(0xb1)];}catch{cachedVersion=_0xc27c0e(0xa8);}return cachedVersion;}export function isDevVersion(){const _0x399511=a55_0x2a5c,_0xcc4afd=getVersion();return _0xcc4afd[_0x399511(0xb0)](_0x399511(0xb6))||_0xcc4afd[_0x399511(0xb0)]('-');}function a55_0x2a5c(_0x187e57,_0x572085){_0x187e57=_0x187e57-0xa8;const _0x418027=a55_0x4180();let _0x2a5c59=_0x418027[_0x187e57];return _0x2a5c59;}function a55_0x4180(){const _0x4e9af2=['16oiaRQA','285570bEGGgo','../build-info.json','4128216EuftoU','11beMZIL','parse','includes','version','../../package.json','30563340saYBEm','1607977NITCOI','45128tOsbbV','.dev','715ypHJcU','utf-8','3987cirJCj','337903EFWIeX','10JKHeKg','0.0.0','19150MddRfl'];a55_0x4180=function(){return _0x4e9af2;};return a55_0x4180();}
1
+ (function(_0x4536c2,_0x385c60){const _0x4c2647=a55_0x1e33,_0x21c4b9=_0x4536c2();while(!![]){try{const _0x257432=-parseInt(_0x4c2647(0x134))/0x1+-parseInt(_0x4c2647(0x137))/0x2+parseInt(_0x4c2647(0x133))/0x3+-parseInt(_0x4c2647(0x13b))/0x4+parseInt(_0x4c2647(0x136))/0x5*(parseInt(_0x4c2647(0x135))/0x6)+parseInt(_0x4c2647(0x12f))/0x7+parseInt(_0x4c2647(0x12d))/0x8*(parseInt(_0x4c2647(0x12e))/0x9);if(_0x257432===_0x385c60)break;else _0x21c4b9['push'](_0x21c4b9['shift']());}catch(_0x2e3da0){_0x21c4b9['push'](_0x21c4b9['shift']());}}}(a55_0x29f0,0x8b9d1));import{readFileSync}from'fs';import{fileURLToPath}from'url';function a55_0x1e33(_0x81f0a7,_0x3cc93c){_0x81f0a7=_0x81f0a7-0x12c;const _0x29f0ee=a55_0x29f0();let _0x1e33f5=_0x29f0ee[_0x81f0a7];return _0x1e33f5;}import{dirname,join}from'path';function a55_0x29f0(){const _0x476f81=['2650100CrtrPb','.dev','version','1712gkKjyk','49482HzBsZF','1304170ySyoBE','0.0.0','../build-info.json','includes','2887797sxiTiL','1077451ARzFjy','14724NOlcBf','1785EOAzMQ','1779452dBuNZb','../../package.json','utf-8','parse'];a55_0x29f0=function(){return _0x476f81;};return a55_0x29f0();}let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0x14f2d6=a55_0x1e33;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x43db82=fileURLToPath(import.meta.url),_0x2932cb=dirname(_0x43db82);try{const _0x21b272=join(_0x2932cb,_0x14f2d6(0x131));cachedBuildInfo=JSON[_0x14f2d6(0x13a)](readFileSync(_0x21b272,'utf-8'));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0xf3efdc=a55_0x1e33;if(cachedVersion!==null)return cachedVersion;const _0x181dd7=fileURLToPath(import.meta.url),_0x19198c=dirname(_0x181dd7),_0x24fb57=getBuildInfo();if(_0x24fb57[_0xf3efdc(0x12c)])return cachedVersion=_0x24fb57[_0xf3efdc(0x12c)],cachedVersion;try{const _0x506a6f=join(_0x19198c,_0xf3efdc(0x138)),_0x5bdcad=JSON[_0xf3efdc(0x13a)](readFileSync(_0x506a6f,_0xf3efdc(0x139)));cachedVersion=_0x5bdcad[_0xf3efdc(0x12c)];}catch{cachedVersion=_0xf3efdc(0x130);}return cachedVersion;}export function isDevVersion(){const _0x5136b5=a55_0x1e33,_0x52e0f1=getVersion();return _0x52e0f1[_0x5136b5(0x132)](_0x5136b5(0x13c))||_0x52e0f1['includes']('-');}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- (function(_0x16bfe8,_0x2dc7fa){var _0x4ab184=a56_0x4207,_0x21eac7=_0x16bfe8();while(!![]){try{var _0x2f270d=-parseInt(_0x4ab184(0xb4))/0x1+-parseInt(_0x4ab184(0xbb))/0x2+-parseInt(_0x4ab184(0xba))/0x3+-parseInt(_0x4ab184(0xb9))/0x4*(parseInt(_0x4ab184(0xbc))/0x5)+-parseInt(_0x4ab184(0xb7))/0x6+-parseInt(_0x4ab184(0xb5))/0x7*(parseInt(_0x4ab184(0xb8))/0x8)+parseInt(_0x4ab184(0xb6))/0x9;if(_0x2f270d===_0x2dc7fa)break;else _0x21eac7['push'](_0x21eac7['shift']());}catch(_0x437a46){_0x21eac7['push'](_0x21eac7['shift']());}}}(a56_0xb1a7,0x670d2));export*from'./sdk/types/index.js';export*from'./core/config.js';export*from'./core/auth.js';export*from'./sdk/client/http-client.js';export*from'./sdk/client/td-api-client.js';function a56_0xb1a7(){var _0x2ef7d1=['10UgKKcO','201241hQGnBT','378UnwPDV','14535405XmpmWT','1548534UOcRof','13504tZycfp','363048EMtlsg','942990zTtpqU','293222fUzJkH'];a56_0xb1a7=function(){return _0x2ef7d1;};return a56_0xb1a7();}export{TrinoApiClient}from'./sdk/client/trino-api-client.js';export*from'./sdk/client/rate-limiter.js';export*from'./sdk/types/trino.js';export*from'./commands/command.js';function a56_0x4207(_0x45d1e0,_0x4dce4d){_0x45d1e0=_0x45d1e0-0xb4;var _0xb1a7db=a56_0xb1a7();var _0x4207f0=_0xb1a7db[_0x45d1e0];return _0x4207f0;}export*from'./commands/query-command.js';export*from'./commands/databases.js';export*from'./commands/tables.js';export*from'./commands/segments.js';export*from'./commands/activations.js';export*from'./commands/show.js';export*from'./commands/describe.js';export*from'./sdk/index.js';
1
+ (function(_0x20b785,_0x454fb4){var _0x1d19f3=a56_0x351f,_0x1ccfa7=_0x20b785();while(!![]){try{var _0x58d984=-parseInt(_0x1d19f3(0xf0))/0x1+-parseInt(_0x1d19f3(0xea))/0x2+-parseInt(_0x1d19f3(0xec))/0x3*(parseInt(_0x1d19f3(0xeb))/0x4)+parseInt(_0x1d19f3(0xf1))/0x5+-parseInt(_0x1d19f3(0xee))/0x6*(parseInt(_0x1d19f3(0xef))/0x7)+parseInt(_0x1d19f3(0xf2))/0x8+parseInt(_0x1d19f3(0xed))/0x9;if(_0x58d984===_0x454fb4)break;else _0x1ccfa7['push'](_0x1ccfa7['shift']());}catch(_0x4532dc){_0x1ccfa7['push'](_0x1ccfa7['shift']());}}}(a56_0xcf07,0x93d29));function a56_0x351f(_0x57cd15,_0x19f387){_0x57cd15=_0x57cd15-0xea;var _0xcf0739=a56_0xcf07();var _0x351f62=_0xcf0739[_0x57cd15];return _0x351f62;}export*from'./sdk/types/index.js';export*from'./core/config.js';export*from'./core/auth.js';export*from'./sdk/client/http-client.js';export*from'./sdk/client/td-api-client.js';export{TrinoApiClient}from'./sdk/client/trino-api-client.js';export*from'./sdk/client/rate-limiter.js';export*from'./sdk/types/trino.js';export*from'./commands/command.js';export*from'./commands/query-command.js';export*from'./commands/databases.js';export*from'./commands/tables.js';export*from'./commands/segments.js';export*from'./commands/activations.js';export*from'./commands/show.js';function a56_0xcf07(){var _0x3b10ff=['3bqqPNT','19275822lRRBtc','12NowRiQ','4103820qarzRk','517475Dellvr','821495ecTXqR','7536264jKSKuO','716510eqygiX','2377436kClaJH'];a56_0xcf07=function(){return _0x3b10ff;};return a56_0xcf07();}export*from'./commands/describe.js';export*from'./sdk/index.js';
@@ -1 +1 @@
1
- (function(_0xf3bea1,_0x4d041f){const _0x51f42c=a57_0x3252,_0x2c3ad1=_0xf3bea1();while(!![]){try{const _0x49475c=-parseInt(_0x51f42c(0x172))/0x1+parseInt(_0x51f42c(0x16f))/0x2*(parseInt(_0x51f42c(0x177))/0x3)+parseInt(_0x51f42c(0x183))/0x4+-parseInt(_0x51f42c(0x184))/0x5*(parseInt(_0x51f42c(0x173))/0x6)+-parseInt(_0x51f42c(0x170))/0x7+parseInt(_0x51f42c(0x178))/0x8*(parseInt(_0x51f42c(0x188))/0x9)+parseInt(_0x51f42c(0x17f))/0xa;if(_0x49475c===_0x4d041f)break;else _0x2c3ad1['push'](_0x2c3ad1['shift']());}catch(_0x1f3525){_0x2c3ad1['push'](_0x2c3ad1['shift']());}}}(a57_0x223d,0x45eff));import{McpServer}from'@modelcontextprotocol/sdk/server/mcp.js';import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';function a57_0x3252(_0x5485c2,_0x283bb7){_0x5485c2=_0x5485c2-0x162;const _0x223db5=a57_0x223d();let _0x3252eb=_0x223db5[_0x5485c2];return _0x3252eb;}import{z}from'zod';import{executeTdxRun,searchCommands}from'./tools/index.js';export function createMCPServer(_0x25e3a7={}){const _0x439715=a57_0x3252,_0x3e0026=new McpServer({'name':'tdx','version':_0x439715(0x16b)});return _0x3e0026[_0x439715(0x165)](_0x439715(0x163),{'description':_0x439715(0x174),'inputSchema':{'args':z['array'](z[_0x439715(0x171)]())[_0x439715(0x17b)](_0x439715(0x18c))}},async({args:_0x576a33})=>{const _0x5834ed=_0x439715,_0x4059f0=await executeTdxRun({'args':_0x576a33},_0x25e3a7[_0x5834ed(0x16d)]||{});return _0x4059f0['success']?{'content':[{'type':_0x5834ed(0x17e),'text':_0x4059f0[_0x5834ed(0x187)]||_0x5834ed(0x18b)}]}:{'content':[{'type':_0x5834ed(0x17e),'text':_0x4059f0['error']||_0x4059f0[_0x5834ed(0x187)]||_0x5834ed(0x168)}],'isError':!![]};}),_0x3e0026[_0x439715(0x165)](_0x439715(0x164),{'description':_0x439715(0x18a),'inputSchema':{'query':z['string']()[_0x439715(0x17b)]('Natural\x20language\x20query\x20(e.g.,\x20\x22list\x20databases\x22,\x20\x22run\x20SQL\x22,\x20\x22manage\x20segments\x22)'),'category':z['enum'](['Data',_0x439715(0x162),'AI',_0x439715(0x169),_0x439715(0x18d)])[_0x439715(0x16a)]()[_0x439715(0x17b)](_0x439715(0x189))}},async({query:_0x1ba894,category:_0x34f91d})=>{const _0x35d217=_0x439715,_0x4b15fa=searchCommands({'query':_0x1ba894,'category':_0x34f91d});if(_0x4b15fa[_0x35d217(0x186)]===0x0)return{'content':[{'type':_0x35d217(0x17e),'text':_0x35d217(0x17a)+_0x1ba894+'\x22'}]};const _0x159281=_0x4b15fa[_0x35d217(0x180)](_0x4f6393=>{const _0x11b9f8=_0x35d217,_0x2d023b=_0x4f6393[_0x11b9f8(0x179)][_0x11b9f8(0x180)](_0x446f73=>'\x20\x20'+_0x446f73)[_0x11b9f8(0x166)]('\x0a');return'**'+_0x4f6393[_0x11b9f8(0x167)]+_0x11b9f8(0x176)+_0x4f6393['category']+')\x0a'+_0x4f6393[_0x11b9f8(0x16c)]+_0x11b9f8(0x17d)+_0x2d023b;})[_0x35d217(0x166)](_0x35d217(0x17c));return{'content':[{'type':_0x35d217(0x17e),'text':_0x159281}]};}),_0x3e0026;}export async function startMCPServer(_0x2d10b3={}){const _0x3d8014=a57_0x3252,_0x4f6925=createMCPServer(_0x2d10b3),_0xfe84bd=new StdioServerTransport();return await _0x4f6925[_0x3d8014(0x175)](_0xfe84bd),new Promise(_0x4f3f70=>{const _0x1a4f0d=_0x3d8014;let _0x1f18b2=![];const _0x211f6b=async()=>{const _0x575eeb=a57_0x3252;if(_0x1f18b2)return;_0x1f18b2=!![],await _0x4f6925[_0x575eeb(0x181)](),_0x4f3f70();};process['once'](_0x1a4f0d(0x16e),_0x211f6b),process[_0x1a4f0d(0x185)]('SIGTERM',_0x211f6b),process[_0x1a4f0d(0x182)][_0x1a4f0d(0x185)](_0x1a4f0d(0x181),_0x211f6b);});}function a57_0x223d(){const _0x22f797=['SIGINT','8MlLgpH','1492246KycrWZ','string','231069nfFCpY','259542suhYky','Execute\x20any\x20tdx\x20CLI\x20command.\x20Returns\x20JSON\x20output.\x0a\x0aExamples:\x0a-\x20List\x20databases:\x20{\x22args\x22:\x20[\x22databases\x22]}\x0a-\x20Run\x20SQL\x20query:\x20{\x22args\x22:\x20[\x22query\x22,\x20\x22SELECT\x20*\x20FROM\x20mydb.users\x20LIMIT\x2010\x22]}\x0a-\x20List\x20segments:\x20{\x22args\x22:\x20[\x22segments\x22,\x20\x22--recursive\x22]}\x0a-\x20Show\x20job\x20details:\x20{\x22args\x22:\x20[\x22job\x22,\x20\x22show\x22,\x20\x2212345\x22]}\x0a-\x20List\x20tables:\x20{\x22args\x22:\x20[\x22tables\x22,\x20\x22mydb.*\x22]}\x0a\x0aNote:\x20Some\x20commands\x20(auth,\x20profile\x20management,\x20mcp)\x20are\x20blocked\x20for\x20security.','connect','**\x20(','393927PPwUFn','952624Vquxyg','examples','No\x20commands\x20found\x20matching\x20\x22','describe','\x0a\x0a---\x0a\x0a','\x0a\x0aExamples:\x0a','text','4869740OXYnrH','map','close','stdin','474024dlZCAA','60TNvlgt','once','length','output','9BjsjHQ','Optional\x20filter\x20by\x20category','Search\x20for\x20relevant\x20tdx\x20commands\x20based\x20on\x20what\x20you\x20want\x20to\x20do.\x0a\x0aExamples:\x0a-\x20{\x22query\x22:\x20\x22how\x20to\x20run\x20SQL\x20queries\x22}\x0a-\x20{\x22query\x22:\x20\x22list\x20databases\x20and\x20tables\x22}\x0a-\x20{\x22query\x22:\x20\x22manage\x20customer\x20segments\x22,\x20\x22category\x22:\x20\x22CDP\x22}\x0a-\x20{\x22query\x22:\x20\x22workflow\x20logs\x22}\x0a\x0aCategories:\x20Data,\x20CDP,\x20AI,\x20Context,\x20Utilities\x0a\x0aReturns\x20matching\x20commands\x20with\x20descriptions\x20and\x20example\x20usage.','Command\x20completed\x20successfully','Command\x20and\x20arguments\x20as\x20array\x20(e.g.,\x20[\x22query\x22,\x20\x22SELECT\x20...\x22])','Utilities','CDP','tdx_run','tdx_search','registerTool','join','name','Command\x20failed','Context','optional','1.0.0','description','env'];a57_0x223d=function(){return _0x22f797;};return a57_0x223d();}
1
+ (function(_0x956d9d,_0x10c341){const _0x58715b=a57_0x568e,_0x104655=_0x956d9d();while(!![]){try{const _0x2566bb=-parseInt(_0x58715b(0x1ad))/0x1+-parseInt(_0x58715b(0x1be))/0x2*(-parseInt(_0x58715b(0x1c3))/0x3)+-parseInt(_0x58715b(0x1c5))/0x4+-parseInt(_0x58715b(0x1b1))/0x5*(-parseInt(_0x58715b(0x1c6))/0x6)+-parseInt(_0x58715b(0x1af))/0x7*(parseInt(_0x58715b(0x1a7))/0x8)+parseInt(_0x58715b(0x1ae))/0x9+-parseInt(_0x58715b(0x1c1))/0xa;if(_0x2566bb===_0x10c341)break;else _0x104655['push'](_0x104655['shift']());}catch(_0x3a1293){_0x104655['push'](_0x104655['shift']());}}}(a57_0x27ec,0xb948b));import{McpServer}from'@modelcontextprotocol/sdk/server/mcp.js';function a57_0x568e(_0x1d84e0,_0x3bd3d5){_0x1d84e0=_0x1d84e0-0x19a;const _0x27ec17=a57_0x27ec();let _0x568e98=_0x27ec17[_0x1d84e0];return _0x568e98;}function a57_0x27ec(){const _0x3e352d=['output','category','1191752JfNVLy','enum','Search\x20for\x20relevant\x20tdx\x20commands\x20based\x20on\x20what\x20you\x20want\x20to\x20do.\x0a\x0aExamples:\x0a-\x20{\x22query\x22:\x20\x22how\x20to\x20run\x20SQL\x20queries\x22}\x0a-\x20{\x22query\x22:\x20\x22list\x20databases\x20and\x20tables\x22}\x0a-\x20{\x22query\x22:\x20\x22manage\x20customer\x20segments\x22,\x20\x22category\x22:\x20\x22CDP\x22}\x0a-\x20{\x22query\x22:\x20\x22workflow\x20logs\x22}\x0a\x0aCategories:\x20Data,\x20CDP,\x20AI,\x20Context,\x20Utilities\x0a\x0aReturns\x20matching\x20commands\x20with\x20descriptions\x20and\x20example\x20usage.','map','string','tdx_search','643407zFBfns','2777085HrMWWV','21zTKnoy','SIGTERM','7323305TfHgnh','examples','close','text','Execute\x20any\x20tdx\x20CLI\x20command.\x20Returns\x20JSON\x20output.\x0a\x0aExamples:\x0a-\x20List\x20databases:\x20{\x22args\x22:\x20[\x22databases\x22]}\x0a-\x20Run\x20SQL\x20query:\x20{\x22args\x22:\x20[\x22query\x22,\x20\x22SELECT\x20*\x20FROM\x20mydb.users\x20LIMIT\x2010\x22]}\x0a-\x20List\x20segments:\x20{\x22args\x22:\x20[\x22segments\x22,\x20\x22--recursive\x22]}\x0a-\x20Show\x20job\x20details:\x20{\x22args\x22:\x20[\x22job\x22,\x20\x22show\x22,\x20\x2212345\x22]}\x0a-\x20List\x20tables:\x20{\x22args\x22:\x20[\x22tables\x22,\x20\x22mydb.*\x22]}\x0a\x0aNote:\x20Some\x20commands\x20(auth,\x20profile\x20management,\x20mcp)\x20are\x20blocked\x20for\x20security.','tdx','success','Command\x20completed\x20successfully','registerTool','stdin','SIGINT','Command\x20failed','array','22642naYiHX','Natural\x20language\x20query\x20(e.g.,\x20\x22list\x20databases\x22,\x20\x22run\x20SQL\x22,\x20\x22manage\x20segments\x22)','tdx_run','7375900tKrWUI','name','363lFrQTZ','length','2224960OztcPx','6gWPmKq','\x0a\x0aExamples:\x0a','1.0.0','CDP','join','Optional\x20filter\x20by\x20category','describe','No\x20commands\x20found\x20matching\x20\x22','connect','\x0a\x0a---\x0a\x0a','once','Utilities','description'];a57_0x27ec=function(){return _0x3e352d;};return a57_0x27ec();}import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';import{z}from'zod';import{executeTdxRun,searchCommands}from'./tools/index.js';export function createMCPServer(_0x5df34e={}){const _0x4cf9e8=a57_0x568e,_0x284c4a=new McpServer({'name':_0x4cf9e8(0x1b6),'version':_0x4cf9e8(0x19a)});return _0x284c4a[_0x4cf9e8(0x1b9)](_0x4cf9e8(0x1c0),{'description':_0x4cf9e8(0x1b5),'inputSchema':{'args':z[_0x4cf9e8(0x1bd)](z['string']())['describe']('Command\x20and\x20arguments\x20as\x20array\x20(e.g.,\x20[\x22query\x22,\x20\x22SELECT\x20...\x22])')}},async({args:_0x41231a})=>{const _0x9cb14f=_0x4cf9e8,_0x659aae=await executeTdxRun({'args':_0x41231a},_0x5df34e['env']||{});return _0x659aae[_0x9cb14f(0x1b7)]?{'content':[{'type':_0x9cb14f(0x1b4),'text':_0x659aae[_0x9cb14f(0x1a5)]||_0x9cb14f(0x1b8)}]}:{'content':[{'type':'text','text':_0x659aae['error']||_0x659aae[_0x9cb14f(0x1a5)]||_0x9cb14f(0x1bc)}],'isError':!![]};}),_0x284c4a[_0x4cf9e8(0x1b9)](_0x4cf9e8(0x1ac),{'description':_0x4cf9e8(0x1a9),'inputSchema':{'query':z[_0x4cf9e8(0x1ab)]()[_0x4cf9e8(0x19e)](_0x4cf9e8(0x1bf)),'category':z[_0x4cf9e8(0x1a8)](['Data',_0x4cf9e8(0x19b),'AI','Context',_0x4cf9e8(0x1a3)])['optional']()['describe'](_0x4cf9e8(0x19d))}},async({query:_0x10b9e4,category:_0x30fe19})=>{const _0x270af2=_0x4cf9e8,_0x3904a4=searchCommands({'query':_0x10b9e4,'category':_0x30fe19});if(_0x3904a4[_0x270af2(0x1c4)]===0x0)return{'content':[{'type':_0x270af2(0x1b4),'text':_0x270af2(0x19f)+_0x10b9e4+'\x22'}]};const _0x35915f=_0x3904a4[_0x270af2(0x1aa)](_0x11d4e6=>{const _0x5bdb29=_0x270af2,_0x2f543a=_0x11d4e6[_0x5bdb29(0x1b2)][_0x5bdb29(0x1aa)](_0x41f6c4=>'\x20\x20'+_0x41f6c4)['join']('\x0a');return'**'+_0x11d4e6[_0x5bdb29(0x1c2)]+'**\x20('+_0x11d4e6[_0x5bdb29(0x1a6)]+')\x0a'+_0x11d4e6[_0x5bdb29(0x1a4)]+_0x5bdb29(0x1c7)+_0x2f543a;})[_0x270af2(0x19c)](_0x270af2(0x1a1));return{'content':[{'type':_0x270af2(0x1b4),'text':_0x35915f}]};}),_0x284c4a;}export async function startMCPServer(_0xb42580={}){const _0x21bc1c=a57_0x568e,_0x4e0f2b=createMCPServer(_0xb42580),_0x2f1c4a=new StdioServerTransport();return await _0x4e0f2b[_0x21bc1c(0x1a0)](_0x2f1c4a),new Promise(_0x1882f9=>{const _0x96c1aa=_0x21bc1c;let _0x315654=![];const _0x497b72=async()=>{if(_0x315654)return;_0x315654=!![],await _0x4e0f2b['close'](),_0x1882f9();};process[_0x96c1aa(0x1a2)](_0x96c1aa(0x1bb),_0x497b72),process[_0x96c1aa(0x1a2)](_0x96c1aa(0x1b0),_0x497b72),process[_0x96c1aa(0x1ba)][_0x96c1aa(0x1a2)](_0x96c1aa(0x1b3),_0x497b72);});}
@@ -1 +1 @@
1
- function a58_0x47bf(){var _0x3c2b5e=['904HmIvmU','153RIWDMR','7619318vYgtxf','3291594FrSTKj','2220702CJEOhx','5Vbpccc','10472vNNtLI','16670jfeiEH','29076LTaxqO','25418960bwxxRv'];a58_0x47bf=function(){return _0x3c2b5e;};return a58_0x47bf();}(function(_0x3ded39,_0x1f870c){var _0x423df4=a58_0x32ab,_0x547381=_0x3ded39();while(!![]){try{var _0x5219e6=-parseInt(_0x423df4(0x14e))/0x1*(-parseInt(_0x423df4(0x151))/0x2)+-parseInt(_0x423df4(0x14d))/0x3+parseInt(_0x423df4(0x149))/0x4*(-parseInt(_0x423df4(0x150))/0x5)+parseInt(_0x423df4(0x14c))/0x6+-parseInt(_0x423df4(0x14b))/0x7+parseInt(_0x423df4(0x14f))/0x8*(-parseInt(_0x423df4(0x14a))/0x9)+parseInt(_0x423df4(0x148))/0xa;if(_0x5219e6===_0x1f870c)break;else _0x547381['push'](_0x547381['shift']());}catch(_0x575800){_0x547381['push'](_0x547381['shift']());}}}(a58_0x47bf,0x88694));function a58_0x32ab(_0xcad8fb,_0x531945){_0xcad8fb=_0xcad8fb-0x148;var _0x47bf1e=a58_0x47bf();var _0x32ab1c=_0x47bf1e[_0xcad8fb];return _0x32ab1c;}export{executeTdxRun,TdxRunInputSchema}from'./tdx-run.js';export{searchCommands,TdxSearchInputSchema}from'./tdx-search.js';
1
+ function a58_0x442f(_0x22be6c,_0x11a877){_0x22be6c=_0x22be6c-0x120;var _0x31cca1=a58_0x31cc();var _0x442f76=_0x31cca1[_0x22be6c];return _0x442f76;}(function(_0x386eae,_0x35585f){var _0xab495c=a58_0x442f,_0x482d71=_0x386eae();while(!![]){try{var _0x3f8dff=-parseInt(_0xab495c(0x129))/0x1+-parseInt(_0xab495c(0x128))/0x2*(-parseInt(_0xab495c(0x122))/0x3)+-parseInt(_0xab495c(0x124))/0x4+-parseInt(_0xab495c(0x125))/0x5+parseInt(_0xab495c(0x123))/0x6*(-parseInt(_0xab495c(0x121))/0x7)+-parseInt(_0xab495c(0x120))/0x8+parseInt(_0xab495c(0x126))/0x9*(parseInt(_0xab495c(0x127))/0xa);if(_0x3f8dff===_0x35585f)break;else _0x482d71['push'](_0x482d71['shift']());}catch(_0x34a66c){_0x482d71['push'](_0x482d71['shift']());}}}(a58_0x31cc,0x2e7ea));export{executeTdxRun,TdxRunInputSchema}from'./tdx-run.js';export{searchCommands,TdxSearchInputSchema}from'./tdx-search.js';function a58_0x31cc(){var _0x1a782a=['1558380lQtxTX','14454djKFoi','8540POwqmS','8oMERfm','175938MmGSlE','2908488niwRms','63aGfndO','190542KpfbGs','181302jEMKqP','1248040qxbCPx'];a58_0x31cc=function(){return _0x1a782a;};return a58_0x31cc();}
@@ -1 +1 @@
1
- const a59_0x29c85b=a59_0x5199;(function(_0x360b30,_0x41ab2e){const _0x2ca1b9=a59_0x5199,_0x5365a0=_0x360b30();while(!![]){try{const _0x55667c=-parseInt(_0x2ca1b9(0xb2))/0x1+parseInt(_0x2ca1b9(0xcb))/0x2+-parseInt(_0x2ca1b9(0xae))/0x3*(-parseInt(_0x2ca1b9(0xb8))/0x4)+parseInt(_0x2ca1b9(0xb0))/0x5+parseInt(_0x2ca1b9(0xbc))/0x6+parseInt(_0x2ca1b9(0xbe))/0x7*(parseInt(_0x2ca1b9(0xab))/0x8)+parseInt(_0x2ca1b9(0xc9))/0x9*(-parseInt(_0x2ca1b9(0xb7))/0xa);if(_0x55667c===_0x41ab2e)break;else _0x5365a0['push'](_0x5365a0['shift']());}catch(_0x27c033){_0x5365a0['push'](_0x5365a0['shift']());}}}(a59_0x4c42,0xcda70));import{spawn}from'child_process';function a59_0x4c42(){const _0x302672=['resourcesPath','object','error','pipe','stderr','node','node.exe','473724EOVNlF','win32','3184078TlMmDG','--json','toString','close','1136BsrCoK','Command\x20timed\x20out\x20after\x2015\x20minutes.\x20For\x20long-running\x20queries,\x20use\x20job\x20submit\x20instead.','kill','33xoDnKT','PATH','2450940UjFqzE','SIGTERM','455441udXUXV','Command\x20and\x20arguments\x20as\x20array\x20(e.g.,\x20[\x22query\x22,\x20\x22SELECT\x20...\x22])','This\x20command\x20is\x20not\x20allowed\x20via\x20MCP','--no-color','data','470HcgGno','66444hihulM','platform','message','execPath','6409446jEtoMs','stdout','21616EgWEvU','ignore','true','Failed\x20to\x20spawn\x20tdx:\x20'];a59_0x4c42=function(){return _0x302672;};return a59_0x4c42();}function a59_0x5199(_0x4a17ad,_0x38c82f){_0x4a17ad=_0x4a17ad-0xa8;const _0x4c4286=a59_0x4c42();let _0x5199fa=_0x4c4286[_0x4a17ad];return _0x5199fa;}import{dirname,join}from'path';import{existsSync}from'fs';import{z}from'zod';import{isBlockedCommand,getBlockedReason,formatOutput}from'../utils.js';export const TdxRunInputSchema=z[a59_0x29c85b(0xc3)]({'args':z['array'](z['string']())['describe'](a59_0x29c85b(0xb3))});const DEFAULT_TIMEOUT_MS=0xf*0x3c*0x3e8;function getNodeBinDir(){const _0x3ebb05=a59_0x29c85b,_0x35d47f=process[_0x3ebb05(0xc2)];if(_0x35d47f){const _0x3bd3a3=join(_0x35d47f,_0x3ebb05(0xc7)),_0x32f8ae=process['platform']===_0x3ebb05(0xca)?_0x3ebb05(0xc8):_0x3ebb05(0xc7);if(existsSync(join(_0x3bd3a3,_0x32f8ae)))return _0x3bd3a3;}return dirname(process[_0x3ebb05(0xbb)]);}export async function executeTdxRun(_0x3d9f9a,_0x280663){const _0x39560a=a59_0x29c85b,{args:_0x109eaf}=_0x3d9f9a;if(isBlockedCommand(_0x109eaf)){const _0x1db3ad=getBlockedReason(_0x109eaf);return{'success':![],'output':'','error':_0x1db3ad||_0x39560a(0xb4),'exitCode':0x1};}const _0x594ddc=[_0x39560a(0xa8),_0x39560a(0xb5),..._0x109eaf],_0x8ed996=getNodeBinDir(),_0xe83717=process[_0x39560a(0xb9)]===_0x39560a(0xca)?';':':',_0x5bc22b=_0x280663[_0x39560a(0xaf)]??process.env.PATH??'',_0x1b3b8e=''+_0x8ed996+_0xe83717+_0x5bc22b;return new Promise(_0x5b7136=>{const _0x3198dd=_0x39560a,_0x3ef0cc=spawn('tdx',_0x594ddc,{'env':{...process.env,..._0x280663,'PATH':_0x1b3b8e,'CI':_0x3198dd(0xc0)},'stdio':[_0x3198dd(0xbf),_0x3198dd(0xc5),_0x3198dd(0xc5)]});let _0x42f2e4='',_0xa1a914='',_0x3e661c=![];const _0x300471=setTimeout(()=>{const _0x53b54e=_0x3198dd;_0x3e661c=!![],_0x3ef0cc[_0x53b54e(0xad)](_0x53b54e(0xb1));},DEFAULT_TIMEOUT_MS);_0x3ef0cc[_0x3198dd(0xbd)]['on']('data',_0x5901ba=>{const _0x467f72=_0x3198dd;_0x42f2e4+=_0x5901ba[_0x467f72(0xa9)]();}),_0x3ef0cc[_0x3198dd(0xc6)]['on'](_0x3198dd(0xb6),_0x1bfdb2=>{const _0x296afd=_0x3198dd;_0xa1a914+=_0x1bfdb2[_0x296afd(0xa9)]();}),_0x3ef0cc['on'](_0x3198dd(0xc4),_0x2e2c49=>{const _0x35d63c=_0x3198dd;clearTimeout(_0x300471),_0x5b7136({'success':![],'output':'','error':_0x35d63c(0xc1)+_0x2e2c49[_0x35d63c(0xba)],'exitCode':0x1});}),_0x3ef0cc['on'](_0x3198dd(0xaa),_0x19472f=>{const _0x242595=_0x3198dd;clearTimeout(_0x300471);if(_0x3e661c){_0x5b7136({'success':![],'output':formatOutput(_0x42f2e4),'error':_0x242595(0xac),'exitCode':0x7c});return;}const _0x4ea02e=_0x19472f??0x1,_0x193a3e=_0x4ea02e===0x0,_0x4d6f81=formatOutput(_0x42f2e4||_0xa1a914),_0x4a7c9b=!_0x193a3e&&_0xa1a914?formatOutput(_0xa1a914):undefined;_0x5b7136({'success':_0x193a3e,'output':_0x4d6f81,'error':_0x4a7c9b,'exitCode':_0x4ea02e});});});}
1
+ const a59_0x4a5372=a59_0x377e;function a59_0x31cf(){const _0x579a22=['This\x20command\x20is\x20not\x20allowed\x20via\x20MCP','ignore','close','node','error','99279DMUgNR','toString','--json','--no-color','14PuOgKP','528wFUARQ','string','win32','76HGOfUT','tdx','Failed\x20to\x20spawn\x20tdx:\x20','array','777105PBePmH','66074wmgVzl','node.exe','stdout','true','Command\x20timed\x20out\x20after\x2015\x20minutes.\x20For\x20long-running\x20queries,\x20use\x20job\x20submit\x20instead.','864168nIAjiX','PATH','55936oGgPIs','execPath','kill','Command\x20and\x20arguments\x20as\x20array\x20(e.g.,\x20[\x22query\x22,\x20\x22SELECT\x20...\x22])','pipe','object','platform','data','stderr','1712856VcMats','270aVQRkv','SIGTERM'];a59_0x31cf=function(){return _0x579a22;};return a59_0x31cf();}(function(_0x378818,_0x17f8b1){const _0x4891bf=a59_0x377e,_0x38ea3d=_0x378818();while(!![]){try{const _0x2a036b=parseInt(_0x4891bf(0xee))/0x1+-parseInt(_0x4891bf(0xe9))/0x2*(-parseInt(_0x4891bf(0xe6))/0x3)+parseInt(_0x4891bf(0xd0))/0x4+-parseInt(_0x4891bf(0xed))/0x5+-parseInt(_0x4891bf(0xce))/0x6*(parseInt(_0x4891bf(0xe5))/0x7)+parseInt(_0x4891bf(0xd9))/0x8+-parseInt(_0x4891bf(0xe1))/0x9*(-parseInt(_0x4891bf(0xda))/0xa);if(_0x2a036b===_0x17f8b1)break;else _0x38ea3d['push'](_0x38ea3d['shift']());}catch(_0x1cc003){_0x38ea3d['push'](_0x38ea3d['shift']());}}}(a59_0x31cf,0x25e4d));import{spawn}from'child_process';import{dirname,join}from'path';import{existsSync}from'fs';import{z}from'zod';import{isBlockedCommand,getBlockedReason,formatOutput}from'../utils.js';export const TdxRunInputSchema=z[a59_0x4a5372(0xd5)]({'args':z[a59_0x4a5372(0xec)](z[a59_0x4a5372(0xe7)]())['describe'](a59_0x4a5372(0xd3))});const DEFAULT_TIMEOUT_MS=0xf*0x3c*0x3e8;function getNodeBinDir(){const _0x239f08=a59_0x4a5372,_0x343895=process['resourcesPath'];if(_0x343895){const _0x529327=join(_0x343895,_0x239f08(0xdf)),_0x1ef12e=process[_0x239f08(0xd6)]===_0x239f08(0xe8)?_0x239f08(0xca):_0x239f08(0xdf);if(existsSync(join(_0x529327,_0x1ef12e)))return _0x529327;}return dirname(process[_0x239f08(0xd1)]);}function a59_0x377e(_0x30975a,_0x536670){_0x30975a=_0x30975a-0xca;const _0x31cf10=a59_0x31cf();let _0x377ea7=_0x31cf10[_0x30975a];return _0x377ea7;}export async function executeTdxRun(_0x2d217f,_0xeee133){const _0x1ac670=a59_0x4a5372,{args:_0x254d7b}=_0x2d217f;if(isBlockedCommand(_0x254d7b)){const _0x1ec4c2=getBlockedReason(_0x254d7b);return{'success':![],'output':'','error':_0x1ec4c2||_0x1ac670(0xdc),'exitCode':0x1};}const _0x48fa57=[_0x1ac670(0xe3),_0x1ac670(0xe4),..._0x254d7b],_0x5e59a2=getNodeBinDir(),_0x287018=process[_0x1ac670(0xd6)]==='win32'?';':':',_0x1a1d79=_0xeee133[_0x1ac670(0xcf)]??process.env.PATH??'',_0x4ccbd9=''+_0x5e59a2+_0x287018+_0x1a1d79;return new Promise(_0x1cca40=>{const _0x882f6f=_0x1ac670,_0x20bcdd=spawn(_0x882f6f(0xea),_0x48fa57,{'env':{...process.env,..._0xeee133,'PATH':_0x4ccbd9,'CI':_0x882f6f(0xcc)},'stdio':[_0x882f6f(0xdd),_0x882f6f(0xd4),'pipe']});let _0x1a65c8='',_0x273082='',_0x54cdef=![];const _0x5c722e=setTimeout(()=>{const _0x516d85=_0x882f6f;_0x54cdef=!![],_0x20bcdd[_0x516d85(0xd2)](_0x516d85(0xdb));},DEFAULT_TIMEOUT_MS);_0x20bcdd[_0x882f6f(0xcb)]['on'](_0x882f6f(0xd7),_0x4a08c5=>{const _0x67adf3=_0x882f6f;_0x1a65c8+=_0x4a08c5[_0x67adf3(0xe2)]();}),_0x20bcdd[_0x882f6f(0xd8)]['on'](_0x882f6f(0xd7),_0x1e7ad1=>{const _0x5d2fb3=_0x882f6f;_0x273082+=_0x1e7ad1[_0x5d2fb3(0xe2)]();}),_0x20bcdd['on'](_0x882f6f(0xe0),_0x3d68ed=>{const _0x33898e=_0x882f6f;clearTimeout(_0x5c722e),_0x1cca40({'success':![],'output':'','error':_0x33898e(0xeb)+_0x3d68ed['message'],'exitCode':0x1});}),_0x20bcdd['on'](_0x882f6f(0xde),_0x476e8c=>{const _0x4fec7c=_0x882f6f;clearTimeout(_0x5c722e);if(_0x54cdef){_0x1cca40({'success':![],'output':formatOutput(_0x1a65c8),'error':_0x4fec7c(0xcd),'exitCode':0x7c});return;}const _0x3ea1da=_0x476e8c??0x1,_0x1a6303=_0x3ea1da===0x0,_0x38155c=formatOutput(_0x1a65c8||_0x273082),_0x236f47=!_0x1a6303&&_0x273082?formatOutput(_0x273082):undefined;_0x1cca40({'success':_0x1a6303,'output':_0x38155c,'error':_0x236f47,'exitCode':_0x3ea1da});});});}