@treasuredata/tdx 0.28.3 → 0.28.5

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 (184) 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/delivery-command.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-campaign-pull-command.js +1 -1
  20. package/dist/commands/engage-campaign-push-command.js +1 -1
  21. package/dist/commands/engage-campaign-validate-command.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/journey-command.js +1 -1
  25. package/dist/commands/journey-validate-command.js +1 -1
  26. package/dist/commands/llm-command.js +1 -1
  27. package/dist/commands/mcp-command.js +1 -1
  28. package/dist/commands/parent-segment-command.js +1 -1
  29. package/dist/commands/profile-command.js +1 -1
  30. package/dist/commands/profiles-command.js +1 -1
  31. package/dist/commands/query-command.js +1 -1
  32. package/dist/commands/schedule-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pull-command.js +1 -1
  37. package/dist/commands/segment-push-command.js +1 -1
  38. package/dist/commands/segment-update-command.js +1 -1
  39. package/dist/commands/segment-use-command.js +1 -1
  40. package/dist/commands/segment-validate-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/status-command.js +1 -1
  44. package/dist/commands/tables.js +1 -1
  45. package/dist/commands/unset-command.js +1 -1
  46. package/dist/commands/use-command.js +1 -1
  47. package/dist/commands/user-command.js +1 -1
  48. package/dist/commands/workflow-command.js +1 -1
  49. package/dist/core/auth.js +1 -1
  50. package/dist/core/command-output.js +1 -1
  51. package/dist/core/config.js +1 -1
  52. package/dist/core/connection-cache.js +1 -1
  53. package/dist/core/constants.js +1 -1
  54. package/dist/core/credential-cache.js +1 -1
  55. package/dist/core/global-context.js +1 -1
  56. package/dist/core/keychain.js +1 -1
  57. package/dist/core/profile.js +1 -1
  58. package/dist/core/project-config.js +1 -1
  59. package/dist/core/session.js +1 -1
  60. package/dist/core/user-cache.js +1 -1
  61. package/dist/core/version.js +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/mcp/server.js +1 -1
  64. package/dist/mcp/tools/index.js +1 -1
  65. package/dist/mcp/tools/tdx-run.js +1 -1
  66. package/dist/mcp/tools/tdx-search.js +1 -1
  67. package/dist/mcp/utils.js +1 -1
  68. package/dist/proxy/claude-usage-tracker.js +1 -1
  69. package/dist/proxy/passthrough-server.js +1 -1
  70. package/dist/proxy/sse-usage-parser.js +1 -1
  71. package/dist/sdk/agent/agent-config.js +1 -1
  72. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  73. package/dist/sdk/agent/agent-yaml.js +1 -1
  74. package/dist/sdk/agent/test/evaluator.js +1 -1
  75. package/dist/sdk/agent/test/executor.js +1 -1
  76. package/dist/sdk/agent/test/index.js +1 -1
  77. package/dist/sdk/agent/test/output.js +1 -1
  78. package/dist/sdk/agent/test/parser.js +1 -1
  79. package/dist/sdk/agent/tool-target-registry.js +1 -1
  80. package/dist/sdk/api.js +1 -1
  81. package/dist/sdk/client/cdp-api-client.js +1 -1
  82. package/dist/sdk/client/delivery-api-client.js +1 -1
  83. package/dist/sdk/client/endpoints.js +1 -1
  84. package/dist/sdk/client/engage-api-client.js +1 -1
  85. package/dist/sdk/client/http-client.js +1 -1
  86. package/dist/sdk/client/llm-api-client.js +1 -1
  87. package/dist/sdk/client/rate-limiter.js +1 -1
  88. package/dist/sdk/client/td-api-client.js +1 -1
  89. package/dist/sdk/client/trino-api-client.js +1 -1
  90. package/dist/sdk/client/workflow-client.js +1 -1
  91. package/dist/sdk/connection-validator.js +1 -1
  92. package/dist/sdk/connection.js +1 -1
  93. package/dist/sdk/delivery.js +1 -1
  94. package/dist/sdk/engage/campaign-pull.js +1 -1
  95. package/dist/sdk/engage/campaign-push.js +1 -1
  96. package/dist/sdk/engage/campaign-validator.js +1 -1
  97. package/dist/sdk/engage/campaign-yaml.js +1 -1
  98. package/dist/sdk/engage/types/campaign-def.js +1 -1
  99. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  100. package/dist/sdk/engage.js +1 -1
  101. package/dist/sdk/errors.js +1 -1
  102. package/dist/sdk/index.js +1 -1
  103. package/dist/sdk/io/index.js +1 -1
  104. package/dist/sdk/io/node-filesystem.js +1 -1
  105. package/dist/sdk/job.js +1 -1
  106. package/dist/sdk/journey.js +1 -1
  107. package/dist/sdk/llm/chat-cache.js +1 -1
  108. package/dist/sdk/llm/index.js +1 -1
  109. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  110. package/dist/sdk/llm/model-factors.js +1 -1
  111. package/dist/sdk/personalization.js +1 -1
  112. package/dist/sdk/query/index.js +1 -1
  113. package/dist/sdk/query/sql-parser.js +1 -1
  114. package/dist/sdk/realtime.js +1 -1
  115. package/dist/sdk/schedule.js +1 -1
  116. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  117. package/dist/sdk/segment/fields-display.js +1 -1
  118. package/dist/sdk/segment/file-discovery.js +1 -1
  119. package/dist/sdk/segment/journey-utils.d.ts.map +1 -1
  120. package/dist/sdk/segment/journey-utils.js +1 -1
  121. package/dist/sdk/segment/journey-utils.js.map +1 -1
  122. package/dist/sdk/segment/journey-validator.js +1 -1
  123. package/dist/sdk/segment/journey-validator.js.map +1 -1
  124. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  125. package/dist/sdk/segment/journey-yaml.js +1 -1
  126. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  127. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  128. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  129. package/dist/sdk/segment/pull-workflow.js +1 -1
  130. package/dist/sdk/segment/push-recovery.js +1 -1
  131. package/dist/sdk/segment/push-workflow.js +1 -1
  132. package/dist/sdk/segment/resolution-context.js +1 -1
  133. package/dist/sdk/segment/segment-path-parser.js +1 -1
  134. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  135. package/dist/sdk/segment/target-resolution.js +1 -1
  136. package/dist/sdk/segment/tdx-config.js +1 -1
  137. package/dist/sdk/segment/validate-files.js +1 -1
  138. package/dist/sdk/segment/yaml-validator.js +1 -1
  139. package/dist/sdk/segment.js +1 -1
  140. package/dist/sdk/types/index.js +1 -1
  141. package/dist/sdk/types/progress.js +1 -1
  142. package/dist/sdk/user.js +1 -1
  143. package/dist/sdk/util/format-detector.js +1 -1
  144. package/dist/sdk/util/formatters.js +1 -1
  145. package/dist/sdk/util/index.js +1 -1
  146. package/dist/sdk/util/tree-formatter.js +1 -1
  147. package/dist/sdk/workflow/archive-validation.js +1 -1
  148. package/dist/sdk/workflow/clone-workflow.js +1 -1
  149. package/dist/sdk/workflow/index.js +1 -1
  150. package/dist/sdk/workflow/pull-workflow.js +1 -1
  151. package/dist/sdk/workflow/push-workflow.js +1 -1
  152. package/dist/sdk/workflow/tdx-config.js +1 -1
  153. package/dist/sdk/workflow/workflow-utils.js +1 -1
  154. package/dist/test-utils/command-runner.js +1 -1
  155. package/dist/test-utils/factories.js +1 -1
  156. package/dist/test-utils/fixtures.js +1 -1
  157. package/dist/test-utils/http-mock.js +1 -1
  158. package/dist/test-utils/index.js +1 -1
  159. package/dist/utils/async.js +1 -1
  160. package/dist/utils/colors.js +1 -1
  161. package/dist/utils/diff.js +1 -1
  162. package/dist/utils/file-permissions.js +1 -1
  163. package/dist/utils/global-cache.js +1 -1
  164. package/dist/utils/json-loader.js +1 -1
  165. package/dist/utils/local-cache.js +1 -1
  166. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  167. package/dist/utils/logger/formatters/index.js +1 -1
  168. package/dist/utils/logger/handlers/console-handler.js +1 -1
  169. package/dist/utils/logger/handlers/file-handler.js +1 -1
  170. package/dist/utils/logger/handlers/index.js +1 -1
  171. package/dist/utils/logger/handlers/null-handler.js +1 -1
  172. package/dist/utils/logger/index.js +1 -1
  173. package/dist/utils/logger/logger.js +1 -1
  174. package/dist/utils/logger/types.js +1 -1
  175. package/dist/utils/option-validation.js +1 -1
  176. package/dist/utils/process.js +1 -1
  177. package/dist/utils/prompt.js +1 -1
  178. package/dist/utils/spinner.js +1 -1
  179. package/dist/utils/sse-parser.js +1 -1
  180. package/dist/utils/string-utils.js +1 -1
  181. package/dist/utils/table-ref-parser.js +1 -1
  182. package/dist/utils/tdx-logger.js +1 -1
  183. package/dist/utils/version-check.js +1 -1
  184. package/package.json +1 -1
