@treasuredata/tdx 0.16.19 → 0.17.0

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 (192) 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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-command.js +1 -1
  21. package/dist/commands/job-command.d.ts +3 -0
  22. package/dist/commands/job-command.d.ts.map +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/job-command.js.map +1 -1
  25. package/dist/commands/journey-command.js +1 -1
  26. package/dist/commands/journey-validate-command.js +1 -1
  27. package/dist/commands/llm-command.js +1 -1
  28. package/dist/commands/llm-proxy.js +1 -1
  29. package/dist/commands/mcp-command.js +1 -1
  30. package/dist/commands/parent-segment-command.js +1 -1
  31. package/dist/commands/profile-command.js +1 -1
  32. package/dist/commands/profiles-command.js +1 -1
  33. package/dist/commands/query-command.js +1 -1
  34. package/dist/commands/schedule-command.d.ts +67 -0
  35. package/dist/commands/schedule-command.d.ts.map +1 -0
  36. package/dist/commands/schedule-command.js +1 -0
  37. package/dist/commands/schedule-command.js.map +1 -0
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/use-command.js +1 -1
  52. package/dist/commands/user-command.js +1 -1
  53. package/dist/commands/workflow-command.js +1 -1
  54. package/dist/core/auth.js +1 -1
  55. package/dist/core/command-output.js +1 -1
  56. package/dist/core/config.js +1 -1
  57. package/dist/core/connection-cache.js +1 -1
  58. package/dist/core/constants.js +1 -1
  59. package/dist/core/credential-cache.js +1 -1
  60. package/dist/core/global-context.js +1 -1
  61. package/dist/core/keychain.js +1 -1
  62. package/dist/core/profile.js +1 -1
  63. package/dist/core/project-config.js +1 -1
  64. package/dist/core/session.js +1 -1
  65. package/dist/core/user-cache.js +1 -1
  66. package/dist/core/version.js +1 -1
  67. package/dist/index.js +1 -1
  68. package/dist/mcp/server.js +1 -1
  69. package/dist/mcp/tools/index.js +1 -1
  70. package/dist/mcp/tools/tdx-run.js +1 -1
  71. package/dist/mcp/tools/tdx-search.js +1 -1
  72. package/dist/mcp/utils.js +1 -1
  73. package/dist/proxy/anthropic-adapter.js +1 -1
  74. package/dist/proxy/claude-usage-tracker.js +1 -1
  75. package/dist/proxy/context-signature.js +1 -1
  76. package/dist/proxy/conversation-utils.js +1 -1
  77. package/dist/proxy/passthrough-server.js +1 -1
  78. package/dist/proxy/server.js +1 -1
  79. package/dist/proxy/session-cache.js +1 -1
  80. package/dist/proxy/sse-usage-parser.js +1 -1
  81. package/dist/sdk/agent/agent-config.js +1 -1
  82. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  83. package/dist/sdk/agent/agent-yaml.js +1 -1
  84. package/dist/sdk/agent/test/evaluator.js +1 -1
  85. package/dist/sdk/agent/test/executor.js +1 -1
  86. package/dist/sdk/agent/test/index.js +1 -1
  87. package/dist/sdk/agent/test/output.js +1 -1
  88. package/dist/sdk/agent/test/parser.js +1 -1
  89. package/dist/sdk/api.js +1 -1
  90. package/dist/sdk/client/cdp-api-client.js +1 -1
  91. package/dist/sdk/client/endpoints.js +1 -1
  92. package/dist/sdk/client/engage-api-client.js +1 -1
  93. package/dist/sdk/client/http-client.js +1 -1
  94. package/dist/sdk/client/llm-api-client.js +1 -1
  95. package/dist/sdk/client/rate-limiter.js +1 -1
  96. package/dist/sdk/client/td-api-client.d.ts +64 -1
  97. package/dist/sdk/client/td-api-client.d.ts.map +1 -1
  98. package/dist/sdk/client/td-api-client.js +1 -1
  99. package/dist/sdk/client/td-api-client.js.map +1 -1
  100. package/dist/sdk/client/trino-api-client.js +1 -1
  101. package/dist/sdk/client/workflow-client.js +1 -1
  102. package/dist/sdk/connection-validator.js +1 -1
  103. package/dist/sdk/connection.js +1 -1
  104. package/dist/sdk/engage.js +1 -1
  105. package/dist/sdk/errors.js +1 -1
  106. package/dist/sdk/index.d.ts +6 -0
  107. package/dist/sdk/index.d.ts.map +1 -1
  108. package/dist/sdk/index.js +1 -1
  109. package/dist/sdk/index.js.map +1 -1
  110. package/dist/sdk/io/index.js +1 -1
  111. package/dist/sdk/io/node-filesystem.js +1 -1
  112. package/dist/sdk/job.js +1 -1
  113. package/dist/sdk/journey.js +1 -1
  114. package/dist/sdk/llm/chat-cache.js +1 -1
  115. package/dist/sdk/llm/index.js +1 -1
  116. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  117. package/dist/sdk/llm/model-aliases.js +1 -1
  118. package/dist/sdk/llm/model-factors.js +1 -1
  119. package/dist/sdk/query/index.js +1 -1
  120. package/dist/sdk/query/sql-parser.js +1 -1
  121. package/dist/sdk/schedule.d.ts +99 -0
  122. package/dist/sdk/schedule.d.ts.map +1 -0
  123. package/dist/sdk/schedule.js +1 -0
  124. package/dist/sdk/schedule.js.map +1 -0
  125. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  126. package/dist/sdk/segment/fields-display.js +1 -1
  127. package/dist/sdk/segment/file-discovery.js +1 -1
  128. package/dist/sdk/segment/journey-utils.js +1 -1
  129. package/dist/sdk/segment/journey-yaml.js +1 -1
  130. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  131. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  132. package/dist/sdk/segment/pull-workflow.js +1 -1
  133. package/dist/sdk/segment/push-workflow.js +1 -1
  134. package/dist/sdk/segment/resolution-context.js +1 -1
  135. package/dist/sdk/segment/segment-path-parser.js +1 -1
  136. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  137. package/dist/sdk/segment/target-resolution.js +1 -1
  138. package/dist/sdk/segment/tdx-config.js +1 -1
  139. package/dist/sdk/segment/validate-files.js +1 -1
  140. package/dist/sdk/segment/yaml-validator.js +1 -1
  141. package/dist/sdk/segment.js +1 -1
  142. package/dist/sdk/types/index.d.ts +1 -0
  143. package/dist/sdk/types/index.d.ts.map +1 -1
  144. package/dist/sdk/types/index.js +1 -1
  145. package/dist/sdk/types/progress.js +1 -1
  146. package/dist/sdk/types/schedule.d.ts +196 -0
  147. package/dist/sdk/types/schedule.d.ts.map +1 -0
  148. package/dist/sdk/types/schedule.js +1 -0
  149. package/dist/sdk/types/schedule.js.map +1 -0
  150. package/dist/sdk/user.js +1 -1
  151. package/dist/sdk/util/format-detector.js +1 -1
  152. package/dist/sdk/util/formatters.js +1 -1
  153. package/dist/sdk/util/index.js +1 -1
  154. package/dist/sdk/util/tree-formatter.js +1 -1
  155. package/dist/sdk/workflow/clone-workflow.js +1 -1
  156. package/dist/sdk/workflow/index.js +1 -1
  157. package/dist/sdk/workflow/pull-workflow.js +1 -1
  158. package/dist/sdk/workflow/push-workflow.js +1 -1
  159. package/dist/sdk/workflow/tdx-config.js +1 -1
  160. package/dist/sdk/workflow/workflow-utils.js +1 -1
  161. package/dist/test-utils/command-runner.js +1 -1
  162. package/dist/test-utils/factories.js +1 -1
  163. package/dist/test-utils/fixtures.js +1 -1
  164. package/dist/test-utils/http-mock.js +1 -1
  165. package/dist/test-utils/index.js +1 -1
  166. package/dist/utils/async.js +1 -1
  167. package/dist/utils/colors.js +1 -1
  168. package/dist/utils/diff.js +1 -1
  169. package/dist/utils/file-permissions.js +1 -1
  170. package/dist/utils/global-cache.js +1 -1
  171. package/dist/utils/json-loader.js +1 -1
  172. package/dist/utils/local-cache.js +1 -1
  173. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  174. package/dist/utils/logger/formatters/index.js +1 -1
  175. package/dist/utils/logger/handlers/console-handler.js +1 -1
  176. package/dist/utils/logger/handlers/file-handler.js +1 -1
  177. package/dist/utils/logger/handlers/index.js +1 -1
  178. package/dist/utils/logger/handlers/null-handler.js +1 -1
  179. package/dist/utils/logger/index.js +1 -1
  180. package/dist/utils/logger/logger.js +1 -1
  181. package/dist/utils/logger/types.js +1 -1
  182. package/dist/utils/option-validation.js +1 -1
  183. package/dist/utils/port.js +1 -1
  184. package/dist/utils/process.js +1 -1
  185. package/dist/utils/prompt.js +1 -1
  186. package/dist/utils/spinner.js +1 -1
  187. package/dist/utils/sse-parser.js +1 -1
  188. package/dist/utils/string-utils.js +1 -1
  189. package/dist/utils/table-ref-parser.js +1 -1
  190. package/dist/utils/tdx-logger.js +1 -1
  191. package/dist/utils/version-check.js +1 -1
  192. package/package.json +2 -2
