@treasuredata/tdx 2026.4.23 → 2026.5.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 (292) hide show
  1. package/README.md +5 -5
  2. package/dist/bin.js +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli.d.ts +1 -1
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +1 -1
  8. package/dist/cli.js.map +1 -1
  9. package/dist/commands/activations.js +1 -1
  10. package/dist/commands/agent-command.js +1 -1
  11. package/dist/commands/agent-test-command.js +1 -1
  12. package/dist/commands/api-command.d.ts +1 -1
  13. package/dist/commands/api-command.js +1 -1
  14. package/dist/commands/auth-command.js +1 -1
  15. package/dist/commands/cas-command.js +1 -1
  16. package/dist/commands/cas-segment-command.js +1 -1
  17. package/dist/commands/chat-command.js +1 -1
  18. package/dist/commands/claude-command.js +1 -1
  19. package/dist/commands/claude-command.js.map +1 -1
  20. package/dist/commands/claude-statusline-command.js +1 -1
  21. package/dist/commands/claude-usage-command.js +1 -1
  22. package/dist/commands/command.js +1 -1
  23. package/dist/commands/connection-command.js +1 -1
  24. package/dist/commands/databases.js +1 -1
  25. package/dist/commands/delivery-command.js +1 -1
  26. package/dist/commands/describe.js +1 -1
  27. package/dist/commands/engage-campaign-pull-command.js +1 -1
  28. package/dist/commands/engage-campaign-push-command.js +1 -1
  29. package/dist/commands/engage-campaign-validate-command.js +1 -1
  30. package/dist/commands/engage-command.js +1 -1
  31. package/dist/commands/engage-template-pull-command.js +1 -1
  32. package/dist/commands/engage-template-push-command.js +1 -1
  33. package/dist/commands/engage-template-validate-command.js +1 -1
  34. package/dist/commands/job-command.d.ts +1 -1
  35. package/dist/commands/job-command.js +1 -1
  36. package/dist/commands/journey-command.d.ts +1 -1
  37. package/dist/commands/journey-command.d.ts.map +1 -1
  38. package/dist/commands/journey-command.js +1 -1
  39. package/dist/commands/journey-command.js.map +1 -1
  40. package/dist/commands/journey-validate-command.js +1 -1
  41. package/dist/commands/llm-command.js +1 -1
  42. package/dist/commands/mcp-command.js +1 -1
  43. package/dist/commands/parent-segment-command.js +1 -1
  44. package/dist/commands/policy-command.js +1 -1
  45. package/dist/commands/profile-command.js +1 -1
  46. package/dist/commands/profiles-command.js +1 -1
  47. package/dist/commands/query-command.js +1 -1
  48. package/dist/commands/schedule-command.d.ts +1 -1
  49. package/dist/commands/schedule-command.js +1 -1
  50. package/dist/commands/segment-command.js +1 -1
  51. package/dist/commands/segment-create-command.js +1 -1
  52. package/dist/commands/segment-fields-command.js +1 -1
  53. package/dist/commands/segment-pull-command.d.ts +1 -1
  54. package/dist/commands/segment-pull-command.js +1 -1
  55. package/dist/commands/segment-push-command.d.ts +3 -3
  56. package/dist/commands/segment-push-command.d.ts.map +1 -1
  57. package/dist/commands/segment-push-command.js +1 -1
  58. package/dist/commands/segment-push-command.js.map +1 -1
  59. package/dist/commands/segment-update-command.js +1 -1
  60. package/dist/commands/segment-use-command.js +1 -1
  61. package/dist/commands/segment-validate-command.js +1 -1
  62. package/dist/commands/segments.js +1 -1
  63. package/dist/commands/show.js +1 -1
  64. package/dist/commands/status-command.js +1 -1
  65. package/dist/commands/table-deleted.d.ts +31 -0
  66. package/dist/commands/table-deleted.d.ts.map +1 -0
  67. package/dist/commands/table-deleted.js +1 -0
  68. package/dist/commands/table-deleted.js.map +1 -0
  69. package/dist/commands/tables.js +1 -1
  70. package/dist/commands/unset-command.js +1 -1
  71. package/dist/commands/upgrade-command.js +1 -1
  72. package/dist/commands/use-command.js +1 -1
  73. package/dist/commands/user-command.js +1 -1
  74. package/dist/commands/work-command.js +1 -1
  75. package/dist/commands/workflow-command.d.ts +5 -5
  76. package/dist/commands/workflow-command.d.ts.map +1 -1
  77. package/dist/commands/workflow-command.js +1 -1
  78. package/dist/commands/workflow-command.js.map +1 -1
  79. package/dist/core/auth.js +1 -1
  80. package/dist/core/command-output.js +1 -1
  81. package/dist/core/config.js +1 -1
  82. package/dist/core/connection-cache.js +1 -1
  83. package/dist/core/constants.js +1 -1
  84. package/dist/core/constants.js.map +1 -1
  85. package/dist/core/credential-cache.js +1 -1
  86. package/dist/core/global-context.js +1 -1
  87. package/dist/core/keychain.js +1 -1
  88. package/dist/core/oauth-keychain.js +1 -1
  89. package/dist/core/oauth.js +1 -1
  90. package/dist/core/profile.js +1 -1
  91. package/dist/core/project-config.js +1 -1
  92. package/dist/core/session.js +1 -1
  93. package/dist/core/user-cache.js +1 -1
  94. package/dist/core/version.js +1 -1
  95. package/dist/index.d.ts +1 -1
  96. package/dist/index.js +1 -1
  97. package/dist/mcp/server.js +1 -1
  98. package/dist/mcp/tools/index.js +1 -1
  99. package/dist/mcp/tools/tdx-run.js +1 -1
  100. package/dist/mcp/tools/tdx-search.js +1 -1
  101. package/dist/mcp/tools/work-create-item.js +1 -1
  102. package/dist/mcp/utils.js +1 -1
  103. package/dist/proxy/claude-usage-tracker.js +1 -1
  104. package/dist/proxy/passthrough-server.js +1 -1
  105. package/dist/proxy/sse-usage-parser.js +1 -1
  106. package/dist/sdk/agent/agent-config.js +1 -1
  107. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  108. package/dist/sdk/agent/agent-yaml.js +1 -1
  109. package/dist/sdk/agent/test/evaluator.js +1 -1
  110. package/dist/sdk/agent/test/executor.js +1 -1
  111. package/dist/sdk/agent/test/index.js +1 -1
  112. package/dist/sdk/agent/test/output.js +1 -1
  113. package/dist/sdk/agent/test/parser.js +1 -1
  114. package/dist/sdk/agent/tool-target-registry.js +1 -1
  115. package/dist/sdk/api.d.ts +1 -1
  116. package/dist/sdk/api.js +1 -1
  117. package/dist/sdk/cas/cas-api-client.js +1 -1
  118. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  119. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  120. package/dist/sdk/cas/index.js +1 -1
  121. package/dist/sdk/cas/pull-workflow.js +1 -1
  122. package/dist/sdk/cas/push-workflow.js +1 -1
  123. package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
  124. package/dist/sdk/client/cdp-api-client.js +1 -1
  125. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  126. package/dist/sdk/client/delivery-api-client.js +1 -1
  127. package/dist/sdk/client/endpoints.d.ts +1 -1
  128. package/dist/sdk/client/endpoints.js +1 -1
  129. package/dist/sdk/client/engage-api-client.js +1 -1
  130. package/dist/sdk/client/http-client.js +1 -1
  131. package/dist/sdk/client/llm-api-client.d.ts +1 -1
  132. package/dist/sdk/client/llm-api-client.js +1 -1
  133. package/dist/sdk/client/oauth-refresh.js +1 -1
  134. package/dist/sdk/client/rate-limiter.js +1 -1
  135. package/dist/sdk/client/td-api-client.d.ts +23 -2
  136. package/dist/sdk/client/td-api-client.d.ts.map +1 -1
  137. package/dist/sdk/client/td-api-client.js +1 -1
  138. package/dist/sdk/client/td-api-client.js.map +1 -1
  139. package/dist/sdk/client/trino-api-client.d.ts +1 -1
  140. package/dist/sdk/client/trino-api-client.js +1 -1
  141. package/dist/sdk/client/trino-api-client.js.map +1 -1
  142. package/dist/sdk/client/workflow-client.d.ts +2 -2
  143. package/dist/sdk/client/workflow-client.js +1 -1
  144. package/dist/sdk/connection-validator.js +1 -1
  145. package/dist/sdk/connection.js +1 -1
  146. package/dist/sdk/delivery.js +1 -1
  147. package/dist/sdk/engage/campaign-pull.js +1 -1
  148. package/dist/sdk/engage/campaign-push.js +1 -1
  149. package/dist/sdk/engage/campaign-validator.js +1 -1
  150. package/dist/sdk/engage/campaign-yaml.js +1 -1
  151. package/dist/sdk/engage/template-pull.js +1 -1
  152. package/dist/sdk/engage/template-push.js +1 -1
  153. package/dist/sdk/engage/template-validator.js +1 -1
  154. package/dist/sdk/engage/template-yaml.js +1 -1
  155. package/dist/sdk/engage/types/campaign-def.js +1 -1
  156. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  157. package/dist/sdk/engage/types/template-schema.js +1 -1
  158. package/dist/sdk/engage.js +1 -1
  159. package/dist/sdk/errors.js +1 -1
  160. package/dist/sdk/index.d.ts +2 -2
  161. package/dist/sdk/index.js +1 -1
  162. package/dist/sdk/io/index.js +1 -1
  163. package/dist/sdk/io/node-filesystem.js +1 -1
  164. package/dist/sdk/job.js +1 -1
  165. package/dist/sdk/journey.js +1 -1
  166. package/dist/sdk/llm/chat-cache.js +1 -1
  167. package/dist/sdk/llm/index.d.ts.map +1 -1
  168. package/dist/sdk/llm/index.js +1 -1
  169. package/dist/sdk/llm/index.js.map +1 -1
  170. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  171. package/dist/sdk/llm/model-factors.js +1 -1
  172. package/dist/sdk/llm/user-settings.d.ts +3 -0
  173. package/dist/sdk/llm/user-settings.d.ts.map +1 -0
  174. package/dist/sdk/llm/user-settings.js +1 -0
  175. package/dist/sdk/llm/user-settings.js.map +1 -0
  176. package/dist/sdk/personalization.js +1 -1
  177. package/dist/sdk/policy.js +1 -1
  178. package/dist/sdk/query/deleted-table-validation.d.ts +19 -0
  179. package/dist/sdk/query/deleted-table-validation.d.ts.map +1 -0
  180. package/dist/sdk/query/deleted-table-validation.js +1 -0
  181. package/dist/sdk/query/deleted-table-validation.js.map +1 -0
  182. package/dist/sdk/query/index.d.ts +43 -0
  183. package/dist/sdk/query/index.d.ts.map +1 -1
  184. package/dist/sdk/query/index.js +1 -1
  185. package/dist/sdk/query/index.js.map +1 -1
  186. package/dist/sdk/query/sql-parser.js +1 -1
  187. package/dist/sdk/realtime.js +1 -1
  188. package/dist/sdk/schedule.js +1 -1
  189. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  190. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  191. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  192. package/dist/sdk/segment/fields-display.js +1 -1
  193. package/dist/sdk/segment/file-discovery.js +1 -1
  194. package/dist/sdk/segment/journey-utils.js +1 -1
  195. package/dist/sdk/segment/journey-validator.js +1 -1
  196. package/dist/sdk/segment/journey-yaml.js +1 -1
  197. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  198. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  199. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  200. package/dist/sdk/segment/pull-workflow.d.ts +2 -2
  201. package/dist/sdk/segment/pull-workflow.js +1 -1
  202. package/dist/sdk/segment/push-recovery.js +1 -1
  203. package/dist/sdk/segment/push-workflow.d.ts +1 -1
  204. package/dist/sdk/segment/push-workflow.js +1 -1
  205. package/dist/sdk/segment/resolution-context.js +1 -1
  206. package/dist/sdk/segment/segment-path-parser.js +1 -1
  207. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  208. package/dist/sdk/segment/segment-validator.js +1 -1
  209. package/dist/sdk/segment/segment-validator.js.map +1 -1
  210. package/dist/sdk/segment/target-resolution.js +1 -1
  211. package/dist/sdk/segment/tdx-config.js +1 -1
  212. package/dist/sdk/segment/types/activation-schema.js +1 -1
  213. package/dist/sdk/segment/types/journey-def.js +1 -1
  214. package/dist/sdk/segment/types/journey-schema.js +1 -1
  215. package/dist/sdk/segment/types/segment-def.js +1 -1
  216. package/dist/sdk/segment/types/segment-schema.d.ts +4 -2
  217. package/dist/sdk/segment/types/segment-schema.d.ts.map +1 -1
  218. package/dist/sdk/segment/types/segment-schema.js +1 -1
  219. package/dist/sdk/segment/types/segment-schema.js.map +1 -1
  220. package/dist/sdk/segment/validate-files.js +1 -1
  221. package/dist/sdk/segment/yaml-validator.js +1 -1
  222. package/dist/sdk/segment.d.ts +1 -1
  223. package/dist/sdk/segment.js +1 -1
  224. package/dist/sdk/types/cdp.d.ts +7 -3
  225. package/dist/sdk/types/cdp.d.ts.map +1 -1
  226. package/dist/sdk/types/connection.d.ts +1 -1
  227. package/dist/sdk/types/database.d.ts +28 -0
  228. package/dist/sdk/types/database.d.ts.map +1 -1
  229. package/dist/sdk/types/index.d.ts +1 -1
  230. package/dist/sdk/types/index.d.ts.map +1 -1
  231. package/dist/sdk/types/index.js +1 -1
  232. package/dist/sdk/types/llm.d.ts +7 -3
  233. package/dist/sdk/types/llm.d.ts.map +1 -1
  234. package/dist/sdk/types/progress.js +1 -1
  235. package/dist/sdk/types/workspace.js +1 -1
  236. package/dist/sdk/user.js +1 -1
  237. package/dist/sdk/util/format-detector.js +1 -1
  238. package/dist/sdk/util/formatters.js +1 -1
  239. package/dist/sdk/util/index.js +1 -1
  240. package/dist/sdk/util/paginate.js +1 -1
  241. package/dist/sdk/util/tree-formatter.js +1 -1
  242. package/dist/sdk/workflow/archive-validation.js +1 -1
  243. package/dist/sdk/workflow/clone-workflow.js +1 -1
  244. package/dist/sdk/workflow/index.d.ts +2 -2
  245. package/dist/sdk/workflow/index.d.ts.map +1 -1
  246. package/dist/sdk/workflow/index.js +1 -1
  247. package/dist/sdk/workflow/index.js.map +1 -1
  248. package/dist/sdk/workflow/pull-workflow.js +1 -1
  249. package/dist/sdk/workflow/push-workflow.js +1 -1
  250. package/dist/sdk/workflow/task-graph.js +1 -1
  251. package/dist/sdk/workflow/tdx-config.js +1 -1
  252. package/dist/sdk/workflow/workflow-utils.js +1 -1
  253. package/dist/sdk/workspace/access-tracker.js +1 -1
  254. package/dist/sdk/workspace/frontmatter.js +1 -1
  255. package/dist/sdk/workspace/git.js +1 -1
  256. package/dist/sdk/workspace/index.js +1 -1
  257. package/dist/sdk/workspace/templates.js +1 -1
  258. package/dist/sdk/workspace/weekly.js +1 -1
  259. package/dist/sdk/workspace/wikilinks.js +1 -1
  260. package/dist/test-utils/command-runner.js +1 -1
  261. package/dist/test-utils/factories.js +1 -1
  262. package/dist/test-utils/fixtures.js +1 -1
  263. package/dist/test-utils/http-mock.js +1 -1
  264. package/dist/test-utils/index.js +1 -1
  265. package/dist/utils/async.js +1 -1
  266. package/dist/utils/colors.js +1 -1
  267. package/dist/utils/diff.js +1 -1
  268. package/dist/utils/file-permissions.js +1 -1
  269. package/dist/utils/file-reader.js +1 -1
  270. package/dist/utils/github-releases.js +1 -1
  271. package/dist/utils/global-cache.js +1 -1
  272. package/dist/utils/json-loader.js +1 -1
  273. package/dist/utils/local-cache.js +1 -1
  274. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  275. package/dist/utils/logger/formatters/index.js +1 -1
  276. package/dist/utils/logger/handlers/console-handler.js +1 -1
  277. package/dist/utils/logger/handlers/file-handler.js +1 -1
  278. package/dist/utils/logger/handlers/index.js +1 -1
  279. package/dist/utils/logger/handlers/null-handler.js +1 -1
  280. package/dist/utils/logger/index.js +1 -1
  281. package/dist/utils/logger/logger.js +1 -1
  282. package/dist/utils/logger/types.js +1 -1
  283. package/dist/utils/option-validation.js +1 -1
  284. package/dist/utils/process.js +1 -1
  285. package/dist/utils/prompt.js +1 -1
  286. package/dist/utils/spinner.js +1 -1
  287. package/dist/utils/sse-parser.js +1 -1
  288. package/dist/utils/string-utils.js +1 -1
  289. package/dist/utils/table-ref-parser.js +1 -1
  290. package/dist/utils/tdx-logger.js +1 -1
  291. package/dist/utils/version-check.js +1 -1
  292. package/package.json +17 -12
