@treasuredata/tdx 2026.9.3 → 2026.10.1

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 (351) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.d.ts +1 -1
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli-categories.js.map +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.js +1 -1
  13. package/dist/commands/auth-command.d.ts.map +1 -1
  14. package/dist/commands/auth-command.js +1 -1
  15. package/dist/commands/auth-command.js.map +1 -1
  16. package/dist/commands/cas-command.js +1 -1
  17. package/dist/commands/cas-journey-command.d.ts +34 -0
  18. package/dist/commands/cas-journey-command.d.ts.map +1 -0
  19. package/dist/commands/cas-journey-command.js +1 -0
  20. package/dist/commands/cas-journey-command.js.map +1 -0
  21. package/dist/commands/cas-segment-command.js +1 -1
  22. package/dist/commands/chat-command.js +1 -1
  23. package/dist/commands/claude-command.d.ts.map +1 -1
  24. package/dist/commands/claude-command.js +1 -1
  25. package/dist/commands/claude-command.js.map +1 -1
  26. package/dist/commands/claude-statusline-command.d.ts.map +1 -1
  27. package/dist/commands/claude-statusline-command.js +1 -1
  28. package/dist/commands/claude-statusline-command.js.map +1 -1
  29. package/dist/commands/codex-command.d.ts.map +1 -1
  30. package/dist/commands/codex-command.js +1 -1
  31. package/dist/commands/codex-command.js.map +1 -1
  32. package/dist/commands/command.js +1 -1
  33. package/dist/commands/connection-command.js +1 -1
  34. package/dist/commands/databases.js +1 -1
  35. package/dist/commands/delivery-command.js +1 -1
  36. package/dist/commands/describe.js +1 -1
  37. package/dist/commands/engage-always-on-campaign-pull-command.js +1 -1
  38. package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
  39. package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
  40. package/dist/commands/engage-campaign-pull-command.js +1 -1
  41. package/dist/commands/engage-campaign-push-command.js +1 -1
  42. package/dist/commands/engage-campaign-readiness-command.js +1 -1
  43. package/dist/commands/engage-campaign-validate-command.js +1 -1
  44. package/dist/commands/engage-command.js +1 -1
  45. package/dist/commands/engage-in-browser-message-command.js +1 -1
  46. package/dist/commands/engage-landing-page-command.js +1 -1
  47. package/dist/commands/engage-template-pull-command.js +1 -1
  48. package/dist/commands/engage-template-push-command.js +1 -1
  49. package/dist/commands/engage-template-validate-command.js +1 -1
  50. package/dist/commands/engage-workspace-assignment-command.js +1 -1
  51. package/dist/commands/job-command.js +1 -1
  52. package/dist/commands/journey-command.d.ts +46 -0
  53. package/dist/commands/journey-command.d.ts.map +1 -1
  54. package/dist/commands/journey-command.js +1 -1
  55. package/dist/commands/journey-command.js.map +1 -1
  56. package/dist/commands/journey-validate-command.js +1 -1
  57. package/dist/commands/llm-command.js +1 -1
  58. package/dist/commands/mcp-command.js +1 -1
  59. package/dist/commands/opencode-command.d.ts +33 -1
  60. package/dist/commands/opencode-command.d.ts.map +1 -1
  61. package/dist/commands/opencode-command.js +1 -1
  62. package/dist/commands/opencode-command.js.map +1 -1
  63. package/dist/commands/p13n-command.js +1 -1
  64. package/dist/commands/parent-segment-command.js +1 -1
  65. package/dist/commands/policy-command.js +1 -1
  66. package/dist/commands/profile-command.js +1 -1
  67. package/dist/commands/profiles-command.d.ts.map +1 -1
  68. package/dist/commands/profiles-command.js +1 -1
  69. package/dist/commands/profiles-command.js.map +1 -1
  70. package/dist/commands/query-command.js +1 -1
  71. package/dist/commands/schedule-command.js +1 -1
  72. package/dist/commands/segment-command.js +1 -1
  73. package/dist/commands/segment-create-command.js +1 -1
  74. package/dist/commands/segment-fields-command.js +1 -1
  75. package/dist/commands/segment-move-command.js +1 -1
  76. package/dist/commands/segment-pull-command.js +1 -1
  77. package/dist/commands/segment-push-command.js +1 -1
  78. package/dist/commands/segment-update-command.js +1 -1
  79. package/dist/commands/segment-use-command.js +1 -1
  80. package/dist/commands/segment-validate-command.js +1 -1
  81. package/dist/commands/segments.js +1 -1
  82. package/dist/commands/show.js +1 -1
  83. package/dist/commands/status-command.js +1 -1
  84. package/dist/commands/table-deleted.js +1 -1
  85. package/dist/commands/tables.js +1 -1
  86. package/dist/commands/unset-command.js +1 -1
  87. package/dist/commands/upgrade-command.js +1 -1
  88. package/dist/commands/usage-command.d.ts +10 -0
  89. package/dist/commands/usage-command.d.ts.map +1 -0
  90. package/dist/commands/usage-command.js +1 -0
  91. package/dist/commands/usage-command.js.map +1 -0
  92. package/dist/commands/use-command.js +1 -1
  93. package/dist/commands/user-command.js +1 -1
  94. package/dist/commands/work-command.js +1 -1
  95. package/dist/commands/workflow-command.js +1 -1
  96. package/dist/core/auth.d.ts +10 -1
  97. package/dist/core/auth.d.ts.map +1 -1
  98. package/dist/core/auth.js +1 -1
  99. package/dist/core/auth.js.map +1 -1
  100. package/dist/core/command-output.js +1 -1
  101. package/dist/core/config.d.ts +2 -1
  102. package/dist/core/config.d.ts.map +1 -1
  103. package/dist/core/config.js +1 -1
  104. package/dist/core/config.js.map +1 -1
  105. package/dist/core/connection-cache.js +1 -1
  106. package/dist/core/constants.js +1 -1
  107. package/dist/core/credential-cache.js +1 -1
  108. package/dist/core/global-context.js +1 -1
  109. package/dist/core/keychain.js +1 -1
  110. package/dist/core/oauth-keychain.js +1 -1
  111. package/dist/core/oauth.js +1 -1
  112. package/dist/core/profile.d.ts +1 -0
  113. package/dist/core/profile.d.ts.map +1 -1
  114. package/dist/core/profile.js +1 -1
  115. package/dist/core/profile.js.map +1 -1
  116. package/dist/core/project-config.js +1 -1
  117. package/dist/core/session.js +1 -1
  118. package/dist/core/site-mismatch.js +1 -1
  119. package/dist/core/user-cache.js +1 -1
  120. package/dist/core/version.js +1 -1
  121. package/dist/index.js +1 -1
  122. package/dist/mcp/server.js +1 -1
  123. package/dist/mcp/tools/index.js +1 -1
  124. package/dist/mcp/tools/tdx-run.js +1 -1
  125. package/dist/mcp/tools/tdx-search.js +1 -1
  126. package/dist/mcp/tools/work-create-item.js +1 -1
  127. package/dist/mcp/utils.js +1 -1
  128. package/dist/proxy/claude-usage-tracker.d.ts +5 -4
  129. package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
  130. package/dist/proxy/claude-usage-tracker.js +1 -1
  131. package/dist/proxy/claude-usage-tracker.js.map +1 -1
  132. package/dist/proxy/passthrough-server.d.ts +2 -0
  133. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  134. package/dist/proxy/passthrough-server.js +1 -1
  135. package/dist/proxy/passthrough-server.js.map +1 -1
  136. package/dist/proxy/sse-usage-parser.js +1 -1
  137. package/dist/sdk/agent/agent-config.js +1 -1
  138. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  139. package/dist/sdk/agent/agent-yaml.js +1 -1
  140. package/dist/sdk/agent/test/evaluator.js +1 -1
  141. package/dist/sdk/agent/test/executor.js +1 -1
  142. package/dist/sdk/agent/test/index.js +1 -1
  143. package/dist/sdk/agent/test/output.js +1 -1
  144. package/dist/sdk/agent/test/parser.js +1 -1
  145. package/dist/sdk/agent/tool-target-registry.js +1 -1
  146. package/dist/sdk/api.js +1 -1
  147. package/dist/sdk/auth-token.js +1 -1
  148. package/dist/sdk/cas/audience-context.d.ts +33 -0
  149. package/dist/sdk/cas/audience-context.d.ts.map +1 -0
  150. package/dist/sdk/cas/audience-context.js +1 -0
  151. package/dist/sdk/cas/audience-context.js.map +1 -0
  152. package/dist/sdk/cas/cas-api-client.js +1 -1
  153. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  154. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  155. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  156. package/dist/sdk/cas/cas-segment-schema.js +1 -1
  157. package/dist/sdk/cas/cas-segment-validator.js +1 -1
  158. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  159. package/dist/sdk/cas/index.d.ts +8 -0
  160. package/dist/sdk/cas/index.d.ts.map +1 -1
  161. package/dist/sdk/cas/index.js +1 -1
  162. package/dist/sdk/cas/index.js.map +1 -1
  163. package/dist/sdk/cas/pull-workflow.js +1 -1
  164. package/dist/sdk/cas/push-workflow.js +1 -1
  165. package/dist/sdk/cas/validate-files.js +1 -1
  166. package/dist/sdk/client/cdp-api-client.js +1 -1
  167. package/dist/sdk/client/delivery-api-client.js +1 -1
  168. package/dist/sdk/client/endpoints.js +1 -1
  169. package/dist/sdk/client/engage-api-client.js +1 -1
  170. package/dist/sdk/client/http-client.js +1 -1
  171. package/dist/sdk/client/llm-api-client.js +1 -1
  172. package/dist/sdk/client/oauth-refresh.js +1 -1
  173. package/dist/sdk/client/p13n-studio-api-client.js +1 -1
  174. package/dist/sdk/client/rate-limiter.js +1 -1
  175. package/dist/sdk/client/td-api-client.js +1 -1
  176. package/dist/sdk/client/trino-api-client.js +1 -1
  177. package/dist/sdk/client/workflow-client.js +1 -1
  178. package/dist/sdk/connection-validator.js +1 -1
  179. package/dist/sdk/connection.js +1 -1
  180. package/dist/sdk/delivery.js +1 -1
  181. package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
  182. package/dist/sdk/engage/always-on-campaign-push.js +1 -1
  183. package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
  184. package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
  185. package/dist/sdk/engage/campaign-pull.js +1 -1
  186. package/dist/sdk/engage/campaign-push.js +1 -1
  187. package/dist/sdk/engage/campaign-readiness-workflow.js +1 -1
  188. package/dist/sdk/engage/campaign-readiness.js +1 -1
  189. package/dist/sdk/engage/campaign-validator.js +1 -1
  190. package/dist/sdk/engage/campaign-yaml.js +1 -1
  191. package/dist/sdk/engage/in-browser-message-pull.js +1 -1
  192. package/dist/sdk/engage/in-browser-message-push.js +1 -1
  193. package/dist/sdk/engage/in-browser-message-validator.js +1 -1
  194. package/dist/sdk/engage/in-browser-message-yaml.js +1 -1
  195. package/dist/sdk/engage/landing-page-init.js +1 -1
  196. package/dist/sdk/engage/landing-page-public-asset.js +1 -1
  197. package/dist/sdk/engage/landing-page-pull.js +1 -1
  198. package/dist/sdk/engage/landing-page-push.js +1 -1
  199. package/dist/sdk/engage/landing-page-static-site.js +1 -1
  200. package/dist/sdk/engage/landing-page-validator.js +1 -1
  201. package/dist/sdk/engage/landing-page-workspace.js +1 -1
  202. package/dist/sdk/engage/landing-page-yaml.js +1 -1
  203. package/dist/sdk/engage/list-campaign-schema.js +1 -1
  204. package/dist/sdk/engage/list-campaign-yaml.js +1 -1
  205. package/dist/sdk/engage/template-pull.js +1 -1
  206. package/dist/sdk/engage/template-push.js +1 -1
  207. package/dist/sdk/engage/template-validator.js +1 -1
  208. package/dist/sdk/engage/template-yaml.js +1 -1
  209. package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
  210. package/dist/sdk/engage/types/campaign-def.js +1 -1
  211. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  212. package/dist/sdk/engage/types/in-browser-message-schema.js +1 -1
  213. package/dist/sdk/engage/types/landing-page-schema.js +1 -1
  214. package/dist/sdk/engage/types/template-schema.js +1 -1
  215. package/dist/sdk/engage/workspace-assignments.js +1 -1
  216. package/dist/sdk/engage.js +1 -1
  217. package/dist/sdk/errors.js +1 -1
  218. package/dist/sdk/index.js +1 -1
  219. package/dist/sdk/io/index.js +1 -1
  220. package/dist/sdk/io/node-filesystem.js +1 -1
  221. package/dist/sdk/job.js +1 -1
  222. package/dist/sdk/journey.d.ts +4 -1
  223. package/dist/sdk/journey.d.ts.map +1 -1
  224. package/dist/sdk/journey.js +1 -1
  225. package/dist/sdk/journey.js.map +1 -1
  226. package/dist/sdk/llm/chat-cache.js +1 -1
  227. package/dist/sdk/llm/codex-usage.d.ts +13 -0
  228. package/dist/sdk/llm/codex-usage.d.ts.map +1 -0
  229. package/dist/sdk/llm/codex-usage.js +1 -0
  230. package/dist/sdk/llm/codex-usage.js.map +1 -0
  231. package/dist/sdk/llm/index.js +1 -1
  232. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  233. package/dist/sdk/llm/model-factors.d.ts.map +1 -1
  234. package/dist/sdk/llm/model-factors.js +1 -1
  235. package/dist/sdk/llm/model-factors.js.map +1 -1
  236. package/dist/sdk/llm/user-settings.js +1 -1
  237. package/dist/sdk/llm/work-models.d.ts +52 -0
  238. package/dist/sdk/llm/work-models.d.ts.map +1 -0
  239. package/dist/sdk/llm/work-models.js +1 -0
  240. package/dist/sdk/llm/work-models.js.map +1 -0
  241. package/dist/sdk/p13n-studio-errors.js +1 -1
  242. package/dist/sdk/p13n-studio.js +1 -1
  243. package/dist/sdk/personalization.js +1 -1
  244. package/dist/sdk/policy.js +1 -1
  245. package/dist/sdk/query/deleted-table-validation.js +1 -1
  246. package/dist/sdk/query/index.js +1 -1
  247. package/dist/sdk/query/sql-parser.js +1 -1
  248. package/dist/sdk/realtime.js +1 -1
  249. package/dist/sdk/schedule.js +1 -1
  250. package/dist/sdk/segment/audience-context.js +1 -1
  251. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  252. package/dist/sdk/segment/fields-display.js +1 -1
  253. package/dist/sdk/segment/file-discovery.js +1 -1
  254. package/dist/sdk/segment/journey-utils.js +1 -1
  255. package/dist/sdk/segment/journey-validator.js +1 -1
  256. package/dist/sdk/segment/journey-yaml.js +1 -1
  257. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  258. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  259. package/dist/sdk/segment/pull-workflow.js +1 -1
  260. package/dist/sdk/segment/push-recovery.js +1 -1
  261. package/dist/sdk/segment/push-workflow.js +1 -1
  262. package/dist/sdk/segment/resolution-context.js +1 -1
  263. package/dist/sdk/segment/segment-path-parser.js +1 -1
  264. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  265. package/dist/sdk/segment/segment-validator.js +1 -1
  266. package/dist/sdk/segment/target-resolution.js +1 -1
  267. package/dist/sdk/segment/tdx-config.js +1 -1
  268. package/dist/sdk/segment/types/activation-schema.js +1 -1
  269. package/dist/sdk/segment/types/journey-def.js +1 -1
  270. package/dist/sdk/segment/types/journey-schema.js +1 -1
  271. package/dist/sdk/segment/types/segment-def.js +1 -1
  272. package/dist/sdk/segment/types/segment-schema.js +1 -1
  273. package/dist/sdk/segment/validate-files.js +1 -1
  274. package/dist/sdk/segment/yaml-validator.js +1 -1
  275. package/dist/sdk/segment.js +1 -1
  276. package/dist/sdk/types/index.js +1 -1
  277. package/dist/sdk/types/progress.js +1 -1
  278. package/dist/sdk/types/workspace.js +1 -1
  279. package/dist/sdk/user.js +1 -1
  280. package/dist/sdk/util/format-detector.js +1 -1
  281. package/dist/sdk/util/formatters.js +1 -1
  282. package/dist/sdk/util/index.js +1 -1
  283. package/dist/sdk/util/paginate.js +1 -1
  284. package/dist/sdk/util/tree-formatter.js +1 -1
  285. package/dist/sdk/util/tree-search.js +1 -1
  286. package/dist/sdk/workflow/archive-validation.js +1 -1
  287. package/dist/sdk/workflow/clone-workflow.js +1 -1
  288. package/dist/sdk/workflow/index.js +1 -1
  289. package/dist/sdk/workflow/pull-workflow.js +1 -1
  290. package/dist/sdk/workflow/push-workflow.js +1 -1
  291. package/dist/sdk/workflow/task-graph.js +1 -1
  292. package/dist/sdk/workflow/tdx-config.js +1 -1
  293. package/dist/sdk/workflow/workflow-utils.js +1 -1
  294. package/dist/sdk/workspace/access-tracker.js +1 -1
  295. package/dist/sdk/workspace/frontmatter.js +1 -1
  296. package/dist/sdk/workspace/git.js +1 -1
  297. package/dist/sdk/workspace/index.js +1 -1
  298. package/dist/sdk/workspace/templates.js +1 -1
  299. package/dist/sdk/workspace/weekly.js +1 -1
  300. package/dist/sdk/workspace/wikilinks.js +1 -1
  301. package/dist/test-utils/command-runner.js +1 -1
  302. package/dist/test-utils/factories.js +1 -1
  303. package/dist/test-utils/fixtures.js +1 -1
  304. package/dist/test-utils/http-mock.js +1 -1
  305. package/dist/test-utils/index.js +1 -1
  306. package/dist/utils/async.js +1 -1
  307. package/dist/utils/claude-code-state.js +1 -1
  308. package/dist/utils/colors.js +1 -1
  309. package/dist/utils/diff.js +1 -1
  310. package/dist/utils/file-permissions.js +1 -1
  311. package/dist/utils/file-reader.js +1 -1
  312. package/dist/utils/github-releases.js +1 -1
  313. package/dist/utils/global-cache.js +1 -1
  314. package/dist/utils/json-loader.js +1 -1
  315. package/dist/utils/local-cache.js +1 -1
  316. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  317. package/dist/utils/logger/formatters/index.js +1 -1
  318. package/dist/utils/logger/handlers/console-handler.js +1 -1
  319. package/dist/utils/logger/handlers/file-handler.js +1 -1
  320. package/dist/utils/logger/handlers/index.js +1 -1
  321. package/dist/utils/logger/handlers/null-handler.js +1 -1
  322. package/dist/utils/logger/index.js +1 -1
  323. package/dist/utils/logger/logger.js +1 -1
  324. package/dist/utils/logger/types.js +1 -1
  325. package/dist/utils/option-validation.js +1 -1
  326. package/dist/utils/process.js +1 -1
  327. package/dist/utils/prompt.js +1 -1
  328. package/dist/utils/proxy-fetch.js +1 -1
  329. package/dist/utils/spinner.js +1 -1
  330. package/dist/utils/sse-parser.js +1 -1
  331. package/dist/utils/string-utils.js +1 -1
  332. package/dist/utils/table-ref-parser.js +1 -1
  333. package/dist/utils/td-user.d.ts +3 -0
  334. package/dist/utils/td-user.d.ts.map +1 -0
  335. package/dist/utils/td-user.js +1 -0
  336. package/dist/utils/td-user.js.map +1 -0
  337. package/dist/utils/tdx-logger.js +1 -1
  338. package/dist/utils/version-check.js +1 -1
  339. package/package.json +2 -1
  340. package/dist/commands/ai-usage-command-base.d.ts +0 -26
  341. package/dist/commands/ai-usage-command-base.d.ts.map +0 -1
  342. package/dist/commands/ai-usage-command-base.js +0 -1
  343. package/dist/commands/ai-usage-command-base.js.map +0 -1
  344. package/dist/commands/claude-usage-command.d.ts +0 -19
  345. package/dist/commands/claude-usage-command.d.ts.map +0 -1
  346. package/dist/commands/claude-usage-command.js +0 -1
  347. package/dist/commands/claude-usage-command.js.map +0 -1
  348. package/dist/commands/opencode-usage-command.d.ts +0 -19
  349. package/dist/commands/opencode-usage-command.d.ts.map +0 -1
  350. package/dist/commands/opencode-usage-command.js +0 -1
  351. package/dist/commands/opencode-usage-command.js.map +0 -1
