@treasuredata/tdx 2026.8.7 → 2026.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (312) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/cas-command.js +1 -1
  13. package/dist/commands/cas-segment-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/codex-command.js +1 -1
  19. package/dist/commands/command.js +1 -1
  20. package/dist/commands/connection-command.js +1 -1
  21. package/dist/commands/databases.js +1 -1
  22. package/dist/commands/delivery-command.js +1 -1
  23. package/dist/commands/describe.js +1 -1
  24. package/dist/commands/engage-always-on-campaign-pull-command.js +1 -1
  25. package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
  26. package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
  27. package/dist/commands/engage-campaign-pull-command.js +1 -1
  28. package/dist/commands/engage-campaign-push-command.js +1 -1
  29. package/dist/commands/engage-campaign-validate-command.js +1 -1
  30. package/dist/commands/engage-command.d.ts +48 -0
  31. package/dist/commands/engage-command.d.ts.map +1 -1
  32. package/dist/commands/engage-command.js +1 -1
  33. package/dist/commands/engage-command.js.map +1 -1
  34. package/dist/commands/engage-landing-page-command.d.ts +48 -0
  35. package/dist/commands/engage-landing-page-command.d.ts.map +1 -0
  36. package/dist/commands/engage-landing-page-command.js +1 -0
  37. package/dist/commands/engage-landing-page-command.js.map +1 -0
  38. package/dist/commands/engage-template-pull-command.js +1 -1
  39. package/dist/commands/engage-template-push-command.js +1 -1
  40. package/dist/commands/engage-template-validate-command.js +1 -1
  41. package/dist/commands/job-command.js +1 -1
  42. package/dist/commands/journey-command.js +1 -1
  43. package/dist/commands/journey-validate-command.js +1 -1
  44. package/dist/commands/llm-command.js +1 -1
  45. package/dist/commands/mcp-command.js +1 -1
  46. package/dist/commands/p13n-command.js +1 -1
  47. package/dist/commands/parent-segment-command.js +1 -1
  48. package/dist/commands/policy-command.js +1 -1
  49. package/dist/commands/profile-command.js +1 -1
  50. package/dist/commands/profiles-command.js +1 -1
  51. package/dist/commands/query-command.js +1 -1
  52. package/dist/commands/schedule-command.js +1 -1
  53. package/dist/commands/segment-command.js +1 -1
  54. package/dist/commands/segment-create-command.js +1 -1
  55. package/dist/commands/segment-fields-command.js +1 -1
  56. package/dist/commands/segment-move-command.js +1 -1
  57. package/dist/commands/segment-pull-command.js +1 -1
  58. package/dist/commands/segment-push-command.js +1 -1
  59. package/dist/commands/segment-update-command.js +1 -1
  60. package/dist/commands/segment-use-command.js +1 -1
  61. package/dist/commands/segment-validate-command.js +1 -1
  62. package/dist/commands/segments.js +1 -1
  63. package/dist/commands/show.js +1 -1
  64. package/dist/commands/status-command.js +1 -1
  65. package/dist/commands/table-deleted.js +1 -1
  66. package/dist/commands/tables.js +1 -1
  67. package/dist/commands/unset-command.js +1 -1
  68. package/dist/commands/upgrade-command.js +1 -1
  69. package/dist/commands/use-command.js +1 -1
  70. package/dist/commands/user-command.js +1 -1
  71. package/dist/commands/work-command.js +1 -1
  72. package/dist/commands/workflow-command.js +1 -1
  73. package/dist/core/auth.js +1 -1
  74. package/dist/core/command-output.js +1 -1
  75. package/dist/core/config.js +1 -1
  76. package/dist/core/connection-cache.js +1 -1
  77. package/dist/core/constants.js +1 -1
  78. package/dist/core/credential-cache.js +1 -1
  79. package/dist/core/global-context.js +1 -1
  80. package/dist/core/keychain.js +1 -1
  81. package/dist/core/oauth-keychain.js +1 -1
  82. package/dist/core/oauth.js +1 -1
  83. package/dist/core/profile.js +1 -1
  84. package/dist/core/project-config.js +1 -1
  85. package/dist/core/session.js +1 -1
  86. package/dist/core/site-mismatch.js +1 -1
  87. package/dist/core/user-cache.js +1 -1
  88. package/dist/core/version.js +1 -1
  89. package/dist/index.js +1 -1
  90. package/dist/mcp/server.js +1 -1
  91. package/dist/mcp/tools/index.js +1 -1
  92. package/dist/mcp/tools/tdx-run.d.ts +28 -0
  93. package/dist/mcp/tools/tdx-run.d.ts.map +1 -1
  94. package/dist/mcp/tools/tdx-run.js +1 -1
  95. package/dist/mcp/tools/tdx-run.js.map +1 -1
  96. package/dist/mcp/tools/tdx-search.js +1 -1
  97. package/dist/mcp/tools/work-create-item.js +1 -1
  98. package/dist/mcp/utils.js +1 -1
  99. package/dist/proxy/claude-usage-tracker.js +1 -1
  100. package/dist/proxy/passthrough-server.js +1 -1
  101. package/dist/proxy/sse-usage-parser.js +1 -1
  102. package/dist/sdk/agent/agent-config.js +1 -1
  103. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  104. package/dist/sdk/agent/agent-yaml.js +1 -1
  105. package/dist/sdk/agent/test/evaluator.js +1 -1
  106. package/dist/sdk/agent/test/executor.js +1 -1
  107. package/dist/sdk/agent/test/index.js +1 -1
  108. package/dist/sdk/agent/test/output.js +1 -1
  109. package/dist/sdk/agent/test/parser.js +1 -1
  110. package/dist/sdk/agent/tool-target-registry.js +1 -1
  111. package/dist/sdk/api.js +1 -1
  112. package/dist/sdk/auth-token.js +1 -1
  113. package/dist/sdk/cas/cas-api-client.js +1 -1
  114. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  115. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  116. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  117. package/dist/sdk/cas/cas-segment-schema.js +1 -1
  118. package/dist/sdk/cas/cas-segment-validator.js +1 -1
  119. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  120. package/dist/sdk/cas/index.js +1 -1
  121. package/dist/sdk/cas/pull-workflow.js +1 -1
  122. package/dist/sdk/cas/push-workflow.js +1 -1
  123. package/dist/sdk/cas/validate-files.js +1 -1
  124. package/dist/sdk/client/cdp-api-client.js +1 -1
  125. package/dist/sdk/client/delivery-api-client.js +1 -1
  126. package/dist/sdk/client/endpoints.js +1 -1
  127. package/dist/sdk/client/engage-api-client.d.ts +58 -1
  128. package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
  129. package/dist/sdk/client/engage-api-client.js +1 -1
  130. package/dist/sdk/client/engage-api-client.js.map +1 -1
  131. package/dist/sdk/client/http-client.js +1 -1
  132. package/dist/sdk/client/llm-api-client.js +1 -1
  133. package/dist/sdk/client/oauth-refresh.js +1 -1
  134. package/dist/sdk/client/p13n-studio-api-client.js +1 -1
  135. package/dist/sdk/client/rate-limiter.js +1 -1
  136. package/dist/sdk/client/td-api-client.js +1 -1
  137. package/dist/sdk/client/trino-api-client.js +1 -1
  138. package/dist/sdk/client/workflow-client.js +1 -1
  139. package/dist/sdk/connection-validator.js +1 -1
  140. package/dist/sdk/connection.js +1 -1
  141. package/dist/sdk/delivery.js +1 -1
  142. package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
  143. package/dist/sdk/engage/always-on-campaign-push.js +1 -1
  144. package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
  145. package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
  146. package/dist/sdk/engage/campaign-pull.js +1 -1
  147. package/dist/sdk/engage/campaign-push.js +1 -1
  148. package/dist/sdk/engage/campaign-validator.js +1 -1
  149. package/dist/sdk/engage/campaign-yaml.js +1 -1
  150. package/dist/sdk/engage/landing-page-init.d.ts +15 -0
  151. package/dist/sdk/engage/landing-page-init.d.ts.map +1 -0
  152. package/dist/sdk/engage/landing-page-init.js +1 -0
  153. package/dist/sdk/engage/landing-page-init.js.map +1 -0
  154. package/dist/sdk/engage/landing-page-public-asset.d.ts +16 -0
  155. package/dist/sdk/engage/landing-page-public-asset.d.ts.map +1 -0
  156. package/dist/sdk/engage/landing-page-public-asset.js +1 -0
  157. package/dist/sdk/engage/landing-page-public-asset.js.map +1 -0
  158. package/dist/sdk/engage/landing-page-pull.d.ts +42 -0
  159. package/dist/sdk/engage/landing-page-pull.d.ts.map +1 -0
  160. package/dist/sdk/engage/landing-page-pull.js +1 -0
  161. package/dist/sdk/engage/landing-page-pull.js.map +1 -0
  162. package/dist/sdk/engage/landing-page-push.d.ts +44 -0
  163. package/dist/sdk/engage/landing-page-push.d.ts.map +1 -0
  164. package/dist/sdk/engage/landing-page-push.js +1 -0
  165. package/dist/sdk/engage/landing-page-push.js.map +1 -0
  166. package/dist/sdk/engage/landing-page-static-site.d.ts +37 -0
  167. package/dist/sdk/engage/landing-page-static-site.d.ts.map +1 -0
  168. package/dist/sdk/engage/landing-page-static-site.js +1 -0
  169. package/dist/sdk/engage/landing-page-static-site.js.map +1 -0
  170. package/dist/sdk/engage/landing-page-validator.d.ts +17 -0
  171. package/dist/sdk/engage/landing-page-validator.d.ts.map +1 -0
  172. package/dist/sdk/engage/landing-page-validator.js +1 -0
  173. package/dist/sdk/engage/landing-page-validator.js.map +1 -0
  174. package/dist/sdk/engage/landing-page-workspace.d.ts +10 -0
  175. package/dist/sdk/engage/landing-page-workspace.d.ts.map +1 -0
  176. package/dist/sdk/engage/landing-page-workspace.js +1 -0
  177. package/dist/sdk/engage/landing-page-workspace.js.map +1 -0
  178. package/dist/sdk/engage/landing-page-yaml.d.ts +20 -0
  179. package/dist/sdk/engage/landing-page-yaml.d.ts.map +1 -0
  180. package/dist/sdk/engage/landing-page-yaml.js +1 -0
  181. package/dist/sdk/engage/landing-page-yaml.js.map +1 -0
  182. package/dist/sdk/engage/template-pull.js +1 -1
  183. package/dist/sdk/engage/template-push.js +1 -1
  184. package/dist/sdk/engage/template-validator.js +1 -1
  185. package/dist/sdk/engage/template-yaml.js +1 -1
  186. package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
  187. package/dist/sdk/engage/types/campaign-def.js +1 -1
  188. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  189. package/dist/sdk/engage/types/landing-page-schema.d.ts +21 -0
  190. package/dist/sdk/engage/types/landing-page-schema.d.ts.map +1 -0
  191. package/dist/sdk/engage/types/landing-page-schema.js +1 -0
  192. package/dist/sdk/engage/types/landing-page-schema.js.map +1 -0
  193. package/dist/sdk/engage/types/template-schema.js +1 -1
  194. package/dist/sdk/engage.d.ts +91 -1
  195. package/dist/sdk/engage.d.ts.map +1 -1
  196. package/dist/sdk/engage.js +1 -1
  197. package/dist/sdk/engage.js.map +1 -1
  198. package/dist/sdk/errors.js +1 -1
  199. package/dist/sdk/index.d.ts +1 -1
  200. package/dist/sdk/index.d.ts.map +1 -1
  201. package/dist/sdk/index.js +1 -1
  202. package/dist/sdk/index.js.map +1 -1
  203. package/dist/sdk/io/index.js +1 -1
  204. package/dist/sdk/io/node-filesystem.js +1 -1
  205. package/dist/sdk/job.js +1 -1
  206. package/dist/sdk/journey.js +1 -1
  207. package/dist/sdk/llm/chat-cache.js +1 -1
  208. package/dist/sdk/llm/index.js +1 -1
  209. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  210. package/dist/sdk/llm/model-factors.js +1 -1
  211. package/dist/sdk/llm/user-settings.js +1 -1
  212. package/dist/sdk/p13n-studio.js +1 -1
  213. package/dist/sdk/personalization.js +1 -1
  214. package/dist/sdk/policy.js +1 -1
  215. package/dist/sdk/query/deleted-table-validation.js +1 -1
  216. package/dist/sdk/query/index.js +1 -1
  217. package/dist/sdk/query/sql-parser.js +1 -1
  218. package/dist/sdk/realtime.js +1 -1
  219. package/dist/sdk/schedule.js +1 -1
  220. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  221. package/dist/sdk/segment/fields-display.js +1 -1
  222. package/dist/sdk/segment/file-discovery.js +1 -1
  223. package/dist/sdk/segment/journey-utils.js +1 -1
  224. package/dist/sdk/segment/journey-validator.js +1 -1
  225. package/dist/sdk/segment/journey-yaml.js +1 -1
  226. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  227. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  228. package/dist/sdk/segment/pull-workflow.js +1 -1
  229. package/dist/sdk/segment/push-recovery.js +1 -1
  230. package/dist/sdk/segment/push-workflow.js +1 -1
  231. package/dist/sdk/segment/resolution-context.js +1 -1
  232. package/dist/sdk/segment/segment-path-parser.js +1 -1
  233. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  234. package/dist/sdk/segment/segment-validator.js +1 -1
  235. package/dist/sdk/segment/target-resolution.js +1 -1
  236. package/dist/sdk/segment/tdx-config.js +1 -1
  237. package/dist/sdk/segment/types/activation-schema.js +1 -1
  238. package/dist/sdk/segment/types/journey-def.js +1 -1
  239. package/dist/sdk/segment/types/journey-schema.js +1 -1
  240. package/dist/sdk/segment/types/segment-def.js +1 -1
  241. package/dist/sdk/segment/types/segment-schema.js +1 -1
  242. package/dist/sdk/segment/validate-files.js +1 -1
  243. package/dist/sdk/segment/yaml-validator.d.ts +1 -1
  244. package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
  245. package/dist/sdk/segment/yaml-validator.js +1 -1
  246. package/dist/sdk/segment/yaml-validator.js.map +1 -1
  247. package/dist/sdk/segment.js +1 -1
  248. package/dist/sdk/types/engage.d.ts +182 -0
  249. package/dist/sdk/types/engage.d.ts.map +1 -1
  250. package/dist/sdk/types/index.d.ts +1 -1
  251. package/dist/sdk/types/index.d.ts.map +1 -1
  252. package/dist/sdk/types/index.js +1 -1
  253. package/dist/sdk/types/index.js.map +1 -1
  254. package/dist/sdk/types/progress.js +1 -1
  255. package/dist/sdk/types/workspace.js +1 -1
  256. package/dist/sdk/user.js +1 -1
  257. package/dist/sdk/util/format-detector.js +1 -1
  258. package/dist/sdk/util/formatters.js +1 -1
  259. package/dist/sdk/util/index.js +1 -1
  260. package/dist/sdk/util/paginate.js +1 -1
  261. package/dist/sdk/util/tree-formatter.js +1 -1
  262. package/dist/sdk/util/tree-search.js +1 -1
  263. package/dist/sdk/workflow/archive-validation.js +1 -1
  264. package/dist/sdk/workflow/clone-workflow.js +1 -1
  265. package/dist/sdk/workflow/index.js +1 -1
  266. package/dist/sdk/workflow/pull-workflow.js +1 -1
  267. package/dist/sdk/workflow/push-workflow.js +1 -1
  268. package/dist/sdk/workflow/task-graph.js +1 -1
  269. package/dist/sdk/workflow/tdx-config.js +1 -1
  270. package/dist/sdk/workflow/workflow-utils.js +1 -1
  271. package/dist/sdk/workspace/access-tracker.js +1 -1
  272. package/dist/sdk/workspace/frontmatter.js +1 -1
  273. package/dist/sdk/workspace/git.js +1 -1
  274. package/dist/sdk/workspace/index.js +1 -1
  275. package/dist/sdk/workspace/templates.js +1 -1
  276. package/dist/sdk/workspace/weekly.js +1 -1
  277. package/dist/sdk/workspace/wikilinks.js +1 -1
  278. package/dist/test-utils/command-runner.js +1 -1
  279. package/dist/test-utils/factories.js +1 -1
  280. package/dist/test-utils/fixtures.js +1 -1
  281. package/dist/test-utils/http-mock.js +1 -1
  282. package/dist/test-utils/index.js +1 -1
  283. package/dist/utils/async.js +1 -1
  284. package/dist/utils/claude-code-state.js +1 -1
  285. package/dist/utils/colors.js +1 -1
  286. package/dist/utils/diff.js +1 -1
  287. package/dist/utils/file-permissions.js +1 -1
  288. package/dist/utils/file-reader.js +1 -1
  289. package/dist/utils/github-releases.js +1 -1
  290. package/dist/utils/global-cache.js +1 -1
  291. package/dist/utils/json-loader.js +1 -1
  292. package/dist/utils/local-cache.js +1 -1
  293. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  294. package/dist/utils/logger/formatters/index.js +1 -1
  295. package/dist/utils/logger/handlers/console-handler.js +1 -1
  296. package/dist/utils/logger/handlers/file-handler.js +1 -1
  297. package/dist/utils/logger/handlers/index.js +1 -1
  298. package/dist/utils/logger/handlers/null-handler.js +1 -1
  299. package/dist/utils/logger/index.js +1 -1
  300. package/dist/utils/logger/logger.js +1 -1
  301. package/dist/utils/logger/types.js +1 -1
  302. package/dist/utils/option-validation.js +1 -1
  303. package/dist/utils/process.js +1 -1
  304. package/dist/utils/prompt.js +1 -1
  305. package/dist/utils/proxy-fetch.js +1 -1
  306. package/dist/utils/spinner.js +1 -1
  307. package/dist/utils/sse-parser.js +1 -1
  308. package/dist/utils/string-utils.js +1 -1
  309. package/dist/utils/table-ref-parser.js +1 -1
  310. package/dist/utils/tdx-logger.js +1 -1
  311. package/dist/utils/version-check.js +1 -1
  312. package/package.json +1 -1