@@ -1 +1 @@
1
- const a49_0x5058bd=a49_0x147d;(function(_0x399ba4,_0x4e5632){const _0x352733=a49_0x147d,_0x4fc7cb=_0x399ba4();while(!![]){try{const _0x466429=parseInt(_0x352733(0x1ae))/0x1*(-parseInt(_0x352733(0x1d9))/0x2)+parseInt(_0x352733(0x1df))/0x3+parseInt(_0x352733(0x1e1))/0x4*(parseInt(_0x352733(0x1ea))/0x5)+parseInt(_0x352733(0x1ad))/0x6*(parseInt(_0x352733(0x1bc))/0x7)+-parseInt(_0x352733(0x1ca))/0x8+-parseInt(_0x352733(0x1de))/0x9*(parseInt(_0x352733(0x1af))/0xa)+parseInt(_0x352733(0x1c4))/0xb*(parseInt(_0x352733(0x1be))/0xc);if(_0x466429===_0x4e5632)break;else _0x4fc7cb['push'](_0x4fc7cb['shift']());}catch(_0xe4b340){_0x4fc7cb['push'](_0x4fc7cb['shift']());}}}(a49_0x5dec,0xb04b2));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a49_0x10ee6d from'node:fs';import*as a49_0x39b424 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 a49_0x415371 from'chalk';import{getGlobalCacheDir,createOptionalProfileCache}from'../utils/global-cache.js';export function getConfigDir(){const _0x14a0f6=a49_0x147d;return process.env.TDX_CONFIG_DIR||join(homedir(),_0x14a0f6(0x1eb),_0x14a0f6(0x1aa));}export function getConfigFile(){const _0x490644=a49_0x147d;return join(getConfigDir(),_0x490644(0x1e3));}export function getConfigFilePath(_0x431fdf){const _0x59701d=a49_0x147d,_0x3cf338=getConfigDir();return _0x431fdf?a49_0x39b424[_0x59701d(0x1d3)](_0x3cf338,_0x59701d(0x1c7)+_0x431fdf):getConfigFile();}export function getCacheDir(){return getGlobalCacheDir();}const llmProjectCache=createOptionalProfileCache(a49_0x5058bd(0x1d1),a49_0x5058bd(0x1b6));function a49_0x147d(_0x15c5ba,_0x231a8e){_0x15c5ba=_0x15c5ba-0x1a5;const _0x5dec9f=a49_0x5dec();let _0x147d98=_0x5dec9f[_0x15c5ba];return _0x147d98;}export function getLLMProjectCacheFile(_0x14b503){const _0x2f8c25=a49_0x5058bd;return llmProjectCache[_0x2f8c25(0x1ed)](_0x14b503);}export function readCachedLLMProject(_0x46458e){const _0x24a0e0=a49_0x5058bd,_0x1298de=llmProjectCache[_0x24a0e0(0x1d5)](_0x46458e);if(_0x1298de&&typeof _0x1298de['id']==='string'&&typeof _0x1298de[_0x24a0e0(0x1d4)]===_0x24a0e0(0x1b5))return _0x1298de;return null;}export function writeCachedLLMProject(_0x602e22,_0x4714dc,_0x531163){try{llmProjectCache['write']({'name':_0x602e22,'id':_0x4714dc},_0x531163);}catch{}}const llmAgentCache=createOptionalProfileCache(a49_0x5058bd(0x1b3),'config/llm-agent');export function getLLMAgentCacheFile(_0x557f30){return llmAgentCache['path'](_0x557f30);}export function readCachedLLMAgent(_0x3e3da1){const _0x286ded=a49_0x5058bd,_0x40a433=llmAgentCache['read'](_0x3e3da1);if(_0x40a433&&typeof _0x40a433['id']===_0x286ded(0x1b5)&&typeof _0x40a433['name']==='string'&&typeof _0x40a433['projectId']===_0x286ded(0x1b5))return _0x40a433;return null;}export function writeCachedLLMAgent(_0x3423d6,_0x24d77d,_0x2d4db2,_0x529dc1){const _0x18e0aa=a49_0x5058bd;try{llmAgentCache[_0x18e0aa(0x1a9)]({'name':_0x3423d6,'id':_0x24d77d,'projectId':_0x2d4db2},_0x529dc1);}catch{}}export function clearCachedLLMAgent(_0x487e2f){const _0x57f4e6=a49_0x5058bd;try{llmAgentCache[_0x57f4e6(0x1e4)](_0x487e2f);}catch{}}const accountInfoCache=createOptionalProfileCache('account_info',a49_0x5058bd(0x1b8),{'suffix':a49_0x5058bd(0x1dd)});export function getAccountInfoCacheFile(_0x500f7f){return accountInfoCache['path'](_0x500f7f);}export function readCachedAccountInfo(_0x52a86f){const _0x44f56b=a49_0x5058bd,_0x4a6bd8=accountInfoCache[_0x44f56b(0x1d5)](_0x52a86f);if(_0x4a6bd8&&typeof _0x4a6bd8[_0x44f56b(0x1e2)]==='string'&&typeof _0x4a6bd8['accountId']==='number')return _0x4a6bd8;return null;}export function writeCachedAccountInfo(_0x10538f,_0x397e67,_0x5210ba){const _0x4fcf7a=a49_0x5058bd;try{accountInfoCache[_0x4fcf7a(0x1a9)]({'site':_0x10538f,'accountId':_0x397e67,'cachedAt':new Date()['toISOString']()},_0x5210ba);}catch{}}export function parseEnvFile(_0x4a9fff){const _0x5e3539=a49_0x5058bd,_0x549885={};for(const _0xedd25d of _0x4a9fff[_0x5e3539(0x1ba)]('\x0a')){const _0x3183a2=_0xedd25d[_0x5e3539(0x1bf)]();if(!_0x3183a2||_0x3183a2[_0x5e3539(0x1c1)]('#'))continue;const _0x551541=_0x3183a2[_0x5e3539(0x1ac)](/^([^=]+)=(.*)$/);if(_0x551541){const _0x1151b4=_0x551541[0x1]['trim']();let _0x448d31=_0x551541[0x2]['trim']();(_0x448d31[_0x5e3539(0x1c1)]('\x22')&&_0x448d31['endsWith']('\x22')||_0x448d31[_0x5e3539(0x1c1)]('\x27')&&_0x448d31[_0x5e3539(0x1bb)]('\x27'))&&(_0x448d31=_0x448d31[_0x5e3539(0x1d7)](0x1,-0x1)),_0x549885[_0x1151b4]=_0x448d31;}}return _0x549885;}export function readUserConfig(){const _0x4875a3=a49_0x5058bd,_0x449098=getConfigFile();if(!existsSync(_0x449098))return{};try{const _0x3ba9f1=readFileSync(_0x449098,_0x4875a3(0x1a5));return parseEnvFile(_0x3ba9f1);}catch(_0x1a8c79){return console[_0x4875a3(0x1cf)](_0x4875a3(0x1a7)+_0x449098+':',_0x1a8c79),{};}}export function resolveSite(_0xeb9449){const _0x1d724c=a49_0x5058bd,_0x10ba45=['us01',_0x1d724c(0x1cb),_0x1d724c(0x1e0),_0x1d724c(0x1b1),'ap03',_0x1d724c(0x1cd),'dev-eu01','stg-us01','stg-jp01',_0x1d724c(0x1e8)];if(_0x10ba45[_0x1d724c(0x1b7)](_0xeb9449))return _0xeb9449;if(_0xeb9449 in SITE_ALIASES)return SITE_ALIASES[_0xeb9449];return console[_0x1d724c(0x1cf)](_0x1d724c(0x1db)+_0xeb9449+'\x27,\x20defaulting\x20to\x20us01'),'us01';}let cachedUserConfig=null;function a49_0x5dec(){const _0x3f4a92=['map','stable','utf-8','apiKeys','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','some','write','tdx','proxy','match','2203338bYSPls','651721gwntrI','460kLVNPL','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','ap02','release_channel','llm_default_agent','next','string','config/llm-project','includes','config/account-info','TDX_API_KEY_','split','endsWith','14BnLvLi','stg-us01','456ATRGyx','trim','apiKey','startsWith','toUpperCase','yellow','140987RAdtNG','us01','profile','.env.','tdx.json','keychain\x20(profile:\x20','1854120CvcONO','jp01','existsSync','dev-us01','TD_API_KEY_','warn','ap03','llm_default_project','parse','join','name','read','keychain','slice','dev-eu01','4AznJao','readFileSync','Warning:\x20Unknown\x20site\x20\x27','stg-jp01','.json','83196hRtgmN','1589784ffvgDV','eu01','92eAnDkN','site','.env','clear','replace','entries','\x20env\x20var','stg-ap03','Warning:\x20Failed\x20to\x20read\x20','202415qeFhnu','.config','stringify','path'];a49_0x5dec=function(){return _0x3f4a92;};return a49_0x5dec();}export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x168713){const _0x1994a1=a49_0x5058bd,_0x22bb85=_0x168713||getActiveProfileName();if(_0x22bb85){const _0x359a3d=_0x1994a1(0x1b9)+normalizeProfileForEnvVar(_0x22bb85);if(process.env[_0x359a3d])return process.env[_0x359a3d];}if(process.env.TDX_API_KEY)return process.env.TDX_API_KEY;return undefined;}export function normalizeProfileForEnvVar(_0x3578bf){const _0x58aaa5=a49_0x5058bd;return _0x3578bf[_0x58aaa5(0x1c2)]()[_0x58aaa5(0x1e5)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x261640,_0x386853){const _0x3e9a43=a49_0x5058bd,_0x4ddf18=_0x386853||getActiveProfileName()||undefined;if(_0x4ddf18){const _0x42fd59=_0x3e9a43(0x1b9)+normalizeProfileForEnvVar(_0x4ddf18);if(process.env[_0x42fd59])return{'apiKey':process.env[_0x42fd59],'source':_0x42fd59+_0x3e9a43(0x1e7),'isDeprecated':![]};const _0x5465e2=getCachedCredential(_0x261640,_0x4ddf18);if(_0x5465e2)return{'apiKey':_0x5465e2,'source':_0x3e9a43(0x1c9)+_0x4ddf18+')','isDeprecated':![]};const _0x4f0659=await getKeychainAPIKey(_0x4ddf18);if(_0x4f0659)return setCachedCredential(_0x4f0659,_0x261640,_0x4ddf18),{'apiKey':_0x4f0659,'source':_0x3e9a43(0x1c9)+_0x4ddf18+')','isDeprecated':![]};}if(process.env.TDX_API_KEY)return{'apiKey':process.env.TDX_API_KEY,'source':'TDX_API_KEY\x20env\x20var','isDeprecated':![]};if(!_0x4ddf18){const _0x1c5ad1=getCachedCredential(_0x261640,undefined);if(_0x1c5ad1)return{'apiKey':_0x1c5ad1,'source':_0x3e9a43(0x1d6),'isDeprecated':![]};const _0x3f46c4=await getKeychainAPIKey(undefined);if(_0x3f46c4)return setCachedCredential(_0x3f46c4,_0x261640,undefined),{'apiKey':_0x3f46c4,'source':_0x3e9a43(0x1d6),'isDeprecated':![]};}return null;}export async function getAPIKeyAsync(_0xbc4919,_0x1e124e){const _0x47ab6c=a49_0x5058bd,_0x567394=await resolveAPIKeyAsync(_0xbc4919,_0x1e124e);return _0x567394?.[_0x47ab6c(0x1c0)];}function cleanupLegacyEnvFile(_0x1979be){const _0x5f1fa0=a49_0x5058bd;if(!existsSync(_0x1979be))return![];try{const _0xe0c988=readFileSync(_0x1979be,_0x5f1fa0(0x1a5)),_0x306b22=_0xe0c988['split']('\x0a'),_0x4f346b=_0x306b22['filter'](_0x3224dc=>{const _0x2429e1=_0x5f1fa0,_0x18f28d=_0x3224dc[_0x2429e1(0x1bf)]();if(!_0x18f28d||_0x18f28d['startsWith']('#'))return!![];const [_0x5bb092]=_0x18f28d[_0x2429e1(0x1ba)]('=');return!_0x5bb092[_0x2429e1(0x1c1)]('TD_API_KEY');}),_0x30eeb5=_0x4f346b[_0x5f1fa0(0x1a8)](_0x31254c=>{const _0x718291=_0x5f1fa0,_0x24688e=_0x31254c[_0x718291(0x1bf)]();return _0x24688e&&!_0x24688e[_0x718291(0x1c1)]('#');});if(!_0x30eeb5)return unlinkSync(_0x1979be),!![];return writeFileSync(_0x1979be,_0x4f346b['join']('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function getActiveProfileName(){const _0x56783a=a49_0x5058bd;if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x18d8b2=a49_0x39b424[_0x56783a(0x1d3)](getConfigDir(),'tdx.json');if(!a49_0x10ee6d[_0x56783a(0x1cc)](_0x18d8b2))return null;try{const _0x101153=a49_0x10ee6d[_0x56783a(0x1da)](_0x18d8b2,_0x56783a(0x1a5)),_0x4c7968=JSON[_0x56783a(0x1d2)](_0x101153);return _0x4c7968[_0x56783a(0x1c6)]||null;}catch{return null;}}export function saveAPIKey(_0x11dd68,_0x3fbf60,_0xc5a95f){const _0x294f02=a49_0x5058bd,_0x54bebc=getConfigDir(),_0x5ce55d=getConfigFilePath(_0xc5a95f);!existsSync(_0x54bebc)&&mkdirSync(_0x54bebc,{'recursive':!![],'mode':0x1c0});let _0x1a8ac8={};if(existsSync(_0x5ce55d))try{const _0xe9e78e=readFileSync(_0x5ce55d,'utf-8');_0x1a8ac8=parseEnvFile(_0xe9e78e);}catch(_0x391940){console[_0x294f02(0x1cf)](_0x294f02(0x1e9)+_0x5ce55d+':',_0x391940);}const _0x39c1bf=_0x11dd68[_0x294f02(0x1c2)]()[_0x294f02(0x1e5)](/-/g,'_');_0x1a8ac8[_0x294f02(0x1ce)+_0x39c1bf]=_0x3fbf60;const _0x297ac5=Object[_0x294f02(0x1e6)](_0x1a8ac8)[_0x294f02(0x1ee)](([_0x1fc1e6,_0x6a7446])=>_0x1fc1e6+'='+_0x6a7446);writeFileSync(_0x5ce55d,_0x297ac5[_0x294f02(0x1d3)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x72bc50,_0x58afed,_0x3c95c4){const _0xfc45ad=a49_0x5058bd;await saveKeychainAPIKey(_0x72bc50,_0x3c95c4),setCachedCredential(_0x72bc50,_0x58afed,_0x3c95c4);const _0x167277=getConfigFilePath(_0x3c95c4);cleanupLegacyEnvFile(_0x167277)&&console[_0xfc45ad(0x1cf)](a49_0x415371[_0xfc45ad(0x1c3)](_0xfc45ad(0x1b0)));}export function loadConfig(){const _0x2aed5d=a49_0x5058bd,_0x32c07d={'apiKeys':{},'defaultSite':_0x2aed5d(0x1c5)},_0x36afa9=[_0x2aed5d(0x1c5),_0x2aed5d(0x1cb),_0x2aed5d(0x1e0),_0x2aed5d(0x1b1),_0x2aed5d(0x1d0),_0x2aed5d(0x1cd),_0x2aed5d(0x1d8),_0x2aed5d(0x1bd),_0x2aed5d(0x1dc),_0x2aed5d(0x1e8)],_0x27b819=getAPIKey();if(_0x27b819)for(const _0x584104 of _0x36afa9){_0x32c07d[_0x2aed5d(0x1a6)][_0x584104]=_0x27b819;}return _0x32c07d;}export function isExperimentalAvailable(){return!!process.env.TDX_EXPERIMENTAL;}export function loadGlobalProxy(){const _0x314789=a49_0x5058bd,_0x1372a4=a49_0x39b424[_0x314789(0x1d3)](getConfigDir(),_0x314789(0x1c8));if(!a49_0x10ee6d[_0x314789(0x1cc)](_0x1372a4))return undefined;try{const _0x4a75b5=a49_0x10ee6d[_0x314789(0x1da)](_0x1372a4,'utf-8'),_0x2efa9e=JSON['parse'](_0x4a75b5);return typeof _0x2efa9e['proxy']==='string'?_0x2efa9e[_0x314789(0x1ab)]:undefined;}catch{return undefined;}}export function loadReleaseChannel(){const _0x10683a=a49_0x5058bd,_0x55a3f7=process.env.TDX_RELEASE_CHANNEL;if(_0x55a3f7==='next'||_0x55a3f7===_0x10683a(0x1ef))return _0x55a3f7;const _0x2eca27=a49_0x39b424[_0x10683a(0x1d3)](getConfigDir(),'tdx.json');if(!a49_0x10ee6d[_0x10683a(0x1cc)](_0x2eca27))return'stable';try{const _0x110c38=a49_0x10ee6d['readFileSync'](_0x2eca27,'utf-8'),_0x3de72e=JSON[_0x10683a(0x1d2)](_0x110c38);if(_0x3de72e['release_channel']===_0x10683a(0x1b4))return _0x10683a(0x1b4);}catch{}return _0x10683a(0x1ef);}export function saveReleaseChannel(_0x19f313){const _0x119d39=a49_0x5058bd,_0x44475a=getConfigDir(),_0x4c6652=a49_0x39b424['join'](_0x44475a,_0x119d39(0x1c8));!existsSync(_0x44475a)&&mkdirSync(_0x44475a,{'recursive':!![],'mode':0x1c0});let _0x40cd45={};if(existsSync(_0x4c6652))try{const _0x38b5d4=readFileSync(_0x4c6652,_0x119d39(0x1a5));_0x40cd45=JSON[_0x119d39(0x1d2)](_0x38b5d4);}catch{}_0x40cd45[_0x119d39(0x1b2)]=_0x19f313,writeFileSync(_0x4c6652,JSON[_0x119d39(0x1ec)](_0x40cd45,null,0x2),{'mode':0x180});}
1
+ function a49_0x2f58(_0x3a5770,_0x49e825){_0x3a5770=_0x3a5770-0xc2;const _0x25c93e=a49_0x25c9();let _0x2f581c=_0x25c93e[_0x3a5770];return _0x2f581c;}const a49_0xadf9f7=a49_0x2f58;(function(_0x445a50,_0x3971e5){const _0x3a8038=a49_0x2f58,_0x1fd4f9=_0x445a50();while(!![]){try{const _0x331209=parseInt(_0x3a8038(0xec))/0x1+-parseInt(_0x3a8038(0xef))/0x2+parseInt(_0x3a8038(0xd5))/0x3*(parseInt(_0x3a8038(0xcf))/0x4)+-parseInt(_0x3a8038(0xd7))/0x5*(parseInt(_0x3a8038(0xda))/0x6)+-parseInt(_0x3a8038(0xfc))/0x7*(-parseInt(_0x3a8038(0xc7))/0x8)+parseInt(_0x3a8038(0xdb))/0x9+parseInt(_0x3a8038(0xca))/0xa*(parseInt(_0x3a8038(0xd3))/0xb);if(_0x331209===_0x3971e5)break;else _0x1fd4f9['push'](_0x1fd4f9['shift']());}catch(_0x506a41){_0x1fd4f9['push'](_0x1fd4f9['shift']());}}}(a49_0x25c9,0x46bb8));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a49_0x55ba4d from'node:fs';import*as a49_0xc8f30 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 a49_0xbd54fd from'chalk';import{getGlobalCacheDir,createOptionalProfileCache}from'../utils/global-cache.js';export function getConfigDir(){const _0x116c9f=a49_0x2f58;return process.env.TDX_CONFIG_DIR||join(homedir(),_0x116c9f(0xf3),_0x116c9f(0xd4));}export function getConfigFile(){const _0x5bfb88=a49_0x2f58;return join(getConfigDir(),_0x5bfb88(0xe1));}export function getConfigFilePath(_0x405b65){const _0x5dce28=a49_0x2f58,_0x476b93=getConfigDir();return _0x405b65?a49_0xc8f30[_0x5dce28(0xe4)](_0x476b93,_0x5dce28(0xfb)+_0x405b65):getConfigFile();}export function getCacheDir(){return getGlobalCacheDir();}const llmProjectCache=createOptionalProfileCache(a49_0xadf9f7(0xf6),a49_0xadf9f7(0xc5));export function getLLMProjectCacheFile(_0x27efdb){return llmProjectCache['path'](_0x27efdb);}export function readCachedLLMProject(_0x563289){const _0x24e326=a49_0xadf9f7,_0x103fa1=llmProjectCache[_0x24e326(0xff)](_0x563289);if(_0x103fa1&&typeof _0x103fa1['id']==='string'&&typeof _0x103fa1['name']==='string')return _0x103fa1;return null;}export function writeCachedLLMProject(_0x3946bd,_0x86ab1f,_0x1ba98d){const _0x5dbc3b=a49_0xadf9f7;try{llmProjectCache[_0x5dbc3b(0x108)]({'name':_0x3946bd,'id':_0x86ab1f},_0x1ba98d);}catch{}}const llmAgentCache=createOptionalProfileCache(a49_0xadf9f7(0xf0),'config/llm-agent');export function getLLMAgentCacheFile(_0x2bffb0){const _0x4768dc=a49_0xadf9f7;return llmAgentCache[_0x4768dc(0xd6)](_0x2bffb0);}export function readCachedLLMAgent(_0x3de6e8){const _0x36cc38=a49_0xadf9f7,_0xacb505=llmAgentCache[_0x36cc38(0xff)](_0x3de6e8);if(_0xacb505&&typeof _0xacb505['id']===_0x36cc38(0xd2)&&typeof _0xacb505[_0x36cc38(0xfa)]===_0x36cc38(0xd2)&&typeof _0xacb505[_0x36cc38(0xc2)]==='string')return _0xacb505;return null;}export function writeCachedLLMAgent(_0xad9d02,_0x102585,_0x10a3f5,_0x19d7c4){const _0x4579e2=a49_0xadf9f7;try{llmAgentCache[_0x4579e2(0x108)]({'name':_0xad9d02,'id':_0x102585,'projectId':_0x10a3f5},_0x19d7c4);}catch{}}export function clearCachedLLMAgent(_0x537458){try{llmAgentCache['clear'](_0x537458);}catch{}}const accountInfoCache=createOptionalProfileCache('account_info',a49_0xadf9f7(0xed),{'suffix':a49_0xadf9f7(0xcc)});export function getAccountInfoCacheFile(_0x1db152){const _0x52f9e8=a49_0xadf9f7;return accountInfoCache[_0x52f9e8(0xd6)](_0x1db152);}export function readCachedAccountInfo(_0x20e7b8){const _0x7d78ef=a49_0xadf9f7,_0x36c5ed=accountInfoCache['read'](_0x20e7b8);if(_0x36c5ed&&typeof _0x36c5ed['site']===_0x7d78ef(0xd2)&&typeof _0x36c5ed['accountId']==='number')return _0x36c5ed;return null;}export function writeCachedAccountInfo(_0x989e24,_0x15264b,_0x4483ac){try{accountInfoCache['write']({'site':_0x989e24,'accountId':_0x15264b,'cachedAt':new Date()['toISOString']()},_0x4483ac);}catch{}}export function parseEnvFile(_0x387baf){const _0xa7920a=a49_0xadf9f7,_0x45dee9={};for(const _0x25a78f of _0x387baf[_0xa7920a(0x100)]('\x0a')){const _0x31ca1b=_0x25a78f[_0xa7920a(0xf5)]();if(!_0x31ca1b||_0x31ca1b[_0xa7920a(0xcd)]('#'))continue;const _0x51208f=_0x31ca1b[_0xa7920a(0xde)](/^([^=]+)=(.*)$/);if(_0x51208f){const _0x425539=_0x51208f[0x1][_0xa7920a(0xf5)]();let _0x454b20=_0x51208f[0x2][_0xa7920a(0xf5)]();(_0x454b20[_0xa7920a(0xcd)]('\x22')&&_0x454b20[_0xa7920a(0xc8)]('\x22')||_0x454b20[_0xa7920a(0xcd)]('\x27')&&_0x454b20[_0xa7920a(0xc8)]('\x27'))&&(_0x454b20=_0x454b20[_0xa7920a(0x103)](0x1,-0x1)),_0x45dee9[_0x425539]=_0x454b20;}}return _0x45dee9;}export function readUserConfig(){const _0x159577=a49_0xadf9f7,_0x44e22c=getConfigFile();if(!existsSync(_0x44e22c))return{};try{const _0x3a939a=readFileSync(_0x44e22c,_0x159577(0xc4));return parseEnvFile(_0x3a939a);}catch(_0x486f79){return console[_0x159577(0xf7)](_0x159577(0x109)+_0x44e22c+':',_0x486f79),{};}}export function resolveSite(_0x6c4301){const _0x5bf960=a49_0xadf9f7,_0x142803=[_0x5bf960(0xee),'jp01',_0x5bf960(0x104),_0x5bf960(0xf1),'ap03',_0x5bf960(0xce),_0x5bf960(0x107),'stg-us01',_0x5bf960(0xfe),_0x5bf960(0xd1)];if(_0x142803[_0x5bf960(0xcb)](_0x6c4301))return _0x6c4301;if(_0x6c4301 in SITE_ALIASES)return SITE_ALIASES[_0x6c4301];return console['warn'](_0x5bf960(0xe7)+_0x6c4301+_0x5bf960(0xd9)),_0x5bf960(0xee);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}function a49_0x25c9(){const _0x229e4d=['stg-us01','1032312sfWXzq','endsWith','toUpperCase','165870oEphDU','includes','.json','startsWith','dev-us01','4248ByYeSu','proxy','stg-ap03','string','55CmOHKB','tdx','804bFKlfi','path','5IKGSqt','parse','\x27,\x20defaulting\x20to\x20us01','2250594LInSpY','1709937kphewP','keychain','entries','match','readFileSync','stable','.env','filter','stringify','join','TD_API_KEY_','apiKey','Warning:\x20Unknown\x20site\x20\x27','ap03','apiKeys','some','TDX_API_KEY_','355687iExaeo','config/account-info','us01','754902hugGkB','llm_default_agent','ap02','TD_API_KEY','.config','yellow','trim','llm_default_project','warn','next','existsSync','name','.env.','7bzOqWx','release_channel','stg-jp01','read','split','tdx.json','keychain\x20(profile:\x20','slice','eu01','TDX_API_KEY\x20env\x20var','replace','dev-eu01','write','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','projectId','map','utf-8','config/llm-project'];a49_0x25c9=function(){return _0x229e4d;};return a49_0x25c9();}export function getAPIKey(_0x217e2b){const _0x80363b=a49_0xadf9f7,_0x1dd22f=_0x217e2b||getActiveProfileName();if(_0x1dd22f){const _0x10b10f=_0x80363b(0xeb)+normalizeProfileForEnvVar(_0x1dd22f);if(process.env[_0x10b10f])return process.env[_0x10b10f];}if(process.env.TDX_API_KEY)return process.env.TDX_API_KEY;return undefined;}export function normalizeProfileForEnvVar(_0x525390){const _0x242949=a49_0xadf9f7;return _0x525390[_0x242949(0xc9)]()[_0x242949(0x106)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x133f21,_0xb4045c){const _0x5c85c7=a49_0xadf9f7,_0x48df40=_0xb4045c||getActiveProfileName()||undefined;if(_0x48df40){const _0x230c3e=_0x5c85c7(0xeb)+normalizeProfileForEnvVar(_0x48df40);if(process.env[_0x230c3e])return{'apiKey':process.env[_0x230c3e],'source':_0x230c3e+'\x20env\x20var','isDeprecated':![]};const _0x24a59e=getCachedCredential(_0x133f21,_0x48df40);if(_0x24a59e)return{'apiKey':_0x24a59e,'source':_0x5c85c7(0x102)+_0x48df40+')','isDeprecated':![]};const _0xe64d6a=await getKeychainAPIKey(_0x48df40);if(_0xe64d6a)return setCachedCredential(_0xe64d6a,_0x133f21,_0x48df40),{'apiKey':_0xe64d6a,'source':_0x5c85c7(0x102)+_0x48df40+')','isDeprecated':![]};}if(process.env.TDX_API_KEY)return{'apiKey':process.env.TDX_API_KEY,'source':_0x5c85c7(0x105),'isDeprecated':![]};if(!_0x48df40){const _0x3daf7d=getCachedCredential(_0x133f21,undefined);if(_0x3daf7d)return{'apiKey':_0x3daf7d,'source':_0x5c85c7(0xdc),'isDeprecated':![]};const _0x281aeb=await getKeychainAPIKey(undefined);if(_0x281aeb)return setCachedCredential(_0x281aeb,_0x133f21,undefined),{'apiKey':_0x281aeb,'source':'keychain','isDeprecated':![]};}return null;}export async function getAPIKeyAsync(_0x500324,_0x249945){const _0x283a91=a49_0xadf9f7,_0x46b48e=await resolveAPIKeyAsync(_0x500324,_0x249945);return _0x46b48e?.[_0x283a91(0xe6)];}function cleanupLegacyEnvFile(_0x3a153a){const _0xb07306=a49_0xadf9f7;if(!existsSync(_0x3a153a))return![];try{const _0x5da54f=readFileSync(_0x3a153a,_0xb07306(0xc4)),_0x15ae90=_0x5da54f['split']('\x0a'),_0x348186=_0x15ae90[_0xb07306(0xe2)](_0x2ce0e8=>{const _0x160b48=_0xb07306,_0x3a2957=_0x2ce0e8[_0x160b48(0xf5)]();if(!_0x3a2957||_0x3a2957['startsWith']('#'))return!![];const [_0x49480a]=_0x3a2957[_0x160b48(0x100)]('=');return!_0x49480a[_0x160b48(0xcd)](_0x160b48(0xf2));}),_0x46ad44=_0x348186[_0xb07306(0xea)](_0x316032=>{const _0x4bda9c=_0xb07306,_0x22fdfe=_0x316032[_0x4bda9c(0xf5)]();return _0x22fdfe&&!_0x22fdfe[_0x4bda9c(0xcd)]('#');});if(!_0x46ad44)return unlinkSync(_0x3a153a),!![];return writeFileSync(_0x3a153a,_0x348186['join']('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function getActiveProfileName(){const _0x1bf77e=a49_0xadf9f7;if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x4e7b32=a49_0xc8f30[_0x1bf77e(0xe4)](getConfigDir(),_0x1bf77e(0x101));if(!a49_0x55ba4d[_0x1bf77e(0xf9)](_0x4e7b32))return null;try{const _0x57bd8f=a49_0x55ba4d[_0x1bf77e(0xdf)](_0x4e7b32,'utf-8'),_0x300861=JSON['parse'](_0x57bd8f);return _0x300861['profile']||null;}catch{return null;}}export function saveAPIKey(_0x88c3a1,_0x1ef747,_0x341028){const _0x59f7ba=a49_0xadf9f7,_0x20df51=getConfigDir(),_0x3bf009=getConfigFilePath(_0x341028);!existsSync(_0x20df51)&&mkdirSync(_0x20df51,{'recursive':!![],'mode':0x1c0});let _0xa2501={};if(existsSync(_0x3bf009))try{const _0x3a37a7=readFileSync(_0x3bf009,'utf-8');_0xa2501=parseEnvFile(_0x3a37a7);}catch(_0x3998df){console[_0x59f7ba(0xf7)]('Warning:\x20Failed\x20to\x20read\x20'+_0x3bf009+':',_0x3998df);}const _0x291a50=_0x88c3a1['toUpperCase']()[_0x59f7ba(0x106)](/-/g,'_');_0xa2501[_0x59f7ba(0xe5)+_0x291a50]=_0x1ef747;const _0x3a3423=Object[_0x59f7ba(0xdd)](_0xa2501)[_0x59f7ba(0xc3)](([_0x2fc369,_0x150f63])=>_0x2fc369+'='+_0x150f63);writeFileSync(_0x3bf009,_0x3a3423[_0x59f7ba(0xe4)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x38e082,_0x3d35f8,_0x131aac){const _0x19798a=a49_0xadf9f7;await saveKeychainAPIKey(_0x38e082,_0x131aac),setCachedCredential(_0x38e082,_0x3d35f8,_0x131aac);const _0x386484=getConfigFilePath(_0x131aac);cleanupLegacyEnvFile(_0x386484)&&console[_0x19798a(0xf7)](a49_0xbd54fd[_0x19798a(0xf4)]('⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'));}export function loadConfig(){const _0xf22f0f=a49_0xadf9f7,_0x52801f={'apiKeys':{},'defaultSite':_0xf22f0f(0xee)},_0x41f224=[_0xf22f0f(0xee),'jp01',_0xf22f0f(0x104),_0xf22f0f(0xf1),_0xf22f0f(0xe8),_0xf22f0f(0xce),_0xf22f0f(0x107),_0xf22f0f(0xc6),'stg-jp01','stg-ap03'],_0x26e058=getAPIKey();if(_0x26e058)for(const _0xcf1066 of _0x41f224){_0x52801f[_0xf22f0f(0xe9)][_0xcf1066]=_0x26e058;}return _0x52801f;}export function isExperimentalAvailable(){return!!process.env.TDX_EXPERIMENTAL;}export function loadGlobalProxy(){const _0x15a52f=a49_0xadf9f7,_0x4a4ed5=a49_0xc8f30[_0x15a52f(0xe4)](getConfigDir(),_0x15a52f(0x101));if(!a49_0x55ba4d['existsSync'](_0x4a4ed5))return undefined;try{const _0x5367dc=a49_0x55ba4d['readFileSync'](_0x4a4ed5,'utf-8'),_0x16419f=JSON[_0x15a52f(0xd8)](_0x5367dc);return typeof _0x16419f[_0x15a52f(0xd0)]===_0x15a52f(0xd2)?_0x16419f['proxy']:undefined;}catch{return undefined;}}export function loadReleaseChannel(){const _0x548116=a49_0xadf9f7,_0x424eaa=process.env.TDX_RELEASE_CHANNEL;if(_0x424eaa==='next'||_0x424eaa==='stable')return _0x424eaa;const _0x47b74d=a49_0xc8f30[_0x548116(0xe4)](getConfigDir(),_0x548116(0x101));if(!a49_0x55ba4d['existsSync'](_0x47b74d))return _0x548116(0xe0);try{const _0x5f2e2f=a49_0x55ba4d['readFileSync'](_0x47b74d,_0x548116(0xc4)),_0xc3834a=JSON[_0x548116(0xd8)](_0x5f2e2f);if(_0xc3834a['release_channel']===_0x548116(0xf8))return _0x548116(0xf8);}catch{}return'stable';}export function saveReleaseChannel(_0x522217){const _0x1d77ce=a49_0xadf9f7,_0x317bc5=getConfigDir(),_0x4da29b=a49_0xc8f30[_0x1d77ce(0xe4)](_0x317bc5,_0x1d77ce(0x101));!existsSync(_0x317bc5)&&mkdirSync(_0x317bc5,{'recursive':!![],'mode':0x1c0});let _0x15c8cb={};if(existsSync(_0x4da29b))try{const _0x13e94a=readFileSync(_0x4da29b,_0x1d77ce(0xc4));_0x15c8cb=JSON[_0x1d77ce(0xd8)](_0x13e94a);}catch{}_0x15c8cb[_0x1d77ce(0xfd)]=_0x522217,writeFileSync(_0x4da29b,JSON[_0x1d77ce(0xe3)](_0x15c8cb,null,0x2),{'mode':0x180});}
@@ -1 +1 @@
1
- function a50_0xfe07(_0x5afb78,_0x550ca5){_0x5afb78=_0x5afb78-0xbb;const _0x1a34ba=a50_0x1a34();let _0xfe078d=_0x1a34ba[_0x5afb78];return _0xfe078d;}const a50_0x414619=a50_0xfe07;(function(_0x4734d0,_0x1361a4){const _0x58e4e5=a50_0xfe07,_0x2917fb=_0x4734d0();while(!![]){try{const _0x5114f9=-parseInt(_0x58e4e5(0xbc))/0x1*(parseInt(_0x58e4e5(0xc8))/0x2)+-parseInt(_0x58e4e5(0xbd))/0x3+parseInt(_0x58e4e5(0xc5))/0x4+-parseInt(_0x58e4e5(0xc7))/0x5*(parseInt(_0x58e4e5(0xc4))/0x6)+-parseInt(_0x58e4e5(0xc3))/0x7*(-parseInt(_0x58e4e5(0xc9))/0x8)+-parseInt(_0x58e4e5(0xc1))/0x9+parseInt(_0x58e4e5(0xbf))/0xa*(parseInt(_0x58e4e5(0xc0))/0xb);if(_0x5114f9===_0x1361a4)break;else _0x2917fb['push'](_0x2917fb['shift']());}catch(_0x4d8354){_0x2917fb['push'](_0x2917fb['shift']());}}}(a50_0x1a34,0x53e03));function a50_0x1a34(){const _0x3003fa=['write','110liyehg','398057ZgUhmq','1199709pHTTHA','now','77kPGNSn','6726ganbxz','2559732kUWqsx','read','970TOLNGl','56FHcNQD','361904slEUKi','connections-{profile}.json','18824PKoICa','942618zSvNcz'];a50_0x1a34=function(){return _0x3003fa;};return a50_0x1a34();}import{createProfileCache}from'../utils/global-cache.js';const connectionCache=createProfileCache(a50_0x414619(0xbb),'core/connection-cache');export function loadCachedConnections(_0x41e9b0){const _0x1f41c8=a50_0x414619,_0x40d03b=connectionCache[_0x1f41c8(0xc6)](_0x41e9b0);return _0x40d03b?.['connections']??null;}export function saveCachedConnections(_0x344f12,_0x233e80){const _0x3cd810=a50_0x414619;connectionCache[_0x3cd810(0xbe)](_0x344f12,{'connections':_0x233e80,'cachedAt':Date[_0x3cd810(0xc2)]()});}export function clearConnectionCache(_0x53f956){connectionCache['clear'](_0x53f956);}
1
+ const a50_0x53c581=a50_0x1dfe;(function(_0x187f74,_0xf9e33d){const _0x456481=a50_0x1dfe,_0x5adde6=_0x187f74();while(!![]){try{const _0x161301=-parseInt(_0x456481(0x1a2))/0x1+-parseInt(_0x456481(0x193))/0x2*(-parseInt(_0x456481(0x1a1))/0x3)+-parseInt(_0x456481(0x19d))/0x4+parseInt(_0x456481(0x195))/0x5*(-parseInt(_0x456481(0x19a))/0x6)+parseInt(_0x456481(0x1a3))/0x7*(parseInt(_0x456481(0x196))/0x8)+parseInt(_0x456481(0x198))/0x9*(-parseInt(_0x456481(0x19f))/0xa)+parseInt(_0x456481(0x199))/0xb;if(_0x161301===_0xf9e33d)break;else _0x5adde6['push'](_0x5adde6['shift']());}catch(_0x12ab87){_0x5adde6['push'](_0x5adde6['shift']());}}}(a50_0x47d5,0x615e5));import{createProfileCache}from'../utils/global-cache.js';const connectionCache=createProfileCache(a50_0x53c581(0x197),a50_0x53c581(0x194));export function loadCachedConnections(_0x4bb0de){const _0x21842c=a50_0x53c581,_0x36f1b5=connectionCache[_0x21842c(0x1a0)](_0x4bb0de);return _0x36f1b5?.[_0x21842c(0x19c)]??null;}export function saveCachedConnections(_0x11ba66,_0x48861a){const _0x792d23=a50_0x53c581;connectionCache[_0x792d23(0x19b)](_0x11ba66,{'connections':_0x48861a,'cachedAt':Date[_0x792d23(0x19e)]()});}export function clearConnectionCache(_0x3f2fb7){connectionCache['clear'](_0x3f2fb7);}function a50_0x1dfe(_0x3fcd33,_0x508976){_0x3fcd33=_0x3fcd33-0x193;const _0x47d550=a50_0x47d5();let _0x1dfe2c=_0x47d550[_0x3fcd33];return _0x1dfe2c;}function a50_0x47d5(){const _0x12b151=['122409jJvbgJ','254046nhvRpR','core/connection-cache','200nDwYwq','8aGhEFn','connections-{profile}.json','15039MrmcAP','16059340VjIYco','114306TPyWAm','write','connections','1261732NRcUue','now','10VEvCiB','read','18wsYLcK','761600IOHRMd'];a50_0x47d5=function(){return _0x12b151;};return a50_0x47d5();}
@@ -1 +1 @@
1
- function a51_0x565f(_0xf9fec6,_0x199067){_0xf9fec6=_0xf9fec6-0x6e;const _0x5d224e=a51_0x5d22();let _0x565f7c=_0x5d224e[_0xf9fec6];return _0x565f7c;}const a51_0x224fac=a51_0x565f;(function(_0x313d5b,_0x726c46){const _0x18c1b6=a51_0x565f,_0x5c86ef=_0x313d5b();while(!![]){try{const _0x50b983=-parseInt(_0x18c1b6(0x7e))/0x1+-parseInt(_0x18c1b6(0x7f))/0x2+parseInt(_0x18c1b6(0x77))/0x3*(parseInt(_0x18c1b6(0x6e))/0x4)+-parseInt(_0x18c1b6(0x74))/0x5*(parseInt(_0x18c1b6(0x6f))/0x6)+-parseInt(_0x18c1b6(0x82))/0x7*(-parseInt(_0x18c1b6(0x7a))/0x8)+-parseInt(_0x18c1b6(0x71))/0x9*(parseInt(_0x18c1b6(0x76))/0xa)+-parseInt(_0x18c1b6(0x79))/0xb*(-parseInt(_0x18c1b6(0x78))/0xc);if(_0x50b983===_0x726c46)break;else _0x5c86ef['push'](_0x5c86ef['shift']());}catch(_0x280fd6){_0x5c86ef['push'](_0x5c86ef['shift']());}}}(a51_0x5d22,0x9c722));export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x37703f,_0x1b184f){if(_0x37703f===undefined)return _0x1b184f;if(typeof _0x37703f==='number')return _0x37703f;return parseInt(_0x37703f,0xa);}function a51_0x5d22(){const _0x5d9c8a=['1360vmwMGQ','5553TJLDsp','93336MVukVT','3410oxYAOP','8oWguAH','ap02\x20-\x20Korea','eu\x20\x20\x20-\x20Europe','ap02','899233PAMdpn','1804450IfDUNI','us\x20\x20\x20-\x20United\x20States','eu01','428029VaVEuB','2324TWaIAZ','3515052dgCfpZ','jp\x20\x20\x20-\x20Japan','34389qoFrAS','jp01','us01','5WOamOi','value'];a51_0x5d22=function(){return _0x5d9c8a;};return a51_0x5d22();}export const STANDARD_SITE_CHOICES=[{'title':a51_0x224fac(0x80),'value':a51_0x224fac(0x73)},{'title':a51_0x224fac(0x70),'value':a51_0x224fac(0x72)},{'title':a51_0x224fac(0x7c),'value':a51_0x224fac(0x81)},{'title':a51_0x224fac(0x7b),'value':a51_0x224fac(0x7d)}];export function buildSiteChoices(_0x142384){const _0x3ee789=a51_0x224fac,_0x10fd71=[...STANDARD_SITE_CHOICES];let _0x5c2b4e=_0x10fd71['findIndex'](_0xcc133f=>_0xcc133f[_0x3ee789(0x75)]===_0x142384);return _0x5c2b4e===-0x1&&_0x142384!==_0x3ee789(0x73)&&(_0x10fd71['push']({'title':_0x142384,'value':_0x142384}),_0x5c2b4e=_0x10fd71['length']-0x1),_0x10fd71['push']({'title':'Enter\x20custom\x20site','value':'other'}),{'choices':_0x10fd71,'initialIndex':_0x5c2b4e>=0x0?_0x5c2b4e:0x0};}
1
+ function a51_0x4429(){const _0x36ed27=['length','number','eu01','2707Vysust','508520JMPlYH','ap02','Enter\x20custom\x20site','ap02\x20-\x20Korea','1050fAcFjb','value','859074mliRVf','165Byedgu','1548081ZUrmOV','eu\x20\x20\x20-\x20Europe','us\x20\x20\x20-\x20United\x20States','202AZWnFf','us01','findIndex','689507TidRvV','8MOeova','18750iJaYtB','11020xanzjT','jp01','jp\x20\x20\x20-\x20Japan','push'];a51_0x4429=function(){return _0x36ed27;};return a51_0x4429();}function a51_0x1c6a(_0x4d70d8,_0x46062a){_0x4d70d8=_0x4d70d8-0x85;const _0x4429cb=a51_0x4429();let _0x1c6a15=_0x4429cb[_0x4d70d8];return _0x1c6a15;}const a51_0x2054bc=a51_0x1c6a;(function(_0x4ee599,_0x2debb2){const _0x44598b=a51_0x1c6a,_0x104985=_0x4ee599();while(!![]){try{const _0x4c5029=parseInt(_0x44598b(0x8e))/0x1*(parseInt(_0x44598b(0x9a))/0x2)+parseInt(_0x44598b(0x95))/0x3+parseInt(_0x44598b(0x8f))/0x4+parseInt(_0x44598b(0x87))/0x5*(-parseInt(_0x44598b(0x93))/0x6)+parseInt(_0x44598b(0x9d))/0x7+parseInt(_0x44598b(0x85))/0x8*(-parseInt(_0x44598b(0x97))/0x9)+-parseInt(_0x44598b(0x86))/0xa*(parseInt(_0x44598b(0x96))/0xb);if(_0x4c5029===_0x2debb2)break;else _0x104985['push'](_0x104985['shift']());}catch(_0x3e5eaa){_0x104985['push'](_0x104985['shift']());}}}(a51_0x4429,0x30b8a));export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x3c2fd4,_0x242401){const _0x3ed64c=a51_0x1c6a;if(_0x3c2fd4===undefined)return _0x242401;if(typeof _0x3c2fd4===_0x3ed64c(0x8c))return _0x3c2fd4;return parseInt(_0x3c2fd4,0xa);}export const STANDARD_SITE_CHOICES=[{'title':a51_0x2054bc(0x99),'value':a51_0x2054bc(0x9b)},{'title':a51_0x2054bc(0x89),'value':a51_0x2054bc(0x88)},{'title':a51_0x2054bc(0x98),'value':a51_0x2054bc(0x8d)},{'title':a51_0x2054bc(0x92),'value':a51_0x2054bc(0x90)}];export function buildSiteChoices(_0x3d01f0){const _0x4baeee=a51_0x2054bc,_0x253451=[...STANDARD_SITE_CHOICES];let _0xc2ecf0=_0x253451[_0x4baeee(0x9c)](_0x285833=>_0x285833[_0x4baeee(0x94)]===_0x3d01f0);return _0xc2ecf0===-0x1&&_0x3d01f0!==_0x4baeee(0x9b)&&(_0x253451[_0x4baeee(0x8a)]({'title':_0x3d01f0,'value':_0x3d01f0}),_0xc2ecf0=_0x253451[_0x4baeee(0x8b)]-0x1),_0x253451[_0x4baeee(0x8a)]({'title':_0x4baeee(0x91),'value':'other'}),{'choices':_0x253451,'initialIndex':_0xc2ecf0>=0x0?_0xc2ecf0:0x0};}
@@ -1 +1 @@
1
- (function(_0x3fd041,_0x1db098){const _0x53d883=a52_0x528a,_0x5ae3fa=_0x3fd041();while(!![]){try{const _0x11cf9b=-parseInt(_0x53d883(0x6d))/0x1*(parseInt(_0x53d883(0x78))/0x2)+-parseInt(_0x53d883(0x79))/0x3*(-parseInt(_0x53d883(0x70))/0x4)+-parseInt(_0x53d883(0x6f))/0x5*(-parseInt(_0x53d883(0x76))/0x6)+parseInt(_0x53d883(0x6e))/0x7*(parseInt(_0x53d883(0x77))/0x8)+parseInt(_0x53d883(0x72))/0x9+-parseInt(_0x53d883(0x7d))/0xa*(parseInt(_0x53d883(0x73))/0xb)+parseInt(_0x53d883(0x74))/0xc*(parseInt(_0x53d883(0x75))/0xd);if(_0x11cf9b===_0x1db098)break;else _0x5ae3fa['push'](_0x5ae3fa['shift']());}catch(_0xd4408a){_0x5ae3fa['push'](_0x5ae3fa['shift']());}}}(a52_0x5924,0xd162a));function a52_0x528a(_0x54acdf,_0x1e64cf){_0x54acdf=_0x54acdf-0x6b;const _0x59240e=a52_0x5924();let _0x528ad1=_0x59240e[_0x54acdf];return _0x528ad1;}const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x4e2274,_0x45733e){const _0x6d90d1=a52_0x528a,_0x15ed4d=_0x4e2274||'__default_site__',_0x29cb37=_0x45733e||_0x6d90d1(0x7c);return _0x15ed4d+':'+_0x29cb37;}export function getCachedCredential(_0x4b40de,_0x278c5c){const _0x275eb4=a52_0x528a,_0x4d28d7=getCacheKey(_0x4b40de,_0x278c5c),_0x278218=cache['get'](_0x4d28d7);if(!_0x278218)return null;if(Date[_0x275eb4(0x7a)]()-_0x278218[_0x275eb4(0x7b)]>CACHE_TTL_MS)return cache['delete'](_0x4d28d7),null;return _0x278218[_0x275eb4(0x71)];}function a52_0x5924(){const _0x585ae2=['set','delete','1575987SpRaJF','1701455GUcqth','110YaSbMN','20IJVpph','apiKey','6079914JduwWE','473htZShL','3817548jqFVGC','39ELoGqH','171966BkCDTj','32MXIrds','2DShumJ','65613AHeFUr','now','loadedAt','__default_profile__','211270olYBAI'];a52_0x5924=function(){return _0x585ae2;};return a52_0x5924();}export function setCachedCredential(_0x409ca9,_0x2ed190,_0x2c73a9){const _0x59408f=a52_0x528a,_0x3f02c2=getCacheKey(_0x2ed190,_0x2c73a9);cache[_0x59408f(0x6b)](_0x3f02c2,{'apiKey':_0x409ca9,'loadedAt':Date[_0x59408f(0x7a)]()});}export function clearCredentialCache(){cache['clear']();}export function clearCachedCredential(_0x55d657,_0x2cd995){const _0x495d3e=a52_0x528a,_0x4cd2ae=getCacheKey(_0x55d657,_0x2cd995);cache[_0x495d3e(0x6c)](_0x4cd2ae);}
1
+ function a52_0x5083(_0x114507,_0x2e7f40){_0x114507=_0x114507-0x1aa;const _0x46260d=a52_0x4626();let _0x50838f=_0x46260d[_0x114507];return _0x50838f;}(function(_0x5478c0,_0x503505){const _0x41f888=a52_0x5083,_0x1dd2ef=_0x5478c0();while(!![]){try{const _0x4a24ac=-parseInt(_0x41f888(0x1b2))/0x1*(parseInt(_0x41f888(0x1ae))/0x2)+parseInt(_0x41f888(0x1b7))/0x3+parseInt(_0x41f888(0x1af))/0x4+parseInt(_0x41f888(0x1aa))/0x5*(parseInt(_0x41f888(0x1b9))/0x6)+parseInt(_0x41f888(0x1ac))/0x7*(parseInt(_0x41f888(0x1b5))/0x8)+parseInt(_0x41f888(0x1b8))/0x9*(-parseInt(_0x41f888(0x1b3))/0xa)+parseInt(_0x41f888(0x1bc))/0xb*(parseInt(_0x41f888(0x1ab))/0xc);if(_0x4a24ac===_0x503505)break;else _0x1dd2ef['push'](_0x1dd2ef['shift']());}catch(_0x170b01){_0x1dd2ef['push'](_0x1dd2ef['shift']());}}}(a52_0x4626,0x1f934));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x3bed9b,_0x4ca314){const _0x37952d=a52_0x5083,_0x1a6ed5=_0x3bed9b||_0x37952d(0x1b1),_0x283d12=_0x4ca314||_0x37952d(0x1b6);return _0x1a6ed5+':'+_0x283d12;}export function getCachedCredential(_0x435374,_0xeeeddb){const _0x493980=a52_0x5083,_0x4f2798=getCacheKey(_0x435374,_0xeeeddb),_0x3a6c56=cache[_0x493980(0x1bb)](_0x4f2798);if(!_0x3a6c56)return null;if(Date[_0x493980(0x1ba)]()-_0x3a6c56['loadedAt']>CACHE_TTL_MS)return cache[_0x493980(0x1b0)](_0x4f2798),null;return _0x3a6c56[_0x493980(0x1ad)];}export function setCachedCredential(_0x408753,_0x54edbf,_0x46fc6c){const _0x517f5e=a52_0x5083,_0x574017=getCacheKey(_0x54edbf,_0x46fc6c);cache['set'](_0x574017,{'apiKey':_0x408753,'loadedAt':Date[_0x517f5e(0x1ba)]()});}function a52_0x4626(){const _0x17aafb=['clear','33736kgwLBq','__default_profile__','59400QKrarK','279sWeQJQ','1097946gQouIy','now','get','638XrkEmn','5MyvYVr','2364NUxPrx','182uNItkV','apiKey','58DHBLbH','732016VsyguA','delete','__default_site__','6705XEIWkT','59060jpXRfz'];a52_0x4626=function(){return _0x17aafb;};return a52_0x4626();}export function clearCredentialCache(){const _0x34329d=a52_0x5083;cache[_0x34329d(0x1b4)]();}export function clearCachedCredential(_0x267dcc,_0xdc5178){const _0x5d4edb=a52_0x5083,_0x4a7698=getCacheKey(_0x267dcc,_0xdc5178);cache[_0x5d4edb(0x1b0)](_0x4a7698);}
@@ -1 +1 @@
1
- const a53_0x9beedf=a53_0x46e7;(function(_0x4e1c11,_0x447d7d){const _0x56b430=a53_0x46e7,_0x5094b0=_0x4e1c11();while(!![]){try{const _0x28e484=-parseInt(_0x56b430(0xe8))/0x1+parseInt(_0x56b430(0xf1))/0x2+-parseInt(_0x56b430(0xe3))/0x3+parseInt(_0x56b430(0xe5))/0x4+parseInt(_0x56b430(0xec))/0x5+parseInt(_0x56b430(0xfd))/0x6+-parseInt(_0x56b430(0x125))/0x7;if(_0x28e484===_0x447d7d)break;else _0x5094b0['push'](_0x5094b0['shift']());}catch(_0x3699ad){_0x5094b0['push'](_0x5094b0['shift']());}}}(a53_0x3cb7,0xa2d10));function a53_0x46e7(_0x23fe26,_0x2d7e7d){_0x23fe26=_0x23fe26-0xda;const _0x3cb736=a53_0x3cb7();let _0x46e73d=_0x3cb736[_0x23fe26];return _0x46e73d;}function a53_0x3cb7(){const _0x7c2ca0=['default','1272650uEoQbW','llm_agent','resolveAPIKeyAsync','CLI\x20flag:\x20--','cliFlags','2239344pTSUSX','getParameters','global','profile','llmAgent','project','llm_project','globalCredentials','session','proxy','(active)','createAsync','2402220tCOIpn','parent_segment','log','cli','us01','configFiles','workflow_project','apiKey','utf-8','loadGlobalConfig','Project','Session','cyan','assign','.json','green','not\x20set','bold','[context]','sessions','profiles','string','sessionId','dim','profileSource','parentSegment','display','Profile','env','llmProject','injectIntoOptions','.env','workflowProject','replace','none','profile:\x20','parse','site','readFileSync','tdx.json','4234132JGUcoj','join','verbose','activeProfile','segment_path','existsSync','layers','entries','displayWithSources','segmentPath','getSource','895791VxzDyv','profileCredentials','3708120tUhJLU','database','INFO','1131233EmfAea','Global\x20Credentials','config'];a53_0x3cb7=function(){return _0x7c2ca0;};return a53_0x3cb7();}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 a53_0x437942 from'node:fs';import*as a53_0x415076 from'node:path';import a53_0x3c5770 from'chalk';export class GlobalContext{['site'];[a53_0x9beedf(0xe6)];[a53_0x9beedf(0xfe)];[a53_0x9beedf(0xdc)];[a53_0x9beedf(0xf7)];[a53_0x9beedf(0xed)];[a53_0x9beedf(0x103)];[a53_0x9beedf(0x104)];[a53_0x9beedf(0xfa)];['verbose'];['logLevel'];[a53_0x9beedf(0xf4)];[a53_0x9beedf(0x115)]=null;[a53_0x9beedf(0xde)];[a53_0x9beedf(0xdb)];[a53_0x9beedf(0x113)];['configFiles'];constructor(_0x1d31b7){const _0x1d013f=a53_0x9beedf;this[_0x1d013f(0x113)]=getSessionID(_0x1d31b7[_0x1d013f(0xf9)]);const _0x33fa51=loadSessionContext(_0x1d31b7[_0x1d013f(0xf9)]),_0x22637d=loadProjectConfig(),_0x3e0b84=this['loadGlobalConfig']();if(_0x1d31b7[_0x1d013f(0xf4)])this[_0x1d013f(0xdb)]=_0x1d31b7[_0x1d013f(0xf4)],this['profileSource']=_0x1d013f(0x100);else{if(_0x33fa51?.[_0x1d013f(0xf4)])this[_0x1d013f(0xdb)]=_0x33fa51[_0x1d013f(0xf4)],this['profileSource']='session';else{if(_0x3e0b84[_0x1d013f(0xf4)])this[_0x1d013f(0xdb)]=_0x3e0b84['profile'],this[_0x1d013f(0x115)]=_0x1d013f(0xea);else process.env.TDX_PROFILE?(this['activeProfile']=process.env.TDX_PROFILE,this['profileSource']=_0x1d013f(0x119)):(this[_0x1d013f(0xdb)]=null,this['profileSource']=null);}}const _0x16e3b6=this[_0x1d013f(0xdb)]?loadProfile(this['activeProfile']):null,_0x298bd7=_0x3c14ca=>{const _0x3547c3=_0x1d013f;if(!_0x3c14ca)return{};const _0xacbd65=_0x3c14ca,_0x3c950f={};for(const [_0x3f7c1e,_0x4e6c05]of Object[_0x3547c3(0xdf)](_0xacbd65)){typeof _0x4e6c05==='string'&&(_0x3c950f[_0x3f7c1e]=_0x4e6c05);}return _0x3c950f;},_0x81562d={},_0x2beb3d=(_0x57ef43,_0xc2ec88,_0x19ed55)=>{const _0x1655ce=_0x1d013f;if(!_0x57ef43)return![];if(_0x19ed55&&_0x57ef43===_0x19ed55)return![];const _0x502eb5=_0x33fa51,_0xfb202a=_0x22637d,_0x16778a=_0x16e3b6?.[_0x1655ce(0xea)],_0x22c84d=_0x3e0b84,_0x55769e=_0x502eb5?.[_0xc2ec88],_0x206f7a=_0xfb202a?.[_0xc2ec88],_0x531fb3=_0x16778a?.[_0xc2ec88],_0x3a837c=_0x22c84d[_0xc2ec88];return _0x57ef43!==_0x55769e&&_0x57ef43!==_0x206f7a&&_0x57ef43!==_0x531fb3&&_0x57ef43!==_0x3a837c;},_0x15a83e=[{'optionKey':'site','contextKey':_0x1d013f(0x122),'defaultValue':_0x1d013f(0x101)},{'optionKey':'database','contextKey':_0x1d013f(0xe6)},{'optionKey':'parentSegment','contextKey':'parent_segment'},{'optionKey':_0x1d013f(0x11a),'contextKey':_0x1d013f(0xf7)},{'optionKey':_0x1d013f(0xf5),'contextKey':'llm_agent'},{'optionKey':_0x1d013f(0xf4),'contextKey':_0x1d013f(0xf4)}];for(const {optionKey:_0x37577c,contextKey:_0x5cdfac,defaultValue:_0xfa074f}of _0x15a83e){const _0x44be73=_0x1d31b7[_0x37577c];_0x2beb3d(_0x44be73,_0x5cdfac,_0xfa074f)&&(_0x81562d[_0x5cdfac]=_0x44be73);}this['layers']={'cliFlags':_0x81562d,'session':_0x298bd7(_0x33fa51),'project':_0x298bd7(_0x22637d),'profile':_0x298bd7(_0x16e3b6?.[_0x1d013f(0xea)]),'global':_0x298bd7(_0x3e0b84)};const _0x3a648f={...this[_0x1d013f(0xde)][_0x1d013f(0xf3)],...this['layers'][_0x1d013f(0xf4)],...this[_0x1d013f(0xde)][_0x1d013f(0xf6)]};process.env.TDX_SITE&&!this[_0x1d013f(0xde)][_0x1d013f(0xf9)]['site']&&!this['layers'][_0x1d013f(0xf0)][_0x1d013f(0x122)]&&(_0x3a648f[_0x1d013f(0x122)]=process.env.TDX_SITE);Object[_0x1d013f(0x10a)](_0x3a648f,this['layers'][_0x1d013f(0xf9)]),Object[_0x1d013f(0x10a)](_0x3a648f,this[_0x1d013f(0xde)][_0x1d013f(0xf0)]);const _0x55a903=_0x3a648f[_0x1d013f(0x122)]||_0x1d013f(0x101);this['site']=resolveSite(_0x55a903),this[_0x1d013f(0xe6)]=_0x3a648f[_0x1d013f(0xe6)],this[_0x1d013f(0xfe)]=_0x3a648f[_0x1d013f(0xfe)],this[_0x1d013f(0xdc)]=_0x3a648f[_0x1d013f(0xdc)],this[_0x1d013f(0xf7)]=_0x3a648f[_0x1d013f(0xf7)],this['llm_agent']=_0x3a648f[_0x1d013f(0xed)],this[_0x1d013f(0x103)]=_0x3a648f[_0x1d013f(0x103)],this[_0x1d013f(0xda)]=_0x1d31b7['verbose']||![],this['logLevel']=_0x1d31b7['logLevel']??LogLevel[_0x1d013f(0xe7)],this[_0x1d013f(0xf4)]=this['activeProfile']||undefined,this[_0x1d013f(0x104)]=getAPIKey(this[_0x1d013f(0xdb)]||undefined);const _0x2117c2=typeof _0x3e0b84[_0x1d013f(0xfa)]===_0x1d013f(0x112)?_0x3e0b84['proxy']:undefined;this[_0x1d013f(0xfa)]=_0x2117c2||process.env.HTTPS_PROXY||process.env.HTTP_PROXY;const _0x4d054f=getConfigDir(),_0x54058b=a53_0x415076[_0x1d013f(0x126)](_0x4d054f,_0x1d013f(0x110),this[_0x1d013f(0x113)]+_0x1d013f(0x10b)),_0x367eb1=findProjectConfigPath(),_0x2c4f9a=a53_0x415076[_0x1d013f(0x126)](_0x4d054f,_0x1d013f(0x124)),_0x185c7e=a53_0x415076[_0x1d013f(0x126)](_0x4d054f,'.env');let _0x527cfb=null,_0x1f0962=null;this[_0x1d013f(0xdb)]&&(_0x527cfb=a53_0x415076[_0x1d013f(0x126)](_0x4d054f,'profiles',this[_0x1d013f(0xdb)],_0x1d013f(0x124)),_0x1f0962=a53_0x415076[_0x1d013f(0x126)](_0x4d054f,_0x1d013f(0x111),this[_0x1d013f(0xdb)],_0x1d013f(0x11c))),this[_0x1d013f(0x102)]={'session':a53_0x437942[_0x1d013f(0xdd)](_0x54058b)?_0x54058b:null,'project':_0x367eb1,'profile':_0x527cfb&&a53_0x437942['existsSync'](_0x527cfb)?_0x527cfb:null,'profileCredentials':_0x1f0962&&a53_0x437942[_0x1d013f(0xdd)](_0x1f0962)?_0x1f0962:null,'global':a53_0x437942[_0x1d013f(0xdd)](_0x2c4f9a)?_0x2c4f9a:null,'globalCredentials':a53_0x437942[_0x1d013f(0xdd)](_0x185c7e)?_0x185c7e:null};}[a53_0x9beedf(0xe2)](_0x4b4d3d,_0x3c42c1){const _0x3e74d9=a53_0x9beedf;if(!_0x3c42c1)return _0x3e74d9(0x10d);const _0x35c505=_0x3c42c1;if(this[_0x3e74d9(0xde)]['cliFlags'][_0x4b4d3d]===_0x35c505){if(_0x4b4d3d==='site'&&_0x35c505===_0x3e74d9(0x101)&&!this[_0x3e74d9(0xde)][_0x3e74d9(0xf9)][_0x3e74d9(0x122)]&&!this['layers']['project'][_0x3e74d9(0x122)]&&!this['layers'][_0x3e74d9(0xf4)][_0x3e74d9(0x122)]&&!this[_0x3e74d9(0xde)][_0x3e74d9(0xf3)]['site'])return _0x3e74d9(0xeb);return _0x3e74d9(0xef)+_0x4b4d3d[_0x3e74d9(0x11e)](/_/g,'-');}if(this[_0x3e74d9(0xde)][_0x3e74d9(0xf9)][_0x4b4d3d]===_0x35c505)return _0x3e74d9(0xf9);if(this[_0x3e74d9(0xde)][_0x3e74d9(0xf6)][_0x4b4d3d]===_0x35c505)return _0x3e74d9(0xf6);if(this['layers'][_0x3e74d9(0xf4)][_0x4b4d3d]===_0x35c505)return _0x3e74d9(0x120)+this[_0x3e74d9(0xdb)];if(this[_0x3e74d9(0xde)][_0x3e74d9(0xf3)][_0x4b4d3d]===_0x35c505)return'global';return _0x3e74d9(0xeb);}[a53_0x9beedf(0x106)](){const _0x47f52f=a53_0x9beedf,_0x567259=a53_0x415076[_0x47f52f(0x126)](getConfigDir(),_0x47f52f(0x124));if(!a53_0x437942[_0x47f52f(0xdd)](_0x567259))return{};try{const _0x2bb686=a53_0x437942[_0x47f52f(0x123)](_0x567259,_0x47f52f(0x105));return JSON[_0x47f52f(0x121)](_0x2bb686);}catch{return{};}}[a53_0x9beedf(0x11b)](_0x778afe){const _0x95ba1b=a53_0x9beedf;_0x778afe[_0x95ba1b(0x122)]=this['site'],!_0x778afe[_0x95ba1b(0xe6)]&&this[_0x95ba1b(0xe6)]&&(_0x778afe[_0x95ba1b(0xe6)]=this['database']),!_0x778afe['parentSegment']&&this[_0x95ba1b(0xfe)]&&(_0x778afe[_0x95ba1b(0x116)]=this[_0x95ba1b(0xfe)]),!_0x778afe[_0x95ba1b(0xe1)]&&this[_0x95ba1b(0xdc)]&&(_0x778afe[_0x95ba1b(0xe1)]=this[_0x95ba1b(0xdc)]),!_0x778afe['llmProject']&&this[_0x95ba1b(0xf7)]&&(_0x778afe['llmProject']=this[_0x95ba1b(0xf7)]),!_0x778afe[_0x95ba1b(0xf5)]&&this[_0x95ba1b(0xed)]&&(_0x778afe[_0x95ba1b(0xf5)]=this[_0x95ba1b(0xed)]),!_0x778afe[_0x95ba1b(0x11d)]&&this[_0x95ba1b(0x103)]&&(_0x778afe[_0x95ba1b(0x11d)]=this[_0x95ba1b(0x103)]);}['getParameters'](){const _0x2d6098=a53_0x9beedf;return[{'key':_0x2d6098(0x122),'value':this[_0x2d6098(0x122)]},{'key':_0x2d6098(0xe6),'value':this['database']},{'key':_0x2d6098(0xfe),'value':this[_0x2d6098(0xfe)]},{'key':'segment_path','value':this['segment_path']},{'key':_0x2d6098(0xf7),'value':this['llm_project']},{'key':'llm_agent','value':this[_0x2d6098(0xed)]},{'key':_0x2d6098(0x103),'value':this[_0x2d6098(0x103)]},{'key':_0x2d6098(0xf4),'value':this[_0x2d6098(0xdb)]||undefined}];}[a53_0x9beedf(0x117)](){const _0x106f36=a53_0x9beedf;console['log'](a53_0x3c5770[_0x106f36(0x10e)](_0x106f36(0x10f)));for(const {key:_0x11f41c,value:_0x3d7dfe}of this[_0x106f36(0xf2)]()){_0x3d7dfe&&console[_0x106f36(0xff)](a53_0x3c5770[_0x106f36(0x109)](_0x11f41c)+':\x20'+_0x3d7dfe);}}[a53_0x9beedf(0xe0)](){const _0x15825f=a53_0x9beedf;console[_0x15825f(0xff)](a53_0x3c5770['bold'](_0x15825f(0x10f)));for(const {key:_0xe75aae,value:_0x5a1630}of this[_0x15825f(0xf2)]()){if(_0x5a1630){const _0x280bb2=_0xe75aae===_0x15825f(0xf4)?_0x15825f(0xfb):'('+this['getSource'](_0xe75aae,_0x5a1630)+')';console['log'](a53_0x3c5770[_0x15825f(0x109)](_0xe75aae)+':\x20'+_0x5a1630+'\x20'+a53_0x3c5770[_0x15825f(0x114)](_0x280bb2));}}console['log']('\x0a'+a53_0x3c5770[_0x15825f(0x10e)]('[configuration\x20files]'));const _0xc06bff=[{'label':_0x15825f(0x108),'path':this[_0x15825f(0x102)][_0x15825f(0xf9)],'extra':'(session:\x20'+this[_0x15825f(0x113)]+')'},{'label':_0x15825f(0x107),'path':this[_0x15825f(0x102)][_0x15825f(0xf6)]},{'label':_0x15825f(0x118),'path':this[_0x15825f(0x102)]['profile']},{'label':'Profile\x20Credentials','path':this[_0x15825f(0x102)][_0x15825f(0xe4)]},{'label':'Global','path':this['configFiles'][_0x15825f(0xf3)]},{'label':_0x15825f(0xe9),'path':this[_0x15825f(0x102)][_0x15825f(0xf8)]}];for(const {label:_0x17d618,path:_0x4e1015,extra:_0x5b7c6b}of _0xc06bff){if(_0x4e1015)console[_0x15825f(0xff)](a53_0x3c5770[_0x15825f(0x109)](_0x17d618)+':\x20'+_0x4e1015+'\x20'+a53_0x3c5770[_0x15825f(0x10c)]('✓')+(_0x5b7c6b?'\x20'+a53_0x3c5770[_0x15825f(0x114)](_0x5b7c6b):''));else{if(_0x17d618===_0x15825f(0x108))console[_0x15825f(0xff)](a53_0x3c5770[_0x15825f(0x109)](_0x17d618)+':\x20'+a53_0x3c5770['dim'](_0x15825f(0x11f))+'\x20'+a53_0x3c5770[_0x15825f(0x114)]('(using\x20session:\x20'+this[_0x15825f(0x113)]+')'));else(_0x17d618==='Project'||_0x17d618==='Global')&&console[_0x15825f(0xff)](a53_0x3c5770[_0x15825f(0x109)](_0x17d618)+':\x20'+a53_0x3c5770['dim'](_0x15825f(0x11f)));}}}async[a53_0x9beedf(0xee)](){const _0x40b248=a53_0x9beedf;return this[_0x40b248(0x104)]=await getAPIKeyAsync(this[_0x40b248(0x122)],this[_0x40b248(0xdb)]||undefined),this[_0x40b248(0x104)];}static async[a53_0x9beedf(0xfc)](_0x5d342d){const _0x47bb92=a53_0x9beedf,_0xd48ef3=new GlobalContext(_0x5d342d);return await _0xd48ef3[_0x47bb92(0xee)](),_0xd48ef3;}}
1
+ function a53_0x574e(_0x468a81,_0x482310){_0x468a81=_0x468a81-0x1c1;const _0x30ab38=a53_0x30ab();let _0x574e0b=_0x30ab38[_0x468a81];return _0x574e0b;}function a53_0x30ab(){const _0x2488d4=['sessions','default','resolveAPIKeyAsync','llm_project','apiKey','global','Global','110NlrAIQ','logLevel','tdx.json','cliFlags','getSource','createAsync','Profile\x20Credentials','green','INFO','segment_path','log','Global\x20Credentials','entries','us01','bold','profileSource','workflowProject','profile','parent_segment','12XAKtdI','cli','Profile','activeProfile','layers','existsSync','llm_agent','proxy','28766296paHvVZ','543416WTgJuE','6JOGeJJ','parentSegment','[context]','dim','CLI\x20flag:\x20--','assign','loadGlobalConfig','(active)','[configuration\x20files]','Project','workflow_project','profile:\x20','getParameters','config','readFileSync','none','join','globalCredentials','(using\x20session:\x20','profileCredentials','database','llmAgent','injectIntoOptions','2368YxKaVN','sessionId','llmProject','2851aXRoBQ','configFiles','profiles','utf-8','1032163uczDnu','14256xsFgvk','parse','3320425mubrnK','session','cyan','project','30hnhgEM','site','verbose','614404LaTFVo','.json','.env','210GjJZJS','string'];a53_0x30ab=function(){return _0x2488d4;};return a53_0x30ab();}const a53_0x200f2d=a53_0x574e;(function(_0x46c4a4,_0x399cfe){const _0x41bbad=a53_0x574e,_0x3ee8f0=_0x46c4a4();while(!![]){try{const _0x30d533=parseInt(_0x41bbad(0x1c8))/0x1*(parseInt(_0x41bbad(0x1d9))/0x2)+-parseInt(_0x41bbad(0x1ff))/0x3*(parseInt(_0x41bbad(0x1fe))/0x4)+-parseInt(_0x41bbad(0x1cf))/0x5+-parseInt(_0x41bbad(0x1d3))/0x6*(parseInt(_0x41bbad(0x1d6))/0x7)+parseInt(_0x41bbad(0x1c5))/0x8*(parseInt(_0x41bbad(0x1cd))/0x9)+-parseInt(_0x41bbad(0x1e2))/0xa*(parseInt(_0x41bbad(0x1cc))/0xb)+-parseInt(_0x41bbad(0x1f5))/0xc*(-parseInt(_0x41bbad(0x1fd))/0xd);if(_0x30d533===_0x399cfe)break;else _0x3ee8f0['push'](_0x3ee8f0['shift']());}catch(_0x3c3174){_0x3ee8f0['push'](_0x3ee8f0['shift']());}}}(a53_0x30ab,0x8c2f3));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 a53_0x152127 from'node:fs';import*as a53_0x4a412c from'node:path';import a53_0x3aeb62 from'chalk';export class GlobalContext{['site'];[a53_0x200f2d(0x1c2)];[a53_0x200f2d(0x1f4)];[a53_0x200f2d(0x1eb)];[a53_0x200f2d(0x1de)];[a53_0x200f2d(0x1fb)];['workflow_project'];[a53_0x200f2d(0x1df)];['proxy'];[a53_0x200f2d(0x1d5)];[a53_0x200f2d(0x1e3)];['profile'];[a53_0x200f2d(0x1f1)]=null;[a53_0x200f2d(0x1f9)];['activeProfile'];[a53_0x200f2d(0x1c6)];[a53_0x200f2d(0x1c9)];constructor(_0x5b55a3){const _0x1f0573=a53_0x200f2d;this['sessionId']=getSessionID(_0x5b55a3['session']);const _0x29321b=loadSessionContext(_0x5b55a3[_0x1f0573(0x1d0)]),_0xe9766f=loadProjectConfig(),_0x20f075=this[_0x1f0573(0x205)]();if(_0x5b55a3[_0x1f0573(0x1f3)])this[_0x1f0573(0x1f8)]=_0x5b55a3['profile'],this[_0x1f0573(0x1f1)]=_0x1f0573(0x1f6);else{if(_0x29321b?.[_0x1f0573(0x1f3)])this[_0x1f0573(0x1f8)]=_0x29321b[_0x1f0573(0x1f3)],this[_0x1f0573(0x1f1)]=_0x1f0573(0x1d0);else{if(_0x20f075['profile'])this[_0x1f0573(0x1f8)]=_0x20f075[_0x1f0573(0x1f3)],this['profileSource']=_0x1f0573(0x20c);else process.env.TDX_PROFILE?(this['activeProfile']=process.env.TDX_PROFILE,this[_0x1f0573(0x1f1)]='env'):(this[_0x1f0573(0x1f8)]=null,this[_0x1f0573(0x1f1)]=null);}}const _0x767c46=this[_0x1f0573(0x1f8)]?loadProfile(this[_0x1f0573(0x1f8)]):null,_0x5a87d3=_0x3e28cd=>{const _0x49a982=_0x1f0573;if(!_0x3e28cd)return{};const _0x2d9fb4=_0x3e28cd,_0x51d7da={};for(const [_0x54122d,_0x4fbf4b]of Object[_0x49a982(0x1ee)](_0x2d9fb4)){typeof _0x4fbf4b===_0x49a982(0x1da)&&(_0x51d7da[_0x54122d]=_0x4fbf4b);}return _0x51d7da;},_0x12a933={},_0x1aaacd=(_0x4056e8,_0x358f82,_0x86755b)=>{const _0x46fd00=_0x1f0573;if(!_0x4056e8)return![];if(_0x86755b&&_0x4056e8===_0x86755b)return![];const _0x256835=_0x29321b,_0x626084=_0xe9766f,_0x3ffcc6=_0x767c46?.[_0x46fd00(0x20c)],_0x2b2f3d=_0x20f075,_0x3a707c=_0x256835?.[_0x358f82],_0xe9b20=_0x626084?.[_0x358f82],_0x337073=_0x3ffcc6?.[_0x358f82],_0x3b51d3=_0x2b2f3d[_0x358f82];return _0x4056e8!==_0x3a707c&&_0x4056e8!==_0xe9b20&&_0x4056e8!==_0x337073&&_0x4056e8!==_0x3b51d3;},_0x239878=[{'optionKey':_0x1f0573(0x1d4),'contextKey':'site','defaultValue':'us01'},{'optionKey':_0x1f0573(0x1c2),'contextKey':'database'},{'optionKey':'parentSegment','contextKey':_0x1f0573(0x1f4)},{'optionKey':_0x1f0573(0x1c7),'contextKey':_0x1f0573(0x1de)},{'optionKey':_0x1f0573(0x1c3),'contextKey':'llm_agent'},{'optionKey':_0x1f0573(0x1f3),'contextKey':_0x1f0573(0x1f3)}];for(const {optionKey:_0x410af4,contextKey:_0x53c4b4,defaultValue:_0x20f326}of _0x239878){const _0x4dd153=_0x5b55a3[_0x410af4];_0x1aaacd(_0x4dd153,_0x53c4b4,_0x20f326)&&(_0x12a933[_0x53c4b4]=_0x4dd153);}this[_0x1f0573(0x1f9)]={'cliFlags':_0x12a933,'session':_0x5a87d3(_0x29321b),'project':_0x5a87d3(_0xe9766f),'profile':_0x5a87d3(_0x767c46?.['config']),'global':_0x5a87d3(_0x20f075)};const _0x1aad25={...this[_0x1f0573(0x1f9)][_0x1f0573(0x1e0)],...this[_0x1f0573(0x1f9)][_0x1f0573(0x1f3)],...this[_0x1f0573(0x1f9)][_0x1f0573(0x1d2)]};process.env.TDX_SITE&&!this[_0x1f0573(0x1f9)][_0x1f0573(0x1d0)][_0x1f0573(0x1d4)]&&!this[_0x1f0573(0x1f9)][_0x1f0573(0x1e5)][_0x1f0573(0x1d4)]&&(_0x1aad25['site']=process.env.TDX_SITE);Object['assign'](_0x1aad25,this['layers'][_0x1f0573(0x1d0)]),Object[_0x1f0573(0x204)](_0x1aad25,this[_0x1f0573(0x1f9)]['cliFlags']);const _0x2eff19=_0x1aad25['site']||_0x1f0573(0x1ef);this[_0x1f0573(0x1d4)]=resolveSite(_0x2eff19),this[_0x1f0573(0x1c2)]=_0x1aad25[_0x1f0573(0x1c2)],this[_0x1f0573(0x1f4)]=_0x1aad25[_0x1f0573(0x1f4)],this[_0x1f0573(0x1eb)]=_0x1aad25[_0x1f0573(0x1eb)],this[_0x1f0573(0x1de)]=_0x1aad25['llm_project'],this[_0x1f0573(0x1fb)]=_0x1aad25[_0x1f0573(0x1fb)],this[_0x1f0573(0x209)]=_0x1aad25[_0x1f0573(0x209)],this[_0x1f0573(0x1d5)]=_0x5b55a3[_0x1f0573(0x1d5)]||![],this[_0x1f0573(0x1e3)]=_0x5b55a3[_0x1f0573(0x1e3)]??LogLevel[_0x1f0573(0x1ea)],this['profile']=this['activeProfile']||undefined,this['apiKey']=getAPIKey(this['activeProfile']||undefined);const _0x3f1795=typeof _0x20f075[_0x1f0573(0x1fc)]===_0x1f0573(0x1da)?_0x20f075[_0x1f0573(0x1fc)]:undefined;this[_0x1f0573(0x1fc)]=_0x3f1795||process.env.HTTPS_PROXY||process.env.HTTP_PROXY;const _0xac5dce=getConfigDir(),_0x5be233=a53_0x4a412c['join'](_0xac5dce,_0x1f0573(0x1db),this[_0x1f0573(0x1c6)]+_0x1f0573(0x1d7)),_0x3f80d6=findProjectConfigPath(),_0xd6e8f8=a53_0x4a412c['join'](_0xac5dce,_0x1f0573(0x1e4)),_0x2a8cbe=a53_0x4a412c[_0x1f0573(0x20f)](_0xac5dce,_0x1f0573(0x1d8));let _0x5b852b=null,_0x50c858=null;this[_0x1f0573(0x1f8)]&&(_0x5b852b=a53_0x4a412c['join'](_0xac5dce,'profiles',this[_0x1f0573(0x1f8)],_0x1f0573(0x1e4)),_0x50c858=a53_0x4a412c[_0x1f0573(0x20f)](_0xac5dce,_0x1f0573(0x1ca),this['activeProfile'],_0x1f0573(0x1d8))),this['configFiles']={'session':a53_0x152127[_0x1f0573(0x1fa)](_0x5be233)?_0x5be233:null,'project':_0x3f80d6,'profile':_0x5b852b&&a53_0x152127['existsSync'](_0x5b852b)?_0x5b852b:null,'profileCredentials':_0x50c858&&a53_0x152127['existsSync'](_0x50c858)?_0x50c858:null,'global':a53_0x152127['existsSync'](_0xd6e8f8)?_0xd6e8f8:null,'globalCredentials':a53_0x152127[_0x1f0573(0x1fa)](_0x2a8cbe)?_0x2a8cbe:null};}['getSource'](_0x9e026,_0x2ed6e1){const _0x17f8dc=a53_0x200f2d;if(!_0x2ed6e1)return'not\x20set';const _0x4aa1af=_0x2ed6e1;if(this[_0x17f8dc(0x1f9)][_0x17f8dc(0x1e5)][_0x9e026]===_0x4aa1af){if(_0x9e026===_0x17f8dc(0x1d4)&&_0x4aa1af===_0x17f8dc(0x1ef)&&!this[_0x17f8dc(0x1f9)][_0x17f8dc(0x1d0)]['site']&&!this[_0x17f8dc(0x1f9)][_0x17f8dc(0x1d2)][_0x17f8dc(0x1d4)]&&!this['layers'][_0x17f8dc(0x1f3)][_0x17f8dc(0x1d4)]&&!this['layers'][_0x17f8dc(0x1e0)][_0x17f8dc(0x1d4)])return _0x17f8dc(0x1dc);return _0x17f8dc(0x203)+_0x9e026['replace'](/_/g,'-');}if(this['layers'][_0x17f8dc(0x1d0)][_0x9e026]===_0x4aa1af)return _0x17f8dc(0x1d0);if(this[_0x17f8dc(0x1f9)][_0x17f8dc(0x1d2)][_0x9e026]===_0x4aa1af)return _0x17f8dc(0x1d2);if(this[_0x17f8dc(0x1f9)][_0x17f8dc(0x1f3)][_0x9e026]===_0x4aa1af)return _0x17f8dc(0x20a)+this[_0x17f8dc(0x1f8)];if(this['layers'][_0x17f8dc(0x1e0)][_0x9e026]===_0x4aa1af)return'global';return'default';}[a53_0x200f2d(0x205)](){const _0x40d028=a53_0x200f2d,_0x2d0b29=a53_0x4a412c[_0x40d028(0x20f)](getConfigDir(),_0x40d028(0x1e4));if(!a53_0x152127[_0x40d028(0x1fa)](_0x2d0b29))return{};try{const _0x25b6b2=a53_0x152127[_0x40d028(0x20d)](_0x2d0b29,_0x40d028(0x1cb));return JSON[_0x40d028(0x1ce)](_0x25b6b2);}catch{return{};}}[a53_0x200f2d(0x1c4)](_0x226e98){const _0x2f0a4a=a53_0x200f2d;_0x226e98[_0x2f0a4a(0x1d4)]=this[_0x2f0a4a(0x1d4)],!_0x226e98[_0x2f0a4a(0x1c2)]&&this[_0x2f0a4a(0x1c2)]&&(_0x226e98[_0x2f0a4a(0x1c2)]=this[_0x2f0a4a(0x1c2)]),!_0x226e98[_0x2f0a4a(0x200)]&&this[_0x2f0a4a(0x1f4)]&&(_0x226e98[_0x2f0a4a(0x200)]=this[_0x2f0a4a(0x1f4)]),!_0x226e98['segmentPath']&&this['segment_path']&&(_0x226e98['segmentPath']=this[_0x2f0a4a(0x1eb)]),!_0x226e98[_0x2f0a4a(0x1c7)]&&this['llm_project']&&(_0x226e98[_0x2f0a4a(0x1c7)]=this[_0x2f0a4a(0x1de)]),!_0x226e98['llmAgent']&&this['llm_agent']&&(_0x226e98[_0x2f0a4a(0x1c3)]=this['llm_agent']),!_0x226e98[_0x2f0a4a(0x1f2)]&&this['workflow_project']&&(_0x226e98[_0x2f0a4a(0x1f2)]=this[_0x2f0a4a(0x209)]);}[a53_0x200f2d(0x20b)](){const _0x23716e=a53_0x200f2d;return[{'key':_0x23716e(0x1d4),'value':this[_0x23716e(0x1d4)]},{'key':_0x23716e(0x1c2),'value':this[_0x23716e(0x1c2)]},{'key':_0x23716e(0x1f4),'value':this[_0x23716e(0x1f4)]},{'key':_0x23716e(0x1eb),'value':this['segment_path']},{'key':_0x23716e(0x1de),'value':this['llm_project']},{'key':_0x23716e(0x1fb),'value':this[_0x23716e(0x1fb)]},{'key':'workflow_project','value':this[_0x23716e(0x209)]},{'key':_0x23716e(0x1f3),'value':this[_0x23716e(0x1f8)]||undefined}];}['display'](){const _0x11a907=a53_0x200f2d;console['log'](a53_0x3aeb62['bold'](_0x11a907(0x201)));for(const {key:_0x3120cf,value:_0x3d6772}of this['getParameters']()){_0x3d6772&&console['log'](a53_0x3aeb62[_0x11a907(0x1d1)](_0x3120cf)+':\x20'+_0x3d6772);}}['displayWithSources'](){const _0x281863=a53_0x200f2d;console[_0x281863(0x1ec)](a53_0x3aeb62[_0x281863(0x1f0)]('[context]'));for(const {key:_0x2ee95d,value:_0x3b82ae}of this[_0x281863(0x20b)]()){if(_0x3b82ae){const _0x2e1be7=_0x2ee95d==='profile'?_0x281863(0x206):'('+this[_0x281863(0x1e6)](_0x2ee95d,_0x3b82ae)+')';console[_0x281863(0x1ec)](a53_0x3aeb62[_0x281863(0x1d1)](_0x2ee95d)+':\x20'+_0x3b82ae+'\x20'+a53_0x3aeb62[_0x281863(0x202)](_0x2e1be7));}}console[_0x281863(0x1ec)]('\x0a'+a53_0x3aeb62[_0x281863(0x1f0)](_0x281863(0x207)));const _0x5e59b3=[{'label':'Session','path':this[_0x281863(0x1c9)][_0x281863(0x1d0)],'extra':'(session:\x20'+this[_0x281863(0x1c6)]+')'},{'label':_0x281863(0x208),'path':this[_0x281863(0x1c9)][_0x281863(0x1d2)]},{'label':_0x281863(0x1f7),'path':this[_0x281863(0x1c9)][_0x281863(0x1f3)]},{'label':_0x281863(0x1e8),'path':this[_0x281863(0x1c9)][_0x281863(0x1c1)]},{'label':_0x281863(0x1e1),'path':this[_0x281863(0x1c9)][_0x281863(0x1e0)]},{'label':_0x281863(0x1ed),'path':this[_0x281863(0x1c9)][_0x281863(0x210)]}];for(const {label:_0x2520b3,path:_0x4782da,extra:_0x1e90e2}of _0x5e59b3){if(_0x4782da)console[_0x281863(0x1ec)](a53_0x3aeb62[_0x281863(0x1d1)](_0x2520b3)+':\x20'+_0x4782da+'\x20'+a53_0x3aeb62[_0x281863(0x1e9)]('✓')+(_0x1e90e2?'\x20'+a53_0x3aeb62[_0x281863(0x202)](_0x1e90e2):''));else{if(_0x2520b3==='Session')console['log'](a53_0x3aeb62[_0x281863(0x1d1)](_0x2520b3)+':\x20'+a53_0x3aeb62['dim']('none')+'\x20'+a53_0x3aeb62[_0x281863(0x202)](_0x281863(0x211)+this[_0x281863(0x1c6)]+')'));else(_0x2520b3==='Project'||_0x2520b3===_0x281863(0x1e1))&&console['log'](a53_0x3aeb62[_0x281863(0x1d1)](_0x2520b3)+':\x20'+a53_0x3aeb62[_0x281863(0x202)](_0x281863(0x20e)));}}}async[a53_0x200f2d(0x1dd)](){const _0xc1d487=a53_0x200f2d;return this[_0xc1d487(0x1df)]=await getAPIKeyAsync(this[_0xc1d487(0x1d4)],this[_0xc1d487(0x1f8)]||undefined),this['apiKey'];}static async[a53_0x200f2d(0x1e7)](_0x261771){const _0x21d91f=a53_0x200f2d,_0xc247ab=new GlobalContext(_0x261771);return await _0xc247ab[_0x21d91f(0x1dd)](),_0xc247ab;}}
@@ -1 +1 @@
1
- const a54_0x4b81e0=a54_0x5d36;(function(_0x121896,_0x541a1b){const _0x3e77d1=a54_0x5d36,_0x5d7a88=_0x121896();while(!![]){try{const _0x25201e=-parseInt(_0x3e77d1(0x1ef))/0x1+parseInt(_0x3e77d1(0x1d5))/0x2+parseInt(_0x3e77d1(0x1d7))/0x3*(parseInt(_0x3e77d1(0x1da))/0x4)+parseInt(_0x3e77d1(0x1d4))/0x5*(-parseInt(_0x3e77d1(0x1cb))/0x6)+parseInt(_0x3e77d1(0x1cc))/0x7*(-parseInt(_0x3e77d1(0x1d9))/0x8)+parseInt(_0x3e77d1(0x1ee))/0x9+parseInt(_0x3e77d1(0x1cf))/0xa*(parseInt(_0x3e77d1(0x1dc))/0xb);if(_0x25201e===_0x541a1b)break;else _0x5d7a88['push'](_0x5d7a88['shift']());}catch(_0xdeee04){_0x5d7a88['push'](_0x5d7a88['shift']());}}}(a54_0x1435,0xb5947));function a54_0x1435(){const _0x305786=['2931BWnnEb','@napi-rs/keyring','4957168OHBDjN','2368RHXbcd','cannot\x20find','11537537EqBalY','deleteCredential',':api_key','reason','message','unavailable','includes','not\x20found','success','-25300','System\x20keychain\x20is\x20not\x20available','access_denied','error','__keychain_test__','access','value','not\x20supported','no\x20matching\x20entry','7620948KJiuaf','1460084lPivWk','not\x20available','setPassword','getPassword','6lzNptV','7sCWbrD','toLowerCase','-25293','10LCtLuB','Keychain\x20access\x20denied.\x20The\x20API\x20key\x20exists\x20but\x20cannot\x20be\x20accessed.\x20Try\x20running\x20\x22tdx\x20auth\x20setup\x22\x20to\x20re-authenticate,\x20or\x20check\x20your\x20keychain\x20permissions\x20for\x20\x22tdx\x22.','could\x20not\x20be\x20found','profile:','tdx','118835hggqkq','746450DSrBPP','Warning:\x20'];a54_0x1435=function(){return _0x305786;};return a54_0x1435();}const SERVICE_NAME=a54_0x4b81e0(0x1d3);let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x553243=a54_0x4b81e0;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0xab6e2=await import(_0x553243(0x1d8));return EntryClass=_0xab6e2['Entry'],EntryClass;}catch(_0x380c57){return keyringLoadError=_0x380c57 instanceof Error?_0x380c57:new Error(String(_0x380c57)),null;}}function getAccountName(_0x34e889){const _0x210c6d=a54_0x4b81e0,_0xd8a23d=_0x34e889||'';return _0x210c6d(0x1d2)+_0xd8a23d+_0x210c6d(0x1de);}export async function getKeychainAPIKey(_0x464f28){const _0xc0b43c=a54_0x4b81e0,_0x2864ab=await getKeychainAPIKeyWithStatus(_0x464f28);if(_0x2864ab[_0xc0b43c(0x1e4)])return _0x2864ab[_0xc0b43c(0x1eb)];return _0x2864ab[_0xc0b43c(0x1df)]===_0xc0b43c(0x1e7)&&console[_0xc0b43c(0x1e8)](_0xc0b43c(0x1d6)+_0x2864ab[_0xc0b43c(0x1e0)]),null;}export async function getKeychainAPIKeyWithStatus(_0x1f58f2){const _0x35b162=a54_0x4b81e0;try{const _0x1861b6=await getEntryClass();if(!_0x1861b6)return{'success':![],'reason':'unavailable'};const _0x4cd22a=getAccountName(_0x1f58f2),_0x4d5bf2=new _0x1861b6(SERVICE_NAME,_0x4cd22a),_0x1cab50=_0x4d5bf2[_0x35b162(0x1ca)]();if(_0x1cab50)return{'success':!![],'value':_0x1cab50};return{'success':![],'reason':'not_found'};}catch(_0x13086f){const _0x212c3d=_0x13086f instanceof Error?_0x13086f[_0x35b162(0x1e0)]:String(_0x13086f);if(_0x212c3d['includes'](_0x35b162(0x1e5))||_0x212c3d[_0x35b162(0x1cd)]()[_0x35b162(0x1e2)](_0x35b162(0x1d1))||_0x212c3d[_0x35b162(0x1cd)]()[_0x35b162(0x1e2)](_0x35b162(0x1e3))||_0x212c3d[_0x35b162(0x1cd)]()[_0x35b162(0x1e2)](_0x35b162(0x1ed)))return{'success':![],'reason':'not_found'};if(_0x212c3d[_0x35b162(0x1e2)](_0x35b162(0x1ce))||_0x212c3d['toLowerCase']()[_0x35b162(0x1e2)]('restricted')||_0x212c3d[_0x35b162(0x1cd)]()[_0x35b162(0x1e2)](_0x35b162(0x1ea)))return{'success':![],'reason':'access_denied','message':_0x35b162(0x1d0)};return{'success':![],'reason':_0x35b162(0x1e1),'message':_0x212c3d};}}export async function saveKeychainAPIKey(_0x4ff13b,_0x55f7fd){const _0x4f557f=a54_0x4b81e0,_0x45202e=await getEntryClass();if(!_0x45202e)throw new Error(_0x4f557f(0x1e6));const _0x5af91a=getAccountName(_0x55f7fd),_0x30de74=new _0x45202e(SERVICE_NAME,_0x5af91a);_0x30de74[_0x4f557f(0x1c9)](_0x4ff13b);}function a54_0x5d36(_0x1d967a,_0x2ce57e){_0x1d967a=_0x1d967a-0x1c8;const _0x143540=a54_0x1435();let _0x5d36d5=_0x143540[_0x1d967a];return _0x5d36d5;}export async function deleteKeychainAPIKey(_0x245100){const _0x573b93=a54_0x4b81e0;try{const _0x1af525=await getEntryClass();if(!_0x1af525)return![];const _0x4f46fe=getAccountName(_0x245100),_0x4096f7=new _0x1af525(SERVICE_NAME,_0x4f46fe);return _0x4096f7[_0x573b93(0x1dd)](),!![];}catch{return![];}}export async function isKeychainAvailable(){const _0x5b19d2=a54_0x4b81e0;try{const _0x4b5098=await getEntryClass();if(!_0x4b5098)return![];const _0x2a9d75=new _0x4b5098(SERVICE_NAME,_0x5b19d2(0x1e9));return _0x2a9d75[_0x5b19d2(0x1ca)](),!![];}catch(_0x5e9960){const _0x54b056=_0x5e9960 instanceof Error?_0x5e9960[_0x5b19d2(0x1e0)]['toLowerCase']():'';if(_0x54b056[_0x5b19d2(0x1e2)](_0x5b19d2(0x1c8))||_0x54b056[_0x5b19d2(0x1e2)](_0x5b19d2(0x1ec))||_0x54b056['includes'](_0x5b19d2(0x1db)))return![];return!![];}}
1
+ const a54_0x52a5d0=a54_0x5d1c;(function(_0x437d75,_0xe7a99d){const _0x2a0237=a54_0x5d1c,_0x5a490d=_0x437d75();while(!![]){try{const _0x3c444e=-parseInt(_0x2a0237(0x8f))/0x1+parseInt(_0x2a0237(0x8e))/0x2+-parseInt(_0x2a0237(0x87))/0x3+parseInt(_0x2a0237(0xa4))/0x4*(-parseInt(_0x2a0237(0x8b))/0x5)+parseInt(_0x2a0237(0x91))/0x6+parseInt(_0x2a0237(0x98))/0x7+parseInt(_0x2a0237(0x8d))/0x8;if(_0x3c444e===_0xe7a99d)break;else _0x5a490d['push'](_0x5a490d['shift']());}catch(_0x5dc2ba){_0x5a490d['push'](_0x5a490d['shift']());}}}(a54_0x1e4c,0x57172));const SERVICE_NAME=a54_0x52a5d0(0x9d);let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x1b423e=a54_0x52a5d0;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x29ab55=await import(_0x1b423e(0x94));return EntryClass=_0x29ab55[_0x1b423e(0x99)],EntryClass;}catch(_0x346b86){return keyringLoadError=_0x346b86 instanceof Error?_0x346b86:new Error(String(_0x346b86)),null;}}function getAccountName(_0x85361e){const _0x26bef8=a54_0x52a5d0,_0x15b1b2=_0x85361e||'';return _0x26bef8(0xa5)+_0x15b1b2+_0x26bef8(0x83);}export async function getKeychainAPIKey(_0x5566ea){const _0x288d89=a54_0x52a5d0,_0x1e2343=await getKeychainAPIKeyWithStatus(_0x5566ea);if(_0x1e2343['success'])return _0x1e2343[_0x288d89(0x86)];return _0x1e2343[_0x288d89(0x96)]===_0x288d89(0xa8)&&console[_0x288d89(0x8a)](_0x288d89(0xa3)+_0x1e2343['message']),null;}function a54_0x1e4c(){const _0x23186c=['reason','toLowerCase','3472994ZlQljC','Entry','could\x20not\x20be\x20found','message','unavailable','tdx','Keychain\x20access\x20denied.\x20The\x20API\x20key\x20exists\x20but\x20cannot\x20be\x20accessed.\x20Try\x20running\x20\x22tdx\x20auth\x20setup\x22\x20to\x20re-authenticate,\x20or\x20check\x20your\x20keychain\x20permissions\x20for\x20\x22tdx\x22.','not\x20available','System\x20keychain\x20is\x20not\x20available','no\x20matching\x20entry','getPassword','Warning:\x20','17704tAwWDd','profile:','deleteCredential','includes','access_denied',':api_key','not\x20supported','-25300','value','1452420FecIeL','__keychain_test__','cannot\x20find','error','745KldKKG','-25293','8371168Qhtodw','389816EmsoGv','607104wuQCTq','access','2219964ynpGKt','restricted','not_found','@napi-rs/keyring','not\x20found'];a54_0x1e4c=function(){return _0x23186c;};return a54_0x1e4c();}function a54_0x5d1c(_0x505da1,_0x480d06){_0x505da1=_0x505da1-0x83;const _0x1e4c0c=a54_0x1e4c();let _0x5d1c87=_0x1e4c0c[_0x505da1];return _0x5d1c87;}export async function getKeychainAPIKeyWithStatus(_0x5ce091){const _0x7e65b6=a54_0x52a5d0;try{const _0x16e035=await getEntryClass();if(!_0x16e035)return{'success':![],'reason':_0x7e65b6(0x9c)};const _0x2f4423=getAccountName(_0x5ce091),_0xccf63f=new _0x16e035(SERVICE_NAME,_0x2f4423),_0x20eb3e=_0xccf63f[_0x7e65b6(0xa2)]();if(_0x20eb3e)return{'success':!![],'value':_0x20eb3e};return{'success':![],'reason':_0x7e65b6(0x93)};}catch(_0x307043){const _0x317239=_0x307043 instanceof Error?_0x307043[_0x7e65b6(0x9b)]:String(_0x307043);if(_0x317239[_0x7e65b6(0xa7)](_0x7e65b6(0x85))||_0x317239['toLowerCase']()[_0x7e65b6(0xa7)](_0x7e65b6(0x9a))||_0x317239[_0x7e65b6(0x97)]()[_0x7e65b6(0xa7)](_0x7e65b6(0x95))||_0x317239[_0x7e65b6(0x97)]()['includes'](_0x7e65b6(0xa1)))return{'success':![],'reason':_0x7e65b6(0x93)};if(_0x317239[_0x7e65b6(0xa7)](_0x7e65b6(0x8c))||_0x317239[_0x7e65b6(0x97)]()[_0x7e65b6(0xa7)](_0x7e65b6(0x92))||_0x317239['toLowerCase']()['includes'](_0x7e65b6(0x90)))return{'success':![],'reason':'access_denied','message':_0x7e65b6(0x9e)};return{'success':![],'reason':_0x7e65b6(0x9c),'message':_0x317239};}}export async function saveKeychainAPIKey(_0x584bc9,_0x4b2954){const _0x3d1ee6=a54_0x52a5d0,_0x35470e=await getEntryClass();if(!_0x35470e)throw new Error(_0x3d1ee6(0xa0));const _0x9f8dcc=getAccountName(_0x4b2954),_0x150820=new _0x35470e(SERVICE_NAME,_0x9f8dcc);_0x150820['setPassword'](_0x584bc9);}export async function deleteKeychainAPIKey(_0x4f8a81){const _0x430e76=a54_0x52a5d0;try{const _0x4b77bc=await getEntryClass();if(!_0x4b77bc)return![];const _0x9610ab=getAccountName(_0x4f8a81),_0x5a255d=new _0x4b77bc(SERVICE_NAME,_0x9610ab);return _0x5a255d[_0x430e76(0xa6)](),!![];}catch{return![];}}export async function isKeychainAvailable(){const _0x46394c=a54_0x52a5d0;try{const _0x156d99=await getEntryClass();if(!_0x156d99)return![];const _0x4fae62=new _0x156d99(SERVICE_NAME,_0x46394c(0x88));return _0x4fae62[_0x46394c(0xa2)](),!![];}catch(_0x4cb798){const _0x5c1bb5=_0x4cb798 instanceof Error?_0x4cb798[_0x46394c(0x9b)][_0x46394c(0x97)]():'';if(_0x5c1bb5[_0x46394c(0xa7)](_0x46394c(0x9f))||_0x5c1bb5[_0x46394c(0xa7)](_0x46394c(0x84))||_0x5c1bb5['includes'](_0x46394c(0x89)))return![];return!![];}}
@@ -1 +1 @@
1
- (function(_0x23e33b,_0x5a7abd){const _0x187244=a55_0xb50f,_0x5b96af=_0x23e33b();while(!![]){try{const _0x15c1d3=-parseInt(_0x187244(0x97))/0x1*(-parseInt(_0x187244(0xc0))/0x2)+-parseInt(_0x187244(0xaf))/0x3*(-parseInt(_0x187244(0xa6))/0x4)+parseInt(_0x187244(0x8b))/0x5*(-parseInt(_0x187244(0x9c))/0x6)+-parseInt(_0x187244(0xae))/0x7+parseInt(_0x187244(0xb8))/0x8+-parseInt(_0x187244(0xbf))/0x9+-parseInt(_0x187244(0x85))/0xa;if(_0x15c1d3===_0x5a7abd)break;else _0x5b96af['push'](_0x5b96af['shift']());}catch(_0x42651a){_0x5b96af['push'](_0x5b96af['shift']());}}}(a55_0xc46a,0x8dd40));import*as a55_0x369802 from'node:fs';import*as a55_0x5b8e6d from'node:path';import{SDKError,ErrorCode}from'../sdk/errors.js';function a55_0xc46a(){const _0x5989a5=['\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','user','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','filter','INVALID_PROFILE_CONFIG','\x20does\x20not\x20exist','Profile\x20','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20',',\x20creating\x20new\x20file','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','readFileSync','profiles','stringify','Invalid\x20profile\x20name:\x20','profile','isDirectory','4217470cEpZAz','object','\x27:\x20config\x20must\x20be\x20an\x20object','existsSync','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','Failed\x20to\x20parse\x20','110BfFiDO','\x27\x20not\x20found\x20in\x20user\x20configuration','To\x20migrate:','values','toISOString','.env','\x20already\x20exists','llm_project','\x20\x201.\x20Edit:\x20','Warning:\x20Failed\x20to\x20parse\x20','message','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','1wfsfbL','rmSync','includes','string','push','236286aNRonu','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','parse','from','tdx.json','find','\x27\x20will\x20be\x20ignored','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','Profile\x20\x27','utf-8','172808WTIoAS','database','warn','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20underscore,\x20and\x20optional\x20@\x20prefix\x20for\x20reserved\x20profiles.','description','has','directory','join','927206UUiHzw','72IWiwRT','test','local','map','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','.env.','\x22\x20\x22','sort','590896bwUCeA','llm_agent','parent_segment','name','\x0aWarning:\x20Failed\x20to\x20parse\x20','Warning:\x20Profile\x20\x27','Error:\x20','1855764DaMxxZ','2194002vMIwAi',':\x20Invalid\x20JSON\x20syntax','\x27:\x20unknown\x20config\x20key\x20\x27','site'];a55_0xc46a=function(){return _0x5989a5;};return a55_0xc46a();}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(_0x4ba9a2){const _0x8b0616=a55_0xb50f,_0x5f288b={};if(!_0x4ba9a2)return _0x5f288b;for(const [_0x3e8e00,_0x583641]of Object['entries'](_0x4ba9a2)){_0x3e8e00!==_0x8b0616(0xaa)&&_0x583641!==undefined&&(_0x5f288b[_0x3e8e00]=_0x583641);}return _0x5f288b;}function a55_0xb50f(_0x47a722,_0x5da854){_0x47a722=_0x47a722-0x76;const _0xc46a02=a55_0xc46a();let _0xb50fc3=_0xc46a02[_0x47a722];return _0xb50fc3;}export function getProfilesDir(){const _0x2dbe91=a55_0xb50f;return a55_0x5b8e6d['join'](getConfigDir(),_0x2dbe91(0x80));}function getProfileDir(_0x39365a){const _0x318b91=a55_0xb50f;return a55_0x5b8e6d[_0x318b91(0xad)](getProfilesDir(),_0x39365a);}function getProfileConfigPath(_0x287649){const _0x36cabb=a55_0xb50f;return a55_0x5b8e6d[_0x36cabb(0xad)](getProfileDir(_0x287649),_0x36cabb(0xa0));}function getProfileEnvPath(_0x9494ee){const _0x140f0a=a55_0xb50f;return a55_0x5b8e6d['join'](getProfileDir(_0x9494ee),_0x140f0a(0x90));}function getGlobalConfigPath(){const _0x1c2b62=a55_0xb50f;return a55_0x5b8e6d[_0x1c2b62(0xad)](getConfigDir(),_0x1c2b62(0xa0));}function validateProfileName(_0x775451){const _0x584816=a55_0xb50f;if(/^@?[a-zA-Z0-9_-]+$/['test'](_0x775451))return;if(/^@tdx-studio:[a-zA-Z0-9_-]+:\d+$/[_0x584816(0xb0)](_0x775451))return;throw new Error(_0x584816(0x82)+_0x775451+_0x584816(0xa9));}function validateProfileConfig(_0x404bad,_0x580cef){const _0x2a768e=a55_0xb50f;if(typeof _0x404bad!==_0x2a768e(0x86)||_0x404bad===null)throw new SDKError(ErrorCode[_0x2a768e(0x79)],_0x2a768e(0xa4)+_0x580cef+_0x2a768e(0x87));const _0x412d94=['description',_0x2a768e(0xc3),_0x2a768e(0xa7),_0x2a768e(0xba),_0x2a768e(0x92),_0x2a768e(0xb9),'user_info'],_0x91169f=_0x404bad;for(const _0x1d0caa of Object['keys'](_0x91169f)){!_0x412d94[_0x2a768e(0x99)](_0x1d0caa)&&console[_0x2a768e(0xa8)](_0x2a768e(0xbd)+_0x580cef+_0x2a768e(0xc2)+_0x1d0caa+_0x2a768e(0xa2));}if(_0x91169f[_0x2a768e(0xaa)]!==undefined&&typeof _0x91169f['description']!==_0x2a768e(0x9a))throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],'Profile\x20\x27'+_0x580cef+_0x2a768e(0x96));if(_0x91169f[_0x2a768e(0xc3)]!==undefined&&typeof _0x91169f[_0x2a768e(0xc3)]!==_0x2a768e(0x9a))throw new SDKError(ErrorCode[_0x2a768e(0x79)],_0x2a768e(0xa4)+_0x580cef+_0x2a768e(0x77));if(_0x91169f[_0x2a768e(0xa7)]!==undefined&&typeof _0x91169f[_0x2a768e(0xa7)]!==_0x2a768e(0x9a))throw new SDKError(ErrorCode[_0x2a768e(0x79)],_0x2a768e(0xa4)+_0x580cef+'\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string');if(_0x91169f[_0x2a768e(0xba)]!==undefined&&typeof _0x91169f[_0x2a768e(0xba)]!==_0x2a768e(0x9a))throw new SDKError(ErrorCode[_0x2a768e(0x79)],_0x2a768e(0xa4)+_0x580cef+_0x2a768e(0xa3));if(_0x91169f[_0x2a768e(0x92)]!==undefined&&typeof _0x91169f[_0x2a768e(0x92)]!==_0x2a768e(0x9a))throw new SDKError(ErrorCode[_0x2a768e(0x79)],_0x2a768e(0xa4)+_0x580cef+_0x2a768e(0x9d));if(_0x91169f[_0x2a768e(0xb9)]!==undefined&&typeof _0x91169f['llm_agent']!=='string')throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],'Profile\x20\x27'+_0x580cef+'\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string');return!![];}function loadProfilesFromTdxJson(_0x42401f,_0x536c46){const _0x451e3c=a55_0xb50f;if(!a55_0x369802[_0x451e3c(0x88)](_0x42401f))return[];try{const _0x24b5bc=a55_0x369802[_0x451e3c(0x7f)](_0x42401f,'utf-8'),_0x1b848e=JSON[_0x451e3c(0x9e)](_0x24b5bc);if(!_0x1b848e[_0x451e3c(0x80)]||typeof _0x1b848e[_0x451e3c(0x80)]!==_0x451e3c(0x86))return[];const _0x17db7e=[];for(const [_0xbea5d6,_0x58199e]of Object['entries'](_0x1b848e[_0x451e3c(0x80)])){try{validateProfileConfig(_0x58199e,_0xbea5d6);const _0x535dd1=getNewCredentialPath(_0xbea5d6),_0x31d840=getOldCredentialPath(_0xbea5d6),_0x34f829=a55_0x369802['existsSync'](_0x535dd1)||a55_0x369802[_0x451e3c(0x88)](_0x31d840);_0x17db7e[_0x451e3c(0x9b)]({'name':_0xbea5d6,'config':_0x58199e,'metadata':{'name':_0xbea5d6,'createdAt':new Date()['toISOString']()},'hasCredentials':_0x34f829,'scope':_0x536c46});}catch(_0x25813a){_0x25813a instanceof Error&&(console[_0x451e3c(0xa8)](_0x451e3c(0xc4)+_0x42401f+':'),console['warn']('\x20\x20'+_0x25813a[_0x451e3c(0x95)]+'\x0a'));}}return _0x17db7e;}catch(_0x191eae){return _0x191eae instanceof SyntaxError?(console[_0x451e3c(0xa8)](_0x451e3c(0xbc)+_0x42401f+_0x451e3c(0xc1)),console[_0x451e3c(0xa8)](_0x451e3c(0xbe)+_0x191eae[_0x451e3c(0x95)]+'\x0a')):console[_0x451e3c(0xa8)](_0x451e3c(0x76)+_0x42401f+':\x20'+_0x191eae+'\x0a'),[];}}export function getNewCredentialPath(_0x331130){const _0x1e97a0=a55_0xb50f;return a55_0x5b8e6d[_0x1e97a0(0xad)](getConfigDir(),_0x1e97a0(0xb5)+_0x331130);}function getOldCredentialPath(_0x2500cd){const _0x190c1f=a55_0xb50f;return a55_0x5b8e6d['join'](getProfilesDir(),_0x2500cd,_0x190c1f(0x90));}function loadProfilesFromTdxJsonFiles(){const _0x219b27=a55_0xb50f,_0x3d2c2a=[],_0x31d461=findProjectConfigPath();_0x31d461&&_0x3d2c2a[_0x219b27(0x9b)](...loadProfilesFromTdxJson(_0x31d461,_0x219b27(0xb1)));const _0x1bfcb2=a55_0x5b8e6d[_0x219b27(0xad)](getConfigDir(),_0x219b27(0xa0));return _0x3d2c2a[_0x219b27(0x9b)](...loadProfilesFromTdxJson(_0x1bfcb2,_0x219b27(0xc5))),_0x3d2c2a;}function loadProfilesFromDirectories(){const _0x8c0b9e=a55_0xb50f,_0x435af3=getProfilesDir();if(!a55_0x369802[_0x8c0b9e(0x88)](_0x435af3))return[];try{return a55_0x369802['readdirSync'](_0x435af3,{'withFileTypes':!![]})[_0x8c0b9e(0x78)](_0x618b62=>_0x618b62[_0x8c0b9e(0x84)]())[_0x8c0b9e(0xb2)](_0x1bd762=>_0x1bd762[_0x8c0b9e(0xbb)])[_0x8c0b9e(0x78)](_0x26d4d1=>{const _0x42c736=_0x8c0b9e,_0x1665ec=getProfileConfigPath(_0x26d4d1),_0x1afe31=getProfileEnvPath(_0x26d4d1);return a55_0x369802[_0x42c736(0x88)](_0x1665ec)||a55_0x369802['existsSync'](_0x1afe31);})[_0x8c0b9e(0xb2)](_0x4bdf7b=>{const _0x478da9=loadProfileFromDirectory(_0x4bdf7b);if(_0x478da9)return{..._0x478da9,'scope':'directory'};return null;})[_0x8c0b9e(0x78)](_0x24934e=>_0x24934e!==null);}catch{return[];}}function loadProfileFromDirectory(_0x557d99){const _0x4a7a2e=a55_0xb50f,_0x3ab407=getProfileConfigPath(_0x557d99),_0x5b2236=getOldCredentialPath(_0x557d99);if(!a55_0x369802[_0x4a7a2e(0x88)](_0x3ab407)&&!a55_0x369802[_0x4a7a2e(0x88)](_0x5b2236))return null;let _0x3897ee={},_0x4892a2={'name':_0x557d99,'createdAt':new Date()[_0x4a7a2e(0x8f)]()};if(a55_0x369802[_0x4a7a2e(0x88)](_0x3ab407))try{const _0x10b32b=a55_0x369802[_0x4a7a2e(0x7f)](_0x3ab407,_0x4a7a2e(0xa5)),_0x4d210d=JSON['parse'](_0x10b32b),{metadata:_0x2f619b,..._0x268c82}=_0x4d210d;_0x3897ee=_0x268c82,_0x2f619b&&(_0x4892a2=_0x2f619b);}catch{}return{'name':_0x557d99,'config':_0x3897ee,'metadata':_0x4892a2,'hasCredentials':a55_0x369802[_0x4a7a2e(0x88)](_0x5b2236),'scope':_0x4a7a2e(0xac)};}export function listProfiles(){const _0x355147=a55_0xb50f,_0x23cdc9=loadProfilesFromTdxJsonFiles(),_0x5296fd=loadProfilesFromDirectories();if(_0x5296fd['length']>0x0){const _0x490d8e=_0x5296fd['map'](_0x2854c2=>_0x2854c2[_0x355147(0xbb)])[_0x355147(0xad)](',\x20'),_0x1aedd1=getConfigDir();console[_0x355147(0xa8)](_0x355147(0x7c)+_0x490d8e),console[_0x355147(0xa8)](_0x355147(0x89)),console['warn'](_0x355147(0x93)+a55_0x5b8e6d['join'](_0x1aedd1,_0x355147(0xa0))),console[_0x355147(0xa8)]('\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)'),console[_0x355147(0xa8)](_0x355147(0x7e));}const _0x559a3d=[..._0x23cdc9,..._0x5296fd],_0x1b9ce5=new Map();for(const _0x14e61f of _0x559a3d){!_0x1b9ce5[_0x355147(0xab)](_0x14e61f[_0x355147(0xbb)])&&_0x1b9ce5['set'](_0x14e61f[_0x355147(0xbb)],_0x14e61f);}return Array[_0x355147(0x9f)](_0x1b9ce5[_0x355147(0x8e)]())[_0x355147(0xb7)]((_0x1228ed,_0x2bbe12)=>_0x1228ed[_0x355147(0xbb)]['localeCompare'](_0x2bbe12['name']));}export function profileExists(_0x47d2ba){const _0x3338f3=a55_0xb50f,_0x288770=listProfiles();return _0x288770['some'](_0x49f4d3=>_0x49f4d3[_0x3338f3(0xbb)]===_0x47d2ba);}export function loadProfile(_0x3e9edb){const _0x2a7bf5=a55_0xb50f;validateProfileName(_0x3e9edb);const _0x161d44=listProfiles(),_0x17b64c=_0x161d44[_0x2a7bf5(0xa1)](_0x3c76c3=>_0x3c76c3[_0x2a7bf5(0xbb)]===_0x3e9edb);return _0x17b64c||null;}export function saveProfile(_0x1400c1,_0x117eaa,_0xc1591f=![]){saveProfileToUserConfig(_0x1400c1,_0x117eaa);}export function deleteProfile(_0x5366ae){const _0x214561=a55_0xb50f;validateProfileName(_0x5366ae);const _0x4d42fc=getProfileDir(_0x5366ae);if(!a55_0x369802['existsSync'](_0x4d42fc))throw new Error(_0x214561(0x7b)+_0x5366ae+'\x20does\x20not\x20exist');a55_0x369802[_0x214561(0x98)](_0x4d42fc,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x295a22,_0x417ef9){const _0xc4b0cc=a55_0xb50f;validateProfileName(_0x295a22);const _0x1e2cce=getGlobalConfigPath(),_0x2bc97a=getConfigDir();!a55_0x369802[_0xc4b0cc(0x88)](_0x2bc97a)&&createSecureDirectory(_0x2bc97a);let _0x54e877={};if(a55_0x369802[_0xc4b0cc(0x88)](_0x1e2cce))try{const _0x3c1d40=a55_0x369802['readFileSync'](_0x1e2cce,'utf-8');_0x54e877=JSON['parse'](_0x3c1d40);}catch{console['warn']('Warning:\x20Failed\x20to\x20parse\x20'+_0x1e2cce+_0xc4b0cc(0x7d));}!_0x54e877[_0xc4b0cc(0x80)]&&(_0x54e877[_0xc4b0cc(0x80)]={}),_0x54e877[_0xc4b0cc(0x80)][_0x295a22]=_0x417ef9,writeSecureFile(_0x1e2cce,JSON[_0xc4b0cc(0x81)](_0x54e877,null,0x2));}export function removeProfileFromUserConfig(_0x59eac5){const _0x3d8c2e=a55_0xb50f;validateProfileName(_0x59eac5);const _0x2c6091=getGlobalConfigPath();if(!a55_0x369802[_0x3d8c2e(0x88)](_0x2c6091))throw new Error(_0x3d8c2e(0xa4)+_0x59eac5+_0x3d8c2e(0x8c));let _0x39aba9={};try{const _0x4a0683=a55_0x369802['readFileSync'](_0x2c6091,_0x3d8c2e(0xa5));_0x39aba9=JSON[_0x3d8c2e(0x9e)](_0x4a0683);}catch{throw new Error(_0x3d8c2e(0x8a)+_0x2c6091);}if(!_0x39aba9['profiles']||!_0x39aba9[_0x3d8c2e(0x80)][_0x59eac5])throw new Error(_0x3d8c2e(0xa4)+_0x59eac5+_0x3d8c2e(0x8c));delete _0x39aba9[_0x3d8c2e(0x80)][_0x59eac5],_0x39aba9[_0x3d8c2e(0x83)]===_0x59eac5&&delete _0x39aba9[_0x3d8c2e(0x83)],writeSecureFile(_0x2c6091,JSON[_0x3d8c2e(0x81)](_0x39aba9,null,0x2));}export function getActiveProfile(){const _0x59f99a=a55_0xb50f,_0x2054ab=loadSessionContext();if(_0x2054ab?.[_0x59f99a(0x83)])return _0x2054ab['profile'];if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x2f5e73=getGlobalConfigPath();if(!a55_0x369802[_0x59f99a(0x88)](_0x2f5e73))return null;try{const _0x12f89f=a55_0x369802['readFileSync'](_0x2f5e73,_0x59f99a(0xa5)),_0x4b1970=JSON[_0x59f99a(0x9e)](_0x12f89f);return _0x4b1970[_0x59f99a(0x83)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x5522a6){const _0x417f1e=a55_0xb50f,_0x446737=getGlobalConfigPath(),_0x2ffcd7=getConfigDir();!a55_0x369802[_0x417f1e(0x88)](_0x2ffcd7)&&createSecureDirectory(_0x2ffcd7);let _0x26120d={};if(a55_0x369802[_0x417f1e(0x88)](_0x446737))try{const _0x13d036=a55_0x369802[_0x417f1e(0x7f)](_0x446737,_0x417f1e(0xa5));_0x26120d=JSON[_0x417f1e(0x9e)](_0x13d036);}catch{console['warn'](_0x417f1e(0x94)+_0x446737+_0x417f1e(0x7d));}_0x26120d[_0x417f1e(0xc3)]=_0x5522a6,writeSecureFile(_0x446737,JSON[_0x417f1e(0x81)](_0x26120d,null,0x2));}export function saveActiveProfileToUserConfig(_0x18d49d){const _0x1c5537=a55_0xb50f;validateProfileName(_0x18d49d);const _0x2261af=getGlobalConfigPath(),_0xa95346=getConfigDir();!a55_0x369802[_0x1c5537(0x88)](_0xa95346)&&createSecureDirectory(_0xa95346);let _0x235bf4={};if(a55_0x369802['existsSync'](_0x2261af))try{const _0x409d5f=a55_0x369802[_0x1c5537(0x7f)](_0x2261af,_0x1c5537(0xa5));_0x235bf4=JSON[_0x1c5537(0x9e)](_0x409d5f);}catch{console[_0x1c5537(0xa8)](_0x1c5537(0x94)+_0x2261af+_0x1c5537(0x7d));}_0x235bf4[_0x1c5537(0x83)]=_0x18d49d,writeSecureFile(_0x2261af,JSON[_0x1c5537(0x81)](_0x235bf4,null,0x2));}function clearFieldFromUserConfig(_0x53b1ac){const _0x387621=a55_0xb50f,_0x13978b=getGlobalConfigPath();if(!a55_0x369802[_0x387621(0x88)](_0x13978b))return;let _0x25e257={};try{const _0x593e38=a55_0x369802[_0x387621(0x7f)](_0x13978b,_0x387621(0xa5));_0x25e257=JSON['parse'](_0x593e38);}catch{return;}delete _0x25e257[_0x53b1ac],writeSecureFile(_0x13978b,JSON['stringify'](_0x25e257,null,0x2));}export function clearDefaultSiteFromUserConfig(){const _0x4e7c70=a55_0xb50f;clearFieldFromUserConfig(_0x4e7c70(0xc3));}export function clearActiveProfileFromUserConfig(){clearFieldFromUserConfig('profile');}export function createProfile(_0x477178,_0x4ed694){const _0x5d5c56=a55_0xb50f;validateProfileName(_0x477178);if(profileExists(_0x477178))throw new Error('Profile\x20'+_0x477178+_0x5d5c56(0x91));saveProfile(_0x477178,_0x4ed694);}export function saveProfileCredentials(_0x33cbff,_0x3863bc){const _0x4d5a4e=a55_0xb50f;validateProfileName(_0x33cbff);if(!profileExists(_0x33cbff))throw new Error(_0x4d5a4e(0x7b)+_0x33cbff+_0x4d5a4e(0x7a));const _0x559e85=getNewCredentialPath(_0x33cbff);writeSecureFile(_0x559e85,_0x3863bc);}export function loadProfileCredentials(_0x16759f){const _0x1771ea=a55_0xb50f;validateProfileName(_0x16759f);const _0x2cb645=getNewCredentialPath(_0x16759f);if(a55_0x369802[_0x1771ea(0x88)](_0x2cb645))try{return a55_0x369802[_0x1771ea(0x7f)](_0x2cb645,_0x1771ea(0xa5));}catch{}const _0x18dff2=getOldCredentialPath(_0x16759f);if(a55_0x369802['existsSync'](_0x18dff2)){console['warn'](_0x1771ea(0xb4)+_0x16759f+'\x27'),console[_0x1771ea(0xa8)](_0x1771ea(0x8d)),console[_0x1771ea(0xa8)]('\x20\x20mv\x20\x22'+_0x18dff2+_0x1771ea(0xb6)+_0x2cb645+'\x22'),console[_0x1771ea(0xa8)](_0x1771ea(0xb3));try{return a55_0x369802[_0x1771ea(0x7f)](_0x18dff2,_0x1771ea(0xa5));}catch{return null;}}return null;}
1
+ const a55_0x2bc7c4=a55_0x407f;(function(_0x1c2223,_0x59f198){const _0x51b82d=a55_0x407f,_0x3085af=_0x1c2223();while(!![]){try{const _0x3a5e00=parseInt(_0x51b82d(0x1bd))/0x1+parseInt(_0x51b82d(0x1cd))/0x2*(-parseInt(_0x51b82d(0x1d1))/0x3)+parseInt(_0x51b82d(0x1e6))/0x4*(-parseInt(_0x51b82d(0x1ff))/0x5)+-parseInt(_0x51b82d(0x1c4))/0x6*(-parseInt(_0x51b82d(0x1d0))/0x7)+parseInt(_0x51b82d(0x1c7))/0x8+parseInt(_0x51b82d(0x20b))/0x9+parseInt(_0x51b82d(0x200))/0xa*(-parseInt(_0x51b82d(0x207))/0xb);if(_0x3a5e00===_0x59f198)break;else _0x3085af['push'](_0x3085af['shift']());}catch(_0x3da0d4){_0x3085af['push'](_0x3085af['shift']());}}}(a55_0x1ff4,0xee2a9));import*as a55_0x2900c4 from'node:fs';import*as a55_0x2bcd7b from'node:path';function a55_0x407f(_0x373f40,_0x2ae072){_0x373f40=_0x373f40-0x1ba;const _0x1ff4b5=a55_0x1ff4();let _0x407f07=_0x1ff4b5[_0x373f40];return _0x407f07;}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=a55_0x2bc7c4(0x1f0);export function getProfileParams(_0x26fe4c){const _0x660437=a55_0x2bc7c4,_0x17b1f8={};if(!_0x26fe4c)return _0x17b1f8;for(const [_0xa13e0,_0x580a11]of Object[_0x660437(0x1df)](_0x26fe4c)){_0xa13e0!==_0x660437(0x20d)&&_0x580a11!==undefined&&(_0x17b1f8[_0xa13e0]=_0x580a11);}return _0x17b1f8;}export function getProfilesDir(){const _0x31c634=a55_0x2bc7c4;return a55_0x2bcd7b[_0x31c634(0x1cf)](getConfigDir(),'profiles');}function getProfileDir(_0xdf27e5){return a55_0x2bcd7b['join'](getProfilesDir(),_0xdf27e5);}function getProfileConfigPath(_0x53fb74){const _0xed23c3=a55_0x2bc7c4;return a55_0x2bcd7b[_0xed23c3(0x1cf)](getProfileDir(_0x53fb74),'tdx.json');}function getProfileEnvPath(_0x207cc1){return a55_0x2bcd7b['join'](getProfileDir(_0x207cc1),'.env');}function getGlobalConfigPath(){const _0x18751f=a55_0x2bc7c4;return a55_0x2bcd7b[_0x18751f(0x1cf)](getConfigDir(),_0x18751f(0x1ec));}function validateProfileName(_0x45e4f2){const _0x4b35f4=a55_0x2bc7c4;if(/^@?[a-zA-Z0-9_-]+$/['test'](_0x45e4f2))return;if(/^@tdx-studio:[a-zA-Z0-9_-]+:\d+$/[_0x4b35f4(0x1d3)](_0x45e4f2))return;throw new Error(_0x4b35f4(0x1de)+_0x45e4f2+_0x4b35f4(0x1dc));}function validateProfileConfig(_0x5bf122,_0x4e42bc){const _0x3237a6=a55_0x2bc7c4;if(typeof _0x5bf122!==_0x3237a6(0x1e7)||_0x5bf122===null)throw new SDKError(ErrorCode[_0x3237a6(0x1ba)],'Profile\x20\x27'+_0x4e42bc+_0x3237a6(0x209));const _0x2e017e=[_0x3237a6(0x20d),_0x3237a6(0x1cb),_0x3237a6(0x205),_0x3237a6(0x203),'llm_project','llm_agent','user_info'],_0x3ec91a=_0x5bf122;for(const _0x21798b of Object[_0x3237a6(0x1f7)](_0x3ec91a)){!_0x2e017e[_0x3237a6(0x1fb)](_0x21798b)&&console[_0x3237a6(0x1fd)]('Warning:\x20Profile\x20\x27'+_0x4e42bc+_0x3237a6(0x1c6)+_0x21798b+_0x3237a6(0x1da));}if(_0x3ec91a[_0x3237a6(0x20d)]!==undefined&&typeof _0x3ec91a[_0x3237a6(0x20d)]!==_0x3237a6(0x202))throw new SDKError(ErrorCode[_0x3237a6(0x1ba)],'Profile\x20\x27'+_0x4e42bc+_0x3237a6(0x20c));if(_0x3ec91a['site']!==undefined&&typeof _0x3ec91a[_0x3237a6(0x1cb)]!==_0x3237a6(0x202))throw new SDKError(ErrorCode[_0x3237a6(0x1ba)],_0x3237a6(0x1eb)+_0x4e42bc+'\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string');if(_0x3ec91a[_0x3237a6(0x205)]!==undefined&&typeof _0x3ec91a[_0x3237a6(0x205)]!=='string')throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0x3237a6(0x1eb)+_0x4e42bc+'\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string');if(_0x3ec91a['parent_segment']!==undefined&&typeof _0x3ec91a[_0x3237a6(0x203)]!=='string')throw new SDKError(ErrorCode[_0x3237a6(0x1ba)],_0x3237a6(0x1eb)+_0x4e42bc+_0x3237a6(0x1ed));if(_0x3ec91a['llm_project']!==undefined&&typeof _0x3ec91a[_0x3237a6(0x1c2)]!==_0x3237a6(0x202))throw new SDKError(ErrorCode[_0x3237a6(0x1ba)],_0x3237a6(0x1eb)+_0x4e42bc+_0x3237a6(0x1db));if(_0x3ec91a['llm_agent']!==undefined&&typeof _0x3ec91a['llm_agent']!==_0x3237a6(0x202))throw new SDKError(ErrorCode[_0x3237a6(0x1ba)],_0x3237a6(0x1eb)+_0x4e42bc+_0x3237a6(0x1dd));return!![];}function loadProfilesFromTdxJson(_0x4defbd,_0x54f614){const _0x5e2148=a55_0x2bc7c4;if(!a55_0x2900c4[_0x5e2148(0x1f4)](_0x4defbd))return[];try{const _0x595707=a55_0x2900c4[_0x5e2148(0x1e5)](_0x4defbd,'utf-8'),_0x40ac56=JSON[_0x5e2148(0x1ee)](_0x595707);if(!_0x40ac56[_0x5e2148(0x201)]||typeof _0x40ac56[_0x5e2148(0x201)]!==_0x5e2148(0x1e7))return[];const _0x542536=[];for(const [_0x157d83,_0x16d196]of Object[_0x5e2148(0x1df)](_0x40ac56['profiles'])){try{validateProfileConfig(_0x16d196,_0x157d83);const _0x47bfbe=getNewCredentialPath(_0x157d83),_0x33ff41=getOldCredentialPath(_0x157d83),_0x48723d=a55_0x2900c4[_0x5e2148(0x1f4)](_0x47bfbe)||a55_0x2900c4[_0x5e2148(0x1f4)](_0x33ff41);_0x542536[_0x5e2148(0x1c5)]({'name':_0x157d83,'config':_0x16d196,'metadata':{'name':_0x157d83,'createdAt':new Date()[_0x5e2148(0x1bf)]()},'hasCredentials':_0x48723d,'scope':_0x54f614});}catch(_0x4fdece){_0x4fdece instanceof Error&&(console['warn'](_0x5e2148(0x1e2)+_0x4defbd+':'),console[_0x5e2148(0x1fd)]('\x20\x20'+_0x4fdece[_0x5e2148(0x1c9)]+'\x0a'));}}return _0x542536;}catch(_0x13dc3f){return _0x13dc3f instanceof SyntaxError?(console[_0x5e2148(0x1fd)](_0x5e2148(0x1cc)+_0x4defbd+_0x5e2148(0x1fe)),console[_0x5e2148(0x1fd)](_0x5e2148(0x1bb)+_0x13dc3f[_0x5e2148(0x1c9)]+'\x0a')):console[_0x5e2148(0x1fd)](_0x5e2148(0x204)+_0x4defbd+':\x20'+_0x13dc3f+'\x0a'),[];}}export function getNewCredentialPath(_0x200ab3){const _0x4db7b7=a55_0x2bc7c4;return a55_0x2bcd7b[_0x4db7b7(0x1cf)](getConfigDir(),_0x4db7b7(0x1f1)+_0x200ab3);}function getOldCredentialPath(_0x4af152){const _0x51cd45=a55_0x2bc7c4;return a55_0x2bcd7b['join'](getProfilesDir(),_0x4af152,_0x51cd45(0x1f9));}function loadProfilesFromTdxJsonFiles(){const _0x2ff518=a55_0x2bc7c4,_0x1ca45b=[],_0x248395=findProjectConfigPath();_0x248395&&_0x1ca45b['push'](...loadProfilesFromTdxJson(_0x248395,_0x2ff518(0x20a)));const _0x5bbf3b=a55_0x2bcd7b[_0x2ff518(0x1cf)](getConfigDir(),'tdx.json');return _0x1ca45b[_0x2ff518(0x1c5)](...loadProfilesFromTdxJson(_0x5bbf3b,_0x2ff518(0x1ca))),_0x1ca45b;}function loadProfilesFromDirectories(){const _0x4015dd=a55_0x2bc7c4,_0x603074=getProfilesDir();if(!a55_0x2900c4[_0x4015dd(0x1f4)](_0x603074))return[];try{return a55_0x2900c4[_0x4015dd(0x1f8)](_0x603074,{'withFileTypes':!![]})[_0x4015dd(0x1f5)](_0x5da21e=>_0x5da21e['isDirectory']())[_0x4015dd(0x1f6)](_0x36238f=>_0x36238f[_0x4015dd(0x1fa)])['filter'](_0x5de58c=>{const _0x23d486=_0x4015dd,_0x15c7df=getProfileConfigPath(_0x5de58c),_0x6d0c5b=getProfileEnvPath(_0x5de58c);return a55_0x2900c4[_0x23d486(0x1f4)](_0x15c7df)||a55_0x2900c4['existsSync'](_0x6d0c5b);})[_0x4015dd(0x1f6)](_0x2f36ce=>{const _0x18dfce=loadProfileFromDirectory(_0x2f36ce);if(_0x18dfce)return{..._0x18dfce,'scope':'directory'};return null;})['filter'](_0x589724=>_0x589724!==null);}catch{return[];}}function loadProfileFromDirectory(_0x1c30ef){const _0x127373=a55_0x2bc7c4,_0x495134=getProfileConfigPath(_0x1c30ef),_0x4b478f=getOldCredentialPath(_0x1c30ef);if(!a55_0x2900c4[_0x127373(0x1f4)](_0x495134)&&!a55_0x2900c4['existsSync'](_0x4b478f))return null;let _0x29d97b={},_0x183b44={'name':_0x1c30ef,'createdAt':new Date()[_0x127373(0x1bf)]()};if(a55_0x2900c4[_0x127373(0x1f4)](_0x495134))try{const _0x415f5c=a55_0x2900c4[_0x127373(0x1e5)](_0x495134,_0x127373(0x1f3)),_0x44d427=JSON[_0x127373(0x1ee)](_0x415f5c),{metadata:_0x4468d0,..._0x1a2e8b}=_0x44d427;_0x29d97b=_0x1a2e8b,_0x4468d0&&(_0x183b44=_0x4468d0);}catch{}return{'name':_0x1c30ef,'config':_0x29d97b,'metadata':_0x183b44,'hasCredentials':a55_0x2900c4[_0x127373(0x1f4)](_0x4b478f),'scope':'directory'};}export function listProfiles(){const _0x584a33=a55_0x2bc7c4,_0x12f36e=loadProfilesFromTdxJsonFiles(),_0x2e60fc=loadProfilesFromDirectories();if(_0x2e60fc[_0x584a33(0x208)]>0x0){const _0x5cf2c4=_0x2e60fc[_0x584a33(0x1f6)](_0x27eee4=>_0x27eee4[_0x584a33(0x1fa)])[_0x584a33(0x1cf)](',\x20'),_0x521cb7=getConfigDir();console[_0x584a33(0x1fd)]('\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20'+_0x5cf2c4),console[_0x584a33(0x1fd)]('Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:'),console[_0x584a33(0x1fd)](_0x584a33(0x1f2)+a55_0x2bcd7b[_0x584a33(0x1cf)](_0x521cb7,_0x584a33(0x1ec))),console[_0x584a33(0x1fd)](_0x584a33(0x1c1)),console[_0x584a33(0x1fd)](_0x584a33(0x206));}const _0x7eda34=[..._0x12f36e,..._0x2e60fc],_0x29de46=new Map();for(const _0x1411f7 of _0x7eda34){!_0x29de46[_0x584a33(0x1e3)](_0x1411f7[_0x584a33(0x1fa)])&&_0x29de46[_0x584a33(0x1fc)](_0x1411f7[_0x584a33(0x1fa)],_0x1411f7);}return Array[_0x584a33(0x1d6)](_0x29de46[_0x584a33(0x1c0)]())[_0x584a33(0x1c8)]((_0x4269b9,_0x30e140)=>_0x4269b9[_0x584a33(0x1fa)][_0x584a33(0x1e0)](_0x30e140[_0x584a33(0x1fa)]));}export function profileExists(_0x3c3ec2){const _0x4cebdc=a55_0x2bc7c4,_0xb36e94=listProfiles();return _0xb36e94[_0x4cebdc(0x1be)](_0x4c52fe=>_0x4c52fe[_0x4cebdc(0x1fa)]===_0x3c3ec2);}export function loadProfile(_0x4a140c){const _0x36319e=a55_0x2bc7c4;validateProfileName(_0x4a140c);const _0x5d5621=listProfiles(),_0x48242e=_0x5d5621[_0x36319e(0x1e8)](_0x3b7b08=>_0x3b7b08[_0x36319e(0x1fa)]===_0x4a140c);return _0x48242e||null;}export function saveProfile(_0x5682d8,_0x82fc90,_0x423cdb=![]){saveProfileToUserConfig(_0x5682d8,_0x82fc90);}export function deleteProfile(_0xd09e49){const _0x57c785=a55_0x2bc7c4;validateProfileName(_0xd09e49);const _0x5b86ca=getProfileDir(_0xd09e49);if(!a55_0x2900c4[_0x57c785(0x1f4)](_0x5b86ca))throw new Error(_0x57c785(0x1ce)+_0xd09e49+_0x57c785(0x1d5));a55_0x2900c4[_0x57c785(0x1c3)](_0x5b86ca,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x2fbaf4,_0x3befdf){const _0x44b32d=a55_0x2bc7c4;validateProfileName(_0x2fbaf4);const _0x12d15e=getGlobalConfigPath(),_0x1a4b8f=getConfigDir();!a55_0x2900c4[_0x44b32d(0x1f4)](_0x1a4b8f)&&createSecureDirectory(_0x1a4b8f);let _0x2dff20={};if(a55_0x2900c4['existsSync'](_0x12d15e))try{const _0x331212=a55_0x2900c4[_0x44b32d(0x1e5)](_0x12d15e,_0x44b32d(0x1f3));_0x2dff20=JSON[_0x44b32d(0x1ee)](_0x331212);}catch{console['warn'](_0x44b32d(0x1e1)+_0x12d15e+_0x44b32d(0x1ea));}!_0x2dff20['profiles']&&(_0x2dff20[_0x44b32d(0x201)]={}),_0x2dff20[_0x44b32d(0x201)][_0x2fbaf4]=_0x3befdf,writeSecureFile(_0x12d15e,JSON[_0x44b32d(0x1d9)](_0x2dff20,null,0x2));}export function removeProfileFromUserConfig(_0x3603e8){const _0x45fe06=a55_0x2bc7c4;validateProfileName(_0x3603e8);const _0x325327=getGlobalConfigPath();if(!a55_0x2900c4[_0x45fe06(0x1f4)](_0x325327))throw new Error(_0x45fe06(0x1eb)+_0x3603e8+_0x45fe06(0x1e9));let _0x247a98={};try{const _0x291ef2=a55_0x2900c4[_0x45fe06(0x1e5)](_0x325327,_0x45fe06(0x1f3));_0x247a98=JSON[_0x45fe06(0x1ee)](_0x291ef2);}catch{throw new Error(_0x45fe06(0x1d8)+_0x325327);}if(!_0x247a98[_0x45fe06(0x201)]||!_0x247a98[_0x45fe06(0x201)][_0x3603e8])throw new Error(_0x45fe06(0x1eb)+_0x3603e8+_0x45fe06(0x1e9));delete _0x247a98[_0x45fe06(0x201)][_0x3603e8],_0x247a98[_0x45fe06(0x1bc)]===_0x3603e8&&delete _0x247a98[_0x45fe06(0x1bc)],writeSecureFile(_0x325327,JSON[_0x45fe06(0x1d9)](_0x247a98,null,0x2));}export function getActiveProfile(){const _0x9a3f8d=a55_0x2bc7c4,_0x568a5c=loadSessionContext();if(_0x568a5c?.['profile'])return _0x568a5c[_0x9a3f8d(0x1bc)];if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x380a81=getGlobalConfigPath();if(!a55_0x2900c4[_0x9a3f8d(0x1f4)](_0x380a81))return null;try{const _0x5ef327=a55_0x2900c4[_0x9a3f8d(0x1e5)](_0x380a81,_0x9a3f8d(0x1f3)),_0x45e37e=JSON[_0x9a3f8d(0x1ee)](_0x5ef327);return _0x45e37e[_0x9a3f8d(0x1bc)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x2f7085){const _0x368ebd=a55_0x2bc7c4,_0x404905=getGlobalConfigPath(),_0x11a203=getConfigDir();!a55_0x2900c4['existsSync'](_0x11a203)&&createSecureDirectory(_0x11a203);let _0x4d62ce={};if(a55_0x2900c4['existsSync'](_0x404905))try{const _0x18e257=a55_0x2900c4[_0x368ebd(0x1e5)](_0x404905,_0x368ebd(0x1f3));_0x4d62ce=JSON[_0x368ebd(0x1ee)](_0x18e257);}catch{console[_0x368ebd(0x1fd)](_0x368ebd(0x1e1)+_0x404905+_0x368ebd(0x1ea));}_0x4d62ce[_0x368ebd(0x1cb)]=_0x2f7085,writeSecureFile(_0x404905,JSON['stringify'](_0x4d62ce,null,0x2));}export function saveActiveProfileToUserConfig(_0x26ce25){const _0xb3be51=a55_0x2bc7c4;validateProfileName(_0x26ce25);const _0x257c2b=getGlobalConfigPath(),_0x171676=getConfigDir();!a55_0x2900c4[_0xb3be51(0x1f4)](_0x171676)&&createSecureDirectory(_0x171676);let _0x56089f={};if(a55_0x2900c4['existsSync'](_0x257c2b))try{const _0x5e9774=a55_0x2900c4[_0xb3be51(0x1e5)](_0x257c2b,_0xb3be51(0x1f3));_0x56089f=JSON['parse'](_0x5e9774);}catch{console[_0xb3be51(0x1fd)]('Warning:\x20Failed\x20to\x20parse\x20'+_0x257c2b+_0xb3be51(0x1ea));}_0x56089f[_0xb3be51(0x1bc)]=_0x26ce25,writeSecureFile(_0x257c2b,JSON[_0xb3be51(0x1d9)](_0x56089f,null,0x2));}function clearFieldFromUserConfig(_0x2ee9f7){const _0x15d143=a55_0x2bc7c4,_0x149aa0=getGlobalConfigPath();if(!a55_0x2900c4[_0x15d143(0x1f4)](_0x149aa0))return;let _0x4622f9={};try{const _0x5d37db=a55_0x2900c4[_0x15d143(0x1e5)](_0x149aa0,_0x15d143(0x1f3));_0x4622f9=JSON['parse'](_0x5d37db);}catch{return;}delete _0x4622f9[_0x2ee9f7],writeSecureFile(_0x149aa0,JSON['stringify'](_0x4622f9,null,0x2));}export function clearDefaultSiteFromUserConfig(){clearFieldFromUserConfig('site');}export function clearActiveProfileFromUserConfig(){clearFieldFromUserConfig('profile');}export function createProfile(_0x5efc06,_0x3a422e){const _0x56632d=a55_0x2bc7c4;validateProfileName(_0x5efc06);if(profileExists(_0x5efc06))throw new Error(_0x56632d(0x1ce)+_0x5efc06+_0x56632d(0x1e4));saveProfile(_0x5efc06,_0x3a422e);}export function saveProfileCredentials(_0x7ec93d,_0x4e3171){const _0x192d35=a55_0x2bc7c4;validateProfileName(_0x7ec93d);if(!profileExists(_0x7ec93d))throw new Error('Profile\x20'+_0x7ec93d+_0x192d35(0x1d5));const _0x574308=getNewCredentialPath(_0x7ec93d);writeSecureFile(_0x574308,_0x4e3171);}function a55_0x1ff4(){const _0x1ec62f=['.env','name','includes','set','warn',':\x20Invalid\x20JSON\x20syntax','140anrRUf','134210PVcxdI','profiles','string','parent_segment','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','database','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','704xoEbMy','length','\x27:\x20config\x20must\x20be\x20an\x20object','local','15678009OLirpL','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','description','INVALID_PROFILE_CONFIG','Error:\x20','profile','754155qduypO','some','toISOString','values','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','llm_project','rmSync','2827290jebLxL','push','\x27:\x20unknown\x20config\x20key\x20\x27','4398608mlrNuZ','sort','message','user','site','\x0aWarning:\x20Failed\x20to\x20parse\x20','26SNNsaG','Profile\x20','join','7zisSBM','286500DheaIN','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','test','\x22\x20\x22','\x20does\x20not\x20exist','from','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','Failed\x20to\x20parse\x20','stringify','\x27\x20will\x20be\x20ignored','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20underscore,\x20and\x20optional\x20@\x20prefix\x20for\x20reserved\x20profiles.','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','Invalid\x20profile\x20name:\x20','entries','localeCompare','Warning:\x20Failed\x20to\x20parse\x20','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','has','\x20already\x20exists','readFileSync','63032rRtvrS','object','find','\x27\x20not\x20found\x20in\x20user\x20configuration',',\x20creating\x20new\x20file','Profile\x20\x27','tdx.json','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','parse','To\x20migrate:','@tdx-studio','.env.','\x20\x201.\x20Edit:\x20','utf-8','existsSync','filter','map','keys','readdirSync'];a55_0x1ff4=function(){return _0x1ec62f;};return a55_0x1ff4();}export function loadProfileCredentials(_0x5ccdd2){const _0x2f2ac7=a55_0x2bc7c4;validateProfileName(_0x5ccdd2);const _0x7fcf7b=getNewCredentialPath(_0x5ccdd2);if(a55_0x2900c4[_0x2f2ac7(0x1f4)](_0x7fcf7b))try{return a55_0x2900c4[_0x2f2ac7(0x1e5)](_0x7fcf7b,_0x2f2ac7(0x1f3));}catch{}const _0x4d6457=getOldCredentialPath(_0x5ccdd2);if(a55_0x2900c4['existsSync'](_0x4d6457)){console[_0x2f2ac7(0x1fd)](_0x2f2ac7(0x1d2)+_0x5ccdd2+'\x27'),console['warn'](_0x2f2ac7(0x1ef)),console['warn']('\x20\x20mv\x20\x22'+_0x4d6457+_0x2f2ac7(0x1d4)+_0x7fcf7b+'\x22'),console[_0x2f2ac7(0x1fd)](_0x2f2ac7(0x1d7));try{return a55_0x2900c4[_0x2f2ac7(0x1e5)](_0x4d6457,_0x2f2ac7(0x1f3));}catch{return null;}}return null;}
@@ -1 +1 @@
1
- const a56_0x282dfa=a56_0x597a;(function(_0x1b3af9,_0x36c3ac){const _0x1cb35c=a56_0x597a,_0x52f66e=_0x1b3af9();while(!![]){try{const _0x4dee2e=-parseInt(_0x1cb35c(0x1ea))/0x1+-parseInt(_0x1cb35c(0x1de))/0x2+-parseInt(_0x1cb35c(0x1e4))/0x3+parseInt(_0x1cb35c(0x1da))/0x4*(parseInt(_0x1cb35c(0x1e8))/0x5)+-parseInt(_0x1cb35c(0x1f0))/0x6*(parseInt(_0x1cb35c(0x1e3))/0x7)+-parseInt(_0x1cb35c(0x1dd))/0x8+parseInt(_0x1cb35c(0x1f4))/0x9;if(_0x4dee2e===_0x36c3ac)break;else _0x52f66e['push'](_0x52f66e['shift']());}catch(_0x568abe){_0x52f66e['push'](_0x52f66e['shift']());}}}(a56_0x456b,0x79b34));import*as a56_0x3f66f6 from'node:fs';import*as a56_0x562836 from'node:path';const PROJECT_CONFIG_FILENAME=a56_0x282dfa(0x1f5);function a56_0x597a(_0x4c2c37,_0x56c091){_0x4c2c37=_0x4c2c37-0x1d7;const _0x456b66=a56_0x456b();let _0x597a54=_0x456b66[_0x4c2c37];return _0x597a54;}export function findProjectConfigPath(_0xcd15be){const _0x145404=a56_0x282dfa;let _0x4682a5=_0xcd15be||process['cwd']();while(!![]){const _0x24630c=a56_0x562836[_0x145404(0x1e6)](_0x4682a5,PROJECT_CONFIG_FILENAME);if(a56_0x3f66f6[_0x145404(0x1d9)](_0x24630c))return _0x24630c;const _0x4f0b56=a56_0x562836[_0x145404(0x1e2)](_0x4682a5);if(_0x4f0b56===_0x4682a5)return null;_0x4682a5=_0x4f0b56;}}export function loadProjectConfig(_0x3c4625){const _0x34ee35=a56_0x282dfa,_0x486aa8=findProjectConfigPath(_0x3c4625);if(!_0x486aa8)return null;try{const _0x4c5429=a56_0x3f66f6['readFileSync'](_0x486aa8,_0x34ee35(0x1eb)),_0x1dffff=JSON[_0x34ee35(0x1dc)](_0x4c5429),_0x1f3c92=JSON[_0x34ee35(0x1db)](_0x1dffff);if(_0x1f3c92[_0x34ee35(0x1e5)](_0x34ee35(0x1f3))||_0x1f3c92[_0x34ee35(0x1e5)](_0x34ee35(0x1d7))||_0x1f3c92[_0x34ee35(0x1e5)](_0x34ee35(0x1ee)))throw new Error(_0x34ee35(0x1df)+_0x486aa8+').\x20'+_0x34ee35(0x1d8));const {metadata:_0x4108fc,profile:_0x19969f,..._0x20f732}=_0x1dffff;return _0x19969f&&console[_0x34ee35(0x1ef)]('Warning:\x20\x27profile\x27\x20field\x20in\x20'+_0x486aa8+'\x20is\x20ignored.\x20'+_0x34ee35(0x1e0)),_0x20f732;}catch(_0x16794d){if(_0x16794d instanceof Error&&_0x34ee35(0x1e9)in _0x16794d&&_0x16794d[_0x34ee35(0x1e9)]===_0x34ee35(0x1ec))return null;throw new Error(_0x34ee35(0x1ed)+_0x486aa8+':\x20'+_0x16794d);}}function a56_0x456b(){const _0x5a6e27=['cwd','5fJmJSY','code','658595eYstmF','utf-8','ENOENT','Failed\x20to\x20load\x20project\x20config\x20from\x20','api_key','warn','225996nlZxsR','writeFileSync','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','TD_API_KEY','24442623cxBxqC','tdx.json','apiKey','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','existsSync','2330008rpQjpN','stringify','parse','437304YBeHFw','1533968pqtTWB','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','dirname','119EOPPMZ','2037903vMIMXv','includes','join'];a56_0x456b=function(){return _0x5a6e27;};return a56_0x456b();}export function saveProjectConfig(_0x4f0e76,_0x57905f){const _0x144f03=a56_0x282dfa,_0x38b2cf=_0x57905f||process[_0x144f03(0x1e7)](),_0x3aa03d=a56_0x562836[_0x144f03(0x1e6)](_0x38b2cf,PROJECT_CONFIG_FILENAME),_0x4195d4=JSON[_0x144f03(0x1db)](_0x4f0e76);if(_0x4195d4[_0x144f03(0x1e5)]('TD_API_KEY')||_0x4195d4['includes'](_0x144f03(0x1d7))||_0x4195d4[_0x144f03(0x1e5)](_0x144f03(0x1ee)))throw new Error(_0x144f03(0x1f2));if('profile'in _0x4f0e76)throw new Error(_0x144f03(0x1e1));a56_0x3f66f6[_0x144f03(0x1f1)](_0x3aa03d,JSON[_0x144f03(0x1db)](_0x4f0e76,null,0x2));}export function hasProjectConfig(_0x1fbb7d){return findProjectConfigPath(_0x1fbb7d)!==null;}export function getProjectRoot(_0x5d212d){const _0x34647f=a56_0x282dfa,_0x5e951e=findProjectConfigPath(_0x5d212d);return _0x5e951e?a56_0x562836[_0x34647f(0x1e2)](_0x5e951e):null;}
1
+ const a56_0x3141c9=a56_0x497f;(function(_0x1fd89f,_0x3b48bf){const _0xc327c=a56_0x497f,_0x1db26c=_0x1fd89f();while(!![]){try{const _0x5aba98=-parseInt(_0xc327c(0xe0))/0x1*(-parseInt(_0xc327c(0xd9))/0x2)+parseInt(_0xc327c(0xd7))/0x3+-parseInt(_0xc327c(0xce))/0x4*(parseInt(_0xc327c(0xd8))/0x5)+parseInt(_0xc327c(0xc8))/0x6+parseInt(_0xc327c(0xe3))/0x7*(parseInt(_0xc327c(0xdf))/0x8)+-parseInt(_0xc327c(0xdd))/0x9*(parseInt(_0xc327c(0xde))/0xa)+-parseInt(_0xc327c(0xd6))/0xb;if(_0x5aba98===_0x3b48bf)break;else _0x1db26c['push'](_0x1db26c['shift']());}catch(_0x5514b5){_0x1db26c['push'](_0x1db26c['shift']());}}}(a56_0x1047,0x3c48e));function a56_0x1047(){const _0x1435f3=['cwd','parse','stringify','3497263USZueA','1349385FQrUqm','15yvwSeh','16vnNluU','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','readFileSync','existsSync','3987693wTUWPH','10NlOhXn','20584vCQTCW','25052INXGYk','Failed\x20to\x20load\x20project\x20config\x20from\x20','dirname','1113LPAwGY','\x20is\x20ignored.\x20','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','utf-8','api_key','code','tdx.json','880230ysWAFq','apiKey','profile','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','writeFileSync','join','264116QiWFNY','warn','ENOENT','includes','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20('];a56_0x1047=function(){return _0x1435f3;};return a56_0x1047();}function a56_0x497f(_0x4b6279,_0x25c5a6){_0x4b6279=_0x4b6279-0xc6;const _0x1047e1=a56_0x1047();let _0x497f69=_0x1047e1[_0x4b6279];return _0x497f69;}import*as a56_0x4f8ec6 from'node:fs';import*as a56_0x175299 from'node:path';const PROJECT_CONFIG_FILENAME=a56_0x3141c9(0xc7);export function findProjectConfigPath(_0xd0fe94){const _0x5f3e0d=a56_0x3141c9;let _0x1cda89=_0xd0fe94||process['cwd']();while(!![]){const _0x2ca3f6=a56_0x175299[_0x5f3e0d(0xcd)](_0x1cda89,PROJECT_CONFIG_FILENAME);if(a56_0x4f8ec6[_0x5f3e0d(0xdc)](_0x2ca3f6))return _0x2ca3f6;const _0x4a0c70=a56_0x175299[_0x5f3e0d(0xe2)](_0x1cda89);if(_0x4a0c70===_0x1cda89)return null;_0x1cda89=_0x4a0c70;}}export function loadProjectConfig(_0x12fa87){const _0x7f57d6=a56_0x3141c9,_0x31f829=findProjectConfigPath(_0x12fa87);if(!_0x31f829)return null;try{const _0x201ae9=a56_0x4f8ec6[_0x7f57d6(0xdb)](_0x31f829,_0x7f57d6(0xe6)),_0x53410c=JSON[_0x7f57d6(0xd4)](_0x201ae9),_0x5aa124=JSON[_0x7f57d6(0xd5)](_0x53410c);if(_0x5aa124[_0x7f57d6(0xd1)]('TD_API_KEY')||_0x5aa124[_0x7f57d6(0xd1)](_0x7f57d6(0xc9))||_0x5aa124['includes']('api_key'))throw new Error(_0x7f57d6(0xd2)+_0x31f829+').\x20'+_0x7f57d6(0xda));const {metadata:_0x5aa777,profile:_0x268fcf,..._0x2751d6}=_0x53410c;return _0x268fcf&&console[_0x7f57d6(0xcf)]('Warning:\x20\x27profile\x27\x20field\x20in\x20'+_0x31f829+_0x7f57d6(0xe4)+_0x7f57d6(0xcb)),_0x2751d6;}catch(_0x335b03){if(_0x335b03 instanceof Error&&_0x7f57d6(0xc6)in _0x335b03&&_0x335b03['code']===_0x7f57d6(0xd0))return null;throw new Error(_0x7f57d6(0xe1)+_0x31f829+':\x20'+_0x335b03);}}export function saveProjectConfig(_0x28f7a4,_0x2156b4){const _0x4a64f4=a56_0x3141c9,_0x244f07=_0x2156b4||process[_0x4a64f4(0xd3)](),_0x5cb8a1=a56_0x175299[_0x4a64f4(0xcd)](_0x244f07,PROJECT_CONFIG_FILENAME),_0x4869c7=JSON['stringify'](_0x28f7a4);if(_0x4869c7[_0x4a64f4(0xd1)]('TD_API_KEY')||_0x4869c7[_0x4a64f4(0xd1)]('apiKey')||_0x4869c7['includes'](_0x4a64f4(0xe7)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.');if(_0x4a64f4(0xca)in _0x28f7a4)throw new Error(_0x4a64f4(0xe5));a56_0x4f8ec6[_0x4a64f4(0xcc)](_0x5cb8a1,JSON['stringify'](_0x28f7a4,null,0x2));}export function hasProjectConfig(_0x73b501){return findProjectConfigPath(_0x73b501)!==null;}export function getProjectRoot(_0x57158a){const _0xc0591b=a56_0x3141c9,_0xaee589=findProjectConfigPath(_0x57158a);return _0xaee589?a56_0x175299[_0xc0591b(0xe2)](_0xaee589):null;}
@@ -1 +1 @@
1
- (function(_0x25aac2,_0x2809f9){const _0x49a78b=a57_0x5dba,_0x43011a=_0x25aac2();while(!![]){try{const _0x4ea3f2=-parseInt(_0x49a78b(0xbe))/0x1+-parseInt(_0x49a78b(0xcd))/0x2*(parseInt(_0x49a78b(0xbd))/0x3)+-parseInt(_0x49a78b(0xb8))/0x4+parseInt(_0x49a78b(0xbf))/0x5*(-parseInt(_0x49a78b(0xaa))/0x6)+parseInt(_0x49a78b(0xb9))/0x7*(parseInt(_0x49a78b(0xcc))/0x8)+parseInt(_0x49a78b(0xca))/0x9+parseInt(_0x49a78b(0xc2))/0xa*(parseInt(_0x49a78b(0xc0))/0xb);if(_0x4ea3f2===_0x2809f9)break;else _0x43011a['push'](_0x43011a['shift']());}catch(_0x2585fa){_0x43011a['push'](_0x43011a['shift']());}}}(a57_0x3bb5,0xc1b02));import*as a57_0x28cc75 from'node:fs';import*as a57_0xe8d060 from'node:path';import*as a57_0xf6f756 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 _0x516085=a57_0x5dba,_0x5ae925=process.env.TDX_CONFIG_DIR||a57_0xe8d060['join'](a57_0xf6f756['homedir'](),_0x516085(0xb2),_0x516085(0xd0));return a57_0xe8d060[_0x516085(0xd2)](_0x5ae925,_0x516085(0xd1));}function a57_0x3bb5(){const _0x4e5fb1=['8771334fbOPob','stringify','getTime','includes','unlinkSync','parse','warn','existsSync','.config','replace','toISOString','createdAt','push','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','6262300vrUbNc','178878zRHLzp','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','apiKey','test','27eHBDmU','783562VStIfG','5OcDWbW','22sDljrB','utf-8','22718220kHZCzU','endsWith','now','sort','.json','readFileSync','api_key','readdirSync','10443753YJZygw','.\x20This\x20is\x20insecure.\x20Removing\x20session.','32grChib','267090UOcnAE','toString','writeFileSync','tdx','sessions','join','TD_API_KEY'];a57_0x3bb5=function(){return _0x4e5fb1;};return a57_0x3bb5();}function getSessionPath(_0x51cc1c){const _0x615045=a57_0x5dba;return a57_0xe8d060[_0x615045(0xd2)](getSessionsDir(),_0x51cc1c+_0x615045(0xc6));}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x142a68){if(_0x142a68)return _0x142a68;if(process.env.TDX_SESSION)return process.env.TDX_SESSION;return getCurrentSessionPID()['toString']();}export function loadSessionContext(_0x6d0ca4){const _0x4e2d19=getSessionID(_0x6d0ca4),_0x2a1dc8=/^\d+$/['test'](_0x4e2d19)?parseInt(_0x4e2d19,0xa):null;return _0x2a1dc8!==null?loadSessionContextByPID(_0x2a1dc8):loadSessionContextByString(_0x4e2d19);}function a57_0x5dba(_0xb24c6f,_0x5a09bd){_0xb24c6f=_0xb24c6f-0xaa;const _0x3bb541=a57_0x3bb5();let _0x5dbada=_0x3bb541[_0xb24c6f];return _0x5dbada;}export function loadSessionContextByPID(_0x50cb88){const _0x52d5f2=a57_0x5dba,_0xd63321=getSessionPath(_0x50cb88);if(!a57_0x28cc75[_0x52d5f2(0xb1)](_0xd63321))return null;try{const _0x14a531=a57_0x28cc75[_0x52d5f2(0xc7)](_0xd63321,_0x52d5f2(0xc1)),_0x38c517=JSON[_0x52d5f2(0xaf)](_0x14a531),_0x238f7f=new Date(_0x38c517[_0x52d5f2(0xb5)])[_0x52d5f2(0xac)](),_0x2e5551=Date[_0x52d5f2(0xc4)]();if(_0x2e5551-_0x238f7f>SESSION_EXPIRATION_MS)return a57_0x28cc75[_0x52d5f2(0xae)](_0xd63321),null;const _0x3af3e9=JSON[_0x52d5f2(0xab)](_0x38c517);if(_0x3af3e9['includes'](_0x52d5f2(0xd3))||_0x3af3e9['includes']('apiKey')||_0x3af3e9['includes']('api_key'))return console['warn']('Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20'+_0xd63321+_0x52d5f2(0xcb)),a57_0x28cc75['unlinkSync'](_0xd63321),null;return _0x38c517;}catch{try{a57_0x28cc75[_0x52d5f2(0xae)](_0xd63321);}catch{}return null;}}function loadSessionContextByString(_0x3b36ad){const _0x396cf5=a57_0x5dba,_0x38ef73=a57_0xe8d060[_0x396cf5(0xd2)](getSessionsDir(),_0x3b36ad+_0x396cf5(0xc6));if(!a57_0x28cc75['existsSync'](_0x38ef73))return null;try{const _0x14af5c=a57_0x28cc75[_0x396cf5(0xc7)](_0x38ef73,_0x396cf5(0xc1)),_0xc5b83=JSON[_0x396cf5(0xaf)](_0x14af5c),_0x51c0c9=new Date(_0xc5b83[_0x396cf5(0xb5)])[_0x396cf5(0xac)](),_0x2e24c7=Date[_0x396cf5(0xc4)]();if(_0x2e24c7-_0x51c0c9>SESSION_EXPIRATION_MS)return a57_0x28cc75[_0x396cf5(0xae)](_0x38ef73),null;const _0x4cc771=JSON[_0x396cf5(0xab)](_0xc5b83);if(_0x4cc771[_0x396cf5(0xad)](_0x396cf5(0xd3))||_0x4cc771['includes']('apiKey')||_0x4cc771['includes']('api_key'))return console[_0x396cf5(0xb0)](_0x396cf5(0xb7)+_0x38ef73+_0x396cf5(0xcb)),a57_0x28cc75[_0x396cf5(0xae)](_0x38ef73),null;return _0xc5b83;}catch{try{a57_0x28cc75[_0x396cf5(0xae)](_0x38ef73);}catch{}return null;}}export function saveSessionContext(_0x2dd91f,_0x5dbe14){const _0x5569ca=a57_0x5dba,_0x263209=getSessionID(_0x5dbe14),_0x57ffad=/^\d+$/['test'](_0x263209)?parseInt(_0x263209,0xa):getCurrentSessionPID(),_0x5056aa=a57_0xe8d060['join'](getSessionsDir(),_0x263209+'.json'),_0x25923b=getSessionsDir();createSecureDirectory(_0x25923b);const _0x4ec2d9=JSON[_0x5569ca(0xab)](_0x2dd91f);if(_0x4ec2d9[_0x5569ca(0xad)](_0x5569ca(0xd3))||_0x4ec2d9[_0x5569ca(0xad)](_0x5569ca(0xbb))||_0x4ec2d9[_0x5569ca(0xad)](_0x5569ca(0xc8)))throw new Error(_0x5569ca(0xba));let _0x280db7;const _0x1f5c80=/^\d+$/[_0x5569ca(0xbc)](_0x263209)?loadSessionContextByPID(parseInt(_0x263209,0xa)):loadSessionContextByString(_0x263209);_0x1f5c80?_0x280db7={..._0x1f5c80,..._0x2dd91f,'pid':_0x57ffad,'sessionId':_0x263209!==_0x57ffad[_0x5569ca(0xce)]()?_0x263209:undefined,'updatedAt':new Date()[_0x5569ca(0xb4)]()}:_0x280db7={'pid':_0x57ffad,'sessionId':_0x263209!==_0x57ffad[_0x5569ca(0xce)]()?_0x263209:undefined,..._0x2dd91f,'createdAt':new Date()['toISOString'](),'updatedAt':new Date()['toISOString']()},a57_0x28cc75[_0x5569ca(0xcf)](_0x5056aa,JSON[_0x5569ca(0xab)](_0x280db7,null,0x2));}export function clearSessionContext(_0x4bb4f){const _0x4a1f95=a57_0x5dba,_0x1afdc5=getSessionID(_0x4bb4f),_0x107b2d=a57_0xe8d060[_0x4a1f95(0xd2)](getSessionsDir(),_0x1afdc5+_0x4a1f95(0xc6));a57_0x28cc75[_0x4a1f95(0xb1)](_0x107b2d)&&a57_0x28cc75[_0x4a1f95(0xae)](_0x107b2d);}export function clearSessionContextField(_0x143d71,_0x23f9ef){const _0x26f8c8=a57_0x5dba,_0x5cc732=getSessionID(_0x23f9ef),_0x4352b6=a57_0xe8d060[_0x26f8c8(0xd2)](getSessionsDir(),_0x5cc732+_0x26f8c8(0xc6));if(!a57_0x28cc75['existsSync'](_0x4352b6))return;try{const _0x2bfcbb=a57_0x28cc75[_0x26f8c8(0xc7)](_0x4352b6,_0x26f8c8(0xc1)),_0x390703=JSON[_0x26f8c8(0xaf)](_0x2bfcbb);delete _0x390703[_0x143d71],a57_0x28cc75['writeFileSync'](_0x4352b6,JSON[_0x26f8c8(0xab)](_0x390703,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x56b7e7=a57_0x5dba,_0xdddec=getSessionsDir();if(!a57_0x28cc75['existsSync'](_0xdddec))return 0x0;let _0x5a2fdd=0x0;const _0x2a1557=Date[_0x56b7e7(0xc4)]();try{const _0x5397ad=a57_0x28cc75[_0x56b7e7(0xc9)](_0xdddec);for(const _0x5688ec of _0x5397ad){if(!_0x5688ec[_0x56b7e7(0xc3)](_0x56b7e7(0xc6)))continue;const _0x14aec0=a57_0xe8d060[_0x56b7e7(0xd2)](_0xdddec,_0x5688ec),_0x35335a=_0x5688ec[_0x56b7e7(0xb3)](_0x56b7e7(0xc6),''),_0x284467=parseInt(_0x35335a,0xa),_0x3734e1=!isNaN(_0x284467);if(_0x3734e1){if(!isProcessRunning(_0x284467)){a57_0x28cc75[_0x56b7e7(0xae)](_0x14aec0),_0x5a2fdd++;continue;}}try{const _0x3b4930=a57_0x28cc75[_0x56b7e7(0xc7)](_0x14aec0,'utf-8'),_0xd639c6=JSON['parse'](_0x3b4930),_0xee64e9=new Date(_0xd639c6[_0x56b7e7(0xb5)])[_0x56b7e7(0xac)]();_0x2a1557-_0xee64e9>SESSION_EXPIRATION_MS&&(a57_0x28cc75['unlinkSync'](_0x14aec0),_0x5a2fdd++);}catch{a57_0x28cc75[_0x56b7e7(0xae)](_0x14aec0),_0x5a2fdd++;}}}catch{}return _0x5a2fdd;}export function listActiveSessions(){const _0x2aee34=a57_0x5dba,_0x37b9eb=getSessionsDir();if(!a57_0x28cc75['existsSync'](_0x37b9eb))return[];try{const _0x1c12e3=a57_0x28cc75[_0x2aee34(0xc9)](_0x37b9eb),_0x47c2c0=[];for(const _0x55e47d of _0x1c12e3){if(!_0x55e47d[_0x2aee34(0xc3)](_0x2aee34(0xc6)))continue;const _0x194b10=_0x55e47d[_0x2aee34(0xb3)](_0x2aee34(0xc6),''),_0x1852b6=parseInt(_0x194b10,0xa);!isNaN(_0x1852b6)&&isProcessRunning(_0x1852b6)&&_0x47c2c0[_0x2aee34(0xb6)](_0x1852b6);}return _0x47c2c0[_0x2aee34(0xc5)]((_0x147a84,_0x2fd5b3)=>_0x147a84-_0x2fd5b3);}catch{return[];}}
1
+ (function(_0x1f453d,_0x58d55a){const _0x57d4da=a57_0x3d73,_0x5ea368=_0x1f453d();while(!![]){try{const _0x44958b=-parseInt(_0x57d4da(0xd7))/0x1+parseInt(_0x57d4da(0xb9))/0x2+-parseInt(_0x57d4da(0xc5))/0x3*(parseInt(_0x57d4da(0xc2))/0x4)+parseInt(_0x57d4da(0xe0))/0x5+parseInt(_0x57d4da(0xdb))/0x6*(-parseInt(_0x57d4da(0xd5))/0x7)+parseInt(_0x57d4da(0xdf))/0x8*(parseInt(_0x57d4da(0xdd))/0x9)+parseInt(_0x57d4da(0xba))/0xa;if(_0x44958b===_0x58d55a)break;else _0x5ea368['push'](_0x5ea368['shift']());}catch(_0x116126){_0x5ea368['push'](_0x5ea368['shift']());}}}(a57_0x4c16,0x52d29));import*as a57_0x4adaab from'node:fs';import*as a57_0x1c14dc from'node:path';import*as a57_0x4a6a5d 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 _0x389174=a57_0x3d73,_0x220a84=process.env.TDX_CONFIG_DIR||a57_0x1c14dc[_0x389174(0xca)](a57_0x4a6a5d[_0x389174(0xc6)](),_0x389174(0xc1),_0x389174(0xc0));return a57_0x1c14dc[_0x389174(0xca)](_0x220a84,'sessions');}function getSessionPath(_0x4d65a3){const _0x21098b=a57_0x3d73;return a57_0x1c14dc[_0x21098b(0xca)](getSessionsDir(),_0x4d65a3+_0x21098b(0xd9));}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x334232){const _0x40e520=a57_0x3d73;if(_0x334232)return _0x334232;if(process.env.TDX_SESSION)return process.env.TDX_SESSION;return getCurrentSessionPID()[_0x40e520(0xde)]();}function a57_0x3d73(_0x2f9a27,_0x58af81){_0x2f9a27=_0x2f9a27-0xb9;const _0x4c1697=a57_0x4c16();let _0x3d73e6=_0x4c1697[_0x2f9a27];return _0x3d73e6;}export function loadSessionContext(_0x5d0da8){const _0x1fd75f=getSessionID(_0x5d0da8),_0x925f5e=/^\d+$/['test'](_0x1fd75f)?parseInt(_0x1fd75f,0xa):null;return _0x925f5e!==null?loadSessionContextByPID(_0x925f5e):loadSessionContextByString(_0x1fd75f);}export function loadSessionContextByPID(_0x5a85f9){const _0x58b236=a57_0x3d73,_0x295404=getSessionPath(_0x5a85f9);if(!a57_0x4adaab['existsSync'](_0x295404))return null;try{const _0x1492a5=a57_0x4adaab['readFileSync'](_0x295404,_0x58b236(0xd0)),_0x3082fc=JSON[_0x58b236(0xce)](_0x1492a5),_0x2cebea=new Date(_0x3082fc[_0x58b236(0xcf)])['getTime'](),_0x25853e=Date[_0x58b236(0xbe)]();if(_0x25853e-_0x2cebea>SESSION_EXPIRATION_MS)return a57_0x4adaab['unlinkSync'](_0x295404),null;const _0x2c5c27=JSON[_0x58b236(0xcd)](_0x3082fc);if(_0x2c5c27[_0x58b236(0xc9)]('TD_API_KEY')||_0x2c5c27[_0x58b236(0xc9)]('apiKey')||_0x2c5c27[_0x58b236(0xc9)]('api_key'))return console['warn']('Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20'+_0x295404+_0x58b236(0xdc)),a57_0x4adaab['unlinkSync'](_0x295404),null;return _0x3082fc;}catch{try{a57_0x4adaab[_0x58b236(0xd3)](_0x295404);}catch{}return null;}}function a57_0x4c16(){const _0x2d4576=['939792IiFXix','toISOString','readdirSync','6YzzBaf','homedir','push','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','includes','join','replace','api_key','stringify','parse','createdAt','utf-8','TD_API_KEY','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','unlinkSync','existsSync','2261HDeKkM','writeFileSync','494577ykfAcU','readFileSync','.json','getTime','4962bkzaiT','.\x20This\x20is\x20insecure.\x20Removing\x20session.','666rgrbWB','toString','47264RavqJy','2351905APuwOu','873796CjqkJa','2263640OdciiE','warn','test','apiKey','now','endsWith','tdx','.config'];a57_0x4c16=function(){return _0x2d4576;};return a57_0x4c16();}function loadSessionContextByString(_0x24b1da){const _0x5c1923=a57_0x3d73,_0x3bb754=a57_0x1c14dc[_0x5c1923(0xca)](getSessionsDir(),_0x24b1da+_0x5c1923(0xd9));if(!a57_0x4adaab[_0x5c1923(0xd4)](_0x3bb754))return null;try{const _0x1b57eb=a57_0x4adaab[_0x5c1923(0xd8)](_0x3bb754,_0x5c1923(0xd0)),_0x1172b2=JSON[_0x5c1923(0xce)](_0x1b57eb),_0x21d3ee=new Date(_0x1172b2[_0x5c1923(0xcf)])[_0x5c1923(0xda)](),_0x3a9ff4=Date[_0x5c1923(0xbe)]();if(_0x3a9ff4-_0x21d3ee>SESSION_EXPIRATION_MS)return a57_0x4adaab[_0x5c1923(0xd3)](_0x3bb754),null;const _0x4ad7f7=JSON[_0x5c1923(0xcd)](_0x1172b2);if(_0x4ad7f7[_0x5c1923(0xc9)](_0x5c1923(0xd1))||_0x4ad7f7['includes']('apiKey')||_0x4ad7f7[_0x5c1923(0xc9)](_0x5c1923(0xcc)))return console[_0x5c1923(0xbb)](_0x5c1923(0xc8)+_0x3bb754+'.\x20This\x20is\x20insecure.\x20Removing\x20session.'),a57_0x4adaab[_0x5c1923(0xd3)](_0x3bb754),null;return _0x1172b2;}catch{try{a57_0x4adaab['unlinkSync'](_0x3bb754);}catch{}return null;}}export function saveSessionContext(_0x30c9bd,_0x1db9e5){const _0x5d467d=a57_0x3d73,_0x2b555e=getSessionID(_0x1db9e5),_0x53af22=/^\d+$/[_0x5d467d(0xbc)](_0x2b555e)?parseInt(_0x2b555e,0xa):getCurrentSessionPID(),_0x36231c=a57_0x1c14dc[_0x5d467d(0xca)](getSessionsDir(),_0x2b555e+'.json'),_0x9e882e=getSessionsDir();createSecureDirectory(_0x9e882e);const _0x18c4cb=JSON[_0x5d467d(0xcd)](_0x30c9bd);if(_0x18c4cb[_0x5d467d(0xc9)](_0x5d467d(0xd1))||_0x18c4cb['includes'](_0x5d467d(0xbd))||_0x18c4cb[_0x5d467d(0xc9)]('api_key'))throw new Error(_0x5d467d(0xd2));let _0x26bcfd;const _0xfadf42=/^\d+$/[_0x5d467d(0xbc)](_0x2b555e)?loadSessionContextByPID(parseInt(_0x2b555e,0xa)):loadSessionContextByString(_0x2b555e);_0xfadf42?_0x26bcfd={..._0xfadf42,..._0x30c9bd,'pid':_0x53af22,'sessionId':_0x2b555e!==_0x53af22[_0x5d467d(0xde)]()?_0x2b555e:undefined,'updatedAt':new Date()[_0x5d467d(0xc3)]()}:_0x26bcfd={'pid':_0x53af22,'sessionId':_0x2b555e!==_0x53af22[_0x5d467d(0xde)]()?_0x2b555e:undefined,..._0x30c9bd,'createdAt':new Date()['toISOString'](),'updatedAt':new Date()[_0x5d467d(0xc3)]()},a57_0x4adaab[_0x5d467d(0xd6)](_0x36231c,JSON['stringify'](_0x26bcfd,null,0x2));}export function clearSessionContext(_0xb6ad08){const _0x565324=a57_0x3d73,_0x359d9f=getSessionID(_0xb6ad08),_0x2bfff6=a57_0x1c14dc[_0x565324(0xca)](getSessionsDir(),_0x359d9f+_0x565324(0xd9));a57_0x4adaab['existsSync'](_0x2bfff6)&&a57_0x4adaab[_0x565324(0xd3)](_0x2bfff6);}export function clearSessionContextField(_0x4ae8f2,_0x49003f){const _0x38e68a=a57_0x3d73,_0x594253=getSessionID(_0x49003f),_0x2376b4=a57_0x1c14dc[_0x38e68a(0xca)](getSessionsDir(),_0x594253+'.json');if(!a57_0x4adaab['existsSync'](_0x2376b4))return;try{const _0x3e701b=a57_0x4adaab[_0x38e68a(0xd8)](_0x2376b4,_0x38e68a(0xd0)),_0x5815d1=JSON[_0x38e68a(0xce)](_0x3e701b);delete _0x5815d1[_0x4ae8f2],a57_0x4adaab['writeFileSync'](_0x2376b4,JSON[_0x38e68a(0xcd)](_0x5815d1,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x553a0b=a57_0x3d73,_0x23ec5d=getSessionsDir();if(!a57_0x4adaab[_0x553a0b(0xd4)](_0x23ec5d))return 0x0;let _0x452fd8=0x0;const _0x4e64ea=Date['now']();try{const _0xed3d68=a57_0x4adaab[_0x553a0b(0xc4)](_0x23ec5d);for(const _0x35637d of _0xed3d68){if(!_0x35637d[_0x553a0b(0xbf)](_0x553a0b(0xd9)))continue;const _0x489c4f=a57_0x1c14dc[_0x553a0b(0xca)](_0x23ec5d,_0x35637d),_0x4fa3cf=_0x35637d[_0x553a0b(0xcb)]('.json',''),_0x13bc23=parseInt(_0x4fa3cf,0xa),_0x40c9d9=!isNaN(_0x13bc23);if(_0x40c9d9){if(!isProcessRunning(_0x13bc23)){a57_0x4adaab[_0x553a0b(0xd3)](_0x489c4f),_0x452fd8++;continue;}}try{const _0x1f3559=a57_0x4adaab['readFileSync'](_0x489c4f,_0x553a0b(0xd0)),_0xac9caa=JSON[_0x553a0b(0xce)](_0x1f3559),_0x1c74ac=new Date(_0xac9caa[_0x553a0b(0xcf)])[_0x553a0b(0xda)]();_0x4e64ea-_0x1c74ac>SESSION_EXPIRATION_MS&&(a57_0x4adaab[_0x553a0b(0xd3)](_0x489c4f),_0x452fd8++);}catch{a57_0x4adaab[_0x553a0b(0xd3)](_0x489c4f),_0x452fd8++;}}}catch{}return _0x452fd8;}export function listActiveSessions(){const _0x2426b4=a57_0x3d73,_0x5a65e8=getSessionsDir();if(!a57_0x4adaab['existsSync'](_0x5a65e8))return[];try{const _0x22e1cc=a57_0x4adaab[_0x2426b4(0xc4)](_0x5a65e8),_0x231444=[];for(const _0xbf1cfc of _0x22e1cc){if(!_0xbf1cfc[_0x2426b4(0xbf)](_0x2426b4(0xd9)))continue;const _0x17cb55=_0xbf1cfc[_0x2426b4(0xcb)](_0x2426b4(0xd9),''),_0x120bd9=parseInt(_0x17cb55,0xa);!isNaN(_0x120bd9)&&isProcessRunning(_0x120bd9)&&_0x231444[_0x2426b4(0xc7)](_0x120bd9);}return _0x231444['sort']((_0x11460f,_0x18d325)=>_0x11460f-_0x18d325);}catch{return[];}}
@@ -1 +1 @@
1
- const a58_0x2b67d3=a58_0x3201;(function(_0x19bf14,_0x472edc){const _0x4dad2c=a58_0x3201,_0xe858f7=_0x19bf14();while(!![]){try{const _0x49b03c=parseInt(_0x4dad2c(0x105))/0x1+-parseInt(_0x4dad2c(0xfc))/0x2*(-parseInt(_0x4dad2c(0xfe))/0x3)+parseInt(_0x4dad2c(0xfb))/0x4*(-parseInt(_0x4dad2c(0x102))/0x5)+parseInt(_0x4dad2c(0x101))/0x6*(-parseInt(_0x4dad2c(0xf7))/0x7)+-parseInt(_0x4dad2c(0xf8))/0x8+parseInt(_0x4dad2c(0x100))/0x9+-parseInt(_0x4dad2c(0x104))/0xa;if(_0x49b03c===_0x472edc)break;else _0xe858f7['push'](_0xe858f7['shift']());}catch(_0x339f9f){_0xe858f7['push'](_0xe858f7['shift']());}}}(a58_0x4bed,0x2605d));import{createProfileCache}from'../utils/global-cache.js';function a58_0x3201(_0x33a9b9,_0x4ef622){_0x33a9b9=_0x33a9b9-0xf7;const _0x4bed91=a58_0x4bed();let _0x320152=_0x4bed91[_0x33a9b9];return _0x320152;}const userCache=createProfileCache(a58_0x2b67d3(0xf9),'core/user-cache');export function loadCachedUsers(_0x65f42b){const _0x374e2f=a58_0x2b67d3,_0xe941ac=userCache[_0x374e2f(0xfa)](_0x65f42b);return _0xe941ac?.[_0x374e2f(0xfd)]??null;}export function saveCachedUsers(_0x3a2108,_0x1eeddc){const _0x594ff2=a58_0x2b67d3;userCache['write'](_0x3a2108,{'users':_0x1eeddc,'cachedAt':Date[_0x594ff2(0xff)]()});}export function clearUserCache(_0x3e90a1){const _0x41e046=a58_0x2b67d3;userCache[_0x41e046(0x103)](_0x3e90a1);}function a58_0x4bed(){const _0x124ad6=['clear','3013040JTlevd','223638GgVmUJ','14413XByvNW','489096GJRdIN','users-{profile}.json','read','264HPBqNd','11098ZKgKMX','users','111jdybde','now','2025198hBFFYT','318rYvtLI','2020GMqMfj'];a58_0x4bed=function(){return _0x124ad6;};return a58_0x4bed();}
1
+ const a58_0x36756f=a58_0x430d;(function(_0x42a676,_0x4dd9f8){const _0x28b434=a58_0x430d,_0xa65e0f=_0x42a676();while(!![]){try{const _0x2c460b=-parseInt(_0x28b434(0xdb))/0x1*(parseInt(_0x28b434(0xde))/0x2)+-parseInt(_0x28b434(0xd7))/0x3*(parseInt(_0x28b434(0xd6))/0x4)+parseInt(_0x28b434(0xd8))/0x5*(parseInt(_0x28b434(0xd5))/0x6)+-parseInt(_0x28b434(0xe1))/0x7*(parseInt(_0x28b434(0xdd))/0x8)+-parseInt(_0x28b434(0xda))/0x9+parseInt(_0x28b434(0xe2))/0xa*(-parseInt(_0x28b434(0xdc))/0xb)+parseInt(_0x28b434(0xe0))/0xc;if(_0x2c460b===_0x4dd9f8)break;else _0xa65e0f['push'](_0xa65e0f['shift']());}catch(_0x47fc87){_0xa65e0f['push'](_0xa65e0f['shift']());}}}(a58_0x5abb,0x27cbf));import{createProfileCache}from'../utils/global-cache.js';function a58_0x5abb(){const _0x649a90=['clear','6527100loxFYM','14pCIQTv','10SajxeA','users-{profile}.json','read','write','6PdfXdz','1252QKkFLx','996mNQNYf','1416310swwpjK','now','280413khuvbv','3447IYnELC','3445332GRjzFj','270696dvMpIE','86jUfRJY'];a58_0x5abb=function(){return _0x649a90;};return a58_0x5abb();}const userCache=createProfileCache(a58_0x36756f(0xe3),'core/user-cache');export function loadCachedUsers(_0x3df7fc){const _0x158ccb=a58_0x36756f,_0x12e06b=userCache[_0x158ccb(0xe4)](_0x3df7fc);return _0x12e06b?.['users']??null;}export function saveCachedUsers(_0x3355ff,_0x17481b){const _0x362a7d=a58_0x36756f;userCache[_0x362a7d(0xe5)](_0x3355ff,{'users':_0x17481b,'cachedAt':Date[_0x362a7d(0xd9)]()});}function a58_0x430d(_0x37eda4,_0x3d206d){_0x37eda4=_0x37eda4-0xd5;const _0x5abb42=a58_0x5abb();let _0x430ded=_0x5abb42[_0x37eda4];return _0x430ded;}export function clearUserCache(_0x566d91){const _0x3bef95=a58_0x36756f;userCache[_0x3bef95(0xdf)](_0x566d91);}
@@ -1 +1 @@
1
- (function(_0x1f05a5,_0x283188){const _0x381e12=a59_0x452b,_0x32582f=_0x1f05a5();while(!![]){try{const _0x29118b=-parseInt(_0x381e12(0x1a2))/0x1*(-parseInt(_0x381e12(0x1ab))/0x2)+parseInt(_0x381e12(0x1a7))/0x3*(parseInt(_0x381e12(0x19b))/0x4)+-parseInt(_0x381e12(0x1a3))/0x5+parseInt(_0x381e12(0x1aa))/0x6+-parseInt(_0x381e12(0x1a6))/0x7*(parseInt(_0x381e12(0x1ac))/0x8)+-parseInt(_0x381e12(0x19f))/0x9+parseInt(_0x381e12(0x1a9))/0xa*(parseInt(_0x381e12(0x19c))/0xb);if(_0x29118b===_0x283188)break;else _0x32582f['push'](_0x32582f['shift']());}catch(_0x570b36){_0x32582f['push'](_0x32582f['shift']());}}}(a59_0x1dcf,0x2d24f));import{readFileSync}from'fs';function a59_0x452b(_0x400b48,_0x299cf7){_0x400b48=_0x400b48-0x19b;const _0x1dcf1d=a59_0x1dcf();let _0x452bb7=_0x1dcf1d[_0x400b48];return _0x452bb7;}import{fileURLToPath}from'url';import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0xa7db47=a59_0x452b;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x127aa5=fileURLToPath(import.meta.url),_0x57d3de=dirname(_0x127aa5);try{const _0x45e812=join(_0x57d3de,_0xa7db47(0x1a0));cachedBuildInfo=JSON['parse'](readFileSync(_0x45e812,_0xa7db47(0x19d)));}catch{cachedBuildInfo={};}return cachedBuildInfo;}function a59_0x1dcf(){const _0x42aa9d=['1533303XGyama','../build-info.json','version','1VzssYq','882710iEmJbr','includes','../../package.json','28JHVIbp','6RmFHQf','0.0.0','125030puaASR','1182168bykSNS','160652eZlquM','667248hbeDgT','526024bdQJkl','286tKTHIT','utf-8','parse'];a59_0x1dcf=function(){return _0x42aa9d;};return a59_0x1dcf();}export function getVersion(){const _0xee53db=a59_0x452b;if(cachedVersion!==null)return cachedVersion;const _0x1cd17f=fileURLToPath(import.meta.url),_0x59eccd=dirname(_0x1cd17f),_0x34937a=getBuildInfo();if(_0x34937a['version'])return cachedVersion=_0x34937a[_0xee53db(0x1a1)],cachedVersion;try{const _0x262b69=join(_0x59eccd,_0xee53db(0x1a5)),_0x4302a8=JSON[_0xee53db(0x19e)](readFileSync(_0x262b69,'utf-8'));cachedVersion=_0x4302a8[_0xee53db(0x1a1)];}catch{cachedVersion=_0xee53db(0x1a8);}return cachedVersion;}export function isDevVersion(){const _0x1244d8=a59_0x452b,_0x207185=getVersion();return _0x207185['includes']('.dev')||_0x207185[_0x1244d8(0x1a4)]('-');}
1
+ (function(_0x5436ca,_0x2a09b6){const _0x156b7c=a59_0x54fc,_0x3e5caa=_0x5436ca();while(!![]){try{const _0x21ac9f=-parseInt(_0x156b7c(0x1b1))/0x1*(parseInt(_0x156b7c(0x1b0))/0x2)+-parseInt(_0x156b7c(0x1a6))/0x3+parseInt(_0x156b7c(0x1a7))/0x4+parseInt(_0x156b7c(0x1a5))/0x5*(parseInt(_0x156b7c(0x1aa))/0x6)+parseInt(_0x156b7c(0x1b3))/0x7+parseInt(_0x156b7c(0x1a9))/0x8+-parseInt(_0x156b7c(0x1a4))/0x9;if(_0x21ac9f===_0x2a09b6)break;else _0x3e5caa['push'](_0x3e5caa['shift']());}catch(_0x5b50c9){_0x3e5caa['push'](_0x3e5caa['shift']());}}}(a59_0x339a,0xf2de8));import{readFileSync}from'fs';function a59_0x54fc(_0x25fd5c,_0x5997b2){_0x25fd5c=_0x25fd5c-0x1a4;const _0x339a90=a59_0x339a();let _0x54fc5a=_0x339a90[_0x25fd5c];return _0x54fc5a;}import{fileURLToPath}from'url';import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0x59b5e1=a59_0x54fc;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x35caf0=fileURLToPath(import.meta.url),_0x1bd202=dirname(_0x35caf0);try{const _0x4d6de0=join(_0x1bd202,'../build-info.json');cachedBuildInfo=JSON[_0x59b5e1(0x1b2)](readFileSync(_0x4d6de0,_0x59b5e1(0x1ae)));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0x370ab9=a59_0x54fc;if(cachedVersion!==null)return cachedVersion;const _0x124a45=fileURLToPath(import.meta.url),_0x1347fc=dirname(_0x124a45),_0x1d0e63=getBuildInfo();if(_0x1d0e63['version'])return cachedVersion=_0x1d0e63[_0x370ab9(0x1ac)],cachedVersion;try{const _0x450ff7=join(_0x1347fc,_0x370ab9(0x1ab)),_0x37881d=JSON[_0x370ab9(0x1b2)](readFileSync(_0x450ff7,_0x370ab9(0x1ae)));cachedVersion=_0x37881d[_0x370ab9(0x1ac)];}catch{cachedVersion=_0x370ab9(0x1af);}return cachedVersion;}export function isDevVersion(){const _0xfb4e9f=a59_0x54fc,_0x122aa2=getVersion();return _0x122aa2['includes'](_0xfb4e9f(0x1ad))||_0x122aa2[_0xfb4e9f(0x1a8)]('-');}function a59_0x339a(){const _0x3f20b5=['utf-8','0.0.0','270yWqAhl','2293VbcBDC','parse','9322642wGodwj','9479376xlSRCR','30zaGqOf','2866662ALwNrb','2267408TEomsX','includes','11297768ZYTuaJ','2286HGXPYM','../../package.json','version','.dev'];a59_0x339a=function(){return _0x3f20b5;};return a59_0x339a();}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- (function(_0x1a2665,_0x4e4d10){var _0x43225d=a60_0x289e,_0x4f6195=_0x1a2665();while(!![]){try{var _0x1cd47a=-parseInt(_0x43225d(0x119))/0x1+parseInt(_0x43225d(0x114))/0x2*(parseInt(_0x43225d(0x113))/0x3)+-parseInt(_0x43225d(0x116))/0x4*(-parseInt(_0x43225d(0x111))/0x5)+parseInt(_0x43225d(0x118))/0x6+parseInt(_0x43225d(0x117))/0x7+-parseInt(_0x43225d(0x11b))/0x8*(-parseInt(_0x43225d(0x115))/0x9)+-parseInt(_0x43225d(0x112))/0xa*(parseInt(_0x43225d(0x11a))/0xb);if(_0x1cd47a===_0x4e4d10)break;else _0x4f6195['push'](_0x4f6195['shift']());}catch(_0x487fc8){_0x4f6195['push'](_0x4f6195['shift']());}}}(a60_0x5102,0xda7d0));function a60_0x5102(){var _0x1ab48a=['439439SSZuZB','1345216wxwuGb','1043090WvHFtN','770LLyUij','1178433UgGNHQ','2qqmCuF','63QzQdqg','16csaOxF','11044670iAiJhE','6733230sFoQJT','1133361vDXIHE'];a60_0x5102=function(){return _0x1ab48a;};return a60_0x5102();}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';function a60_0x289e(_0x1db509,_0x3372a2){_0x1db509=_0x1db509-0x111;var _0x510247=a60_0x5102();var _0x289edf=_0x510247[_0x1db509];return _0x289edf;}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';export*from'./commands/describe.js';export*from'./sdk/index.js';
1
+ (function(_0x4bf78b,_0x3944c8){var _0x2802de=a60_0x28a2,_0x540737=_0x4bf78b();while(!![]){try{var _0x182f66=-parseInt(_0x2802de(0x99))/0x1*(-parseInt(_0x2802de(0x95))/0x2)+parseInt(_0x2802de(0x9e))/0x3*(-parseInt(_0x2802de(0x9a))/0x4)+-parseInt(_0x2802de(0x96))/0x5+-parseInt(_0x2802de(0x9d))/0x6*(-parseInt(_0x2802de(0x9c))/0x7)+parseInt(_0x2802de(0x9f))/0x8*(parseInt(_0x2802de(0x97))/0x9)+parseInt(_0x2802de(0x9b))/0xa+-parseInt(_0x2802de(0x98))/0xb;if(_0x182f66===_0x3944c8)break;else _0x540737['push'](_0x540737['shift']());}catch(_0x5ad390){_0x540737['push'](_0x540737['shift']());}}}(a60_0x1625,0xe2e63));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';function a60_0x1625(){var _0x5c86c4=['1002YmMZum','2383923IpaNEX','8BlwOtE','4gKloVI','7894730StBGvm','15146640lcDkFJ','32181743xqkisv','833717ICtASS','4ENodeJ','12998680zXBVBN','66157UUNzBS'];a60_0x1625=function(){return _0x5c86c4;};return a60_0x1625();}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';function a60_0x28a2(_0x4601ba,_0x1b95cb){_0x4601ba=_0x4601ba-0x95;var _0x16258e=a60_0x1625();var _0x28a289=_0x16258e[_0x4601ba];return _0x28a289;}export*from'./commands/show.js';export*from'./commands/describe.js';export*from'./sdk/index.js';
@@ -1 +1 @@
1
- (function(_0x22d529,_0x3b2f52){const _0x3f9f93=a61_0x4bf6,_0xb7980b=_0x22d529();while(!![]){try{const _0x2d73d0=parseInt(_0x3f9f93(0x140))/0x1+parseInt(_0x3f9f93(0x157))/0x2+-parseInt(_0x3f9f93(0x147))/0x3*(-parseInt(_0x3f9f93(0x141))/0x4)+-parseInt(_0x3f9f93(0x137))/0x5+parseInt(_0x3f9f93(0x135))/0x6+parseInt(_0x3f9f93(0x15c))/0x7+parseInt(_0x3f9f93(0x138))/0x8*(-parseInt(_0x3f9f93(0x15e))/0x9);if(_0x2d73d0===_0x3b2f52)break;else _0xb7980b['push'](_0xb7980b['shift']());}catch(_0xbe4066){_0xb7980b['push'](_0xb7980b['shift']());}}}(a61_0x3972,0x8e13e));import{McpServer}from'@modelcontextprotocol/sdk/server/mcp.js';import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';function a61_0x4bf6(_0x55eb3d,_0x5d8a99){_0x55eb3d=_0x55eb3d-0x134;const _0x397224=a61_0x3972();let _0x4bf64b=_0x397224[_0x55eb3d];return _0x4bf64b;}import{z}from'zod';import{executeTdxRun,searchCommands}from'./tools/index.js';export function createMCPServer(_0x19ce36={}){const _0x593a01=a61_0x4bf6,_0x454c9d=new McpServer({'name':'tdx','version':_0x593a01(0x143)});return _0x454c9d[_0x593a01(0x14e)](_0x593a01(0x13c),{'description':_0x593a01(0x14b),'inputSchema':{'args':z[_0x593a01(0x149)](z[_0x593a01(0x134)]())[_0x593a01(0x155)](_0x593a01(0x152))}},async({args:_0x4d9f26})=>{const _0x8a7957=_0x593a01,_0x2a507d=await executeTdxRun({'args':_0x4d9f26},_0x19ce36[_0x8a7957(0x136)]||{});return _0x2a507d['success']?{'content':[{'type':_0x8a7957(0x139),'text':_0x2a507d[_0x8a7957(0x15a)]||_0x8a7957(0x148)}]}:{'content':[{'type':_0x8a7957(0x139),'text':_0x2a507d[_0x8a7957(0x13d)]||_0x2a507d[_0x8a7957(0x15a)]||'Command\x20failed'}],'isError':!![]};}),_0x454c9d[_0x593a01(0x14e)](_0x593a01(0x144),{'description':_0x593a01(0x145),'inputSchema':{'query':z['string']()[_0x593a01(0x155)](_0x593a01(0x14f)),'category':z[_0x593a01(0x15b)](['Data',_0x593a01(0x14c),'AI',_0x593a01(0x154),_0x593a01(0x156)])[_0x593a01(0x142)]()['describe'](_0x593a01(0x13f))}},async({query:_0x1c3582,category:_0x304d1e})=>{const _0x518927=_0x593a01,_0x578f35=searchCommands({'query':_0x1c3582,'category':_0x304d1e});if(_0x578f35[_0x518927(0x153)]===0x0)return{'content':[{'type':_0x518927(0x139),'text':_0x518927(0x158)+_0x1c3582+'\x22'}]};const _0x2786d0=_0x578f35[_0x518927(0x146)](_0x1a5940=>{const _0x587bf2=_0x518927,_0x31b565=_0x1a5940[_0x587bf2(0x15f)][_0x587bf2(0x146)](_0x305f46=>'\x20\x20'+_0x305f46)[_0x587bf2(0x150)]('\x0a');return'**'+_0x1a5940['name']+_0x587bf2(0x151)+_0x1a5940[_0x587bf2(0x159)]+')\x0a'+_0x1a5940['description']+_0x587bf2(0x14a)+_0x31b565;})[_0x518927(0x150)](_0x518927(0x14d));return{'content':[{'type':_0x518927(0x139),'text':_0x2786d0}]};}),_0x454c9d;}export async function startMCPServer(_0x54d435={}){const _0x314451=a61_0x4bf6,_0x583f9f=createMCPServer(_0x54d435),_0x2f4c78=new StdioServerTransport();return await _0x583f9f[_0x314451(0x13e)](_0x2f4c78),new Promise(_0x1f380f=>{const _0x116073=_0x314451;let _0x224101=![];const _0x5142d3=async()=>{const _0x38915f=a61_0x4bf6;if(_0x224101)return;_0x224101=!![],await _0x583f9f[_0x38915f(0x160)](),_0x1f380f();};process['once']('SIGINT',_0x5142d3),process[_0x116073(0x13b)](_0x116073(0x13a),_0x5142d3),process[_0x116073(0x15d)][_0x116073(0x13b)](_0x116073(0x160),_0x5142d3);});}function a61_0x3972(){const _0x4bf13a=['enum','6863171ZRVBmG','stdin','24882633gfKtyv','examples','close','string','2108790dvzofK','env','570705zfmArh','8bVgxlR','text','SIGTERM','once','tdx_run','error','connect','Optional\x20filter\x20by\x20category','871932aVVVpl','53948ySvJqR','optional','1.0.0','tdx_search','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','174VGVOja','Command\x20completed\x20successfully','array','\x0a\x0aExamples:\x0a','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.','CDP','\x0a\x0a---\x0a\x0a','registerTool','Natural\x20language\x20query\x20(e.g.,\x20\x22list\x20databases\x22,\x20\x22run\x20SQL\x22,\x20\x22manage\x20segments\x22)','join','**\x20(','Command\x20and\x20arguments\x20as\x20array\x20(e.g.,\x20[\x22query\x22,\x20\x22SELECT\x20...\x22])','length','Context','describe','Utilities','949464NZShkM','No\x20commands\x20found\x20matching\x20\x22','category','output'];a61_0x3972=function(){return _0x4bf13a;};return a61_0x3972();}
1
+ function a61_0x35f8(){const _0x3edf99=['stdin','describe','optional','join','Natural\x20language\x20query\x20(e.g.,\x20\x22list\x20databases\x22,\x20\x22run\x20SQL\x22,\x20\x22manage\x20segments\x22)','28269186BWwSHx','7ddaAcG','array','Optional\x20filter\x20by\x20category','1VGUVKJ','3140ejycUH','text','close','SIGINT','3390892iBnqSk','once','4696278zViUyU','examples','**\x20(','No\x20commands\x20found\x20matching\x20\x22','name','15516KLaunk','1532154pcZALZ','Command\x20and\x20arguments\x20as\x20array\x20(e.g.,\x20[\x22query\x22,\x20\x22SELECT\x20...\x22])','1027868hNbTqi','enum','Data','success','8705272RrobsX','error','Utilities','description','output','tdx','tdx_search','\x0a\x0a---\x0a\x0a','map','category','registerTool','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.','env','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.','5IIUhzO','tdx_run','connect'];a61_0x35f8=function(){return _0x3edf99;};return a61_0x35f8();}(function(_0x3687e6,_0x325a0d){const _0x191172=a61_0x2b83,_0x538bfa=_0x3687e6();while(!![]){try{const _0x8cb9df=-parseInt(_0x191172(0xf8))/0x1*(-parseInt(_0x191172(0x107))/0x2)+parseInt(_0x191172(0x105))/0x3+parseInt(_0x191172(0xfd))/0x4+-parseInt(_0x191172(0x119))/0x5*(-parseInt(_0x191172(0xff))/0x6)+parseInt(_0x191172(0x122))/0x7*(parseInt(_0x191172(0x10b))/0x8)+-parseInt(_0x191172(0x104))/0x9*(parseInt(_0x191172(0xf9))/0xa)+-parseInt(_0x191172(0x121))/0xb;if(_0x8cb9df===_0x325a0d)break;else _0x538bfa['push'](_0x538bfa['shift']());}catch(_0x5c0eed){_0x538bfa['push'](_0x538bfa['shift']());}}}(a61_0x35f8,0x9a4b1));import{McpServer}from'@modelcontextprotocol/sdk/server/mcp.js';function a61_0x2b83(_0x4e6b4c,_0x4bd1cd){_0x4e6b4c=_0x4e6b4c-0xf8;const _0x35f8de=a61_0x35f8();let _0x2b83c5=_0x35f8de[_0x4e6b4c];return _0x2b83c5;}import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';import{z}from'zod';import{executeTdxRun,searchCommands}from'./tools/index.js';export function createMCPServer(_0x466938={}){const _0x8d3789=a61_0x2b83,_0x27ab9a=new McpServer({'name':_0x8d3789(0x110),'version':'1.0.0'});return _0x27ab9a[_0x8d3789(0x115)](_0x8d3789(0x11a),{'description':_0x8d3789(0x118),'inputSchema':{'args':z[_0x8d3789(0x123)](z['string']())[_0x8d3789(0x11d)](_0x8d3789(0x106))}},async({args:_0x4fa5e7})=>{const _0x185e6b=_0x8d3789,_0x4e2551=await executeTdxRun({'args':_0x4fa5e7},_0x466938[_0x185e6b(0x117)]||{});return _0x4e2551[_0x185e6b(0x10a)]?{'content':[{'type':_0x185e6b(0xfa),'text':_0x4e2551[_0x185e6b(0x10f)]||'Command\x20completed\x20successfully'}]}:{'content':[{'type':_0x185e6b(0xfa),'text':_0x4e2551[_0x185e6b(0x10c)]||_0x4e2551[_0x185e6b(0x10f)]||'Command\x20failed'}],'isError':!![]};}),_0x27ab9a[_0x8d3789(0x115)](_0x8d3789(0x111),{'description':_0x8d3789(0x116),'inputSchema':{'query':z['string']()[_0x8d3789(0x11d)](_0x8d3789(0x120)),'category':z[_0x8d3789(0x108)]([_0x8d3789(0x109),'CDP','AI','Context',_0x8d3789(0x10d)])[_0x8d3789(0x11e)]()[_0x8d3789(0x11d)](_0x8d3789(0x124))}},async({query:_0x5d8e1e,category:_0x235e1e})=>{const _0x4cba36=_0x8d3789,_0x49ef42=searchCommands({'query':_0x5d8e1e,'category':_0x235e1e});if(_0x49ef42['length']===0x0)return{'content':[{'type':'text','text':_0x4cba36(0x102)+_0x5d8e1e+'\x22'}]};const _0x46e15a=_0x49ef42['map'](_0x40afdb=>{const _0x3a6433=_0x4cba36,_0xb87977=_0x40afdb[_0x3a6433(0x100)][_0x3a6433(0x113)](_0x43d28a=>'\x20\x20'+_0x43d28a)[_0x3a6433(0x11f)]('\x0a');return'**'+_0x40afdb[_0x3a6433(0x103)]+_0x3a6433(0x101)+_0x40afdb[_0x3a6433(0x114)]+')\x0a'+_0x40afdb[_0x3a6433(0x10e)]+'\x0a\x0aExamples:\x0a'+_0xb87977;})['join'](_0x4cba36(0x112));return{'content':[{'type':_0x4cba36(0xfa),'text':_0x46e15a}]};}),_0x27ab9a;}export async function startMCPServer(_0x25339b={}){const _0x4cea27=a61_0x2b83,_0x2ec101=createMCPServer(_0x25339b),_0x1fd52f=new StdioServerTransport();return await _0x2ec101[_0x4cea27(0x11b)](_0x1fd52f),new Promise(_0x3d27d6=>{const _0x3964f6=_0x4cea27;let _0x58903e=![];const _0x161c76=async()=>{const _0xbd2c90=a61_0x2b83;if(_0x58903e)return;_0x58903e=!![],await _0x2ec101[_0xbd2c90(0xfb)](),_0x3d27d6();};process['once'](_0x3964f6(0xfc),_0x161c76),process[_0x3964f6(0xfe)]('SIGTERM',_0x161c76),process[_0x3964f6(0x11c)]['once'](_0x3964f6(0xfb),_0x161c76);});}
@@ -1 +1 @@
1
- function a62_0xabd3(){var _0x5311c5=['24gmsFOU','2WgdVEM','25860TGHWMa','1181691RELCiM','982884tugdeO','913636NLOksY','12654220UFMarQ','58016jWLIuz','1012569AicFqC','280bzSzSL'];a62_0xabd3=function(){return _0x5311c5;};return a62_0xabd3();}(function(_0x3df531,_0x549887){var _0x1326fa=a62_0x4440,_0x3028a5=_0x3df531();while(!![]){try{var _0x4456f4=-parseInt(_0x1326fa(0x85))/0x1+parseInt(_0x1326fa(0x89))/0x2*(-parseInt(_0x1326fa(0x86))/0x3)+parseInt(_0x1326fa(0x8d))/0x4+-parseInt(_0x1326fa(0x87))/0x5*(parseInt(_0x1326fa(0x8a))/0x6)+parseInt(_0x1326fa(0x8c))/0x7*(-parseInt(_0x1326fa(0x88))/0x8)+-parseInt(_0x1326fa(0x8b))/0x9+parseInt(_0x1326fa(0x8e))/0xa;if(_0x4456f4===_0x549887)break;else _0x3028a5['push'](_0x3028a5['shift']());}catch(_0x51cb69){_0x3028a5['push'](_0x3028a5['shift']());}}}(a62_0xabd3,0x4a50d));export{executeTdxRun,TdxRunInputSchema}from'./tdx-run.js';function a62_0x4440(_0x2ec8f8,_0xd5cd04){_0x2ec8f8=_0x2ec8f8-0x85;var _0xabd394=a62_0xabd3();var _0x4440f3=_0xabd394[_0x2ec8f8];return _0x4440f3;}export{searchCommands,TdxSearchInputSchema}from'./tdx-search.js';
1
+ function a62_0x400b(){var _0x36e844=['768100tnHZZg','354389opgCtT','9ikXBQw','2992UofiDl','8822510LsZHbf','7641468vQRrYM','11aydjwx','1027229HkCNqW','206956NkEnIT','48LIiVjM','6uviqgp','6DeMcdt'];a62_0x400b=function(){return _0x36e844;};return a62_0x400b();}(function(_0x520dfc,_0x118c2e){var _0x2b217a=a62_0x47a2,_0x470680=_0x520dfc();while(!![]){try{var _0x2916ca=parseInt(_0x2b217a(0x96))/0x1+-parseInt(_0x2b217a(0x98))/0x2+-parseInt(_0x2b217a(0x93))/0x3*(parseInt(_0x2b217a(0x91))/0x4)+parseInt(_0x2b217a(0x95))/0x5*(-parseInt(_0x2b217a(0x94))/0x6)+-parseInt(_0x2b217a(0x90))/0x7*(-parseInt(_0x2b217a(0x92))/0x8)+-parseInt(_0x2b217a(0x97))/0x9*(parseInt(_0x2b217a(0x8d))/0xa)+parseInt(_0x2b217a(0x8f))/0xb*(parseInt(_0x2b217a(0x8e))/0xc);if(_0x2916ca===_0x118c2e)break;else _0x470680['push'](_0x470680['shift']());}catch(_0x52c20d){_0x470680['push'](_0x470680['shift']());}}}(a62_0x400b,0xb26bf));function a62_0x47a2(_0x1f50b4,_0x2db362){_0x1f50b4=_0x1f50b4-0x8d;var _0x400bdf=a62_0x400b();var _0x47a232=_0x400bdf[_0x1f50b4];return _0x47a232;}export{executeTdxRun,TdxRunInputSchema}from'./tdx-run.js';export{searchCommands,TdxSearchInputSchema}from'./tdx-search.js';
@@ -1 +1 @@
1
- function a63_0x2ce0(){const _0x375b42=['Command\x20and\x20arguments\x20as\x20array\x20(e.g.,\x20[\x22query\x22,\x20\x22SELECT\x20...\x22])','resourcesPath','win32','235352zDMZPL','--json','This\x20command\x20is\x20not\x20allowed\x20via\x20MCP','toString','PATH','array','execPath','object','stdout','8330lqbUEh','3MbeaXj','SIGTERM','6eejrKd','1025965WCVDjC','3762865RjNkpT','7664FRAsJW','ignore','--no-color','712196qzQpKY','pipe','10itiKxO','Failed\x20to\x20spawn\x20tdx:\x20','node','string','close','26085532OHqOKh','true','720666EHiXXl','data','stderr','describe','platform','Command\x20timed\x20out\x20after\x2015\x20minutes.\x20For\x20long-running\x20queries,\x20use\x20job\x20submit\x20instead.'];a63_0x2ce0=function(){return _0x375b42;};return a63_0x2ce0();}const a63_0x41913e=a63_0x5087;(function(_0x13631b,_0x5ed352){const _0x58bc19=a63_0x5087,_0x38ead3=_0x13631b();while(!![]){try{const _0x1bf0d6=-parseInt(_0x58bc19(0x1ca))/0x1+parseInt(_0x58bc19(0x1cf))/0x2*(-parseInt(_0x58bc19(0x1c7))/0x3)+-parseInt(_0x58bc19(0x1e1))/0x4+-parseInt(_0x58bc19(0x1cb))/0x5*(-parseInt(_0x58bc19(0x1c9))/0x6)+-parseInt(_0x58bc19(0x1c6))/0x7*(parseInt(_0x58bc19(0x1cc))/0x8)+-parseInt(_0x58bc19(0x1d8))/0x9*(-parseInt(_0x58bc19(0x1d1))/0xa)+parseInt(_0x58bc19(0x1d6))/0xb;if(_0x1bf0d6===_0x5ed352)break;else _0x38ead3['push'](_0x38ead3['shift']());}catch(_0x1db611){_0x38ead3['push'](_0x38ead3['shift']());}}}(a63_0x2ce0,0x98222));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[a63_0x41913e(0x1c4)]({'args':z[a63_0x41913e(0x1e6)](z[a63_0x41913e(0x1d4)]())[a63_0x41913e(0x1db)](a63_0x41913e(0x1de))});function a63_0x5087(_0x15e166,_0x426692){_0x15e166=_0x15e166-0x1c4;const _0x2ce021=a63_0x2ce0();let _0x5087dc=_0x2ce021[_0x15e166];return _0x5087dc;}const DEFAULT_TIMEOUT_MS=0xf*0x3c*0x3e8;function getNodeBinDir(){const _0x11d9a5=a63_0x41913e,_0x41584d=process[_0x11d9a5(0x1df)];if(_0x41584d){const _0x2672e1=join(_0x41584d,_0x11d9a5(0x1d3)),_0x3c6719=process['platform']===_0x11d9a5(0x1e0)?'node.exe':'node';if(existsSync(join(_0x2672e1,_0x3c6719)))return _0x2672e1;}return dirname(process[_0x11d9a5(0x1e7)]);}export async function executeTdxRun(_0x2f5aed,_0x4d661d){const _0x1ea3b0=a63_0x41913e,{args:_0x2cab2e}=_0x2f5aed;if(isBlockedCommand(_0x2cab2e)){const _0x31788c=getBlockedReason(_0x2cab2e);return{'success':![],'output':'','error':_0x31788c||_0x1ea3b0(0x1e3),'exitCode':0x1};}const _0x3a7db5=[_0x1ea3b0(0x1e2),_0x1ea3b0(0x1ce),..._0x2cab2e],_0x2676b0=getNodeBinDir(),_0x84f061=process[_0x1ea3b0(0x1dc)]===_0x1ea3b0(0x1e0)?';':':',_0x539255=_0x4d661d[_0x1ea3b0(0x1e5)]??process.env.PATH??'',_0x146872=''+_0x2676b0+_0x84f061+_0x539255;return new Promise(_0x32dab9=>{const _0x348b54=_0x1ea3b0,_0x568fbc=spawn('tdx',_0x3a7db5,{'env':{...process.env,..._0x4d661d,'PATH':_0x146872,'CI':_0x348b54(0x1d7)},'stdio':[_0x348b54(0x1cd),_0x348b54(0x1d0),_0x348b54(0x1d0)]});let _0x13ac0d='',_0xb0f304='',_0x5ca635=![];const _0x45dded=setTimeout(()=>{const _0x273baa=_0x348b54;_0x5ca635=!![],_0x568fbc['kill'](_0x273baa(0x1c8));},DEFAULT_TIMEOUT_MS);_0x568fbc[_0x348b54(0x1c5)]['on'](_0x348b54(0x1d9),_0x280280=>{const _0x440f0=_0x348b54;_0x13ac0d+=_0x280280[_0x440f0(0x1e4)]();}),_0x568fbc[_0x348b54(0x1da)]['on'](_0x348b54(0x1d9),_0x3fc0fc=>{const _0x48f051=_0x348b54;_0xb0f304+=_0x3fc0fc[_0x48f051(0x1e4)]();}),_0x568fbc['on']('error',_0x4ae4f5=>{const _0x411509=_0x348b54;clearTimeout(_0x45dded),_0x32dab9({'success':![],'output':'','error':_0x411509(0x1d2)+_0x4ae4f5['message'],'exitCode':0x1});}),_0x568fbc['on'](_0x348b54(0x1d5),_0x56f63a=>{const _0x5b5033=_0x348b54;clearTimeout(_0x45dded);if(_0x5ca635){_0x32dab9({'success':![],'output':formatOutput(_0x13ac0d),'error':_0x5b5033(0x1dd),'exitCode':0x7c});return;}const _0x4eb419=_0x56f63a??0x1,_0x1b94cb=_0x4eb419===0x0,_0x389fd8=formatOutput(_0x13ac0d||_0xb0f304),_0x192b9c=!_0x1b94cb&&_0xb0f304?formatOutput(_0xb0f304):undefined;_0x32dab9({'success':_0x1b94cb,'output':_0x389fd8,'error':_0x192b9c,'exitCode':_0x4eb419});});});}
1
+ const a63_0xb01357=a63_0x5c0f;(function(_0x1445f1,_0x313679){const _0x5c0b0a=a63_0x5c0f,_0x10e58a=_0x1445f1();while(!![]){try{const _0x3b5df2=-parseInt(_0x5c0b0a(0x14e))/0x1+-parseInt(_0x5c0b0a(0x148))/0x2+-parseInt(_0x5c0b0a(0x13c))/0x3*(-parseInt(_0x5c0b0a(0x135))/0x4)+parseInt(_0x5c0b0a(0x140))/0x5+parseInt(_0x5c0b0a(0x147))/0x6*(parseInt(_0x5c0b0a(0x153))/0x7)+parseInt(_0x5c0b0a(0x154))/0x8*(parseInt(_0x5c0b0a(0x13e))/0x9)+-parseInt(_0x5c0b0a(0x14a))/0xa;if(_0x3b5df2===_0x313679)break;else _0x10e58a['push'](_0x10e58a['shift']());}catch(_0x37be9c){_0x10e58a['push'](_0x10e58a['shift']());}}}(a63_0x494e,0x30bda));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';function a63_0x5c0f(_0x2866c7,_0x38e571){_0x2866c7=_0x2866c7-0x135;const _0x494e12=a63_0x494e();let _0x5c0fa0=_0x494e12[_0x2866c7];return _0x5c0fa0;}export const TdxRunInputSchema=z[a63_0xb01357(0x141)]({'args':z['array'](z['string']())[a63_0xb01357(0x14d)](a63_0xb01357(0x145))});const DEFAULT_TIMEOUT_MS=0xf*0x3c*0x3e8;function getNodeBinDir(){const _0xac4cce=a63_0xb01357,_0x576dcb=process['resourcesPath'];if(_0x576dcb){const _0x2c74a9=join(_0x576dcb,'node'),_0x131756=process[_0xac4cce(0x146)]==='win32'?'node.exe':_0xac4cce(0x150);if(existsSync(join(_0x2c74a9,_0x131756)))return _0x2c74a9;}return dirname(process[_0xac4cce(0x136)]);}export async function executeTdxRun(_0x14594e,_0x3252c8){const _0x3e9556=a63_0xb01357,{args:_0x36018f}=_0x14594e;if(isBlockedCommand(_0x36018f)){const _0x40e88e=getBlockedReason(_0x36018f);return{'success':![],'output':'','error':_0x40e88e||_0x3e9556(0x14c),'exitCode':0x1};}const _0x1916f9=[_0x3e9556(0x138),'--no-color',..._0x36018f],_0x550c45=getNodeBinDir(),_0x46f350=process[_0x3e9556(0x146)]===_0x3e9556(0x13b)?';':':',_0x1f6213=_0x3252c8[_0x3e9556(0x142)]??process.env.PATH??'',_0x109981=''+_0x550c45+_0x46f350+_0x1f6213;return new Promise(_0x2f1bf5=>{const _0x30d225=_0x3e9556,_0x5be009=spawn(_0x30d225(0x14b),_0x1916f9,{'env':{...process.env,..._0x3252c8,'PATH':_0x109981,'CI':_0x30d225(0x13a)},'stdio':[_0x30d225(0x151),_0x30d225(0x137),'pipe']});let _0x1a3976='',_0x46f407='',_0x566e6f=![];const _0x5bb647=setTimeout(()=>{const _0x5aa62f=_0x30d225;_0x566e6f=!![],_0x5be009[_0x5aa62f(0x13d)](_0x5aa62f(0x13f));},DEFAULT_TIMEOUT_MS);_0x5be009[_0x30d225(0x144)]['on'](_0x30d225(0x14f),_0x41962e=>{const _0x1ee95d=_0x30d225;_0x1a3976+=_0x41962e[_0x1ee95d(0x152)]();}),_0x5be009['stderr']['on'](_0x30d225(0x14f),_0x10cf23=>{const _0x489af3=_0x30d225;_0x46f407+=_0x10cf23[_0x489af3(0x152)]();}),_0x5be009['on'](_0x30d225(0x143),_0x2f0efc=>{const _0x6e0a33=_0x30d225;clearTimeout(_0x5bb647),_0x2f1bf5({'success':![],'output':'','error':_0x6e0a33(0x139)+_0x2f0efc[_0x6e0a33(0x149)],'exitCode':0x1});}),_0x5be009['on']('close',_0x56ece0=>{clearTimeout(_0x5bb647);if(_0x566e6f){_0x2f1bf5({'success':![],'output':formatOutput(_0x1a3976),'error':'Command\x20timed\x20out\x20after\x2015\x20minutes.\x20For\x20long-running\x20queries,\x20use\x20job\x20submit\x20instead.','exitCode':0x7c});return;}const _0x2000a6=_0x56ece0??0x1,_0x37f002=_0x2000a6===0x0,_0x75865e=formatOutput(_0x1a3976||_0x46f407),_0x2fb026=!_0x37f002&&_0x46f407?formatOutput(_0x46f407):undefined;_0x2f1bf5({'success':_0x37f002,'output':_0x75865e,'error':_0x2fb026,'exitCode':_0x2000a6});});});}function a63_0x494e(){const _0x1f08b2=['--json','Failed\x20to\x20spawn\x20tdx:\x20','true','win32','235311dbaAcT','kill','20781qmUJyk','SIGTERM','596140nhNhUY','object','PATH','error','stdout','Command\x20and\x20arguments\x20as\x20array\x20(e.g.,\x20[\x22query\x22,\x20\x22SELECT\x20...\x22])','platform','6684FndJmR','391086YGSzZj','message','110230oSbwyu','tdx','This\x20command\x20is\x20not\x20allowed\x20via\x20MCP','describe','166339LhJHQr','data','node','ignore','toString','1442fFOMCt','232qFgVcQ','8ABqwrt','execPath','pipe'];a63_0x494e=function(){return _0x1f08b2;};return a63_0x494e();}