@@ -1 +1 @@
1
- const a3_0x4f3827=a3_0x201a;(function(_0x2da8bf,_0x145453){const _0x1129f3=a3_0x201a,_0x2f5835=_0x2da8bf();while(!![]){try{const _0x3a80dc=-parseInt(_0x1129f3(0x172))/0x1+-parseInt(_0x1129f3(0x16a))/0x2*(parseInt(_0x1129f3(0x16b))/0x3)+-parseInt(_0x1129f3(0x16e))/0x4+parseInt(_0x1129f3(0x15a))/0x5*(-parseInt(_0x1129f3(0x16f))/0x6)+-parseInt(_0x1129f3(0x170))/0x7+-parseInt(_0x1129f3(0x162))/0x8*(parseInt(_0x1129f3(0x171))/0x9)+-parseInt(_0x1129f3(0x15f))/0xa*(-parseInt(_0x1129f3(0x175))/0xb);if(_0x3a80dc===_0x145453)break;else _0x2f5835['push'](_0x2f5835['shift']());}catch(_0x306e7c){_0x2f5835['push'](_0x2f5835['shift']());}}}(a3_0x4181,0x52eb9));import{BaseCommand}from'./command.js';function a3_0x201a(_0x258150,_0x57bd88){_0x258150=_0x258150-0x159;const _0x418189=a3_0x4181();let _0x201a54=_0x418189[_0x258150];return _0x201a54;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0x4181(){const _0x4685ac=['verbose','3977677dReNBi','Resolving\x20parent\x20segment\x20\x27','data','error','execute','site','Site:\x20','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','name','104165hGJzJw','✔\x20Found\x20','segment','cause','\x27...','60HUukIJ','resolveSegmentId','\x20\x20Cause:\x20','32HYSVKD','Error:\x20Segment\x20name\x20is\x20required','description','activations','resolveParentId','length','message','Listing\x20activations\x20for\x20segment\x20\x27','3022Nrcryt','690PjQzGz','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','listActivations','2037264zQMBtn','48uzBAKa','4114950qswBKW','33039RRUfls','203957upoZkK','\x20activation'];a3_0x4181=function(){return _0x4685ac;};return a3_0x4181();}export class ActivationsCommand extends BaseCommand{[a3_0x4f3827(0x159)]=a3_0x4f3827(0x165);[a3_0x4f3827(0x164)]='List\x20activations\x20for\x20a\x20segment';async[a3_0x4f3827(0x179)](_0x2a8171){const _0x30167e=a3_0x4f3827,{options:_0x7d7a54,args:_0x2ed483,tdx:_0x19e6b4}=_0x2a8171;if(_0x2ed483[_0x30167e(0x167)]===0x0)return console['error'](_0x30167e(0x163)),console[_0x30167e(0x178)](_0x30167e(0x17c)),0x1;try{const {parentId:_0x1c0c3d,childId:_0x362873}=parseSegmentRef(_0x2ed483[0x0]);if(!_0x362873)return console['error'](_0x30167e(0x16c)),console[_0x30167e(0x178)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x7d7a54['verbose']&&(console[_0x30167e(0x178)](_0x30167e(0x17b)+_0x7d7a54[_0x30167e(0x17a)]),console['error']('Parent\x20name:\x20'+_0x1c0c3d),console[_0x30167e(0x178)]('Child\x20name:\x20'+_0x362873));const _0xf9b0c4=await withSpinner(_0x30167e(0x176)+_0x1c0c3d+'\x27...',()=>_0x19e6b4[_0x30167e(0x15c)][_0x30167e(0x166)](_0x1c0c3d),{'verbose':_0x7d7a54[_0x30167e(0x174)]}),_0x405f95=_0xf9b0c4[_0x30167e(0x177)];_0x7d7a54[_0x30167e(0x174)]&&console[_0x30167e(0x178)]('Resolved\x20parent\x20ID:\x20'+_0x405f95);const _0x183543=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x362873+_0x30167e(0x15e),()=>_0x19e6b4[_0x30167e(0x15c)][_0x30167e(0x160)](_0x405f95,_0x362873),{'verbose':_0x7d7a54['verbose']}),_0x13522d=_0x183543[_0x30167e(0x177)];_0x7d7a54[_0x30167e(0x174)]&&console[_0x30167e(0x178)]('Resolved\x20child\x20ID:\x20'+_0x13522d);const _0x4190a9=await withSpinner(_0x30167e(0x169)+_0x362873+_0x30167e(0x15e),()=>_0x19e6b4[_0x30167e(0x15c)][_0x30167e(0x16d)](_0x405f95,_0x13522d),{'verbose':_0x7d7a54[_0x30167e(0x174)]}),_0x18e9f1=_0x4190a9[_0x30167e(0x177)];return console[_0x30167e(0x178)](_0x30167e(0x15b)+_0x18e9f1['length']+_0x30167e(0x173)+(_0x18e9f1[_0x30167e(0x167)]!==0x1?'s':'')),await handleSDKOutput(_0x18e9f1,_0x7d7a54),0x0;}catch(_0x33f7be){if(_0x33f7be instanceof SDKError)return console['error']('Error:\x20'+_0x33f7be[_0x30167e(0x168)]),_0x33f7be[_0x30167e(0x15d)]&&console[_0x30167e(0x178)](_0x30167e(0x161)+_0x33f7be[_0x30167e(0x15d)]),0x1;throw _0x33f7be;}}}
1
+ const a3_0x2edbc7=a3_0x2e82;(function(_0x498c42,_0x5acad1){const _0x5f611e=a3_0x2e82,_0x4d7584=_0x498c42();while(!![]){try{const _0x236f37=-parseInt(_0x5f611e(0xf7))/0x1*(parseInt(_0x5f611e(0xfd))/0x2)+parseInt(_0x5f611e(0xfa))/0x3+parseInt(_0x5f611e(0xfe))/0x4*(-parseInt(_0x5f611e(0x107))/0x5)+-parseInt(_0x5f611e(0xfc))/0x6+-parseInt(_0x5f611e(0x106))/0x7*(parseInt(_0x5f611e(0x10a))/0x8)+parseInt(_0x5f611e(0x115))/0x9+-parseInt(_0x5f611e(0x102))/0xa*(parseInt(_0x5f611e(0xf8))/0xb);if(_0x236f37===_0x5acad1)break;else _0x4d7584['push'](_0x4d7584['shift']());}catch(_0x16923e){_0x4d7584['push'](_0x4d7584['shift']());}}}(a3_0xf255,0xc7f0b));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0x2e82(_0x5a4194,_0x2ed479){_0x5a4194=_0x5a4194-0xf2;const _0xf255c4=a3_0xf255();let _0x2e8241=_0xf255c4[_0x5a4194];return _0x2e8241;}function a3_0xf255(){const _0xf6a079=['\x20\x20Cause:\x20','24WrYkgy','description','Site:\x20','Resolving\x20child\x20segment\x20\x27','error','Parent\x20name:\x20','activations','execute','Resolving\x20parent\x20segment\x20\x27','\x27...','\x20activation','13384827JYaEgI','cause','Error:\x20','Child\x20name:\x20','data','site','162696PoqjOG','9031VtGxYR','verbose','1315617dbGiFZ','List\x20activations\x20for\x20a\x20segment','1641876zZOiOj','2dCmdwU','8enYELY','length','name','segment','4670CdjsWA','resolveSegmentId','Resolved\x20parent\x20ID:\x20','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','994BXNuzB','716530XEKQmC','listActivations'];a3_0xf255=function(){return _0xf6a079;};return a3_0xf255();}export class ActivationsCommand extends BaseCommand{[a3_0x2edbc7(0x100)]=a3_0x2edbc7(0x110);[a3_0x2edbc7(0x10b)]=a3_0x2edbc7(0xfb);async[a3_0x2edbc7(0x111)](_0x639922){const _0x3504c9=a3_0x2edbc7,{options:_0x55ccdd,args:_0x4b580d,tdx:_0x19421b}=_0x639922;if(_0x4b580d[_0x3504c9(0xff)]===0x0)return console[_0x3504c9(0x10e)]('Error:\x20Segment\x20name\x20is\x20required'),console[_0x3504c9(0x10e)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x3ea099,childId:_0x118797}=parseSegmentRef(_0x4b580d[0x0]);if(!_0x118797)return console[_0x3504c9(0x10e)]('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x3504c9(0x10e)](_0x3504c9(0x105)),0x1;_0x55ccdd[_0x3504c9(0xf9)]&&(console['error'](_0x3504c9(0x10c)+_0x55ccdd[_0x3504c9(0xf6)]),console['error'](_0x3504c9(0x10f)+_0x3ea099),console[_0x3504c9(0x10e)](_0x3504c9(0xf4)+_0x118797));const _0x430806=await withSpinner(_0x3504c9(0x112)+_0x3ea099+_0x3504c9(0x113),()=>_0x19421b[_0x3504c9(0x101)]['resolveParentId'](_0x3ea099),{'verbose':_0x55ccdd[_0x3504c9(0xf9)]}),_0xdd8f32=_0x430806[_0x3504c9(0xf5)];_0x55ccdd['verbose']&&console['error'](_0x3504c9(0x104)+_0xdd8f32);const _0xd372e2=await withSpinner(_0x3504c9(0x10d)+_0x118797+_0x3504c9(0x113),()=>_0x19421b[_0x3504c9(0x101)][_0x3504c9(0x103)](_0xdd8f32,_0x118797),{'verbose':_0x55ccdd[_0x3504c9(0xf9)]}),_0x497910=_0xd372e2['data'];_0x55ccdd[_0x3504c9(0xf9)]&&console[_0x3504c9(0x10e)]('Resolved\x20child\x20ID:\x20'+_0x497910);const _0x2df728=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x118797+'\x27...',()=>_0x19421b[_0x3504c9(0x101)][_0x3504c9(0x108)](_0xdd8f32,_0x497910),{'verbose':_0x55ccdd['verbose']}),_0x2592ee=_0x2df728[_0x3504c9(0xf5)];return console[_0x3504c9(0x10e)]('✔\x20Found\x20'+_0x2592ee['length']+_0x3504c9(0x114)+(_0x2592ee['length']!==0x1?'s':'')),await handleSDKOutput(_0x2592ee,_0x55ccdd),0x0;}catch(_0x51f6d3){if(_0x51f6d3 instanceof SDKError)return console['error'](_0x3504c9(0xf3)+_0x51f6d3['message']),_0x51f6d3[_0x3504c9(0xf2)]&&console[_0x3504c9(0x10e)](_0x3504c9(0x109)+_0x51f6d3[_0x3504c9(0xf2)]),0x1;throw _0x51f6d3;}}}
@@ -1 +1 @@
1
- const a4_0x548581=a4_0x39d3;(function(_0x3de63c,_0x1878c3){const _0xab7ab7=a4_0x39d3,_0x405e3a=_0x3de63c();while(!![]){try{const _0x480692=parseInt(_0xab7ab7(0x217))/0x1+-parseInt(_0xab7ab7(0x18c))/0x2+parseInt(_0xab7ab7(0x171))/0x3+parseInt(_0xab7ab7(0x1fb))/0x4+-parseInt(_0xab7ab7(0x1b3))/0x5*(parseInt(_0xab7ab7(0x1e1))/0x6)+parseInt(_0xab7ab7(0x193))/0x7+-parseInt(_0xab7ab7(0x205))/0x8*(-parseInt(_0xab7ab7(0x1a8))/0x9);if(_0x480692===_0x1878c3)break;else _0x405e3a['push'](_0x405e3a['shift']());}catch(_0x3df993){_0x405e3a['push'](_0x405e3a['shift']());}}}(a4_0x335b,0xa86c5));function a4_0x335b(){const _0x3a4e17=['action','Cancelled','Writing\x20files...','message','Cloning\x20\x22','Using\x20local\x20project:\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x0aError:','2106255mREbsO','counts','tdx.json','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','\x0aPush\x20summary\x20for\x20\x27','\x20\x20Integrations:\x20','\x0aChanges\x20to\x20chat\x20interface\x20\x27','\x20resources?','red','\x0aWrite\x20','agent:clone','agent:pull','sourceProjectName','\x20|\x20','Would\x20push\x20agent:\x20','Would\x20pull\x20agent:\x20','profile','\x20\x20Form\x20Interfaces:\x20','\x0a✔\x20Pushed\x20','MISSING_ARGUMENT','textKnowledgeBases','dim','description','errors','unchanged','Analyzing\x20project\x20\x22','dryRun','692132aLyYXa','no_context','site','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20new','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x20\x20Prompts:\x20','1062516tHQiMW','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','integrations','\x0aPush\x20','new','\x20\x20Knowledge\x20Bases:\x20','log','cyan','yes','execute','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','projectName','No\x20tdx.json\x20found\x20in\x20','llmProject','diff','updated','outputDir','repeat','New\x20project\x20ID:\x20','context','\x20--profile\x20','370485BZJCOb','source','agentName','INVALID_ARGUMENT','\x20total','✔\x20Context\x20set:\x20','\x0aPull\x20summary\x20for\x20\x27','\x0aProject\x20pushed\x20with\x20errors','\x20\x20Chat\x20Interfaces:\x20','arg-dir','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','5mRNTNf','utf-8','newProjectName','llm_project','Using\x20project\x20from\x20','Using\x20current\x20project:\x20','agentId','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x22:\x20','\x20files\x20to\x20','created','\x20\x20Text\x20Knowledge\x20Base\x20\x22','reason','knowledgeBases','experimentalArtifacts','Agent:\x20','\x20\x20Chat\x20Interface\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20\x20Agent\x20\x22','Dry\x20run\x20-\x20no\x20changes\x20made','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20resources\x20to\x20\x27','Using\x20project\x20from\x20context:\x20','Errors:','\x20unchanged','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','output','parse','pullAgent','cwd-config','Agent\x20pulled\x20successfully','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','push','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Using\x20project:\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','total','yellow','gray','\x20\x20tdx\x20agent\x20pull\x20','chatInterfaces','\x22\x20to\x20a\x20different\x20profile','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Project:\x20','newProjectId','llm','4984020cgUDXP','\x20\x20Source:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x27\x20to\x20create\x20the\x20folder\x20structure.','green','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','\x20\x20Target:\x20','Using\x20context\x20project:\x20','Pushing\x20agent\x20from\x20\x22','\x20\x20Experimental\x20Artifact\x20\x22','\x0a✔\x20Pulled\x20','Project\x20cloned\x20successfully','\x20\x20Form\x20Interface\x20\x22','outputPath','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','error','-\x20nothing\x20pushed','pushProject','experimentalKnowledgeBases','pushAgent','\x20=\x20','prompts','Would\x20clone:','\x20\x20Experimental\x20Artifacts:\x20','join','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','291188QrtWEp','no_local_folder','\x22...','\x0aChanges\x20to\x20agent\x20\x27','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20\x20Text\x20Knowledge\x20Bases:\x20','Clone\x20\x22','hasChanges','force','8MGDSWF','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','dirname','session','\x20\x20Knowledge\x20Base\x20\x22','agent','Pushing\x20to\x20project...','cloneProject','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20Prompt\x20\x22','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','name','formInterfaces','Failed\x20to\x20push\x20agent:\x20','Summary:','cwd','\x0aErrors\x20found:','New\x20project:\x20','898762ZLsuTR','pullProject','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','New\x20project\x20name\x20is\x20required','\x22\x20to\x20\x22','\x0aChanges\x20to\x20prompt\x20\x27','projectId','Pulling\x20agent\x20\x22','\x20changed','Agent\x20','agents','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20\x20Agents:\x20','isNew','-\x20no\x20files\x20written'];a4_0x335b=function(){return _0x3a4e17;};return a4_0x335b();}import a4_0x2eb76c from'chalk';import a4_0x2853a9 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';function a4_0x39d3(_0x4c1708,_0x4d069d){_0x4c1708=_0x4c1708-0x15e;const _0x335b89=a4_0x335b();let _0x39d3f6=_0x335b89[_0x4c1708];return _0x39d3f6;}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x5486f4){const _0x8b1c9e=a4_0x39d3,_0x182a3d=[];if(_0x5486f4[_0x8b1c9e(0x1d7)]!==undefined)_0x182a3d['push'](_0x5486f4[_0x8b1c9e(0x1d7)]+_0x8b1c9e(0x1ac));if(_0x5486f4[_0x8b1c9e(0x197)]!==undefined&&_0x5486f4['new']>0x0)_0x182a3d[_0x8b1c9e(0x1d3)](a4_0x2eb76c[_0x8b1c9e(0x1e5)](_0x5486f4['new']+_0x8b1c9e(0x190)));if(_0x5486f4[_0x8b1c9e(0x1bd)]!==undefined&&_0x5486f4[_0x8b1c9e(0x1bd)]>0x0)_0x182a3d[_0x8b1c9e(0x1d3)](a4_0x2eb76c[_0x8b1c9e(0x1e5)](_0x5486f4[_0x8b1c9e(0x1bd)]+'\x20created'));if(_0x5486f4[_0x8b1c9e(0x1a2)]!==undefined&&_0x5486f4[_0x8b1c9e(0x1a2)]>0x0)_0x182a3d[_0x8b1c9e(0x1d3)](a4_0x2eb76c['yellow'](_0x5486f4['updated']+'\x20updated'));if(_0x5486f4[_0x8b1c9e(0x189)]!==undefined&&_0x5486f4[_0x8b1c9e(0x189)]>0x0)_0x182a3d['push'](a4_0x2eb76c[_0x8b1c9e(0x1d9)](_0x5486f4[_0x8b1c9e(0x189)]+_0x8b1c9e(0x1cb)));if(_0x5486f4[_0x8b1c9e(0x188)]!==undefined&&_0x5486f4['errors']>0x0)_0x182a3d[_0x8b1c9e(0x1d3)](a4_0x2eb76c['red'](_0x5486f4[_0x8b1c9e(0x188)]+'\x20errors'));return _0x182a3d[_0x8b1c9e(0x1f9)](',\x20');}function displayDiffs(_0x305aa0,_0x51f90d,_0x3ad12d,_0x39258b,_0x4016db,_0x51a477,_0x10661b,_0x4aa83c,_0x36b92d){const _0xb9600b=a4_0x39d3;for(const _0x2edcf5 of _0x305aa0){if(_0x2edcf5[_0xb9600b(0x1a1)]){const _0x306d26=_0x2edcf5[_0xb9600b(0x1aa)]||_0x2edcf5[_0xb9600b(0x210)];console['log'](_0xb9600b(0x1fe)+_0x306d26+'\x27:'),console[_0xb9600b(0x199)]('─'['repeat'](0x3c)),console[_0xb9600b(0x199)](_0x2edcf5[_0xb9600b(0x1a1)]),console[_0xb9600b(0x199)]('─'['repeat'](0x3c));}}for(const _0x1fba5f of _0x51f90d){_0x1fba5f['diff']&&(console[_0xb9600b(0x199)](_0xb9600b(0x1fa)+_0x1fba5f[_0xb9600b(0x210)]+'\x27:'),console['log']('─'[_0xb9600b(0x1a4)](0x3c)),console[_0xb9600b(0x199)](_0x1fba5f[_0xb9600b(0x1a1)]),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)));}for(const _0x37d92c of _0x3ad12d){_0x37d92c[_0xb9600b(0x1a1)]&&(console[_0xb9600b(0x199)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x37d92c[_0xb9600b(0x210)]+'\x27:'),console['log']('─'[_0xb9600b(0x1a4)](0x3c)),console[_0xb9600b(0x199)](_0x37d92c[_0xb9600b(0x1a1)]),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)));}for(const _0x4b700a of _0x39258b){_0x4b700a[_0xb9600b(0x1a1)]&&(console[_0xb9600b(0x199)](_0xb9600b(0x15f)+_0x4b700a[_0xb9600b(0x210)]+'\x27:'),console[_0xb9600b(0x199)]('─'['repeat'](0x3c)),console[_0xb9600b(0x199)](_0x4b700a[_0xb9600b(0x1a1)]),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)));}for(const _0x29d1b7 of _0x4016db){_0x29d1b7['diff']&&(console[_0xb9600b(0x199)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x29d1b7[_0xb9600b(0x210)]+'\x27:'),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)),console[_0xb9600b(0x199)](_0x29d1b7[_0xb9600b(0x1a1)]),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)));}for(const _0x1a7a03 of _0x51a477){_0x1a7a03[_0xb9600b(0x1a1)]&&(console[_0xb9600b(0x199)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x1a7a03[_0xb9600b(0x210)]+'\x27:'),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)),console[_0xb9600b(0x199)](_0x1a7a03[_0xb9600b(0x1a1)]),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)));}for(const _0x2d0b9f of _0x10661b){_0x2d0b9f['diff']&&(console['log'](_0xb9600b(0x1d4)+_0x2d0b9f[_0xb9600b(0x210)]+'\x27:'),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)),console[_0xb9600b(0x199)](_0x2d0b9f[_0xb9600b(0x1a1)]),console['log']('─'[_0xb9600b(0x1a4)](0x3c)));}for(const _0x4d293a of _0x4aa83c){_0x4d293a[_0xb9600b(0x1a1)]&&(console[_0xb9600b(0x199)]('\x0aChanges\x20to\x20form\x20interface\x20\x27'+_0x4d293a[_0xb9600b(0x210)]+'\x27:'),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)),console[_0xb9600b(0x199)](_0x4d293a[_0xb9600b(0x1a1)]),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)));}for(const _0x3cc575 of _0x36b92d){_0x3cc575['diff']&&(console[_0xb9600b(0x199)](_0xb9600b(0x177)+_0x3cc575[_0xb9600b(0x210)]+'\x27:'),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)),console[_0xb9600b(0x199)](_0x3cc575['diff']),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x548581(0x210)]=a4_0x548581(0x17c);[a4_0x548581(0x187)]=a4_0x548581(0x1e3);async[a4_0x548581(0x19c)](_0x3bd507){const _0x4db717=a4_0x548581,{options:_0x404418,args:_0x419587,tdx:_0x1bf585}=_0x3bd507,_0x33b6b5=_0x419587[0x0],_0x35d6e3=_0x419587[0x1],_0x497872=_0x404418[_0x4db717(0x1cd)],_0x4a0e8e=_0x404418[_0x4db717(0x18b)],_0x443b81=_0x404418[_0x4db717(0x204)],_0x16aba6=_0x404418[_0x4db717(0x19b)],_0x4c2628=_0x404418[_0x4db717(0x1a0)],_0x33ca8c=_0x404418[_0x4db717(0x20a)];let _0x4eb937;if(_0x33b6b5){const _0x4e5cd7=a4_0x2853a9[_0x4db717(0x1f9)](_0x33b6b5,_0x4db717(0x173));if(existsSync(_0x4e5cd7))try{const _0x54b777=JSON[_0x4db717(0x1ce)](readFileSync(_0x4e5cd7,_0x4db717(0x1b4)));_0x54b777[_0x4db717(0x1b6)]&&(_0x4eb937={'llm_project':_0x54b777[_0x4db717(0x1b6)]});}catch{}}const _0x1956ce=findAgentConfigPath(process[_0x4db717(0x214)]());let _0x314c22;if(_0x1956ce)try{const _0xdf7128=JSON[_0x4db717(0x1ce)](readFileSync(_0x1956ce,_0x4db717(0x1b4)));_0xdf7128['llm_project']&&(_0x314c22={'llm_project':_0xdf7128[_0x4db717(0x1b6)]});}catch{}const _0x3eea46=resolveAgentPullArgs({'arg':_0x33b6b5,'agentNameArg':_0x35d6e3,'agentFlag':_0x33ca8c,'contextProject':_0x4c2628,'argDirConfig':_0x4eb937,'cwdConfigPath':_0x1956ce||undefined,'cwdConfig':_0x314c22}),{projectNameOrId:_0xd0ba54,targetAgentName:_0x360369,existingOutputDir:_0x2f3860,source:_0x1df413}=_0x3eea46;if(_0x1df413===_0x4db717(0x1b1))console[_0x4db717(0x199)](a4_0x2eb76c['dim'](_0x4db717(0x1b7)+a4_0x2853a9[_0x4db717(0x1f9)](_0x33b6b5,_0x4db717(0x173))+':\x20'+_0xd0ba54));else{if(_0x1df413===_0x4db717(0x1d0))console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x186)](_0x4db717(0x1d5)+_0xd0ba54));else _0x1df413==='context'&&console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x186)](_0x4db717(0x1c9)+_0xd0ba54));}if(!_0xd0ba54)return _0x33ca8c?(console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x1d8)](_0x4db717(0x191))),console[_0x4db717(0x199)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console['log']('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x1d8)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console['log']('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x4db717(0x199)](_0x4db717(0x1c4)),console[_0x4db717(0x199)](_0x4db717(0x174)),console[_0x4db717(0x199)](_0x4db717(0x1b2)),console[_0x4db717(0x199)](_0x4db717(0x194))),0x1;if(_0x360369){const {data:_0x43bdab}=await withSpinner(_0x4db717(0x161)+_0x360369+'\x22\x20from\x20project\x20\x22'+_0xd0ba54+_0x4db717(0x1fd),()=>_0x1bf585[_0x4db717(0x1e0)][_0x4db717(0x1cf)](_0xd0ba54,_0x360369,_0x497872,{'dryRun':_0x4a0e8e,'force':_0x443b81}));if(_0x4a0e8e)return console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x1d8)](_0x4db717(0x20d))),console[_0x4db717(0x199)](_0x4db717(0x180)+_0x43bdab['agentName']),console[_0x4db717(0x199)]('Output\x20path:\x20'+_0x43bdab[_0x4db717(0x1ee)]),_0x43bdab['diff']&&(console[_0x4db717(0x199)]('\x0aChanges:'),console[_0x4db717(0x199)]('─'[_0x4db717(0x1a4)](0x3c)),console[_0x4db717(0x199)](_0x43bdab[_0x4db717(0x1a1)]),console['log']('─'[_0x4db717(0x1a4)](0x3c))),0x0;return console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x1e5)](_0x4db717(0x1d1))),console[_0x4db717(0x199)](_0x4db717(0x1c2)+_0x43bdab[_0x4db717(0x1aa)]),console[_0x4db717(0x199)]('Output:\x20'+_0x43bdab[_0x4db717(0x1ee)]),console['log']('Status:\x20'+(_0x43bdab[_0x4db717(0x167)]?a4_0x2eb76c['green'](_0x4db717(0x197)):_0x43bdab[_0x4db717(0x203)]?a4_0x2eb76c['yellow'](_0x4db717(0x1a2)):a4_0x2eb76c[_0x4db717(0x1d9)](_0x4db717(0x189)))),0x0;}const _0xb07bbb=_0x2f3860||_0x497872,{data:_0x43af13}=await withSpinner(_0x4db717(0x18a)+_0xd0ba54+_0x4db717(0x1fd),()=>_0x1bf585[_0x4db717(0x1e0)][_0x4db717(0x218)](_0xd0ba54,_0xb07bbb,{'dryRun':!![]})),_0x14d10b=_0x43af13[_0x4db717(0x172)][_0x4db717(0x164)][_0x4db717(0x197)]+_0x43af13[_0x4db717(0x172)]['knowledgeBases'][_0x4db717(0x197)]+_0x43af13[_0x4db717(0x172)]['textKnowledgeBases'][_0x4db717(0x197)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1f6)][_0x4db717(0x197)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x195)][_0x4db717(0x197)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1f3)][_0x4db717(0x197)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1c1)][_0x4db717(0x197)]+_0x43af13['counts']['formInterfaces']['new']+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1db)][_0x4db717(0x197)],_0x7bb37d=_0x43af13['counts']['agents'][_0x4db717(0x1a2)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1c0)][_0x4db717(0x1a2)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x185)][_0x4db717(0x1a2)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1f6)][_0x4db717(0x1a2)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x195)][_0x4db717(0x1a2)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1f3)][_0x4db717(0x1a2)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1c1)][_0x4db717(0x1a2)]+_0x43af13[_0x4db717(0x172)]['formInterfaces'][_0x4db717(0x1a2)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1db)]['updated'],_0x177e65=_0x43af13[_0x4db717(0x172)][_0x4db717(0x164)]['unchanged']+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1c0)][_0x4db717(0x189)]+_0x43af13['counts'][_0x4db717(0x185)][_0x4db717(0x189)]+_0x43af13['counts'][_0x4db717(0x1f6)]['unchanged']+_0x43af13[_0x4db717(0x172)][_0x4db717(0x195)][_0x4db717(0x189)]+_0x43af13['counts'][_0x4db717(0x1f3)]['unchanged']+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1c1)][_0x4db717(0x189)]+_0x43af13[_0x4db717(0x172)]['formInterfaces']['unchanged']+_0x43af13['counts'][_0x4db717(0x1db)]['unchanged'];console[_0x4db717(0x199)](_0x4db717(0x1ae)+_0x43af13[_0x4db717(0x19e)]+'\x27:'),console[_0x4db717(0x199)]('\x20\x20'+a4_0x2eb76c['green']('+\x20'+_0x14d10b+_0x4db717(0x190))+_0x4db717(0x17e)+a4_0x2eb76c['yellow']('~\x20'+_0x7bb37d+'\x20changed')+_0x4db717(0x17e)+a4_0x2eb76c[_0x4db717(0x186)]('=\x20'+_0x177e65+_0x4db717(0x1cb))),console[_0x4db717(0x199)](_0x4db717(0x166)+formatCountSummary(_0x43af13['counts'][_0x4db717(0x164)])),console[_0x4db717(0x199)](_0x4db717(0x198)+formatCountSummary(_0x43af13['counts']['knowledgeBases'])),console[_0x4db717(0x199)](_0x4db717(0x201)+formatCountSummary(_0x43af13['counts']['textKnowledgeBases'])),console[_0x4db717(0x199)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x43af13[_0x4db717(0x172)][_0x4db717(0x1f6)])),console[_0x4db717(0x199)](_0x4db717(0x176)+formatCountSummary(_0x43af13[_0x4db717(0x172)][_0x4db717(0x195)])),console[_0x4db717(0x199)](_0x4db717(0x182)+formatCountSummary(_0x43af13[_0x4db717(0x172)][_0x4db717(0x211)])),console[_0x4db717(0x199)](_0x4db717(0x1b0)+formatCountSummary(_0x43af13[_0x4db717(0x172)][_0x4db717(0x1db)]));const _0x47a832=_0x43af13[_0x4db717(0x172)][_0x4db717(0x1f3)][_0x4db717(0x1d7)]>0x0||_0x43af13[_0x4db717(0x172)][_0x4db717(0x1c1)][_0x4db717(0x1d7)]>0x0;_0x47a832&&(console[_0x4db717(0x199)](_0x4db717(0x19d)+formatCountSummary(_0x43af13[_0x4db717(0x172)][_0x4db717(0x1f3)])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x43af13[_0x4db717(0x172)][_0x4db717(0x1c1)])));console[_0x4db717(0x199)](_0x4db717(0x1e7)+a4_0x2eb76c[_0x4db717(0x19a)](_0x43af13[_0x4db717(0x1a3)])),displayDiffs(_0x43af13[_0x4db717(0x164)],_0x43af13[_0x4db717(0x1c0)],_0x43af13[_0x4db717(0x185)],_0x43af13[_0x4db717(0x1f6)],_0x43af13[_0x4db717(0x195)],_0x43af13['experimentalKnowledgeBases'],_0x43af13[_0x4db717(0x1c1)],_0x43af13[_0x4db717(0x211)],_0x43af13[_0x4db717(0x1db)]);if(_0x4a0e8e)return console['log'](a4_0x2eb76c[_0x4db717(0x1d8)](_0x4db717(0x1c7))),0x0;if(_0x14d10b===0x0&&_0x7bb37d===0x0)return console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x1e5)](_0x4db717(0x200))),saveSessionContext({'llm_project':_0x43af13[_0x4db717(0x19e)]},_0x404418[_0x4db717(0x208)]),console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x1e5)](_0x4db717(0x1ad)+a4_0x2eb76c[_0x4db717(0x186)](_0x4db717(0x1b6))+_0x4db717(0x1f5)+a4_0x2eb76c[_0x4db717(0x19a)](_0x43af13[_0x4db717(0x19e)]))),0x0;if(!_0x16aba6&&!_0x443b81){if(!isInteractive())return console['error'](a4_0x2eb76c[_0x4db717(0x179)](_0x4db717(0x170)),_0x4db717(0x206)),console['error'](a4_0x2eb76c['dim'](_0x4db717(0x20f))),0x1;const _0x1649bd=await confirmKey(_0x4db717(0x17a)+(_0x14d10b+_0x7bb37d)+'\x20files?');if(!_0x1649bd)return console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x1d8)]('Cancelled'),_0x4db717(0x168)),0x1;}const {data:_0x2ce20e}=await withSpinner(_0x4db717(0x16b),()=>_0x1bf585[_0x4db717(0x1e0)]['pullProject'](_0xd0ba54,_0xb07bbb,{'force':_0x443b81}));return console[_0x4db717(0x199)](a4_0x2eb76c['green'](_0x4db717(0x1eb)+(_0x14d10b+_0x7bb37d)+_0x4db717(0x1bc)+_0x2ce20e[_0x4db717(0x1a3)])),saveSessionContext({'llm_project':_0x2ce20e[_0x4db717(0x19e)]},_0x404418[_0x4db717(0x208)]),console['log'](a4_0x2eb76c[_0x4db717(0x1e5)]('✔\x20Context\x20set:\x20'+a4_0x2eb76c[_0x4db717(0x186)]('llm_project')+_0x4db717(0x1f5)+a4_0x2eb76c[_0x4db717(0x19a)](_0x2ce20e[_0x4db717(0x19e)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x548581(0x210)]=a4_0x548581(0x17b);[a4_0x548581(0x187)]=a4_0x548581(0x219);async[a4_0x548581(0x19c)](_0x3907c4){const _0x14e8d9=a4_0x548581,{options:_0x477cff,args:_0xc13c6,tdx:_0x5f1b09}=_0x3907c4,_0x1f8ca7=_0xc13c6[0x0],_0x1fc857=_0x477cff[_0x14e8d9(0x210)],_0x2dceac=_0x477cff[_0x14e8d9(0x18b)],_0x22faab=_0x477cff[_0x14e8d9(0x19b)],_0x42e367=_0x477cff[_0x14e8d9(0x18e)],_0x541f89=_0x477cff[_0x14e8d9(0x1a0)];let _0x20b23b;const _0x2f3ce7=findAgentConfigPath(process[_0x14e8d9(0x214)]());if(_0x1f8ca7){const _0x434a71=a4_0x2853a9[_0x14e8d9(0x1f9)](_0x1f8ca7,_0x14e8d9(0x173));existsSync(_0x434a71)?(_0x20b23b=_0x1f8ca7,console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x186)](_0x14e8d9(0x16e)+_0x1f8ca7))):_0x20b23b=_0x1f8ca7;}else{if(_0x2f3ce7)_0x20b23b=a4_0x2853a9[_0x14e8d9(0x207)](_0x2f3ce7),console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x186)](_0x14e8d9(0x1b8)+_0x20b23b));else{if(_0x541f89){const _0x45423d=sanitizeForFilesystem(_0x541f89);let _0xa44c9=_0x45423d,_0x4541fa=a4_0x2853a9[_0x14e8d9(0x1f9)](process[_0x14e8d9(0x214)](),_0x14e8d9(0x164),_0x45423d,_0x14e8d9(0x173));if(!existsSync(_0x4541fa)){const _0x4fc36e=normalizeName(_0x541f89),_0x5d18d3=a4_0x2853a9[_0x14e8d9(0x1f9)](process[_0x14e8d9(0x214)](),_0x14e8d9(0x164),_0x4fc36e,_0x14e8d9(0x173));existsSync(_0x5d18d3)&&(_0xa44c9=_0x4fc36e,_0x4541fa=_0x5d18d3);}if(existsSync(_0x4541fa))_0x20b23b=a4_0x2853a9[_0x14e8d9(0x207)](_0x4541fa),console['log'](a4_0x2eb76c['dim'](_0x14e8d9(0x16e)+_0x20b23b));else{const _0x347efd=_0x477cff[_0x14e8d9(0x181)];if(_0x347efd)throw new SDKError(ErrorCode[_0x14e8d9(0x1ab)],_0x14e8d9(0x165)+_0x541f89+_0x14e8d9(0x1dc),undefined,{'helpText':_0x14e8d9(0x1ef)+_0x14e8d9(0x1d2)+(_0x14e8d9(0x1da)+_0x541f89+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0xa44c9+'\x20--name\x20'+(_0x1fc857||'<new-name>')+_0x14e8d9(0x1a7)+_0x347efd)});_0x20b23b=_0x541f89,console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x186)](_0x14e8d9(0x1e8)+_0x541f89));}}}}if(!_0x20b23b)return console[_0x14e8d9(0x199)](a4_0x2eb76c['yellow'](_0x14e8d9(0x1cc))),console['log']('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x14e8d9(0x199)](_0x14e8d9(0x1e6)),console['log'](_0x14e8d9(0x1d6)),0x1;if(!_0x1fc857)throw new SDKError(ErrorCode[_0x14e8d9(0x184)],_0x14e8d9(0x21a),undefined,{'helpText':_0x14e8d9(0x1ba)});if(!_0x22faab&&!_0x2dceac){if(!isInteractive())return console[_0x14e8d9(0x1f0)](a4_0x2eb76c[_0x14e8d9(0x179)](_0x14e8d9(0x170)),_0x14e8d9(0x206)),console[_0x14e8d9(0x1f0)](a4_0x2eb76c[_0x14e8d9(0x186)](_0x14e8d9(0x20f))),0x1;const _0x3a7eac=await confirmKey(_0x14e8d9(0x202)+_0x20b23b+'\x22\x20to\x20new\x20project\x20\x22'+_0x1fc857+'\x22?');if(!_0x3a7eac)return console['log'](a4_0x2eb76c[_0x14e8d9(0x1d8)](_0x14e8d9(0x16a))),0x1;}const {data:_0x490c7d}=await withSpinner(_0x14e8d9(0x16d)+_0x20b23b+_0x14e8d9(0x15e)+_0x1fc857+_0x14e8d9(0x1fd),()=>_0x5f1b09['llm'][_0x14e8d9(0x20c)](_0x20b23b,_0x1fc857,{'dryRun':_0x2dceac}));if(_0x2dceac){console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x1d8)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x14e8d9(0x199)]('Source:\x20'+_0x490c7d[_0x14e8d9(0x17d)]),console['log'](_0x14e8d9(0x216)+_0x1fc857),console[_0x14e8d9(0x199)](_0x14e8d9(0x1f7)),console[_0x14e8d9(0x199)](_0x14e8d9(0x166)+_0x490c7d['counts'][_0x14e8d9(0x164)][_0x14e8d9(0x1bd)]),console[_0x14e8d9(0x199)](_0x14e8d9(0x198)+_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1c0)]['created']),console[_0x14e8d9(0x199)](_0x14e8d9(0x192)+_0x490c7d[_0x14e8d9(0x172)]['prompts'][_0x14e8d9(0x1bd)]),console[_0x14e8d9(0x199)](_0x14e8d9(0x182)+_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x211)]['created']),console[_0x14e8d9(0x199)]('\x20\x20Chat\x20Interfaces:\x20'+_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1db)]['created']);const _0x411776=_0x490c7d['counts']['experimentalKnowledgeBases']['created']>0x0||_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1c1)][_0x14e8d9(0x1bd)]>0x0;return _0x411776&&(console[_0x14e8d9(0x199)](_0x14e8d9(0x19d)+_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1f3)]['created']),console[_0x14e8d9(0x199)](_0x14e8d9(0x1f8)+_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1c1)][_0x14e8d9(0x1bd)])),0x0;}const _0x46d3e9=_0x490c7d['counts'][_0x14e8d9(0x164)]['errors']>0x0||_0x490c7d[_0x14e8d9(0x172)]['knowledgeBases'][_0x14e8d9(0x188)]>0x0||_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1f6)][_0x14e8d9(0x188)]>0x0||_0x490c7d['counts'][_0x14e8d9(0x211)][_0x14e8d9(0x188)]>0x0||_0x490c7d['counts'][_0x14e8d9(0x1db)][_0x14e8d9(0x188)]>0x0||_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1f3)][_0x14e8d9(0x188)]>0x0||_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1c1)]['errors']>0x0;_0x46d3e9?console['log'](a4_0x2eb76c[_0x14e8d9(0x1d8)]('Project\x20cloned\x20with\x20errors')):console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x1e5)](_0x14e8d9(0x1ec)));console[_0x14e8d9(0x199)]('Source:\x20'+_0x490c7d[_0x14e8d9(0x17d)]),console[_0x14e8d9(0x199)]('New\x20project:\x20'+_0x490c7d[_0x14e8d9(0x1b5)]),console[_0x14e8d9(0x199)](_0x14e8d9(0x1a5)+_0x490c7d['newProjectId']),console[_0x14e8d9(0x199)](),console[_0x14e8d9(0x199)](_0x14e8d9(0x213)),console[_0x14e8d9(0x199)](_0x14e8d9(0x166)+formatCountSummary(_0x490c7d['counts'][_0x14e8d9(0x164)])),console['log'](_0x14e8d9(0x198)+formatCountSummary(_0x490c7d['counts'][_0x14e8d9(0x1c0)])),console[_0x14e8d9(0x199)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1f6)])),console[_0x14e8d9(0x199)](_0x14e8d9(0x176)+formatCountSummary(_0x490c7d[_0x14e8d9(0x172)]['integrations'])),console['log'](_0x14e8d9(0x182)+formatCountSummary(_0x490c7d['counts'][_0x14e8d9(0x211)])),console[_0x14e8d9(0x199)](_0x14e8d9(0x1b0)+formatCountSummary(_0x490c7d[_0x14e8d9(0x172)]['chatInterfaces']));const _0x519e0d=_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1f3)][_0x14e8d9(0x1bd)]>0x0||_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1f3)]['updated']>0x0||_0x490c7d['counts'][_0x14e8d9(0x1f3)][_0x14e8d9(0x189)]>0x0||_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1c1)][_0x14e8d9(0x1bd)]>0x0||_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1c1)]['updated']>0x0||_0x490c7d['counts'][_0x14e8d9(0x1c1)][_0x14e8d9(0x189)]>0x0;_0x519e0d&&(console[_0x14e8d9(0x199)](_0x14e8d9(0x19d)+formatCountSummary(_0x490c7d[_0x14e8d9(0x172)]['experimentalKnowledgeBases'])),console[_0x14e8d9(0x199)](_0x14e8d9(0x1f8)+formatCountSummary(_0x490c7d['counts'][_0x14e8d9(0x1c1)])));if(_0x46d3e9){console['log'](),console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x179)](_0x14e8d9(0x1ca)));for(const _0x1dc48c of _0x490c7d[_0x14e8d9(0x164)]){_0x1dc48c[_0x14e8d9(0x169)]==='error'&&console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x179)](_0x14e8d9(0x1c5)+_0x1dc48c[_0x14e8d9(0x1aa)]+_0x14e8d9(0x1bb)+_0x1dc48c[_0x14e8d9(0x1f0)]));}for(const _0x4be18b of _0x490c7d['knowledgeBases']){_0x4be18b[_0x14e8d9(0x169)]===_0x14e8d9(0x1f0)&&console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x179)](_0x14e8d9(0x209)+_0x4be18b['name']+_0x14e8d9(0x1bb)+_0x4be18b['error']));}for(const _0x339eba of _0x490c7d[_0x14e8d9(0x1f6)]){_0x339eba[_0x14e8d9(0x169)]===_0x14e8d9(0x1f0)&&console['log'](a4_0x2eb76c[_0x14e8d9(0x179)]('\x20\x20Prompt\x20\x22'+_0x339eba[_0x14e8d9(0x210)]+_0x14e8d9(0x1bb)+_0x339eba[_0x14e8d9(0x1f0)]));}for(const _0xf77c79 of _0x490c7d['integrations']){_0xf77c79[_0x14e8d9(0x169)]===_0x14e8d9(0x1f0)&&console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x179)]('\x20\x20Integration\x20\x22'+_0xf77c79[_0x14e8d9(0x210)]+'\x22:\x20'+_0xf77c79[_0x14e8d9(0x1f0)]));}for(const _0x37a53d of _0x490c7d['formInterfaces']){_0x37a53d[_0x14e8d9(0x169)]===_0x14e8d9(0x1f0)&&console[_0x14e8d9(0x199)](a4_0x2eb76c['red'](_0x14e8d9(0x1ed)+_0x37a53d[_0x14e8d9(0x210)]+_0x14e8d9(0x1bb)+_0x37a53d[_0x14e8d9(0x1f0)]));}for(const _0x2ebb90 of _0x490c7d['chatInterfaces']){_0x2ebb90[_0x14e8d9(0x169)]===_0x14e8d9(0x1f0)&&console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x179)](_0x14e8d9(0x1c3)+_0x2ebb90[_0x14e8d9(0x210)]+_0x14e8d9(0x1bb)+_0x2ebb90[_0x14e8d9(0x1f0)]));}for(const _0x5a94d7 of _0x490c7d['experimentalKnowledgeBases']){_0x5a94d7[_0x14e8d9(0x169)]===_0x14e8d9(0x1f0)&&console[_0x14e8d9(0x199)](a4_0x2eb76c['red'](_0x14e8d9(0x18f)+_0x5a94d7[_0x14e8d9(0x210)]+_0x14e8d9(0x1bb)+_0x5a94d7[_0x14e8d9(0x1f0)]));}for(const _0x581098 of _0x490c7d[_0x14e8d9(0x1c1)]){_0x581098[_0x14e8d9(0x169)]===_0x14e8d9(0x1f0)&&console['log'](a4_0x2eb76c[_0x14e8d9(0x179)](_0x14e8d9(0x1ea)+_0x581098['name']+'\x22:\x20'+_0x581098[_0x14e8d9(0x1f0)]));}return 0x1;}console[_0x14e8d9(0x199)]();const _0x3192dc=getLLMProjectUrl(_0x42e367,_0x490c7d[_0x14e8d9(0x1df)]);return console[_0x14e8d9(0x199)](_0x14e8d9(0x1de)+a4_0x2eb76c[_0x14e8d9(0x19a)](_0x3192dc)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x548581(0x210)]='agent:push';[a4_0x548581(0x187)]=a4_0x548581(0x1dd);async['execute'](_0x4870e0){const _0x295e53=a4_0x548581,{options:_0x5a50b1,args:_0x167776,tdx:_0x55f3c1}=_0x4870e0;let _0x33412b=_0x167776[0x0]||process[_0x295e53(0x214)]();const _0x1da88d=_0x5a50b1['dryRun'],_0x33fa42=_0x5a50b1['force'],_0x598892=_0x5a50b1['yes'],_0x1fd251=_0x5a50b1[_0x295e53(0x18e)],_0x31e7c1=a4_0x2853a9['join'](_0x33412b,'agent.yml'),_0x27abdd=existsSync(_0x31e7c1);if(_0x27abdd){const {data:_0x9f7f9b}=await withSpinner(_0x295e53(0x1e9)+_0x33412b+_0x295e53(0x1fd),()=>_0x55f3c1[_0x295e53(0x1e0)][_0x295e53(0x1f4)](_0x33412b,{'dryRun':_0x1da88d,'force':_0x33fa42}));if(_0x1da88d)return console[_0x295e53(0x199)](a4_0x2eb76c['yellow'](_0x295e53(0x1c6))),console[_0x295e53(0x199)](_0x295e53(0x17f)+_0x9f7f9b[_0x295e53(0x1aa)]),0x0;if(_0x9f7f9b['action']===_0x295e53(0x1f0))return console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x179)](_0x295e53(0x212)+_0x9f7f9b[_0x295e53(0x1f0)])),0x1;console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x1e5)](_0x295e53(0x163)+_0x9f7f9b[_0x295e53(0x169)]+'\x20successfully')),console[_0x295e53(0x199)]('Agent:\x20'+_0x9f7f9b[_0x295e53(0x1aa)]);if(_0x9f7f9b[_0x295e53(0x1b9)]&&_0x9f7f9b[_0x295e53(0x160)]){const _0x52c08b=getLLMAgentChatUrl(_0x1fd251,_0x9f7f9b[_0x295e53(0x160)],_0x9f7f9b[_0x295e53(0x1b9)]);console[_0x295e53(0x199)]('Chat:\x20'+a4_0x2eb76c['cyan'](_0x52c08b));}return 0x0;}const _0x4249bb=_0x5a50b1[_0x295e53(0x1a0)],_0xbbe47e=resolveProjectFromContext(_0x33412b,_0x4249bb);if(_0xbbe47e['found'])_0x33412b=_0xbbe47e['projectDir'],_0xbbe47e[_0x295e53(0x1a9)]===_0x295e53(0x1a6)&&console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x186)](_0x295e53(0x1d5)+_0x33412b));else{let _0xc60d79=_0x295e53(0x1ff);_0xbbe47e[_0x295e53(0x1bf)]===_0x295e53(0x1fc)&&(_0xc60d79=_0xbbe47e[_0x295e53(0x16c)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0xbbe47e[_0x295e53(0x1a0)]+_0x295e53(0x1e4));throw new SDKError(ErrorCode[_0x295e53(0x1ab)],_0xbbe47e[_0x295e53(0x1bf)]===_0x295e53(0x18d)?_0xbbe47e[_0x295e53(0x16c)]:_0x295e53(0x19f)+_0x33412b,undefined,{'helpText':_0xc60d79});}const {data:_0xcfb7d3}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x55f3c1[_0x295e53(0x1e0)][_0x295e53(0x1f2)](_0x33412b,{'dryRun':!![]})),_0x46de5d=_0xcfb7d3['counts']['agents'][_0x295e53(0x188)]>0x0;if(_0x46de5d){console['log'](a4_0x2eb76c['red'](_0x295e53(0x215)));for(const _0x535657 of _0xcfb7d3[_0x295e53(0x164)]){_0x535657['action']===_0x295e53(0x1f0)&&console[_0x295e53(0x199)](a4_0x2eb76c['red']('\x20\x20Agent\x20\x22'+_0x535657['agentName']+_0x295e53(0x1bb)+_0x535657[_0x295e53(0x1f0)]));}return 0x1;}const _0x271cf7=_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x164)][_0x295e53(0x1bd)]+_0xcfb7d3['counts'][_0x295e53(0x1c0)][_0x295e53(0x1bd)]+_0xcfb7d3[_0x295e53(0x172)]['textKnowledgeBases'][_0x295e53(0x1bd)]+_0xcfb7d3['counts'][_0x295e53(0x1f6)][_0x295e53(0x1bd)]+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x195)][_0x295e53(0x1bd)]+_0xcfb7d3['counts'][_0x295e53(0x1f3)]['created']+_0xcfb7d3['counts']['experimentalArtifacts'][_0x295e53(0x1bd)]+_0xcfb7d3['counts'][_0x295e53(0x211)][_0x295e53(0x1bd)]+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1db)][_0x295e53(0x1bd)],_0x2aaf81=_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x164)]['updated']+_0xcfb7d3['counts'][_0x295e53(0x1c0)]['updated']+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x185)][_0x295e53(0x1a2)]+_0xcfb7d3[_0x295e53(0x172)]['prompts']['updated']+_0xcfb7d3[_0x295e53(0x172)]['integrations'][_0x295e53(0x1a2)]+_0xcfb7d3['counts'][_0x295e53(0x1f3)]['updated']+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1c1)][_0x295e53(0x1a2)]+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x211)]['updated']+_0xcfb7d3['counts']['chatInterfaces'][_0x295e53(0x1a2)],_0x5d4268=_0xcfb7d3['counts'][_0x295e53(0x164)]['unchanged']+_0xcfb7d3['counts'][_0x295e53(0x1c0)][_0x295e53(0x189)]+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x185)][_0x295e53(0x189)]+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1f6)][_0x295e53(0x189)]+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x195)]['unchanged']+_0xcfb7d3[_0x295e53(0x172)]['experimentalKnowledgeBases'][_0x295e53(0x189)]+_0xcfb7d3[_0x295e53(0x172)]['experimentalArtifacts'][_0x295e53(0x189)]+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x211)]['unchanged']+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1db)][_0x295e53(0x189)];console['log'](_0x295e53(0x175)+_0xcfb7d3[_0x295e53(0x19e)]+'\x27:'),console[_0x295e53(0x199)]('\x20\x20'+a4_0x2eb76c[_0x295e53(0x1e5)]('+\x20'+_0x271cf7+'\x20new')+_0x295e53(0x17e)+a4_0x2eb76c[_0x295e53(0x1d8)]('~\x20'+_0x2aaf81+_0x295e53(0x162))+_0x295e53(0x17e)+a4_0x2eb76c[_0x295e53(0x186)]('=\x20'+_0x5d4268+_0x295e53(0x1cb))),console[_0x295e53(0x199)](_0x295e53(0x166)+formatCountSummary(_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x164)])),console[_0x295e53(0x199)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1c0)])),console[_0x295e53(0x199)](_0x295e53(0x201)+formatCountSummary(_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x185)])),console[_0x295e53(0x199)](_0x295e53(0x192)+formatCountSummary(_0xcfb7d3['counts'][_0x295e53(0x1f6)])),console['log'](_0x295e53(0x176)+formatCountSummary(_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x195)])),console[_0x295e53(0x199)](_0x295e53(0x182)+formatCountSummary(_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x211)])),console[_0x295e53(0x199)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0xcfb7d3['counts'][_0x295e53(0x1db)]));const _0x498de6=_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1f3)][_0x295e53(0x1bd)]>0x0||_0xcfb7d3[_0x295e53(0x172)]['experimentalKnowledgeBases']['updated']>0x0||_0xcfb7d3['counts'][_0x295e53(0x1f3)][_0x295e53(0x189)]>0x0||_0xcfb7d3['counts'][_0x295e53(0x1c1)][_0x295e53(0x1bd)]>0x0||_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1c1)][_0x295e53(0x1a2)]>0x0||_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1c1)]['unchanged']>0x0;_0x498de6&&(console[_0x295e53(0x199)](_0x295e53(0x19d)+formatCountSummary(_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1f3)])),console[_0x295e53(0x199)](_0x295e53(0x1f8)+formatCountSummary(_0xcfb7d3[_0x295e53(0x172)]['experimentalArtifacts'])));console[_0x295e53(0x199)](_0x295e53(0x1e2)+a4_0x2eb76c['cyan'](_0x33412b)),displayDiffs(_0xcfb7d3[_0x295e53(0x164)],_0xcfb7d3[_0x295e53(0x1c0)],_0xcfb7d3[_0x295e53(0x185)],_0xcfb7d3[_0x295e53(0x1f6)],_0xcfb7d3[_0x295e53(0x195)],_0xcfb7d3[_0x295e53(0x1f3)],_0xcfb7d3['experimentalArtifacts'],_0xcfb7d3[_0x295e53(0x211)],_0xcfb7d3[_0x295e53(0x1db)]);if(_0x1da88d)return console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x1d8)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x271cf7===0x0&&_0x2aaf81===0x0){console['log'](a4_0x2eb76c[_0x295e53(0x1e5)](_0x295e53(0x16f)));const _0x5b98b3=getLLMProjectUrl(_0x1fd251,_0xcfb7d3[_0x295e53(0x160)]);return console[_0x295e53(0x199)](_0x295e53(0x1de)+a4_0x2eb76c[_0x295e53(0x19a)](_0x5b98b3)),0x0;}if(!_0x598892&&!_0x33fa42){if(!isInteractive())return console['error'](a4_0x2eb76c[_0x295e53(0x179)](_0x295e53(0x170)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x295e53(0x1f0)](a4_0x2eb76c['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x46b959=await confirmKey(_0x295e53(0x196)+(_0x271cf7+_0x2aaf81)+_0x295e53(0x178));if(!_0x46b959)return console[_0x295e53(0x199)](a4_0x2eb76c['yellow'](_0x295e53(0x16a)),_0x295e53(0x1f1)),0x1;}const {data:_0x4b3528}=await withSpinner(_0x295e53(0x20b),()=>_0x55f3c1[_0x295e53(0x1e0)][_0x295e53(0x1f2)](_0x33412b,{'force':_0x33fa42})),_0x505d49=_0x4b3528[_0x295e53(0x172)][_0x295e53(0x164)]['errors']>0x0||_0x4b3528[_0x295e53(0x172)][_0x295e53(0x1c0)][_0x295e53(0x188)]>0x0||_0x4b3528[_0x295e53(0x172)]['textKnowledgeBases'][_0x295e53(0x188)]>0x0||_0x4b3528[_0x295e53(0x172)]['prompts']['errors']>0x0||_0x4b3528[_0x295e53(0x172)][_0x295e53(0x211)][_0x295e53(0x188)]>0x0||_0x4b3528[_0x295e53(0x172)][_0x295e53(0x1db)][_0x295e53(0x188)]>0x0;if(_0x505d49){console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x1d8)](_0x295e53(0x1af))),console[_0x295e53(0x199)](),console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x179)](_0x295e53(0x1ca)));for(const _0x13e171 of _0x4b3528[_0x295e53(0x164)]){_0x13e171['action']===_0x295e53(0x1f0)&&console[_0x295e53(0x199)](a4_0x2eb76c['red'](_0x295e53(0x1c5)+_0x13e171[_0x295e53(0x1aa)]+_0x295e53(0x1bb)+_0x13e171['error']));}for(const _0x14ef0c of _0x4b3528[_0x295e53(0x1c0)]){_0x14ef0c[_0x295e53(0x169)]===_0x295e53(0x1f0)&&console['log'](a4_0x2eb76c['red'](_0x295e53(0x209)+_0x14ef0c[_0x295e53(0x210)]+'\x22:\x20'+_0x14ef0c[_0x295e53(0x1f0)]));}for(const _0x34b265 of _0x4b3528[_0x295e53(0x185)]){_0x34b265['action']===_0x295e53(0x1f0)&&console['log'](a4_0x2eb76c[_0x295e53(0x179)](_0x295e53(0x1be)+_0x34b265[_0x295e53(0x210)]+_0x295e53(0x1bb)+_0x34b265[_0x295e53(0x1f0)]));}for(const _0x5af133 of _0x4b3528[_0x295e53(0x1f6)]){_0x5af133[_0x295e53(0x169)]==='error'&&console['log'](a4_0x2eb76c['red'](_0x295e53(0x20e)+_0x5af133['name']+_0x295e53(0x1bb)+_0x5af133[_0x295e53(0x1f0)]));}for(const _0xf86436 of _0x4b3528[_0x295e53(0x195)]){_0xf86436[_0x295e53(0x169)]===_0x295e53(0x1f0)&&console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x179)]('\x20\x20Integration\x20\x22'+_0xf86436[_0x295e53(0x210)]+_0x295e53(0x1bb)+_0xf86436[_0x295e53(0x1f0)]));}for(const _0x3eae41 of _0x4b3528['formInterfaces']){_0x3eae41[_0x295e53(0x169)]===_0x295e53(0x1f0)&&console['log'](a4_0x2eb76c['red']('\x20\x20Form\x20Interface\x20\x22'+_0x3eae41[_0x295e53(0x210)]+_0x295e53(0x1bb)+_0x3eae41[_0x295e53(0x1f0)]));}for(const _0x58441d of _0x4b3528[_0x295e53(0x1db)]){_0x58441d['action']==='error'&&console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x179)](_0x295e53(0x1c3)+_0x58441d[_0x295e53(0x210)]+_0x295e53(0x1bb)+_0x58441d[_0x295e53(0x1f0)]));}return 0x1;}console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x1e5)](_0x295e53(0x183)+(_0x271cf7+_0x2aaf81)+_0x295e53(0x1c8)+_0x4b3528['projectName']+'\x27'));const _0x3505ba=getLLMProjectUrl(_0x1fd251,_0x4b3528[_0x295e53(0x160)]);return console[_0x295e53(0x199)](_0x295e53(0x1de)+a4_0x2eb76c[_0x295e53(0x19a)](_0x3505ba)),0x0;}}
1
+ const a4_0x289cb1=a4_0x5099;(function(_0x37afe4,_0x355221){const _0x1a5ad0=a4_0x5099,_0x3631e7=_0x37afe4();while(!![]){try{const _0x2b002e=-parseInt(_0x1a5ad0(0x1c7))/0x1+parseInt(_0x1a5ad0(0x231))/0x2*(-parseInt(_0x1a5ad0(0x20f))/0x3)+-parseInt(_0x1a5ad0(0x205))/0x4+parseInt(_0x1a5ad0(0x1db))/0x5+parseInt(_0x1a5ad0(0x1fa))/0x6+-parseInt(_0x1a5ad0(0x1ff))/0x7*(parseInt(_0x1a5ad0(0x25d))/0x8)+parseInt(_0x1a5ad0(0x24a))/0x9*(parseInt(_0x1a5ad0(0x21b))/0xa);if(_0x2b002e===_0x355221)break;else _0x3631e7['push'](_0x3631e7['shift']());}catch(_0x5c4d17){_0x3631e7['push'](_0x3631e7['shift']());}}}(a4_0x3e2e,0x3c8cf));import a4_0x4f196d from'chalk';import a4_0x296591 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';function a4_0x5099(_0x364e12,_0x44edb5){_0x364e12=_0x364e12-0x1bd;const _0x3e2e8e=a4_0x3e2e();let _0x50995a=_0x3e2e8e[_0x364e12];return _0x50995a;}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function a4_0x3e2e(){const _0x102eff=['14fbQzod','<new-name>','red','agentId','\x22\x20to\x20\x22','output','29616XLGlny','counts','cyan','\x20\x20Integrations:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20successfully','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','chatInterfaces','agents','384189cwkZMV','llm','agent','\x20|\x20','experimentalArtifacts','\x20created','cwd','\x20unchanged','Using\x20project:\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','action','Output:\x20','20sSNTzf','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','session','error','\x0a✔\x20Pushed\x20','cloneProject','parse','Dry\x20run\x20-\x20no\x20changes\x20made','description','\x22\x20from\x20project\x20\x22','newProjectId','source','force','experimentalKnowledgeBases','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','agent:clone','\x20\x20Form\x20Interfaces:\x20','newProjectName','\x0aWrite\x20','agentName','pullProject','2KNcQTv','\x20\x20tdx\x20agent\x20pull\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','updated','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','Would\x20pull\x20agent:\x20','Using\x20context\x20project:\x20','\x20=\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Form\x20Interface\x20\x22','\x0aProject\x20pushed\x20with\x20errors','Agent:\x20','no_context','Using\x20current\x20project:\x20','\x20\x20Chat\x20Interfaces:\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','name','\x20\x20Agent\x20\x22','MISSING_ARGUMENT','\x20\x20Prompt\x20\x22','pullAgent','Analyzing\x20changes\x20to\x20push...','profile','1994427agAbKZ','outputPath','outputDir','log','\x22:\x20','dirname','\x20\x20Experimental\x20Artifact\x20\x22','Using\x20local\x20project:\x20','projectId','Agent\x20pulled\x20successfully','yes','\x20updated','green','\x20changed','found','\x22...','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','agent:pull','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','1454848VURFOO','yellow','Chat:\x20','dim','Using\x20project\x20from\x20context:\x20','arg-dir','\x0aErrors\x20found:','✔\x20Context\x20set:\x20','New\x20project\x20name\x20is\x20required','context','Pushing\x20agent\x20from\x20\x22','\x20\x20Integration\x20\x22','knowledgeBases','Failed\x20to\x20push\x20agent:\x20','integrations','prompts','Cancelled','\x0aError:','projectName','Summary:','\x20\x20Target:\x20','Project:\x20','\x0aChanges\x20to\x20agent\x20\x27','sourceProjectName','Clone\x20\x22','\x0a✔\x20Pulled\x20','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','agent.yml','\x0aPull\x20summary\x20for\x20\x27','\x20files\x20to\x20','push','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x20\x20Source:\x20','Pushing\x20to\x20project...','diff','message','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','tdx.json','utf-8','Cloning\x20\x22','projectDir','192084mBlyyD','\x20\x20Prompts:\x20','total','pushProject','\x20new','new','Status:\x20','\x20\x20Knowledge\x20Bases:\x20','Using\x20project\x20from\x20','dryRun','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20--name\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x0aPush\x20summary\x20for\x20\x27','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','New\x20project\x20ID:\x20','\x0aChanges\x20to\x20form\x20interface\x20\x27','cwd-config','\x20\x20Experimental\x20Artifacts:\x20','Pulling\x20agent\x20\x22','115065LgwVCO','join','Writing\x20files...','Source:\x20','\x20resources?','\x20\x20tdx\x20agent\x20clone\x20agents/','formInterfaces','\x20\x20Chat\x20Interface\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','unchanged','no_local_folder','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','gray','New\x20project:\x20','\x0aChanges:','repeat','llmProject','reason','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20\x20Agents:\x20','textKnowledgeBases','Errors:','pushAgent','execute','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','created','site','Analyzing\x20project\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','No\x20tdx.json\x20found\x20in\x20','errors','2838354xfYnGd','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','llm_project','INVALID_ARGUMENT','\x20\x20Knowledge\x20Base\x20\x22'];a4_0x3e2e=function(){return _0x102eff;};return a4_0x3e2e();}function formatCountSummary(_0x2b2819){const _0x35ce74=a4_0x5099,_0x38e6b2=[];if(_0x2b2819[_0x35ce74(0x1c9)]!==undefined)_0x38e6b2['push'](_0x2b2819[_0x35ce74(0x1c9)]+'\x20total');if(_0x2b2819['new']!==undefined&&_0x2b2819[_0x35ce74(0x1cc)]>0x0)_0x38e6b2[_0x35ce74(0x27e)](a4_0x4f196d[_0x35ce74(0x256)](_0x2b2819[_0x35ce74(0x1cc)]+_0x35ce74(0x1cb)));if(_0x2b2819['created']!==undefined&&_0x2b2819[_0x35ce74(0x1f4)]>0x0)_0x38e6b2[_0x35ce74(0x27e)](a4_0x4f196d[_0x35ce74(0x256)](_0x2b2819[_0x35ce74(0x1f4)]+_0x35ce74(0x214)));if(_0x2b2819[_0x35ce74(0x234)]!==undefined&&_0x2b2819[_0x35ce74(0x234)]>0x0)_0x38e6b2[_0x35ce74(0x27e)](a4_0x4f196d['yellow'](_0x2b2819['updated']+_0x35ce74(0x255)));if(_0x2b2819[_0x35ce74(0x1e4)]!==undefined&&_0x2b2819[_0x35ce74(0x1e4)]>0x0)_0x38e6b2[_0x35ce74(0x27e)](a4_0x4f196d[_0x35ce74(0x1e7)](_0x2b2819['unchanged']+_0x35ce74(0x216)));if(_0x2b2819[_0x35ce74(0x1f9)]!==undefined&&_0x2b2819[_0x35ce74(0x1f9)]>0x0)_0x38e6b2[_0x35ce74(0x27e)](a4_0x4f196d[_0x35ce74(0x201)](_0x2b2819['errors']+'\x20errors'));return _0x38e6b2[_0x35ce74(0x1dc)](',\x20');}function displayDiffs(_0x1ae202,_0x2f3b67,_0x279d59,_0x3ce258,_0x1298eb,_0xe51635,_0x316e6c,_0x100f2c,_0x1ba5bc){const _0x3f5ebb=a4_0x5099;for(const _0x31e053 of _0x1ae202){if(_0x31e053[_0x3f5ebb(0x1c0)]){const _0x5028c3=_0x31e053[_0x3f5ebb(0x22f)]||_0x31e053[_0x3f5ebb(0x243)];console[_0x3f5ebb(0x24d)](_0x3f5ebb(0x273)+_0x5028c3+'\x27:'),console[_0x3f5ebb(0x24d)]('─'[_0x3f5ebb(0x1ea)](0x3c)),console[_0x3f5ebb(0x24d)](_0x31e053[_0x3f5ebb(0x1c0)]),console[_0x3f5ebb(0x24d)]('─'[_0x3f5ebb(0x1ea)](0x3c));}}for(const _0x463a51 of _0x2f3b67){_0x463a51[_0x3f5ebb(0x1c0)]&&(console[_0x3f5ebb(0x24d)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x463a51[_0x3f5ebb(0x243)]+'\x27:'),console[_0x3f5ebb(0x24d)]('─'['repeat'](0x3c)),console[_0x3f5ebb(0x24d)](_0x463a51[_0x3f5ebb(0x1c0)]),console[_0x3f5ebb(0x24d)]('─'[_0x3f5ebb(0x1ea)](0x3c)));}for(const _0x1ebe73 of _0x279d59){_0x1ebe73[_0x3f5ebb(0x1c0)]&&(console[_0x3f5ebb(0x24d)](_0x3f5ebb(0x1d1)+_0x1ebe73[_0x3f5ebb(0x243)]+'\x27:'),console['log']('─'[_0x3f5ebb(0x1ea)](0x3c)),console['log'](_0x1ebe73['diff']),console['log']('─'[_0x3f5ebb(0x1ea)](0x3c)));}for(const _0xf26b71 of _0x3ce258){_0xf26b71[_0x3f5ebb(0x1c0)]&&(console[_0x3f5ebb(0x24d)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0xf26b71['name']+'\x27:'),console[_0x3f5ebb(0x24d)]('─'[_0x3f5ebb(0x1ea)](0x3c)),console[_0x3f5ebb(0x24d)](_0xf26b71[_0x3f5ebb(0x1c0)]),console[_0x3f5ebb(0x24d)]('─'[_0x3f5ebb(0x1ea)](0x3c)));}for(const _0x1e947d of _0x1298eb){_0x1e947d[_0x3f5ebb(0x1c0)]&&(console[_0x3f5ebb(0x24d)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x1e947d['name']+'\x27:'),console[_0x3f5ebb(0x24d)]('─'[_0x3f5ebb(0x1ea)](0x3c)),console[_0x3f5ebb(0x24d)](_0x1e947d[_0x3f5ebb(0x1c0)]),console[_0x3f5ebb(0x24d)]('─'[_0x3f5ebb(0x1ea)](0x3c)));}for(const _0x58d9ec of _0xe51635){_0x58d9ec[_0x3f5ebb(0x1c0)]&&(console[_0x3f5ebb(0x24d)](_0x3f5ebb(0x1d3)+_0x58d9ec[_0x3f5ebb(0x243)]+'\x27:'),console[_0x3f5ebb(0x24d)]('─'[_0x3f5ebb(0x1ea)](0x3c)),console[_0x3f5ebb(0x24d)](_0x58d9ec[_0x3f5ebb(0x1c0)]),console[_0x3f5ebb(0x24d)]('─'[_0x3f5ebb(0x1ea)](0x3c)));}for(const _0xd46b78 of _0x316e6c){_0xd46b78['diff']&&(console[_0x3f5ebb(0x24d)](_0x3f5ebb(0x1ed)+_0xd46b78[_0x3f5ebb(0x243)]+'\x27:'),console[_0x3f5ebb(0x24d)]('─'[_0x3f5ebb(0x1ea)](0x3c)),console[_0x3f5ebb(0x24d)](_0xd46b78[_0x3f5ebb(0x1c0)]),console[_0x3f5ebb(0x24d)]('─'[_0x3f5ebb(0x1ea)](0x3c)));}for(const _0x42205e of _0x100f2c){_0x42205e['diff']&&(console['log'](_0x3f5ebb(0x1d7)+_0x42205e[_0x3f5ebb(0x243)]+'\x27:'),console[_0x3f5ebb(0x24d)]('─'['repeat'](0x3c)),console[_0x3f5ebb(0x24d)](_0x42205e[_0x3f5ebb(0x1c0)]),console['log']('─'[_0x3f5ebb(0x1ea)](0x3c)));}for(const _0x56efb8 of _0x1ba5bc){_0x56efb8[_0x3f5ebb(0x1c0)]&&(console['log']('\x0aChanges\x20to\x20chat\x20interface\x20\x27'+_0x56efb8['name']+'\x27:'),console[_0x3f5ebb(0x24d)]('─'[_0x3f5ebb(0x1ea)](0x3c)),console[_0x3f5ebb(0x24d)](_0x56efb8[_0x3f5ebb(0x1c0)]),console[_0x3f5ebb(0x24d)]('─'[_0x3f5ebb(0x1ea)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x289cb1(0x25b);[a4_0x289cb1(0x223)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x289cb1(0x1f2)](_0x34bf2a){const _0x5305d4=a4_0x289cb1,{options:_0x5d9788,args:_0x4de664,tdx:_0x3e929a}=_0x34bf2a,_0x5ba64e=_0x4de664[0x0],_0x2fcc95=_0x4de664[0x1],_0x2529cd=_0x5d9788[_0x5305d4(0x204)],_0x369de4=_0x5d9788['dryRun'],_0xcd48e7=_0x5d9788[_0x5305d4(0x227)],_0xe8d481=_0x5d9788[_0x5305d4(0x254)],_0x40fd43=_0x5d9788[_0x5305d4(0x1eb)],_0x1f6bf7=_0x5d9788[_0x5305d4(0x211)];let _0x13df4e;if(_0x5ba64e){const _0x832a4b=a4_0x296591[_0x5305d4(0x1dc)](_0x5ba64e,_0x5305d4(0x1c3));if(existsSync(_0x832a4b))try{const _0x1ba09b=JSON['parse'](readFileSync(_0x832a4b,_0x5305d4(0x1c4)));_0x1ba09b[_0x5305d4(0x1fc)]&&(_0x13df4e={'llm_project':_0x1ba09b['llm_project']});}catch{}}const _0x1142b9=findAgentConfigPath(process[_0x5305d4(0x215)]());let _0x3b9f56;if(_0x1142b9)try{const _0x3fcd32=JSON[_0x5305d4(0x221)](readFileSync(_0x1142b9,'utf-8'));_0x3fcd32['llm_project']&&(_0x3b9f56={'llm_project':_0x3fcd32[_0x5305d4(0x1fc)]});}catch{}const _0x1588a3=resolveAgentPullArgs({'arg':_0x5ba64e,'agentNameArg':_0x2fcc95,'agentFlag':_0x1f6bf7,'contextProject':_0x40fd43,'argDirConfig':_0x13df4e,'cwdConfigPath':_0x1142b9||undefined,'cwdConfig':_0x3b9f56}),{projectNameOrId:_0x21fdaa,targetAgentName:_0x271ae9,existingOutputDir:_0x12935c,source:_0x26ac42}=_0x1588a3;if(_0x26ac42===_0x5305d4(0x262))console[_0x5305d4(0x24d)](a4_0x4f196d[_0x5305d4(0x260)](_0x5305d4(0x1cf)+a4_0x296591['join'](_0x5ba64e,_0x5305d4(0x1c3))+':\x20'+_0x21fdaa));else{if(_0x26ac42===_0x5305d4(0x1d8))console[_0x5305d4(0x24d)](a4_0x4f196d[_0x5305d4(0x260)](_0x5305d4(0x217)+_0x21fdaa));else _0x26ac42===_0x5305d4(0x266)&&console[_0x5305d4(0x24d)](a4_0x4f196d[_0x5305d4(0x260)](_0x5305d4(0x261)+_0x21fdaa));}if(!_0x21fdaa)return _0x1f6bf7?(console[_0x5305d4(0x24d)](a4_0x4f196d['yellow'](_0x5305d4(0x27a))),console[_0x5305d4(0x24d)](_0x5305d4(0x23a)),console['log'](_0x5305d4(0x20b))):(console[_0x5305d4(0x24d)](a4_0x4f196d[_0x5305d4(0x25e)](_0x5305d4(0x1bd))),console['log'](_0x5305d4(0x229)),console[_0x5305d4(0x24d)](_0x5305d4(0x233)),console[_0x5305d4(0x24d)](_0x5305d4(0x279)),console[_0x5305d4(0x24d)](_0x5305d4(0x235)),console['log'](_0x5305d4(0x1e3))),0x1;if(_0x271ae9){const {data:_0x6e78ce}=await withSpinner(_0x5305d4(0x1da)+_0x271ae9+_0x5305d4(0x224)+_0x21fdaa+_0x5305d4(0x259),()=>_0x3e929a[_0x5305d4(0x210)][_0x5305d4(0x247)](_0x21fdaa,_0x271ae9,_0x2529cd,{'dryRun':_0x369de4,'force':_0xcd48e7}));if(_0x369de4)return console['log'](a4_0x4f196d[_0x5305d4(0x25e)](_0x5305d4(0x277))),console['log'](_0x5305d4(0x236)+_0x6e78ce['agentName']),console[_0x5305d4(0x24d)]('Output\x20path:\x20'+_0x6e78ce[_0x5305d4(0x24b)]),_0x6e78ce[_0x5305d4(0x1c0)]&&(console[_0x5305d4(0x24d)](_0x5305d4(0x1e9)),console['log']('─'['repeat'](0x3c)),console[_0x5305d4(0x24d)](_0x6e78ce['diff']),console[_0x5305d4(0x24d)]('─'[_0x5305d4(0x1ea)](0x3c))),0x0;return console[_0x5305d4(0x24d)](a4_0x4f196d['green'](_0x5305d4(0x253))),console[_0x5305d4(0x24d)]('Agent:\x20'+_0x6e78ce[_0x5305d4(0x22f)]),console[_0x5305d4(0x24d)](_0x5305d4(0x21a)+_0x6e78ce['outputPath']),console[_0x5305d4(0x24d)](_0x5305d4(0x1cd)+(_0x6e78ce['isNew']?a4_0x4f196d[_0x5305d4(0x256)](_0x5305d4(0x1cc)):_0x6e78ce['hasChanges']?a4_0x4f196d[_0x5305d4(0x25e)](_0x5305d4(0x234)):a4_0x4f196d[_0x5305d4(0x1e7)](_0x5305d4(0x1e4)))),0x0;}const _0x12fd7f=_0x12935c||_0x2529cd,{data:_0x27bd67}=await withSpinner(_0x5305d4(0x1f6)+_0x21fdaa+_0x5305d4(0x259),()=>_0x3e929a[_0x5305d4(0x210)]['pullProject'](_0x21fdaa,_0x12fd7f,{'dryRun':!![]})),_0x440b9b=_0x27bd67[_0x5305d4(0x206)][_0x5305d4(0x20e)]['new']+_0x27bd67[_0x5305d4(0x206)]['knowledgeBases'][_0x5305d4(0x1cc)]+_0x27bd67[_0x5305d4(0x206)][_0x5305d4(0x1ef)]['new']+_0x27bd67[_0x5305d4(0x206)][_0x5305d4(0x26c)][_0x5305d4(0x1cc)]+_0x27bd67[_0x5305d4(0x206)][_0x5305d4(0x26b)][_0x5305d4(0x1cc)]+_0x27bd67[_0x5305d4(0x206)][_0x5305d4(0x228)][_0x5305d4(0x1cc)]+_0x27bd67[_0x5305d4(0x206)]['experimentalArtifacts'][_0x5305d4(0x1cc)]+_0x27bd67['counts'][_0x5305d4(0x1e1)][_0x5305d4(0x1cc)]+_0x27bd67['counts'][_0x5305d4(0x20d)][_0x5305d4(0x1cc)],_0x495fa8=_0x27bd67['counts'][_0x5305d4(0x20e)]['updated']+_0x27bd67[_0x5305d4(0x206)][_0x5305d4(0x269)][_0x5305d4(0x234)]+_0x27bd67[_0x5305d4(0x206)][_0x5305d4(0x1ef)][_0x5305d4(0x234)]+_0x27bd67['counts'][_0x5305d4(0x26c)][_0x5305d4(0x234)]+_0x27bd67['counts'][_0x5305d4(0x26b)][_0x5305d4(0x234)]+_0x27bd67['counts']['experimentalKnowledgeBases']['updated']+_0x27bd67['counts'][_0x5305d4(0x213)][_0x5305d4(0x234)]+_0x27bd67[_0x5305d4(0x206)]['formInterfaces']['updated']+_0x27bd67['counts'][_0x5305d4(0x20d)][_0x5305d4(0x234)],_0x4488d1=_0x27bd67['counts'][_0x5305d4(0x20e)][_0x5305d4(0x1e4)]+_0x27bd67[_0x5305d4(0x206)][_0x5305d4(0x269)]['unchanged']+_0x27bd67[_0x5305d4(0x206)][_0x5305d4(0x1ef)][_0x5305d4(0x1e4)]+_0x27bd67['counts'][_0x5305d4(0x26c)][_0x5305d4(0x1e4)]+_0x27bd67[_0x5305d4(0x206)]['integrations'][_0x5305d4(0x1e4)]+_0x27bd67[_0x5305d4(0x206)]['experimentalKnowledgeBases'][_0x5305d4(0x1e4)]+_0x27bd67[_0x5305d4(0x206)][_0x5305d4(0x213)]['unchanged']+_0x27bd67[_0x5305d4(0x206)][_0x5305d4(0x1e1)]['unchanged']+_0x27bd67[_0x5305d4(0x206)][_0x5305d4(0x20d)][_0x5305d4(0x1e4)];console[_0x5305d4(0x24d)](_0x5305d4(0x27c)+_0x27bd67[_0x5305d4(0x26f)]+'\x27:'),console[_0x5305d4(0x24d)]('\x20\x20'+a4_0x4f196d[_0x5305d4(0x256)]('+\x20'+_0x440b9b+'\x20new')+'\x20|\x20'+a4_0x4f196d[_0x5305d4(0x25e)]('~\x20'+_0x495fa8+_0x5305d4(0x257))+_0x5305d4(0x212)+a4_0x4f196d[_0x5305d4(0x260)]('=\x20'+_0x4488d1+'\x20unchanged')),console[_0x5305d4(0x24d)](_0x5305d4(0x1ee)+formatCountSummary(_0x27bd67['counts'][_0x5305d4(0x20e)])),console['log'](_0x5305d4(0x1ce)+formatCountSummary(_0x27bd67[_0x5305d4(0x206)]['knowledgeBases'])),console[_0x5305d4(0x24d)](_0x5305d4(0x242)+formatCountSummary(_0x27bd67[_0x5305d4(0x206)][_0x5305d4(0x1ef)])),console[_0x5305d4(0x24d)](_0x5305d4(0x1c8)+formatCountSummary(_0x27bd67[_0x5305d4(0x206)][_0x5305d4(0x26c)])),console[_0x5305d4(0x24d)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x27bd67[_0x5305d4(0x206)][_0x5305d4(0x26b)])),console[_0x5305d4(0x24d)](_0x5305d4(0x22c)+formatCountSummary(_0x27bd67[_0x5305d4(0x206)][_0x5305d4(0x1e1)])),console[_0x5305d4(0x24d)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x27bd67[_0x5305d4(0x206)][_0x5305d4(0x20d)]));const _0x2e456a=_0x27bd67['counts'][_0x5305d4(0x228)][_0x5305d4(0x1c9)]>0x0||_0x27bd67['counts']['experimentalArtifacts'][_0x5305d4(0x1c9)]>0x0;_0x2e456a&&(console[_0x5305d4(0x24d)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x27bd67[_0x5305d4(0x206)][_0x5305d4(0x228)])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x27bd67[_0x5305d4(0x206)][_0x5305d4(0x213)])));console[_0x5305d4(0x24d)](_0x5305d4(0x271)+a4_0x4f196d[_0x5305d4(0x207)](_0x27bd67[_0x5305d4(0x24c)])),displayDiffs(_0x27bd67[_0x5305d4(0x20e)],_0x27bd67[_0x5305d4(0x269)],_0x27bd67[_0x5305d4(0x1ef)],_0x27bd67[_0x5305d4(0x26c)],_0x27bd67[_0x5305d4(0x26b)],_0x27bd67[_0x5305d4(0x228)],_0x27bd67[_0x5305d4(0x213)],_0x27bd67['formInterfaces'],_0x27bd67[_0x5305d4(0x20d)]);if(_0x369de4)return console[_0x5305d4(0x24d)](a4_0x4f196d[_0x5305d4(0x25e)](_0x5305d4(0x22a))),0x0;if(_0x440b9b===0x0&&_0x495fa8===0x0)return console[_0x5305d4(0x24d)](a4_0x4f196d['green'](_0x5305d4(0x1f3))),saveSessionContext({'llm_project':_0x27bd67[_0x5305d4(0x26f)]},_0x5d9788['session']),console[_0x5305d4(0x24d)](a4_0x4f196d[_0x5305d4(0x256)](_0x5305d4(0x264)+a4_0x4f196d['dim']('llm_project')+_0x5305d4(0x238)+a4_0x4f196d[_0x5305d4(0x207)](_0x27bd67[_0x5305d4(0x26f)]))),0x0;if(!_0xe8d481&&!_0xcd48e7){if(!isInteractive())return console[_0x5305d4(0x21e)](a4_0x4f196d['red'](_0x5305d4(0x26e)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5305d4(0x21e)](a4_0x4f196d[_0x5305d4(0x260)](_0x5305d4(0x25c))),0x1;const _0x5645ae=await confirmKey(_0x5305d4(0x22e)+(_0x440b9b+_0x495fa8)+'\x20files?');if(!_0x5645ae)return console[_0x5305d4(0x24d)](a4_0x4f196d[_0x5305d4(0x25e)](_0x5305d4(0x26d)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x3360b7}=await withSpinner(_0x5305d4(0x1dd),()=>_0x3e929a['llm'][_0x5305d4(0x230)](_0x21fdaa,_0x12fd7f,{'force':_0xcd48e7}));return console[_0x5305d4(0x24d)](a4_0x4f196d[_0x5305d4(0x256)](_0x5305d4(0x276)+(_0x440b9b+_0x495fa8)+_0x5305d4(0x27d)+_0x3360b7[_0x5305d4(0x24c)])),saveSessionContext({'llm_project':_0x3360b7[_0x5305d4(0x26f)]},_0x5d9788[_0x5305d4(0x21d)]),console[_0x5305d4(0x24d)](a4_0x4f196d[_0x5305d4(0x256)](_0x5305d4(0x264)+a4_0x4f196d[_0x5305d4(0x260)](_0x5305d4(0x1fc))+_0x5305d4(0x238)+a4_0x4f196d[_0x5305d4(0x207)](_0x3360b7[_0x5305d4(0x26f)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x289cb1(0x243)]=a4_0x289cb1(0x22b);[a4_0x289cb1(0x223)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async['execute'](_0x238043){const _0x5d7982=a4_0x289cb1,{options:_0x2e0e07,args:_0x35eae1,tdx:_0x1479b3}=_0x238043,_0x165200=_0x35eae1[0x0],_0x177c48=_0x2e0e07[_0x5d7982(0x243)],_0x1d49bf=_0x2e0e07[_0x5d7982(0x1d0)],_0x1070d1=_0x2e0e07[_0x5d7982(0x254)],_0x5233f5=_0x2e0e07[_0x5d7982(0x1f5)],_0x387b23=_0x2e0e07[_0x5d7982(0x1eb)];let _0x28e991;const _0x3a1179=findAgentConfigPath(process[_0x5d7982(0x215)]());if(_0x165200){const _0x446456=a4_0x296591['join'](_0x165200,_0x5d7982(0x1c3));existsSync(_0x446456)?(_0x28e991=_0x165200,console['log'](a4_0x4f196d['dim'](_0x5d7982(0x251)+_0x165200))):_0x28e991=_0x165200;}else{if(_0x3a1179)_0x28e991=a4_0x296591[_0x5d7982(0x24f)](_0x3a1179),console[_0x5d7982(0x24d)](a4_0x4f196d[_0x5d7982(0x260)](_0x5d7982(0x23f)+_0x28e991));else{if(_0x387b23){const _0x5ad24e=sanitizeForFilesystem(_0x387b23);let _0x3926fd=_0x5ad24e,_0x4c3f77=a4_0x296591[_0x5d7982(0x1dc)](process[_0x5d7982(0x215)](),_0x5d7982(0x20e),_0x5ad24e,_0x5d7982(0x1c3));if(!existsSync(_0x4c3f77)){const _0x17c0fa=normalizeName(_0x387b23),_0x2f4c80=a4_0x296591['join'](process[_0x5d7982(0x215)](),_0x5d7982(0x20e),_0x17c0fa,_0x5d7982(0x1c3));existsSync(_0x2f4c80)&&(_0x3926fd=_0x17c0fa,_0x4c3f77=_0x2f4c80);}if(existsSync(_0x4c3f77))_0x28e991=a4_0x296591[_0x5d7982(0x24f)](_0x4c3f77),console['log'](a4_0x4f196d[_0x5d7982(0x260)](_0x5d7982(0x251)+_0x28e991));else{const _0x3aad88=_0x2e0e07[_0x5d7982(0x249)];if(_0x3aad88)throw new SDKError(ErrorCode[_0x5d7982(0x1fd)],_0x5d7982(0x241)+_0x387b23+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x5d7982(0x1c2)+_0x5d7982(0x1fb)+(_0x5d7982(0x232)+_0x387b23+'\x0a')+(_0x5d7982(0x1e0)+_0x3926fd+_0x5d7982(0x1d2)+(_0x177c48||_0x5d7982(0x200))+'\x20--profile\x20'+_0x3aad88)});_0x28e991=_0x387b23,console[_0x5d7982(0x24d)](a4_0x4f196d[_0x5d7982(0x260)](_0x5d7982(0x237)+_0x387b23));}}}}if(!_0x28e991)return console['log'](a4_0x4f196d[_0x5d7982(0x25e)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x5d7982(0x24d)](_0x5d7982(0x1f7)),console[_0x5d7982(0x24d)](_0x5d7982(0x1e6)),console[_0x5d7982(0x24d)](_0x5d7982(0x25a)),console[_0x5d7982(0x24d)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x177c48)throw new SDKError(ErrorCode[_0x5d7982(0x245)],_0x5d7982(0x265),undefined,{'helpText':_0x5d7982(0x209)});if(!_0x1070d1&&!_0x1d49bf){if(!isInteractive())return console['error'](a4_0x4f196d[_0x5d7982(0x201)](_0x5d7982(0x26e)),_0x5d7982(0x21c)),console[_0x5d7982(0x21e)](a4_0x4f196d[_0x5d7982(0x260)](_0x5d7982(0x25c))),0x1;const _0x33fa8f=await confirmKey(_0x5d7982(0x275)+_0x28e991+'\x22\x20to\x20new\x20project\x20\x22'+_0x177c48+'\x22?');if(!_0x33fa8f)return console[_0x5d7982(0x24d)](a4_0x4f196d[_0x5d7982(0x25e)](_0x5d7982(0x26d))),0x1;}const {data:_0x3be343}=await withSpinner(_0x5d7982(0x1c5)+_0x28e991+_0x5d7982(0x203)+_0x177c48+_0x5d7982(0x259),()=>_0x1479b3['llm'][_0x5d7982(0x220)](_0x28e991,_0x177c48,{'dryRun':_0x1d49bf}));if(_0x1d49bf){console[_0x5d7982(0x24d)](a4_0x4f196d[_0x5d7982(0x25e)](_0x5d7982(0x222))),console[_0x5d7982(0x24d)](_0x5d7982(0x1de)+_0x3be343[_0x5d7982(0x274)]),console[_0x5d7982(0x24d)](_0x5d7982(0x1e8)+_0x177c48),console[_0x5d7982(0x24d)]('Would\x20clone:'),console[_0x5d7982(0x24d)](_0x5d7982(0x1ee)+_0x3be343['counts'][_0x5d7982(0x20e)][_0x5d7982(0x1f4)]),console[_0x5d7982(0x24d)](_0x5d7982(0x1ce)+_0x3be343[_0x5d7982(0x206)][_0x5d7982(0x269)]['created']),console[_0x5d7982(0x24d)](_0x5d7982(0x1c8)+_0x3be343['counts'][_0x5d7982(0x26c)]['created']),console[_0x5d7982(0x24d)](_0x5d7982(0x22c)+_0x3be343[_0x5d7982(0x206)][_0x5d7982(0x1e1)][_0x5d7982(0x1f4)]),console[_0x5d7982(0x24d)](_0x5d7982(0x240)+_0x3be343['counts']['chatInterfaces'][_0x5d7982(0x1f4)]);const _0xf32060=_0x3be343['counts'][_0x5d7982(0x228)]['created']>0x0||_0x3be343[_0x5d7982(0x206)]['experimentalArtifacts']['created']>0x0;return _0xf32060&&(console[_0x5d7982(0x24d)](_0x5d7982(0x218)+_0x3be343['counts'][_0x5d7982(0x228)][_0x5d7982(0x1f4)]),console[_0x5d7982(0x24d)](_0x5d7982(0x1d9)+_0x3be343['counts'][_0x5d7982(0x213)][_0x5d7982(0x1f4)])),0x0;}const _0xae6fcf=_0x3be343[_0x5d7982(0x206)][_0x5d7982(0x20e)][_0x5d7982(0x1f9)]>0x0||_0x3be343[_0x5d7982(0x206)]['knowledgeBases'][_0x5d7982(0x1f9)]>0x0||_0x3be343[_0x5d7982(0x206)]['prompts']['errors']>0x0||_0x3be343['counts']['formInterfaces'][_0x5d7982(0x1f9)]>0x0||_0x3be343[_0x5d7982(0x206)][_0x5d7982(0x20d)][_0x5d7982(0x1f9)]>0x0||_0x3be343[_0x5d7982(0x206)][_0x5d7982(0x228)][_0x5d7982(0x1f9)]>0x0||_0x3be343[_0x5d7982(0x206)][_0x5d7982(0x213)][_0x5d7982(0x1f9)]>0x0;_0xae6fcf?console[_0x5d7982(0x24d)](a4_0x4f196d[_0x5d7982(0x25e)]('Project\x20cloned\x20with\x20errors')):console[_0x5d7982(0x24d)](a4_0x4f196d[_0x5d7982(0x256)]('Project\x20cloned\x20successfully'));console['log'](_0x5d7982(0x1de)+_0x3be343[_0x5d7982(0x274)]),console[_0x5d7982(0x24d)](_0x5d7982(0x1e8)+_0x3be343[_0x5d7982(0x22d)]),console[_0x5d7982(0x24d)](_0x5d7982(0x1d6)+_0x3be343[_0x5d7982(0x225)]),console[_0x5d7982(0x24d)](),console[_0x5d7982(0x24d)](_0x5d7982(0x270)),console[_0x5d7982(0x24d)](_0x5d7982(0x1ee)+formatCountSummary(_0x3be343[_0x5d7982(0x206)][_0x5d7982(0x20e)])),console[_0x5d7982(0x24d)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3be343[_0x5d7982(0x206)][_0x5d7982(0x269)])),console[_0x5d7982(0x24d)](_0x5d7982(0x1c8)+formatCountSummary(_0x3be343['counts'][_0x5d7982(0x26c)])),console[_0x5d7982(0x24d)](_0x5d7982(0x208)+formatCountSummary(_0x3be343[_0x5d7982(0x206)][_0x5d7982(0x26b)])),console[_0x5d7982(0x24d)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x3be343[_0x5d7982(0x206)][_0x5d7982(0x1e1)])),console[_0x5d7982(0x24d)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x3be343[_0x5d7982(0x206)][_0x5d7982(0x20d)]));const _0x74db02=_0x3be343['counts']['experimentalKnowledgeBases'][_0x5d7982(0x1f4)]>0x0||_0x3be343['counts']['experimentalKnowledgeBases']['updated']>0x0||_0x3be343[_0x5d7982(0x206)]['experimentalKnowledgeBases'][_0x5d7982(0x1e4)]>0x0||_0x3be343[_0x5d7982(0x206)][_0x5d7982(0x213)][_0x5d7982(0x1f4)]>0x0||_0x3be343['counts'][_0x5d7982(0x213)][_0x5d7982(0x234)]>0x0||_0x3be343[_0x5d7982(0x206)]['experimentalArtifacts']['unchanged']>0x0;_0x74db02&&(console['log'](_0x5d7982(0x218)+formatCountSummary(_0x3be343[_0x5d7982(0x206)][_0x5d7982(0x228)])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x3be343[_0x5d7982(0x206)][_0x5d7982(0x213)])));if(_0xae6fcf){console['log'](),console[_0x5d7982(0x24d)](a4_0x4f196d[_0x5d7982(0x201)](_0x5d7982(0x1f0)));for(const _0x54ab48 of _0x3be343[_0x5d7982(0x20e)]){_0x54ab48['action']==='error'&&console['log'](a4_0x4f196d['red'](_0x5d7982(0x244)+_0x54ab48[_0x5d7982(0x22f)]+'\x22:\x20'+_0x54ab48[_0x5d7982(0x21e)]));}for(const _0x428429 of _0x3be343['knowledgeBases']){_0x428429['action']===_0x5d7982(0x21e)&&console[_0x5d7982(0x24d)](a4_0x4f196d[_0x5d7982(0x201)](_0x5d7982(0x1fe)+_0x428429[_0x5d7982(0x243)]+_0x5d7982(0x24e)+_0x428429[_0x5d7982(0x21e)]));}for(const _0x1163ca of _0x3be343[_0x5d7982(0x26c)]){_0x1163ca[_0x5d7982(0x219)]===_0x5d7982(0x21e)&&console[_0x5d7982(0x24d)](a4_0x4f196d[_0x5d7982(0x201)](_0x5d7982(0x246)+_0x1163ca['name']+_0x5d7982(0x24e)+_0x1163ca[_0x5d7982(0x21e)]));}for(const _0x14b16f of _0x3be343[_0x5d7982(0x26b)]){_0x14b16f[_0x5d7982(0x219)]===_0x5d7982(0x21e)&&console[_0x5d7982(0x24d)](a4_0x4f196d['red']('\x20\x20Integration\x20\x22'+_0x14b16f[_0x5d7982(0x243)]+_0x5d7982(0x24e)+_0x14b16f[_0x5d7982(0x21e)]));}for(const _0x44480d of _0x3be343['formInterfaces']){_0x44480d['action']==='error'&&console[_0x5d7982(0x24d)](a4_0x4f196d[_0x5d7982(0x201)](_0x5d7982(0x23b)+_0x44480d[_0x5d7982(0x243)]+'\x22:\x20'+_0x44480d[_0x5d7982(0x21e)]));}for(const _0x5e1d5e of _0x3be343[_0x5d7982(0x20d)]){_0x5e1d5e[_0x5d7982(0x219)]===_0x5d7982(0x21e)&&console[_0x5d7982(0x24d)](a4_0x4f196d[_0x5d7982(0x201)](_0x5d7982(0x1e2)+_0x5e1d5e[_0x5d7982(0x243)]+'\x22:\x20'+_0x5e1d5e['error']));}for(const _0x327b27 of _0x3be343[_0x5d7982(0x228)]){_0x327b27[_0x5d7982(0x219)]===_0x5d7982(0x21e)&&console[_0x5d7982(0x24d)](a4_0x4f196d[_0x5d7982(0x201)](_0x5d7982(0x278)+_0x327b27[_0x5d7982(0x243)]+_0x5d7982(0x24e)+_0x327b27[_0x5d7982(0x21e)]));}for(const _0xa020a4 of _0x3be343[_0x5d7982(0x213)]){_0xa020a4[_0x5d7982(0x219)]===_0x5d7982(0x21e)&&console[_0x5d7982(0x24d)](a4_0x4f196d[_0x5d7982(0x201)](_0x5d7982(0x250)+_0xa020a4[_0x5d7982(0x243)]+_0x5d7982(0x24e)+_0xa020a4[_0x5d7982(0x21e)]));}return 0x1;}console[_0x5d7982(0x24d)]();const _0x377561=getLLMProjectUrl(_0x5233f5,_0x3be343['newProjectId']);return console[_0x5d7982(0x24d)](_0x5d7982(0x272)+a4_0x4f196d[_0x5d7982(0x207)](_0x377561)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x289cb1(0x243)]='agent:push';[a4_0x289cb1(0x223)]=a4_0x289cb1(0x20c);async[a4_0x289cb1(0x1f2)](_0x4a8116){const _0x5030ea=a4_0x289cb1,{options:_0x494cf7,args:_0x2517e0,tdx:_0x2ad294}=_0x4a8116;let _0x2ed38b=_0x2517e0[0x0]||process[_0x5030ea(0x215)]();const _0x1c85c1=_0x494cf7[_0x5030ea(0x1d0)],_0x326c65=_0x494cf7[_0x5030ea(0x227)],_0x104a98=_0x494cf7[_0x5030ea(0x254)],_0x33f04d=_0x494cf7[_0x5030ea(0x1f5)],_0x3c7f1a=a4_0x296591[_0x5030ea(0x1dc)](_0x2ed38b,_0x5030ea(0x27b)),_0x3c40ae=existsSync(_0x3c7f1a);if(_0x3c40ae){const {data:_0x7264a0}=await withSpinner(_0x5030ea(0x267)+_0x2ed38b+'\x22...',()=>_0x2ad294[_0x5030ea(0x210)][_0x5030ea(0x1f1)](_0x2ed38b,{'dryRun':_0x1c85c1,'force':_0x326c65}));if(_0x1c85c1)return console[_0x5030ea(0x24d)](a4_0x4f196d['yellow'](_0x5030ea(0x222))),console['log']('Would\x20push\x20agent:\x20'+_0x7264a0[_0x5030ea(0x22f)]),0x0;if(_0x7264a0[_0x5030ea(0x219)]===_0x5030ea(0x21e))return console[_0x5030ea(0x24d)](a4_0x4f196d[_0x5030ea(0x201)](_0x5030ea(0x26a)+_0x7264a0[_0x5030ea(0x21e)])),0x1;console[_0x5030ea(0x24d)](a4_0x4f196d['green']('Agent\x20'+_0x7264a0['action']+_0x5030ea(0x20a))),console[_0x5030ea(0x24d)](_0x5030ea(0x23d)+_0x7264a0[_0x5030ea(0x22f)]);if(_0x7264a0[_0x5030ea(0x202)]&&_0x7264a0['projectId']){const _0x2422ef=getLLMAgentChatUrl(_0x33f04d,_0x7264a0[_0x5030ea(0x252)],_0x7264a0[_0x5030ea(0x202)]);console[_0x5030ea(0x24d)](_0x5030ea(0x25f)+a4_0x4f196d[_0x5030ea(0x207)](_0x2422ef));}return 0x0;}const _0x2bbb7a=_0x494cf7[_0x5030ea(0x1eb)],_0x9b5623=resolveProjectFromContext(_0x2ed38b,_0x2bbb7a);if(_0x9b5623[_0x5030ea(0x258)])_0x2ed38b=_0x9b5623[_0x5030ea(0x1c6)],_0x9b5623[_0x5030ea(0x226)]===_0x5030ea(0x266)&&console[_0x5030ea(0x24d)](a4_0x4f196d['dim'](_0x5030ea(0x217)+_0x2ed38b));else{let _0x47a7ef='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x9b5623[_0x5030ea(0x1ec)]===_0x5030ea(0x1e5)&&(_0x47a7ef=_0x9b5623['message']+_0x5030ea(0x1d5)+_0x9b5623[_0x5030ea(0x1eb)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x5030ea(0x1fd)],_0x9b5623[_0x5030ea(0x1ec)]===_0x5030ea(0x23e)?_0x9b5623[_0x5030ea(0x1c1)]:_0x5030ea(0x1f8)+_0x2ed38b,undefined,{'helpText':_0x47a7ef});}const {data:_0x22bc78}=await withSpinner(_0x5030ea(0x248),()=>_0x2ad294['llm'][_0x5030ea(0x1ca)](_0x2ed38b,{'dryRun':!![]})),_0x4c5c05=_0x22bc78[_0x5030ea(0x206)][_0x5030ea(0x20e)][_0x5030ea(0x1f9)]>0x0;if(_0x4c5c05){console['log'](a4_0x4f196d[_0x5030ea(0x201)](_0x5030ea(0x263)));for(const _0x354f79 of _0x22bc78[_0x5030ea(0x20e)]){_0x354f79[_0x5030ea(0x219)]===_0x5030ea(0x21e)&&console[_0x5030ea(0x24d)](a4_0x4f196d[_0x5030ea(0x201)]('\x20\x20Agent\x20\x22'+_0x354f79[_0x5030ea(0x22f)]+_0x5030ea(0x24e)+_0x354f79[_0x5030ea(0x21e)]));}return 0x1;}const _0x354787=_0x22bc78['counts']['agents'][_0x5030ea(0x1f4)]+_0x22bc78[_0x5030ea(0x206)][_0x5030ea(0x269)][_0x5030ea(0x1f4)]+_0x22bc78[_0x5030ea(0x206)][_0x5030ea(0x1ef)][_0x5030ea(0x1f4)]+_0x22bc78[_0x5030ea(0x206)][_0x5030ea(0x26c)][_0x5030ea(0x1f4)]+_0x22bc78[_0x5030ea(0x206)][_0x5030ea(0x26b)][_0x5030ea(0x1f4)]+_0x22bc78[_0x5030ea(0x206)][_0x5030ea(0x228)]['created']+_0x22bc78[_0x5030ea(0x206)][_0x5030ea(0x213)][_0x5030ea(0x1f4)]+_0x22bc78[_0x5030ea(0x206)][_0x5030ea(0x1e1)]['created']+_0x22bc78[_0x5030ea(0x206)][_0x5030ea(0x20d)][_0x5030ea(0x1f4)],_0x5315eb=_0x22bc78[_0x5030ea(0x206)][_0x5030ea(0x20e)][_0x5030ea(0x234)]+_0x22bc78[_0x5030ea(0x206)][_0x5030ea(0x269)]['updated']+_0x22bc78[_0x5030ea(0x206)][_0x5030ea(0x1ef)][_0x5030ea(0x234)]+_0x22bc78[_0x5030ea(0x206)][_0x5030ea(0x26c)][_0x5030ea(0x234)]+_0x22bc78[_0x5030ea(0x206)]['integrations'][_0x5030ea(0x234)]+_0x22bc78[_0x5030ea(0x206)]['experimentalKnowledgeBases']['updated']+_0x22bc78[_0x5030ea(0x206)]['experimentalArtifacts']['updated']+_0x22bc78['counts'][_0x5030ea(0x1e1)][_0x5030ea(0x234)]+_0x22bc78[_0x5030ea(0x206)]['chatInterfaces']['updated'],_0x51238a=_0x22bc78[_0x5030ea(0x206)][_0x5030ea(0x20e)]['unchanged']+_0x22bc78[_0x5030ea(0x206)]['knowledgeBases'][_0x5030ea(0x1e4)]+_0x22bc78[_0x5030ea(0x206)][_0x5030ea(0x1ef)]['unchanged']+_0x22bc78[_0x5030ea(0x206)][_0x5030ea(0x26c)][_0x5030ea(0x1e4)]+_0x22bc78[_0x5030ea(0x206)]['integrations'][_0x5030ea(0x1e4)]+_0x22bc78['counts'][_0x5030ea(0x228)][_0x5030ea(0x1e4)]+_0x22bc78[_0x5030ea(0x206)]['experimentalArtifacts'][_0x5030ea(0x1e4)]+_0x22bc78[_0x5030ea(0x206)][_0x5030ea(0x1e1)][_0x5030ea(0x1e4)]+_0x22bc78[_0x5030ea(0x206)][_0x5030ea(0x20d)][_0x5030ea(0x1e4)];console['log'](_0x5030ea(0x1d4)+_0x22bc78[_0x5030ea(0x26f)]+'\x27:'),console[_0x5030ea(0x24d)]('\x20\x20'+a4_0x4f196d[_0x5030ea(0x256)]('+\x20'+_0x354787+_0x5030ea(0x1cb))+'\x20|\x20'+a4_0x4f196d[_0x5030ea(0x25e)]('~\x20'+_0x5315eb+_0x5030ea(0x257))+_0x5030ea(0x212)+a4_0x4f196d[_0x5030ea(0x260)]('=\x20'+_0x51238a+_0x5030ea(0x216))),console[_0x5030ea(0x24d)](_0x5030ea(0x1ee)+formatCountSummary(_0x22bc78[_0x5030ea(0x206)][_0x5030ea(0x20e)])),console[_0x5030ea(0x24d)](_0x5030ea(0x1ce)+formatCountSummary(_0x22bc78[_0x5030ea(0x206)][_0x5030ea(0x269)])),console[_0x5030ea(0x24d)](_0x5030ea(0x242)+formatCountSummary(_0x22bc78[_0x5030ea(0x206)][_0x5030ea(0x1ef)])),console[_0x5030ea(0x24d)](_0x5030ea(0x1c8)+formatCountSummary(_0x22bc78['counts'][_0x5030ea(0x26c)])),console[_0x5030ea(0x24d)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x22bc78['counts'][_0x5030ea(0x26b)])),console[_0x5030ea(0x24d)](_0x5030ea(0x22c)+formatCountSummary(_0x22bc78[_0x5030ea(0x206)]['formInterfaces'])),console[_0x5030ea(0x24d)](_0x5030ea(0x240)+formatCountSummary(_0x22bc78[_0x5030ea(0x206)]['chatInterfaces']));const _0x4bce50=_0x22bc78[_0x5030ea(0x206)][_0x5030ea(0x228)][_0x5030ea(0x1f4)]>0x0||_0x22bc78['counts'][_0x5030ea(0x228)][_0x5030ea(0x234)]>0x0||_0x22bc78['counts'][_0x5030ea(0x228)]['unchanged']>0x0||_0x22bc78[_0x5030ea(0x206)]['experimentalArtifacts']['created']>0x0||_0x22bc78[_0x5030ea(0x206)][_0x5030ea(0x213)][_0x5030ea(0x234)]>0x0||_0x22bc78[_0x5030ea(0x206)][_0x5030ea(0x213)][_0x5030ea(0x1e4)]>0x0;_0x4bce50&&(console[_0x5030ea(0x24d)](_0x5030ea(0x218)+formatCountSummary(_0x22bc78[_0x5030ea(0x206)][_0x5030ea(0x228)])),console['log'](_0x5030ea(0x1d9)+formatCountSummary(_0x22bc78['counts'][_0x5030ea(0x213)])));console[_0x5030ea(0x24d)](_0x5030ea(0x1be)+a4_0x4f196d[_0x5030ea(0x207)](_0x2ed38b)),displayDiffs(_0x22bc78[_0x5030ea(0x20e)],_0x22bc78['knowledgeBases'],_0x22bc78[_0x5030ea(0x1ef)],_0x22bc78[_0x5030ea(0x26c)],_0x22bc78[_0x5030ea(0x26b)],_0x22bc78[_0x5030ea(0x228)],_0x22bc78['experimentalArtifacts'],_0x22bc78['formInterfaces'],_0x22bc78[_0x5030ea(0x20d)]);if(_0x1c85c1)return console['log'](a4_0x4f196d[_0x5030ea(0x25e)](_0x5030ea(0x239))),0x0;if(_0x354787===0x0&&_0x5315eb===0x0){console['log'](a4_0x4f196d[_0x5030ea(0x256)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x470023=getLLMProjectUrl(_0x33f04d,_0x22bc78[_0x5030ea(0x252)]);return console[_0x5030ea(0x24d)]('Project:\x20'+a4_0x4f196d[_0x5030ea(0x207)](_0x470023)),0x0;}if(!_0x104a98&&!_0x326c65){if(!isInteractive())return console['error'](a4_0x4f196d['red'](_0x5030ea(0x26e)),_0x5030ea(0x21c)),console['error'](a4_0x4f196d[_0x5030ea(0x260)](_0x5030ea(0x25c))),0x1;const _0x566b33=await confirmKey('\x0aPush\x20'+(_0x354787+_0x5315eb)+_0x5030ea(0x1df));if(!_0x566b33)return console[_0x5030ea(0x24d)](a4_0x4f196d[_0x5030ea(0x25e)]('Cancelled'),'-\x20nothing\x20pushed'),0x1;}const {data:_0x58da4d}=await withSpinner(_0x5030ea(0x1bf),()=>_0x2ad294[_0x5030ea(0x210)][_0x5030ea(0x1ca)](_0x2ed38b,{'force':_0x326c65})),_0x4868af=_0x58da4d['counts'][_0x5030ea(0x20e)][_0x5030ea(0x1f9)]>0x0||_0x58da4d[_0x5030ea(0x206)][_0x5030ea(0x269)][_0x5030ea(0x1f9)]>0x0||_0x58da4d['counts']['textKnowledgeBases'][_0x5030ea(0x1f9)]>0x0||_0x58da4d[_0x5030ea(0x206)][_0x5030ea(0x26c)][_0x5030ea(0x1f9)]>0x0||_0x58da4d['counts']['formInterfaces']['errors']>0x0||_0x58da4d[_0x5030ea(0x206)][_0x5030ea(0x20d)][_0x5030ea(0x1f9)]>0x0;if(_0x4868af){console[_0x5030ea(0x24d)](a4_0x4f196d[_0x5030ea(0x25e)](_0x5030ea(0x23c))),console[_0x5030ea(0x24d)](),console[_0x5030ea(0x24d)](a4_0x4f196d[_0x5030ea(0x201)](_0x5030ea(0x1f0)));for(const _0x26375c of _0x58da4d[_0x5030ea(0x20e)]){_0x26375c['action']===_0x5030ea(0x21e)&&console[_0x5030ea(0x24d)](a4_0x4f196d[_0x5030ea(0x201)](_0x5030ea(0x244)+_0x26375c['agentName']+_0x5030ea(0x24e)+_0x26375c[_0x5030ea(0x21e)]));}for(const _0x38e9e4 of _0x58da4d[_0x5030ea(0x269)]){_0x38e9e4['action']===_0x5030ea(0x21e)&&console[_0x5030ea(0x24d)](a4_0x4f196d[_0x5030ea(0x201)](_0x5030ea(0x1fe)+_0x38e9e4['name']+_0x5030ea(0x24e)+_0x38e9e4['error']));}for(const _0xe3df9d of _0x58da4d[_0x5030ea(0x1ef)]){_0xe3df9d[_0x5030ea(0x219)]===_0x5030ea(0x21e)&&console[_0x5030ea(0x24d)](a4_0x4f196d[_0x5030ea(0x201)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0xe3df9d[_0x5030ea(0x243)]+_0x5030ea(0x24e)+_0xe3df9d[_0x5030ea(0x21e)]));}for(const _0x22cc82 of _0x58da4d[_0x5030ea(0x26c)]){_0x22cc82['action']===_0x5030ea(0x21e)&&console[_0x5030ea(0x24d)](a4_0x4f196d['red'](_0x5030ea(0x246)+_0x22cc82['name']+_0x5030ea(0x24e)+_0x22cc82[_0x5030ea(0x21e)]));}for(const _0x451ee8 of _0x58da4d['integrations']){_0x451ee8[_0x5030ea(0x219)]===_0x5030ea(0x21e)&&console['log'](a4_0x4f196d[_0x5030ea(0x201)](_0x5030ea(0x268)+_0x451ee8[_0x5030ea(0x243)]+'\x22:\x20'+_0x451ee8[_0x5030ea(0x21e)]));}for(const _0x425af6 of _0x58da4d[_0x5030ea(0x1e1)]){_0x425af6[_0x5030ea(0x219)]==='error'&&console[_0x5030ea(0x24d)](a4_0x4f196d['red'](_0x5030ea(0x23b)+_0x425af6[_0x5030ea(0x243)]+_0x5030ea(0x24e)+_0x425af6['error']));}for(const _0x4fdca7 of _0x58da4d[_0x5030ea(0x20d)]){_0x4fdca7[_0x5030ea(0x219)]===_0x5030ea(0x21e)&&console['log'](a4_0x4f196d['red']('\x20\x20Chat\x20Interface\x20\x22'+_0x4fdca7[_0x5030ea(0x243)]+_0x5030ea(0x24e)+_0x4fdca7[_0x5030ea(0x21e)]));}return 0x1;}console[_0x5030ea(0x24d)](a4_0x4f196d[_0x5030ea(0x256)](_0x5030ea(0x21f)+(_0x354787+_0x5315eb)+'\x20resources\x20to\x20\x27'+_0x58da4d['projectName']+'\x27'));const _0x28f00e=getLLMProjectUrl(_0x33f04d,_0x58da4d['projectId']);return console[_0x5030ea(0x24d)](_0x5030ea(0x272)+a4_0x4f196d['cyan'](_0x28f00e)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x222562=a5_0x2373;(function(_0x194b83,_0x3eb3ee){const _0x1da68e=a5_0x2373,_0x4b29fc=_0x194b83();while(!![]){try{const _0x5b6080=-parseInt(_0x1da68e(0x172))/0x1*(parseInt(_0x1da68e(0x15e))/0x2)+-parseInt(_0x1da68e(0x12b))/0x3*(parseInt(_0x1da68e(0x18a))/0x4)+parseInt(_0x1da68e(0xf4))/0x5*(parseInt(_0x1da68e(0x139))/0x6)+parseInt(_0x1da68e(0x165))/0x7*(-parseInt(_0x1da68e(0x144))/0x8)+-parseInt(_0x1da68e(0x10e))/0x9+-parseInt(_0x1da68e(0x143))/0xa*(-parseInt(_0x1da68e(0x13a))/0xb)+parseInt(_0x1da68e(0x107))/0xc;if(_0x5b6080===_0x3eb3ee)break;else _0x4b29fc['push'](_0x4b29fc['shift']());}catch(_0x516284){_0x4b29fc['push'](_0x4b29fc['shift']());}}}(a5_0x2080,0xd78ca));import*as a5_0x15b21f from'node:fs';function a5_0x2080(){const _0x11fbdd=['\x20-\x20','jsonl','New\x20tests\x20to\x20execute:\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','Running\x20test:\x20','Running:\x20','\x20\x20-\x20','site','tags','context','✗\x20FAIL:\x20','resolve','verbose','join','\x20(cached)','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','reeval','94026jNlMJI','size','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','agentName','resolveAgentId','Test\x20Configuration:','repeat','add','tsv','PASS','includes','Duration:\x20','Conversation\x20URL:\x20','114gOUVKc','11IgHcQZ','message','✗\x20ERROR:\x20Project\x20not\x20found:\x20','llmProject','\x20\x20Conversation:\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','found','/<agent-name>','source','3760810DfbDyD','325312zyNWjO','toISOString','Error:\x20No\x20previous\x20test\x20run\x20found.','writeFileSync','\x20\x20Project:\x20','executeReeval','no_tests','utf-8','red','description','status','Round\x20','rounds','agentDirs','ERROR','now','conversation_url','Usage:','isSpinning','conversations','Round\x201/','Agent:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','Executing\x20new\x20tests...','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','dim','1338094jiJsSc','name','projectDir','\x20\x20Evaluating...\x20','Project\x20path:\x20','timestamp','Re-evaluation\x20Summary','217SVqyVP','tests','Running\x20agent\x20tests...','...','some','execute','\x20\x20Site:\x20','green','stop','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','No\x20tests\x20found\x20with\x20tags:\x20','projectName','multiple_agents','1KVsinY','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','\x22:\x20','split','...\x20','Either\x20switch\x20to\x20the\x20\x22','output','Re-evaluating\x20cached\x20test\x20run...','existsSync','table','agent:test','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','FAIL','has','Failed:\x20\x20\x20','Passed:\x20\x20\x20','reason','No\x20tests\x20have\x20tags\x20defined.','Test\x20','white','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','round','Failed\x20Tests:','Errors:\x20\x20\x20','164jqaYPn','Cached\x20run\x20from:\x20','forEach','Test\x20Summary','404','378470vAlcBk','log','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Total:\x20\x20\x20\x20','trim','json','✓\x20PASS:\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','\x20\x20Agent:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','no_context','\x20\x20Round\x20','cyan','start','push','toLowerCase','text','agent','35577180exMlPf','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','yellow','Error\x20writing\x20output\x20file:\x20','Re-evaluating...','✗\x20ERROR:\x20','map','6133401cQHIWa','Available\x20tests:\x20','length','no_local_folder','Output\x20written\x20to:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','resolveProjectId',':\x20Sending\x20user\x20input...','llm','testName','filter','not\x20found'];a5_0x2080=function(){return _0x11fbdd;};return a5_0x2080();}import*as a5_0x3575f6 from'node:path';import a5_0x1bac87 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x2373(_0x456def,_0x13ce25){_0x456def=_0x456def-0xf4;const _0x208091=a5_0x2080();let _0x237381=_0x208091[_0x456def];return _0x237381;}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x222562(0x15f)]=a5_0x222562(0x17c);[a5_0x222562(0x14d)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x222562(0x16a)](_0xfc7681){const _0x191717=a5_0x222562,{options:_0x2e1904,args:_0x2282fe,tdx:_0x338079}=_0xfc7681,_0x355578=_0x2282fe[0x0]||'.',_0x182584=_0x2e1904['dryRun'],_0x7006fc=_0x2e1904,_0x2351f1=_0x7006fc['eval']===![],_0x5b96fe=_0x7006fc[_0x191717(0x12a)],_0x12500a=_0x7006fc[_0x191717(0x15f)],_0x718b03=_0x7006fc[_0x191717(0x122)],_0x53ca69=_0x2e1904[_0x191717(0x121)],_0x946f4b=_0x7006fc[_0x191717(0x178)];if(_0x5b96fe&&_0x2351f1)return console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x14c)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x2e0f27=_0x191717(0x17b);if(_0x7006fc[_0x191717(0xf9)])_0x2e0f27='json';else{if(_0x7006fc[_0x191717(0x11b)])_0x2e0f27=_0x191717(0x11b);else{if(_0x7006fc[_0x191717(0x134)])_0x2e0f27=_0x191717(0x134);else{if(_0x7006fc['table'])_0x2e0f27=_0x191717(0x17b);}}}const _0x49133c=_0x7006fc['llmProject'];let _0x10d656=_0x355578;const _0x537b07=a5_0x15b21f[_0x191717(0x17a)](_0x355578),_0x461b67=_0x355578==='.';if(!_0x537b07||_0x461b67){const _0x256792=resolveProjectFromContext(_0x355578,_0x49133c,{'requireFile':'test.yml'});if(_0x256792[_0x191717(0x140)])_0x10d656=_0x256792[_0x191717(0x160)],_0x256792[_0x191717(0x142)]===_0x191717(0x123)&&console['log'](a5_0x1bac87[_0x191717(0x15d)]('Using\x20agent:\x20'+_0x10d656));else switch(_0x256792['reason']){case _0x191717(0xff):console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x109)](_0x256792['message'])),console[_0x191717(0xf5)](),console[_0x191717(0xf5)](_0x191717(0x155)),console[_0x191717(0xf5)](_0x191717(0x173)),console[_0x191717(0xf5)](_0x191717(0x11d)),console['log'](),console['log']('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x191717(0x111):console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x109)](_0x256792['message'])),console[_0x191717(0xf5)](),console['log']('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x256792[_0x191717(0x13d)]+_0x191717(0x15a));return 0x1;case _0x191717(0x171):{const _0xd9d497=a5_0x3575f6['basename'](_0x256792[_0x191717(0x160)]);console['log'](a5_0x1bac87[_0x191717(0x109)](_0x191717(0x17d)+_0x256792[_0x191717(0x13d)]+'\x22:'));for(const _0x19ec5c of _0x256792[_0x191717(0x151)]){console[_0x191717(0xf5)](_0x191717(0x120)+_0x19ec5c);}return console['log'](),console['log'](_0x191717(0x186)+_0xd9d497+_0x191717(0x141)),0x1;}case _0x191717(0x14a):console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x109)](_0x191717(0xfe)+_0x256792[_0x191717(0x13d)]+'\x22.')),console[_0x191717(0xf5)](a5_0x1bac87['dim'](_0x191717(0x162)+_0x256792[_0x191717(0x160)])),console[_0x191717(0xf5)](),console[_0x191717(0xf5)](_0x191717(0xf6));return 0x1;}}const {definition:_0x39719e,agentInfo:_0x5c94e1}=parseTestFile(_0x10d656);let _0x5e2016=_0x39719e[_0x191717(0x166)];if(_0x12500a){const _0x4a4aec=_0x12500a[_0x191717(0x175)](',')[_0x191717(0x10d)](_0x19a918=>_0x19a918[_0x191717(0xf8)]());_0x5e2016=_0x39719e[_0x191717(0x166)]['filter'](_0x817aa5=>_0x4a4aec['includes'](_0x817aa5['name']));if(_0x5e2016[_0x191717(0x110)]===0x0)return console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x109)]('No\x20tests\x20found\x20matching:\x20'+_0x12500a)),console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x15d)](_0x191717(0x10f)+_0x39719e[_0x191717(0x166)][_0x191717(0x10d)](_0x1ddfe7=>_0x1ddfe7['name'])[_0x191717(0x127)](',\x20'))),0x1;}if(_0x718b03){const _0x5c2c6f=_0x718b03[_0x191717(0x175)](',')[_0x191717(0x10d)](_0x596a70=>_0x596a70['trim']()[_0x191717(0x104)]());_0x5e2016=_0x5e2016[_0x191717(0x118)](_0x509a01=>_0x509a01[_0x191717(0x122)]?.[_0x191717(0x169)](_0x3ba687=>_0x5c2c6f[_0x191717(0x136)](_0x3ba687[_0x191717(0x104)]())));if(_0x5e2016[_0x191717(0x110)]===0x0){console[_0x191717(0xf5)](a5_0x1bac87['yellow'](_0x191717(0x16f)+_0x718b03));const _0x2563c9=new Set();return _0x39719e['tests']['forEach'](_0x448c29=>_0x448c29[_0x191717(0x122)]?.[_0x191717(0x18c)](_0x24a1b7=>_0x2563c9[_0x191717(0x133)](_0x24a1b7))),_0x2563c9[_0x191717(0x12c)]>0x0?console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x15d)]('Available\x20tags:\x20'+[..._0x2563c9]['join'](',\x20'))):console['log'](a5_0x1bac87[_0x191717(0x15d)](_0x191717(0x183))),0x1;}}if(_0x5b96fe)return this[_0x191717(0x149)](_0xfc7681,{'definition':{'tests':_0x5e2016},'agentInfo':_0x5c94e1,'outputFormat':_0x2e0f27,'outputFile':_0x946f4b,'testNames':_0x12500a});if(_0x182584){console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x101)](_0x191717(0x131))),console[_0x191717(0xf5)](_0x191717(0x16b)+a5_0x1bac87[_0x191717(0x185)](_0x53ca69)),console['log'](_0x191717(0x148)+a5_0x1bac87[_0x191717(0x185)](_0x5c94e1[_0x191717(0x170)])),console[_0x191717(0xf5)](_0x191717(0xfc)+a5_0x1bac87[_0x191717(0x185)](_0x5c94e1['agentName'])),console[_0x191717(0xf5)](),console[_0x191717(0xf5)]('Tests\x20found:\x20'+a5_0x1bac87[_0x191717(0x185)](_0x5e2016[_0x191717(0x110)]));for(let _0x28929e=0x0;_0x28929e<_0x5e2016[_0x191717(0x110)];_0x28929e++){const _0x3adfc4=_0x5e2016[_0x28929e],_0x5f3275=_0x3adfc4[_0x191717(0x150)][_0x191717(0x110)]===0x1?_0x191717(0x187):_0x191717(0x150),_0x362072=_0x3adfc4[_0x191717(0x122)]?.[_0x191717(0x110)]?'\x20['+_0x3adfc4[_0x191717(0x122)][_0x191717(0x127)](',\x20')+']':'';console[_0x191717(0xf5)]('\x20\x20'+(_0x28929e+0x1)+'.\x20'+a5_0x1bac87[_0x191717(0x185)](_0x3adfc4[_0x191717(0x15f)])+'\x20('+_0x3adfc4['rounds'][_0x191717(0x110)]+'\x20'+_0x5f3275+')'+a5_0x1bac87[_0x191717(0x15d)](_0x362072));}return 0x0;}let _0x19a720,_0xe31e65;try{_0x19a720=await _0x338079[_0x191717(0x116)][_0x191717(0x114)](_0x5c94e1[_0x191717(0x170)]);}catch(_0x2ad4d4){const _0x3531ae=_0x2ad4d4 instanceof Error?_0x2ad4d4['message']:String(_0x2ad4d4);return _0x3531ae['includes'](_0x191717(0x18e))||_0x3531ae['toLowerCase']()['includes'](_0x191717(0x119))?console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x14c)](_0x191717(0x13c)+_0x5c94e1[_0x191717(0x170)])):console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x14c)](_0x191717(0x15c)+_0x5c94e1[_0x191717(0x170)]+_0x191717(0x174)+_0x3531ae)),0x1;}try{_0xe31e65=await _0x338079[_0x191717(0x116)][_0x191717(0x130)](_0x5c94e1[_0x191717(0x12f)],_0x19a720);}catch(_0x5e90b6){const _0x33c00b=_0x5e90b6 instanceof Error?_0x5e90b6[_0x191717(0x13b)]:String(_0x5e90b6);return _0x33c00b[_0x191717(0x136)](_0x191717(0x18e))||_0x33c00b[_0x191717(0x104)]()[_0x191717(0x136)](_0x191717(0x119))?console[_0x191717(0xf5)](a5_0x1bac87['red']('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x5c94e1[_0x191717(0x12f)])):console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x14c)](_0x191717(0x113)+_0x5c94e1['agentName']+'\x22:\x20'+_0x33c00b)),0x1;}let _0x5da48f;if(!_0x2351f1)try{_0x5da48f=await setupEvaluatorAgent(_0x338079[_0x191717(0x116)],_0x2e1904[_0x191717(0x126)]);}catch(_0x8dba4d){const _0x334039=_0x8dba4d instanceof Error?_0x8dba4d[_0x191717(0x13b)]:String(_0x8dba4d);return console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x14c)](_0x191717(0x129)+_0x334039)),0x1;}console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x101)](_0x191717(0x167))),console['log']('Site:\x20'+a5_0x1bac87[_0x191717(0x185)](_0x53ca69)),console[_0x191717(0xf5)](_0x191717(0x159)+a5_0x1bac87[_0x191717(0x185)](_0x5c94e1[_0x191717(0x170)]+'/'+_0x5c94e1['agentName'])),console[_0x191717(0xf5)]();const _0x3fbc3b=[],_0x281f5f=[],_0x3c8464=Date['now']();for(let _0x124f4e=0x0;_0x124f4e<_0x5e2016[_0x191717(0x110)];_0x124f4e++){const _0x2228e0=_0x5e2016[_0x124f4e];_0x5e2016['length']>0x1?console['log'](_0x191717(0x184)+(_0x124f4e+0x1)+'/'+_0x5e2016[_0x191717(0x110)]+':\x20'+a5_0x1bac87[_0x191717(0x185)](_0x2228e0['name'])):console[_0x191717(0xf5)](_0x191717(0x11e)+a5_0x1bac87[_0x191717(0x185)](_0x2228e0[_0x191717(0x15f)]));const _0x4b0756=createCommandSpinner(_0x191717(0x158)+_0x2228e0[_0x191717(0x150)][_0x191717(0x110)]+_0x191717(0x115));_0x4b0756[_0x191717(0x102)]();try{const {result:_0x9f945c,conversation:_0x4fc834}=await runTest(_0x338079['llm'],_0x2228e0,{'agentId':_0xe31e65,'projectId':_0x19a720,'site':_0x53ca69,'noEval':_0x2351f1,'evaluatorId':_0x5da48f,'onRoundStart':(_0x257f47,_0x341fab)=>{const _0x5720f9=_0x191717;_0x4b0756[_0x5720f9(0x105)]=_0x5720f9(0x14f)+(_0x257f47+0x1)+'/'+_0x341fab+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x568c26,_0x2a4e80,_0x36ec12)=>{const _0x83aaee=_0x191717,_0x27a11e=formatElapsed(_0x2a4e80);_0x36ec12?console[_0x83aaee(0xf5)](_0x83aaee(0x100)+(_0x568c26+0x1)+'/'+_0x2228e0['rounds'][_0x83aaee(0x110)]+_0x83aaee(0x176)+a5_0x1bac87[_0x83aaee(0x16c)]('✓')+'\x20('+_0x27a11e+')'):console[_0x83aaee(0xf5)]('\x20\x20Round\x20'+(_0x568c26+0x1)+'/'+_0x2228e0['rounds'][_0x83aaee(0x110)]+_0x83aaee(0x176)+a5_0x1bac87['red']('✗'));},'onEvaluationStart':()=>{const _0x5ad15e=_0x191717;_0x4b0756[_0x5ad15e(0x105)]='Evaluating\x20response...';},'onEvaluationComplete':_0x2806ac=>{const _0x24c1a6=_0x191717,_0xf65c18=formatElapsed(_0x2806ac);console[_0x24c1a6(0xf5)](_0x24c1a6(0x161)+a5_0x1bac87[_0x24c1a6(0x16c)]('✓')+'\x20('+_0xf65c18+')');}});_0x4b0756[_0x191717(0x16d)](),_0x3fbc3b[_0x191717(0x103)](_0x9f945c),_0x281f5f[_0x191717(0x103)](_0x4fc834);if(_0x9f945c[_0x191717(0x14e)]==='PASS')console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x16c)](_0x191717(0xfa)+_0x9f945c[_0x191717(0x182)]));else _0x9f945c[_0x191717(0x14e)]===_0x191717(0x17e)?console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x14c)](_0x191717(0x124)+_0x9f945c[_0x191717(0x182)])):console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x14c)](_0x191717(0x10c)+_0x9f945c['reason']));_0x9f945c[_0x191717(0x154)]&&console['log'](a5_0x1bac87[_0x191717(0x15d)](_0x191717(0x138)+_0x9f945c[_0x191717(0x154)])),console['log']();}catch(_0x1b7bd9){_0x4b0756[_0x191717(0x16d)]();const _0x5794e6=_0x1b7bd9 instanceof Error?_0x1b7bd9[_0x191717(0x13b)]:String(_0x1b7bd9);console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x14c)](_0x191717(0x10c)+_0x5794e6)),console[_0x191717(0xf5)](),_0x3fbc3b[_0x191717(0x103)]({'name':_0x2228e0[_0x191717(0x15f)],'status':_0x191717(0x152),'reason':_0x5794e6,'timestamp':new Date()[_0x191717(0x145)](),'duration_ms':0x0});}}const _0xfa4fa0=Date[_0x191717(0x153)]()-_0x3c8464,_0x3d9dcd=_0x3fbc3b['filter'](_0x54851b=>_0x54851b[_0x191717(0x14e)]===_0x191717(0x135))[_0x191717(0x110)],_0x4718de=_0x3fbc3b[_0x191717(0x118)](_0x127727=>_0x127727[_0x191717(0x14e)]===_0x191717(0x17e))['length'],_0x4b1b23=_0x3fbc3b[_0x191717(0x118)](_0x55e4c0=>_0x55e4c0['status']==='ERROR')['length'];console[_0x191717(0xf5)]('━'['repeat'](0x3c)),console['log'](_0x191717(0x18d)),console[_0x191717(0xf5)]('━'[_0x191717(0x132)](0x3c)),console['log'](_0x191717(0xf7)+_0x3fbc3b['length']),console[_0x191717(0xf5)]('Passed:\x20\x20\x20'+a5_0x1bac87[_0x191717(0x16c)](_0x3d9dcd)),console[_0x191717(0xf5)](_0x191717(0x180)+a5_0x1bac87[_0x191717(0x14c)](_0x4718de));_0x4b1b23>0x0&&console['log'](_0x191717(0x189)+a5_0x1bac87[_0x191717(0x14c)](_0x4b1b23));console[_0x191717(0xf5)](_0x191717(0x137)+formatElapsed(_0xfa4fa0)),console[_0x191717(0xf5)]('━'[_0x191717(0x132)](0x3c));const _0x5e23d9=_0x3fbc3b[_0x191717(0x118)](_0x402f3f=>_0x402f3f[_0x191717(0x14e)]!==_0x191717(0x135));if(_0x5e23d9[_0x191717(0x110)]>0x0){console[_0x191717(0xf5)](),console[_0x191717(0xf5)](_0x191717(0x188));for(const _0x391380 of _0x5e23d9){const _0x4f16df=a5_0x1bac87[_0x191717(0x14c)]('✗'),_0x4ed12d=_0x391380[_0x191717(0x182)][_0x191717(0x110)]>0x32?_0x391380['reason']['substring'](0x0,0x32)+_0x191717(0x168):_0x391380[_0x191717(0x182)];console['log']('\x20\x20'+_0x4f16df+'\x20'+_0x391380[_0x191717(0x15f)]+':\x20'+_0x4ed12d);}}const _0x457fd3={'summary':{'total':_0x3fbc3b[_0x191717(0x110)],'passed':_0x3d9dcd,'failed':_0x4718de,'errors':_0x4b1b23>0x0?_0x4b1b23:undefined,'duration_ms':_0xfa4fa0},'tests':_0x3fbc3b,'agent':{'project':_0x5c94e1['projectName'],'name':_0x5c94e1['agentName'],'site':_0x53ca69},'timestamp':new Date(_0x3c8464)[_0x191717(0x145)]()};try{const _0x455b34=buildCachedTestRun(_0x281f5f,{'site':_0x53ca69,'projectId':_0x19a720,'projectName':_0x5c94e1['projectName'],'agentId':_0xe31e65,'agentName':_0x5c94e1[_0x191717(0x12f)],'testYmlPath':a5_0x3575f6[_0x191717(0x125)](_0x5c94e1['testYmlPath'])});saveLastTestRun(_0x455b34);}catch{}if(_0x2e0f27!==_0x191717(0x17b)||_0x946f4b){const _0x441789=formatResults(_0x457fd3,_0x2e0f27);if(_0x946f4b)try{a5_0x15b21f[_0x191717(0x147)](_0x946f4b,_0x441789,_0x191717(0x14b)),console[_0x191717(0xf5)](),console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x15d)](_0x191717(0x112)+_0x946f4b));}catch(_0x2dedd9){return console[_0x191717(0xf5)](),console[_0x191717(0xf5)](a5_0x1bac87['red'](_0x191717(0x10a)+_0x2dedd9)),0x1;}else console['log'](),console[_0x191717(0xf5)](_0x441789);}return _0x5e23d9[_0x191717(0x110)]>0x0?0x1:0x0;}async[a5_0x222562(0x149)](_0x4d17d7,_0x159f50){const _0x430068=a5_0x222562,{options:_0x176d2b,tdx:_0x39f9f0}=_0x4d17d7,{definition:_0x1fac99,agentInfo:_0xd33f37,outputFormat:_0x13924f,outputFile:_0x4afe5b}=_0x159f50,_0x35bf15=_0x176d2b['site'],_0x460934=loadLastTestRun();if(!_0x460934)return console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x14c)](_0x430068(0x146))),console[_0x430068(0xf5)](a5_0x1bac87['dim'](_0x430068(0x16e))),0x1;if(_0x460934[_0x430068(0x106)][_0x430068(0x12f)]!==_0xd33f37[_0x430068(0x12f)])return console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x14c)](_0x430068(0x13f)+_0x460934['agent'][_0x430068(0x12f)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0xd33f37['agentName']+'\x22.')),console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x15d)](_0x430068(0x12e))),0x1;const _0x110ca1=new Set(_0x460934[_0x430068(0x157)][_0x430068(0x10d)](_0x4a14e6=>_0x4a14e6[_0x430068(0x117)])),_0x5d360a=_0x1fac99['tests']['filter'](_0x28a049=>!_0x110ca1[_0x430068(0x17f)](_0x28a049['name']));if(_0x5d360a[_0x430068(0x110)]>0x0&&_0x460934[_0x430068(0x121)]!==_0x35bf15)return console['log'](a5_0x1bac87[_0x430068(0x14c)](_0x430068(0x108))),console[_0x430068(0xf5)](a5_0x1bac87['dim'](_0x430068(0xfb)+_0x460934['site']+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x35bf15+'\x22.')),console['log'](a5_0x1bac87[_0x430068(0x15d)](_0x430068(0x177)+_0x460934[_0x430068(0x121)]+_0x430068(0x12d))),0x1;const _0x144045=_0x1fac99[_0x430068(0x166)]['filter'](_0x229fa8=>_0x110ca1[_0x430068(0x17f)](_0x229fa8[_0x430068(0x15f)])),_0x9a4d48=_0x5d360a;let _0x404b5a;try{_0x404b5a=await setupEvaluatorAgent(_0x39f9f0[_0x430068(0x116)],_0x176d2b['verbose']);}catch(_0x13311b){const _0xd4aaa=_0x13311b instanceof Error?_0x13311b[_0x430068(0x13b)]:String(_0x13311b);return console[_0x430068(0xf5)](a5_0x1bac87['red'](_0x430068(0x129)+_0xd4aaa)),0x1;}console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x101)](_0x430068(0x179))),console[_0x430068(0xf5)](_0x430068(0x18b)+a5_0x1bac87[_0x430068(0x185)](_0x460934[_0x430068(0x163)])),console['log'](_0x430068(0x159)+a5_0x1bac87[_0x430068(0x185)](_0x460934[_0x430068(0x106)][_0x430068(0x170)]+'/'+_0x460934[_0x430068(0x106)][_0x430068(0x12f)]));_0x9a4d48[_0x430068(0x110)]>0x0&&console['log'](_0x430068(0x11c)+a5_0x1bac87[_0x430068(0x109)](_0x9a4d48[_0x430068(0x110)]));console[_0x430068(0xf5)]();const _0x3c4d09=[],_0x1bf0eb=Date['now'](),_0xaf8d15=createCommandSpinner(_0x430068(0x10b));if(_0x144045[_0x430068(0x110)]>0x0)try{const _0x4d8302=await reevaluateFromCache(_0x39f9f0['llm'],_0x460934,{'tests':_0x144045},{'evaluatorId':_0x404b5a,'onTestStart':(_0xa2abc1,_0x1633cb,_0x556308)=>{const _0x1ad402=_0x430068;_0xaf8d15[_0x1ad402(0x105)]='Re-evaluating\x20'+(_0x1633cb+0x1)+'/'+_0x556308+':\x20'+_0xa2abc1+_0x1ad402(0x168);if(!_0xaf8d15[_0x1ad402(0x156)])_0xaf8d15[_0x1ad402(0x102)]();},'onTestComplete':(_0x51768a,_0x4390aa)=>{const _0x2fc65c=_0x430068;_0xaf8d15[_0x2fc65c(0x16d)]();if(_0x4390aa[_0x2fc65c(0x14e)]==='PASS')console[_0x2fc65c(0xf5)](a5_0x1bac87[_0x2fc65c(0x16c)](_0x2fc65c(0xfa)+_0x51768a)+a5_0x1bac87[_0x2fc65c(0x15d)](_0x2fc65c(0x128)));else _0x4390aa[_0x2fc65c(0x14e)]===_0x2fc65c(0x17e)?console['log'](a5_0x1bac87[_0x2fc65c(0x14c)](_0x2fc65c(0x124)+_0x51768a+_0x2fc65c(0x11a)+_0x4390aa[_0x2fc65c(0x182)])+a5_0x1bac87[_0x2fc65c(0x15d)]('\x20(cached)')):console[_0x2fc65c(0xf5)](a5_0x1bac87[_0x2fc65c(0x14c)]('✗\x20ERROR:\x20'+_0x51768a+_0x2fc65c(0x11a)+_0x4390aa['reason']));_0x4390aa[_0x2fc65c(0x154)]&&console[_0x2fc65c(0xf5)](a5_0x1bac87['dim']('\x20\x20Conversation:\x20'+_0x4390aa['conversation_url'])),_0x3c4d09[_0x2fc65c(0x103)](_0x4390aa);},'onTestSkipped':(_0x578160,_0x6b8d5e)=>{const _0x2717d7=_0x430068;_0xaf8d15[_0x2717d7(0x16d)](),console[_0x2717d7(0xf5)](a5_0x1bac87[_0x2717d7(0x109)]('⚠\x20SKIPPED:\x20'+_0x578160+'\x20-\x20'+_0x6b8d5e));}});for(const _0x3399d1 of _0x4d8302){!_0x3c4d09['find'](_0x19d8c7=>_0x19d8c7[_0x430068(0x15f)]===_0x3399d1[_0x430068(0x15f)])&&_0x3c4d09[_0x430068(0x103)](_0x3399d1);}}catch(_0x1cba77){_0xaf8d15[_0x430068(0x16d)]();const _0x2f08a0=_0x1cba77 instanceof Error?_0x1cba77[_0x430068(0x13b)]:String(_0x1cba77);return console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x14c)](_0x430068(0xfd)+_0x2f08a0)),0x1;}_0xaf8d15[_0x430068(0x16d)]();if(_0x9a4d48[_0x430068(0x110)]>0x0){console[_0x430068(0xf5)](),console['log'](a5_0x1bac87[_0x430068(0x101)](_0x430068(0x15b)));const {projectId:_0x8ed771,agentId:_0x5e9fc1}=_0x460934[_0x430068(0x106)];for(const _0x6c32ff of _0x9a4d48){console[_0x430068(0xf5)](_0x430068(0x11f)+a5_0x1bac87[_0x430068(0x185)](_0x6c32ff['name']));const _0x1ba6ec=createCommandSpinner('Round\x201/'+_0x6c32ff[_0x430068(0x150)][_0x430068(0x110)]+':\x20Sending\x20user\x20input...');_0x1ba6ec['start']();try{const {result:_0xda30ac}=await runTest(_0x39f9f0[_0x430068(0x116)],_0x6c32ff,{'agentId':_0x5e9fc1,'projectId':_0x8ed771,'site':_0x460934[_0x430068(0x121)],'noEval':![],'evaluatorId':_0x404b5a,'onRoundStart':(_0x301a06,_0x2c620e)=>{const _0x213245=_0x430068;_0x1ba6ec[_0x213245(0x105)]=_0x213245(0x14f)+(_0x301a06+0x1)+'/'+_0x2c620e+_0x213245(0x115);},'onRoundComplete':(_0x4d0e6d,_0x2caca7,_0x7b38be)=>{const _0x6c5f94=_0x430068,_0x54d390=formatElapsed(_0x2caca7);_0x7b38be?console[_0x6c5f94(0xf5)](_0x6c5f94(0x100)+(_0x4d0e6d+0x1)+'/'+_0x6c32ff[_0x6c5f94(0x150)][_0x6c5f94(0x110)]+'...\x20'+a5_0x1bac87[_0x6c5f94(0x16c)]('✓')+'\x20('+_0x54d390+')'):console[_0x6c5f94(0xf5)]('\x20\x20Round\x20'+(_0x4d0e6d+0x1)+'/'+_0x6c32ff[_0x6c5f94(0x150)][_0x6c5f94(0x110)]+_0x6c5f94(0x176)+a5_0x1bac87[_0x6c5f94(0x14c)]('✗'));},'onEvaluationStart':()=>{const _0x2266f8=_0x430068;_0x1ba6ec[_0x2266f8(0x105)]='Evaluating\x20response...';},'onEvaluationComplete':_0x5acc8c=>{const _0xee3371=_0x430068,_0x1e6455=formatElapsed(_0x5acc8c);console[_0xee3371(0xf5)]('\x20\x20Evaluating...\x20'+a5_0x1bac87[_0xee3371(0x16c)]('✓')+'\x20('+_0x1e6455+')');}});_0x1ba6ec[_0x430068(0x16d)](),_0x3c4d09[_0x430068(0x103)](_0xda30ac);if(_0xda30ac[_0x430068(0x14e)]==='PASS')console[_0x430068(0xf5)](a5_0x1bac87['green'](_0x430068(0xfa)+_0xda30ac['reason'])+a5_0x1bac87['dim']('\x20(new)'));else _0xda30ac['status']==='FAIL'?console[_0x430068(0xf5)](a5_0x1bac87['red'](_0x430068(0x124)+_0xda30ac[_0x430068(0x182)])+a5_0x1bac87[_0x430068(0x15d)]('\x20(new)')):console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x14c)](_0x430068(0x10c)+_0xda30ac[_0x430068(0x182)]));_0xda30ac[_0x430068(0x154)]&&console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x15d)](_0x430068(0x13e)+_0xda30ac['conversation_url']));}catch(_0x3b948b){_0x1ba6ec['stop']();const _0x1cd3e9=_0x3b948b instanceof Error?_0x3b948b['message']:String(_0x3b948b);console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x14c)](_0x430068(0x10c)+_0x1cd3e9)),_0x3c4d09['push']({'name':_0x6c32ff[_0x430068(0x15f)],'status':_0x430068(0x152),'reason':_0x1cd3e9,'timestamp':new Date()[_0x430068(0x145)](),'duration_ms':0x0});}}}console[_0x430068(0xf5)]();const _0xb9a542=Date['now']()-_0x1bf0eb,_0x2f8364=_0x3c4d09[_0x430068(0x118)](_0x4e5cd7=>_0x4e5cd7[_0x430068(0x14e)]==='PASS')[_0x430068(0x110)],_0x32e58c=_0x3c4d09[_0x430068(0x118)](_0x1ba691=>_0x1ba691['status']===_0x430068(0x17e))[_0x430068(0x110)],_0x58a971=_0x3c4d09['filter'](_0x219104=>_0x219104['status']==='ERROR')[_0x430068(0x110)];console[_0x430068(0xf5)]('━'['repeat'](0x3c)),console[_0x430068(0xf5)](_0x430068(0x164)),console[_0x430068(0xf5)]('━'[_0x430068(0x132)](0x3c)),console[_0x430068(0xf5)]('Total:\x20\x20\x20\x20'+_0x3c4d09[_0x430068(0x110)]),console[_0x430068(0xf5)](_0x430068(0x181)+a5_0x1bac87[_0x430068(0x16c)](_0x2f8364)),console['log'](_0x430068(0x180)+a5_0x1bac87[_0x430068(0x14c)](_0x32e58c));_0x58a971>0x0&&console[_0x430068(0xf5)]('Errors:\x20\x20\x20'+a5_0x1bac87[_0x430068(0x14c)](_0x58a971));console[_0x430068(0xf5)](_0x430068(0x137)+formatElapsed(_0xb9a542)),console[_0x430068(0xf5)]('━'[_0x430068(0x132)](0x3c));const _0x7db2be={'summary':{'total':_0x3c4d09[_0x430068(0x110)],'passed':_0x2f8364,'failed':_0x32e58c,'errors':_0x58a971>0x0?_0x58a971:undefined,'duration_ms':_0xb9a542},'tests':_0x3c4d09,'agent':{'project':_0xd33f37['projectName'],'name':_0xd33f37['agentName'],'site':_0x35bf15},'timestamp':new Date(_0x1bf0eb)[_0x430068(0x145)]()};if(_0x13924f!==_0x430068(0x17b)||_0x4afe5b){const _0x22f687=formatResults(_0x7db2be,_0x13924f);if(_0x4afe5b)try{a5_0x15b21f[_0x430068(0x147)](_0x4afe5b,_0x22f687,_0x430068(0x14b)),console[_0x430068(0xf5)](),console['log'](a5_0x1bac87[_0x430068(0x15d)](_0x430068(0x112)+_0x4afe5b));}catch(_0x203bb0){return console[_0x430068(0xf5)](),console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x14c)](_0x430068(0x10a)+_0x203bb0)),0x1;}else console[_0x430068(0xf5)](),console[_0x430068(0xf5)](_0x22f687);}const _0x2fd87f=_0x3c4d09['filter'](_0x28ff18=>_0x28ff18['status']!==_0x430068(0x135));return _0x2fd87f['length']>0x0?0x1:0x0;}}
1
+ const a5_0x526702=a5_0x213f;(function(_0x1639e4,_0x48a480){const _0x299e98=a5_0x213f,_0x14cbb1=_0x1639e4();while(!![]){try{const _0x25c8f6=-parseInt(_0x299e98(0xb1))/0x1+-parseInt(_0x299e98(0x100))/0x2*(-parseInt(_0x299e98(0x8e))/0x3)+parseInt(_0x299e98(0xc0))/0x4+-parseInt(_0x299e98(0x87))/0x5*(-parseInt(_0x299e98(0x101))/0x6)+parseInt(_0x299e98(0xfb))/0x7*(parseInt(_0x299e98(0x104))/0x8)+-parseInt(_0x299e98(0x109))/0x9+-parseInt(_0x299e98(0xe7))/0xa;if(_0x25c8f6===_0x48a480)break;else _0x14cbb1['push'](_0x14cbb1['shift']());}catch(_0xfd9c79){_0x14cbb1['push'](_0x14cbb1['shift']());}}}(a5_0x547f,0x68da6));function a5_0x213f(_0x1956b4,_0x347502){_0x1956b4=_0x1956b4-0x78;const _0x547fb4=a5_0x547f();let _0x213f78=_0x547fb4[_0x1956b4];return _0x213f78;}function a5_0x547f(){const _0x5413ec=['agent:test','No\x20tests\x20found\x20with\x20tags:\x20','forEach','4348RlqaBW','Round\x201/','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','conversation_url','yellow','\x22,\x20but\x20current\x20site\x20is\x20\x22','Project\x20path:\x20','no_tests','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','log','✓\x20PASS:\x20','resolveAgentId','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','...','join','3256984naaBXa','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','jsonl','output','Output\x20written\x20to:\x20','description','now','PASS',':\x20Sending\x20user\x20input...','substring','Re-evaluating\x20','Running\x20test:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','green','No\x20tests\x20found\x20matching:\x20','Total:\x20\x20\x20\x20','Passed:\x20\x20\x20','Conversation\x20URL:\x20','No\x20tests\x20have\x20tags\x20defined.','status','FAIL','name','text','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','agentDirs','tsv','has','context','tags','site','\x20-\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','writeFileSync','\x20\x20-\x20','agent','execute','white','12511770ZUJINc','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','utf-8','New\x20tests\x20to\x20execute:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','testYmlPath','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','✗\x20FAIL:\x20','\x20\x20Evaluating...\x20','projectName','Executing\x20new\x20tests...','verbose','Failed:\x20\x20\x20','stop','\x20\x20Site:\x20','eval','Errors:\x20\x20\x20','⚠\x20SKIPPED:\x20','dim','\x20\x20Agent:\x20','644HVtGVi','✗\x20ERROR:\x20Project\x20not\x20found:\x20','repeat','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Site:\x20','2EoGimu','2774862GHfbDC','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','not\x20found','54344zMetQE','json','find','resolveProjectId','Available\x20tests:\x20','5311539qGwrbD','\x20(cached)','includes','Evaluating\x20response...','Error:\x20No\x20previous\x20test\x20run\x20found.','push','Re-evaluating\x20cached\x20test\x20run...','executeReeval','llmProject','no_local_folder','size','rounds','found','Re-evaluating...','dryRun','testName','toLowerCase','reason','split','404','5KazSXG','Test\x20Summary','length','cyan','message','Failed\x20Tests:','Round\x20','1120485hLmXzH','Cached\x20run\x20from:\x20','Agent:\x20','tests','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','resolve','Available\x20tags:\x20','red','test.yml','Running:\x20','map','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','/<agent-name>','\x20\x20Round\x20','Tests\x20found:\x20','ERROR','Duration:\x20','Error\x20writing\x20output\x20file:\x20','timestamp','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','multiple_agents','✗\x20ERROR:\x20','...\x20','table','toISOString','llm','agentName','filter','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Run\x20\x27tdx\x20agent\x20pull\x20','existsSync','projectDir'];a5_0x547f=function(){return _0x5413ec;};return a5_0x547f();}import*as a5_0x592ad9 from'node:fs';import*as a5_0x181cc2 from'node:path';import a5_0x1b164b from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x526702(0xd7)]=a5_0x526702(0xae);[a5_0x526702(0xc5)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x526702(0xe5)](_0x12aca7){const _0x944f63=a5_0x526702,{options:_0x2a7f9b,args:_0x28ead2,tdx:_0x3d8e42}=_0x12aca7,_0x3fd86f=_0x28ead2[0x0]||'.',_0x57e7d7=_0x2a7f9b[_0x944f63(0x81)],_0x4f4e42=_0x2a7f9b,_0x4a9aee=_0x4f4e42[_0x944f63(0xf6)]===![],_0x372320=_0x4f4e42['reeval'],_0x544d70=_0x4f4e42[_0x944f63(0xd7)],_0x2e7d4e=_0x4f4e42['tags'],_0x166a08=_0x2a7f9b['site'],_0x1e7d28=_0x4f4e42[_0x944f63(0xc3)];if(_0x372320&&_0x4a9aee)return console[_0x944f63(0xba)](a5_0x1b164b[_0x944f63(0x95)](_0x944f63(0xb9))),0x1;let _0x1ec6d2=_0x944f63(0xa5);if(_0x4f4e42[_0x944f63(0x105)])_0x1ec6d2='json';else{if(_0x4f4e42[_0x944f63(0xc2)])_0x1ec6d2=_0x944f63(0xc2);else{if(_0x4f4e42[_0x944f63(0xdb)])_0x1ec6d2=_0x944f63(0xdb);else{if(_0x4f4e42['table'])_0x1ec6d2=_0x944f63(0xa5);}}}const _0x5e16ae=_0x4f4e42[_0x944f63(0x7b)];let _0x551b6e=_0x3fd86f;const _0x449b6f=a5_0x592ad9[_0x944f63(0xac)](_0x3fd86f),_0x5b56d4=_0x3fd86f==='.';if(!_0x449b6f||_0x5b56d4){const _0x2622e7=resolveProjectFromContext(_0x3fd86f,_0x5e16ae,{'requireFile':_0x944f63(0x96)});if(_0x2622e7[_0x944f63(0x7f)])_0x551b6e=_0x2622e7['projectDir'],_0x2622e7['source']===_0x944f63(0xdd)&&console[_0x944f63(0xba)](a5_0x1b164b[_0x944f63(0xf9)]('Using\x20agent:\x20'+_0x551b6e));else switch(_0x2622e7[_0x944f63(0x84)]){case'no_context':console['log'](a5_0x1b164b['yellow'](_0x2622e7[_0x944f63(0x8b)])),console['log'](),console['log']('Usage:'),console[_0x944f63(0xba)](_0x944f63(0xe8)),console['log'](_0x944f63(0xbd)),console[_0x944f63(0xba)](),console[_0x944f63(0xba)](_0x944f63(0x99));return 0x1;case _0x944f63(0x7c):console['log'](a5_0x1b164b['yellow'](_0x2622e7[_0x944f63(0x8b)])),console[_0x944f63(0xba)](),console[_0x944f63(0xba)](_0x944f63(0xab)+_0x2622e7['llmProject']+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x944f63(0xa2):{const _0x5b1721=a5_0x181cc2['basename'](_0x2622e7[_0x944f63(0xad)]);console[_0x944f63(0xba)](a5_0x1b164b[_0x944f63(0xb5)](_0x944f63(0xeb)+_0x2622e7[_0x944f63(0x7b)]+'\x22:'));for(const _0x60b7d6 of _0x2622e7[_0x944f63(0xda)]){console['log'](_0x944f63(0xe3)+_0x60b7d6);}return console[_0x944f63(0xba)](),console[_0x944f63(0xba)](_0x944f63(0x102)+_0x5b1721+_0x944f63(0x9a)),0x1;}case _0x944f63(0xb8):console[_0x944f63(0xba)](a5_0x1b164b[_0x944f63(0xb5)](_0x944f63(0xfe)+_0x2622e7[_0x944f63(0x7b)]+'\x22.')),console['log'](a5_0x1b164b[_0x944f63(0xf9)](_0x944f63(0xb7)+_0x2622e7[_0x944f63(0xad)])),console['log'](),console[_0x944f63(0xba)](_0x944f63(0xce));return 0x1;}}const {definition:_0x3cec5b,agentInfo:_0x15ab8b}=parseTestFile(_0x551b6e);let _0xfba421=_0x3cec5b[_0x944f63(0x91)];if(_0x544d70){const _0x32e0a6=_0x544d70[_0x944f63(0x85)](',')[_0x944f63(0x98)](_0x2e3de7=>_0x2e3de7['trim']());_0xfba421=_0x3cec5b[_0x944f63(0x91)][_0x944f63(0xa9)](_0x30e1b4=>_0x32e0a6[_0x944f63(0x10b)](_0x30e1b4[_0x944f63(0xd7)]));if(_0xfba421[_0x944f63(0x89)]===0x0)return console['log'](a5_0x1b164b['yellow'](_0x944f63(0xd0)+_0x544d70)),console[_0x944f63(0xba)](a5_0x1b164b['dim'](_0x944f63(0x108)+_0x3cec5b[_0x944f63(0x91)][_0x944f63(0x98)](_0x184d1a=>_0x184d1a[_0x944f63(0xd7)])['join'](',\x20'))),0x1;}if(_0x2e7d4e){const _0x5931ea=_0x2e7d4e[_0x944f63(0x85)](',')[_0x944f63(0x98)](_0x41c5d5=>_0x41c5d5['trim']()[_0x944f63(0x83)]());_0xfba421=_0xfba421[_0x944f63(0xa9)](_0x33dd50=>_0x33dd50[_0x944f63(0xde)]?.['some'](_0x1d1938=>_0x5931ea[_0x944f63(0x10b)](_0x1d1938[_0x944f63(0x83)]())));if(_0xfba421['length']===0x0){console[_0x944f63(0xba)](a5_0x1b164b[_0x944f63(0xb5)](_0x944f63(0xaf)+_0x2e7d4e));const _0x21ae78=new Set();return _0x3cec5b[_0x944f63(0x91)][_0x944f63(0xb0)](_0x1212fe=>_0x1212fe[_0x944f63(0xde)]?.[_0x944f63(0xb0)](_0x5a6ddf=>_0x21ae78['add'](_0x5a6ddf))),_0x21ae78[_0x944f63(0x7d)]>0x0?console[_0x944f63(0xba)](a5_0x1b164b[_0x944f63(0xf9)](_0x944f63(0x94)+[..._0x21ae78][_0x944f63(0xbf)](',\x20'))):console[_0x944f63(0xba)](a5_0x1b164b[_0x944f63(0xf9)](_0x944f63(0xd4))),0x1;}}if(_0x372320)return this[_0x944f63(0x7a)](_0x12aca7,{'definition':{'tests':_0xfba421},'agentInfo':_0x15ab8b,'outputFormat':_0x1ec6d2,'outputFile':_0x1e7d28,'testNames':_0x544d70});if(_0x57e7d7){console['log'](a5_0x1b164b['cyan']('Test\x20Configuration:')),console[_0x944f63(0xba)](_0x944f63(0xf5)+a5_0x1b164b[_0x944f63(0xe6)](_0x166a08)),console[_0x944f63(0xba)]('\x20\x20Project:\x20'+a5_0x1b164b['white'](_0x15ab8b[_0x944f63(0xf0)])),console[_0x944f63(0xba)](_0x944f63(0xfa)+a5_0x1b164b[_0x944f63(0xe6)](_0x15ab8b[_0x944f63(0xa8)])),console[_0x944f63(0xba)](),console['log'](_0x944f63(0x9c)+a5_0x1b164b[_0x944f63(0xe6)](_0xfba421[_0x944f63(0x89)]));for(let _0x404ed7=0x0;_0x404ed7<_0xfba421[_0x944f63(0x89)];_0x404ed7++){const _0x540ae6=_0xfba421[_0x404ed7],_0x52dc76=_0x540ae6[_0x944f63(0x7e)][_0x944f63(0x89)]===0x1?'round':_0x944f63(0x7e),_0x3b1911=_0x540ae6[_0x944f63(0xde)]?.['length']?'\x20['+_0x540ae6[_0x944f63(0xde)][_0x944f63(0xbf)](',\x20')+']':'';console[_0x944f63(0xba)]('\x20\x20'+(_0x404ed7+0x1)+'.\x20'+a5_0x1b164b[_0x944f63(0xe6)](_0x540ae6[_0x944f63(0xd7)])+'\x20('+_0x540ae6['rounds']['length']+'\x20'+_0x52dc76+')'+a5_0x1b164b[_0x944f63(0xf9)](_0x3b1911));}return 0x0;}let _0x3c79da,_0x2f2775;try{_0x3c79da=await _0x3d8e42[_0x944f63(0xa7)][_0x944f63(0x107)](_0x15ab8b[_0x944f63(0xf0)]);}catch(_0xcc1d49){const _0x161e52=_0xcc1d49 instanceof Error?_0xcc1d49[_0x944f63(0x8b)]:String(_0xcc1d49);return _0x161e52[_0x944f63(0x10b)]('404')||_0x161e52[_0x944f63(0x83)]()[_0x944f63(0x10b)](_0x944f63(0x103))?console['log'](a5_0x1b164b[_0x944f63(0x95)](_0x944f63(0xfc)+_0x15ab8b[_0x944f63(0xf0)])):console[_0x944f63(0xba)](a5_0x1b164b[_0x944f63(0x95)](_0x944f63(0x92)+_0x15ab8b['projectName']+'\x22:\x20'+_0x161e52)),0x1;}try{_0x2f2775=await _0x3d8e42[_0x944f63(0xa7)][_0x944f63(0xbc)](_0x15ab8b[_0x944f63(0xa8)],_0x3c79da);}catch(_0x43c2fd){const _0x58de17=_0x43c2fd instanceof Error?_0x43c2fd[_0x944f63(0x8b)]:String(_0x43c2fd);return _0x58de17[_0x944f63(0x10b)](_0x944f63(0x86))||_0x58de17['toLowerCase']()[_0x944f63(0x10b)](_0x944f63(0x103))?console[_0x944f63(0xba)](a5_0x1b164b[_0x944f63(0x95)](_0x944f63(0xcc)+_0x15ab8b[_0x944f63(0xa8)])):console[_0x944f63(0xba)](a5_0x1b164b[_0x944f63(0x95)](_0x944f63(0xcd)+_0x15ab8b['agentName']+'\x22:\x20'+_0x58de17)),0x1;}let _0x4a9b66;if(!_0x4a9aee)try{_0x4a9b66=await setupEvaluatorAgent(_0x3d8e42[_0x944f63(0xa7)],_0x2a7f9b['verbose']);}catch(_0x1b5d3b){const _0x330c1e=_0x1b5d3b instanceof Error?_0x1b5d3b[_0x944f63(0x8b)]:String(_0x1b5d3b);return console[_0x944f63(0xba)](a5_0x1b164b['red'](_0x944f63(0xc1)+_0x330c1e)),0x1;}console[_0x944f63(0xba)](a5_0x1b164b[_0x944f63(0x8a)]('Running\x20agent\x20tests...')),console['log'](_0x944f63(0xff)+a5_0x1b164b['white'](_0x166a08)),console['log']('Agent:\x20'+a5_0x1b164b['white'](_0x15ab8b[_0x944f63(0xf0)]+'/'+_0x15ab8b[_0x944f63(0xa8)])),console[_0x944f63(0xba)]();const _0x6ae5c0=[],_0x11f9f5=[],_0x463b66=Date['now']();for(let _0x54f66a=0x0;_0x54f66a<_0xfba421['length'];_0x54f66a++){const _0x98ea8c=_0xfba421[_0x54f66a];_0xfba421[_0x944f63(0x89)]>0x1?console[_0x944f63(0xba)]('Test\x20'+(_0x54f66a+0x1)+'/'+_0xfba421[_0x944f63(0x89)]+':\x20'+a5_0x1b164b[_0x944f63(0xe6)](_0x98ea8c['name'])):console[_0x944f63(0xba)](_0x944f63(0xcb)+a5_0x1b164b['white'](_0x98ea8c[_0x944f63(0xd7)]));const _0x86cd5f=createCommandSpinner('Round\x201/'+_0x98ea8c[_0x944f63(0x7e)]['length']+_0x944f63(0xc8));_0x86cd5f['start']();try{const {result:_0x4844d8,conversation:_0x3844e0}=await runTest(_0x3d8e42[_0x944f63(0xa7)],_0x98ea8c,{'agentId':_0x2f2775,'projectId':_0x3c79da,'site':_0x166a08,'noEval':_0x4a9aee,'evaluatorId':_0x4a9b66,'onRoundStart':(_0x322891,_0x50baa7)=>{const _0x5f109c=_0x944f63;_0x86cd5f[_0x5f109c(0xd8)]='Round\x20'+(_0x322891+0x1)+'/'+_0x50baa7+_0x5f109c(0xc8);},'onRoundComplete':(_0x171852,_0x520c95,_0x2917a3)=>{const _0x44abc3=_0x944f63,_0x132fa8=formatElapsed(_0x520c95);_0x2917a3?console[_0x44abc3(0xba)]('\x20\x20Round\x20'+(_0x171852+0x1)+'/'+_0x98ea8c['rounds']['length']+_0x44abc3(0xa4)+a5_0x1b164b['green']('✓')+'\x20('+_0x132fa8+')'):console[_0x44abc3(0xba)]('\x20\x20Round\x20'+(_0x171852+0x1)+'/'+_0x98ea8c['rounds'][_0x44abc3(0x89)]+_0x44abc3(0xa4)+a5_0x1b164b[_0x44abc3(0x95)]('✗'));},'onEvaluationStart':()=>{const _0x1b6841=_0x944f63;_0x86cd5f[_0x1b6841(0xd8)]=_0x1b6841(0x10c);},'onEvaluationComplete':_0x5775cb=>{const _0x2cecca=_0x944f63,_0x38d199=formatElapsed(_0x5775cb);console[_0x2cecca(0xba)](_0x2cecca(0xef)+a5_0x1b164b[_0x2cecca(0xcf)]('✓')+'\x20('+_0x38d199+')');}});_0x86cd5f[_0x944f63(0xf4)](),_0x6ae5c0[_0x944f63(0x78)](_0x4844d8),_0x11f9f5['push'](_0x3844e0);if(_0x4844d8[_0x944f63(0xd5)]===_0x944f63(0xc7))console[_0x944f63(0xba)](a5_0x1b164b[_0x944f63(0xcf)](_0x944f63(0xbb)+_0x4844d8[_0x944f63(0x84)]));else _0x4844d8[_0x944f63(0xd5)]===_0x944f63(0xd6)?console['log'](a5_0x1b164b[_0x944f63(0x95)](_0x944f63(0xee)+_0x4844d8['reason'])):console[_0x944f63(0xba)](a5_0x1b164b[_0x944f63(0x95)](_0x944f63(0xa3)+_0x4844d8[_0x944f63(0x84)]));_0x4844d8['conversation_url']&&console['log'](a5_0x1b164b[_0x944f63(0xf9)](_0x944f63(0xd3)+_0x4844d8['conversation_url'])),console[_0x944f63(0xba)]();}catch(_0x29d453){_0x86cd5f[_0x944f63(0xf4)]();const _0x11b4bd=_0x29d453 instanceof Error?_0x29d453['message']:String(_0x29d453);console[_0x944f63(0xba)](a5_0x1b164b['red'](_0x944f63(0xa3)+_0x11b4bd)),console['log'](),_0x6ae5c0['push']({'name':_0x98ea8c['name'],'status':_0x944f63(0x9d),'reason':_0x11b4bd,'timestamp':new Date()[_0x944f63(0xa6)](),'duration_ms':0x0});}}const _0x1fcf6c=Date[_0x944f63(0xc6)]()-_0x463b66,_0x3067c0=_0x6ae5c0[_0x944f63(0xa9)](_0x383f25=>_0x383f25[_0x944f63(0xd5)]===_0x944f63(0xc7))[_0x944f63(0x89)],_0x349a01=_0x6ae5c0[_0x944f63(0xa9)](_0x3bbea3=>_0x3bbea3[_0x944f63(0xd5)]===_0x944f63(0xd6))[_0x944f63(0x89)],_0x5bc7e3=_0x6ae5c0[_0x944f63(0xa9)](_0x3a9a76=>_0x3a9a76['status']===_0x944f63(0x9d))[_0x944f63(0x89)];console[_0x944f63(0xba)]('━'[_0x944f63(0xfd)](0x3c)),console[_0x944f63(0xba)](_0x944f63(0x88)),console[_0x944f63(0xba)]('━'['repeat'](0x3c)),console[_0x944f63(0xba)](_0x944f63(0xd1)+_0x6ae5c0[_0x944f63(0x89)]),console[_0x944f63(0xba)](_0x944f63(0xd2)+a5_0x1b164b[_0x944f63(0xcf)](_0x3067c0)),console['log'](_0x944f63(0xf3)+a5_0x1b164b[_0x944f63(0x95)](_0x349a01));_0x5bc7e3>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x1b164b['red'](_0x5bc7e3));console['log'](_0x944f63(0x9e)+formatElapsed(_0x1fcf6c)),console[_0x944f63(0xba)]('━'[_0x944f63(0xfd)](0x3c));const _0x4c290b=_0x6ae5c0['filter'](_0x3c2076=>_0x3c2076[_0x944f63(0xd5)]!=='PASS');if(_0x4c290b['length']>0x0){console[_0x944f63(0xba)](),console[_0x944f63(0xba)](_0x944f63(0x8c));for(const _0x46fe3f of _0x4c290b){const _0xcf3a68=a5_0x1b164b['red']('✗'),_0x5afd65=_0x46fe3f[_0x944f63(0x84)][_0x944f63(0x89)]>0x32?_0x46fe3f[_0x944f63(0x84)][_0x944f63(0xc9)](0x0,0x32)+'...':_0x46fe3f[_0x944f63(0x84)];console[_0x944f63(0xba)]('\x20\x20'+_0xcf3a68+'\x20'+_0x46fe3f[_0x944f63(0xd7)]+':\x20'+_0x5afd65);}}const _0x304704={'summary':{'total':_0x6ae5c0['length'],'passed':_0x3067c0,'failed':_0x349a01,'errors':_0x5bc7e3>0x0?_0x5bc7e3:undefined,'duration_ms':_0x1fcf6c},'tests':_0x6ae5c0,'agent':{'project':_0x15ab8b['projectName'],'name':_0x15ab8b[_0x944f63(0xa8)],'site':_0x166a08},'timestamp':new Date(_0x463b66)[_0x944f63(0xa6)]()};try{const _0x54dbe0=buildCachedTestRun(_0x11f9f5,{'site':_0x166a08,'projectId':_0x3c79da,'projectName':_0x15ab8b['projectName'],'agentId':_0x2f2775,'agentName':_0x15ab8b[_0x944f63(0xa8)],'testYmlPath':a5_0x181cc2[_0x944f63(0x93)](_0x15ab8b[_0x944f63(0xec)])});saveLastTestRun(_0x54dbe0);}catch{}if(_0x1ec6d2!==_0x944f63(0xa5)||_0x1e7d28){const _0xd5f57c=formatResults(_0x304704,_0x1ec6d2);if(_0x1e7d28)try{a5_0x592ad9[_0x944f63(0xe2)](_0x1e7d28,_0xd5f57c,_0x944f63(0xe9)),console[_0x944f63(0xba)](),console['log'](a5_0x1b164b[_0x944f63(0xf9)](_0x944f63(0xc4)+_0x1e7d28));}catch(_0x16c131){return console[_0x944f63(0xba)](),console[_0x944f63(0xba)](a5_0x1b164b[_0x944f63(0x95)](_0x944f63(0x9f)+_0x16c131)),0x1;}else console[_0x944f63(0xba)](),console[_0x944f63(0xba)](_0xd5f57c);}return _0x4c290b[_0x944f63(0x89)]>0x0?0x1:0x0;}async[a5_0x526702(0x7a)](_0x20928a,_0x2ae388){const _0xf40c49=a5_0x526702,{options:_0x239a00,tdx:_0x3ddbb6}=_0x20928a,{definition:_0x37c982,agentInfo:_0x405723,outputFormat:_0x226171,outputFile:_0x38d064}=_0x2ae388,_0x30086b=_0x239a00[_0xf40c49(0xdf)],_0x5d04e3=loadLastTestRun();if(!_0x5d04e3)return console[_0xf40c49(0xba)](a5_0x1b164b['red'](_0xf40c49(0x10d))),console['log'](a5_0x1b164b[_0xf40c49(0xf9)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x5d04e3[_0xf40c49(0xe4)]['agentName']!==_0x405723[_0xf40c49(0xa8)])return console['log'](a5_0x1b164b[_0xf40c49(0x95)](_0xf40c49(0xed)+_0x5d04e3[_0xf40c49(0xe4)][_0xf40c49(0xa8)]+_0xf40c49(0xe1)+_0x405723[_0xf40c49(0xa8)]+'\x22.')),console[_0xf40c49(0xba)](a5_0x1b164b[_0xf40c49(0xf9)](_0xf40c49(0xaa))),0x1;const _0x358921=new Set(_0x5d04e3['conversations']['map'](_0x2a6cc5=>_0x2a6cc5[_0xf40c49(0x82)])),_0x2b9a25=_0x37c982[_0xf40c49(0x91)][_0xf40c49(0xa9)](_0x72a7e7=>!_0x358921['has'](_0x72a7e7[_0xf40c49(0xd7)]));if(_0x2b9a25['length']>0x0&&_0x5d04e3[_0xf40c49(0xdf)]!==_0x30086b)return console[_0xf40c49(0xba)](a5_0x1b164b[_0xf40c49(0x95)](_0xf40c49(0xb3))),console[_0xf40c49(0xba)](a5_0x1b164b['dim']('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x5d04e3[_0xf40c49(0xdf)]+_0xf40c49(0xb6)+_0x30086b+'\x22.')),console[_0xf40c49(0xba)](a5_0x1b164b[_0xf40c49(0xf9)]('Either\x20switch\x20to\x20the\x20\x22'+_0x5d04e3['site']+_0xf40c49(0xa1))),0x1;const _0x400833=_0x37c982[_0xf40c49(0x91)][_0xf40c49(0xa9)](_0x41e0e1=>_0x358921[_0xf40c49(0xdc)](_0x41e0e1[_0xf40c49(0xd7)])),_0x10f215=_0x2b9a25;let _0x2e669c;try{_0x2e669c=await setupEvaluatorAgent(_0x3ddbb6[_0xf40c49(0xa7)],_0x239a00[_0xf40c49(0xf2)]);}catch(_0x5789de){const _0x58cb90=_0x5789de instanceof Error?_0x5789de[_0xf40c49(0x8b)]:String(_0x5789de);return console['log'](a5_0x1b164b['red'](_0xf40c49(0xc1)+_0x58cb90)),0x1;}console['log'](a5_0x1b164b[_0xf40c49(0x8a)](_0xf40c49(0x79))),console[_0xf40c49(0xba)](_0xf40c49(0x8f)+a5_0x1b164b[_0xf40c49(0xe6)](_0x5d04e3[_0xf40c49(0xa0)])),console[_0xf40c49(0xba)](_0xf40c49(0x90)+a5_0x1b164b[_0xf40c49(0xe6)](_0x5d04e3['agent']['projectName']+'/'+_0x5d04e3[_0xf40c49(0xe4)][_0xf40c49(0xa8)]));_0x10f215[_0xf40c49(0x89)]>0x0&&console[_0xf40c49(0xba)](_0xf40c49(0xea)+a5_0x1b164b[_0xf40c49(0xb5)](_0x10f215[_0xf40c49(0x89)]));console['log']();const _0x738838=[],_0x36d07e=Date[_0xf40c49(0xc6)](),_0x2731ec=createCommandSpinner(_0xf40c49(0x80));if(_0x400833['length']>0x0)try{const _0x40a943=await reevaluateFromCache(_0x3ddbb6[_0xf40c49(0xa7)],_0x5d04e3,{'tests':_0x400833},{'evaluatorId':_0x2e669c,'onTestStart':(_0xa34e12,_0x2bc50f,_0x29b405)=>{const _0x964acf=_0xf40c49;_0x2731ec[_0x964acf(0xd8)]=_0x964acf(0xca)+(_0x2bc50f+0x1)+'/'+_0x29b405+':\x20'+_0xa34e12+_0x964acf(0xbe);if(!_0x2731ec['isSpinning'])_0x2731ec['start']();},'onTestComplete':(_0x107a57,_0x3c3dc3)=>{const _0x52396c=_0xf40c49;_0x2731ec[_0x52396c(0xf4)]();if(_0x3c3dc3[_0x52396c(0xd5)]===_0x52396c(0xc7))console[_0x52396c(0xba)](a5_0x1b164b['green']('✓\x20PASS:\x20'+_0x107a57)+a5_0x1b164b[_0x52396c(0xf9)](_0x52396c(0x10a)));else _0x3c3dc3[_0x52396c(0xd5)]==='FAIL'?console[_0x52396c(0xba)](a5_0x1b164b[_0x52396c(0x95)](_0x52396c(0xee)+_0x107a57+_0x52396c(0xe0)+_0x3c3dc3[_0x52396c(0x84)])+a5_0x1b164b['dim'](_0x52396c(0x10a))):console[_0x52396c(0xba)](a5_0x1b164b['red'](_0x52396c(0xa3)+_0x107a57+_0x52396c(0xe0)+_0x3c3dc3[_0x52396c(0x84)]));_0x3c3dc3[_0x52396c(0xb4)]&&console['log'](a5_0x1b164b[_0x52396c(0xf9)]('\x20\x20Conversation:\x20'+_0x3c3dc3[_0x52396c(0xb4)])),_0x738838[_0x52396c(0x78)](_0x3c3dc3);},'onTestSkipped':(_0x235419,_0x392c6d)=>{const _0x4da371=_0xf40c49;_0x2731ec[_0x4da371(0xf4)](),console['log'](a5_0x1b164b['yellow'](_0x4da371(0xf8)+_0x235419+_0x4da371(0xe0)+_0x392c6d));}});for(const _0x1be11c of _0x40a943){!_0x738838[_0xf40c49(0x106)](_0x3d317c=>_0x3d317c['name']===_0x1be11c[_0xf40c49(0xd7)])&&_0x738838[_0xf40c49(0x78)](_0x1be11c);}}catch(_0xd3be36){_0x2731ec[_0xf40c49(0xf4)]();const _0x29bc0e=_0xd3be36 instanceof Error?_0xd3be36[_0xf40c49(0x8b)]:String(_0xd3be36);return console['log'](a5_0x1b164b[_0xf40c49(0x95)](_0xf40c49(0xd9)+_0x29bc0e)),0x1;}_0x2731ec['stop']();if(_0x10f215['length']>0x0){console['log'](),console['log'](a5_0x1b164b[_0xf40c49(0x8a)](_0xf40c49(0xf1)));const {projectId:_0x231f61,agentId:_0x2ce83e}=_0x5d04e3[_0xf40c49(0xe4)];for(const _0x2c8b72 of _0x10f215){console[_0xf40c49(0xba)](_0xf40c49(0x97)+a5_0x1b164b[_0xf40c49(0xe6)](_0x2c8b72[_0xf40c49(0xd7)]));const _0x346a22=createCommandSpinner(_0xf40c49(0xb2)+_0x2c8b72[_0xf40c49(0x7e)]['length']+':\x20Sending\x20user\x20input...');_0x346a22['start']();try{const {result:_0x5e4668}=await runTest(_0x3ddbb6[_0xf40c49(0xa7)],_0x2c8b72,{'agentId':_0x2ce83e,'projectId':_0x231f61,'site':_0x5d04e3[_0xf40c49(0xdf)],'noEval':![],'evaluatorId':_0x2e669c,'onRoundStart':(_0x41eee1,_0x127f9c)=>{const _0x1becf3=_0xf40c49;_0x346a22['text']=_0x1becf3(0x8d)+(_0x41eee1+0x1)+'/'+_0x127f9c+_0x1becf3(0xc8);},'onRoundComplete':(_0x6ffcc3,_0x1e8019,_0x221920)=>{const _0x36e9ee=_0xf40c49,_0x59f645=formatElapsed(_0x1e8019);_0x221920?console[_0x36e9ee(0xba)]('\x20\x20Round\x20'+(_0x6ffcc3+0x1)+'/'+_0x2c8b72[_0x36e9ee(0x7e)][_0x36e9ee(0x89)]+_0x36e9ee(0xa4)+a5_0x1b164b['green']('✓')+'\x20('+_0x59f645+')'):console[_0x36e9ee(0xba)](_0x36e9ee(0x9b)+(_0x6ffcc3+0x1)+'/'+_0x2c8b72['rounds'][_0x36e9ee(0x89)]+_0x36e9ee(0xa4)+a5_0x1b164b[_0x36e9ee(0x95)]('✗'));},'onEvaluationStart':()=>{const _0x280e60=_0xf40c49;_0x346a22[_0x280e60(0xd8)]=_0x280e60(0x10c);},'onEvaluationComplete':_0x35dd9e=>{const _0x5d61cd=_0xf40c49,_0x57da9d=formatElapsed(_0x35dd9e);console[_0x5d61cd(0xba)](_0x5d61cd(0xef)+a5_0x1b164b[_0x5d61cd(0xcf)]('✓')+'\x20('+_0x57da9d+')');}});_0x346a22[_0xf40c49(0xf4)](),_0x738838['push'](_0x5e4668);if(_0x5e4668[_0xf40c49(0xd5)]==='PASS')console[_0xf40c49(0xba)](a5_0x1b164b['green'](_0xf40c49(0xbb)+_0x5e4668['reason'])+a5_0x1b164b[_0xf40c49(0xf9)]('\x20(new)'));else _0x5e4668['status']===_0xf40c49(0xd6)?console['log'](a5_0x1b164b[_0xf40c49(0x95)](_0xf40c49(0xee)+_0x5e4668[_0xf40c49(0x84)])+a5_0x1b164b['dim']('\x20(new)')):console['log'](a5_0x1b164b[_0xf40c49(0x95)]('✗\x20ERROR:\x20'+_0x5e4668[_0xf40c49(0x84)]));_0x5e4668[_0xf40c49(0xb4)]&&console[_0xf40c49(0xba)](a5_0x1b164b[_0xf40c49(0xf9)]('\x20\x20Conversation:\x20'+_0x5e4668[_0xf40c49(0xb4)]));}catch(_0x1764c9){_0x346a22['stop']();const _0x1e7d65=_0x1764c9 instanceof Error?_0x1764c9[_0xf40c49(0x8b)]:String(_0x1764c9);console[_0xf40c49(0xba)](a5_0x1b164b['red'](_0xf40c49(0xa3)+_0x1e7d65)),_0x738838[_0xf40c49(0x78)]({'name':_0x2c8b72[_0xf40c49(0xd7)],'status':_0xf40c49(0x9d),'reason':_0x1e7d65,'timestamp':new Date()[_0xf40c49(0xa6)](),'duration_ms':0x0});}}}console[_0xf40c49(0xba)]();const _0x5b2d5e=Date[_0xf40c49(0xc6)]()-_0x36d07e,_0x25044d=_0x738838[_0xf40c49(0xa9)](_0x1517b9=>_0x1517b9[_0xf40c49(0xd5)]===_0xf40c49(0xc7))['length'],_0x901e6f=_0x738838['filter'](_0x4bf7a2=>_0x4bf7a2[_0xf40c49(0xd5)]==='FAIL')[_0xf40c49(0x89)],_0x1351f7=_0x738838[_0xf40c49(0xa9)](_0xc1f6fc=>_0xc1f6fc[_0xf40c49(0xd5)]===_0xf40c49(0x9d))[_0xf40c49(0x89)];console[_0xf40c49(0xba)]('━'[_0xf40c49(0xfd)](0x3c)),console[_0xf40c49(0xba)]('Re-evaluation\x20Summary'),console[_0xf40c49(0xba)]('━'[_0xf40c49(0xfd)](0x3c)),console[_0xf40c49(0xba)](_0xf40c49(0xd1)+_0x738838[_0xf40c49(0x89)]),console['log'](_0xf40c49(0xd2)+a5_0x1b164b['green'](_0x25044d)),console[_0xf40c49(0xba)]('Failed:\x20\x20\x20'+a5_0x1b164b['red'](_0x901e6f));_0x1351f7>0x0&&console[_0xf40c49(0xba)](_0xf40c49(0xf7)+a5_0x1b164b[_0xf40c49(0x95)](_0x1351f7));console[_0xf40c49(0xba)](_0xf40c49(0x9e)+formatElapsed(_0x5b2d5e)),console[_0xf40c49(0xba)]('━'[_0xf40c49(0xfd)](0x3c));const _0x30756a={'summary':{'total':_0x738838['length'],'passed':_0x25044d,'failed':_0x901e6f,'errors':_0x1351f7>0x0?_0x1351f7:undefined,'duration_ms':_0x5b2d5e},'tests':_0x738838,'agent':{'project':_0x405723[_0xf40c49(0xf0)],'name':_0x405723[_0xf40c49(0xa8)],'site':_0x30086b},'timestamp':new Date(_0x36d07e)['toISOString']()};if(_0x226171!==_0xf40c49(0xa5)||_0x38d064){const _0xc78a78=formatResults(_0x30756a,_0x226171);if(_0x38d064)try{a5_0x592ad9[_0xf40c49(0xe2)](_0x38d064,_0xc78a78,'utf-8'),console[_0xf40c49(0xba)](),console[_0xf40c49(0xba)](a5_0x1b164b[_0xf40c49(0xf9)](_0xf40c49(0xc4)+_0x38d064));}catch(_0x4b9a54){return console[_0xf40c49(0xba)](),console[_0xf40c49(0xba)](a5_0x1b164b['red']('Error\x20writing\x20output\x20file:\x20'+_0x4b9a54)),0x1;}else console[_0xf40c49(0xba)](),console[_0xf40c49(0xba)](_0xc78a78);}const _0x468654=_0x738838['filter'](_0x455c74=>_0x455c74[_0xf40c49(0xd5)]!==_0xf40c49(0xc7));return _0x468654[_0xf40c49(0x89)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- function a7_0x2428(_0x8c4c77,_0x4a595c){_0x8c4c77=_0x8c4c77-0x186;const _0x46cfeb=a7_0x46cf();let _0x24283a=_0x46cfeb[_0x8c4c77];return _0x24283a;}const a7_0x341c00=a7_0x2428;(function(_0x386180,_0x11fac6){const _0x3f3d59=a7_0x2428,_0x444e28=_0x386180();while(!![]){try{const _0x2038b5=-parseInt(_0x3f3d59(0x1b1))/0x1+parseInt(_0x3f3d59(0x1c9))/0x2+parseInt(_0x3f3d59(0x19d))/0x3+-parseInt(_0x3f3d59(0x18c))/0x4+parseInt(_0x3f3d59(0x19c))/0x5*(-parseInt(_0x3f3d59(0x1b2))/0x6)+-parseInt(_0x3f3d59(0x1c2))/0x7+parseInt(_0x3f3d59(0x1b9))/0x8*(parseInt(_0x3f3d59(0x196))/0x9);if(_0x2038b5===_0x11fac6)break;else _0x444e28['push'](_0x444e28['shift']());}catch(_0x1398da){_0x444e28['push'](_0x444e28['shift']());}}}(a7_0x46cf,0x53b26));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';function a7_0x46cf(){const _0x5df5ee=['Error:\x20','set-cookie','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','header','workflow','toLowerCase','3103205WtilVS','set-cookie2','length','stack','headers','method','substring','304828aDxsqV','output','isArray','us01','cookie','has','includes','2467980YcVCdR','PATCH','GET','error','verbose','toUpperCase','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','cdp','name','log','9qmcSUM','x-xsrf-token','trim','Invalid\x20HTTP\x20method:\x20','DELETE','api','5cdOeTh','1598154GYKFXA','request','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','x-auth-token','data','PUT','body','proxy-authorization','message','noColor','readBodyFromFile','color','file','Results\x20saved\x20to\x20','x-trino-user','status','authorization','Invalid\x20header\x20format:\x20\x22','llm-proxy','type','296557FWousy','2518182JmKYqs','.\x20Valid\x20types:\x20','join','cas','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','\x0aStack\x20trace:\x0a','execute','11474032LhdSez','validate','site'];a7_0x46cf=function(){return _0x5df5ee;};return a7_0x46cf();}import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a7_0x341c00(0x1ad),a7_0x341c00(0x1a4),a7_0x341c00(0x189),a7_0x341c00(0x1bd),a7_0x341c00(0x1c3),a7_0x341c00(0x197),a7_0x341c00(0x1a0),a7_0x341c00(0x1ab)]);function isSensitiveHeader(_0x1356a3){const _0x4580c1=a7_0x341c00;return SENSITIVE_HEADERS[_0x4580c1(0x18a)](_0x1356a3[_0x4580c1(0x1c1)]());}function parseHeader(_0x44ff6a){const _0x4932da=a7_0x341c00,_0x33bd0c=_0x44ff6a['indexOf'](':');if(_0x33bd0c===-0x1)throw new Error(_0x4932da(0x1ae)+_0x44ff6a+'\x22.\x20'+_0x4932da(0x1be));const _0x1baf0f=_0x44ff6a['substring'](0x0,_0x33bd0c)[_0x4932da(0x198)](),_0x37ea0c=_0x44ff6a[_0x4932da(0x1c8)](_0x33bd0c+0x1)['trim']();if(!_0x1baf0f)throw new Error(_0x4932da(0x19f)+_0x44ff6a+'\x22');return[_0x1baf0f,_0x37ea0c];}export class ApiCommand extends BaseCommand{[a7_0x341c00(0x194)]=a7_0x341c00(0x19b);['description']='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a7_0x341c00(0x1ba)](_0x50fbe7){const _0x120dc1=a7_0x341c00,{args:_0x1efa30,options:_0x2f1352}=_0x50fbe7,_0x2215e9=_0x2f1352;if(_0x1efa30[_0x120dc1(0x1c4)]===0x0)return _0x120dc1(0x192);const _0xf4f0b9=_0x1efa30[0x0];if(!_0xf4f0b9['startsWith']('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0xf4f0b9;const _0x12011a=_0x2215e9['data'],_0x12546e=_0x2215e9[_0x120dc1(0x1a9)];if(_0x12011a&&_0x12546e)return _0x120dc1(0x1b6);const _0x9c6453=_0x2215e9[_0x120dc1(0x1c7)]||'GET',_0x1272f3=[_0x120dc1(0x18e),'POST',_0x120dc1(0x1a2),_0x120dc1(0x19a),_0x120dc1(0x18d)];if(!_0x1272f3['includes'](_0x9c6453[_0x120dc1(0x191)]()))return _0x120dc1(0x199)+_0x9c6453+'.\x20Valid\x20methods:\x20'+_0x1272f3[_0x120dc1(0x1b4)](',\x20');const _0x3be0c2=_0x2215e9['type']||'td',_0x172f85=['td',_0x120dc1(0x193),_0x120dc1(0x1c0),'trino','llm',_0x120dc1(0x1af),_0x120dc1(0x1b5)];if(!_0x172f85[_0x120dc1(0x18b)](_0x3be0c2))return'Invalid\x20API\x20type:\x20'+_0x3be0c2+_0x120dc1(0x1b3)+_0x172f85['join'](',\x20');return undefined;}async[a7_0x341c00(0x1b8)](_0x274928){const _0x4d774a=a7_0x341c00,{options:_0x40d4ce,args:_0x317d02,tdx:_0x11b39c}=_0x274928,_0x1d08f2=_0x40d4ce,_0x524af5=_0x317d02[0x0],_0x21e2e3=(_0x1d08f2[_0x4d774a(0x1c7)]||_0x4d774a(0x18e))[_0x4d774a(0x191)](),_0x8ebec=_0x1d08f2[_0x4d774a(0x1a1)],_0x2c8e0a=_0x1d08f2[_0x4d774a(0x1a9)],_0x5ea09a=_0x1d08f2[_0x4d774a(0x1bf)],_0x1ec29b=_0x1d08f2[_0x4d774a(0x1b0)]||'td';try{const _0x1af3a3={};if(_0x5ea09a){const _0x3331af=Array[_0x4d774a(0x187)](_0x5ea09a)?_0x5ea09a:[_0x5ea09a];for(const _0x3a0f7d of _0x3331af){const [_0x5f305f,_0x2cbdbd]=parseHeader(_0x3a0f7d);_0x1af3a3[_0x5f305f]=_0x2cbdbd;}}let _0x27ef08;if(_0x8ebec)_0x27ef08=_0x8ebec;else{if(_0x2c8e0a)try{_0x27ef08=RawAPI[_0x4d774a(0x1a7)](_0x2c8e0a);}catch(_0x630057){return console[_0x4d774a(0x18f)](_0x4d774a(0x1bc)+(_0x630057 instanceof Error?_0x630057['message']:String(_0x630057))),0x1;}}const _0x4179d8={'method':_0x21e2e3,'apiType':_0x1ec29b,'includeHeaders':_0x40d4ce[_0x4d774a(0x190)]};_0x27ef08&&(_0x4179d8[_0x4d774a(0x1a3)]=_0x27ef08);Object['keys'](_0x1af3a3)[_0x4d774a(0x1c4)]>0x0&&(_0x4179d8[_0x4d774a(0x1c6)]=_0x1af3a3);if(_0x40d4ce[_0x4d774a(0x190)]){const _0x3cd915=resolveSite(_0x40d4ce[_0x4d774a(0x1bb)]??_0x4d774a(0x188)),_0x3be765=getEndpoint(_0x3cd915,_0x1ec29b),_0x91bf6c=''+_0x3be765+_0x524af5;console[_0x4d774a(0x18f)]('>\x20'+_0x21e2e3+'\x20'+_0x91bf6c);const _0x26be68=getAuthHeaders(_0x3cd915),_0xf5d39c={..._0x26be68,..._0x1af3a3};for(const [_0x265ea8,_0x2171e7]of Object['entries'](_0xf5d39c)){!isSensitiveHeader(_0x265ea8)&&console['error']('>\x20'+_0x265ea8+':\x20'+_0x2171e7);}_0x27ef08&&console[_0x4d774a(0x18f)]('>'),console[_0x4d774a(0x18f)]('');}const _0x55b0b2=await _0x11b39c[_0x4d774a(0x19b)][_0x4d774a(0x19e)](_0x524af5,_0x4179d8);if(_0x40d4ce[_0x4d774a(0x190)]&&_0x55b0b2[_0x4d774a(0x1c6)]){console[_0x4d774a(0x18f)]('<\x20HTTP/1.1\x20'+_0x55b0b2[_0x4d774a(0x1ac)]);for(const [_0x4e818c,_0x120e6b]of Object['entries'](_0x55b0b2[_0x4d774a(0x1c6)])){!isSensitiveHeader(_0x4e818c)&&console[_0x4d774a(0x18f)]('<\x20'+_0x4e818c+':\x20'+_0x120e6b);}console[_0x4d774a(0x18f)]('');}const _0x255c59=Boolean(_0x40d4ce[_0x4d774a(0x186)]),_0x4ba211={'color':_0x40d4ce[_0x4d774a(0x1a8)],'noColor':_0x40d4ce[_0x4d774a(0x1a6)]||_0x255c59&&!_0x40d4ce[_0x4d774a(0x1a8)]},_0x4c4113=colorizeJSON(_0x55b0b2[_0x4d774a(0x1a1)],_0x4ba211);return _0x40d4ce[_0x4d774a(0x186)]?(writeFileSync(_0x40d4ce['output'],_0x4c4113),console[_0x4d774a(0x18f)](_0x4d774a(0x1aa)+_0x40d4ce[_0x4d774a(0x186)])):console[_0x4d774a(0x195)](_0x4c4113),0x0;}catch(_0x1a5792){return _0x1a5792 instanceof Error?(console[_0x4d774a(0x18f)](_0x4d774a(0x1bc)+_0x1a5792[_0x4d774a(0x1a5)]),_0x40d4ce[_0x4d774a(0x190)]&&_0x1a5792[_0x4d774a(0x1c5)]&&console['error'](_0x4d774a(0x1b7)+_0x1a5792[_0x4d774a(0x1c5)])):console[_0x4d774a(0x18f)](_0x4d774a(0x1bc)+String(_0x1a5792)),0x1;}}}
1
+ function a6_0x78a8(){const _0x3dad2b=['12iQkZuU','color','isArray','stack','verbose','toLowerCase','set-cookie2','message','6JNoGjc','readBodyFromFile','Invalid\x20HTTP\x20method:\x20','llm','10LaPAFV','startsWith','<\x20HTTP/1.1\x20','1721264PyRfra','proxy-authorization','method','us01','1534541GlBPns','2053142AgnMfC','9091008pQgGDf','661728LIPVFx','noColor','file','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','\x0aStack\x20trace:\x0a','includes','trino','x-xsrf-token','api','entries','cas','type','GET','.\x20Valid\x20types:\x20','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','keys','error','trim','site','join','POST','cookie','Error:\x20','headers','Endpoint\x20must\x20start\x20with\x20/:\x20','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','output','length','DELETE','6975010IUHLrg','11203092amEgrc','data','x-trino-user','body','\x22.\x20','has','header','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','validate','PUT','description','execute'];a6_0x78a8=function(){return _0x3dad2b;};return a6_0x78a8();}const a6_0x17e74a=a6_0xfd61;(function(_0x397118,_0x165bf0){const _0x23de60=a6_0xfd61,_0x65448=_0x397118();while(!![]){try{const _0x30148b=-parseInt(_0x23de60(0x181))/0x1+-parseInt(_0x23de60(0x184))/0x2*(parseInt(_0x23de60(0x1ae))/0x3)+-parseInt(_0x23de60(0x1bd))/0x4+parseInt(_0x23de60(0x1a1))/0x5+parseInt(_0x23de60(0x1b6))/0x6*(parseInt(_0x23de60(0x182))/0x7)+parseInt(_0x23de60(0x183))/0x8+-parseInt(_0x23de60(0x1a2))/0x9*(-parseInt(_0x23de60(0x1ba))/0xa);if(_0x30148b===_0x165bf0)break;else _0x65448['push'](_0x65448['shift']());}catch(_0x574ab7){_0x65448['push'](_0x65448['shift']());}}}(a6_0x78a8,0xbeb67));import{BaseCommand}from'./command.js';function a6_0xfd61(_0x21338d,_0x18a015){_0x21338d=_0x21338d-0x17f;const _0x78a846=a6_0x78a8();let _0xfd6170=_0x78a846[_0x21338d];return _0xfd6170;}import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization',a6_0x17e74a(0x1be),a6_0x17e74a(0x199),'set-cookie',a6_0x17e74a(0x1b4),a6_0x17e74a(0x18b),'x-auth-token',a6_0x17e74a(0x1a4)]);function isSensitiveHeader(_0x1d40b1){const _0x864cbd=a6_0x17e74a;return SENSITIVE_HEADERS[_0x864cbd(0x1a7)](_0x1d40b1[_0x864cbd(0x1b3)]());}function parseHeader(_0x66c999){const _0x2c8913=a6_0x17e74a,_0xb94ab0=_0x66c999['indexOf'](':');if(_0xb94ab0===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x66c999+_0x2c8913(0x1a6)+_0x2c8913(0x19d));const _0x35a660=_0x66c999['substring'](0x0,_0xb94ab0)[_0x2c8913(0x195)](),_0x480278=_0x66c999['substring'](_0xb94ab0+0x1)[_0x2c8913(0x195)]();if(!_0x35a660)throw new Error(_0x2c8913(0x1a9)+_0x66c999+'\x22');return[_0x35a660,_0x480278];}export class ApiCommand extends BaseCommand{['name']=a6_0x17e74a(0x18c);[a6_0x17e74a(0x1ac)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x17e74a(0x1aa)](_0x518f07){const _0x512236=a6_0x17e74a,{args:_0x1aefa4,options:_0x4c45be}=_0x518f07,_0x28e9f5=_0x4c45be;if(_0x1aefa4[_0x512236(0x19f)]===0x0)return _0x512236(0x192);const _0x2a39b9=_0x1aefa4[0x0];if(!_0x2a39b9[_0x512236(0x1bb)]('/'))return _0x512236(0x19c)+_0x2a39b9;const _0x3f7eb5=_0x28e9f5['data'],_0x1960ff=_0x28e9f5[_0x512236(0x186)];if(_0x3f7eb5&&_0x1960ff)return _0x512236(0x187);const _0x35e735=_0x28e9f5[_0x512236(0x17f)]||_0x512236(0x190),_0xacb5d0=[_0x512236(0x190),_0x512236(0x198),_0x512236(0x1ab),_0x512236(0x1a0),'PATCH'];if(!_0xacb5d0[_0x512236(0x189)](_0x35e735['toUpperCase']()))return _0x512236(0x1b8)+_0x35e735+'.\x20Valid\x20methods:\x20'+_0xacb5d0[_0x512236(0x197)](',\x20');const _0xb7a408=_0x28e9f5[_0x512236(0x18f)]||'td',_0x370d1e=['td','cdp','workflow',_0x512236(0x18a),_0x512236(0x1b9),'llm-proxy',_0x512236(0x18e)];if(!_0x370d1e[_0x512236(0x189)](_0xb7a408))return'Invalid\x20API\x20type:\x20'+_0xb7a408+_0x512236(0x191)+_0x370d1e[_0x512236(0x197)](',\x20');return undefined;}async[a6_0x17e74a(0x1ad)](_0xc05929){const _0x329a01=a6_0x17e74a,{options:_0x1703a,args:_0x13d55b,tdx:_0x5152ac}=_0xc05929,_0x24c6af=_0x1703a,_0x4529f9=_0x13d55b[0x0],_0x3aa318=(_0x24c6af[_0x329a01(0x17f)]||'GET')['toUpperCase'](),_0x57ba6f=_0x24c6af[_0x329a01(0x1a3)],_0x3923e3=_0x24c6af[_0x329a01(0x186)],_0x239d65=_0x24c6af[_0x329a01(0x1a8)],_0x41dffd=_0x24c6af[_0x329a01(0x18f)]||'td';try{const _0xbd0e01={};if(_0x239d65){const _0x11efe0=Array[_0x329a01(0x1b0)](_0x239d65)?_0x239d65:[_0x239d65];for(const _0x3705f7 of _0x11efe0){const [_0x36d0be,_0x529e5f]=parseHeader(_0x3705f7);_0xbd0e01[_0x36d0be]=_0x529e5f;}}let _0x587fd8;if(_0x57ba6f)_0x587fd8=_0x57ba6f;else{if(_0x3923e3)try{_0x587fd8=RawAPI[_0x329a01(0x1b7)](_0x3923e3);}catch(_0x9fed47){return console[_0x329a01(0x194)]('Error:\x20'+(_0x9fed47 instanceof Error?_0x9fed47[_0x329a01(0x1b5)]:String(_0x9fed47))),0x1;}}const _0x408df9={'method':_0x3aa318,'apiType':_0x41dffd,'includeHeaders':_0x1703a[_0x329a01(0x1b2)]};_0x587fd8&&(_0x408df9[_0x329a01(0x1a5)]=_0x587fd8);Object[_0x329a01(0x193)](_0xbd0e01)[_0x329a01(0x19f)]>0x0&&(_0x408df9[_0x329a01(0x19b)]=_0xbd0e01);if(_0x1703a[_0x329a01(0x1b2)]){const _0x56c44f=resolveSite(_0x1703a[_0x329a01(0x196)]??_0x329a01(0x180)),_0x4a44ea=getEndpoint(_0x56c44f,_0x41dffd),_0x93f477=''+_0x4a44ea+_0x4529f9;console[_0x329a01(0x194)]('>\x20'+_0x3aa318+'\x20'+_0x93f477);const _0x5ed19c=getAuthHeaders(_0x56c44f),_0x5301b8={..._0x5ed19c,..._0xbd0e01};for(const [_0x3720f4,_0x30133f]of Object['entries'](_0x5301b8)){!isSensitiveHeader(_0x3720f4)&&console[_0x329a01(0x194)]('>\x20'+_0x3720f4+':\x20'+_0x30133f);}_0x587fd8&&console[_0x329a01(0x194)]('>'),console[_0x329a01(0x194)]('');}const _0x4853bf=await _0x5152ac[_0x329a01(0x18c)]['request'](_0x4529f9,_0x408df9);if(_0x1703a[_0x329a01(0x1b2)]&&_0x4853bf[_0x329a01(0x19b)]){console[_0x329a01(0x194)](_0x329a01(0x1bc)+_0x4853bf['status']);for(const [_0x1f08e9,_0x4d963]of Object[_0x329a01(0x18d)](_0x4853bf[_0x329a01(0x19b)])){!isSensitiveHeader(_0x1f08e9)&&console['error']('<\x20'+_0x1f08e9+':\x20'+_0x4d963);}console[_0x329a01(0x194)]('');}const _0x1be242=Boolean(_0x1703a[_0x329a01(0x19e)]),_0x45e49e={'color':_0x1703a[_0x329a01(0x1af)],'noColor':_0x1703a[_0x329a01(0x185)]||_0x1be242&&!_0x1703a['color']},_0x342361=colorizeJSON(_0x4853bf[_0x329a01(0x1a3)],_0x45e49e);return _0x1703a['output']?(writeFileSync(_0x1703a[_0x329a01(0x19e)],_0x342361),console['error']('Results\x20saved\x20to\x20'+_0x1703a[_0x329a01(0x19e)])):console['log'](_0x342361),0x0;}catch(_0x156eaa){return _0x156eaa instanceof Error?(console[_0x329a01(0x194)](_0x329a01(0x19a)+_0x156eaa[_0x329a01(0x1b5)]),_0x1703a[_0x329a01(0x1b2)]&&_0x156eaa[_0x329a01(0x1b1)]&&console[_0x329a01(0x194)](_0x329a01(0x188)+_0x156eaa[_0x329a01(0x1b1)])):console[_0x329a01(0x194)](_0x329a01(0x19a)+String(_0x156eaa)),0x1;}}}
@@ -1 +1 @@
1
- {"version":3,"file":"auth-command.d.ts","sourceRoot":"","sources":["../../src/commands/auth-command.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAkB,MAAM,cAAc,CAAC;AAShF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAenE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGlD,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,QAAQ,EACnB,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GACjC,OAAO,CAAC,IAAI,CAAC,CAiFf;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC,CAmB3E;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,gDAAgD;IAE9D,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAuHxD;AAED;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,QAAQ,CAAC,IAAI,UAAU;IACvB,QAAQ,CAAC,WAAW,qDAAqD;IAEnE,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAmDxD;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,0CAA0C;IAExD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAUxD;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,yCAAyC;IAEvD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAgCxD"}
1
+ {"version":3,"file":"auth-command.d.ts","sourceRoot":"","sources":["../../src/commands/auth-command.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAkB,MAAM,cAAc,CAAC;AAShF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAenE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGlD,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,QAAQ,EACnB,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GACjC,OAAO,CAAC,IAAI,CAAC,CAiFf;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC,CAmB3E;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,gDAAgD;IAE9D,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAuHxD;AAED;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,QAAQ,CAAC,IAAI,UAAU;IACvB,QAAQ,CAAC,WAAW,qDAAqD;IAEnE,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAmDxD;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,0CAA0C;IAExD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAWxD;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,yCAAyC;IAEvD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAgCxD"}
@@ -1 +1 @@
1
- const a8_0x1153cd=a8_0x5672;(function(_0x337874,_0x41d301){const _0x115a85=a8_0x5672,_0x268794=_0x337874();while(!![]){try{const _0x3b26c6=parseInt(_0x115a85(0x17a))/0x1*(parseInt(_0x115a85(0x195))/0x2)+-parseInt(_0x115a85(0x16e))/0x3*(parseInt(_0x115a85(0x163))/0x4)+parseInt(_0x115a85(0x170))/0x5*(parseInt(_0x115a85(0x1a4))/0x6)+-parseInt(_0x115a85(0x155))/0x7+parseInt(_0x115a85(0x15e))/0x8+parseInt(_0x115a85(0x184))/0x9*(parseInt(_0x115a85(0x1a3))/0xa)+-parseInt(_0x115a85(0x168))/0xb*(parseInt(_0x115a85(0x18d))/0xc);if(_0x3b26c6===_0x41d301)break;else _0x268794['push'](_0x268794['shift']());}catch(_0xc01390){_0x268794['push'](_0x268794['shift']());}}}(a8_0x2dde,0xbee9f));import{BaseCommand,printAuthError}from'./command.js';import{resolveOAuthAccessToken}from'../sdk/auth-token.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync,loadGlobalProxy}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';function a8_0x5672(_0x4ca834,_0x37759c){_0x4ca834=_0x4ca834-0x152;const _0x2ddea4=a8_0x2dde();let _0x567204=_0x2ddea4[_0x4ca834];return _0x567204;}import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a8_0x5d3075 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x3c5a3f from'chalk';export async function runOAuthLoginFlow(_0x4d9bf0,_0x146cde,_0x322d38,_0x3ad8ff){const _0x2cdd85=a8_0x5672,_0x3d9ee8=await isKeychainAvailable();if(!_0x3d9ee8)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');let _0x353f43=_0x3ad8ff?.[_0x2cdd85(0x15b)];if(!_0x353f43){const _0x5b29a3=await a8_0x5d3075({'type':_0x2cdd85(0x16c),'name':'accountName','message':_0x2cdd85(0x160)});if(_0x5b29a3[_0x2cdd85(0x15b)]===undefined)throw new Error('Setup\x20cancelled');_0x353f43=_0x5b29a3[_0x2cdd85(0x15b)][_0x2cdd85(0x19c)]()||undefined;}const _0x47a1e0=getConsoleUrl(_0x4d9bf0);console[_0x2cdd85(0x16a)](_0x2cdd85(0x196));_0x353f43?console[_0x2cdd85(0x16a)]('\x20\x20'+_0x47a1e0+_0x2cdd85(0x1a1)+_0x353f43+')'):console[_0x2cdd85(0x16a)]('\x20\x20'+_0x47a1e0+_0x2cdd85(0x16f));console['log']('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0x3bf23a=loadGlobalProxy()||process.env.HTTPS_PROXY||process.env.HTTP_PROXY,_0x4ff7a9=await startOAuthFlow(_0x4d9bf0,{'accountName':_0x353f43,'proxy':_0x3bf23a});console[_0x2cdd85(0x16a)](_0x2cdd85(0x15d));const _0xcaff9e=TDX[_0x2cdd85(0x1b2)]({'site':_0x4d9bf0,'accessToken':_0x4ff7a9[_0x2cdd85(0x1b0)],'logLevel':_0x322d38??LogLevel['ERROR']}),_0x41911a=await _0xcaff9e[_0x2cdd85(0x1a2)][_0x2cdd85(0x17f)]();console[_0x2cdd85(0x16a)](a8_0x3c5a3f[_0x2cdd85(0x156)](_0x2cdd85(0x1b8))),console[_0x2cdd85(0x16a)]('\x20\x20'+a8_0x3c5a3f[_0x2cdd85(0x1b9)](_0x4d9bf0+':'+_0x41911a[_0x2cdd85(0x17d)])+_0x2cdd85(0x1ac)+_0x41911a['id']+_0x2cdd85(0x180)+_0x41911a['email']+')');!_0x353f43&&(console[_0x2cdd85(0x16a)](a8_0x3c5a3f[_0x2cdd85(0x165)](_0x2cdd85(0x186))),console[_0x2cdd85(0x16a)](a8_0x3c5a3f[_0x2cdd85(0x165)](_0x2cdd85(0x18f))),console[_0x2cdd85(0x16a)](a8_0x3c5a3f[_0x2cdd85(0x165)](_0x2cdd85(0x17e))));await saveOAuthTokens(_0x4ff7a9,_0x146cde),console[_0x2cdd85(0x16a)]('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x146cde?_0x2cdd85(0x19e)+_0x146cde+')':''));if(_0x146cde){const _0x29b164={'site':_0x4d9bf0};saveProfileToUserConfig(_0x146cde,_0x29b164),console[_0x2cdd85(0x16a)](_0x2cdd85(0x18b)+_0x146cde+_0x2cdd85(0x15c));}else saveDefaultSiteToUserConfig(_0x4d9bf0),console['log'](_0x2cdd85(0x1a5)+_0x4d9bf0);const _0x23116b=_0x146cde?_0x2cdd85(0x172)+_0x146cde:'';console[_0x2cdd85(0x16a)](),console[_0x2cdd85(0x16a)](_0x2cdd85(0x19b)),console[_0x2cdd85(0x16a)](_0x2cdd85(0x159)+_0x23116b+_0x2cdd85(0x190)),console[_0x2cdd85(0x16a)](_0x2cdd85(0x159)+_0x23116b+_0x2cdd85(0x1b3));}export async function promptAuthMethod(){const _0x54a2cb=a8_0x5672,_0x379b94=await a8_0x5d3075({'type':_0x54a2cb(0x174),'name':_0x54a2cb(0x189),'message':_0x54a2cb(0x19a),'choices':[{'title':_0x54a2cb(0x178),'description':_0x54a2cb(0x1ab),'value':'oauth'},{'title':'Use\x20an\x20API\x20key','description':_0x54a2cb(0x1b1),'value':'apikey'}]});return _0x379b94[_0x54a2cb(0x189)]||null;}export class AuthSetupCommand extends BaseCommand{['name']=a8_0x1153cd(0x193);[a8_0x1153cd(0x171)]=a8_0x1153cd(0x199);async[a8_0x1153cd(0x1ae)](_0x48fb28){const _0x3c4f1f=a8_0x1153cd,{options:_0x495235}=_0x48fb28,_0x2b7659=_0x495235[_0x3c4f1f(0x176)];console[_0x3c4f1f(0x16a)](a8_0x3c5a3f[_0x3c4f1f(0x188)]('tdx:\x20auth\x20setup'));const _0x33cc7b=_0x495235['site']||_0x3c4f1f(0x157),_0x4c45e4=await promptSiteSelection(_0x33cc7b,_0x2b7659,'Setup\x20cancelled');if(!_0x4c45e4)return 0x1;const _0x4e60b6=resolveSite(_0x4c45e4),_0x459314=await promptAuthMethod();if(!_0x459314)return console[_0x3c4f1f(0x16a)](_0x3c4f1f(0x16d)),0x1;if(_0x459314==='oauth'){const {accountName:_0x2b9348}=_0x495235;return await runOAuthLoginFlow(_0x4e60b6,_0x2b7659,_0x495235[_0x3c4f1f(0x173)]??LogLevel['ERROR'],{'accountName':_0x2b9348}),0x0;}console[_0x3c4f1f(0x16a)](_0x3c4f1f(0x167)+_0x4e60b6),console[_0x3c4f1f(0x16a)](_0x3c4f1f(0x158)),console[_0x3c4f1f(0x16a)]('\x20\x20'+getConsoleUrl(_0x4e60b6,_0x3c4f1f(0x1a6)));const _0x3de54c=await a8_0x5d3075({'type':'password','name':_0x3c4f1f(0x153),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0xd92b84=>{const _0x13bfd0=_0x3c4f1f;if(!_0xd92b84||!_0xd92b84[_0x13bfd0(0x19c)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x3de54c[_0x3c4f1f(0x153)])return console['log']('\x0aSetup\x20cancelled'),0x1;const _0x4693d6=_0x3de54c[_0x3c4f1f(0x153)];console[_0x3c4f1f(0x16a)](_0x3c4f1f(0x1a0));try{const _0x53a439=TDX['create']({'site':_0x4e60b6,'apiKey':_0x4693d6[_0x3c4f1f(0x19c)](),'logLevel':_0x495235[_0x3c4f1f(0x173)]??LogLevel[_0x3c4f1f(0x162)]}),_0x563cd7=await _0x53a439[_0x3c4f1f(0x1a2)]['getUserInfo']();console[_0x3c4f1f(0x16a)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x563cd7[_0x3c4f1f(0x1aa)]+')');const _0x1f412a=await isKeychainAvailable();_0x1f412a?(await saveAPIKeyAsync(_0x4693d6[_0x3c4f1f(0x19c)](),_0x4e60b6,_0x2b7659),console[_0x3c4f1f(0x16a)](_0x3c4f1f(0x192)+(_0x2b7659?_0x3c4f1f(0x19e)+_0x2b7659+')':''))):(console[_0x3c4f1f(0x164)](a8_0x3c5a3f[_0x3c4f1f(0x18e)](_0x3c4f1f(0x154))),console[_0x3c4f1f(0x164)](a8_0x3c5a3f[_0x3c4f1f(0x18e)](_0x3c4f1f(0x1ad))));if(_0x2b7659){const _0x457aee={'site':_0x4e60b6};saveProfileToUserConfig(_0x2b7659,_0x457aee),console['log']('✓\x20Profile\x20\x27'+_0x2b7659+_0x3c4f1f(0x15c));}else saveDefaultSiteToUserConfig(_0x4e60b6),console[_0x3c4f1f(0x16a)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x4e60b6);const _0x264f77=_0x2b7659?_0x3c4f1f(0x172)+_0x2b7659:'';return console[_0x3c4f1f(0x16a)](),console[_0x3c4f1f(0x16a)](_0x3c4f1f(0x19b)),console[_0x3c4f1f(0x16a)](_0x3c4f1f(0x159)+_0x264f77+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x3c4f1f(0x16a)](_0x3c4f1f(0x159)+_0x264f77+_0x3c4f1f(0x1b3)),0x0;}catch(_0x31f89d){if(_0x31f89d instanceof HTTPClientError&&_0x31f89d[_0x3c4f1f(0x175)]===0x191)return printAuthError(_0x31f89d),0x1;return console['error'](a8_0x3c5a3f['red']('✗\x20Validation\x20failed:\x20'+(_0x31f89d instanceof Error?_0x31f89d[_0x3c4f1f(0x1b4)]:String(_0x31f89d)))),console[_0x3c4f1f(0x181)](_0x3c4f1f(0x198)),0x1;}}}function a8_0x2dde(){const _0x44800a=['auth:token','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','Remove\x20API\x20key\x20from\x20system\x20keychain','ERROR','52iFQwVn','warn','dim','auth:clear','Setting\x20up\x20authentication\x20for\x20site:\x20','1008403AlUrCK','red','log','Read\x20credential\x20from\x20keychain','text','\x0aSetup\x20cancelled','322356Aibced','/oauth/authorize','572980fmQuGz','description','\x20--profile\x20','logLevel','select','status','profile','Name:\x20','Sign\x20in\x20with\x20browser\x20(recommended)','System\x20keychain\x20is\x20not\x20available','85615abqfXt','all','\x20for\x20profile:\x20','account_id','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','getUserInfo','\x20\x20(','error','\x20removed\x20from\x20keychain','auth','45WrjJhM','No\x20credentials\x20found\x20in\x20keychain','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','filter','bold','method','tdx:\x20auth\x20clear','✓\x20Profile\x20\x27','tdx\x20profile:\x20','60vDBbSo','yellow','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','✗\x20Validation\x20failed:\x20','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','auth:setup','No\x20credential\x20found','10VbEbnr','Opening\x20browser\x20for\x20authentication...','site','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Setup\x20API\x20key\x20authentication\x20interactively','Choose\x20how\x20to\x20sign\x20in:','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','trim','Credential\x20type:\x20OAuth','\x20(profile:\x20','✓\x20Authentication\x20successful\x0a','Validating\x20API\x20key...','/users/initiate_sso\x20(account:\x20','jobs','2537450mSgjpi','66NHXZnu','✓\x20Default\x20site\x20set\x20to\x20','/app/mp/ak','join','name','last_name','email','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','\x20\x20user_id:','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','execute','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','access_token','For\x20scripts\x20or\x20headless\x20servers','create','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','message','OAuth\x20tokens','API\x20key','N/A','✓\x20Signed\x20in\x20successfully','cyan','\x20(site:\x20','apiKey','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','8249563qAGcnA','green','us01','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20\x20tdx','first_name','accountName','\x27\x20registered','Validating\x20OAuth\x20tokens...','6867016wxZPbo'];a8_0x2dde=function(){return _0x44800a;};return a8_0x2dde();}export class AuthStatusCommand extends BaseCommand{[a8_0x1153cd(0x1a8)]=a8_0x1153cd(0x183);[a8_0x1153cd(0x171)]=a8_0x1153cd(0x1af);async['execute'](_0xf2e79a){const _0x1e6f47=a8_0x1153cd,{options:_0x1d5e10,tdx:_0x3ce2b5}=_0xf2e79a,_0x2fca78=_0x1d5e10[_0x1e6f47(0x197)],_0x584d94=_0x1d5e10[_0x1e6f47(0x176)],_0x37da24=_0x584d94?_0x584d94:_0x1e6f47(0x1b7);console[_0x1e6f47(0x16a)](_0x1e6f47(0x18c)+_0x37da24+_0x1e6f47(0x152)+_0x2fca78+')');const _0x4c86cd=await getOAuthTokens(_0x584d94);if(_0x4c86cd)console[_0x1e6f47(0x16a)](_0x1e6f47(0x19d)),console[_0x1e6f47(0x16a)](_0x1e6f47(0x16b)+(_0x584d94?_0x1e6f47(0x19e)+_0x584d94+')':''));else{const _0x398a94=await resolveAPIKeyAsync(_0x2fca78,_0x584d94);if(_0x398a94){const {source:_0x2e4509,isDeprecated:_0x3e5d64}=_0x398a94,_0xc865ba='Read\x20credential\x20from\x20'+_0x2e4509;console['log'](_0x3e5d64?a8_0x3c5a3f[_0x1e6f47(0x18e)](_0xc865ba):_0xc865ba);}else console[_0x1e6f47(0x16a)](a8_0x3c5a3f[_0x1e6f47(0x18e)](_0x1e6f47(0x194)));}try{const _0x13d254=await _0x3ce2b5[_0x1e6f47(0x1a2)][_0x1e6f47(0x17f)]();return console[_0x1e6f47(0x16a)](a8_0x3c5a3f[_0x1e6f47(0x156)](_0x1e6f47(0x19f))),console[_0x1e6f47(0x16a)]('User:\x20'+_0x13d254[_0x1e6f47(0x1aa)]),(_0x13d254[_0x1e6f47(0x15a)]||_0x13d254[_0x1e6f47(0x1a9)])&&console[_0x1e6f47(0x16a)](_0x1e6f47(0x177)+[_0x13d254['first_name'],_0x13d254['last_name']][_0x1e6f47(0x187)](Boolean)[_0x1e6f47(0x1a7)]('\x20')),0x0;}catch(_0x2f4a15){return _0x2f4a15 instanceof HTTPClientError&&_0x2f4a15[_0x1e6f47(0x175)]===0x191?printAuthError(_0x2f4a15,!![],_0x584d94):console[_0x1e6f47(0x181)](a8_0x3c5a3f[_0x1e6f47(0x169)](_0x1e6f47(0x191)+(_0x2f4a15 instanceof Error?_0x2f4a15[_0x1e6f47(0x1b4)]:String(_0x2f4a15)))),0x1;}}}export class AuthTokenCommand extends BaseCommand{['name']=a8_0x1153cd(0x15f);[a8_0x1153cd(0x171)]='Print\x20the\x20current\x20OAuth\x20access\x20token';async['execute'](_0x168c54){const _0x52877f=a8_0x1153cd,{options:_0x1b1b82}=_0x168c54,_0x3e8a57=await resolveOAuthAccessToken({'site':resolveSite(_0x1b1b82['site']||_0x52877f(0x157)),'profile':_0x1b1b82[_0x52877f(0x176)],'proxy':loadGlobalProxy()});return console[_0x52877f(0x16a)](_0x3e8a57),0x0;}}export class AuthClearCommand extends BaseCommand{[a8_0x1153cd(0x1a8)]=a8_0x1153cd(0x166);['description']=a8_0x1153cd(0x161);async[a8_0x1153cd(0x1ae)](_0x47bf9b){const _0x5dc929=a8_0x1153cd,{options:_0x1d55a7}=_0x47bf9b,_0x3afb54=_0x1d55a7[_0x5dc929(0x176)];console['log'](a8_0x3c5a3f['bold'](_0x5dc929(0x18a)));const _0x4539e9=await isKeychainAvailable();if(!_0x4539e9)return console[_0x5dc929(0x181)](a8_0x3c5a3f[_0x5dc929(0x169)](_0x5dc929(0x179))),0x1;const [_0x25016f,_0x365b45]=await Promise[_0x5dc929(0x17b)]([deleteKeychainAPIKey(_0x3afb54),deleteOAuthTokens(_0x3afb54)]);if(_0x25016f||_0x365b45){clearCredentialCache();const _0xb2430c=[_0x25016f&&_0x5dc929(0x1b6),_0x365b45&&_0x5dc929(0x1b5)]['filter'](Boolean)['join']('\x20and\x20');return console[_0x5dc929(0x16a)]('✓\x20'+_0xb2430c+_0x5dc929(0x182)+(_0x3afb54?_0x5dc929(0x19e)+_0x3afb54+')':'')),0x0;}else return console[_0x5dc929(0x16a)](_0x5dc929(0x185)+(_0x3afb54?_0x5dc929(0x17c)+_0x3afb54:'')),0x1;}}
1
+ const a7_0x31aac8=a7_0x2b5a;(function(_0x498f79,_0x1d3b94){const _0x363154=a7_0x2b5a,_0x274168=_0x498f79();while(!![]){try{const _0x1cf0be=parseInt(_0x363154(0xdc))/0x1+-parseInt(_0x363154(0x103))/0x2+parseInt(_0x363154(0xe1))/0x3*(parseInt(_0x363154(0xe3))/0x4)+parseInt(_0x363154(0x11a))/0x5*(parseInt(_0x363154(0xff))/0x6)+parseInt(_0x363154(0xd9))/0x7+parseInt(_0x363154(0xe7))/0x8*(-parseInt(_0x363154(0xd8))/0x9)+parseInt(_0x363154(0xd3))/0xa*(parseInt(_0x363154(0xc9))/0xb);if(_0x1cf0be===_0x1d3b94)break;else _0x274168['push'](_0x274168['shift']());}catch(_0x2daeb1){_0x274168['push'](_0x274168['shift']());}}}(a7_0x32f6,0xadcef));import{BaseCommand,printAuthError}from'./command.js';import{resolveOAuthAccessToken}from'../sdk/auth-token.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync,loadGlobalProxy}from'../core/config.js';function a7_0x2b5a(_0x3f2644,_0x116c3f){_0x3f2644=_0x3f2644-0xc9;const _0x32f6fb=a7_0x32f6();let _0x2b5a49=_0x32f6fb[_0x3f2644];return _0x2b5a49;}import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';function a7_0x32f6(){const _0x441b5c=['4747981nXVStO','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Enter\x20your\x20TD\x20API\x20key:','783486lWZFhu','Print\x20the\x20current\x20OAuth\x20access\x20token','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','tdx:\x20auth\x20setup','Read\x20credential\x20from\x20keychain','835239jiWCiP','name','4XsExHh','message','dim','Setup\x20API\x20key\x20authentication\x20interactively','9136160lAcULS','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','red','Sign\x20in\x20with\x20browser\x20(recommended)','yellow','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','jobs','Read\x20credential\x20from\x20','method','\x20(profile:\x20','write','API\x20key\x20cannot\x20be\x20empty','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','us01','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','tdx\x20profile:\x20','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','apiKey','✗\x20Validation\x20failed:\x20','getUserInfo','create','Credential\x20type:\x20OAuth','✓\x20Profile\x20\x27','site','520050FhtabE','account_id','\x20\x20user_id:','description','1924728iFgELP','No\x20credential\x20found','filter','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','oauth','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20(site:\x20','Validating\x20OAuth\x20tokens...','✓\x20Default\x20site\x20set\x20to\x20','trim','status','cyan','\x20\x20(','join','execute','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','\x20\x20tdx','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','email','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','first_name','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','\x27\x20registered','60kWtgXS','stdout','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','auth:token','access_token','N/A','For\x20scripts\x20or\x20headless\x20servers','✓\x20Signed\x20in\x20successfully','auth','Setting\x20up\x20authentication\x20for\x20site:\x20','warn','all','User:\x20','green','log','\x20removed\x20from\x20keychain','\x20--profile\x20','profile','/users/initiate_sso\x20(account:\x20','error','Choose\x20how\x20to\x20sign\x20in:','132077minuNt','bold','auth:clear','No\x20credentials\x20found\x20in\x20keychain','Remove\x20API\x20key\x20from\x20system\x20keychain','ERROR','Opening\x20browser\x20for\x20authentication...','\x0aSetup\x20cancelled','text','last_name','30DRHLsC','System\x20keychain\x20is\x20not\x20available','accountName','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','9GkqUid'];a7_0x32f6=function(){return _0x441b5c;};return a7_0x32f6();}import{promptSiteSelection}from'../core/constants.js';import a7_0x396374 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x3b6340 from'chalk';export async function runOAuthLoginFlow(_0x5f4a0c,_0x1cae86,_0x36f15b,_0x12fd96){const _0x5aeb1f=a7_0x2b5a,_0x700010=await isKeychainAvailable();if(!_0x700010)throw new Error(_0x5aeb1f(0xd7)+_0x5aeb1f(0x11c));let _0x16f40e=_0x12fd96?.[_0x5aeb1f(0xd5)];if(!_0x16f40e){const _0x29f420=await a7_0x396374({'type':_0x5aeb1f(0xd1),'name':'accountName','message':_0x5aeb1f(0xec)});if(_0x29f420[_0x5aeb1f(0xd5)]===undefined)throw new Error('Setup\x20cancelled');_0x16f40e=_0x29f420[_0x5aeb1f(0xd5)]['trim']()||undefined;}const _0x22b41f=getConsoleUrl(_0x5f4a0c);console[_0x5aeb1f(0x128)](_0x5aeb1f(0xcf));_0x16f40e?console['log']('\x20\x20'+_0x22b41f+_0x5aeb1f(0x12c)+_0x16f40e+')'):console[_0x5aeb1f(0x128)]('\x20\x20'+_0x22b41f+'/oauth/authorize');console[_0x5aeb1f(0x128)](_0x5aeb1f(0xf7));const _0x166dea=loadGlobalProxy()||process.env.HTTPS_PROXY||process.env.HTTP_PROXY,_0x3cae4d=await startOAuthFlow(_0x5f4a0c,{'accountName':_0x16f40e,'proxy':_0x166dea});console[_0x5aeb1f(0x128)](_0x5aeb1f(0x10a));const _0x516226=TDX[_0x5aeb1f(0xfb)]({'site':_0x5f4a0c,'accessToken':_0x3cae4d[_0x5aeb1f(0x11e)],'logLevel':_0x36f15b??LogLevel['ERROR']}),_0x2fe004=await _0x516226[_0x5aeb1f(0xed)][_0x5aeb1f(0xfa)]();console['log'](a7_0x3b6340['green'](_0x5aeb1f(0x121))),console[_0x5aeb1f(0x128)]('\x20\x20'+a7_0x3b6340[_0x5aeb1f(0x10e)](_0x5f4a0c+':'+_0x2fe004[_0x5aeb1f(0x100)])+_0x5aeb1f(0x101)+_0x2fe004['id']+_0x5aeb1f(0x10f)+_0x2fe004[_0x5aeb1f(0x115)]+')');!_0x16f40e&&(console['log'](a7_0x3b6340[_0x5aeb1f(0xe5)](_0x5aeb1f(0xde))),console['log'](a7_0x3b6340[_0x5aeb1f(0xe5)](_0x5aeb1f(0x112))),console[_0x5aeb1f(0x128)](a7_0x3b6340[_0x5aeb1f(0xe5)](_0x5aeb1f(0x114))));await saveOAuthTokens(_0x3cae4d,_0x1cae86),console[_0x5aeb1f(0x128)](_0x5aeb1f(0x116)+(_0x1cae86?'\x20(profile:\x20'+_0x1cae86+')':''));if(_0x1cae86){const _0x1f1c0d={'site':_0x5f4a0c};saveProfileToUserConfig(_0x1cae86,_0x1f1c0d),console[_0x5aeb1f(0x128)]('✓\x20Profile\x20\x27'+_0x1cae86+_0x5aeb1f(0x119));}else saveDefaultSiteToUserConfig(_0x5f4a0c),console[_0x5aeb1f(0x128)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x5f4a0c);const _0x5dc0e1=_0x1cae86?_0x5aeb1f(0x12a)+_0x1cae86:'';console[_0x5aeb1f(0x128)](),console[_0x5aeb1f(0x128)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x5aeb1f(0x128)]('\x20\x20tdx'+_0x5dc0e1+_0x5aeb1f(0x108)),console[_0x5aeb1f(0x128)](_0x5aeb1f(0x113)+_0x5dc0e1+_0x5aeb1f(0xd6));}export async function promptAuthMethod(){const _0x46ffe6=a7_0x2b5a,_0x43b931=await a7_0x396374({'type':'select','name':_0x46ffe6(0xef),'message':_0x46ffe6(0x12e),'choices':[{'title':_0x46ffe6(0xea),'description':'Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','value':_0x46ffe6(0x107)},{'title':'Use\x20an\x20API\x20key','description':_0x46ffe6(0x120),'value':'apikey'}]});return _0x43b931[_0x46ffe6(0xef)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x31aac8(0xe2)]='auth:setup';[a7_0x31aac8(0x102)]=a7_0x31aac8(0xe6);async['execute'](_0x2fe9e4){const _0x34048a=a7_0x31aac8,{options:_0x131143}=_0x2fe9e4,_0x22f463=_0x131143[_0x34048a(0x12b)];console[_0x34048a(0x128)](a7_0x3b6340[_0x34048a(0xca)](_0x34048a(0xdf)));const _0x38e9ea=_0x131143[_0x34048a(0xfe)]||_0x34048a(0xf4),_0x4f7f83=await promptSiteSelection(_0x38e9ea,_0x22f463,'Setup\x20cancelled');if(!_0x4f7f83)return 0x1;const _0x444ab4=resolveSite(_0x4f7f83),_0x58ca63=await promptAuthMethod();if(!_0x58ca63)return console[_0x34048a(0x128)](_0x34048a(0xd0)),0x1;if(_0x58ca63===_0x34048a(0x107)){const {accountName:_0x49e59a}=_0x131143;return await runOAuthLoginFlow(_0x444ab4,_0x22f463,_0x131143['logLevel']??LogLevel[_0x34048a(0xce)],{'accountName':_0x49e59a}),0x0;}console[_0x34048a(0x128)](_0x34048a(0x123)+_0x444ab4),console[_0x34048a(0x128)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console['log']('\x20\x20'+getConsoleUrl(_0x444ab4,'/app/mp/ak'));const _0x28cd99=await a7_0x396374({'type':'password','name':'apiKey','message':_0x34048a(0xdb),'validate':_0xbad1cb=>{const _0x2f2346=_0x34048a;if(!_0xbad1cb||!_0xbad1cb['trim']())return _0x2f2346(0xf2);return!![];}});if(!_0x28cd99[_0x34048a(0xf8)])return console[_0x34048a(0x128)](_0x34048a(0xd0)),0x1;const _0x20b518=_0x28cd99['apiKey'];console[_0x34048a(0x128)]('Validating\x20API\x20key...');try{const _0x24fd58=TDX[_0x34048a(0xfb)]({'site':_0x444ab4,'apiKey':_0x20b518[_0x34048a(0x10c)](),'logLevel':_0x131143['logLevel']??LogLevel[_0x34048a(0xce)]}),_0x253fe2=await _0x24fd58[_0x34048a(0xed)][_0x34048a(0xfa)]();console[_0x34048a(0x128)](_0x34048a(0x118)+_0x253fe2[_0x34048a(0x115)]+')');const _0x18cf2a=await isKeychainAvailable();_0x18cf2a?(await saveAPIKeyAsync(_0x20b518[_0x34048a(0x10c)](),_0x444ab4,_0x22f463),console['log'](_0x34048a(0xf3)+(_0x22f463?'\x20(profile:\x20'+_0x22f463+')':''))):(console['warn'](a7_0x3b6340[_0x34048a(0xeb)](_0x34048a(0xe8))),console[_0x34048a(0x124)](a7_0x3b6340['yellow'](_0x34048a(0x106))));if(_0x22f463){const _0x5ef681={'site':_0x444ab4};saveProfileToUserConfig(_0x22f463,_0x5ef681),console['log'](_0x34048a(0xfd)+_0x22f463+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x444ab4),console[_0x34048a(0x128)](_0x34048a(0x10b)+_0x444ab4);const _0x5bf4d2=_0x22f463?_0x34048a(0x12a)+_0x22f463:'';return console[_0x34048a(0x128)](),console[_0x34048a(0x128)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x34048a(0x128)](_0x34048a(0x113)+_0x5bf4d2+_0x34048a(0x108)),console['log']('\x20\x20tdx'+_0x5bf4d2+_0x34048a(0xd6)),0x0;}catch(_0x264bda){if(_0x264bda instanceof HTTPClientError&&_0x264bda[_0x34048a(0x10d)]===0x191)return printAuthError(_0x264bda),0x1;return console['error'](a7_0x3b6340[_0x34048a(0xe9)](_0x34048a(0xf9)+(_0x264bda instanceof Error?_0x264bda['message']:String(_0x264bda)))),console[_0x34048a(0x12d)](_0x34048a(0xda)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x31aac8(0xe2)]=a7_0x31aac8(0x122);['description']=a7_0x31aac8(0xf5);async['execute'](_0x20376a){const _0x2e56a9=a7_0x31aac8,{options:_0x546b53,tdx:_0x55af86}=_0x20376a,_0x825ba3=_0x546b53[_0x2e56a9(0xfe)],_0x92e192=_0x546b53[_0x2e56a9(0x12b)],_0x2e17a1=_0x92e192?_0x92e192:_0x2e56a9(0x11f);console['log'](_0x2e56a9(0xf6)+_0x2e17a1+_0x2e56a9(0x109)+_0x825ba3+')');const _0x222418=await getOAuthTokens(_0x92e192);if(_0x222418)console[_0x2e56a9(0x128)](_0x2e56a9(0xfc)),console[_0x2e56a9(0x128)](_0x2e56a9(0xe0)+(_0x92e192?_0x2e56a9(0xf0)+_0x92e192+')':''));else{const _0x2ddb15=await resolveAPIKeyAsync(_0x825ba3,_0x92e192);if(_0x2ddb15){const {source:_0x5bd8df,isDeprecated:_0xde4c5d}=_0x2ddb15,_0x184280=_0x2e56a9(0xee)+_0x5bd8df;console[_0x2e56a9(0x128)](_0xde4c5d?a7_0x3b6340[_0x2e56a9(0xeb)](_0x184280):_0x184280);}else console[_0x2e56a9(0x128)](a7_0x3b6340['yellow'](_0x2e56a9(0x104)));}try{const _0x2a7695=await _0x55af86['jobs'][_0x2e56a9(0xfa)]();return console[_0x2e56a9(0x128)](a7_0x3b6340[_0x2e56a9(0x127)]('✓\x20Authentication\x20successful\x0a')),console[_0x2e56a9(0x128)](_0x2e56a9(0x126)+_0x2a7695[_0x2e56a9(0x115)]),(_0x2a7695['first_name']||_0x2a7695[_0x2e56a9(0xd2)])&&console[_0x2e56a9(0x128)]('Name:\x20'+[_0x2a7695[_0x2e56a9(0x117)],_0x2a7695[_0x2e56a9(0xd2)]][_0x2e56a9(0x105)](Boolean)['join']('\x20')),0x0;}catch(_0x223a4b){return _0x223a4b instanceof HTTPClientError&&_0x223a4b[_0x2e56a9(0x10d)]===0x191?printAuthError(_0x223a4b,!![],_0x92e192):console['error'](a7_0x3b6340[_0x2e56a9(0xe9)](_0x2e56a9(0xf9)+(_0x223a4b instanceof Error?_0x223a4b[_0x2e56a9(0xe4)]:String(_0x223a4b)))),0x1;}}}export class AuthTokenCommand extends BaseCommand{[a7_0x31aac8(0xe2)]=a7_0x31aac8(0x11d);[a7_0x31aac8(0x102)]=a7_0x31aac8(0xdd);async['execute'](_0x2aac03){const _0x224425=a7_0x31aac8,{options:_0x3efdc3}=_0x2aac03,_0x4942a7=await resolveOAuthAccessToken({'site':resolveSite(_0x3efdc3[_0x224425(0xfe)]||'us01'),'profile':_0x3efdc3[_0x224425(0x12b)],'proxy':loadGlobalProxy()});return process[_0x224425(0x11b)][_0x224425(0xf1)](_0x4942a7+'\x0a'),0x0;}}export class AuthClearCommand extends BaseCommand{[a7_0x31aac8(0xe2)]=a7_0x31aac8(0xcb);[a7_0x31aac8(0x102)]=a7_0x31aac8(0xcd);async[a7_0x31aac8(0x111)](_0x249d3d){const _0x1bcd7e=a7_0x31aac8,{options:_0x21a4ab}=_0x249d3d,_0x51fc39=_0x21a4ab[_0x1bcd7e(0x12b)];console['log'](a7_0x3b6340[_0x1bcd7e(0xca)]('tdx:\x20auth\x20clear'));const _0x32a412=await isKeychainAvailable();if(!_0x32a412)return console[_0x1bcd7e(0x12d)](a7_0x3b6340[_0x1bcd7e(0xe9)](_0x1bcd7e(0xd4))),0x1;const [_0x55e2f5,_0x30ffe0]=await Promise[_0x1bcd7e(0x125)]([deleteKeychainAPIKey(_0x51fc39),deleteOAuthTokens(_0x51fc39)]);if(_0x55e2f5||_0x30ffe0){clearCredentialCache();const _0x423f74=[_0x55e2f5&&'API\x20key',_0x30ffe0&&'OAuth\x20tokens'][_0x1bcd7e(0x105)](Boolean)[_0x1bcd7e(0x110)]('\x20and\x20');return console[_0x1bcd7e(0x128)]('✓\x20'+_0x423f74+_0x1bcd7e(0x129)+(_0x51fc39?_0x1bcd7e(0xf0)+_0x51fc39+')':'')),0x0;}else return console[_0x1bcd7e(0x128)](_0x1bcd7e(0xcc)+(_0x51fc39?'\x20for\x20profile:\x20'+_0x51fc39:'')),0x1;}}