@@ -1 +1 @@
1
- (function(_0xc469fa,_0x1f2979){const _0x1d6f5a=a44_0x31a6,_0x1c5317=_0xc469fa();while(!![]){try{const _0x5e9184=parseInt(_0x1d6f5a(0x1b0))/0x1+-parseInt(_0x1d6f5a(0x1e0))/0x2+parseInt(_0x1d6f5a(0x1bc))/0x3*(-parseInt(_0x1d6f5a(0x1a3))/0x4)+parseInt(_0x1d6f5a(0x1d3))/0x5*(parseInt(_0x1d6f5a(0x1b6))/0x6)+parseInt(_0x1d6f5a(0x1b9))/0x7*(parseInt(_0x1d6f5a(0x1a0))/0x8)+-parseInt(_0x1d6f5a(0x1b3))/0x9*(parseInt(_0x1d6f5a(0x1a8))/0xa)+parseInt(_0x1d6f5a(0x1b5))/0xb;if(_0x5e9184===_0x1f2979)break;else _0x1c5317['push'](_0x1c5317['shift']());}catch(_0xbf72fb){_0x1c5317['push'](_0x1c5317['shift']());}}}(a44_0x420e,0x4620b));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a44_0x5f087d from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x251d8e){const _0x812b44=a44_0x31a6;return _0x251d8e[_0x812b44(0x1a2)]==='json'||_0x251d8e[_0x812b44(0x1a2)]===_0x812b44(0x19b)||_0x251d8e['format']===_0x812b44(0x1bb)||_0x251d8e[_0x812b44(0x1a2)]===_0x812b44(0x1c8)||_0x251d8e[_0x812b44(0x1ba)]===!![]||_0x251d8e[_0x812b44(0x19b)]===!![]||_0x251d8e['tsv']===!![]||_0x251d8e['table']===!![];}export function parseOutputOptions(_0x4e179c){const _0x11aac0=a44_0x31a6;return{'format':_0x4e179c[_0x11aac0(0x1a2)]||_0x11aac0(0x1c8),'output':_0x4e179c[_0x11aac0(0x1bd)]||'','limit':_0x4e179c[_0x11aac0(0x1b8)],'color':_0x4e179c[_0x11aac0(0x19e)],'noColor':_0x4e179c[_0x11aac0(0x1a5)]};}function convertSDKResultToQueryResult(_0xeb40ed){const _0x339ab5=a44_0x31a6,_0x33e4f1=[];if(_0xeb40ed[_0x339ab5(0x1d4)]>0x0){const _0x56f585=_0xeb40ed[0x0];for(const [_0x3300ba,_0x389223]of Object[_0x339ab5(0x1dd)](_0x56f585)){let _0x227c00=_0x339ab5(0x1cd);if(typeof _0x389223===_0x339ab5(0x1a4))_0x227c00=Number[_0x339ab5(0x1cf)](_0x389223)?_0x339ab5(0x1c6):_0x339ab5(0x1c0);else{if(typeof _0x389223===_0x339ab5(0x1e2))_0x227c00=_0x339ab5(0x1e2);else _0x389223===null&&(_0x227c00=_0x339ab5(0x1cd));}_0x33e4f1['push']({'name':_0x3300ba,'type':_0x227c00});}}return{'queryId':_0x339ab5(0x1ab),'columns':_0x33e4f1,'data':_0xeb40ed,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0xeb40ed['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x48d12e,_0x48eb8){const _0x36d6fb=convertSDKResultToQueryResult(_0x48d12e);return formatQueryOutput(_0x36d6fb,_0x48eb8);}export async function formatQueryOutput(_0x17f5f8,_0x262531){const _0x5b9f3f=a44_0x31a6,{format:_0x3e78ac,limit:_0x259476,output:_0x9a69c6,color:_0x204a9c,noColor:_0x37defa}=_0x262531,_0x3d1686=Boolean(_0x9a69c6)&&!_0x204a9c,_0x39f64b={'color':_0x204a9c,'noColor':_0x37defa||_0x3d1686};if(_0x3e78ac==='table'){const _0x4623d0=shouldUseLess(_0x3e78ac,_0x9a69c6);return formatAsTable(_0x17f5f8,_0x259476,_0x4623d0,_0x39f64b);}else{if(_0x3e78ac===_0x5b9f3f(0x1ba))return formatAsJSON(_0x17f5f8,_0x39f64b);else return _0x3e78ac===_0x5b9f3f(0x19b)?formatAsJSONL(_0x17f5f8,_0x39f64b):formatQueryResult(_0x17f5f8,_0x3e78ac);}}function shouldUseLess(_0x4f4e10,_0x4beaa5){const _0x5b4638=a44_0x31a6;return(_0x4f4e10==='table'||_0x4f4e10===_0x5b4638(0x1c5))&&process[_0x5b4638(0x1d2)][_0x5b4638(0x1af)]&&!_0x4beaa5;}function a44_0x31a6(_0x2cc277,_0x28078e){_0x2cc277=_0x2cc277-0x19b;const _0x420eae=a44_0x420e();let _0x31a60b=_0x420eae[_0x2cc277];return _0x31a60b;}export function resolveOutputOptions(_0x501ddd){const _0x1223fa=a44_0x31a6,_0x10995e=resolveOutputFormat(_0x501ddd[_0x1223fa(0x1a2)],_0x501ddd['output'],_0x1223fa(0x1c8));let _0x28fefd=typeof _0x501ddd[_0x1223fa(0x1b8)]===_0x1223fa(0x1a4)?_0x501ddd[_0x1223fa(0x1b8)]:parseInt(_0x501ddd[_0x1223fa(0x1b8)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x28dc62=_0x501ddd[_0x1223fa(0x1bd)]||'';return shouldUseLess(_0x10995e,_0x28dc62)&&(_0x28fefd=Infinity),{'format':_0x10995e,'output':_0x28dc62,'limit':_0x28fefd,'color':_0x501ddd[_0x1223fa(0x19e)],'noColor':_0x501ddd[_0x1223fa(0x1a5)]};}export function writeOutput(_0x1da068,_0x1d5ea7,_0x2dee06){const _0x350cb0=a44_0x31a6;return _0x1d5ea7?(writeFileSync(_0x1d5ea7,_0x1da068),console[_0x350cb0(0x1bf)](_0x350cb0(0x1c1)+_0x1d5ea7),Promise[_0x350cb0(0x1d1)]()):shouldUseLess(_0x2dee06||'','')?new Promise(_0x48c9b7=>{const _0x4ac7cd=_0x350cb0,_0x4def0b=spawn(_0x4ac7cd(0x1d9),[_0x4ac7cd(0x1ac)],{'stdio':[_0x4ac7cd(0x1c7),_0x4ac7cd(0x1be),_0x4ac7cd(0x1be)]});let _0x2a91f7=![];_0x4def0b['on'](_0x4ac7cd(0x1bf),()=>{const _0x1f78b6=_0x4ac7cd;!_0x2a91f7&&(_0x2a91f7=!![],console[_0x1f78b6(0x1ce)](_0x1da068),_0x48c9b7());}),_0x4def0b['on']('close',()=>{!_0x2a91f7&&(_0x2a91f7=!![],_0x48c9b7());}),_0x4def0b['on']('spawn',()=>{const _0x1a2daf=_0x4ac7cd;!_0x2a91f7&&_0x4def0b[_0x1a2daf(0x1a6)]&&(_0x4def0b[_0x1a2daf(0x1a6)]['on']('error',()=>{}),_0x4def0b[_0x1a2daf(0x1a6)]['write'](_0x1da068),_0x4def0b[_0x1a2daf(0x1a6)][_0x1a2daf(0x1cc)]());}),!_0x4def0b[_0x4ac7cd(0x1a6)]&&(!_0x2a91f7&&(_0x2a91f7=!![],console[_0x4ac7cd(0x1ce)](_0x1da068),_0x48c9b7()));}):(console[_0x350cb0(0x1ce)](_0x1da068),Promise[_0x350cb0(0x1d1)]());}export async function handleSDKOutput(_0x121a4b,_0x24b034){const _0x2c9de0=a44_0x31a6,_0x3d1957=resolveOutputOptions(_0x24b034),_0x3f6b50=await formatSDKOutput(_0x121a4b,_0x3d1957);await writeOutput(_0x3f6b50,_0x3d1957[_0x2c9de0(0x1bd)]||undefined,_0x3d1957['format']);}function a44_0x420e(){const _0x4aa2b6=['tsv','9NXTdcX','output','inherit','error','double','Results\x20saved\x20to\x20','push','─┬─','object','list','bigint','pipe','table','No\x20data','filter','split','end','varchar','log','isInteger','rule','resolve','stdout','12115xfLsKt','length','max','[error]','bold','trim','less','magenta','map','[Object]','entries','stringify','cmdout','682802MyGwtK','string','boolean','red','jsonl','padEnd','query','color','forEach','40riRMhk','[query]','format','305756hshlgA','number','noColor','stdin','join','64240VtRDbv','[rule]','repeat','sdk-result','-FXRSn','debug','yellow','isTTY','519360gTISgQ','[params]','blue','36AUJLfs','keys','1752773Sgkkvf','318wCmhzF','[logs]','limit','107149RyJnMl','json'];a44_0x420e=function(){return _0x4aa2b6;};return a44_0x420e();}export async function handleQueryOutput(_0x490821,_0x35cbd2){const _0x4c083b=a44_0x31a6,_0x235d34=resolveOutputOptions(_0x35cbd2),_0x24b787=await formatQueryOutput(_0x490821,_0x235d34);await writeOutput(_0x24b787,_0x235d34['output']||undefined,_0x235d34[_0x4c083b(0x1a2)]);}async function formatSingleObject(_0x4c7ee4,_0x2047cb){const _0x5db5af=a44_0x31a6,{format:_0x1bba4f,color:_0x1b7db8,noColor:_0x321cd8}=_0x2047cb,_0xd85215={'color':_0x1b7db8,'noColor':_0x321cd8};if(_0x1bba4f===_0x5db5af(0x1ba)){if(shouldUseColor(_0xd85215))return colorizeJSON(_0x4c7ee4,_0xd85215);return JSON[_0x5db5af(0x1de)](_0x4c7ee4,null,0x2);}else{if(_0x1bba4f==='jsonl'){if(shouldUseColor(_0xd85215))return colorizeJSONCompact(_0x4c7ee4,_0xd85215);return JSON[_0x5db5af(0x1de)](_0x4c7ee4);}else{if(_0x1bba4f==='tsv')return Object['entries'](_0x4c7ee4)[_0x5db5af(0x1db)](([_0x49e334,_0x530039])=>_0x49e334+'\x09'+_0x530039)['join']('\x0a');else{const _0x18aebe=Object[_0x5db5af(0x1dd)](_0x4c7ee4);if(_0x18aebe[_0x5db5af(0x1d4)]===0x0)return _0x5db5af(0x1c9);const _0x2a64eb=_0x4c7ee4[_0x5db5af(0x1ad)],_0xff3121=_0x4c7ee4[_0x5db5af(0x19d)],_0x99365a=_0x4c7ee4['params'],_0x787679=_0x4c7ee4['rule'],_0x6ef9d5=_0xff3121?typeof _0xff3121===_0x5db5af(0x1e1)?_0xff3121:JSON['stringify'](_0xff3121,null,0x2):undefined,_0x2c44d3=_0x99365a&&Object['keys'](_0x99365a)[_0x5db5af(0x1d4)]>0x0?JSON[_0x5db5af(0x1de)](_0x99365a,null,0x2):undefined,_0x5d6f93=_0x787679&&Object[_0x5db5af(0x1b4)](_0x787679)['length']>0x0?JSON['stringify'](_0x787679,null,0x2):undefined,_0x5ce560=_0x18aebe[_0x5db5af(0x1ca)](([_0x58e34f])=>_0x58e34f!=='debug'&&_0x58e34f!=='query'&&_0x58e34f!=='params'&&_0x58e34f!==_0x5db5af(0x1d0)),_0x42986f=Math[_0x5db5af(0x1d5)](..._0x5ce560[_0x5db5af(0x1db)](([_0x1dcb1c])=>_0x1dcb1c[_0x5db5af(0x1d4)])),_0x10b6e3=Math[_0x5db5af(0x1d5)](..._0x5ce560[_0x5db5af(0x1db)](([,_0x110d60])=>{const _0x3ed241=_0x5db5af;try{const _0x500921=_0x110d60===null||_0x110d60===undefined?'':typeof _0x110d60==='object'?JSON[_0x3ed241(0x1de)](_0x110d60):String(_0x110d60),_0x4dc88e=_0x500921[_0x3ed241(0x1cb)]('\x0a');return Math['max'](..._0x4dc88e[_0x3ed241(0x1db)](_0x5b117f=>_0x5b117f[_0x3ed241(0x1d4)]),0x0);}catch{return 0x0;}}),0x14),_0x4300e7=[];_0x4300e7[_0x5db5af(0x1c2)](colorBorder('┌─'+'─'[_0x5db5af(0x1aa)](_0x42986f)+_0x5db5af(0x1c3)+'─'[_0x5db5af(0x1aa)](_0x10b6e3)+'─┐',_0xd85215)),_0x5ce560[_0x5db5af(0x19f)](([_0x3028c7,_0x35b9cb])=>{const _0x253b73=_0x5db5af;let _0x2d2c8c;try{_0x2d2c8c=_0x35b9cb===null||_0x35b9cb===undefined?'':typeof _0x35b9cb===_0x253b73(0x1c4)?JSON[_0x253b73(0x1de)](_0x35b9cb):String(_0x35b9cb);}catch{_0x2d2c8c=_0x253b73(0x1dc);}const _0x18d784=_0x3028c7[_0x253b73(0x19c)](_0x42986f),_0x341649=_0x2d2c8c[_0x253b73(0x1cb)]('\x0a');_0x341649['forEach']((_0x2bf138,_0x1fdda4)=>{const _0x32d958=_0x253b73,_0x27492f=colorBorder('│',_0xd85215);_0x1fdda4===0x0?_0x4300e7[_0x32d958(0x1c2)](_0x27492f+'\x20'+_0x18d784+'\x20'+_0x27492f+'\x20'+_0x2bf138[_0x32d958(0x19c)](_0x10b6e3)+'\x20'+_0x27492f):_0x4300e7[_0x32d958(0x1c2)](_0x27492f+'\x20'+'\x20'[_0x32d958(0x1aa)](_0x42986f)+'\x20'+_0x27492f+'\x20'+_0x2bf138[_0x32d958(0x19c)](_0x10b6e3)+'\x20'+_0x27492f);});}),_0x4300e7[_0x5db5af(0x1c2)](colorBorder('└─'+'─'[_0x5db5af(0x1aa)](_0x42986f)+'─┴─'+'─'[_0x5db5af(0x1aa)](_0x10b6e3)+'─┘',_0xd85215));_0x6ef9d5&&(_0x4300e7[_0x5db5af(0x1c2)](''),_0x4300e7['push'](String(a44_0x5f087d[_0x5db5af(0x1ae)][_0x5db5af(0x1d7)](_0x5db5af(0x1a1)))),_0x4300e7[_0x5db5af(0x1c2)](_0x6ef9d5));_0x2c44d3&&(_0x4300e7['push'](''),_0x4300e7[_0x5db5af(0x1c2)](String(a44_0x5f087d[_0x5db5af(0x1b2)][_0x5db5af(0x1d7)](_0x5db5af(0x1b1)))),_0x4300e7['push'](_0x2c44d3));_0x5d6f93&&(_0x4300e7['push'](''),_0x4300e7[_0x5db5af(0x1c2)](String(a44_0x5f087d[_0x5db5af(0x1da)][_0x5db5af(0x1d7)](_0x5db5af(0x1a9)))),_0x4300e7[_0x5db5af(0x1c2)](_0x5d6f93));if(_0x2a64eb){if(_0x2a64eb['stderr']){_0x4300e7['push'](''),_0x4300e7['push'](String(a44_0x5f087d[_0x5db5af(0x1e3)][_0x5db5af(0x1d7)](_0x5db5af(0x1d6))));const _0x2d4d77=_0x2a64eb['stderr'][_0x5db5af(0x1cb)]('\x0a');_0x2d4d77['forEach'](_0x210c02=>{const _0x14ec1c=_0x5db5af;_0x210c02['trim']()&&_0x4300e7[_0x14ec1c(0x1c2)](_0x210c02);});}if(_0x2a64eb[_0x5db5af(0x1df)]){_0x4300e7[_0x5db5af(0x1c2)](''),_0x4300e7[_0x5db5af(0x1c2)](String(a44_0x5f087d['cyan'][_0x5db5af(0x1d7)](_0x5db5af(0x1b7))));const _0x315b63=_0x2a64eb[_0x5db5af(0x1df)][_0x5db5af(0x1cb)]('\x0a');_0x315b63['forEach'](_0x5c3970=>{const _0x560c7c=_0x5db5af;_0x5c3970[_0x560c7c(0x1d8)]()&&_0x4300e7[_0x560c7c(0x1c2)](_0x5c3970);});}}return _0x4300e7[_0x5db5af(0x1a7)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x183c97,_0x5949ab){const _0x414524=a44_0x31a6;if(_0x5949ab[_0x414524(0x1a2)]===_0x414524(0x1c8)){await handleSDKOutput([_0x183c97],_0x5949ab);return;}const _0x4e00d8=resolveOutputOptions(_0x5949ab),_0x3fce0b=await formatSingleObject(_0x183c97,_0x4e00d8);await writeOutput(_0x3fce0b,_0x4e00d8['output']||undefined,_0x4e00d8[_0x414524(0x1a2)]);}
1
+ (function(_0x218f9a,_0x206a2b){const _0x1b4fb9=a45_0x5271,_0x4a8a71=_0x218f9a();while(!![]){try{const _0x173256=-parseInt(_0x1b4fb9(0x189))/0x1+parseInt(_0x1b4fb9(0x197))/0x2+-parseInt(_0x1b4fb9(0x199))/0x3*(-parseInt(_0x1b4fb9(0x186))/0x4)+-parseInt(_0x1b4fb9(0x19c))/0x5+parseInt(_0x1b4fb9(0x17b))/0x6*(-parseInt(_0x1b4fb9(0x192))/0x7)+parseInt(_0x1b4fb9(0x180))/0x8+parseInt(_0x1b4fb9(0x188))/0x9;if(_0x173256===_0x206a2b)break;else _0x4a8a71['push'](_0x4a8a71['shift']());}catch(_0x330de3){_0x4a8a71['push'](_0x4a8a71['shift']());}}}(a45_0x5960,0x789e9));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a45_0x31c1e5 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x12f5a2){const _0x23a001=a45_0x5271;return _0x12f5a2[_0x23a001(0x19d)]===_0x23a001(0x187)||_0x12f5a2[_0x23a001(0x19d)]===_0x23a001(0x194)||_0x12f5a2[_0x23a001(0x19d)]===_0x23a001(0x16a)||_0x12f5a2[_0x23a001(0x19d)]===_0x23a001(0x191)||_0x12f5a2['json']===!![]||_0x12f5a2['jsonl']===!![]||_0x12f5a2[_0x23a001(0x16a)]===!![]||_0x12f5a2[_0x23a001(0x191)]===!![];}function a45_0x5960(){const _0x5dee44=['blue','noColor','max','entries','split','string','magenta','pipe','12zYSMRw','output','debug','trim','varchar','1357088Pzeyaw','number','repeat','─┬─','boolean','filter','4nEttMA','json','11971080USHghR','368567GMQFbN','stdin','[Object]','map','error','limit','Results\x20saved\x20to\x20','No\x20data','table','304171npAOUy','write','jsonl','rule','keys','14102fEQlvd','params','333837LqmZnb','[query]','FINISHED','3342780kniZLz','format','sdk-result','color','stringify','[logs]','yellow','query','end','[rule]','push','object','close','resolve','forEach','bold','stdout','tsv','cmdout','padEnd','bigint','length','double','log','red','stderr'];a45_0x5960=function(){return _0x5dee44;};return a45_0x5960();}export function parseOutputOptions(_0x343eca){const _0x1bcbcf=a45_0x5271;return{'format':_0x343eca[_0x1bcbcf(0x19d)]||'table','output':_0x343eca[_0x1bcbcf(0x17c)]||'','limit':_0x343eca['limit'],'color':_0x343eca[_0x1bcbcf(0x19f)],'noColor':_0x343eca[_0x1bcbcf(0x174)]};}function convertSDKResultToQueryResult(_0x3f23a5){const _0x3fd726=a45_0x5271,_0xcf3809=[];if(_0x3f23a5[_0x3fd726(0x16e)]>0x0){const _0x1947ea=_0x3f23a5[0x0];for(const [_0x45fa9d,_0x1694b0]of Object['entries'](_0x1947ea)){let _0x1fce10='varchar';if(typeof _0x1694b0===_0x3fd726(0x181))_0x1fce10=Number['isInteger'](_0x1694b0)?_0x3fd726(0x16d):_0x3fd726(0x16f);else{if(typeof _0x1694b0===_0x3fd726(0x184))_0x1fce10=_0x3fd726(0x184);else _0x1694b0===null&&(_0x1fce10=_0x3fd726(0x17f));}_0xcf3809[_0x3fd726(0x163)]({'name':_0x45fa9d,'type':_0x1fce10});}}return{'queryId':_0x3fd726(0x19e),'columns':_0xcf3809,'data':_0x3f23a5,'stats':{'state':_0x3fd726(0x19b),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3f23a5[_0x3fd726(0x16e)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x196e2d,_0x22b92c){const _0x23ff31=convertSDKResultToQueryResult(_0x196e2d);return formatQueryOutput(_0x23ff31,_0x22b92c);}export async function formatQueryOutput(_0x8dcdc6,_0x426a96){const _0x3635f1=a45_0x5271,{format:_0x418a7d,limit:_0x2bfd9c,output:_0x9fda68,color:_0x269e8b,noColor:_0x49ef77}=_0x426a96,_0x2e565e=Boolean(_0x9fda68)&&!_0x269e8b,_0x3efcf4={'color':_0x269e8b,'noColor':_0x49ef77||_0x2e565e};if(_0x418a7d===_0x3635f1(0x191)){const _0x14b96e=shouldUseLess(_0x418a7d,_0x9fda68);return formatAsTable(_0x8dcdc6,_0x2bfd9c,_0x14b96e,_0x3efcf4);}else{if(_0x418a7d===_0x3635f1(0x187))return formatAsJSON(_0x8dcdc6,_0x3efcf4);else return _0x418a7d==='jsonl'?formatAsJSONL(_0x8dcdc6,_0x3efcf4):formatQueryResult(_0x8dcdc6,_0x418a7d);}}function shouldUseLess(_0x4e222a,_0x2c549f){const _0x139b7b=a45_0x5271;return(_0x4e222a==='table'||_0x4e222a==='list')&&process[_0x139b7b(0x169)]['isTTY']&&!_0x2c549f;}function a45_0x5271(_0x1ddf05,_0x57f5f8){_0x1ddf05=_0x1ddf05-0x15d;const _0x596041=a45_0x5960();let _0x527172=_0x596041[_0x1ddf05];return _0x527172;}export function resolveOutputOptions(_0x3b7498){const _0x21e8b9=a45_0x5271,_0xc556f8=resolveOutputFormat(_0x3b7498[_0x21e8b9(0x19d)],_0x3b7498['output'],_0x21e8b9(0x191));let _0x33e4c1=typeof _0x3b7498[_0x21e8b9(0x18e)]===_0x21e8b9(0x181)?_0x3b7498[_0x21e8b9(0x18e)]:parseInt(_0x3b7498['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x4dea3b=_0x3b7498[_0x21e8b9(0x17c)]||'';return shouldUseLess(_0xc556f8,_0x4dea3b)&&(_0x33e4c1=Infinity),{'format':_0xc556f8,'output':_0x4dea3b,'limit':_0x33e4c1,'color':_0x3b7498[_0x21e8b9(0x19f)],'noColor':_0x3b7498['noColor']};}export function writeOutput(_0xb20e0d,_0x1fa56a,_0x4cbdef){const _0x4a6be9=a45_0x5271;return _0x1fa56a?(writeFileSync(_0x1fa56a,_0xb20e0d),console['error'](_0x4a6be9(0x18f)+_0x1fa56a),Promise['resolve']()):shouldUseLess(_0x4cbdef||'','')?new Promise(_0x4a31cd=>{const _0x5d187d=_0x4a6be9,_0x483f66=spawn('less',['-FXRSn'],{'stdio':[_0x5d187d(0x17a),'inherit','inherit']});let _0x29bf46=![];_0x483f66['on'](_0x5d187d(0x18d),()=>{const _0x53f419=_0x5d187d;!_0x29bf46&&(_0x29bf46=!![],console[_0x53f419(0x170)](_0xb20e0d),_0x4a31cd());}),_0x483f66['on'](_0x5d187d(0x165),()=>{!_0x29bf46&&(_0x29bf46=!![],_0x4a31cd());}),_0x483f66['on']('spawn',()=>{const _0x215d1c=_0x5d187d;!_0x29bf46&&_0x483f66[_0x215d1c(0x18a)]&&(_0x483f66['stdin']['on'](_0x215d1c(0x18d),()=>{}),_0x483f66['stdin'][_0x215d1c(0x193)](_0xb20e0d),_0x483f66[_0x215d1c(0x18a)][_0x215d1c(0x161)]());}),!_0x483f66[_0x5d187d(0x18a)]&&(!_0x29bf46&&(_0x29bf46=!![],console['log'](_0xb20e0d),_0x4a31cd()));}):(console['log'](_0xb20e0d),Promise[_0x4a6be9(0x166)]());}export async function handleSDKOutput(_0xd142d0,_0x850a50){const _0x96813d=a45_0x5271,_0x445344=resolveOutputOptions(_0x850a50),_0x1030a8=await formatSDKOutput(_0xd142d0,_0x445344);await writeOutput(_0x1030a8,_0x445344[_0x96813d(0x17c)]||undefined,_0x445344['format']);}export async function handleQueryOutput(_0x3ec40d,_0x3f4746){const _0x1ea810=a45_0x5271,_0x34cf81=resolveOutputOptions(_0x3f4746),_0xdab95a=await formatQueryOutput(_0x3ec40d,_0x34cf81);await writeOutput(_0xdab95a,_0x34cf81[_0x1ea810(0x17c)]||undefined,_0x34cf81[_0x1ea810(0x19d)]);}async function formatSingleObject(_0x332017,_0x2c5e40){const _0x580c78=a45_0x5271,{format:_0x54ca97,color:_0x4153de,noColor:_0xb0f499}=_0x2c5e40,_0x49b78d={'color':_0x4153de,'noColor':_0xb0f499};if(_0x54ca97==='json'){if(shouldUseColor(_0x49b78d))return colorizeJSON(_0x332017,_0x49b78d);return JSON['stringify'](_0x332017,null,0x2);}else{if(_0x54ca97===_0x580c78(0x194)){if(shouldUseColor(_0x49b78d))return colorizeJSONCompact(_0x332017,_0x49b78d);return JSON[_0x580c78(0x15d)](_0x332017);}else{if(_0x54ca97===_0x580c78(0x16a))return Object[_0x580c78(0x176)](_0x332017)[_0x580c78(0x18c)](([_0xe35147,_0x442235])=>_0xe35147+'\x09'+_0x442235)['join']('\x0a');else{const _0x3f7ca5=Object[_0x580c78(0x176)](_0x332017);if(_0x3f7ca5[_0x580c78(0x16e)]===0x0)return _0x580c78(0x190);const _0x4e7e0a=_0x332017[_0x580c78(0x17d)],_0x3b8b3d=_0x332017[_0x580c78(0x160)],_0x146f05=_0x332017[_0x580c78(0x198)],_0x100fd2=_0x332017[_0x580c78(0x195)],_0x46222f=_0x3b8b3d?typeof _0x3b8b3d===_0x580c78(0x178)?_0x3b8b3d:JSON['stringify'](_0x3b8b3d,null,0x2):undefined,_0x192ce8=_0x146f05&&Object[_0x580c78(0x196)](_0x146f05)[_0x580c78(0x16e)]>0x0?JSON[_0x580c78(0x15d)](_0x146f05,null,0x2):undefined,_0x1de266=_0x100fd2&&Object[_0x580c78(0x196)](_0x100fd2)[_0x580c78(0x16e)]>0x0?JSON[_0x580c78(0x15d)](_0x100fd2,null,0x2):undefined,_0x22043f=_0x3f7ca5[_0x580c78(0x185)](([_0x4c1fd0])=>_0x4c1fd0!==_0x580c78(0x17d)&&_0x4c1fd0!==_0x580c78(0x160)&&_0x4c1fd0!=='params'&&_0x4c1fd0!==_0x580c78(0x195)),_0x5e3aef=Math[_0x580c78(0x175)](..._0x22043f[_0x580c78(0x18c)](([_0x149f9b])=>_0x149f9b['length'])),_0x178a00=Math[_0x580c78(0x175)](..._0x22043f[_0x580c78(0x18c)](([,_0x407b6f])=>{const _0x2cf0c2=_0x580c78;try{const _0x4c67c5=_0x407b6f===null||_0x407b6f===undefined?'':typeof _0x407b6f===_0x2cf0c2(0x164)?JSON['stringify'](_0x407b6f):String(_0x407b6f),_0xff586a=_0x4c67c5[_0x2cf0c2(0x177)]('\x0a');return Math[_0x2cf0c2(0x175)](..._0xff586a[_0x2cf0c2(0x18c)](_0x523602=>_0x523602[_0x2cf0c2(0x16e)]),0x0);}catch{return 0x0;}}),0x14),_0x531508=[];_0x531508[_0x580c78(0x163)](colorBorder('┌─'+'─'['repeat'](_0x5e3aef)+_0x580c78(0x183)+'─'[_0x580c78(0x182)](_0x178a00)+'─┐',_0x49b78d)),_0x22043f[_0x580c78(0x167)](([_0x365114,_0x306d4d])=>{const _0x3dd1a4=_0x580c78;let _0x2f7df9;try{_0x2f7df9=_0x306d4d===null||_0x306d4d===undefined?'':typeof _0x306d4d===_0x3dd1a4(0x164)?JSON[_0x3dd1a4(0x15d)](_0x306d4d):String(_0x306d4d);}catch{_0x2f7df9=_0x3dd1a4(0x18b);}const _0x2d4644=_0x365114['padEnd'](_0x5e3aef),_0x5592bd=_0x2f7df9[_0x3dd1a4(0x177)]('\x0a');_0x5592bd[_0x3dd1a4(0x167)]((_0x7ae56e,_0x2c6a7f)=>{const _0x58f021=_0x3dd1a4,_0x3278b3=colorBorder('│',_0x49b78d);_0x2c6a7f===0x0?_0x531508[_0x58f021(0x163)](_0x3278b3+'\x20'+_0x2d4644+'\x20'+_0x3278b3+'\x20'+_0x7ae56e[_0x58f021(0x16c)](_0x178a00)+'\x20'+_0x3278b3):_0x531508['push'](_0x3278b3+'\x20'+'\x20'['repeat'](_0x5e3aef)+'\x20'+_0x3278b3+'\x20'+_0x7ae56e[_0x58f021(0x16c)](_0x178a00)+'\x20'+_0x3278b3);});}),_0x531508[_0x580c78(0x163)](colorBorder('└─'+'─'[_0x580c78(0x182)](_0x5e3aef)+'─┴─'+'─'[_0x580c78(0x182)](_0x178a00)+'─┘',_0x49b78d));_0x46222f&&(_0x531508[_0x580c78(0x163)](''),_0x531508[_0x580c78(0x163)](String(a45_0x31c1e5[_0x580c78(0x15f)][_0x580c78(0x168)](_0x580c78(0x19a)))),_0x531508[_0x580c78(0x163)](_0x46222f));_0x192ce8&&(_0x531508[_0x580c78(0x163)](''),_0x531508[_0x580c78(0x163)](String(a45_0x31c1e5[_0x580c78(0x173)]['bold']('[params]'))),_0x531508[_0x580c78(0x163)](_0x192ce8));_0x1de266&&(_0x531508[_0x580c78(0x163)](''),_0x531508[_0x580c78(0x163)](String(a45_0x31c1e5[_0x580c78(0x179)][_0x580c78(0x168)](_0x580c78(0x162)))),_0x531508[_0x580c78(0x163)](_0x1de266));if(_0x4e7e0a){if(_0x4e7e0a[_0x580c78(0x172)]){_0x531508['push'](''),_0x531508[_0x580c78(0x163)](String(a45_0x31c1e5[_0x580c78(0x171)]['bold']('[error]')));const _0x5dba89=_0x4e7e0a[_0x580c78(0x172)][_0x580c78(0x177)]('\x0a');_0x5dba89[_0x580c78(0x167)](_0x2ced65=>{_0x2ced65['trim']()&&_0x531508['push'](_0x2ced65);});}if(_0x4e7e0a['cmdout']){_0x531508[_0x580c78(0x163)](''),_0x531508[_0x580c78(0x163)](String(a45_0x31c1e5['cyan'][_0x580c78(0x168)](_0x580c78(0x15e))));const _0x17fba0=_0x4e7e0a[_0x580c78(0x16b)]['split']('\x0a');_0x17fba0[_0x580c78(0x167)](_0x4bca31=>{const _0x5c724f=_0x580c78;_0x4bca31[_0x5c724f(0x17e)]()&&_0x531508['push'](_0x4bca31);});}}return _0x531508['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x3199b5,_0x2958ef){const _0x18c053=a45_0x5271;if(_0x2958ef[_0x18c053(0x19d)]===_0x18c053(0x191)){await handleSDKOutput([_0x3199b5],_0x2958ef);return;}const _0x2e5aa2=resolveOutputOptions(_0x2958ef),_0x516c3d=await formatSingleObject(_0x3199b5,_0x2e5aa2);await writeOutput(_0x516c3d,_0x2e5aa2[_0x18c053(0x17c)]||undefined,_0x2e5aa2[_0x18c053(0x19d)]);}
@@ -1 +1 @@
1
- const a45_0x31e953=a45_0x52e0;(function(_0x8c9e96,_0x1b9d1e){const _0x429f80=a45_0x52e0,_0x4ee1c9=_0x8c9e96();while(!![]){try{const _0x10783e=-parseInt(_0x429f80(0x195))/0x1+-parseInt(_0x429f80(0x1b0))/0x2*(parseInt(_0x429f80(0x1cb))/0x3)+parseInt(_0x429f80(0x19e))/0x4*(-parseInt(_0x429f80(0x19f))/0x5)+parseInt(_0x429f80(0x191))/0x6*(-parseInt(_0x429f80(0x1da))/0x7)+-parseInt(_0x429f80(0x1b9))/0x8+parseInt(_0x429f80(0x197))/0x9+-parseInt(_0x429f80(0x1cf))/0xa*(-parseInt(_0x429f80(0x1b4))/0xb);if(_0x10783e===_0x1b9d1e)break;else _0x4ee1c9['push'](_0x4ee1c9['shift']());}catch(_0x578481){_0x4ee1c9['push'](_0x4ee1c9['shift']());}}}(a45_0x394e,0xba347));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a45_0x17c79b from'node:fs';import*as a45_0x23c5a2 from'node:path';import{SITE_ALIASES}from'../sdk/types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';function a45_0x394e(){const _0x52b82b=['TD_API_KEY','ap02','apiKeys','stg-jp01','parse','us01','Warning:\x20Failed\x20to\x20load\x20','TDX_API_KEY','toISOString','projectId','some','3DZWyPm','tdx','filter','TD_API_KEY_','1210190SoAmqx','slice','toUpperCase','dev-us01','existsSync','legacy\x20.env\x20file\x20(profile:\x20','TDX_API_KEY_<PROFILE>','.env','TD_API_KEY\x20env\x20var\x20(deprecated)','Warning:\x20Failed\x20to\x20read\x20','endsWith','431438HUDGet','keychain','includes','.json','keychain\x20(profile:\x20','dev-eu01','string','number','site','.env.','readFileSync','replace','30xjiaCT','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','join','write','579964rBDxkT','tdx.json','13592763WHPHTb','path','stg-us01','llm_default_agent','clear','map','read','1108nLGxcS','4815npTnLn','env','eu01','TDX_CONFIG_DIR','account_info','config/llm-project','startsWith','name','legacy\x20.env\x20file','trim','\x20env\x20var','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','yellow','\x27,\x20defaulting\x20to\x20us01','utf-8','entries','config/account-info','3017426eNFOfw','isDeprecated','split','ap03','209wTcbaM','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','accountId','TDX_API_KEY\x20env\x20var','warn','3067000tFhpWd','jp01','TDX_API_KEY_','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','source','llm_default_project','config/llm-agent'];a45_0x394e=function(){return _0x52b82b;};return a45_0x394e();}import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a45_0x1f696e from'chalk';import{getGlobalCacheDir,createOptionalProfileCache}from'../utils/global-cache.js';export function getConfigDir(){const _0x2f5496=a45_0x52e0;return process['env'][_0x2f5496(0x1a2)]||join(homedir(),'.config',_0x2f5496(0x1cc));}export function getConfigFile(){const _0x1bb955=a45_0x52e0;return join(getConfigDir(),_0x1bb955(0x1d6));}export function getConfigFilePath(_0x23b3e8){const _0x2f9675=a45_0x52e0,_0x126ee5=getConfigDir();return _0x23b3e8?a45_0x23c5a2[_0x2f9675(0x193)](_0x126ee5,_0x2f9675(0x18e)+_0x23b3e8):getConfigFile();}export function getCacheDir(){return getGlobalCacheDir();}const llmProjectCache=createOptionalProfileCache(a45_0x31e953(0x1be),a45_0x31e953(0x1a4));export function getLLMProjectCacheFile(_0x5799b5){return llmProjectCache['path'](_0x5799b5);}export function readCachedLLMProject(_0x326b1e){const _0x3eb6c6=a45_0x31e953,_0x4db500=llmProjectCache[_0x3eb6c6(0x19d)](_0x326b1e);if(_0x4db500&&typeof _0x4db500['id']===_0x3eb6c6(0x18b)&&typeof _0x4db500[_0x3eb6c6(0x1a6)]===_0x3eb6c6(0x18b))return _0x4db500;return null;}export function writeCachedLLMProject(_0x1dfd46,_0x1a2a25,_0x25f302){const _0x19163c=a45_0x31e953;try{llmProjectCache[_0x19163c(0x194)]({'name':_0x1dfd46,'id':_0x1a2a25},_0x25f302);}catch{}}const llmAgentCache=createOptionalProfileCache(a45_0x31e953(0x19a),a45_0x31e953(0x1bf));export function getLLMAgentCacheFile(_0x575d44){const _0x2766cb=a45_0x31e953;return llmAgentCache[_0x2766cb(0x198)](_0x575d44);}export function readCachedLLMAgent(_0x34ca45){const _0x5b10fd=a45_0x31e953,_0x7b42ab=llmAgentCache[_0x5b10fd(0x19d)](_0x34ca45);if(_0x7b42ab&&typeof _0x7b42ab['id']==='string'&&typeof _0x7b42ab[_0x5b10fd(0x1a6)]==='string'&&typeof _0x7b42ab[_0x5b10fd(0x1c9)]==='string')return _0x7b42ab;return null;}export function writeCachedLLMAgent(_0x6740af,_0x19cdd7,_0x270c8a,_0x5bff82){const _0x16cc34=a45_0x31e953;try{llmAgentCache[_0x16cc34(0x194)]({'name':_0x6740af,'id':_0x19cdd7,'projectId':_0x270c8a},_0x5bff82);}catch{}}function a45_0x52e0(_0x162392,_0x45c904){_0x162392=_0x162392-0x18b;const _0x394ed7=a45_0x394e();let _0x52e041=_0x394ed7[_0x162392];return _0x52e041;}export function clearCachedLLMAgent(_0x495a0e){const _0x196ef3=a45_0x31e953;try{llmAgentCache[_0x196ef3(0x19b)](_0x495a0e);}catch{}}const accountInfoCache=createOptionalProfileCache(a45_0x31e953(0x1a3),a45_0x31e953(0x1af),{'suffix':a45_0x31e953(0x1dd)});export function getAccountInfoCacheFile(_0x5ab8b1){const _0x2dc14a=a45_0x31e953;return accountInfoCache[_0x2dc14a(0x198)](_0x5ab8b1);}export function readCachedAccountInfo(_0x6a7446){const _0x3660b3=a45_0x31e953,_0x1acd7c=accountInfoCache[_0x3660b3(0x19d)](_0x6a7446);if(_0x1acd7c&&typeof _0x1acd7c[_0x3660b3(0x18d)]===_0x3660b3(0x18b)&&typeof _0x1acd7c[_0x3660b3(0x1b6)]===_0x3660b3(0x18c))return _0x1acd7c;return null;}export function writeCachedAccountInfo(_0x56b6bc,_0x1c41ff,_0x25a4f3){const _0x1d2684=a45_0x31e953;try{accountInfoCache['write']({'site':_0x56b6bc,'accountId':_0x1c41ff,'cachedAt':new Date()[_0x1d2684(0x1c8)]()},_0x25a4f3);}catch{}}export function parseEnvFile(_0x5085ff){const _0x526de5=a45_0x31e953,_0xe80ff3={};for(const _0x88b5c of _0x5085ff[_0x526de5(0x1b2)]('\x0a')){const _0x3544c8=_0x88b5c['trim']();if(!_0x3544c8||_0x3544c8[_0x526de5(0x1a5)]('#'))continue;const _0x1143bc=_0x3544c8['match'](/^([^=]+)=(.*)$/);if(_0x1143bc){const _0x28cece=_0x1143bc[0x1][_0x526de5(0x1a8)]();let _0x2137c0=_0x1143bc[0x2]['trim']();(_0x2137c0['startsWith']('\x22')&&_0x2137c0['endsWith']('\x22')||_0x2137c0[_0x526de5(0x1a5)]('\x27')&&_0x2137c0[_0x526de5(0x1d9)]('\x27'))&&(_0x2137c0=_0x2137c0[_0x526de5(0x1d0)](0x1,-0x1)),_0xe80ff3[_0x28cece]=_0x2137c0;}}return _0xe80ff3;}export function readUserConfig(){const _0xb679ae=a45_0x31e953,_0x222e36=getConfigFile();if(!existsSync(_0x222e36))return{};try{const _0x217a50=readFileSync(_0x222e36,'utf-8');return parseEnvFile(_0x217a50);}catch(_0x2b0e91){return console[_0xb679ae(0x1b8)](_0xb679ae(0x1b5)+_0x222e36+':',_0x2b0e91),{};}}export function resolveSite(_0x5d16c1){const _0x19ab87=a45_0x31e953,_0x65d1a9=['us01',_0x19ab87(0x1ba),'eu01','ap02',_0x19ab87(0x1b3),_0x19ab87(0x1d2),'dev-eu01',_0x19ab87(0x199),_0x19ab87(0x1c3),'stg-ap03'];if(_0x65d1a9[_0x19ab87(0x1dc)](_0x5d16c1))return _0x5d16c1;if(_0x5d16c1 in SITE_ALIASES)return SITE_ALIASES[_0x5d16c1];return console[_0x19ab87(0x1b8)]('Warning:\x20Unknown\x20site\x20\x27'+_0x5d16c1+_0x19ab87(0x1ac)),_0x19ab87(0x1c5);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x3a4c05,_0x3a0abd){const _0x4c90e7=a45_0x31e953,_0x485c53=_0x3a0abd||getActiveProfileName();if(_0x485c53){const _0xae6903=_0x4c90e7(0x1bb)+normalizeProfileForEnvVar(_0x485c53);if(process[_0x4c90e7(0x1a0)][_0xae6903])return process[_0x4c90e7(0x1a0)][_0xae6903];}if(process[_0x4c90e7(0x1a0)][_0x4c90e7(0x1c7)])return process[_0x4c90e7(0x1a0)][_0x4c90e7(0x1c7)];if(process[_0x4c90e7(0x1a0)]['TD_API_KEY'])return process[_0x4c90e7(0x1a0)][_0x4c90e7(0x1c0)];const _0x27cf48=_0x3a4c05[_0x4c90e7(0x1d1)]()['replace'](/-/g,'_'),_0x1f3bc5=_0x4c90e7(0x1ce)+_0x27cf48;if(_0x485c53){const _0x1ffea5=loadProfileEnv(_0x485c53);if(_0x1ffea5){if(_0x1ffea5[_0x1f3bc5])return _0x1ffea5[_0x1f3bc5];if(_0x1ffea5[_0x4c90e7(0x1c0)])return _0x1ffea5[_0x4c90e7(0x1c0)];}}const _0x3f44be=loadUserConfigOnce();if(_0x3f44be[_0x1f3bc5])return _0x3f44be[_0x1f3bc5];if(_0x3f44be[_0x4c90e7(0x1c0)])return _0x3f44be['TD_API_KEY'];return undefined;}export function normalizeProfileForEnvVar(_0x5d74f7){const _0x2710c2=a45_0x31e953;return _0x5d74f7[_0x2710c2(0x1d1)]()[_0x2710c2(0x190)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x985ff6,_0x595b64){const _0x53575c=a45_0x31e953,_0x1fedeb=_0x595b64||getActiveProfileName()||undefined;if(_0x1fedeb){const _0x5b02b4='TDX_API_KEY_'+normalizeProfileForEnvVar(_0x1fedeb);if(process[_0x53575c(0x1a0)][_0x5b02b4])return{'apiKey':process[_0x53575c(0x1a0)][_0x5b02b4],'source':_0x5b02b4+_0x53575c(0x1a9),'isDeprecated':![]};const _0x1e7fcf=getCachedCredential(_0x985ff6,_0x1fedeb);if(_0x1e7fcf)return{'apiKey':_0x1e7fcf,'source':_0x53575c(0x1de)+_0x1fedeb+')','isDeprecated':![]};const _0x481b9b=await getKeychainAPIKey(_0x1fedeb);if(_0x481b9b)return setCachedCredential(_0x481b9b,_0x985ff6,_0x1fedeb),{'apiKey':_0x481b9b,'source':_0x53575c(0x1de)+_0x1fedeb+')','isDeprecated':![]};}if(process[_0x53575c(0x1a0)]['TDX_API_KEY'])return{'apiKey':process[_0x53575c(0x1a0)]['TDX_API_KEY'],'source':_0x53575c(0x1b7),'isDeprecated':![]};if(!_0x1fedeb){const _0x30348f=getCachedCredential(_0x985ff6,undefined);if(_0x30348f)return{'apiKey':_0x30348f,'source':_0x53575c(0x1db),'isDeprecated':![]};const _0x1706ee=await getKeychainAPIKey(undefined);if(_0x1706ee)return setCachedCredential(_0x1706ee,_0x985ff6,undefined),{'apiKey':_0x1706ee,'source':_0x53575c(0x1db),'isDeprecated':![]};}if(process[_0x53575c(0x1a0)][_0x53575c(0x1c0)])return{'apiKey':process['env'][_0x53575c(0x1c0)],'source':_0x53575c(0x1d7),'isDeprecated':!![]};const _0x59235d=getLegacyEnvAPIKey(_0x985ff6,_0x1fedeb);if(_0x59235d){const _0x364cd0=await isKeychainAvailable();if(_0x364cd0)try{await saveKeychainAPIKey(_0x59235d,_0x1fedeb),setCachedCredential(_0x59235d,_0x985ff6,_0x1fedeb);const _0x57f6d5=getConfigFilePath(_0x1fedeb);cleanupLegacyEnvFile(_0x57f6d5)&&console[_0x53575c(0x1b8)](a45_0x1f696e[_0x53575c(0x1ab)](_0x53575c(0x192)));}catch(_0x11e8d4){console[_0x53575c(0x1b8)](a45_0x1f696e[_0x53575c(0x1ab)]('⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20'+_0x11e8d4));}const _0x665ef=_0x1fedeb?_0x53575c(0x1d4)+_0x1fedeb+')':_0x53575c(0x1a7);return{'apiKey':_0x59235d,'source':_0x665ef,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x2443ba,_0x2c1555,_0x5293fd=!![]){const _0x2e6ee4=a45_0x31e953,_0x405623=await resolveAPIKeyAsync(_0x2443ba,_0x2c1555);if(!_0x405623)return undefined;if(_0x5293fd&&_0x405623[_0x2e6ee4(0x1b1)]&&_0x405623[_0x2e6ee4(0x1bd)][_0x2e6ee4(0x1dc)](_0x2e6ee4(0x1c0))){const _0x270862=_0x2c1555||getActiveProfileName()||undefined,_0x5120e2=_0x270862?_0x2e6ee4(0x1bb)+normalizeProfileForEnvVar(_0x270862):_0x2e6ee4(0x1d5);console[_0x2e6ee4(0x1b8)](a45_0x1f696e[_0x2e6ee4(0x1ab)](_0x2e6ee4(0x1aa)+(_0x2e6ee4(0x1bc)+_0x5120e2+').')));}return _0x405623['apiKey'];}function getLegacyEnvAPIKey(_0x572818,_0x5aa183){const _0x3174bb=a45_0x31e953,_0x3f6a2b=_0x572818[_0x3174bb(0x1d1)]()[_0x3174bb(0x190)](/-/g,'_'),_0x3a1627=_0x3174bb(0x1ce)+_0x3f6a2b;if(_0x5aa183){const _0x8fe81e=loadProfileEnv(_0x5aa183);if(_0x8fe81e){if(_0x8fe81e[_0x3a1627])return _0x8fe81e[_0x3a1627];if(_0x8fe81e[_0x3174bb(0x1c0)])return _0x8fe81e[_0x3174bb(0x1c0)];}}const _0x214622=loadUserConfigOnce();if(_0x214622[_0x3a1627])return _0x214622[_0x3a1627];if(_0x214622[_0x3174bb(0x1c0)])return _0x214622[_0x3174bb(0x1c0)];return undefined;}function cleanupLegacyEnvFile(_0x4ae435){const _0xeada3=a45_0x31e953;if(!existsSync(_0x4ae435))return![];try{const _0x4390f0=readFileSync(_0x4ae435,'utf-8'),_0x4eabf0=_0x4390f0[_0xeada3(0x1b2)]('\x0a'),_0x2a82f0=_0x4eabf0[_0xeada3(0x1cd)](_0x457a83=>{const _0x3bb455=_0xeada3,_0x10d330=_0x457a83[_0x3bb455(0x1a8)]();if(!_0x10d330||_0x10d330['startsWith']('#'))return!![];const [_0x4e3a23]=_0x10d330[_0x3bb455(0x1b2)]('=');return!_0x4e3a23[_0x3bb455(0x1a5)](_0x3bb455(0x1c0));}),_0x4ce79d=_0x2a82f0[_0xeada3(0x1ca)](_0x441d01=>{const _0x2a6359=_0xeada3,_0x218bdc=_0x441d01[_0x2a6359(0x1a8)]();return _0x218bdc&&!_0x218bdc[_0x2a6359(0x1a5)]('#');});if(!_0x4ce79d)return unlinkSync(_0x4ae435),!![];return writeFileSync(_0x4ae435,_0x2a82f0[_0xeada3(0x193)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x51f2c4){const _0x1d8191=a45_0x31e953,_0x329141=a45_0x23c5a2[_0x1d8191(0x193)](getConfigDir(),_0x1d8191(0x18e)+_0x51f2c4);if(a45_0x17c79b[_0x1d8191(0x1d3)](_0x329141)){validateSecureFilePermissions(_0x329141);try{const _0x547389=a45_0x17c79b['readFileSync'](_0x329141,_0x1d8191(0x1ad));return parseEnvFile(_0x547389);}catch(_0x4c3f56){console['warn'](_0x1d8191(0x1c6)+_0x329141+':\x20'+_0x4c3f56);}}const _0x3e2361=a45_0x23c5a2[_0x1d8191(0x193)](getConfigDir(),'profiles',_0x51f2c4,_0x1d8191(0x1d6));if(a45_0x17c79b['existsSync'](_0x3e2361)){validateSecureFilePermissions(_0x3e2361);try{const _0x4693a2=a45_0x17c79b[_0x1d8191(0x18f)](_0x3e2361,_0x1d8191(0x1ad));return parseEnvFile(_0x4693a2);}catch(_0x2c6d3c){return console[_0x1d8191(0x1b8)](_0x1d8191(0x1c6)+_0x3e2361+':\x20'+_0x2c6d3c),null;}}return null;}function getActiveProfileName(){const _0x1bda04=a45_0x31e953,_0x3140a9=a45_0x23c5a2[_0x1bda04(0x193)](getConfigDir(),_0x1bda04(0x196));if(!a45_0x17c79b['existsSync'](_0x3140a9))return null;try{const _0x12bf18=a45_0x17c79b[_0x1bda04(0x18f)](_0x3140a9,_0x1bda04(0x1ad)),_0x18a07a=JSON[_0x1bda04(0x1c4)](_0x12bf18);return _0x18a07a['profile']||null;}catch{return null;}}export function saveAPIKey(_0x1a15db,_0x2a2385,_0x19a309){const _0x28fc69=a45_0x31e953,_0x338533=getConfigDir(),_0x16260d=getConfigFilePath(_0x19a309);!existsSync(_0x338533)&&mkdirSync(_0x338533,{'recursive':!![],'mode':0x1c0});let _0x200b82={};if(existsSync(_0x16260d))try{const _0x478365=readFileSync(_0x16260d,_0x28fc69(0x1ad));_0x200b82=parseEnvFile(_0x478365);}catch(_0x47a9f4){console[_0x28fc69(0x1b8)](_0x28fc69(0x1d8)+_0x16260d+':',_0x47a9f4);}const _0x1a35b9=_0x1a15db[_0x28fc69(0x1d1)]()[_0x28fc69(0x190)](/-/g,'_');_0x200b82['TD_API_KEY_'+_0x1a35b9]=_0x2a2385;const _0x59037c=Object[_0x28fc69(0x1ae)](_0x200b82)[_0x28fc69(0x19c)](([_0x2cd806,_0x28292a])=>_0x2cd806+'='+_0x28292a);writeFileSync(_0x16260d,_0x59037c[_0x28fc69(0x193)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x1fbfea,_0x1fc43f,_0x59519a){const _0x37213e=a45_0x31e953;await saveKeychainAPIKey(_0x1fbfea,_0x59519a),setCachedCredential(_0x1fbfea,_0x1fc43f,_0x59519a);const _0x5b3f0e=getConfigFilePath(_0x59519a);cleanupLegacyEnvFile(_0x5b3f0e)&&console[_0x37213e(0x1b8)](a45_0x1f696e[_0x37213e(0x1ab)]('⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'));}export function loadConfig(){const _0x4f54cc=a45_0x31e953,_0x341c22={'apiKeys':{},'defaultSite':_0x4f54cc(0x1c5)},_0x1ffc95=[_0x4f54cc(0x1c5),_0x4f54cc(0x1ba),_0x4f54cc(0x1a1),_0x4f54cc(0x1c1),_0x4f54cc(0x1b3),'dev-us01',_0x4f54cc(0x1df),_0x4f54cc(0x199),_0x4f54cc(0x1c3),'stg-ap03'];for(const _0x6c3bcd of _0x1ffc95){const _0x58f46c=getAPIKey(_0x6c3bcd);_0x58f46c&&(_0x341c22[_0x4f54cc(0x1c2)][_0x6c3bcd]=_0x58f46c);}return _0x341c22;}
1
+ const a46_0xdafaab=a46_0x35fc;(function(_0x15242f,_0x4af7c4){const _0x3646b6=a46_0x35fc,_0x337ffa=_0x15242f();while(!![]){try{const _0xb1ebdc=-parseInt(_0x3646b6(0x152))/0x1+parseInt(_0x3646b6(0x14f))/0x2*(parseInt(_0x3646b6(0x12e))/0x3)+-parseInt(_0x3646b6(0x145))/0x4+-parseInt(_0x3646b6(0x14d))/0x5*(parseInt(_0x3646b6(0x15d))/0x6)+-parseInt(_0x3646b6(0x12c))/0x7+parseInt(_0x3646b6(0x133))/0x8*(parseInt(_0x3646b6(0x115))/0x9)+parseInt(_0x3646b6(0x164))/0xa*(parseInt(_0x3646b6(0x151))/0xb);if(_0xb1ebdc===_0x4af7c4)break;else _0x337ffa['push'](_0x337ffa['shift']());}catch(_0x2bd380){_0x337ffa['push'](_0x337ffa['shift']());}}}(a46_0x707b,0x5888b));function a46_0x35fc(_0x124f91,_0x4ea7e5){_0x124f91=_0x124f91-0x110;const _0x707b25=a46_0x707b();let _0x35fc08=_0x707b25[_0x124f91];return _0x35fc08;}import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a46_0x2be569 from'node:fs';import*as a46_0x529989 from'node:path';import{SITE_ALIASES}from'../sdk/types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a46_0x41870d from'chalk';import{getGlobalCacheDir,createOptionalProfileCache}from'../utils/global-cache.js';export function getConfigDir(){const _0x3cf64f=a46_0x35fc;return process[_0x3cf64f(0x11a)][_0x3cf64f(0x13e)]||join(homedir(),_0x3cf64f(0x137),'tdx');}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getConfigFilePath(_0x2f2d46){const _0x2fded8=a46_0x35fc,_0x232c50=getConfigDir();return _0x2f2d46?a46_0x529989['join'](_0x232c50,_0x2fded8(0x15f)+_0x2f2d46):getConfigFile();}export function getCacheDir(){return getGlobalCacheDir();}const llmProjectCache=createOptionalProfileCache(a46_0xdafaab(0x158),a46_0xdafaab(0x148));export function getLLMProjectCacheFile(_0x4faaa8){const _0x56f5e0=a46_0xdafaab;return llmProjectCache[_0x56f5e0(0x123)](_0x4faaa8);}export function readCachedLLMProject(_0x5a8c4a){const _0x4fdaf6=a46_0xdafaab,_0x33f609=llmProjectCache['read'](_0x5a8c4a);if(_0x33f609&&typeof _0x33f609['id']===_0x4fdaf6(0x149)&&typeof _0x33f609[_0x4fdaf6(0x156)]===_0x4fdaf6(0x149))return _0x33f609;return null;}export function writeCachedLLMProject(_0x4ff382,_0x42f20b,_0x18524a){const _0x321e88=a46_0xdafaab;try{llmProjectCache[_0x321e88(0x118)]({'name':_0x4ff382,'id':_0x42f20b},_0x18524a);}catch{}}const llmAgentCache=createOptionalProfileCache(a46_0xdafaab(0x15c),'config/llm-agent');export function getLLMAgentCacheFile(_0x1a080d){return llmAgentCache['path'](_0x1a080d);}export function readCachedLLMAgent(_0x222a48){const _0x5e88c6=a46_0xdafaab,_0x7de846=llmAgentCache[_0x5e88c6(0x12b)](_0x222a48);if(_0x7de846&&typeof _0x7de846['id']==='string'&&typeof _0x7de846[_0x5e88c6(0x156)]===_0x5e88c6(0x149)&&typeof _0x7de846['projectId']===_0x5e88c6(0x149))return _0x7de846;return null;}export function writeCachedLLMAgent(_0x54dbb1,_0x2eca61,_0x13dc9b,_0x11d530){const _0x41578e=a46_0xdafaab;try{llmAgentCache[_0x41578e(0x118)]({'name':_0x54dbb1,'id':_0x2eca61,'projectId':_0x13dc9b},_0x11d530);}catch{}}export function clearCachedLLMAgent(_0x47c8db){const _0x321e33=a46_0xdafaab;try{llmAgentCache[_0x321e33(0x135)](_0x47c8db);}catch{}}const accountInfoCache=createOptionalProfileCache(a46_0xdafaab(0x113),a46_0xdafaab(0x140),{'suffix':a46_0xdafaab(0x12d)});export function getAccountInfoCacheFile(_0x2e88cf){const _0x30d95d=a46_0xdafaab;return accountInfoCache[_0x30d95d(0x123)](_0x2e88cf);}export function readCachedAccountInfo(_0xf24323){const _0x1104ca=a46_0xdafaab,_0x1c468e=accountInfoCache['read'](_0xf24323);if(_0x1c468e&&typeof _0x1c468e[_0x1104ca(0x117)]===_0x1104ca(0x149)&&typeof _0x1c468e['accountId']===_0x1104ca(0x121))return _0x1c468e;return null;}export function writeCachedAccountInfo(_0x449772,_0x2f0d10,_0x3afd4f){const _0x220bb2=a46_0xdafaab;try{accountInfoCache[_0x220bb2(0x118)]({'site':_0x449772,'accountId':_0x2f0d10,'cachedAt':new Date()[_0x220bb2(0x131)]()},_0x3afd4f);}catch{}}export function parseEnvFile(_0x3b7ef8){const _0xc90887=a46_0xdafaab,_0x1ecde4={};for(const _0x86ae6 of _0x3b7ef8[_0xc90887(0x124)]('\x0a')){const _0x2a9aa3=_0x86ae6['trim']();if(!_0x2a9aa3||_0x2a9aa3[_0xc90887(0x159)]('#'))continue;const _0x30b976=_0x2a9aa3[_0xc90887(0x15b)](/^([^=]+)=(.*)$/);if(_0x30b976){const _0xc7fa8f=_0x30b976[0x1]['trim']();let _0x58671e=_0x30b976[0x2][_0xc90887(0x162)]();(_0x58671e['startsWith']('\x22')&&_0x58671e[_0xc90887(0x11e)]('\x22')||_0x58671e[_0xc90887(0x159)]('\x27')&&_0x58671e[_0xc90887(0x11e)]('\x27'))&&(_0x58671e=_0x58671e[_0xc90887(0x11f)](0x1,-0x1)),_0x1ecde4[_0xc7fa8f]=_0x58671e;}}return _0x1ecde4;}export function readUserConfig(){const _0x4515ae=a46_0xdafaab,_0x2bc03c=getConfigFile();if(!existsSync(_0x2bc03c))return{};try{const _0x22ab94=readFileSync(_0x2bc03c,_0x4515ae(0x144));return parseEnvFile(_0x22ab94);}catch(_0x3f5729){return console[_0x4515ae(0x15e)](_0x4515ae(0x14a)+_0x2bc03c+':',_0x3f5729),{};}}export function resolveSite(_0x248aeb){const _0x31b2b5=a46_0xdafaab,_0xc03a0e=['us01',_0x31b2b5(0x116),_0x31b2b5(0x147),_0x31b2b5(0x150),_0x31b2b5(0x153),_0x31b2b5(0x114),_0x31b2b5(0x12f),_0x31b2b5(0x163),'stg-jp01',_0x31b2b5(0x11c)];if(_0xc03a0e['includes'](_0x248aeb))return _0x248aeb;if(_0x248aeb in SITE_ALIASES)return SITE_ALIASES[_0x248aeb];return console[_0x31b2b5(0x15e)](_0x31b2b5(0x141)+_0x248aeb+_0x31b2b5(0x125)),_0x31b2b5(0x14b);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x1bb0ef,_0x4d4e40){const _0x16459c=a46_0xdafaab,_0x58233f=_0x4d4e40||getActiveProfileName();if(_0x58233f){const _0x134258=_0x16459c(0x128)+normalizeProfileForEnvVar(_0x58233f);if(process[_0x16459c(0x11a)][_0x134258])return process['env'][_0x134258];}if(process['env'][_0x16459c(0x12a)])return process[_0x16459c(0x11a)][_0x16459c(0x12a)];if(process['env'][_0x16459c(0x13b)])return process[_0x16459c(0x11a)]['TD_API_KEY'];const _0x5b8aef=_0x1bb0ef[_0x16459c(0x126)]()['replace'](/-/g,'_'),_0x14e118='TD_API_KEY_'+_0x5b8aef;if(_0x58233f){const _0x254893=loadProfileEnv(_0x58233f);if(_0x254893){if(_0x254893[_0x14e118])return _0x254893[_0x14e118];if(_0x254893[_0x16459c(0x13b)])return _0x254893[_0x16459c(0x13b)];}}const _0x3bf407=loadUserConfigOnce();if(_0x3bf407[_0x14e118])return _0x3bf407[_0x14e118];if(_0x3bf407['TD_API_KEY'])return _0x3bf407['TD_API_KEY'];return undefined;}export function normalizeProfileForEnvVar(_0x46a7cd){const _0x9990bb=a46_0xdafaab;return _0x46a7cd[_0x9990bb(0x126)]()['replace'](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x305765,_0x92e53){const _0x12e6e3=a46_0xdafaab,_0x2076e1=_0x92e53||getActiveProfileName()||undefined;if(_0x2076e1){const _0x25c0e3=_0x12e6e3(0x128)+normalizeProfileForEnvVar(_0x2076e1);if(process[_0x12e6e3(0x11a)][_0x25c0e3])return{'apiKey':process['env'][_0x25c0e3],'source':_0x25c0e3+_0x12e6e3(0x130),'isDeprecated':![]};const _0x2aaa68=getCachedCredential(_0x305765,_0x2076e1);if(_0x2aaa68)return{'apiKey':_0x2aaa68,'source':'keychain\x20(profile:\x20'+_0x2076e1+')','isDeprecated':![]};const _0x1b0cf4=await getKeychainAPIKey(_0x2076e1);if(_0x1b0cf4)return setCachedCredential(_0x1b0cf4,_0x305765,_0x2076e1),{'apiKey':_0x1b0cf4,'source':_0x12e6e3(0x119)+_0x2076e1+')','isDeprecated':![]};}if(process[_0x12e6e3(0x11a)][_0x12e6e3(0x12a)])return{'apiKey':process['env'][_0x12e6e3(0x12a)],'source':_0x12e6e3(0x14e),'isDeprecated':![]};if(!_0x2076e1){const _0x199b3d=getCachedCredential(_0x305765,undefined);if(_0x199b3d)return{'apiKey':_0x199b3d,'source':_0x12e6e3(0x138),'isDeprecated':![]};const _0xe430d4=await getKeychainAPIKey(undefined);if(_0xe430d4)return setCachedCredential(_0xe430d4,_0x305765,undefined),{'apiKey':_0xe430d4,'source':_0x12e6e3(0x138),'isDeprecated':![]};}if(process[_0x12e6e3(0x11a)]['TD_API_KEY'])return{'apiKey':process[_0x12e6e3(0x11a)][_0x12e6e3(0x13b)],'source':'TD_API_KEY\x20env\x20var\x20(deprecated)','isDeprecated':!![]};const _0x160f5a=getLegacyEnvAPIKey(_0x305765,_0x2076e1);if(_0x160f5a){const _0x5c6bd7=await isKeychainAvailable();if(_0x5c6bd7)try{await saveKeychainAPIKey(_0x160f5a,_0x2076e1),setCachedCredential(_0x160f5a,_0x305765,_0x2076e1);const _0x23e3a1=getConfigFilePath(_0x2076e1);cleanupLegacyEnvFile(_0x23e3a1)&&console['warn'](a46_0x41870d[_0x12e6e3(0x129)]('⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage'));}catch(_0x3db7f6){console[_0x12e6e3(0x15e)](a46_0x41870d[_0x12e6e3(0x129)](_0x12e6e3(0x13c)+_0x3db7f6));}const _0x4b64c3=_0x2076e1?_0x12e6e3(0x110)+_0x2076e1+')':'legacy\x20.env\x20file';return{'apiKey':_0x160f5a,'source':_0x4b64c3,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x350c33,_0x3a229c,_0x15db7a=!![]){const _0x363541=a46_0xdafaab,_0x2a2499=await resolveAPIKeyAsync(_0x350c33,_0x3a229c);if(!_0x2a2499)return undefined;if(_0x15db7a&&_0x2a2499[_0x363541(0x14c)]&&_0x2a2499[_0x363541(0x13f)][_0x363541(0x155)]('TD_API_KEY')){const _0x201210=_0x3a229c||getActiveProfileName()||undefined,_0x6c7136=_0x201210?_0x363541(0x128)+normalizeProfileForEnvVar(_0x201210):'TDX_API_KEY_<PROFILE>';console['warn'](a46_0x41870d[_0x363541(0x129)](_0x363541(0x146)+(_0x363541(0x132)+_0x6c7136+').')));}return _0x2a2499[_0x363541(0x122)];}function getLegacyEnvAPIKey(_0x6f626e,_0x1d996d){const _0x2891a6=a46_0xdafaab,_0x63e5a0=_0x6f626e[_0x2891a6(0x126)]()[_0x2891a6(0x157)](/-/g,'_'),_0x3adfdc=_0x2891a6(0x134)+_0x63e5a0;if(_0x1d996d){const _0x2b6c3c=loadProfileEnv(_0x1d996d);if(_0x2b6c3c){if(_0x2b6c3c[_0x3adfdc])return _0x2b6c3c[_0x3adfdc];if(_0x2b6c3c['TD_API_KEY'])return _0x2b6c3c[_0x2891a6(0x13b)];}}const _0x2bd50a=loadUserConfigOnce();if(_0x2bd50a[_0x3adfdc])return _0x2bd50a[_0x3adfdc];if(_0x2bd50a[_0x2891a6(0x13b)])return _0x2bd50a[_0x2891a6(0x13b)];return undefined;}function cleanupLegacyEnvFile(_0x2e8d03){const _0x46109d=a46_0xdafaab;if(!existsSync(_0x2e8d03))return![];try{const _0x3b7b20=readFileSync(_0x2e8d03,_0x46109d(0x144)),_0x4d1b99=_0x3b7b20[_0x46109d(0x124)]('\x0a'),_0x40d745=_0x4d1b99[_0x46109d(0x160)](_0x58435d=>{const _0x3461f6=_0x46109d,_0x2e501c=_0x58435d[_0x3461f6(0x162)]();if(!_0x2e501c||_0x2e501c[_0x3461f6(0x159)]('#'))return!![];const [_0x3da4ba]=_0x2e501c[_0x3461f6(0x124)]('=');return!_0x3da4ba[_0x3461f6(0x159)](_0x3461f6(0x13b));}),_0x3046d6=_0x40d745[_0x46109d(0x112)](_0x5d3ad2=>{const _0x19a1e8=_0x46109d,_0xaf7df7=_0x5d3ad2['trim']();return _0xaf7df7&&!_0xaf7df7[_0x19a1e8(0x159)]('#');});if(!_0x3046d6)return unlinkSync(_0x2e8d03),!![];return writeFileSync(_0x2e8d03,_0x40d745[_0x46109d(0x136)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x4fb38f){const _0x549fd2=a46_0xdafaab,_0x53265d=a46_0x529989[_0x549fd2(0x136)](getConfigDir(),_0x549fd2(0x15f)+_0x4fb38f);if(a46_0x2be569['existsSync'](_0x53265d)){validateSecureFilePermissions(_0x53265d);try{const _0x49b23c=a46_0x2be569[_0x549fd2(0x127)](_0x53265d,_0x549fd2(0x144));return parseEnvFile(_0x49b23c);}catch(_0x109761){console[_0x549fd2(0x15e)](_0x549fd2(0x161)+_0x53265d+':\x20'+_0x109761);}}const _0x204d0e=a46_0x529989['join'](getConfigDir(),_0x549fd2(0x13d),_0x4fb38f,_0x549fd2(0x154));if(a46_0x2be569[_0x549fd2(0x11b)](_0x204d0e)){validateSecureFilePermissions(_0x204d0e);try{const _0x420216=a46_0x2be569[_0x549fd2(0x127)](_0x204d0e,_0x549fd2(0x144));return parseEnvFile(_0x420216);}catch(_0x25a366){return console[_0x549fd2(0x15e)](_0x549fd2(0x161)+_0x204d0e+':\x20'+_0x25a366),null;}}return null;}function getActiveProfileName(){const _0x4f6c85=a46_0xdafaab,_0x49a480=a46_0x529989[_0x4f6c85(0x136)](getConfigDir(),_0x4f6c85(0x120));if(!a46_0x2be569[_0x4f6c85(0x11b)](_0x49a480))return null;try{const _0x1b0499=a46_0x2be569[_0x4f6c85(0x127)](_0x49a480,_0x4f6c85(0x144)),_0x10fe48=JSON[_0x4f6c85(0x142)](_0x1b0499);return _0x10fe48[_0x4f6c85(0x139)]||null;}catch{return null;}}export function saveAPIKey(_0x159d8a,_0x38d75c,_0x44fd34){const _0x55c61a=a46_0xdafaab,_0x4bc837=getConfigDir(),_0x12daa5=getConfigFilePath(_0x44fd34);!existsSync(_0x4bc837)&&mkdirSync(_0x4bc837,{'recursive':!![],'mode':0x1c0});let _0x3e4185={};if(existsSync(_0x12daa5))try{const _0x50c1e2=readFileSync(_0x12daa5,'utf-8');_0x3e4185=parseEnvFile(_0x50c1e2);}catch(_0x42b25d){console['warn'](_0x55c61a(0x143)+_0x12daa5+':',_0x42b25d);}const _0x5b3a05=_0x159d8a[_0x55c61a(0x126)]()[_0x55c61a(0x157)](/-/g,'_');_0x3e4185[_0x55c61a(0x134)+_0x5b3a05]=_0x38d75c;const _0x4763f6=Object[_0x55c61a(0x13a)](_0x3e4185)[_0x55c61a(0x111)](([_0x3eb24d,_0x5a9cd9])=>_0x3eb24d+'='+_0x5a9cd9);writeFileSync(_0x12daa5,_0x4763f6[_0x55c61a(0x136)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0xa70601,_0x27232c,_0x572665){const _0x423e97=a46_0xdafaab;await saveKeychainAPIKey(_0xa70601,_0x572665),setCachedCredential(_0xa70601,_0x27232c,_0x572665);const _0xdb4e69=getConfigFilePath(_0x572665);cleanupLegacyEnvFile(_0xdb4e69)&&console['warn'](a46_0x41870d[_0x423e97(0x129)]('⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'));}export function loadConfig(){const _0x500e76=a46_0xdafaab,_0x50223a={'apiKeys':{},'defaultSite':_0x500e76(0x14b)},_0x56155a=[_0x500e76(0x14b),_0x500e76(0x116),_0x500e76(0x147),_0x500e76(0x150),_0x500e76(0x153),_0x500e76(0x114),'dev-eu01',_0x500e76(0x163),_0x500e76(0x11d),_0x500e76(0x11c)];for(const _0x4f0efc of _0x56155a){const _0x203bad=getAPIKey(_0x4f0efc);_0x203bad&&(_0x50223a[_0x500e76(0x15a)][_0x4f0efc]=_0x203bad);}return _0x50223a;}function a46_0x707b(){const _0x559d31=['588162iibXhB','warn','.env.','filter','Warning:\x20Failed\x20to\x20load\x20','trim','stg-us01','50pitFRK','legacy\x20.env\x20file\x20(profile:\x20','map','some','account_info','dev-us01','3705255KMYFPY','jp01','site','write','keychain\x20(profile:\x20','env','existsSync','stg-ap03','stg-jp01','endsWith','slice','tdx.json','number','apiKey','path','split','\x27,\x20defaulting\x20to\x20us01','toUpperCase','readFileSync','TDX_API_KEY_','yellow','TDX_API_KEY','read','3492181GwLbkW','.json','1627125jwkYMq','dev-eu01','\x20env\x20var','toISOString','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','8ayJLnr','TD_API_KEY_','clear','join','.config','keychain','profile','entries','TD_API_KEY','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','profiles','TDX_CONFIG_DIR','source','config/account-info','Warning:\x20Unknown\x20site\x20\x27','parse','Warning:\x20Failed\x20to\x20read\x20','utf-8','1599500AIhpLG','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','eu01','config/llm-project','string','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','us01','isDeprecated','5GIQSBR','TDX_API_KEY\x20env\x20var','2OzapFG','ap02','1771594DLAdPa','399920GdIOXc','ap03','.env','includes','name','replace','llm_default_project','startsWith','apiKeys','match','llm_default_agent'];a46_0x707b=function(){return _0x559d31;};return a46_0x707b();}
@@ -1 +1 @@
1
- const a46_0x50a5ef=a46_0x399d;(function(_0x477442,_0x15993e){const _0x8799cc=a46_0x399d,_0x26931b=_0x477442();while(!![]){try{const _0x40f883=-parseInt(_0x8799cc(0x176))/0x1+parseInt(_0x8799cc(0x174))/0x2*(parseInt(_0x8799cc(0x169))/0x3)+parseInt(_0x8799cc(0x16b))/0x4+-parseInt(_0x8799cc(0x16a))/0x5+parseInt(_0x8799cc(0x16d))/0x6+-parseInt(_0x8799cc(0x170))/0x7+parseInt(_0x8799cc(0x172))/0x8*(-parseInt(_0x8799cc(0x175))/0x9);if(_0x40f883===_0x15993e)break;else _0x26931b['push'](_0x26931b['shift']());}catch(_0x25bb70){_0x26931b['push'](_0x26931b['shift']());}}}(a46_0x521f,0x3bc33));function a46_0x521f(){const _0x322183=['133714BQzTgI','957477hmNUbT','95445BTqwEt','1235296sEyavj','clear','2221254Hwutyn','core/connection-cache','connections-{profile}.json','2250360XqdVut','now','16664IXIefW','read','2RBrcSE','1206YsOJdz'];a46_0x521f=function(){return _0x322183;};return a46_0x521f();}function a46_0x399d(_0x10f1e5,_0x58212c){_0x10f1e5=_0x10f1e5-0x169;const _0x521f3b=a46_0x521f();let _0x399deb=_0x521f3b[_0x10f1e5];return _0x399deb;}import{createProfileCache}from'../utils/global-cache.js';const connectionCache=createProfileCache(a46_0x50a5ef(0x16f),a46_0x50a5ef(0x16e));export function loadCachedConnections(_0x5b9c47){const _0x345e41=a46_0x50a5ef,_0x321de6=connectionCache[_0x345e41(0x173)](_0x5b9c47);return _0x321de6?.['connections']??null;}export function saveCachedConnections(_0x641f72,_0x2666a8){const _0x4093a7=a46_0x50a5ef;connectionCache['write'](_0x641f72,{'connections':_0x2666a8,'cachedAt':Date[_0x4093a7(0x171)]()});}export function clearConnectionCache(_0x125f26){const _0x5f4226=a46_0x50a5ef;connectionCache[_0x5f4226(0x16c)](_0x125f26);}
1
+ const a47_0x10deaf=a47_0x4ca3;(function(_0x4fc60b,_0x18d387){const _0x478484=a47_0x4ca3,_0x3365c9=_0x4fc60b();while(!![]){try{const _0x36fab4=-parseInt(_0x478484(0x156))/0x1+-parseInt(_0x478484(0x154))/0x2+parseInt(_0x478484(0x15a))/0x3+-parseInt(_0x478484(0x159))/0x4*(parseInt(_0x478484(0x158))/0x5)+parseInt(_0x478484(0x15d))/0x6+parseInt(_0x478484(0x160))/0x7*(parseInt(_0x478484(0x155))/0x8)+-parseInt(_0x478484(0x152))/0x9*(-parseInt(_0x478484(0x15f))/0xa);if(_0x36fab4===_0x18d387)break;else _0x3365c9['push'](_0x3365c9['shift']());}catch(_0x512686){_0x3365c9['push'](_0x3365c9['shift']());}}}(a47_0x2cc2,0xcd458));function a47_0x2cc2(){const _0x6026a=['7uApzeS','connections','core/connection-cache','1048266sVINDq','read','139622KVPLAB','10776680WoZfDs','1439076xsFyaa','connections-{profile}.json','5rxAgri','418428rTxWZb','1173588OtnHBf','write','clear','2199498mrZkKo','now','30KvDVDX'];a47_0x2cc2=function(){return _0x6026a;};return a47_0x2cc2();}function a47_0x4ca3(_0x54ed03,_0x49d9e1){_0x54ed03=_0x54ed03-0x151;const _0x2cc2fc=a47_0x2cc2();let _0x4ca3bd=_0x2cc2fc[_0x54ed03];return _0x4ca3bd;}import{createProfileCache}from'../utils/global-cache.js';const connectionCache=createProfileCache(a47_0x10deaf(0x157),a47_0x10deaf(0x151));export function loadCachedConnections(_0x566093){const _0x344c96=a47_0x10deaf,_0xbcc0c=connectionCache[_0x344c96(0x153)](_0x566093);return _0xbcc0c?.[_0x344c96(0x161)]??null;}export function saveCachedConnections(_0x258de4,_0x31101a){const _0x4a82ed=a47_0x10deaf;connectionCache[_0x4a82ed(0x15b)](_0x258de4,{'connections':_0x31101a,'cachedAt':Date[_0x4a82ed(0x15e)]()});}export function clearConnectionCache(_0x288bd0){const _0x48de42=a47_0x10deaf;connectionCache[_0x48de42(0x15c)](_0x288bd0);}
@@ -1 +1 @@
1
- const a47_0x27e2f8=a47_0x11f6;(function(_0x891bc9,_0x1106b1){const _0x1db1ba=a47_0x11f6,_0x40a0d5=_0x891bc9();while(!![]){try{const _0x527f1b=-parseInt(_0x1db1ba(0xf6))/0x1+-parseInt(_0x1db1ba(0xee))/0x2*(-parseInt(_0x1db1ba(0x101))/0x3)+parseInt(_0x1db1ba(0xfe))/0x4*(parseInt(_0x1db1ba(0xef))/0x5)+parseInt(_0x1db1ba(0xfa))/0x6+parseInt(_0x1db1ba(0xf5))/0x7+parseInt(_0x1db1ba(0xf4))/0x8*(parseInt(_0x1db1ba(0xed))/0x9)+-parseInt(_0x1db1ba(0xf1))/0xa;if(_0x527f1b===_0x1106b1)break;else _0x40a0d5['push'](_0x40a0d5['shift']());}catch(_0x32c2ce){_0x40a0d5['push'](_0x40a0d5['shift']());}}}(a47_0x2ad3,0x1975a));export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;function a47_0x2ad3(){const _0x19c64b=['357CQUfjW','ap02\x20-\x20Korea','1417860fXDSPq','768XOLuYF','39365ougfQk','ap02','1078580yFqJpZ','push','other','8XkjyjQ','622111OsxqEM','102502BVGexy','us01','value','jp\x20\x20\x20-\x20Japan','87960NqyvRb','us\x20\x20\x20-\x20United\x20States','jp01','number','4THVjXE','eu\x20\x20\x20-\x20Europe','eu01'];a47_0x2ad3=function(){return _0x19c64b;};return a47_0x2ad3();}function a47_0x11f6(_0x589fcd,_0x513c70){_0x589fcd=_0x589fcd-0xec;const _0x2ad387=a47_0x2ad3();let _0x11f65b=_0x2ad387[_0x589fcd];return _0x11f65b;}export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x5e545e,_0x573489){const _0xe7ff8e=a47_0x11f6;if(_0x5e545e===undefined)return _0x573489;if(typeof _0x5e545e===_0xe7ff8e(0xfd))return _0x5e545e;return parseInt(_0x5e545e,0xa);}export const STANDARD_SITE_CHOICES=[{'title':a47_0x27e2f8(0xfb),'value':'us01'},{'title':a47_0x27e2f8(0xf9),'value':a47_0x27e2f8(0xfc)},{'title':a47_0x27e2f8(0xff),'value':a47_0x27e2f8(0x100)},{'title':a47_0x27e2f8(0xec),'value':a47_0x27e2f8(0xf0)}];export function buildSiteChoices(_0x3ebafa){const _0xb3115a=a47_0x27e2f8,_0x672e4d=[...STANDARD_SITE_CHOICES];let _0x17007c=_0x672e4d['findIndex'](_0x34143d=>_0x34143d[_0xb3115a(0xf8)]===_0x3ebafa);return _0x17007c===-0x1&&_0x3ebafa!==_0xb3115a(0xf7)&&(_0x672e4d[_0xb3115a(0xf2)]({'title':_0x3ebafa,'value':_0x3ebafa}),_0x17007c=_0x672e4d['length']-0x1),_0x672e4d[_0xb3115a(0xf2)]({'title':'Enter\x20custom\x20site','value':_0xb3115a(0xf3)}),{'choices':_0x672e4d,'initialIndex':_0x17007c>=0x0?_0x17007c:0x0};}
1
+ const a48_0x4fbba9=a48_0x40b4;(function(_0x3dd131,_0x4bad00){const _0x1af266=a48_0x40b4,_0xbf8000=_0x3dd131();while(!![]){try{const _0x2c82c6=-parseInt(_0x1af266(0x168))/0x1+-parseInt(_0x1af266(0x15e))/0x2*(-parseInt(_0x1af266(0x171))/0x3)+-parseInt(_0x1af266(0x167))/0x4+-parseInt(_0x1af266(0x170))/0x5+parseInt(_0x1af266(0x163))/0x6*(parseInt(_0x1af266(0x15f))/0x7)+parseInt(_0x1af266(0x164))/0x8*(parseInt(_0x1af266(0x16e))/0x9)+-parseInt(_0x1af266(0x16a))/0xa;if(_0x2c82c6===_0x4bad00)break;else _0xbf8000['push'](_0xbf8000['shift']());}catch(_0x54d54f){_0xbf8000['push'](_0xbf8000['shift']());}}}(a48_0x385b,0x5c76d));export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;function a48_0x385b(){const _0x93e84d=['ap02','eu\x20\x20\x20-\x20Europe','279TjSftg','us\x20\x20\x20-\x20United\x20States','1309290bElkUT','534ZYIxdv','number','other','jp01','4764YfOmon','3379222hiurxk','push','ap02\x20-\x20Korea','findIndex','6MMQEzV','113584zuaWKx','jp\x20\x20\x20-\x20Japan','us01','139848ALoAJm','524320IfdHin','eu01','1470070eRBBmf','length'];a48_0x385b=function(){return _0x93e84d;};return a48_0x385b();}function a48_0x40b4(_0xf377c0,_0xbb4959){_0xf377c0=_0xf377c0-0x15c;const _0x385b3e=a48_0x385b();let _0x40b43c=_0x385b3e[_0xf377c0];return _0x40b43c;}export function resolveLimit(_0xebce1e,_0x2daaa3){const _0x431731=a48_0x40b4;if(_0xebce1e===undefined)return _0x2daaa3;if(typeof _0xebce1e===_0x431731(0x172))return _0xebce1e;return parseInt(_0xebce1e,0xa);}export const STANDARD_SITE_CHOICES=[{'title':a48_0x4fbba9(0x16f),'value':a48_0x4fbba9(0x166)},{'title':a48_0x4fbba9(0x165),'value':a48_0x4fbba9(0x15d)},{'title':a48_0x4fbba9(0x16d),'value':a48_0x4fbba9(0x169)},{'title':a48_0x4fbba9(0x161),'value':a48_0x4fbba9(0x16c)}];export function buildSiteChoices(_0x4d43b2){const _0x12fade=a48_0x4fbba9,_0x4584f9=[...STANDARD_SITE_CHOICES];let _0x319579=_0x4584f9[_0x12fade(0x162)](_0x4c7fef=>_0x4c7fef['value']===_0x4d43b2);return _0x319579===-0x1&&_0x4d43b2!==_0x12fade(0x166)&&(_0x4584f9[_0x12fade(0x160)]({'title':_0x4d43b2,'value':_0x4d43b2}),_0x319579=_0x4584f9[_0x12fade(0x16b)]-0x1),_0x4584f9[_0x12fade(0x160)]({'title':'Enter\x20custom\x20site','value':_0x12fade(0x15c)}),{'choices':_0x4584f9,'initialIndex':_0x319579>=0x0?_0x319579:0x0};}
@@ -1 +1 @@
1
- (function(_0x2cb380,_0x10da3c){const _0x214489=a48_0x20e4,_0x4bb495=_0x2cb380();while(!![]){try{const _0x1295ff=parseInt(_0x214489(0x17e))/0x1+-parseInt(_0x214489(0x181))/0x2+-parseInt(_0x214489(0x189))/0x3*(-parseInt(_0x214489(0x182))/0x4)+-parseInt(_0x214489(0x18a))/0x5+-parseInt(_0x214489(0x180))/0x6*(parseInt(_0x214489(0x17d))/0x7)+-parseInt(_0x214489(0x18b))/0x8+-parseInt(_0x214489(0x187))/0x9*(-parseInt(_0x214489(0x17c))/0xa);if(_0x1295ff===_0x10da3c)break;else _0x4bb495['push'](_0x4bb495['shift']());}catch(_0x45f09d){_0x4bb495['push'](_0x4bb495['shift']());}}}(a48_0x5cc4,0x6c47f));function a48_0x20e4(_0x2f9c56,_0x22d3aa){_0x2f9c56=_0x2f9c56-0x17c;const _0x5cc443=a48_0x5cc4();let _0x20e420=_0x5cc443[_0x2f9c56];return _0x20e420;}const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x24c280,_0x197a43){const _0x36b61c=a48_0x20e4,_0x48d8b7=_0x24c280||_0x36b61c(0x184),_0x18feef=_0x197a43||_0x36b61c(0x185);return _0x48d8b7+':'+_0x18feef;}function a48_0x5cc4(){const _0x686e23=['__default_profile__','loadedAt','28791NiVAug','get','3NeTraE','850075qQRcmh','6592576kwrBjR','apiKey','now','6710UaDnQt','5579021QygMJr','372592jqvSyZ','set','6GDKvNP','1489234TGVkGZ','1840420aVEdeI','delete','__default_site__'];a48_0x5cc4=function(){return _0x686e23;};return a48_0x5cc4();}export function getCachedCredential(_0x4bcf94,_0x17cca8){const _0x50f670=a48_0x20e4,_0x45e60f=getCacheKey(_0x4bcf94,_0x17cca8),_0x1a92b0=cache[_0x50f670(0x188)](_0x45e60f);if(!_0x1a92b0)return null;if(Date[_0x50f670(0x18d)]()-_0x1a92b0[_0x50f670(0x186)]>CACHE_TTL_MS)return cache['delete'](_0x45e60f),null;return _0x1a92b0[_0x50f670(0x18c)];}export function setCachedCredential(_0x49a442,_0x2ee99b,_0xecafb6){const _0x26cfe0=a48_0x20e4,_0xad2a13=getCacheKey(_0x2ee99b,_0xecafb6);cache[_0x26cfe0(0x17f)](_0xad2a13,{'apiKey':_0x49a442,'loadedAt':Date[_0x26cfe0(0x18d)]()});}export function clearCredentialCache(){cache['clear']();}export function clearCachedCredential(_0x2949bd,_0x4f49a4){const _0x2e3c36=a48_0x20e4,_0x208bfb=getCacheKey(_0x2949bd,_0x4f49a4);cache[_0x2e3c36(0x183)](_0x208bfb);}
1
+ (function(_0xd93918,_0x14602f){const _0x48f492=a49_0x4157,_0x3e2b05=_0xd93918();while(!![]){try{const _0x20d11d=-parseInt(_0x48f492(0x196))/0x1+-parseInt(_0x48f492(0x19d))/0x2*(parseInt(_0x48f492(0x19a))/0x3)+parseInt(_0x48f492(0x19f))/0x4*(-parseInt(_0x48f492(0x192))/0x5)+parseInt(_0x48f492(0x19c))/0x6*(-parseInt(_0x48f492(0x193))/0x7)+-parseInt(_0x48f492(0x194))/0x8+parseInt(_0x48f492(0x19b))/0x9+parseInt(_0x48f492(0x195))/0xa;if(_0x20d11d===_0x14602f)break;else _0x3e2b05['push'](_0x3e2b05['shift']());}catch(_0x2daff8){_0x3e2b05['push'](_0x3e2b05['shift']());}}}(a49_0x3b91,0x24219));function a49_0x4157(_0x77598d,_0x44ea00){_0x77598d=_0x77598d-0x191;const _0x3b91a1=a49_0x3b91();let _0x4157cb=_0x3b91a1[_0x77598d];return _0x4157cb;}const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x1eca21,_0x11834c){const _0x484594=a49_0x4157,_0x32719d=_0x1eca21||_0x484594(0x198),_0x5b4a9c=_0x11834c||_0x484594(0x191);return _0x32719d+':'+_0x5b4a9c;}export function getCachedCredential(_0x1dec99,_0x54fc0e){const _0x510655=a49_0x4157,_0x16972e=getCacheKey(_0x1dec99,_0x54fc0e),_0x4c5d2c=cache[_0x510655(0x199)](_0x16972e);if(!_0x4c5d2c)return null;if(Date[_0x510655(0x19e)]()-_0x4c5d2c['loadedAt']>CACHE_TTL_MS)return cache[_0x510655(0x197)](_0x16972e),null;return _0x4c5d2c['apiKey'];}export function setCachedCredential(_0x448321,_0x3fb19b,_0xd58b96){const _0x4c3d42=a49_0x4157,_0x43d4c1=getCacheKey(_0x3fb19b,_0xd58b96);cache['set'](_0x43d4c1,{'apiKey':_0x448321,'loadedAt':Date[_0x4c3d42(0x19e)]()});}export function clearCredentialCache(){cache['clear']();}export function clearCachedCredential(_0xb16a67,_0xe7825f){const _0x42e736=a49_0x4157,_0x5d8601=getCacheKey(_0xb16a67,_0xe7825f);cache[_0x42e736(0x197)](_0x5d8601);}function a49_0x3b91(){const _0x255491=['1225611OFHPVC','143790Ztyxck','10776xCTAdv','now','317416JAjFbl','__default_profile__','15UZQJCw','35exXbIN','346256wgfFSg','4889640pWqfMD','27489amvGKc','delete','__default_site__','get','27VBvbvz'];a49_0x3b91=function(){return _0x255491;};return a49_0x3b91();}
@@ -1 +1 @@
1
- const a49_0x54053b=a49_0x3638;(function(_0x571a6b,_0x1ec3b1){const _0x285494=a49_0x3638,_0x35446e=_0x571a6b();while(!![]){try{const _0x2225a1=-parseInt(_0x285494(0x97))/0x1+-parseInt(_0x285494(0xa1))/0x2+-parseInt(_0x285494(0x93))/0x3+parseInt(_0x285494(0xb7))/0x4*(parseInt(_0x285494(0x99))/0x5)+parseInt(_0x285494(0x88))/0x6+parseInt(_0x285494(0xa2))/0x7*(-parseInt(_0x285494(0x7b))/0x8)+parseInt(_0x285494(0x87))/0x9;if(_0x2225a1===_0x1ec3b1)break;else _0x35446e['push'](_0x35446e['shift']());}catch(_0x4d00ad){_0x35446e['push'](_0x35446e['shift']());}}}(a49_0x198f,0xb0f32));import{resolveSite,getAPIKey,getAPIKeyAsync,getConfigDir}from'./config.js';import{loadSessionContext,getCurrentSessionPID}from'./session.js';function a49_0x3638(_0x1a92bf,_0x2d9afb){_0x1a92bf=_0x1a92bf-0x73;const _0x198fbe=a49_0x198f();let _0x36384e=_0x198fbe[_0x1a92bf];return _0x36384e;}import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';import{getActiveProfile,loadProfile}from'./profile.js';import{LogLevel}from'../utils/logger/index.js';import*as a49_0x10982c from'node:fs';import*as a49_0x311170 from'node:path';function a49_0x198f(){const _0x276799=['apiKey','getSource','join','loadGlobalConfig','logLevel','220581CfsXqB','llmProject','default','segment_path','849389UkQGjk','tdx.json','10TCoZTB','Project','existsSync','activeProfile','sessionId','(active)','getParameters','sessions','2182020bkkGdx','122416SxwXcY','llm_project','displayWithSources','cliFlags','parent_segment','Profile\x20Credentials','env','readFileSync','assign','.json','INFO','global','profileCredentials','database','parentSegment','us01','injectIntoOptions','workflowProject','configFiles','bold','createAsync','2192628dAlneK','log','Profile','none','resolveAPIKeyAsync','(using\x20session:\x20','segmentPath','profile','entries','llm_agent','Global','site','replace','workflow_project','216aMNZTJ','[context]','Session','dim','project','cyan','session','[configuration\x20files]','.env','verbose','utf-8','not\x20set','13463091OdNFZV','3712050jbCTgG','CLI\x20flag:\x20--','llmAgent','profile:\x20','green','layers'];a49_0x198f=function(){return _0x276799;};return a49_0x198f();}import a49_0xff4bf1 from'chalk';export class GlobalContext{[a49_0x54053b(0x78)];[a49_0x54053b(0xaf)];[a49_0x54053b(0xa6)];[a49_0x54053b(0x96)];[a49_0x54053b(0xa3)];[a49_0x54053b(0x76)];['workflow_project'];['apiKey'];[a49_0x54053b(0x84)];[a49_0x54053b(0x92)];[a49_0x54053b(0x74)];[a49_0x54053b(0x8d)];[a49_0x54053b(0x9c)];[a49_0x54053b(0x9d)];[a49_0x54053b(0xb4)];constructor(_0x187f76){const _0x113441=a49_0x54053b;this[_0x113441(0x9d)]=_0x187f76[_0x113441(0x81)]||getCurrentSessionPID()['toString']();const _0x3bab3f=loadSessionContext(_0x187f76['session']),_0x48a77e=loadProjectConfig(),_0x5229c7=this[_0x113441(0x91)]();this[_0x113441(0x9c)]=_0x187f76[_0x113441(0x74)]||_0x3bab3f?.[_0x113441(0x74)]||_0x5229c7['profile']||getActiveProfile();const _0x412b0a=this['activeProfile']?loadProfile(this[_0x113441(0x9c)]):null,_0x4a3e2d=_0x407506=>{const _0x3e121a=_0x113441;if(!_0x407506)return{};const _0x4195c2=_0x407506,_0x3e59e2={};for(const [_0x3b73bc,_0x10dd82]of Object[_0x3e121a(0x75)](_0x4195c2)){typeof _0x10dd82==='string'&&(_0x3e59e2[_0x3b73bc]=_0x10dd82);}return _0x3e59e2;},_0x1e3120={},_0x29750f=(_0x16e875,_0x3a5991,_0x1df1e8)=>{if(!_0x16e875)return![];if(_0x1df1e8&&_0x16e875===_0x1df1e8)return![];const _0x17a472=_0x3bab3f,_0x2ff6f4=_0x48a77e,_0x3efa1f=_0x412b0a?.['config'],_0x38c601=_0x5229c7,_0x5d0d81=_0x17a472?.[_0x3a5991],_0x283eae=_0x2ff6f4?.[_0x3a5991],_0x58ee8c=_0x3efa1f?.[_0x3a5991],_0x4842e5=_0x38c601[_0x3a5991];return _0x16e875!==_0x5d0d81&&_0x16e875!==_0x283eae&&_0x16e875!==_0x58ee8c&&_0x16e875!==_0x4842e5;},_0x27e884=[{'optionKey':_0x113441(0x78),'contextKey':_0x113441(0x78),'defaultValue':_0x113441(0xb1)},{'optionKey':_0x113441(0xaf),'contextKey':_0x113441(0xaf)},{'optionKey':_0x113441(0xb0),'contextKey':_0x113441(0xa6)},{'optionKey':_0x113441(0x94),'contextKey':_0x113441(0xa3)},{'optionKey':_0x113441(0x8a),'contextKey':_0x113441(0x76)},{'optionKey':_0x113441(0x74),'contextKey':'profile'}];for(const {optionKey:_0x138508,contextKey:_0x44f4a2,defaultValue:_0x361e2e}of _0x27e884){const _0x38ed2a=_0x187f76[_0x138508];_0x29750f(_0x38ed2a,_0x44f4a2,_0x361e2e)&&(_0x1e3120[_0x44f4a2]=_0x38ed2a);}this[_0x113441(0x8d)]={'cliFlags':_0x1e3120,'session':_0x4a3e2d(_0x3bab3f),'project':_0x4a3e2d(_0x48a77e),'profile':_0x4a3e2d(_0x412b0a?.['config']),'global':_0x4a3e2d(_0x5229c7)};const _0x242140={...this[_0x113441(0x8d)][_0x113441(0xad)],...this[_0x113441(0x8d)][_0x113441(0x74)],...this['layers'][_0x113441(0x7f)]};process['env']['TDX_SITE']&&!this['layers'][_0x113441(0x81)][_0x113441(0x78)]&&!this[_0x113441(0x8d)][_0x113441(0xa5)][_0x113441(0x78)]&&(_0x242140['site']=process[_0x113441(0xa8)]['TDX_SITE']);Object[_0x113441(0xaa)](_0x242140,this[_0x113441(0x8d)][_0x113441(0x81)]),Object[_0x113441(0xaa)](_0x242140,this[_0x113441(0x8d)][_0x113441(0xa5)]);const _0x46ccab=_0x242140[_0x113441(0x78)]||'us01';this['site']=resolveSite(_0x46ccab),this[_0x113441(0xaf)]=_0x242140[_0x113441(0xaf)],this[_0x113441(0xa6)]=_0x242140['parent_segment'],this[_0x113441(0x96)]=_0x242140[_0x113441(0x96)],this['llm_project']=_0x242140[_0x113441(0xa3)],this[_0x113441(0x76)]=_0x242140['llm_agent'],this[_0x113441(0x7a)]=_0x242140[_0x113441(0x7a)],this[_0x113441(0x84)]=_0x187f76[_0x113441(0x84)]||![],this[_0x113441(0x92)]=_0x187f76[_0x113441(0x92)]??LogLevel[_0x113441(0xac)],this[_0x113441(0x74)]=this['activeProfile']||undefined,this[_0x113441(0x8e)]=getAPIKey(this[_0x113441(0x78)],this['activeProfile']||undefined);const _0x121832=getConfigDir(),_0x130536=a49_0x311170['join'](_0x121832,_0x113441(0xa0),this[_0x113441(0x9d)]+_0x113441(0xab)),_0x481b0a=findProjectConfigPath(),_0x3dcb04=a49_0x311170['join'](_0x121832,_0x113441(0x98)),_0x3842ef=a49_0x311170[_0x113441(0x90)](_0x121832,'.env');let _0xbceadf=null,_0x2b1743=null;this[_0x113441(0x9c)]&&(_0xbceadf=a49_0x311170['join'](_0x121832,'profiles',this[_0x113441(0x9c)],_0x113441(0x98)),_0x2b1743=a49_0x311170[_0x113441(0x90)](_0x121832,'profiles',this[_0x113441(0x9c)],_0x113441(0x83))),this[_0x113441(0xb4)]={'session':a49_0x10982c[_0x113441(0x9b)](_0x130536)?_0x130536:null,'project':_0x481b0a,'profile':_0xbceadf&&a49_0x10982c[_0x113441(0x9b)](_0xbceadf)?_0xbceadf:null,'profileCredentials':_0x2b1743&&a49_0x10982c[_0x113441(0x9b)](_0x2b1743)?_0x2b1743:null,'global':a49_0x10982c[_0x113441(0x9b)](_0x3dcb04)?_0x3dcb04:null,'globalCredentials':a49_0x10982c[_0x113441(0x9b)](_0x3842ef)?_0x3842ef:null};}[a49_0x54053b(0x8f)](_0x382739,_0x2d2636){const _0x4f83c7=a49_0x54053b;if(!_0x2d2636)return _0x4f83c7(0x86);const _0xd633bd=_0x2d2636;if(this[_0x4f83c7(0x8d)]['cliFlags'][_0x382739]===_0xd633bd){if(_0x382739===_0x4f83c7(0x78)&&_0xd633bd===_0x4f83c7(0xb1)&&!this[_0x4f83c7(0x8d)][_0x4f83c7(0x81)][_0x4f83c7(0x78)]&&!this[_0x4f83c7(0x8d)]['project'][_0x4f83c7(0x78)]&&!this['layers'][_0x4f83c7(0x74)]['site']&&!this[_0x4f83c7(0x8d)][_0x4f83c7(0xad)]['site'])return _0x4f83c7(0x95);return _0x4f83c7(0x89)+_0x382739[_0x4f83c7(0x79)](/_/g,'-');}if(this[_0x4f83c7(0x8d)][_0x4f83c7(0x81)][_0x382739]===_0xd633bd)return'session';if(this['layers']['project'][_0x382739]===_0xd633bd)return _0x4f83c7(0x7f);if(this[_0x4f83c7(0x8d)][_0x4f83c7(0x74)][_0x382739]===_0xd633bd)return _0x4f83c7(0x8b)+this['activeProfile'];if(this['layers']['global'][_0x382739]===_0xd633bd)return _0x4f83c7(0xad);return _0x4f83c7(0x95);}[a49_0x54053b(0x91)](){const _0xaf46dd=a49_0x54053b,_0x3f908e=a49_0x311170[_0xaf46dd(0x90)](getConfigDir(),'tdx.json');if(!a49_0x10982c[_0xaf46dd(0x9b)](_0x3f908e))return{};try{const _0x155582=a49_0x10982c[_0xaf46dd(0xa9)](_0x3f908e,_0xaf46dd(0x85));return JSON['parse'](_0x155582);}catch{return{};}}[a49_0x54053b(0xb2)](_0x2c6fd6){const _0x1f783c=a49_0x54053b;_0x2c6fd6[_0x1f783c(0x78)]=this[_0x1f783c(0x78)],!_0x2c6fd6[_0x1f783c(0xaf)]&&this[_0x1f783c(0xaf)]&&(_0x2c6fd6[_0x1f783c(0xaf)]=this[_0x1f783c(0xaf)]),!_0x2c6fd6[_0x1f783c(0xb0)]&&this[_0x1f783c(0xa6)]&&(_0x2c6fd6['parentSegment']=this['parent_segment']),!_0x2c6fd6['segmentPath']&&this[_0x1f783c(0x96)]&&(_0x2c6fd6[_0x1f783c(0x73)]=this[_0x1f783c(0x96)]),!_0x2c6fd6[_0x1f783c(0x94)]&&this[_0x1f783c(0xa3)]&&(_0x2c6fd6[_0x1f783c(0x94)]=this[_0x1f783c(0xa3)]),!_0x2c6fd6[_0x1f783c(0x8a)]&&this[_0x1f783c(0x76)]&&(_0x2c6fd6[_0x1f783c(0x8a)]=this['llm_agent']),!_0x2c6fd6['workflowProject']&&this[_0x1f783c(0x7a)]&&(_0x2c6fd6[_0x1f783c(0xb3)]=this[_0x1f783c(0x7a)]);}['getParameters'](){const _0x9f17ef=a49_0x54053b;return[{'key':_0x9f17ef(0x78),'value':this['site']},{'key':_0x9f17ef(0xaf),'value':this[_0x9f17ef(0xaf)]},{'key':'parent_segment','value':this[_0x9f17ef(0xa6)]},{'key':_0x9f17ef(0x96),'value':this[_0x9f17ef(0x96)]},{'key':'llm_project','value':this[_0x9f17ef(0xa3)]},{'key':_0x9f17ef(0x76),'value':this[_0x9f17ef(0x76)]},{'key':_0x9f17ef(0x7a),'value':this['workflow_project']},{'key':_0x9f17ef(0x74),'value':this[_0x9f17ef(0x9c)]||undefined}];}['display'](){const _0x12730b=a49_0x54053b;console[_0x12730b(0xb8)](a49_0xff4bf1[_0x12730b(0xb5)](_0x12730b(0x7c)));for(const {key:_0x19bf06,value:_0x3b9d2d}of this[_0x12730b(0x9f)]()){_0x3b9d2d&&console['log'](a49_0xff4bf1[_0x12730b(0x80)](_0x19bf06)+':\x20'+_0x3b9d2d);}}[a49_0x54053b(0xa4)](){const _0x4ee14f=a49_0x54053b;console['log'](a49_0xff4bf1[_0x4ee14f(0xb5)]('[context]'));for(const {key:_0x3648ee,value:_0x4cabb2}of this[_0x4ee14f(0x9f)]()){if(_0x4cabb2){const _0x5dfc42=_0x3648ee==='profile'?_0x4ee14f(0x9e):'('+this[_0x4ee14f(0x8f)](_0x3648ee,_0x4cabb2)+')';console['log'](a49_0xff4bf1['cyan'](_0x3648ee)+':\x20'+_0x4cabb2+'\x20'+a49_0xff4bf1[_0x4ee14f(0x7e)](_0x5dfc42));}}console[_0x4ee14f(0xb8)]('\x0a'+a49_0xff4bf1[_0x4ee14f(0xb5)](_0x4ee14f(0x82)));const _0x2557ce=[{'label':_0x4ee14f(0x7d),'path':this[_0x4ee14f(0xb4)][_0x4ee14f(0x81)],'extra':'(session:\x20'+this['sessionId']+')'},{'label':'Project','path':this[_0x4ee14f(0xb4)]['project']},{'label':_0x4ee14f(0xb9),'path':this['configFiles']['profile']},{'label':_0x4ee14f(0xa7),'path':this[_0x4ee14f(0xb4)][_0x4ee14f(0xae)]},{'label':_0x4ee14f(0x77),'path':this[_0x4ee14f(0xb4)][_0x4ee14f(0xad)]},{'label':'Global\x20Credentials','path':this[_0x4ee14f(0xb4)]['globalCredentials']}];for(const {label:_0x36a671,path:_0xac135d,extra:_0x24cfc8}of _0x2557ce){if(_0xac135d)console[_0x4ee14f(0xb8)](a49_0xff4bf1['cyan'](_0x36a671)+':\x20'+_0xac135d+'\x20'+a49_0xff4bf1[_0x4ee14f(0x8c)]('✓')+(_0x24cfc8?'\x20'+a49_0xff4bf1[_0x4ee14f(0x7e)](_0x24cfc8):''));else{if(_0x36a671===_0x4ee14f(0x7d))console[_0x4ee14f(0xb8)](a49_0xff4bf1[_0x4ee14f(0x80)](_0x36a671)+':\x20'+a49_0xff4bf1['dim'](_0x4ee14f(0xba))+'\x20'+a49_0xff4bf1['dim'](_0x4ee14f(0xbc)+this[_0x4ee14f(0x9d)]+')'));else(_0x36a671===_0x4ee14f(0x9a)||_0x36a671==='Global')&&console[_0x4ee14f(0xb8)](a49_0xff4bf1[_0x4ee14f(0x80)](_0x36a671)+':\x20'+a49_0xff4bf1[_0x4ee14f(0x7e)](_0x4ee14f(0xba)));}}}async[a49_0x54053b(0xbb)](){const _0x1b51d0=a49_0x54053b;return this[_0x1b51d0(0x8e)]=await getAPIKeyAsync(this[_0x1b51d0(0x78)],this[_0x1b51d0(0x9c)]||undefined),this[_0x1b51d0(0x8e)];}static async[a49_0x54053b(0xb6)](_0x251147){const _0x4dfaba=a49_0x54053b,_0x2410f8=new GlobalContext(_0x251147);return await _0x2410f8[_0x4dfaba(0xbb)](),_0x2410f8;}}
1
+ const a50_0x22e732=a50_0x3a72;(function(_0x5945bd,_0x11c34f){const _0x567e55=a50_0x3a72,_0x8c7a62=_0x5945bd();while(!![]){try{const _0x3f6d74=-parseInt(_0x567e55(0xf5))/0x1*(parseInt(_0x567e55(0x128))/0x2)+-parseInt(_0x567e55(0x11e))/0x3*(-parseInt(_0x567e55(0x11f))/0x4)+parseInt(_0x567e55(0x125))/0x5+parseInt(_0x567e55(0x105))/0x6*(parseInt(_0x567e55(0x133))/0x7)+-parseInt(_0x567e55(0x117))/0x8*(parseInt(_0x567e55(0x102))/0x9)+-parseInt(_0x567e55(0xfb))/0xa+-parseInt(_0x567e55(0x111))/0xb;if(_0x3f6d74===_0x11c34f)break;else _0x8c7a62['push'](_0x8c7a62['shift']());}catch(_0x274a6a){_0x8c7a62['push'](_0x8c7a62['shift']());}}}(a50_0x2ae2,0xbe340));function a50_0x2ae2(){const _0x390d11=['log','1707JWcLvI','956GkVAVF','profile','Session','(session:\x20','TDX_SITE','injectIntoOptions','6099295DNLMOt','logLevel','[context]','2tdUlIZ','bold','none','Project','replace','existsSync','utf-8','segmentPath','session','tdx.json','(using\x20session:\x20','22729OUAsdc','[configuration\x20files]','workflowProject','display','activeProfile','assign','getParameters','us01','profiles','segment_path','sessionId','563740wpJplF','apiKey','sessions','parent_segment','default','.env','282880DnYDbB','cyan','not\x20set','parse','(active)','config','llmProject','369iVqgoj','Profile','llm_agent','1704sudTiz','join','database','layers','loadGlobalConfig','getSource','entries','string','parentSegment','Global','project','configFiles','8217429SbFoRC','site','llm_project','cliFlags','dim','profile:\x20','31192AlTZbK','llmAgent','verbose','global','globalCredentials','workflow_project'];a50_0x2ae2=function(){return _0x390d11;};return a50_0x2ae2();}import{resolveSite,getAPIKey,getAPIKeyAsync,getConfigDir}from'./config.js';import{loadSessionContext,getCurrentSessionPID}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';import{getActiveProfile,loadProfile}from'./profile.js';import{LogLevel}from'../utils/logger/index.js';import*as a50_0x5e6b18 from'node:fs';function a50_0x3a72(_0x4a2d84,_0x2dcfeb){_0x4a2d84=_0x4a2d84-0xf4;const _0x2ae2b7=a50_0x2ae2();let _0x3a723a=_0x2ae2b7[_0x4a2d84];return _0x3a723a;}import*as a50_0x23217b from'node:path';import a50_0x8db492 from'chalk';export class GlobalContext{[a50_0x22e732(0x112)];['database'];[a50_0x22e732(0xf8)];[a50_0x22e732(0x13c)];[a50_0x22e732(0x113)];[a50_0x22e732(0x104)];[a50_0x22e732(0x11c)];[a50_0x22e732(0xf6)];[a50_0x22e732(0x119)];[a50_0x22e732(0x126)];[a50_0x22e732(0x120)];[a50_0x22e732(0x108)];[a50_0x22e732(0x137)];[a50_0x22e732(0xf4)];['configFiles'];constructor(_0x1a350d){const _0x12c7d2=a50_0x22e732;this['sessionId']=_0x1a350d[_0x12c7d2(0x130)]||getCurrentSessionPID()['toString']();const _0x9cedd7=loadSessionContext(_0x1a350d['session']),_0x5b578f=loadProjectConfig(),_0x1df388=this[_0x12c7d2(0x109)]();this[_0x12c7d2(0x137)]=_0x1a350d[_0x12c7d2(0x120)]||_0x9cedd7?.[_0x12c7d2(0x120)]||_0x1df388['profile']||getActiveProfile();const _0x15dddc=this[_0x12c7d2(0x137)]?loadProfile(this[_0x12c7d2(0x137)]):null,_0x34ca2e=_0x221e04=>{const _0x4003a6=_0x12c7d2;if(!_0x221e04)return{};const _0x47458a=_0x221e04,_0x8aff9b={};for(const [_0x3cfa33,_0x17b4ac]of Object[_0x4003a6(0x10b)](_0x47458a)){typeof _0x17b4ac===_0x4003a6(0x10c)&&(_0x8aff9b[_0x3cfa33]=_0x17b4ac);}return _0x8aff9b;},_0x31547c={},_0x456a4b=(_0x5a307c,_0x3026f8,_0x1d89b8)=>{const _0x43e2b4=_0x12c7d2;if(!_0x5a307c)return![];if(_0x1d89b8&&_0x5a307c===_0x1d89b8)return![];const _0x380019=_0x9cedd7,_0x2cc35e=_0x5b578f,_0x13bc4b=_0x15dddc?.[_0x43e2b4(0x100)],_0x4f097a=_0x1df388,_0x2eb4b8=_0x380019?.[_0x3026f8],_0x1fb6a8=_0x2cc35e?.[_0x3026f8],_0x4144ce=_0x13bc4b?.[_0x3026f8],_0x304bef=_0x4f097a[_0x3026f8];return _0x5a307c!==_0x2eb4b8&&_0x5a307c!==_0x1fb6a8&&_0x5a307c!==_0x4144ce&&_0x5a307c!==_0x304bef;},_0x5a5a32=[{'optionKey':'site','contextKey':_0x12c7d2(0x112),'defaultValue':_0x12c7d2(0x13a)},{'optionKey':'database','contextKey':_0x12c7d2(0x107)},{'optionKey':'parentSegment','contextKey':_0x12c7d2(0xf8)},{'optionKey':_0x12c7d2(0x101),'contextKey':_0x12c7d2(0x113)},{'optionKey':_0x12c7d2(0x118),'contextKey':_0x12c7d2(0x104)},{'optionKey':_0x12c7d2(0x120),'contextKey':_0x12c7d2(0x120)}];for(const {optionKey:_0x1e52a0,contextKey:_0x2c53e2,defaultValue:_0x13d6da}of _0x5a5a32){const _0x599121=_0x1a350d[_0x1e52a0];_0x456a4b(_0x599121,_0x2c53e2,_0x13d6da)&&(_0x31547c[_0x2c53e2]=_0x599121);}this[_0x12c7d2(0x108)]={'cliFlags':_0x31547c,'session':_0x34ca2e(_0x9cedd7),'project':_0x34ca2e(_0x5b578f),'profile':_0x34ca2e(_0x15dddc?.[_0x12c7d2(0x100)]),'global':_0x34ca2e(_0x1df388)};const _0x397d2c={...this[_0x12c7d2(0x108)]['global'],...this['layers']['profile'],...this[_0x12c7d2(0x108)][_0x12c7d2(0x10f)]};process['env'][_0x12c7d2(0x123)]&&!this[_0x12c7d2(0x108)][_0x12c7d2(0x130)]['site']&&!this[_0x12c7d2(0x108)][_0x12c7d2(0x114)][_0x12c7d2(0x112)]&&(_0x397d2c[_0x12c7d2(0x112)]=process['env']['TDX_SITE']);Object[_0x12c7d2(0x138)](_0x397d2c,this[_0x12c7d2(0x108)][_0x12c7d2(0x130)]),Object[_0x12c7d2(0x138)](_0x397d2c,this['layers'][_0x12c7d2(0x114)]);const _0x5b8a6f=_0x397d2c[_0x12c7d2(0x112)]||'us01';this[_0x12c7d2(0x112)]=resolveSite(_0x5b8a6f),this[_0x12c7d2(0x107)]=_0x397d2c[_0x12c7d2(0x107)],this[_0x12c7d2(0xf8)]=_0x397d2c[_0x12c7d2(0xf8)],this[_0x12c7d2(0x13c)]=_0x397d2c[_0x12c7d2(0x13c)],this['llm_project']=_0x397d2c[_0x12c7d2(0x113)],this['llm_agent']=_0x397d2c['llm_agent'],this[_0x12c7d2(0x11c)]=_0x397d2c[_0x12c7d2(0x11c)],this['verbose']=_0x1a350d[_0x12c7d2(0x119)]||![],this[_0x12c7d2(0x126)]=_0x1a350d[_0x12c7d2(0x126)]??LogLevel['INFO'],this[_0x12c7d2(0x120)]=this[_0x12c7d2(0x137)]||undefined,this[_0x12c7d2(0xf6)]=getAPIKey(this[_0x12c7d2(0x112)],this[_0x12c7d2(0x137)]||undefined);const _0x2a244f=getConfigDir(),_0x79d58c=a50_0x23217b[_0x12c7d2(0x106)](_0x2a244f,_0x12c7d2(0xf7),this[_0x12c7d2(0xf4)]+'.json'),_0x450d4a=findProjectConfigPath(),_0x4d3d5d=a50_0x23217b[_0x12c7d2(0x106)](_0x2a244f,_0x12c7d2(0x131)),_0x1b31e5=a50_0x23217b['join'](_0x2a244f,_0x12c7d2(0xfa));let _0x20859a=null,_0x340972=null;this[_0x12c7d2(0x137)]&&(_0x20859a=a50_0x23217b['join'](_0x2a244f,'profiles',this[_0x12c7d2(0x137)],'tdx.json'),_0x340972=a50_0x23217b[_0x12c7d2(0x106)](_0x2a244f,_0x12c7d2(0x13b),this['activeProfile'],_0x12c7d2(0xfa))),this[_0x12c7d2(0x110)]={'session':a50_0x5e6b18[_0x12c7d2(0x12d)](_0x79d58c)?_0x79d58c:null,'project':_0x450d4a,'profile':_0x20859a&&a50_0x5e6b18[_0x12c7d2(0x12d)](_0x20859a)?_0x20859a:null,'profileCredentials':_0x340972&&a50_0x5e6b18['existsSync'](_0x340972)?_0x340972:null,'global':a50_0x5e6b18[_0x12c7d2(0x12d)](_0x4d3d5d)?_0x4d3d5d:null,'globalCredentials':a50_0x5e6b18[_0x12c7d2(0x12d)](_0x1b31e5)?_0x1b31e5:null};}[a50_0x22e732(0x10a)](_0x515243,_0x36e0f8){const _0x2ceee3=a50_0x22e732;if(!_0x36e0f8)return _0x2ceee3(0xfd);const _0x1d78c7=_0x36e0f8;if(this['layers'][_0x2ceee3(0x114)][_0x515243]===_0x1d78c7){if(_0x515243===_0x2ceee3(0x112)&&_0x1d78c7===_0x2ceee3(0x13a)&&!this[_0x2ceee3(0x108)][_0x2ceee3(0x130)][_0x2ceee3(0x112)]&&!this[_0x2ceee3(0x108)][_0x2ceee3(0x10f)][_0x2ceee3(0x112)]&&!this['layers'][_0x2ceee3(0x120)]['site']&&!this[_0x2ceee3(0x108)][_0x2ceee3(0x11a)][_0x2ceee3(0x112)])return _0x2ceee3(0xf9);return'CLI\x20flag:\x20--'+_0x515243[_0x2ceee3(0x12c)](/_/g,'-');}if(this[_0x2ceee3(0x108)][_0x2ceee3(0x130)][_0x515243]===_0x1d78c7)return _0x2ceee3(0x130);if(this['layers'][_0x2ceee3(0x10f)][_0x515243]===_0x1d78c7)return'project';if(this['layers'][_0x2ceee3(0x120)][_0x515243]===_0x1d78c7)return _0x2ceee3(0x116)+this['activeProfile'];if(this[_0x2ceee3(0x108)][_0x2ceee3(0x11a)][_0x515243]===_0x1d78c7)return'global';return _0x2ceee3(0xf9);}[a50_0x22e732(0x109)](){const _0x10437a=a50_0x22e732,_0x4da3b8=a50_0x23217b[_0x10437a(0x106)](getConfigDir(),_0x10437a(0x131));if(!a50_0x5e6b18['existsSync'](_0x4da3b8))return{};try{const _0x448be1=a50_0x5e6b18['readFileSync'](_0x4da3b8,_0x10437a(0x12e));return JSON[_0x10437a(0xfe)](_0x448be1);}catch{return{};}}[a50_0x22e732(0x124)](_0x4823f6){const _0x31192f=a50_0x22e732;_0x4823f6[_0x31192f(0x112)]=this['site'],!_0x4823f6['database']&&this[_0x31192f(0x107)]&&(_0x4823f6[_0x31192f(0x107)]=this[_0x31192f(0x107)]),!_0x4823f6['parentSegment']&&this['parent_segment']&&(_0x4823f6[_0x31192f(0x10d)]=this['parent_segment']),!_0x4823f6[_0x31192f(0x12f)]&&this[_0x31192f(0x13c)]&&(_0x4823f6[_0x31192f(0x12f)]=this[_0x31192f(0x13c)]),!_0x4823f6['llmProject']&&this[_0x31192f(0x113)]&&(_0x4823f6[_0x31192f(0x101)]=this[_0x31192f(0x113)]),!_0x4823f6['llmAgent']&&this[_0x31192f(0x104)]&&(_0x4823f6['llmAgent']=this[_0x31192f(0x104)]),!_0x4823f6[_0x31192f(0x135)]&&this[_0x31192f(0x11c)]&&(_0x4823f6[_0x31192f(0x135)]=this[_0x31192f(0x11c)]);}[a50_0x22e732(0x139)](){const _0x302f6d=a50_0x22e732;return[{'key':_0x302f6d(0x112),'value':this['site']},{'key':'database','value':this[_0x302f6d(0x107)]},{'key':_0x302f6d(0xf8),'value':this[_0x302f6d(0xf8)]},{'key':_0x302f6d(0x13c),'value':this[_0x302f6d(0x13c)]},{'key':_0x302f6d(0x113),'value':this[_0x302f6d(0x113)]},{'key':_0x302f6d(0x104),'value':this[_0x302f6d(0x104)]},{'key':_0x302f6d(0x11c),'value':this['workflow_project']},{'key':_0x302f6d(0x120),'value':this[_0x302f6d(0x137)]||undefined}];}[a50_0x22e732(0x136)](){const _0x4e7146=a50_0x22e732;console[_0x4e7146(0x11d)](a50_0x8db492[_0x4e7146(0x129)](_0x4e7146(0x127)));for(const {key:_0x3faaf9,value:_0xfe9fb9}of this[_0x4e7146(0x139)]()){_0xfe9fb9&&console[_0x4e7146(0x11d)](a50_0x8db492['cyan'](_0x3faaf9)+':\x20'+_0xfe9fb9);}}['displayWithSources'](){const _0x301470=a50_0x22e732;console[_0x301470(0x11d)](a50_0x8db492[_0x301470(0x129)](_0x301470(0x127)));for(const {key:_0x3b5e61,value:_0x14b19e}of this[_0x301470(0x139)]()){if(_0x14b19e){const _0x284c02=_0x3b5e61===_0x301470(0x120)?_0x301470(0xff):'('+this['getSource'](_0x3b5e61,_0x14b19e)+')';console['log'](a50_0x8db492['cyan'](_0x3b5e61)+':\x20'+_0x14b19e+'\x20'+a50_0x8db492[_0x301470(0x115)](_0x284c02));}}console[_0x301470(0x11d)]('\x0a'+a50_0x8db492['bold'](_0x301470(0x134)));const _0x9cb85a=[{'label':_0x301470(0x121),'path':this[_0x301470(0x110)][_0x301470(0x130)],'extra':_0x301470(0x122)+this[_0x301470(0xf4)]+')'},{'label':_0x301470(0x12b),'path':this[_0x301470(0x110)]['project']},{'label':_0x301470(0x103),'path':this[_0x301470(0x110)][_0x301470(0x120)]},{'label':'Profile\x20Credentials','path':this['configFiles']['profileCredentials']},{'label':'Global','path':this[_0x301470(0x110)]['global']},{'label':'Global\x20Credentials','path':this[_0x301470(0x110)][_0x301470(0x11b)]}];for(const {label:_0x5a2c19,path:_0x2161c1,extra:_0x291264}of _0x9cb85a){if(_0x2161c1)console[_0x301470(0x11d)](a50_0x8db492[_0x301470(0xfc)](_0x5a2c19)+':\x20'+_0x2161c1+'\x20'+a50_0x8db492['green']('✓')+(_0x291264?'\x20'+a50_0x8db492[_0x301470(0x115)](_0x291264):''));else{if(_0x5a2c19===_0x301470(0x121))console[_0x301470(0x11d)](a50_0x8db492[_0x301470(0xfc)](_0x5a2c19)+':\x20'+a50_0x8db492[_0x301470(0x115)](_0x301470(0x12a))+'\x20'+a50_0x8db492['dim'](_0x301470(0x132)+this[_0x301470(0xf4)]+')'));else(_0x5a2c19==='Project'||_0x5a2c19===_0x301470(0x10e))&&console[_0x301470(0x11d)](a50_0x8db492[_0x301470(0xfc)](_0x5a2c19)+':\x20'+a50_0x8db492[_0x301470(0x115)](_0x301470(0x12a)));}}}async['resolveAPIKeyAsync'](){const _0x556bab=a50_0x22e732;return this[_0x556bab(0xf6)]=await getAPIKeyAsync(this[_0x556bab(0x112)],this['activeProfile']||undefined),this[_0x556bab(0xf6)];}static async['createAsync'](_0x10b969){const _0x3ac268=new GlobalContext(_0x10b969);return await _0x3ac268['resolveAPIKeyAsync'](),_0x3ac268;}}
@@ -1 +1 @@
1
- (function(_0xb8e18e,_0xcf8f7){const _0x3efbfd=a50_0x3896,_0x497360=_0xb8e18e();while(!![]){try{const _0x217169=parseInt(_0x3efbfd(0x1d0))/0x1*(-parseInt(_0x3efbfd(0x1e4))/0x2)+-parseInt(_0x3efbfd(0x1e2))/0x3*(parseInt(_0x3efbfd(0x1d1))/0x4)+parseInt(_0x3efbfd(0x1da))/0x5+parseInt(_0x3efbfd(0x1dc))/0x6*(parseInt(_0x3efbfd(0x1e9))/0x7)+-parseInt(_0x3efbfd(0x1ca))/0x8+-parseInt(_0x3efbfd(0x1d2))/0x9*(parseInt(_0x3efbfd(0x1e1))/0xa)+parseInt(_0x3efbfd(0x1db))/0xb;if(_0x217169===_0xcf8f7)break;else _0x497360['push'](_0x497360['shift']());}catch(_0x1fc820){_0x497360['push'](_0x497360['shift']());}}}(a50_0x25ee,0xd8098));function a50_0x3896(_0x2e0ecb,_0x33ee5e){_0x2e0ecb=_0x2e0ecb-0x1ca;const _0x25eee4=a50_0x25ee();let _0x3896c4=_0x25eee4[_0x2e0ecb];return _0x3896c4;}const SERVICE_NAME='tdx';let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x16448a=a50_0x3896;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x3c09a0=await import('@napi-rs/keyring');return EntryClass=_0x3c09a0[_0x16448a(0x1e6)],EntryClass;}catch(_0x3b01b7){return keyringLoadError=_0x3b01b7 instanceof Error?_0x3b01b7:new Error(String(_0x3b01b7)),null;}}function getAccountName(_0x31f73d){const _0x4aafe3=a50_0x3896,_0x359beb=_0x31f73d||'';return'profile:'+_0x359beb+_0x4aafe3(0x1ce);}export async function getKeychainAPIKey(_0x2cf96e){const _0x36b8bc=a50_0x3896,_0x59a37f=await getKeychainAPIKeyWithStatus(_0x2cf96e);if(_0x59a37f[_0x36b8bc(0x1e8)])return _0x59a37f['value'];return _0x59a37f[_0x36b8bc(0x1df)]===_0x36b8bc(0x1d4)&&console[_0x36b8bc(0x1cc)](_0x36b8bc(0x1cd)+_0x59a37f['message']),null;}export async function getKeychainAPIKeyWithStatus(_0x128532){const _0x2872db=a50_0x3896;try{const _0x3c1fc5=await getEntryClass();if(!_0x3c1fc5)return{'success':![],'reason':_0x2872db(0x1e7)};const _0x30581f=getAccountName(_0x128532),_0x4b2fd2=new _0x3c1fc5(SERVICE_NAME,_0x30581f),_0x138f0c=_0x4b2fd2[_0x2872db(0x1de)]();if(_0x138f0c)return{'success':!![],'value':_0x138f0c};return{'success':![],'reason':'not_found'};}catch(_0x196e92){const _0x5ad938=_0x196e92 instanceof Error?_0x196e92[_0x2872db(0x1d3)]:String(_0x196e92);if(_0x5ad938[_0x2872db(0x1d9)](_0x2872db(0x1e3))||_0x5ad938[_0x2872db(0x1e0)]()[_0x2872db(0x1d9)](_0x2872db(0x1e5))||_0x5ad938[_0x2872db(0x1e0)]()['includes'](_0x2872db(0x1cb))||_0x5ad938[_0x2872db(0x1e0)]()['includes'](_0x2872db(0x1d6)))return{'success':![],'reason':_0x2872db(0x1cf)};if(_0x5ad938[_0x2872db(0x1d9)]('-25293')||_0x5ad938[_0x2872db(0x1e0)]()['includes']('restricted')||_0x5ad938[_0x2872db(0x1e0)]()[_0x2872db(0x1d9)](_0x2872db(0x1eb)))return{'success':![],'reason':_0x2872db(0x1d4),'message':_0x2872db(0x1d5)};return{'success':![],'reason':_0x2872db(0x1e7),'message':_0x5ad938};}}function a50_0x25ee(){const _0x4fe816=['unavailable','success','13027mCnxWs','__keychain_test__','access','11158384IVvezz','not\x20found','error','Warning:\x20',':api_key','not_found','5PBFehD','12dRUquO','11119455CrmodP','message','access_denied','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.','no\x20matching\x20entry','not\x20available','cannot\x20find','includes','7864085revUDq','33970156sDpImT','2748ndKBVh','System\x20keychain\x20is\x20not\x20available','getPassword','reason','toLowerCase','10iFVobt','949335yivsuL','-25300','419534htKhbd','could\x20not\x20be\x20found','Entry'];a50_0x25ee=function(){return _0x4fe816;};return a50_0x25ee();}export async function saveKeychainAPIKey(_0x343de8,_0x516554){const _0x4a0b06=a50_0x3896,_0x42248b=await getEntryClass();if(!_0x42248b)throw new Error(_0x4a0b06(0x1dd));const _0xd7e4cc=getAccountName(_0x516554),_0x14e092=new _0x42248b(SERVICE_NAME,_0xd7e4cc);_0x14e092['setPassword'](_0x343de8);}export async function deleteKeychainAPIKey(_0x3dec84){try{const _0x44f62c=await getEntryClass();if(!_0x44f62c)return![];const _0x38aa40=getAccountName(_0x3dec84),_0x4b8ebb=new _0x44f62c(SERVICE_NAME,_0x38aa40);return _0x4b8ebb['deleteCredential'](),!![];}catch{return![];}}export async function isKeychainAvailable(){const _0x33b178=a50_0x3896;try{const _0x4f79ba=await getEntryClass();if(!_0x4f79ba)return![];const _0x577f41=new _0x4f79ba(SERVICE_NAME,_0x33b178(0x1ea));return _0x577f41['getPassword'](),!![];}catch(_0x3866d1){const _0x3a7a4d=_0x3866d1 instanceof Error?_0x3866d1[_0x33b178(0x1d3)][_0x33b178(0x1e0)]():'';if(_0x3a7a4d[_0x33b178(0x1d9)](_0x33b178(0x1d7))||_0x3a7a4d[_0x33b178(0x1d9)]('not\x20supported')||_0x3a7a4d[_0x33b178(0x1d9)](_0x33b178(0x1d8)))return![];return!![];}}
1
+ const a51_0x254a3c=a51_0x495f;(function(_0x66ed6d,_0xcac178){const _0x3423a5=a51_0x495f,_0x351b3a=_0x66ed6d();while(!![]){try{const _0x1306e0=parseInt(_0x3423a5(0x157))/0x1+parseInt(_0x3423a5(0x15e))/0x2+-parseInt(_0x3423a5(0x151))/0x3*(parseInt(_0x3423a5(0x14e))/0x4)+parseInt(_0x3423a5(0x14d))/0x5+-parseInt(_0x3423a5(0x14b))/0x6+parseInt(_0x3423a5(0x145))/0x7*(-parseInt(_0x3423a5(0x159))/0x8)+-parseInt(_0x3423a5(0x144))/0x9*(-parseInt(_0x3423a5(0x15b))/0xa);if(_0x1306e0===_0xcac178)break;else _0x351b3a['push'](_0x351b3a['shift']());}catch(_0xce62e5){_0x351b3a['push'](_0x351b3a['shift']());}}}(a51_0x1250,0x2dd33));const SERVICE_NAME=a51_0x254a3c(0x15a);function a51_0x495f(_0x448253,_0x4d4d7a){_0x448253=_0x448253-0x143;const _0x12503c=a51_0x1250();let _0x495fab=_0x12503c[_0x448253];return _0x495fab;}let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x4a55fd=a51_0x254a3c;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x4c5ee1=await import(_0x4a55fd(0x162));return EntryClass=_0x4c5ee1[_0x4a55fd(0x163)],EntryClass;}catch(_0x36d7fb){return keyringLoadError=_0x36d7fb instanceof Error?_0x36d7fb:new Error(String(_0x36d7fb)),null;}}function getAccountName(_0x39f343){const _0x4cbf11=a51_0x254a3c,_0x3f23df=_0x39f343||'';return _0x4cbf11(0x150)+_0x3f23df+_0x4cbf11(0x167);}export async function getKeychainAPIKey(_0x5350fd){const _0x79de07=a51_0x254a3c,_0x30231b=await getKeychainAPIKeyWithStatus(_0x5350fd);if(_0x30231b[_0x79de07(0x14f)])return _0x30231b[_0x79de07(0x168)];return _0x30231b[_0x79de07(0x165)]===_0x79de07(0x161)&&console[_0x79de07(0x15d)](_0x79de07(0x152)+_0x30231b[_0x79de07(0x16c)]),null;}export async function getKeychainAPIKeyWithStatus(_0xc9901b){const _0x82cdd9=a51_0x254a3c;try{const _0x9533dc=await getEntryClass();if(!_0x9533dc)return{'success':![],'reason':_0x82cdd9(0x15c)};const _0x578743=getAccountName(_0xc9901b),_0x25e1d4=new _0x9533dc(SERVICE_NAME,_0x578743),_0x4f7d72=_0x25e1d4['getPassword']();if(_0x4f7d72)return{'success':!![],'value':_0x4f7d72};return{'success':![],'reason':_0x82cdd9(0x169)};}catch(_0x656221){const _0x1d47f5=_0x656221 instanceof Error?_0x656221['message']:String(_0x656221);if(_0x1d47f5[_0x82cdd9(0x16b)](_0x82cdd9(0x146))||_0x1d47f5[_0x82cdd9(0x153)]()['includes'](_0x82cdd9(0x160))||_0x1d47f5['toLowerCase']()['includes'](_0x82cdd9(0x14c))||_0x1d47f5[_0x82cdd9(0x153)]()[_0x82cdd9(0x16b)](_0x82cdd9(0x156)))return{'success':![],'reason':'not_found'};if(_0x1d47f5[_0x82cdd9(0x16b)](_0x82cdd9(0x155))||_0x1d47f5[_0x82cdd9(0x153)]()[_0x82cdd9(0x16b)](_0x82cdd9(0x147))||_0x1d47f5['toLowerCase']()['includes'](_0x82cdd9(0x158)))return{'success':![],'reason':_0x82cdd9(0x161),'message':_0x82cdd9(0x166)};return{'success':![],'reason':_0x82cdd9(0x15c),'message':_0x1d47f5};}}function a51_0x1250(){const _0x4ac048=['restricted','__keychain_test__','not\x20supported','not\x20available','196572ZQjyOq','not\x20found','1126430HvAGQC','596UkhYOH','success','profile:','3174ewnvLW','Warning:\x20','toLowerCase','deleteCredential','-25293','no\x20matching\x20entry','10418GVxler','access','40Umnrta','tdx','650kpBsRe','unavailable','error','570688LfzUkr','getPassword','could\x20not\x20be\x20found','access_denied','@napi-rs/keyring','Entry','System\x20keychain\x20is\x20not\x20available','reason','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.',':api_key','value','not_found','setPassword','includes','message','cannot\x20find','28656DWKFYp','489867wifiQp','-25300'];a51_0x1250=function(){return _0x4ac048;};return a51_0x1250();}export async function saveKeychainAPIKey(_0x347c64,_0x13fe1a){const _0x457ff8=a51_0x254a3c,_0xc4e3ed=await getEntryClass();if(!_0xc4e3ed)throw new Error(_0x457ff8(0x164));const _0x563a8c=getAccountName(_0x13fe1a),_0x456fa1=new _0xc4e3ed(SERVICE_NAME,_0x563a8c);_0x456fa1[_0x457ff8(0x16a)](_0x347c64);}export async function deleteKeychainAPIKey(_0x279064){const _0x3587c4=a51_0x254a3c;try{const _0x2d0b04=await getEntryClass();if(!_0x2d0b04)return![];const _0x447e29=getAccountName(_0x279064),_0x227bad=new _0x2d0b04(SERVICE_NAME,_0x447e29);return _0x227bad[_0x3587c4(0x154)](),!![];}catch{return![];}}export async function isKeychainAvailable(){const _0x449ced=a51_0x254a3c;try{const _0x20c963=await getEntryClass();if(!_0x20c963)return![];const _0x29e350=new _0x20c963(SERVICE_NAME,_0x449ced(0x148));return _0x29e350[_0x449ced(0x15f)](),!![];}catch(_0x449223){const _0x961a81=_0x449223 instanceof Error?_0x449223[_0x449ced(0x16c)]['toLowerCase']():'';if(_0x961a81['includes'](_0x449ced(0x14a))||_0x961a81[_0x449ced(0x16b)](_0x449ced(0x149))||_0x961a81[_0x449ced(0x16b)](_0x449ced(0x143)))return![];return!![];}}
@@ -1 +1 @@
1
- const a51_0x446ed2=a51_0x3e8b;(function(_0x503e1c,_0x18b9c8){const _0x42b739=a51_0x3e8b,_0x47b520=_0x503e1c();while(!![]){try{const _0x3ea55b=-parseInt(_0x42b739(0x1d3))/0x1*(-parseInt(_0x42b739(0x1e8))/0x2)+-parseInt(_0x42b739(0x1f6))/0x3*(parseInt(_0x42b739(0x1fd))/0x4)+parseInt(_0x42b739(0x1fc))/0x5+-parseInt(_0x42b739(0x1fb))/0x6+-parseInt(_0x42b739(0x1d0))/0x7+-parseInt(_0x42b739(0x202))/0x8+parseInt(_0x42b739(0x1dd))/0x9;if(_0x3ea55b===_0x18b9c8)break;else _0x47b520['push'](_0x47b520['shift']());}catch(_0x829297){_0x47b520['push'](_0x47b520['shift']());}}}(a51_0x2082,0x87636));import*as a51_0x5ccb3a from'node:fs';import*as a51_0xe677bf from'node:path';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=a51_0x446ed2(0x1f0);export function getProfileParams(_0x5d2087){const _0x7d174c=a51_0x446ed2,_0x517100={};if(!_0x5d2087)return _0x517100;for(const [_0x40448f,_0x51f314]of Object[_0x7d174c(0x1c9)](_0x5d2087)){_0x40448f!==_0x7d174c(0x1c6)&&_0x51f314!==undefined&&(_0x517100[_0x40448f]=_0x51f314);}return _0x517100;}function a51_0x3e8b(_0x53eac2,_0x3f8ee1){_0x53eac2=_0x53eac2-0x1bd;const _0x2082a8=a51_0x2082();let _0x3e8bf2=_0x2082a8[_0x53eac2];return _0x3e8bf2;}export function getProfilesDir(){const _0x4c5728=a51_0x446ed2;return a51_0xe677bf[_0x4c5728(0x207)](getConfigDir(),_0x4c5728(0x1fe));}function getProfileDir(_0x366de6){return a51_0xe677bf['join'](getProfilesDir(),_0x366de6);}function getProfileConfigPath(_0x1ef868){const _0x3b658e=a51_0x446ed2;return a51_0xe677bf['join'](getProfileDir(_0x1ef868),_0x3b658e(0x1f8));}function getProfileEnvPath(_0x29d7bf){return a51_0xe677bf['join'](getProfileDir(_0x29d7bf),'.env');}function getGlobalConfigPath(){return a51_0xe677bf['join'](getConfigDir(),'tdx.json');}function validateProfileName(_0x2cb1e0){const _0x1fee7b=a51_0x446ed2;if(!/^@?[a-zA-Z0-9_-]+$/[_0x1fee7b(0x1ed)](_0x2cb1e0))throw new Error(_0x1fee7b(0x203)+_0x2cb1e0+_0x1fee7b(0x1e1));}function validateProfileConfig(_0x21d0be,_0x455157){const _0x2e308a=a51_0x446ed2;if(typeof _0x21d0be!==_0x2e308a(0x1cd)||_0x21d0be===null)throw new Error('Profile\x20\x27'+_0x455157+'\x27:\x20config\x20must\x20be\x20an\x20object');const _0x1ae104=[_0x2e308a(0x1c6),_0x2e308a(0x1d1),_0x2e308a(0x1f4),_0x2e308a(0x1ce),_0x2e308a(0x1e2),_0x2e308a(0x1ca)],_0x51e550=_0x21d0be;for(const _0x372fe2 of Object['keys'](_0x51e550)){!_0x1ae104['includes'](_0x372fe2)&&console[_0x2e308a(0x1ff)](_0x2e308a(0x1db)+_0x455157+'\x27:\x20unknown\x20config\x20key\x20\x27'+_0x372fe2+_0x2e308a(0x1cf));}if(_0x51e550['description']!==undefined&&typeof _0x51e550[_0x2e308a(0x1c6)]!==_0x2e308a(0x1bf))throw new Error(_0x2e308a(0x1ea)+_0x455157+_0x2e308a(0x1be));if(_0x51e550[_0x2e308a(0x1d1)]!==undefined&&typeof _0x51e550['site']!==_0x2e308a(0x1bf))throw new Error(_0x2e308a(0x1ea)+_0x455157+_0x2e308a(0x1bd));if(_0x51e550[_0x2e308a(0x1f4)]!==undefined&&typeof _0x51e550['database']!=='string')throw new Error(_0x2e308a(0x1ea)+_0x455157+_0x2e308a(0x1eb));if(_0x51e550['parent_segment']!==undefined&&typeof _0x51e550[_0x2e308a(0x1ce)]!=='string')throw new Error(_0x2e308a(0x1ea)+_0x455157+_0x2e308a(0x1c1));if(_0x51e550[_0x2e308a(0x1e2)]!==undefined&&typeof _0x51e550['llm_project']!==_0x2e308a(0x1bf))throw new Error(_0x2e308a(0x1ea)+_0x455157+'\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string');if(_0x51e550[_0x2e308a(0x1ca)]!==undefined&&typeof _0x51e550[_0x2e308a(0x1ca)]!==_0x2e308a(0x1bf))throw new Error(_0x2e308a(0x1ea)+_0x455157+_0x2e308a(0x1ec));return!![];}function loadProfilesFromTdxJson(_0x11a4c5,_0x5e6018){const _0x532fe2=a51_0x446ed2;if(!a51_0x5ccb3a['existsSync'](_0x11a4c5))return[];try{const _0x46f1c9=a51_0x5ccb3a[_0x532fe2(0x1e4)](_0x11a4c5,_0x532fe2(0x1e5)),_0x4b7f00=JSON[_0x532fe2(0x1cb)](_0x46f1c9);if(!_0x4b7f00[_0x532fe2(0x1fe)]||typeof _0x4b7f00[_0x532fe2(0x1fe)]!=='object')return[];const _0xf7cccb=[];for(const [_0x2fdb38,_0x4c8013]of Object[_0x532fe2(0x1c9)](_0x4b7f00[_0x532fe2(0x1fe)])){try{validateProfileConfig(_0x4c8013,_0x2fdb38);const _0x19f88b=getNewCredentialPath(_0x2fdb38),_0x191ce7=getOldCredentialPath(_0x2fdb38),_0x28847e=a51_0x5ccb3a[_0x532fe2(0x1dc)](_0x19f88b)||a51_0x5ccb3a['existsSync'](_0x191ce7);_0xf7cccb['push']({'name':_0x2fdb38,'config':_0x4c8013,'metadata':{'name':_0x2fdb38,'createdAt':new Date()['toISOString']()},'hasCredentials':_0x28847e,'scope':_0x5e6018});}catch(_0x30596c){_0x30596c instanceof Error&&(console[_0x532fe2(0x1ff)](_0x532fe2(0x1c4)+_0x11a4c5+':'),console[_0x532fe2(0x1ff)]('\x20\x20'+_0x30596c[_0x532fe2(0x204)]+'\x0a'));}}return _0xf7cccb;}catch(_0x29a520){return _0x29a520 instanceof SyntaxError?(console[_0x532fe2(0x1ff)]('\x0aWarning:\x20Failed\x20to\x20parse\x20'+_0x11a4c5+_0x532fe2(0x201)),console[_0x532fe2(0x1ff)](_0x532fe2(0x1e0)+_0x29a520[_0x532fe2(0x204)]+'\x0a')):console[_0x532fe2(0x1ff)](_0x532fe2(0x1c8)+_0x11a4c5+':\x20'+_0x29a520+'\x0a'),[];}}function a51_0x2082(){const _0x282480=['5ogZJBv','sort','\x20does\x20not\x20exist','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','stringify','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','user','local','Warning:\x20Profile\x20\x27','existsSync','27361710irWnbV','find','from','Error:\x20','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20underscore,\x20and\x20optional\x20@\x20prefix\x20for\x20reserved\x20profiles.','llm_project','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','readFileSync','utf-8','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','some','164080vmmrJT','Failed\x20to\x20parse\x20','Profile\x20\x27','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','test','.env.','profile','@tdx-studio','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','\x20already\x20exists','directory','database',',\x20creating\x20new\x20file','316623ThNNla','\x27\x20not\x20found\x20in\x20user\x20configuration','tdx.json','rmSync','values','5716464FBsptt','126600Cwuxur','20fPWUQz','profiles','warn','env',':\x20Invalid\x20JSON\x20syntax','3981072ZdbMws','Invalid\x20profile\x20name:\x20','message','map','filter','join','name','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','string','\x20\x20mv\x20\x22','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','\x22\x20\x22','TDX_PROFILE','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','Profile\x20','description','Warning:\x20Failed\x20to\x20parse\x20','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','entries','llm_agent','parse','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','object','parent_segment','\x27\x20will\x20be\x20ignored','6601539BPnpiL','site','set'];a51_0x2082=function(){return _0x282480;};return a51_0x2082();}export function getNewCredentialPath(_0xf67407){const _0x30306f=a51_0x446ed2;return a51_0xe677bf[_0x30306f(0x207)](getConfigDir(),_0x30306f(0x1ee)+_0xf67407);}function getOldCredentialPath(_0x4fcfac){const _0x3c1d25=a51_0x446ed2;return a51_0xe677bf[_0x3c1d25(0x207)](getProfilesDir(),_0x4fcfac,'.env');}function loadProfilesFromTdxJsonFiles(){const _0x3a50f6=a51_0x446ed2,_0x3d1128=[],_0x2b08a7=findProjectConfigPath();_0x2b08a7&&_0x3d1128['push'](...loadProfilesFromTdxJson(_0x2b08a7,_0x3a50f6(0x1da)));const _0x159375=a51_0xe677bf['join'](getConfigDir(),_0x3a50f6(0x1f8));return _0x3d1128['push'](...loadProfilesFromTdxJson(_0x159375,_0x3a50f6(0x1d9))),_0x3d1128;}function loadProfilesFromDirectories(){const _0x37ce1b=a51_0x446ed2,_0x588922=getProfilesDir();if(!a51_0x5ccb3a['existsSync'](_0x588922))return[];try{return a51_0x5ccb3a['readdirSync'](_0x588922,{'withFileTypes':!![]})['filter'](_0x41c52a=>_0x41c52a['isDirectory']())['map'](_0x461585=>_0x461585['name'])[_0x37ce1b(0x206)](_0x3e799f=>{const _0x33b1ee=_0x37ce1b,_0x3f243f=getProfileConfigPath(_0x3e799f),_0x3d97e2=getProfileEnvPath(_0x3e799f);return a51_0x5ccb3a[_0x33b1ee(0x1dc)](_0x3f243f)||a51_0x5ccb3a['existsSync'](_0x3d97e2);})['map'](_0x559dd7=>{const _0x2608a0=_0x37ce1b,_0x257c8f=loadProfileFromDirectory(_0x559dd7);if(_0x257c8f)return{..._0x257c8f,'scope':_0x2608a0(0x1f3)};return null;})[_0x37ce1b(0x206)](_0x51ca83=>_0x51ca83!==null);}catch{return[];}}function loadProfileFromDirectory(_0x3014a9){const _0x1ce2eb=a51_0x446ed2,_0x3ee763=getProfileConfigPath(_0x3014a9),_0x4fadc0=getOldCredentialPath(_0x3014a9);if(!a51_0x5ccb3a['existsSync'](_0x3ee763)&&!a51_0x5ccb3a[_0x1ce2eb(0x1dc)](_0x4fadc0))return null;let _0xb2aee9={},_0x452203={'name':_0x3014a9,'createdAt':new Date()['toISOString']()};if(a51_0x5ccb3a[_0x1ce2eb(0x1dc)](_0x3ee763))try{const _0x5771ad=a51_0x5ccb3a[_0x1ce2eb(0x1e4)](_0x3ee763,_0x1ce2eb(0x1e5)),_0x298f34=JSON[_0x1ce2eb(0x1cb)](_0x5771ad),{metadata:_0x5c23a8,..._0x3e1bda}=_0x298f34;_0xb2aee9=_0x3e1bda,_0x5c23a8&&(_0x452203=_0x5c23a8);}catch{}return{'name':_0x3014a9,'config':_0xb2aee9,'metadata':_0x452203,'hasCredentials':a51_0x5ccb3a[_0x1ce2eb(0x1dc)](_0x4fadc0),'scope':_0x1ce2eb(0x1f3)};}export function listProfiles(){const _0x1bdcd2=a51_0x446ed2,_0x322ca1=loadProfilesFromTdxJsonFiles(),_0x3b53dc=loadProfilesFromDirectories();if(_0x3b53dc['length']>0x0){const _0x5c0cb1=_0x3b53dc[_0x1bdcd2(0x205)](_0x23a01c=>_0x23a01c[_0x1bdcd2(0x208)])[_0x1bdcd2(0x207)](',\x20'),_0x38ace7=getConfigDir();console['warn'](_0x1bdcd2(0x1e6)+_0x5c0cb1),console['warn'](_0x1bdcd2(0x1d6)),console[_0x1bdcd2(0x1ff)]('\x20\x201.\x20Edit:\x20'+a51_0xe677bf[_0x1bdcd2(0x207)](_0x38ace7,_0x1bdcd2(0x1f8))),console[_0x1bdcd2(0x1ff)](_0x1bdcd2(0x1e3)),console[_0x1bdcd2(0x1ff)](_0x1bdcd2(0x1d8));}const _0x35c0bc=[..._0x322ca1,..._0x3b53dc],_0x3eba6c=new Map();for(const _0x2b484d of _0x35c0bc){!_0x3eba6c['has'](_0x2b484d['name'])&&_0x3eba6c[_0x1bdcd2(0x1d2)](_0x2b484d[_0x1bdcd2(0x208)],_0x2b484d);}return Array[_0x1bdcd2(0x1df)](_0x3eba6c[_0x1bdcd2(0x1fa)]())[_0x1bdcd2(0x1d4)]((_0xe1fc55,_0x4d5b8f)=>_0xe1fc55[_0x1bdcd2(0x208)]['localeCompare'](_0x4d5b8f[_0x1bdcd2(0x208)]));}export function profileExists(_0x34b051){const _0x3cbfe1=a51_0x446ed2,_0x4d3683=listProfiles();return _0x4d3683[_0x3cbfe1(0x1e7)](_0x30c706=>_0x30c706[_0x3cbfe1(0x208)]===_0x34b051);}export function loadProfile(_0x17f916){const _0x2c4fc0=a51_0x446ed2;validateProfileName(_0x17f916);const _0x537515=listProfiles(),_0x4741ea=_0x537515[_0x2c4fc0(0x1de)](_0x1fae0c=>_0x1fae0c['name']===_0x17f916);return _0x4741ea||null;}export function saveProfile(_0x52a944,_0x4070f9,_0xf9e8ea=![]){saveProfileToUserConfig(_0x52a944,_0x4070f9);}export function deleteProfile(_0x179a00){const _0xde71e0=a51_0x446ed2;validateProfileName(_0x179a00);const _0x189356=getProfileDir(_0x179a00);if(!a51_0x5ccb3a[_0xde71e0(0x1dc)](_0x189356))throw new Error('Profile\x20'+_0x179a00+_0xde71e0(0x1d5));a51_0x5ccb3a[_0xde71e0(0x1f9)](_0x189356,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0xc6e787,_0x5cf46c){const _0x16cef8=a51_0x446ed2;validateProfileName(_0xc6e787);const _0x1927d1=getGlobalConfigPath(),_0x3d019b=getConfigDir();!a51_0x5ccb3a[_0x16cef8(0x1dc)](_0x3d019b)&&createSecureDirectory(_0x3d019b);let _0x244c08={};if(a51_0x5ccb3a[_0x16cef8(0x1dc)](_0x1927d1))try{const _0x1e5533=a51_0x5ccb3a['readFileSync'](_0x1927d1,'utf-8');_0x244c08=JSON['parse'](_0x1e5533);}catch{console[_0x16cef8(0x1ff)](_0x16cef8(0x1c7)+_0x1927d1+_0x16cef8(0x1f5));}!_0x244c08['profiles']&&(_0x244c08[_0x16cef8(0x1fe)]={}),_0x244c08[_0x16cef8(0x1fe)][_0xc6e787]=_0x5cf46c,writeSecureFile(_0x1927d1,JSON[_0x16cef8(0x1d7)](_0x244c08,null,0x2));}export function removeProfileFromUserConfig(_0x4dead5){const _0x4f6ee0=a51_0x446ed2;validateProfileName(_0x4dead5);const _0x45ec12=getGlobalConfigPath();if(!a51_0x5ccb3a[_0x4f6ee0(0x1dc)](_0x45ec12))throw new Error(_0x4f6ee0(0x1ea)+_0x4dead5+_0x4f6ee0(0x1f7));let _0x4809bb={};try{const _0x2b8788=a51_0x5ccb3a['readFileSync'](_0x45ec12,_0x4f6ee0(0x1e5));_0x4809bb=JSON[_0x4f6ee0(0x1cb)](_0x2b8788);}catch{throw new Error(_0x4f6ee0(0x1e9)+_0x45ec12);}if(!_0x4809bb[_0x4f6ee0(0x1fe)]||!_0x4809bb[_0x4f6ee0(0x1fe)][_0x4dead5])throw new Error(_0x4f6ee0(0x1ea)+_0x4dead5+_0x4f6ee0(0x1f7));delete _0x4809bb[_0x4f6ee0(0x1fe)][_0x4dead5],_0x4809bb[_0x4f6ee0(0x1ef)]===_0x4dead5&&delete _0x4809bb[_0x4f6ee0(0x1ef)],writeSecureFile(_0x45ec12,JSON['stringify'](_0x4809bb,null,0x2));}export function getActiveProfile(){const _0x1d4ee2=a51_0x446ed2,_0x46a3a4=loadSessionContext();if(_0x46a3a4?.[_0x1d4ee2(0x1ef)])return _0x46a3a4[_0x1d4ee2(0x1ef)];if(process[_0x1d4ee2(0x200)]['TDX_PROFILE'])return process[_0x1d4ee2(0x200)][_0x1d4ee2(0x1c3)];const _0x5a9666=getGlobalConfigPath();if(!a51_0x5ccb3a[_0x1d4ee2(0x1dc)](_0x5a9666))return null;try{const _0x4a7c8f=a51_0x5ccb3a[_0x1d4ee2(0x1e4)](_0x5a9666,'utf-8'),_0x5f4ae0=JSON['parse'](_0x4a7c8f);return _0x5f4ae0[_0x1d4ee2(0x1ef)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x1b3897){const _0x1d9ee8=a51_0x446ed2,_0x3aa432=getGlobalConfigPath(),_0x46e29f=getConfigDir();!a51_0x5ccb3a[_0x1d9ee8(0x1dc)](_0x46e29f)&&createSecureDirectory(_0x46e29f);let _0x3514b9={};if(a51_0x5ccb3a[_0x1d9ee8(0x1dc)](_0x3aa432))try{const _0x4abeac=a51_0x5ccb3a[_0x1d9ee8(0x1e4)](_0x3aa432,_0x1d9ee8(0x1e5));_0x3514b9=JSON['parse'](_0x4abeac);}catch{console[_0x1d9ee8(0x1ff)](_0x1d9ee8(0x1c7)+_0x3aa432+_0x1d9ee8(0x1f5));}_0x3514b9['site']=_0x1b3897,writeSecureFile(_0x3aa432,JSON[_0x1d9ee8(0x1d7)](_0x3514b9,null,0x2));}export function saveActiveProfileToUserConfig(_0x2ca1dd){const _0x5abeca=a51_0x446ed2;validateProfileName(_0x2ca1dd);const _0x342125=getGlobalConfigPath(),_0x4a59af=getConfigDir();!a51_0x5ccb3a[_0x5abeca(0x1dc)](_0x4a59af)&&createSecureDirectory(_0x4a59af);let _0x6c8cc={};if(a51_0x5ccb3a['existsSync'](_0x342125))try{const _0x41b8bb=a51_0x5ccb3a['readFileSync'](_0x342125,_0x5abeca(0x1e5));_0x6c8cc=JSON[_0x5abeca(0x1cb)](_0x41b8bb);}catch{console['warn']('Warning:\x20Failed\x20to\x20parse\x20'+_0x342125+_0x5abeca(0x1f5));}_0x6c8cc[_0x5abeca(0x1ef)]=_0x2ca1dd,writeSecureFile(_0x342125,JSON[_0x5abeca(0x1d7)](_0x6c8cc,null,0x2));}function clearFieldFromUserConfig(_0x2eb832){const _0x34dd7c=a51_0x446ed2,_0x14b0b0=getGlobalConfigPath();if(!a51_0x5ccb3a[_0x34dd7c(0x1dc)](_0x14b0b0))return;let _0x40a205={};try{const _0x5a9216=a51_0x5ccb3a['readFileSync'](_0x14b0b0,_0x34dd7c(0x1e5));_0x40a205=JSON[_0x34dd7c(0x1cb)](_0x5a9216);}catch{return;}delete _0x40a205[_0x2eb832],writeSecureFile(_0x14b0b0,JSON[_0x34dd7c(0x1d7)](_0x40a205,null,0x2));}export function clearDefaultSiteFromUserConfig(){const _0x4b0bfb=a51_0x446ed2;clearFieldFromUserConfig(_0x4b0bfb(0x1d1));}export function clearActiveProfileFromUserConfig(){const _0x415916=a51_0x446ed2;clearFieldFromUserConfig(_0x415916(0x1ef));}export function createProfile(_0x37a481,_0x268737){const _0x5aed56=a51_0x446ed2;validateProfileName(_0x37a481);if(profileExists(_0x37a481))throw new Error(_0x5aed56(0x1c5)+_0x37a481+_0x5aed56(0x1f2));saveProfile(_0x37a481,_0x268737);}export function saveProfileCredentials(_0x45e14f,_0x53e0b9){const _0x97af86=a51_0x446ed2;validateProfileName(_0x45e14f);if(!profileExists(_0x45e14f))throw new Error(_0x97af86(0x1c5)+_0x45e14f+_0x97af86(0x1d5));const _0x5a8332=getNewCredentialPath(_0x45e14f);writeSecureFile(_0x5a8332,_0x53e0b9);}export function loadProfileCredentials(_0x50e7ba){const _0x311af7=a51_0x446ed2;validateProfileName(_0x50e7ba);const _0x48d8b9=getNewCredentialPath(_0x50e7ba);if(a51_0x5ccb3a[_0x311af7(0x1dc)](_0x48d8b9))try{return a51_0x5ccb3a[_0x311af7(0x1e4)](_0x48d8b9,_0x311af7(0x1e5));}catch{}const _0x4e1f64=getOldCredentialPath(_0x50e7ba);if(a51_0x5ccb3a[_0x311af7(0x1dc)](_0x4e1f64)){console[_0x311af7(0x1ff)](_0x311af7(0x1cc)+_0x50e7ba+'\x27'),console[_0x311af7(0x1ff)]('To\x20migrate:'),console['warn'](_0x311af7(0x1c0)+_0x4e1f64+_0x311af7(0x1c2)+_0x48d8b9+'\x22'),console[_0x311af7(0x1ff)](_0x311af7(0x1f1));try{return a51_0x5ccb3a[_0x311af7(0x1e4)](_0x4e1f64,_0x311af7(0x1e5));}catch{return null;}}return null;}
1
+ const a52_0x2e187c=a52_0x1237;(function(_0x1d656f,_0xab647b){const _0x1ae5f1=a52_0x1237,_0xf0de83=_0x1d656f();while(!![]){try{const _0x1f0933=parseInt(_0x1ae5f1(0x1c9))/0x1+-parseInt(_0x1ae5f1(0x207))/0x2+parseInt(_0x1ae5f1(0x205))/0x3*(-parseInt(_0x1ae5f1(0x1c3))/0x4)+-parseInt(_0x1ae5f1(0x1ef))/0x5*(parseInt(_0x1ae5f1(0x1bf))/0x6)+-parseInt(_0x1ae5f1(0x1cb))/0x7+-parseInt(_0x1ae5f1(0x1e0))/0x8*(parseInt(_0x1ae5f1(0x200))/0x9)+parseInt(_0x1ae5f1(0x1fc))/0xa*(parseInt(_0x1ae5f1(0x1ca))/0xb);if(_0x1f0933===_0xab647b)break;else _0xf0de83['push'](_0xf0de83['shift']());}catch(_0x1b9d4a){_0xf0de83['push'](_0xf0de83['shift']());}}}(a52_0x381e,0x9ae87));import*as a52_0x298918 from'node:fs';import*as a52_0x384da7 from'node:path';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=a52_0x2e187c(0x209);export function getProfileParams(_0x5f01ec){const _0x423014=a52_0x2e187c,_0xe12511={};if(!_0x5f01ec)return _0xe12511;for(const [_0x5042f0,_0x3b266a]of Object[_0x423014(0x1bd)](_0x5f01ec)){_0x5042f0!==_0x423014(0x1df)&&_0x3b266a!==undefined&&(_0xe12511[_0x5042f0]=_0x3b266a);}return _0xe12511;}export function getProfilesDir(){const _0x2dca36=a52_0x2e187c;return a52_0x384da7[_0x2dca36(0x20c)](getConfigDir(),_0x2dca36(0x203));}function getProfileDir(_0x900372){const _0xb254a9=a52_0x2e187c;return a52_0x384da7[_0xb254a9(0x20c)](getProfilesDir(),_0x900372);}function getProfileConfigPath(_0x319c64){const _0x16d08e=a52_0x2e187c;return a52_0x384da7[_0x16d08e(0x20c)](getProfileDir(_0x319c64),_0x16d08e(0x1e4));}function getProfileEnvPath(_0x268f08){const _0x468f96=a52_0x2e187c;return a52_0x384da7[_0x468f96(0x20c)](getProfileDir(_0x268f08),_0x468f96(0x1f2));}function getGlobalConfigPath(){const _0x25a82f=a52_0x2e187c;return a52_0x384da7['join'](getConfigDir(),_0x25a82f(0x1e4));}function a52_0x1237(_0x3f0738,_0x5a3c50){_0x3f0738=_0x3f0738-0x1bb;const _0x381e34=a52_0x381e();let _0x123779=_0x381e34[_0x3f0738];return _0x123779;}function validateProfileName(_0x230706){const _0x2002c3=a52_0x2e187c;if(!/^@?[a-zA-Z0-9_-]+$/[_0x2002c3(0x1be)](_0x230706))throw new Error(_0x2002c3(0x1f4)+_0x230706+_0x2002c3(0x1bb));}function validateProfileConfig(_0xae54e7,_0x46e8f4){const _0x2f78b0=a52_0x2e187c;if(typeof _0xae54e7!==_0x2f78b0(0x1c8)||_0xae54e7===null)throw new Error('Profile\x20\x27'+_0x46e8f4+_0x2f78b0(0x1d9));const _0x245fd1=[_0x2f78b0(0x1df),_0x2f78b0(0x1f0),'database',_0x2f78b0(0x1d2),'llm_project',_0x2f78b0(0x1d8)],_0x36fc63=_0xae54e7;for(const _0x5032f5 of Object[_0x2f78b0(0x1f6)](_0x36fc63)){!_0x245fd1[_0x2f78b0(0x1c5)](_0x5032f5)&&console[_0x2f78b0(0x1dd)](_0x2f78b0(0x20f)+_0x46e8f4+_0x2f78b0(0x20e)+_0x5032f5+_0x2f78b0(0x1c1));}if(_0x36fc63[_0x2f78b0(0x1df)]!==undefined&&typeof _0x36fc63[_0x2f78b0(0x1df)]!==_0x2f78b0(0x1c6))throw new Error('Profile\x20\x27'+_0x46e8f4+_0x2f78b0(0x1bc));if(_0x36fc63['site']!==undefined&&typeof _0x36fc63[_0x2f78b0(0x1f0)]!=='string')throw new Error(_0x2f78b0(0x1f7)+_0x46e8f4+_0x2f78b0(0x1c4));if(_0x36fc63[_0x2f78b0(0x1d0)]!==undefined&&typeof _0x36fc63[_0x2f78b0(0x1d0)]!==_0x2f78b0(0x1c6))throw new Error(_0x2f78b0(0x1f7)+_0x46e8f4+_0x2f78b0(0x1de));if(_0x36fc63[_0x2f78b0(0x1d2)]!==undefined&&typeof _0x36fc63['parent_segment']!==_0x2f78b0(0x1c6))throw new Error(_0x2f78b0(0x1f7)+_0x46e8f4+_0x2f78b0(0x1e5));if(_0x36fc63[_0x2f78b0(0x1e6)]!==undefined&&typeof _0x36fc63['llm_project']!==_0x2f78b0(0x1c6))throw new Error('Profile\x20\x27'+_0x46e8f4+_0x2f78b0(0x1fa));if(_0x36fc63[_0x2f78b0(0x1d8)]!==undefined&&typeof _0x36fc63[_0x2f78b0(0x1d8)]!==_0x2f78b0(0x1c6))throw new Error(_0x2f78b0(0x1f7)+_0x46e8f4+_0x2f78b0(0x1e7));return!![];}function loadProfilesFromTdxJson(_0x292caa,_0xc386d0){const _0x30e1d5=a52_0x2e187c;if(!a52_0x298918['existsSync'](_0x292caa))return[];try{const _0x353944=a52_0x298918[_0x30e1d5(0x1c0)](_0x292caa,'utf-8'),_0x5138ff=JSON[_0x30e1d5(0x1e2)](_0x353944);if(!_0x5138ff['profiles']||typeof _0x5138ff[_0x30e1d5(0x203)]!==_0x30e1d5(0x1c8))return[];const _0x559a02=[];for(const [_0x3bfa7b,_0x59ee3a]of Object[_0x30e1d5(0x1bd)](_0x5138ff['profiles'])){try{validateProfileConfig(_0x59ee3a,_0x3bfa7b);const _0x3611c3=getNewCredentialPath(_0x3bfa7b),_0x5ea055=getOldCredentialPath(_0x3bfa7b),_0xc666c2=a52_0x298918[_0x30e1d5(0x210)](_0x3611c3)||a52_0x298918[_0x30e1d5(0x210)](_0x5ea055);_0x559a02[_0x30e1d5(0x1ed)]({'name':_0x3bfa7b,'config':_0x59ee3a,'metadata':{'name':_0x3bfa7b,'createdAt':new Date()[_0x30e1d5(0x1fd)]()},'hasCredentials':_0xc666c2,'scope':_0xc386d0});}catch(_0x372562){_0x372562 instanceof Error&&(console[_0x30e1d5(0x1dd)]('\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20'+_0x292caa+':'),console['warn']('\x20\x20'+_0x372562['message']+'\x0a'));}}return _0x559a02;}catch(_0x265022){return _0x265022 instanceof SyntaxError?(console[_0x30e1d5(0x1dd)](_0x30e1d5(0x1cf)+_0x292caa+_0x30e1d5(0x1e1)),console[_0x30e1d5(0x1dd)](_0x30e1d5(0x1e9)+_0x265022[_0x30e1d5(0x1d6)]+'\x0a')):console[_0x30e1d5(0x1dd)](_0x30e1d5(0x1f8)+_0x292caa+':\x20'+_0x265022+'\x0a'),[];}}export function getNewCredentialPath(_0x54bcb2){const _0x1bf95b=a52_0x2e187c;return a52_0x384da7[_0x1bf95b(0x20c)](getConfigDir(),_0x1bf95b(0x1f5)+_0x54bcb2);}function getOldCredentialPath(_0x8433d9){const _0x5b21b6=a52_0x2e187c;return a52_0x384da7[_0x5b21b6(0x20c)](getProfilesDir(),_0x8433d9,_0x5b21b6(0x1f2));}function loadProfilesFromTdxJsonFiles(){const _0x5c825a=a52_0x2e187c,_0x3a3d8b=[],_0x4cf0bb=findProjectConfigPath();_0x4cf0bb&&_0x3a3d8b['push'](...loadProfilesFromTdxJson(_0x4cf0bb,_0x5c825a(0x1f1)));const _0x121d6c=a52_0x384da7[_0x5c825a(0x20c)](getConfigDir(),_0x5c825a(0x1e4));return _0x3a3d8b['push'](...loadProfilesFromTdxJson(_0x121d6c,_0x5c825a(0x208))),_0x3a3d8b;}function loadProfilesFromDirectories(){const _0x5678ae=a52_0x2e187c,_0x297a43=getProfilesDir();if(!a52_0x298918[_0x5678ae(0x210)](_0x297a43))return[];try{return a52_0x298918['readdirSync'](_0x297a43,{'withFileTypes':!![]})[_0x5678ae(0x1d4)](_0x43125c=>_0x43125c[_0x5678ae(0x206)]())[_0x5678ae(0x20a)](_0x451277=>_0x451277[_0x5678ae(0x1cc)])[_0x5678ae(0x1d4)](_0x494816=>{const _0x144d5a=_0x5678ae,_0x16dac5=getProfileConfigPath(_0x494816),_0x23dce6=getProfileEnvPath(_0x494816);return a52_0x298918[_0x144d5a(0x210)](_0x16dac5)||a52_0x298918[_0x144d5a(0x210)](_0x23dce6);})[_0x5678ae(0x20a)](_0x758d4f=>{const _0x219525=_0x5678ae,_0x8647ee=loadProfileFromDirectory(_0x758d4f);if(_0x8647ee)return{..._0x8647ee,'scope':_0x219525(0x204)};return null;})[_0x5678ae(0x1d4)](_0x2d97da=>_0x2d97da!==null);}catch{return[];}}function loadProfileFromDirectory(_0x33d80b){const _0x23236f=a52_0x2e187c,_0x5c2a12=getProfileConfigPath(_0x33d80b),_0x226458=getOldCredentialPath(_0x33d80b);if(!a52_0x298918['existsSync'](_0x5c2a12)&&!a52_0x298918[_0x23236f(0x210)](_0x226458))return null;let _0x41b41a={},_0x437bdc={'name':_0x33d80b,'createdAt':new Date()[_0x23236f(0x1fd)]()};if(a52_0x298918[_0x23236f(0x210)](_0x5c2a12))try{const _0x51eae6=a52_0x298918[_0x23236f(0x1c0)](_0x5c2a12,_0x23236f(0x1e8)),_0x4541b2=JSON[_0x23236f(0x1e2)](_0x51eae6),{metadata:_0x176a06,..._0x55b879}=_0x4541b2;_0x41b41a=_0x55b879,_0x176a06&&(_0x437bdc=_0x176a06);}catch{}return{'name':_0x33d80b,'config':_0x41b41a,'metadata':_0x437bdc,'hasCredentials':a52_0x298918['existsSync'](_0x226458),'scope':'directory'};}export function listProfiles(){const _0x3990fe=a52_0x2e187c,_0x6bf67d=loadProfilesFromTdxJsonFiles(),_0x1011b9=loadProfilesFromDirectories();if(_0x1011b9[_0x3990fe(0x20b)]>0x0){const _0x221ca9=_0x1011b9[_0x3990fe(0x20a)](_0x1973ab=>_0x1973ab[_0x3990fe(0x1cc)])[_0x3990fe(0x20c)](',\x20'),_0x398616=getConfigDir();console['warn']('\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20'+_0x221ca9),console[_0x3990fe(0x1dd)]('Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:'),console[_0x3990fe(0x1dd)](_0x3990fe(0x1f9)+a52_0x384da7[_0x3990fe(0x20c)](_0x398616,_0x3990fe(0x1e4))),console[_0x3990fe(0x1dd)](_0x3990fe(0x1ff)),console[_0x3990fe(0x1dd)](_0x3990fe(0x202));}const _0x249d19=[..._0x6bf67d,..._0x1011b9],_0x43e8e0=new Map();for(const _0x262b4d of _0x249d19){!_0x43e8e0[_0x3990fe(0x1ea)](_0x262b4d[_0x3990fe(0x1cc)])&&_0x43e8e0['set'](_0x262b4d[_0x3990fe(0x1cc)],_0x262b4d);}return Array[_0x3990fe(0x1db)](_0x43e8e0[_0x3990fe(0x1d5)]())['sort']((_0x908d20,_0x1df879)=>_0x908d20[_0x3990fe(0x1cc)][_0x3990fe(0x1ec)](_0x1df879['name']));}function a52_0x381e(){const _0x57ca9a=['some','Invalid\x20profile\x20name:\x20','.env.','keys','Profile\x20\x27','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','\x20\x201.\x20Edit:\x20','\x27:\x20\x27llm_project\x27\x20must\x20be\x20a\x20string','\x20\x20mv\x20\x22','10PWujcy','toISOString','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','9xKoGbn','\x22\x20\x22','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','profiles','directory','436899eMjSiN','isDirectory','2478636bJNzve','user','@tdx-studio','map','length','join',',\x20creating\x20new\x20file','\x27:\x20unknown\x20config\x20key\x20\x27','Warning:\x20Profile\x20\x27','existsSync','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20underscore,\x20and\x20optional\x20@\x20prefix\x20for\x20reserved\x20profiles.','\x27:\x20\x27description\x27\x20must\x20be\x20a\x20string','entries','test','300lNFVQF','readFileSync','\x27\x20will\x20be\x20ignored','find','16Dtsxga','\x27:\x20\x27site\x27\x20must\x20be\x20a\x20string','includes','string','Profile\x20','object','692032ndSUTX','42465533qQdyUr','4613518bgvoVT','name','\x20does\x20not\x20exist','profile','\x0aWarning:\x20Failed\x20to\x20parse\x20','database','\x27\x20not\x20found\x20in\x20user\x20configuration','parent_segment','TDX_PROFILE','filter','values','message','stringify','llm_agent','\x27:\x20config\x20must\x20be\x20an\x20object','rmSync','from','env','warn','\x27:\x20\x27database\x27\x20must\x20be\x20a\x20string','description','4932064CQoRuk',':\x20Invalid\x20JSON\x20syntax','parse','Failed\x20to\x20parse\x20','tdx.json','\x27:\x20\x27parent_segment\x27\x20must\x20be\x20a\x20string','llm_project','\x27:\x20\x27llm_agent\x27\x20must\x20be\x20a\x20string','utf-8','Error:\x20','has','\x20already\x20exists','localeCompare','push','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','82060waBFpp','site','local','.env'];a52_0x381e=function(){return _0x57ca9a;};return a52_0x381e();}export function profileExists(_0x2734c0){const _0x543ba1=a52_0x2e187c,_0x79cd5e=listProfiles();return _0x79cd5e[_0x543ba1(0x1f3)](_0x154920=>_0x154920[_0x543ba1(0x1cc)]===_0x2734c0);}export function loadProfile(_0x1b98fb){const _0x24fe43=a52_0x2e187c;validateProfileName(_0x1b98fb);const _0x122804=listProfiles(),_0x29e7c6=_0x122804[_0x24fe43(0x1c2)](_0x41817f=>_0x41817f['name']===_0x1b98fb);return _0x29e7c6||null;}export function saveProfile(_0x2c24a6,_0x331b9a,_0x417c9a=![]){saveProfileToUserConfig(_0x2c24a6,_0x331b9a);}export function deleteProfile(_0x279313){const _0x2b09b2=a52_0x2e187c;validateProfileName(_0x279313);const _0x4ea07d=getProfileDir(_0x279313);if(!a52_0x298918['existsSync'](_0x4ea07d))throw new Error('Profile\x20'+_0x279313+'\x20does\x20not\x20exist');a52_0x298918[_0x2b09b2(0x1da)](_0x4ea07d,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x5a22de,_0x21123e){const _0x54dada=a52_0x2e187c;validateProfileName(_0x5a22de);const _0xbcff6f=getGlobalConfigPath(),_0x563810=getConfigDir();!a52_0x298918['existsSync'](_0x563810)&&createSecureDirectory(_0x563810);let _0x385511={};if(a52_0x298918[_0x54dada(0x210)](_0xbcff6f))try{const _0x4b3c7b=a52_0x298918[_0x54dada(0x1c0)](_0xbcff6f,_0x54dada(0x1e8));_0x385511=JSON[_0x54dada(0x1e2)](_0x4b3c7b);}catch{console[_0x54dada(0x1dd)]('Warning:\x20Failed\x20to\x20parse\x20'+_0xbcff6f+_0x54dada(0x20d));}!_0x385511[_0x54dada(0x203)]&&(_0x385511[_0x54dada(0x203)]={}),_0x385511[_0x54dada(0x203)][_0x5a22de]=_0x21123e,writeSecureFile(_0xbcff6f,JSON['stringify'](_0x385511,null,0x2));}export function removeProfileFromUserConfig(_0x58170e){const _0x513c39=a52_0x2e187c;validateProfileName(_0x58170e);const _0x2a8dff=getGlobalConfigPath();if(!a52_0x298918[_0x513c39(0x210)](_0x2a8dff))throw new Error(_0x513c39(0x1f7)+_0x58170e+_0x513c39(0x1d1));let _0x1bb269={};try{const _0x3bab58=a52_0x298918[_0x513c39(0x1c0)](_0x2a8dff,'utf-8');_0x1bb269=JSON[_0x513c39(0x1e2)](_0x3bab58);}catch{throw new Error(_0x513c39(0x1e3)+_0x2a8dff);}if(!_0x1bb269[_0x513c39(0x203)]||!_0x1bb269[_0x513c39(0x203)][_0x58170e])throw new Error(_0x513c39(0x1f7)+_0x58170e+_0x513c39(0x1d1));delete _0x1bb269['profiles'][_0x58170e],_0x1bb269[_0x513c39(0x1ce)]===_0x58170e&&delete _0x1bb269['profile'],writeSecureFile(_0x2a8dff,JSON[_0x513c39(0x1d7)](_0x1bb269,null,0x2));}export function getActiveProfile(){const _0x3552e5=a52_0x2e187c,_0x327f78=loadSessionContext();if(_0x327f78?.[_0x3552e5(0x1ce)])return _0x327f78['profile'];if(process[_0x3552e5(0x1dc)][_0x3552e5(0x1d3)])return process['env'][_0x3552e5(0x1d3)];const _0x32c1da=getGlobalConfigPath();if(!a52_0x298918[_0x3552e5(0x210)](_0x32c1da))return null;try{const _0x3b11e6=a52_0x298918['readFileSync'](_0x32c1da,_0x3552e5(0x1e8)),_0x44b903=JSON[_0x3552e5(0x1e2)](_0x3b11e6);return _0x44b903[_0x3552e5(0x1ce)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x5d0d7e){const _0x36a0fa=a52_0x2e187c,_0x340803=getGlobalConfigPath(),_0x156df9=getConfigDir();!a52_0x298918['existsSync'](_0x156df9)&&createSecureDirectory(_0x156df9);let _0x42bf14={};if(a52_0x298918[_0x36a0fa(0x210)](_0x340803))try{const _0x37f8e5=a52_0x298918['readFileSync'](_0x340803,_0x36a0fa(0x1e8));_0x42bf14=JSON[_0x36a0fa(0x1e2)](_0x37f8e5);}catch{console[_0x36a0fa(0x1dd)]('Warning:\x20Failed\x20to\x20parse\x20'+_0x340803+_0x36a0fa(0x20d));}_0x42bf14[_0x36a0fa(0x1f0)]=_0x5d0d7e,writeSecureFile(_0x340803,JSON[_0x36a0fa(0x1d7)](_0x42bf14,null,0x2));}export function saveActiveProfileToUserConfig(_0x3d78dd){const _0xe3f75d=a52_0x2e187c;validateProfileName(_0x3d78dd);const _0x178a73=getGlobalConfigPath(),_0x20ab63=getConfigDir();!a52_0x298918[_0xe3f75d(0x210)](_0x20ab63)&&createSecureDirectory(_0x20ab63);let _0x326fcf={};if(a52_0x298918[_0xe3f75d(0x210)](_0x178a73))try{const _0x3c1464=a52_0x298918[_0xe3f75d(0x1c0)](_0x178a73,_0xe3f75d(0x1e8));_0x326fcf=JSON['parse'](_0x3c1464);}catch{console[_0xe3f75d(0x1dd)]('Warning:\x20Failed\x20to\x20parse\x20'+_0x178a73+',\x20creating\x20new\x20file');}_0x326fcf[_0xe3f75d(0x1ce)]=_0x3d78dd,writeSecureFile(_0x178a73,JSON['stringify'](_0x326fcf,null,0x2));}function clearFieldFromUserConfig(_0x546f6b){const _0x53bd96=a52_0x2e187c,_0x4d705a=getGlobalConfigPath();if(!a52_0x298918[_0x53bd96(0x210)](_0x4d705a))return;let _0x972925={};try{const _0x31c620=a52_0x298918[_0x53bd96(0x1c0)](_0x4d705a,'utf-8');_0x972925=JSON['parse'](_0x31c620);}catch{return;}delete _0x972925[_0x546f6b],writeSecureFile(_0x4d705a,JSON[_0x53bd96(0x1d7)](_0x972925,null,0x2));}export function clearDefaultSiteFromUserConfig(){const _0x2ab315=a52_0x2e187c;clearFieldFromUserConfig(_0x2ab315(0x1f0));}export function clearActiveProfileFromUserConfig(){const _0xd8f58f=a52_0x2e187c;clearFieldFromUserConfig(_0xd8f58f(0x1ce));}export function createProfile(_0x20e080,_0x5ae05b){const _0x255d5e=a52_0x2e187c;validateProfileName(_0x20e080);if(profileExists(_0x20e080))throw new Error(_0x255d5e(0x1c7)+_0x20e080+_0x255d5e(0x1eb));saveProfile(_0x20e080,_0x5ae05b);}export function saveProfileCredentials(_0x2c94b8,_0x354d77){const _0x4d24f9=a52_0x2e187c;validateProfileName(_0x2c94b8);if(!profileExists(_0x2c94b8))throw new Error(_0x4d24f9(0x1c7)+_0x2c94b8+_0x4d24f9(0x1cd));const _0x57d32b=getNewCredentialPath(_0x2c94b8);writeSecureFile(_0x57d32b,_0x354d77);}export function loadProfileCredentials(_0xaecd8){const _0x2555a2=a52_0x2e187c;validateProfileName(_0xaecd8);const _0x5a4181=getNewCredentialPath(_0xaecd8);if(a52_0x298918[_0x2555a2(0x210)](_0x5a4181))try{return a52_0x298918['readFileSync'](_0x5a4181,_0x2555a2(0x1e8));}catch{}const _0x401763=getOldCredentialPath(_0xaecd8);if(a52_0x298918['existsSync'](_0x401763)){console[_0x2555a2(0x1dd)](_0x2555a2(0x1fe)+_0xaecd8+'\x27'),console[_0x2555a2(0x1dd)]('To\x20migrate:'),console['warn'](_0x2555a2(0x1fb)+_0x401763+_0x2555a2(0x201)+_0x5a4181+'\x22'),console[_0x2555a2(0x1dd)](_0x2555a2(0x1ee));try{return a52_0x298918[_0x2555a2(0x1c0)](_0x401763,_0x2555a2(0x1e8));}catch{return null;}}return null;}
@@ -1 +1 @@
1
- const a52_0x4c8c1c=a52_0x50f2;function a52_0x3fa1(){const _0x24093d=['\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.',').\x20','apiKey','tdx.json','readFileSync','7521UOwAaZ','includes','stringify','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','576xuUJDt','writeFileSync','ENOENT','cwd','27UUNCGp','1563056QCMANg','join','24hpJJqy','TD_API_KEY','parse','code','Warning:\x20\x27profile\x27\x20field\x20in\x20','434399pekidY','221295RcNPXA','Failed\x20to\x20load\x20project\x20config\x20from\x20','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','681528nAZwJe','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','dirname','975808YhfAvQ','1878210DgprNc','utf-8','28QEOqca','existsSync'];a52_0x3fa1=function(){return _0x24093d;};return a52_0x3fa1();}(function(_0x463294,_0x3af9ed){const _0x48e9e0=a52_0x50f2,_0x13d7b7=_0x463294();while(!![]){try{const _0x58e45e=parseInt(_0x48e9e0(0x181))/0x1+parseInt(_0x48e9e0(0x188))/0x2+-parseInt(_0x48e9e0(0x171))/0x3*(-parseInt(_0x48e9e0(0x175))/0x4)+parseInt(_0x48e9e0(0x182))/0x5*(-parseInt(_0x48e9e0(0x17c))/0x6)+-parseInt(_0x48e9e0(0x18b))/0x7*(parseInt(_0x48e9e0(0x185))/0x8)+parseInt(_0x48e9e0(0x179))/0x9*(-parseInt(_0x48e9e0(0x189))/0xa)+parseInt(_0x48e9e0(0x17a))/0xb;if(_0x58e45e===_0x3af9ed)break;else _0x13d7b7['push'](_0x13d7b7['shift']());}catch(_0x2f0772){_0x13d7b7['push'](_0x13d7b7['shift']());}}}(a52_0x3fa1,0x54050));import*as a52_0x3aec97 from'node:fs';import*as a52_0x510f3e from'node:path';const PROJECT_CONFIG_FILENAME=a52_0x4c8c1c(0x190);function a52_0x50f2(_0x36c9dc,_0x1da4c7){_0x36c9dc=_0x36c9dc-0x171;const _0x3fa1f4=a52_0x3fa1();let _0x50f239=_0x3fa1f4[_0x36c9dc];return _0x50f239;}export function findProjectConfigPath(_0x3e37ba){const _0x46641e=a52_0x4c8c1c;let _0x355df2=_0x3e37ba||process[_0x46641e(0x178)]();while(!![]){const _0x481788=a52_0x510f3e[_0x46641e(0x17b)](_0x355df2,PROJECT_CONFIG_FILENAME);if(a52_0x3aec97[_0x46641e(0x18c)](_0x481788))return _0x481788;const _0x526a48=a52_0x510f3e[_0x46641e(0x187)](_0x355df2);if(_0x526a48===_0x355df2)return null;_0x355df2=_0x526a48;}}export function loadProjectConfig(_0x1b2636){const _0x52033d=a52_0x4c8c1c,_0x2f15dc=findProjectConfigPath(_0x1b2636);if(!_0x2f15dc)return null;try{const _0x1fd2d5=a52_0x3aec97[_0x52033d(0x191)](_0x2f15dc,_0x52033d(0x18a)),_0x3b4722=JSON[_0x52033d(0x17e)](_0x1fd2d5),_0xe84f7a=JSON[_0x52033d(0x173)](_0x3b4722);if(_0xe84f7a[_0x52033d(0x172)](_0x52033d(0x17d))||_0xe84f7a[_0x52033d(0x172)](_0x52033d(0x18f))||_0xe84f7a[_0x52033d(0x172)]('api_key'))throw new Error('Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20('+_0x2f15dc+_0x52033d(0x18e)+_0x52033d(0x174));const {metadata:_0x1ffce4,profile:_0x21593d,..._0x5cfdf9}=_0x3b4722;return _0x21593d&&console['warn'](_0x52033d(0x180)+_0x2f15dc+'\x20is\x20ignored.\x20'+_0x52033d(0x186)),_0x5cfdf9;}catch(_0x404636){if(_0x404636 instanceof Error&&'code'in _0x404636&&_0x404636[_0x52033d(0x17f)]===_0x52033d(0x177))return null;throw new Error(_0x52033d(0x183)+_0x2f15dc+':\x20'+_0x404636);}}export function saveProjectConfig(_0x579ac5,_0x115ea7){const _0x255536=a52_0x4c8c1c,_0x14961e=_0x115ea7||process[_0x255536(0x178)](),_0x1b1e3d=a52_0x510f3e['join'](_0x14961e,PROJECT_CONFIG_FILENAME),_0x26f549=JSON['stringify'](_0x579ac5);if(_0x26f549['includes'](_0x255536(0x17d))||_0x26f549[_0x255536(0x172)](_0x255536(0x18f))||_0x26f549['includes']('api_key'))throw new Error(_0x255536(0x184));if('profile'in _0x579ac5)throw new Error(_0x255536(0x18d));a52_0x3aec97[_0x255536(0x176)](_0x1b1e3d,JSON[_0x255536(0x173)](_0x579ac5,null,0x2));}export function hasProjectConfig(_0x24e5a7){return findProjectConfigPath(_0x24e5a7)!==null;}export function getProjectRoot(_0x54d229){const _0x4bdd60=a52_0x4c8c1c,_0x52d393=findProjectConfigPath(_0x54d229);return _0x52d393?a52_0x510f3e[_0x4bdd60(0x187)](_0x52d393):null;}
1
+ function a53_0x2d3d(_0x11a2ab,_0xd18c50){_0x11a2ab=_0x11a2ab-0x1a0;const _0x120093=a53_0x1200();let _0x2d3d0c=_0x120093[_0x11a2ab];return _0x2d3d0c;}const a53_0x4f00ca=a53_0x2d3d;(function(_0x3e497a,_0xd835ef){const _0x3a18ae=a53_0x2d3d,_0x1efd6a=_0x3e497a();while(!![]){try{const _0x255603=parseInt(_0x3a18ae(0x1a2))/0x1+-parseInt(_0x3a18ae(0x1b0))/0x2*(parseInt(_0x3a18ae(0x1b2))/0x3)+-parseInt(_0x3a18ae(0x1af))/0x4*(parseInt(_0x3a18ae(0x1b4))/0x5)+-parseInt(_0x3a18ae(0x1ab))/0x6*(-parseInt(_0x3a18ae(0x1a1))/0x7)+-parseInt(_0x3a18ae(0x1a7))/0x8+-parseInt(_0x3a18ae(0x1ad))/0x9*(-parseInt(_0x3a18ae(0x1bc))/0xa)+-parseInt(_0x3a18ae(0x1c0))/0xb*(parseInt(_0x3a18ae(0x1aa))/0xc);if(_0x255603===_0xd835ef)break;else _0x1efd6a['push'](_0x1efd6a['shift']());}catch(_0x4873e0){_0x1efd6a['push'](_0x1efd6a['shift']());}}}(a53_0x1200,0x98ffd));import*as a53_0x3253de from'node:fs';import*as a53_0x2f6520 from'node:path';const PROJECT_CONFIG_FILENAME=a53_0x4f00ca(0x1c2);export function findProjectConfigPath(_0x52f83f){const _0x32a28b=a53_0x4f00ca;let _0x21e51d=_0x52f83f||process['cwd']();while(!![]){const _0xe4435=a53_0x2f6520[_0x32a28b(0x1a8)](_0x21e51d,PROJECT_CONFIG_FILENAME);if(a53_0x3253de[_0x32a28b(0x1ac)](_0xe4435))return _0xe4435;const _0x31759b=a53_0x2f6520[_0x32a28b(0x1bd)](_0x21e51d);if(_0x31759b===_0x21e51d)return null;_0x21e51d=_0x31759b;}}export function loadProjectConfig(_0xf8d9fa){const _0x441fa7=a53_0x4f00ca,_0x1c5873=findProjectConfigPath(_0xf8d9fa);if(!_0x1c5873)return null;try{const _0x5611a7=a53_0x3253de[_0x441fa7(0x1a5)](_0x1c5873,_0x441fa7(0x1b3)),_0x52a3fb=JSON['parse'](_0x5611a7),_0x1a0535=JSON['stringify'](_0x52a3fb);if(_0x1a0535[_0x441fa7(0x1a4)](_0x441fa7(0x1c1))||_0x1a0535[_0x441fa7(0x1a4)](_0x441fa7(0x1ae))||_0x1a0535[_0x441fa7(0x1a4)](_0x441fa7(0x1b6)))throw new Error(_0x441fa7(0x1b8)+_0x1c5873+_0x441fa7(0x1b7)+_0x441fa7(0x1a3));const {metadata:_0x19ed4c,profile:_0x427cc6,..._0x28f024}=_0x52a3fb;return _0x427cc6&&console[_0x441fa7(0x1bb)]('Warning:\x20\x27profile\x27\x20field\x20in\x20'+_0x1c5873+_0x441fa7(0x1a0)+_0x441fa7(0x1b1)),_0x28f024;}catch(_0x2ac718){if(_0x2ac718 instanceof Error&&_0x441fa7(0x1ba)in _0x2ac718&&_0x2ac718[_0x441fa7(0x1ba)]===_0x441fa7(0x1b9))return null;throw new Error('Failed\x20to\x20load\x20project\x20config\x20from\x20'+_0x1c5873+':\x20'+_0x2ac718);}}export function saveProjectConfig(_0x5bb687,_0x1deecb){const _0x41a10f=a53_0x4f00ca,_0x1fadc1=_0x1deecb||process[_0x41a10f(0x1a6)](),_0x1ecec2=a53_0x2f6520[_0x41a10f(0x1a8)](_0x1fadc1,PROJECT_CONFIG_FILENAME),_0x537f62=JSON[_0x41a10f(0x1bf)](_0x5bb687);if(_0x537f62[_0x41a10f(0x1a4)](_0x41a10f(0x1c1))||_0x537f62['includes'](_0x41a10f(0x1ae))||_0x537f62['includes']('api_key'))throw new Error(_0x41a10f(0x1c3));if(_0x41a10f(0x1be)in _0x5bb687)throw new Error(_0x41a10f(0x1b5));a53_0x3253de[_0x41a10f(0x1a9)](_0x1ecec2,JSON['stringify'](_0x5bb687,null,0x2));}export function hasProjectConfig(_0x340016){return findProjectConfigPath(_0x340016)!==null;}function a53_0x1200(){const _0x513bde=['Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','includes','readFileSync','cwd','2705928FTtGii','join','writeFileSync','24732vGHcii','42hClDfg','existsSync','3015aAauVx','apiKey','89828kwBHvN','2bJCRaZ','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','349911uXQKlZ','utf-8','200TVxipL','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','api_key',').\x20','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','ENOENT','code','warn','30130SghJZt','dirname','profile','stringify','1969yveXYL','TD_API_KEY','tdx.json','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','\x20is\x20ignored.\x20','369089aATpPD','970318BHcevb'];a53_0x1200=function(){return _0x513bde;};return a53_0x1200();}export function getProjectRoot(_0x34bd0a){const _0x22202b=a53_0x4f00ca,_0x41e08b=findProjectConfigPath(_0x34bd0a);return _0x41e08b?a53_0x2f6520[_0x22202b(0x1bd)](_0x41e08b):null;}
@@ -1 +1 @@
1
- (function(_0x488d8b,_0x52b406){const _0x1d68e2=a53_0x5db7,_0x2e827c=_0x488d8b();while(!![]){try{const _0x589b2e=parseInt(_0x1d68e2(0xc8))/0x1*(parseInt(_0x1d68e2(0xd1))/0x2)+parseInt(_0x1d68e2(0xc6))/0x3+-parseInt(_0x1d68e2(0xc3))/0x4+parseInt(_0x1d68e2(0xdb))/0x5+-parseInt(_0x1d68e2(0xc4))/0x6+-parseInt(_0x1d68e2(0xcf))/0x7*(parseInt(_0x1d68e2(0xd4))/0x8)+-parseInt(_0x1d68e2(0xcd))/0x9;if(_0x589b2e===_0x52b406)break;else _0x2e827c['push'](_0x2e827c['shift']());}catch(_0x115926){_0x2e827c['push'](_0x2e827c['shift']());}}}(a53_0x5840,0xc463e));import*as a53_0x373b76 from'node:fs';import*as a53_0x5210d6 from'node:path';function a53_0x5840(){const _0x282d15=['now','join','unlinkSync','619180kNJszQ','6040812HIUBzG','tdx','3204228LYMIVb','homedir','98MGQGPE','includes','readFileSync','.\x20This\x20is\x20insecure.\x20Removing\x20session.','sessions','1618110chasiK','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','7ptDAdT','parse','26526zUOuNc','replace','env','6630128xfjVDK','.json','readdirSync','utf-8','TD_API_KEY','toString','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','3033585rAwzqU','endsWith','existsSync','test','api_key','sort','TDX_CONFIG_DIR','toISOString','push','getTime','writeFileSync','stringify','createdAt','apiKey','warn'];a53_0x5840=function(){return _0x282d15;};return a53_0x5840();}import*as a53_0x19bdb3 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 a53_0x5db7(_0x43cd58,_0x387e5e){_0x43cd58=_0x43cd58-0xb2;const _0x584012=a53_0x5840();let _0x5db7ba=_0x584012[_0x43cd58];return _0x5db7ba;}function getSessionsDir(){const _0x51b805=a53_0x5db7,_0x38e929=process[_0x51b805(0xd3)][_0x51b805(0xb7)]||a53_0x5210d6[_0x51b805(0xc1)](a53_0x19bdb3[_0x51b805(0xc7)](),'.config',_0x51b805(0xc5));return a53_0x5210d6[_0x51b805(0xc1)](_0x38e929,_0x51b805(0xcc));}function getSessionPath(_0x30c255){const _0x327385=a53_0x5db7;return a53_0x5210d6[_0x327385(0xc1)](getSessionsDir(),_0x30c255+_0x327385(0xd5));}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x38c0da){const _0x1edc54=a53_0x5db7;if(_0x38c0da)return _0x38c0da;return getCurrentSessionPID()[_0x1edc54(0xd9)]();}export function loadSessionContext(_0x2d4663){const _0x58b16c=a53_0x5db7,_0x42d898=_0x2d4663||getCurrentSessionPID()['toString'](),_0x4c6511=/^\d+$/[_0x58b16c(0xb4)](_0x42d898)?parseInt(_0x42d898,0xa):null;return _0x4c6511!==null?loadSessionContextByPID(_0x4c6511):loadSessionContextByString(_0x42d898);}export function loadSessionContextByPID(_0x5290fd){const _0x2ebdc5=a53_0x5db7,_0x52a23d=getSessionPath(_0x5290fd);if(!a53_0x373b76[_0x2ebdc5(0xb3)](_0x52a23d))return null;try{const _0x116b85=a53_0x373b76[_0x2ebdc5(0xca)](_0x52a23d,_0x2ebdc5(0xd7)),_0x1715ba=JSON[_0x2ebdc5(0xd0)](_0x116b85),_0x3c58ea=new Date(_0x1715ba[_0x2ebdc5(0xbd)])[_0x2ebdc5(0xba)](),_0x219707=Date[_0x2ebdc5(0xc0)]();if(_0x219707-_0x3c58ea>SESSION_EXPIRATION_MS)return a53_0x373b76[_0x2ebdc5(0xc2)](_0x52a23d),null;const _0x21bb90=JSON[_0x2ebdc5(0xbc)](_0x1715ba);if(_0x21bb90[_0x2ebdc5(0xc9)](_0x2ebdc5(0xd8))||_0x21bb90['includes'](_0x2ebdc5(0xbe))||_0x21bb90['includes']('api_key'))return console['warn']('Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20'+_0x52a23d+_0x2ebdc5(0xcb)),a53_0x373b76['unlinkSync'](_0x52a23d),null;return _0x1715ba;}catch{try{a53_0x373b76[_0x2ebdc5(0xc2)](_0x52a23d);}catch{}return null;}}function loadSessionContextByString(_0x3d762a){const _0x26e7c6=a53_0x5db7,_0x285384=a53_0x5210d6[_0x26e7c6(0xc1)](getSessionsDir(),_0x3d762a+'.json');if(!a53_0x373b76[_0x26e7c6(0xb3)](_0x285384))return null;try{const _0x14fe6a=a53_0x373b76[_0x26e7c6(0xca)](_0x285384,_0x26e7c6(0xd7)),_0x17dd9c=JSON['parse'](_0x14fe6a),_0x492a45=new Date(_0x17dd9c[_0x26e7c6(0xbd)])[_0x26e7c6(0xba)](),_0x1b56b9=Date[_0x26e7c6(0xc0)]();if(_0x1b56b9-_0x492a45>SESSION_EXPIRATION_MS)return a53_0x373b76[_0x26e7c6(0xc2)](_0x285384),null;const _0xa23829=JSON[_0x26e7c6(0xbc)](_0x17dd9c);if(_0xa23829[_0x26e7c6(0xc9)](_0x26e7c6(0xd8))||_0xa23829[_0x26e7c6(0xc9)](_0x26e7c6(0xbe))||_0xa23829[_0x26e7c6(0xc9)](_0x26e7c6(0xb5)))return console[_0x26e7c6(0xbf)](_0x26e7c6(0xda)+_0x285384+_0x26e7c6(0xcb)),a53_0x373b76[_0x26e7c6(0xc2)](_0x285384),null;return _0x17dd9c;}catch{try{a53_0x373b76['unlinkSync'](_0x285384);}catch{}return null;}}export function saveSessionContext(_0x341e13,_0x4efb8b){const _0x182c11=a53_0x5db7,_0x154351=_0x4efb8b||getCurrentSessionPID()[_0x182c11(0xd9)](),_0x1400a8=/^\d+$/[_0x182c11(0xb4)](_0x154351)?parseInt(_0x154351,0xa):getCurrentSessionPID(),_0x229d4e=a53_0x5210d6['join'](getSessionsDir(),_0x154351+_0x182c11(0xd5)),_0x175946=getSessionsDir();createSecureDirectory(_0x175946);const _0x108204=JSON[_0x182c11(0xbc)](_0x341e13);if(_0x108204['includes'](_0x182c11(0xd8))||_0x108204[_0x182c11(0xc9)](_0x182c11(0xbe))||_0x108204[_0x182c11(0xc9)](_0x182c11(0xb5)))throw new Error(_0x182c11(0xce));let _0x42ac6f;const _0x554050=/^\d+$/[_0x182c11(0xb4)](_0x154351)?loadSessionContextByPID(parseInt(_0x154351,0xa)):loadSessionContextByString(_0x154351);_0x554050?_0x42ac6f={..._0x554050,..._0x341e13,'pid':_0x1400a8,'sessionId':_0x154351!==_0x1400a8[_0x182c11(0xd9)]()?_0x154351:undefined,'updatedAt':new Date()[_0x182c11(0xb8)]()}:_0x42ac6f={'pid':_0x1400a8,'sessionId':_0x154351!==_0x1400a8[_0x182c11(0xd9)]()?_0x154351:undefined,..._0x341e13,'createdAt':new Date()[_0x182c11(0xb8)](),'updatedAt':new Date()[_0x182c11(0xb8)]()},a53_0x373b76[_0x182c11(0xbb)](_0x229d4e,JSON['stringify'](_0x42ac6f,null,0x2));}export function clearSessionContext(_0x4e30df){const _0x1a28d5=a53_0x5db7,_0x31af65=_0x4e30df||getCurrentSessionPID()[_0x1a28d5(0xd9)](),_0x130577=a53_0x5210d6[_0x1a28d5(0xc1)](getSessionsDir(),_0x31af65+'.json');a53_0x373b76[_0x1a28d5(0xb3)](_0x130577)&&a53_0x373b76[_0x1a28d5(0xc2)](_0x130577);}export function clearSessionContextField(_0x4cbe38,_0x54f89b){const _0x5a9ec8=a53_0x5db7,_0x5afcbf=_0x54f89b||getCurrentSessionPID()['toString'](),_0xb22461=a53_0x5210d6[_0x5a9ec8(0xc1)](getSessionsDir(),_0x5afcbf+_0x5a9ec8(0xd5));if(!a53_0x373b76[_0x5a9ec8(0xb3)](_0xb22461))return;try{const _0x5cd1ae=a53_0x373b76[_0x5a9ec8(0xca)](_0xb22461,_0x5a9ec8(0xd7)),_0x1f9e0f=JSON['parse'](_0x5cd1ae);delete _0x1f9e0f[_0x4cbe38],a53_0x373b76[_0x5a9ec8(0xbb)](_0xb22461,JSON[_0x5a9ec8(0xbc)](_0x1f9e0f,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x1caa47=a53_0x5db7,_0x41b106=getSessionsDir();if(!a53_0x373b76[_0x1caa47(0xb3)](_0x41b106))return 0x0;let _0xab51d0=0x0;const _0x441b83=Date[_0x1caa47(0xc0)]();try{const _0x4e829e=a53_0x373b76[_0x1caa47(0xd6)](_0x41b106);for(const _0x338f23 of _0x4e829e){if(!_0x338f23[_0x1caa47(0xb2)]('.json'))continue;const _0x5d92b3=a53_0x5210d6['join'](_0x41b106,_0x338f23),_0x4c7beb=_0x338f23['replace'](_0x1caa47(0xd5),''),_0x15981e=parseInt(_0x4c7beb,0xa),_0x25fa30=!isNaN(_0x15981e);if(_0x25fa30){if(!isProcessRunning(_0x15981e)){a53_0x373b76[_0x1caa47(0xc2)](_0x5d92b3),_0xab51d0++;continue;}}try{const _0x1a540d=a53_0x373b76[_0x1caa47(0xca)](_0x5d92b3,_0x1caa47(0xd7)),_0x1feecc=JSON[_0x1caa47(0xd0)](_0x1a540d),_0x1c460a=new Date(_0x1feecc[_0x1caa47(0xbd)])['getTime']();_0x441b83-_0x1c460a>SESSION_EXPIRATION_MS&&(a53_0x373b76[_0x1caa47(0xc2)](_0x5d92b3),_0xab51d0++);}catch{a53_0x373b76[_0x1caa47(0xc2)](_0x5d92b3),_0xab51d0++;}}}catch{}return _0xab51d0;}export function listActiveSessions(){const _0x3e7a60=a53_0x5db7,_0x18b36e=getSessionsDir();if(!a53_0x373b76[_0x3e7a60(0xb3)](_0x18b36e))return[];try{const _0x2a8217=a53_0x373b76[_0x3e7a60(0xd6)](_0x18b36e),_0x2bcaf5=[];for(const _0x57655a of _0x2a8217){if(!_0x57655a['endsWith']('.json'))continue;const _0x521a93=_0x57655a[_0x3e7a60(0xd2)](_0x3e7a60(0xd5),''),_0x41922a=parseInt(_0x521a93,0xa);!isNaN(_0x41922a)&&isProcessRunning(_0x41922a)&&_0x2bcaf5[_0x3e7a60(0xb9)](_0x41922a);}return _0x2bcaf5[_0x3e7a60(0xb6)]((_0x52025b,_0x7fd3ea)=>_0x52025b-_0x7fd3ea);}catch{return[];}}
1
+ (function(_0x4200fa,_0x2dcfc8){const _0x140481=a54_0x487a,_0x5dd0d8=_0x4200fa();while(!![]){try{const _0x4431ff=-parseInt(_0x140481(0x83))/0x1*(parseInt(_0x140481(0x87))/0x2)+-parseInt(_0x140481(0x6e))/0x3*(-parseInt(_0x140481(0x8f))/0x4)+parseInt(_0x140481(0x85))/0x5*(parseInt(_0x140481(0x98))/0x6)+parseInt(_0x140481(0x88))/0x7+-parseInt(_0x140481(0x86))/0x8*(parseInt(_0x140481(0x99))/0x9)+parseInt(_0x140481(0x96))/0xa+parseInt(_0x140481(0x97))/0xb*(-parseInt(_0x140481(0x72))/0xc);if(_0x4431ff===_0x2dcfc8)break;else _0x5dd0d8['push'](_0x5dd0d8['shift']());}catch(_0x1ad902){_0x5dd0d8['push'](_0x5dd0d8['shift']());}}}(a54_0xa540,0xa3917));import*as a54_0x55a4d6 from'node:fs';import*as a54_0x183ac4 from'node:path';function a54_0xa540(){const _0x52996=['env','.json','test','54915TVxWET','tdx','5QCAjTK','8EGUCSR','10RfiPxg','4920293LnNrpp','warn','now','endsWith','unlinkSync','existsSync','.\x20This\x20is\x20insecure.\x20Removing\x20session.','44TmCIxz','sessions','toString','readdirSync','parse','createdAt','join','8774110QOOIRo','11Kafets','2132508ZxdeEj','10274454xPMrEy','utf-8','305307JqCgMs','push','readFileSync','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','11628372VQlpAx','apiKey','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','TDX_CONFIG_DIR','getTime','sort','writeFileSync','toISOString','homedir','replace','stringify','api_key','TD_API_KEY','includes'];a54_0xa540=function(){return _0x52996;};return a54_0xa540();}import*as a54_0x20823f 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 _0x1d689c=a54_0x487a,_0x347c26=process[_0x1d689c(0x80)][_0x1d689c(0x75)]||a54_0x183ac4[_0x1d689c(0x95)](a54_0x20823f[_0x1d689c(0x7a)](),'.config',_0x1d689c(0x84));return a54_0x183ac4['join'](_0x347c26,_0x1d689c(0x90));}function getSessionPath(_0x3731d5){const _0xf45909=a54_0x487a;return a54_0x183ac4[_0xf45909(0x95)](getSessionsDir(),_0x3731d5+'.json');}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x17e64a){const _0x37570d=a54_0x487a;if(_0x17e64a)return _0x17e64a;return getCurrentSessionPID()[_0x37570d(0x91)]();}export function loadSessionContext(_0x12dded){const _0x3b2da2=a54_0x487a,_0x1e0097=_0x12dded||getCurrentSessionPID()['toString'](),_0x4df0bb=/^\d+$/[_0x3b2da2(0x82)](_0x1e0097)?parseInt(_0x1e0097,0xa):null;return _0x4df0bb!==null?loadSessionContextByPID(_0x4df0bb):loadSessionContextByString(_0x1e0097);}export function loadSessionContextByPID(_0xa65084){const _0x5bbbc1=a54_0x487a,_0x4aacbd=getSessionPath(_0xa65084);if(!a54_0x55a4d6[_0x5bbbc1(0x8d)](_0x4aacbd))return null;try{const _0x1223ef=a54_0x55a4d6[_0x5bbbc1(0x70)](_0x4aacbd,'utf-8'),_0x2e47c8=JSON[_0x5bbbc1(0x93)](_0x1223ef),_0x3ce994=new Date(_0x2e47c8[_0x5bbbc1(0x94)])[_0x5bbbc1(0x76)](),_0x30c75b=Date[_0x5bbbc1(0x8a)]();if(_0x30c75b-_0x3ce994>SESSION_EXPIRATION_MS)return a54_0x55a4d6[_0x5bbbc1(0x8c)](_0x4aacbd),null;const _0x512f7e=JSON[_0x5bbbc1(0x7c)](_0x2e47c8);if(_0x512f7e[_0x5bbbc1(0x7f)](_0x5bbbc1(0x7e))||_0x512f7e[_0x5bbbc1(0x7f)](_0x5bbbc1(0x73))||_0x512f7e[_0x5bbbc1(0x7f)](_0x5bbbc1(0x7d)))return console['warn'](_0x5bbbc1(0x71)+_0x4aacbd+_0x5bbbc1(0x8e)),a54_0x55a4d6['unlinkSync'](_0x4aacbd),null;return _0x2e47c8;}catch{try{a54_0x55a4d6[_0x5bbbc1(0x8c)](_0x4aacbd);}catch{}return null;}}function loadSessionContextByString(_0x39420e){const _0x24e0d3=a54_0x487a,_0x2c9334=a54_0x183ac4[_0x24e0d3(0x95)](getSessionsDir(),_0x39420e+_0x24e0d3(0x81));if(!a54_0x55a4d6[_0x24e0d3(0x8d)](_0x2c9334))return null;try{const _0x6e45f2=a54_0x55a4d6[_0x24e0d3(0x70)](_0x2c9334,'utf-8'),_0x4a3811=JSON[_0x24e0d3(0x93)](_0x6e45f2),_0x100810=new Date(_0x4a3811[_0x24e0d3(0x94)])['getTime'](),_0x196f22=Date[_0x24e0d3(0x8a)]();if(_0x196f22-_0x100810>SESSION_EXPIRATION_MS)return a54_0x55a4d6[_0x24e0d3(0x8c)](_0x2c9334),null;const _0x53f9ed=JSON['stringify'](_0x4a3811);if(_0x53f9ed[_0x24e0d3(0x7f)]('TD_API_KEY')||_0x53f9ed['includes'](_0x24e0d3(0x73))||_0x53f9ed[_0x24e0d3(0x7f)](_0x24e0d3(0x7d)))return console[_0x24e0d3(0x89)](_0x24e0d3(0x71)+_0x2c9334+'.\x20This\x20is\x20insecure.\x20Removing\x20session.'),a54_0x55a4d6['unlinkSync'](_0x2c9334),null;return _0x4a3811;}catch{try{a54_0x55a4d6['unlinkSync'](_0x2c9334);}catch{}return null;}}export function saveSessionContext(_0x5cf874,_0x3c9f1b){const _0x1290c3=a54_0x487a,_0x5083de=_0x3c9f1b||getCurrentSessionPID()[_0x1290c3(0x91)](),_0x664999=/^\d+$/[_0x1290c3(0x82)](_0x5083de)?parseInt(_0x5083de,0xa):getCurrentSessionPID(),_0x1ca8a0=a54_0x183ac4['join'](getSessionsDir(),_0x5083de+_0x1290c3(0x81)),_0x29b5c0=getSessionsDir();createSecureDirectory(_0x29b5c0);const _0x94b330=JSON[_0x1290c3(0x7c)](_0x5cf874);if(_0x94b330['includes']('TD_API_KEY')||_0x94b330[_0x1290c3(0x7f)](_0x1290c3(0x73))||_0x94b330[_0x1290c3(0x7f)](_0x1290c3(0x7d)))throw new Error(_0x1290c3(0x74));let _0x1c80f1;const _0x1844d1=/^\d+$/[_0x1290c3(0x82)](_0x5083de)?loadSessionContextByPID(parseInt(_0x5083de,0xa)):loadSessionContextByString(_0x5083de);_0x1844d1?_0x1c80f1={..._0x1844d1,..._0x5cf874,'pid':_0x664999,'sessionId':_0x5083de!==_0x664999[_0x1290c3(0x91)]()?_0x5083de:undefined,'updatedAt':new Date()[_0x1290c3(0x79)]()}:_0x1c80f1={'pid':_0x664999,'sessionId':_0x5083de!==_0x664999[_0x1290c3(0x91)]()?_0x5083de:undefined,..._0x5cf874,'createdAt':new Date()[_0x1290c3(0x79)](),'updatedAt':new Date()[_0x1290c3(0x79)]()},a54_0x55a4d6[_0x1290c3(0x78)](_0x1ca8a0,JSON['stringify'](_0x1c80f1,null,0x2));}export function clearSessionContext(_0x256036){const _0x2cf0e4=a54_0x487a,_0x2dc6a3=_0x256036||getCurrentSessionPID()['toString'](),_0x1bace8=a54_0x183ac4[_0x2cf0e4(0x95)](getSessionsDir(),_0x2dc6a3+_0x2cf0e4(0x81));a54_0x55a4d6['existsSync'](_0x1bace8)&&a54_0x55a4d6['unlinkSync'](_0x1bace8);}export function clearSessionContextField(_0x223ca6,_0x392496){const _0x3f9df3=a54_0x487a,_0x4a44b9=_0x392496||getCurrentSessionPID()['toString'](),_0x237f36=a54_0x183ac4[_0x3f9df3(0x95)](getSessionsDir(),_0x4a44b9+_0x3f9df3(0x81));if(!a54_0x55a4d6['existsSync'](_0x237f36))return;try{const _0x3d79ea=a54_0x55a4d6[_0x3f9df3(0x70)](_0x237f36,_0x3f9df3(0x6d)),_0x1d8004=JSON[_0x3f9df3(0x93)](_0x3d79ea);delete _0x1d8004[_0x223ca6],a54_0x55a4d6['writeFileSync'](_0x237f36,JSON[_0x3f9df3(0x7c)](_0x1d8004,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x262109=a54_0x487a,_0x2b8906=getSessionsDir();if(!a54_0x55a4d6[_0x262109(0x8d)](_0x2b8906))return 0x0;let _0x3445f8=0x0;const _0x28f43c=Date[_0x262109(0x8a)]();try{const _0x1f82c7=a54_0x55a4d6[_0x262109(0x92)](_0x2b8906);for(const _0x5661f0 of _0x1f82c7){if(!_0x5661f0[_0x262109(0x8b)](_0x262109(0x81)))continue;const _0x1adf78=a54_0x183ac4[_0x262109(0x95)](_0x2b8906,_0x5661f0),_0x546a98=_0x5661f0[_0x262109(0x7b)](_0x262109(0x81),''),_0x48af42=parseInt(_0x546a98,0xa),_0x44044a=!isNaN(_0x48af42);if(_0x44044a){if(!isProcessRunning(_0x48af42)){a54_0x55a4d6[_0x262109(0x8c)](_0x1adf78),_0x3445f8++;continue;}}try{const _0x49aa2b=a54_0x55a4d6[_0x262109(0x70)](_0x1adf78,_0x262109(0x6d)),_0x1105a8=JSON[_0x262109(0x93)](_0x49aa2b),_0x3923c4=new Date(_0x1105a8[_0x262109(0x94)])[_0x262109(0x76)]();_0x28f43c-_0x3923c4>SESSION_EXPIRATION_MS&&(a54_0x55a4d6[_0x262109(0x8c)](_0x1adf78),_0x3445f8++);}catch{a54_0x55a4d6[_0x262109(0x8c)](_0x1adf78),_0x3445f8++;}}}catch{}return _0x3445f8;}function a54_0x487a(_0x1ea75a,_0x51529b){_0x1ea75a=_0x1ea75a-0x6d;const _0xa54090=a54_0xa540();let _0x487a91=_0xa54090[_0x1ea75a];return _0x487a91;}export function listActiveSessions(){const _0x4e6228=a54_0x487a,_0x45942b=getSessionsDir();if(!a54_0x55a4d6[_0x4e6228(0x8d)](_0x45942b))return[];try{const _0x2407b5=a54_0x55a4d6[_0x4e6228(0x92)](_0x45942b),_0x3c39b0=[];for(const _0x18345d of _0x2407b5){if(!_0x18345d[_0x4e6228(0x8b)](_0x4e6228(0x81)))continue;const _0x5b9cfd=_0x18345d[_0x4e6228(0x7b)](_0x4e6228(0x81),''),_0x277e6b=parseInt(_0x5b9cfd,0xa);!isNaN(_0x277e6b)&&isProcessRunning(_0x277e6b)&&_0x3c39b0[_0x4e6228(0x6f)](_0x277e6b);}return _0x3c39b0[_0x4e6228(0x77)]((_0xb42a9c,_0x14403d)=>_0xb42a9c-_0x14403d);}catch{return[];}}
@@ -1 +1 @@
1
- const a54_0x10752d=a54_0x2432;(function(_0x18986d,_0x28a038){const _0x5aca5b=a54_0x2432,_0x33bd6b=_0x18986d();while(!![]){try{const _0x24fa0d=parseInt(_0x5aca5b(0x178))/0x1+parseInt(_0x5aca5b(0x17d))/0x2*(-parseInt(_0x5aca5b(0x179))/0x3)+-parseInt(_0x5aca5b(0x17c))/0x4+parseInt(_0x5aca5b(0x17f))/0x5+parseInt(_0x5aca5b(0x183))/0x6*(-parseInt(_0x5aca5b(0x17a))/0x7)+-parseInt(_0x5aca5b(0x17b))/0x8*(parseInt(_0x5aca5b(0x17e))/0x9)+parseInt(_0x5aca5b(0x185))/0xa*(parseInt(_0x5aca5b(0x182))/0xb);if(_0x24fa0d===_0x28a038)break;else _0x33bd6b['push'](_0x33bd6b['shift']());}catch(_0x161b9e){_0x33bd6b['push'](_0x33bd6b['shift']());}}}(a54_0x480a,0x8bd69));import{createProfileCache}from'../utils/global-cache.js';const userCache=createProfileCache(a54_0x10752d(0x184),'core/user-cache');function a54_0x480a(){const _0x33b2f5=['2477270KspjRx','now','read','66HXQSUk','6qqIUMG','users-{profile}.json','4813100GCOOlt','257729wYqLDN','3CVlkRa','5576711TSSvia','3647936gWicQO','3957244HPvynB','740596iDsVFL','18adMVna'];a54_0x480a=function(){return _0x33b2f5;};return a54_0x480a();}export function loadCachedUsers(_0x4b1fc0){const _0x13c897=a54_0x10752d,_0x3dcf2e=userCache[_0x13c897(0x181)](_0x4b1fc0);return _0x3dcf2e?.['users']??null;}function a54_0x2432(_0x3c607b,_0x4b6ae6){_0x3c607b=_0x3c607b-0x178;const _0x480a5b=a54_0x480a();let _0x24329e=_0x480a5b[_0x3c607b];return _0x24329e;}export function saveCachedUsers(_0x5eadd1,_0x7a8296){const _0x1088e6=a54_0x10752d;userCache['write'](_0x5eadd1,{'users':_0x7a8296,'cachedAt':Date[_0x1088e6(0x180)]()});}export function clearUserCache(_0x272696){userCache['clear'](_0x272696);}
1
+ function a55_0x4a51(){const _0x4d1de1=['2WOwRUE','3045147BERdLK','3210216WVwBuH','39915Fvqmhw','16hCAjCF','420odPbws','7181372GCBlIt','28NbrvdE','core/user-cache','write','888891rhokFU','101445XdCWZE','users-{profile}.json','1632684Jyqajm','clear'];a55_0x4a51=function(){return _0x4d1de1;};return a55_0x4a51();}function a55_0x3366(_0x4e94f3,_0x27de25){_0x4e94f3=_0x4e94f3-0x82;const _0x4a51f6=a55_0x4a51();let _0x3366e9=_0x4a51f6[_0x4e94f3];return _0x3366e9;}const a55_0x933823=a55_0x3366;(function(_0x1f9044,_0x38859a){const _0x4b9d3d=a55_0x3366,_0x3a0f86=_0x1f9044();while(!![]){try{const _0x20a71d=parseInt(_0x4b9d3d(0x87))/0x1*(parseInt(_0x4b9d3d(0x8c))/0x2)+parseInt(_0x4b9d3d(0x8a))/0x3+parseInt(_0x4b9d3d(0x84))/0x4*(-parseInt(_0x4b9d3d(0x88))/0x5)+parseInt(_0x4b9d3d(0x8e))/0x6+parseInt(_0x4b9d3d(0x8d))/0x7*(-parseInt(_0x4b9d3d(0x90))/0x8)+parseInt(_0x4b9d3d(0x8f))/0x9*(parseInt(_0x4b9d3d(0x82))/0xa)+-parseInt(_0x4b9d3d(0x83))/0xb;if(_0x20a71d===_0x38859a)break;else _0x3a0f86['push'](_0x3a0f86['shift']());}catch(_0x2a4426){_0x3a0f86['push'](_0x3a0f86['shift']());}}}(a55_0x4a51,0x77824));import{createProfileCache}from'../utils/global-cache.js';const userCache=createProfileCache(a55_0x933823(0x89),a55_0x933823(0x85));export function loadCachedUsers(_0x2347cb){const _0x2a4bb5=userCache['read'](_0x2347cb);return _0x2a4bb5?.['users']??null;}export function saveCachedUsers(_0x5ee0fc,_0x1c895d){const _0x117bef=a55_0x933823;userCache[_0x117bef(0x86)](_0x5ee0fc,{'users':_0x1c895d,'cachedAt':Date['now']()});}export function clearUserCache(_0x13cc6f){const _0x363c2f=a55_0x933823;userCache[_0x363c2f(0x8b)](_0x13cc6f);}
@@ -1 +1 @@
1
- function a55_0x1c55(){const _0x539a60=['.dev','48YfBPxN','10710258jzzxZB','3034115OewjUr','9OkGenz','parse','149176iDYMae','version','284045mWFYVR','6Qxftwc','2MwuHvj','1398105kAdTwa','20CDUmpH','90cJBQPd','739387IElueZ','includes','utf-8','0.0.0','990319wdBcjy','../../package.json'];a55_0x1c55=function(){return _0x539a60;};return a55_0x1c55();}(function(_0x1fb448,_0x2deb17){const _0x294a6a=a55_0x3d48,_0x171342=_0x1fb448();while(!![]){try{const _0x51a18f=parseInt(_0x294a6a(0x99))/0x1*(-parseInt(_0x294a6a(0x91))/0x2)+-parseInt(_0x294a6a(0x92))/0x3+parseInt(_0x294a6a(0x93))/0x4*(-parseInt(_0x294a6a(0x8f))/0x5)+-parseInt(_0x294a6a(0x90))/0x6*(parseInt(_0x294a6a(0x8a))/0x7)+-parseInt(_0x294a6a(0x8d))/0x8*(parseInt(_0x294a6a(0x8b))/0x9)+-parseInt(_0x294a6a(0x94))/0xa*(parseInt(_0x294a6a(0x95))/0xb)+-parseInt(_0x294a6a(0x88))/0xc*(-parseInt(_0x294a6a(0x89))/0xd);if(_0x51a18f===_0x2deb17)break;else _0x171342['push'](_0x171342['shift']());}catch(_0x491ea4){_0x171342['push'](_0x171342['shift']());}}}(a55_0x1c55,0x79964));import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';function a55_0x3d48(_0x4a4f57,_0x329d89){_0x4a4f57=_0x4a4f57-0x86;const _0x1c550f=a55_0x1c55();let _0x3d48d2=_0x1c550f[_0x4a4f57];return _0x3d48d2;}let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0x1d095c=a55_0x3d48;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x550b29=fileURLToPath(import.meta.url),_0x3e9ee1=dirname(_0x550b29);try{const _0x4b7fab=join(_0x3e9ee1,'../build-info.json');cachedBuildInfo=JSON[_0x1d095c(0x8c)](readFileSync(_0x4b7fab,_0x1d095c(0x97)));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0x5bbac1=a55_0x3d48;if(cachedVersion!==null)return cachedVersion;const _0x399b70=fileURLToPath(import.meta.url),_0x3501aa=dirname(_0x399b70),_0x3db71a=getBuildInfo();if(_0x3db71a[_0x5bbac1(0x8e)])return cachedVersion=_0x3db71a[_0x5bbac1(0x8e)],cachedVersion;try{const _0x43a540=join(_0x3501aa,_0x5bbac1(0x86)),_0xdf142e=JSON[_0x5bbac1(0x8c)](readFileSync(_0x43a540,_0x5bbac1(0x97)));cachedVersion=_0xdf142e[_0x5bbac1(0x8e)];}catch{cachedVersion=_0x5bbac1(0x98);}return cachedVersion;}export function isDevVersion(){const _0x1ccea7=a55_0x3d48,_0x29de6b=getVersion();return _0x29de6b[_0x1ccea7(0x96)](_0x1ccea7(0x87))||_0x29de6b[_0x1ccea7(0x96)]('-');}
1
+ (function(_0xf8414b,_0x5b6cd0){const _0x4d8d6e=a56_0x3106,_0x1caa0c=_0xf8414b();while(!![]){try{const _0x65e7bb=parseInt(_0x4d8d6e(0x195))/0x1*(-parseInt(_0x4d8d6e(0x188))/0x2)+-parseInt(_0x4d8d6e(0x18b))/0x3+parseInt(_0x4d8d6e(0x18a))/0x4+-parseInt(_0x4d8d6e(0x197))/0x5*(parseInt(_0x4d8d6e(0x189))/0x6)+parseInt(_0x4d8d6e(0x18c))/0x7*(parseInt(_0x4d8d6e(0x190))/0x8)+-parseInt(_0x4d8d6e(0x198))/0x9+parseInt(_0x4d8d6e(0x192))/0xa*(parseInt(_0x4d8d6e(0x191))/0xb);if(_0x65e7bb===_0x5b6cd0)break;else _0x1caa0c['push'](_0x1caa0c['shift']());}catch(_0x12c478){_0x1caa0c['push'](_0x1caa0c['shift']());}}}(a56_0x3939,0xa2148));import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0x5b2ac7=a56_0x3106;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x1e85a1=fileURLToPath(import.meta.url),_0x1da068=dirname(_0x1e85a1);try{const _0x2727c2=join(_0x1da068,_0x5b2ac7(0x18d));cachedBuildInfo=JSON['parse'](readFileSync(_0x2727c2,_0x5b2ac7(0x18e)));}catch{cachedBuildInfo={};}return cachedBuildInfo;}function a56_0x3106(_0x5a2e69,_0x210903){_0x5a2e69=_0x5a2e69-0x188;const _0x39398f=a56_0x3939();let _0x310682=_0x39398f[_0x5a2e69];return _0x310682;}export function getVersion(){const _0xc57c8e=a56_0x3106;if(cachedVersion!==null)return cachedVersion;const _0x1190ff=fileURLToPath(import.meta.url),_0x2320f8=dirname(_0x1190ff),_0x184dff=getBuildInfo();if(_0x184dff[_0xc57c8e(0x194)])return cachedVersion=_0x184dff['version'],cachedVersion;try{const _0x19b7a2=join(_0x2320f8,_0xc57c8e(0x196)),_0x4b3f92=JSON[_0xc57c8e(0x18f)](readFileSync(_0x19b7a2,_0xc57c8e(0x18e)));cachedVersion=_0x4b3f92[_0xc57c8e(0x194)];}catch{cachedVersion='0.0.0';}return cachedVersion;}export function isDevVersion(){const _0x108563=a56_0x3106,_0x1bde6a=getVersion();return _0x1bde6a[_0x108563(0x193)]('.dev')||_0x1bde6a[_0x108563(0x193)]('-');}function a56_0x3939(){const _0x232891=['15018110hzuzuV','includes','version','3794ybSbgE','../../package.json','1195QkPrwF','353052Yakbxu','456EpVeyt','7608czkKAR','1144048PTYNaN','3652809TJGuoz','28peKEix','../build-info.json','utf-8','parse','2601944BlejMI','11csqAhI'];a56_0x3939=function(){return _0x232891;};return a56_0x3939();}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- (function(_0xc03714,_0x472c24){var _0x435005=a56_0x1d7d,_0x1e8b49=_0xc03714();while(!![]){try{var _0x2f841d=-parseInt(_0x435005(0x9d))/0x1*(parseInt(_0x435005(0x9c))/0x2)+-parseInt(_0x435005(0x9f))/0x3+parseInt(_0x435005(0xa0))/0x4*(parseInt(_0x435005(0x99))/0x5)+-parseInt(_0x435005(0xa1))/0x6*(-parseInt(_0x435005(0x9a))/0x7)+-parseInt(_0x435005(0x98))/0x8+parseInt(_0x435005(0x9e))/0x9+parseInt(_0x435005(0x9b))/0xa;if(_0x2f841d===_0x472c24)break;else _0x1e8b49['push'](_0x1e8b49['shift']());}catch(_0x1db9f8){_0x1e8b49['push'](_0x1e8b49['shift']());}}}(a56_0x1251,0xf25bb));export*from'./sdk/types/index.js';export*from'./core/config.js';export*from'./core/auth.js';export*from'./sdk/client/http-client.js';export*from'./sdk/client/td-api-client.js';export{TrinoApiClient}from'./sdk/client/trino-api-client.js';export*from'./sdk/client/rate-limiter.js';export*from'./sdk/types/trino.js';function a56_0x1d7d(_0x4ab3e6,_0x42365e){_0x4ab3e6=_0x4ab3e6-0x98;var _0x12517d=a56_0x1251();var _0x1d7d30=_0x12517d[_0x4ab3e6];return _0x1d7d30;}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';function a56_0x1251(){var _0x1cb987=['1279rVAYTf','1110168tPhlGt','52404VqdfVF','4HznVRy','1746984LmGTiV','7604240ccUaMq','1997255SuonYi','42fmlIhO','5670250LlBtIj','1370CkvPAJ'];a56_0x1251=function(){return _0x1cb987;};return a56_0x1251();}export*from'./commands/activations.js';export*from'./commands/show.js';export*from'./commands/describe.js';export*from'./sdk/index.js';
1
+ (function(_0x4342cb,_0x453789){var _0x37092c=a57_0x400a,_0x463eed=_0x4342cb();while(!![]){try{var _0x3e1a69=-parseInt(_0x37092c(0x12c))/0x1+-parseInt(_0x37092c(0x129))/0x2*(-parseInt(_0x37092c(0x12a))/0x3)+-parseInt(_0x37092c(0x126))/0x4+-parseInt(_0x37092c(0x12d))/0x5+parseInt(_0x37092c(0x12e))/0x6+-parseInt(_0x37092c(0x127))/0x7*(-parseInt(_0x37092c(0x128))/0x8)+parseInt(_0x37092c(0x12b))/0x9;if(_0x3e1a69===_0x453789)break;else _0x463eed['push'](_0x463eed['shift']());}catch(_0x1a28d7){_0x463eed['push'](_0x463eed['shift']());}}}(a57_0x23dc,0xcbae2));export*from'./sdk/types/index.js';export*from'./core/config.js';export*from'./core/auth.js';export*from'./sdk/client/http-client.js';export*from'./sdk/client/td-api-client.js';export{TrinoApiClient}from'./sdk/client/trino-api-client.js';export*from'./sdk/client/rate-limiter.js';export*from'./sdk/types/trino.js';export*from'./commands/command.js';export*from'./commands/query-command.js';function a57_0x400a(_0x403360,_0x2548c8){_0x403360=_0x403360-0x126;var _0x23dced=a57_0x23dc();var _0x400afc=_0x23dced[_0x403360];return _0x400afc;}export*from'./commands/databases.js';export*from'./commands/tables.js';export*from'./commands/segments.js';export*from'./commands/activations.js';export*from'./commands/show.js';function a57_0x23dc(){var _0x8d76c9=['3421875TpEWaN','3946362nnpNUn','5177668KhrHwF','7mPnbpP','11811848ZzFYae','307114tlHUxr','3AKWCjt','12735225gbLxuS','889724mxzDfU'];a57_0x23dc=function(){return _0x8d76c9;};return a57_0x23dc();}export*from'./commands/describe.js';export*from'./sdk/index.js';