@@ -1 +1 @@
1
- function a3_0x1eed(_0x179ce5,_0x50e001){_0x179ce5=_0x179ce5-0x121;const _0x31b74f=a3_0x31b7();let _0x1eed1d=_0x31b74f[_0x179ce5];return _0x1eed1d;}const a3_0x5e6396=a3_0x1eed;(function(_0x36f5be,_0x5e9383){const _0x39ace8=a3_0x1eed,_0x1d698c=_0x36f5be();while(!![]){try{const _0x2e866e=-parseInt(_0x39ace8(0x142))/0x1+-parseInt(_0x39ace8(0x12c))/0x2+-parseInt(_0x39ace8(0x129))/0x3*(-parseInt(_0x39ace8(0x13f))/0x4)+-parseInt(_0x39ace8(0x13c))/0x5*(parseInt(_0x39ace8(0x134))/0x6)+-parseInt(_0x39ace8(0x141))/0x7+parseInt(_0x39ace8(0x13a))/0x8+parseInt(_0x39ace8(0x128))/0x9;if(_0x2e866e===_0x5e9383)break;else _0x1d698c['push'](_0x1d698c['shift']());}catch(_0x223ac0){_0x1d698c['push'](_0x1d698c['shift']());}}}(a3_0x31b7,0x4d577));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';export class ActivationsCommand extends BaseCommand{['name']=a3_0x5e6396(0x121);[a3_0x5e6396(0x127)]=a3_0x5e6396(0x124);async[a3_0x5e6396(0x133)](_0x430b02){const _0x4e5900=a3_0x5e6396,{options:_0x4d90b9,args:_0x930d58,tdx:_0x2a0c66}=_0x430b02;if(_0x930d58[_0x4e5900(0x135)]===0x0)return console[_0x4e5900(0x140)](_0x4e5900(0x137)),console[_0x4e5900(0x140)](_0x4e5900(0x139)),0x1;try{const {parentId:_0x2c6f0a,childId:_0x296d91}=parseSegmentRef(_0x930d58[0x0]);if(!_0x296d91)return console['error'](_0x4e5900(0x13d)),console[_0x4e5900(0x140)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x4d90b9[_0x4e5900(0x12f)]&&(console[_0x4e5900(0x140)](_0x4e5900(0x125)+_0x4d90b9[_0x4e5900(0x12d)]),console[_0x4e5900(0x140)](_0x4e5900(0x126)+_0x2c6f0a),console['error']('Child\x20name:\x20'+_0x296d91));const _0x5d91dd=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2c6f0a+_0x4e5900(0x138),()=>_0x2a0c66['segment']['resolveParentId'](_0x2c6f0a),{'verbose':_0x4d90b9[_0x4e5900(0x12f)]}),_0x5e702b=_0x5d91dd[_0x4e5900(0x12a)];_0x4d90b9[_0x4e5900(0x12f)]&&console[_0x4e5900(0x140)](_0x4e5900(0x13b)+_0x5e702b);const _0x5d7a9b=await withSpinner(_0x4e5900(0x122)+_0x296d91+_0x4e5900(0x138),()=>_0x2a0c66['segment'][_0x4e5900(0x143)](_0x5e702b,_0x296d91),{'verbose':_0x4d90b9[_0x4e5900(0x12f)]}),_0x1b7b68=_0x5d7a9b[_0x4e5900(0x12a)];_0x4d90b9[_0x4e5900(0x12f)]&&console[_0x4e5900(0x140)](_0x4e5900(0x130)+_0x1b7b68);const _0x2fa6e4=await withSpinner(_0x4e5900(0x13e)+_0x296d91+'\x27...',()=>_0x2a0c66[_0x4e5900(0x123)]['listActivations'](_0x5e702b,_0x1b7b68),{'verbose':_0x4d90b9[_0x4e5900(0x12f)]}),_0x49e7c8=_0x2fa6e4[_0x4e5900(0x12a)];return console[_0x4e5900(0x140)]('✔\x20Found\x20'+_0x49e7c8[_0x4e5900(0x135)]+_0x4e5900(0x136)+(_0x49e7c8[_0x4e5900(0x135)]!==0x1?'s':'')),await handleSDKOutput(_0x49e7c8,_0x4d90b9),0x0;}catch(_0xc9452){if(_0xc9452 instanceof SDKError)return console[_0x4e5900(0x140)](_0x4e5900(0x12b)+_0xc9452[_0x4e5900(0x132)]),_0xc9452[_0x4e5900(0x12e)]&&console[_0x4e5900(0x140)](_0x4e5900(0x131)+_0xc9452[_0x4e5900(0x12e)]),0x1;throw _0xc9452;}}}function a3_0x31b7(){const _0x18de9b=['6DArwYP','length','\x20activation','Error:\x20Segment\x20name\x20is\x20required','\x27...','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','1451816PkPZUg','Resolved\x20parent\x20ID:\x20','1628470ZplQvH','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','Listing\x20activations\x20for\x20segment\x20\x27','2179292DsRTdQ','error','1642669wCnAyD','193590sYChUr','resolveSegmentId','activations','Resolving\x20child\x20segment\x20\x27','segment','List\x20activations\x20for\x20a\x20segment','Site:\x20','Parent\x20name:\x20','description','3789351fDLxnd','3CsEMzw','data','Error:\x20','153194vnXudk','site','cause','verbose','Resolved\x20child\x20ID:\x20','\x20\x20Cause:\x20','message','execute'];a3_0x31b7=function(){return _0x18de9b;};return a3_0x31b7();}
1
+ const a3_0x2093a4=a3_0x5cf8;(function(_0x41cee5,_0x661d0c){const _0x41a733=a3_0x5cf8,_0x54e01b=_0x41cee5();while(!![]){try{const _0x4046bc=-parseInt(_0x41a733(0x191))/0x1*(parseInt(_0x41a733(0x174))/0x2)+-parseInt(_0x41a733(0x188))/0x3+parseInt(_0x41a733(0x18f))/0x4+parseInt(_0x41a733(0x17d))/0x5+-parseInt(_0x41a733(0x17b))/0x6*(-parseInt(_0x41a733(0x179))/0x7)+-parseInt(_0x41a733(0x18d))/0x8*(parseInt(_0x41a733(0x18b))/0x9)+parseInt(_0x41a733(0x192))/0xa;if(_0x4046bc===_0x661d0c)break;else _0x54e01b['push'](_0x54e01b['shift']());}catch(_0x43a407){_0x54e01b['push'](_0x54e01b['shift']());}}}(a3_0x204e,0xcab25));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a3_0x5cf8(_0x2fc127,_0x263f38){_0x2fc127=_0x2fc127-0x174;const _0x204e7c=a3_0x204e();let _0x5cf8b7=_0x204e7c[_0x2fc127];return _0x5cf8b7;}import{withSpinner}from'../utils/spinner.js';function a3_0x204e(){const _0x1aa779=['4142870JPqCfD','description','resolveParentId','Resolved\x20child\x20ID:\x20','Resolving\x20parent\x20segment\x20\x27','Error:\x20Segment\x20name\x20is\x20required','cause','name','Parent\x20name:\x20','execute','✔\x20Found\x20','1767894lZqnnf','listActivations','verbose','72vWLHrH','activations','1216744AQQANw','Resolving\x20child\x20segment\x20\x27','763472QOQUCq','resolveSegmentId','1132CtQspM','26489330joqdmV','message','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Listing\x20activations\x20for\x20segment\x20\x27','data','\x20\x20Cause:\x20','Child\x20name:\x20','error','2228pMbMOr','Error:\x20','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','Site:\x20','List\x20activations\x20for\x20a\x20segment','504NQgTqC','length','19080hABluF','\x27...'];a3_0x204e=function(){return _0x1aa779;};return a3_0x204e();}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x2093a4(0x184)]=a3_0x2093a4(0x18c);[a3_0x2093a4(0x17e)]=a3_0x2093a4(0x178);async[a3_0x2093a4(0x186)](_0x43c9a1){const _0x24d27d=a3_0x2093a4,{options:_0x16aa04,args:_0x2ae6fa,tdx:_0x1c3f20}=_0x43c9a1;if(_0x2ae6fa['length']===0x0)return console[_0x24d27d(0x199)](_0x24d27d(0x182)),console[_0x24d27d(0x199)](_0x24d27d(0x194)),0x1;try{const {parentId:_0x2f0c36,childId:_0x1e96c0}=parseSegmentRef(_0x2ae6fa[0x0]);if(!_0x1e96c0)return console['error'](_0x24d27d(0x176)),console[_0x24d27d(0x199)](_0x24d27d(0x194)),0x1;_0x16aa04[_0x24d27d(0x18a)]&&(console[_0x24d27d(0x199)](_0x24d27d(0x177)+_0x16aa04['site']),console['error'](_0x24d27d(0x185)+_0x2f0c36),console['error'](_0x24d27d(0x198)+_0x1e96c0));const _0x46c93d=await withSpinner(_0x24d27d(0x181)+_0x2f0c36+_0x24d27d(0x17c),()=>_0x1c3f20['segment'][_0x24d27d(0x17f)](_0x2f0c36),{'verbose':_0x16aa04[_0x24d27d(0x18a)]}),_0x247802=_0x46c93d[_0x24d27d(0x196)];_0x16aa04[_0x24d27d(0x18a)]&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x247802);const _0x4145e4=await withSpinner(_0x24d27d(0x18e)+_0x1e96c0+_0x24d27d(0x17c),()=>_0x1c3f20['segment'][_0x24d27d(0x190)](_0x247802,_0x1e96c0),{'verbose':_0x16aa04['verbose']}),_0x59143f=_0x4145e4[_0x24d27d(0x196)];_0x16aa04[_0x24d27d(0x18a)]&&console[_0x24d27d(0x199)](_0x24d27d(0x180)+_0x59143f);const _0x15d678=await withSpinner(_0x24d27d(0x195)+_0x1e96c0+_0x24d27d(0x17c),()=>_0x1c3f20['segment'][_0x24d27d(0x189)](_0x247802,_0x59143f),{'verbose':_0x16aa04[_0x24d27d(0x18a)]}),_0xc54b76=_0x15d678[_0x24d27d(0x196)];return console[_0x24d27d(0x199)](_0x24d27d(0x187)+_0xc54b76[_0x24d27d(0x17a)]+'\x20activation'+(_0xc54b76[_0x24d27d(0x17a)]!==0x1?'s':'')),await handleSDKOutput(_0xc54b76,_0x16aa04),0x0;}catch(_0x44508d){if(_0x44508d instanceof SDKError)return console[_0x24d27d(0x199)](_0x24d27d(0x175)+_0x44508d[_0x24d27d(0x193)]),_0x44508d[_0x24d27d(0x183)]&&console[_0x24d27d(0x199)](_0x24d27d(0x197)+_0x44508d[_0x24d27d(0x183)]),0x1;throw _0x44508d;}}}
@@ -1 +1 @@
1
- const a4_0x30fe7e=a4_0x7cc9;(function(_0x302502,_0x3b895c){const _0x65398c=a4_0x7cc9,_0x24cfa9=_0x302502();while(!![]){try{const _0x4a38ea=-parseInt(_0x65398c(0xde))/0x1+parseInt(_0x65398c(0xc2))/0x2*(-parseInt(_0x65398c(0xb4))/0x3)+-parseInt(_0x65398c(0x126))/0x4+parseInt(_0x65398c(0x12b))/0x5+parseInt(_0x65398c(0xca))/0x6*(-parseInt(_0x65398c(0xa1))/0x7)+parseInt(_0x65398c(0xd9))/0x8+parseInt(_0x65398c(0xfc))/0x9*(parseInt(_0x65398c(0x121))/0xa);if(_0x4a38ea===_0x3b895c)break;else _0x24cfa9['push'](_0x24cfa9['shift']());}catch(_0x71c4d2){_0x24cfa9['push'](_0x24cfa9['shift']());}}}(a4_0x406f,0x2bd4d));import a4_0x5c037e from'chalk';import a4_0x4fc7ef from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';function a4_0x7cc9(_0x179dbf,_0x4e26bf){_0x179dbf=_0x179dbf-0x76;const _0x406f5d=a4_0x406f();let _0x7cc982=_0x406f5d[_0x179dbf];return _0x7cc982;}function a4_0x406f(){const _0x2d8479=['Errors:','execute','action','newProjectName','\x0aChanges\x20to\x20chat\x20interface\x20\x27','Output:\x20','yellow','pushProject','\x20changed','experimentalArtifacts','Cancelled','No\x20tdx.json\x20found\x20in\x20','tdx.json','\x0aChanges\x20to\x20integration\x20\x27','yes','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','New\x20project:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20\x20Integration\x20\x22','\x0a✔\x20Pulled\x20','\x0aRun\x20\x27tdx\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','Pushing\x20agent\x20from\x20\x22','diff','New\x20project\x20name\x20is\x20required','Output\x20path:\x20','textKnowledgeBases','Cannot\x20clone\x20from\x20context\x20project\x20\x22','agentName','sourceProjectName','profile','Project\x20cloned\x20successfully','created','\x20resources?','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','new','outputPath','\x20\x20Chat\x20Interface\x20\x22','hasChanges','integrations','\x20files?','push','prompts','agent:pull','utf-8','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','dryRun','description','pullProject','\x20\x20Integrations:\x20','\x0aWrite\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','441364dLMNhi','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x22...','\x20\x20Text\x20Knowledge\x20Bases:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','agent.yml','knowledgeBases','counts','\x20\x20Knowledge\x20Bases:\x20','Project\x20cloned\x20with\x20errors','llm','\x20\x20Form\x20Interface\x20\x22','cloneProject','\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','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','formInterfaces','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x22:\x20','\x20created','662253MfDJsY','\x22\x20to\x20a\x20different\x20profile','\x0aPush\x20','\x0aProject\x20pushed\x20with\x20errors','error','Agent\x20','experimentalKnowledgeBases','Pulling\x20agent\x20\x22','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20\x20tdx\x20agent\x20clone\x20agents/','Status:\x20','Pushing\x20to\x20project...','agent','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','2XEmMHf','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20unchanged','<new-name>','\x20--profile\x20','\x20=\x20','\x0aError:','Agent:\x20','30YZHNAO','\x20updated','\x0aPush\x20summary\x20for\x20\x27','✔\x20Context\x20set:\x20','llmProject','repeat','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','green','\x20\x20Agents:\x20','\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\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','\x20\x20Source:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','projectName','updated','266736AtpJch','Using\x20project\x20from\x20context:\x20','session','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Cloning\x20\x22','332508BepRAy','\x0aErrors\x20found:','\x20\x20Chat\x20Interfaces:\x20','\x20errors','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20Experimental\x20Artifact\x20\x22','log','name','\x20resources\x20to\x20\x27','llm_project','\x20\x20Target:\x20','Using\x20current\x20project:\x20','INVALID_ARGUMENT','join','New\x20project\x20ID:\x20','message','\x20|\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20successfully','projectDir','Source:\x20','cwd','cyan','pushAgent','agents','Would\x20push\x20agent:\x20','total','cwd-config','\x20\x20Knowledge\x20Base\x20\x22','Using\x20context\x20project:\x20','289062mcVfFT','Summary:','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)','unchanged','\x22\x20to\x20\x22','gray','no_local_folder','-\x20no\x20files\x20written','\x20\x20Prompts:\x20','Project:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','context','\x20\x20tdx\x20agent\x20pull\x20','Analyzing\x20project\x20\x22','agentId','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Prompt\x20\x22','errors','Analyzing\x20changes\x20to\x20push...','parse','\x0a✔\x20Pushed\x20','\x20\x20Agent\x20\x22','site','\x20new','\x20\x20Form\x20Interfaces:\x20','\x0aChanges:','red','found','pullAgent','Dry\x20run\x20-\x20no\x20changes\x20made','output','arg-dir','dirname','Would\x20pull\x20agent:\x20','isNew','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','source','390afkUSw','Failed\x20to\x20push\x20agent:\x20','force','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Clone\x20\x22','1414044TUYwoM','\x0aChanges\x20to\x20agent\x20\x27','newProjectId','Would\x20clone:','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','578095KkKpay','Using\x20local\x20project:\x20','projectId','reason','dim','Chat:\x20','chatInterfaces','MISSING_ARGUMENT'];a4_0x406f=function(){return _0x2d8479;};return a4_0x406f();}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';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x26c792){const _0x362440=a4_0x7cc9,_0x5920e7=[];if(_0x26c792['total']!==undefined)_0x5920e7[_0x362440(0x96)](_0x26c792[_0x362440(0xf8)]+'\x20total');if(_0x26c792[_0x362440(0x90)]!==undefined&&_0x26c792[_0x362440(0x90)]>0x0)_0x5920e7[_0x362440(0x96)](a4_0x5c037e[_0x362440(0xd1)](_0x26c792['new']+_0x362440(0x113)));if(_0x26c792[_0x362440(0x8d)]!==undefined&&_0x26c792[_0x362440(0x8d)]>0x0)_0x5920e7['push'](a4_0x5c037e['green'](_0x26c792[_0x362440(0x8d)]+_0x362440(0xb3)));if(_0x26c792[_0x362440(0xd8)]!==undefined&&_0x26c792[_0x362440(0xd8)]>0x0)_0x5920e7[_0x362440(0x96)](a4_0x5c037e[_0x362440(0x139)](_0x26c792[_0x362440(0xd8)]+_0x362440(0xcb)));if(_0x26c792[_0x362440(0xff)]!==undefined&&_0x26c792[_0x362440(0xff)]>0x0)_0x5920e7[_0x362440(0x96)](a4_0x5c037e['gray'](_0x26c792['unchanged']+_0x362440(0xc4)));if(_0x26c792[_0x362440(0x10d)]!==undefined&&_0x26c792['errors']>0x0)_0x5920e7[_0x362440(0x96)](a4_0x5c037e[_0x362440(0x116)](_0x26c792[_0x362440(0x10d)]+_0x362440(0xe1)));return _0x5920e7[_0x362440(0xeb)](',\x20');}function displayDiffs(_0x2c2ce3,_0xf308ea,_0x3ad83f,_0x111424,_0x40eb91,_0x4ac43f,_0x4746f4,_0x529245,_0xe163d7){const _0x300b15=a4_0x7cc9;for(const _0x565b25 of _0x2c2ce3){if(_0x565b25['diff']){const _0xe25f51=_0x565b25['agentName']||_0x565b25[_0x300b15(0xe5)];console[_0x300b15(0xe4)](_0x300b15(0x127)+_0xe25f51+'\x27:'),console[_0x300b15(0xe4)]('─'[_0x300b15(0xcf)](0x3c)),console[_0x300b15(0xe4)](_0x565b25[_0x300b15(0x84)]),console[_0x300b15(0xe4)]('─'[_0x300b15(0xcf)](0x3c));}}for(const _0x49923c of _0xf308ea){_0x49923c[_0x300b15(0x84)]&&(console[_0x300b15(0xe4)](_0x300b15(0xa2)+_0x49923c[_0x300b15(0xe5)]+'\x27:'),console['log']('─'[_0x300b15(0xcf)](0x3c)),console['log'](_0x49923c[_0x300b15(0x84)]),console['log']('─'[_0x300b15(0xcf)](0x3c)));}for(const _0x5ba6a3 of _0x3ad83f){_0x5ba6a3[_0x300b15(0x84)]&&(console[_0x300b15(0xe4)](_0x300b15(0x7b)+_0x5ba6a3[_0x300b15(0xe5)]+'\x27:'),console['log']('─'[_0x300b15(0xcf)](0x3c)),console[_0x300b15(0xe4)](_0x5ba6a3[_0x300b15(0x84)]),console[_0x300b15(0xe4)]('─'[_0x300b15(0xcf)](0x3c)));}for(const _0x5a678c of _0x111424){_0x5a678c[_0x300b15(0x84)]&&(console['log']('\x0aChanges\x20to\x20prompt\x20\x27'+_0x5a678c[_0x300b15(0xe5)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x300b15(0xe4)](_0x5a678c[_0x300b15(0x84)]),console['log']('─'[_0x300b15(0xcf)](0x3c)));}for(const _0x312b81 of _0x40eb91){_0x312b81['diff']&&(console[_0x300b15(0xe4)](_0x300b15(0x79)+_0x312b81['name']+'\x27:'),console['log']('─'[_0x300b15(0xcf)](0x3c)),console[_0x300b15(0xe4)](_0x312b81[_0x300b15(0x84)]),console['log']('─'[_0x300b15(0xcf)](0x3c)));}for(const _0x678192 of _0x4ac43f){_0x678192[_0x300b15(0x84)]&&(console[_0x300b15(0xe4)](_0x300b15(0xbc)+_0x678192[_0x300b15(0xe5)]+'\x27:'),console[_0x300b15(0xe4)]('─'['repeat'](0x3c)),console[_0x300b15(0xe4)](_0x678192['diff']),console[_0x300b15(0xe4)]('─'[_0x300b15(0xcf)](0x3c)));}for(const _0x4347fc of _0x4746f4){_0x4347fc['diff']&&(console[_0x300b15(0xe4)](_0x300b15(0x11f)+_0x4347fc[_0x300b15(0xe5)]+'\x27:'),console[_0x300b15(0xe4)]('─'[_0x300b15(0xcf)](0x3c)),console[_0x300b15(0xe4)](_0x4347fc['diff']),console['log']('─'['repeat'](0x3c)));}for(const _0x3dc372 of _0x529245){_0x3dc372['diff']&&(console[_0x300b15(0xe4)]('\x0aChanges\x20to\x20form\x20interface\x20\x27'+_0x3dc372[_0x300b15(0xe5)]+'\x27:'),console[_0x300b15(0xe4)]('─'[_0x300b15(0xcf)](0x3c)),console[_0x300b15(0xe4)](_0x3dc372[_0x300b15(0x84)]),console[_0x300b15(0xe4)]('─'[_0x300b15(0xcf)](0x3c)));}for(const _0x47e2a0 of _0xe163d7){_0x47e2a0[_0x300b15(0x84)]&&(console[_0x300b15(0xe4)](_0x300b15(0x137)+_0x47e2a0[_0x300b15(0xe5)]+'\x27:'),console[_0x300b15(0xe4)]('─'[_0x300b15(0xcf)](0x3c)),console[_0x300b15(0xe4)](_0x47e2a0[_0x300b15(0x84)]),console[_0x300b15(0xe4)]('─'[_0x300b15(0xcf)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x30fe7e(0xe5)]=a4_0x30fe7e(0x98);[a4_0x30fe7e(0x9c)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x30fe7e(0x134)](_0x250ecd){const _0x5ae605=a4_0x30fe7e,{options:_0x2c51c8,args:_0x5c25e3,tdx:_0x150fcb}=_0x250ecd,_0x575c0f=_0x5c25e3[0x0],_0x3dada4=_0x5c25e3[0x1],_0x4dd03e=_0x2c51c8[_0x5ae605(0x11a)],_0x4ff10a=_0x2c51c8[_0x5ae605(0x9b)],_0x1cea52=_0x2c51c8[_0x5ae605(0x123)],_0x3ebbe9=_0x2c51c8[_0x5ae605(0x7a)],_0x4a9c18=_0x2c51c8[_0x5ae605(0xce)],_0x21afd9=_0x2c51c8[_0x5ae605(0xc0)];let _0x4f06a7;if(_0x575c0f){const _0x13f958=a4_0x4fc7ef[_0x5ae605(0xeb)](_0x575c0f,'tdx.json');if(existsSync(_0x13f958))try{const _0x5afdb6=JSON['parse'](readFileSync(_0x13f958,_0x5ae605(0x99)));_0x5afdb6[_0x5ae605(0xe7)]&&(_0x4f06a7={'llm_project':_0x5afdb6['llm_project']});}catch{}}const _0x4b43d6=findAgentConfigPath(process['cwd']());let _0x28a70e;if(_0x4b43d6)try{const _0xe9c96=JSON[_0x5ae605(0x10f)](readFileSync(_0x4b43d6,'utf-8'));_0xe9c96['llm_project']&&(_0x28a70e={'llm_project':_0xe9c96['llm_project']});}catch{}const _0x9d08b7=resolveAgentPullArgs({'arg':_0x575c0f,'agentNameArg':_0x3dada4,'agentFlag':_0x21afd9,'contextProject':_0x4a9c18,'argDirConfig':_0x4f06a7,'cwdConfigPath':_0x4b43d6||undefined,'cwdConfig':_0x28a70e}),{projectNameOrId:_0x4df0d4,targetAgentName:_0x15fefd,existingOutputDir:_0x3482e5,source:_0x1ab720}=_0x9d08b7;if(_0x1ab720===_0x5ae605(0x11b))console['log'](a4_0x5c037e[_0x5ae605(0x12f)]('Using\x20project\x20from\x20'+a4_0x4fc7ef[_0x5ae605(0xeb)](_0x575c0f,_0x5ae605(0x78))+':\x20'+_0x4df0d4));else{if(_0x1ab720===_0x5ae605(0xf9))console[_0x5ae605(0xe4)](a4_0x5c037e[_0x5ae605(0x12f)]('Using\x20project:\x20'+_0x4df0d4));else _0x1ab720===_0x5ae605(0x107)&&console[_0x5ae605(0xe4)](a4_0x5c037e[_0x5ae605(0x12f)](_0x5ae605(0xda)+_0x4df0d4));}if(!_0x4df0d4)return _0x21afd9?(console['log'](a4_0x5c037e[_0x5ae605(0x139)](_0x5ae605(0xb1))),console[_0x5ae605(0xe4)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0x5ae605(0xe4)](_0x5ae605(0xd6))):(console[_0x5ae605(0xe4)](a4_0x5c037e[_0x5ae605(0x139)](_0x5ae605(0xa0))),console[_0x5ae605(0xe4)](_0x5ae605(0xfe)),console['log'](_0x5ae605(0x82)),console[_0x5ae605(0xe4)]('\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'),console['log'](_0x5ae605(0xd4)),console[_0x5ae605(0xe4)](_0x5ae605(0xae))),0x1;if(_0x15fefd){const {data:_0xbc6817}=await withSpinner(_0x5ae605(0xbb)+_0x15fefd+'\x22\x20from\x20project\x20\x22'+_0x4df0d4+_0x5ae605(0xa3),()=>_0x150fcb[_0x5ae605(0xab)][_0x5ae605(0x118)](_0x4df0d4,_0x15fefd,_0x4dd03e,{'dryRun':_0x4ff10a,'force':_0x1cea52}));if(_0x4ff10a)return console['log'](a4_0x5c037e['yellow']('Dry\x20run\x20-\x20no\x20files\x20written')),console['log'](_0x5ae605(0x11d)+_0xbc6817['agentName']),console[_0x5ae605(0xe4)](_0x5ae605(0x86)+_0xbc6817[_0x5ae605(0x91)]),_0xbc6817[_0x5ae605(0x84)]&&(console[_0x5ae605(0xe4)](_0x5ae605(0x115)),console['log']('─'['repeat'](0x3c)),console[_0x5ae605(0xe4)](_0xbc6817[_0x5ae605(0x84)]),console[_0x5ae605(0xe4)]('─'['repeat'](0x3c))),0x0;return console[_0x5ae605(0xe4)](a4_0x5c037e[_0x5ae605(0xd1)]('Agent\x20pulled\x20successfully')),console[_0x5ae605(0xe4)](_0x5ae605(0xc9)+_0xbc6817[_0x5ae605(0x89)]),console[_0x5ae605(0xe4)](_0x5ae605(0x138)+_0xbc6817['outputPath']),console[_0x5ae605(0xe4)](_0x5ae605(0xbe)+(_0xbc6817[_0x5ae605(0x11e)]?a4_0x5c037e[_0x5ae605(0xd1)](_0x5ae605(0x90)):_0xbc6817[_0x5ae605(0x93)]?a4_0x5c037e['yellow']('updated'):a4_0x5c037e[_0x5ae605(0x101)](_0x5ae605(0xff)))),0x0;}const _0x237316=_0x3482e5||_0x4dd03e,{data:_0x13fe3c}=await withSpinner(_0x5ae605(0x109)+_0x4df0d4+_0x5ae605(0xa3),()=>_0x150fcb[_0x5ae605(0xab)][_0x5ae605(0x9d)](_0x4df0d4,_0x237316,{'dryRun':!![]})),_0x3a9d79=_0x13fe3c[_0x5ae605(0xa8)][_0x5ae605(0xf6)]['new']+_0x13fe3c[_0x5ae605(0xa8)][_0x5ae605(0xa7)]['new']+_0x13fe3c[_0x5ae605(0xa8)][_0x5ae605(0x87)]['new']+_0x13fe3c[_0x5ae605(0xa8)][_0x5ae605(0x97)][_0x5ae605(0x90)]+_0x13fe3c[_0x5ae605(0xa8)][_0x5ae605(0x94)]['new']+_0x13fe3c[_0x5ae605(0xa8)][_0x5ae605(0xba)]['new']+_0x13fe3c['counts'][_0x5ae605(0x13c)]['new']+_0x13fe3c[_0x5ae605(0xa8)]['formInterfaces'][_0x5ae605(0x90)]+_0x13fe3c[_0x5ae605(0xa8)]['chatInterfaces']['new'],_0x43dbb0=_0x13fe3c[_0x5ae605(0xa8)][_0x5ae605(0xf6)]['updated']+_0x13fe3c[_0x5ae605(0xa8)]['knowledgeBases'][_0x5ae605(0xd8)]+_0x13fe3c['counts'][_0x5ae605(0x87)][_0x5ae605(0xd8)]+_0x13fe3c[_0x5ae605(0xa8)][_0x5ae605(0x97)][_0x5ae605(0xd8)]+_0x13fe3c[_0x5ae605(0xa8)][_0x5ae605(0x94)][_0x5ae605(0xd8)]+_0x13fe3c[_0x5ae605(0xa8)][_0x5ae605(0xba)][_0x5ae605(0xd8)]+_0x13fe3c[_0x5ae605(0xa8)][_0x5ae605(0x13c)][_0x5ae605(0xd8)]+_0x13fe3c[_0x5ae605(0xa8)][_0x5ae605(0xb0)]['updated']+_0x13fe3c['counts']['chatInterfaces'][_0x5ae605(0xd8)],_0x298e0b=_0x13fe3c[_0x5ae605(0xa8)]['agents'][_0x5ae605(0xff)]+_0x13fe3c['counts'][_0x5ae605(0xa7)][_0x5ae605(0xff)]+_0x13fe3c[_0x5ae605(0xa8)]['textKnowledgeBases'][_0x5ae605(0xff)]+_0x13fe3c[_0x5ae605(0xa8)][_0x5ae605(0x97)][_0x5ae605(0xff)]+_0x13fe3c[_0x5ae605(0xa8)][_0x5ae605(0x94)][_0x5ae605(0xff)]+_0x13fe3c[_0x5ae605(0xa8)][_0x5ae605(0xba)][_0x5ae605(0xff)]+_0x13fe3c[_0x5ae605(0xa8)][_0x5ae605(0x13c)]['unchanged']+_0x13fe3c[_0x5ae605(0xa8)]['formInterfaces'][_0x5ae605(0xff)]+_0x13fe3c[_0x5ae605(0xa8)][_0x5ae605(0x131)][_0x5ae605(0xff)];console[_0x5ae605(0xe4)]('\x0aPull\x20summary\x20for\x20\x27'+_0x13fe3c[_0x5ae605(0xd7)]+'\x27:'),console[_0x5ae605(0xe4)]('\x20\x20'+a4_0x5c037e[_0x5ae605(0xd1)]('+\x20'+_0x3a9d79+'\x20new')+'\x20|\x20'+a4_0x5c037e['yellow']('~\x20'+_0x43dbb0+'\x20changed')+'\x20|\x20'+a4_0x5c037e[_0x5ae605(0x12f)]('=\x20'+_0x298e0b+_0x5ae605(0xc4))),console['log'](_0x5ae605(0xd2)+formatCountSummary(_0x13fe3c[_0x5ae605(0xa8)][_0x5ae605(0xf6)])),console[_0x5ae605(0xe4)](_0x5ae605(0xa9)+formatCountSummary(_0x13fe3c[_0x5ae605(0xa8)]['knowledgeBases'])),console[_0x5ae605(0xe4)](_0x5ae605(0xa4)+formatCountSummary(_0x13fe3c[_0x5ae605(0xa8)][_0x5ae605(0x87)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x13fe3c[_0x5ae605(0xa8)][_0x5ae605(0x97)])),console[_0x5ae605(0xe4)](_0x5ae605(0x9e)+formatCountSummary(_0x13fe3c[_0x5ae605(0xa8)][_0x5ae605(0x94)])),console[_0x5ae605(0xe4)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x13fe3c[_0x5ae605(0xa8)][_0x5ae605(0xb0)])),console[_0x5ae605(0xe4)](_0x5ae605(0xe0)+formatCountSummary(_0x13fe3c[_0x5ae605(0xa8)][_0x5ae605(0x131)]));const _0x52645d=_0x13fe3c['counts'][_0x5ae605(0xba)][_0x5ae605(0xf8)]>0x0||_0x13fe3c['counts'][_0x5ae605(0x13c)]['total']>0x0;_0x52645d&&(console['log'](_0x5ae605(0xef)+formatCountSummary(_0x13fe3c['counts']['experimentalKnowledgeBases'])),console[_0x5ae605(0xe4)](_0x5ae605(0xe2)+formatCountSummary(_0x13fe3c['counts'][_0x5ae605(0x13c)])));console[_0x5ae605(0xe4)](_0x5ae605(0xe8)+a4_0x5c037e[_0x5ae605(0xf4)](_0x13fe3c['outputDir'])),displayDiffs(_0x13fe3c[_0x5ae605(0xf6)],_0x13fe3c[_0x5ae605(0xa7)],_0x13fe3c[_0x5ae605(0x87)],_0x13fe3c[_0x5ae605(0x97)],_0x13fe3c[_0x5ae605(0x94)],_0x13fe3c['experimentalKnowledgeBases'],_0x13fe3c[_0x5ae605(0x13c)],_0x13fe3c[_0x5ae605(0xb0)],_0x13fe3c[_0x5ae605(0x131)]);if(_0x4ff10a)return console[_0x5ae605(0xe4)](a4_0x5c037e[_0x5ae605(0x139)](_0x5ae605(0xc3))),0x0;if(_0x3a9d79===0x0&&_0x43dbb0===0x0)return console[_0x5ae605(0xe4)](a4_0x5c037e[_0x5ae605(0xd1)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x13fe3c[_0x5ae605(0xd7)]},_0x2c51c8[_0x5ae605(0xdb)]),console[_0x5ae605(0xe4)](a4_0x5c037e['green'](_0x5ae605(0xcd)+a4_0x5c037e[_0x5ae605(0x12f)](_0x5ae605(0xe7))+_0x5ae605(0xc7)+a4_0x5c037e[_0x5ae605(0xf4)](_0x13fe3c[_0x5ae605(0xd7)]))),0x0;if(!_0x3ebbe9&&!_0x1cea52){if(!isInteractive())return console['error'](a4_0x5c037e[_0x5ae605(0x116)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5ae605(0xb8)](a4_0x5c037e['dim'](_0x5ae605(0x106))),0x1;const _0x4dea30=await confirmKey(_0x5ae605(0x9f)+(_0x3a9d79+_0x43dbb0)+_0x5ae605(0x95));if(!_0x4dea30)return console[_0x5ae605(0xe4)](a4_0x5c037e[_0x5ae605(0x139)](_0x5ae605(0x76)),_0x5ae605(0x103)),0x1;}const {data:_0x1536cf}=await withSpinner('Writing\x20files...',()=>_0x150fcb[_0x5ae605(0xab)][_0x5ae605(0x9d)](_0x4df0d4,_0x237316,{'force':_0x1cea52}));return console[_0x5ae605(0xe4)](a4_0x5c037e[_0x5ae605(0xd1)](_0x5ae605(0x80)+(_0x3a9d79+_0x43dbb0)+'\x20files\x20to\x20'+_0x1536cf['outputDir'])),saveSessionContext({'llm_project':_0x1536cf[_0x5ae605(0xd7)]},_0x2c51c8[_0x5ae605(0xdb)]),console[_0x5ae605(0xe4)](a4_0x5c037e[_0x5ae605(0xd1)]('✔\x20Context\x20set:\x20'+a4_0x5c037e[_0x5ae605(0x12f)](_0x5ae605(0xe7))+_0x5ae605(0xc7)+a4_0x5c037e['cyan'](_0x1536cf['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x30fe7e(0xe5)]='agent:clone';[a4_0x30fe7e(0x9c)]=a4_0x30fe7e(0x12a);async['execute'](_0x2b2f77){const _0x9a6379=a4_0x30fe7e,{options:_0x192584,args:_0x5dfbe3,tdx:_0x37b077}=_0x2b2f77,_0x754f3=_0x5dfbe3[0x0],_0x3a5b26=_0x192584[_0x9a6379(0xe5)],_0x22dbe2=_0x192584['dryRun'],_0x1f83fd=_0x192584[_0x9a6379(0x7a)],_0xf617ff=_0x192584[_0x9a6379(0x112)],_0x2e3bfc=_0x192584['llmProject'];let _0xa6c4d;const _0x484267=findAgentConfigPath(process[_0x9a6379(0xf3)]());if(_0x754f3){const _0x18ea6=a4_0x4fc7ef['join'](_0x754f3,'tdx.json');existsSync(_0x18ea6)?(_0xa6c4d=_0x754f3,console[_0x9a6379(0xe4)](a4_0x5c037e['dim'](_0x9a6379(0x12c)+_0x754f3))):_0xa6c4d=_0x754f3;}else{if(_0x484267)_0xa6c4d=a4_0x4fc7ef[_0x9a6379(0x11c)](_0x484267),console[_0x9a6379(0xe4)](a4_0x5c037e[_0x9a6379(0x12f)](_0x9a6379(0xe9)+_0xa6c4d));else{if(_0x2e3bfc){const _0x4a1442=sanitizeForFilesystem(_0x2e3bfc);let _0x566864=_0x4a1442,_0x4481c8=a4_0x4fc7ef[_0x9a6379(0xeb)](process['cwd'](),_0x9a6379(0xf6),_0x4a1442,_0x9a6379(0x78));if(!existsSync(_0x4481c8)){const _0x89d9aa=normalizeName(_0x2e3bfc),_0x3069fe=a4_0x4fc7ef[_0x9a6379(0xeb)](process[_0x9a6379(0xf3)](),_0x9a6379(0xf6),_0x89d9aa,_0x9a6379(0x78));existsSync(_0x3069fe)&&(_0x566864=_0x89d9aa,_0x4481c8=_0x3069fe);}if(existsSync(_0x4481c8))_0xa6c4d=a4_0x4fc7ef[_0x9a6379(0x11c)](_0x4481c8),console[_0x9a6379(0xe4)](a4_0x5c037e[_0x9a6379(0x12f)]('Using\x20local\x20project:\x20'+_0xa6c4d));else{const _0x503d1e=_0x192584[_0x9a6379(0x8b)];if(_0x503d1e)throw new SDKError(ErrorCode[_0x9a6379(0xea)],_0x9a6379(0x88)+_0x2e3bfc+_0x9a6379(0xb5),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x9a6379(0xd0)+(_0x9a6379(0x108)+_0x2e3bfc+'\x0a')+(_0x9a6379(0xbd)+_0x566864+'\x20--name\x20'+(_0x3a5b26||_0x9a6379(0xc5))+_0x9a6379(0xc6)+_0x503d1e)});_0xa6c4d=_0x2e3bfc,console[_0x9a6379(0xe4)](a4_0x5c037e[_0x9a6379(0x12f)](_0x9a6379(0xfb)+_0x2e3bfc));}}}}if(!_0xa6c4d)return console['log'](a4_0x5c037e[_0x9a6379(0x139)](_0x9a6379(0xc1))),console[_0x9a6379(0xe4)](_0x9a6379(0x7d)),console['log'](_0x9a6379(0xaf)),console[_0x9a6379(0xe4)](_0x9a6379(0xd3)),console[_0x9a6379(0xe4)](_0x9a6379(0x10b)),0x1;if(!_0x3a5b26)throw new SDKError(ErrorCode[_0x9a6379(0x132)],_0x9a6379(0x85),undefined,{'helpText':_0x9a6379(0xa5)});if(!_0x1f83fd&&!_0x22dbe2){if(!isInteractive())return console[_0x9a6379(0xb8)](a4_0x5c037e[_0x9a6379(0x116)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x9a6379(0xb8)](a4_0x5c037e['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4ce90f=await confirmKey(_0x9a6379(0x125)+_0xa6c4d+'\x22\x20to\x20new\x20project\x20\x22'+_0x3a5b26+'\x22?');if(!_0x4ce90f)return console[_0x9a6379(0xe4)](a4_0x5c037e[_0x9a6379(0x139)](_0x9a6379(0x76))),0x1;}const {data:_0x13ddb3}=await withSpinner(_0x9a6379(0xdd)+_0xa6c4d+_0x9a6379(0x100)+_0x3a5b26+_0x9a6379(0xa3),()=>_0x37b077[_0x9a6379(0xab)][_0x9a6379(0xad)](_0xa6c4d,_0x3a5b26,{'dryRun':_0x22dbe2}));if(_0x22dbe2){console[_0x9a6379(0xe4)](a4_0x5c037e['yellow'](_0x9a6379(0x119))),console[_0x9a6379(0xe4)](_0x9a6379(0xf2)+_0x13ddb3[_0x9a6379(0x8a)]),console['log'](_0x9a6379(0x7c)+_0x3a5b26),console[_0x9a6379(0xe4)](_0x9a6379(0x129)),console[_0x9a6379(0xe4)](_0x9a6379(0xd2)+_0x13ddb3[_0x9a6379(0xa8)]['agents'][_0x9a6379(0x8d)]),console['log'](_0x9a6379(0xa9)+_0x13ddb3['counts'][_0x9a6379(0xa7)][_0x9a6379(0x8d)]),console['log'](_0x9a6379(0x104)+_0x13ddb3[_0x9a6379(0xa8)][_0x9a6379(0x97)][_0x9a6379(0x8d)]),console['log']('\x20\x20Form\x20Interfaces:\x20'+_0x13ddb3[_0x9a6379(0xa8)]['formInterfaces']['created']),console['log'](_0x9a6379(0xe0)+_0x13ddb3[_0x9a6379(0xa8)]['chatInterfaces']['created']);const _0x3bd9c4=_0x13ddb3[_0x9a6379(0xa8)]['experimentalKnowledgeBases'][_0x9a6379(0x8d)]>0x0||_0x13ddb3['counts']['experimentalArtifacts'][_0x9a6379(0x8d)]>0x0;return _0x3bd9c4&&(console[_0x9a6379(0xe4)](_0x9a6379(0xef)+_0x13ddb3['counts']['experimentalKnowledgeBases'][_0x9a6379(0x8d)]),console[_0x9a6379(0xe4)](_0x9a6379(0xe2)+_0x13ddb3['counts'][_0x9a6379(0x13c)]['created'])),0x0;}const _0x4e6a07=_0x13ddb3[_0x9a6379(0xa8)][_0x9a6379(0xf6)][_0x9a6379(0x10d)]>0x0||_0x13ddb3[_0x9a6379(0xa8)]['knowledgeBases'][_0x9a6379(0x10d)]>0x0||_0x13ddb3[_0x9a6379(0xa8)][_0x9a6379(0x97)][_0x9a6379(0x10d)]>0x0||_0x13ddb3[_0x9a6379(0xa8)][_0x9a6379(0xb0)][_0x9a6379(0x10d)]>0x0||_0x13ddb3[_0x9a6379(0xa8)][_0x9a6379(0x131)][_0x9a6379(0x10d)]>0x0||_0x13ddb3['counts'][_0x9a6379(0xba)][_0x9a6379(0x10d)]>0x0||_0x13ddb3[_0x9a6379(0xa8)][_0x9a6379(0x13c)][_0x9a6379(0x10d)]>0x0;_0x4e6a07?console[_0x9a6379(0xe4)](a4_0x5c037e['yellow'](_0x9a6379(0xaa))):console[_0x9a6379(0xe4)](a4_0x5c037e[_0x9a6379(0xd1)](_0x9a6379(0x8c)));console[_0x9a6379(0xe4)](_0x9a6379(0xf2)+_0x13ddb3[_0x9a6379(0x8a)]),console[_0x9a6379(0xe4)]('New\x20project:\x20'+_0x13ddb3[_0x9a6379(0x136)]),console[_0x9a6379(0xe4)](_0x9a6379(0xec)+_0x13ddb3[_0x9a6379(0x128)]),console['log'](),console[_0x9a6379(0xe4)](_0x9a6379(0xfd)),console[_0x9a6379(0xe4)](_0x9a6379(0xd2)+formatCountSummary(_0x13ddb3[_0x9a6379(0xa8)]['agents'])),console[_0x9a6379(0xe4)](_0x9a6379(0xa9)+formatCountSummary(_0x13ddb3[_0x9a6379(0xa8)]['knowledgeBases'])),console['log'](_0x9a6379(0x104)+formatCountSummary(_0x13ddb3[_0x9a6379(0xa8)][_0x9a6379(0x97)])),console[_0x9a6379(0xe4)](_0x9a6379(0x9e)+formatCountSummary(_0x13ddb3[_0x9a6379(0xa8)][_0x9a6379(0x94)])),console[_0x9a6379(0xe4)](_0x9a6379(0x114)+formatCountSummary(_0x13ddb3[_0x9a6379(0xa8)][_0x9a6379(0xb0)])),console[_0x9a6379(0xe4)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x13ddb3[_0x9a6379(0xa8)][_0x9a6379(0x131)]));const _0x4f59cb=_0x13ddb3[_0x9a6379(0xa8)][_0x9a6379(0xba)][_0x9a6379(0x8d)]>0x0||_0x13ddb3[_0x9a6379(0xa8)][_0x9a6379(0xba)]['updated']>0x0||_0x13ddb3[_0x9a6379(0xa8)]['experimentalKnowledgeBases'][_0x9a6379(0xff)]>0x0||_0x13ddb3[_0x9a6379(0xa8)][_0x9a6379(0x13c)][_0x9a6379(0x8d)]>0x0||_0x13ddb3[_0x9a6379(0xa8)]['experimentalArtifacts'][_0x9a6379(0xd8)]>0x0||_0x13ddb3['counts'][_0x9a6379(0x13c)][_0x9a6379(0xff)]>0x0;_0x4f59cb&&(console['log'](_0x9a6379(0xef)+formatCountSummary(_0x13ddb3[_0x9a6379(0xa8)][_0x9a6379(0xba)])),console[_0x9a6379(0xe4)](_0x9a6379(0xe2)+formatCountSummary(_0x13ddb3[_0x9a6379(0xa8)][_0x9a6379(0x13c)])));if(_0x4e6a07){console[_0x9a6379(0xe4)](),console['log'](a4_0x5c037e[_0x9a6379(0x116)]('Errors:'));for(const _0x325555 of _0x13ddb3[_0x9a6379(0xf6)]){_0x325555[_0x9a6379(0x135)]==='error'&&console[_0x9a6379(0xe4)](a4_0x5c037e[_0x9a6379(0x116)](_0x9a6379(0x111)+_0x325555['agentName']+_0x9a6379(0xb2)+_0x325555[_0x9a6379(0xb8)]));}for(const _0x503b90 of _0x13ddb3['knowledgeBases']){_0x503b90[_0x9a6379(0x135)]===_0x9a6379(0xb8)&&console['log'](a4_0x5c037e['red'](_0x9a6379(0xfa)+_0x503b90['name']+_0x9a6379(0xb2)+_0x503b90[_0x9a6379(0xb8)]));}for(const _0x944a09 of _0x13ddb3[_0x9a6379(0x97)]){_0x944a09[_0x9a6379(0x135)]===_0x9a6379(0xb8)&&console[_0x9a6379(0xe4)](a4_0x5c037e[_0x9a6379(0x116)](_0x9a6379(0x10c)+_0x944a09[_0x9a6379(0xe5)]+_0x9a6379(0xb2)+_0x944a09['error']));}for(const _0x2c8d44 of _0x13ddb3['integrations']){_0x2c8d44[_0x9a6379(0x135)]==='error'&&console[_0x9a6379(0xe4)](a4_0x5c037e['red'](_0x9a6379(0x7f)+_0x2c8d44['name']+'\x22:\x20'+_0x2c8d44[_0x9a6379(0xb8)]));}for(const _0x36caf3 of _0x13ddb3['formInterfaces']){_0x36caf3[_0x9a6379(0x135)]===_0x9a6379(0xb8)&&console[_0x9a6379(0xe4)](a4_0x5c037e[_0x9a6379(0x116)](_0x9a6379(0xac)+_0x36caf3[_0x9a6379(0xe5)]+_0x9a6379(0xb2)+_0x36caf3[_0x9a6379(0xb8)]));}for(const _0x5ec37e of _0x13ddb3['chatInterfaces']){_0x5ec37e[_0x9a6379(0x135)]==='error'&&console['log'](a4_0x5c037e[_0x9a6379(0x116)](_0x9a6379(0x92)+_0x5ec37e[_0x9a6379(0xe5)]+_0x9a6379(0xb2)+_0x5ec37e[_0x9a6379(0xb8)]));}for(const _0x1530c0 of _0x13ddb3[_0x9a6379(0xba)]){_0x1530c0['action']==='error'&&console[_0x9a6379(0xe4)](a4_0x5c037e[_0x9a6379(0x116)](_0x9a6379(0x8f)+_0x1530c0[_0x9a6379(0xe5)]+_0x9a6379(0xb2)+_0x1530c0['error']));}for(const _0x553c4e of _0x13ddb3[_0x9a6379(0x13c)]){_0x553c4e[_0x9a6379(0x135)]===_0x9a6379(0xb8)&&console[_0x9a6379(0xe4)](a4_0x5c037e[_0x9a6379(0x116)](_0x9a6379(0xe3)+_0x553c4e[_0x9a6379(0xe5)]+_0x9a6379(0xb2)+_0x553c4e['error']));}return 0x1;}console[_0x9a6379(0xe4)]();const _0x10e9d5=getLLMProjectUrl(_0xf617ff,_0x13ddb3[_0x9a6379(0x128)]);return console[_0x9a6379(0xe4)](_0x9a6379(0x105)+a4_0x5c037e[_0x9a6379(0xf4)](_0x10e9d5)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x30fe7e(0xe5)]='agent:push';[a4_0x30fe7e(0x9c)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x30fe7e(0x134)](_0x2e44d1){const _0x321f13=a4_0x30fe7e,{options:_0x1bc3e0,args:_0x3022f3,tdx:_0x21e2ed}=_0x2e44d1;let _0x4a4b93=_0x3022f3[0x0]||process[_0x321f13(0xf3)]();const _0x27cd7a=_0x1bc3e0[_0x321f13(0x9b)],_0x3c0510=_0x1bc3e0[_0x321f13(0x123)],_0x582a3a=_0x1bc3e0['yes'],_0x17e61b=_0x1bc3e0[_0x321f13(0x112)],_0x2e4a9c=a4_0x4fc7ef[_0x321f13(0xeb)](_0x4a4b93,_0x321f13(0xa6)),_0x20637e=existsSync(_0x2e4a9c);if(_0x20637e){const {data:_0x5aba0c}=await withSpinner(_0x321f13(0x83)+_0x4a4b93+_0x321f13(0xa3),()=>_0x21e2ed['llm'][_0x321f13(0xf5)](_0x4a4b93,{'dryRun':_0x27cd7a,'force':_0x3c0510}));if(_0x27cd7a)return console['log'](a4_0x5c037e[_0x321f13(0x139)](_0x321f13(0x119))),console[_0x321f13(0xe4)](_0x321f13(0xf7)+_0x5aba0c[_0x321f13(0x89)]),0x0;if(_0x5aba0c[_0x321f13(0x135)]==='error')return console['log'](a4_0x5c037e['red'](_0x321f13(0x122)+_0x5aba0c[_0x321f13(0xb8)])),0x1;console[_0x321f13(0xe4)](a4_0x5c037e[_0x321f13(0xd1)](_0x321f13(0xb9)+_0x5aba0c['action']+_0x321f13(0xf0))),console[_0x321f13(0xe4)](_0x321f13(0xc9)+_0x5aba0c['agentName']);if(_0x5aba0c[_0x321f13(0x10a)]&&_0x5aba0c['projectId']){const _0x15184b=getLLMAgentChatUrl(_0x17e61b,_0x5aba0c[_0x321f13(0x12d)],_0x5aba0c['agentId']);console['log'](_0x321f13(0x130)+a4_0x5c037e[_0x321f13(0xf4)](_0x15184b));}return 0x0;}const _0x3dc55c=_0x1bc3e0[_0x321f13(0xce)],_0x14c211=resolveProjectFromContext(_0x4a4b93,_0x3dc55c);if(_0x14c211[_0x321f13(0x117)])_0x4a4b93=_0x14c211[_0x321f13(0xf1)],_0x14c211[_0x321f13(0x120)]===_0x321f13(0x107)&&console[_0x321f13(0xe4)](a4_0x5c037e[_0x321f13(0x12f)]('Using\x20project:\x20'+_0x4a4b93));else{let _0x41df23='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x14c211[_0x321f13(0x12e)]===_0x321f13(0x102)&&(_0x41df23=_0x14c211[_0x321f13(0xed)]+_0x321f13(0x81)+_0x14c211[_0x321f13(0xce)]+_0x321f13(0x7e));throw new SDKError(ErrorCode[_0x321f13(0xea)],_0x14c211[_0x321f13(0x12e)]==='no_context'?_0x14c211[_0x321f13(0xed)]:_0x321f13(0x77)+_0x4a4b93,undefined,{'helpText':_0x41df23});}const {data:_0x255611}=await withSpinner(_0x321f13(0x10e),()=>_0x21e2ed[_0x321f13(0xab)]['pushProject'](_0x4a4b93,{'dryRun':!![]})),_0x552cff=_0x255611[_0x321f13(0xa8)][_0x321f13(0xf6)]['errors']>0x0;if(_0x552cff){console['log'](a4_0x5c037e[_0x321f13(0x116)](_0x321f13(0xdf)));for(const _0x499fd1 of _0x255611[_0x321f13(0xf6)]){_0x499fd1[_0x321f13(0x135)]===_0x321f13(0xb8)&&console['log'](a4_0x5c037e[_0x321f13(0x116)](_0x321f13(0x111)+_0x499fd1[_0x321f13(0x89)]+'\x22:\x20'+_0x499fd1['error']));}return 0x1;}const _0x47d83a=_0x255611['counts'][_0x321f13(0xf6)][_0x321f13(0x8d)]+_0x255611[_0x321f13(0xa8)]['knowledgeBases'][_0x321f13(0x8d)]+_0x255611[_0x321f13(0xa8)]['textKnowledgeBases'][_0x321f13(0x8d)]+_0x255611[_0x321f13(0xa8)][_0x321f13(0x97)][_0x321f13(0x8d)]+_0x255611[_0x321f13(0xa8)][_0x321f13(0x94)][_0x321f13(0x8d)]+_0x255611['counts']['experimentalKnowledgeBases'][_0x321f13(0x8d)]+_0x255611[_0x321f13(0xa8)]['experimentalArtifacts']['created']+_0x255611['counts'][_0x321f13(0xb0)]['created']+_0x255611[_0x321f13(0xa8)][_0x321f13(0x131)][_0x321f13(0x8d)],_0x568ab0=_0x255611[_0x321f13(0xa8)][_0x321f13(0xf6)]['updated']+_0x255611[_0x321f13(0xa8)][_0x321f13(0xa7)][_0x321f13(0xd8)]+_0x255611[_0x321f13(0xa8)][_0x321f13(0x87)][_0x321f13(0xd8)]+_0x255611[_0x321f13(0xa8)][_0x321f13(0x97)]['updated']+_0x255611['counts'][_0x321f13(0x94)]['updated']+_0x255611[_0x321f13(0xa8)][_0x321f13(0xba)][_0x321f13(0xd8)]+_0x255611[_0x321f13(0xa8)]['experimentalArtifacts']['updated']+_0x255611['counts'][_0x321f13(0xb0)][_0x321f13(0xd8)]+_0x255611[_0x321f13(0xa8)][_0x321f13(0x131)]['updated'],_0x111d4e=_0x255611[_0x321f13(0xa8)][_0x321f13(0xf6)][_0x321f13(0xff)]+_0x255611['counts']['knowledgeBases']['unchanged']+_0x255611[_0x321f13(0xa8)][_0x321f13(0x87)][_0x321f13(0xff)]+_0x255611[_0x321f13(0xa8)][_0x321f13(0x97)][_0x321f13(0xff)]+_0x255611[_0x321f13(0xa8)][_0x321f13(0x94)][_0x321f13(0xff)]+_0x255611[_0x321f13(0xa8)][_0x321f13(0xba)][_0x321f13(0xff)]+_0x255611[_0x321f13(0xa8)]['experimentalArtifacts'][_0x321f13(0xff)]+_0x255611[_0x321f13(0xa8)][_0x321f13(0xb0)][_0x321f13(0xff)]+_0x255611[_0x321f13(0xa8)][_0x321f13(0x131)][_0x321f13(0xff)];console['log'](_0x321f13(0xcc)+_0x255611[_0x321f13(0xd7)]+'\x27:'),console[_0x321f13(0xe4)]('\x20\x20'+a4_0x5c037e[_0x321f13(0xd1)]('+\x20'+_0x47d83a+_0x321f13(0x113))+'\x20|\x20'+a4_0x5c037e[_0x321f13(0x139)]('~\x20'+_0x568ab0+_0x321f13(0x13b))+_0x321f13(0xee)+a4_0x5c037e['dim']('=\x20'+_0x111d4e+'\x20unchanged')),console[_0x321f13(0xe4)]('\x20\x20Agents:\x20'+formatCountSummary(_0x255611[_0x321f13(0xa8)][_0x321f13(0xf6)])),console[_0x321f13(0xe4)](_0x321f13(0xa9)+formatCountSummary(_0x255611['counts'][_0x321f13(0xa7)])),console[_0x321f13(0xe4)](_0x321f13(0xa4)+formatCountSummary(_0x255611[_0x321f13(0xa8)]['textKnowledgeBases'])),console[_0x321f13(0xe4)](_0x321f13(0x104)+formatCountSummary(_0x255611[_0x321f13(0xa8)]['prompts'])),console[_0x321f13(0xe4)](_0x321f13(0x9e)+formatCountSummary(_0x255611['counts']['integrations'])),console[_0x321f13(0xe4)](_0x321f13(0x114)+formatCountSummary(_0x255611[_0x321f13(0xa8)][_0x321f13(0xb0)])),console[_0x321f13(0xe4)](_0x321f13(0xe0)+formatCountSummary(_0x255611[_0x321f13(0xa8)][_0x321f13(0x131)]));const _0x42fb3c=_0x255611[_0x321f13(0xa8)][_0x321f13(0xba)][_0x321f13(0x8d)]>0x0||_0x255611[_0x321f13(0xa8)]['experimentalKnowledgeBases'][_0x321f13(0xd8)]>0x0||_0x255611[_0x321f13(0xa8)][_0x321f13(0xba)][_0x321f13(0xff)]>0x0||_0x255611[_0x321f13(0xa8)][_0x321f13(0x13c)]['created']>0x0||_0x255611[_0x321f13(0xa8)]['experimentalArtifacts'][_0x321f13(0xd8)]>0x0||_0x255611['counts'][_0x321f13(0x13c)]['unchanged']>0x0;_0x42fb3c&&(console[_0x321f13(0xe4)](_0x321f13(0xef)+formatCountSummary(_0x255611['counts']['experimentalKnowledgeBases'])),console['log'](_0x321f13(0xe2)+formatCountSummary(_0x255611[_0x321f13(0xa8)]['experimentalArtifacts'])));console['log'](_0x321f13(0xd5)+a4_0x5c037e[_0x321f13(0xf4)](_0x4a4b93)),displayDiffs(_0x255611['agents'],_0x255611[_0x321f13(0xa7)],_0x255611[_0x321f13(0x87)],_0x255611[_0x321f13(0x97)],_0x255611[_0x321f13(0x94)],_0x255611['experimentalKnowledgeBases'],_0x255611['experimentalArtifacts'],_0x255611[_0x321f13(0xb0)],_0x255611['chatInterfaces']);if(_0x27cd7a)return console[_0x321f13(0xe4)](a4_0x5c037e[_0x321f13(0x139)](_0x321f13(0x9a))),0x0;if(_0x47d83a===0x0&&_0x568ab0===0x0){console[_0x321f13(0xe4)](a4_0x5c037e[_0x321f13(0xd1)](_0x321f13(0xdc)));const _0x10a3cd=getLLMProjectUrl(_0x17e61b,_0x255611[_0x321f13(0x12d)]);return console[_0x321f13(0xe4)]('Project:\x20'+a4_0x5c037e[_0x321f13(0xf4)](_0x10a3cd)),0x0;}if(!_0x582a3a&&!_0x3c0510){if(!isInteractive())return console[_0x321f13(0xb8)](a4_0x5c037e[_0x321f13(0x116)](_0x321f13(0xc8)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x321f13(0xb8)](a4_0x5c037e['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xb7d0a7=await confirmKey(_0x321f13(0xb6)+(_0x47d83a+_0x568ab0)+_0x321f13(0x8e));if(!_0xb7d0a7)return console[_0x321f13(0xe4)](a4_0x5c037e['yellow'](_0x321f13(0x76)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x3e9276}=await withSpinner(_0x321f13(0xbf),()=>_0x21e2ed['llm'][_0x321f13(0x13a)](_0x4a4b93,{'force':_0x3c0510})),_0x5ce6f9=_0x3e9276[_0x321f13(0xa8)][_0x321f13(0xf6)][_0x321f13(0x10d)]>0x0||_0x3e9276[_0x321f13(0xa8)]['knowledgeBases'][_0x321f13(0x10d)]>0x0||_0x3e9276['counts'][_0x321f13(0x87)]['errors']>0x0||_0x3e9276[_0x321f13(0xa8)][_0x321f13(0x97)][_0x321f13(0x10d)]>0x0||_0x3e9276[_0x321f13(0xa8)][_0x321f13(0xb0)][_0x321f13(0x10d)]>0x0||_0x3e9276[_0x321f13(0xa8)][_0x321f13(0x131)][_0x321f13(0x10d)]>0x0;if(_0x5ce6f9){console[_0x321f13(0xe4)](a4_0x5c037e[_0x321f13(0x139)](_0x321f13(0xb7))),console[_0x321f13(0xe4)](),console[_0x321f13(0xe4)](a4_0x5c037e[_0x321f13(0x116)](_0x321f13(0x133)));for(const _0x5c9147 of _0x3e9276[_0x321f13(0xf6)]){_0x5c9147[_0x321f13(0x135)]===_0x321f13(0xb8)&&console[_0x321f13(0xe4)](a4_0x5c037e[_0x321f13(0x116)](_0x321f13(0x111)+_0x5c9147[_0x321f13(0x89)]+_0x321f13(0xb2)+_0x5c9147[_0x321f13(0xb8)]));}for(const _0x533dfb of _0x3e9276[_0x321f13(0xa7)]){_0x533dfb['action']===_0x321f13(0xb8)&&console[_0x321f13(0xe4)](a4_0x5c037e['red'](_0x321f13(0xfa)+_0x533dfb[_0x321f13(0xe5)]+_0x321f13(0xb2)+_0x533dfb[_0x321f13(0xb8)]));}for(const _0x1899f2 of _0x3e9276[_0x321f13(0x87)]){_0x1899f2[_0x321f13(0x135)]===_0x321f13(0xb8)&&console['log'](a4_0x5c037e[_0x321f13(0x116)](_0x321f13(0x124)+_0x1899f2['name']+_0x321f13(0xb2)+_0x1899f2[_0x321f13(0xb8)]));}for(const _0x357bac of _0x3e9276[_0x321f13(0x97)]){_0x357bac[_0x321f13(0x135)]===_0x321f13(0xb8)&&console[_0x321f13(0xe4)](a4_0x5c037e[_0x321f13(0x116)](_0x321f13(0x10c)+_0x357bac[_0x321f13(0xe5)]+'\x22:\x20'+_0x357bac['error']));}for(const _0x403790 of _0x3e9276['integrations']){_0x403790[_0x321f13(0x135)]===_0x321f13(0xb8)&&console[_0x321f13(0xe4)](a4_0x5c037e[_0x321f13(0x116)]('\x20\x20Integration\x20\x22'+_0x403790[_0x321f13(0xe5)]+_0x321f13(0xb2)+_0x403790[_0x321f13(0xb8)]));}for(const _0x553ccc of _0x3e9276[_0x321f13(0xb0)]){_0x553ccc[_0x321f13(0x135)]==='error'&&console[_0x321f13(0xe4)](a4_0x5c037e[_0x321f13(0x116)](_0x321f13(0xac)+_0x553ccc['name']+_0x321f13(0xb2)+_0x553ccc[_0x321f13(0xb8)]));}for(const _0x409c0f of _0x3e9276['chatInterfaces']){_0x409c0f['action']==='error'&&console['log'](a4_0x5c037e[_0x321f13(0x116)](_0x321f13(0x92)+_0x409c0f[_0x321f13(0xe5)]+_0x321f13(0xb2)+_0x409c0f[_0x321f13(0xb8)]));}return 0x1;}console[_0x321f13(0xe4)](a4_0x5c037e[_0x321f13(0xd1)](_0x321f13(0x110)+(_0x47d83a+_0x568ab0)+_0x321f13(0xe6)+_0x3e9276[_0x321f13(0xd7)]+'\x27'));const _0x380501=getLLMProjectUrl(_0x17e61b,_0x3e9276[_0x321f13(0x12d)]);return console[_0x321f13(0xe4)](_0x321f13(0x105)+a4_0x5c037e['cyan'](_0x380501)),0x0;}}
1
+ const a4_0x2af0fe=a4_0x1798;(function(_0x590029,_0x3ff73d){const _0x40b5e0=a4_0x1798,_0x306d9a=_0x590029();while(!![]){try{const _0x510222=parseInt(_0x40b5e0(0x21a))/0x1+parseInt(_0x40b5e0(0x208))/0x2+-parseInt(_0x40b5e0(0x281))/0x3*(-parseInt(_0x40b5e0(0x205))/0x4)+parseInt(_0x40b5e0(0x275))/0x5+-parseInt(_0x40b5e0(0x1f4))/0x6+parseInt(_0x40b5e0(0x254))/0x7+-parseInt(_0x40b5e0(0x28c))/0x8*(parseInt(_0x40b5e0(0x1e0))/0x9);if(_0x510222===_0x3ff73d)break;else _0x306d9a['push'](_0x306d9a['shift']());}catch(_0x35ecb0){_0x306d9a['push'](_0x306d9a['shift']());}}}(a4_0x47ff,0x47d63));import a4_0x3da766 from'chalk';import a4_0x36d7a3 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_0x1798(_0x184cf8,_0x1478ff){_0x184cf8=_0x184cf8-0x1d9;const _0x47ffe3=a4_0x47ff();let _0x1798e2=_0x47ffe3[_0x184cf8];return _0x1798e2;}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x1ea353){const _0x28861b=a4_0x1798,_0x212e2b=[];if(_0x1ea353[_0x28861b(0x22f)]!==undefined)_0x212e2b[_0x28861b(0x215)](_0x1ea353[_0x28861b(0x22f)]+_0x28861b(0x272));if(_0x1ea353[_0x28861b(0x20a)]!==undefined&&_0x1ea353[_0x28861b(0x20a)]>0x0)_0x212e2b[_0x28861b(0x215)](a4_0x3da766[_0x28861b(0x263)](_0x1ea353['new']+_0x28861b(0x1ff)));if(_0x1ea353['created']!==undefined&&_0x1ea353[_0x28861b(0x259)]>0x0)_0x212e2b[_0x28861b(0x215)](a4_0x3da766[_0x28861b(0x263)](_0x1ea353[_0x28861b(0x259)]+_0x28861b(0x1fc)));if(_0x1ea353[_0x28861b(0x210)]!==undefined&&_0x1ea353[_0x28861b(0x210)]>0x0)_0x212e2b[_0x28861b(0x215)](a4_0x3da766[_0x28861b(0x257)](_0x1ea353['updated']+_0x28861b(0x241)));if(_0x1ea353[_0x28861b(0x235)]!==undefined&&_0x1ea353[_0x28861b(0x235)]>0x0)_0x212e2b[_0x28861b(0x215)](a4_0x3da766['gray'](_0x1ea353['unchanged']+'\x20unchanged'));if(_0x1ea353[_0x28861b(0x200)]!==undefined&&_0x1ea353[_0x28861b(0x200)]>0x0)_0x212e2b[_0x28861b(0x215)](a4_0x3da766['red'](_0x1ea353[_0x28861b(0x200)]+'\x20errors'));return _0x212e2b['join'](',\x20');}function displayDiffs(_0x45ddcb,_0x179bde,_0x5005f1,_0x172d1b,_0x206831,_0x39c622,_0x72277d,_0x11389a,_0x47dc31){const _0x363447=a4_0x1798;for(const _0x35a5d6 of _0x45ddcb){if(_0x35a5d6['diff']){const _0x72cdc3=_0x35a5d6[_0x363447(0x204)]||_0x35a5d6[_0x363447(0x20d)];console['log'](_0x363447(0x261)+_0x72cdc3+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x363447(0x212)](_0x35a5d6['diff']),console['log']('─'[_0x363447(0x23d)](0x3c));}}for(const _0x42a854 of _0x179bde){_0x42a854[_0x363447(0x1df)]&&(console['log'](_0x363447(0x227)+_0x42a854['name']+'\x27:'),console[_0x363447(0x212)]('─'[_0x363447(0x23d)](0x3c)),console[_0x363447(0x212)](_0x42a854[_0x363447(0x1df)]),console['log']('─'[_0x363447(0x23d)](0x3c)));}for(const _0xd700f of _0x5005f1){_0xd700f['diff']&&(console[_0x363447(0x212)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0xd700f[_0x363447(0x20d)]+'\x27:'),console[_0x363447(0x212)]('─'[_0x363447(0x23d)](0x3c)),console[_0x363447(0x212)](_0xd700f[_0x363447(0x1df)]),console[_0x363447(0x212)]('─'['repeat'](0x3c)));}for(const _0x30e252 of _0x172d1b){_0x30e252[_0x363447(0x1df)]&&(console[_0x363447(0x212)](_0x363447(0x25e)+_0x30e252[_0x363447(0x20d)]+'\x27:'),console[_0x363447(0x212)]('─'['repeat'](0x3c)),console['log'](_0x30e252[_0x363447(0x1df)]),console[_0x363447(0x212)]('─'[_0x363447(0x23d)](0x3c)));}for(const _0x5c9987 of _0x206831){_0x5c9987[_0x363447(0x1df)]&&(console[_0x363447(0x212)](_0x363447(0x21b)+_0x5c9987['name']+'\x27:'),console['log']('─'[_0x363447(0x23d)](0x3c)),console[_0x363447(0x212)](_0x5c9987[_0x363447(0x1df)]),console[_0x363447(0x212)]('─'[_0x363447(0x23d)](0x3c)));}for(const _0x4b703c of _0x39c622){_0x4b703c['diff']&&(console[_0x363447(0x212)](_0x363447(0x20f)+_0x4b703c[_0x363447(0x20d)]+'\x27:'),console[_0x363447(0x212)]('─'[_0x363447(0x23d)](0x3c)),console['log'](_0x4b703c[_0x363447(0x1df)]),console['log']('─'[_0x363447(0x23d)](0x3c)));}for(const _0x2e822e of _0x72277d){_0x2e822e[_0x363447(0x1df)]&&(console[_0x363447(0x212)](_0x363447(0x214)+_0x2e822e[_0x363447(0x20d)]+'\x27:'),console[_0x363447(0x212)]('─'['repeat'](0x3c)),console[_0x363447(0x212)](_0x2e822e[_0x363447(0x1df)]),console[_0x363447(0x212)]('─'[_0x363447(0x23d)](0x3c)));}for(const _0x203a61 of _0x11389a){_0x203a61[_0x363447(0x1df)]&&(console[_0x363447(0x212)](_0x363447(0x270)+_0x203a61['name']+'\x27:'),console['log']('─'[_0x363447(0x23d)](0x3c)),console['log'](_0x203a61['diff']),console[_0x363447(0x212)]('─'[_0x363447(0x23d)](0x3c)));}for(const _0x1d37b6 of _0x47dc31){_0x1d37b6['diff']&&(console['log'](_0x363447(0x28e)+_0x1d37b6[_0x363447(0x20d)]+'\x27:'),console[_0x363447(0x212)]('─'[_0x363447(0x23d)](0x3c)),console[_0x363447(0x212)](_0x1d37b6[_0x363447(0x1df)]),console[_0x363447(0x212)]('─'[_0x363447(0x23d)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x2af0fe(0x20d)]=a4_0x2af0fe(0x280);[a4_0x2af0fe(0x1e9)]=a4_0x2af0fe(0x27b);async['execute'](_0xeae5c){const _0x2d1d8a=a4_0x2af0fe,{options:_0x3a2ab6,args:_0xfd8977,tdx:_0x30cdc1}=_0xeae5c,_0xe5712e=_0xfd8977[0x0],_0x4c82c5=_0xfd8977[0x1],_0x47ccd7=_0x3a2ab6[_0x2d1d8a(0x21f)],_0x83d480=_0x3a2ab6['dryRun'],_0x9b062=_0x3a2ab6[_0x2d1d8a(0x1e8)],_0x5301dc=_0x3a2ab6['yes'],_0x31f03f=_0x3a2ab6[_0x2d1d8a(0x224)],_0x4a9caf=_0x3a2ab6[_0x2d1d8a(0x295)];let _0x37f198;if(_0xe5712e){const _0x5a4572=a4_0x36d7a3[_0x2d1d8a(0x292)](_0xe5712e,'tdx.json');if(existsSync(_0x5a4572))try{const _0x123979=JSON[_0x2d1d8a(0x211)](readFileSync(_0x5a4572,_0x2d1d8a(0x1e4)));_0x123979[_0x2d1d8a(0x225)]&&(_0x37f198={'llm_project':_0x123979[_0x2d1d8a(0x225)]});}catch{}}const _0x15aab0=findAgentConfigPath(process[_0x2d1d8a(0x22e)]());let _0x57fc10;if(_0x15aab0)try{const _0x4a5509=JSON[_0x2d1d8a(0x211)](readFileSync(_0x15aab0,_0x2d1d8a(0x1e4)));_0x4a5509['llm_project']&&(_0x57fc10={'llm_project':_0x4a5509[_0x2d1d8a(0x225)]});}catch{}const _0x442aaa=resolveAgentPullArgs({'arg':_0xe5712e,'agentNameArg':_0x4c82c5,'agentFlag':_0x4a9caf,'contextProject':_0x31f03f,'argDirConfig':_0x37f198,'cwdConfigPath':_0x15aab0||undefined,'cwdConfig':_0x57fc10}),{projectNameOrId:_0x10cb1c,targetAgentName:_0x487445,existingOutputDir:_0xa863f4,source:_0x52d40a}=_0x442aaa;if(_0x52d40a===_0x2d1d8a(0x244))console[_0x2d1d8a(0x212)](a4_0x3da766[_0x2d1d8a(0x21e)]('Using\x20project\x20from\x20'+a4_0x36d7a3[_0x2d1d8a(0x292)](_0xe5712e,_0x2d1d8a(0x239))+':\x20'+_0x10cb1c));else{if(_0x52d40a===_0x2d1d8a(0x1e2))console['log'](a4_0x3da766[_0x2d1d8a(0x21e)]('Using\x20project:\x20'+_0x10cb1c));else _0x52d40a===_0x2d1d8a(0x213)&&console[_0x2d1d8a(0x212)](a4_0x3da766[_0x2d1d8a(0x21e)]('Using\x20project\x20from\x20context:\x20'+_0x10cb1c));}if(!_0x10cb1c)return _0x4a9caf?(console[_0x2d1d8a(0x212)](a4_0x3da766['yellow'](_0x2d1d8a(0x26c))),console[_0x2d1d8a(0x212)](_0x2d1d8a(0x1e3)),console['log'](_0x2d1d8a(0x1f0))):(console[_0x2d1d8a(0x212)](a4_0x3da766[_0x2d1d8a(0x257)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x2d1d8a(0x212)](_0x2d1d8a(0x1da)),console['log']('\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'),console['log'](_0x2d1d8a(0x285)),console[_0x2d1d8a(0x212)](_0x2d1d8a(0x249)),console['log']('\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')),0x1;if(_0x487445){const {data:_0x4cb958}=await withSpinner('Pulling\x20agent\x20\x22'+_0x487445+'\x22\x20from\x20project\x20\x22'+_0x10cb1c+_0x2d1d8a(0x25f),()=>_0x30cdc1[_0x2d1d8a(0x265)]['pullAgent'](_0x10cb1c,_0x487445,_0x47ccd7,{'dryRun':_0x83d480,'force':_0x9b062}));if(_0x83d480)return console[_0x2d1d8a(0x212)](a4_0x3da766[_0x2d1d8a(0x257)](_0x2d1d8a(0x278))),console['log'](_0x2d1d8a(0x20b)+_0x4cb958[_0x2d1d8a(0x204)]),console[_0x2d1d8a(0x212)](_0x2d1d8a(0x216)+_0x4cb958[_0x2d1d8a(0x1f5)]),_0x4cb958[_0x2d1d8a(0x1df)]&&(console[_0x2d1d8a(0x212)](_0x2d1d8a(0x207)),console[_0x2d1d8a(0x212)]('─'[_0x2d1d8a(0x23d)](0x3c)),console[_0x2d1d8a(0x212)](_0x4cb958[_0x2d1d8a(0x1df)]),console[_0x2d1d8a(0x212)]('─'['repeat'](0x3c))),0x0;return console['log'](a4_0x3da766[_0x2d1d8a(0x263)](_0x2d1d8a(0x1f9))),console[_0x2d1d8a(0x212)](_0x2d1d8a(0x229)+_0x4cb958['agentName']),console[_0x2d1d8a(0x212)](_0x2d1d8a(0x293)+_0x4cb958[_0x2d1d8a(0x1f5)]),console[_0x2d1d8a(0x212)](_0x2d1d8a(0x26d)+(_0x4cb958['isNew']?a4_0x3da766[_0x2d1d8a(0x263)](_0x2d1d8a(0x20a)):_0x4cb958[_0x2d1d8a(0x228)]?a4_0x3da766['yellow']('updated'):a4_0x3da766[_0x2d1d8a(0x296)]('unchanged'))),0x0;}const _0x4ee6df=_0xa863f4||_0x47ccd7,{data:_0x56c7db}=await withSpinner('Analyzing\x20project\x20\x22'+_0x10cb1c+_0x2d1d8a(0x25f),()=>_0x30cdc1['llm'][_0x2d1d8a(0x25c)](_0x10cb1c,_0x4ee6df,{'dryRun':!![]})),_0x57e5e7=_0x56c7db[_0x2d1d8a(0x226)][_0x2d1d8a(0x290)][_0x2d1d8a(0x20a)]+_0x56c7db['counts'][_0x2d1d8a(0x221)]['new']+_0x56c7db[_0x2d1d8a(0x226)][_0x2d1d8a(0x234)][_0x2d1d8a(0x20a)]+_0x56c7db[_0x2d1d8a(0x226)][_0x2d1d8a(0x283)]['new']+_0x56c7db[_0x2d1d8a(0x226)][_0x2d1d8a(0x28a)][_0x2d1d8a(0x20a)]+_0x56c7db[_0x2d1d8a(0x226)][_0x2d1d8a(0x1e1)][_0x2d1d8a(0x20a)]+_0x56c7db[_0x2d1d8a(0x226)]['experimentalArtifacts']['new']+_0x56c7db[_0x2d1d8a(0x226)][_0x2d1d8a(0x247)][_0x2d1d8a(0x20a)]+_0x56c7db[_0x2d1d8a(0x226)]['chatInterfaces'][_0x2d1d8a(0x20a)],_0x39f4c7=_0x56c7db['counts']['agents'][_0x2d1d8a(0x210)]+_0x56c7db[_0x2d1d8a(0x226)]['knowledgeBases'][_0x2d1d8a(0x210)]+_0x56c7db[_0x2d1d8a(0x226)]['textKnowledgeBases'][_0x2d1d8a(0x210)]+_0x56c7db[_0x2d1d8a(0x226)][_0x2d1d8a(0x283)]['updated']+_0x56c7db[_0x2d1d8a(0x226)][_0x2d1d8a(0x28a)][_0x2d1d8a(0x210)]+_0x56c7db[_0x2d1d8a(0x226)]['experimentalKnowledgeBases'][_0x2d1d8a(0x210)]+_0x56c7db[_0x2d1d8a(0x226)]['experimentalArtifacts'][_0x2d1d8a(0x210)]+_0x56c7db[_0x2d1d8a(0x226)][_0x2d1d8a(0x247)][_0x2d1d8a(0x210)]+_0x56c7db[_0x2d1d8a(0x226)][_0x2d1d8a(0x1ec)][_0x2d1d8a(0x210)],_0x2b3870=_0x56c7db[_0x2d1d8a(0x226)][_0x2d1d8a(0x290)][_0x2d1d8a(0x235)]+_0x56c7db[_0x2d1d8a(0x226)][_0x2d1d8a(0x221)][_0x2d1d8a(0x235)]+_0x56c7db[_0x2d1d8a(0x226)][_0x2d1d8a(0x234)][_0x2d1d8a(0x235)]+_0x56c7db[_0x2d1d8a(0x226)][_0x2d1d8a(0x283)][_0x2d1d8a(0x235)]+_0x56c7db[_0x2d1d8a(0x226)][_0x2d1d8a(0x28a)]['unchanged']+_0x56c7db[_0x2d1d8a(0x226)]['experimentalKnowledgeBases'][_0x2d1d8a(0x235)]+_0x56c7db[_0x2d1d8a(0x226)][_0x2d1d8a(0x201)][_0x2d1d8a(0x235)]+_0x56c7db[_0x2d1d8a(0x226)][_0x2d1d8a(0x247)][_0x2d1d8a(0x235)]+_0x56c7db['counts'][_0x2d1d8a(0x1ec)][_0x2d1d8a(0x235)];console[_0x2d1d8a(0x212)]('\x0aPull\x20summary\x20for\x20\x27'+_0x56c7db[_0x2d1d8a(0x286)]+'\x27:'),console[_0x2d1d8a(0x212)]('\x20\x20'+a4_0x3da766['green']('+\x20'+_0x57e5e7+'\x20new')+'\x20|\x20'+a4_0x3da766[_0x2d1d8a(0x257)]('~\x20'+_0x39f4c7+_0x2d1d8a(0x279))+'\x20|\x20'+a4_0x3da766[_0x2d1d8a(0x21e)]('=\x20'+_0x2b3870+'\x20unchanged')),console[_0x2d1d8a(0x212)](_0x2d1d8a(0x273)+formatCountSummary(_0x56c7db['counts'][_0x2d1d8a(0x290)])),console[_0x2d1d8a(0x212)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x56c7db[_0x2d1d8a(0x226)]['knowledgeBases'])),console[_0x2d1d8a(0x212)](_0x2d1d8a(0x20e)+formatCountSummary(_0x56c7db['counts'][_0x2d1d8a(0x234)])),console[_0x2d1d8a(0x212)](_0x2d1d8a(0x220)+formatCountSummary(_0x56c7db[_0x2d1d8a(0x226)][_0x2d1d8a(0x283)])),console[_0x2d1d8a(0x212)](_0x2d1d8a(0x1ef)+formatCountSummary(_0x56c7db[_0x2d1d8a(0x226)][_0x2d1d8a(0x28a)])),console['log'](_0x2d1d8a(0x294)+formatCountSummary(_0x56c7db[_0x2d1d8a(0x226)][_0x2d1d8a(0x247)])),console[_0x2d1d8a(0x212)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x56c7db[_0x2d1d8a(0x226)]['chatInterfaces']));const _0x1749b9=_0x56c7db['counts']['experimentalKnowledgeBases'][_0x2d1d8a(0x22f)]>0x0||_0x56c7db[_0x2d1d8a(0x226)][_0x2d1d8a(0x201)]['total']>0x0;_0x1749b9&&(console[_0x2d1d8a(0x212)](_0x2d1d8a(0x25d)+formatCountSummary(_0x56c7db[_0x2d1d8a(0x226)][_0x2d1d8a(0x1e1)])),console[_0x2d1d8a(0x212)](_0x2d1d8a(0x258)+formatCountSummary(_0x56c7db['counts']['experimentalArtifacts'])));console[_0x2d1d8a(0x212)](_0x2d1d8a(0x27d)+a4_0x3da766[_0x2d1d8a(0x1fa)](_0x56c7db['outputDir'])),displayDiffs(_0x56c7db[_0x2d1d8a(0x290)],_0x56c7db[_0x2d1d8a(0x221)],_0x56c7db[_0x2d1d8a(0x234)],_0x56c7db[_0x2d1d8a(0x283)],_0x56c7db[_0x2d1d8a(0x28a)],_0x56c7db['experimentalKnowledgeBases'],_0x56c7db[_0x2d1d8a(0x201)],_0x56c7db['formInterfaces'],_0x56c7db[_0x2d1d8a(0x1ec)]);if(_0x83d480)return console[_0x2d1d8a(0x212)](a4_0x3da766[_0x2d1d8a(0x257)](_0x2d1d8a(0x22d))),0x0;if(_0x57e5e7===0x0&&_0x39f4c7===0x0)return console[_0x2d1d8a(0x212)](a4_0x3da766[_0x2d1d8a(0x263)](_0x2d1d8a(0x267))),saveSessionContext({'llm_project':_0x56c7db[_0x2d1d8a(0x286)]},_0x3a2ab6[_0x2d1d8a(0x288)]),console['log'](a4_0x3da766[_0x2d1d8a(0x263)](_0x2d1d8a(0x27a)+a4_0x3da766[_0x2d1d8a(0x21e)](_0x2d1d8a(0x225))+_0x2d1d8a(0x23b)+a4_0x3da766[_0x2d1d8a(0x1fa)](_0x56c7db[_0x2d1d8a(0x286)]))),0x0;if(!_0x5301dc&&!_0x9b062){if(!isInteractive())return console['error'](a4_0x3da766['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2d1d8a(0x233)](a4_0x3da766[_0x2d1d8a(0x21e)](_0x2d1d8a(0x269))),0x1;const _0x672dfa=await confirmKey(_0x2d1d8a(0x21c)+(_0x57e5e7+_0x39f4c7)+_0x2d1d8a(0x24b));if(!_0x672dfa)return console[_0x2d1d8a(0x212)](a4_0x3da766[_0x2d1d8a(0x257)]('Cancelled'),_0x2d1d8a(0x1f2)),0x1;}const {data:_0x33fd5c}=await withSpinner('Writing\x20files...',()=>_0x30cdc1['llm'][_0x2d1d8a(0x25c)](_0x10cb1c,_0x4ee6df,{'force':_0x9b062}));return console[_0x2d1d8a(0x212)](a4_0x3da766[_0x2d1d8a(0x263)](_0x2d1d8a(0x27f)+(_0x57e5e7+_0x39f4c7)+_0x2d1d8a(0x282)+_0x33fd5c[_0x2d1d8a(0x1ea)])),saveSessionContext({'llm_project':_0x33fd5c[_0x2d1d8a(0x286)]},_0x3a2ab6[_0x2d1d8a(0x288)]),console[_0x2d1d8a(0x212)](a4_0x3da766['green'](_0x2d1d8a(0x27a)+a4_0x3da766[_0x2d1d8a(0x21e)](_0x2d1d8a(0x225))+_0x2d1d8a(0x23b)+a4_0x3da766[_0x2d1d8a(0x1fa)](_0x33fd5c[_0x2d1d8a(0x286)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x2af0fe(0x262);['description']=a4_0x2af0fe(0x1ed);async[a4_0x2af0fe(0x24e)](_0x5c236d){const _0x3ebc85=a4_0x2af0fe,{options:_0x220733,args:_0x2fdee4,tdx:_0x4de6ce}=_0x5c236d,_0x25e917=_0x2fdee4[0x0],_0xd6c711=_0x220733[_0x3ebc85(0x20d)],_0x42d2f3=_0x220733[_0x3ebc85(0x25b)],_0x3a5c23=_0x220733[_0x3ebc85(0x24f)],_0x53820a=_0x220733[_0x3ebc85(0x25a)],_0x24df62=_0x220733[_0x3ebc85(0x224)];let _0x22430d;const _0x1c02a0=findAgentConfigPath(process['cwd']());if(_0x25e917){const _0x3daa15=a4_0x36d7a3[_0x3ebc85(0x292)](_0x25e917,_0x3ebc85(0x239));existsSync(_0x3daa15)?(_0x22430d=_0x25e917,console['log'](a4_0x3da766[_0x3ebc85(0x21e)](_0x3ebc85(0x28b)+_0x25e917))):_0x22430d=_0x25e917;}else{if(_0x1c02a0)_0x22430d=a4_0x36d7a3[_0x3ebc85(0x240)](_0x1c02a0),console[_0x3ebc85(0x212)](a4_0x3da766[_0x3ebc85(0x21e)]('Using\x20current\x20project:\x20'+_0x22430d));else{if(_0x24df62){const _0x14e48d=sanitizeForFilesystem(_0x24df62);let _0x403eba=_0x14e48d,_0x13dce8=a4_0x36d7a3[_0x3ebc85(0x292)](process[_0x3ebc85(0x22e)](),_0x3ebc85(0x290),_0x14e48d,_0x3ebc85(0x239));if(!existsSync(_0x13dce8)){const _0x276631=normalizeName(_0x24df62),_0x3817e6=a4_0x36d7a3[_0x3ebc85(0x292)](process['cwd'](),_0x3ebc85(0x290),_0x276631,_0x3ebc85(0x239));existsSync(_0x3817e6)&&(_0x403eba=_0x276631,_0x13dce8=_0x3817e6);}if(existsSync(_0x13dce8))_0x22430d=a4_0x36d7a3[_0x3ebc85(0x240)](_0x13dce8),console[_0x3ebc85(0x212)](a4_0x3da766[_0x3ebc85(0x21e)](_0x3ebc85(0x28b)+_0x22430d));else{const _0x54ddbf=_0x220733[_0x3ebc85(0x23a)];if(_0x54ddbf)throw new SDKError(ErrorCode[_0x3ebc85(0x1de)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x24df62+_0x3ebc85(0x1dd),undefined,{'helpText':_0x3ebc85(0x242)+_0x3ebc85(0x243)+(_0x3ebc85(0x250)+_0x24df62+'\x0a')+(_0x3ebc85(0x246)+_0x403eba+'\x20--name\x20'+(_0xd6c711||_0x3ebc85(0x284))+_0x3ebc85(0x24a)+_0x54ddbf)});_0x22430d=_0x24df62,console[_0x3ebc85(0x212)](a4_0x3da766['dim'](_0x3ebc85(0x248)+_0x24df62));}}}}if(!_0x22430d)return console[_0x3ebc85(0x212)](a4_0x3da766[_0x3ebc85(0x257)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x3ebc85(0x212)](_0x3ebc85(0x217)),console[_0x3ebc85(0x212)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x3ebc85(0x212)](_0x3ebc85(0x251)),console[_0x3ebc85(0x212)](_0x3ebc85(0x218)),0x1;if(!_0xd6c711)throw new SDKError(ErrorCode[_0x3ebc85(0x222)],_0x3ebc85(0x24d),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x3a5c23&&!_0x42d2f3){if(!isInteractive())return console[_0x3ebc85(0x233)](a4_0x3da766[_0x3ebc85(0x260)](_0x3ebc85(0x202)),_0x3ebc85(0x26a)),console[_0x3ebc85(0x233)](a4_0x3da766['dim'](_0x3ebc85(0x269))),0x1;const _0x3c4680=await confirmKey('Clone\x20\x22'+_0x22430d+_0x3ebc85(0x22c)+_0xd6c711+'\x22?');if(!_0x3c4680)return console[_0x3ebc85(0x212)](a4_0x3da766[_0x3ebc85(0x257)](_0x3ebc85(0x237))),0x1;}const {data:_0x3cf285}=await withSpinner('Cloning\x20\x22'+_0x22430d+'\x22\x20to\x20\x22'+_0xd6c711+'\x22...',()=>_0x4de6ce['llm'][_0x3ebc85(0x23c)](_0x22430d,_0xd6c711,{'dryRun':_0x42d2f3}));if(_0x42d2f3){console[_0x3ebc85(0x212)](a4_0x3da766[_0x3ebc85(0x257)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x3ebc85(0x212)](_0x3ebc85(0x1e5)+_0x3cf285[_0x3ebc85(0x1dc)]),console[_0x3ebc85(0x212)]('New\x20project:\x20'+_0xd6c711),console[_0x3ebc85(0x212)](_0x3ebc85(0x1fd)),console[_0x3ebc85(0x212)](_0x3ebc85(0x273)+_0x3cf285[_0x3ebc85(0x226)][_0x3ebc85(0x290)][_0x3ebc85(0x259)]),console[_0x3ebc85(0x212)](_0x3ebc85(0x1e7)+_0x3cf285[_0x3ebc85(0x226)][_0x3ebc85(0x221)]['created']),console['log']('\x20\x20Prompts:\x20'+_0x3cf285['counts'][_0x3ebc85(0x283)]['created']),console['log'](_0x3ebc85(0x294)+_0x3cf285['counts']['formInterfaces']['created']),console[_0x3ebc85(0x212)]('\x20\x20Chat\x20Interfaces:\x20'+_0x3cf285[_0x3ebc85(0x226)]['chatInterfaces'][_0x3ebc85(0x259)]);const _0x42b3ea=_0x3cf285[_0x3ebc85(0x226)][_0x3ebc85(0x1e1)][_0x3ebc85(0x259)]>0x0||_0x3cf285[_0x3ebc85(0x226)][_0x3ebc85(0x201)][_0x3ebc85(0x259)]>0x0;return _0x42b3ea&&(console['log'](_0x3ebc85(0x25d)+_0x3cf285[_0x3ebc85(0x226)][_0x3ebc85(0x1e1)]['created']),console[_0x3ebc85(0x212)](_0x3ebc85(0x258)+_0x3cf285[_0x3ebc85(0x226)][_0x3ebc85(0x201)][_0x3ebc85(0x259)])),0x0;}const _0x4558f8=_0x3cf285[_0x3ebc85(0x226)][_0x3ebc85(0x290)][_0x3ebc85(0x200)]>0x0||_0x3cf285[_0x3ebc85(0x226)][_0x3ebc85(0x221)][_0x3ebc85(0x200)]>0x0||_0x3cf285[_0x3ebc85(0x226)][_0x3ebc85(0x283)]['errors']>0x0||_0x3cf285['counts'][_0x3ebc85(0x247)][_0x3ebc85(0x200)]>0x0||_0x3cf285[_0x3ebc85(0x226)]['chatInterfaces'][_0x3ebc85(0x200)]>0x0||_0x3cf285[_0x3ebc85(0x226)][_0x3ebc85(0x1e1)]['errors']>0x0||_0x3cf285[_0x3ebc85(0x226)][_0x3ebc85(0x201)][_0x3ebc85(0x200)]>0x0;_0x4558f8?console[_0x3ebc85(0x212)](a4_0x3da766[_0x3ebc85(0x257)](_0x3ebc85(0x21d))):console[_0x3ebc85(0x212)](a4_0x3da766[_0x3ebc85(0x263)](_0x3ebc85(0x268)));console[_0x3ebc85(0x212)](_0x3ebc85(0x1e5)+_0x3cf285[_0x3ebc85(0x1dc)]),console['log'](_0x3ebc85(0x20c)+_0x3cf285[_0x3ebc85(0x238)]),console['log'](_0x3ebc85(0x24c)+_0x3cf285[_0x3ebc85(0x23e)]),console[_0x3ebc85(0x212)](),console[_0x3ebc85(0x212)](_0x3ebc85(0x232)),console[_0x3ebc85(0x212)](_0x3ebc85(0x273)+formatCountSummary(_0x3cf285['counts'][_0x3ebc85(0x290)])),console[_0x3ebc85(0x212)](_0x3ebc85(0x1e7)+formatCountSummary(_0x3cf285[_0x3ebc85(0x226)][_0x3ebc85(0x221)])),console[_0x3ebc85(0x212)](_0x3ebc85(0x220)+formatCountSummary(_0x3cf285[_0x3ebc85(0x226)][_0x3ebc85(0x283)])),console[_0x3ebc85(0x212)](_0x3ebc85(0x1ef)+formatCountSummary(_0x3cf285['counts']['integrations'])),console[_0x3ebc85(0x212)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x3cf285['counts'][_0x3ebc85(0x247)])),console['log'](_0x3ebc85(0x1f6)+formatCountSummary(_0x3cf285[_0x3ebc85(0x226)][_0x3ebc85(0x1ec)]));const _0x373e0b=_0x3cf285['counts'][_0x3ebc85(0x1e1)][_0x3ebc85(0x259)]>0x0||_0x3cf285['counts']['experimentalKnowledgeBases']['updated']>0x0||_0x3cf285[_0x3ebc85(0x226)][_0x3ebc85(0x1e1)][_0x3ebc85(0x235)]>0x0||_0x3cf285[_0x3ebc85(0x226)]['experimentalArtifacts'][_0x3ebc85(0x259)]>0x0||_0x3cf285[_0x3ebc85(0x226)][_0x3ebc85(0x201)]['updated']>0x0||_0x3cf285[_0x3ebc85(0x226)][_0x3ebc85(0x201)]['unchanged']>0x0;_0x373e0b&&(console['log'](_0x3ebc85(0x25d)+formatCountSummary(_0x3cf285['counts'][_0x3ebc85(0x1e1)])),console[_0x3ebc85(0x212)](_0x3ebc85(0x258)+formatCountSummary(_0x3cf285[_0x3ebc85(0x226)][_0x3ebc85(0x201)])));if(_0x4558f8){console['log'](),console[_0x3ebc85(0x212)](a4_0x3da766[_0x3ebc85(0x260)](_0x3ebc85(0x27e)));for(const _0x4c8c22 of _0x3cf285['agents']){_0x4c8c22[_0x3ebc85(0x230)]===_0x3ebc85(0x233)&&console['log'](a4_0x3da766[_0x3ebc85(0x260)](_0x3ebc85(0x264)+_0x4c8c22['agentName']+_0x3ebc85(0x276)+_0x4c8c22[_0x3ebc85(0x233)]));}for(const _0x456aaf of _0x3cf285['knowledgeBases']){_0x456aaf[_0x3ebc85(0x230)]==='error'&&console[_0x3ebc85(0x212)](a4_0x3da766[_0x3ebc85(0x260)](_0x3ebc85(0x245)+_0x456aaf['name']+'\x22:\x20'+_0x456aaf['error']));}for(const _0x371589 of _0x3cf285[_0x3ebc85(0x283)]){_0x371589[_0x3ebc85(0x230)]===_0x3ebc85(0x233)&&console['log'](a4_0x3da766[_0x3ebc85(0x260)](_0x3ebc85(0x23f)+_0x371589[_0x3ebc85(0x20d)]+_0x3ebc85(0x276)+_0x371589[_0x3ebc85(0x233)]));}for(const _0x245d5a of _0x3cf285[_0x3ebc85(0x28a)]){_0x245d5a[_0x3ebc85(0x230)]==='error'&&console['log'](a4_0x3da766[_0x3ebc85(0x260)](_0x3ebc85(0x1fe)+_0x245d5a['name']+_0x3ebc85(0x276)+_0x245d5a['error']));}for(const _0x5e71e0 of _0x3cf285['formInterfaces']){_0x5e71e0[_0x3ebc85(0x230)]===_0x3ebc85(0x233)&&console['log'](a4_0x3da766['red']('\x20\x20Form\x20Interface\x20\x22'+_0x5e71e0['name']+'\x22:\x20'+_0x5e71e0[_0x3ebc85(0x233)]));}for(const _0x6b7ae1 of _0x3cf285['chatInterfaces']){_0x6b7ae1[_0x3ebc85(0x230)]===_0x3ebc85(0x233)&&console[_0x3ebc85(0x212)](a4_0x3da766[_0x3ebc85(0x260)](_0x3ebc85(0x1e6)+_0x6b7ae1[_0x3ebc85(0x20d)]+_0x3ebc85(0x276)+_0x6b7ae1[_0x3ebc85(0x233)]));}for(const _0x15abec of _0x3cf285['experimentalKnowledgeBases']){_0x15abec[_0x3ebc85(0x230)]==='error'&&console[_0x3ebc85(0x212)](a4_0x3da766[_0x3ebc85(0x260)](_0x3ebc85(0x1d9)+_0x15abec[_0x3ebc85(0x20d)]+_0x3ebc85(0x276)+_0x15abec['error']));}for(const _0xbcb242 of _0x3cf285['experimentalArtifacts']){_0xbcb242['action']===_0x3ebc85(0x233)&&console[_0x3ebc85(0x212)](a4_0x3da766[_0x3ebc85(0x260)](_0x3ebc85(0x1ee)+_0xbcb242[_0x3ebc85(0x20d)]+_0x3ebc85(0x276)+_0xbcb242['error']));}return 0x1;}console[_0x3ebc85(0x212)]();const _0x575cf5=getLLMProjectUrl(_0x53820a,_0x3cf285['newProjectId']);return console[_0x3ebc85(0x212)](_0x3ebc85(0x253)+a4_0x3da766['cyan'](_0x575cf5)),0x0;}}function a4_0x47ff(){const _0x4a17fa=['errors','experimentalArtifacts','\x0aError:','Pushing\x20agent\x20from\x20\x22','agentName','4hfAfCy','Pushing\x20to\x20project...','\x0aChanges:','338058OkWoID','\x0aPush\x20summary\x20for\x20\x27','new','Would\x20pull\x20agent:\x20','New\x20project:\x20','name','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','updated','parse','log','context','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','push','Output\x20path:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','479711HbFpvq','\x0aChanges\x20to\x20integration\x20\x27','\x0aWrite\x20','Project\x20cloned\x20with\x20errors','dim','output','\x20\x20Prompts:\x20','knowledgeBases','MISSING_ARGUMENT','agent:push','llmProject','llm_project','counts','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','hasChanges','Agent:\x20','agentId','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x22\x20to\x20new\x20project\x20\x22','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','cwd','total','action','No\x20tdx.json\x20found\x20in\x20','Summary:','error','textKnowledgeBases','unchanged','\x20successfully','Cancelled','newProjectName','tdx.json','profile','\x20=\x20','cloneProject','repeat','newProjectId','\x20\x20Prompt\x20\x22','dirname','\x20updated','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','arg-dir','\x20\x20Knowledge\x20Base\x20\x22','\x20\x20tdx\x20agent\x20clone\x20agents/','formInterfaces','Using\x20context\x20project:\x20','\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','\x20--profile\x20','\x20files?','New\x20project\x20ID:\x20','New\x20project\x20name\x20is\x20required','execute','yes','\x20\x20tdx\x20agent\x20pull\x20','\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)','pushProject','Project:\x20','3009405uBDykH','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','yellow','\x20\x20Experimental\x20Artifacts:\x20','created','site','dryRun','pullProject','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x0aChanges\x20to\x20prompt\x20\x27','\x22...','red','\x0aChanges\x20to\x20agent\x20\x27','agent:clone','green','\x20\x20Agent\x20\x22','llm','reason','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Project\x20cloned\x20successfully','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Dry\x20run\x20-\x20no\x20changes\x20made','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Status:\x20','source','message','\x0aChanges\x20to\x20form\x20interface\x20\x27','no_context','\x20total','\x20\x20Agents:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','1227690StjDMJ','\x22:\x20','projectDir','Dry\x20run\x20-\x20no\x20files\x20written','\x20changed','✔\x20Context\x20set:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','projectId','\x20\x20Target:\x20','Errors:','\x0a✔\x20Pulled\x20','agent:pull','1545CNbDul','\x20files\x20to\x20','prompts','<new-name>','\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','projectName','\x27\x20to\x20create\x20the\x20folder\x20structure.','session','Analyzing\x20changes\x20to\x20push...','integrations','Using\x20local\x20project:\x20','8QRXvBq','Failed\x20to\x20push\x20agent:\x20','\x0aChanges\x20to\x20chat\x20interface\x20\x27','Using\x20project:\x20','agents','Would\x20push\x20agent:\x20','join','Output:\x20','\x20\x20Form\x20Interfaces:\x20','agent','gray','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','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)','\x20|\x20','sourceProjectName','\x22\x20to\x20a\x20different\x20profile','INVALID_ARGUMENT','diff','4782627WbRWUp','experimentalKnowledgeBases','cwd-config','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','utf-8','Source:\x20','\x20\x20Chat\x20Interface\x20\x22','\x20\x20Knowledge\x20Bases:\x20','force','description','outputDir','no_local_folder','chatInterfaces','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20Experimental\x20Artifact\x20\x22','\x20\x20Integrations:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x20unchanged','-\x20no\x20files\x20written','\x0aProject\x20pushed\x20with\x20errors','2994372djtcoU','outputPath','\x20\x20Chat\x20Interfaces:\x20','\x20resources?','Chat:\x20','Agent\x20pulled\x20successfully','cyan','\x20\x20Form\x20Interface\x20\x22','\x20created','Would\x20clone:','\x20\x20Integration\x20\x22','\x20new'];a4_0x47ff=function(){return _0x4a17fa;};return a4_0x47ff();}export class AgentPushCommand extends BaseCommand{[a4_0x2af0fe(0x20d)]=a4_0x2af0fe(0x223);[a4_0x2af0fe(0x1e9)]=a4_0x2af0fe(0x255);async['execute'](_0x189341){const _0x3793ab=a4_0x2af0fe,{options:_0x38e5dd,args:_0x13443c,tdx:_0x192436}=_0x189341;let _0x157910=_0x13443c[0x0]||process[_0x3793ab(0x22e)]();const _0x2328d4=_0x38e5dd[_0x3793ab(0x25b)],_0x4df92b=_0x38e5dd['force'],_0xfcedda=_0x38e5dd[_0x3793ab(0x24f)],_0x385993=_0x38e5dd[_0x3793ab(0x25a)],_0x593015=a4_0x36d7a3[_0x3793ab(0x292)](_0x157910,'agent.yml'),_0x128cfe=existsSync(_0x593015);if(_0x128cfe){const {data:_0x38465b}=await withSpinner(_0x3793ab(0x203)+_0x157910+_0x3793ab(0x25f),()=>_0x192436[_0x3793ab(0x265)]['pushAgent'](_0x157910,{'dryRun':_0x2328d4,'force':_0x4df92b}));if(_0x2328d4)return console['log'](a4_0x3da766[_0x3793ab(0x257)](_0x3793ab(0x26b))),console[_0x3793ab(0x212)](_0x3793ab(0x291)+_0x38465b[_0x3793ab(0x204)]),0x0;if(_0x38465b['action']===_0x3793ab(0x233))return console['log'](a4_0x3da766[_0x3793ab(0x260)](_0x3793ab(0x28d)+_0x38465b[_0x3793ab(0x233)])),0x1;console[_0x3793ab(0x212)](a4_0x3da766[_0x3793ab(0x263)]('Agent\x20'+_0x38465b[_0x3793ab(0x230)]+_0x3793ab(0x236))),console[_0x3793ab(0x212)](_0x3793ab(0x229)+_0x38465b['agentName']);if(_0x38465b[_0x3793ab(0x22a)]&&_0x38465b[_0x3793ab(0x27c)]){const _0x86f8f3=getLLMAgentChatUrl(_0x385993,_0x38465b['projectId'],_0x38465b[_0x3793ab(0x22a)]);console[_0x3793ab(0x212)](_0x3793ab(0x1f8)+a4_0x3da766[_0x3793ab(0x1fa)](_0x86f8f3));}return 0x0;}const _0x20af74=_0x38e5dd['llmProject'],_0x24bc64=resolveProjectFromContext(_0x157910,_0x20af74);if(_0x24bc64['found'])_0x157910=_0x24bc64[_0x3793ab(0x277)],_0x24bc64[_0x3793ab(0x26e)]==='context'&&console[_0x3793ab(0x212)](a4_0x3da766[_0x3793ab(0x21e)](_0x3793ab(0x28f)+_0x157910));else{let _0x424cd3=_0x3793ab(0x22b);_0x24bc64['reason']===_0x3793ab(0x1eb)&&(_0x424cd3=_0x24bc64[_0x3793ab(0x26f)]+_0x3793ab(0x219)+_0x24bc64['llmProject']+_0x3793ab(0x287));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x24bc64[_0x3793ab(0x266)]===_0x3793ab(0x271)?_0x24bc64[_0x3793ab(0x26f)]:_0x3793ab(0x231)+_0x157910,undefined,{'helpText':_0x424cd3});}const {data:_0x4d1d68}=await withSpinner(_0x3793ab(0x289),()=>_0x192436[_0x3793ab(0x265)]['pushProject'](_0x157910,{'dryRun':!![]})),_0x2d2b9b=_0x4d1d68[_0x3793ab(0x226)][_0x3793ab(0x290)]['errors']>0x0;if(_0x2d2b9b){console[_0x3793ab(0x212)](a4_0x3da766[_0x3793ab(0x260)]('\x0aErrors\x20found:'));for(const _0x33c9de of _0x4d1d68[_0x3793ab(0x290)]){_0x33c9de['action']==='error'&&console['log'](a4_0x3da766[_0x3793ab(0x260)]('\x20\x20Agent\x20\x22'+_0x33c9de[_0x3793ab(0x204)]+_0x3793ab(0x276)+_0x33c9de[_0x3793ab(0x233)]));}return 0x1;}const _0x171b05=_0x4d1d68[_0x3793ab(0x226)]['agents']['created']+_0x4d1d68[_0x3793ab(0x226)][_0x3793ab(0x221)]['created']+_0x4d1d68['counts'][_0x3793ab(0x234)][_0x3793ab(0x259)]+_0x4d1d68[_0x3793ab(0x226)][_0x3793ab(0x283)][_0x3793ab(0x259)]+_0x4d1d68[_0x3793ab(0x226)][_0x3793ab(0x28a)][_0x3793ab(0x259)]+_0x4d1d68['counts'][_0x3793ab(0x1e1)][_0x3793ab(0x259)]+_0x4d1d68[_0x3793ab(0x226)][_0x3793ab(0x201)]['created']+_0x4d1d68[_0x3793ab(0x226)][_0x3793ab(0x247)]['created']+_0x4d1d68[_0x3793ab(0x226)]['chatInterfaces'][_0x3793ab(0x259)],_0x1ffd47=_0x4d1d68[_0x3793ab(0x226)][_0x3793ab(0x290)][_0x3793ab(0x210)]+_0x4d1d68[_0x3793ab(0x226)][_0x3793ab(0x221)][_0x3793ab(0x210)]+_0x4d1d68[_0x3793ab(0x226)][_0x3793ab(0x234)][_0x3793ab(0x210)]+_0x4d1d68[_0x3793ab(0x226)]['prompts'][_0x3793ab(0x210)]+_0x4d1d68['counts'][_0x3793ab(0x28a)]['updated']+_0x4d1d68[_0x3793ab(0x226)][_0x3793ab(0x1e1)][_0x3793ab(0x210)]+_0x4d1d68[_0x3793ab(0x226)][_0x3793ab(0x201)]['updated']+_0x4d1d68[_0x3793ab(0x226)][_0x3793ab(0x247)][_0x3793ab(0x210)]+_0x4d1d68[_0x3793ab(0x226)]['chatInterfaces'][_0x3793ab(0x210)],_0x2ff503=_0x4d1d68[_0x3793ab(0x226)]['agents'][_0x3793ab(0x235)]+_0x4d1d68[_0x3793ab(0x226)]['knowledgeBases'][_0x3793ab(0x235)]+_0x4d1d68[_0x3793ab(0x226)][_0x3793ab(0x234)][_0x3793ab(0x235)]+_0x4d1d68['counts'][_0x3793ab(0x283)]['unchanged']+_0x4d1d68['counts'][_0x3793ab(0x28a)][_0x3793ab(0x235)]+_0x4d1d68[_0x3793ab(0x226)][_0x3793ab(0x1e1)][_0x3793ab(0x235)]+_0x4d1d68['counts'][_0x3793ab(0x201)][_0x3793ab(0x235)]+_0x4d1d68[_0x3793ab(0x226)]['formInterfaces'][_0x3793ab(0x235)]+_0x4d1d68['counts'][_0x3793ab(0x1ec)]['unchanged'];console[_0x3793ab(0x212)](_0x3793ab(0x209)+_0x4d1d68[_0x3793ab(0x286)]+'\x27:'),console[_0x3793ab(0x212)]('\x20\x20'+a4_0x3da766[_0x3793ab(0x263)]('+\x20'+_0x171b05+'\x20new')+_0x3793ab(0x1db)+a4_0x3da766[_0x3793ab(0x257)]('~\x20'+_0x1ffd47+'\x20changed')+_0x3793ab(0x1db)+a4_0x3da766['dim']('=\x20'+_0x2ff503+_0x3793ab(0x1f1))),console[_0x3793ab(0x212)](_0x3793ab(0x273)+formatCountSummary(_0x4d1d68['counts'][_0x3793ab(0x290)])),console[_0x3793ab(0x212)](_0x3793ab(0x1e7)+formatCountSummary(_0x4d1d68['counts'][_0x3793ab(0x221)])),console[_0x3793ab(0x212)](_0x3793ab(0x20e)+formatCountSummary(_0x4d1d68[_0x3793ab(0x226)][_0x3793ab(0x234)])),console['log'](_0x3793ab(0x220)+formatCountSummary(_0x4d1d68['counts'][_0x3793ab(0x283)])),console[_0x3793ab(0x212)](_0x3793ab(0x1ef)+formatCountSummary(_0x4d1d68[_0x3793ab(0x226)][_0x3793ab(0x28a)])),console[_0x3793ab(0x212)](_0x3793ab(0x294)+formatCountSummary(_0x4d1d68[_0x3793ab(0x226)]['formInterfaces'])),console[_0x3793ab(0x212)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x4d1d68[_0x3793ab(0x226)][_0x3793ab(0x1ec)]));const _0x131600=_0x4d1d68[_0x3793ab(0x226)][_0x3793ab(0x1e1)][_0x3793ab(0x259)]>0x0||_0x4d1d68[_0x3793ab(0x226)][_0x3793ab(0x1e1)][_0x3793ab(0x210)]>0x0||_0x4d1d68['counts'][_0x3793ab(0x1e1)][_0x3793ab(0x235)]>0x0||_0x4d1d68[_0x3793ab(0x226)][_0x3793ab(0x201)][_0x3793ab(0x259)]>0x0||_0x4d1d68[_0x3793ab(0x226)][_0x3793ab(0x201)]['updated']>0x0||_0x4d1d68['counts'][_0x3793ab(0x201)]['unchanged']>0x0;_0x131600&&(console[_0x3793ab(0x212)](_0x3793ab(0x25d)+formatCountSummary(_0x4d1d68['counts'][_0x3793ab(0x1e1)])),console[_0x3793ab(0x212)](_0x3793ab(0x258)+formatCountSummary(_0x4d1d68[_0x3793ab(0x226)]['experimentalArtifacts'])));console[_0x3793ab(0x212)]('\x20\x20Source:\x20'+a4_0x3da766[_0x3793ab(0x1fa)](_0x157910)),displayDiffs(_0x4d1d68[_0x3793ab(0x290)],_0x4d1d68['knowledgeBases'],_0x4d1d68[_0x3793ab(0x234)],_0x4d1d68[_0x3793ab(0x283)],_0x4d1d68['integrations'],_0x4d1d68[_0x3793ab(0x1e1)],_0x4d1d68[_0x3793ab(0x201)],_0x4d1d68[_0x3793ab(0x247)],_0x4d1d68[_0x3793ab(0x1ec)]);if(_0x2328d4)return console[_0x3793ab(0x212)](a4_0x3da766[_0x3793ab(0x257)](_0x3793ab(0x274))),0x0;if(_0x171b05===0x0&&_0x1ffd47===0x0){console[_0x3793ab(0x212)](a4_0x3da766['green'](_0x3793ab(0x256)));const _0x1ac860=getLLMProjectUrl(_0x385993,_0x4d1d68[_0x3793ab(0x27c)]);return console[_0x3793ab(0x212)](_0x3793ab(0x253)+a4_0x3da766[_0x3793ab(0x1fa)](_0x1ac860)),0x0;}if(!_0xfcedda&&!_0x4df92b){if(!isInteractive())return console[_0x3793ab(0x233)](a4_0x3da766[_0x3793ab(0x260)](_0x3793ab(0x202)),_0x3793ab(0x26a)),console[_0x3793ab(0x233)](a4_0x3da766['dim'](_0x3793ab(0x269))),0x1;const _0x170c4a=await confirmKey('\x0aPush\x20'+(_0x171b05+_0x1ffd47)+_0x3793ab(0x1f7));if(!_0x170c4a)return console[_0x3793ab(0x212)](a4_0x3da766[_0x3793ab(0x257)](_0x3793ab(0x237)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x989abe}=await withSpinner(_0x3793ab(0x206),()=>_0x192436[_0x3793ab(0x265)][_0x3793ab(0x252)](_0x157910,{'force':_0x4df92b})),_0x5419c6=_0x989abe[_0x3793ab(0x226)][_0x3793ab(0x290)]['errors']>0x0||_0x989abe['counts'][_0x3793ab(0x221)][_0x3793ab(0x200)]>0x0||_0x989abe[_0x3793ab(0x226)]['textKnowledgeBases']['errors']>0x0||_0x989abe[_0x3793ab(0x226)]['prompts'][_0x3793ab(0x200)]>0x0||_0x989abe[_0x3793ab(0x226)][_0x3793ab(0x247)][_0x3793ab(0x200)]>0x0||_0x989abe[_0x3793ab(0x226)][_0x3793ab(0x1ec)][_0x3793ab(0x200)]>0x0;if(_0x5419c6){console[_0x3793ab(0x212)](a4_0x3da766[_0x3793ab(0x257)](_0x3793ab(0x1f3))),console['log'](),console[_0x3793ab(0x212)](a4_0x3da766['red'](_0x3793ab(0x27e)));for(const _0x53ff10 of _0x989abe[_0x3793ab(0x290)]){_0x53ff10[_0x3793ab(0x230)]===_0x3793ab(0x233)&&console[_0x3793ab(0x212)](a4_0x3da766['red']('\x20\x20Agent\x20\x22'+_0x53ff10[_0x3793ab(0x204)]+_0x3793ab(0x276)+_0x53ff10[_0x3793ab(0x233)]));}for(const _0x1814c0 of _0x989abe[_0x3793ab(0x221)]){_0x1814c0[_0x3793ab(0x230)]==='error'&&console['log'](a4_0x3da766[_0x3793ab(0x260)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x1814c0[_0x3793ab(0x20d)]+_0x3793ab(0x276)+_0x1814c0['error']));}for(const _0x1b0b53 of _0x989abe[_0x3793ab(0x234)]){_0x1b0b53[_0x3793ab(0x230)]===_0x3793ab(0x233)&&console[_0x3793ab(0x212)](a4_0x3da766[_0x3793ab(0x260)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x1b0b53[_0x3793ab(0x20d)]+_0x3793ab(0x276)+_0x1b0b53[_0x3793ab(0x233)]));}for(const _0x1beb38 of _0x989abe['prompts']){_0x1beb38[_0x3793ab(0x230)]===_0x3793ab(0x233)&&console['log'](a4_0x3da766[_0x3793ab(0x260)](_0x3793ab(0x23f)+_0x1beb38[_0x3793ab(0x20d)]+_0x3793ab(0x276)+_0x1beb38[_0x3793ab(0x233)]));}for(const _0x56bf0a of _0x989abe[_0x3793ab(0x28a)]){_0x56bf0a[_0x3793ab(0x230)]==='error'&&console[_0x3793ab(0x212)](a4_0x3da766[_0x3793ab(0x260)](_0x3793ab(0x1fe)+_0x56bf0a[_0x3793ab(0x20d)]+_0x3793ab(0x276)+_0x56bf0a[_0x3793ab(0x233)]));}for(const _0x501747 of _0x989abe[_0x3793ab(0x247)]){_0x501747['action']===_0x3793ab(0x233)&&console['log'](a4_0x3da766['red'](_0x3793ab(0x1fb)+_0x501747['name']+_0x3793ab(0x276)+_0x501747[_0x3793ab(0x233)]));}for(const _0x55cdcd of _0x989abe[_0x3793ab(0x1ec)]){_0x55cdcd['action']===_0x3793ab(0x233)&&console['log'](a4_0x3da766[_0x3793ab(0x260)]('\x20\x20Chat\x20Interface\x20\x22'+_0x55cdcd['name']+_0x3793ab(0x276)+_0x55cdcd[_0x3793ab(0x233)]));}return 0x1;}console[_0x3793ab(0x212)](a4_0x3da766[_0x3793ab(0x263)]('\x0a✔\x20Pushed\x20'+(_0x171b05+_0x1ffd47)+'\x20resources\x20to\x20\x27'+_0x989abe[_0x3793ab(0x286)]+'\x27'));const _0x1d6b98=getLLMProjectUrl(_0x385993,_0x989abe['projectId']);return console[_0x3793ab(0x212)](_0x3793ab(0x253)+a4_0x3da766[_0x3793ab(0x1fa)](_0x1d6b98)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x17415b=a5_0xf3b3;(function(_0x4c544d,_0x1f8934){const _0x5572eb=a5_0xf3b3,_0x250281=_0x4c544d();while(!![]){try{const _0x232eea=-parseInt(_0x5572eb(0x1cb))/0x1+-parseInt(_0x5572eb(0x250))/0x2+parseInt(_0x5572eb(0x229))/0x3+parseInt(_0x5572eb(0x24a))/0x4+parseInt(_0x5572eb(0x1f1))/0x5*(-parseInt(_0x5572eb(0x228))/0x6)+parseInt(_0x5572eb(0x20b))/0x7*(parseInt(_0x5572eb(0x233))/0x8)+parseInt(_0x5572eb(0x201))/0x9;if(_0x232eea===_0x1f8934)break;else _0x250281['push'](_0x250281['shift']());}catch(_0x37f894){_0x250281['push'](_0x250281['shift']());}}}(a5_0x20de,0x96ad2));import*as a5_0x178dc4 from'node:fs';function a5_0x20de(){const _0x5e0e4d=['Conversation\x20URL:\x20','stop','\x22,\x20but\x20current\x20site\x20is\x20\x22','Evaluating\x20response...','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','join','trim','\x20\x20Site:\x20','dim','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','filter','Round\x20','substring','Error\x20writing\x20output\x20file:\x20','red','toISOString','length','projectDir','not\x20found','\x20(cached)','545884DLQgEn','jsonl','start','tests','\x20-\x20','yellow','1451746VdLZPB','status','push','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','\x20\x20Conversation:\x20','green','Passed:\x20\x20\x20','tsv','Re-evaluating...','Total:\x20\x20\x20\x20','813070OsSTIp','resolveAgentId','...\x20','Using\x20agent:\x20','PASS','✗\x20FAIL:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Duration:\x20','round','llm','ERROR','size','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','table','Running\x20test:\x20','basename','message','some','Failed:\x20\x20\x20','✗\x20ERROR:\x20','No\x20tests\x20have\x20tags\x20defined.','Test\x20','json','agentDirs','repeat','no_local_folder','Errors:\x20\x20\x20','isSpinning','agent','\x22:\x20','Re-evaluating\x20cached\x20test\x20run...','Usage:','includes','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','text','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','3505JRXLmJ','conversations','llmProject','name','conversation_url','source','site','resolve','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','forEach','testName','no_tests','white','Agent:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','\x20(new)','20616534WSqjUh','now','New\x20tests\x20to\x20execute:\x20','tags','executeReeval','✓\x20PASS:\x20','Output\x20written\x20to:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','agentName','log','7AsFIth','output','Test\x20Summary','cyan','no_context','resolveProjectId','utf-8','writeFileSync','Round\x201/','add','reeval','verbose','map','projectName','404','split','\x20\x20Evaluating...\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','toLowerCase','Cached\x20run\x20is\x20from\x20site\x20\x22','FAIL','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','\x20\x20Round\x20','Running:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','has','reason','Available\x20tags:\x20','Site:\x20','6798PArZsN','696198rWyEgM','Failed\x20Tests:','Project\x20path:\x20','rounds','Run\x20tests\x20for\x20an\x20LLM\x20agent','\x27\x20to\x20create\x20the\x20folder\x20structure.',':\x20Sending\x20user\x20input...','\x20\x20Project:\x20','Available\x20tests:\x20','context','2328664FBHGtz','\x20\x20Agent:\x20','Cached\x20run\x20from:\x20'];a5_0x20de=function(){return _0x5e0e4d;};return a5_0x20de();}import*as a5_0x3f3055 from'node:path';import a5_0x4d72d3 from'chalk';function a5_0xf3b3(_0x453d1b,_0x2281fb){_0x453d1b=_0x453d1b-0x1c3;const _0x20de5c=a5_0x20de();let _0xf3b3f5=_0x20de5c[_0x453d1b];return _0xf3b3f5;}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_0x17415b(0x1f4)]='agent:test';['description']=a5_0x17415b(0x22d);async['execute'](_0x170f34){const _0x5aa758=a5_0x17415b,{options:_0x548d32,args:_0x227d1a,tdx:_0x190766}=_0x170f34,_0x13bd5e=_0x227d1a[0x0]||'.',_0x2c94df=_0x548d32['dryRun'],_0x1fd105=_0x548d32,_0x59da2a=_0x1fd105['eval']===![],_0x45dd0c=_0x1fd105[_0x5aa758(0x215)],_0x55ffce=_0x1fd105[_0x5aa758(0x1f4)],_0x2bafaf=_0x1fd105[_0x5aa758(0x204)],_0x63d97b=_0x548d32[_0x5aa758(0x1f7)],_0x5dd7fa=_0x1fd105[_0x5aa758(0x20c)];if(_0x45dd0c&&_0x59da2a)return console[_0x5aa758(0x20a)](a5_0x4d72d3[_0x5aa758(0x244)](_0x5aa758(0x1c3))),0x1;let _0x2b6379=_0x5aa758(0x1d9);if(_0x1fd105[_0x5aa758(0x1e2)])_0x2b6379=_0x5aa758(0x1e2);else{if(_0x1fd105[_0x5aa758(0x24b)])_0x2b6379=_0x5aa758(0x24b);else{if(_0x1fd105[_0x5aa758(0x1c8)])_0x2b6379='tsv';else{if(_0x1fd105[_0x5aa758(0x1d9)])_0x2b6379=_0x5aa758(0x1d9);}}}const _0x39806e=_0x1fd105[_0x5aa758(0x1f3)];let _0x23ea47=_0x13bd5e;const _0x135c2a=a5_0x178dc4['existsSync'](_0x13bd5e),_0x37aeaf=_0x13bd5e==='.';if(!_0x135c2a||_0x37aeaf){const _0xf9c0df=resolveProjectFromContext(_0x13bd5e,_0x39806e,{'requireFile':'test.yml'});if(_0xf9c0df['found'])_0x23ea47=_0xf9c0df[_0x5aa758(0x247)],_0xf9c0df[_0x5aa758(0x1f6)]===_0x5aa758(0x232)&&console[_0x5aa758(0x20a)](a5_0x4d72d3[_0x5aa758(0x23e)](_0x5aa758(0x1ce)+_0x23ea47));else switch(_0xf9c0df[_0x5aa758(0x225)]){case _0x5aa758(0x20f):console[_0x5aa758(0x20a)](a5_0x4d72d3[_0x5aa758(0x24f)](_0xf9c0df['message'])),console['log'](),console[_0x5aa758(0x20a)](_0x5aa758(0x1eb)),console[_0x5aa758(0x20a)]('\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'),console['log']('\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)'),console[_0x5aa758(0x20a)](),console[_0x5aa758(0x20a)](_0x5aa758(0x1d8));return 0x1;case _0x5aa758(0x1e5):console[_0x5aa758(0x20a)](a5_0x4d72d3[_0x5aa758(0x24f)](_0xf9c0df[_0x5aa758(0x1dc)])),console['log'](),console['log'](_0x5aa758(0x208)+_0xf9c0df['llmProject']+_0x5aa758(0x22e));return 0x1;case'multiple_agents':{const _0x5d73b8=a5_0x3f3055[_0x5aa758(0x1db)](_0xf9c0df['projectDir']);console[_0x5aa758(0x20a)](a5_0x4d72d3[_0x5aa758(0x24f)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0xf9c0df[_0x5aa758(0x1f3)]+'\x22:'));for(const _0x153886 of _0xf9c0df[_0x5aa758(0x1e3)]){console[_0x5aa758(0x20a)]('\x20\x20-\x20'+_0x153886);}return console[_0x5aa758(0x20a)](),console[_0x5aa758(0x20a)](_0x5aa758(0x220)+_0x5d73b8+'/<agent-name>'),0x1;}case _0x5aa758(0x1fc):console[_0x5aa758(0x20a)](a5_0x4d72d3['yellow'](_0x5aa758(0x1f9)+_0xf9c0df[_0x5aa758(0x1f3)]+'\x22.')),console[_0x5aa758(0x20a)](a5_0x4d72d3['dim'](_0x5aa758(0x22b)+_0xf9c0df[_0x5aa758(0x247)])),console[_0x5aa758(0x20a)](),console['log'](_0x5aa758(0x1d7));return 0x1;}}const {definition:_0x1aebe8,agentInfo:_0x255050}=parseTestFile(_0x23ea47);let _0x3b5167=_0x1aebe8[_0x5aa758(0x24d)];if(_0x55ffce){const _0x2ea248=_0x55ffce[_0x5aa758(0x21a)](',')[_0x5aa758(0x217)](_0x4bdbab=>_0x4bdbab[_0x5aa758(0x23c)]());_0x3b5167=_0x1aebe8[_0x5aa758(0x24d)][_0x5aa758(0x240)](_0x158a0a=>_0x2ea248['includes'](_0x158a0a[_0x5aa758(0x1f4)]));if(_0x3b5167[_0x5aa758(0x246)]===0x0)return console[_0x5aa758(0x20a)](a5_0x4d72d3['yellow']('No\x20tests\x20found\x20matching:\x20'+_0x55ffce)),console['log'](a5_0x4d72d3[_0x5aa758(0x23e)](_0x5aa758(0x231)+_0x1aebe8['tests'][_0x5aa758(0x217)](_0x26276c=>_0x26276c[_0x5aa758(0x1f4)])['join'](',\x20'))),0x1;}if(_0x2bafaf){const _0x1619e4=_0x2bafaf[_0x5aa758(0x21a)](',')[_0x5aa758(0x217)](_0x56bf40=>_0x56bf40['trim']()['toLowerCase']());_0x3b5167=_0x3b5167[_0x5aa758(0x240)](_0x1c8a1c=>_0x1c8a1c[_0x5aa758(0x204)]?.[_0x5aa758(0x1dd)](_0x8f7b65=>_0x1619e4[_0x5aa758(0x1ec)](_0x8f7b65[_0x5aa758(0x21d)]())));if(_0x3b5167[_0x5aa758(0x246)]===0x0){console['log'](a5_0x4d72d3[_0x5aa758(0x24f)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x2bafaf));const _0x580d83=new Set();return _0x1aebe8[_0x5aa758(0x24d)][_0x5aa758(0x1fa)](_0x4f0b18=>_0x4f0b18[_0x5aa758(0x204)]?.[_0x5aa758(0x1fa)](_0x488af8=>_0x580d83[_0x5aa758(0x214)](_0x488af8))),_0x580d83[_0x5aa758(0x1d6)]>0x0?console[_0x5aa758(0x20a)](a5_0x4d72d3[_0x5aa758(0x23e)](_0x5aa758(0x226)+[..._0x580d83][_0x5aa758(0x23b)](',\x20'))):console[_0x5aa758(0x20a)](a5_0x4d72d3[_0x5aa758(0x23e)](_0x5aa758(0x1e0))),0x1;}}if(_0x45dd0c)return this[_0x5aa758(0x205)](_0x170f34,{'definition':{'tests':_0x3b5167},'agentInfo':_0x255050,'outputFormat':_0x2b6379,'outputFile':_0x5dd7fa,'testNames':_0x55ffce});if(_0x2c94df){console['log'](a5_0x4d72d3[_0x5aa758(0x20e)]('Test\x20Configuration:')),console[_0x5aa758(0x20a)](_0x5aa758(0x23d)+a5_0x4d72d3[_0x5aa758(0x1fd)](_0x63d97b)),console['log'](_0x5aa758(0x230)+a5_0x4d72d3[_0x5aa758(0x1fd)](_0x255050[_0x5aa758(0x218)])),console['log'](_0x5aa758(0x234)+a5_0x4d72d3[_0x5aa758(0x1fd)](_0x255050[_0x5aa758(0x209)])),console[_0x5aa758(0x20a)](),console[_0x5aa758(0x20a)]('Tests\x20found:\x20'+a5_0x4d72d3['white'](_0x3b5167[_0x5aa758(0x246)]));for(let _0x6e12af=0x0;_0x6e12af<_0x3b5167['length'];_0x6e12af++){const _0x1fef87=_0x3b5167[_0x6e12af],_0x3d164a=_0x1fef87['rounds']['length']===0x1?_0x5aa758(0x1d3):_0x5aa758(0x22c),_0xed93bb=_0x1fef87[_0x5aa758(0x204)]?.[_0x5aa758(0x246)]?'\x20['+_0x1fef87[_0x5aa758(0x204)][_0x5aa758(0x23b)](',\x20')+']':'';console[_0x5aa758(0x20a)]('\x20\x20'+(_0x6e12af+0x1)+'.\x20'+a5_0x4d72d3[_0x5aa758(0x1fd)](_0x1fef87[_0x5aa758(0x1f4)])+'\x20('+_0x1fef87[_0x5aa758(0x22c)]['length']+'\x20'+_0x3d164a+')'+a5_0x4d72d3[_0x5aa758(0x23e)](_0xed93bb));}return 0x0;}let _0x1764ed,_0x57e379;try{_0x1764ed=await _0x190766[_0x5aa758(0x1d4)][_0x5aa758(0x210)](_0x255050[_0x5aa758(0x218)]);}catch(_0x49dbad){const _0x19ccfc=_0x49dbad instanceof Error?_0x49dbad[_0x5aa758(0x1dc)]:String(_0x49dbad);return _0x19ccfc[_0x5aa758(0x1ec)](_0x5aa758(0x219))||_0x19ccfc['toLowerCase']()['includes'](_0x5aa758(0x248))?console['log'](a5_0x4d72d3[_0x5aa758(0x244)](_0x5aa758(0x1ff)+_0x255050[_0x5aa758(0x218)])):console[_0x5aa758(0x20a)](a5_0x4d72d3[_0x5aa758(0x244)](_0x5aa758(0x1ee)+_0x255050['projectName']+_0x5aa758(0x1e9)+_0x19ccfc)),0x1;}try{_0x57e379=await _0x190766[_0x5aa758(0x1d4)][_0x5aa758(0x1cc)](_0x255050[_0x5aa758(0x209)],_0x1764ed);}catch(_0x202625){const _0x2c8474=_0x202625 instanceof Error?_0x202625['message']:String(_0x202625);return _0x2c8474[_0x5aa758(0x1ec)](_0x5aa758(0x219))||_0x2c8474[_0x5aa758(0x21d)]()[_0x5aa758(0x1ec)](_0x5aa758(0x248))?console[_0x5aa758(0x20a)](a5_0x4d72d3[_0x5aa758(0x244)](_0x5aa758(0x23a)+_0x255050[_0x5aa758(0x209)])):console['log'](a5_0x4d72d3[_0x5aa758(0x244)](_0x5aa758(0x1f0)+_0x255050[_0x5aa758(0x209)]+_0x5aa758(0x1e9)+_0x2c8474)),0x1;}let _0x5f30cf;if(!_0x59da2a)try{_0x5f30cf=await setupEvaluatorAgent(_0x190766[_0x5aa758(0x1d4)],_0x548d32[_0x5aa758(0x216)]);}catch(_0x41baf5){const _0x346202=_0x41baf5 instanceof Error?_0x41baf5[_0x5aa758(0x1dc)]:String(_0x41baf5);return console[_0x5aa758(0x20a)](a5_0x4d72d3['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x346202)),0x1;}console[_0x5aa758(0x20a)](a5_0x4d72d3[_0x5aa758(0x20e)]('Running\x20agent\x20tests...')),console[_0x5aa758(0x20a)](_0x5aa758(0x227)+a5_0x4d72d3[_0x5aa758(0x1fd)](_0x63d97b)),console[_0x5aa758(0x20a)](_0x5aa758(0x1fe)+a5_0x4d72d3[_0x5aa758(0x1fd)](_0x255050[_0x5aa758(0x218)]+'/'+_0x255050[_0x5aa758(0x209)])),console['log']();const _0x1f8676=[],_0x40b134=[],_0x26fd48=Date[_0x5aa758(0x202)]();for(let _0x4bc6c5=0x0;_0x4bc6c5<_0x3b5167[_0x5aa758(0x246)];_0x4bc6c5++){const _0x11aa68=_0x3b5167[_0x4bc6c5];_0x3b5167['length']>0x1?console['log'](_0x5aa758(0x1e1)+(_0x4bc6c5+0x1)+'/'+_0x3b5167[_0x5aa758(0x246)]+':\x20'+a5_0x4d72d3[_0x5aa758(0x1fd)](_0x11aa68[_0x5aa758(0x1f4)])):console[_0x5aa758(0x20a)](_0x5aa758(0x1da)+a5_0x4d72d3[_0x5aa758(0x1fd)](_0x11aa68[_0x5aa758(0x1f4)]));const _0x325a54=createCommandSpinner(_0x5aa758(0x213)+_0x11aa68[_0x5aa758(0x22c)][_0x5aa758(0x246)]+':\x20Sending\x20user\x20input...');_0x325a54[_0x5aa758(0x24c)]();try{const {result:_0x74e939,conversation:_0x216a5d}=await runTest(_0x190766[_0x5aa758(0x1d4)],_0x11aa68,{'agentId':_0x57e379,'projectId':_0x1764ed,'site':_0x63d97b,'noEval':_0x59da2a,'evaluatorId':_0x5f30cf,'onRoundStart':(_0xb83e38,_0x413391)=>{const _0xf743f=_0x5aa758;_0x325a54[_0xf743f(0x1ef)]='Round\x20'+(_0xb83e38+0x1)+'/'+_0x413391+_0xf743f(0x22f);},'onRoundComplete':(_0x5ae153,_0x4caa8e,_0xb80dac)=>{const _0x10c973=_0x5aa758,_0x4fb856=formatElapsed(_0x4caa8e);_0xb80dac?console['log'](_0x10c973(0x221)+(_0x5ae153+0x1)+'/'+_0x11aa68[_0x10c973(0x22c)][_0x10c973(0x246)]+'...\x20'+a5_0x4d72d3['green']('✓')+'\x20('+_0x4fb856+')'):console[_0x10c973(0x20a)]('\x20\x20Round\x20'+(_0x5ae153+0x1)+'/'+_0x11aa68[_0x10c973(0x22c)][_0x10c973(0x246)]+'...\x20'+a5_0x4d72d3[_0x10c973(0x244)]('✗'));},'onEvaluationStart':()=>{const _0xfdb117=_0x5aa758;_0x325a54[_0xfdb117(0x1ef)]='Evaluating\x20response...';},'onEvaluationComplete':_0x5f0432=>{const _0x277549=_0x5aa758,_0x1a9363=formatElapsed(_0x5f0432);console[_0x277549(0x20a)](_0x277549(0x21b)+a5_0x4d72d3[_0x277549(0x1c6)]('✓')+'\x20('+_0x1a9363+')');}});_0x325a54[_0x5aa758(0x237)](),_0x1f8676[_0x5aa758(0x252)](_0x74e939),_0x40b134[_0x5aa758(0x252)](_0x216a5d);if(_0x74e939[_0x5aa758(0x251)]===_0x5aa758(0x1cf))console['log'](a5_0x4d72d3['green']('✓\x20PASS:\x20'+_0x74e939[_0x5aa758(0x225)]));else _0x74e939['status']===_0x5aa758(0x21f)?console[_0x5aa758(0x20a)](a5_0x4d72d3['red'](_0x5aa758(0x1d0)+_0x74e939[_0x5aa758(0x225)])):console['log'](a5_0x4d72d3[_0x5aa758(0x244)](_0x5aa758(0x1df)+_0x74e939['reason']));_0x74e939['conversation_url']&&console[_0x5aa758(0x20a)](a5_0x4d72d3[_0x5aa758(0x23e)](_0x5aa758(0x236)+_0x74e939[_0x5aa758(0x1f5)])),console[_0x5aa758(0x20a)]();}catch(_0x1608ea){_0x325a54[_0x5aa758(0x237)]();const _0x39d556=_0x1608ea instanceof Error?_0x1608ea[_0x5aa758(0x1dc)]:String(_0x1608ea);console[_0x5aa758(0x20a)](a5_0x4d72d3[_0x5aa758(0x244)](_0x5aa758(0x1df)+_0x39d556)),console[_0x5aa758(0x20a)](),_0x1f8676[_0x5aa758(0x252)]({'name':_0x11aa68['name'],'status':_0x5aa758(0x1d5),'reason':_0x39d556,'timestamp':new Date()[_0x5aa758(0x245)](),'duration_ms':0x0});}}const _0x46fd26=Date[_0x5aa758(0x202)]()-_0x26fd48,_0x53edff=_0x1f8676[_0x5aa758(0x240)](_0x47a9ce=>_0x47a9ce[_0x5aa758(0x251)]===_0x5aa758(0x1cf))[_0x5aa758(0x246)],_0x28869b=_0x1f8676['filter'](_0x512ccc=>_0x512ccc[_0x5aa758(0x251)]===_0x5aa758(0x21f))[_0x5aa758(0x246)],_0x4ed43f=_0x1f8676[_0x5aa758(0x240)](_0x1c5f80=>_0x1c5f80[_0x5aa758(0x251)]===_0x5aa758(0x1d5))['length'];console['log']('━'[_0x5aa758(0x1e4)](0x3c)),console[_0x5aa758(0x20a)](_0x5aa758(0x20d)),console[_0x5aa758(0x20a)]('━'[_0x5aa758(0x1e4)](0x3c)),console[_0x5aa758(0x20a)](_0x5aa758(0x1ca)+_0x1f8676[_0x5aa758(0x246)]),console['log'](_0x5aa758(0x1c7)+a5_0x4d72d3[_0x5aa758(0x1c6)](_0x53edff)),console['log'](_0x5aa758(0x1de)+a5_0x4d72d3[_0x5aa758(0x244)](_0x28869b));_0x4ed43f>0x0&&console[_0x5aa758(0x20a)](_0x5aa758(0x1e6)+a5_0x4d72d3[_0x5aa758(0x244)](_0x4ed43f));console[_0x5aa758(0x20a)]('Duration:\x20'+formatElapsed(_0x46fd26)),console[_0x5aa758(0x20a)]('━'[_0x5aa758(0x1e4)](0x3c));const _0x56863c=_0x1f8676[_0x5aa758(0x240)](_0xb1d09c=>_0xb1d09c[_0x5aa758(0x251)]!==_0x5aa758(0x1cf));if(_0x56863c[_0x5aa758(0x246)]>0x0){console[_0x5aa758(0x20a)](),console[_0x5aa758(0x20a)](_0x5aa758(0x22a));for(const _0x2f7e12 of _0x56863c){const _0x3beb51=a5_0x4d72d3['red']('✗'),_0x138780=_0x2f7e12[_0x5aa758(0x225)]['length']>0x32?_0x2f7e12['reason'][_0x5aa758(0x242)](0x0,0x32)+'...':_0x2f7e12['reason'];console[_0x5aa758(0x20a)]('\x20\x20'+_0x3beb51+'\x20'+_0x2f7e12[_0x5aa758(0x1f4)]+':\x20'+_0x138780);}}const _0x26de0e={'summary':{'total':_0x1f8676['length'],'passed':_0x53edff,'failed':_0x28869b,'errors':_0x4ed43f>0x0?_0x4ed43f:undefined,'duration_ms':_0x46fd26},'tests':_0x1f8676,'agent':{'project':_0x255050[_0x5aa758(0x218)],'name':_0x255050[_0x5aa758(0x209)],'site':_0x63d97b},'timestamp':new Date(_0x26fd48)[_0x5aa758(0x245)]()};try{const _0x42a104=buildCachedTestRun(_0x40b134,{'site':_0x63d97b,'projectId':_0x1764ed,'projectName':_0x255050[_0x5aa758(0x218)],'agentId':_0x57e379,'agentName':_0x255050[_0x5aa758(0x209)],'testYmlPath':a5_0x3f3055[_0x5aa758(0x1f8)](_0x255050['testYmlPath'])});saveLastTestRun(_0x42a104);}catch{}if(_0x2b6379!=='table'||_0x5dd7fa){const _0xdc3255=formatResults(_0x26de0e,_0x2b6379);if(_0x5dd7fa)try{a5_0x178dc4[_0x5aa758(0x212)](_0x5dd7fa,_0xdc3255,_0x5aa758(0x211)),console[_0x5aa758(0x20a)](),console['log'](a5_0x4d72d3[_0x5aa758(0x23e)](_0x5aa758(0x207)+_0x5dd7fa));}catch(_0x229e90){return console['log'](),console[_0x5aa758(0x20a)](a5_0x4d72d3['red'](_0x5aa758(0x243)+_0x229e90)),0x1;}else console[_0x5aa758(0x20a)](),console[_0x5aa758(0x20a)](_0xdc3255);}return _0x56863c[_0x5aa758(0x246)]>0x0?0x1:0x0;}async[a5_0x17415b(0x205)](_0x35e122,_0x2058a1){const _0x19cdfa=a5_0x17415b,{options:_0x4c2dcc,tdx:_0x3e74ba}=_0x35e122,{definition:_0x36679a,agentInfo:_0x348cc9,outputFormat:_0x543108,outputFile:_0x35d0c0}=_0x2058a1,_0x1ec1bc=_0x4c2dcc[_0x19cdfa(0x1f7)],_0x195c8d=loadLastTestRun();if(!_0x195c8d)return console[_0x19cdfa(0x20a)](a5_0x4d72d3[_0x19cdfa(0x244)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x19cdfa(0x20a)](a5_0x4d72d3['dim']('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x195c8d['agent'][_0x19cdfa(0x209)]!==_0x348cc9[_0x19cdfa(0x209)])return console[_0x19cdfa(0x20a)](a5_0x4d72d3[_0x19cdfa(0x244)](_0x19cdfa(0x21c)+_0x195c8d['agent'][_0x19cdfa(0x209)]+_0x19cdfa(0x1d1)+_0x348cc9[_0x19cdfa(0x209)]+'\x22.')),console[_0x19cdfa(0x20a)](a5_0x4d72d3[_0x19cdfa(0x23e)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x55fb1d=new Set(_0x195c8d[_0x19cdfa(0x1f2)][_0x19cdfa(0x217)](_0x116f3c=>_0x116f3c[_0x19cdfa(0x1fb)])),_0x36da69=_0x36679a['tests'][_0x19cdfa(0x240)](_0x4ab52c=>!_0x55fb1d[_0x19cdfa(0x224)](_0x4ab52c[_0x19cdfa(0x1f4)]));if(_0x36da69[_0x19cdfa(0x246)]>0x0&&_0x195c8d[_0x19cdfa(0x1f7)]!==_0x1ec1bc)return console[_0x19cdfa(0x20a)](a5_0x4d72d3['red'](_0x19cdfa(0x1ed))),console['log'](a5_0x4d72d3[_0x19cdfa(0x23e)](_0x19cdfa(0x21e)+_0x195c8d[_0x19cdfa(0x1f7)]+_0x19cdfa(0x238)+_0x1ec1bc+'\x22.')),console[_0x19cdfa(0x20a)](a5_0x4d72d3[_0x19cdfa(0x23e)]('Either\x20switch\x20to\x20the\x20\x22'+_0x195c8d[_0x19cdfa(0x1f7)]+_0x19cdfa(0x1c4))),0x1;const _0x2548a9=_0x36679a['tests'][_0x19cdfa(0x240)](_0x1396c8=>_0x55fb1d[_0x19cdfa(0x224)](_0x1396c8['name'])),_0x58a952=_0x36da69;let _0x34fa67;try{_0x34fa67=await setupEvaluatorAgent(_0x3e74ba[_0x19cdfa(0x1d4)],_0x4c2dcc[_0x19cdfa(0x216)]);}catch(_0x21a759){const _0x4c3b98=_0x21a759 instanceof Error?_0x21a759[_0x19cdfa(0x1dc)]:String(_0x21a759);return console[_0x19cdfa(0x20a)](a5_0x4d72d3[_0x19cdfa(0x244)](_0x19cdfa(0x223)+_0x4c3b98)),0x1;}console[_0x19cdfa(0x20a)](a5_0x4d72d3[_0x19cdfa(0x20e)](_0x19cdfa(0x1ea))),console[_0x19cdfa(0x20a)](_0x19cdfa(0x235)+a5_0x4d72d3[_0x19cdfa(0x1fd)](_0x195c8d['timestamp'])),console[_0x19cdfa(0x20a)](_0x19cdfa(0x1fe)+a5_0x4d72d3['white'](_0x195c8d[_0x19cdfa(0x1e8)][_0x19cdfa(0x218)]+'/'+_0x195c8d[_0x19cdfa(0x1e8)][_0x19cdfa(0x209)]));_0x58a952['length']>0x0&&console[_0x19cdfa(0x20a)](_0x19cdfa(0x203)+a5_0x4d72d3['yellow'](_0x58a952[_0x19cdfa(0x246)]));console[_0x19cdfa(0x20a)]();const _0x2b4c88=[],_0x18ab8f=Date[_0x19cdfa(0x202)](),_0x17f2a5=createCommandSpinner(_0x19cdfa(0x1c9));if(_0x2548a9[_0x19cdfa(0x246)]>0x0)try{const _0xe43000=await reevaluateFromCache(_0x3e74ba[_0x19cdfa(0x1d4)],_0x195c8d,{'tests':_0x2548a9},{'evaluatorId':_0x34fa67,'onTestStart':(_0x260822,_0x3c8dd6,_0x294f9b)=>{const _0x3b59b=_0x19cdfa;_0x17f2a5[_0x3b59b(0x1ef)]='Re-evaluating\x20'+(_0x3c8dd6+0x1)+'/'+_0x294f9b+':\x20'+_0x260822+'...';if(!_0x17f2a5[_0x3b59b(0x1e7)])_0x17f2a5['start']();},'onTestComplete':(_0x22fb80,_0x37b97b)=>{const _0x3a6b0c=_0x19cdfa;_0x17f2a5['stop']();if(_0x37b97b[_0x3a6b0c(0x251)]===_0x3a6b0c(0x1cf))console['log'](a5_0x4d72d3[_0x3a6b0c(0x1c6)]('✓\x20PASS:\x20'+_0x22fb80)+a5_0x4d72d3['dim'](_0x3a6b0c(0x249)));else _0x37b97b[_0x3a6b0c(0x251)]===_0x3a6b0c(0x21f)?console[_0x3a6b0c(0x20a)](a5_0x4d72d3[_0x3a6b0c(0x244)](_0x3a6b0c(0x1d0)+_0x22fb80+_0x3a6b0c(0x24e)+_0x37b97b[_0x3a6b0c(0x225)])+a5_0x4d72d3[_0x3a6b0c(0x23e)]('\x20(cached)')):console[_0x3a6b0c(0x20a)](a5_0x4d72d3['red']('✗\x20ERROR:\x20'+_0x22fb80+_0x3a6b0c(0x24e)+_0x37b97b[_0x3a6b0c(0x225)]));_0x37b97b[_0x3a6b0c(0x1f5)]&&console[_0x3a6b0c(0x20a)](a5_0x4d72d3[_0x3a6b0c(0x23e)](_0x3a6b0c(0x1c5)+_0x37b97b[_0x3a6b0c(0x1f5)])),_0x2b4c88[_0x3a6b0c(0x252)](_0x37b97b);},'onTestSkipped':(_0x44a0a9,_0x2d544b)=>{const _0x4bddb0=_0x19cdfa;_0x17f2a5[_0x4bddb0(0x237)](),console[_0x4bddb0(0x20a)](a5_0x4d72d3[_0x4bddb0(0x24f)]('⚠\x20SKIPPED:\x20'+_0x44a0a9+_0x4bddb0(0x24e)+_0x2d544b));}});for(const _0x5a047e of _0xe43000){!_0x2b4c88['find'](_0x5ede00=>_0x5ede00['name']===_0x5a047e[_0x19cdfa(0x1f4)])&&_0x2b4c88[_0x19cdfa(0x252)](_0x5a047e);}}catch(_0x441ab5){_0x17f2a5[_0x19cdfa(0x237)]();const _0x18a17f=_0x441ab5 instanceof Error?_0x441ab5[_0x19cdfa(0x1dc)]:String(_0x441ab5);return console[_0x19cdfa(0x20a)](a5_0x4d72d3['red'](_0x19cdfa(0x23f)+_0x18a17f)),0x1;}_0x17f2a5[_0x19cdfa(0x237)]();if(_0x58a952[_0x19cdfa(0x246)]>0x0){console[_0x19cdfa(0x20a)](),console[_0x19cdfa(0x20a)](a5_0x4d72d3[_0x19cdfa(0x20e)]('Executing\x20new\x20tests...'));const {projectId:_0x1317b0,agentId:_0x3a4ac7}=_0x195c8d[_0x19cdfa(0x1e8)];for(const _0x19dea7 of _0x58a952){console[_0x19cdfa(0x20a)](_0x19cdfa(0x222)+a5_0x4d72d3[_0x19cdfa(0x1fd)](_0x19dea7['name']));const _0x27a882=createCommandSpinner(_0x19cdfa(0x213)+_0x19dea7['rounds']['length']+_0x19cdfa(0x22f));_0x27a882['start']();try{const {result:_0x3661d1}=await runTest(_0x3e74ba[_0x19cdfa(0x1d4)],_0x19dea7,{'agentId':_0x3a4ac7,'projectId':_0x1317b0,'site':_0x195c8d['site'],'noEval':![],'evaluatorId':_0x34fa67,'onRoundStart':(_0x368cc4,_0x428ab5)=>{const _0xe306d1=_0x19cdfa;_0x27a882[_0xe306d1(0x1ef)]=_0xe306d1(0x241)+(_0x368cc4+0x1)+'/'+_0x428ab5+_0xe306d1(0x22f);},'onRoundComplete':(_0x5c4206,_0x414b41,_0x27e953)=>{const _0x3e9cca=_0x19cdfa,_0xc0c6e=formatElapsed(_0x414b41);_0x27e953?console[_0x3e9cca(0x20a)]('\x20\x20Round\x20'+(_0x5c4206+0x1)+'/'+_0x19dea7['rounds'][_0x3e9cca(0x246)]+'...\x20'+a5_0x4d72d3[_0x3e9cca(0x1c6)]('✓')+'\x20('+_0xc0c6e+')'):console[_0x3e9cca(0x20a)](_0x3e9cca(0x221)+(_0x5c4206+0x1)+'/'+_0x19dea7[_0x3e9cca(0x22c)][_0x3e9cca(0x246)]+_0x3e9cca(0x1cd)+a5_0x4d72d3[_0x3e9cca(0x244)]('✗'));},'onEvaluationStart':()=>{const _0x2c071e=_0x19cdfa;_0x27a882[_0x2c071e(0x1ef)]=_0x2c071e(0x239);},'onEvaluationComplete':_0x499e65=>{const _0x5182e6=_0x19cdfa,_0x53361c=formatElapsed(_0x499e65);console[_0x5182e6(0x20a)](_0x5182e6(0x21b)+a5_0x4d72d3[_0x5182e6(0x1c6)]('✓')+'\x20('+_0x53361c+')');}});_0x27a882[_0x19cdfa(0x237)](),_0x2b4c88[_0x19cdfa(0x252)](_0x3661d1);if(_0x3661d1[_0x19cdfa(0x251)]===_0x19cdfa(0x1cf))console[_0x19cdfa(0x20a)](a5_0x4d72d3[_0x19cdfa(0x1c6)](_0x19cdfa(0x206)+_0x3661d1[_0x19cdfa(0x225)])+a5_0x4d72d3[_0x19cdfa(0x23e)](_0x19cdfa(0x200)));else _0x3661d1[_0x19cdfa(0x251)]===_0x19cdfa(0x21f)?console['log'](a5_0x4d72d3[_0x19cdfa(0x244)](_0x19cdfa(0x1d0)+_0x3661d1[_0x19cdfa(0x225)])+a5_0x4d72d3[_0x19cdfa(0x23e)](_0x19cdfa(0x200))):console[_0x19cdfa(0x20a)](a5_0x4d72d3[_0x19cdfa(0x244)]('✗\x20ERROR:\x20'+_0x3661d1[_0x19cdfa(0x225)]));_0x3661d1['conversation_url']&&console[_0x19cdfa(0x20a)](a5_0x4d72d3[_0x19cdfa(0x23e)](_0x19cdfa(0x1c5)+_0x3661d1['conversation_url']));}catch(_0x4fcca8){_0x27a882[_0x19cdfa(0x237)]();const _0x1b54b2=_0x4fcca8 instanceof Error?_0x4fcca8[_0x19cdfa(0x1dc)]:String(_0x4fcca8);console[_0x19cdfa(0x20a)](a5_0x4d72d3['red'](_0x19cdfa(0x1df)+_0x1b54b2)),_0x2b4c88['push']({'name':_0x19dea7[_0x19cdfa(0x1f4)],'status':_0x19cdfa(0x1d5),'reason':_0x1b54b2,'timestamp':new Date()[_0x19cdfa(0x245)](),'duration_ms':0x0});}}}console[_0x19cdfa(0x20a)]();const _0x17b2f5=Date[_0x19cdfa(0x202)]()-_0x18ab8f,_0x59d90c=_0x2b4c88[_0x19cdfa(0x240)](_0x57eca5=>_0x57eca5[_0x19cdfa(0x251)]===_0x19cdfa(0x1cf))['length'],_0x38b591=_0x2b4c88['filter'](_0x24b983=>_0x24b983[_0x19cdfa(0x251)]===_0x19cdfa(0x21f))['length'],_0x43ad0a=_0x2b4c88[_0x19cdfa(0x240)](_0x571528=>_0x571528[_0x19cdfa(0x251)]===_0x19cdfa(0x1d5))[_0x19cdfa(0x246)];console[_0x19cdfa(0x20a)]('━'['repeat'](0x3c)),console[_0x19cdfa(0x20a)]('Re-evaluation\x20Summary'),console[_0x19cdfa(0x20a)]('━'[_0x19cdfa(0x1e4)](0x3c)),console['log'](_0x19cdfa(0x1ca)+_0x2b4c88[_0x19cdfa(0x246)]),console[_0x19cdfa(0x20a)]('Passed:\x20\x20\x20'+a5_0x4d72d3[_0x19cdfa(0x1c6)](_0x59d90c)),console['log'](_0x19cdfa(0x1de)+a5_0x4d72d3['red'](_0x38b591));_0x43ad0a>0x0&&console['log'](_0x19cdfa(0x1e6)+a5_0x4d72d3[_0x19cdfa(0x244)](_0x43ad0a));console[_0x19cdfa(0x20a)](_0x19cdfa(0x1d2)+formatElapsed(_0x17b2f5)),console['log']('━'[_0x19cdfa(0x1e4)](0x3c));const _0x44d5c1={'summary':{'total':_0x2b4c88[_0x19cdfa(0x246)],'passed':_0x59d90c,'failed':_0x38b591,'errors':_0x43ad0a>0x0?_0x43ad0a:undefined,'duration_ms':_0x17b2f5},'tests':_0x2b4c88,'agent':{'project':_0x348cc9['projectName'],'name':_0x348cc9[_0x19cdfa(0x209)],'site':_0x1ec1bc},'timestamp':new Date(_0x18ab8f)[_0x19cdfa(0x245)]()};if(_0x543108!==_0x19cdfa(0x1d9)||_0x35d0c0){const _0x4cbee0=formatResults(_0x44d5c1,_0x543108);if(_0x35d0c0)try{a5_0x178dc4[_0x19cdfa(0x212)](_0x35d0c0,_0x4cbee0,'utf-8'),console['log'](),console[_0x19cdfa(0x20a)](a5_0x4d72d3[_0x19cdfa(0x23e)]('Output\x20written\x20to:\x20'+_0x35d0c0));}catch(_0x5ceed1){return console[_0x19cdfa(0x20a)](),console[_0x19cdfa(0x20a)](a5_0x4d72d3[_0x19cdfa(0x244)](_0x19cdfa(0x243)+_0x5ceed1)),0x1;}else console['log'](),console[_0x19cdfa(0x20a)](_0x4cbee0);}const _0x356f34=_0x2b4c88['filter'](_0x1140f9=>_0x1140f9[_0x19cdfa(0x251)]!=='PASS');return _0x356f34[_0x19cdfa(0x246)]>0x0?0x1:0x0;}}
1
+ const a5_0x2e5a6c=a5_0x596c;(function(_0x30e288,_0x14a7a8){const _0x3c2e59=a5_0x596c,_0x32749c=_0x30e288();while(!![]){try{const _0x143b03=parseInt(_0x3c2e59(0x12a))/0x1+-parseInt(_0x3c2e59(0x146))/0x2*(parseInt(_0x3c2e59(0x10a))/0x3)+-parseInt(_0x3c2e59(0x17b))/0x4*(-parseInt(_0x3c2e59(0x14d))/0x5)+-parseInt(_0x3c2e59(0x13d))/0x6+-parseInt(_0x3c2e59(0x110))/0x7*(-parseInt(_0x3c2e59(0x171))/0x8)+-parseInt(_0x3c2e59(0x12c))/0x9+-parseInt(_0x3c2e59(0x11a))/0xa;if(_0x143b03===_0x14a7a8)break;else _0x32749c['push'](_0x32749c['shift']());}catch(_0x4d230e){_0x32749c['push'](_0x32749c['shift']());}}}(a5_0x1608,0x7ffdb));import*as a5_0x11f00d from'node:fs';import*as a5_0x1735ea from'node:path';import a5_0x288236 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x596c(_0xd8ac64,_0x363616){_0xd8ac64=_0xd8ac64-0xf3;const _0x1608ad=a5_0x1608();let _0x596c79=_0x1608ad[_0xd8ac64];return _0x596c79;}function a5_0x1608(){const _0xbcb183=['split','context','\x20(new)','forEach','199073dSFaVQ','green','site','now','no_tests','\x20\x20Evaluating...\x20','testName','dryRun','agentDirs','log','1461550KnlYBS','writeFileSync','start','name','✓\x20PASS:\x20','source','Test\x20Configuration:','toLowerCase','Agent:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','resolveAgentId','table','agent:test','Error\x20writing\x20output\x20file:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Output\x20written\x20to:\x20','994599JnCWQP','\x20\x20Site:\x20','118728jhrLTe','Failed\x20Tests:','includes','Round\x20','no_local_folder','Site:\x20','PASS','repeat','not\x20found','executeReeval','No\x20tests\x20found\x20with\x20tags:\x20','Using\x20agent:\x20','\x20-\x20','dim','reeval','timestamp','Executing\x20new\x20tests...','428988qMzoOw','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Failed:\x20\x20\x20','Re-evaluating...','red','no_context','Run\x20\x27tdx\x20agent\x20pull\x20','Project\x20path:\x20','/<agent-name>','356NeTJvk','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','filter','\x20\x20Project:\x20','projectName','Available\x20tests:\x20','yellow','5SEHrmd','json','...\x20','white','projectDir','message','Cached\x20run\x20from:\x20','✗\x20ERROR:\x20','llm','Round\x201/','Re-evaluation\x20Summary','agentName','Passed:\x20\x20\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','utf-8','has','status','jsonl','testYmlPath','Duration:\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)','tags','eval','FAIL','push','cyan','rounds','Re-evaluating\x20','multiple_agents','map','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','test.yml','stop','ERROR','\x20\x20Conversation:\x20','Evaluating\x20response...','32GEiKuo','tsv','Usage:','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','size','\x22:\x20','tests','Running\x20test:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','\x20(cached)','2748604YvfxIa','substring','reason','New\x20tests\x20to\x20execute:\x20','Test\x20Summary','agent','some','\x20\x20Round\x20','resolve','404','conversation_url','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','isSpinning','text','execute','\x22,\x20but\x20current\x20site\x20is\x20\x22','Total:\x20\x20\x20\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','join','Errors:\x20\x20\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Tests\x20found:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','\x27\x20to\x20create\x20the\x20folder\x20structure.','length','trim','round','...','Error:\x20No\x20previous\x20test\x20run\x20found.','Either\x20switch\x20to\x20the\x20\x22','llmProject','verbose','✗\x20FAIL:\x20','\x20\x20-\x20',':\x20Sending\x20user\x20input...','basename','existsSync','Available\x20tags:\x20','found','toISOString','17535KQJVvP','add'];a5_0x1608=function(){return _0xbcb183;};return a5_0x1608();}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x2e5a6c(0x11d)]=a5_0x2e5a6c(0x126);['description']='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x2e5a6c(0x189)](_0x1886fb){const _0x4d155f=a5_0x2e5a6c,{options:_0x1d06f1,args:_0x5b9067,tdx:_0x259311}=_0x1886fb,_0x31fa53=_0x5b9067[0x0]||'.',_0x1fa782=_0x1d06f1[_0x4d155f(0x117)],_0x1ed815=_0x1d06f1,_0x19cf9f=_0x1ed815[_0x4d155f(0x163)]===![],_0x4589dc=_0x1ed815[_0x4d155f(0x13a)],_0x34fba3=_0x1ed815[_0x4d155f(0x11d)],_0x3ccce1=_0x1ed815['tags'],_0x56f4b8=_0x1d06f1[_0x4d155f(0x112)],_0x500427=_0x1ed815['output'];if(_0x4589dc&&_0x19cf9f)return console[_0x4d155f(0x119)](a5_0x288236['red']('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x598295=_0x4d155f(0x125);if(_0x1ed815['json'])_0x598295=_0x4d155f(0x14e);else{if(_0x1ed815[_0x4d155f(0x15e)])_0x598295=_0x4d155f(0x15e);else{if(_0x1ed815[_0x4d155f(0x172)])_0x598295=_0x4d155f(0x172);else{if(_0x1ed815[_0x4d155f(0x125)])_0x598295=_0x4d155f(0x125);}}}const _0x28f14b=_0x1ed815['llmProject'];let _0x5aeaaa=_0x31fa53;const _0x449218=a5_0x11f00d[_0x4d155f(0x106)](_0x31fa53),_0x571469=_0x31fa53==='.';if(!_0x449218||_0x571469){const _0x9fb587=resolveProjectFromContext(_0x31fa53,_0x28f14b,{'requireFile':_0x4d155f(0x16c)});if(_0x9fb587[_0x4d155f(0x108)])_0x5aeaaa=_0x9fb587[_0x4d155f(0x151)],_0x9fb587[_0x4d155f(0x11f)]===_0x4d155f(0x10d)&&console['log'](a5_0x288236[_0x4d155f(0x139)](_0x4d155f(0x137)+_0x5aeaaa));else switch(_0x9fb587['reason']){case _0x4d155f(0x142):console[_0x4d155f(0x119)](a5_0x288236[_0x4d155f(0x14c)](_0x9fb587['message'])),console[_0x4d155f(0x119)](),console[_0x4d155f(0x119)](_0x4d155f(0x173)),console['log']('\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'),console[_0x4d155f(0x119)](_0x4d155f(0x161)),console[_0x4d155f(0x119)](),console[_0x4d155f(0x119)](_0x4d155f(0xf6));return 0x1;case _0x4d155f(0x130):console[_0x4d155f(0x119)](a5_0x288236['yellow'](_0x9fb587[_0x4d155f(0x152)])),console[_0x4d155f(0x119)](),console[_0x4d155f(0x119)](_0x4d155f(0x143)+_0x9fb587[_0x4d155f(0x100)]+_0x4d155f(0xf9));return 0x1;case _0x4d155f(0x169):{const _0x3126eb=a5_0x1735ea[_0x4d155f(0x105)](_0x9fb587[_0x4d155f(0x151)]);console['log'](a5_0x288236[_0x4d155f(0x14c)](_0x4d155f(0xf8)+_0x9fb587[_0x4d155f(0x100)]+'\x22:'));for(const _0x1ac009 of _0x9fb587[_0x4d155f(0x118)]){console[_0x4d155f(0x119)](_0x4d155f(0x103)+_0x1ac009);}return console[_0x4d155f(0x119)](),console[_0x4d155f(0x119)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x3126eb+_0x4d155f(0x145)),0x1;}case _0x4d155f(0x114):console[_0x4d155f(0x119)](a5_0x288236[_0x4d155f(0x14c)](_0x4d155f(0x123)+_0x9fb587[_0x4d155f(0x100)]+'\x22.')),console[_0x4d155f(0x119)](a5_0x288236['dim'](_0x4d155f(0x144)+_0x9fb587[_0x4d155f(0x151)])),console[_0x4d155f(0x119)](),console['log'](_0x4d155f(0x15a));return 0x1;}}const {definition:_0x57a718,agentInfo:_0x13b692}=parseTestFile(_0x5aeaaa);let _0x2f01e7=_0x57a718[_0x4d155f(0x177)];if(_0x34fba3){const _0x1c7877=_0x34fba3[_0x4d155f(0x10c)](',')['map'](_0x39c70f=>_0x39c70f[_0x4d155f(0xfb)]());_0x2f01e7=_0x57a718[_0x4d155f(0x177)][_0x4d155f(0x148)](_0x257211=>_0x1c7877['includes'](_0x257211[_0x4d155f(0x11d)]));if(_0x2f01e7[_0x4d155f(0xfa)]===0x0)return console['log'](a5_0x288236['yellow']('No\x20tests\x20found\x20matching:\x20'+_0x34fba3)),console[_0x4d155f(0x119)](a5_0x288236['dim'](_0x4d155f(0x14b)+_0x57a718[_0x4d155f(0x177)]['map'](_0x11e7a7=>_0x11e7a7[_0x4d155f(0x11d)])[_0x4d155f(0xf4)](',\x20'))),0x1;}if(_0x3ccce1){const _0x1dc11f=_0x3ccce1[_0x4d155f(0x10c)](',')[_0x4d155f(0x16a)](_0x56b10e=>_0x56b10e[_0x4d155f(0xfb)]()['toLowerCase']());_0x2f01e7=_0x2f01e7[_0x4d155f(0x148)](_0xf13269=>_0xf13269[_0x4d155f(0x162)]?.[_0x4d155f(0x181)](_0x260ac9=>_0x1dc11f[_0x4d155f(0x12e)](_0x260ac9[_0x4d155f(0x121)]())));if(_0x2f01e7[_0x4d155f(0xfa)]===0x0){console['log'](a5_0x288236[_0x4d155f(0x14c)](_0x4d155f(0x136)+_0x3ccce1));const _0x3c986d=new Set();return _0x57a718[_0x4d155f(0x177)][_0x4d155f(0x10f)](_0x5a22cf=>_0x5a22cf[_0x4d155f(0x162)]?.[_0x4d155f(0x10f)](_0x3580f6=>_0x3c986d[_0x4d155f(0x10b)](_0x3580f6))),_0x3c986d[_0x4d155f(0x175)]>0x0?console[_0x4d155f(0x119)](a5_0x288236[_0x4d155f(0x139)](_0x4d155f(0x107)+[..._0x3c986d]['join'](',\x20'))):console[_0x4d155f(0x119)](a5_0x288236[_0x4d155f(0x139)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x4589dc)return this['executeReeval'](_0x1886fb,{'definition':{'tests':_0x2f01e7},'agentInfo':_0x13b692,'outputFormat':_0x598295,'outputFile':_0x500427,'testNames':_0x34fba3});if(_0x1fa782){console[_0x4d155f(0x119)](a5_0x288236['cyan'](_0x4d155f(0x120))),console[_0x4d155f(0x119)](_0x4d155f(0x12b)+a5_0x288236[_0x4d155f(0x150)](_0x56f4b8)),console[_0x4d155f(0x119)](_0x4d155f(0x149)+a5_0x288236[_0x4d155f(0x150)](_0x13b692['projectName'])),console[_0x4d155f(0x119)]('\x20\x20Agent:\x20'+a5_0x288236[_0x4d155f(0x150)](_0x13b692[_0x4d155f(0x158)])),console[_0x4d155f(0x119)](),console[_0x4d155f(0x119)](_0x4d155f(0xf7)+a5_0x288236[_0x4d155f(0x150)](_0x2f01e7[_0x4d155f(0xfa)]));for(let _0x1c0d02=0x0;_0x1c0d02<_0x2f01e7[_0x4d155f(0xfa)];_0x1c0d02++){const _0x200b5b=_0x2f01e7[_0x1c0d02],_0x377d30=_0x200b5b['rounds'][_0x4d155f(0xfa)]===0x1?_0x4d155f(0xfc):_0x4d155f(0x167),_0x34f42b=_0x200b5b[_0x4d155f(0x162)]?.[_0x4d155f(0xfa)]?'\x20['+_0x200b5b['tags'][_0x4d155f(0xf4)](',\x20')+']':'';console[_0x4d155f(0x119)]('\x20\x20'+(_0x1c0d02+0x1)+'.\x20'+a5_0x288236['white'](_0x200b5b[_0x4d155f(0x11d)])+'\x20('+_0x200b5b[_0x4d155f(0x167)][_0x4d155f(0xfa)]+'\x20'+_0x377d30+')'+a5_0x288236[_0x4d155f(0x139)](_0x34f42b));}return 0x0;}let _0x3c21bc,_0x3ec614;try{_0x3c21bc=await _0x259311[_0x4d155f(0x155)]['resolveProjectId'](_0x13b692[_0x4d155f(0x14a)]);}catch(_0x2402ce){const _0x4915a1=_0x2402ce instanceof Error?_0x2402ce['message']:String(_0x2402ce);return _0x4915a1[_0x4d155f(0x12e)]('404')||_0x4915a1[_0x4d155f(0x121)]()['includes']('not\x20found')?console['log'](a5_0x288236[_0x4d155f(0x141)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x13b692[_0x4d155f(0x14a)])):console[_0x4d155f(0x119)](a5_0x288236[_0x4d155f(0x141)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x13b692[_0x4d155f(0x14a)]+_0x4d155f(0x176)+_0x4915a1)),0x1;}try{_0x3ec614=await _0x259311[_0x4d155f(0x155)][_0x4d155f(0x124)](_0x13b692[_0x4d155f(0x158)],_0x3c21bc);}catch(_0x44f5d3){const _0xb7b972=_0x44f5d3 instanceof Error?_0x44f5d3['message']:String(_0x44f5d3);return _0xb7b972['includes'](_0x4d155f(0x184))||_0xb7b972[_0x4d155f(0x121)]()[_0x4d155f(0x12e)](_0x4d155f(0x134))?console[_0x4d155f(0x119)](a5_0x288236[_0x4d155f(0x141)](_0x4d155f(0x13e)+_0x13b692[_0x4d155f(0x158)])):console[_0x4d155f(0x119)](a5_0x288236[_0x4d155f(0x141)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x13b692[_0x4d155f(0x158)]+_0x4d155f(0x176)+_0xb7b972)),0x1;}let _0x107e9f;if(!_0x19cf9f)try{_0x107e9f=await setupEvaluatorAgent(_0x259311['llm'],_0x1d06f1[_0x4d155f(0x101)]);}catch(_0x4cab4e){const _0x3fb8cb=_0x4cab4e instanceof Error?_0x4cab4e['message']:String(_0x4cab4e);return console[_0x4d155f(0x119)](a5_0x288236[_0x4d155f(0x141)](_0x4d155f(0x147)+_0x3fb8cb)),0x1;}console[_0x4d155f(0x119)](a5_0x288236[_0x4d155f(0x166)]('Running\x20agent\x20tests...')),console[_0x4d155f(0x119)](_0x4d155f(0x131)+a5_0x288236[_0x4d155f(0x150)](_0x56f4b8)),console['log'](_0x4d155f(0x122)+a5_0x288236[_0x4d155f(0x150)](_0x13b692[_0x4d155f(0x14a)]+'/'+_0x13b692[_0x4d155f(0x158)])),console[_0x4d155f(0x119)]();const _0x5050f8=[],_0x5d2f7f=[],_0x4fb282=Date['now']();for(let _0x16c429=0x0;_0x16c429<_0x2f01e7[_0x4d155f(0xfa)];_0x16c429++){const _0x5a0e97=_0x2f01e7[_0x16c429];_0x2f01e7[_0x4d155f(0xfa)]>0x1?console['log']('Test\x20'+(_0x16c429+0x1)+'/'+_0x2f01e7[_0x4d155f(0xfa)]+':\x20'+a5_0x288236[_0x4d155f(0x150)](_0x5a0e97['name'])):console[_0x4d155f(0x119)](_0x4d155f(0x178)+a5_0x288236[_0x4d155f(0x150)](_0x5a0e97[_0x4d155f(0x11d)]));const _0x3b33f9=createCommandSpinner(_0x4d155f(0x156)+_0x5a0e97[_0x4d155f(0x167)]['length']+_0x4d155f(0x104));_0x3b33f9[_0x4d155f(0x11c)]();try{const {result:_0x507ee2,conversation:_0x35fe9c}=await runTest(_0x259311['llm'],_0x5a0e97,{'agentId':_0x3ec614,'projectId':_0x3c21bc,'site':_0x56f4b8,'noEval':_0x19cf9f,'evaluatorId':_0x107e9f,'onRoundStart':(_0x1a7e69,_0xf13f50)=>{const _0x3b4a1d=_0x4d155f;_0x3b33f9[_0x3b4a1d(0x188)]='Round\x20'+(_0x1a7e69+0x1)+'/'+_0xf13f50+_0x3b4a1d(0x104);},'onRoundComplete':(_0x5f2340,_0x322c18,_0x372c3b)=>{const _0x55a895=_0x4d155f,_0x5e5d02=formatElapsed(_0x322c18);_0x372c3b?console['log'](_0x55a895(0x182)+(_0x5f2340+0x1)+'/'+_0x5a0e97[_0x55a895(0x167)][_0x55a895(0xfa)]+_0x55a895(0x14f)+a5_0x288236[_0x55a895(0x111)]('✓')+'\x20('+_0x5e5d02+')'):console['log']('\x20\x20Round\x20'+(_0x5f2340+0x1)+'/'+_0x5a0e97['rounds']['length']+_0x55a895(0x14f)+a5_0x288236[_0x55a895(0x141)]('✗'));},'onEvaluationStart':()=>{const _0x462f67=_0x4d155f;_0x3b33f9[_0x462f67(0x188)]=_0x462f67(0x170);},'onEvaluationComplete':_0x33437e=>{const _0xed1a8c=_0x4d155f,_0x4f0a56=formatElapsed(_0x33437e);console['log']('\x20\x20Evaluating...\x20'+a5_0x288236[_0xed1a8c(0x111)]('✓')+'\x20('+_0x4f0a56+')');}});_0x3b33f9[_0x4d155f(0x16d)](),_0x5050f8[_0x4d155f(0x165)](_0x507ee2),_0x5d2f7f[_0x4d155f(0x165)](_0x35fe9c);if(_0x507ee2['status']===_0x4d155f(0x132))console['log'](a5_0x288236[_0x4d155f(0x111)](_0x4d155f(0x11e)+_0x507ee2[_0x4d155f(0x17d)]));else _0x507ee2[_0x4d155f(0x15d)]===_0x4d155f(0x164)?console[_0x4d155f(0x119)](a5_0x288236[_0x4d155f(0x141)](_0x4d155f(0x102)+_0x507ee2['reason'])):console[_0x4d155f(0x119)](a5_0x288236[_0x4d155f(0x141)](_0x4d155f(0x154)+_0x507ee2[_0x4d155f(0x17d)]));_0x507ee2[_0x4d155f(0x185)]&&console[_0x4d155f(0x119)](a5_0x288236[_0x4d155f(0x139)]('Conversation\x20URL:\x20'+_0x507ee2['conversation_url'])),console[_0x4d155f(0x119)]();}catch(_0x351bd7){_0x3b33f9[_0x4d155f(0x16d)]();const _0x4bf277=_0x351bd7 instanceof Error?_0x351bd7[_0x4d155f(0x152)]:String(_0x351bd7);console[_0x4d155f(0x119)](a5_0x288236[_0x4d155f(0x141)](_0x4d155f(0x154)+_0x4bf277)),console[_0x4d155f(0x119)](),_0x5050f8['push']({'name':_0x5a0e97['name'],'status':'ERROR','reason':_0x4bf277,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x270295=Date[_0x4d155f(0x113)]()-_0x4fb282,_0x29e9d4=_0x5050f8[_0x4d155f(0x148)](_0x199d80=>_0x199d80['status']===_0x4d155f(0x132))[_0x4d155f(0xfa)],_0x5d3b08=_0x5050f8[_0x4d155f(0x148)](_0x3867b0=>_0x3867b0[_0x4d155f(0x15d)]===_0x4d155f(0x164))[_0x4d155f(0xfa)],_0x3cc12f=_0x5050f8[_0x4d155f(0x148)](_0x2d603d=>_0x2d603d[_0x4d155f(0x15d)]===_0x4d155f(0x16e))[_0x4d155f(0xfa)];console[_0x4d155f(0x119)]('━'[_0x4d155f(0x133)](0x3c)),console[_0x4d155f(0x119)](_0x4d155f(0x17f)),console[_0x4d155f(0x119)]('━'[_0x4d155f(0x133)](0x3c)),console['log'](_0x4d155f(0x18b)+_0x5050f8[_0x4d155f(0xfa)]),console['log'](_0x4d155f(0x159)+a5_0x288236[_0x4d155f(0x111)](_0x29e9d4)),console[_0x4d155f(0x119)]('Failed:\x20\x20\x20'+a5_0x288236[_0x4d155f(0x141)](_0x5d3b08));_0x3cc12f>0x0&&console[_0x4d155f(0x119)](_0x4d155f(0xf5)+a5_0x288236[_0x4d155f(0x141)](_0x3cc12f));console['log'](_0x4d155f(0x160)+formatElapsed(_0x270295)),console[_0x4d155f(0x119)]('━'[_0x4d155f(0x133)](0x3c));const _0x1b85c4=_0x5050f8[_0x4d155f(0x148)](_0x3b46ab=>_0x3b46ab[_0x4d155f(0x15d)]!=='PASS');if(_0x1b85c4[_0x4d155f(0xfa)]>0x0){console[_0x4d155f(0x119)](),console[_0x4d155f(0x119)](_0x4d155f(0x12d));for(const _0x34a1bd of _0x1b85c4){const _0x5ade37=a5_0x288236[_0x4d155f(0x141)]('✗'),_0x63d43d=_0x34a1bd['reason'][_0x4d155f(0xfa)]>0x32?_0x34a1bd['reason'][_0x4d155f(0x17c)](0x0,0x32)+_0x4d155f(0xfd):_0x34a1bd[_0x4d155f(0x17d)];console[_0x4d155f(0x119)]('\x20\x20'+_0x5ade37+'\x20'+_0x34a1bd[_0x4d155f(0x11d)]+':\x20'+_0x63d43d);}}const _0x3d5d8c={'summary':{'total':_0x5050f8['length'],'passed':_0x29e9d4,'failed':_0x5d3b08,'errors':_0x3cc12f>0x0?_0x3cc12f:undefined,'duration_ms':_0x270295},'tests':_0x5050f8,'agent':{'project':_0x13b692[_0x4d155f(0x14a)],'name':_0x13b692[_0x4d155f(0x158)],'site':_0x56f4b8},'timestamp':new Date(_0x4fb282)[_0x4d155f(0x109)]()};try{const _0x54fba7=buildCachedTestRun(_0x5d2f7f,{'site':_0x56f4b8,'projectId':_0x3c21bc,'projectName':_0x13b692[_0x4d155f(0x14a)],'agentId':_0x3ec614,'agentName':_0x13b692[_0x4d155f(0x158)],'testYmlPath':a5_0x1735ea[_0x4d155f(0x183)](_0x13b692[_0x4d155f(0x15f)])});saveLastTestRun(_0x54fba7);}catch{}if(_0x598295!==_0x4d155f(0x125)||_0x500427){const _0x42daa1=formatResults(_0x3d5d8c,_0x598295);if(_0x500427)try{a5_0x11f00d[_0x4d155f(0x11b)](_0x500427,_0x42daa1,'utf-8'),console[_0x4d155f(0x119)](),console['log'](a5_0x288236[_0x4d155f(0x139)](_0x4d155f(0x129)+_0x500427));}catch(_0x51f5fb){return console[_0x4d155f(0x119)](),console[_0x4d155f(0x119)](a5_0x288236['red']('Error\x20writing\x20output\x20file:\x20'+_0x51f5fb)),0x1;}else console[_0x4d155f(0x119)](),console[_0x4d155f(0x119)](_0x42daa1);}return _0x1b85c4[_0x4d155f(0xfa)]>0x0?0x1:0x0;}async[a5_0x2e5a6c(0x135)](_0xebb950,_0x538d7b){const _0x4800ea=a5_0x2e5a6c,{options:_0x19bdd0,tdx:_0x5c2ecc}=_0xebb950,{definition:_0x2aa340,agentInfo:_0x3b551c,outputFormat:_0x693801,outputFile:_0x579916}=_0x538d7b,_0x2838dc=_0x19bdd0[_0x4800ea(0x112)],_0x577ef9=loadLastTestRun();if(!_0x577ef9)return console[_0x4800ea(0x119)](a5_0x288236[_0x4800ea(0x141)](_0x4800ea(0xfe))),console[_0x4800ea(0x119)](a5_0x288236[_0x4800ea(0x139)](_0x4800ea(0x174))),0x1;if(_0x577ef9['agent'][_0x4800ea(0x158)]!==_0x3b551c['agentName'])return console['log'](a5_0x288236[_0x4800ea(0x141)](_0x4800ea(0x186)+_0x577ef9[_0x4800ea(0x180)]['agentName']+_0x4800ea(0x128)+_0x3b551c[_0x4800ea(0x158)]+'\x22.')),console[_0x4800ea(0x119)](a5_0x288236[_0x4800ea(0x139)](_0x4800ea(0x16b))),0x1;const _0x4ee573=new Set(_0x577ef9['conversations'][_0x4800ea(0x16a)](_0x28d007=>_0x28d007[_0x4800ea(0x116)])),_0x34e5a3=_0x2aa340[_0x4800ea(0x177)]['filter'](_0x11c014=>!_0x4ee573['has'](_0x11c014[_0x4800ea(0x11d)]));if(_0x34e5a3[_0x4800ea(0xfa)]>0x0&&_0x577ef9[_0x4800ea(0x112)]!==_0x2838dc)return console[_0x4800ea(0x119)](a5_0x288236[_0x4800ea(0x141)](_0x4800ea(0xf3))),console[_0x4800ea(0x119)](a5_0x288236[_0x4800ea(0x139)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x577ef9[_0x4800ea(0x112)]+_0x4800ea(0x18a)+_0x2838dc+'\x22.')),console[_0x4800ea(0x119)](a5_0x288236[_0x4800ea(0x139)](_0x4800ea(0xff)+_0x577ef9['site']+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x350318=_0x2aa340['tests'][_0x4800ea(0x148)](_0x3ed229=>_0x4ee573[_0x4800ea(0x15c)](_0x3ed229[_0x4800ea(0x11d)])),_0x33b4e3=_0x34e5a3;let _0x5ec236;try{_0x5ec236=await setupEvaluatorAgent(_0x5c2ecc[_0x4800ea(0x155)],_0x19bdd0[_0x4800ea(0x101)]);}catch(_0x427259){const _0x3f4825=_0x427259 instanceof Error?_0x427259[_0x4800ea(0x152)]:String(_0x427259);return console[_0x4800ea(0x119)](a5_0x288236[_0x4800ea(0x141)](_0x4800ea(0x147)+_0x3f4825)),0x1;}console['log'](a5_0x288236[_0x4800ea(0x166)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x4800ea(0x119)](_0x4800ea(0x153)+a5_0x288236['white'](_0x577ef9[_0x4800ea(0x13b)])),console[_0x4800ea(0x119)](_0x4800ea(0x122)+a5_0x288236[_0x4800ea(0x150)](_0x577ef9[_0x4800ea(0x180)]['projectName']+'/'+_0x577ef9[_0x4800ea(0x180)][_0x4800ea(0x158)]));_0x33b4e3[_0x4800ea(0xfa)]>0x0&&console['log'](_0x4800ea(0x17e)+a5_0x288236['yellow'](_0x33b4e3[_0x4800ea(0xfa)]));console[_0x4800ea(0x119)]();const _0x57ac4b=[],_0x51794d=Date[_0x4800ea(0x113)](),_0x369a13=createCommandSpinner(_0x4800ea(0x140));if(_0x350318[_0x4800ea(0xfa)]>0x0)try{const _0x3b35aa=await reevaluateFromCache(_0x5c2ecc[_0x4800ea(0x155)],_0x577ef9,{'tests':_0x350318},{'evaluatorId':_0x5ec236,'onTestStart':(_0x1bfb92,_0x499a5a,_0x27d2de)=>{const _0x4b5191=_0x4800ea;_0x369a13[_0x4b5191(0x188)]=_0x4b5191(0x168)+(_0x499a5a+0x1)+'/'+_0x27d2de+':\x20'+_0x1bfb92+_0x4b5191(0xfd);if(!_0x369a13[_0x4b5191(0x187)])_0x369a13[_0x4b5191(0x11c)]();},'onTestComplete':(_0x212e2e,_0x5c3224)=>{const _0x53978c=_0x4800ea;_0x369a13[_0x53978c(0x16d)]();if(_0x5c3224[_0x53978c(0x15d)]===_0x53978c(0x132))console[_0x53978c(0x119)](a5_0x288236['green'](_0x53978c(0x11e)+_0x212e2e)+a5_0x288236[_0x53978c(0x139)](_0x53978c(0x17a)));else _0x5c3224['status']==='FAIL'?console[_0x53978c(0x119)](a5_0x288236[_0x53978c(0x141)]('✗\x20FAIL:\x20'+_0x212e2e+_0x53978c(0x138)+_0x5c3224[_0x53978c(0x17d)])+a5_0x288236[_0x53978c(0x139)](_0x53978c(0x17a))):console['log'](a5_0x288236[_0x53978c(0x141)]('✗\x20ERROR:\x20'+_0x212e2e+_0x53978c(0x138)+_0x5c3224[_0x53978c(0x17d)]));_0x5c3224[_0x53978c(0x185)]&&console[_0x53978c(0x119)](a5_0x288236[_0x53978c(0x139)](_0x53978c(0x16f)+_0x5c3224[_0x53978c(0x185)])),_0x57ac4b[_0x53978c(0x165)](_0x5c3224);},'onTestSkipped':(_0x22f748,_0x3c0df0)=>{const _0x163446=_0x4800ea;_0x369a13[_0x163446(0x16d)](),console[_0x163446(0x119)](a5_0x288236[_0x163446(0x14c)]('⚠\x20SKIPPED:\x20'+_0x22f748+_0x163446(0x138)+_0x3c0df0));}});for(const _0x579eb1 of _0x3b35aa){!_0x57ac4b['find'](_0x28f201=>_0x28f201[_0x4800ea(0x11d)]===_0x579eb1['name'])&&_0x57ac4b[_0x4800ea(0x165)](_0x579eb1);}}catch(_0x2c34b9){_0x369a13['stop']();const _0x2d907a=_0x2c34b9 instanceof Error?_0x2c34b9[_0x4800ea(0x152)]:String(_0x2c34b9);return console['log'](a5_0x288236[_0x4800ea(0x141)](_0x4800ea(0x179)+_0x2d907a)),0x1;}_0x369a13[_0x4800ea(0x16d)]();if(_0x33b4e3[_0x4800ea(0xfa)]>0x0){console[_0x4800ea(0x119)](),console[_0x4800ea(0x119)](a5_0x288236[_0x4800ea(0x166)](_0x4800ea(0x13c)));const {projectId:_0x3b104d,agentId:_0x25ac9b}=_0x577ef9[_0x4800ea(0x180)];for(const _0x508955 of _0x33b4e3){console[_0x4800ea(0x119)]('Running:\x20'+a5_0x288236[_0x4800ea(0x150)](_0x508955[_0x4800ea(0x11d)]));const _0x58d5e5=createCommandSpinner(_0x4800ea(0x156)+_0x508955[_0x4800ea(0x167)][_0x4800ea(0xfa)]+_0x4800ea(0x104));_0x58d5e5[_0x4800ea(0x11c)]();try{const {result:_0x40ed27}=await runTest(_0x5c2ecc['llm'],_0x508955,{'agentId':_0x25ac9b,'projectId':_0x3b104d,'site':_0x577ef9['site'],'noEval':![],'evaluatorId':_0x5ec236,'onRoundStart':(_0x2d50c3,_0x20fabf)=>{const _0xa4fad9=_0x4800ea;_0x58d5e5[_0xa4fad9(0x188)]=_0xa4fad9(0x12f)+(_0x2d50c3+0x1)+'/'+_0x20fabf+_0xa4fad9(0x104);},'onRoundComplete':(_0x1dc26f,_0x36bac8,_0x4b1a25)=>{const _0x36d69d=_0x4800ea,_0xdd93f6=formatElapsed(_0x36bac8);_0x4b1a25?console[_0x36d69d(0x119)]('\x20\x20Round\x20'+(_0x1dc26f+0x1)+'/'+_0x508955[_0x36d69d(0x167)]['length']+_0x36d69d(0x14f)+a5_0x288236['green']('✓')+'\x20('+_0xdd93f6+')'):console[_0x36d69d(0x119)](_0x36d69d(0x182)+(_0x1dc26f+0x1)+'/'+_0x508955[_0x36d69d(0x167)]['length']+_0x36d69d(0x14f)+a5_0x288236[_0x36d69d(0x141)]('✗'));},'onEvaluationStart':()=>{const _0xe516bb=_0x4800ea;_0x58d5e5[_0xe516bb(0x188)]='Evaluating\x20response...';},'onEvaluationComplete':_0x4f7dbd=>{const _0x3e24d0=_0x4800ea,_0x4a89de=formatElapsed(_0x4f7dbd);console[_0x3e24d0(0x119)](_0x3e24d0(0x115)+a5_0x288236[_0x3e24d0(0x111)]('✓')+'\x20('+_0x4a89de+')');}});_0x58d5e5[_0x4800ea(0x16d)](),_0x57ac4b[_0x4800ea(0x165)](_0x40ed27);if(_0x40ed27[_0x4800ea(0x15d)]===_0x4800ea(0x132))console['log'](a5_0x288236['green'](_0x4800ea(0x11e)+_0x40ed27[_0x4800ea(0x17d)])+a5_0x288236[_0x4800ea(0x139)](_0x4800ea(0x10e)));else _0x40ed27[_0x4800ea(0x15d)]===_0x4800ea(0x164)?console[_0x4800ea(0x119)](a5_0x288236[_0x4800ea(0x141)](_0x4800ea(0x102)+_0x40ed27[_0x4800ea(0x17d)])+a5_0x288236[_0x4800ea(0x139)](_0x4800ea(0x10e))):console[_0x4800ea(0x119)](a5_0x288236[_0x4800ea(0x141)](_0x4800ea(0x154)+_0x40ed27['reason']));_0x40ed27[_0x4800ea(0x185)]&&console[_0x4800ea(0x119)](a5_0x288236[_0x4800ea(0x139)](_0x4800ea(0x16f)+_0x40ed27['conversation_url']));}catch(_0x2c471b){_0x58d5e5[_0x4800ea(0x16d)]();const _0x5126c7=_0x2c471b instanceof Error?_0x2c471b[_0x4800ea(0x152)]:String(_0x2c471b);console[_0x4800ea(0x119)](a5_0x288236[_0x4800ea(0x141)](_0x4800ea(0x154)+_0x5126c7)),_0x57ac4b[_0x4800ea(0x165)]({'name':_0x508955['name'],'status':'ERROR','reason':_0x5126c7,'timestamp':new Date()[_0x4800ea(0x109)](),'duration_ms':0x0});}}}console[_0x4800ea(0x119)]();const _0x3d5ae1=Date['now']()-_0x51794d,_0x90a0d2=_0x57ac4b[_0x4800ea(0x148)](_0x15f4de=>_0x15f4de[_0x4800ea(0x15d)]===_0x4800ea(0x132))[_0x4800ea(0xfa)],_0xe2a2c6=_0x57ac4b['filter'](_0x526953=>_0x526953[_0x4800ea(0x15d)]==='FAIL')[_0x4800ea(0xfa)],_0x508845=_0x57ac4b[_0x4800ea(0x148)](_0xf4a063=>_0xf4a063[_0x4800ea(0x15d)]===_0x4800ea(0x16e))[_0x4800ea(0xfa)];console['log']('━'['repeat'](0x3c)),console[_0x4800ea(0x119)](_0x4800ea(0x157)),console[_0x4800ea(0x119)]('━'[_0x4800ea(0x133)](0x3c)),console[_0x4800ea(0x119)](_0x4800ea(0x18b)+_0x57ac4b[_0x4800ea(0xfa)]),console[_0x4800ea(0x119)](_0x4800ea(0x159)+a5_0x288236[_0x4800ea(0x111)](_0x90a0d2)),console['log'](_0x4800ea(0x13f)+a5_0x288236[_0x4800ea(0x141)](_0xe2a2c6));_0x508845>0x0&&console[_0x4800ea(0x119)](_0x4800ea(0xf5)+a5_0x288236['red'](_0x508845));console[_0x4800ea(0x119)](_0x4800ea(0x160)+formatElapsed(_0x3d5ae1)),console['log']('━'[_0x4800ea(0x133)](0x3c));const _0xb43b77={'summary':{'total':_0x57ac4b['length'],'passed':_0x90a0d2,'failed':_0xe2a2c6,'errors':_0x508845>0x0?_0x508845:undefined,'duration_ms':_0x3d5ae1},'tests':_0x57ac4b,'agent':{'project':_0x3b551c['projectName'],'name':_0x3b551c[_0x4800ea(0x158)],'site':_0x2838dc},'timestamp':new Date(_0x51794d)[_0x4800ea(0x109)]()};if(_0x693801!==_0x4800ea(0x125)||_0x579916){const _0x5d085c=formatResults(_0xb43b77,_0x693801);if(_0x579916)try{a5_0x11f00d['writeFileSync'](_0x579916,_0x5d085c,_0x4800ea(0x15b)),console[_0x4800ea(0x119)](),console[_0x4800ea(0x119)](a5_0x288236[_0x4800ea(0x139)](_0x4800ea(0x129)+_0x579916));}catch(_0x184ef1){return console[_0x4800ea(0x119)](),console[_0x4800ea(0x119)](a5_0x288236[_0x4800ea(0x141)](_0x4800ea(0x127)+_0x184ef1)),0x1;}else console['log'](),console[_0x4800ea(0x119)](_0x5d085c);}const _0x24a373=_0x57ac4b['filter'](_0x1f690c=>_0x1f690c[_0x4800ea(0x15d)]!==_0x4800ea(0x132));return _0x24a373[_0x4800ea(0xfa)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x2acfd5=a6_0x579e;(function(_0x45c223,_0x2d3d5b){const _0x44b341=a6_0x579e,_0x24ed64=_0x45c223();while(!![]){try{const _0x250728=parseInt(_0x44b341(0x9c))/0x1+parseInt(_0x44b341(0x94))/0x2+parseInt(_0x44b341(0xca))/0x3+parseInt(_0x44b341(0x8d))/0x4+parseInt(_0x44b341(0xbf))/0x5*(parseInt(_0x44b341(0xb4))/0x6)+parseInt(_0x44b341(0xc7))/0x7+-parseInt(_0x44b341(0xaf))/0x8;if(_0x250728===_0x2d3d5b)break;else _0x24ed64['push'](_0x24ed64['shift']());}catch(_0x8f3ab0){_0x24ed64['push'](_0x24ed64['shift']());}}}(a6_0x1e60,0xcb5e6));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';function a6_0x579e(_0x4ff10b,_0x2b3620){_0x4ff10b=_0x4ff10b-0x8b;const _0x1e600d=a6_0x1e60();let _0x579eb5=_0x1e600d[_0x4ff10b];return _0x579eb5;}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([a6_0x2acfd5(0xb6),a6_0x2acfd5(0xad),a6_0x2acfd5(0xbb),'set-cookie',a6_0x2acfd5(0x92),a6_0x2acfd5(0xb2),a6_0x2acfd5(0x90),a6_0x2acfd5(0xc5)]);function isSensitiveHeader(_0x2244fc){const _0x3fa3fc=a6_0x2acfd5;return SENSITIVE_HEADERS[_0x3fa3fc(0x9e)](_0x2244fc[_0x3fa3fc(0x97)]());}function a6_0x1e60(){const _0x6eb0a=['DELETE','Invalid\x20header\x20format:\x20\x22','keys','isArray','output','api','verbose','body','header','PUT','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','proxy-authorization','Error:\x20','34424144PNbVRi','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','includes','x-xsrf-token','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','28188bJCqAO','headers','authorization','cdp','Endpoint\x20must\x20start\x20with\x20/:\x20','indexOf','name','cookie','trim','.\x20Valid\x20methods:\x20','readBodyFromFile','1005kYPwXc','method','substring','Invalid\x20HTTP\x20method:\x20','stack','execute','x-trino-user','POST','6944112rUBGpA','file','error','1898964thHbtY','<\x20HTTP/1.1\x20','color','entries','4188620iclome','startsWith','cas','x-auth-token','GET','set-cookie2','us01','292262dowfNN','join','length','toLowerCase','message','PATCH','llm','toUpperCase','1373428ACtxym','type','has','\x0aStack\x20trace:\x0a','data','site'];a6_0x1e60=function(){return _0x6eb0a;};return a6_0x1e60();}function parseHeader(_0x5b8a23){const _0x3233e4=a6_0x2acfd5,_0x5ad459=_0x5b8a23[_0x3233e4(0xb9)](':');if(_0x5ad459===-0x1)throw new Error(_0x3233e4(0xa3)+_0x5b8a23+'\x22.\x20'+_0x3233e4(0xac));const _0x29ef8e=_0x5b8a23[_0x3233e4(0xc1)](0x0,_0x5ad459)[_0x3233e4(0xbc)](),_0x17f20b=_0x5b8a23[_0x3233e4(0xc1)](_0x5ad459+0x1)[_0x3233e4(0xbc)]();if(!_0x29ef8e)throw new Error(_0x3233e4(0xb0)+_0x5b8a23+'\x22');return[_0x29ef8e,_0x17f20b];}export class ApiCommand extends BaseCommand{[a6_0x2acfd5(0xba)]='api';['description']='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';['validate'](_0x45c0d0){const _0x4302cf=a6_0x2acfd5,{args:_0x59600b,options:_0x372d14}=_0x45c0d0,_0x501b1e=_0x372d14;if(_0x59600b[_0x4302cf(0x96)]===0x0)return _0x4302cf(0xb3);const _0x37e536=_0x59600b[0x0];if(!_0x37e536[_0x4302cf(0x8e)]('/'))return _0x4302cf(0xb8)+_0x37e536;const _0x5d05af=_0x501b1e[_0x4302cf(0xa0)],_0x56eff2=_0x501b1e[_0x4302cf(0xc8)];if(_0x5d05af&&_0x56eff2)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x341fa8=_0x501b1e[_0x4302cf(0xc0)]||_0x4302cf(0x91),_0x477e76=[_0x4302cf(0x91),_0x4302cf(0xc6),_0x4302cf(0xab),_0x4302cf(0xa2),_0x4302cf(0x99)];if(!_0x477e76[_0x4302cf(0xb1)](_0x341fa8['toUpperCase']()))return _0x4302cf(0xc2)+_0x341fa8+_0x4302cf(0xbd)+_0x477e76['join'](',\x20');const _0x150852=_0x501b1e['type']||'td',_0xb36c21=['td',_0x4302cf(0xb7),'workflow','trino',_0x4302cf(0x9a),'llm-proxy',_0x4302cf(0x8f)];if(!_0xb36c21[_0x4302cf(0xb1)](_0x150852))return'Invalid\x20API\x20type:\x20'+_0x150852+'.\x20Valid\x20types:\x20'+_0xb36c21[_0x4302cf(0x95)](',\x20');return undefined;}async[a6_0x2acfd5(0xc4)](_0x414320){const _0x472799=a6_0x2acfd5,{options:_0xde5d45,args:_0x41dc1b,tdx:_0x117c7d}=_0x414320,_0x52663b=_0xde5d45,_0x3725f1=_0x41dc1b[0x0],_0x2c005f=(_0x52663b[_0x472799(0xc0)]||_0x472799(0x91))[_0x472799(0x9b)](),_0x141f38=_0x52663b[_0x472799(0xa0)],_0x257595=_0x52663b[_0x472799(0xc8)],_0x1ddb41=_0x52663b[_0x472799(0xaa)],_0x43f019=_0x52663b[_0x472799(0x9d)]||'td';try{const _0xea33e8={};if(_0x1ddb41){const _0x4a244f=Array[_0x472799(0xa5)](_0x1ddb41)?_0x1ddb41:[_0x1ddb41];for(const _0x267132 of _0x4a244f){const [_0x4a812c,_0x1512e4]=parseHeader(_0x267132);_0xea33e8[_0x4a812c]=_0x1512e4;}}let _0x2c317e;if(_0x141f38)_0x2c317e=_0x141f38;else{if(_0x257595)try{_0x2c317e=RawAPI[_0x472799(0xbe)](_0x257595);}catch(_0x3fb1b8){return console[_0x472799(0xc9)](_0x472799(0xae)+(_0x3fb1b8 instanceof Error?_0x3fb1b8[_0x472799(0x98)]:String(_0x3fb1b8))),0x1;}}const _0x27f192={'method':_0x2c005f,'apiType':_0x43f019,'includeHeaders':_0xde5d45[_0x472799(0xa8)]};_0x2c317e&&(_0x27f192[_0x472799(0xa9)]=_0x2c317e);Object[_0x472799(0xa4)](_0xea33e8)['length']>0x0&&(_0x27f192['headers']=_0xea33e8);if(_0xde5d45['verbose']){const _0x52fffb=resolveSite(_0xde5d45[_0x472799(0xa1)]??_0x472799(0x93)),_0x510c70=getEndpoint(_0x52fffb,_0x43f019),_0x146681=''+_0x510c70+_0x3725f1;console['error']('>\x20'+_0x2c005f+'\x20'+_0x146681);const _0x56058b=getAuthHeaders(_0x52fffb),_0x3d4247={..._0x56058b,..._0xea33e8};for(const [_0x106122,_0x1a82f2]of Object[_0x472799(0x8c)](_0x3d4247)){!isSensitiveHeader(_0x106122)&&console[_0x472799(0xc9)]('>\x20'+_0x106122+':\x20'+_0x1a82f2);}_0x2c317e&&console[_0x472799(0xc9)]('>'),console[_0x472799(0xc9)]('');}const _0x379fe5=await _0x117c7d[_0x472799(0xa7)]['request'](_0x3725f1,_0x27f192);if(_0xde5d45[_0x472799(0xa8)]&&_0x379fe5[_0x472799(0xb5)]){console['error'](_0x472799(0xcb)+_0x379fe5['status']);for(const [_0x50dfa9,_0x416a92]of Object[_0x472799(0x8c)](_0x379fe5['headers'])){!isSensitiveHeader(_0x50dfa9)&&console['error']('<\x20'+_0x50dfa9+':\x20'+_0x416a92);}console['error']('');}const _0x4ad697=Boolean(_0xde5d45['output']),_0x3ce504={'color':_0xde5d45[_0x472799(0x8b)],'noColor':_0xde5d45['noColor']||_0x4ad697&&!_0xde5d45[_0x472799(0x8b)]},_0x42962b=colorizeJSON(_0x379fe5['data'],_0x3ce504);return _0xde5d45['output']?(writeFileSync(_0xde5d45[_0x472799(0xa6)],_0x42962b),console[_0x472799(0xc9)]('Results\x20saved\x20to\x20'+_0xde5d45['output'])):console['log'](_0x42962b),0x0;}catch(_0x53827b){return _0x53827b instanceof Error?(console[_0x472799(0xc9)](_0x472799(0xae)+_0x53827b[_0x472799(0x98)]),_0xde5d45[_0x472799(0xa8)]&&_0x53827b[_0x472799(0xc3)]&&console[_0x472799(0xc9)](_0x472799(0x9f)+_0x53827b['stack'])):console['error']('Error:\x20'+String(_0x53827b)),0x1;}}}
1
+ const a6_0x29998a=a6_0x5715;(function(_0x46a6e3,_0x7a4e85){const _0xa5aad8=a6_0x5715,_0x4e6db5=_0x46a6e3();while(!![]){try{const _0x2374d4=-parseInt(_0xa5aad8(0xc9))/0x1*(-parseInt(_0xa5aad8(0xc0))/0x2)+parseInt(_0xa5aad8(0xcb))/0x3+parseInt(_0xa5aad8(0xe8))/0x4+parseInt(_0xa5aad8(0xec))/0x5*(parseInt(_0xa5aad8(0xb6))/0x6)+-parseInt(_0xa5aad8(0xf1))/0x7+parseInt(_0xa5aad8(0xd0))/0x8+-parseInt(_0xa5aad8(0xd3))/0x9;if(_0x2374d4===_0x7a4e85)break;else _0x4e6db5['push'](_0x4e6db5['shift']());}catch(_0x25a459){_0x4e6db5['push'](_0x4e6db5['shift']());}}}(a6_0x402e,0x95aa8));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';function a6_0x402e(){const _0x4cd265=['6683121wXwvbu','DELETE','request','stack','us01','output','color','POST','headers','site','length','trino','toLowerCase','log','proxy-authorization','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','error','status','cookie','cdp','entries','1497284JubPaD','Invalid\x20API\x20type:\x20','isArray','substring','20IpFbYg','set-cookie','.\x20Valid\x20types:\x20','startsWith','GET','5735436OBfdYE','description','workflow','verbose','api','Results\x20saved\x20to\x20','Invalid\x20header\x20format:\x20\x22','join','llm','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','22428iGOsuW','Error:\x20','trim','type','.\x20Valid\x20methods:\x20','\x22.\x20','name','toUpperCase','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','PUT','428948eTSNTa','validate','execute','has','Invalid\x20HTTP\x20method:\x20','header','x-auth-token','body','data','1xpiiRB','readBodyFromFile','3668475nDuZBU','\x0aStack\x20trace:\x0a','set-cookie2','includes','method','2787016rmRrWt','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','PATCH'];a6_0x402e=function(){return _0x4cd265;};return a6_0x402e();}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization',a6_0x29998a(0xe1),a6_0x29998a(0xe5),a6_0x29998a(0xed),a6_0x29998a(0xcd),'x-xsrf-token',a6_0x29998a(0xc6),'x-trino-user']);function a6_0x5715(_0x4aab90,_0x2a33f3){_0x4aab90=_0x4aab90-0xad;const _0x402ed5=a6_0x402e();let _0x57158d=_0x402ed5[_0x4aab90];return _0x57158d;}function isSensitiveHeader(_0x18e668){const _0x1a232a=a6_0x29998a;return SENSITIVE_HEADERS[_0x1a232a(0xc3)](_0x18e668[_0x1a232a(0xdf)]());}function parseHeader(_0x193a3c){const _0x3d0ffa=a6_0x29998a,_0x53b648=_0x193a3c['indexOf'](':');if(_0x53b648===-0x1)throw new Error(_0x3d0ffa(0xb2)+_0x193a3c+_0x3d0ffa(0xbb)+_0x3d0ffa(0xb5));const _0x11bd58=_0x193a3c[_0x3d0ffa(0xeb)](0x0,_0x53b648)[_0x3d0ffa(0xb8)](),_0x491bd5=_0x193a3c['substring'](_0x53b648+0x1)['trim']();if(!_0x11bd58)throw new Error(_0x3d0ffa(0xd1)+_0x193a3c+'\x22');return[_0x11bd58,_0x491bd5];}export class ApiCommand extends BaseCommand{[a6_0x29998a(0xbc)]='api';[a6_0x29998a(0xad)]=a6_0x29998a(0xbe);[a6_0x29998a(0xc1)](_0x6d2f8){const _0x2d3aae=a6_0x29998a,{args:_0x1f42a2,options:_0x487414}=_0x6d2f8,_0x5a5ab1=_0x487414;if(_0x1f42a2[_0x2d3aae(0xdd)]===0x0)return _0x2d3aae(0xe2);const _0x2b8601=_0x1f42a2[0x0];if(!_0x2b8601[_0x2d3aae(0xef)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x2b8601;const _0xc73185=_0x5a5ab1[_0x2d3aae(0xc8)],_0x363383=_0x5a5ab1['file'];if(_0xc73185&&_0x363383)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x580ccc=_0x5a5ab1[_0x2d3aae(0xcf)]||'GET',_0x406df6=[_0x2d3aae(0xf0),_0x2d3aae(0xda),_0x2d3aae(0xbf),_0x2d3aae(0xd4),_0x2d3aae(0xd2)];if(!_0x406df6[_0x2d3aae(0xce)](_0x580ccc[_0x2d3aae(0xbd)]()))return _0x2d3aae(0xc4)+_0x580ccc+_0x2d3aae(0xba)+_0x406df6['join'](',\x20');const _0x201751=_0x5a5ab1[_0x2d3aae(0xb9)]||'td',_0x4d943c=['td',_0x2d3aae(0xe6),_0x2d3aae(0xae),_0x2d3aae(0xde),_0x2d3aae(0xb4),'llm-proxy','cas'];if(!_0x4d943c[_0x2d3aae(0xce)](_0x201751))return _0x2d3aae(0xe9)+_0x201751+_0x2d3aae(0xee)+_0x4d943c[_0x2d3aae(0xb3)](',\x20');return undefined;}async[a6_0x29998a(0xc2)](_0x599252){const _0x110299=a6_0x29998a,{options:_0x3ffc11,args:_0x1b4d6,tdx:_0x47f594}=_0x599252,_0x3d7018=_0x3ffc11,_0x4a084f=_0x1b4d6[0x0],_0x3f5038=(_0x3d7018['method']||'GET')['toUpperCase'](),_0x43614b=_0x3d7018[_0x110299(0xc8)],_0x21bc0=_0x3d7018['file'],_0x4a7b20=_0x3d7018[_0x110299(0xc5)],_0x320aea=_0x3d7018['type']||'td';try{const _0x17c681={};if(_0x4a7b20){const _0x517ba6=Array[_0x110299(0xea)](_0x4a7b20)?_0x4a7b20:[_0x4a7b20];for(const _0x14eac4 of _0x517ba6){const [_0x5ab159,_0x20af0e]=parseHeader(_0x14eac4);_0x17c681[_0x5ab159]=_0x20af0e;}}let _0x29876a;if(_0x43614b)_0x29876a=_0x43614b;else{if(_0x21bc0)try{_0x29876a=RawAPI[_0x110299(0xca)](_0x21bc0);}catch(_0x135218){return console[_0x110299(0xe3)](_0x110299(0xb7)+(_0x135218 instanceof Error?_0x135218['message']:String(_0x135218))),0x1;}}const _0x597a9d={'method':_0x3f5038,'apiType':_0x320aea,'includeHeaders':_0x3ffc11['verbose']};_0x29876a&&(_0x597a9d[_0x110299(0xc7)]=_0x29876a);Object['keys'](_0x17c681)[_0x110299(0xdd)]>0x0&&(_0x597a9d[_0x110299(0xdb)]=_0x17c681);if(_0x3ffc11[_0x110299(0xaf)]){const _0x4ac079=resolveSite(_0x3ffc11[_0x110299(0xdc)]??_0x110299(0xd7)),_0x476e53=getEndpoint(_0x4ac079,_0x320aea),_0x448628=''+_0x476e53+_0x4a084f;console[_0x110299(0xe3)]('>\x20'+_0x3f5038+'\x20'+_0x448628);const _0x332938=getAuthHeaders(_0x4ac079),_0x24fec9={..._0x332938,..._0x17c681};for(const [_0x4b7932,_0x1d4061]of Object[_0x110299(0xe7)](_0x24fec9)){!isSensitiveHeader(_0x4b7932)&&console['error']('>\x20'+_0x4b7932+':\x20'+_0x1d4061);}_0x29876a&&console[_0x110299(0xe3)]('>'),console[_0x110299(0xe3)]('');}const _0x447b5e=await _0x47f594[_0x110299(0xb0)][_0x110299(0xd5)](_0x4a084f,_0x597a9d);if(_0x3ffc11[_0x110299(0xaf)]&&_0x447b5e[_0x110299(0xdb)]){console['error']('<\x20HTTP/1.1\x20'+_0x447b5e[_0x110299(0xe4)]);for(const [_0x6a30cf,_0x2c729f]of Object[_0x110299(0xe7)](_0x447b5e[_0x110299(0xdb)])){!isSensitiveHeader(_0x6a30cf)&&console[_0x110299(0xe3)]('<\x20'+_0x6a30cf+':\x20'+_0x2c729f);}console['error']('');}const _0x269be2=Boolean(_0x3ffc11[_0x110299(0xd8)]),_0x2637dd={'color':_0x3ffc11[_0x110299(0xd9)],'noColor':_0x3ffc11['noColor']||_0x269be2&&!_0x3ffc11[_0x110299(0xd9)]},_0x5b2c1c=colorizeJSON(_0x447b5e[_0x110299(0xc8)],_0x2637dd);return _0x3ffc11['output']?(writeFileSync(_0x3ffc11[_0x110299(0xd8)],_0x5b2c1c),console[_0x110299(0xe3)](_0x110299(0xb1)+_0x3ffc11['output'])):console[_0x110299(0xe0)](_0x5b2c1c),0x0;}catch(_0x4569f6){return _0x4569f6 instanceof Error?(console['error']('Error:\x20'+_0x4569f6['message']),_0x3ffc11['verbose']&&_0x4569f6[_0x110299(0xd6)]&&console[_0x110299(0xe3)](_0x110299(0xcc)+_0x4569f6[_0x110299(0xd6)])):console[_0x110299(0xe3)](_0x110299(0xb7)+String(_0x4569f6)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0xcaabb5=a7_0x3b2d;(function(_0x2f7b3b,_0x2d48ba){const _0x4d41e8=a7_0x3b2d,_0x13d7c2=_0x2f7b3b();while(!![]){try{const _0x42e734=parseInt(_0x4d41e8(0x169))/0x1+-parseInt(_0x4d41e8(0x156))/0x2*(-parseInt(_0x4d41e8(0x12b))/0x3)+parseInt(_0x4d41e8(0x162))/0x4*(-parseInt(_0x4d41e8(0x14b))/0x5)+-parseInt(_0x4d41e8(0x159))/0x6+parseInt(_0x4d41e8(0x128))/0x7+-parseInt(_0x4d41e8(0x15e))/0x8+parseInt(_0x4d41e8(0x139))/0x9*(parseInt(_0x4d41e8(0x133))/0xa);if(_0x42e734===_0x2d48ba)break;else _0x13d7c2['push'](_0x13d7c2['shift']());}catch(_0x5ff23f){_0x13d7c2['push'](_0x13d7c2['shift']());}}}(a7_0x716b,0x5dc2c));import{BaseCommand,printAuthError}from'./command.js';import{resolveOAuthAccessToken}from'../sdk/auth-token.js';function a7_0x716b(){const _0x434216=['API\x20key','You\x20can\x20find\x20your\x20API\x20key\x20at:','OAuth\x20tokens','auth:token','54531sNJlFM','No\x20credential\x20found','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','Read\x20credential\x20from\x20keychain','User:\x20','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Setting\x20up\x20authentication\x20for\x20site:\x20','description','profile','N/A','all','execute','Validating\x20OAuth\x20tokens...','last_name','Choose\x20how\x20to\x20sign\x20in:','filter','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','error','55mZUjJB','Setup\x20API\x20key\x20authentication\x20interactively','logLevel','getUserInfo','tdx:\x20auth\x20clear','/users/initiate_sso\x20(account:\x20','ERROR','Print\x20the\x20current\x20OAuth\x20access\x20token','cyan','✓\x20Signed\x20in\x20successfully','✓\x20Authentication\x20successful\x0a','44840wxJlcj','status','oauth','166896WDTAck','/app/mp/ak','Name:\x20','\x27\x20registered','✗\x20Validation\x20failed:\x20','1670448Ogjhyt','Remove\x20API\x20key\x20from\x20system\x20keychain','apikey','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','161992BtTGfx','bold','select','Validating\x20API\x20key...','\x20removed\x20from\x20keychain','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','accountName','264667nRCaKU','warn','\x0aSetup\x20cancelled','✓\x20Profile\x20\x27','\x20--profile\x20','API\x20key\x20cannot\x20be\x20empty','email','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','site','red','method','account_id','dim','trim','\x20(profile:\x20','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','System\x20keychain\x20is\x20not\x20available','Setup\x20cancelled','yellow','\x20\x20(','\x20\x20tdx','access_token','\x20\x20user_id:','password','auth:clear','✓\x20Default\x20site\x20set\x20to\x20','Sign\x20in\x20with\x20browser\x20(recommended)','log','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','auth','No\x20credentials\x20found\x20in\x20keychain','green','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20for\x20profile:\x20','join','1330546dvukmX','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','message','81qAGSjT','For\x20scripts\x20or\x20headless\x20servers','us01','name','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','apiKey','Credential\x20type:\x20OAuth','Enter\x20your\x20TD\x20API\x20key:','10Snodcv','first_name'];a7_0x716b=function(){return _0x434216;};return a7_0x716b();}import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync,loadGlobalProxy}from'../core/config.js';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';function a7_0x3b2d(_0xfbe435,_0x613fa5){_0xfbe435=_0xfbe435-0x128;const _0x716bd0=a7_0x716b();let _0x3b2d9e=_0x716bd0[_0xfbe435];return _0x3b2d9e;}import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x4becda 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_0x254951 from'chalk';export async function runOAuthLoginFlow(_0x4f924a,_0xcd282e,_0x362a44,_0x14be90){const _0x4204b6=a7_0x3b2d,_0x2d4d5d=await isKeychainAvailable();if(!_0x2d4d5d)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 _0x11a0bc=_0x14be90?.[_0x4204b6(0x168)];if(!_0x11a0bc){const _0x567326=await a7_0x4becda({'type':'text','name':'accountName','message':_0x4204b6(0x161)});if(_0x567326[_0x4204b6(0x168)]===undefined)throw new Error(_0x4204b6(0x17a));_0x11a0bc=_0x567326[_0x4204b6(0x168)]['trim']()||undefined;}const _0x3a0203=getConsoleUrl(_0x4f924a);console[_0x4204b6(0x184)]('Opening\x20browser\x20for\x20authentication...');_0x11a0bc?console['log']('\x20\x20'+_0x3a0203+_0x4204b6(0x150)+_0x11a0bc+')'):console[_0x4204b6(0x184)]('\x20\x20'+_0x3a0203+'/oauth/authorize');console[_0x4204b6(0x184)](_0x4204b6(0x129));const _0x1e96b2=loadGlobalProxy()||process.env.HTTPS_PROXY||process.env.HTTP_PROXY,_0x343257=await startOAuthFlow(_0x4f924a,{'accountName':_0x11a0bc,'proxy':_0x1e96b2});console[_0x4204b6(0x184)](_0x4204b6(0x145));const _0x1ad2ba=TDX['create']({'site':_0x4f924a,'accessToken':_0x343257[_0x4204b6(0x17e)],'logLevel':_0x362a44??LogLevel['ERROR']}),_0x1df8d0=await _0x1ad2ba['jobs'][_0x4204b6(0x14e)]();console[_0x4204b6(0x184)](a7_0x254951[_0x4204b6(0x188)](_0x4204b6(0x154))),console[_0x4204b6(0x184)]('\x20\x20'+a7_0x254951[_0x4204b6(0x153)](_0x4f924a+':'+_0x1df8d0[_0x4204b6(0x174)])+_0x4204b6(0x17f)+_0x1df8d0['id']+_0x4204b6(0x17c)+_0x1df8d0[_0x4204b6(0x16f)]+')');!_0x11a0bc&&(console[_0x4204b6(0x184)](a7_0x254951[_0x4204b6(0x175)](_0x4204b6(0x178))),console[_0x4204b6(0x184)](a7_0x254951[_0x4204b6(0x175)](_0x4204b6(0x185))),console[_0x4204b6(0x184)](a7_0x254951[_0x4204b6(0x175)]('\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions')));await saveOAuthTokens(_0x343257,_0xcd282e),console['log']('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0xcd282e?'\x20(profile:\x20'+_0xcd282e+')':''));if(_0xcd282e){const _0xc5c97d={'site':_0x4f924a};saveProfileToUserConfig(_0xcd282e,_0xc5c97d),console[_0x4204b6(0x184)](_0x4204b6(0x16c)+_0xcd282e+_0x4204b6(0x15c));}else saveDefaultSiteToUserConfig(_0x4f924a),console['log'](_0x4204b6(0x182)+_0x4f924a);const _0x209ae4=_0xcd282e?'\x20--profile\x20'+_0xcd282e:'';console['log'](),console[_0x4204b6(0x184)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x4204b6(0x184)](_0x4204b6(0x17d)+_0x209ae4+_0x4204b6(0x189)),console['log'](_0x4204b6(0x17d)+_0x209ae4+_0x4204b6(0x170));}export async function promptAuthMethod(){const _0x284af5=a7_0x3b2d,_0x25d16a=await a7_0x4becda({'type':_0x284af5(0x164),'name':_0x284af5(0x173),'message':_0x284af5(0x147),'choices':[{'title':_0x284af5(0x183),'description':'Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','value':_0x284af5(0x158)},{'title':'Use\x20an\x20API\x20key','description':_0x284af5(0x12c),'value':_0x284af5(0x160)}]});return _0x25d16a[_0x284af5(0x173)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0xcaabb5(0x12e)]='auth:setup';[a7_0xcaabb5(0x140)]=a7_0xcaabb5(0x14c);async[a7_0xcaabb5(0x144)](_0x9d0e63){const _0x3d38ca=a7_0xcaabb5,{options:_0x1c650b}=_0x9d0e63,_0x41bf4d=_0x1c650b[_0x3d38ca(0x141)];console[_0x3d38ca(0x184)](a7_0x254951[_0x3d38ca(0x163)]('tdx:\x20auth\x20setup'));const _0x31c54e=_0x1c650b[_0x3d38ca(0x171)]||_0x3d38ca(0x12d),_0x388d27=await promptSiteSelection(_0x31c54e,_0x41bf4d,_0x3d38ca(0x17a));if(!_0x388d27)return 0x1;const _0x3195e0=resolveSite(_0x388d27),_0x11d472=await promptAuthMethod();if(!_0x11d472)return console[_0x3d38ca(0x184)](_0x3d38ca(0x16b)),0x1;if(_0x11d472===_0x3d38ca(0x158)){const {accountName:_0x10f8ce}=_0x1c650b;return await runOAuthLoginFlow(_0x3195e0,_0x41bf4d,_0x1c650b[_0x3d38ca(0x14d)]??LogLevel[_0x3d38ca(0x151)],{'accountName':_0x10f8ce}),0x0;}console[_0x3d38ca(0x184)](_0x3d38ca(0x13f)+_0x3195e0),console[_0x3d38ca(0x184)](_0x3d38ca(0x136)),console['log']('\x20\x20'+getConsoleUrl(_0x3195e0,_0x3d38ca(0x15a)));const _0x4d0e32=await a7_0x4becda({'type':_0x3d38ca(0x180),'name':_0x3d38ca(0x130),'message':_0x3d38ca(0x132),'validate':_0x152293=>{const _0x31218a=_0x3d38ca;if(!_0x152293||!_0x152293[_0x31218a(0x176)]())return _0x31218a(0x16e);return!![];}});if(!_0x4d0e32[_0x3d38ca(0x130)])return console[_0x3d38ca(0x184)](_0x3d38ca(0x16b)),0x1;const _0xb713da=_0x4d0e32['apiKey'];console[_0x3d38ca(0x184)](_0x3d38ca(0x165));try{const _0x126a94=TDX['create']({'site':_0x3195e0,'apiKey':_0xb713da[_0x3d38ca(0x176)](),'logLevel':_0x1c650b[_0x3d38ca(0x14d)]??LogLevel[_0x3d38ca(0x151)]}),_0x2463c2=await _0x126a94['jobs'][_0x3d38ca(0x14e)]();console[_0x3d38ca(0x184)](_0x3d38ca(0x167)+_0x2463c2[_0x3d38ca(0x16f)]+')');const _0x58375a=await isKeychainAvailable();_0x58375a?(await saveAPIKeyAsync(_0xb713da['trim'](),_0x3195e0,_0x41bf4d),console[_0x3d38ca(0x184)](_0x3d38ca(0x149)+(_0x41bf4d?_0x3d38ca(0x177)+_0x41bf4d+')':''))):(console[_0x3d38ca(0x16a)](a7_0x254951[_0x3d38ca(0x17b)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x3d38ca(0x16a)](a7_0x254951[_0x3d38ca(0x17b)](_0x3d38ca(0x12f))));if(_0x41bf4d){const _0x5bb576={'site':_0x3195e0};saveProfileToUserConfig(_0x41bf4d,_0x5bb576),console[_0x3d38ca(0x184)]('✓\x20Profile\x20\x27'+_0x41bf4d+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x3195e0),console[_0x3d38ca(0x184)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x3195e0);const _0x2505c3=_0x41bf4d?_0x3d38ca(0x16d)+_0x41bf4d:'';return console[_0x3d38ca(0x184)](),console[_0x3d38ca(0x184)](_0x3d38ca(0x13b)),console['log'](_0x3d38ca(0x17d)+_0x2505c3+_0x3d38ca(0x189)),console[_0x3d38ca(0x184)]('\x20\x20tdx'+_0x2505c3+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x3fe27a){if(_0x3fe27a instanceof HTTPClientError&&_0x3fe27a[_0x3d38ca(0x157)]===0x191)return printAuthError(_0x3fe27a),0x1;return console[_0x3d38ca(0x14a)](a7_0x254951[_0x3d38ca(0x172)](_0x3d38ca(0x15d)+(_0x3fe27a instanceof Error?_0x3fe27a[_0x3d38ca(0x12a)]:String(_0x3fe27a)))),console[_0x3d38ca(0x14a)](_0x3d38ca(0x13e)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0xcaabb5(0x12e)]=a7_0xcaabb5(0x186);[a7_0xcaabb5(0x140)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0xcaabb5(0x144)](_0x2ead8a){const _0x7ec935=a7_0xcaabb5,{options:_0x2f8df9,tdx:_0x1acf4b}=_0x2ead8a,_0x5b0f5b=_0x2f8df9['site'],_0x4e55ea=_0x2f8df9['profile'],_0x2feecc=_0x4e55ea?_0x4e55ea:_0x7ec935(0x142);console[_0x7ec935(0x184)]('tdx\x20profile:\x20'+_0x2feecc+'\x20(site:\x20'+_0x5b0f5b+')');const _0x59be30=await getOAuthTokens(_0x4e55ea);if(_0x59be30)console[_0x7ec935(0x184)](_0x7ec935(0x131)),console['log'](_0x7ec935(0x13c)+(_0x4e55ea?_0x7ec935(0x177)+_0x4e55ea+')':''));else{const _0x13b935=await resolveAPIKeyAsync(_0x5b0f5b,_0x4e55ea);if(_0x13b935){const {source:_0x243432,isDeprecated:_0x20ed1d}=_0x13b935,_0xbd2b90='Read\x20credential\x20from\x20'+_0x243432;console['log'](_0x20ed1d?a7_0x254951[_0x7ec935(0x17b)](_0xbd2b90):_0xbd2b90);}else console['log'](a7_0x254951[_0x7ec935(0x17b)](_0x7ec935(0x13a)));}try{const _0x4b7ba8=await _0x1acf4b['jobs']['getUserInfo']();return console['log'](a7_0x254951['green'](_0x7ec935(0x155))),console['log'](_0x7ec935(0x13d)+_0x4b7ba8[_0x7ec935(0x16f)]),(_0x4b7ba8[_0x7ec935(0x134)]||_0x4b7ba8[_0x7ec935(0x146)])&&console['log'](_0x7ec935(0x15b)+[_0x4b7ba8[_0x7ec935(0x134)],_0x4b7ba8[_0x7ec935(0x146)]]['filter'](Boolean)[_0x7ec935(0x18b)]('\x20')),0x0;}catch(_0x5516cc){return _0x5516cc instanceof HTTPClientError&&_0x5516cc[_0x7ec935(0x157)]===0x191?printAuthError(_0x5516cc,!![],_0x4e55ea):console['error'](a7_0x254951['red'](_0x7ec935(0x15d)+(_0x5516cc instanceof Error?_0x5516cc[_0x7ec935(0x12a)]:String(_0x5516cc)))),0x1;}}}export class AuthTokenCommand extends BaseCommand{[a7_0xcaabb5(0x12e)]=a7_0xcaabb5(0x138);['description']=a7_0xcaabb5(0x152);async[a7_0xcaabb5(0x144)](_0x452983){const _0x29d6c7=a7_0xcaabb5,{options:_0xe4f31d}=_0x452983,_0x5a2548=await resolveOAuthAccessToken({'site':resolveSite(_0xe4f31d[_0x29d6c7(0x171)]||'us01'),'profile':_0xe4f31d[_0x29d6c7(0x141)],'proxy':loadGlobalProxy()});return console[_0x29d6c7(0x184)](_0x5a2548),0x0;}}export class AuthClearCommand extends BaseCommand{[a7_0xcaabb5(0x12e)]=a7_0xcaabb5(0x181);[a7_0xcaabb5(0x140)]=a7_0xcaabb5(0x15f);async['execute'](_0x207d24){const _0x48921e=a7_0xcaabb5,{options:_0x480156}=_0x207d24,_0x1dfab1=_0x480156[_0x48921e(0x141)];console['log'](a7_0x254951[_0x48921e(0x163)](_0x48921e(0x14f)));const _0x4a748f=await isKeychainAvailable();if(!_0x4a748f)return console[_0x48921e(0x14a)](a7_0x254951['red'](_0x48921e(0x179))),0x1;const [_0x246142,_0x2e47a1]=await Promise[_0x48921e(0x143)]([deleteKeychainAPIKey(_0x1dfab1),deleteOAuthTokens(_0x1dfab1)]);if(_0x246142||_0x2e47a1){clearCredentialCache();const _0x4bc89c=[_0x246142&&_0x48921e(0x135),_0x2e47a1&&_0x48921e(0x137)][_0x48921e(0x148)](Boolean)[_0x48921e(0x18b)]('\x20and\x20');return console['log']('✓\x20'+_0x4bc89c+_0x48921e(0x166)+(_0x1dfab1?_0x48921e(0x177)+_0x1dfab1+')':'')),0x0;}else return console['log'](_0x48921e(0x187)+(_0x1dfab1?_0x48921e(0x18a)+_0x1dfab1:'')),0x1;}}
1
+ const a7_0x155774=a7_0xd83c;(function(_0xb1d9bc,_0x5a7fd9){const _0x5e2152=a7_0xd83c,_0x260bf7=_0xb1d9bc();while(!![]){try{const _0x5b6589=parseInt(_0x5e2152(0x23c))/0x1*(parseInt(_0x5e2152(0x238))/0x2)+parseInt(_0x5e2152(0x226))/0x3*(-parseInt(_0x5e2152(0x1ec))/0x4)+-parseInt(_0x5e2152(0x211))/0x5+parseInt(_0x5e2152(0x1f3))/0x6+parseInt(_0x5e2152(0x213))/0x7*(-parseInt(_0x5e2152(0x208))/0x8)+parseInt(_0x5e2152(0x220))/0x9*(parseInt(_0x5e2152(0x214))/0xa)+parseInt(_0x5e2152(0x20e))/0xb*(parseInt(_0x5e2152(0x228))/0xc);if(_0x5b6589===_0x5a7fd9)break;else _0x260bf7['push'](_0x260bf7['shift']());}catch(_0x1ff37b){_0x260bf7['push'](_0x260bf7['shift']());}}}(a7_0xb775,0x2d4ac));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';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';function a7_0xb775(){const _0xba5a0f=['warn','\x0aSetup\x20cancelled','password','105153oevmKb','accountName','614904vzxaXB','/oauth/authorize','yellow','\x20--profile\x20','✗\x20Validation\x20failed:\x20','Setup\x20cancelled','message','\x20removed\x20from\x20keychain','trim','red','You\x20can\x20find\x20your\x20API\x20key\x20at:','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','ERROR','apikey','log','\x20\x20tdx','106TdSrMQ','green','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','System\x20keychain\x20is\x20not\x20available','2045VNjWlS','bold','email','✓\x20Authentication\x20successful\x0a','User:\x20','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','\x20(profile:\x20','join','\x27\x20registered','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','first_name','✓\x20Profile\x20\x27','API\x20key\x20cannot\x20be\x20empty','getUserInfo','✓\x20Default\x20site\x20set\x20to\x20','\x20and\x20','auth:setup','Validating\x20OAuth\x20tokens...','auth','logLevel','Use\x20an\x20API\x20key','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','24ONfrXm','auth:token','Credential\x20type:\x20OAuth','tdx\x20profile:\x20','Read\x20credential\x20from\x20keychain','/users/initiate_sso\x20(account:\x20','text','787896QkxlMo','method','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','status','N/A','Setup\x20API\x20key\x20authentication\x20interactively','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','Enter\x20your\x20TD\x20API\x20key:','last_name','\x20(site:\x20','cyan','Setting\x20up\x20authentication\x20for\x20site:\x20','execute','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','tdx:\x20auth\x20setup','oauth','Print\x20the\x20current\x20OAuth\x20access\x20token','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','name','us01','error','719720ETCEbw','description','✓\x20Signed\x20in\x20successfully','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','apiKey','filter','11ZlCJaf','create','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','504975hjbVuh','dim','7BhuIne','270Rvqcbv','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','tdx:\x20auth\x20clear','OAuth\x20tokens','Choose\x20how\x20to\x20sign\x20in:','site','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Opening\x20browser\x20for\x20authentication...','No\x20credentials\x20found\x20in\x20keychain','\x20\x20(','select','profile','98613dNeIoJ','Validating\x20API\x20key...','API\x20key'];a7_0xb775=function(){return _0xba5a0f;};return a7_0xb775();}import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x4787ac 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_0xa22649 from'chalk';export async function runOAuthLoginFlow(_0x2f1676,_0x439cc9,_0x2ad1d1,_0x42b126){const _0x2bf96a=a7_0xd83c,_0xdc08ed=await isKeychainAvailable();if(!_0xdc08ed)throw new Error(_0x2bf96a(0x200)+_0x2bf96a(0x20b));let _0x5ab79e=_0x42b126?.[_0x2bf96a(0x227)];if(!_0x5ab79e){const _0x37c419=await a7_0x4787ac({'type':_0x2bf96a(0x1f2),'name':'accountName','message':_0x2bf96a(0x210)});if(_0x37c419[_0x2bf96a(0x227)]===undefined)throw new Error(_0x2bf96a(0x22d));_0x5ab79e=_0x37c419[_0x2bf96a(0x227)][_0x2bf96a(0x230)]()||undefined;}const _0x30ef69=getConsoleUrl(_0x2f1676);console[_0x2bf96a(0x236)](_0x2bf96a(0x21b));_0x5ab79e?console['log']('\x20\x20'+_0x30ef69+_0x2bf96a(0x1f1)+_0x5ab79e+')'):console[_0x2bf96a(0x236)]('\x20\x20'+_0x30ef69+_0x2bf96a(0x229));console[_0x2bf96a(0x236)]('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0x112bcc=loadGlobalProxy()||process.env.HTTPS_PROXY||process.env.HTTP_PROXY,_0x4ac0e1=await startOAuthFlow(_0x2f1676,{'accountName':_0x5ab79e,'proxy':_0x112bcc});console['log'](_0x2bf96a(0x1e7));const _0x216e80=TDX[_0x2bf96a(0x20f)]({'site':_0x2f1676,'accessToken':_0x4ac0e1['access_token'],'logLevel':_0x2ad1d1??LogLevel[_0x2bf96a(0x234)]}),_0xc6894b=await _0x216e80['jobs'][_0x2bf96a(0x1e3)]();console[_0x2bf96a(0x236)](a7_0xa22649[_0x2bf96a(0x239)](_0x2bf96a(0x20a))),console['log']('\x20\x20'+a7_0xa22649[_0x2bf96a(0x1fd)](_0x2f1676+':'+_0xc6894b['account_id'])+'\x20\x20user_id:'+_0xc6894b['id']+_0x2bf96a(0x21d)+_0xc6894b['email']+')');!_0x5ab79e&&(console['log'](a7_0xa22649[_0x2bf96a(0x212)](_0x2bf96a(0x23a))),console[_0x2bf96a(0x236)](a7_0xa22649[_0x2bf96a(0x212)]('\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>')),console[_0x2bf96a(0x236)](a7_0xa22649[_0x2bf96a(0x212)](_0x2bf96a(0x1f9))));await saveOAuthTokens(_0x4ac0e1,_0x439cc9),console[_0x2bf96a(0x236)](_0x2bf96a(0x1eb)+(_0x439cc9?'\x20(profile:\x20'+_0x439cc9+')':''));if(_0x439cc9){const _0x21ae88={'site':_0x2f1676};saveProfileToUserConfig(_0x439cc9,_0x21ae88),console[_0x2bf96a(0x236)](_0x2bf96a(0x1e1)+_0x439cc9+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x2f1676),console['log'](_0x2bf96a(0x1e4)+_0x2f1676);const _0x56a787=_0x439cc9?_0x2bf96a(0x22b)+_0x439cc9:'';console['log'](),console[_0x2bf96a(0x236)](_0x2bf96a(0x1df)),console[_0x2bf96a(0x236)](_0x2bf96a(0x237)+_0x56a787+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console['log'](_0x2bf96a(0x237)+_0x56a787+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export async function promptAuthMethod(){const _0x33418f=a7_0xd83c,_0x43a614=await a7_0x4787ac({'type':_0x33418f(0x21e),'name':_0x33418f(0x1f4),'message':_0x33418f(0x218),'choices':[{'title':'Sign\x20in\x20with\x20browser\x20(recommended)','description':_0x33418f(0x204),'value':'oauth'},{'title':_0x33418f(0x1ea),'description':'For\x20scripts\x20or\x20headless\x20servers','value':_0x33418f(0x235)}]});return _0x43a614[_0x33418f(0x1f4)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x155774(0x205)]=a7_0x155774(0x1e6);[a7_0x155774(0x209)]=a7_0x155774(0x1f8);async['execute'](_0x2f71e5){const _0x4510b0=a7_0x155774,{options:_0x412107}=_0x2f71e5,_0x49ed20=_0x412107[_0x4510b0(0x21f)];console[_0x4510b0(0x236)](a7_0xa22649[_0x4510b0(0x23d)](_0x4510b0(0x201)));const _0x1f3b98=_0x412107[_0x4510b0(0x219)]||_0x4510b0(0x206),_0x2683c7=await promptSiteSelection(_0x1f3b98,_0x49ed20,_0x4510b0(0x22d));if(!_0x2683c7)return 0x1;const _0x2d6c52=resolveSite(_0x2683c7),_0x4326bf=await promptAuthMethod();if(!_0x4326bf)return console[_0x4510b0(0x236)](_0x4510b0(0x224)),0x1;if(_0x4326bf===_0x4510b0(0x202)){const {accountName:_0x3abd08}=_0x412107;return await runOAuthLoginFlow(_0x2d6c52,_0x49ed20,_0x412107[_0x4510b0(0x1e9)]??LogLevel[_0x4510b0(0x234)],{'accountName':_0x3abd08}),0x0;}console[_0x4510b0(0x236)](_0x4510b0(0x1fe)+_0x2d6c52),console[_0x4510b0(0x236)](_0x4510b0(0x232)),console[_0x4510b0(0x236)]('\x20\x20'+getConsoleUrl(_0x2d6c52,'/app/mp/ak'));const _0x55e441=await a7_0x4787ac({'type':_0x4510b0(0x225),'name':_0x4510b0(0x20c),'message':_0x4510b0(0x1fa),'validate':_0x14ab8b=>{const _0x9d8f26=_0x4510b0;if(!_0x14ab8b||!_0x14ab8b[_0x9d8f26(0x230)]())return _0x9d8f26(0x1e2);return!![];}});if(!_0x55e441[_0x4510b0(0x20c)])return console[_0x4510b0(0x236)](_0x4510b0(0x224)),0x1;const _0x399e7e=_0x55e441[_0x4510b0(0x20c)];console[_0x4510b0(0x236)](_0x4510b0(0x221));try{const _0x5ec378=TDX['create']({'site':_0x2d6c52,'apiKey':_0x399e7e[_0x4510b0(0x230)](),'logLevel':_0x412107[_0x4510b0(0x1e9)]??LogLevel['ERROR']}),_0xb5d7c4=await _0x5ec378['jobs'][_0x4510b0(0x1e3)]();console[_0x4510b0(0x236)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0xb5d7c4[_0x4510b0(0x23e)]+')');const _0x128f79=await isKeychainAvailable();_0x128f79?(await saveAPIKeyAsync(_0x399e7e[_0x4510b0(0x230)](),_0x2d6c52,_0x49ed20),console[_0x4510b0(0x236)](_0x4510b0(0x241)+(_0x49ed20?'\x20(profile:\x20'+_0x49ed20+')':''))):(console[_0x4510b0(0x223)](a7_0xa22649['yellow'](_0x4510b0(0x215))),console['warn'](a7_0xa22649[_0x4510b0(0x22a)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x49ed20){const _0x5e5223={'site':_0x2d6c52};saveProfileToUserConfig(_0x49ed20,_0x5e5223),console[_0x4510b0(0x236)](_0x4510b0(0x1e1)+_0x49ed20+_0x4510b0(0x1de));}else saveDefaultSiteToUserConfig(_0x2d6c52),console[_0x4510b0(0x236)](_0x4510b0(0x1e4)+_0x2d6c52);const _0x5d59b7=_0x49ed20?'\x20--profile\x20'+_0x49ed20:'';return console[_0x4510b0(0x236)](),console['log']('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x4510b0(0x236)]('\x20\x20tdx'+_0x5d59b7+_0x4510b0(0x1f5)),console['log'](_0x4510b0(0x237)+_0x5d59b7+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x107781){if(_0x107781 instanceof HTTPClientError&&_0x107781[_0x4510b0(0x1f6)]===0x191)return printAuthError(_0x107781),0x1;return console['error'](a7_0xa22649[_0x4510b0(0x231)]('✗\x20Validation\x20failed:\x20'+(_0x107781 instanceof Error?_0x107781[_0x4510b0(0x22e)]:String(_0x107781)))),console[_0x4510b0(0x207)](_0x4510b0(0x21a)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x155774(0x205)]=a7_0x155774(0x1e8);[a7_0x155774(0x209)]=a7_0x155774(0x233);async[a7_0x155774(0x1ff)](_0xd8da30){const _0x3b48f6=a7_0x155774,{options:_0x1b4fa5,tdx:_0xcb5df2}=_0xd8da30,_0x38f910=_0x1b4fa5[_0x3b48f6(0x219)],_0x37b39d=_0x1b4fa5[_0x3b48f6(0x21f)],_0x2f8bb8=_0x37b39d?_0x37b39d:_0x3b48f6(0x1f7);console[_0x3b48f6(0x236)](_0x3b48f6(0x1ef)+_0x2f8bb8+_0x3b48f6(0x1fc)+_0x38f910+')');const _0x3f5c4b=await getOAuthTokens(_0x37b39d);if(_0x3f5c4b)console[_0x3b48f6(0x236)](_0x3b48f6(0x1ee)),console[_0x3b48f6(0x236)](_0x3b48f6(0x1f0)+(_0x37b39d?'\x20(profile:\x20'+_0x37b39d+')':''));else{const _0x5df3b5=await resolveAPIKeyAsync(_0x38f910,_0x37b39d);if(_0x5df3b5){const {source:_0x5ab487,isDeprecated:_0x29dc17}=_0x5df3b5,_0x3c00f5='Read\x20credential\x20from\x20'+_0x5ab487;console[_0x3b48f6(0x236)](_0x29dc17?a7_0xa22649['yellow'](_0x3c00f5):_0x3c00f5);}else console['log'](a7_0xa22649[_0x3b48f6(0x22a)]('No\x20credential\x20found'));}try{const _0x4da01d=await _0xcb5df2['jobs'][_0x3b48f6(0x1e3)]();return console[_0x3b48f6(0x236)](a7_0xa22649[_0x3b48f6(0x239)](_0x3b48f6(0x23f))),console[_0x3b48f6(0x236)](_0x3b48f6(0x240)+_0x4da01d[_0x3b48f6(0x23e)]),(_0x4da01d[_0x3b48f6(0x1e0)]||_0x4da01d[_0x3b48f6(0x1fb)])&&console[_0x3b48f6(0x236)]('Name:\x20'+[_0x4da01d['first_name'],_0x4da01d[_0x3b48f6(0x1fb)]][_0x3b48f6(0x20d)](Boolean)[_0x3b48f6(0x1dd)]('\x20')),0x0;}catch(_0x3f04c7){return _0x3f04c7 instanceof HTTPClientError&&_0x3f04c7[_0x3b48f6(0x1f6)]===0x191?printAuthError(_0x3f04c7,!![],_0x37b39d):console[_0x3b48f6(0x207)](a7_0xa22649['red'](_0x3b48f6(0x22c)+(_0x3f04c7 instanceof Error?_0x3f04c7[_0x3b48f6(0x22e)]:String(_0x3f04c7)))),0x1;}}}export class AuthTokenCommand extends BaseCommand{[a7_0x155774(0x205)]=a7_0x155774(0x1ed);['description']=a7_0x155774(0x203);async[a7_0x155774(0x1ff)](_0x1429dd){const _0x405270=a7_0x155774,{options:_0x9ab438}=_0x1429dd,_0x1bb408=await resolveOAuthAccessToken({'site':resolveSite(_0x9ab438[_0x405270(0x219)]||_0x405270(0x206)),'profile':_0x9ab438[_0x405270(0x21f)],'proxy':loadGlobalProxy()});return console[_0x405270(0x236)](_0x1bb408),0x0;}}function a7_0xd83c(_0x412255,_0x2866ab){_0x412255=_0x412255-0x1dd;const _0xb775af=a7_0xb775();let _0xd83c5f=_0xb775af[_0x412255];return _0xd83c5f;}export class AuthClearCommand extends BaseCommand{[a7_0x155774(0x205)]='auth:clear';[a7_0x155774(0x209)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x155774(0x1ff)](_0x5a0739){const _0x43b33a=a7_0x155774,{options:_0x262c18}=_0x5a0739,_0x4e74d2=_0x262c18[_0x43b33a(0x21f)];console[_0x43b33a(0x236)](a7_0xa22649['bold'](_0x43b33a(0x216)));const _0x4b481d=await isKeychainAvailable();if(!_0x4b481d)return console['error'](a7_0xa22649[_0x43b33a(0x231)](_0x43b33a(0x23b))),0x1;const [_0x28224e,_0x350f8b]=await Promise['all']([deleteKeychainAPIKey(_0x4e74d2),deleteOAuthTokens(_0x4e74d2)]);if(_0x28224e||_0x350f8b){clearCredentialCache();const _0x341f06=[_0x28224e&&_0x43b33a(0x222),_0x350f8b&&_0x43b33a(0x217)][_0x43b33a(0x20d)](Boolean)[_0x43b33a(0x1dd)](_0x43b33a(0x1e5));return console['log']('✓\x20'+_0x341f06+_0x43b33a(0x22f)+(_0x4e74d2?_0x43b33a(0x242)+_0x4e74d2+')':'')),0x0;}else return console[_0x43b33a(0x236)](_0x43b33a(0x21c)+(_0x4e74d2?'\x20for\x20profile:\x20'+_0x4e74d2:'')),0x1;}}