@@ -1 +1 @@
1
- const a58_0x5b1f03=a58_0x1b5f;function a58_0x1b5f(_0xeba5c2,_0x235f24){_0xeba5c2=_0xeba5c2-0x1c6;const _0x4bf9c4=a58_0x4bf9();let _0x1b5f65=_0x4bf9c4[_0xeba5c2];return _0x1b5f65;}(function(_0x127e16,_0x46f7f5){const _0x5605aa=a58_0x1b5f,_0x1f7ff1=_0x127e16();while(!![]){try{const _0x4f5527=-parseInt(_0x5605aa(0x1c7))/0x1*(-parseInt(_0x5605aa(0x1c8))/0x2)+parseInt(_0x5605aa(0x1d9))/0x3*(-parseInt(_0x5605aa(0x1ca))/0x4)+-parseInt(_0x5605aa(0x1c6))/0x5*(parseInt(_0x5605aa(0x1d8))/0x6)+parseInt(_0x5605aa(0x1cd))/0x7*(-parseInt(_0x5605aa(0x1d5))/0x8)+-parseInt(_0x5605aa(0x1cc))/0x9+-parseInt(_0x5605aa(0x1d3))/0xa*(parseInt(_0x5605aa(0x1cb))/0xb)+-parseInt(_0x5605aa(0x1c9))/0xc*(-parseInt(_0x5605aa(0x1ce))/0xd);if(_0x4f5527===_0x46f7f5)break;else _0x1f7ff1['push'](_0x1f7ff1['shift']());}catch(_0x4f99ab){_0x1f7ff1['push'](_0x1f7ff1['shift']());}}}(a58_0x4bf9,0xb78a3));import{createProfileCache}from'../utils/global-cache.js';const connectionCache=createProfileCache(a58_0x5b1f03(0x1d2),a58_0x5b1f03(0x1d1));function a58_0x4bf9(){const _0x5417c1=['107393UXPZGu','clear','now','core/connection-cache','connections-{profile}.json','10430lqEwNU','write','8XbOkQP','connections','read','72iUxGCl','859146MaJFrd','504345DCLKeo','590388RvZxCq','2vuUBIK','7704ZwcIQM','16szFksw','15389YmnOFS','24291uLWkpy','9270513vtufkk'];a58_0x4bf9=function(){return _0x5417c1;};return a58_0x4bf9();}export function loadCachedConnections(_0x5aaf86){const _0xa74611=a58_0x5b1f03,_0x5b645d=connectionCache[_0xa74611(0x1d7)](_0x5aaf86);return _0x5b645d?.[_0xa74611(0x1d6)]??null;}export function saveCachedConnections(_0x2ff51e,_0x52b8d5){const _0x49c748=a58_0x5b1f03;connectionCache[_0x49c748(0x1d4)](_0x2ff51e,{'connections':_0x52b8d5,'cachedAt':Date[_0x49c748(0x1d0)]()});}export function clearConnectionCache(_0x3a59bd){const _0x5b52ed=a58_0x5b1f03;connectionCache[_0x5b52ed(0x1cf)](_0x3a59bd);}
1
+ function a59_0x24e6(_0x4747d3,_0x4cd0ec){_0x4747d3=_0x4747d3-0x12c;const _0x46d2db=a59_0x46d2();let _0x24e6c2=_0x46d2db[_0x4747d3];return _0x24e6c2;}const a59_0x3bcb63=a59_0x24e6;(function(_0x1fad34,_0x15f3e5){const _0x18155d=a59_0x24e6,_0x4300a8=_0x1fad34();while(!![]){try{const _0x229622=parseInt(_0x18155d(0x133))/0x1+parseInt(_0x18155d(0x134))/0x2+-parseInt(_0x18155d(0x131))/0x3*(-parseInt(_0x18155d(0x135))/0x4)+parseInt(_0x18155d(0x139))/0x5+parseInt(_0x18155d(0x132))/0x6+-parseInt(_0x18155d(0x12e))/0x7*(-parseInt(_0x18155d(0x136))/0x8)+-parseInt(_0x18155d(0x12d))/0x9;if(_0x229622===_0x15f3e5)break;else _0x4300a8['push'](_0x4300a8['shift']());}catch(_0x4d4e30){_0x4300a8['push'](_0x4300a8['shift']());}}}(a59_0x46d2,0xb596c));function a59_0x46d2(){const _0x47d9d0=['819SlZyHm','core/connection-cache','read','2079669HQLOgM','2302884QQGdyn','593893jPulqQ','154086zXCeSd','4spFNdA','32968DiXEWu','now','write','3023730BYSCcu','connections','clear','18819792ZyfELX'];a59_0x46d2=function(){return _0x47d9d0;};return a59_0x46d2();}import{createProfileCache}from'../utils/global-cache.js';const connectionCache=createProfileCache('connections-{profile}.json',a59_0x3bcb63(0x12f));export function loadCachedConnections(_0x1a2f5a){const _0x2a7642=a59_0x3bcb63,_0x36c19b=connectionCache[_0x2a7642(0x130)](_0x1a2f5a);return _0x36c19b?.[_0x2a7642(0x13a)]??null;}export function saveCachedConnections(_0x4a354e,_0x43a4d9){const _0xee8b48=a59_0x3bcb63;connectionCache[_0xee8b48(0x138)](_0x4a354e,{'connections':_0x43a4d9,'cachedAt':Date[_0xee8b48(0x137)]()});}export function clearConnectionCache(_0x36df17){const _0x45b196=a59_0x3bcb63;connectionCache[_0x45b196(0x12c)](_0x36df17);}
@@ -1 +1 @@
1
- const a59_0x30b49e=a59_0x4e0a;(function(_0x26b2d4,_0x3cd8d8){const _0x8880d9=a59_0x4e0a,_0x8ff67f=_0x26b2d4();while(!![]){try{const _0x2c49f7=parseInt(_0x8880d9(0xa2))/0x1+parseInt(_0x8880d9(0xba))/0x2+parseInt(_0x8880d9(0xbd))/0x3*(parseInt(_0x8880d9(0xb8))/0x4)+parseInt(_0x8880d9(0xa8))/0x5*(parseInt(_0x8880d9(0xaf))/0x6)+parseInt(_0x8880d9(0xb2))/0x7+parseInt(_0x8880d9(0xb4))/0x8*(parseInt(_0x8880d9(0xbb))/0x9)+-parseInt(_0x8880d9(0xb7))/0xa;if(_0x2c49f7===_0x3cd8d8)break;else _0x8ff67f['push'](_0x8ff67f['shift']());}catch(_0x21a205){_0x8ff67f['push'](_0x8ff67f['shift']());}}}(a59_0x2b52,0x3703a));import a59_0x48abc9 from'prompts';export const DEFAULT_DISPLAY_LIMIT=0x28;function a59_0x2b52(){const _0x1a6f4b=['ap01','Select\x20your\x20Treasure\x20Data\x20site:','Cancelled','132uapMtq','log','test','3035347VBxxRH','length','1365368lomoaT','jp\x20\x20\x20-\x20Japan','eu\x20\x20\x20-\x20Europe','11481290mRwVtn','238904rWBbds','findIndex','549740Gsuvny','9mnwMGv','us\x20\x20\x20-\x20United\x20States','18iHEqRX','trim','value','push','Site\x20name\x20cannot\x20be\x20empty','24827dcNAew','customSite','select','us01','other','eu01','25255afrqbQ','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','site'];a59_0x2b52=function(){return _0x1a6f4b;};return a59_0x2b52();}export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0xe0f454,_0x3a6ec2){if(_0xe0f454===undefined)return _0x3a6ec2;if(typeof _0xe0f454==='number')return _0xe0f454;return parseInt(_0xe0f454,0xa);}export const STANDARD_SITE_CHOICES=[{'title':a59_0x30b49e(0xbc),'value':'us01'},{'title':a59_0x30b49e(0xb5),'value':a59_0x30b49e(0xac)},{'title':a59_0x30b49e(0xb6),'value':a59_0x30b49e(0xa7)},{'title':'ap02\x20-\x20Korea','value':'ap02'}];function a59_0x4e0a(_0x3eaedc,_0x257e65){_0x3eaedc=_0x3eaedc-0x9e;const _0x2b52ae=a59_0x2b52();let _0x4e0aab=_0x2b52ae[_0x3eaedc];return _0x4e0aab;}export function buildSiteChoices(_0x2fd431){const _0x440dac=a59_0x30b49e,_0x1ca05f=[...STANDARD_SITE_CHOICES];let _0x18034d=_0x1ca05f[_0x440dac(0xb9)](_0x385b63=>_0x385b63[_0x440dac(0x9f)]===_0x2fd431);return _0x18034d===-0x1&&_0x2fd431!==_0x440dac(0xa5)&&(_0x1ca05f['push']({'title':_0x2fd431,'value':_0x2fd431}),_0x18034d=_0x1ca05f[_0x440dac(0xb3)]-0x1),_0x1ca05f[_0x440dac(0xa0)]({'title':'Enter\x20custom\x20site','value':'other'}),{'choices':_0x1ca05f,'initialIndex':_0x18034d>=0x0?_0x18034d:0x0};}export async function promptSiteSelection(_0x2b5916,_0x2461a2,_0x4a4751=a59_0x30b49e(0xae)){const _0x1a9372=a59_0x30b49e,{choices:_0xcc250a,initialIndex:_0x1825a3}=buildSiteChoices(_0x2b5916),_0x36198e=_0x2461a2?_0x1a9372(0xa9)+_0x2461a2+'):':_0x1a9372(0xad),_0x60b4b8=await a59_0x48abc9({'type':_0x1a9372(0xa4),'name':_0x1a9372(0xab),'message':_0x36198e,'choices':_0xcc250a,'initial':_0x1825a3});if(!_0x60b4b8['site'])return console['log']('\x0a'+_0x4a4751),null;if(_0x60b4b8[_0x1a9372(0xab)]!==_0x1a9372(0xa6))return _0x60b4b8[_0x1a9372(0xab)];const _0xfaa9e7=await a59_0x48abc9({'type':'text','name':_0x1a9372(0xa3),'message':'Enter\x20site\x20name:','initial':_0x1a9372(0xa5),'validate':_0x273a98=>{const _0x228c23=_0x1a9372;if(!_0x273a98||!_0x273a98[_0x228c23(0x9e)]())return _0x228c23(0xa1);if(!/^[a-z0-9-]+$/[_0x228c23(0xb1)](_0x273a98['trim']()))return _0x228c23(0xaa);return!![];}});if(!_0xfaa9e7[_0x1a9372(0xa3)])return console[_0x1a9372(0xb0)]('\x0a'+_0x4a4751),null;return _0xfaa9e7[_0x1a9372(0xa3)];}
1
+ const a60_0x1faa14=a60_0x494b;(function(_0x486f41,_0x4711a9){const _0x59f18d=a60_0x494b,_0x25d1a3=_0x486f41();while(!![]){try{const _0x41f14c=parseInt(_0x59f18d(0x14f))/0x1+-parseInt(_0x59f18d(0x135))/0x2+parseInt(_0x59f18d(0x13f))/0x3*(parseInt(_0x59f18d(0x137))/0x4)+-parseInt(_0x59f18d(0x144))/0x5*(-parseInt(_0x59f18d(0x154))/0x6)+-parseInt(_0x59f18d(0x138))/0x7*(-parseInt(_0x59f18d(0x146))/0x8)+parseInt(_0x59f18d(0x150))/0x9*(parseInt(_0x59f18d(0x139))/0xa)+-parseInt(_0x59f18d(0x148))/0xb*(parseInt(_0x59f18d(0x13b))/0xc);if(_0x41f14c===_0x4711a9)break;else _0x25d1a3['push'](_0x25d1a3['shift']());}catch(_0x42ff3d){_0x25d1a3['push'](_0x25d1a3['shift']());}}}(a60_0x3cd6,0x697fb));function a60_0x494b(_0x18e798,_0x692f3b){_0x18e798=_0x18e798-0x134;const _0x3cd6f0=a60_0x3cd6();let _0x494beb=_0x3cd6f0[_0x18e798];return _0x494beb;}import a60_0x39c518 from'prompts';export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x193498,_0x10bfed){const _0x50de37=a60_0x494b;if(_0x193498===undefined)return _0x10bfed;if(typeof _0x193498===_0x50de37(0x13e))return _0x193498;return parseInt(_0x193498,0xa);}function a60_0x3cd6(){const _0x41df8a=['number','2404011iLrBPD','jp\x20\x20\x20-\x20Japan','site','ap02','Enter\x20site\x20name:','1785oyHkLj','trim','248tMKzKZ','Select\x20your\x20Treasure\x20AI\x20site\x20(for\x20profile:\x20','30151jJCvOX','other','push','length','eu01','Select\x20your\x20Treasure\x20AI\x20site:','us01','553313MeCpWr','13617LGfDna','customSite','text','log','7320UJxQJW','findIndex','eu\x20\x20\x20-\x20Europe','1358172igGbzZ','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','4rDiTDl','2926oROtXn','300FBEFtN','test','3228KMvyRj','value','select'];a60_0x3cd6=function(){return _0x41df8a;};return a60_0x3cd6();}export const STANDARD_SITE_CHOICES=[{'title':'us\x20\x20\x20-\x20United\x20States','value':'us01'},{'title':a60_0x1faa14(0x140),'value':'ap01'},{'title':a60_0x1faa14(0x134),'value':a60_0x1faa14(0x14c)},{'title':'ap02\x20-\x20Korea','value':a60_0x1faa14(0x142)}];export function buildSiteChoices(_0x111986){const _0x5576ee=a60_0x1faa14,_0x1aaca3=[...STANDARD_SITE_CHOICES];let _0x4851d2=_0x1aaca3[_0x5576ee(0x155)](_0x4a766=>_0x4a766[_0x5576ee(0x13c)]===_0x111986);return _0x4851d2===-0x1&&_0x111986!==_0x5576ee(0x14e)&&(_0x1aaca3[_0x5576ee(0x14a)]({'title':_0x111986,'value':_0x111986}),_0x4851d2=_0x1aaca3[_0x5576ee(0x14b)]-0x1),_0x1aaca3['push']({'title':'Enter\x20custom\x20site','value':_0x5576ee(0x149)}),{'choices':_0x1aaca3,'initialIndex':_0x4851d2>=0x0?_0x4851d2:0x0};}export async function promptSiteSelection(_0x23a48c,_0x3ed3e4,_0x101954='Cancelled'){const _0x3db590=a60_0x1faa14,{choices:_0x55929d,initialIndex:_0x7c83c0}=buildSiteChoices(_0x23a48c),_0x2fbf69=_0x3ed3e4?_0x3db590(0x147)+_0x3ed3e4+'):':_0x3db590(0x14d),_0x3d5ada=await a60_0x39c518({'type':_0x3db590(0x13d),'name':_0x3db590(0x141),'message':_0x2fbf69,'choices':_0x55929d,'initial':_0x7c83c0});if(!_0x3d5ada[_0x3db590(0x141)])return console[_0x3db590(0x153)]('\x0a'+_0x101954),null;if(_0x3d5ada[_0x3db590(0x141)]!==_0x3db590(0x149))return _0x3d5ada[_0x3db590(0x141)];const _0x54f688=await a60_0x39c518({'type':_0x3db590(0x152),'name':'customSite','message':_0x3db590(0x143),'initial':_0x3db590(0x14e),'validate':_0x1d5352=>{const _0xba1edf=_0x3db590;if(!_0x1d5352||!_0x1d5352['trim']())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/[_0xba1edf(0x13a)](_0x1d5352[_0xba1edf(0x145)]()))return _0xba1edf(0x136);return!![];}});if(!_0x54f688[_0x3db590(0x151)])return console[_0x3db590(0x153)]('\x0a'+_0x101954),null;return _0x54f688[_0x3db590(0x151)];}
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/core/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAExC;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAE3C;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAEpC;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,KAAkC,EAAE,YAAoB;IACnF,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAA4C;IAC5E,EAAE,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,MAAM,EAAE;IAChD,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE;IACxC,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE;IACzC,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE;CACzC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,WAAmB;IAIlD,MAAM,OAAO,GAAG,CAAC,GAAG,qBAAqB,CAAC,CAAC;IAE3C,IAAI,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,WAAW,CAAC,CAAC;IAC/E,IAAI,YAAY,KAAK,CAAC,CAAC,IAAI,WAAW,KAAK,MAAM,EAAE,CAAC;QAClD,iDAAiD;QACjD,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC;QACzD,YAAY,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IACpC,CAAC;IAED,8CAA8C;IAC9C,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;IAE7D,OAAO;QACL,OAAO;QACP,YAAY,EAAE,YAAY,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;KACnD,CAAC;AACJ,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,WAAmB,EACnB,OAAgB,EAChB,aAAa,GAAG,WAAW;IAE3B,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC;IAE7E,MAAM,iBAAiB,GAAG,OAAO;QAC/B,CAAC,CAAC,gDAAgD,OAAO,IAAI;QAC7D,CAAC,CAAC,iCAAiC,CAAC;IAEtC,MAAM,YAAY,GAAG,MAAM,OAAO,CAAC;QACjC,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,iBAAiB;QAC1B,OAAO,EAAE,WAAW;QACpB,OAAO,EAAE,YAAY;KACtB,CAAC,CAAC;IAEH,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;QACvB,OAAO,CAAC,GAAG,CAAC,KAAK,aAAa,EAAE,CAAC,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,YAAY,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAClC,OAAO,YAAY,CAAC,IAAI,CAAC;IAC3B,CAAC;IAED,oBAAoB;IACpB,MAAM,kBAAkB,GAAG,MAAM,OAAO,CAAC;QACvC,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,kBAAkB;QAC3B,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;YAClB,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;gBAC5B,OAAO,2BAA2B,CAAC;YACrC,CAAC;YACD,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;gBACvC,OAAO,qEAAqE,CAAC;YAC/E,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC,CAAC;IAEH,IAAI,CAAC,kBAAkB,CAAC,UAAU,EAAE,CAAC;QACnC,OAAO,CAAC,GAAG,CAAC,KAAK,aAAa,EAAE,CAAC,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,kBAAkB,CAAC,UAAU,CAAC;AACvC,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/core/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAExC;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAE3C;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAEpC;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,KAAkC,EAAE,YAAoB;IACnF,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAA4C;IAC5E,EAAE,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,MAAM,EAAE;IAChD,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE;IACxC,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE;IACzC,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE;CACzC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,WAAmB;IAIlD,MAAM,OAAO,GAAG,CAAC,GAAG,qBAAqB,CAAC,CAAC;IAE3C,IAAI,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,WAAW,CAAC,CAAC;IAC/E,IAAI,YAAY,KAAK,CAAC,CAAC,IAAI,WAAW,KAAK,MAAM,EAAE,CAAC;QAClD,iDAAiD;QACjD,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC;QACzD,YAAY,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IACpC,CAAC;IAED,8CAA8C;IAC9C,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;IAE7D,OAAO;QACL,OAAO;QACP,YAAY,EAAE,YAAY,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;KACnD,CAAC;AACJ,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,WAAmB,EACnB,OAAgB,EAChB,aAAa,GAAG,WAAW;IAE3B,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC;IAE7E,MAAM,iBAAiB,GAAG,OAAO;QAC/B,CAAC,CAAC,8CAA8C,OAAO,IAAI;QAC3D,CAAC,CAAC,+BAA+B,CAAC;IAEpC,MAAM,YAAY,GAAG,MAAM,OAAO,CAAC;QACjC,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,iBAAiB;QAC1B,OAAO,EAAE,WAAW;QACpB,OAAO,EAAE,YAAY;KACtB,CAAC,CAAC;IAEH,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;QACvB,OAAO,CAAC,GAAG,CAAC,KAAK,aAAa,EAAE,CAAC,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,YAAY,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAClC,OAAO,YAAY,CAAC,IAAI,CAAC;IAC3B,CAAC;IAED,oBAAoB;IACpB,MAAM,kBAAkB,GAAG,MAAM,OAAO,CAAC;QACvC,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,kBAAkB;QAC3B,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;YAClB,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;gBAC5B,OAAO,2BAA2B,CAAC;YACrC,CAAC;YACD,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;gBACvC,OAAO,qEAAqE,CAAC;YAC/E,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC,CAAC;IAEH,IAAI,CAAC,kBAAkB,CAAC,UAAU,EAAE,CAAC;QACnC,OAAO,CAAC,GAAG,CAAC,KAAK,aAAa,EAAE,CAAC,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,kBAAkB,CAAC,UAAU,CAAC;AACvC,CAAC"}
@@ -1 +1 @@
1
- (function(_0x21d66c,_0x1b153f){const _0x2e0566=a60_0x3892,_0x8151cd=_0x21d66c();while(!![]){try{const _0x384fe8=-parseInt(_0x2e0566(0x107))/0x1+parseInt(_0x2e0566(0x101))/0x2*(parseInt(_0x2e0566(0x103))/0x3)+-parseInt(_0x2e0566(0xf7))/0x4*(parseInt(_0x2e0566(0xfa))/0x5)+parseInt(_0x2e0566(0xf9))/0x6+parseInt(_0x2e0566(0xfb))/0x7*(-parseInt(_0x2e0566(0x106))/0x8)+-parseInt(_0x2e0566(0x102))/0x9*(-parseInt(_0x2e0566(0xf6))/0xa)+parseInt(_0x2e0566(0xfd))/0xb*(parseInt(_0x2e0566(0xfc))/0xc);if(_0x384fe8===_0x1b153f)break;else _0x8151cd['push'](_0x8151cd['shift']());}catch(_0x3d9f71){_0x8151cd['push'](_0x8151cd['shift']());}}}(a60_0x6678,0x9d295));function a60_0x3892(_0x39eff7,_0x404f81){_0x39eff7=_0x39eff7-0xf5;const _0x6678c3=a60_0x6678();let _0x389233=_0x6678c3[_0x39eff7];return _0x389233;}const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x3a22f5,_0x10b855){const _0x551fa8=a60_0x3892,_0x20b343=_0x3a22f5||_0x551fa8(0x104),_0x271d39=_0x10b855||_0x551fa8(0xff);return _0x20b343+':'+_0x271d39;}export function getCachedCredential(_0x4d5e67,_0x5a3ca1){const _0x33265d=a60_0x3892,_0x3d202c=getCacheKey(_0x4d5e67,_0x5a3ca1),_0x3b48e3=cache[_0x33265d(0x100)](_0x3d202c);if(!_0x3b48e3)return null;if(Date[_0x33265d(0xfe)]()-_0x3b48e3['loadedAt']>CACHE_TTL_MS)return cache[_0x33265d(0xf5)](_0x3d202c),null;return _0x3b48e3['apiKey'];}export function setCachedCredential(_0x2622be,_0x44f78b,_0x2bad39){const _0x1254d1=a60_0x3892,_0x3c250f=getCacheKey(_0x44f78b,_0x2bad39);cache[_0x1254d1(0xf8)](_0x3c250f,{'apiKey':_0x2622be,'loadedAt':Date['now']()});}export function clearCredentialCache(){const _0x386608=a60_0x3892;cache[_0x386608(0x105)]();}export function clearCachedCredential(_0x13ade4,_0x45c4b8){const _0x219802=a60_0x3892,_0x5b554e=getCacheKey(_0x13ade4,_0x45c4b8);cache[_0x219802(0xf5)](_0x5b554e);}function a60_0x6678(){const _0x530a53=['1055574BsGdgC','147bdZzaO','__default_site__','clear','8KIeLIV','1201756SzgNge','delete','20brNzRI','4pOTSWb','set','6813636WqaCdn','2627960TTsBxt','1898414hhfbZu','5484WTZRzZ','5401MxZIwh','now','__default_profile__','get','42764roTudp'];a60_0x6678=function(){return _0x530a53;};return a60_0x6678();}
1
+ (function(_0x8d5c50,_0x119dbe){const _0x106034=a61_0x4989,_0x33d3e7=_0x8d5c50();while(!![]){try{const _0x52552b=parseInt(_0x106034(0x15e))/0x1*(parseInt(_0x106034(0x15d))/0x2)+-parseInt(_0x106034(0x160))/0x3*(-parseInt(_0x106034(0x159))/0x4)+parseInt(_0x106034(0x15c))/0x5*(parseInt(_0x106034(0x161))/0x6)+-parseInt(_0x106034(0x157))/0x7+-parseInt(_0x106034(0x15a))/0x8+-parseInt(_0x106034(0x15f))/0x9+parseInt(_0x106034(0x154))/0xa*(parseInt(_0x106034(0x153))/0xb);if(_0x52552b===_0x119dbe)break;else _0x33d3e7['push'](_0x33d3e7['shift']());}catch(_0x1ae444){_0x33d3e7['push'](_0x33d3e7['shift']());}}}(a61_0x36fc,0x30e96));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x37e9a9,_0xc0f0ca){const _0x710b05=a61_0x4989,_0x11d86a=_0x37e9a9||_0x710b05(0x15b),_0x2e6ae9=_0xc0f0ca||_0x710b05(0x151);return _0x11d86a+':'+_0x2e6ae9;}function a61_0x4989(_0x14b0a6,_0x2f091d){_0x14b0a6=_0x14b0a6-0x150;const _0x36fc53=a61_0x36fc();let _0x49890e=_0x36fc53[_0x14b0a6];return _0x49890e;}function a61_0x36fc(){const _0x4edc13=['57674LxhcoU','1mPYrlw','1024758fnNFSU','8403JRCQOK','6LmMypg','now','delete','__default_profile__','set','1714757UlAyNS','30fkaeUR','clear','apiKey','2462754MnQtGi','get','268rrqVAa','3181680nMMEWx','__default_site__','1897855LRuPtt'];a61_0x36fc=function(){return _0x4edc13;};return a61_0x36fc();}export function getCachedCredential(_0xc5c818,_0x17ce63){const _0x39cc0a=a61_0x4989,_0x14c635=getCacheKey(_0xc5c818,_0x17ce63),_0x3ded8e=cache[_0x39cc0a(0x158)](_0x14c635);if(!_0x3ded8e)return null;if(Date[_0x39cc0a(0x162)]()-_0x3ded8e['loadedAt']>CACHE_TTL_MS)return cache[_0x39cc0a(0x150)](_0x14c635),null;return _0x3ded8e[_0x39cc0a(0x156)];}export function setCachedCredential(_0x3b3f81,_0x38bcdf,_0x4ab766){const _0x35acd7=a61_0x4989,_0x18fdcb=getCacheKey(_0x38bcdf,_0x4ab766);cache[_0x35acd7(0x152)](_0x18fdcb,{'apiKey':_0x3b3f81,'loadedAt':Date['now']()});}export function clearCredentialCache(){const _0x1ae843=a61_0x4989;cache[_0x1ae843(0x155)]();}export function clearCachedCredential(_0x2405a7,_0x49bafb){const _0x2662cc=a61_0x4989,_0x183cec=getCacheKey(_0x2405a7,_0x49bafb);cache[_0x2662cc(0x150)](_0x183cec);}
@@ -1 +1 @@
1
- const a61_0x5c45c9=a61_0x16e6;(function(_0x24c653,_0x1c8e6e){const _0x320289=a61_0x16e6,_0x115aa0=_0x24c653();while(!![]){try{const _0x424238=-parseInt(_0x320289(0xe7))/0x1*(parseInt(_0x320289(0xd9))/0x2)+parseInt(_0x320289(0xc5))/0x3+-parseInt(_0x320289(0xf1))/0x4*(parseInt(_0x320289(0xd6))/0x5)+-parseInt(_0x320289(0xbe))/0x6+parseInt(_0x320289(0x103))/0x7*(parseInt(_0x320289(0xea))/0x8)+parseInt(_0x320289(0xf4))/0x9*(-parseInt(_0x320289(0x102))/0xa)+parseInt(_0x320289(0xd8))/0xb;if(_0x424238===_0x1c8e6e)break;else _0x115aa0['push'](_0x115aa0['shift']());}catch(_0x570421){_0x115aa0['push'](_0x115aa0['shift']());}}}(a61_0x4cd8,0xbcd42));function a61_0x4cd8(){const _0x247b58=['260lYmeDh','llm_project','30534339QJXCUV','5422sJEZRj','activeProfile','not\x20set','none','log','config','env','getParameters','llmProject','logLevel','Global','llm_agent','(active)','expires_at','389uBNtIx','(using\x20session:\x20','cliFlags','51504CxZPDa','.env','sessions','workflowProject','string','access_token','now','25940TzfYnR','displayWithSources','[configuration\x20files]','662391EuwyKX','Profile','profileCredentials','loadGlobalConfig','segmentPath','replace','project','site','assign','.json','resolveAPIKeyAsync','(session:\x20','profile:\x20','readFileSync','10jWNhtb','49ZzzfCT','Global\x20Credentials','configFiles','refresh_token','segment_path','apiKey','us01','session','Session','database','parent_segment','layers','profileSource','global','getSource','entries','globalCredentials','parse','7519584nMZsyX','default','tdx.json','[context]','accessToken','green','injectIntoOptions','2013567mtaGMF','composableAudience','cli','cyan','sessionId','join','workflow_project','proxy','bold','profiles','llmAgent','display','CLI\x20flag:\x20--','profile','existsSync','dim','composable_audience'];a61_0x4cd8=function(){return _0x247b58;};return a61_0x4cd8();}import{resolveSite,getAPIKey,getAccessToken,getAPIKeyAsync,getConfigDir}from'./config.js';import{getOAuthTokens,saveOAuthTokens}from'./oauth-keychain.js';import{refreshAccessToken}from'../sdk/client/oauth-refresh.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{loadSessionContext,getSessionID}from'./session.js';function a61_0x16e6(_0x33c3f6,_0x4e8d8d){_0x33c3f6=_0x33c3f6-0xbb;const _0x4cd84d=a61_0x4cd8();let _0x16e628=_0x4cd84d[_0x33c3f6];return _0x16e628;}import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';import{loadProfile}from'./profile.js';import{LogLevel}from'../utils/logger/index.js';import*as a61_0x103bc3 from'node:fs';import*as a61_0x551c95 from'node:path';import a61_0x32ae15 from'chalk';export class GlobalContext{[a61_0x5c45c9(0xfb)];['database'];[a61_0x5c45c9(0x10d)];[a61_0x5c45c9(0x107)];[a61_0x5c45c9(0xd7)];[a61_0x5c45c9(0xe4)];['workflow_project'];['composable_audience'];['apiKey'];[a61_0x5c45c9(0xc2)];['proxy'];['verbose'];['logLevel'];[a61_0x5c45c9(0xd2)];['profileSource']=null;[a61_0x5c45c9(0x10e)];[a61_0x5c45c9(0xda)];[a61_0x5c45c9(0xc9)];['configFiles'];constructor(_0x271573){const _0x469528=a61_0x5c45c9;this[_0x469528(0xc9)]=getSessionID(_0x271573[_0x469528(0x10a)]);const _0x425e05=loadSessionContext(_0x271573[_0x469528(0x10a)]),_0x4cd476=loadProjectConfig(),_0x20dc3d=this[_0x469528(0xf7)]();if(_0x271573[_0x469528(0xd2)])this[_0x469528(0xda)]=_0x271573[_0x469528(0xd2)],this[_0x469528(0x10f)]=_0x469528(0xc7);else{if(_0x425e05?.[_0x469528(0xd2)])this[_0x469528(0xda)]=_0x425e05[_0x469528(0xd2)],this[_0x469528(0x10f)]=_0x469528(0x10a);else{if(_0x20dc3d[_0x469528(0xd2)])this[_0x469528(0xda)]=_0x20dc3d[_0x469528(0xd2)],this['profileSource']=_0x469528(0xde);else process.env.TDX_PROFILE?(this['activeProfile']=process.env.TDX_PROFILE,this['profileSource']=_0x469528(0xdf)):(this['activeProfile']=null,this[_0x469528(0x10f)]=null);}}const _0xa607b8=this['activeProfile']?loadProfile(this[_0x469528(0xda)]):null,_0x553601=_0x44a6b1=>{const _0x5628de=_0x469528;if(!_0x44a6b1)return{};const _0xbbabc0=_0x44a6b1,_0x528498={};for(const [_0x2044dc,_0x4d302d]of Object[_0x5628de(0xbb)](_0xbbabc0)){typeof _0x4d302d===_0x5628de(0xee)&&(_0x528498[_0x2044dc]=_0x4d302d);}return _0x528498;},_0x468711={},_0x50a4e6=(_0x17e6f9,_0x4e0709,_0x452758)=>{const _0x1218a9=_0x469528;if(!_0x17e6f9)return![];if(_0x452758&&_0x17e6f9===_0x452758)return![];const _0x27918f=_0x425e05,_0x1ad2d3=_0x4cd476,_0x4242c1=_0xa607b8?.[_0x1218a9(0xde)],_0x1a1c3a=_0x20dc3d,_0x4db8fd=_0x27918f?.[_0x4e0709],_0x107361=_0x1ad2d3?.[_0x4e0709],_0x144061=_0x4242c1?.[_0x4e0709],_0x40270a=_0x1a1c3a[_0x4e0709];return _0x17e6f9!==_0x4db8fd&&_0x17e6f9!==_0x107361&&_0x17e6f9!==_0x144061&&_0x17e6f9!==_0x40270a;},_0x3c54ed=[{'optionKey':'site','contextKey':'site','defaultValue':_0x469528(0x109)},{'optionKey':_0x469528(0x10c),'contextKey':_0x469528(0x10c)},{'optionKey':'parentSegment','contextKey':_0x469528(0x10d)},{'optionKey':'llmProject','contextKey':_0x469528(0xd7)},{'optionKey':_0x469528(0xcf),'contextKey':_0x469528(0xe4)},{'optionKey':'composableAudience','contextKey':'composable_audience'},{'optionKey':_0x469528(0xd2),'contextKey':_0x469528(0xd2)}];for(const {optionKey:_0x262130,contextKey:_0x40e27c,defaultValue:_0x1fe4bd}of _0x3c54ed){const _0x47fe04=_0x271573[_0x262130];_0x50a4e6(_0x47fe04,_0x40e27c,_0x1fe4bd)&&(_0x468711[_0x40e27c]=_0x47fe04);}this[_0x469528(0x10e)]={'cliFlags':_0x468711,'session':_0x553601(_0x425e05),'project':_0x553601(_0x4cd476),'profile':_0x553601(_0xa607b8?.['config']),'global':_0x553601(_0x20dc3d)};const _0x3b8295={...this[_0x469528(0x10e)][_0x469528(0x110)],...this[_0x469528(0x10e)][_0x469528(0xd2)],...this[_0x469528(0x10e)][_0x469528(0xfa)]};process.env.TDX_SITE&&!this['layers'][_0x469528(0x10a)][_0x469528(0xfb)]&&!this[_0x469528(0x10e)]['cliFlags'][_0x469528(0xfb)]&&(_0x3b8295[_0x469528(0xfb)]=process.env.TDX_SITE);Object['assign'](_0x3b8295,this['layers'][_0x469528(0x10a)]),Object[_0x469528(0xfc)](_0x3b8295,this[_0x469528(0x10e)][_0x469528(0xe9)]);const _0x4bf2f0=_0x3b8295[_0x469528(0xfb)]||_0x469528(0x109);this['site']=resolveSite(_0x4bf2f0),this[_0x469528(0x10c)]=_0x3b8295[_0x469528(0x10c)],this[_0x469528(0x10d)]=_0x3b8295[_0x469528(0x10d)],this[_0x469528(0x107)]=_0x3b8295[_0x469528(0x107)],this[_0x469528(0xd7)]=_0x3b8295[_0x469528(0xd7)],this[_0x469528(0xe4)]=_0x3b8295[_0x469528(0xe4)],this[_0x469528(0xcb)]=_0x3b8295[_0x469528(0xcb)],this[_0x469528(0xd5)]=_0x3b8295['composable_audience'],this['verbose']=_0x271573['verbose']||![],this[_0x469528(0xe2)]=_0x271573[_0x469528(0xe2)]??LogLevel['INFO'],this[_0x469528(0xd2)]=this['activeProfile']||undefined,this[_0x469528(0xc2)]=getAccessToken(this[_0x469528(0xda)]||undefined),this[_0x469528(0x108)]=getAPIKey(this[_0x469528(0xda)]||undefined);const _0x15501a=typeof _0x20dc3d[_0x469528(0xcc)]===_0x469528(0xee)?_0x20dc3d[_0x469528(0xcc)]:undefined;this[_0x469528(0xcc)]=_0x15501a||process.env.HTTPS_PROXY||process.env.HTTP_PROXY;const _0x7e1397=getConfigDir(),_0x4d93f9=a61_0x551c95[_0x469528(0xca)](_0x7e1397,_0x469528(0xec),this[_0x469528(0xc9)]+_0x469528(0xfd)),_0x4522d5=findProjectConfigPath(),_0xefa307=a61_0x551c95[_0x469528(0xca)](_0x7e1397,_0x469528(0xc0)),_0x46909d=a61_0x551c95[_0x469528(0xca)](_0x7e1397,_0x469528(0xeb));let _0x3bda34=null,_0x325fc8=null;this[_0x469528(0xda)]&&(_0x3bda34=a61_0x551c95[_0x469528(0xca)](_0x7e1397,_0x469528(0xce),this[_0x469528(0xda)],'tdx.json'),_0x325fc8=a61_0x551c95[_0x469528(0xca)](_0x7e1397,_0x469528(0xce),this[_0x469528(0xda)],'.env')),this[_0x469528(0x105)]={'session':a61_0x103bc3[_0x469528(0xd3)](_0x4d93f9)?_0x4d93f9:null,'project':_0x4522d5,'profile':_0x3bda34&&a61_0x103bc3[_0x469528(0xd3)](_0x3bda34)?_0x3bda34:null,'profileCredentials':_0x325fc8&&a61_0x103bc3[_0x469528(0xd3)](_0x325fc8)?_0x325fc8:null,'global':a61_0x103bc3[_0x469528(0xd3)](_0xefa307)?_0xefa307:null,'globalCredentials':a61_0x103bc3[_0x469528(0xd3)](_0x46909d)?_0x46909d:null};}[a61_0x5c45c9(0x111)](_0x353f92,_0x4e16d9){const _0xfd43f3=a61_0x5c45c9;if(!_0x4e16d9)return _0xfd43f3(0xdb);const _0x231794=_0x4e16d9;if(this[_0xfd43f3(0x10e)][_0xfd43f3(0xe9)][_0x353f92]===_0x231794){if(_0x353f92==='site'&&_0x231794===_0xfd43f3(0x109)&&!this[_0xfd43f3(0x10e)]['session'][_0xfd43f3(0xfb)]&&!this[_0xfd43f3(0x10e)][_0xfd43f3(0xfa)]['site']&&!this[_0xfd43f3(0x10e)][_0xfd43f3(0xd2)][_0xfd43f3(0xfb)]&&!this['layers'][_0xfd43f3(0x110)][_0xfd43f3(0xfb)])return _0xfd43f3(0xbf);return _0xfd43f3(0xd1)+_0x353f92[_0xfd43f3(0xf9)](/_/g,'-');}if(this[_0xfd43f3(0x10e)]['session'][_0x353f92]===_0x231794)return _0xfd43f3(0x10a);if(this[_0xfd43f3(0x10e)][_0xfd43f3(0xfa)][_0x353f92]===_0x231794)return _0xfd43f3(0xfa);if(this['layers'][_0xfd43f3(0xd2)][_0x353f92]===_0x231794)return _0xfd43f3(0x100)+this['activeProfile'];if(this[_0xfd43f3(0x10e)]['global'][_0x353f92]===_0x231794)return _0xfd43f3(0x110);return _0xfd43f3(0xbf);}[a61_0x5c45c9(0xf7)](){const _0x133afa=a61_0x5c45c9,_0x4bae95=a61_0x551c95[_0x133afa(0xca)](getConfigDir(),_0x133afa(0xc0));if(!a61_0x103bc3['existsSync'](_0x4bae95))return{};try{const _0x2f0135=a61_0x103bc3[_0x133afa(0x101)](_0x4bae95,'utf-8');return JSON[_0x133afa(0xbd)](_0x2f0135);}catch{return{};}}[a61_0x5c45c9(0xc4)](_0x25535c){const _0x3083c5=a61_0x5c45c9;_0x25535c[_0x3083c5(0xfb)]=this[_0x3083c5(0xfb)],!_0x25535c['database']&&this[_0x3083c5(0x10c)]&&(_0x25535c[_0x3083c5(0x10c)]=this[_0x3083c5(0x10c)]),!_0x25535c['parentSegment']&&this[_0x3083c5(0x10d)]&&(_0x25535c['parentSegment']=this['parent_segment']),!_0x25535c[_0x3083c5(0xf8)]&&this[_0x3083c5(0x107)]&&(_0x25535c[_0x3083c5(0xf8)]=this[_0x3083c5(0x107)]),!_0x25535c[_0x3083c5(0xe1)]&&this[_0x3083c5(0xd7)]&&(_0x25535c[_0x3083c5(0xe1)]=this[_0x3083c5(0xd7)]),!_0x25535c[_0x3083c5(0xcf)]&&this['llm_agent']&&(_0x25535c[_0x3083c5(0xcf)]=this[_0x3083c5(0xe4)]),!_0x25535c['workflowProject']&&this[_0x3083c5(0xcb)]&&(_0x25535c[_0x3083c5(0xed)]=this[_0x3083c5(0xcb)]),!_0x25535c[_0x3083c5(0xc6)]&&this[_0x3083c5(0xd5)]&&(_0x25535c[_0x3083c5(0xc6)]=this[_0x3083c5(0xd5)]);}[a61_0x5c45c9(0xe0)](){const _0x561921=a61_0x5c45c9;return[{'key':_0x561921(0xfb),'value':this['site']},{'key':_0x561921(0x10c),'value':this[_0x561921(0x10c)]},{'key':_0x561921(0x10d),'value':this[_0x561921(0x10d)]},{'key':_0x561921(0x107),'value':this[_0x561921(0x107)]},{'key':'llm_project','value':this[_0x561921(0xd7)]},{'key':'llm_agent','value':this['llm_agent']},{'key':_0x561921(0xcb),'value':this['workflow_project']},{'key':'composable_audience','value':this['composable_audience']},{'key':_0x561921(0xd2),'value':this[_0x561921(0xda)]||undefined}];}[a61_0x5c45c9(0xd0)](){const _0x19fa6e=a61_0x5c45c9;console['log'](a61_0x32ae15['bold'](_0x19fa6e(0xc1)));for(const {key:_0x58f028,value:_0x17e890}of this[_0x19fa6e(0xe0)]()){_0x17e890&&console[_0x19fa6e(0xdd)](a61_0x32ae15['cyan'](_0x58f028)+':\x20'+_0x17e890);}}[a61_0x5c45c9(0xf2)](){const _0x28d027=a61_0x5c45c9;console[_0x28d027(0xdd)](a61_0x32ae15[_0x28d027(0xcd)](_0x28d027(0xc1)));for(const {key:_0x12bf97,value:_0x4856a5}of this[_0x28d027(0xe0)]()){if(_0x4856a5){const _0x5821d2=_0x12bf97===_0x28d027(0xd2)?_0x28d027(0xe5):'('+this[_0x28d027(0x111)](_0x12bf97,_0x4856a5)+')';console[_0x28d027(0xdd)](a61_0x32ae15[_0x28d027(0xc8)](_0x12bf97)+':\x20'+_0x4856a5+'\x20'+a61_0x32ae15[_0x28d027(0xd4)](_0x5821d2));}}console[_0x28d027(0xdd)]('\x0a'+a61_0x32ae15[_0x28d027(0xcd)](_0x28d027(0xf3)));const _0x37a248=[{'label':_0x28d027(0x10b),'path':this['configFiles']['session'],'extra':_0x28d027(0xff)+this['sessionId']+')'},{'label':'Project','path':this['configFiles'][_0x28d027(0xfa)]},{'label':_0x28d027(0xf5),'path':this['configFiles'][_0x28d027(0xd2)]},{'label':'Profile\x20Credentials','path':this[_0x28d027(0x105)][_0x28d027(0xf6)]},{'label':_0x28d027(0xe3),'path':this['configFiles']['global']},{'label':_0x28d027(0x104),'path':this[_0x28d027(0x105)][_0x28d027(0xbc)]}];for(const {label:_0x37dca3,path:_0x33ccc7,extra:_0x3fa84e}of _0x37a248){if(_0x33ccc7)console['log'](a61_0x32ae15[_0x28d027(0xc8)](_0x37dca3)+':\x20'+_0x33ccc7+'\x20'+a61_0x32ae15[_0x28d027(0xc3)]('✓')+(_0x3fa84e?'\x20'+a61_0x32ae15[_0x28d027(0xd4)](_0x3fa84e):''));else{if(_0x37dca3===_0x28d027(0x10b))console['log'](a61_0x32ae15['cyan'](_0x37dca3)+':\x20'+a61_0x32ae15['dim'](_0x28d027(0xdc))+'\x20'+a61_0x32ae15[_0x28d027(0xd4)](_0x28d027(0xe8)+this['sessionId']+')'));else(_0x37dca3==='Project'||_0x37dca3===_0x28d027(0xe3))&&console[_0x28d027(0xdd)](a61_0x32ae15[_0x28d027(0xc8)](_0x37dca3)+':\x20'+a61_0x32ae15[_0x28d027(0xd4)]('none'));}}}async['resolveAPIKeyAsync'](){const _0x54a858=a61_0x5c45c9;if(!this['accessToken']){const _0x12da3c=await getOAuthTokens(this[_0x54a858(0xda)]||undefined);if(_0x12da3c){const _0x86d88b=0x5*0x3c*0x3e8,_0x4771e1=!_0x12da3c[_0x54a858(0xe6)]||_0x12da3c[_0x54a858(0xe6)]<Date[_0x54a858(0xf0)]()+_0x86d88b;if(_0x4771e1&&_0x12da3c[_0x54a858(0x106)])try{const _0x30975b=getConsoleUrl(this['site']),_0x4caf47=await refreshAccessToken(_0x30975b,_0x12da3c[_0x54a858(0x106)]);await saveOAuthTokens(_0x4caf47,this[_0x54a858(0xda)]||undefined),this[_0x54a858(0xc2)]=_0x4caf47[_0x54a858(0xef)];}catch{this[_0x54a858(0xc2)]=_0x12da3c[_0x54a858(0xef)];}else this[_0x54a858(0xc2)]=_0x12da3c[_0x54a858(0xef)];return undefined;}}return this['apiKey']=await getAPIKeyAsync(this[_0x54a858(0xfb)],this['activeProfile']||undefined),this[_0x54a858(0x108)];}static async['createAsync'](_0x3618c6){const _0x470533=a61_0x5c45c9,_0x55152a=new GlobalContext(_0x3618c6);return await _0x55152a[_0x470533(0xfe)](),_0x55152a;}}
1
+ const a62_0x54600b=a62_0x241f;(function(_0x3a3c78,_0x5ab983){const _0x1cd5c5=a62_0x241f,_0x4751d5=_0x3a3c78();while(!![]){try{const _0x30e77f=-parseInt(_0x1cd5c5(0x230))/0x1+parseInt(_0x1cd5c5(0x21f))/0x2*(parseInt(_0x1cd5c5(0x20b))/0x3)+parseInt(_0x1cd5c5(0x21c))/0x4+parseInt(_0x1cd5c5(0x1fe))/0x5+parseInt(_0x1cd5c5(0x1df))/0x6+-parseInt(_0x1cd5c5(0x1ec))/0x7*(-parseInt(_0x1cd5c5(0x207))/0x8)+-parseInt(_0x1cd5c5(0x201))/0x9;if(_0x30e77f===_0x5ab983)break;else _0x4751d5['push'](_0x4751d5['shift']());}catch(_0x347821){_0x4751d5['push'](_0x4751d5['shift']());}}}(a62_0x3437,0xb5081));import{resolveSite,getAPIKey,getAccessToken,getAPIKeyAsync,getConfigDir}from'./config.js';import{getOAuthTokens,saveOAuthTokens}from'./oauth-keychain.js';import{refreshAccessToken}from'../sdk/client/oauth-refresh.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a62_0x241f(_0x37bd8c,_0x43ee1d){_0x37bd8c=_0x37bd8c-0x1df;const _0x3437e2=a62_0x3437();let _0x241fd9=_0x3437e2[_0x37bd8c];return _0x241fd9;}function a62_0x3437(){const _0x32f574=['Session','profile:\x20','(session:\x20','existsSync','llm_project','access_token','display','global','(using\x20session:\x20','string','282614uSrvNi','llmProject','llmAgent','now','default','3644052ENdXzU','configFiles','profileSource','resolveAPIKeyAsync','composableAudience','join','logLevel','layers','Global\x20Credentials','readFileSync','database','green','bold','7tJFpCl','workflowProject','parent_segment','config','llm_agent','getParameters','cli','composable_audience','parse','workflow_project','INFO','env','proxy','getSource','globalCredentials','dim','accessToken','segmentPath','6464410nvQnpi','Global','cliFlags','35634249IxgPGv','site','verbose','refresh_token','displayWithSources','createAsync','9185944IqpYiO','Profile\x20Credentials','profile','entries','774735ILXaGA','[context]','profiles','replace','loadGlobalConfig','Profile','assign','Project','expires_at','segment_path','session','.env','project','activeProfile','apiKey','tdx.json','us01','5674092tqikJB','[configuration\x20files]','profileCredentials','4NRYgGz','log','utf-8','injectIntoOptions','parentSegment','cyan','sessionId'];a62_0x3437=function(){return _0x32f574;};return a62_0x3437();}import{loadSessionContext,getSessionID}from'./session.js';import{loadProjectConfig,findProjectConfigPath}from'./project-config.js';import{loadProfile}from'./profile.js';import{LogLevel}from'../utils/logger/index.js';import*as a62_0x24484d from'node:fs';import*as a62_0x1728d6 from'node:path';import a62_0x57ec3d from'chalk';export class GlobalContext{['site'];[a62_0x54600b(0x1e9)];[a62_0x54600b(0x1ee)];[a62_0x54600b(0x214)];[a62_0x54600b(0x22a)];['llm_agent'];[a62_0x54600b(0x1f5)];[a62_0x54600b(0x1f3)];['apiKey'];[a62_0x54600b(0x1fc)];[a62_0x54600b(0x1f8)];[a62_0x54600b(0x203)];[a62_0x54600b(0x1e5)];[a62_0x54600b(0x209)];[a62_0x54600b(0x1e1)]=null;[a62_0x54600b(0x1e6)];[a62_0x54600b(0x218)];[a62_0x54600b(0x225)];[a62_0x54600b(0x1e0)];constructor(_0x438471){const _0x243346=a62_0x54600b;this[_0x243346(0x225)]=getSessionID(_0x438471['session']);const _0x39be01=loadSessionContext(_0x438471[_0x243346(0x215)]),_0x5cf01a=loadProjectConfig(),_0xfc6b41=this[_0x243346(0x20f)]();if(_0x438471[_0x243346(0x209)])this[_0x243346(0x218)]=_0x438471[_0x243346(0x209)],this[_0x243346(0x1e1)]=_0x243346(0x1f2);else{if(_0x39be01?.[_0x243346(0x209)])this[_0x243346(0x218)]=_0x39be01[_0x243346(0x209)],this[_0x243346(0x1e1)]=_0x243346(0x215);else{if(_0xfc6b41[_0x243346(0x209)])this[_0x243346(0x218)]=_0xfc6b41[_0x243346(0x209)],this[_0x243346(0x1e1)]=_0x243346(0x1ef);else process.env.TDX_PROFILE?(this[_0x243346(0x218)]=process.env.TDX_PROFILE,this['profileSource']=_0x243346(0x1f7)):(this['activeProfile']=null,this[_0x243346(0x1e1)]=null);}}const _0x399851=this[_0x243346(0x218)]?loadProfile(this[_0x243346(0x218)]):null,_0x21cee4=_0x1c6e72=>{const _0x2dad89=_0x243346;if(!_0x1c6e72)return{};const _0x221e90=_0x1c6e72,_0x1dbfab={};for(const [_0x2e7a05,_0x155349]of Object[_0x2dad89(0x20a)](_0x221e90)){typeof _0x155349===_0x2dad89(0x22f)&&(_0x1dbfab[_0x2e7a05]=_0x155349);}return _0x1dbfab;},_0x457fb8={},_0x555fd1=(_0x50203b,_0x5d91de,_0x2674ca)=>{if(!_0x50203b)return![];if(_0x2674ca&&_0x50203b===_0x2674ca)return![];const _0x5ad867=_0x39be01,_0x2b93d8=_0x5cf01a,_0x1c8a53=_0x399851?.['config'],_0x24f3ca=_0xfc6b41,_0xf322cb=_0x5ad867?.[_0x5d91de],_0x54efc7=_0x2b93d8?.[_0x5d91de],_0x6b8fef=_0x1c8a53?.[_0x5d91de],_0x4553f5=_0x24f3ca[_0x5d91de];return _0x50203b!==_0xf322cb&&_0x50203b!==_0x54efc7&&_0x50203b!==_0x6b8fef&&_0x50203b!==_0x4553f5;},_0x3a2d2e=[{'optionKey':'site','contextKey':_0x243346(0x202),'defaultValue':_0x243346(0x21b)},{'optionKey':'database','contextKey':_0x243346(0x1e9)},{'optionKey':_0x243346(0x223),'contextKey':'parent_segment'},{'optionKey':_0x243346(0x231),'contextKey':'llm_project'},{'optionKey':'llmAgent','contextKey':_0x243346(0x1f0)},{'optionKey':_0x243346(0x1e3),'contextKey':_0x243346(0x1f3)},{'optionKey':_0x243346(0x209),'contextKey':_0x243346(0x209)}];for(const {optionKey:_0x175e90,contextKey:_0x4ca031,defaultValue:_0x2880b8}of _0x3a2d2e){const _0x316574=_0x438471[_0x175e90];_0x555fd1(_0x316574,_0x4ca031,_0x2880b8)&&(_0x457fb8[_0x4ca031]=_0x316574);}this[_0x243346(0x1e6)]={'cliFlags':_0x457fb8,'session':_0x21cee4(_0x39be01),'project':_0x21cee4(_0x5cf01a),'profile':_0x21cee4(_0x399851?.[_0x243346(0x1ef)]),'global':_0x21cee4(_0xfc6b41)};const _0x1ea1f4={...this[_0x243346(0x1e6)][_0x243346(0x22d)],...this[_0x243346(0x1e6)][_0x243346(0x209)],...this[_0x243346(0x1e6)][_0x243346(0x217)]};process.env.TDX_SITE&&!this['layers'][_0x243346(0x215)][_0x243346(0x202)]&&!this[_0x243346(0x1e6)][_0x243346(0x200)][_0x243346(0x202)]&&(_0x1ea1f4[_0x243346(0x202)]=process.env.TDX_SITE);Object[_0x243346(0x211)](_0x1ea1f4,this[_0x243346(0x1e6)][_0x243346(0x215)]),Object[_0x243346(0x211)](_0x1ea1f4,this[_0x243346(0x1e6)]['cliFlags']);const _0x4ca0dc=_0x1ea1f4[_0x243346(0x202)]||_0x243346(0x21b);this['site']=resolveSite(_0x4ca0dc),this[_0x243346(0x1e9)]=_0x1ea1f4[_0x243346(0x1e9)],this[_0x243346(0x1ee)]=_0x1ea1f4[_0x243346(0x1ee)],this['segment_path']=_0x1ea1f4[_0x243346(0x214)],this[_0x243346(0x22a)]=_0x1ea1f4[_0x243346(0x22a)],this['llm_agent']=_0x1ea1f4[_0x243346(0x1f0)],this[_0x243346(0x1f5)]=_0x1ea1f4[_0x243346(0x1f5)],this[_0x243346(0x1f3)]=_0x1ea1f4['composable_audience'],this['verbose']=_0x438471['verbose']||![],this[_0x243346(0x1e5)]=_0x438471[_0x243346(0x1e5)]??LogLevel[_0x243346(0x1f6)],this['profile']=this[_0x243346(0x218)]||undefined,this['accessToken']=getAccessToken(this[_0x243346(0x218)]||undefined),this['apiKey']=getAPIKey(this[_0x243346(0x218)]||undefined);const _0x5719a9=typeof _0xfc6b41['proxy']==='string'?_0xfc6b41[_0x243346(0x1f8)]:undefined;this['proxy']=_0x5719a9||process.env.HTTPS_PROXY||process.env.HTTP_PROXY;const _0x4edb1b=getConfigDir(),_0x32a917=a62_0x1728d6[_0x243346(0x1e4)](_0x4edb1b,'sessions',this['sessionId']+'.json'),_0x58f900=findProjectConfigPath(),_0x132dc2=a62_0x1728d6['join'](_0x4edb1b,_0x243346(0x21a)),_0x27b928=a62_0x1728d6['join'](_0x4edb1b,'.env');let _0x3391ff=null,_0x23e1d0=null;this[_0x243346(0x218)]&&(_0x3391ff=a62_0x1728d6[_0x243346(0x1e4)](_0x4edb1b,_0x243346(0x20d),this[_0x243346(0x218)],_0x243346(0x21a)),_0x23e1d0=a62_0x1728d6[_0x243346(0x1e4)](_0x4edb1b,_0x243346(0x20d),this[_0x243346(0x218)],_0x243346(0x216))),this[_0x243346(0x1e0)]={'session':a62_0x24484d[_0x243346(0x229)](_0x32a917)?_0x32a917:null,'project':_0x58f900,'profile':_0x3391ff&&a62_0x24484d[_0x243346(0x229)](_0x3391ff)?_0x3391ff:null,'profileCredentials':_0x23e1d0&&a62_0x24484d[_0x243346(0x229)](_0x23e1d0)?_0x23e1d0:null,'global':a62_0x24484d[_0x243346(0x229)](_0x132dc2)?_0x132dc2:null,'globalCredentials':a62_0x24484d[_0x243346(0x229)](_0x27b928)?_0x27b928:null};}['getSource'](_0x471517,_0x78450c){const _0x413110=a62_0x54600b;if(!_0x78450c)return'not\x20set';const _0x573d5d=_0x78450c;if(this[_0x413110(0x1e6)]['cliFlags'][_0x471517]===_0x573d5d){if(_0x471517===_0x413110(0x202)&&_0x573d5d===_0x413110(0x21b)&&!this[_0x413110(0x1e6)]['session'][_0x413110(0x202)]&&!this[_0x413110(0x1e6)]['project'][_0x413110(0x202)]&&!this[_0x413110(0x1e6)][_0x413110(0x209)][_0x413110(0x202)]&&!this[_0x413110(0x1e6)]['global']['site'])return'default';return'CLI\x20flag:\x20--'+_0x471517[_0x413110(0x20e)](/_/g,'-');}if(this[_0x413110(0x1e6)][_0x413110(0x215)][_0x471517]===_0x573d5d)return _0x413110(0x215);if(this['layers'][_0x413110(0x217)][_0x471517]===_0x573d5d)return _0x413110(0x217);if(this[_0x413110(0x1e6)][_0x413110(0x209)][_0x471517]===_0x573d5d)return _0x413110(0x227)+this[_0x413110(0x218)];if(this[_0x413110(0x1e6)][_0x413110(0x22d)][_0x471517]===_0x573d5d)return _0x413110(0x22d);return _0x413110(0x234);}['loadGlobalConfig'](){const _0x1b7509=a62_0x54600b,_0x90c08f=a62_0x1728d6['join'](getConfigDir(),_0x1b7509(0x21a));if(!a62_0x24484d[_0x1b7509(0x229)](_0x90c08f))return{};try{const _0x59d6d3=a62_0x24484d[_0x1b7509(0x1e8)](_0x90c08f,_0x1b7509(0x221));return JSON[_0x1b7509(0x1f4)](_0x59d6d3);}catch{return{};}}[a62_0x54600b(0x222)](_0x3f96b2){const _0xc4c023=a62_0x54600b;_0x3f96b2[_0xc4c023(0x202)]=this[_0xc4c023(0x202)],!_0x3f96b2[_0xc4c023(0x1e9)]&&this[_0xc4c023(0x1e9)]&&(_0x3f96b2['database']=this['database']),!_0x3f96b2[_0xc4c023(0x223)]&&this['parent_segment']&&(_0x3f96b2[_0xc4c023(0x223)]=this[_0xc4c023(0x1ee)]),!_0x3f96b2[_0xc4c023(0x1fd)]&&this[_0xc4c023(0x214)]&&(_0x3f96b2[_0xc4c023(0x1fd)]=this[_0xc4c023(0x214)]),!_0x3f96b2[_0xc4c023(0x231)]&&this['llm_project']&&(_0x3f96b2['llmProject']=this[_0xc4c023(0x22a)]),!_0x3f96b2[_0xc4c023(0x232)]&&this[_0xc4c023(0x1f0)]&&(_0x3f96b2[_0xc4c023(0x232)]=this[_0xc4c023(0x1f0)]),!_0x3f96b2[_0xc4c023(0x1ed)]&&this['workflow_project']&&(_0x3f96b2[_0xc4c023(0x1ed)]=this[_0xc4c023(0x1f5)]),!_0x3f96b2[_0xc4c023(0x1e3)]&&this[_0xc4c023(0x1f3)]&&(_0x3f96b2[_0xc4c023(0x1e3)]=this[_0xc4c023(0x1f3)]);}[a62_0x54600b(0x1f1)](){const _0x207424=a62_0x54600b;return[{'key':_0x207424(0x202),'value':this[_0x207424(0x202)]},{'key':_0x207424(0x1e9),'value':this[_0x207424(0x1e9)]},{'key':'parent_segment','value':this[_0x207424(0x1ee)]},{'key':'segment_path','value':this['segment_path']},{'key':_0x207424(0x22a),'value':this[_0x207424(0x22a)]},{'key':_0x207424(0x1f0),'value':this[_0x207424(0x1f0)]},{'key':_0x207424(0x1f5),'value':this[_0x207424(0x1f5)]},{'key':'composable_audience','value':this[_0x207424(0x1f3)]},{'key':_0x207424(0x209),'value':this[_0x207424(0x218)]||undefined}];}[a62_0x54600b(0x22c)](){const _0x19358b=a62_0x54600b;console['log'](a62_0x57ec3d[_0x19358b(0x1eb)](_0x19358b(0x20c)));for(const {key:_0x32dbd7,value:_0x358dd4}of this[_0x19358b(0x1f1)]()){_0x358dd4&&console[_0x19358b(0x220)](a62_0x57ec3d[_0x19358b(0x224)](_0x32dbd7)+':\x20'+_0x358dd4);}}[a62_0x54600b(0x205)](){const _0x251632=a62_0x54600b;console[_0x251632(0x220)](a62_0x57ec3d[_0x251632(0x1eb)](_0x251632(0x20c)));for(const {key:_0x680687,value:_0x165b2d}of this[_0x251632(0x1f1)]()){if(_0x165b2d){const _0x1c2fcd=_0x680687===_0x251632(0x209)?'(active)':'('+this[_0x251632(0x1f9)](_0x680687,_0x165b2d)+')';console[_0x251632(0x220)](a62_0x57ec3d[_0x251632(0x224)](_0x680687)+':\x20'+_0x165b2d+'\x20'+a62_0x57ec3d[_0x251632(0x1fb)](_0x1c2fcd));}}console['log']('\x0a'+a62_0x57ec3d[_0x251632(0x1eb)](_0x251632(0x21d)));const _0x35e7e6=[{'label':_0x251632(0x226),'path':this['configFiles'][_0x251632(0x215)],'extra':_0x251632(0x228)+this[_0x251632(0x225)]+')'},{'label':_0x251632(0x212),'path':this[_0x251632(0x1e0)]['project']},{'label':_0x251632(0x210),'path':this[_0x251632(0x1e0)][_0x251632(0x209)]},{'label':_0x251632(0x208),'path':this[_0x251632(0x1e0)][_0x251632(0x21e)]},{'label':_0x251632(0x1ff),'path':this[_0x251632(0x1e0)][_0x251632(0x22d)]},{'label':_0x251632(0x1e7),'path':this[_0x251632(0x1e0)][_0x251632(0x1fa)]}];for(const {label:_0x1867fe,path:_0x26a72f,extra:_0x7bca5e}of _0x35e7e6){if(_0x26a72f)console[_0x251632(0x220)](a62_0x57ec3d[_0x251632(0x224)](_0x1867fe)+':\x20'+_0x26a72f+'\x20'+a62_0x57ec3d[_0x251632(0x1ea)]('✓')+(_0x7bca5e?'\x20'+a62_0x57ec3d[_0x251632(0x1fb)](_0x7bca5e):''));else{if(_0x1867fe==='Session')console['log'](a62_0x57ec3d[_0x251632(0x224)](_0x1867fe)+':\x20'+a62_0x57ec3d[_0x251632(0x1fb)]('none')+'\x20'+a62_0x57ec3d[_0x251632(0x1fb)](_0x251632(0x22e)+this[_0x251632(0x225)]+')'));else(_0x1867fe===_0x251632(0x212)||_0x1867fe==='Global')&&console[_0x251632(0x220)](a62_0x57ec3d[_0x251632(0x224)](_0x1867fe)+':\x20'+a62_0x57ec3d[_0x251632(0x1fb)]('none'));}}}async[a62_0x54600b(0x1e2)](){const _0x5ed5f5=a62_0x54600b;if(!this['accessToken']){const _0xa85a3e=await getOAuthTokens(this[_0x5ed5f5(0x218)]||undefined);if(_0xa85a3e){const _0x2e1a1b=0x5*0x3c*0x3e8,_0xe4324e=!_0xa85a3e[_0x5ed5f5(0x213)]||_0xa85a3e[_0x5ed5f5(0x213)]<Date[_0x5ed5f5(0x233)]()+_0x2e1a1b;if(_0xe4324e&&_0xa85a3e[_0x5ed5f5(0x204)])try{const _0x1b0e79=getConsoleUrl(this['site']),_0x37968f=await refreshAccessToken(_0x1b0e79,_0xa85a3e[_0x5ed5f5(0x204)]);await saveOAuthTokens(_0x37968f,this['activeProfile']||undefined),this[_0x5ed5f5(0x1fc)]=_0x37968f[_0x5ed5f5(0x22b)];}catch{this[_0x5ed5f5(0x1fc)]=_0xa85a3e['access_token'];}else this[_0x5ed5f5(0x1fc)]=_0xa85a3e[_0x5ed5f5(0x22b)];return undefined;}}return this[_0x5ed5f5(0x219)]=await getAPIKeyAsync(this[_0x5ed5f5(0x202)],this[_0x5ed5f5(0x218)]||undefined),this['apiKey'];}static async[a62_0x54600b(0x206)](_0x54822e){const _0xfbf6ef=a62_0x54600b,_0x4a791e=new GlobalContext(_0x54822e);return await _0x4a791e[_0xfbf6ef(0x1e2)](),_0x4a791e;}}
@@ -1 +1 @@
1
- const a62_0x1fbc23=a62_0x2aaa;(function(_0x2dd8fb,_0x55f3bd){const _0x119215=a62_0x2aaa,_0x1503e4=_0x2dd8fb();while(!![]){try{const _0x44af4a=-parseInt(_0x119215(0xa7))/0x1+parseInt(_0x119215(0xae))/0x2*(-parseInt(_0x119215(0x99))/0x3)+-parseInt(_0x119215(0xab))/0x4*(-parseInt(_0x119215(0xad))/0x5)+parseInt(_0x119215(0x97))/0x6*(-parseInt(_0x119215(0xb5))/0x7)+-parseInt(_0x119215(0xa2))/0x8*(-parseInt(_0x119215(0x94))/0x9)+parseInt(_0x119215(0x91))/0xa*(-parseInt(_0x119215(0x96))/0xb)+parseInt(_0x119215(0xb4))/0xc;if(_0x44af4a===_0x55f3bd)break;else _0x1503e4['push'](_0x1503e4['shift']());}catch(_0x34f869){_0x1503e4['push'](_0x1503e4['shift']());}}}(a62_0x2beb,0xc7377));const SERVICE_NAME=a62_0x1fbc23(0x95);let EntryClass=null,keyringLoadError=null;function a62_0x2aaa(_0x401428,_0x31b81e){_0x401428=_0x401428-0x91;const _0x2beb09=a62_0x2beb();let _0x2aaabb=_0x2beb09[_0x401428];return _0x2aaabb;}function a62_0x2beb(){const _0x21c05e=['8cfOaMl','could\x20not\x20be\x20found','reason','cannot\x20find','restricted','186742TWGpJI','unavailable','not\x20found','deleteCredential','2816308MTTLhE','message','10pIiiVr','153214yyaHeU',':api_key','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.','__keychain_test__','Entry','not\x20available','11733048ywmJvn','329ojIEZx','6641820lDmObH','toLowerCase','access_denied','12268089vjFmDJ','tdx','11wXdCHW','158226yNHzfu','getPassword','33cugrlp','no\x20matching\x20entry','success','includes','setPassword','value','not_found','access','-25293'];a62_0x2beb=function(){return _0x21c05e;};return a62_0x2beb();}async function getEntryClass(){const _0x11bd8c=a62_0x1fbc23;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x107cf3=await import('@napi-rs/keyring');return EntryClass=_0x107cf3[_0x11bd8c(0xb2)],EntryClass;}catch(_0x3774fc){return keyringLoadError=_0x3774fc instanceof Error?_0x3774fc:new Error(String(_0x3774fc)),null;}}function getAccountName(_0x442773){const _0x19324a=a62_0x1fbc23,_0xc9e7c4=_0x442773||'';return'profile:'+_0xc9e7c4+_0x19324a(0xaf);}export async function getKeychainAPIKey(_0x3745f9){const _0x83ae5a=a62_0x1fbc23,_0xe4bcdf=await getKeychainAPIKeyWithStatus(_0x3745f9);if(_0xe4bcdf[_0x83ae5a(0x9b)])return _0xe4bcdf[_0x83ae5a(0x9e)];return _0xe4bcdf[_0x83ae5a(0xa4)]===_0x83ae5a(0x93)&&console['error']('Warning:\x20'+_0xe4bcdf[_0x83ae5a(0xac)]),null;}export async function getKeychainAPIKeyWithStatus(_0x196838){const _0x25f51e=a62_0x1fbc23;try{const _0x5930d1=await getEntryClass();if(!_0x5930d1)return{'success':![],'reason':_0x25f51e(0xa8)};const _0x4d4004=getAccountName(_0x196838),_0x2fcd37=new _0x5930d1(SERVICE_NAME,_0x4d4004),_0x5ced3f=_0x2fcd37[_0x25f51e(0x98)]();if(_0x5ced3f)return{'success':!![],'value':_0x5ced3f};return{'success':![],'reason':_0x25f51e(0x9f)};}catch(_0x2aafed){const _0x438706=_0x2aafed instanceof Error?_0x2aafed[_0x25f51e(0xac)]:String(_0x2aafed);if(_0x438706['includes']('-25300')||_0x438706[_0x25f51e(0x92)]()['includes'](_0x25f51e(0xa3))||_0x438706['toLowerCase']()[_0x25f51e(0x9c)](_0x25f51e(0xa9))||_0x438706[_0x25f51e(0x92)]()[_0x25f51e(0x9c)](_0x25f51e(0x9a)))return{'success':![],'reason':'not_found'};if(_0x438706['includes'](_0x25f51e(0xa1))||_0x438706[_0x25f51e(0x92)]()['includes'](_0x25f51e(0xa6))||_0x438706[_0x25f51e(0x92)]()[_0x25f51e(0x9c)](_0x25f51e(0xa0)))return{'success':![],'reason':'access_denied','message':_0x25f51e(0xb0)};return{'success':![],'reason':'unavailable','message':_0x438706};}}export async function saveKeychainAPIKey(_0xaeb61b,_0xdb8670){const _0x26615e=a62_0x1fbc23,_0x13fda5=await getEntryClass();if(!_0x13fda5)throw new Error('System\x20keychain\x20is\x20not\x20available');const _0x29dc59=getAccountName(_0xdb8670),_0xf2b024=new _0x13fda5(SERVICE_NAME,_0x29dc59);_0xf2b024[_0x26615e(0x9d)](_0xaeb61b);}export async function deleteKeychainAPIKey(_0xb2b7d8){const _0x390c0b=a62_0x1fbc23;try{const _0x2d5f12=await getEntryClass();if(!_0x2d5f12)return![];const _0x4b7e1e=getAccountName(_0xb2b7d8),_0x567ac3=new _0x2d5f12(SERVICE_NAME,_0x4b7e1e);return _0x567ac3[_0x390c0b(0xaa)](),!![];}catch{return![];}}export async function isKeychainAvailable(){const _0x3c5b92=a62_0x1fbc23;try{const _0x32efd4=await getEntryClass();if(!_0x32efd4)return![];const _0x579057=new _0x32efd4(SERVICE_NAME,_0x3c5b92(0xb1));return _0x579057['getPassword'](),!![];}catch(_0x27cf1f){const _0x2b7c72=_0x27cf1f instanceof Error?_0x27cf1f[_0x3c5b92(0xac)][_0x3c5b92(0x92)]():'';if(_0x2b7c72[_0x3c5b92(0x9c)](_0x3c5b92(0xb3))||_0x2b7c72[_0x3c5b92(0x9c)]('not\x20supported')||_0x2b7c72[_0x3c5b92(0x9c)](_0x3c5b92(0xa5)))return![];return!![];}}
1
+ (function(_0x131f02,_0x4437cb){const _0x2b69fa=a63_0x345f,_0x18091c=_0x131f02();while(!![]){try{const _0x44e367=-parseInt(_0x2b69fa(0xf1))/0x1+parseInt(_0x2b69fa(0xed))/0x2+-parseInt(_0x2b69fa(0x107))/0x3*(parseInt(_0x2b69fa(0xf0))/0x4)+parseInt(_0x2b69fa(0xea))/0x5*(-parseInt(_0x2b69fa(0xec))/0x6)+parseInt(_0x2b69fa(0x102))/0x7+parseInt(_0x2b69fa(0xf6))/0x8+parseInt(_0x2b69fa(0xf9))/0x9;if(_0x44e367===_0x4437cb)break;else _0x18091c['push'](_0x18091c['shift']());}catch(_0x1fcd12){_0x18091c['push'](_0x18091c['shift']());}}}(a63_0xc1ac,0x39704));const SERVICE_NAME='tdx';let EntryClass=null,keyringLoadError=null;function a63_0x345f(_0x586772,_0x58654b){_0x586772=_0x586772-0xe9;const _0xc1acc7=a63_0xc1ac();let _0x345f17=_0xc1acc7[_0x586772];return _0x345f17;}function a63_0xc1ac(){const _0x10782a=['1107366lkXJAG','146480NzuTis','toLowerCase','getPassword','4erBKQG','412538VCozZR','Entry','unavailable','Warning:\x20','deleteCredential','2250432SnPuhh','could\x20not\x20be\x20found','not_found','3952764HplDru','not\x20supported','System\x20keychain\x20is\x20not\x20available','-25300','not\x20available','includes',':api_key','not\x20found','cannot\x20find','1771266nWxoky','no\x20matching\x20entry','-25293','value','__keychain_test__','643233UDVdQW','message','error','5xtWnMe','@napi-rs/keyring'];a63_0xc1ac=function(){return _0x10782a;};return a63_0xc1ac();}async function getEntryClass(){const _0x3b75e4=a63_0x345f;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0xb3a6d7=await import(_0x3b75e4(0xeb));return EntryClass=_0xb3a6d7[_0x3b75e4(0xf2)],EntryClass;}catch(_0x1fdb88){return keyringLoadError=_0x1fdb88 instanceof Error?_0x1fdb88:new Error(String(_0x1fdb88)),null;}}function getAccountName(_0x370838){const _0x5cc0ab=a63_0x345f,_0x30202f=_0x370838||'';return'profile:'+_0x30202f+_0x5cc0ab(0xff);}export async function getKeychainAPIKey(_0x5ade52){const _0x1e3cdb=a63_0x345f,_0x1edcd7=await getKeychainAPIKeyWithStatus(_0x5ade52);if(_0x1edcd7['success'])return _0x1edcd7[_0x1e3cdb(0x105)];return _0x1edcd7['reason']==='access_denied'&&console[_0x1e3cdb(0xe9)](_0x1e3cdb(0xf4)+_0x1edcd7[_0x1e3cdb(0x108)]),null;}export async function getKeychainAPIKeyWithStatus(_0x53873c){const _0x5c4cd1=a63_0x345f;try{const _0x1328d9=await getEntryClass();if(!_0x1328d9)return{'success':![],'reason':_0x5c4cd1(0xf3)};const _0x118bf6=getAccountName(_0x53873c),_0x5d0a4b=new _0x1328d9(SERVICE_NAME,_0x118bf6),_0x4e97b9=_0x5d0a4b[_0x5c4cd1(0xef)]();if(_0x4e97b9)return{'success':!![],'value':_0x4e97b9};return{'success':![],'reason':'not_found'};}catch(_0x58d323){const _0x46b087=_0x58d323 instanceof Error?_0x58d323[_0x5c4cd1(0x108)]:String(_0x58d323);if(_0x46b087[_0x5c4cd1(0xfe)](_0x5c4cd1(0xfc))||_0x46b087[_0x5c4cd1(0xee)]()['includes'](_0x5c4cd1(0xf7))||_0x46b087['toLowerCase']()[_0x5c4cd1(0xfe)](_0x5c4cd1(0x100))||_0x46b087['toLowerCase']()[_0x5c4cd1(0xfe)](_0x5c4cd1(0x103)))return{'success':![],'reason':_0x5c4cd1(0xf8)};if(_0x46b087['includes'](_0x5c4cd1(0x104))||_0x46b087['toLowerCase']()[_0x5c4cd1(0xfe)]('restricted')||_0x46b087[_0x5c4cd1(0xee)]()['includes']('access'))return{'success':![],'reason':'access_denied','message':'Keychain\x20access\x20denied.\x20The\x20API\x20key\x20exists\x20but\x20cannot\x20be\x20accessed.\x20Try\x20running\x20\x22tdx\x20auth\x20setup\x22\x20to\x20re-authenticate,\x20or\x20check\x20your\x20keychain\x20permissions\x20for\x20\x22tdx\x22.'};return{'success':![],'reason':_0x5c4cd1(0xf3),'message':_0x46b087};}}export async function saveKeychainAPIKey(_0x4edfb1,_0x29ae5c){const _0x2f22a5=a63_0x345f,_0x513ca3=await getEntryClass();if(!_0x513ca3)throw new Error(_0x2f22a5(0xfb));const _0x43427b=getAccountName(_0x29ae5c),_0x28f9c8=new _0x513ca3(SERVICE_NAME,_0x43427b);_0x28f9c8['setPassword'](_0x4edfb1);}export async function deleteKeychainAPIKey(_0x4c9b1b){const _0x36eac6=a63_0x345f;try{const _0x19ed07=await getEntryClass();if(!_0x19ed07)return![];const _0x52a0a1=getAccountName(_0x4c9b1b),_0x416caf=new _0x19ed07(SERVICE_NAME,_0x52a0a1);return _0x416caf[_0x36eac6(0xf5)](),!![];}catch{return![];}}export async function isKeychainAvailable(){const _0x46adc9=a63_0x345f;try{const _0x52c3ac=await getEntryClass();if(!_0x52c3ac)return![];const _0x3af7be=new _0x52c3ac(SERVICE_NAME,_0x46adc9(0x106));return _0x3af7be['getPassword'](),!![];}catch(_0x7ae745){const _0x558ea3=_0x7ae745 instanceof Error?_0x7ae745[_0x46adc9(0x108)][_0x46adc9(0xee)]():'';if(_0x558ea3['includes'](_0x46adc9(0xfd))||_0x558ea3['includes'](_0x46adc9(0xfa))||_0x558ea3[_0x46adc9(0xfe)](_0x46adc9(0x101)))return![];return!![];}}
@@ -1 +1 @@
1
- const a63_0x2d0a61=a63_0xfb4c;(function(_0xb9556b,_0x5bdaab){const _0x1f85ea=a63_0xfb4c,_0x390933=_0xb9556b();while(!![]){try{const _0x5141ee=parseInt(_0x1f85ea(0xb0))/0x1*(-parseInt(_0x1f85ea(0xb2))/0x2)+parseInt(_0x1f85ea(0xbd))/0x3+parseInt(_0x1f85ea(0xb3))/0x4*(-parseInt(_0x1f85ea(0xb9))/0x5)+-parseInt(_0x1f85ea(0xb5))/0x6*(parseInt(_0x1f85ea(0xbb))/0x7)+-parseInt(_0x1f85ea(0xb7))/0x8*(parseInt(_0x1f85ea(0xb1))/0x9)+-parseInt(_0x1f85ea(0xb6))/0xa*(parseInt(_0x1f85ea(0xbc))/0xb)+-parseInt(_0x1f85ea(0xb4))/0xc*(-parseInt(_0x1f85ea(0xbe))/0xd);if(_0x5141ee===_0x5bdaab)break;else _0x390933['push'](_0x390933['shift']());}catch(_0x3a32e5){_0x390933['push'](_0x390933['shift']());}}}(a63_0x1d4e,0x2e1da));const SERVICE_NAME=a63_0x2d0a61(0xac);let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x40f5e1=a63_0x2d0a61;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x1faf21=await import(_0x40f5e1(0xba));return EntryClass=_0x1faf21['Entry'],EntryClass;}catch(_0x2d16c3){return keyringLoadError=_0x2d16c3 instanceof Error?_0x2d16c3:new Error(String(_0x2d16c3)),null;}}function getOAuthAccountName(_0xe3165a){const _0x40189c=a63_0x2d0a61,_0x5ef159=_0xe3165a||'';return'profile:'+_0x5ef159+_0x40189c(0xb8);}export async function saveOAuthTokens(_0x15015a,_0x5e2feb){const _0x481444=a63_0x2d0a61,_0x43b70c=await getEntryClass();if(!_0x43b70c)throw new Error(_0x481444(0xaf));const _0x2139d0=getOAuthAccountName(_0x5e2feb),_0x2fd03c=new _0x43b70c(SERVICE_NAME,_0x2139d0);_0x2fd03c[_0x481444(0xae)](JSON['stringify'](_0x15015a));}function a63_0xfb4c(_0xedd3b,_0x53f88b){_0xedd3b=_0xedd3b-0xac;const _0x1d4e60=a63_0x1d4e();let _0xfb4c67=_0x1d4e60[_0xedd3b];return _0xfb4c67;}function a63_0x1d4e(){const _0x35a6aa=['System\x20keychain\x20is\x20not\x20available','1CEMgkN','322362fygevf','11932YZxpyL','4dyeLwa','3298992RVaouG','96hkAwwb','3303470SxcUwF','72YOjbsq',':oauth_tokens','425605EBPpGB','@napi-rs/keyring','12796OWVuPR','11fnmind','411558STbUCA','39QljVNE','tdx','deleteCredential','setPassword'];a63_0x1d4e=function(){return _0x35a6aa;};return a63_0x1d4e();}export async function getOAuthTokens(_0x2731a8){try{const _0x576475=await getEntryClass();if(!_0x576475)return null;const _0x820ebe=getOAuthAccountName(_0x2731a8),_0x4ac8ff=new _0x576475(SERVICE_NAME,_0x820ebe),_0x34c688=_0x4ac8ff['getPassword']();if(_0x34c688)return JSON['parse'](_0x34c688);return null;}catch{return null;}}export async function deleteOAuthTokens(_0x5ad7e7){const _0x30ce45=a63_0x2d0a61;try{const _0x1a4d9a=await getEntryClass();if(!_0x1a4d9a)return![];const _0x533813=getOAuthAccountName(_0x5ad7e7),_0x80c798=new _0x1a4d9a(SERVICE_NAME,_0x533813);return _0x80c798[_0x30ce45(0xad)](),!![];}catch{return![];}}
1
+ function a64_0x4053(_0x2d0713,_0x38bcc0){_0x2d0713=_0x2d0713-0xd7;const _0xa42b6c=a64_0xa42b();let _0x405386=_0xa42b6c[_0x2d0713];return _0x405386;}const a64_0x329ac7=a64_0x4053;(function(_0x27b9b5,_0x42acb1){const _0x39e4dc=a64_0x4053,_0x1fdb49=_0x27b9b5();while(!![]){try{const _0x11c8b0=parseInt(_0x39e4dc(0xda))/0x1*(parseInt(_0x39e4dc(0xe1))/0x2)+-parseInt(_0x39e4dc(0xe0))/0x3*(-parseInt(_0x39e4dc(0xe2))/0x4)+-parseInt(_0x39e4dc(0xd7))/0x5*(-parseInt(_0x39e4dc(0xdc))/0x6)+parseInt(_0x39e4dc(0xe4))/0x7+parseInt(_0x39e4dc(0xd9))/0x8+parseInt(_0x39e4dc(0xdf))/0x9*(parseInt(_0x39e4dc(0xd8))/0xa)+-parseInt(_0x39e4dc(0xe3))/0xb;if(_0x11c8b0===_0x42acb1)break;else _0x1fdb49['push'](_0x1fdb49['shift']());}catch(_0x3ee80f){_0x1fdb49['push'](_0x1fdb49['shift']());}}}(a64_0xa42b,0x9dfc1));const SERVICE_NAME=a64_0x329ac7(0xe6);let EntryClass=null,keyringLoadError=null;async function getEntryClass(){const _0x185df5=a64_0x329ac7;if(EntryClass!==null)return EntryClass;if(keyringLoadError!==null)return null;try{const _0x12e18d=await import(_0x185df5(0xdb));return EntryClass=_0x12e18d['Entry'],EntryClass;}catch(_0x8c9704){return keyringLoadError=_0x8c9704 instanceof Error?_0x8c9704:new Error(String(_0x8c9704)),null;}}function a64_0xa42b(){const _0x52868d=['39sGxnzZ','90886JxpILf','36332LuvKcQ','40228397bMYuGg','7085050fPSZpR',':oauth_tokens','tdx','profile:','setPassword','stringify','250Mtvpui','43980EFPtYj','2615288pRssdV','26MZSNXR','@napi-rs/keyring','140232FicKnS','parse','getPassword','1017pDCaPW'];a64_0xa42b=function(){return _0x52868d;};return a64_0xa42b();}function getOAuthAccountName(_0x119a48){const _0x509c57=a64_0x329ac7,_0x1c7d7c=_0x119a48||'';return _0x509c57(0xe7)+_0x1c7d7c+_0x509c57(0xe5);}export async function saveOAuthTokens(_0x18f754,_0x5f1fd8){const _0x4dcce7=a64_0x329ac7,_0x4b468f=await getEntryClass();if(!_0x4b468f)throw new Error('System\x20keychain\x20is\x20not\x20available');const _0x40206b=getOAuthAccountName(_0x5f1fd8),_0x428990=new _0x4b468f(SERVICE_NAME,_0x40206b);_0x428990[_0x4dcce7(0xe8)](JSON[_0x4dcce7(0xe9)](_0x18f754));}export async function getOAuthTokens(_0x3891df){const _0x206d35=a64_0x329ac7;try{const _0x2a1a94=await getEntryClass();if(!_0x2a1a94)return null;const _0x5ec41f=getOAuthAccountName(_0x3891df),_0x22b0bd=new _0x2a1a94(SERVICE_NAME,_0x5ec41f),_0x147160=_0x22b0bd[_0x206d35(0xde)]();if(_0x147160)return JSON[_0x206d35(0xdd)](_0x147160);return null;}catch{return null;}}export async function deleteOAuthTokens(_0x2d3971){try{const _0x371520=await getEntryClass();if(!_0x371520)return![];const _0x36d553=getOAuthAccountName(_0x2d3971),_0x462c03=new _0x371520(SERVICE_NAME,_0x36d553);return _0x462c03['deleteCredential'](),!![];}catch{return![];}}
@@ -1 +1 @@
1
- const a64_0x502812=a64_0x2a4c;(function(_0x522d1e,_0x5a5185){const _0x507376=a64_0x2a4c,_0x161288=_0x522d1e();while(!![]){try{const _0x23c4c2=-parseInt(_0x507376(0xa0))/0x1*(parseInt(_0x507376(0x8d))/0x2)+-parseInt(_0x507376(0x75))/0x3+parseInt(_0x507376(0x89))/0x4*(parseInt(_0x507376(0xa7))/0x5)+parseInt(_0x507376(0x72))/0x6+-parseInt(_0x507376(0x91))/0x7*(-parseInt(_0x507376(0x76))/0x8)+parseInt(_0x507376(0x6c))/0x9*(-parseInt(_0x507376(0x9e))/0xa)+parseInt(_0x507376(0x7d))/0xb*(parseInt(_0x507376(0x96))/0xc);if(_0x23c4c2===_0x5a5185)break;else _0x161288['push'](_0x161288['shift']());}catch(_0x5c9b58){_0x161288['push'](_0x161288['shift']());}}}(a64_0x5084,0x9f5ae));import*as a64_0x21f618 from'node:crypto';import*as a64_0x3cdc1e from'node:http';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';export const OAUTH_CALLBACK_PORT=0xaa4a;export const OAUTH_REDIRECT_URI=a64_0x502812(0x7b)+OAUTH_CALLBACK_PORT+a64_0x502812(0x65);export function getOAuthClientId(){const _0x9a129d=a64_0x502812;return process.env.TD_OAUTH_CLIENT_ID||_0x9a129d(0x7c);}export function generatePKCEPair(){const _0x280669=a64_0x502812,_0x4c45cf=a64_0x21f618[_0x280669(0x93)](0x20)['toString'](_0x280669(0x94)),_0xbec6d5=a64_0x21f618[_0x280669(0xa8)](_0x280669(0x95))[_0x280669(0x9c)](_0x4c45cf)[_0x280669(0x87)](_0x280669(0x94));return{'verifier':_0x4c45cf,'challenge':_0xbec6d5};}export function buildAuthorizeURL(_0x2315d0,_0x20acbb){const _0x322d28=a64_0x502812,_0x4696d3=new URL(_0x322d28(0x6f),_0x2315d0);return _0x4696d3[_0x322d28(0x6d)][_0x322d28(0x80)]('response_type',_0x322d28(0x8b)),_0x4696d3[_0x322d28(0x6d)]['set'](_0x322d28(0x81),_0x20acbb[_0x322d28(0x68)]),_0x4696d3[_0x322d28(0x6d)][_0x322d28(0x80)](_0x322d28(0xa3),_0x20acbb[_0x322d28(0x85)]),_0x4696d3['searchParams'][_0x322d28(0x80)]('state',_0x20acbb[_0x322d28(0x66)]),_0x4696d3[_0x322d28(0x6d)][_0x322d28(0x80)]('code_challenge',_0x20acbb['codeChallenge']),_0x4696d3[_0x322d28(0x6d)][_0x322d28(0x80)](_0x322d28(0x6e),_0x322d28(0x86)),_0x20acbb['scope']&&_0x4696d3[_0x322d28(0x6d)]['set']('scope',_0x20acbb[_0x322d28(0x8c)]),_0x4696d3[_0x322d28(0x7e)]();}function a64_0x5084(){const _0x270c5f=['http://127.0.0.1','2014970vlWZgA','127.0.0.1','4qytfBx','application/x-www-form-urlencoded','listen','redirect_uri','get','expires_in','<html><body><h1>Authentication\x20Successful</h1><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','5138300oRbVTk','createHash','/users/initiate_sso','/oauth/callback','state','pathname','clientId','message','<html><body><h1>Authentication\x20Failed</h1><p>An\x20error\x20occurred\x20during\x20authentication.\x20Please\x20close\x20this\x20window\x20and\x20try\x20again.</p></body></html>','waitForCallback','54AgfYlZ','searchParams','code_challenge_method','/oauth/authorize','text/html','end','1291242tMncnp','text','url','3578856zxkNdl','8EIdadz','openid\x20email\x20profile','createServer','text/plain','redirect_to_path','http://localhost:','tdx','11629970cainnI','toString','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','set','client_id','json','hex','Not\x20Found','redirectUri','S256','digest','writeHead','4VEpdTf','close','code','scope','629638ydjUjm','\x20is\x20already\x20in\x20use.\x20Stop\x20the\x20process\x20using\x20it\x20and\x20retry.','now','OAuth\x20callback\x20received\x20an\x20error\x20or\x20missing\x20parameters','6695647MEuKOF','Port\x20','randomBytes','base64url','sha256','24KVmjzp','error','):\x20','EADDRINUSE','account_name','Failed\x20to\x20start\x20OAuth\x20callback\x20server:\x20','update'];a64_0x5084=function(){return _0x270c5f;};return a64_0x5084();}export function buildSSOInitiateURL(_0x28fb89,_0x22290d,_0xb1f3a2){const _0x1dea77=a64_0x502812,_0x5567c4=new URL(_0x1dea77(0xa9),_0x28fb89);_0x5567c4[_0x1dea77(0x6d)][_0x1dea77(0x80)](_0x1dea77(0x9a),_0x22290d);const _0x508c0d=_0xb1f3a2['replace'](_0x28fb89,'');return _0x5567c4[_0x1dea77(0x6d)][_0x1dea77(0x80)](_0x1dea77(0x7a),_0x508c0d),_0x5567c4[_0x1dea77(0x7e)]();}export async function postTokenRequest(_0x185790,_0x313c13){const _0x3a0a6d=a64_0x502812,_0x1011cb=new URLSearchParams(_0x313c13)[_0x3a0a6d(0x7e)](),_0x51bc58=await fetch(_0x185790,{'method':'POST','headers':{'Content-Type':_0x3a0a6d(0xa1)},'body':_0x1011cb});if(!_0x51bc58['ok']){const _0x47cb83=await _0x51bc58[_0x3a0a6d(0x73)]();throw new Error('OAuth\x20token\x20request\x20failed\x20('+_0x51bc58['status']+_0x3a0a6d(0x98)+_0x47cb83);}const _0xfe0e7d=await _0x51bc58[_0x3a0a6d(0x82)]();return{'access_token':_0xfe0e7d['access_token'],'refresh_token':_0xfe0e7d['refresh_token'],'scope':_0xfe0e7d[_0x3a0a6d(0x8c)],'expires_at':_0xfe0e7d[_0x3a0a6d(0xa5)]?Date[_0x3a0a6d(0x8f)]()+_0xfe0e7d[_0x3a0a6d(0xa5)]*0x3e8:undefined};}export async function exchangeCodeForTokens(_0x3bca13,_0x37bc26,_0x5d2d4e,_0x643f97){const _0x29b89a=_0x3bca13+'/oauth/token';return postTokenRequest(_0x29b89a,{'grant_type':'authorization_code','client_id':getOAuthClientId(),'code':_0x37bc26,'code_verifier':_0x5d2d4e,'redirect_uri':_0x643f97});}export function startLocalCallbackServer(){const _0x245138=a64_0x502812;let _0x4e43c5,_0x3f4824;const _0xe60c44=new Promise((_0x440e18,_0x570df7)=>{_0x4e43c5=_0x440e18,_0x3f4824=_0x570df7;}),_0x392442=a64_0x3cdc1e[_0x245138(0x78)]((_0x4be11f,_0xa74d65)=>{const _0x2c5500=_0x245138,_0x3860c1=new URL(_0x4be11f[_0x2c5500(0x74)]||'/',_0x2c5500(0x9d));if(_0x3860c1[_0x2c5500(0x67)]!==_0x2c5500(0x65)){_0xa74d65[_0x2c5500(0x88)](0x194,{'Content-Type':_0x2c5500(0x79)}),_0xa74d65[_0x2c5500(0x71)](_0x2c5500(0x84));return;}const _0x54d172=_0x3860c1['searchParams'][_0x2c5500(0xa4)]('code'),_0x50d07b=_0x3860c1[_0x2c5500(0x6d)]['get'](_0x2c5500(0x66)),_0x3f901a=_0x3860c1[_0x2c5500(0x6d)]['get'](_0x2c5500(0x97));if(_0x3f901a||!_0x54d172||!_0x50d07b){_0xa74d65[_0x2c5500(0x88)](0x190,{'Content-Type':_0x2c5500(0x70)}),_0xa74d65[_0x2c5500(0x71)](_0x2c5500(0x6a)),_0x3f4824(new Error(_0x2c5500(0x90)));return;}_0xa74d65[_0x2c5500(0x88)](0xc8,{'Content-Type':'text/html'}),_0xa74d65['end'](_0x2c5500(0xa6)),_0x4e43c5({'code':_0x54d172,'state':_0x50d07b});});_0x392442['on'](_0x245138(0x97),_0x2d7721=>{const _0x5c9788=_0x245138;_0x2d7721['code']===_0x5c9788(0x99)?_0x3f4824(new Error(_0x5c9788(0x92)+OAUTH_CALLBACK_PORT+_0x5c9788(0x8e))):_0x3f4824(new Error(_0x5c9788(0x9b)+_0x2d7721[_0x5c9788(0x69)]));}),_0x392442[_0x245138(0xa2)](OAUTH_CALLBACK_PORT,_0x245138(0x9f));const _0x50d0b6=setTimeout(()=>{const _0x314193=_0x245138;_0x3f4824(new Error(_0x314193(0x7f))),_0x392442[_0x314193(0x8a)]();},0x2*0x3c*0x3e8);return{'waitForCallback':()=>_0xe60c44,'close':()=>{const _0x1d1ba4=_0x245138;clearTimeout(_0x50d0b6),_0x392442[_0x1d1ba4(0x8a)]();}};}function a64_0x2a4c(_0x19d308,_0x562447){_0x19d308=_0x19d308-0x65;const _0x50842d=a64_0x5084();let _0x2a4cad=_0x50842d[_0x19d308];return _0x2a4cad;}export async function startOAuthFlow(_0x6fbde1,_0x25e30b){const _0x529dbb=a64_0x502812,_0x55ccd0=getConsoleUrl(_0x6fbde1),_0x16e681=getOAuthClientId(),{verifier:_0x384935,challenge:_0x3ba28c}=generatePKCEPair(),_0x14901b=a64_0x21f618[_0x529dbb(0x93)](0x10)['toString'](_0x529dbb(0x83)),_0x4a16cf=startLocalCallbackServer();try{const _0x1ba781=OAUTH_REDIRECT_URI,_0x402a7f=buildAuthorizeURL(_0x55ccd0,{'clientId':_0x16e681,'redirectUri':_0x1ba781,'state':_0x14901b,'codeChallenge':_0x3ba28c,'scope':_0x529dbb(0x77)}),_0x25a75a=_0x25e30b?.['accountName']?buildSSOInitiateURL(_0x55ccd0,_0x25e30b['accountName'],_0x402a7f):_0x402a7f;openBrowser(_0x25a75a);const _0x418559=await _0x4a16cf[_0x529dbb(0x6b)]();if(_0x418559['state']!==_0x14901b)throw new Error('OAuth\x20state\x20mismatch\x20—\x20possible\x20CSRF\x20attack');return await exchangeCodeForTokens(_0x55ccd0,_0x418559['code'],_0x384935,_0x1ba781);}finally{_0x4a16cf[_0x529dbb(0x8a)]();}}
1
+ const a65_0x3359c4=a65_0x5da6;(function(_0x313a3a,_0xc9bed8){const _0x5aed6b=a65_0x5da6,_0x56b693=_0x313a3a();while(!![]){try{const _0x5a3e67=parseInt(_0x5aed6b(0x132))/0x1+parseInt(_0x5aed6b(0x147))/0x2*(-parseInt(_0x5aed6b(0x144))/0x3)+parseInt(_0x5aed6b(0x12f))/0x4*(-parseInt(_0x5aed6b(0x13d))/0x5)+parseInt(_0x5aed6b(0x145))/0x6*(parseInt(_0x5aed6b(0x141))/0x7)+parseInt(_0x5aed6b(0x14a))/0x8+parseInt(_0x5aed6b(0x151))/0x9+parseInt(_0x5aed6b(0x13c))/0xa*(parseInt(_0x5aed6b(0x161))/0xb);if(_0x5a3e67===_0xc9bed8)break;else _0x56b693['push'](_0x56b693['shift']());}catch(_0x4b779e){_0x56b693['push'](_0x56b693['shift']());}}}(a65_0x4ecb,0x62d76));import*as a65_0x42222b from'node:crypto';import*as a65_0x3abfa3 from'node:http';function a65_0x4ecb(){const _0x27f5c5=['end','text','toString','status','146344RbiyMT','close','hex','Port\x20','Not\x20Found','/oauth/callback','/users/initiate_sso','text/plain','digest','base64url','text/html','sha256','POST','account_name','EADDRINUSE','code_challenge','listen','/oauth/authorize','redirect_to_path','164DvwjQw','json','expires_in','50645IMhslp','message','authorization_code','):\x20','<html><body><h1>Authentication\x20Failed</h1><p>An\x20error\x20occurred\x20during\x20authentication.\x20Please\x20close\x20this\x20window\x20and\x20try\x20again.</p></body></html>','clientId','response_type','client_id','createServer','\x20is\x20already\x20in\x20use.\x20Stop\x20the\x20process\x20using\x20it\x20and\x20retry.','10kmquKH','45425snSMjF','replace','pathname','<html><body><h1>Authentication\x20Successful</h1><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','998858YsXTrT','get','refresh_token','1204179fxUUGd','12MfcfYK','http://127.0.0.1','2GJHcTD','writeHead','code_challenge_method','5115056DqFJQN','waitForCallback','set','OAuth\x20callback\x20received\x20an\x20error\x20or\x20missing\x20parameters','createHash','redirect_uri','application/x-www-form-urlencoded','1710117NwYSzE','127.0.0.1','searchParams','state','access_token','url','scope','error','code','accountName','OAuth\x20token\x20request\x20failed\x20(','randomBytes'];a65_0x4ecb=function(){return _0x27f5c5;};return a65_0x4ecb();}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';export const OAUTH_CALLBACK_PORT=0xaa4a;export const OAUTH_REDIRECT_URI='http://localhost:'+OAUTH_CALLBACK_PORT+a65_0x3359c4(0x166);export function getOAuthClientId(){return process.env.TD_OAUTH_CLIENT_ID||'tdx';}export function generatePKCEPair(){const _0x35c227=a65_0x3359c4,_0x3f6578=a65_0x42222b[_0x35c227(0x15c)](0x20)['toString']('base64url'),_0x3aa46d=a65_0x42222b[_0x35c227(0x14e)](_0x35c227(0x16c))['update'](_0x3f6578)[_0x35c227(0x169)](_0x35c227(0x16a));return{'verifier':_0x3f6578,'challenge':_0x3aa46d};}export function buildAuthorizeURL(_0x4c40ef,_0x93d4de){const _0x2976c5=a65_0x3359c4,_0x2c3900=new URL(_0x2976c5(0x12d),_0x4c40ef);return _0x2c3900[_0x2976c5(0x153)][_0x2976c5(0x14c)](_0x2976c5(0x138),_0x2976c5(0x159)),_0x2c3900['searchParams']['set'](_0x2976c5(0x139),_0x93d4de[_0x2976c5(0x137)]),_0x2c3900[_0x2976c5(0x153)][_0x2976c5(0x14c)](_0x2976c5(0x14f),_0x93d4de['redirectUri']),_0x2c3900[_0x2976c5(0x153)][_0x2976c5(0x14c)](_0x2976c5(0x154),_0x93d4de[_0x2976c5(0x154)]),_0x2c3900[_0x2976c5(0x153)][_0x2976c5(0x14c)](_0x2976c5(0x12b),_0x93d4de['codeChallenge']),_0x2c3900[_0x2976c5(0x153)]['set'](_0x2976c5(0x149),'S256'),_0x93d4de[_0x2976c5(0x157)]&&_0x2c3900['searchParams']['set'](_0x2976c5(0x157),_0x93d4de[_0x2976c5(0x157)]),_0x2c3900[_0x2976c5(0x15f)]();}export function buildSSOInitiateURL(_0x186528,_0x4e980c,_0xa1395f){const _0x2360b8=a65_0x3359c4,_0x4ab189=new URL(_0x2360b8(0x167),_0x186528);_0x4ab189[_0x2360b8(0x153)]['set'](_0x2360b8(0x16e),_0x4e980c);const _0x1b024f=_0xa1395f[_0x2360b8(0x13e)](_0x186528,'');return _0x4ab189['searchParams'][_0x2360b8(0x14c)](_0x2360b8(0x12e),_0x1b024f),_0x4ab189['toString']();}export async function postTokenRequest(_0x2510ba,_0x41814d){const _0x455399=a65_0x3359c4,_0x5f2fba=new URLSearchParams(_0x41814d)[_0x455399(0x15f)](),_0x2d82e7=await fetch(_0x2510ba,{'method':_0x455399(0x16d),'headers':{'Content-Type':_0x455399(0x150)},'body':_0x5f2fba});if(!_0x2d82e7['ok']){const _0x4202d8=await _0x2d82e7[_0x455399(0x15e)]();throw new Error(_0x455399(0x15b)+_0x2d82e7[_0x455399(0x160)]+_0x455399(0x135)+_0x4202d8);}const _0x5ec507=await _0x2d82e7[_0x455399(0x130)]();return{'access_token':_0x5ec507[_0x455399(0x155)],'refresh_token':_0x5ec507[_0x455399(0x143)],'scope':_0x5ec507[_0x455399(0x157)],'expires_at':_0x5ec507[_0x455399(0x131)]?Date['now']()+_0x5ec507[_0x455399(0x131)]*0x3e8:undefined};}export async function exchangeCodeForTokens(_0x18192a,_0x398c3c,_0x3949a6,_0x52ce3f){const _0x4f812a=a65_0x3359c4,_0x1d518d=_0x18192a+'/oauth/token';return postTokenRequest(_0x1d518d,{'grant_type':_0x4f812a(0x134),'client_id':getOAuthClientId(),'code':_0x398c3c,'code_verifier':_0x3949a6,'redirect_uri':_0x52ce3f});}export function startLocalCallbackServer(){const _0x5d812d=a65_0x3359c4;let _0x53787c,_0x25a19d;const _0x52ef74=new Promise((_0x265cad,_0x118345)=>{_0x53787c=_0x265cad,_0x25a19d=_0x118345;}),_0x3140ba=a65_0x3abfa3[_0x5d812d(0x13a)]((_0x32db82,_0x30e1f7)=>{const _0xf64904=_0x5d812d,_0x3719c9=new URL(_0x32db82[_0xf64904(0x156)]||'/',_0xf64904(0x146));if(_0x3719c9[_0xf64904(0x13f)]!==_0xf64904(0x166)){_0x30e1f7[_0xf64904(0x148)](0x194,{'Content-Type':_0xf64904(0x168)}),_0x30e1f7['end'](_0xf64904(0x165));return;}const _0x32cc34=_0x3719c9[_0xf64904(0x153)][_0xf64904(0x142)](_0xf64904(0x159)),_0x5b5ca=_0x3719c9[_0xf64904(0x153)][_0xf64904(0x142)](_0xf64904(0x154)),_0x15f979=_0x3719c9[_0xf64904(0x153)][_0xf64904(0x142)](_0xf64904(0x158));if(_0x15f979||!_0x32cc34||!_0x5b5ca){_0x30e1f7[_0xf64904(0x148)](0x190,{'Content-Type':_0xf64904(0x16b)}),_0x30e1f7[_0xf64904(0x15d)](_0xf64904(0x136)),_0x25a19d(new Error(_0xf64904(0x14d)));return;}_0x30e1f7[_0xf64904(0x148)](0xc8,{'Content-Type':_0xf64904(0x16b)}),_0x30e1f7[_0xf64904(0x15d)](_0xf64904(0x140)),_0x53787c({'code':_0x32cc34,'state':_0x5b5ca});});_0x3140ba['on'](_0x5d812d(0x158),_0x4ac204=>{const _0x13deed=_0x5d812d;_0x4ac204[_0x13deed(0x159)]===_0x13deed(0x16f)?_0x25a19d(new Error(_0x13deed(0x164)+OAUTH_CALLBACK_PORT+_0x13deed(0x13b))):_0x25a19d(new Error('Failed\x20to\x20start\x20OAuth\x20callback\x20server:\x20'+_0x4ac204[_0x13deed(0x133)]));}),_0x3140ba[_0x5d812d(0x12c)](OAUTH_CALLBACK_PORT,_0x5d812d(0x152));const _0x4b1b6f=setTimeout(()=>{_0x25a19d(new Error('OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes')),_0x3140ba['close']();},0x2*0x3c*0x3e8);return{'waitForCallback':()=>_0x52ef74,'close':()=>{const _0x4bb733=_0x5d812d;clearTimeout(_0x4b1b6f),_0x3140ba[_0x4bb733(0x162)]();}};}function a65_0x5da6(_0x3d1a93,_0x4232e0){_0x3d1a93=_0x3d1a93-0x12b;const _0x4ecbff=a65_0x4ecb();let _0x5da641=_0x4ecbff[_0x3d1a93];return _0x5da641;}export async function startOAuthFlow(_0x3b4a6d,_0xaa3751){const _0xa3c59c=a65_0x3359c4,_0x22e983=getConsoleUrl(_0x3b4a6d),_0x453946=getOAuthClientId(),{verifier:_0x1776bf,challenge:_0x162268}=generatePKCEPair(),_0x4f721f=a65_0x42222b['randomBytes'](0x10)[_0xa3c59c(0x15f)](_0xa3c59c(0x163)),_0x44a744=startLocalCallbackServer();try{const _0x30758=OAUTH_REDIRECT_URI,_0x2d5c54=buildAuthorizeURL(_0x22e983,{'clientId':_0x453946,'redirectUri':_0x30758,'state':_0x4f721f,'codeChallenge':_0x162268,'scope':'openid\x20email\x20profile'}),_0x485899=_0xaa3751?.[_0xa3c59c(0x15a)]?buildSSOInitiateURL(_0x22e983,_0xaa3751[_0xa3c59c(0x15a)],_0x2d5c54):_0x2d5c54;openBrowser(_0x485899);const _0x4f47b3=await _0x44a744[_0xa3c59c(0x14b)]();if(_0x4f47b3[_0xa3c59c(0x154)]!==_0x4f721f)throw new Error('OAuth\x20state\x20mismatch\x20—\x20possible\x20CSRF\x20attack');return await exchangeCodeForTokens(_0x22e983,_0x4f47b3['code'],_0x1776bf,_0x30758);}finally{_0x44a744['close']();}}
@@ -1 +1 @@
1
- function a65_0x27f5(){const _0x2f45f2=['\x27:\x20config\x20must\x20be\x20an\x20object','Profile\x20\x27','7MkhWjv','parent_segment','rmSync','\x20\x20mv\x20\x22','672824fLxWox','push','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','account_name','site','parse','Profile\x20','join','directory','values','Error:\x20','profile','message','\x27:\x20\x27','readFileSync','name','657599SEdtXF','user_info','toISOString','from','\x20does\x20not\x20exist','sort','description','\x20\x201.\x20Edit:\x20','find','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','warn','test','stringify','73419RUEqKt','has','entries','5271816XqMrwq','llm_agent','\x27\x20not\x20found\x20in\x20user\x20configuration','INVALID_PROFILE_CONFIG','user','localeCompare','7375aZpUZY','Warning:\x20Profile\x20\x27','620090dBGJNU','readdirSync','.env.','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','length','map','@tdx-studio','Invalid\x20profile\x20name:\x20','utf-8','existsSync','includes','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','\x27:\x20unknown\x20config\x20key\x20\x27','profiles','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','\x20already\x20exists','\x27\x20must\x20be\x20a\x20string',',\x20creating\x20new\x20file','\x0aWarning:\x20Failed\x20to\x20parse\x20','Warning:\x20Failed\x20to\x20parse\x20','tdx.json','set','isDirectory','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','Failed\x20to\x20parse\x20','object','some','171KSPGYp','filter','.env','785608HHdGck',':\x20Invalid\x20JSON\x20syntax','llm_project','128ZMtWDi','database','local','keys'];a65_0x27f5=function(){return _0x2f45f2;};return a65_0x27f5();}const a65_0x417818=a65_0x3237;(function(_0x52dbc6,_0x1fe802){const _0x501020=a65_0x3237,_0x85421b=_0x52dbc6();while(!![]){try{const _0x30ae52=parseInt(_0x501020(0x135))/0x1+-parseInt(_0x501020(0x118))/0x2+parseInt(_0x501020(0xef))/0x3+-parseInt(_0x501020(0x11b))/0x4*(parseInt(_0x501020(0xf8))/0x5)+-parseInt(_0x501020(0xf2))/0x6+-parseInt(_0x501020(0x121))/0x7*(parseInt(_0x501020(0x125))/0x8)+parseInt(_0x501020(0x115))/0x9*(parseInt(_0x501020(0xfa))/0xa);if(_0x30ae52===_0x1fe802)break;else _0x85421b['push'](_0x85421b['shift']());}catch(_0x243e6f){_0x85421b['push'](_0x85421b['shift']());}}}(a65_0x27f5,0x6fb1c));import*as a65_0x2644da from'node:fs';import*as a65_0xc8443c from'node:path';import{SDKError,ErrorCode}from'../sdk/errors.js';import{getConfigDir}from'./config.js';import{createSecureDirectory,writeSecureFile}from'../utils/file-permissions.js';import{findProjectConfigPath}from'./project-config.js';import{loadSessionContext}from'./session.js';export const STUDIO_PROFILE_NAME=a65_0x417818(0x100);export function getProfileParams(_0x2f774a){const _0x3753a3=a65_0x417818,_0x2e1dae={};if(!_0x2f774a)return _0x2e1dae;for(const [_0x207c0a,_0x4388f1]of Object[_0x3753a3(0xf1)](_0x2f774a)){_0x207c0a!==_0x3753a3(0xe8)&&_0x4388f1!==undefined&&(_0x2e1dae[_0x207c0a]=_0x4388f1);}return _0x2e1dae;}export function getProfilesDir(){const _0x586570=a65_0x417818;return a65_0xc8443c[_0x586570(0x12c)](getConfigDir(),_0x586570(0x107));}function getProfileDir(_0x1c215e){const _0x4d7a8d=a65_0x417818;return a65_0xc8443c[_0x4d7a8d(0x12c)](getProfilesDir(),_0x1c215e);}function getProfileConfigPath(_0x3b385a){const _0x340ab3=a65_0x417818;return a65_0xc8443c[_0x340ab3(0x12c)](getProfileDir(_0x3b385a),_0x340ab3(0x10e));}function getProfileEnvPath(_0x15b530){const _0x326bf9=a65_0x417818;return a65_0xc8443c['join'](getProfileDir(_0x15b530),_0x326bf9(0x117));}function getGlobalConfigPath(){const _0x514223=a65_0x417818;return a65_0xc8443c[_0x514223(0x12c)](getConfigDir(),'tdx.json');}function validateProfileName(_0x4ab0fe){const _0x2cbf49=a65_0x417818;if(/^@?[a-zA-Z0-9_-]+$/[_0x2cbf49(0xed)](_0x4ab0fe))return;if(/^@tdx-studio:[a-zA-Z0-9_-]+:\d+(:\d+)?$/[_0x2cbf49(0xed)](_0x4ab0fe))return;throw new Error(_0x2cbf49(0x101)+_0x4ab0fe+'.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20underscore,\x20and\x20optional\x20@\x20prefix\x20for\x20reserved\x20profiles.');}function validateProfileConfig(_0x5e6983,_0x58e063){const _0x34e394=a65_0x417818;if(typeof _0x5e6983!==_0x34e394(0x113)||_0x5e6983===null)throw new SDKError(ErrorCode['INVALID_PROFILE_CONFIG'],_0x34e394(0x120)+_0x58e063+_0x34e394(0x11f));const _0x431cc0=[_0x34e394(0xe8),_0x34e394(0x129),_0x34e394(0x11c),_0x34e394(0x122),_0x34e394(0x11a),_0x34e394(0xf3),_0x34e394(0x128),_0x34e394(0x136)],_0x407ebb=_0x5e6983;for(const _0x459b0e of Object[_0x34e394(0x11e)](_0x407ebb)){!_0x431cc0[_0x34e394(0x104)](_0x459b0e)&&console['warn'](_0x34e394(0xf9)+_0x58e063+_0x34e394(0x106)+_0x459b0e+'\x27\x20will\x20be\x20ignored');}const _0x2629cd=_0x431cc0['filter'](_0x5b2f22=>_0x5b2f22!==_0x34e394(0x136));for(const _0xcb02ce of _0x2629cd){if(_0x407ebb[_0xcb02ce]!==undefined&&typeof _0x407ebb[_0xcb02ce]!=='string')throw new SDKError(ErrorCode[_0x34e394(0xf5)],_0x34e394(0x120)+_0x58e063+_0x34e394(0x132)+_0xcb02ce+_0x34e394(0x10a));}return!![];}function loadProfilesFromTdxJson(_0x235f9e,_0x3fccf8){const _0x1d82f5=a65_0x417818;if(!a65_0x2644da[_0x1d82f5(0x103)](_0x235f9e))return[];try{const _0x3b34a9=a65_0x2644da[_0x1d82f5(0x133)](_0x235f9e,_0x1d82f5(0x102)),_0x157932=JSON[_0x1d82f5(0x12a)](_0x3b34a9);if(!_0x157932['profiles']||typeof _0x157932['profiles']!==_0x1d82f5(0x113))return[];const _0x4077eb=[];for(const [_0x2d7e2e,_0x1a1352]of Object[_0x1d82f5(0xf1)](_0x157932[_0x1d82f5(0x107)])){try{validateProfileConfig(_0x1a1352,_0x2d7e2e);const _0x343aa0=getNewCredentialPath(_0x2d7e2e),_0x80f91a=getOldCredentialPath(_0x2d7e2e),_0x4208c5=a65_0x2644da[_0x1d82f5(0x103)](_0x343aa0)||a65_0x2644da['existsSync'](_0x80f91a);_0x4077eb[_0x1d82f5(0x126)]({'name':_0x2d7e2e,'config':_0x1a1352,'metadata':{'name':_0x2d7e2e,'createdAt':new Date()[_0x1d82f5(0x137)]()},'hasCredentials':_0x4208c5,'scope':_0x3fccf8});}catch(_0x55ce5d){_0x55ce5d instanceof Error&&(console[_0x1d82f5(0xec)](_0x1d82f5(0xfd)+_0x235f9e+':'),console[_0x1d82f5(0xec)]('\x20\x20'+_0x55ce5d[_0x1d82f5(0x131)]+'\x0a'));}}return _0x4077eb;}catch(_0x139e5e){return _0x139e5e instanceof SyntaxError?(console[_0x1d82f5(0xec)](_0x1d82f5(0x10c)+_0x235f9e+_0x1d82f5(0x119)),console[_0x1d82f5(0xec)](_0x1d82f5(0x12f)+_0x139e5e[_0x1d82f5(0x131)]+'\x0a')):console[_0x1d82f5(0xec)](_0x1d82f5(0x127)+_0x235f9e+':\x20'+_0x139e5e+'\x0a'),[];}}function a65_0x3237(_0x3090f6,_0x415774){_0x3090f6=_0x3090f6-0xe8;const _0x27f506=a65_0x27f5();let _0x32370d=_0x27f506[_0x3090f6];return _0x32370d;}export function getNewCredentialPath(_0x4fb576){const _0x5ab812=a65_0x417818;return a65_0xc8443c[_0x5ab812(0x12c)](getConfigDir(),_0x5ab812(0xfc)+_0x4fb576);}function getOldCredentialPath(_0x1c9a33){const _0x18c609=a65_0x417818;return a65_0xc8443c[_0x18c609(0x12c)](getProfilesDir(),_0x1c9a33,'.env');}function loadProfilesFromTdxJsonFiles(){const _0x1ee472=a65_0x417818,_0x35f2f3=[],_0x31ed3c=findProjectConfigPath();_0x31ed3c&&_0x35f2f3[_0x1ee472(0x126)](...loadProfilesFromTdxJson(_0x31ed3c,_0x1ee472(0x11d)));const _0x4d744f=a65_0xc8443c[_0x1ee472(0x12c)](getConfigDir(),_0x1ee472(0x10e));return _0x35f2f3[_0x1ee472(0x126)](...loadProfilesFromTdxJson(_0x4d744f,_0x1ee472(0xf6))),_0x35f2f3;}function loadProfilesFromDirectories(){const _0x2de899=a65_0x417818,_0x3a7c15=getProfilesDir();if(!a65_0x2644da[_0x2de899(0x103)](_0x3a7c15))return[];try{return a65_0x2644da[_0x2de899(0xfb)](_0x3a7c15,{'withFileTypes':!![]})[_0x2de899(0x116)](_0x57d21c=>_0x57d21c[_0x2de899(0x110)]())['map'](_0x1e5cde=>_0x1e5cde[_0x2de899(0x134)])[_0x2de899(0x116)](_0x124542=>{const _0xa3d2c9=_0x2de899,_0x1139bd=getProfileConfigPath(_0x124542),_0x425777=getProfileEnvPath(_0x124542);return a65_0x2644da['existsSync'](_0x1139bd)||a65_0x2644da[_0xa3d2c9(0x103)](_0x425777);})[_0x2de899(0xff)](_0x59e9b5=>{const _0x27116b=_0x2de899,_0x2ed940=loadProfileFromDirectory(_0x59e9b5);if(_0x2ed940)return{..._0x2ed940,'scope':_0x27116b(0x12d)};return null;})[_0x2de899(0x116)](_0x3de715=>_0x3de715!==null);}catch{return[];}}function loadProfileFromDirectory(_0x4aaced){const _0x4a1f9c=a65_0x417818,_0x16f119=getProfileConfigPath(_0x4aaced),_0x3aca6a=getOldCredentialPath(_0x4aaced);if(!a65_0x2644da['existsSync'](_0x16f119)&&!a65_0x2644da[_0x4a1f9c(0x103)](_0x3aca6a))return null;let _0x45fc32={},_0x41e088={'name':_0x4aaced,'createdAt':new Date()[_0x4a1f9c(0x137)]()};if(a65_0x2644da[_0x4a1f9c(0x103)](_0x16f119))try{const _0x51db45=a65_0x2644da['readFileSync'](_0x16f119,_0x4a1f9c(0x102)),_0x7505ba=JSON[_0x4a1f9c(0x12a)](_0x51db45),{metadata:_0x25dd61,..._0x1af01c}=_0x7505ba;_0x45fc32=_0x1af01c,_0x25dd61&&(_0x41e088=_0x25dd61);}catch{}return{'name':_0x4aaced,'config':_0x45fc32,'metadata':_0x41e088,'hasCredentials':a65_0x2644da['existsSync'](_0x3aca6a),'scope':_0x4a1f9c(0x12d)};}export function listProfiles(){const _0x2a2676=a65_0x417818,_0x1de186=loadProfilesFromTdxJsonFiles(),_0x746541=loadProfilesFromDirectories();if(_0x746541[_0x2a2676(0xfe)]>0x0){const _0x50b461=_0x746541[_0x2a2676(0xff)](_0x25333e=>_0x25333e[_0x2a2676(0x134)])[_0x2a2676(0x12c)](',\x20'),_0x444a5a=getConfigDir();console[_0x2a2676(0xec)](_0x2a2676(0x105)+_0x50b461),console[_0x2a2676(0xec)](_0x2a2676(0xeb)),console[_0x2a2676(0xec)](_0x2a2676(0xe9)+a65_0xc8443c['join'](_0x444a5a,'tdx.json')),console[_0x2a2676(0xec)](_0x2a2676(0x108)),console[_0x2a2676(0xec)](_0x2a2676(0x111));}const _0x5d013b=[..._0x1de186,..._0x746541],_0x5669e0=new Map();for(const _0x1cc006 of _0x5d013b){!_0x5669e0[_0x2a2676(0xf0)](_0x1cc006[_0x2a2676(0x134)])&&_0x5669e0[_0x2a2676(0x10f)](_0x1cc006[_0x2a2676(0x134)],_0x1cc006);}return Array[_0x2a2676(0x138)](_0x5669e0[_0x2a2676(0x12e)]())[_0x2a2676(0x13a)]((_0x3fa9e9,_0x4cfc87)=>_0x3fa9e9[_0x2a2676(0x134)][_0x2a2676(0xf7)](_0x4cfc87[_0x2a2676(0x134)]));}export function profileExists(_0x414272){const _0x2b854a=a65_0x417818,_0x46c6c5=listProfiles();return _0x46c6c5[_0x2b854a(0x114)](_0x2bc12a=>_0x2bc12a['name']===_0x414272);}export function loadProfile(_0xe2a78d){const _0x5906b3=a65_0x417818;validateProfileName(_0xe2a78d);const _0xc67d42=listProfiles(),_0x443c96=_0xc67d42[_0x5906b3(0xea)](_0x4300a9=>_0x4300a9['name']===_0xe2a78d);return _0x443c96||null;}export function saveProfile(_0x2d78f0,_0x236a00,_0x34206a=![]){saveProfileToUserConfig(_0x2d78f0,_0x236a00);}export function deleteProfile(_0x48fe94){const _0x4a73a0=a65_0x417818;validateProfileName(_0x48fe94);const _0x50874b=getProfileDir(_0x48fe94);if(!a65_0x2644da['existsSync'](_0x50874b))throw new Error(_0x4a73a0(0x12b)+_0x48fe94+_0x4a73a0(0x139));a65_0x2644da[_0x4a73a0(0x123)](_0x50874b,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x15d0da,_0x8c417f){const _0x1c941d=a65_0x417818;validateProfileName(_0x15d0da);const _0x555717=getGlobalConfigPath(),_0x290779=getConfigDir();!a65_0x2644da[_0x1c941d(0x103)](_0x290779)&&createSecureDirectory(_0x290779);let _0x40a138={};if(a65_0x2644da[_0x1c941d(0x103)](_0x555717))try{const _0x49201a=a65_0x2644da[_0x1c941d(0x133)](_0x555717,'utf-8');_0x40a138=JSON[_0x1c941d(0x12a)](_0x49201a);}catch{console[_0x1c941d(0xec)](_0x1c941d(0x10d)+_0x555717+',\x20creating\x20new\x20file');}!_0x40a138[_0x1c941d(0x107)]&&(_0x40a138[_0x1c941d(0x107)]={}),_0x40a138[_0x1c941d(0x107)][_0x15d0da]=_0x8c417f,writeSecureFile(_0x555717,JSON[_0x1c941d(0xee)](_0x40a138,null,0x2));}export function removeProfileFromUserConfig(_0x3846a8){const _0x3a4cef=a65_0x417818;validateProfileName(_0x3846a8);const _0x47118e=getGlobalConfigPath();if(!a65_0x2644da['existsSync'](_0x47118e))throw new Error(_0x3a4cef(0x120)+_0x3846a8+_0x3a4cef(0xf4));let _0x1d2559={};try{const _0xfa9d45=a65_0x2644da[_0x3a4cef(0x133)](_0x47118e,'utf-8');_0x1d2559=JSON['parse'](_0xfa9d45);}catch{throw new Error(_0x3a4cef(0x112)+_0x47118e);}if(!_0x1d2559['profiles']||!_0x1d2559[_0x3a4cef(0x107)][_0x3846a8])throw new Error(_0x3a4cef(0x120)+_0x3846a8+'\x27\x20not\x20found\x20in\x20user\x20configuration');delete _0x1d2559[_0x3a4cef(0x107)][_0x3846a8],_0x1d2559['profile']===_0x3846a8&&delete _0x1d2559['profile'],writeSecureFile(_0x47118e,JSON[_0x3a4cef(0xee)](_0x1d2559,null,0x2));}export function getActiveProfile(){const _0x2303fb=a65_0x417818,_0x63ebd0=loadSessionContext();if(_0x63ebd0?.[_0x2303fb(0x130)])return _0x63ebd0[_0x2303fb(0x130)];if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x116da8=getGlobalConfigPath();if(!a65_0x2644da[_0x2303fb(0x103)](_0x116da8))return null;try{const _0x9ea3af=a65_0x2644da[_0x2303fb(0x133)](_0x116da8,_0x2303fb(0x102)),_0x2d24ca=JSON[_0x2303fb(0x12a)](_0x9ea3af);return _0x2d24ca[_0x2303fb(0x130)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0xbad1fc){const _0xc1df3c=a65_0x417818,_0x18d8e7=getGlobalConfigPath(),_0x4e5a9b=getConfigDir();!a65_0x2644da[_0xc1df3c(0x103)](_0x4e5a9b)&&createSecureDirectory(_0x4e5a9b);let _0x57a0ad={};if(a65_0x2644da[_0xc1df3c(0x103)](_0x18d8e7))try{const _0x2f214f=a65_0x2644da['readFileSync'](_0x18d8e7,_0xc1df3c(0x102));_0x57a0ad=JSON[_0xc1df3c(0x12a)](_0x2f214f);}catch{console[_0xc1df3c(0xec)](_0xc1df3c(0x10d)+_0x18d8e7+_0xc1df3c(0x10b));}_0x57a0ad[_0xc1df3c(0x129)]=_0xbad1fc,writeSecureFile(_0x18d8e7,JSON[_0xc1df3c(0xee)](_0x57a0ad,null,0x2));}export function saveActiveProfileToUserConfig(_0x57c989){const _0x55b227=a65_0x417818;validateProfileName(_0x57c989);const _0x4e97cf=getGlobalConfigPath(),_0x1d66bd=getConfigDir();!a65_0x2644da[_0x55b227(0x103)](_0x1d66bd)&&createSecureDirectory(_0x1d66bd);let _0x17e7a7={};if(a65_0x2644da[_0x55b227(0x103)](_0x4e97cf))try{const _0xb9d6ef=a65_0x2644da[_0x55b227(0x133)](_0x4e97cf,_0x55b227(0x102));_0x17e7a7=JSON[_0x55b227(0x12a)](_0xb9d6ef);}catch{console[_0x55b227(0xec)](_0x55b227(0x10d)+_0x4e97cf+_0x55b227(0x10b));}_0x17e7a7[_0x55b227(0x130)]=_0x57c989,writeSecureFile(_0x4e97cf,JSON['stringify'](_0x17e7a7,null,0x2));}function clearFieldFromUserConfig(_0x291c0d){const _0x86b1ed=a65_0x417818,_0x31259e=getGlobalConfigPath();if(!a65_0x2644da[_0x86b1ed(0x103)](_0x31259e))return;let _0x2ab729={};try{const _0x5d50f9=a65_0x2644da[_0x86b1ed(0x133)](_0x31259e,_0x86b1ed(0x102));_0x2ab729=JSON[_0x86b1ed(0x12a)](_0x5d50f9);}catch{return;}delete _0x2ab729[_0x291c0d],writeSecureFile(_0x31259e,JSON[_0x86b1ed(0xee)](_0x2ab729,null,0x2));}export function clearDefaultSiteFromUserConfig(){clearFieldFromUserConfig('site');}export function clearActiveProfileFromUserConfig(){clearFieldFromUserConfig('profile');}export function createProfile(_0x56ef0a,_0x3a6e9f){const _0x39a4f3=a65_0x417818;validateProfileName(_0x56ef0a);if(profileExists(_0x56ef0a))throw new Error(_0x39a4f3(0x12b)+_0x56ef0a+_0x39a4f3(0x109));saveProfile(_0x56ef0a,_0x3a6e9f);}export function saveProfileCredentials(_0x2d040d,_0x13b7fd){const _0x4f7f69=a65_0x417818;validateProfileName(_0x2d040d);if(!profileExists(_0x2d040d))throw new Error(_0x4f7f69(0x12b)+_0x2d040d+_0x4f7f69(0x139));const _0x1f8b1f=getNewCredentialPath(_0x2d040d);writeSecureFile(_0x1f8b1f,_0x13b7fd);}export function loadProfileCredentials(_0x4c7386){const _0x5d0ca6=a65_0x417818;validateProfileName(_0x4c7386);const _0x425c32=getNewCredentialPath(_0x4c7386);if(a65_0x2644da[_0x5d0ca6(0x103)](_0x425c32))try{return a65_0x2644da[_0x5d0ca6(0x133)](_0x425c32,_0x5d0ca6(0x102));}catch{}const _0x5ad4a7=getOldCredentialPath(_0x4c7386);if(a65_0x2644da[_0x5d0ca6(0x103)](_0x5ad4a7)){console[_0x5d0ca6(0xec)]('\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27'+_0x4c7386+'\x27'),console[_0x5d0ca6(0xec)]('To\x20migrate:'),console[_0x5d0ca6(0xec)](_0x5d0ca6(0x124)+_0x5ad4a7+'\x22\x20\x22'+_0x425c32+'\x22'),console[_0x5d0ca6(0xec)]('Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a');try{return a65_0x2644da[_0x5d0ca6(0x133)](_0x5ad4a7,_0x5d0ca6(0x102));}catch{return null;}}return null;}
1
+ const a66_0x4023a1=a66_0x20b5;(function(_0x2907dc,_0x2d5fde){const _0x9314e=a66_0x20b5,_0x3cf399=_0x2907dc();while(!![]){try{const _0x59e580=parseInt(_0x9314e(0x1a4))/0x1*(parseInt(_0x9314e(0x1c2))/0x2)+parseInt(_0x9314e(0x1b8))/0x3+-parseInt(_0x9314e(0x1c3))/0x4*(parseInt(_0x9314e(0x19f))/0x5)+-parseInt(_0x9314e(0x1a9))/0x6+-parseInt(_0x9314e(0x1c9))/0x7*(-parseInt(_0x9314e(0x1a2))/0x8)+-parseInt(_0x9314e(0x1a8))/0x9*(-parseInt(_0x9314e(0x1be))/0xa)+-parseInt(_0x9314e(0x1a7))/0xb;if(_0x59e580===_0x2d5fde)break;else _0x3cf399['push'](_0x3cf399['shift']());}catch(_0x461319){_0x3cf399['push'](_0x3cf399['shift']());}}}(a66_0x14a2,0x59e84));import*as a66_0x1b3a19 from'node:fs';function a66_0x20b5(_0x1c7306,_0x2f715a){_0x1c7306=_0x1c7306-0x18c;const _0x14a270=a66_0x14a2();let _0x20b5a3=_0x14a270[_0x1c7306];return _0x20b5a3;}import*as a66_0x2dfba2 from'node:path';import{SDKError,ErrorCode}from'../sdk/errors.js';import{getConfigDir}from'./config.js';import{createSecureDirectory,writeSecureFile}from'../utils/file-permissions.js';import{findProjectConfigPath}from'./project-config.js';import{loadSessionContext}from'./session.js';export const STUDIO_PROFILE_NAME=a66_0x4023a1(0x1af);export function getProfileParams(_0x5e5241){const _0x1e1bc9=a66_0x4023a1,_0x4de6e6={};if(!_0x5e5241)return _0x4de6e6;for(const [_0x475b60,_0x377e73]of Object[_0x1e1bc9(0x1cf)](_0x5e5241)){_0x475b60!=='description'&&_0x377e73!==undefined&&(_0x4de6e6[_0x475b60]=_0x377e73);}return _0x4de6e6;}export function getProfilesDir(){const _0x30df50=a66_0x4023a1;return a66_0x2dfba2[_0x30df50(0x1bb)](getConfigDir(),'profiles');}function getProfileDir(_0x3415d5){const _0x32be68=a66_0x4023a1;return a66_0x2dfba2[_0x32be68(0x1bb)](getProfilesDir(),_0x3415d5);}function getProfileConfigPath(_0x4d090f){const _0x25b6c3=a66_0x4023a1;return a66_0x2dfba2[_0x25b6c3(0x1bb)](getProfileDir(_0x4d090f),_0x25b6c3(0x1ac));}function getProfileEnvPath(_0x3c90c5){const _0x4a9c98=a66_0x4023a1;return a66_0x2dfba2[_0x4a9c98(0x1bb)](getProfileDir(_0x3c90c5),_0x4a9c98(0x18d));}function getGlobalConfigPath(){const _0xc54016=a66_0x4023a1;return a66_0x2dfba2[_0xc54016(0x1bb)](getConfigDir(),'tdx.json');}function validateProfileName(_0x5d491c){const _0x81921a=a66_0x4023a1;if(/^@?[a-zA-Z0-9_-]+$/[_0x81921a(0x18c)](_0x5d491c))return;if(/^@tdx-studio:[a-zA-Z0-9_-]+:\d+(:\d+)?$/['test'](_0x5d491c))return;throw new Error(_0x81921a(0x191)+_0x5d491c+_0x81921a(0x19e));}function validateProfileConfig(_0xf6350a,_0x5066cd){const _0x2c9ee8=a66_0x4023a1;if(typeof _0xf6350a!=='object'||_0xf6350a===null)throw new SDKError(ErrorCode[_0x2c9ee8(0x1d4)],_0x2c9ee8(0x1b7)+_0x5066cd+_0x2c9ee8(0x1da));const _0x32de6d=[_0x2c9ee8(0x1b0),_0x2c9ee8(0x198),_0x2c9ee8(0x1cc),'parent_segment','llm_project',_0x2c9ee8(0x19c),_0x2c9ee8(0x194),_0x2c9ee8(0x1bc)],_0x50c1d6=_0xf6350a;for(const _0xcba09 of Object['keys'](_0x50c1d6)){!_0x32de6d[_0x2c9ee8(0x1b1)](_0xcba09)&&console[_0x2c9ee8(0x1db)](_0x2c9ee8(0x197)+_0x5066cd+_0x2c9ee8(0x1a3)+_0xcba09+_0x2c9ee8(0x192));}const _0x35da1a=_0x32de6d['filter'](_0x5ba76c=>_0x5ba76c!==_0x2c9ee8(0x1bc));for(const _0x6de4cd of _0x35da1a){if(_0x50c1d6[_0x6de4cd]!==undefined&&typeof _0x50c1d6[_0x6de4cd]!==_0x2c9ee8(0x193))throw new SDKError(ErrorCode[_0x2c9ee8(0x1d4)],_0x2c9ee8(0x1b7)+_0x5066cd+_0x2c9ee8(0x19a)+_0x6de4cd+_0x2c9ee8(0x1c8));}return!![];}function loadProfilesFromTdxJson(_0x2a5d65,_0x13a32a){const _0x4ce0f1=a66_0x4023a1;if(!a66_0x1b3a19[_0x4ce0f1(0x1de)](_0x2a5d65))return[];try{const _0x398ff0=a66_0x1b3a19[_0x4ce0f1(0x1b9)](_0x2a5d65,_0x4ce0f1(0x1d5)),_0x36daf0=JSON[_0x4ce0f1(0x19d)](_0x398ff0);if(!_0x36daf0[_0x4ce0f1(0x1c4)]||typeof _0x36daf0[_0x4ce0f1(0x1c4)]!=='object')return[];const _0x5091bc=[];for(const [_0x112a2e,_0x4418ae]of Object[_0x4ce0f1(0x1cf)](_0x36daf0[_0x4ce0f1(0x1c4)])){try{validateProfileConfig(_0x4418ae,_0x112a2e);const _0x28485f=getNewCredentialPath(_0x112a2e),_0x2f7ce5=getOldCredentialPath(_0x112a2e),_0x52a137=a66_0x1b3a19[_0x4ce0f1(0x1de)](_0x28485f)||a66_0x1b3a19['existsSync'](_0x2f7ce5);_0x5091bc['push']({'name':_0x112a2e,'config':_0x4418ae,'metadata':{'name':_0x112a2e,'createdAt':new Date()[_0x4ce0f1(0x1b3)]()},'hasCredentials':_0x52a137,'scope':_0x13a32a});}catch(_0x3b1eaf){_0x3b1eaf instanceof Error&&(console[_0x4ce0f1(0x1db)](_0x4ce0f1(0x18e)+_0x2a5d65+':'),console[_0x4ce0f1(0x1db)]('\x20\x20'+_0x3b1eaf['message']+'\x0a'));}}return _0x5091bc;}catch(_0x1c66a7){return _0x1c66a7 instanceof SyntaxError?(console[_0x4ce0f1(0x1db)](_0x4ce0f1(0x1b4)+_0x2a5d65+_0x4ce0f1(0x1ab)),console[_0x4ce0f1(0x1db)](_0x4ce0f1(0x1ba)+_0x1c66a7['message']+'\x0a')):console[_0x4ce0f1(0x1db)](_0x4ce0f1(0x1ce)+_0x2a5d65+':\x20'+_0x1c66a7+'\x0a'),[];}}export function getNewCredentialPath(_0x2a0844){const _0x1e3809=a66_0x4023a1;return a66_0x2dfba2['join'](getConfigDir(),_0x1e3809(0x1c5)+_0x2a0844);}function getOldCredentialPath(_0x251ecf){return a66_0x2dfba2['join'](getProfilesDir(),_0x251ecf,'.env');}function a66_0x14a2(){const _0x1a636f=['existsSync','test','.env','\x0aWarning:\x20Skipping\x20invalid\x20profile\x20in\x20','localeCompare','filter','Invalid\x20profile\x20name:\x20','\x27\x20will\x20be\x20ignored','string','account_name','Then\x20define\x20profiles\x20in\x20~/.config/tdx/tdx.json\x0a','length','Warning:\x20Profile\x20\x27','site','Profile\x20','\x27:\x20\x27','Failed\x20to\x20parse\x20','llm_agent','parse','.\x20Must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20underscore,\x20and\x20optional\x20@\x20prefix\x20for\x20reserved\x20profiles.','75155LlkMga','\x0aWarning:\x20Using\x20deprecated\x20credential\x20location\x20for\x20profile\x20\x27','push','190768EWgqtw','\x27:\x20unknown\x20config\x20key\x20\x27','575951fAgMeW','some','Warning:\x20Failed\x20to\x20parse\x20','5961483cgKmdr','48186zvXSPN','2305038CWsmbM','\x27\x20not\x20found\x20in\x20user\x20configuration',':\x20Invalid\x20JSON\x20syntax','tdx.json','\x20\x202.\x20Add\x20profiles\x20under\x20a\x20\x22profiles\x22\x20key\x20(see\x20\x27tdx\x20profiles\x27\x20for\x20current\x20config)','To\x20migrate:','@tdx-studio','description','includes','Please\x20migrate\x20to\x20~/.config/tdx/tdx.json:','toISOString','\x0aWarning:\x20Failed\x20to\x20parse\x20','profile','\x20does\x20not\x20exist','Profile\x20\x27','1624038YnCckH','readFileSync','Error:\x20','join','user_info','\x20\x20mv\x20\x22','320EssLyT','readdirSync','map','name','2iVSkIz','100TerRma','profiles','.env.','\x0aWarning:\x20Profiles\x20in\x20directories\x20are\x20deprecated:\x20','rmSync','\x27\x20must\x20be\x20a\x20string','112PvugDq','has','directory','database','values','\x0aWarning:\x20Failed\x20to\x20load\x20profiles\x20from\x20','entries','isDirectory','\x20\x203.\x20Move\x20credentials:\x20mv\x20~/.config/tdx/profiles/<name>/.env\x20~/.config/tdx/.env.<name>\x0a','local','\x20\x201.\x20Edit:\x20','INVALID_PROFILE_CONFIG','utf-8','set','from',',\x20creating\x20new\x20file','sort','\x27:\x20config\x20must\x20be\x20an\x20object','warn','stringify','user'];a66_0x14a2=function(){return _0x1a636f;};return a66_0x14a2();}function loadProfilesFromTdxJsonFiles(){const _0x1aef8c=a66_0x4023a1,_0x1cc19c=[],_0x5a16d2=findProjectConfigPath();_0x5a16d2&&_0x1cc19c[_0x1aef8c(0x1a1)](...loadProfilesFromTdxJson(_0x5a16d2,_0x1aef8c(0x1d2)));const _0x425117=a66_0x2dfba2['join'](getConfigDir(),'tdx.json');return _0x1cc19c['push'](...loadProfilesFromTdxJson(_0x425117,_0x1aef8c(0x1dd))),_0x1cc19c;}function loadProfilesFromDirectories(){const _0xc103df=a66_0x4023a1,_0x4d2880=getProfilesDir();if(!a66_0x1b3a19['existsSync'](_0x4d2880))return[];try{return a66_0x1b3a19[_0xc103df(0x1bf)](_0x4d2880,{'withFileTypes':!![]})[_0xc103df(0x190)](_0xf31475=>_0xf31475[_0xc103df(0x1d0)]())[_0xc103df(0x1c0)](_0x5f0f8f=>_0x5f0f8f[_0xc103df(0x1c1)])['filter'](_0x57e438=>{const _0x4ee167=_0xc103df,_0x5d957f=getProfileConfigPath(_0x57e438),_0x5b4ffa=getProfileEnvPath(_0x57e438);return a66_0x1b3a19[_0x4ee167(0x1de)](_0x5d957f)||a66_0x1b3a19[_0x4ee167(0x1de)](_0x5b4ffa);})['map'](_0x1e1bba=>{const _0xf37ab1=_0xc103df,_0x4ca242=loadProfileFromDirectory(_0x1e1bba);if(_0x4ca242)return{..._0x4ca242,'scope':_0xf37ab1(0x1cb)};return null;})[_0xc103df(0x190)](_0xa313fa=>_0xa313fa!==null);}catch{return[];}}function loadProfileFromDirectory(_0xbeeef1){const _0x490fdd=a66_0x4023a1,_0x174dba=getProfileConfigPath(_0xbeeef1),_0xc7832c=getOldCredentialPath(_0xbeeef1);if(!a66_0x1b3a19['existsSync'](_0x174dba)&&!a66_0x1b3a19['existsSync'](_0xc7832c))return null;let _0x1c04e7={},_0x81165f={'name':_0xbeeef1,'createdAt':new Date()['toISOString']()};if(a66_0x1b3a19[_0x490fdd(0x1de)](_0x174dba))try{const _0x3d9955=a66_0x1b3a19[_0x490fdd(0x1b9)](_0x174dba,'utf-8'),_0x4db513=JSON[_0x490fdd(0x19d)](_0x3d9955),{metadata:_0x158c33,..._0x11fb45}=_0x4db513;_0x1c04e7=_0x11fb45,_0x158c33&&(_0x81165f=_0x158c33);}catch{}return{'name':_0xbeeef1,'config':_0x1c04e7,'metadata':_0x81165f,'hasCredentials':a66_0x1b3a19[_0x490fdd(0x1de)](_0xc7832c),'scope':_0x490fdd(0x1cb)};}export function listProfiles(){const _0x42680e=a66_0x4023a1,_0x21a649=loadProfilesFromTdxJsonFiles(),_0x3aa6e2=loadProfilesFromDirectories();if(_0x3aa6e2[_0x42680e(0x196)]>0x0){const _0x174661=_0x3aa6e2[_0x42680e(0x1c0)](_0xa8593=>_0xa8593[_0x42680e(0x1c1)])[_0x42680e(0x1bb)](',\x20'),_0x21002c=getConfigDir();console[_0x42680e(0x1db)](_0x42680e(0x1c6)+_0x174661),console[_0x42680e(0x1db)](_0x42680e(0x1b2)),console[_0x42680e(0x1db)](_0x42680e(0x1d3)+a66_0x2dfba2[_0x42680e(0x1bb)](_0x21002c,_0x42680e(0x1ac))),console[_0x42680e(0x1db)](_0x42680e(0x1ad)),console['warn'](_0x42680e(0x1d1));}const _0x4f7b02=[..._0x21a649,..._0x3aa6e2],_0x12fd26=new Map();for(const _0x40632b of _0x4f7b02){!_0x12fd26[_0x42680e(0x1ca)](_0x40632b[_0x42680e(0x1c1)])&&_0x12fd26[_0x42680e(0x1d6)](_0x40632b[_0x42680e(0x1c1)],_0x40632b);}return Array[_0x42680e(0x1d7)](_0x12fd26[_0x42680e(0x1cd)]())[_0x42680e(0x1d9)]((_0x287bd5,_0x5b9470)=>_0x287bd5[_0x42680e(0x1c1)][_0x42680e(0x18f)](_0x5b9470[_0x42680e(0x1c1)]));}export function profileExists(_0x4d6179){const _0x3ff8e2=a66_0x4023a1,_0x57384b=listProfiles();return _0x57384b[_0x3ff8e2(0x1a5)](_0x342cda=>_0x342cda[_0x3ff8e2(0x1c1)]===_0x4d6179);}export function loadProfile(_0x2c263b){const _0x25f75f=a66_0x4023a1;validateProfileName(_0x2c263b);const _0x1fe442=listProfiles(),_0x2602a3=_0x1fe442['find'](_0x48572b=>_0x48572b[_0x25f75f(0x1c1)]===_0x2c263b);return _0x2602a3||null;}export function saveProfile(_0x3cd386,_0x11f45d,_0x3bfbb8=![]){saveProfileToUserConfig(_0x3cd386,_0x11f45d);}export function deleteProfile(_0x2cde95){const _0x491bb7=a66_0x4023a1;validateProfileName(_0x2cde95);const _0x456395=getProfileDir(_0x2cde95);if(!a66_0x1b3a19[_0x491bb7(0x1de)](_0x456395))throw new Error(_0x491bb7(0x199)+_0x2cde95+'\x20does\x20not\x20exist');a66_0x1b3a19[_0x491bb7(0x1c7)](_0x456395,{'recursive':!![],'force':!![]});}export function saveProfileToUserConfig(_0x16f96b,_0x28352b){const _0x523935=a66_0x4023a1;validateProfileName(_0x16f96b);const _0x504f25=getGlobalConfigPath(),_0x142cef=getConfigDir();!a66_0x1b3a19[_0x523935(0x1de)](_0x142cef)&&createSecureDirectory(_0x142cef);let _0xdb5078={};if(a66_0x1b3a19[_0x523935(0x1de)](_0x504f25))try{const _0x3b67ea=a66_0x1b3a19[_0x523935(0x1b9)](_0x504f25,_0x523935(0x1d5));_0xdb5078=JSON['parse'](_0x3b67ea);}catch{console[_0x523935(0x1db)](_0x523935(0x1a6)+_0x504f25+_0x523935(0x1d8));}!_0xdb5078[_0x523935(0x1c4)]&&(_0xdb5078[_0x523935(0x1c4)]={}),_0xdb5078[_0x523935(0x1c4)][_0x16f96b]=_0x28352b,writeSecureFile(_0x504f25,JSON[_0x523935(0x1dc)](_0xdb5078,null,0x2));}export function removeProfileFromUserConfig(_0xcc4681){const _0x2d3ca3=a66_0x4023a1;validateProfileName(_0xcc4681);const _0x1e3ea3=getGlobalConfigPath();if(!a66_0x1b3a19[_0x2d3ca3(0x1de)](_0x1e3ea3))throw new Error(_0x2d3ca3(0x1b7)+_0xcc4681+_0x2d3ca3(0x1aa));let _0x3a7b57={};try{const _0x5b93dc=a66_0x1b3a19['readFileSync'](_0x1e3ea3,_0x2d3ca3(0x1d5));_0x3a7b57=JSON['parse'](_0x5b93dc);}catch{throw new Error(_0x2d3ca3(0x19b)+_0x1e3ea3);}if(!_0x3a7b57[_0x2d3ca3(0x1c4)]||!_0x3a7b57[_0x2d3ca3(0x1c4)][_0xcc4681])throw new Error(_0x2d3ca3(0x1b7)+_0xcc4681+'\x27\x20not\x20found\x20in\x20user\x20configuration');delete _0x3a7b57[_0x2d3ca3(0x1c4)][_0xcc4681],_0x3a7b57['profile']===_0xcc4681&&delete _0x3a7b57[_0x2d3ca3(0x1b5)],writeSecureFile(_0x1e3ea3,JSON[_0x2d3ca3(0x1dc)](_0x3a7b57,null,0x2));}export function getActiveProfile(){const _0x1ef80d=a66_0x4023a1,_0x463cf0=loadSessionContext();if(_0x463cf0?.[_0x1ef80d(0x1b5)])return _0x463cf0['profile'];if(process.env.TDX_PROFILE)return process.env.TDX_PROFILE;const _0x1e0435=getGlobalConfigPath();if(!a66_0x1b3a19[_0x1ef80d(0x1de)](_0x1e0435))return null;try{const _0x1209b5=a66_0x1b3a19[_0x1ef80d(0x1b9)](_0x1e0435,_0x1ef80d(0x1d5)),_0x5a46bf=JSON[_0x1ef80d(0x19d)](_0x1209b5);return _0x5a46bf[_0x1ef80d(0x1b5)]||null;}catch{return null;}}export function saveDefaultSiteToUserConfig(_0x907a20){const _0x2afe2a=a66_0x4023a1,_0x4cbd66=getGlobalConfigPath(),_0x3ffa7e=getConfigDir();!a66_0x1b3a19[_0x2afe2a(0x1de)](_0x3ffa7e)&&createSecureDirectory(_0x3ffa7e);let _0x43b193={};if(a66_0x1b3a19[_0x2afe2a(0x1de)](_0x4cbd66))try{const _0x4218e8=a66_0x1b3a19[_0x2afe2a(0x1b9)](_0x4cbd66,_0x2afe2a(0x1d5));_0x43b193=JSON[_0x2afe2a(0x19d)](_0x4218e8);}catch{console[_0x2afe2a(0x1db)]('Warning:\x20Failed\x20to\x20parse\x20'+_0x4cbd66+_0x2afe2a(0x1d8));}_0x43b193[_0x2afe2a(0x198)]=_0x907a20,writeSecureFile(_0x4cbd66,JSON[_0x2afe2a(0x1dc)](_0x43b193,null,0x2));}export function saveActiveProfileToUserConfig(_0xcf6e08){const _0x36073e=a66_0x4023a1;validateProfileName(_0xcf6e08);const _0x111d10=getGlobalConfigPath(),_0x1dead1=getConfigDir();!a66_0x1b3a19[_0x36073e(0x1de)](_0x1dead1)&&createSecureDirectory(_0x1dead1);let _0x430f0b={};if(a66_0x1b3a19[_0x36073e(0x1de)](_0x111d10))try{const _0x189320=a66_0x1b3a19['readFileSync'](_0x111d10,_0x36073e(0x1d5));_0x430f0b=JSON[_0x36073e(0x19d)](_0x189320);}catch{console['warn']('Warning:\x20Failed\x20to\x20parse\x20'+_0x111d10+_0x36073e(0x1d8));}_0x430f0b[_0x36073e(0x1b5)]=_0xcf6e08,writeSecureFile(_0x111d10,JSON[_0x36073e(0x1dc)](_0x430f0b,null,0x2));}function clearFieldFromUserConfig(_0x581aff){const _0x4d3421=a66_0x4023a1,_0xd74d1=getGlobalConfigPath();if(!a66_0x1b3a19[_0x4d3421(0x1de)](_0xd74d1))return;let _0x387abc={};try{const _0xf047a7=a66_0x1b3a19[_0x4d3421(0x1b9)](_0xd74d1,'utf-8');_0x387abc=JSON[_0x4d3421(0x19d)](_0xf047a7);}catch{return;}delete _0x387abc[_0x581aff],writeSecureFile(_0xd74d1,JSON[_0x4d3421(0x1dc)](_0x387abc,null,0x2));}export function clearDefaultSiteFromUserConfig(){clearFieldFromUserConfig('site');}export function clearActiveProfileFromUserConfig(){const _0x9eabc0=a66_0x4023a1;clearFieldFromUserConfig(_0x9eabc0(0x1b5));}export function createProfile(_0x517aeb,_0x44fc54){const _0x20412f=a66_0x4023a1;validateProfileName(_0x517aeb);if(profileExists(_0x517aeb))throw new Error(_0x20412f(0x199)+_0x517aeb+'\x20already\x20exists');saveProfile(_0x517aeb,_0x44fc54);}export function saveProfileCredentials(_0x198ec4,_0x34272e){const _0x28acd1=a66_0x4023a1;validateProfileName(_0x198ec4);if(!profileExists(_0x198ec4))throw new Error(_0x28acd1(0x199)+_0x198ec4+_0x28acd1(0x1b6));const _0x2bedfa=getNewCredentialPath(_0x198ec4);writeSecureFile(_0x2bedfa,_0x34272e);}export function loadProfileCredentials(_0x4e160e){const _0x4ad6e=a66_0x4023a1;validateProfileName(_0x4e160e);const _0x1d6775=getNewCredentialPath(_0x4e160e);if(a66_0x1b3a19[_0x4ad6e(0x1de)](_0x1d6775))try{return a66_0x1b3a19['readFileSync'](_0x1d6775,_0x4ad6e(0x1d5));}catch{}const _0x587999=getOldCredentialPath(_0x4e160e);if(a66_0x1b3a19['existsSync'](_0x587999)){console[_0x4ad6e(0x1db)](_0x4ad6e(0x1a0)+_0x4e160e+'\x27'),console['warn'](_0x4ad6e(0x1ae)),console['warn'](_0x4ad6e(0x1bd)+_0x587999+'\x22\x20\x22'+_0x1d6775+'\x22'),console['warn'](_0x4ad6e(0x195));try{return a66_0x1b3a19[_0x4ad6e(0x1b9)](_0x587999,_0x4ad6e(0x1d5));}catch{return null;}}return null;}
@@ -1 +1 @@
1
- (function(_0x189343,_0x12a1a8){const _0x22bd0e=a66_0xc674,_0x4db6b9=_0x189343();while(!![]){try{const _0x4522ab=-parseInt(_0x22bd0e(0x1dd))/0x1+parseInt(_0x22bd0e(0x1cb))/0x2*(parseInt(_0x22bd0e(0x1df))/0x3)+-parseInt(_0x22bd0e(0x1d8))/0x4+-parseInt(_0x22bd0e(0x1cf))/0x5+-parseInt(_0x22bd0e(0x1d9))/0x6*(parseInt(_0x22bd0e(0x1e0))/0x7)+parseInt(_0x22bd0e(0x1ce))/0x8+parseInt(_0x22bd0e(0x1e5))/0x9;if(_0x4522ab===_0x12a1a8)break;else _0x4db6b9['push'](_0x4db6b9['shift']());}catch(_0x21d4d6){_0x4db6b9['push'](_0x4db6b9['shift']());}}}(a66_0x59d6,0x3332d));import*as a66_0x19840c from'node:fs';import*as a66_0x5232a2 from'node:path';function a66_0xc674(_0x432413,_0x4ecd4b){_0x432413=_0x432413-0x1cb;const _0x59d6ef=a66_0x59d6();let _0xc67440=_0x59d6ef[_0x432413];return _0xc67440;}const PROJECT_CONFIG_FILENAME='tdx.json';function a66_0x59d6(){const _0x4d9415=['979768INhqVt','57678MrhnpH','stringify','warn','dirname','363194uHpsyN','cwd','4506UbfFib','301MKWgjy','parse','apiKey','readFileSync',').\x20','8107074dXxBFx','258FBquji','api_key','code','1669072KJlRqS','359870vAzKEC','ENOENT','TD_API_KEY','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','join','Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20(','includes','profile','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.'];a66_0x59d6=function(){return _0x4d9415;};return a66_0x59d6();}export function findProjectConfigPath(_0x4aaea4){const _0x36915c=a66_0xc674;let _0x4d7f09=_0x4aaea4||process[_0x36915c(0x1de)]();while(!![]){const _0x322cfe=a66_0x5232a2[_0x36915c(0x1d3)](_0x4d7f09,PROJECT_CONFIG_FILENAME);if(a66_0x19840c['existsSync'](_0x322cfe))return _0x322cfe;const _0x1e5c88=a66_0x5232a2[_0x36915c(0x1dc)](_0x4d7f09);if(_0x1e5c88===_0x4d7f09)return null;_0x4d7f09=_0x1e5c88;}}export function loadProjectConfig(_0x57aaf0){const _0x1df769=a66_0xc674,_0x10413c=findProjectConfigPath(_0x57aaf0);if(!_0x10413c)return null;try{const _0x241b6e=a66_0x19840c[_0x1df769(0x1e3)](_0x10413c,'utf-8'),_0x2bd80a=JSON[_0x1df769(0x1e1)](_0x241b6e),_0x59b786=JSON[_0x1df769(0x1da)](_0x2bd80a);if(_0x59b786[_0x1df769(0x1d5)](_0x1df769(0x1d1))||_0x59b786[_0x1df769(0x1d5)]('apiKey')||_0x59b786[_0x1df769(0x1d5)](_0x1df769(0x1cc)))throw new Error(_0x1df769(0x1d4)+_0x10413c+_0x1df769(0x1e4)+'Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.');const {metadata:_0xf2322f,profile:_0x2b97fe,..._0x27f8fd}=_0x2bd80a;return _0x2b97fe&&console[_0x1df769(0x1db)]('Warning:\x20\x27profile\x27\x20field\x20in\x20'+_0x10413c+'\x20is\x20ignored.\x20'+'Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json'),_0x27f8fd;}catch(_0x542e5f){if(_0x542e5f instanceof Error&&_0x1df769(0x1cd)in _0x542e5f&&_0x542e5f[_0x1df769(0x1cd)]===_0x1df769(0x1d0))return null;throw new Error('Failed\x20to\x20load\x20project\x20config\x20from\x20'+_0x10413c+':\x20'+_0x542e5f);}}export function saveProjectConfig(_0x2bf8db,_0x5b019b){const _0x59fb66=a66_0xc674,_0x461336=_0x5b019b||process['cwd'](),_0x431229=a66_0x5232a2[_0x59fb66(0x1d3)](_0x461336,PROJECT_CONFIG_FILENAME),_0x24bcf1=JSON[_0x59fb66(0x1da)](_0x2bf8db);if(_0x24bcf1['includes'](_0x59fb66(0x1d1))||_0x24bcf1[_0x59fb66(0x1d5)](_0x59fb66(0x1e2))||_0x24bcf1[_0x59fb66(0x1d5)](_0x59fb66(0x1cc)))throw new Error(_0x59fb66(0x1d2));if(_0x59fb66(0x1d6)in _0x2bf8db)throw new Error(_0x59fb66(0x1d7));a66_0x19840c['writeFileSync'](_0x431229,JSON[_0x59fb66(0x1da)](_0x2bf8db,null,0x2));}export function hasProjectConfig(_0x27079e){return findProjectConfigPath(_0x27079e)!==null;}export function getProjectRoot(_0x1356fb){const _0x3fb1e3=findProjectConfigPath(_0x1356fb);return _0x3fb1e3?a66_0x5232a2['dirname'](_0x3fb1e3):null;}
1
+ const a67_0x157aa8=a67_0x2ed0;(function(_0x3c803e,_0x2e8105){const _0x1f29b0=a67_0x2ed0,_0x10480a=_0x3c803e();while(!![]){try{const _0x10b976=parseInt(_0x1f29b0(0xc6))/0x1+parseInt(_0x1f29b0(0xc8))/0x2*(parseInt(_0x1f29b0(0xb3))/0x3)+parseInt(_0x1f29b0(0xc2))/0x4*(-parseInt(_0x1f29b0(0xba))/0x5)+parseInt(_0x1f29b0(0xbe))/0x6+parseInt(_0x1f29b0(0xb9))/0x7+parseInt(_0x1f29b0(0xc9))/0x8*(parseInt(_0x1f29b0(0xcb))/0x9)+-parseInt(_0x1f29b0(0xbd))/0xa;if(_0x10b976===_0x2e8105)break;else _0x10480a['push'](_0x10480a['shift']());}catch(_0x144323){_0x10480a['push'](_0x10480a['shift']());}}}(a67_0x309b,0x7e017));import*as a67_0x339756 from'node:fs';import*as a67_0x428e31 from'node:path';const PROJECT_CONFIG_FILENAME=a67_0x157aa8(0xb6);export function findProjectConfigPath(_0x7dca5a){const _0x2f54f9=a67_0x157aa8;let _0x38da75=_0x7dca5a||process['cwd']();while(!![]){const _0x5e0710=a67_0x428e31[_0x2f54f9(0xc5)](_0x38da75,PROJECT_CONFIG_FILENAME);if(a67_0x339756[_0x2f54f9(0xc1)](_0x5e0710))return _0x5e0710;const _0x1a1ede=a67_0x428e31[_0x2f54f9(0xb8)](_0x38da75);if(_0x1a1ede===_0x38da75)return null;_0x38da75=_0x1a1ede;}}function a67_0x2ed0(_0x45cc5c,_0x4e5260){_0x45cc5c=_0x45cc5c-0xb1;const _0x309bc1=a67_0x309b();let _0x2ed095=_0x309bc1[_0x45cc5c];return _0x2ed095;}function a67_0x309b(){const _0x559b68=['TD_API_KEY','stringify','code','Warning:\x20\x27profile\x27\x20field\x20in\x20','1995393riQRBK','\x27profile\x27\x20should\x20not\x20be\x20set\x20in\x20project\x20config.\x20Use\x20\x27tdx\x20profile\x20use\x27\x20instead.','Failed\x20to\x20load\x20project\x20config\x20from\x20','tdx.json','Use\x20~/.config/tdx/.env\x20or\x20profile\x20.env\x20files\x20instead.','dirname','1386553qJXCAM','362140SxWiXm','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20configuration.\x20Use\x20.env\x20files\x20instead.','parse','17281180EpwLqv','3941856JlBlgF','ENOENT','Active\x20profile\x20is\x20set\x20in\x20~/.config/tdx/tdx.json','existsSync','16HoPfyD','includes','warn','join','473369FkgtSJ','utf-8','2GaGCZo','2161576kwfswp','\x20is\x20ignored.\x20','18CAwpUW','cwd','api_key','readFileSync'];a67_0x309b=function(){return _0x559b68;};return a67_0x309b();}export function loadProjectConfig(_0x32b936){const _0x57940b=a67_0x157aa8,_0x758c17=findProjectConfigPath(_0x32b936);if(!_0x758c17)return null;try{const _0x45b03d=a67_0x339756[_0x57940b(0xce)](_0x758c17,_0x57940b(0xc7)),_0x3eb156=JSON[_0x57940b(0xbc)](_0x45b03d),_0x222a21=JSON[_0x57940b(0xd0)](_0x3eb156);if(_0x222a21[_0x57940b(0xc3)](_0x57940b(0xcf))||_0x222a21[_0x57940b(0xc3)]('apiKey')||_0x222a21['includes'](_0x57940b(0xcd)))throw new Error('Security\x20error:\x20API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20project\x20config\x20('+_0x758c17+').\x20'+_0x57940b(0xb7));const {metadata:_0x28a8f9,profile:_0x11412b,..._0x580a8d}=_0x3eb156;return _0x11412b&&console[_0x57940b(0xc4)](_0x57940b(0xb2)+_0x758c17+_0x57940b(0xca)+_0x57940b(0xc0)),_0x580a8d;}catch(_0x3d8799){if(_0x3d8799 instanceof Error&&_0x57940b(0xb1)in _0x3d8799&&_0x3d8799[_0x57940b(0xb1)]===_0x57940b(0xbf))return null;throw new Error(_0x57940b(0xb5)+_0x758c17+':\x20'+_0x3d8799);}}export function saveProjectConfig(_0xe6cb00,_0x5681b8){const _0x3b4a67=a67_0x157aa8,_0x44c1bc=_0x5681b8||process[_0x3b4a67(0xcc)](),_0x46d7fb=a67_0x428e31[_0x3b4a67(0xc5)](_0x44c1bc,PROJECT_CONFIG_FILENAME),_0x1b73c6=JSON[_0x3b4a67(0xd0)](_0xe6cb00);if(_0x1b73c6[_0x3b4a67(0xc3)](_0x3b4a67(0xcf))||_0x1b73c6['includes']('apiKey')||_0x1b73c6[_0x3b4a67(0xc3)]('api_key'))throw new Error(_0x3b4a67(0xbb));if('profile'in _0xe6cb00)throw new Error(_0x3b4a67(0xb4));a67_0x339756['writeFileSync'](_0x46d7fb,JSON['stringify'](_0xe6cb00,null,0x2));}export function hasProjectConfig(_0x26beb9){return findProjectConfigPath(_0x26beb9)!==null;}export function getProjectRoot(_0x1307d9){const _0x21971a=findProjectConfigPath(_0x1307d9);return _0x21971a?a67_0x428e31['dirname'](_0x21971a):null;}
@@ -1 +1 @@
1
- (function(_0x375c49,_0x7cff2b){const _0x2bb532=a67_0x5e50,_0x190ef5=_0x375c49();while(!![]){try{const _0xeb19ef=parseInt(_0x2bb532(0x188))/0x1+parseInt(_0x2bb532(0x194))/0x2*(-parseInt(_0x2bb532(0x177))/0x3)+-parseInt(_0x2bb532(0x18e))/0x4*(parseInt(_0x2bb532(0x193))/0x5)+parseInt(_0x2bb532(0x184))/0x6+-parseInt(_0x2bb532(0x180))/0x7*(parseInt(_0x2bb532(0x18a))/0x8)+parseInt(_0x2bb532(0x17f))/0x9+parseInt(_0x2bb532(0x18b))/0xa;if(_0xeb19ef===_0x7cff2b)break;else _0x190ef5['push'](_0x190ef5['shift']());}catch(_0x2dcb57){_0x190ef5['push'](_0x190ef5['shift']());}}}(a67_0x5f38,0x9958a));import*as a67_0x4f81ef from'node:fs';import*as a67_0x1e39f7 from'node:path';import*as a67_0x30767e 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 _0x472f2a=a67_0x5e50,_0x34128a=process.env.TDX_CONFIG_DIR||a67_0x1e39f7[_0x472f2a(0x183)](a67_0x30767e[_0x472f2a(0x199)](),_0x472f2a(0x197),_0x472f2a(0x190));return a67_0x1e39f7[_0x472f2a(0x183)](_0x34128a,_0x472f2a(0x175));}function getSessionPath(_0xc35908){const _0x415f5d=a67_0x5e50;return a67_0x1e39f7['join'](getSessionsDir(),_0xc35908+_0x415f5d(0x187));}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x1173a8){const _0x33eee7=a67_0x5e50;if(_0x1173a8)return _0x1173a8;if(process.env.TDX_SESSION)return process.env.TDX_SESSION;return getCurrentSessionPID()[_0x33eee7(0x17c)]();}function a67_0x5f38(){const _0x31257e=['existsSync','parse','join','4210482VFiTNU','API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.','now','.json','221169UtUpdI','api_key','40yvbEdH','3840520moufFr','getTime','replace','44wKliIz','apiKey','tdx','writeFileSync','utf-8','358885JFrLok','756706FqXOle','readdirSync','toISOString','.config','stringify','homedir','test','warn','unlinkSync','sessions','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','3sizHRD','createdAt','.\x20This\x20is\x20insecure.\x20Removing\x20session.','includes','sort','toString','readFileSync','endsWith','9666837LNTJTp','819077rGIMwo'];a67_0x5f38=function(){return _0x31257e;};return a67_0x5f38();}export function loadSessionContext(_0x12f2ff){const _0x34636f=a67_0x5e50,_0x2a4941=getSessionID(_0x12f2ff),_0x3dc6fa=/^\d+$/[_0x34636f(0x19a)](_0x2a4941)?parseInt(_0x2a4941,0xa):null;return _0x3dc6fa!==null?loadSessionContextByPID(_0x3dc6fa):loadSessionContextByString(_0x2a4941);}export function loadSessionContextByPID(_0x38d6d7){const _0x2ebdc5=a67_0x5e50,_0x497508=getSessionPath(_0x38d6d7);if(!a67_0x4f81ef[_0x2ebdc5(0x181)](_0x497508))return null;try{const _0x40fdae=a67_0x4f81ef[_0x2ebdc5(0x17d)](_0x497508,_0x2ebdc5(0x192)),_0x12ae17=JSON[_0x2ebdc5(0x182)](_0x40fdae),_0x59cd79=new Date(_0x12ae17['createdAt'])[_0x2ebdc5(0x18c)](),_0x7f2415=Date[_0x2ebdc5(0x186)]();if(_0x7f2415-_0x59cd79>SESSION_EXPIRATION_MS)return a67_0x4f81ef['unlinkSync'](_0x497508),null;const _0x396458=JSON[_0x2ebdc5(0x198)](_0x12ae17);if(_0x396458[_0x2ebdc5(0x17a)]('TD_API_KEY')||_0x396458[_0x2ebdc5(0x17a)](_0x2ebdc5(0x18f))||_0x396458[_0x2ebdc5(0x17a)](_0x2ebdc5(0x189)))return console[_0x2ebdc5(0x19b)](_0x2ebdc5(0x176)+_0x497508+_0x2ebdc5(0x179)),a67_0x4f81ef[_0x2ebdc5(0x174)](_0x497508),null;return _0x12ae17;}catch{try{a67_0x4f81ef[_0x2ebdc5(0x174)](_0x497508);}catch{}return null;}}function loadSessionContextByString(_0x20d5af){const _0x1375f5=a67_0x5e50,_0x336e35=a67_0x1e39f7['join'](getSessionsDir(),_0x20d5af+_0x1375f5(0x187));if(!a67_0x4f81ef['existsSync'](_0x336e35))return null;try{const _0x401281=a67_0x4f81ef[_0x1375f5(0x17d)](_0x336e35,_0x1375f5(0x192)),_0x1023e3=JSON[_0x1375f5(0x182)](_0x401281),_0x118b33=new Date(_0x1023e3[_0x1375f5(0x178)])[_0x1375f5(0x18c)](),_0x38b1cb=Date[_0x1375f5(0x186)]();if(_0x38b1cb-_0x118b33>SESSION_EXPIRATION_MS)return a67_0x4f81ef[_0x1375f5(0x174)](_0x336e35),null;const _0x1733f4=JSON[_0x1375f5(0x198)](_0x1023e3);if(_0x1733f4[_0x1375f5(0x17a)]('TD_API_KEY')||_0x1733f4[_0x1375f5(0x17a)]('apiKey')||_0x1733f4[_0x1375f5(0x17a)]('api_key'))return console[_0x1375f5(0x19b)]('Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20'+_0x336e35+_0x1375f5(0x179)),a67_0x4f81ef[_0x1375f5(0x174)](_0x336e35),null;return _0x1023e3;}catch{try{a67_0x4f81ef[_0x1375f5(0x174)](_0x336e35);}catch{}return null;}}export function saveSessionContext(_0x2e48ed,_0x10ac8f){const _0x298f4d=a67_0x5e50,_0x2b40a9=getSessionID(_0x10ac8f),_0x1e3194=/^\d+$/['test'](_0x2b40a9)?parseInt(_0x2b40a9,0xa):getCurrentSessionPID(),_0x4b090e=a67_0x1e39f7[_0x298f4d(0x183)](getSessionsDir(),_0x2b40a9+_0x298f4d(0x187)),_0x2bab7b=getSessionsDir();createSecureDirectory(_0x2bab7b);const _0x2f23f1=JSON[_0x298f4d(0x198)](_0x2e48ed);if(_0x2f23f1['includes']('TD_API_KEY')||_0x2f23f1[_0x298f4d(0x17a)](_0x298f4d(0x18f))||_0x2f23f1[_0x298f4d(0x17a)](_0x298f4d(0x189)))throw new Error(_0x298f4d(0x185));let _0x3f208f;const _0x47c15c=/^\d+$/['test'](_0x2b40a9)?loadSessionContextByPID(parseInt(_0x2b40a9,0xa)):loadSessionContextByString(_0x2b40a9);_0x47c15c?_0x3f208f={..._0x47c15c,..._0x2e48ed,'pid':_0x1e3194,'sessionId':_0x2b40a9!==_0x1e3194[_0x298f4d(0x17c)]()?_0x2b40a9:undefined,'updatedAt':new Date()[_0x298f4d(0x196)]()}:_0x3f208f={'pid':_0x1e3194,'sessionId':_0x2b40a9!==_0x1e3194[_0x298f4d(0x17c)]()?_0x2b40a9:undefined,..._0x2e48ed,'createdAt':new Date()['toISOString'](),'updatedAt':new Date()[_0x298f4d(0x196)]()},a67_0x4f81ef[_0x298f4d(0x191)](_0x4b090e,JSON[_0x298f4d(0x198)](_0x3f208f,null,0x2));}function a67_0x5e50(_0xb1b29c,_0x15e09a){_0xb1b29c=_0xb1b29c-0x174;const _0x5f380d=a67_0x5f38();let _0x5e5056=_0x5f380d[_0xb1b29c];return _0x5e5056;}export function clearSessionContext(_0x64cc27){const _0x3742fb=a67_0x5e50,_0x3c0094=getSessionID(_0x64cc27),_0x58f7b6=a67_0x1e39f7[_0x3742fb(0x183)](getSessionsDir(),_0x3c0094+_0x3742fb(0x187));a67_0x4f81ef['existsSync'](_0x58f7b6)&&a67_0x4f81ef[_0x3742fb(0x174)](_0x58f7b6);}export function clearSessionContextField(_0x4cc416,_0x4741d5){const _0x54927e=a67_0x5e50,_0x4521de=getSessionID(_0x4741d5),_0x22f117=a67_0x1e39f7[_0x54927e(0x183)](getSessionsDir(),_0x4521de+_0x54927e(0x187));if(!a67_0x4f81ef[_0x54927e(0x181)](_0x22f117))return;try{const _0x27b1cd=a67_0x4f81ef[_0x54927e(0x17d)](_0x22f117,'utf-8'),_0x4bfd9a=JSON[_0x54927e(0x182)](_0x27b1cd);delete _0x4bfd9a[_0x4cc416],a67_0x4f81ef[_0x54927e(0x191)](_0x22f117,JSON[_0x54927e(0x198)](_0x4bfd9a,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x5b09b5=a67_0x5e50,_0x746bc5=getSessionsDir();if(!a67_0x4f81ef[_0x5b09b5(0x181)](_0x746bc5))return 0x0;let _0x433ad5=0x0;const _0x14f238=Date['now']();try{const _0x22919c=a67_0x4f81ef[_0x5b09b5(0x195)](_0x746bc5);for(const _0x31254e of _0x22919c){if(!_0x31254e[_0x5b09b5(0x17e)](_0x5b09b5(0x187)))continue;const _0x7e1ac9=a67_0x1e39f7['join'](_0x746bc5,_0x31254e),_0x1af52b=_0x31254e[_0x5b09b5(0x18d)](_0x5b09b5(0x187),''),_0x28aef5=parseInt(_0x1af52b,0xa),_0x3c96b2=!isNaN(_0x28aef5);if(_0x3c96b2){if(!isProcessRunning(_0x28aef5)){a67_0x4f81ef[_0x5b09b5(0x174)](_0x7e1ac9),_0x433ad5++;continue;}}try{const _0x5aa757=a67_0x4f81ef['readFileSync'](_0x7e1ac9,'utf-8'),_0x54fb80=JSON[_0x5b09b5(0x182)](_0x5aa757),_0x4d125e=new Date(_0x54fb80[_0x5b09b5(0x178)])[_0x5b09b5(0x18c)]();_0x14f238-_0x4d125e>SESSION_EXPIRATION_MS&&(a67_0x4f81ef[_0x5b09b5(0x174)](_0x7e1ac9),_0x433ad5++);}catch{a67_0x4f81ef[_0x5b09b5(0x174)](_0x7e1ac9),_0x433ad5++;}}}catch{}return _0x433ad5;}export function listActiveSessions(){const _0x3893e7=a67_0x5e50,_0x59f44e=getSessionsDir();if(!a67_0x4f81ef[_0x3893e7(0x181)](_0x59f44e))return[];try{const _0x2b63a1=a67_0x4f81ef[_0x3893e7(0x195)](_0x59f44e),_0x9ce52b=[];for(const _0xc77209 of _0x2b63a1){if(!_0xc77209[_0x3893e7(0x17e)](_0x3893e7(0x187)))continue;const _0x29e9c4=_0xc77209[_0x3893e7(0x18d)]('.json',''),_0x4615d5=parseInt(_0x29e9c4,0xa);!isNaN(_0x4615d5)&&isProcessRunning(_0x4615d5)&&_0x9ce52b['push'](_0x4615d5);}return _0x9ce52b[_0x3893e7(0x17b)]((_0x35a1a5,_0x55f409)=>_0x35a1a5-_0x55f409);}catch{return[];}}
1
+ (function(_0x17a34d,_0x4b3523){const _0x316545=a68_0x439a,_0x4a3e72=_0x17a34d();while(!![]){try{const _0x283f27=-parseInt(_0x316545(0x152))/0x1+parseInt(_0x316545(0x160))/0x2*(-parseInt(_0x316545(0x167))/0x3)+parseInt(_0x316545(0x163))/0x4*(-parseInt(_0x316545(0x164))/0x5)+parseInt(_0x316545(0x170))/0x6+parseInt(_0x316545(0x174))/0x7+parseInt(_0x316545(0x15a))/0x8*(-parseInt(_0x316545(0x173))/0x9)+parseInt(_0x316545(0x150))/0xa;if(_0x283f27===_0x4b3523)break;else _0x4a3e72['push'](_0x4a3e72['shift']());}catch(_0x25137e){_0x4a3e72['push'](_0x4a3e72['shift']());}}}(a68_0x4a71,0x39b79));import*as a68_0x3de14f from'node:fs';import*as a68_0x3bf2aa from'node:path';import*as a68_0x2c1221 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 _0x6d86e6=a68_0x439a,_0x2efcb5=process.env.TDX_CONFIG_DIR||a68_0x3bf2aa[_0x6d86e6(0x159)](a68_0x2c1221[_0x6d86e6(0x15f)](),_0x6d86e6(0x162),_0x6d86e6(0x16a));return a68_0x3bf2aa['join'](_0x2efcb5,_0x6d86e6(0x166));}function a68_0x439a(_0x127034,_0x315fef){_0x127034=_0x127034-0x14d;const _0x4a718e=a68_0x4a71();let _0x439a1e=_0x4a718e[_0x127034];return _0x439a1e;}function getSessionPath(_0x40b0ef){const _0xf1f0e8=a68_0x439a;return a68_0x3bf2aa[_0xf1f0e8(0x159)](getSessionsDir(),_0x40b0ef+'.json');}export function getCurrentSessionPID(){return getPPID();}export function getSessionID(_0x512593){const _0x2b722b=a68_0x439a;if(_0x512593)return _0x512593;if(process.env.TDX_SESSION)return process.env.TDX_SESSION;return getCurrentSessionPID()[_0x2b722b(0x16b)]();}export function loadSessionContext(_0x3142e6){const _0x3dbadb=a68_0x439a,_0x1cb87d=getSessionID(_0x3142e6),_0x5ccb63=/^\d+$/[_0x3dbadb(0x169)](_0x1cb87d)?parseInt(_0x1cb87d,0xa):null;return _0x5ccb63!==null?loadSessionContextByPID(_0x5ccb63):loadSessionContextByString(_0x1cb87d);}function a68_0x4a71(){const _0x308dfd=['tdx','toString','push','readdirSync','endsWith','warn','808242DXbGcH','.\x20This\x20is\x20insecure.\x20Removing\x20session.','sort','652338wuXkKB','1918672JiAtrT','utf-8','readFileSync','parse','getTime','5271220ojKBmp','TD_API_KEY','121985ovwprJ','toISOString','writeFileSync','includes','unlinkSync','createdAt','replace','join','48Dlsqtr','existsSync','now','Warning:\x20API\x20keys\x20found\x20in\x20session\x20file\x20','apiKey','homedir','3118EQNHcK','api_key','.config','12cRCQlq','170175ZhdRiu','stringify','sessions','78iBDijP','.json','test'];a68_0x4a71=function(){return _0x308dfd;};return a68_0x4a71();}export function loadSessionContextByPID(_0x56be9f){const _0x5b30e9=a68_0x439a,_0x1193ca=getSessionPath(_0x56be9f);if(!a68_0x3de14f[_0x5b30e9(0x15b)](_0x1193ca))return null;try{const _0x38fb06=a68_0x3de14f[_0x5b30e9(0x14d)](_0x1193ca,_0x5b30e9(0x175)),_0x18e48d=JSON[_0x5b30e9(0x14e)](_0x38fb06),_0x381a96=new Date(_0x18e48d[_0x5b30e9(0x157)])[_0x5b30e9(0x14f)](),_0x26531d=Date[_0x5b30e9(0x15c)]();if(_0x26531d-_0x381a96>SESSION_EXPIRATION_MS)return a68_0x3de14f['unlinkSync'](_0x1193ca),null;const _0x53ce3a=JSON[_0x5b30e9(0x165)](_0x18e48d);if(_0x53ce3a['includes'](_0x5b30e9(0x151))||_0x53ce3a[_0x5b30e9(0x155)](_0x5b30e9(0x15e))||_0x53ce3a[_0x5b30e9(0x155)](_0x5b30e9(0x161)))return console[_0x5b30e9(0x16f)](_0x5b30e9(0x15d)+_0x1193ca+_0x5b30e9(0x171)),a68_0x3de14f[_0x5b30e9(0x156)](_0x1193ca),null;return _0x18e48d;}catch{try{a68_0x3de14f[_0x5b30e9(0x156)](_0x1193ca);}catch{}return null;}}function loadSessionContextByString(_0x2d8ada){const _0x453499=a68_0x439a,_0x271592=a68_0x3bf2aa[_0x453499(0x159)](getSessionsDir(),_0x2d8ada+'.json');if(!a68_0x3de14f['existsSync'](_0x271592))return null;try{const _0x5ddf6d=a68_0x3de14f[_0x453499(0x14d)](_0x271592,'utf-8'),_0x26ab2d=JSON[_0x453499(0x14e)](_0x5ddf6d),_0x1d46b2=new Date(_0x26ab2d[_0x453499(0x157)])['getTime'](),_0xf3e001=Date['now']();if(_0xf3e001-_0x1d46b2>SESSION_EXPIRATION_MS)return a68_0x3de14f[_0x453499(0x156)](_0x271592),null;const _0x3c90d6=JSON['stringify'](_0x26ab2d);if(_0x3c90d6[_0x453499(0x155)](_0x453499(0x151))||_0x3c90d6[_0x453499(0x155)](_0x453499(0x15e))||_0x3c90d6['includes'](_0x453499(0x161)))return console['warn'](_0x453499(0x15d)+_0x271592+_0x453499(0x171)),a68_0x3de14f['unlinkSync'](_0x271592),null;return _0x26ab2d;}catch{try{a68_0x3de14f[_0x453499(0x156)](_0x271592);}catch{}return null;}}export function saveSessionContext(_0x424d39,_0x225eb6){const _0x477959=a68_0x439a,_0x1a989b=getSessionID(_0x225eb6),_0x1f0e7d=/^\d+$/[_0x477959(0x169)](_0x1a989b)?parseInt(_0x1a989b,0xa):getCurrentSessionPID(),_0x4ca2d5=a68_0x3bf2aa[_0x477959(0x159)](getSessionsDir(),_0x1a989b+'.json'),_0x454356=getSessionsDir();createSecureDirectory(_0x454356);const _0xd11a9b=JSON[_0x477959(0x165)](_0x424d39);if(_0xd11a9b[_0x477959(0x155)](_0x477959(0x151))||_0xd11a9b[_0x477959(0x155)](_0x477959(0x15e))||_0xd11a9b[_0x477959(0x155)](_0x477959(0x161)))throw new Error('API\x20keys\x20must\x20not\x20be\x20stored\x20in\x20session\x20context.\x20Use\x20.env\x20files\x20instead.');let _0x979486;const _0x2d35dc=/^\d+$/[_0x477959(0x169)](_0x1a989b)?loadSessionContextByPID(parseInt(_0x1a989b,0xa)):loadSessionContextByString(_0x1a989b);_0x2d35dc?_0x979486={..._0x2d35dc,..._0x424d39,'pid':_0x1f0e7d,'sessionId':_0x1a989b!==_0x1f0e7d[_0x477959(0x16b)]()?_0x1a989b:undefined,'updatedAt':new Date()[_0x477959(0x153)]()}:_0x979486={'pid':_0x1f0e7d,'sessionId':_0x1a989b!==_0x1f0e7d[_0x477959(0x16b)]()?_0x1a989b:undefined,..._0x424d39,'createdAt':new Date()[_0x477959(0x153)](),'updatedAt':new Date()['toISOString']()},a68_0x3de14f['writeFileSync'](_0x4ca2d5,JSON[_0x477959(0x165)](_0x979486,null,0x2));}export function clearSessionContext(_0x4674b4){const _0x2269cf=a68_0x439a,_0xbd0e11=getSessionID(_0x4674b4),_0x74c6e1=a68_0x3bf2aa['join'](getSessionsDir(),_0xbd0e11+_0x2269cf(0x168));a68_0x3de14f[_0x2269cf(0x15b)](_0x74c6e1)&&a68_0x3de14f['unlinkSync'](_0x74c6e1);}export function clearSessionContextField(_0x1e0cf3,_0x59411e){const _0x17c298=a68_0x439a,_0x13efbf=getSessionID(_0x59411e),_0x2fb8e1=a68_0x3bf2aa[_0x17c298(0x159)](getSessionsDir(),_0x13efbf+_0x17c298(0x168));if(!a68_0x3de14f[_0x17c298(0x15b)](_0x2fb8e1))return;try{const _0x2e00f7=a68_0x3de14f['readFileSync'](_0x2fb8e1,_0x17c298(0x175)),_0x59e0c7=JSON[_0x17c298(0x14e)](_0x2e00f7);delete _0x59e0c7[_0x1e0cf3],a68_0x3de14f[_0x17c298(0x154)](_0x2fb8e1,JSON['stringify'](_0x59e0c7,null,0x2));}catch{}}export function cleanExpiredSessions(){const _0x10cebd=a68_0x439a,_0x393fd7=getSessionsDir();if(!a68_0x3de14f[_0x10cebd(0x15b)](_0x393fd7))return 0x0;let _0x331b19=0x0;const _0x56f6f9=Date[_0x10cebd(0x15c)]();try{const _0x4d52af=a68_0x3de14f[_0x10cebd(0x16d)](_0x393fd7);for(const _0x5c9629 of _0x4d52af){if(!_0x5c9629[_0x10cebd(0x16e)](_0x10cebd(0x168)))continue;const _0x42d478=a68_0x3bf2aa[_0x10cebd(0x159)](_0x393fd7,_0x5c9629),_0x352b3d=_0x5c9629['replace'](_0x10cebd(0x168),''),_0x1b23ac=parseInt(_0x352b3d,0xa),_0x139beb=!isNaN(_0x1b23ac);if(_0x139beb){if(!isProcessRunning(_0x1b23ac)){a68_0x3de14f[_0x10cebd(0x156)](_0x42d478),_0x331b19++;continue;}}try{const _0x3ef3e2=a68_0x3de14f[_0x10cebd(0x14d)](_0x42d478,_0x10cebd(0x175)),_0x216f85=JSON[_0x10cebd(0x14e)](_0x3ef3e2),_0x26264c=new Date(_0x216f85[_0x10cebd(0x157)])[_0x10cebd(0x14f)]();_0x56f6f9-_0x26264c>SESSION_EXPIRATION_MS&&(a68_0x3de14f['unlinkSync'](_0x42d478),_0x331b19++);}catch{a68_0x3de14f[_0x10cebd(0x156)](_0x42d478),_0x331b19++;}}}catch{}return _0x331b19;}export function listActiveSessions(){const _0xb14832=a68_0x439a,_0x5a91a1=getSessionsDir();if(!a68_0x3de14f[_0xb14832(0x15b)](_0x5a91a1))return[];try{const _0x17af40=a68_0x3de14f['readdirSync'](_0x5a91a1),_0x177c88=[];for(const _0x318dd8 of _0x17af40){if(!_0x318dd8[_0xb14832(0x16e)](_0xb14832(0x168)))continue;const _0x40c590=_0x318dd8[_0xb14832(0x158)](_0xb14832(0x168),''),_0x4c2def=parseInt(_0x40c590,0xa);!isNaN(_0x4c2def)&&isProcessRunning(_0x4c2def)&&_0x177c88[_0xb14832(0x16c)](_0x4c2def);}return _0x177c88[_0xb14832(0x172)]((_0x1045d0,_0xb33622)=>_0x1045d0-_0xb33622);}catch{return[];}}
@@ -1 +1 @@
1
- const a68_0x3d032c=a68_0x5886;function a68_0x3087(){const _0x2e6d39=['4173420rNplXE','36iEtnmd','9vlvzsp','178598HFjQPX','312594HhXVhy','145404QCwyNc','write','users','2129696pUHaCZ','core/user-cache','now','read','1196FTNgCq','4371DqjfXy','2129895lQoBOf'];a68_0x3087=function(){return _0x2e6d39;};return a68_0x3087();}function a68_0x5886(_0x321982,_0x11a664){_0x321982=_0x321982-0x16b;const _0x308781=a68_0x3087();let _0x588686=_0x308781[_0x321982];return _0x588686;}(function(_0xff374a,_0x1982c3){const _0x40b366=a68_0x5886,_0x343d5c=_0xff374a();while(!![]){try{const _0x58f46a=parseInt(_0x40b366(0x175))/0x1+-parseInt(_0x40b366(0x176))/0x2+parseInt(_0x40b366(0x16f))/0x3*(parseInt(_0x40b366(0x16e))/0x4)+-parseInt(_0x40b366(0x170))/0x5+parseInt(_0x40b366(0x172))/0x6*(parseInt(_0x40b366(0x174))/0x7)+-parseInt(_0x40b366(0x179))/0x8*(-parseInt(_0x40b366(0x173))/0x9)+-parseInt(_0x40b366(0x171))/0xa;if(_0x58f46a===_0x1982c3)break;else _0x343d5c['push'](_0x343d5c['shift']());}catch(_0x56d26c){_0x343d5c['push'](_0x343d5c['shift']());}}}(a68_0x3087,0x3d676));import{createProfileCache}from'../utils/global-cache.js';const userCache=createProfileCache('users-{profile}.json',a68_0x3d032c(0x16b));export function loadCachedUsers(_0x370171){const _0x593290=a68_0x3d032c,_0x2fc486=userCache[_0x593290(0x16d)](_0x370171);return _0x2fc486?.[_0x593290(0x178)]??null;}export function saveCachedUsers(_0x54819d,_0x267ff6){const _0x4dd3b3=a68_0x3d032c;userCache[_0x4dd3b3(0x177)](_0x54819d,{'users':_0x267ff6,'cachedAt':Date[_0x4dd3b3(0x16c)]()});}export function clearUserCache(_0x1dd0d5){userCache['clear'](_0x1dd0d5);}
1
+ function a69_0x1a12(){const _0x217ddc=['clear','core/user-cache','15044940SdQNCa','54dbnXWV','16158dmcFPz','read','write','49866IxsclI','users-{profile}.json','6645880GGcRfV','3593292dxsQNP','171865gCHiRm','1113VlRnyg','9avIugU','4808300CRwZci','now'];a69_0x1a12=function(){return _0x217ddc;};return a69_0x1a12();}const a69_0x74cecb=a69_0x4c82;(function(_0x529f8d,_0x8f1174){const _0x36dc7f=a69_0x4c82,_0xd6d6ee=_0x529f8d();while(!![]){try{const _0x38735d=-parseInt(_0x36dc7f(0xfa))/0x1+parseInt(_0x36dc7f(0xf2))/0x2*(-parseInt(_0x36dc7f(0xf6))/0x3)+-parseInt(_0x36dc7f(0xf9))/0x4+parseInt(_0x36dc7f(0xed))/0x5+parseInt(_0x36dc7f(0xf3))/0x6*(parseInt(_0x36dc7f(0xeb))/0x7)+-parseInt(_0x36dc7f(0xf8))/0x8+-parseInt(_0x36dc7f(0xec))/0x9*(-parseInt(_0x36dc7f(0xf1))/0xa);if(_0x38735d===_0x8f1174)break;else _0xd6d6ee['push'](_0xd6d6ee['shift']());}catch(_0x3debf6){_0xd6d6ee['push'](_0xd6d6ee['shift']());}}}(a69_0x1a12,0x84f70));import{createProfileCache}from'../utils/global-cache.js';function a69_0x4c82(_0x3c471f,_0x384d09){_0x3c471f=_0x3c471f-0xeb;const _0x1a1205=a69_0x1a12();let _0x4c82bf=_0x1a1205[_0x3c471f];return _0x4c82bf;}const userCache=createProfileCache(a69_0x74cecb(0xf7),a69_0x74cecb(0xf0));export function loadCachedUsers(_0x3e9bfe){const _0x3442e5=a69_0x74cecb,_0x48b302=userCache[_0x3442e5(0xf4)](_0x3e9bfe);return _0x48b302?.['users']??null;}export function saveCachedUsers(_0xf108a1,_0x3bd5e0){const _0x4a8310=a69_0x74cecb;userCache[_0x4a8310(0xf5)](_0xf108a1,{'users':_0x3bd5e0,'cachedAt':Date[_0x4a8310(0xee)]()});}export function clearUserCache(_0x2d921f){const _0x231591=a69_0x74cecb;userCache[_0x231591(0xef)](_0x2d921f);}
@@ -1 +1 @@
1
- (function(_0x4bb042,_0x18d261){const _0xce0e14=a69_0x1957,_0x6126bc=_0x4bb042();while(!![]){try{const _0x507de6=parseInt(_0xce0e14(0x83))/0x1*(parseInt(_0xce0e14(0x8a))/0x2)+-parseInt(_0xce0e14(0x82))/0x3*(-parseInt(_0xce0e14(0x7f))/0x4)+-parseInt(_0xce0e14(0x7e))/0x5+-parseInt(_0xce0e14(0x7d))/0x6*(-parseInt(_0xce0e14(0x89))/0x7)+parseInt(_0xce0e14(0x7c))/0x8*(parseInt(_0xce0e14(0x87))/0x9)+-parseInt(_0xce0e14(0x88))/0xa+-parseInt(_0xce0e14(0x84))/0xb;if(_0x507de6===_0x18d261)break;else _0x6126bc['push'](_0x6126bc['shift']());}catch(_0x29a124){_0x6126bc['push'](_0x6126bc['shift']());}}}(a69_0x30f1,0x1d445));function a69_0x1957(_0x37c856,_0x5e5d8e){_0x37c856=_0x37c856-0x79;const _0x30f184=a69_0x30f1();let _0x19571d=_0x30f184[_0x37c856];return _0x19571d;}import{readFileSync}from'fs';import{fileURLToPath}from'url';function a69_0x30f1(){const _0x47537f=['.dev','utf-8','12lmyHOf','120613sJNJHM','4527985toMHWa','includes','version','18bsyKpT','741700EnwNgO','119kjTZnM','2hOcWyN','../../package.json','parse','0.0.0','914864xhMGWm','49578QickiS','306850nABUoF','177252PkiaWi'];a69_0x30f1=function(){return _0x47537f;};return a69_0x30f1();}import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0x38dfd0=a69_0x1957;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x433c3f=fileURLToPath(import.meta.url),_0x332de9=dirname(_0x433c3f);try{const _0x23db4e=join(_0x332de9,'../build-info.json');cachedBuildInfo=JSON[_0x38dfd0(0x7a)](readFileSync(_0x23db4e,_0x38dfd0(0x81)));}catch{cachedBuildInfo={};}return cachedBuildInfo;}export function getVersion(){const _0x49a331=a69_0x1957;if(cachedVersion!==null)return cachedVersion;const _0x473764=fileURLToPath(import.meta.url),_0x2cc564=dirname(_0x473764),_0x48f99a=getBuildInfo();if(_0x48f99a[_0x49a331(0x86)])return cachedVersion=_0x48f99a[_0x49a331(0x86)],cachedVersion;try{const _0x101eb7=join(_0x2cc564,_0x49a331(0x79)),_0x4dd4cf=JSON[_0x49a331(0x7a)](readFileSync(_0x101eb7,'utf-8'));cachedVersion=_0x4dd4cf['version'];}catch{cachedVersion=_0x49a331(0x7b);}return cachedVersion;}export function isDevVersion(){const _0x321f26=a69_0x1957,_0x2679f7=getVersion();return _0x2679f7[_0x321f26(0x85)](_0x321f26(0x80))||_0x2679f7[_0x321f26(0x85)]('-');}
1
+ (function(_0x1f5a03,_0x4983b2){const _0xfc669c=a70_0x168e,_0x4fcef7=_0x1f5a03();while(!![]){try{const _0x4804b8=parseInt(_0xfc669c(0x7a))/0x1*(-parseInt(_0xfc669c(0x78))/0x2)+parseInt(_0xfc669c(0x6e))/0x3+-parseInt(_0xfc669c(0x6d))/0x4+-parseInt(_0xfc669c(0x73))/0x5+parseInt(_0xfc669c(0x74))/0x6+-parseInt(_0xfc669c(0x6f))/0x7+-parseInt(_0xfc669c(0x72))/0x8*(-parseInt(_0xfc669c(0x71))/0x9);if(_0x4804b8===_0x4983b2)break;else _0x4fcef7['push'](_0x4fcef7['shift']());}catch(_0x44c84e){_0x4fcef7['push'](_0x4fcef7['shift']());}}}(a70_0x4811,0x2509f));import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';let cachedBuildInfo=null,cachedVersion=null;export function getBuildInfo(){const _0x1ed56d=a70_0x168e;if(cachedBuildInfo!==null)return cachedBuildInfo;const _0x5b6614=fileURLToPath(import.meta.url),_0x50098f=dirname(_0x5b6614);try{const _0x1f2947=join(_0x50098f,'../build-info.json');cachedBuildInfo=JSON[_0x1ed56d(0x79)](readFileSync(_0x1f2947,_0x1ed56d(0x6c)));}catch{cachedBuildInfo={};}return cachedBuildInfo;}function a70_0x168e(_0x5a2df6,_0x1a9007){_0x5a2df6=_0x5a2df6-0x6b;const _0x481147=a70_0x4811();let _0x168e38=_0x481147[_0x5a2df6];return _0x168e38;}export function getVersion(){const _0x42f160=a70_0x168e;if(cachedVersion!==null)return cachedVersion;const _0x5be699=fileURLToPath(import.meta.url),_0x30457c=dirname(_0x5be699),_0x10e36a=getBuildInfo();if(_0x10e36a['version'])return cachedVersion=_0x10e36a['version'],cachedVersion;try{const _0x174ef8=join(_0x30457c,_0x42f160(0x6b)),_0x4c42bc=JSON['parse'](readFileSync(_0x174ef8,_0x42f160(0x6c)));cachedVersion=_0x4c42bc[_0x42f160(0x76)];}catch{cachedVersion=_0x42f160(0x77);}return cachedVersion;}export function isDevVersion(){const _0x37d34a=a70_0x168e,_0xa24fe6=getVersion();return _0xa24fe6['includes'](_0x37d34a(0x70))||_0xa24fe6[_0x37d34a(0x75)]('-');}function a70_0x4811(){const _0x1407a5=['751002JvOJlk','includes','version','0.0.0','26FAlQBH','parse','13444osUibv','../../package.json','utf-8','212912hPfKUl','212271nEfUpT','747901gXsdFg','.dev','9CxWBzp','3631592TBArXm','816595vHtqOf'];a70_0x4811=function(){return _0x1407a5;};return a70_0x4811();}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * tdx - AI-native CLI for Treasure Data
2
+ * tdx - AI-native CLI for Treasure AI
3
3
  *
4
4
  * Main entry point for programmatic API usage.
5
5
  * For CLI usage, use src/cli.ts
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- (function(_0x544059,_0x4eacb2){var _0x485c8a=a70_0x4d70,_0x58f30b=_0x544059();while(!![]){try{var _0x2a55bf=parseInt(_0x485c8a(0x1e5))/0x1+-parseInt(_0x485c8a(0x1e2))/0x2+parseInt(_0x485c8a(0x1e3))/0x3*(-parseInt(_0x485c8a(0x1e6))/0x4)+parseInt(_0x485c8a(0x1e1))/0x5+parseInt(_0x485c8a(0x1e7))/0x6*(-parseInt(_0x485c8a(0x1e4))/0x7)+-parseInt(_0x485c8a(0x1e8))/0x8+parseInt(_0x485c8a(0x1e9))/0x9;if(_0x2a55bf===_0x4eacb2)break;else _0x58f30b['push'](_0x58f30b['shift']());}catch(_0x3b639e){_0x58f30b['push'](_0x58f30b['shift']());}}}(a70_0x59e5,0x1bf7e));export*from'./sdk/types/index.js';export*from'./core/config.js';function a70_0x4d70(_0x273064,_0x1bb2dd){_0x273064=_0x273064-0x1e1;var _0x59e5ba=a70_0x59e5();var _0x4d70d8=_0x59e5ba[_0x273064];return _0x4d70d8;}export*from'./core/auth.js';export*from'./sdk/client/http-client.js';export*from'./sdk/client/td-api-client.js';export{TrinoApiClient}from'./sdk/client/trino-api-client.js';export*from'./sdk/client/rate-limiter.js';export*from'./sdk/types/trino.js';export*from'./commands/command.js';export*from'./commands/query-command.js';export*from'./commands/databases.js';function a70_0x59e5(){var _0x444b52=['3dyiVjW','280959PatIZg','185945FdVnbm','26780qzSoQD','6alLCtW','1276848GCxrMl','1149867IWfNxb','158975ahbtVQ','49014GGMbFw'];a70_0x59e5=function(){return _0x444b52;};return a70_0x59e5();}export*from'./commands/tables.js';export*from'./commands/segments.js';export*from'./commands/activations.js';export*from'./commands/show.js';export*from'./commands/describe.js';export*from'./sdk/index.js';
1
+ (function(_0x31095c,_0x4c7753){var _0x4b6dea=a71_0x3b13,_0x457180=_0x31095c();while(!![]){try{var _0x526ce4=-parseInt(_0x4b6dea(0x6e))/0x1*(parseInt(_0x4b6dea(0x6d))/0x2)+-parseInt(_0x4b6dea(0x6b))/0x3+-parseInt(_0x4b6dea(0x70))/0x4+-parseInt(_0x4b6dea(0x68))/0x5*(parseInt(_0x4b6dea(0x6a))/0x6)+parseInt(_0x4b6dea(0x6c))/0x7+parseInt(_0x4b6dea(0x6f))/0x8+parseInt(_0x4b6dea(0x69))/0x9;if(_0x526ce4===_0x4c7753)break;else _0x457180['push'](_0x457180['shift']());}catch(_0x44fd56){_0x457180['push'](_0x457180['shift']());}}}(a71_0x379c,0x9f550));function a71_0x3b13(_0x141d94,_0x4a3b6e){_0x141d94=_0x141d94-0x68;var _0x379cb1=a71_0x379c();var _0x3b138b=_0x379cb1[_0x141d94];return _0x3b138b;}export*from'./sdk/types/index.js';export*from'./core/config.js';export*from'./core/auth.js';export*from'./sdk/client/http-client.js';export*from'./sdk/client/td-api-client.js';export{TrinoApiClient}from'./sdk/client/trino-api-client.js';export*from'./sdk/client/rate-limiter.js';export*from'./sdk/types/trino.js';export*from'./commands/command.js';export*from'./commands/query-command.js';export*from'./commands/databases.js';export*from'./commands/tables.js';function a71_0x379c(){var _0x48157e=['8222543PwXrzy','960808ghnhxa','1ucGBmV','3160744qcIaBN','924100HqSvDo','10XXdLsv','12466323haizcL','2778078kEfTOX','1994430onfsBC'];a71_0x379c=function(){return _0x48157e;};return a71_0x379c();}export*from'./commands/segments.js';export*from'./commands/activations.js';export*from'./commands/show.js';export*from'./commands/describe.js';export*from'./sdk/index.js';