@treasuredata/tdx 2026.7.3 → 2026.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (287) 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.d.ts.map +1 -1
  13. package/dist/commands/cas-command.js +1 -1
  14. package/dist/commands/cas-command.js.map +1 -1
  15. package/dist/commands/cas-segment-command.js +1 -1
  16. package/dist/commands/chat-command.js +1 -1
  17. package/dist/commands/claude-command.d.ts +67 -0
  18. package/dist/commands/claude-command.d.ts.map +1 -1
  19. package/dist/commands/claude-command.js +1 -1
  20. package/dist/commands/claude-command.js.map +1 -1
  21. package/dist/commands/claude-statusline-command.js +1 -1
  22. package/dist/commands/claude-usage-command.js +1 -1
  23. package/dist/commands/command.js +1 -1
  24. package/dist/commands/connection-command.js +1 -1
  25. package/dist/commands/databases.js +1 -1
  26. package/dist/commands/delivery-command.js +1 -1
  27. package/dist/commands/describe.d.ts +11 -0
  28. package/dist/commands/describe.d.ts.map +1 -1
  29. package/dist/commands/describe.js +1 -1
  30. package/dist/commands/describe.js.map +1 -1
  31. package/dist/commands/engage-campaign-pull-command.js +1 -1
  32. package/dist/commands/engage-campaign-push-command.js +1 -1
  33. package/dist/commands/engage-campaign-validate-command.js +1 -1
  34. package/dist/commands/engage-command.js +1 -1
  35. package/dist/commands/engage-template-pull-command.js +1 -1
  36. package/dist/commands/engage-template-push-command.js +1 -1
  37. package/dist/commands/engage-template-validate-command.js +1 -1
  38. package/dist/commands/job-command.d.ts.map +1 -1
  39. package/dist/commands/job-command.js +1 -1
  40. package/dist/commands/job-command.js.map +1 -1
  41. package/dist/commands/journey-command.js +1 -1
  42. package/dist/commands/journey-validate-command.js +1 -1
  43. package/dist/commands/llm-command.d.ts.map +1 -1
  44. package/dist/commands/llm-command.js +1 -1
  45. package/dist/commands/llm-command.js.map +1 -1
  46. package/dist/commands/mcp-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.d.ts.map +1 -1
  73. package/dist/commands/workflow-command.js +1 -1
  74. package/dist/commands/workflow-command.js.map +1 -1
  75. package/dist/core/auth.js +1 -1
  76. package/dist/core/command-output.js +1 -1
  77. package/dist/core/config.js +1 -1
  78. package/dist/core/connection-cache.js +1 -1
  79. package/dist/core/constants.js +1 -1
  80. package/dist/core/credential-cache.js +1 -1
  81. package/dist/core/global-context.js +1 -1
  82. package/dist/core/keychain.js +1 -1
  83. package/dist/core/oauth-keychain.js +1 -1
  84. package/dist/core/oauth.js +1 -1
  85. package/dist/core/profile.js +1 -1
  86. package/dist/core/project-config.js +1 -1
  87. package/dist/core/session.js +1 -1
  88. package/dist/core/user-cache.js +1 -1
  89. package/dist/core/version.js +1 -1
  90. package/dist/index.js +1 -1
  91. package/dist/mcp/server.js +1 -1
  92. package/dist/mcp/tools/index.js +1 -1
  93. package/dist/mcp/tools/tdx-run.js +1 -1
  94. package/dist/mcp/tools/tdx-search.js +1 -1
  95. package/dist/mcp/tools/work-create-item.js +1 -1
  96. package/dist/mcp/utils.js +1 -1
  97. package/dist/proxy/claude-usage-tracker.js +1 -1
  98. package/dist/proxy/passthrough-server.js +1 -1
  99. package/dist/proxy/sse-usage-parser.js +1 -1
  100. package/dist/sdk/agent/agent-config.js +1 -1
  101. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  102. package/dist/sdk/agent/agent-yaml.js +1 -1
  103. package/dist/sdk/agent/test/evaluator.js +1 -1
  104. package/dist/sdk/agent/test/executor.js +1 -1
  105. package/dist/sdk/agent/test/index.js +1 -1
  106. package/dist/sdk/agent/test/output.js +1 -1
  107. package/dist/sdk/agent/test/parser.js +1 -1
  108. package/dist/sdk/agent/tool-target-registry.js +1 -1
  109. package/dist/sdk/api.js +1 -1
  110. package/dist/sdk/cas/cas-api-client.d.ts.map +1 -1
  111. package/dist/sdk/cas/cas-api-client.js +1 -1
  112. package/dist/sdk/cas/cas-api-client.js.map +1 -1
  113. package/dist/sdk/cas/cas-audience-schema.d.ts +15 -3
  114. package/dist/sdk/cas/cas-audience-schema.d.ts.map +1 -1
  115. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  116. package/dist/sdk/cas/cas-audience-schema.js.map +1 -1
  117. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  118. package/dist/sdk/cas/cas-audience-validator.js.map +1 -1
  119. package/dist/sdk/cas/cas-audience-yaml.d.ts +8 -0
  120. package/dist/sdk/cas/cas-audience-yaml.d.ts.map +1 -1
  121. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  122. package/dist/sdk/cas/cas-audience-yaml.js.map +1 -1
  123. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  124. package/dist/sdk/cas/index.js +1 -1
  125. package/dist/sdk/cas/pull-workflow.js +1 -1
  126. package/dist/sdk/cas/push-workflow.d.ts +47 -1
  127. package/dist/sdk/cas/push-workflow.d.ts.map +1 -1
  128. package/dist/sdk/cas/push-workflow.js +1 -1
  129. package/dist/sdk/cas/push-workflow.js.map +1 -1
  130. package/dist/sdk/cas/validate-files.js +1 -1
  131. package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
  132. package/dist/sdk/client/cdp-api-client.js +1 -1
  133. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  134. package/dist/sdk/client/delivery-api-client.js +1 -1
  135. package/dist/sdk/client/endpoints.js +1 -1
  136. package/dist/sdk/client/engage-api-client.d.ts +6 -6
  137. package/dist/sdk/client/engage-api-client.js +1 -1
  138. package/dist/sdk/client/engage-api-client.js.map +1 -1
  139. package/dist/sdk/client/http-client.js +1 -1
  140. package/dist/sdk/client/llm-api-client.js +1 -1
  141. package/dist/sdk/client/oauth-refresh.js +1 -1
  142. package/dist/sdk/client/rate-limiter.js +1 -1
  143. package/dist/sdk/client/td-api-client.js +1 -1
  144. package/dist/sdk/client/trino-api-client.js +1 -1
  145. package/dist/sdk/client/workflow-client.js +1 -1
  146. package/dist/sdk/connection-validator.js +1 -1
  147. package/dist/sdk/connection.js +1 -1
  148. package/dist/sdk/delivery.js +1 -1
  149. package/dist/sdk/engage/campaign-pull.js +1 -1
  150. package/dist/sdk/engage/campaign-push.js +1 -1
  151. package/dist/sdk/engage/campaign-validator.js +1 -1
  152. package/dist/sdk/engage/campaign-yaml.js +1 -1
  153. package/dist/sdk/engage/template-pull.js +1 -1
  154. package/dist/sdk/engage/template-push.js +1 -1
  155. package/dist/sdk/engage/template-validator.js +1 -1
  156. package/dist/sdk/engage/template-yaml.js +1 -1
  157. package/dist/sdk/engage/types/campaign-def.js +1 -1
  158. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  159. package/dist/sdk/engage/types/template-schema.js +1 -1
  160. package/dist/sdk/engage.js +1 -1
  161. package/dist/sdk/errors.js +1 -1
  162. package/dist/sdk/index.js +1 -1
  163. package/dist/sdk/io/index.js +1 -1
  164. package/dist/sdk/io/node-filesystem.js +1 -1
  165. package/dist/sdk/job.js +1 -1
  166. package/dist/sdk/journey.js +1 -1
  167. package/dist/sdk/llm/chat-cache.js +1 -1
  168. package/dist/sdk/llm/index.js +1 -1
  169. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  170. package/dist/sdk/llm/model-factors.d.ts.map +1 -1
  171. package/dist/sdk/llm/model-factors.js +1 -1
  172. package/dist/sdk/llm/model-factors.js.map +1 -1
  173. package/dist/sdk/llm/user-settings.js +1 -1
  174. package/dist/sdk/personalization.js +1 -1
  175. package/dist/sdk/policy.js +1 -1
  176. package/dist/sdk/query/deleted-table-validation.js +1 -1
  177. package/dist/sdk/query/index.d.ts +9 -1
  178. package/dist/sdk/query/index.d.ts.map +1 -1
  179. package/dist/sdk/query/index.js +1 -1
  180. package/dist/sdk/query/index.js.map +1 -1
  181. package/dist/sdk/query/sql-parser.js +1 -1
  182. package/dist/sdk/realtime.js +1 -1
  183. package/dist/sdk/schedule.js +1 -1
  184. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  185. package/dist/sdk/segment/fields-display.js +1 -1
  186. package/dist/sdk/segment/file-discovery.js +1 -1
  187. package/dist/sdk/segment/journey-utils.js +1 -1
  188. package/dist/sdk/segment/journey-validator.js +1 -1
  189. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  190. package/dist/sdk/segment/journey-yaml.js +1 -1
  191. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  192. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  193. package/dist/sdk/segment/parent-segment-yaml.d.ts.map +1 -1
  194. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  195. package/dist/sdk/segment/parent-segment-yaml.js.map +1 -1
  196. package/dist/sdk/segment/pull-workflow.js +1 -1
  197. package/dist/sdk/segment/push-recovery.js +1 -1
  198. package/dist/sdk/segment/push-workflow.js +1 -1
  199. package/dist/sdk/segment/resolution-context.js +1 -1
  200. package/dist/sdk/segment/segment-path-parser.js +1 -1
  201. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  202. package/dist/sdk/segment/segment-validator.js +1 -1
  203. package/dist/sdk/segment/target-resolution.d.ts.map +1 -1
  204. package/dist/sdk/segment/target-resolution.js +1 -1
  205. package/dist/sdk/segment/target-resolution.js.map +1 -1
  206. package/dist/sdk/segment/tdx-config.js +1 -1
  207. package/dist/sdk/segment/types/activation-schema.js +1 -1
  208. package/dist/sdk/segment/types/journey-def.d.ts.map +1 -1
  209. package/dist/sdk/segment/types/journey-def.js +1 -1
  210. package/dist/sdk/segment/types/journey-schema.js +1 -1
  211. package/dist/sdk/segment/types/parent-segment-def.d.ts.map +1 -1
  212. package/dist/sdk/segment/types/segment-def.js +1 -1
  213. package/dist/sdk/segment/types/segment-schema.js +1 -1
  214. package/dist/sdk/segment/validate-files.js +1 -1
  215. package/dist/sdk/segment/yaml-validator.js +1 -1
  216. package/dist/sdk/segment.js +1 -1
  217. package/dist/sdk/types/cas.d.ts +5 -0
  218. package/dist/sdk/types/cas.d.ts.map +1 -1
  219. package/dist/sdk/types/cdp.d.ts.map +1 -1
  220. package/dist/sdk/types/engage.d.ts.map +1 -1
  221. package/dist/sdk/types/index.js +1 -1
  222. package/dist/sdk/types/llm.d.ts.map +1 -1
  223. package/dist/sdk/types/progress.js +1 -1
  224. package/dist/sdk/types/workspace.d.ts.map +1 -1
  225. package/dist/sdk/types/workspace.js +1 -1
  226. package/dist/sdk/types/workspace.js.map +1 -1
  227. package/dist/sdk/user.js +1 -1
  228. package/dist/sdk/util/format-detector.js +1 -1
  229. package/dist/sdk/util/formatters.js +1 -1
  230. package/dist/sdk/util/index.js +1 -1
  231. package/dist/sdk/util/paginate.js +1 -1
  232. package/dist/sdk/util/tree-formatter.js +1 -1
  233. package/dist/sdk/util/tree-search.js +1 -1
  234. package/dist/sdk/workflow/archive-validation.js +1 -1
  235. package/dist/sdk/workflow/clone-workflow.js +1 -1
  236. package/dist/sdk/workflow/index.js +1 -1
  237. package/dist/sdk/workflow/pull-workflow.js +1 -1
  238. package/dist/sdk/workflow/push-workflow.js +1 -1
  239. package/dist/sdk/workflow/task-graph.js +1 -1
  240. package/dist/sdk/workflow/tdx-config.js +1 -1
  241. package/dist/sdk/workflow/workflow-utils.js +1 -1
  242. package/dist/sdk/workspace/access-tracker.js +1 -1
  243. package/dist/sdk/workspace/frontmatter.js +1 -1
  244. package/dist/sdk/workspace/git.js +1 -1
  245. package/dist/sdk/workspace/index.js +1 -1
  246. package/dist/sdk/workspace/templates.js +1 -1
  247. package/dist/sdk/workspace/weekly.js +1 -1
  248. package/dist/sdk/workspace/wikilinks.js +1 -1
  249. package/dist/test-utils/command-runner.js +1 -1
  250. package/dist/test-utils/factories.js +1 -1
  251. package/dist/test-utils/fixtures.js +1 -1
  252. package/dist/test-utils/http-mock.js +1 -1
  253. package/dist/test-utils/index.js +1 -1
  254. package/dist/utils/async.js +1 -1
  255. package/dist/utils/claude-code-state.d.ts +33 -0
  256. package/dist/utils/claude-code-state.d.ts.map +1 -0
  257. package/dist/utils/claude-code-state.js +1 -0
  258. package/dist/utils/claude-code-state.js.map +1 -0
  259. package/dist/utils/colors.js +1 -1
  260. package/dist/utils/diff.js +1 -1
  261. package/dist/utils/file-permissions.js +1 -1
  262. package/dist/utils/file-reader.js +1 -1
  263. package/dist/utils/github-releases.js +1 -1
  264. package/dist/utils/global-cache.js +1 -1
  265. package/dist/utils/json-loader.js +1 -1
  266. package/dist/utils/local-cache.js +1 -1
  267. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  268. package/dist/utils/logger/formatters/index.js +1 -1
  269. package/dist/utils/logger/handlers/console-handler.js +1 -1
  270. package/dist/utils/logger/handlers/file-handler.js +1 -1
  271. package/dist/utils/logger/handlers/index.js +1 -1
  272. package/dist/utils/logger/handlers/null-handler.js +1 -1
  273. package/dist/utils/logger/index.js +1 -1
  274. package/dist/utils/logger/logger.js +1 -1
  275. package/dist/utils/logger/types.js +1 -1
  276. package/dist/utils/option-validation.js +1 -1
  277. package/dist/utils/process.js +1 -1
  278. package/dist/utils/prompt.js +1 -1
  279. package/dist/utils/proxy-fetch.js +1 -1
  280. package/dist/utils/proxy-fetch.js.map +1 -1
  281. package/dist/utils/spinner.js +1 -1
  282. package/dist/utils/sse-parser.js +1 -1
  283. package/dist/utils/string-utils.js +1 -1
  284. package/dist/utils/table-ref-parser.js +1 -1
  285. package/dist/utils/tdx-logger.js +1 -1
  286. package/dist/utils/version-check.js +1 -1
  287. package/package.json +18 -10
@@ -1 +1 @@
1
- function a3_0x14db(_0xcec4ef,_0x1097a9){_0xcec4ef=_0xcec4ef-0xb5;const _0x687ab=a3_0x687a();let _0x14dbbb=_0x687ab[_0xcec4ef];return _0x14dbbb;}const a3_0x4448a9=a3_0x14db;(function(_0x3018cd,_0x123c01){const _0xec12fd=a3_0x14db,_0x339fe9=_0x3018cd();while(!![]){try{const _0x5d7b9b=-parseInt(_0xec12fd(0xb7))/0x1+parseInt(_0xec12fd(0xb9))/0x2+-parseInt(_0xec12fd(0xc6))/0x3*(-parseInt(_0xec12fd(0xce))/0x4)+parseInt(_0xec12fd(0xca))/0x5*(-parseInt(_0xec12fd(0xd3))/0x6)+parseInt(_0xec12fd(0xc5))/0x7*(parseInt(_0xec12fd(0xd1))/0x8)+-parseInt(_0xec12fd(0xc2))/0x9*(-parseInt(_0xec12fd(0xd6))/0xa)+parseInt(_0xec12fd(0xb8))/0xb*(-parseInt(_0xec12fd(0xd7))/0xc);if(_0x5d7b9b===_0x123c01)break;else _0x339fe9['push'](_0x339fe9['shift']());}catch(_0x2c476e){_0x339fe9['push'](_0x339fe9['shift']());}}}(a3_0x687a,0xca129));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_0x4448a9(0xd5);[a3_0x4448a9(0xcd)]=a3_0x4448a9(0xc7);async[a3_0x4448a9(0xba)](_0x183e1e){const _0x4cade9=a3_0x4448a9,{options:_0x1fcffd,args:_0x328ed8,tdx:_0x53587d}=_0x183e1e;if(_0x328ed8[_0x4cade9(0xd2)]===0x0)return console['error']('Error:\x20Segment\x20name\x20is\x20required'),console[_0x4cade9(0xd0)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x2e85b8,childId:_0x286ac2}=parseSegmentRef(_0x328ed8[0x0]);if(!_0x286ac2)return console[_0x4cade9(0xd0)](_0x4cade9(0xd9)),console[_0x4cade9(0xd0)](_0x4cade9(0xbe)),0x1;_0x1fcffd[_0x4cade9(0xc8)]&&(console[_0x4cade9(0xd0)](_0x4cade9(0xc4)+_0x1fcffd[_0x4cade9(0xb5)]),console[_0x4cade9(0xd0)](_0x4cade9(0xd4)+_0x2e85b8),console[_0x4cade9(0xd0)](_0x4cade9(0xb6)+_0x286ac2));const _0x54a151=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2e85b8+'\x27...',()=>_0x53587d['segment'][_0x4cade9(0xbc)](_0x2e85b8),{'verbose':_0x1fcffd[_0x4cade9(0xc8)]}),_0x477db7=_0x54a151[_0x4cade9(0xc1)];_0x1fcffd[_0x4cade9(0xc8)]&&console[_0x4cade9(0xd0)](_0x4cade9(0xd8)+_0x477db7);const _0x52c8cd=await withSpinner(_0x4cade9(0xcc)+_0x286ac2+'\x27...',()=>_0x53587d[_0x4cade9(0xcb)]['resolveSegmentId'](_0x477db7,_0x286ac2),{'verbose':_0x1fcffd['verbose']}),_0x5f0005=_0x52c8cd[_0x4cade9(0xc1)];_0x1fcffd[_0x4cade9(0xc8)]&&console[_0x4cade9(0xd0)](_0x4cade9(0xc0)+_0x5f0005);const _0xa439a0=await withSpinner(_0x4cade9(0xc9)+_0x286ac2+'\x27...',()=>_0x53587d[_0x4cade9(0xcb)][_0x4cade9(0xcf)](_0x477db7,_0x5f0005),{'verbose':_0x1fcffd[_0x4cade9(0xc8)]}),_0x4c8df1=_0xa439a0[_0x4cade9(0xc1)];return console[_0x4cade9(0xd0)](_0x4cade9(0xbf)+_0x4c8df1[_0x4cade9(0xd2)]+'\x20activation'+(_0x4c8df1[_0x4cade9(0xd2)]!==0x1?'s':'')),await handleSDKOutput(_0x4c8df1,_0x1fcffd),0x0;}catch(_0x229ff2){if(_0x229ff2 instanceof SDKError)return console[_0x4cade9(0xd0)]('Error:\x20'+_0x229ff2[_0x4cade9(0xc3)]),_0x229ff2[_0x4cade9(0xbb)]&&console[_0x4cade9(0xd0)](_0x4cade9(0xbd)+_0x229ff2[_0x4cade9(0xbb)]),0x1;throw _0x229ff2;}}}function a3_0x687a(){const _0x2d313f=['682517rKesDs','2507402KftAJl','execute','cause','resolveParentId','\x20\x20Cause:\x20','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','✔\x20Found\x20','Resolved\x20child\x20ID:\x20','data','9mpdHcn','message','Site:\x20','78582FbDduT','225DXIFNP','List\x20activations\x20for\x20a\x20segment','verbose','Listing\x20activations\x20for\x20segment\x20\x27','533315TKJWbG','segment','Resolving\x20child\x20segment\x20\x27','description','81380STbfon','listActivations','error','536MtsRQJ','length','60GeRhxh','Parent\x20name:\x20','activations','2925690kiDlhD','180ZRlxCW','Resolved\x20parent\x20ID:\x20','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','site','Child\x20name:\x20','999263oJMVuK'];a3_0x687a=function(){return _0x2d313f;};return a3_0x687a();}
1
+ const a3_0x379236=a3_0x5c95;(function(_0x5c986f,_0x291550){const _0x59da71=a3_0x5c95,_0x2f28e7=_0x5c986f();while(!![]){try{const _0x1a5e26=parseInt(_0x59da71(0x1f3))/0x1+parseInt(_0x59da71(0x1eb))/0x2*(parseInt(_0x59da71(0x1fc))/0x3)+-parseInt(_0x59da71(0x1f8))/0x4*(parseInt(_0x59da71(0x1f5))/0x5)+parseInt(_0x59da71(0x1f9))/0x6+-parseInt(_0x59da71(0x1ee))/0x7+parseInt(_0x59da71(0x1fa))/0x8+-parseInt(_0x59da71(0x1f1))/0x9*(-parseInt(_0x59da71(0x1e9))/0xa);if(_0x1a5e26===_0x291550)break;else _0x2f28e7['push'](_0x2f28e7['shift']());}catch(_0x1ec82d){_0x2f28e7['push'](_0x2f28e7['shift']());}}}(a3_0x6055,0x435ab));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a3_0x5c95(_0x466356,_0x142365){_0x466356=_0x466356-0x1e5;const _0x60557b=a3_0x6055();let _0x5c9591=_0x60557b[_0x466356];return _0x5c9591;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0x6055(){const _0x3bb532=['Resolved\x20parent\x20ID:\x20','cause','description','\x27...','Resolving\x20parent\x20segment\x20\x27','message','listActivations','Parent\x20name:\x20','20WrgLHJ','Listing\x20activations\x20for\x20segment\x20\x27','620rKGmDw','execute','verbose','3610005sYeomv','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','Child\x20name:\x20','587079cysZlq','Resolving\x20child\x20segment\x20\x27','217220vRaFCW','name','15sbEose','length','resolveSegmentId','334132shKwqX','930942sNtWui','2439984zsFywM','Error:\x20','2268kIksEb','data','segment','resolveParentId','error','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','\x20\x20Cause:\x20','Resolved\x20child\x20ID:\x20','List\x20activations\x20for\x20a\x20segment'];a3_0x6055=function(){return _0x3bb532;};return a3_0x6055();}export class ActivationsCommand extends BaseCommand{[a3_0x379236(0x1f4)]='activations';[a3_0x379236(0x207)]=a3_0x379236(0x204);async[a3_0x379236(0x1ec)](_0x2cb99c){const _0x1500b2=a3_0x379236,{options:_0x20047e,args:_0x2ec8cb,tdx:_0x37276b}=_0x2cb99c;if(_0x2ec8cb[_0x1500b2(0x1f6)]===0x0)return console['error']('Error:\x20Segment\x20name\x20is\x20required'),console[_0x1500b2(0x200)](_0x1500b2(0x201)),0x1;try{const {parentId:_0x21ea84,childId:_0x81859}=parseSegmentRef(_0x2ec8cb[0x0]);if(!_0x81859)return console[_0x1500b2(0x200)](_0x1500b2(0x1ef)),console['error'](_0x1500b2(0x201)),0x1;_0x20047e[_0x1500b2(0x1ed)]&&(console[_0x1500b2(0x200)]('Site:\x20'+_0x20047e['site']),console[_0x1500b2(0x200)](_0x1500b2(0x1e8)+_0x21ea84),console['error'](_0x1500b2(0x1f0)+_0x81859));const _0x4a1a0c=await withSpinner(_0x1500b2(0x1e5)+_0x21ea84+_0x1500b2(0x208),()=>_0x37276b[_0x1500b2(0x1fe)][_0x1500b2(0x1ff)](_0x21ea84),{'verbose':_0x20047e[_0x1500b2(0x1ed)]}),_0x596e4=_0x4a1a0c[_0x1500b2(0x1fd)];_0x20047e['verbose']&&console[_0x1500b2(0x200)](_0x1500b2(0x205)+_0x596e4);const _0x300399=await withSpinner(_0x1500b2(0x1f2)+_0x81859+_0x1500b2(0x208),()=>_0x37276b[_0x1500b2(0x1fe)][_0x1500b2(0x1f7)](_0x596e4,_0x81859),{'verbose':_0x20047e[_0x1500b2(0x1ed)]}),_0x17e08d=_0x300399[_0x1500b2(0x1fd)];_0x20047e[_0x1500b2(0x1ed)]&&console[_0x1500b2(0x200)](_0x1500b2(0x203)+_0x17e08d);const _0x22c4cf=await withSpinner(_0x1500b2(0x1ea)+_0x81859+'\x27...',()=>_0x37276b[_0x1500b2(0x1fe)][_0x1500b2(0x1e7)](_0x596e4,_0x17e08d),{'verbose':_0x20047e['verbose']}),_0x5948ba=_0x22c4cf[_0x1500b2(0x1fd)];return console[_0x1500b2(0x200)]('✔\x20Found\x20'+_0x5948ba[_0x1500b2(0x1f6)]+'\x20activation'+(_0x5948ba[_0x1500b2(0x1f6)]!==0x1?'s':'')),await handleSDKOutput(_0x5948ba,_0x20047e),0x0;}catch(_0x2944ed){if(_0x2944ed instanceof SDKError)return console[_0x1500b2(0x200)](_0x1500b2(0x1fb)+_0x2944ed[_0x1500b2(0x1e6)]),_0x2944ed[_0x1500b2(0x206)]&&console[_0x1500b2(0x200)](_0x1500b2(0x202)+_0x2944ed[_0x1500b2(0x206)]),0x1;throw _0x2944ed;}}}
@@ -1 +1 @@
1
- const a4_0x4a2739=a4_0x29e0;(function(_0x38a809,_0x41e548){const _0x26ce70=a4_0x29e0,_0x3b65b=_0x38a809();while(!![]){try{const _0x581fb9=-parseInt(_0x26ce70(0x1e0))/0x1*(parseInt(_0x26ce70(0x23e))/0x2)+parseInt(_0x26ce70(0x271))/0x3+parseInt(_0x26ce70(0x1bf))/0x4*(parseInt(_0x26ce70(0x1d2))/0x5)+-parseInt(_0x26ce70(0x229))/0x6*(parseInt(_0x26ce70(0x202))/0x7)+parseInt(_0x26ce70(0x1db))/0x8+-parseInt(_0x26ce70(0x234))/0x9+parseInt(_0x26ce70(0x1c8))/0xa*(parseInt(_0x26ce70(0x275))/0xb);if(_0x581fb9===_0x41e548)break;else _0x3b65b['push'](_0x3b65b['shift']());}catch(_0x281c8c){_0x3b65b['push'](_0x3b65b['shift']());}}}(a4_0xa0c9,0x82886));import a4_0xeea917 from'chalk';import a4_0x4bfe75 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';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x31b559){const _0x257d5a=a4_0x29e0,_0x31a4e6=[];if(_0x31b559[_0x257d5a(0x1e1)]!==undefined)_0x31a4e6[_0x257d5a(0x25d)](_0x31b559[_0x257d5a(0x1e1)]+'\x20total');if(_0x31b559[_0x257d5a(0x1e6)]!==undefined&&_0x31b559[_0x257d5a(0x1e6)]>0x0)_0x31a4e6[_0x257d5a(0x25d)](a4_0xeea917[_0x257d5a(0x1f4)](_0x31b559['new']+_0x257d5a(0x1fa)));if(_0x31b559[_0x257d5a(0x1cf)]!==undefined&&_0x31b559[_0x257d5a(0x1cf)]>0x0)_0x31a4e6['push'](a4_0xeea917['green'](_0x31b559[_0x257d5a(0x1cf)]+_0x257d5a(0x206)));if(_0x31b559[_0x257d5a(0x25e)]!==undefined&&_0x31b559[_0x257d5a(0x25e)]>0x0)_0x31a4e6[_0x257d5a(0x25d)](a4_0xeea917[_0x257d5a(0x1bc)](_0x31b559[_0x257d5a(0x25e)]+_0x257d5a(0x224)));if(_0x31b559[_0x257d5a(0x254)]!==undefined&&_0x31b559[_0x257d5a(0x254)]>0x0)_0x31a4e6[_0x257d5a(0x25d)](a4_0xeea917['gray'](_0x31b559[_0x257d5a(0x254)]+_0x257d5a(0x257)));if(_0x31b559[_0x257d5a(0x1df)]!==undefined&&_0x31b559[_0x257d5a(0x1df)]>0x0)_0x31a4e6[_0x257d5a(0x25d)](a4_0xeea917[_0x257d5a(0x214)](_0x31b559[_0x257d5a(0x1df)]+_0x257d5a(0x21e)));return _0x31a4e6['join'](',\x20');}function displayDiffs(_0x746357,_0x391416,_0x2470eb,_0x36e1b2,_0x1747fe,_0x5a316f,_0x4bef7c,_0x470851,_0x209982){const _0x548dc0=a4_0x29e0;for(const _0x59140a of _0x746357){if(_0x59140a['diff']){const _0x1d67a7=_0x59140a['agentName']||_0x59140a[_0x548dc0(0x1f8)];console['log'](_0x548dc0(0x21c)+_0x1d67a7+'\x27:'),console['log']('─'[_0x548dc0(0x1be)](0x3c)),console[_0x548dc0(0x272)](_0x59140a[_0x548dc0(0x1d0)]),console[_0x548dc0(0x272)]('─'[_0x548dc0(0x1be)](0x3c));}}for(const _0x2fe0dc of _0x391416){_0x2fe0dc[_0x548dc0(0x1d0)]&&(console[_0x548dc0(0x272)](_0x548dc0(0x226)+_0x2fe0dc['name']+'\x27:'),console[_0x548dc0(0x272)]('─'[_0x548dc0(0x1be)](0x3c)),console[_0x548dc0(0x272)](_0x2fe0dc['diff']),console[_0x548dc0(0x272)]('─'[_0x548dc0(0x1be)](0x3c)));}for(const _0x403dc4 of _0x2470eb){_0x403dc4['diff']&&(console[_0x548dc0(0x272)](_0x548dc0(0x26d)+_0x403dc4[_0x548dc0(0x1f8)]+'\x27:'),console['log']('─'[_0x548dc0(0x1be)](0x3c)),console[_0x548dc0(0x272)](_0x403dc4[_0x548dc0(0x1d0)]),console[_0x548dc0(0x272)]('─'[_0x548dc0(0x1be)](0x3c)));}for(const _0x2a59fb of _0x36e1b2){_0x2a59fb[_0x548dc0(0x1d0)]&&(console[_0x548dc0(0x272)](_0x548dc0(0x1ea)+_0x2a59fb[_0x548dc0(0x1f8)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x548dc0(0x272)](_0x2a59fb['diff']),console['log']('─'['repeat'](0x3c)));}for(const _0x1501ca of _0x1747fe){_0x1501ca[_0x548dc0(0x1d0)]&&(console[_0x548dc0(0x272)](_0x548dc0(0x201)+_0x1501ca[_0x548dc0(0x1f8)]+'\x27:'),console[_0x548dc0(0x272)]('─'[_0x548dc0(0x1be)](0x3c)),console[_0x548dc0(0x272)](_0x1501ca[_0x548dc0(0x1d0)]),console[_0x548dc0(0x272)]('─'[_0x548dc0(0x1be)](0x3c)));}for(const _0x2d4d49 of _0x5a316f){_0x2d4d49[_0x548dc0(0x1d0)]&&(console[_0x548dc0(0x272)](_0x548dc0(0x217)+_0x2d4d49[_0x548dc0(0x1f8)]+'\x27:'),console[_0x548dc0(0x272)]('─'[_0x548dc0(0x1be)](0x3c)),console[_0x548dc0(0x272)](_0x2d4d49[_0x548dc0(0x1d0)]),console[_0x548dc0(0x272)]('─'['repeat'](0x3c)));}for(const _0x56ea59 of _0x4bef7c){_0x56ea59[_0x548dc0(0x1d0)]&&(console[_0x548dc0(0x272)](_0x548dc0(0x260)+_0x56ea59['name']+'\x27:'),console['log']('─'[_0x548dc0(0x1be)](0x3c)),console[_0x548dc0(0x272)](_0x56ea59[_0x548dc0(0x1d0)]),console['log']('─'[_0x548dc0(0x1be)](0x3c)));}for(const _0x4e04d7 of _0x470851){_0x4e04d7[_0x548dc0(0x1d0)]&&(console[_0x548dc0(0x272)](_0x548dc0(0x1e2)+_0x4e04d7[_0x548dc0(0x1f8)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x548dc0(0x272)](_0x4e04d7[_0x548dc0(0x1d0)]),console[_0x548dc0(0x272)]('─'['repeat'](0x3c)));}for(const _0x528108 of _0x209982){_0x528108[_0x548dc0(0x1d0)]&&(console['log'](_0x548dc0(0x203)+_0x528108[_0x548dc0(0x1f8)]+'\x27:'),console[_0x548dc0(0x272)]('─'[_0x548dc0(0x1be)](0x3c)),console[_0x548dc0(0x272)](_0x528108[_0x548dc0(0x1d0)]),console['log']('─'['repeat'](0x3c)));}}function a4_0xa0c9(){const _0x6041f7=['tdx.json','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Pushing\x20to\x20project...','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20--profile\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','cwd-config','unchanged','yes','Using\x20current\x20project:\x20','\x20unchanged','Dry\x20run\x20-\x20no\x20changes\x20made','\x22\x20to\x20\x22','\x20\x20Form\x20Interfaces:\x20','prompts','session','push','updated','\x20\x20Form\x20Interface\x20\x22','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x0aPull\x20summary\x20for\x20\x27','\x0aErrors\x20found:','Analyzing\x20project\x20\x22','\x27\x20to\x20create\x20the\x20folder\x20structure.','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','parse','found','Would\x20push\x20agent:\x20','source','Writing\x20files...','\x20\x20Chat\x20Interfaces:\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','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x0aPush\x20summary\x20for\x20\x27','New\x20project\x20name\x20is\x20required','projectDir','1641582QBejHD','log','Clone\x20\x22','\x20|\x20','7997TcCjqR','dirname','New\x20project\x20ID:\x20','llm','Using\x20project\x20from\x20context:\x20','\x20\x20Knowledge\x20Bases:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','agent.yml','arg-dir','agents','\x0aError:','no_local_folder','yellow','\x20resources\x20to\x20\x27','repeat','2332Uaphgq','llm_project','experimentalArtifacts','agent','\x20\x20Prompt\x20\x22','Summary:','utf-8','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20files?','4190EqQhnz','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','Pulling\x20agent\x20\x22','Using\x20local\x20project:\x20','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)','projectId','Output:\x20','created','diff','newProjectId','4910INLFLw','\x20--name\x20','-\x20no\x20files\x20written','error','dim','Output\x20path:\x20','\x20\x20Integration\x20\x22','chatInterfaces','\x20\x20Experimental\x20Artifact\x20\x22','6670016IbNHYH','integrations','\x20\x20Chat\x20Interface\x20\x22','✔\x20Context\x20set:\x20','errors','17722oPOYjV','total','\x0aChanges\x20to\x20form\x20interface\x20\x27','cloneProject','pushProject','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','new','Would\x20pull\x20agent:\x20','\x20\x20Text\x20Knowledge\x20Bases:\x20','Source:\x20','\x0aChanges\x20to\x20prompt\x20\x27','agentName','\x20resources?','Would\x20clone:','Dry\x20run\x20-\x20no\x20files\x20written','\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','Cloning\x20\x22','\x22:\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','green','New\x20project:\x20','reason','pushAgent','name','experimentalKnowledgeBases','\x20new','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x22\x20to\x20a\x20different\x20profile','\x20\x20Target:\x20','action','isNew','join','\x0aChanges\x20to\x20integration\x20\x27','7yrGyEz','\x0aChanges\x20to\x20chat\x20interface\x20\x27','\x20\x20Source:\x20','\x22...','\x20created','\x20\x20Integrations:\x20','no_context','description','\x0a✔\x20Pulled\x20','agent:push','\x20\x20Agent\x20\x22','<new-name>','Project:\x20','Errors:','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','knowledgeBases','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','outputPath','red','site','Status:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x0aWrite\x20','profile','formInterfaces','projectName','\x0aChanges\x20to\x20agent\x20\x27','Project\x20cloned\x20with\x20errors','\x20errors','pullProject','force','\x0aChanges:','-\x20nothing\x20pushed','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20updated','outputDir','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Using\x20context\x20project:\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','4807734tsqpZj','dryRun','cyan','\x20\x20Agents:\x20','No\x20tdx.json\x20found\x20in\x20','cwd','\x20\x20Knowledge\x20Base\x20\x22','\x20\x20Prompts:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','textKnowledgeBases','Using\x20project\x20from\x20','4471074njizrG','Failed\x20to\x20push\x20agent:\x20','execute','\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)','\x22\x20from\x20project\x20\x22','Using\x20project:\x20','gray','\x20changed','INVALID_ARGUMENT','\x20\x20Experimental\x20Artifacts:\x20','48YjfDFl','\x20successfully','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','llmProject','\x0a✔\x20Pushed\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','agentId','\x20=\x20','counts','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Chat:\x20','Cancelled','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','context'];a4_0xa0c9=function(){return _0x6041f7;};return a4_0xa0c9();}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';[a4_0x4a2739(0x209)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x4a2739(0x236)](_0x8d8424){const _0xf2c43b=a4_0x4a2739,{options:_0x2b9ae7,args:_0x432a44,tdx:_0x1ed47d}=_0x8d8424,_0x16583e=_0x432a44[0x0],_0x37bfee=_0x432a44[0x1],_0x5db0f7=_0x2b9ae7['output'],_0x34d250=_0x2b9ae7[_0xf2c43b(0x22a)],_0x8ca46c=_0x2b9ae7['force'],_0x1e3b82=_0x2b9ae7[_0xf2c43b(0x255)],_0x511b1d=_0x2b9ae7[_0xf2c43b(0x241)],_0x5c5020=_0x2b9ae7[_0xf2c43b(0x1c2)];let _0x31aad4;if(_0x16583e){const _0x172b6f=a4_0x4bfe75['join'](_0x16583e,_0xf2c43b(0x24d));if(existsSync(_0x172b6f))try{const _0x58bfe6=JSON['parse'](readFileSync(_0x172b6f,_0xf2c43b(0x1c5)));_0x58bfe6[_0xf2c43b(0x1c0)]&&(_0x31aad4={'llm_project':_0x58bfe6['llm_project']});}catch{}}const _0x541b48=findAgentConfigPath(process[_0xf2c43b(0x22e)]());let _0x2689b6;if(_0x541b48)try{const _0x1cf63e=JSON[_0xf2c43b(0x266)](readFileSync(_0x541b48,_0xf2c43b(0x1c5)));_0x1cf63e[_0xf2c43b(0x1c0)]&&(_0x2689b6={'llm_project':_0x1cf63e[_0xf2c43b(0x1c0)]});}catch{}const _0x130856=resolveAgentPullArgs({'arg':_0x16583e,'agentNameArg':_0x37bfee,'agentFlag':_0x5c5020,'contextProject':_0x511b1d,'argDirConfig':_0x31aad4,'cwdConfigPath':_0x541b48||undefined,'cwdConfig':_0x2689b6}),{projectNameOrId:_0x102c83,targetAgentName:_0x1d8f39,existingOutputDir:_0x447333,source:_0x3f260b}=_0x130856;if(_0x3f260b===_0xf2c43b(0x27d))console[_0xf2c43b(0x272)](a4_0xeea917['dim'](_0xf2c43b(0x233)+a4_0x4bfe75[_0xf2c43b(0x200)](_0x16583e,_0xf2c43b(0x24d))+':\x20'+_0x102c83));else{if(_0x3f260b===_0xf2c43b(0x253))console[_0xf2c43b(0x272)](a4_0xeea917['dim'](_0xf2c43b(0x239)+_0x102c83));else _0x3f260b===_0xf2c43b(0x24c)&&console[_0xf2c43b(0x272)](a4_0xeea917[_0xf2c43b(0x1d6)](_0xf2c43b(0x279)+_0x102c83));}if(!_0x102c83)return _0x5c5020?(console[_0xf2c43b(0x272)](a4_0xeea917[_0xf2c43b(0x1bc)](_0xf2c43b(0x231))),console[_0xf2c43b(0x272)](_0xf2c43b(0x210)),console[_0xf2c43b(0x272)](_0xf2c43b(0x1e5))):(console[_0xf2c43b(0x272)](a4_0xeea917[_0xf2c43b(0x1bc)](_0xf2c43b(0x265))),console[_0xf2c43b(0x272)](_0xf2c43b(0x1cc)),console[_0xf2c43b(0x272)](_0xf2c43b(0x250)),console['log'](_0xf2c43b(0x1ef)),console[_0xf2c43b(0x272)](_0xf2c43b(0x26c)),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(_0x1d8f39){const {data:_0x467ed7}=await withSpinner(_0xf2c43b(0x1ca)+_0x1d8f39+_0xf2c43b(0x238)+_0x102c83+_0xf2c43b(0x205),()=>_0x1ed47d[_0xf2c43b(0x278)]['pullAgent'](_0x102c83,_0x1d8f39,_0x5db0f7,{'dryRun':_0x34d250,'force':_0x8ca46c}));if(_0x34d250)return console[_0xf2c43b(0x272)](a4_0xeea917['yellow'](_0xf2c43b(0x1ee))),console[_0xf2c43b(0x272)](_0xf2c43b(0x1e7)+_0x467ed7[_0xf2c43b(0x1eb)]),console[_0xf2c43b(0x272)](_0xf2c43b(0x1d7)+_0x467ed7[_0xf2c43b(0x213)]),_0x467ed7[_0xf2c43b(0x1d0)]&&(console[_0xf2c43b(0x272)](_0xf2c43b(0x221)),console[_0xf2c43b(0x272)]('─'[_0xf2c43b(0x1be)](0x3c)),console[_0xf2c43b(0x272)](_0x467ed7[_0xf2c43b(0x1d0)]),console['log']('─'[_0xf2c43b(0x1be)](0x3c))),0x0;return console['log'](a4_0xeea917[_0xf2c43b(0x1f4)]('Agent\x20pulled\x20successfully')),console[_0xf2c43b(0x272)]('Agent:\x20'+_0x467ed7['agentName']),console[_0xf2c43b(0x272)](_0xf2c43b(0x1ce)+_0x467ed7[_0xf2c43b(0x213)]),console[_0xf2c43b(0x272)](_0xf2c43b(0x216)+(_0x467ed7[_0xf2c43b(0x1ff)]?a4_0xeea917[_0xf2c43b(0x1f4)](_0xf2c43b(0x1e6)):_0x467ed7['hasChanges']?a4_0xeea917[_0xf2c43b(0x1bc)](_0xf2c43b(0x25e)):a4_0xeea917[_0xf2c43b(0x23a)](_0xf2c43b(0x254)))),0x0;}const _0x1e2255=_0x447333||_0x5db0f7,{data:_0x343848}=await withSpinner(_0xf2c43b(0x263)+_0x102c83+_0xf2c43b(0x205),()=>_0x1ed47d['llm'][_0xf2c43b(0x21f)](_0x102c83,_0x1e2255,{'dryRun':!![]})),_0x2302dc=_0x343848[_0xf2c43b(0x247)]['agents'][_0xf2c43b(0x1e6)]+_0x343848['counts'][_0xf2c43b(0x211)]['new']+_0x343848[_0xf2c43b(0x247)][_0xf2c43b(0x232)][_0xf2c43b(0x1e6)]+_0x343848['counts'][_0xf2c43b(0x25b)][_0xf2c43b(0x1e6)]+_0x343848[_0xf2c43b(0x247)]['integrations'][_0xf2c43b(0x1e6)]+_0x343848[_0xf2c43b(0x247)][_0xf2c43b(0x1f9)][_0xf2c43b(0x1e6)]+_0x343848[_0xf2c43b(0x247)][_0xf2c43b(0x1c1)]['new']+_0x343848['counts'][_0xf2c43b(0x21a)][_0xf2c43b(0x1e6)]+_0x343848[_0xf2c43b(0x247)][_0xf2c43b(0x1d9)][_0xf2c43b(0x1e6)],_0x58bf1d=_0x343848['counts'][_0xf2c43b(0x27e)]['updated']+_0x343848[_0xf2c43b(0x247)][_0xf2c43b(0x211)][_0xf2c43b(0x25e)]+_0x343848[_0xf2c43b(0x247)][_0xf2c43b(0x232)][_0xf2c43b(0x25e)]+_0x343848[_0xf2c43b(0x247)][_0xf2c43b(0x25b)][_0xf2c43b(0x25e)]+_0x343848['counts'][_0xf2c43b(0x1dc)][_0xf2c43b(0x25e)]+_0x343848[_0xf2c43b(0x247)][_0xf2c43b(0x1f9)][_0xf2c43b(0x25e)]+_0x343848[_0xf2c43b(0x247)][_0xf2c43b(0x1c1)][_0xf2c43b(0x25e)]+_0x343848[_0xf2c43b(0x247)][_0xf2c43b(0x21a)][_0xf2c43b(0x25e)]+_0x343848[_0xf2c43b(0x247)][_0xf2c43b(0x1d9)][_0xf2c43b(0x25e)],_0x50a1b4=_0x343848[_0xf2c43b(0x247)][_0xf2c43b(0x27e)][_0xf2c43b(0x254)]+_0x343848[_0xf2c43b(0x247)][_0xf2c43b(0x211)][_0xf2c43b(0x254)]+_0x343848['counts']['textKnowledgeBases'][_0xf2c43b(0x254)]+_0x343848[_0xf2c43b(0x247)][_0xf2c43b(0x25b)][_0xf2c43b(0x254)]+_0x343848[_0xf2c43b(0x247)][_0xf2c43b(0x1dc)][_0xf2c43b(0x254)]+_0x343848[_0xf2c43b(0x247)]['experimentalKnowledgeBases']['unchanged']+_0x343848[_0xf2c43b(0x247)][_0xf2c43b(0x1c1)]['unchanged']+_0x343848[_0xf2c43b(0x247)][_0xf2c43b(0x21a)][_0xf2c43b(0x254)]+_0x343848[_0xf2c43b(0x247)]['chatInterfaces'][_0xf2c43b(0x254)];console[_0xf2c43b(0x272)](_0xf2c43b(0x261)+_0x343848[_0xf2c43b(0x21b)]+'\x27:'),console[_0xf2c43b(0x272)]('\x20\x20'+a4_0xeea917['green']('+\x20'+_0x2302dc+'\x20new')+_0xf2c43b(0x274)+a4_0xeea917['yellow']('~\x20'+_0x58bf1d+_0xf2c43b(0x23b))+_0xf2c43b(0x274)+a4_0xeea917[_0xf2c43b(0x1d6)]('=\x20'+_0x50a1b4+_0xf2c43b(0x257))),console[_0xf2c43b(0x272)](_0xf2c43b(0x22c)+formatCountSummary(_0x343848[_0xf2c43b(0x247)][_0xf2c43b(0x27e)])),console['log'](_0xf2c43b(0x27a)+formatCountSummary(_0x343848['counts']['knowledgeBases'])),console[_0xf2c43b(0x272)](_0xf2c43b(0x1e8)+formatCountSummary(_0x343848[_0xf2c43b(0x247)][_0xf2c43b(0x232)])),console['log'](_0xf2c43b(0x230)+formatCountSummary(_0x343848[_0xf2c43b(0x247)][_0xf2c43b(0x25b)])),console[_0xf2c43b(0x272)](_0xf2c43b(0x207)+formatCountSummary(_0x343848[_0xf2c43b(0x247)][_0xf2c43b(0x1dc)])),console[_0xf2c43b(0x272)](_0xf2c43b(0x25a)+formatCountSummary(_0x343848[_0xf2c43b(0x247)][_0xf2c43b(0x21a)])),console[_0xf2c43b(0x272)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x343848[_0xf2c43b(0x247)][_0xf2c43b(0x1d9)]));const _0x2cd794=_0x343848['counts'][_0xf2c43b(0x1f9)][_0xf2c43b(0x1e1)]>0x0||_0x343848[_0xf2c43b(0x247)]['experimentalArtifacts'][_0xf2c43b(0x1e1)]>0x0;_0x2cd794&&(console[_0xf2c43b(0x272)](_0xf2c43b(0x223)+formatCountSummary(_0x343848['counts'][_0xf2c43b(0x1f9)])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x343848[_0xf2c43b(0x247)]['experimentalArtifacts'])));console[_0xf2c43b(0x272)](_0xf2c43b(0x1fd)+a4_0xeea917[_0xf2c43b(0x22b)](_0x343848[_0xf2c43b(0x225)])),displayDiffs(_0x343848[_0xf2c43b(0x27e)],_0x343848[_0xf2c43b(0x211)],_0x343848[_0xf2c43b(0x232)],_0x343848[_0xf2c43b(0x25b)],_0x343848[_0xf2c43b(0x1dc)],_0x343848[_0xf2c43b(0x1f9)],_0x343848['experimentalArtifacts'],_0x343848['formInterfaces'],_0x343848[_0xf2c43b(0x1d9)]);if(_0x34d250)return console[_0xf2c43b(0x272)](a4_0xeea917[_0xf2c43b(0x1bc)](_0xf2c43b(0x212))),0x0;if(_0x2302dc===0x0&&_0x58bf1d===0x0)return console[_0xf2c43b(0x272)](a4_0xeea917[_0xf2c43b(0x1f4)](_0xf2c43b(0x24e))),saveSessionContext({'llm_project':_0x343848[_0xf2c43b(0x21b)]},_0x2b9ae7[_0xf2c43b(0x25c)]),console[_0xf2c43b(0x272)](a4_0xeea917['green']('✔\x20Context\x20set:\x20'+a4_0xeea917[_0xf2c43b(0x1d6)](_0xf2c43b(0x1c0))+_0xf2c43b(0x246)+a4_0xeea917['cyan'](_0x343848[_0xf2c43b(0x21b)]))),0x0;if(!_0x1e3b82&&!_0x8ca46c){if(!isInteractive())return console[_0xf2c43b(0x1d5)](a4_0xeea917[_0xf2c43b(0x214)](_0xf2c43b(0x27f)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xf2c43b(0x1d5)](a4_0xeea917[_0xf2c43b(0x1d6)](_0xf2c43b(0x240))),0x1;const _0x3afa0f=await confirmKey(_0xf2c43b(0x218)+(_0x2302dc+_0x58bf1d)+_0xf2c43b(0x1c7));if(!_0x3afa0f)return console['log'](a4_0xeea917[_0xf2c43b(0x1bc)]('Cancelled'),_0xf2c43b(0x1d4)),0x1;}const {data:_0x2fdd45}=await withSpinner(_0xf2c43b(0x26a),()=>_0x1ed47d[_0xf2c43b(0x278)]['pullProject'](_0x102c83,_0x1e2255,{'force':_0x8ca46c}));return console['log'](a4_0xeea917[_0xf2c43b(0x1f4)](_0xf2c43b(0x20a)+(_0x2302dc+_0x58bf1d)+'\x20files\x20to\x20'+_0x2fdd45[_0xf2c43b(0x225)])),saveSessionContext({'llm_project':_0x2fdd45[_0xf2c43b(0x21b)]},_0x2b9ae7[_0xf2c43b(0x25c)]),console[_0xf2c43b(0x272)](a4_0xeea917[_0xf2c43b(0x1f4)](_0xf2c43b(0x1de)+a4_0xeea917['dim'](_0xf2c43b(0x1c0))+_0xf2c43b(0x246)+a4_0xeea917[_0xf2c43b(0x22b)](_0x2fdd45[_0xf2c43b(0x21b)]))),0x0;}}function a4_0x29e0(_0x12b901,_0x3250e8){_0x12b901=_0x12b901-0x1bc;const _0xa0c974=a4_0xa0c9();let _0x29e01e=_0xa0c974[_0x12b901];return _0x29e01e;}export class AgentCloneCommand extends BaseCommand{[a4_0x4a2739(0x1f8)]='agent:clone';[a4_0x4a2739(0x209)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x4a2739(0x236)](_0x39b876){const _0x1194ea=a4_0x4a2739,{options:_0xe508b1,args:_0x57ee1a,tdx:_0x2e800b}=_0x39b876,_0x10b2ff=_0x57ee1a[0x0],_0x28b624=_0xe508b1[_0x1194ea(0x1f8)],_0x498492=_0xe508b1[_0x1194ea(0x22a)],_0x501787=_0xe508b1[_0x1194ea(0x255)],_0x28caba=_0xe508b1[_0x1194ea(0x215)],_0x348856=_0xe508b1[_0x1194ea(0x241)];let _0x5eda4f;const _0x5d5276=findAgentConfigPath(process[_0x1194ea(0x22e)]());if(_0x10b2ff){const _0x98a578=a4_0x4bfe75[_0x1194ea(0x200)](_0x10b2ff,_0x1194ea(0x24d));existsSync(_0x98a578)?(_0x5eda4f=_0x10b2ff,console[_0x1194ea(0x272)](a4_0xeea917['dim'](_0x1194ea(0x1cb)+_0x10b2ff))):_0x5eda4f=_0x10b2ff;}else{if(_0x5d5276)_0x5eda4f=a4_0x4bfe75[_0x1194ea(0x276)](_0x5d5276),console[_0x1194ea(0x272)](a4_0xeea917[_0x1194ea(0x1d6)](_0x1194ea(0x256)+_0x5eda4f));else{if(_0x348856){const _0x154406=sanitizeForFilesystem(_0x348856);let _0x944015=_0x154406,_0x3b9ab8=a4_0x4bfe75[_0x1194ea(0x200)](process['cwd'](),_0x1194ea(0x27e),_0x154406,_0x1194ea(0x24d));if(!existsSync(_0x3b9ab8)){const _0x48ca4b=normalizeName(_0x348856),_0x2e4cf1=a4_0x4bfe75[_0x1194ea(0x200)](process[_0x1194ea(0x22e)](),'agents',_0x48ca4b,_0x1194ea(0x24d));existsSync(_0x2e4cf1)&&(_0x944015=_0x48ca4b,_0x3b9ab8=_0x2e4cf1);}if(existsSync(_0x3b9ab8))_0x5eda4f=a4_0x4bfe75[_0x1194ea(0x276)](_0x3b9ab8),console[_0x1194ea(0x272)](a4_0xeea917['dim'](_0x1194ea(0x1cb)+_0x5eda4f));else{const _0xfe1c29=_0xe508b1[_0x1194ea(0x219)];if(_0xfe1c29)throw new SDKError(ErrorCode[_0x1194ea(0x23c)],_0x1194ea(0x1f2)+_0x348856+_0x1194ea(0x1fc),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x1194ea(0x1c6)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x348856+'\x0a')+(_0x1194ea(0x243)+_0x944015+_0x1194ea(0x1d3)+(_0x28b624||_0x1194ea(0x20d))+_0x1194ea(0x251)+_0xfe1c29)});_0x5eda4f=_0x348856,console[_0x1194ea(0x272)](a4_0xeea917[_0x1194ea(0x1d6)](_0x1194ea(0x227)+_0x348856));}}}}if(!_0x5eda4f)return console[_0x1194ea(0x272)](a4_0xeea917[_0x1194ea(0x1bc)](_0x1194ea(0x1fb))),console[_0x1194ea(0x272)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x1194ea(0x272)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x1194ea(0x272)](_0x1194ea(0x237)),console[_0x1194ea(0x272)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x28b624)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x1194ea(0x26f),undefined,{'helpText':_0x1194ea(0x248)});if(!_0x501787&&!_0x498492){if(!isInteractive())return console[_0x1194ea(0x1d5)](a4_0xeea917[_0x1194ea(0x214)](_0x1194ea(0x27f)),_0x1194ea(0x27b)),console['error'](a4_0xeea917[_0x1194ea(0x1d6)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x19b7aa=await confirmKey(_0x1194ea(0x273)+_0x5eda4f+'\x22\x20to\x20new\x20project\x20\x22'+_0x28b624+'\x22?');if(!_0x19b7aa)return console[_0x1194ea(0x272)](a4_0xeea917[_0x1194ea(0x1bc)](_0x1194ea(0x24a))),0x1;}const {data:_0x4e9812}=await withSpinner(_0x1194ea(0x1f0)+_0x5eda4f+_0x1194ea(0x259)+_0x28b624+_0x1194ea(0x205),()=>_0x2e800b[_0x1194ea(0x278)][_0x1194ea(0x1e3)](_0x5eda4f,_0x28b624,{'dryRun':_0x498492}));if(_0x498492){console[_0x1194ea(0x272)](a4_0xeea917[_0x1194ea(0x1bc)](_0x1194ea(0x258))),console[_0x1194ea(0x272)](_0x1194ea(0x1e9)+_0x4e9812['sourceProjectName']),console['log'](_0x1194ea(0x1f5)+_0x28b624),console['log'](_0x1194ea(0x1ed)),console['log'](_0x1194ea(0x22c)+_0x4e9812['counts'][_0x1194ea(0x27e)][_0x1194ea(0x1cf)]),console['log'](_0x1194ea(0x27a)+_0x4e9812[_0x1194ea(0x247)]['knowledgeBases'][_0x1194ea(0x1cf)]),console[_0x1194ea(0x272)](_0x1194ea(0x230)+_0x4e9812['counts'][_0x1194ea(0x25b)]['created']),console['log'](_0x1194ea(0x25a)+_0x4e9812[_0x1194ea(0x247)][_0x1194ea(0x21a)][_0x1194ea(0x1cf)]),console[_0x1194ea(0x272)]('\x20\x20Chat\x20Interfaces:\x20'+_0x4e9812[_0x1194ea(0x247)][_0x1194ea(0x1d9)]['created']);const _0x281c1c=_0x4e9812[_0x1194ea(0x247)][_0x1194ea(0x1f9)][_0x1194ea(0x1cf)]>0x0||_0x4e9812[_0x1194ea(0x247)]['experimentalArtifacts'][_0x1194ea(0x1cf)]>0x0;return _0x281c1c&&(console['log'](_0x1194ea(0x223)+_0x4e9812[_0x1194ea(0x247)][_0x1194ea(0x1f9)][_0x1194ea(0x1cf)]),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+_0x4e9812[_0x1194ea(0x247)]['experimentalArtifacts'][_0x1194ea(0x1cf)])),0x0;}const _0x45acb8=_0x4e9812[_0x1194ea(0x247)][_0x1194ea(0x27e)]['errors']>0x0||_0x4e9812['counts'][_0x1194ea(0x211)][_0x1194ea(0x1df)]>0x0||_0x4e9812[_0x1194ea(0x247)][_0x1194ea(0x25b)][_0x1194ea(0x1df)]>0x0||_0x4e9812[_0x1194ea(0x247)][_0x1194ea(0x21a)][_0x1194ea(0x1df)]>0x0||_0x4e9812[_0x1194ea(0x247)][_0x1194ea(0x1d9)]['errors']>0x0||_0x4e9812['counts'][_0x1194ea(0x1f9)][_0x1194ea(0x1df)]>0x0||_0x4e9812[_0x1194ea(0x247)]['experimentalArtifacts']['errors']>0x0;_0x45acb8?console['log'](a4_0xeea917[_0x1194ea(0x1bc)](_0x1194ea(0x21d))):console[_0x1194ea(0x272)](a4_0xeea917[_0x1194ea(0x1f4)]('Project\x20cloned\x20successfully'));console[_0x1194ea(0x272)]('Source:\x20'+_0x4e9812['sourceProjectName']),console['log'](_0x1194ea(0x1f5)+_0x4e9812['newProjectName']),console[_0x1194ea(0x272)](_0x1194ea(0x277)+_0x4e9812[_0x1194ea(0x1d1)]),console['log'](),console[_0x1194ea(0x272)](_0x1194ea(0x1c4)),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x4e9812[_0x1194ea(0x247)][_0x1194ea(0x27e)])),console[_0x1194ea(0x272)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4e9812['counts'][_0x1194ea(0x211)])),console[_0x1194ea(0x272)](_0x1194ea(0x230)+formatCountSummary(_0x4e9812['counts'][_0x1194ea(0x25b)])),console[_0x1194ea(0x272)](_0x1194ea(0x207)+formatCountSummary(_0x4e9812['counts'][_0x1194ea(0x1dc)])),console[_0x1194ea(0x272)](_0x1194ea(0x25a)+formatCountSummary(_0x4e9812[_0x1194ea(0x247)][_0x1194ea(0x21a)])),console[_0x1194ea(0x272)](_0x1194ea(0x26b)+formatCountSummary(_0x4e9812[_0x1194ea(0x247)][_0x1194ea(0x1d9)]));const _0x351cfa=_0x4e9812['counts'][_0x1194ea(0x1f9)][_0x1194ea(0x1cf)]>0x0||_0x4e9812[_0x1194ea(0x247)][_0x1194ea(0x1f9)][_0x1194ea(0x25e)]>0x0||_0x4e9812[_0x1194ea(0x247)][_0x1194ea(0x1f9)][_0x1194ea(0x254)]>0x0||_0x4e9812['counts'][_0x1194ea(0x1c1)][_0x1194ea(0x1cf)]>0x0||_0x4e9812[_0x1194ea(0x247)][_0x1194ea(0x1c1)]['updated']>0x0||_0x4e9812[_0x1194ea(0x247)][_0x1194ea(0x1c1)][_0x1194ea(0x254)]>0x0;_0x351cfa&&(console[_0x1194ea(0x272)](_0x1194ea(0x223)+formatCountSummary(_0x4e9812[_0x1194ea(0x247)]['experimentalKnowledgeBases'])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x4e9812[_0x1194ea(0x247)][_0x1194ea(0x1c1)])));if(_0x45acb8){console[_0x1194ea(0x272)](),console[_0x1194ea(0x272)](a4_0xeea917['red']('Errors:'));for(const _0x38729f of _0x4e9812[_0x1194ea(0x27e)]){_0x38729f[_0x1194ea(0x1fe)]==='error'&&console[_0x1194ea(0x272)](a4_0xeea917[_0x1194ea(0x214)]('\x20\x20Agent\x20\x22'+_0x38729f[_0x1194ea(0x1eb)]+_0x1194ea(0x1f1)+_0x38729f[_0x1194ea(0x1d5)]));}for(const _0x28076a of _0x4e9812['knowledgeBases']){_0x28076a['action']===_0x1194ea(0x1d5)&&console['log'](a4_0xeea917[_0x1194ea(0x214)](_0x1194ea(0x22f)+_0x28076a[_0x1194ea(0x1f8)]+_0x1194ea(0x1f1)+_0x28076a['error']));}for(const _0x9427b3 of _0x4e9812[_0x1194ea(0x25b)]){_0x9427b3[_0x1194ea(0x1fe)]==='error'&&console[_0x1194ea(0x272)](a4_0xeea917['red'](_0x1194ea(0x1c3)+_0x9427b3[_0x1194ea(0x1f8)]+_0x1194ea(0x1f1)+_0x9427b3[_0x1194ea(0x1d5)]));}for(const _0x1b5a50 of _0x4e9812[_0x1194ea(0x1dc)]){_0x1b5a50[_0x1194ea(0x1fe)]===_0x1194ea(0x1d5)&&console[_0x1194ea(0x272)](a4_0xeea917[_0x1194ea(0x214)](_0x1194ea(0x1d8)+_0x1b5a50[_0x1194ea(0x1f8)]+_0x1194ea(0x1f1)+_0x1b5a50[_0x1194ea(0x1d5)]));}for(const _0x344082 of _0x4e9812[_0x1194ea(0x21a)]){_0x344082[_0x1194ea(0x1fe)]===_0x1194ea(0x1d5)&&console[_0x1194ea(0x272)](a4_0xeea917[_0x1194ea(0x214)](_0x1194ea(0x25f)+_0x344082[_0x1194ea(0x1f8)]+'\x22:\x20'+_0x344082[_0x1194ea(0x1d5)]));}for(const _0x1eb303 of _0x4e9812[_0x1194ea(0x1d9)]){_0x1eb303[_0x1194ea(0x1fe)]===_0x1194ea(0x1d5)&&console[_0x1194ea(0x272)](a4_0xeea917[_0x1194ea(0x214)](_0x1194ea(0x1dd)+_0x1eb303[_0x1194ea(0x1f8)]+_0x1194ea(0x1f1)+_0x1eb303[_0x1194ea(0x1d5)]));}for(const _0x587158 of _0x4e9812[_0x1194ea(0x1f9)]){_0x587158[_0x1194ea(0x1fe)]===_0x1194ea(0x1d5)&&console[_0x1194ea(0x272)](a4_0xeea917[_0x1194ea(0x214)](_0x1194ea(0x1c9)+_0x587158[_0x1194ea(0x1f8)]+_0x1194ea(0x1f1)+_0x587158[_0x1194ea(0x1d5)]));}for(const _0x5677e4 of _0x4e9812[_0x1194ea(0x1c1)]){_0x5677e4[_0x1194ea(0x1fe)]===_0x1194ea(0x1d5)&&console[_0x1194ea(0x272)](a4_0xeea917[_0x1194ea(0x214)](_0x1194ea(0x1da)+_0x5677e4[_0x1194ea(0x1f8)]+'\x22:\x20'+_0x5677e4[_0x1194ea(0x1d5)]));}return 0x1;}console[_0x1194ea(0x272)]();const _0x31b365=getLLMProjectUrl(_0x28caba,_0x4e9812[_0x1194ea(0x1d1)]);return console[_0x1194ea(0x272)](_0x1194ea(0x20e)+a4_0xeea917[_0x1194ea(0x22b)](_0x31b365)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x4a2739(0x1f8)]=a4_0x4a2739(0x20b);[a4_0x4a2739(0x209)]=a4_0x4a2739(0x24b);async['execute'](_0x5719df){const _0x50e551=a4_0x4a2739,{options:_0x58898b,args:_0x1ae1df,tdx:_0x4483a9}=_0x5719df;let _0x7603e6=_0x1ae1df[0x0]||process[_0x50e551(0x22e)]();const _0x2f5b5f=_0x58898b['dryRun'],_0x4746f4=_0x58898b[_0x50e551(0x220)],_0x1eef06=_0x58898b[_0x50e551(0x255)],_0x5311b4=_0x58898b[_0x50e551(0x215)],_0x540ead=a4_0x4bfe75[_0x50e551(0x200)](_0x7603e6,_0x50e551(0x27c)),_0x28df90=existsSync(_0x540ead);if(_0x28df90){const {data:_0x1045cd}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x7603e6+_0x50e551(0x205),()=>_0x4483a9[_0x50e551(0x278)][_0x50e551(0x1f7)](_0x7603e6,{'dryRun':_0x2f5b5f,'force':_0x4746f4}));if(_0x2f5b5f)return console[_0x50e551(0x272)](a4_0xeea917[_0x50e551(0x1bc)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console['log'](_0x50e551(0x268)+_0x1045cd[_0x50e551(0x1eb)]),0x0;if(_0x1045cd['action']===_0x50e551(0x1d5))return console[_0x50e551(0x272)](a4_0xeea917[_0x50e551(0x214)](_0x50e551(0x235)+_0x1045cd['error'])),0x1;console[_0x50e551(0x272)](a4_0xeea917[_0x50e551(0x1f4)]('Agent\x20'+_0x1045cd[_0x50e551(0x1fe)]+_0x50e551(0x23f))),console[_0x50e551(0x272)]('Agent:\x20'+_0x1045cd[_0x50e551(0x1eb)]);if(_0x1045cd['agentId']&&_0x1045cd[_0x50e551(0x1cd)]){const _0x5f5b38=getLLMAgentChatUrl(_0x5311b4,_0x1045cd['projectId'],_0x1045cd[_0x50e551(0x245)]);console[_0x50e551(0x272)](_0x50e551(0x249)+a4_0xeea917[_0x50e551(0x22b)](_0x5f5b38));}return 0x0;}const _0x2ceeae=_0x58898b[_0x50e551(0x241)],_0x3ebd17=resolveProjectFromContext(_0x7603e6,_0x2ceeae);if(_0x3ebd17[_0x50e551(0x267)])_0x7603e6=_0x3ebd17[_0x50e551(0x270)],_0x3ebd17[_0x50e551(0x269)]===_0x50e551(0x24c)&&console[_0x50e551(0x272)](a4_0xeea917[_0x50e551(0x1d6)]('Using\x20project:\x20'+_0x7603e6));else{let _0x3307ba=_0x50e551(0x1f3);_0x3ebd17[_0x50e551(0x1f6)]===_0x50e551(0x280)&&(_0x3307ba=_0x3ebd17['message']+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x3ebd17['llmProject']+_0x50e551(0x264));throw new SDKError(ErrorCode[_0x50e551(0x23c)],_0x3ebd17['reason']===_0x50e551(0x208)?_0x3ebd17['message']:_0x50e551(0x22d)+_0x7603e6,undefined,{'helpText':_0x3307ba});}const {data:_0x51740b}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x4483a9['llm'][_0x50e551(0x1e4)](_0x7603e6,{'dryRun':!![]})),_0x227c1f=_0x51740b[_0x50e551(0x247)][_0x50e551(0x27e)]['errors']>0x0;if(_0x227c1f){console[_0x50e551(0x272)](a4_0xeea917['red'](_0x50e551(0x262)));for(const _0x34d0f1 of _0x51740b['agents']){_0x34d0f1[_0x50e551(0x1fe)]===_0x50e551(0x1d5)&&console[_0x50e551(0x272)](a4_0xeea917[_0x50e551(0x214)](_0x50e551(0x20c)+_0x34d0f1['agentName']+_0x50e551(0x1f1)+_0x34d0f1[_0x50e551(0x1d5)]));}return 0x1;}const _0x491d3d=_0x51740b[_0x50e551(0x247)][_0x50e551(0x27e)][_0x50e551(0x1cf)]+_0x51740b['counts'][_0x50e551(0x211)]['created']+_0x51740b[_0x50e551(0x247)][_0x50e551(0x232)]['created']+_0x51740b[_0x50e551(0x247)]['prompts']['created']+_0x51740b['counts']['integrations']['created']+_0x51740b['counts']['experimentalKnowledgeBases']['created']+_0x51740b[_0x50e551(0x247)]['experimentalArtifacts'][_0x50e551(0x1cf)]+_0x51740b[_0x50e551(0x247)][_0x50e551(0x21a)][_0x50e551(0x1cf)]+_0x51740b[_0x50e551(0x247)][_0x50e551(0x1d9)][_0x50e551(0x1cf)],_0x22dca2=_0x51740b[_0x50e551(0x247)][_0x50e551(0x27e)][_0x50e551(0x25e)]+_0x51740b[_0x50e551(0x247)][_0x50e551(0x211)][_0x50e551(0x25e)]+_0x51740b[_0x50e551(0x247)][_0x50e551(0x232)][_0x50e551(0x25e)]+_0x51740b[_0x50e551(0x247)][_0x50e551(0x25b)]['updated']+_0x51740b[_0x50e551(0x247)][_0x50e551(0x1dc)][_0x50e551(0x25e)]+_0x51740b[_0x50e551(0x247)]['experimentalKnowledgeBases'][_0x50e551(0x25e)]+_0x51740b['counts']['experimentalArtifacts'][_0x50e551(0x25e)]+_0x51740b[_0x50e551(0x247)][_0x50e551(0x21a)]['updated']+_0x51740b['counts'][_0x50e551(0x1d9)][_0x50e551(0x25e)],_0xcdfa0=_0x51740b[_0x50e551(0x247)][_0x50e551(0x27e)][_0x50e551(0x254)]+_0x51740b[_0x50e551(0x247)][_0x50e551(0x211)][_0x50e551(0x254)]+_0x51740b['counts'][_0x50e551(0x232)][_0x50e551(0x254)]+_0x51740b[_0x50e551(0x247)][_0x50e551(0x25b)][_0x50e551(0x254)]+_0x51740b['counts'][_0x50e551(0x1dc)]['unchanged']+_0x51740b[_0x50e551(0x247)]['experimentalKnowledgeBases']['unchanged']+_0x51740b['counts'][_0x50e551(0x1c1)][_0x50e551(0x254)]+_0x51740b[_0x50e551(0x247)]['formInterfaces'][_0x50e551(0x254)]+_0x51740b['counts']['chatInterfaces']['unchanged'];console[_0x50e551(0x272)](_0x50e551(0x26e)+_0x51740b[_0x50e551(0x21b)]+'\x27:'),console[_0x50e551(0x272)]('\x20\x20'+a4_0xeea917[_0x50e551(0x1f4)]('+\x20'+_0x491d3d+_0x50e551(0x1fa))+_0x50e551(0x274)+a4_0xeea917[_0x50e551(0x1bc)]('~\x20'+_0x22dca2+_0x50e551(0x23b))+_0x50e551(0x274)+a4_0xeea917[_0x50e551(0x1d6)]('=\x20'+_0xcdfa0+_0x50e551(0x257))),console[_0x50e551(0x272)](_0x50e551(0x22c)+formatCountSummary(_0x51740b[_0x50e551(0x247)][_0x50e551(0x27e)])),console[_0x50e551(0x272)](_0x50e551(0x27a)+formatCountSummary(_0x51740b['counts'][_0x50e551(0x211)])),console[_0x50e551(0x272)](_0x50e551(0x1e8)+formatCountSummary(_0x51740b[_0x50e551(0x247)][_0x50e551(0x232)])),console[_0x50e551(0x272)](_0x50e551(0x230)+formatCountSummary(_0x51740b['counts'][_0x50e551(0x25b)])),console[_0x50e551(0x272)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x51740b[_0x50e551(0x247)][_0x50e551(0x1dc)])),console[_0x50e551(0x272)](_0x50e551(0x25a)+formatCountSummary(_0x51740b[_0x50e551(0x247)]['formInterfaces'])),console[_0x50e551(0x272)](_0x50e551(0x26b)+formatCountSummary(_0x51740b['counts'][_0x50e551(0x1d9)]));const _0x4d8988=_0x51740b[_0x50e551(0x247)][_0x50e551(0x1f9)]['created']>0x0||_0x51740b[_0x50e551(0x247)]['experimentalKnowledgeBases'][_0x50e551(0x25e)]>0x0||_0x51740b[_0x50e551(0x247)][_0x50e551(0x1f9)]['unchanged']>0x0||_0x51740b[_0x50e551(0x247)][_0x50e551(0x1c1)][_0x50e551(0x1cf)]>0x0||_0x51740b['counts'][_0x50e551(0x1c1)][_0x50e551(0x25e)]>0x0||_0x51740b[_0x50e551(0x247)][_0x50e551(0x1c1)]['unchanged']>0x0;_0x4d8988&&(console['log'](_0x50e551(0x223)+formatCountSummary(_0x51740b[_0x50e551(0x247)][_0x50e551(0x1f9)])),console[_0x50e551(0x272)](_0x50e551(0x23d)+formatCountSummary(_0x51740b[_0x50e551(0x247)]['experimentalArtifacts'])));console[_0x50e551(0x272)](_0x50e551(0x204)+a4_0xeea917[_0x50e551(0x22b)](_0x7603e6)),displayDiffs(_0x51740b['agents'],_0x51740b[_0x50e551(0x211)],_0x51740b['textKnowledgeBases'],_0x51740b['prompts'],_0x51740b['integrations'],_0x51740b[_0x50e551(0x1f9)],_0x51740b[_0x50e551(0x1c1)],_0x51740b[_0x50e551(0x21a)],_0x51740b[_0x50e551(0x1d9)]);if(_0x2f5b5f)return console[_0x50e551(0x272)](a4_0xeea917['yellow'](_0x50e551(0x252))),0x0;if(_0x491d3d===0x0&&_0x22dca2===0x0){console['log'](a4_0xeea917[_0x50e551(0x1f4)](_0x50e551(0x244)));const _0x4a7611=getLLMProjectUrl(_0x5311b4,_0x51740b[_0x50e551(0x1cd)]);return console[_0x50e551(0x272)](_0x50e551(0x20e)+a4_0xeea917['cyan'](_0x4a7611)),0x0;}if(!_0x1eef06&&!_0x4746f4){if(!isInteractive())return console['error'](a4_0xeea917[_0x50e551(0x214)](_0x50e551(0x27f)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x50e551(0x1d5)](a4_0xeea917[_0x50e551(0x1d6)](_0x50e551(0x240))),0x1;const _0x420b29=await confirmKey('\x0aPush\x20'+(_0x491d3d+_0x22dca2)+_0x50e551(0x1ec));if(!_0x420b29)return console['log'](a4_0xeea917[_0x50e551(0x1bc)](_0x50e551(0x24a)),_0x50e551(0x222)),0x1;}const {data:_0x49be20}=await withSpinner(_0x50e551(0x24f),()=>_0x4483a9[_0x50e551(0x278)]['pushProject'](_0x7603e6,{'force':_0x4746f4})),_0x35700e=_0x49be20[_0x50e551(0x247)]['agents'][_0x50e551(0x1df)]>0x0||_0x49be20[_0x50e551(0x247)][_0x50e551(0x211)][_0x50e551(0x1df)]>0x0||_0x49be20['counts'][_0x50e551(0x232)][_0x50e551(0x1df)]>0x0||_0x49be20[_0x50e551(0x247)]['prompts'][_0x50e551(0x1df)]>0x0||_0x49be20[_0x50e551(0x247)][_0x50e551(0x21a)][_0x50e551(0x1df)]>0x0||_0x49be20['counts']['chatInterfaces'][_0x50e551(0x1df)]>0x0;if(_0x35700e){console[_0x50e551(0x272)](a4_0xeea917[_0x50e551(0x1bc)]('\x0aProject\x20pushed\x20with\x20errors')),console['log'](),console[_0x50e551(0x272)](a4_0xeea917[_0x50e551(0x214)](_0x50e551(0x20f)));for(const _0x2ae765 of _0x49be20[_0x50e551(0x27e)]){_0x2ae765[_0x50e551(0x1fe)]==='error'&&console[_0x50e551(0x272)](a4_0xeea917[_0x50e551(0x214)](_0x50e551(0x20c)+_0x2ae765[_0x50e551(0x1eb)]+'\x22:\x20'+_0x2ae765[_0x50e551(0x1d5)]));}for(const _0x4912a6 of _0x49be20[_0x50e551(0x211)]){_0x4912a6[_0x50e551(0x1fe)]==='error'&&console[_0x50e551(0x272)](a4_0xeea917[_0x50e551(0x214)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x4912a6['name']+_0x50e551(0x1f1)+_0x4912a6[_0x50e551(0x1d5)]));}for(const _0x14ff1c of _0x49be20[_0x50e551(0x232)]){_0x14ff1c[_0x50e551(0x1fe)]==='error'&&console['log'](a4_0xeea917[_0x50e551(0x214)](_0x50e551(0x228)+_0x14ff1c[_0x50e551(0x1f8)]+_0x50e551(0x1f1)+_0x14ff1c[_0x50e551(0x1d5)]));}for(const _0x184ef5 of _0x49be20[_0x50e551(0x25b)]){_0x184ef5[_0x50e551(0x1fe)]===_0x50e551(0x1d5)&&console[_0x50e551(0x272)](a4_0xeea917[_0x50e551(0x214)](_0x50e551(0x1c3)+_0x184ef5[_0x50e551(0x1f8)]+_0x50e551(0x1f1)+_0x184ef5[_0x50e551(0x1d5)]));}for(const _0x5ae82d of _0x49be20['integrations']){_0x5ae82d['action']===_0x50e551(0x1d5)&&console[_0x50e551(0x272)](a4_0xeea917[_0x50e551(0x214)](_0x50e551(0x1d8)+_0x5ae82d[_0x50e551(0x1f8)]+_0x50e551(0x1f1)+_0x5ae82d[_0x50e551(0x1d5)]));}for(const _0x2dcd06 of _0x49be20[_0x50e551(0x21a)]){_0x2dcd06[_0x50e551(0x1fe)]===_0x50e551(0x1d5)&&console[_0x50e551(0x272)](a4_0xeea917[_0x50e551(0x214)](_0x50e551(0x25f)+_0x2dcd06[_0x50e551(0x1f8)]+_0x50e551(0x1f1)+_0x2dcd06[_0x50e551(0x1d5)]));}for(const _0x1a1980 of _0x49be20[_0x50e551(0x1d9)]){_0x1a1980[_0x50e551(0x1fe)]===_0x50e551(0x1d5)&&console[_0x50e551(0x272)](a4_0xeea917[_0x50e551(0x214)](_0x50e551(0x1dd)+_0x1a1980[_0x50e551(0x1f8)]+_0x50e551(0x1f1)+_0x1a1980[_0x50e551(0x1d5)]));}return 0x1;}console['log'](a4_0xeea917[_0x50e551(0x1f4)](_0x50e551(0x242)+(_0x491d3d+_0x22dca2)+_0x50e551(0x1bd)+_0x49be20['projectName']+'\x27'));const _0x131562=getLLMProjectUrl(_0x5311b4,_0x49be20[_0x50e551(0x1cd)]);return console[_0x50e551(0x272)]('Project:\x20'+a4_0xeea917[_0x50e551(0x22b)](_0x131562)),0x0;}}
1
+ const a4_0x2af299=a4_0x1cf3;(function(_0x529435,_0x2bc563){const _0x1b4ad4=a4_0x1cf3,_0x34e6dd=_0x529435();while(!![]){try{const _0x39f632=parseInt(_0x1b4ad4(0x116))/0x1+parseInt(_0x1b4ad4(0xdd))/0x2+parseInt(_0x1b4ad4(0xef))/0x3*(-parseInt(_0x1b4ad4(0x113))/0x4)+parseInt(_0x1b4ad4(0xfb))/0x5*(parseInt(_0x1b4ad4(0x11a))/0x6)+parseInt(_0x1b4ad4(0xbf))/0x7*(parseInt(_0x1b4ad4(0x127))/0x8)+-parseInt(_0x1b4ad4(0x9e))/0x9*(parseInt(_0x1b4ad4(0xd3))/0xa)+parseInt(_0x1b4ad4(0xe1))/0xb*(parseInt(_0x1b4ad4(0x12b))/0xc);if(_0x39f632===_0x2bc563)break;else _0x34e6dd['push'](_0x34e6dd['shift']());}catch(_0xc7974b){_0x34e6dd['push'](_0x34e6dd['shift']());}}}(a4_0x234c,0x9841f));import a4_0x30f3fc from'chalk';import a4_0x1e8bb5 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';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0xfdaf16){const _0x191c82=a4_0x1cf3,_0xa1b5c=[];if(_0xfdaf16['total']!==undefined)_0xa1b5c[_0x191c82(0x12e)](_0xfdaf16['total']+'\x20total');if(_0xfdaf16[_0x191c82(0x81)]!==undefined&&_0xfdaf16[_0x191c82(0x81)]>0x0)_0xa1b5c[_0x191c82(0x12e)](a4_0x30f3fc[_0x191c82(0xea)](_0xfdaf16['new']+'\x20new'));if(_0xfdaf16[_0x191c82(0xc7)]!==undefined&&_0xfdaf16[_0x191c82(0xc7)]>0x0)_0xa1b5c['push'](a4_0x30f3fc[_0x191c82(0xea)](_0xfdaf16[_0x191c82(0xc7)]+_0x191c82(0xa2)));if(_0xfdaf16['updated']!==undefined&&_0xfdaf16[_0x191c82(0x8f)]>0x0)_0xa1b5c['push'](a4_0x30f3fc['yellow'](_0xfdaf16[_0x191c82(0x8f)]+_0x191c82(0xc1)));if(_0xfdaf16[_0x191c82(0x100)]!==undefined&&_0xfdaf16[_0x191c82(0x100)]>0x0)_0xa1b5c[_0x191c82(0x12e)](a4_0x30f3fc['gray'](_0xfdaf16['unchanged']+_0x191c82(0xc5)));if(_0xfdaf16[_0x191c82(0xe5)]!==undefined&&_0xfdaf16[_0x191c82(0xe5)]>0x0)_0xa1b5c[_0x191c82(0x12e)](a4_0x30f3fc[_0x191c82(0xf9)](_0xfdaf16[_0x191c82(0xe5)]+_0x191c82(0xfe)));return _0xa1b5c[_0x191c82(0xb7)](',\x20');}function a4_0x1cf3(_0x21189c,_0x1dfbea){_0x21189c=_0x21189c-0x7b;const _0x234c19=a4_0x234c();let _0x1cf3fd=_0x234c19[_0x21189c];return _0x1cf3fd;}function displayDiffs(_0x16c78a,_0x29d813,_0x3f97e2,_0x57c017,_0x15e4a3,_0x34bd2b,_0x32b99a,_0x24528b,_0x9c74c0){const _0x1b0e55=a4_0x1cf3;for(const _0x5510c4 of _0x16c78a){if(_0x5510c4[_0x1b0e55(0x9d)]){const _0x1c731b=_0x5510c4[_0x1b0e55(0xaa)]||_0x5510c4[_0x1b0e55(0xdc)];console[_0x1b0e55(0x118)](_0x1b0e55(0xc2)+_0x1c731b+'\x27:'),console['log']('─'[_0x1b0e55(0x11e)](0x3c)),console['log'](_0x5510c4[_0x1b0e55(0x9d)]),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c));}}for(const _0x2275a6 of _0x29d813){_0x2275a6['diff']&&(console[_0x1b0e55(0x118)](_0x1b0e55(0xc0)+_0x2275a6[_0x1b0e55(0xdc)]+'\x27:'),console['log']('─'[_0x1b0e55(0x11e)](0x3c)),console[_0x1b0e55(0x118)](_0x2275a6[_0x1b0e55(0x9d)]),console[_0x1b0e55(0x118)]('─'['repeat'](0x3c)));}for(const _0xca72ff of _0x3f97e2){_0xca72ff[_0x1b0e55(0x9d)]&&(console[_0x1b0e55(0x118)](_0x1b0e55(0x10c)+_0xca72ff[_0x1b0e55(0xdc)]+'\x27:'),console[_0x1b0e55(0x118)]('─'['repeat'](0x3c)),console['log'](_0xca72ff[_0x1b0e55(0x9d)]),console['log']('─'[_0x1b0e55(0x11e)](0x3c)));}for(const _0x1b3447 of _0x57c017){_0x1b3447['diff']&&(console[_0x1b0e55(0x118)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x1b3447[_0x1b0e55(0xdc)]+'\x27:'),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c)),console['log'](_0x1b3447[_0x1b0e55(0x9d)]),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c)));}for(const _0x487bfc of _0x15e4a3){_0x487bfc[_0x1b0e55(0x9d)]&&(console['log']('\x0aChanges\x20to\x20integration\x20\x27'+_0x487bfc[_0x1b0e55(0xdc)]+'\x27:'),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c)),console[_0x1b0e55(0x118)](_0x487bfc[_0x1b0e55(0x9d)]),console['log']('─'[_0x1b0e55(0x11e)](0x3c)));}for(const _0x445ba9 of _0x34bd2b){_0x445ba9['diff']&&(console[_0x1b0e55(0x118)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x445ba9[_0x1b0e55(0xdc)]+'\x27:'),console[_0x1b0e55(0x118)]('─'['repeat'](0x3c)),console[_0x1b0e55(0x118)](_0x445ba9[_0x1b0e55(0x9d)]),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c)));}for(const _0x13f62d of _0x32b99a){_0x13f62d['diff']&&(console['log'](_0x1b0e55(0x115)+_0x13f62d['name']+'\x27:'),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c)),console[_0x1b0e55(0x118)](_0x13f62d[_0x1b0e55(0x9d)]),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c)));}for(const _0x5a9c39 of _0x24528b){_0x5a9c39[_0x1b0e55(0x9d)]&&(console['log'](_0x1b0e55(0x134)+_0x5a9c39[_0x1b0e55(0xdc)]+'\x27:'),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c)),console[_0x1b0e55(0x118)](_0x5a9c39['diff']),console[_0x1b0e55(0x118)]('─'['repeat'](0x3c)));}for(const _0x37bb2d of _0x9c74c0){_0x37bb2d[_0x1b0e55(0x9d)]&&(console[_0x1b0e55(0x118)](_0x1b0e55(0x119)+_0x37bb2d[_0x1b0e55(0xdc)]+'\x27:'),console['log']('─'[_0x1b0e55(0x11e)](0x3c)),console[_0x1b0e55(0x118)](_0x37bb2d[_0x1b0e55(0x9d)]),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';['description']=a4_0x2af299(0x7e);async[a4_0x2af299(0xfd)](_0x52ade0){const _0x6c1221=a4_0x2af299,{options:_0x33ccf4,args:_0x32795a,tdx:_0x19bd71}=_0x52ade0,_0x53f23d=_0x32795a[0x0],_0x1df724=_0x32795a[0x1],_0x38a963=_0x33ccf4['output'],_0x47b70f=_0x33ccf4[_0x6c1221(0xa7)],_0x45d7b8=_0x33ccf4['force'],_0x5b14b4=_0x33ccf4[_0x6c1221(0xec)],_0x1a212f=_0x33ccf4[_0x6c1221(0x12a)],_0x564102=_0x33ccf4[_0x6c1221(0x10d)];let _0x2d5fa8;if(_0x53f23d){const _0x4e20f7=a4_0x1e8bb5[_0x6c1221(0xb7)](_0x53f23d,'tdx.json');if(existsSync(_0x4e20f7))try{const _0x3edd22=JSON[_0x6c1221(0xb9)](readFileSync(_0x4e20f7,'utf-8'));_0x3edd22[_0x6c1221(0x92)]&&(_0x2d5fa8={'llm_project':_0x3edd22[_0x6c1221(0x92)]});}catch{}}const _0x487dab=findAgentConfigPath(process['cwd']());let _0xacf9ff;if(_0x487dab)try{const _0x1f2702=JSON['parse'](readFileSync(_0x487dab,_0x6c1221(0xc8)));_0x1f2702[_0x6c1221(0x92)]&&(_0xacf9ff={'llm_project':_0x1f2702[_0x6c1221(0x92)]});}catch{}const _0x88f71e=resolveAgentPullArgs({'arg':_0x53f23d,'agentNameArg':_0x1df724,'agentFlag':_0x564102,'contextProject':_0x1a212f,'argDirConfig':_0x2d5fa8,'cwdConfigPath':_0x487dab||undefined,'cwdConfig':_0xacf9ff}),{projectNameOrId:_0x1fb462,targetAgentName:_0x2da227,existingOutputDir:_0xb6bed2,source:_0x24d072}=_0x88f71e;if(_0x24d072==='arg-dir')console['log'](a4_0x30f3fc['dim'](_0x6c1221(0xf4)+a4_0x1e8bb5[_0x6c1221(0xb7)](_0x53f23d,_0x6c1221(0xb5))+':\x20'+_0x1fb462));else{if(_0x24d072===_0x6c1221(0x125))console['log'](a4_0x30f3fc[_0x6c1221(0x88)](_0x6c1221(0xcf)+_0x1fb462));else _0x24d072===_0x6c1221(0x85)&&console[_0x6c1221(0x118)](a4_0x30f3fc[_0x6c1221(0x88)](_0x6c1221(0x89)+_0x1fb462));}if(!_0x1fb462)return _0x564102?(console[_0x6c1221(0x118)](a4_0x30f3fc['yellow'](_0x6c1221(0xb2))),console[_0x6c1221(0x118)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console['log'](_0x6c1221(0x137))):(console[_0x6c1221(0x118)](a4_0x30f3fc[_0x6c1221(0xe4)](_0x6c1221(0x135))),console[_0x6c1221(0x118)](_0x6c1221(0xb0)),console[_0x6c1221(0x118)](_0x6c1221(0x123)),console[_0x6c1221(0x118)](_0x6c1221(0x103)),console[_0x6c1221(0x118)]('\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'),console[_0x6c1221(0x118)](_0x6c1221(0x9f))),0x1;if(_0x2da227){const {data:_0x21332c}=await withSpinner(_0x6c1221(0xf0)+_0x2da227+_0x6c1221(0x10e)+_0x1fb462+'\x22...',()=>_0x19bd71[_0x6c1221(0x129)]['pullAgent'](_0x1fb462,_0x2da227,_0x38a963,{'dryRun':_0x47b70f,'force':_0x45d7b8}));if(_0x47b70f)return console['log'](a4_0x30f3fc['yellow'](_0x6c1221(0x12d))),console[_0x6c1221(0x118)](_0x6c1221(0x86)+_0x21332c[_0x6c1221(0xaa)]),console[_0x6c1221(0x118)]('Output\x20path:\x20'+_0x21332c[_0x6c1221(0x11f)]),_0x21332c[_0x6c1221(0x9d)]&&(console[_0x6c1221(0x118)](_0x6c1221(0xe3)),console[_0x6c1221(0x118)]('─'[_0x6c1221(0x11e)](0x3c)),console[_0x6c1221(0x118)](_0x21332c[_0x6c1221(0x9d)]),console[_0x6c1221(0x118)]('─'[_0x6c1221(0x11e)](0x3c))),0x0;return console[_0x6c1221(0x118)](a4_0x30f3fc[_0x6c1221(0xea)]('Agent\x20pulled\x20successfully')),console[_0x6c1221(0x118)]('Agent:\x20'+_0x21332c[_0x6c1221(0xaa)]),console['log'](_0x6c1221(0x98)+_0x21332c[_0x6c1221(0x11f)]),console['log'](_0x6c1221(0x8c)+(_0x21332c[_0x6c1221(0xca)]?a4_0x30f3fc[_0x6c1221(0xea)](_0x6c1221(0x81)):_0x21332c[_0x6c1221(0x122)]?a4_0x30f3fc[_0x6c1221(0xe4)]('updated'):a4_0x30f3fc['gray']('unchanged'))),0x0;}const _0x107b35=_0xb6bed2||_0x38a963,{data:_0x2da2bf}=await withSpinner(_0x6c1221(0xce)+_0x1fb462+_0x6c1221(0xb8),()=>_0x19bd71[_0x6c1221(0x129)][_0x6c1221(0x7b)](_0x1fb462,_0x107b35,{'dryRun':!![]})),_0x49cef5=_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x82)][_0x6c1221(0x81)]+_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x112)]['new']+_0x2da2bf['counts'][_0x6c1221(0xf2)][_0x6c1221(0x81)]+_0x2da2bf['counts'][_0x6c1221(0xe0)][_0x6c1221(0x81)]+_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x8b)][_0x6c1221(0x81)]+_0x2da2bf[_0x6c1221(0x108)]['experimentalKnowledgeBases'][_0x6c1221(0x81)]+_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x10a)]['new']+_0x2da2bf[_0x6c1221(0x108)]['formInterfaces'][_0x6c1221(0x81)]+_0x2da2bf['counts'][_0x6c1221(0x8d)][_0x6c1221(0x81)],_0x8b3201=_0x2da2bf['counts'][_0x6c1221(0x82)]['updated']+_0x2da2bf['counts']['knowledgeBases'][_0x6c1221(0x8f)]+_0x2da2bf['counts']['textKnowledgeBases'][_0x6c1221(0x8f)]+_0x2da2bf[_0x6c1221(0x108)]['prompts']['updated']+_0x2da2bf['counts']['integrations'][_0x6c1221(0x8f)]+_0x2da2bf['counts'][_0x6c1221(0x11b)][_0x6c1221(0x8f)]+_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x10a)][_0x6c1221(0x8f)]+_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x83)][_0x6c1221(0x8f)]+_0x2da2bf['counts'][_0x6c1221(0x8d)][_0x6c1221(0x8f)],_0x16dea0=_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x82)]['unchanged']+_0x2da2bf[_0x6c1221(0x108)]['knowledgeBases']['unchanged']+_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0xf2)][_0x6c1221(0x100)]+_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0xe0)][_0x6c1221(0x100)]+_0x2da2bf[_0x6c1221(0x108)]['integrations']['unchanged']+_0x2da2bf[_0x6c1221(0x108)]['experimentalKnowledgeBases'][_0x6c1221(0x100)]+_0x2da2bf[_0x6c1221(0x108)]['experimentalArtifacts'][_0x6c1221(0x100)]+_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x83)][_0x6c1221(0x100)]+_0x2da2bf['counts']['chatInterfaces'][_0x6c1221(0x100)];console[_0x6c1221(0x118)](_0x6c1221(0x130)+_0x2da2bf[_0x6c1221(0x91)]+'\x27:'),console[_0x6c1221(0x118)]('\x20\x20'+a4_0x30f3fc['green']('+\x20'+_0x49cef5+_0x6c1221(0xd8))+_0x6c1221(0xf7)+a4_0x30f3fc[_0x6c1221(0xe4)]('~\x20'+_0x8b3201+'\x20changed')+_0x6c1221(0xf7)+a4_0x30f3fc[_0x6c1221(0x88)]('=\x20'+_0x16dea0+_0x6c1221(0xc5))),console[_0x6c1221(0x118)](_0x6c1221(0xe6)+formatCountSummary(_0x2da2bf['counts'][_0x6c1221(0x82)])),console[_0x6c1221(0x118)](_0x6c1221(0xa1)+formatCountSummary(_0x2da2bf['counts'][_0x6c1221(0x112)])),console[_0x6c1221(0x118)](_0x6c1221(0xa9)+formatCountSummary(_0x2da2bf['counts'][_0x6c1221(0xf2)])),console[_0x6c1221(0x118)](_0x6c1221(0x7f)+formatCountSummary(_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0xe0)])),console[_0x6c1221(0x118)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x8b)])),console[_0x6c1221(0x118)](_0x6c1221(0xc9)+formatCountSummary(_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x83)])),console['log'](_0x6c1221(0x7c)+formatCountSummary(_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x8d)]));const _0x3b003b=_0x2da2bf[_0x6c1221(0x108)]['experimentalKnowledgeBases'][_0x6c1221(0xf8)]>0x0||_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x10a)]['total']>0x0;_0x3b003b&&(console[_0x6c1221(0x118)](_0x6c1221(0x99)+formatCountSummary(_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x11b)])),console[_0x6c1221(0x118)](_0x6c1221(0x102)+formatCountSummary(_0x2da2bf[_0x6c1221(0x108)]['experimentalArtifacts'])));console[_0x6c1221(0x118)](_0x6c1221(0xb6)+a4_0x30f3fc[_0x6c1221(0x120)](_0x2da2bf['outputDir'])),displayDiffs(_0x2da2bf[_0x6c1221(0x82)],_0x2da2bf[_0x6c1221(0x112)],_0x2da2bf[_0x6c1221(0xf2)],_0x2da2bf[_0x6c1221(0xe0)],_0x2da2bf[_0x6c1221(0x8b)],_0x2da2bf[_0x6c1221(0x11b)],_0x2da2bf[_0x6c1221(0x10a)],_0x2da2bf[_0x6c1221(0x83)],_0x2da2bf[_0x6c1221(0x8d)]);if(_0x47b70f)return console[_0x6c1221(0x118)](a4_0x30f3fc[_0x6c1221(0xe4)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x49cef5===0x0&&_0x8b3201===0x0)return console['log'](a4_0x30f3fc[_0x6c1221(0xea)](_0x6c1221(0x126))),saveSessionContext({'llm_project':_0x2da2bf[_0x6c1221(0x91)]},_0x33ccf4[_0x6c1221(0xd5)]),console[_0x6c1221(0x118)](a4_0x30f3fc[_0x6c1221(0xea)](_0x6c1221(0xde)+a4_0x30f3fc[_0x6c1221(0x88)](_0x6c1221(0x92))+_0x6c1221(0xd7)+a4_0x30f3fc[_0x6c1221(0x120)](_0x2da2bf[_0x6c1221(0x91)]))),0x0;if(!_0x5b14b4&&!_0x45d7b8){if(!isInteractive())return console[_0x6c1221(0x94)](a4_0x30f3fc[_0x6c1221(0xf9)](_0x6c1221(0xb4)),_0x6c1221(0xdb)),console[_0x6c1221(0x94)](a4_0x30f3fc[_0x6c1221(0x88)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3f82a7=await confirmKey(_0x6c1221(0x101)+(_0x49cef5+_0x8b3201)+'\x20files?');if(!_0x3f82a7)return console[_0x6c1221(0x118)](a4_0x30f3fc['yellow'](_0x6c1221(0x87)),_0x6c1221(0xed)),0x1;}const {data:_0x3c185e}=await withSpinner(_0x6c1221(0x104),()=>_0x19bd71[_0x6c1221(0x129)][_0x6c1221(0x7b)](_0x1fb462,_0x107b35,{'force':_0x45d7b8}));return console['log'](a4_0x30f3fc['green'](_0x6c1221(0x111)+(_0x49cef5+_0x8b3201)+_0x6c1221(0xf6)+_0x3c185e[_0x6c1221(0xa6)])),saveSessionContext({'llm_project':_0x3c185e[_0x6c1221(0x91)]},_0x33ccf4[_0x6c1221(0xd5)]),console[_0x6c1221(0x118)](a4_0x30f3fc[_0x6c1221(0xea)]('✔\x20Context\x20set:\x20'+a4_0x30f3fc[_0x6c1221(0x88)]('llm_project')+_0x6c1221(0xd7)+a4_0x30f3fc['cyan'](_0x3c185e[_0x6c1221(0x91)]))),0x0;}}function a4_0x234c(){const _0x31fd51=['MISSING_ARGUMENT','\x20\x20Knowledge\x20Bases:\x20','\x20created','INVALID_ARGUMENT','New\x20project\x20name\x20is\x20required','cwd','outputDir','dryRun','\x20\x20Agent\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','agentName','\x0a✔\x20Pushed\x20','Analyzing\x20changes\x20to\x20push...','agent:push','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20resources\x20to\x20\x27','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)','\x0aPush\x20summary\x20for\x20\x27','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','newProjectName','\x0aError:','tdx.json','\x20\x20Target:\x20','join','\x22...','parse','\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)','site','no_local_folder','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x0aErrors\x20found:','7kaKJFj','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20updated','\x0aChanges\x20to\x20agent\x20\x27','Failed\x20to\x20push\x20agent:\x20','\x22\x20to\x20a\x20different\x20profile','\x20unchanged','\x20\x20tdx\x20agent\x20clone\x20agents/','created','utf-8','\x20\x20Form\x20Interfaces:\x20','isNew','Summary:','Agent\x20','\x22:\x20','Analyzing\x20project\x20\x22','Using\x20project:\x20','sourceProjectName','\x22\x20to\x20\x22','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','541490PXujok','Using\x20local\x20project:\x20','session','Errors:','\x20=\x20','\x20new','Pushing\x20to\x20project...','profile','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','name','1863190fXxVus','✔\x20Context\x20set:\x20','\x20changed','prompts','1911657QlrcQG','description','\x0aChanges:','yellow','errors','\x20\x20Agents:\x20','Cloning\x20\x22','\x20\x20Chat\x20Interface\x20\x22','force','green','Project\x20cloned\x20with\x20errors','yes','-\x20no\x20files\x20written','Project\x20cloned\x20successfully','1470981IMilHf','Pulling\x20agent\x20\x22','\x20\x20Text\x20Knowledge\x20Base\x20\x22','textKnowledgeBases','\x20\x20Integrations:\x20','Using\x20project\x20from\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20files\x20to\x20','\x20|\x20','total','red','pushProject','5XcwVHr','\x22\x20to\x20new\x20project\x20\x22','execute','\x20errors','projectDir','unchanged','\x0aWrite\x20','\x20\x20Experimental\x20Artifacts:\x20','\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','Writing\x20files...','Using\x20context\x20project:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','counts','agentId','experimentalArtifacts','reason','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','agent','\x22\x20from\x20project\x20\x22','Source:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x0a✔\x20Pulled\x20','knowledgeBases','4ugAnxH','found','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','57598qBJWjl','source','log','\x0aChanges\x20to\x20chat\x20interface\x20\x27','1660380IQHpUf','experimentalKnowledgeBases','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Using\x20current\x20project:\x20','repeat','outputPath','cyan','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','hasChanges','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20\x20Prompt\x20\x22','cwd-config','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','2159224ySPVOA','pushAgent','llm','llmProject','12NHIXSI','dirname','Dry\x20run\x20-\x20no\x20files\x20written','push','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x0aPull\x20summary\x20for\x20\x27','newProjectId','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','New\x20project\x20ID:\x20','\x0aChanges\x20to\x20form\x20interface\x20\x27','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Dry\x20run\x20-\x20no\x20changes\x20made','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','pullProject','\x20\x20Chat\x20Interfaces:\x20','projectId','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20\x20Prompts:\x20','\x0aPush\x20','new','agents','formInterfaces','\x0aProject\x20pushed\x20with\x20errors','context','Would\x20pull\x20agent:\x20','Cancelled','dim','Using\x20project\x20from\x20context:\x20','Project:\x20','integrations','Status:\x20','chatInterfaces','\x20\x20Form\x20Interface\x20\x22','updated','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','projectName','llm_project','Would\x20push\x20agent:\x20','error','\x20\x20Knowledge\x20Base\x20\x22','action','\x20--profile\x20','Output:\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','agent.yml','No\x20tdx.json\x20found\x20in\x20','message','diff','99QpMBlq','\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'];a4_0x234c=function(){return _0x31fd51;};return a4_0x234c();}export class AgentCloneCommand extends BaseCommand{['name']='agent:clone';[a4_0x2af299(0xe2)]=a4_0x2af299(0xd2);async[a4_0x2af299(0xfd)](_0x276078){const _0x139afb=a4_0x2af299,{options:_0x5d9229,args:_0x24231b,tdx:_0x5a15a4}=_0x276078,_0x3bf156=_0x24231b[0x0],_0x17109e=_0x5d9229['name'],_0x3a4cbf=_0x5d9229['dryRun'],_0x554405=_0x5d9229[_0x139afb(0xec)],_0x163098=_0x5d9229[_0x139afb(0xbb)],_0x25eeca=_0x5d9229['llmProject'];let _0x2f352b;const _0x532b02=findAgentConfigPath(process[_0x139afb(0xa5)]());if(_0x3bf156){const _0x540b4a=a4_0x1e8bb5[_0x139afb(0xb7)](_0x3bf156,_0x139afb(0xb5));existsSync(_0x540b4a)?(_0x2f352b=_0x3bf156,console[_0x139afb(0x118)](a4_0x30f3fc[_0x139afb(0x88)](_0x139afb(0xd4)+_0x3bf156))):_0x2f352b=_0x3bf156;}else{if(_0x532b02)_0x2f352b=a4_0x1e8bb5[_0x139afb(0x12c)](_0x532b02),console[_0x139afb(0x118)](a4_0x30f3fc[_0x139afb(0x88)](_0x139afb(0x11d)+_0x2f352b));else{if(_0x25eeca){const _0x223ceb=sanitizeForFilesystem(_0x25eeca);let _0x29367e=_0x223ceb,_0x3528a1=a4_0x1e8bb5[_0x139afb(0xb7)](process['cwd'](),_0x139afb(0x82),_0x223ceb,_0x139afb(0xb5));if(!existsSync(_0x3528a1)){const _0x391ea5=normalizeName(_0x25eeca),_0x5a4095=a4_0x1e8bb5[_0x139afb(0xb7)](process[_0x139afb(0xa5)](),_0x139afb(0x82),_0x391ea5,_0x139afb(0xb5));existsSync(_0x5a4095)&&(_0x29367e=_0x391ea5,_0x3528a1=_0x5a4095);}if(existsSync(_0x3528a1))_0x2f352b=a4_0x1e8bb5['dirname'](_0x3528a1),console[_0x139afb(0x118)](a4_0x30f3fc['dim'](_0x139afb(0xd4)+_0x2f352b));else{const _0x3fce93=_0x5d9229[_0x139afb(0xda)];if(_0x3fce93)throw new SDKError(ErrorCode[_0x139afb(0xa3)],_0x139afb(0xf5)+_0x25eeca+_0x139afb(0xc4),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x139afb(0x110)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x25eeca+'\x0a')+(_0x139afb(0xc6)+_0x29367e+'\x20--name\x20'+(_0x17109e||'<new-name>')+_0x139afb(0x97)+_0x3fce93)});_0x2f352b=_0x25eeca,console['log'](a4_0x30f3fc[_0x139afb(0x88)](_0x139afb(0x105)+_0x25eeca));}}}}if(!_0x2f352b)return console[_0x139afb(0x118)](a4_0x30f3fc[_0x139afb(0xe4)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x139afb(0x118)](_0x139afb(0x90)),console[_0x139afb(0x118)](_0x139afb(0x132)),console[_0x139afb(0x118)](_0x139afb(0xba)),console[_0x139afb(0x118)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x17109e)throw new SDKError(ErrorCode[_0x139afb(0xa0)],_0x139afb(0xa4),undefined,{'helpText':_0x139afb(0xae)});if(!_0x554405&&!_0x3a4cbf){if(!isInteractive())return console['error'](a4_0x30f3fc[_0x139afb(0xf9)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x139afb(0x94)](a4_0x30f3fc[_0x139afb(0x88)](_0x139afb(0x121))),0x1;const _0x93efd3=await confirmKey('Clone\x20\x22'+_0x2f352b+_0x139afb(0xfc)+_0x17109e+'\x22?');if(!_0x93efd3)return console[_0x139afb(0x118)](a4_0x30f3fc['yellow'](_0x139afb(0x87))),0x1;}const {data:_0x59a3a9}=await withSpinner(_0x139afb(0xe7)+_0x2f352b+_0x139afb(0xd1)+_0x17109e+'\x22...',()=>_0x5a15a4[_0x139afb(0x129)]['cloneProject'](_0x2f352b,_0x17109e,{'dryRun':_0x3a4cbf}));if(_0x3a4cbf){console['log'](a4_0x30f3fc['yellow'](_0x139afb(0x136))),console[_0x139afb(0x118)](_0x139afb(0x10f)+_0x59a3a9['sourceProjectName']),console[_0x139afb(0x118)]('New\x20project:\x20'+_0x17109e),console[_0x139afb(0x118)]('Would\x20clone:'),console['log'](_0x139afb(0xe6)+_0x59a3a9[_0x139afb(0x108)]['agents']['created']),console[_0x139afb(0x118)](_0x139afb(0xa1)+_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x112)][_0x139afb(0xc7)]),console[_0x139afb(0x118)](_0x139afb(0x7f)+_0x59a3a9[_0x139afb(0x108)][_0x139afb(0xe0)][_0x139afb(0xc7)]),console[_0x139afb(0x118)]('\x20\x20Form\x20Interfaces:\x20'+_0x59a3a9['counts'][_0x139afb(0x83)][_0x139afb(0xc7)]),console[_0x139afb(0x118)](_0x139afb(0x7c)+_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x8d)][_0x139afb(0xc7)]);const _0x597b5c=_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x11b)]['created']>0x0||_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x10a)]['created']>0x0;return _0x597b5c&&(console[_0x139afb(0x118)](_0x139afb(0x99)+_0x59a3a9['counts']['experimentalKnowledgeBases']['created']),console[_0x139afb(0x118)](_0x139afb(0x102)+_0x59a3a9['counts'][_0x139afb(0x10a)][_0x139afb(0xc7)])),0x0;}const _0x23d456=_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x82)][_0x139afb(0xe5)]>0x0||_0x59a3a9['counts'][_0x139afb(0x112)][_0x139afb(0xe5)]>0x0||_0x59a3a9['counts'][_0x139afb(0xe0)][_0x139afb(0xe5)]>0x0||_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x83)]['errors']>0x0||_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x8d)][_0x139afb(0xe5)]>0x0||_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x11b)][_0x139afb(0xe5)]>0x0||_0x59a3a9['counts']['experimentalArtifacts'][_0x139afb(0xe5)]>0x0;_0x23d456?console[_0x139afb(0x118)](a4_0x30f3fc[_0x139afb(0xe4)](_0x139afb(0xeb))):console[_0x139afb(0x118)](a4_0x30f3fc[_0x139afb(0xea)](_0x139afb(0xee)));console[_0x139afb(0x118)](_0x139afb(0x10f)+_0x59a3a9[_0x139afb(0xd0)]),console[_0x139afb(0x118)]('New\x20project:\x20'+_0x59a3a9[_0x139afb(0xb3)]),console['log'](_0x139afb(0x133)+_0x59a3a9[_0x139afb(0x131)]),console[_0x139afb(0x118)](),console[_0x139afb(0x118)](_0x139afb(0xcb)),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x82)])),console[_0x139afb(0x118)](_0x139afb(0xa1)+formatCountSummary(_0x59a3a9['counts'][_0x139afb(0x112)])),console[_0x139afb(0x118)](_0x139afb(0x7f)+formatCountSummary(_0x59a3a9[_0x139afb(0x108)][_0x139afb(0xe0)])),console[_0x139afb(0x118)](_0x139afb(0xf3)+formatCountSummary(_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x8b)])),console[_0x139afb(0x118)](_0x139afb(0xc9)+formatCountSummary(_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x83)])),console[_0x139afb(0x118)](_0x139afb(0x7c)+formatCountSummary(_0x59a3a9['counts'][_0x139afb(0x8d)]));const _0x2195fd=_0x59a3a9[_0x139afb(0x108)]['experimentalKnowledgeBases']['created']>0x0||_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x11b)][_0x139afb(0x8f)]>0x0||_0x59a3a9[_0x139afb(0x108)]['experimentalKnowledgeBases'][_0x139afb(0x100)]>0x0||_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x10a)][_0x139afb(0xc7)]>0x0||_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x10a)]['updated']>0x0||_0x59a3a9['counts']['experimentalArtifacts'][_0x139afb(0x100)]>0x0;_0x2195fd&&(console[_0x139afb(0x118)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x59a3a9[_0x139afb(0x108)]['experimentalKnowledgeBases'])),console['log'](_0x139afb(0x102)+formatCountSummary(_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x10a)])));if(_0x23d456){console[_0x139afb(0x118)](),console[_0x139afb(0x118)](a4_0x30f3fc[_0x139afb(0xf9)](_0x139afb(0xd6)));for(const _0xc70b82 of _0x59a3a9['agents']){_0xc70b82['action']===_0x139afb(0x94)&&console[_0x139afb(0x118)](a4_0x30f3fc['red'](_0x139afb(0xa8)+_0xc70b82['agentName']+_0x139afb(0xcd)+_0xc70b82[_0x139afb(0x94)]));}for(const _0x566e1c of _0x59a3a9[_0x139afb(0x112)]){_0x566e1c[_0x139afb(0x96)]===_0x139afb(0x94)&&console[_0x139afb(0x118)](a4_0x30f3fc[_0x139afb(0xf9)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x566e1c[_0x139afb(0xdc)]+_0x139afb(0xcd)+_0x566e1c[_0x139afb(0x94)]));}for(const _0x10005b of _0x59a3a9['prompts']){_0x10005b[_0x139afb(0x96)]===_0x139afb(0x94)&&console[_0x139afb(0x118)](a4_0x30f3fc['red'](_0x139afb(0x124)+_0x10005b['name']+_0x139afb(0xcd)+_0x10005b['error']));}for(const _0x3063c1 of _0x59a3a9[_0x139afb(0x8b)]){_0x3063c1[_0x139afb(0x96)]===_0x139afb(0x94)&&console['log'](a4_0x30f3fc[_0x139afb(0xf9)]('\x20\x20Integration\x20\x22'+_0x3063c1[_0x139afb(0xdc)]+_0x139afb(0xcd)+_0x3063c1[_0x139afb(0x94)]));}for(const _0x302560 of _0x59a3a9[_0x139afb(0x83)]){_0x302560[_0x139afb(0x96)]===_0x139afb(0x94)&&console['log'](a4_0x30f3fc[_0x139afb(0xf9)](_0x139afb(0x8e)+_0x302560[_0x139afb(0xdc)]+_0x139afb(0xcd)+_0x302560['error']));}for(const _0x3582db of _0x59a3a9['chatInterfaces']){_0x3582db[_0x139afb(0x96)]===_0x139afb(0x94)&&console['log'](a4_0x30f3fc[_0x139afb(0xf9)](_0x139afb(0xe8)+_0x3582db[_0x139afb(0xdc)]+'\x22:\x20'+_0x3582db['error']));}for(const _0x171e84 of _0x59a3a9[_0x139afb(0x11b)]){_0x171e84[_0x139afb(0x96)]===_0x139afb(0x94)&&console['log'](a4_0x30f3fc[_0x139afb(0xf9)](_0x139afb(0x12f)+_0x171e84[_0x139afb(0xdc)]+_0x139afb(0xcd)+_0x171e84[_0x139afb(0x94)]));}for(const _0x4a4f65 of _0x59a3a9[_0x139afb(0x10a)]){_0x4a4f65[_0x139afb(0x96)]===_0x139afb(0x94)&&console[_0x139afb(0x118)](a4_0x30f3fc[_0x139afb(0xf9)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x4a4f65[_0x139afb(0xdc)]+'\x22:\x20'+_0x4a4f65['error']));}return 0x1;}console[_0x139afb(0x118)]();const _0x2f1583=getLLMProjectUrl(_0x163098,_0x59a3a9[_0x139afb(0x131)]);return console[_0x139afb(0x118)](_0x139afb(0x8a)+a4_0x30f3fc[_0x139afb(0x120)](_0x2f1583)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x2af299(0xdc)]=a4_0x2af299(0xad);[a4_0x2af299(0xe2)]=a4_0x2af299(0x107);async[a4_0x2af299(0xfd)](_0x4aa342){const _0x1f9f93=a4_0x2af299,{options:_0x399294,args:_0x15e89f,tdx:_0x422fa3}=_0x4aa342;let _0x2fbd19=_0x15e89f[0x0]||process['cwd']();const _0x4fcec0=_0x399294[_0x1f9f93(0xa7)],_0x5ad3d6=_0x399294[_0x1f9f93(0xe9)],_0x289760=_0x399294['yes'],_0x37e301=_0x399294['site'],_0x1406fe=a4_0x1e8bb5[_0x1f9f93(0xb7)](_0x2fbd19,_0x1f9f93(0x9a)),_0x3f6317=existsSync(_0x1406fe);if(_0x3f6317){const {data:_0x16edac}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x2fbd19+'\x22...',()=>_0x422fa3[_0x1f9f93(0x129)][_0x1f9f93(0x128)](_0x2fbd19,{'dryRun':_0x4fcec0,'force':_0x5ad3d6}));if(_0x4fcec0)return console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xe4)](_0x1f9f93(0x136))),console[_0x1f9f93(0x118)](_0x1f9f93(0x93)+_0x16edac['agentName']),0x0;if(_0x16edac[_0x1f9f93(0x96)]===_0x1f9f93(0x94))return console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0xc3)+_0x16edac['error'])),0x1;console[_0x1f9f93(0x118)](a4_0x30f3fc['green'](_0x1f9f93(0xcc)+_0x16edac[_0x1f9f93(0x96)]+'\x20successfully')),console[_0x1f9f93(0x118)]('Agent:\x20'+_0x16edac[_0x1f9f93(0xaa)]);if(_0x16edac[_0x1f9f93(0x109)]&&_0x16edac[_0x1f9f93(0x7d)]){const _0x136d14=getLLMAgentChatUrl(_0x37e301,_0x16edac[_0x1f9f93(0x7d)],_0x16edac['agentId']);console[_0x1f9f93(0x118)]('Chat:\x20'+a4_0x30f3fc[_0x1f9f93(0x120)](_0x136d14));}return 0x0;}const _0x3daf1f=_0x399294[_0x1f9f93(0x12a)],_0x5a1839=resolveProjectFromContext(_0x2fbd19,_0x3daf1f);if(_0x5a1839[_0x1f9f93(0x114)])_0x2fbd19=_0x5a1839[_0x1f9f93(0xff)],_0x5a1839[_0x1f9f93(0x117)]===_0x1f9f93(0x85)&&console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0x88)](_0x1f9f93(0xcf)+_0x2fbd19));else{let _0x4b07d6='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x5a1839[_0x1f9f93(0x10b)]===_0x1f9f93(0xbc)&&(_0x4b07d6=_0x5a1839[_0x1f9f93(0x9c)]+_0x1f9f93(0x106)+_0x5a1839[_0x1f9f93(0x12a)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x1f9f93(0xa3)],_0x5a1839[_0x1f9f93(0x10b)]==='no_context'?_0x5a1839[_0x1f9f93(0x9c)]:_0x1f9f93(0x9b)+_0x2fbd19,undefined,{'helpText':_0x4b07d6});}const {data:_0x1ecf82}=await withSpinner(_0x1f9f93(0xac),()=>_0x422fa3[_0x1f9f93(0x129)][_0x1f9f93(0xfa)](_0x2fbd19,{'dryRun':!![]})),_0x265bf6=_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x82)]['errors']>0x0;if(_0x265bf6){console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0xbe)));for(const _0x39e21a of _0x1ecf82[_0x1f9f93(0x82)]){_0x39e21a[_0x1f9f93(0x96)]===_0x1f9f93(0x94)&&console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0xa8)+_0x39e21a['agentName']+'\x22:\x20'+_0x39e21a[_0x1f9f93(0x94)]));}return 0x1;}const _0x586465=_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x82)]['created']+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x112)][_0x1f9f93(0xc7)]+_0x1ecf82[_0x1f9f93(0x108)]['textKnowledgeBases'][_0x1f9f93(0xc7)]+_0x1ecf82[_0x1f9f93(0x108)]['prompts']['created']+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x8b)]['created']+_0x1ecf82['counts'][_0x1f9f93(0x11b)][_0x1f9f93(0xc7)]+_0x1ecf82['counts'][_0x1f9f93(0x10a)]['created']+_0x1ecf82['counts'][_0x1f9f93(0x83)][_0x1f9f93(0xc7)]+_0x1ecf82['counts'][_0x1f9f93(0x8d)]['created'],_0x53372f=_0x1ecf82['counts'][_0x1f9f93(0x82)]['updated']+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x112)]['updated']+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0xf2)][_0x1f9f93(0x8f)]+_0x1ecf82['counts'][_0x1f9f93(0xe0)][_0x1f9f93(0x8f)]+_0x1ecf82['counts'][_0x1f9f93(0x8b)][_0x1f9f93(0x8f)]+_0x1ecf82['counts'][_0x1f9f93(0x11b)][_0x1f9f93(0x8f)]+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x10a)]['updated']+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x83)]['updated']+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x8d)][_0x1f9f93(0x8f)],_0x47650c=_0x1ecf82['counts'][_0x1f9f93(0x82)]['unchanged']+_0x1ecf82['counts'][_0x1f9f93(0x112)][_0x1f9f93(0x100)]+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0xf2)][_0x1f9f93(0x100)]+_0x1ecf82['counts']['prompts'][_0x1f9f93(0x100)]+_0x1ecf82['counts'][_0x1f9f93(0x8b)]['unchanged']+_0x1ecf82[_0x1f9f93(0x108)]['experimentalKnowledgeBases'][_0x1f9f93(0x100)]+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x10a)][_0x1f9f93(0x100)]+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x83)]['unchanged']+_0x1ecf82[_0x1f9f93(0x108)]['chatInterfaces'][_0x1f9f93(0x100)];console[_0x1f9f93(0x118)](_0x1f9f93(0xb1)+_0x1ecf82[_0x1f9f93(0x91)]+'\x27:'),console[_0x1f9f93(0x118)]('\x20\x20'+a4_0x30f3fc[_0x1f9f93(0xea)]('+\x20'+_0x586465+'\x20new')+'\x20|\x20'+a4_0x30f3fc[_0x1f9f93(0xe4)]('~\x20'+_0x53372f+_0x1f9f93(0xdf))+'\x20|\x20'+a4_0x30f3fc[_0x1f9f93(0x88)]('=\x20'+_0x47650c+'\x20unchanged')),console[_0x1f9f93(0x118)](_0x1f9f93(0xe6)+formatCountSummary(_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x82)])),console['log'](_0x1f9f93(0xa1)+formatCountSummary(_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x112)])),console[_0x1f9f93(0x118)](_0x1f9f93(0xa9)+formatCountSummary(_0x1ecf82['counts'][_0x1f9f93(0xf2)])),console[_0x1f9f93(0x118)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x1ecf82['counts'][_0x1f9f93(0xe0)])),console[_0x1f9f93(0x118)](_0x1f9f93(0xf3)+formatCountSummary(_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x8b)])),console[_0x1f9f93(0x118)](_0x1f9f93(0xc9)+formatCountSummary(_0x1ecf82['counts']['formInterfaces'])),console[_0x1f9f93(0x118)](_0x1f9f93(0x7c)+formatCountSummary(_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x8d)]));const _0x1c4b20=_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x11b)][_0x1f9f93(0xc7)]>0x0||_0x1ecf82[_0x1f9f93(0x108)]['experimentalKnowledgeBases']['updated']>0x0||_0x1ecf82[_0x1f9f93(0x108)]['experimentalKnowledgeBases'][_0x1f9f93(0x100)]>0x0||_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x10a)][_0x1f9f93(0xc7)]>0x0||_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x10a)][_0x1f9f93(0x8f)]>0x0||_0x1ecf82['counts'][_0x1f9f93(0x10a)][_0x1f9f93(0x100)]>0x0;_0x1c4b20&&(console[_0x1f9f93(0x118)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1ecf82[_0x1f9f93(0x108)]['experimentalKnowledgeBases'])),console[_0x1f9f93(0x118)](_0x1f9f93(0x102)+formatCountSummary(_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x10a)])));console[_0x1f9f93(0x118)]('\x20\x20Source:\x20'+a4_0x30f3fc[_0x1f9f93(0x120)](_0x2fbd19)),displayDiffs(_0x1ecf82[_0x1f9f93(0x82)],_0x1ecf82['knowledgeBases'],_0x1ecf82[_0x1f9f93(0xf2)],_0x1ecf82[_0x1f9f93(0xe0)],_0x1ecf82[_0x1f9f93(0x8b)],_0x1ecf82[_0x1f9f93(0x11b)],_0x1ecf82[_0x1f9f93(0x10a)],_0x1ecf82[_0x1f9f93(0x83)],_0x1ecf82['chatInterfaces']);if(_0x4fcec0)return console['log'](a4_0x30f3fc[_0x1f9f93(0xe4)](_0x1f9f93(0xbd))),0x0;if(_0x586465===0x0&&_0x53372f===0x0){console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xea)](_0x1f9f93(0x11c)));const _0x5559c6=getLLMProjectUrl(_0x37e301,_0x1ecf82['projectId']);return console[_0x1f9f93(0x118)](_0x1f9f93(0x8a)+a4_0x30f3fc[_0x1f9f93(0x120)](_0x5559c6)),0x0;}if(!_0x289760&&!_0x5ad3d6){if(!isInteractive())return console[_0x1f9f93(0x94)](a4_0x30f3fc['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1f9f93(0x94)](a4_0x30f3fc[_0x1f9f93(0x88)](_0x1f9f93(0x121))),0x1;const _0x8a14d9=await confirmKey(_0x1f9f93(0x80)+(_0x586465+_0x53372f)+'\x20resources?');if(!_0x8a14d9)return console['log'](a4_0x30f3fc[_0x1f9f93(0xe4)](_0x1f9f93(0x87)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x3618fb}=await withSpinner(_0x1f9f93(0xd9),()=>_0x422fa3['llm']['pushProject'](_0x2fbd19,{'force':_0x5ad3d6})),_0x304928=_0x3618fb[_0x1f9f93(0x108)][_0x1f9f93(0x82)][_0x1f9f93(0xe5)]>0x0||_0x3618fb[_0x1f9f93(0x108)]['knowledgeBases']['errors']>0x0||_0x3618fb['counts']['textKnowledgeBases'][_0x1f9f93(0xe5)]>0x0||_0x3618fb[_0x1f9f93(0x108)][_0x1f9f93(0xe0)][_0x1f9f93(0xe5)]>0x0||_0x3618fb[_0x1f9f93(0x108)][_0x1f9f93(0x83)][_0x1f9f93(0xe5)]>0x0||_0x3618fb['counts'][_0x1f9f93(0x8d)]['errors']>0x0;if(_0x304928){console[_0x1f9f93(0x118)](a4_0x30f3fc['yellow'](_0x1f9f93(0x84))),console[_0x1f9f93(0x118)](),console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0xd6)));for(const _0x3cba6d of _0x3618fb[_0x1f9f93(0x82)]){_0x3cba6d['action']==='error'&&console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0xa8)+_0x3cba6d[_0x1f9f93(0xaa)]+_0x1f9f93(0xcd)+_0x3cba6d['error']));}for(const _0x3dd7b2 of _0x3618fb[_0x1f9f93(0x112)]){_0x3dd7b2[_0x1f9f93(0x96)]===_0x1f9f93(0x94)&&console['log'](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0x95)+_0x3dd7b2[_0x1f9f93(0xdc)]+'\x22:\x20'+_0x3dd7b2['error']));}for(const _0x4de6d9 of _0x3618fb[_0x1f9f93(0xf2)]){_0x4de6d9[_0x1f9f93(0x96)]===_0x1f9f93(0x94)&&console['log'](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0xf1)+_0x4de6d9[_0x1f9f93(0xdc)]+_0x1f9f93(0xcd)+_0x4de6d9[_0x1f9f93(0x94)]));}for(const _0x4548b7 of _0x3618fb[_0x1f9f93(0xe0)]){_0x4548b7[_0x1f9f93(0x96)]==='error'&&console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0x124)+_0x4548b7[_0x1f9f93(0xdc)]+_0x1f9f93(0xcd)+_0x4548b7[_0x1f9f93(0x94)]));}for(const _0x41762e of _0x3618fb['integrations']){_0x41762e[_0x1f9f93(0x96)]==='error'&&console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)]('\x20\x20Integration\x20\x22'+_0x41762e[_0x1f9f93(0xdc)]+_0x1f9f93(0xcd)+_0x41762e[_0x1f9f93(0x94)]));}for(const _0x17ffcb of _0x3618fb[_0x1f9f93(0x83)]){_0x17ffcb[_0x1f9f93(0x96)]===_0x1f9f93(0x94)&&console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0x8e)+_0x17ffcb[_0x1f9f93(0xdc)]+_0x1f9f93(0xcd)+_0x17ffcb[_0x1f9f93(0x94)]));}for(const _0x5ac351 of _0x3618fb[_0x1f9f93(0x8d)]){_0x5ac351[_0x1f9f93(0x96)]===_0x1f9f93(0x94)&&console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0xe8)+_0x5ac351['name']+_0x1f9f93(0xcd)+_0x5ac351[_0x1f9f93(0x94)]));}return 0x1;}console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xea)](_0x1f9f93(0xab)+(_0x586465+_0x53372f)+_0x1f9f93(0xaf)+_0x3618fb[_0x1f9f93(0x91)]+'\x27'));const _0x560038=getLLMProjectUrl(_0x37e301,_0x3618fb[_0x1f9f93(0x7d)]);return console['log'](_0x1f9f93(0x8a)+a4_0x30f3fc[_0x1f9f93(0x120)](_0x560038)),0x0;}}
@@ -1 +1 @@
1
- function a5_0x274a(_0x3812c0,_0x5eba82){_0x3812c0=_0x3812c0-0xac;const _0x2c5be5=a5_0x2c5b();let _0x274a2b=_0x2c5be5[_0x3812c0];return _0x274a2b;}function a5_0x2c5b(){const _0x5c3906=['\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','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Usage:','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','1494060vZLgBW','output','filter','\x22,\x20but\x20current\x20site\x20is\x20\x22','Round\x20','Test\x20Configuration:','projectDir','not\x20found','\x22:\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Output\x20written\x20to:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','testName','agentDirs','Run\x20\x27tdx\x20agent\x20pull\x20','found','name','794619PRDbYD','trim','FAIL','Running:\x20','dim','Test\x20Summary','message','no_local_folder','Site:\x20','tsv','green','Conversation\x20URL:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Re-evaluation\x20Summary','no_context','Evaluating\x20response...','Errors:\x20\x20\x20','117940QZDfyg','llmProject','Duration:\x20','9QlJQIA','No\x20tests\x20found\x20with\x20tags:\x20','add','white','join','forEach','push','No\x20tests\x20have\x20tags\x20defined.','tests','resolveAgentId','Cached\x20run\x20from:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','status','now','ERROR','New\x20tests\x20to\x20execute:\x20','context','repeat','has','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','testYmlPath','agentName','5500lctKbZ','✗\x20FAIL:\x20','basename','Re-evaluating\x20cached\x20test\x20run...','5658016ZfMaCL','agent','\x20\x20Agent:\x20','Re-evaluating\x20','text','Round\x201/','Tests\x20found:\x20','\x20(new)','Available\x20tests:\x20','eval','cyan','verbose','length','\x20-\x20','map','log','Error\x20writing\x20output\x20file:\x20','Available\x20tags:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','...','llm','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','2aygOTQ','table','404','substring','timestamp','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Total:\x20\x20\x20\x20','agent:test','jsonl','no_tests','874371VkwOJx','source','\x20\x20Project:\x20','split','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','utf-8','writeFileSync','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Re-evaluating...','conversation_url','\x20(cached)','✗\x20ERROR:\x20','existsSync','projectName','✓\x20PASS:\x20','rounds','executeReeval','\x20\x20Site:\x20','dryRun','multiple_agents','Running\x20agent\x20tests...','resolve','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','...\x20','Executing\x20new\x20tests...','Cached\x20run\x20is\x20from\x20site\x20\x22','Passed:\x20\x20\x20','includes','description','site','Either\x20switch\x20to\x20the\x20\x22','Failed\x20Tests:','red','start','\x20\x20Evaluating...\x20','toLowerCase','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','conversations','Running\x20test:\x20','PASS','json','tags','reason','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','No\x20tests\x20found\x20matching:\x20',':\x20Sending\x20user\x20input...','⚠\x20SKIPPED:\x20','\x20\x20Conversation:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','toISOString','Error:\x20No\x20previous\x20test\x20run\x20found.','4019580HbFseK','yellow','stop','Agent:\x20','\x20\x20Round\x20','42JkjRJp'];a5_0x2c5b=function(){return _0x5c3906;};return a5_0x2c5b();}const a5_0x500993=a5_0x274a;(function(_0x59053b,_0x215611){const _0x1c2984=a5_0x274a,_0x1b093c=_0x59053b();while(!![]){try{const _0x53f564=parseInt(_0x1c2984(0x123))/0x1*(-parseInt(_0x1c2984(0x13d))/0x2)+-parseInt(_0x1c2984(0x148))/0x3+-parseInt(_0x1c2984(0x10a))/0x4+parseInt(_0x1c2984(0xe8))/0x5+parseInt(_0x1c2984(0xe3))/0x6*(parseInt(_0x1c2984(0xf9))/0x7)+-parseInt(_0x1c2984(0x127))/0x8+parseInt(_0x1c2984(0x10d))/0x9*(parseInt(_0x1c2984(0xde))/0xa);if(_0x53f564===_0x215611)break;else _0x1b093c['push'](_0x1b093c['shift']());}catch(_0x5c95d0){_0x1b093c['push'](_0x1b093c['shift']());}}}(a5_0x2c5b,0x70b7f));import*as a5_0x431961 from'node:fs';import*as a5_0x2061e7 from'node:path';import a5_0x431ddb from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x500993(0xf8)]=a5_0x500993(0x145);[a5_0x500993(0xc5)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async['execute'](_0x3281de){const _0x186c3f=a5_0x500993,{options:_0x2815e4,args:_0x309d0a,tdx:_0x42525e}=_0x3281de,_0x3558e3=_0x309d0a[0x0]||'.',_0x253e0f=_0x2815e4[_0x186c3f(0xbb)],_0x593ad4=_0x2815e4,_0x5529fc=_0x593ad4[_0x186c3f(0x130)]===![],_0x126b30=_0x593ad4['reeval'],_0x4d9fca=_0x593ad4[_0x186c3f(0xf8)],_0x6a127f=_0x593ad4[_0x186c3f(0xd4)],_0x173605=_0x2815e4['site'],_0x4a2e82=_0x593ad4[_0x186c3f(0xe9)];if(_0x126b30&&_0x5529fc)return console[_0x186c3f(0x136)](a5_0x431ddb[_0x186c3f(0xc9)](_0x186c3f(0xb0))),0x1;let _0x2f5be1='table';if(_0x593ad4[_0x186c3f(0xd3)])_0x2f5be1='json';else{if(_0x593ad4[_0x186c3f(0x146)])_0x2f5be1=_0x186c3f(0x146);else{if(_0x593ad4[_0x186c3f(0x102)])_0x2f5be1='tsv';else{if(_0x593ad4[_0x186c3f(0x13e)])_0x2f5be1=_0x186c3f(0x13e);}}}const _0x49c193=_0x593ad4[_0x186c3f(0x10b)];let _0x95d97f=_0x3558e3;const _0x411bb2=a5_0x431961[_0x186c3f(0xb5)](_0x3558e3),_0x48ed2c=_0x3558e3==='.';if(!_0x411bb2||_0x48ed2c){const _0xa191c=resolveProjectFromContext(_0x3558e3,_0x49c193,{'requireFile':'test.yml'});if(_0xa191c[_0x186c3f(0xf7)])_0x95d97f=_0xa191c[_0x186c3f(0xee)],_0xa191c[_0x186c3f(0x149)]===_0x186c3f(0x11d)&&console['log'](a5_0x431ddb[_0x186c3f(0xfd)]('Using\x20agent:\x20'+_0x95d97f));else switch(_0xa191c[_0x186c3f(0xd5)]){case _0x186c3f(0x107):console[_0x186c3f(0x136)](a5_0x431ddb[_0x186c3f(0xdf)](_0xa191c[_0x186c3f(0xff)])),console[_0x186c3f(0x136)](),console[_0x186c3f(0x136)](_0x186c3f(0xe6)),console['log'](_0x186c3f(0xe4)),console[_0x186c3f(0x136)]('\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[_0x186c3f(0x136)](),console[_0x186c3f(0x136)](_0x186c3f(0xbf));return 0x1;case _0x186c3f(0x100):console['log'](a5_0x431ddb[_0x186c3f(0xdf)](_0xa191c['message'])),console[_0x186c3f(0x136)](),console[_0x186c3f(0x136)](_0x186c3f(0xf6)+_0xa191c[_0x186c3f(0x10b)]+_0x186c3f(0xdb));return 0x1;case _0x186c3f(0xbc):{const _0x3e5cb8=a5_0x2061e7[_0x186c3f(0x125)](_0xa191c['projectDir']);console[_0x186c3f(0x136)](a5_0x431ddb['yellow'](_0x186c3f(0xce)+_0xa191c[_0x186c3f(0x10b)]+'\x22:'));for(const _0x29f891 of _0xa191c[_0x186c3f(0xf5)]){console['log']('\x20\x20-\x20'+_0x29f891);}return console[_0x186c3f(0x136)](),console[_0x186c3f(0x136)](_0x186c3f(0xf1)+_0x3e5cb8+'/<agent-name>'),0x1;}case _0x186c3f(0x147):console[_0x186c3f(0x136)](a5_0x431ddb['yellow'](_0x186c3f(0xcf)+_0xa191c[_0x186c3f(0x10b)]+'\x22.')),console[_0x186c3f(0x136)](a5_0x431ddb[_0x186c3f(0xfd)]('Project\x20path:\x20'+_0xa191c[_0x186c3f(0xee)])),console[_0x186c3f(0x136)](),console['log'](_0x186c3f(0xcd));return 0x1;}}const {definition:_0x8cd12,agentInfo:_0x303e61}=parseTestFile(_0x95d97f);let _0x4cffff=_0x8cd12[_0x186c3f(0x115)];if(_0x4d9fca){const _0x31a2ad=_0x4d9fca[_0x186c3f(0xac)](',')[_0x186c3f(0x135)](_0x11a8d6=>_0x11a8d6[_0x186c3f(0xfa)]());_0x4cffff=_0x8cd12['tests']['filter'](_0x15545d=>_0x31a2ad[_0x186c3f(0xc4)](_0x15545d['name']));if(_0x4cffff[_0x186c3f(0x133)]===0x0)return console['log'](a5_0x431ddb[_0x186c3f(0xdf)](_0x186c3f(0xd7)+_0x4d9fca)),console[_0x186c3f(0x136)](a5_0x431ddb['dim'](_0x186c3f(0x12f)+_0x8cd12[_0x186c3f(0x115)][_0x186c3f(0x135)](_0x65526e=>_0x65526e[_0x186c3f(0xf8)])[_0x186c3f(0x111)](',\x20'))),0x1;}if(_0x6a127f){const _0x1f0248=_0x6a127f[_0x186c3f(0xac)](',')['map'](_0x519a0a=>_0x519a0a['trim']()[_0x186c3f(0xcc)]());_0x4cffff=_0x4cffff[_0x186c3f(0xea)](_0x44bcf8=>_0x44bcf8[_0x186c3f(0xd4)]?.['some'](_0x560c87=>_0x1f0248[_0x186c3f(0xc4)](_0x560c87[_0x186c3f(0xcc)]())));if(_0x4cffff['length']===0x0){console[_0x186c3f(0x136)](a5_0x431ddb[_0x186c3f(0xdf)](_0x186c3f(0x10e)+_0x6a127f));const _0x51f5fd=new Set();return _0x8cd12[_0x186c3f(0x115)][_0x186c3f(0x112)](_0x51b2b7=>_0x51b2b7['tags']?.[_0x186c3f(0x112)](_0x28dabe=>_0x51f5fd[_0x186c3f(0x10f)](_0x28dabe))),_0x51f5fd['size']>0x0?console[_0x186c3f(0x136)](a5_0x431ddb[_0x186c3f(0xfd)](_0x186c3f(0x138)+[..._0x51f5fd][_0x186c3f(0x111)](',\x20'))):console['log'](a5_0x431ddb[_0x186c3f(0xfd)](_0x186c3f(0x114))),0x1;}}if(_0x126b30)return this[_0x186c3f(0xb9)](_0x3281de,{'definition':{'tests':_0x4cffff},'agentInfo':_0x303e61,'outputFormat':_0x2f5be1,'outputFile':_0x4a2e82,'testNames':_0x4d9fca});if(_0x253e0f){console['log'](a5_0x431ddb[_0x186c3f(0x131)](_0x186c3f(0xed))),console['log'](_0x186c3f(0xba)+a5_0x431ddb[_0x186c3f(0x110)](_0x173605)),console[_0x186c3f(0x136)](_0x186c3f(0x14a)+a5_0x431ddb[_0x186c3f(0x110)](_0x303e61['projectName'])),console[_0x186c3f(0x136)](_0x186c3f(0x129)+a5_0x431ddb[_0x186c3f(0x110)](_0x303e61['agentName'])),console[_0x186c3f(0x136)](),console['log'](_0x186c3f(0x12d)+a5_0x431ddb['white'](_0x4cffff[_0x186c3f(0x133)]));for(let _0x36c04c=0x0;_0x36c04c<_0x4cffff['length'];_0x36c04c++){const _0x5e1139=_0x4cffff[_0x36c04c],_0x46ce71=_0x5e1139[_0x186c3f(0xb8)][_0x186c3f(0x133)]===0x1?'round':_0x186c3f(0xb8),_0x112f77=_0x5e1139[_0x186c3f(0xd4)]?.[_0x186c3f(0x133)]?'\x20['+_0x5e1139[_0x186c3f(0xd4)][_0x186c3f(0x111)](',\x20')+']':'';console[_0x186c3f(0x136)]('\x20\x20'+(_0x36c04c+0x1)+'.\x20'+a5_0x431ddb[_0x186c3f(0x110)](_0x5e1139[_0x186c3f(0xf8)])+'\x20('+_0x5e1139[_0x186c3f(0xb8)][_0x186c3f(0x133)]+'\x20'+_0x46ce71+')'+a5_0x431ddb[_0x186c3f(0xfd)](_0x112f77));}return 0x0;}let _0xeb2a18,_0x3fd8f7;try{_0xeb2a18=await _0x42525e['llm']['resolveProjectId'](_0x303e61[_0x186c3f(0xb6)]);}catch(_0x120712){const _0xf91bf3=_0x120712 instanceof Error?_0x120712[_0x186c3f(0xff)]:String(_0x120712);return _0xf91bf3[_0x186c3f(0xc4)](_0x186c3f(0x13f))||_0xf91bf3[_0x186c3f(0xcc)]()['includes']('not\x20found')?console[_0x186c3f(0x136)](a5_0x431ddb[_0x186c3f(0xc9)](_0x186c3f(0x139)+_0x303e61[_0x186c3f(0xb6)])):console[_0x186c3f(0x136)](a5_0x431ddb[_0x186c3f(0xc9)](_0x186c3f(0x120)+_0x303e61[_0x186c3f(0xb6)]+_0x186c3f(0xf0)+_0xf91bf3)),0x1;}try{_0x3fd8f7=await _0x42525e['llm'][_0x186c3f(0x116)](_0x303e61[_0x186c3f(0x122)],_0xeb2a18);}catch(_0x3eeac6){const _0x20b12a=_0x3eeac6 instanceof Error?_0x3eeac6[_0x186c3f(0xff)]:String(_0x3eeac6);return _0x20b12a[_0x186c3f(0xc4)]('404')||_0x20b12a['toLowerCase']()[_0x186c3f(0xc4)](_0x186c3f(0xef))?console['log'](a5_0x431ddb[_0x186c3f(0xc9)](_0x186c3f(0xe7)+_0x303e61[_0x186c3f(0x122)])):console['log'](a5_0x431ddb['red'](_0x186c3f(0x118)+_0x303e61[_0x186c3f(0x122)]+_0x186c3f(0xf0)+_0x20b12a)),0x1;}let _0x55c117;if(!_0x5529fc)try{_0x55c117=await setupEvaluatorAgent(_0x42525e[_0x186c3f(0x13b)],_0x2815e4['verbose']);}catch(_0xc3abcc){const _0x3e39fa=_0xc3abcc instanceof Error?_0xc3abcc[_0x186c3f(0xff)]:String(_0xc3abcc);return console[_0x186c3f(0x136)](a5_0x431ddb[_0x186c3f(0xc9)](_0x186c3f(0x143)+_0x3e39fa)),0x1;}console['log'](a5_0x431ddb[_0x186c3f(0x131)](_0x186c3f(0xbd))),console['log'](_0x186c3f(0x101)+a5_0x431ddb['white'](_0x173605)),console[_0x186c3f(0x136)](_0x186c3f(0xe1)+a5_0x431ddb[_0x186c3f(0x110)](_0x303e61[_0x186c3f(0xb6)]+'/'+_0x303e61['agentName'])),console[_0x186c3f(0x136)]();const _0x5cb6e6=[],_0x3b38a0=[],_0x428a65=Date[_0x186c3f(0x11a)]();for(let _0x43ce8a=0x0;_0x43ce8a<_0x4cffff['length'];_0x43ce8a++){const _0x5a8564=_0x4cffff[_0x43ce8a];_0x4cffff['length']>0x1?console[_0x186c3f(0x136)]('Test\x20'+(_0x43ce8a+0x1)+'/'+_0x4cffff[_0x186c3f(0x133)]+':\x20'+a5_0x431ddb[_0x186c3f(0x110)](_0x5a8564[_0x186c3f(0xf8)])):console['log'](_0x186c3f(0xd1)+a5_0x431ddb[_0x186c3f(0x110)](_0x5a8564['name']));const _0x45ae4a=createCommandSpinner(_0x186c3f(0x12c)+_0x5a8564[_0x186c3f(0xb8)]['length']+_0x186c3f(0xd8));_0x45ae4a['start']();try{const {result:_0x128a0d,conversation:_0xe6ca01}=await runTest(_0x42525e[_0x186c3f(0x13b)],_0x5a8564,{'agentId':_0x3fd8f7,'projectId':_0xeb2a18,'site':_0x173605,'noEval':_0x5529fc,'evaluatorId':_0x55c117,'onRoundStart':(_0x5cdf97,_0x1dff57)=>{const _0x37f4b4=_0x186c3f;_0x45ae4a[_0x37f4b4(0x12b)]=_0x37f4b4(0xec)+(_0x5cdf97+0x1)+'/'+_0x1dff57+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x1bde04,_0x17f6a3,_0x248eba)=>{const _0x3daaf1=_0x186c3f,_0x29d497=formatElapsed(_0x17f6a3);_0x248eba?console['log']('\x20\x20Round\x20'+(_0x1bde04+0x1)+'/'+_0x5a8564[_0x3daaf1(0xb8)][_0x3daaf1(0x133)]+_0x3daaf1(0xc0)+a5_0x431ddb['green']('✓')+'\x20('+_0x29d497+')'):console['log'](_0x3daaf1(0xe2)+(_0x1bde04+0x1)+'/'+_0x5a8564[_0x3daaf1(0xb8)][_0x3daaf1(0x133)]+'...\x20'+a5_0x431ddb['red']('✗'));},'onEvaluationStart':()=>{const _0xc7699f=_0x186c3f;_0x45ae4a[_0xc7699f(0x12b)]=_0xc7699f(0x108);},'onEvaluationComplete':_0x25affe=>{const _0xf9165d=_0x186c3f,_0xce5080=formatElapsed(_0x25affe);console[_0xf9165d(0x136)](_0xf9165d(0xcb)+a5_0x431ddb[_0xf9165d(0x103)]('✓')+'\x20('+_0xce5080+')');}});_0x45ae4a[_0x186c3f(0xe0)](),_0x5cb6e6[_0x186c3f(0x113)](_0x128a0d),_0x3b38a0[_0x186c3f(0x113)](_0xe6ca01);if(_0x128a0d[_0x186c3f(0x119)]===_0x186c3f(0xd2))console[_0x186c3f(0x136)](a5_0x431ddb[_0x186c3f(0x103)](_0x186c3f(0xb7)+_0x128a0d[_0x186c3f(0xd5)]));else _0x128a0d[_0x186c3f(0x119)]===_0x186c3f(0xfb)?console[_0x186c3f(0x136)](a5_0x431ddb[_0x186c3f(0xc9)](_0x186c3f(0x124)+_0x128a0d[_0x186c3f(0xd5)])):console[_0x186c3f(0x136)](a5_0x431ddb[_0x186c3f(0xc9)]('✗\x20ERROR:\x20'+_0x128a0d[_0x186c3f(0xd5)]));_0x128a0d[_0x186c3f(0xb2)]&&console[_0x186c3f(0x136)](a5_0x431ddb[_0x186c3f(0xfd)](_0x186c3f(0x104)+_0x128a0d[_0x186c3f(0xb2)])),console[_0x186c3f(0x136)]();}catch(_0x5aac25){_0x45ae4a[_0x186c3f(0xe0)]();const _0x326074=_0x5aac25 instanceof Error?_0x5aac25[_0x186c3f(0xff)]:String(_0x5aac25);console[_0x186c3f(0x136)](a5_0x431ddb[_0x186c3f(0xc9)](_0x186c3f(0xb4)+_0x326074)),console[_0x186c3f(0x136)](),_0x5cb6e6['push']({'name':_0x5a8564[_0x186c3f(0xf8)],'status':_0x186c3f(0x11b),'reason':_0x326074,'timestamp':new Date()[_0x186c3f(0xdc)](),'duration_ms':0x0});}}const _0x3d57a6=Date[_0x186c3f(0x11a)]()-_0x428a65,_0x52a568=_0x5cb6e6[_0x186c3f(0xea)](_0x72dcef=>_0x72dcef[_0x186c3f(0x119)]===_0x186c3f(0xd2))[_0x186c3f(0x133)],_0x30b134=_0x5cb6e6[_0x186c3f(0xea)](_0x14bc68=>_0x14bc68[_0x186c3f(0x119)]==='FAIL')[_0x186c3f(0x133)],_0x47e013=_0x5cb6e6['filter'](_0x7e5455=>_0x7e5455[_0x186c3f(0x119)]===_0x186c3f(0x11b))[_0x186c3f(0x133)];console[_0x186c3f(0x136)]('━'['repeat'](0x3c)),console[_0x186c3f(0x136)](_0x186c3f(0xfe)),console[_0x186c3f(0x136)]('━'[_0x186c3f(0x11e)](0x3c)),console[_0x186c3f(0x136)](_0x186c3f(0x144)+_0x5cb6e6[_0x186c3f(0x133)]),console['log']('Passed:\x20\x20\x20'+a5_0x431ddb[_0x186c3f(0x103)](_0x52a568)),console[_0x186c3f(0x136)]('Failed:\x20\x20\x20'+a5_0x431ddb[_0x186c3f(0xc9)](_0x30b134));_0x47e013>0x0&&console[_0x186c3f(0x136)](_0x186c3f(0x109)+a5_0x431ddb[_0x186c3f(0xc9)](_0x47e013));console[_0x186c3f(0x136)](_0x186c3f(0x10c)+formatElapsed(_0x3d57a6)),console[_0x186c3f(0x136)]('━'[_0x186c3f(0x11e)](0x3c));const _0x295e22=_0x5cb6e6[_0x186c3f(0xea)](_0x38de13=>_0x38de13[_0x186c3f(0x119)]!=='PASS');if(_0x295e22['length']>0x0){console['log'](),console[_0x186c3f(0x136)](_0x186c3f(0xc8));for(const _0x1c347a of _0x295e22){const _0x1ab6ae=a5_0x431ddb[_0x186c3f(0xc9)]('✗'),_0x33a939=_0x1c347a['reason']['length']>0x32?_0x1c347a[_0x186c3f(0xd5)][_0x186c3f(0x140)](0x0,0x32)+_0x186c3f(0x13a):_0x1c347a[_0x186c3f(0xd5)];console[_0x186c3f(0x136)]('\x20\x20'+_0x1ab6ae+'\x20'+_0x1c347a[_0x186c3f(0xf8)]+':\x20'+_0x33a939);}}const _0x198070={'summary':{'total':_0x5cb6e6[_0x186c3f(0x133)],'passed':_0x52a568,'failed':_0x30b134,'errors':_0x47e013>0x0?_0x47e013:undefined,'duration_ms':_0x3d57a6},'tests':_0x5cb6e6,'agent':{'project':_0x303e61['projectName'],'name':_0x303e61[_0x186c3f(0x122)],'site':_0x173605},'timestamp':new Date(_0x428a65)[_0x186c3f(0xdc)]()};try{const _0xab656f=buildCachedTestRun(_0x3b38a0,{'site':_0x173605,'projectId':_0xeb2a18,'projectName':_0x303e61[_0x186c3f(0xb6)],'agentId':_0x3fd8f7,'agentName':_0x303e61[_0x186c3f(0x122)],'testYmlPath':a5_0x2061e7[_0x186c3f(0xbe)](_0x303e61[_0x186c3f(0x121)])});saveLastTestRun(_0xab656f);}catch{}if(_0x2f5be1!==_0x186c3f(0x13e)||_0x4a2e82){const _0x14195b=formatResults(_0x198070,_0x2f5be1);if(_0x4a2e82)try{a5_0x431961[_0x186c3f(0xaf)](_0x4a2e82,_0x14195b,_0x186c3f(0xae)),console['log'](),console[_0x186c3f(0x136)](a5_0x431ddb[_0x186c3f(0xfd)](_0x186c3f(0xf2)+_0x4a2e82));}catch(_0x2ef33c){return console[_0x186c3f(0x136)](),console[_0x186c3f(0x136)](a5_0x431ddb['red']('Error\x20writing\x20output\x20file:\x20'+_0x2ef33c)),0x1;}else console['log'](),console[_0x186c3f(0x136)](_0x14195b);}return _0x295e22[_0x186c3f(0x133)]>0x0?0x1:0x0;}async[a5_0x500993(0xb9)](_0x1d0956,_0x62fc53){const _0x16efed=a5_0x500993,{options:_0x43423f,tdx:_0x154f45}=_0x1d0956,{definition:_0x35086b,agentInfo:_0x5bd769,outputFormat:_0x1223ab,outputFile:_0x3711b2}=_0x62fc53,_0x55718f=_0x43423f[_0x16efed(0xc6)],_0x560975=loadLastTestRun();if(!_0x560975)return console['log'](a5_0x431ddb[_0x16efed(0xc9)](_0x16efed(0xdd))),console[_0x16efed(0x136)](a5_0x431ddb[_0x16efed(0xfd)](_0x16efed(0x142))),0x1;if(_0x560975[_0x16efed(0x128)][_0x16efed(0x122)]!==_0x5bd769[_0x16efed(0x122)])return console[_0x16efed(0x136)](a5_0x431ddb[_0x16efed(0xc9)](_0x16efed(0x13c)+_0x560975[_0x16efed(0x128)][_0x16efed(0x122)]+_0x16efed(0xd6)+_0x5bd769[_0x16efed(0x122)]+'\x22.')),console[_0x16efed(0x136)](a5_0x431ddb[_0x16efed(0xfd)](_0x16efed(0xad))),0x1;const _0x53cd50=new Set(_0x560975[_0x16efed(0xd0)][_0x16efed(0x135)](_0x3fd20b=>_0x3fd20b[_0x16efed(0xf4)])),_0x38918a=_0x35086b[_0x16efed(0x115)][_0x16efed(0xea)](_0x3f2191=>!_0x53cd50['has'](_0x3f2191['name']));if(_0x38918a['length']>0x0&&_0x560975[_0x16efed(0xc6)]!==_0x55718f)return console[_0x16efed(0x136)](a5_0x431ddb[_0x16efed(0xc9)](_0x16efed(0xf3))),console[_0x16efed(0x136)](a5_0x431ddb['dim'](_0x16efed(0xc2)+_0x560975[_0x16efed(0xc6)]+_0x16efed(0xeb)+_0x55718f+'\x22.')),console[_0x16efed(0x136)](a5_0x431ddb[_0x16efed(0xfd)](_0x16efed(0xc7)+_0x560975['site']+_0x16efed(0x105))),0x1;const _0x1bd0d1=_0x35086b[_0x16efed(0x115)][_0x16efed(0xea)](_0x532e70=>_0x53cd50[_0x16efed(0x11f)](_0x532e70[_0x16efed(0xf8)])),_0x479f94=_0x38918a;let _0x2bba1a;try{_0x2bba1a=await setupEvaluatorAgent(_0x154f45[_0x16efed(0x13b)],_0x43423f[_0x16efed(0x132)]);}catch(_0x1fd64f){const _0xf286d0=_0x1fd64f instanceof Error?_0x1fd64f[_0x16efed(0xff)]:String(_0x1fd64f);return console[_0x16efed(0x136)](a5_0x431ddb[_0x16efed(0xc9)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0xf286d0)),0x1;}console[_0x16efed(0x136)](a5_0x431ddb[_0x16efed(0x131)](_0x16efed(0x126))),console[_0x16efed(0x136)](_0x16efed(0x117)+a5_0x431ddb[_0x16efed(0x110)](_0x560975[_0x16efed(0x141)])),console[_0x16efed(0x136)](_0x16efed(0xe1)+a5_0x431ddb[_0x16efed(0x110)](_0x560975[_0x16efed(0x128)][_0x16efed(0xb6)]+'/'+_0x560975[_0x16efed(0x128)][_0x16efed(0x122)]));_0x479f94[_0x16efed(0x133)]>0x0&&console['log'](_0x16efed(0x11c)+a5_0x431ddb[_0x16efed(0xdf)](_0x479f94[_0x16efed(0x133)]));console[_0x16efed(0x136)]();const _0x1c804b=[],_0x1d3090=Date[_0x16efed(0x11a)](),_0x1d7f4a=createCommandSpinner(_0x16efed(0xb1));if(_0x1bd0d1['length']>0x0)try{const _0xb9f1f4=await reevaluateFromCache(_0x154f45['llm'],_0x560975,{'tests':_0x1bd0d1},{'evaluatorId':_0x2bba1a,'onTestStart':(_0x376143,_0x118220,_0x10fead)=>{const _0x97918f=_0x16efed;_0x1d7f4a['text']=_0x97918f(0x12a)+(_0x118220+0x1)+'/'+_0x10fead+':\x20'+_0x376143+_0x97918f(0x13a);if(!_0x1d7f4a['isSpinning'])_0x1d7f4a['start']();},'onTestComplete':(_0x4f41c4,_0x39e85a)=>{const _0x3c4a44=_0x16efed;_0x1d7f4a[_0x3c4a44(0xe0)]();if(_0x39e85a['status']===_0x3c4a44(0xd2))console['log'](a5_0x431ddb[_0x3c4a44(0x103)](_0x3c4a44(0xb7)+_0x4f41c4)+a5_0x431ddb[_0x3c4a44(0xfd)](_0x3c4a44(0xb3)));else _0x39e85a['status']===_0x3c4a44(0xfb)?console['log'](a5_0x431ddb[_0x3c4a44(0xc9)]('✗\x20FAIL:\x20'+_0x4f41c4+_0x3c4a44(0x134)+_0x39e85a[_0x3c4a44(0xd5)])+a5_0x431ddb[_0x3c4a44(0xfd)](_0x3c4a44(0xb3))):console['log'](a5_0x431ddb[_0x3c4a44(0xc9)]('✗\x20ERROR:\x20'+_0x4f41c4+_0x3c4a44(0x134)+_0x39e85a['reason']));_0x39e85a[_0x3c4a44(0xb2)]&&console[_0x3c4a44(0x136)](a5_0x431ddb[_0x3c4a44(0xfd)](_0x3c4a44(0xda)+_0x39e85a[_0x3c4a44(0xb2)])),_0x1c804b[_0x3c4a44(0x113)](_0x39e85a);},'onTestSkipped':(_0x4003d1,_0x1182f6)=>{const _0xd608af=_0x16efed;_0x1d7f4a[_0xd608af(0xe0)](),console['log'](a5_0x431ddb['yellow'](_0xd608af(0xd9)+_0x4003d1+_0xd608af(0x134)+_0x1182f6));}});for(const _0x660dfd of _0xb9f1f4){!_0x1c804b['find'](_0x48c270=>_0x48c270[_0x16efed(0xf8)]===_0x660dfd['name'])&&_0x1c804b['push'](_0x660dfd);}}catch(_0x74b02c){_0x1d7f4a['stop']();const _0x44b468=_0x74b02c instanceof Error?_0x74b02c[_0x16efed(0xff)]:String(_0x74b02c);return console[_0x16efed(0x136)](a5_0x431ddb[_0x16efed(0xc9)](_0x16efed(0xe5)+_0x44b468)),0x1;}_0x1d7f4a[_0x16efed(0xe0)]();if(_0x479f94[_0x16efed(0x133)]>0x0){console[_0x16efed(0x136)](),console[_0x16efed(0x136)](a5_0x431ddb[_0x16efed(0x131)](_0x16efed(0xc1)));const {projectId:_0x36976f,agentId:_0x4ad207}=_0x560975[_0x16efed(0x128)];for(const _0xdf9a01 of _0x479f94){console[_0x16efed(0x136)](_0x16efed(0xfc)+a5_0x431ddb[_0x16efed(0x110)](_0xdf9a01[_0x16efed(0xf8)]));const _0x4fbb2f=createCommandSpinner('Round\x201/'+_0xdf9a01[_0x16efed(0xb8)][_0x16efed(0x133)]+':\x20Sending\x20user\x20input...');_0x4fbb2f[_0x16efed(0xca)]();try{const {result:_0x5c88b5}=await runTest(_0x154f45[_0x16efed(0x13b)],_0xdf9a01,{'agentId':_0x4ad207,'projectId':_0x36976f,'site':_0x560975[_0x16efed(0xc6)],'noEval':![],'evaluatorId':_0x2bba1a,'onRoundStart':(_0x257c01,_0x13b0cd)=>{const _0x16f7b7=_0x16efed;_0x4fbb2f[_0x16f7b7(0x12b)]=_0x16f7b7(0xec)+(_0x257c01+0x1)+'/'+_0x13b0cd+_0x16f7b7(0xd8);},'onRoundComplete':(_0x56960e,_0x20d2c2,_0x5077b1)=>{const _0x1e949b=_0x16efed,_0x3e83dd=formatElapsed(_0x20d2c2);_0x5077b1?console[_0x1e949b(0x136)](_0x1e949b(0xe2)+(_0x56960e+0x1)+'/'+_0xdf9a01[_0x1e949b(0xb8)][_0x1e949b(0x133)]+_0x1e949b(0xc0)+a5_0x431ddb[_0x1e949b(0x103)]('✓')+'\x20('+_0x3e83dd+')'):console[_0x1e949b(0x136)](_0x1e949b(0xe2)+(_0x56960e+0x1)+'/'+_0xdf9a01[_0x1e949b(0xb8)][_0x1e949b(0x133)]+_0x1e949b(0xc0)+a5_0x431ddb[_0x1e949b(0xc9)]('✗'));},'onEvaluationStart':()=>{const _0x3e137a=_0x16efed;_0x4fbb2f[_0x3e137a(0x12b)]=_0x3e137a(0x108);},'onEvaluationComplete':_0x21b1b6=>{const _0x490631=_0x16efed,_0x2d18ca=formatElapsed(_0x21b1b6);console[_0x490631(0x136)]('\x20\x20Evaluating...\x20'+a5_0x431ddb['green']('✓')+'\x20('+_0x2d18ca+')');}});_0x4fbb2f[_0x16efed(0xe0)](),_0x1c804b[_0x16efed(0x113)](_0x5c88b5);if(_0x5c88b5[_0x16efed(0x119)]==='PASS')console[_0x16efed(0x136)](a5_0x431ddb[_0x16efed(0x103)]('✓\x20PASS:\x20'+_0x5c88b5[_0x16efed(0xd5)])+a5_0x431ddb[_0x16efed(0xfd)](_0x16efed(0x12e)));else _0x5c88b5[_0x16efed(0x119)]===_0x16efed(0xfb)?console[_0x16efed(0x136)](a5_0x431ddb[_0x16efed(0xc9)](_0x16efed(0x124)+_0x5c88b5[_0x16efed(0xd5)])+a5_0x431ddb[_0x16efed(0xfd)]('\x20(new)')):console['log'](a5_0x431ddb[_0x16efed(0xc9)](_0x16efed(0xb4)+_0x5c88b5['reason']));_0x5c88b5[_0x16efed(0xb2)]&&console['log'](a5_0x431ddb[_0x16efed(0xfd)](_0x16efed(0xda)+_0x5c88b5[_0x16efed(0xb2)]));}catch(_0x5427e8){_0x4fbb2f[_0x16efed(0xe0)]();const _0x55cf7a=_0x5427e8 instanceof Error?_0x5427e8['message']:String(_0x5427e8);console[_0x16efed(0x136)](a5_0x431ddb[_0x16efed(0xc9)](_0x16efed(0xb4)+_0x55cf7a)),_0x1c804b['push']({'name':_0xdf9a01[_0x16efed(0xf8)],'status':'ERROR','reason':_0x55cf7a,'timestamp':new Date()[_0x16efed(0xdc)](),'duration_ms':0x0});}}}console[_0x16efed(0x136)]();const _0x2686e9=Date[_0x16efed(0x11a)]()-_0x1d3090,_0x5c4197=_0x1c804b[_0x16efed(0xea)](_0x5a1af7=>_0x5a1af7['status']==='PASS')[_0x16efed(0x133)],_0xb104f3=_0x1c804b[_0x16efed(0xea)](_0x53109d=>_0x53109d['status']===_0x16efed(0xfb))[_0x16efed(0x133)],_0x2a9cc7=_0x1c804b['filter'](_0x3ce141=>_0x3ce141[_0x16efed(0x119)]==='ERROR')[_0x16efed(0x133)];console[_0x16efed(0x136)]('━'[_0x16efed(0x11e)](0x3c)),console[_0x16efed(0x136)](_0x16efed(0x106)),console[_0x16efed(0x136)]('━'[_0x16efed(0x11e)](0x3c)),console['log'](_0x16efed(0x144)+_0x1c804b['length']),console[_0x16efed(0x136)](_0x16efed(0xc3)+a5_0x431ddb[_0x16efed(0x103)](_0x5c4197)),console[_0x16efed(0x136)]('Failed:\x20\x20\x20'+a5_0x431ddb[_0x16efed(0xc9)](_0xb104f3));_0x2a9cc7>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x431ddb[_0x16efed(0xc9)](_0x2a9cc7));console[_0x16efed(0x136)](_0x16efed(0x10c)+formatElapsed(_0x2686e9)),console[_0x16efed(0x136)]('━'[_0x16efed(0x11e)](0x3c));const _0x4e7069={'summary':{'total':_0x1c804b[_0x16efed(0x133)],'passed':_0x5c4197,'failed':_0xb104f3,'errors':_0x2a9cc7>0x0?_0x2a9cc7:undefined,'duration_ms':_0x2686e9},'tests':_0x1c804b,'agent':{'project':_0x5bd769[_0x16efed(0xb6)],'name':_0x5bd769[_0x16efed(0x122)],'site':_0x55718f},'timestamp':new Date(_0x1d3090)[_0x16efed(0xdc)]()};if(_0x1223ab!=='table'||_0x3711b2){const _0x3e3d0e=formatResults(_0x4e7069,_0x1223ab);if(_0x3711b2)try{a5_0x431961[_0x16efed(0xaf)](_0x3711b2,_0x3e3d0e,'utf-8'),console[_0x16efed(0x136)](),console[_0x16efed(0x136)](a5_0x431ddb[_0x16efed(0xfd)](_0x16efed(0xf2)+_0x3711b2));}catch(_0x161a82){return console[_0x16efed(0x136)](),console[_0x16efed(0x136)](a5_0x431ddb[_0x16efed(0xc9)](_0x16efed(0x137)+_0x161a82)),0x1;}else console[_0x16efed(0x136)](),console['log'](_0x3e3d0e);}const _0x101e00=_0x1c804b['filter'](_0xc83891=>_0xc83891[_0x16efed(0x119)]!=='PASS');return _0x101e00['length']>0x0?0x1:0x0;}}
1
+ function a5_0x130f(){const _0x31e687=['...\x20','Available\x20tests:\x20','✓\x20PASS:\x20','Running:\x20','Project\x20path:\x20','tsv','text','404','testName','\x20\x20Site:\x20','now','\x22:\x20','projectName','\x20\x20Round\x20','some','stop','includes','Cached\x20run\x20is\x20from\x20site\x20\x22','Evaluating\x20response...','\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)','cyan','Available\x20tags:\x20','add','test.yml','start','\x20\x20Conversation:\x20','No\x20tests\x20found\x20with\x20tags:\x20','Output\x20written\x20to:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Failed:\x20\x20\x20','Duration:\x20','Re-evaluating\x20','36738GCDGYK','json','no_context','Test\x20','Executing\x20new\x20tests...','\x20(cached)','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','verbose','ERROR','Run\x20tests\x20for\x20an\x20LLM\x20agent','multiple_agents','Run\x20\x27tdx\x20agent\x20pull\x20','Either\x20switch\x20to\x20the\x20\x22','378HZpAhW','Conversation\x20URL:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Re-evaluating...','FAIL','dim','\x20\x20-\x20','Passed:\x20\x20\x20','description','reason','\x22,\x20but\x20current\x20site\x20is\x20\x22','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','agentName','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Tests\x20found:\x20','green','agent:test','Round\x201/','repeat','utf-8','Running\x20agent\x20tests...','\x20-\x20','basename','3FrvBiT','792508hfDFTe','white','PASS','Error:\x20No\x20previous\x20test\x20run\x20found.','No\x20tests\x20found\x20matching:\x20','testYmlPath','tests','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','conversations','Errors:\x20\x20\x20','join','conversation_url','llmProject','Error\x20writing\x20output\x20file:\x20','Round\x20','substring','✗\x20ERROR:\x20','table','yellow','push','find','status','23768nYXgZB','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','rounds','Total:\x20\x20\x20\x20','✗\x20FAIL:\x20','length','has','projectDir','size','Using\x20agent:\x20','2007985QTUnmi','\x27\x20to\x20create\x20the\x20folder\x20structure.','176326FIoPpY','tags','toLowerCase','agent','message','round','site','isSpinning',':\x20Sending\x20user\x20input...','no_tests','dryRun','resolve','/<agent-name>','\x20\x20Evaluating...\x20','resolveProjectId','executeReeval','\x20\x20Project:\x20','log','Failed\x20Tests:','Site:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','toISOString','New\x20tests\x20to\x20execute:\x20','\x20(new)','Usage:','jsonl','311170NTdUpM','output','filter','split','map','writeFileSync','reeval','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','existsSync','resolveAgentId','...','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','execute','Running\x20test:\x20','name','red','trim','llm','75320iUGGyN','Cached\x20run\x20from:\x20','Agent:\x20'];a5_0x130f=function(){return _0x31e687;};return a5_0x130f();}function a5_0x404f(_0x74378c,_0x690966){_0x74378c=_0x74378c-0x146;const _0x130f6a=a5_0x130f();let _0x404f3f=_0x130f6a[_0x74378c];return _0x404f3f;}const a5_0x4054c3=a5_0x404f;(function(_0x282fa6,_0x18686c){const _0x2a6031=a5_0x404f,_0x506991=_0x282fa6();while(!![]){try{const _0x53f547=parseInt(_0x2a6031(0x167))/0x1+-parseInt(_0x2a6031(0x1d2))/0x2+-parseInt(_0x2a6031(0x1ae))/0x3*(parseInt(_0x2a6031(0x1af))/0x4)+-parseInt(_0x2a6031(0x155))/0x5+parseInt(_0x2a6031(0x18a))/0x6+parseInt(_0x2a6031(0x1d0))/0x7+parseInt(_0x2a6031(0x1c6))/0x8*(parseInt(_0x2a6031(0x197))/0x9);if(_0x53f547===_0x18686c)break;else _0x506991['push'](_0x506991['shift']());}catch(_0x303558){_0x506991['push'](_0x506991['shift']());}}}(a5_0x130f,0x234ac));import*as a5_0x454be6 from'node:fs';import*as a5_0x209112 from'node:path';import a5_0x30cc29 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0x4054c3(0x1a7);[a5_0x4054c3(0x19f)]=a5_0x4054c3(0x193);async[a5_0x4054c3(0x161)](_0x27efe8){const _0x4d4e0=a5_0x4054c3,{options:_0x5ae384,args:_0x501306,tdx:_0x480780}=_0x27efe8,_0x3415cd=_0x501306[0x0]||'.',_0x3b49df=_0x5ae384[_0x4d4e0(0x1dc)],_0x4e4942=_0x5ae384,_0x5aca8a=_0x4e4942['eval']===![],_0xaeddd4=_0x4e4942[_0x4d4e0(0x15b)],_0x20bf50=_0x4e4942[_0x4d4e0(0x163)],_0x5e7997=_0x4e4942[_0x4d4e0(0x1d3)],_0x2337eb=_0x5ae384['site'],_0x53eb0e=_0x4e4942[_0x4d4e0(0x156)];if(_0xaeddd4&&_0x5aca8a)return console['log'](a5_0x30cc29[_0x4d4e0(0x164)](_0x4d4e0(0x15c))),0x1;let _0x50923f=_0x4d4e0(0x1c1);if(_0x4e4942[_0x4d4e0(0x18b)])_0x50923f=_0x4d4e0(0x18b);else{if(_0x4e4942['jsonl'])_0x50923f=_0x4d4e0(0x154);else{if(_0x4e4942[_0x4d4e0(0x16f)])_0x50923f=_0x4d4e0(0x16f);else{if(_0x4e4942[_0x4d4e0(0x1c1)])_0x50923f='table';}}}const _0x3a4d97=_0x4e4942[_0x4d4e0(0x1bc)];let _0x40c9f2=_0x3415cd;const _0x1eeed4=a5_0x454be6[_0x4d4e0(0x15d)](_0x3415cd),_0x5cb21e=_0x3415cd==='.';if(!_0x1eeed4||_0x5cb21e){const _0x1eba19=resolveProjectFromContext(_0x3415cd,_0x3a4d97,{'requireFile':_0x4d4e0(0x181)});if(_0x1eba19['found'])_0x40c9f2=_0x1eba19[_0x4d4e0(0x1cd)],_0x1eba19['source']==='context'&&console[_0x4d4e0(0x14b)](a5_0x30cc29['dim'](_0x4d4e0(0x1cf)+_0x40c9f2));else switch(_0x1eba19[_0x4d4e0(0x1a0)]){case _0x4d4e0(0x18c):console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x1c2)](_0x1eba19[_0x4d4e0(0x1d6)])),console[_0x4d4e0(0x14b)](),console['log'](_0x4d4e0(0x153)),console[_0x4d4e0(0x14b)]('\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'](_0x4d4e0(0x17d)),console['log'](),console[_0x4d4e0(0x14b)](_0x4d4e0(0x14e));return 0x1;case'no_local_folder':console['log'](a5_0x30cc29[_0x4d4e0(0x1c2)](_0x1eba19['message'])),console[_0x4d4e0(0x14b)](),console['log'](_0x4d4e0(0x195)+_0x1eba19['llmProject']+_0x4d4e0(0x1d1));return 0x1;case _0x4d4e0(0x194):{const _0x50404b=a5_0x209112[_0x4d4e0(0x1ad)](_0x1eba19[_0x4d4e0(0x1cd)]);console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x1c2)](_0x4d4e0(0x1b6)+_0x1eba19[_0x4d4e0(0x1bc)]+'\x22:'));for(const _0x2f579c of _0x1eba19['agentDirs']){console['log'](_0x4d4e0(0x19d)+_0x2f579c);}return console['log'](),console[_0x4d4e0(0x14b)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x50404b+_0x4d4e0(0x146)),0x1;}case _0x4d4e0(0x1db):console['log'](a5_0x30cc29['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x1eba19[_0x4d4e0(0x1bc)]+'\x22.')),console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x19c)](_0x4d4e0(0x16e)+_0x1eba19['projectDir'])),console[_0x4d4e0(0x14b)](),console[_0x4d4e0(0x14b)](_0x4d4e0(0x14f));return 0x1;}}const {definition:_0x2f7839,agentInfo:_0x1b3616}=parseTestFile(_0x40c9f2);let _0x4ca613=_0x2f7839[_0x4d4e0(0x1b5)];if(_0x20bf50){const _0x20af1d=_0x20bf50[_0x4d4e0(0x158)](',')[_0x4d4e0(0x159)](_0x204f21=>_0x204f21['trim']());_0x4ca613=_0x2f7839['tests']['filter'](_0x5c6e0c=>_0x20af1d[_0x4d4e0(0x17a)](_0x5c6e0c['name']));if(_0x4ca613[_0x4d4e0(0x1cb)]===0x0)return console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x1c2)](_0x4d4e0(0x1b3)+_0x20bf50)),console[_0x4d4e0(0x14b)](a5_0x30cc29['dim'](_0x4d4e0(0x16b)+_0x2f7839[_0x4d4e0(0x1b5)]['map'](_0x29ef4d=>_0x29ef4d[_0x4d4e0(0x163)])[_0x4d4e0(0x1ba)](',\x20'))),0x1;}if(_0x5e7997){const _0x445095=_0x5e7997[_0x4d4e0(0x158)](',')[_0x4d4e0(0x159)](_0x50fb57=>_0x50fb57[_0x4d4e0(0x165)]()[_0x4d4e0(0x1d4)]());_0x4ca613=_0x4ca613['filter'](_0x400438=>_0x400438[_0x4d4e0(0x1d3)]?.[_0x4d4e0(0x178)](_0x24444c=>_0x445095['includes'](_0x24444c[_0x4d4e0(0x1d4)]())));if(_0x4ca613['length']===0x0){console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x1c2)](_0x4d4e0(0x184)+_0x5e7997));const _0x1aefa9=new Set();return _0x2f7839[_0x4d4e0(0x1b5)]['forEach'](_0x564927=>_0x564927['tags']?.['forEach'](_0x779181=>_0x1aefa9[_0x4d4e0(0x180)](_0x779181))),_0x1aefa9[_0x4d4e0(0x1ce)]>0x0?console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x19c)](_0x4d4e0(0x17f)+[..._0x1aefa9]['join'](',\x20'))):console[_0x4d4e0(0x14b)](a5_0x30cc29['dim']('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0xaeddd4)return this['executeReeval'](_0x27efe8,{'definition':{'tests':_0x4ca613},'agentInfo':_0x1b3616,'outputFormat':_0x50923f,'outputFile':_0x53eb0e,'testNames':_0x20bf50});if(_0x3b49df){console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x17e)]('Test\x20Configuration:')),console[_0x4d4e0(0x14b)](_0x4d4e0(0x173)+a5_0x30cc29[_0x4d4e0(0x1b0)](_0x2337eb)),console[_0x4d4e0(0x14b)](_0x4d4e0(0x14a)+a5_0x30cc29[_0x4d4e0(0x1b0)](_0x1b3616[_0x4d4e0(0x176)])),console[_0x4d4e0(0x14b)]('\x20\x20Agent:\x20'+a5_0x30cc29['white'](_0x1b3616['agentName'])),console['log'](),console[_0x4d4e0(0x14b)](_0x4d4e0(0x1a5)+a5_0x30cc29[_0x4d4e0(0x1b0)](_0x4ca613[_0x4d4e0(0x1cb)]));for(let _0x4e986d=0x0;_0x4e986d<_0x4ca613[_0x4d4e0(0x1cb)];_0x4e986d++){const _0x534006=_0x4ca613[_0x4e986d],_0x301af5=_0x534006[_0x4d4e0(0x1c8)]['length']===0x1?_0x4d4e0(0x1d7):_0x4d4e0(0x1c8),_0x4556fa=_0x534006[_0x4d4e0(0x1d3)]?.['length']?'\x20['+_0x534006[_0x4d4e0(0x1d3)][_0x4d4e0(0x1ba)](',\x20')+']':'';console['log']('\x20\x20'+(_0x4e986d+0x1)+'.\x20'+a5_0x30cc29[_0x4d4e0(0x1b0)](_0x534006[_0x4d4e0(0x163)])+'\x20('+_0x534006[_0x4d4e0(0x1c8)][_0x4d4e0(0x1cb)]+'\x20'+_0x301af5+')'+a5_0x30cc29[_0x4d4e0(0x19c)](_0x4556fa));}return 0x0;}let _0x58e9e2,_0x25cf50;try{_0x58e9e2=await _0x480780[_0x4d4e0(0x166)][_0x4d4e0(0x148)](_0x1b3616[_0x4d4e0(0x176)]);}catch(_0x57dc3d){const _0x2bb2e6=_0x57dc3d instanceof Error?_0x57dc3d['message']:String(_0x57dc3d);return _0x2bb2e6[_0x4d4e0(0x17a)](_0x4d4e0(0x171))||_0x2bb2e6[_0x4d4e0(0x1d4)]()[_0x4d4e0(0x17a)]('not\x20found')?console['log'](a5_0x30cc29['red']('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x1b3616[_0x4d4e0(0x176)])):console['log'](a5_0x30cc29[_0x4d4e0(0x164)](_0x4d4e0(0x160)+_0x1b3616[_0x4d4e0(0x176)]+_0x4d4e0(0x175)+_0x2bb2e6)),0x1;}try{_0x25cf50=await _0x480780[_0x4d4e0(0x166)][_0x4d4e0(0x15e)](_0x1b3616[_0x4d4e0(0x1a3)],_0x58e9e2);}catch(_0x2cb56e){const _0x4c138c=_0x2cb56e instanceof Error?_0x2cb56e[_0x4d4e0(0x1d6)]:String(_0x2cb56e);return _0x4c138c[_0x4d4e0(0x17a)]('404')||_0x4c138c[_0x4d4e0(0x1d4)]()[_0x4d4e0(0x17a)]('not\x20found')?console['log'](a5_0x30cc29['red']('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x1b3616[_0x4d4e0(0x1a3)])):console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x164)](_0x4d4e0(0x1b7)+_0x1b3616[_0x4d4e0(0x1a3)]+_0x4d4e0(0x175)+_0x4c138c)),0x1;}let _0x48301d;if(!_0x5aca8a)try{_0x48301d=await setupEvaluatorAgent(_0x480780['llm'],_0x5ae384['verbose']);}catch(_0xc83081){const _0x212c7b=_0xc83081 instanceof Error?_0xc83081[_0x4d4e0(0x1d6)]:String(_0xc83081);return console[_0x4d4e0(0x14b)](a5_0x30cc29['red'](_0x4d4e0(0x199)+_0x212c7b)),0x1;}console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x17e)](_0x4d4e0(0x1ab))),console[_0x4d4e0(0x14b)](_0x4d4e0(0x14d)+a5_0x30cc29['white'](_0x2337eb)),console[_0x4d4e0(0x14b)](_0x4d4e0(0x169)+a5_0x30cc29[_0x4d4e0(0x1b0)](_0x1b3616[_0x4d4e0(0x176)]+'/'+_0x1b3616[_0x4d4e0(0x1a3)])),console['log']();const _0x5218e6=[],_0x77074b=[],_0x20cc30=Date[_0x4d4e0(0x174)]();for(let _0x205c69=0x0;_0x205c69<_0x4ca613[_0x4d4e0(0x1cb)];_0x205c69++){const _0x4281c3=_0x4ca613[_0x205c69];_0x4ca613[_0x4d4e0(0x1cb)]>0x1?console[_0x4d4e0(0x14b)](_0x4d4e0(0x18d)+(_0x205c69+0x1)+'/'+_0x4ca613[_0x4d4e0(0x1cb)]+':\x20'+a5_0x30cc29[_0x4d4e0(0x1b0)](_0x4281c3[_0x4d4e0(0x163)])):console['log'](_0x4d4e0(0x162)+a5_0x30cc29['white'](_0x4281c3[_0x4d4e0(0x163)]));const _0x210b45=createCommandSpinner(_0x4d4e0(0x1a8)+_0x4281c3[_0x4d4e0(0x1c8)][_0x4d4e0(0x1cb)]+_0x4d4e0(0x1da));_0x210b45[_0x4d4e0(0x182)]();try{const {result:_0x1a733c,conversation:_0x5bcc8d}=await runTest(_0x480780[_0x4d4e0(0x166)],_0x4281c3,{'agentId':_0x25cf50,'projectId':_0x58e9e2,'site':_0x2337eb,'noEval':_0x5aca8a,'evaluatorId':_0x48301d,'onRoundStart':(_0x5ec4e0,_0x4dd9c4)=>{const _0x3259c4=_0x4d4e0;_0x210b45[_0x3259c4(0x170)]=_0x3259c4(0x1be)+(_0x5ec4e0+0x1)+'/'+_0x4dd9c4+_0x3259c4(0x1da);},'onRoundComplete':(_0x4d2d83,_0x47701c,_0x57922a)=>{const _0x51c6ae=_0x4d4e0,_0x3786bd=formatElapsed(_0x47701c);_0x57922a?console[_0x51c6ae(0x14b)](_0x51c6ae(0x177)+(_0x4d2d83+0x1)+'/'+_0x4281c3['rounds']['length']+_0x51c6ae(0x16a)+a5_0x30cc29['green']('✓')+'\x20('+_0x3786bd+')'):console[_0x51c6ae(0x14b)](_0x51c6ae(0x177)+(_0x4d2d83+0x1)+'/'+_0x4281c3['rounds']['length']+_0x51c6ae(0x16a)+a5_0x30cc29[_0x51c6ae(0x164)]('✗'));},'onEvaluationStart':()=>{const _0x4789b6=_0x4d4e0;_0x210b45['text']=_0x4789b6(0x17c);},'onEvaluationComplete':_0x41d38c=>{const _0xae8b35=_0x4d4e0,_0x4fe23c=formatElapsed(_0x41d38c);console[_0xae8b35(0x14b)](_0xae8b35(0x147)+a5_0x30cc29[_0xae8b35(0x1a6)]('✓')+'\x20('+_0x4fe23c+')');}});_0x210b45[_0x4d4e0(0x179)](),_0x5218e6[_0x4d4e0(0x1c3)](_0x1a733c),_0x77074b[_0x4d4e0(0x1c3)](_0x5bcc8d);if(_0x1a733c[_0x4d4e0(0x1c5)]===_0x4d4e0(0x1b1))console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x1a6)]('✓\x20PASS:\x20'+_0x1a733c[_0x4d4e0(0x1a0)]));else _0x1a733c['status']===_0x4d4e0(0x19b)?console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x164)](_0x4d4e0(0x1ca)+_0x1a733c[_0x4d4e0(0x1a0)])):console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x164)](_0x4d4e0(0x1c0)+_0x1a733c[_0x4d4e0(0x1a0)]));_0x1a733c[_0x4d4e0(0x1bb)]&&console[_0x4d4e0(0x14b)](a5_0x30cc29['dim'](_0x4d4e0(0x198)+_0x1a733c[_0x4d4e0(0x1bb)])),console[_0x4d4e0(0x14b)]();}catch(_0x264315){_0x210b45['stop']();const _0x4615b0=_0x264315 instanceof Error?_0x264315['message']:String(_0x264315);console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x164)](_0x4d4e0(0x1c0)+_0x4615b0)),console['log'](),_0x5218e6[_0x4d4e0(0x1c3)]({'name':_0x4281c3[_0x4d4e0(0x163)],'status':_0x4d4e0(0x192),'reason':_0x4615b0,'timestamp':new Date()[_0x4d4e0(0x150)](),'duration_ms':0x0});}}const _0xe7743a=Date[_0x4d4e0(0x174)]()-_0x20cc30,_0x1af56d=_0x5218e6[_0x4d4e0(0x157)](_0x5724cb=>_0x5724cb['status']===_0x4d4e0(0x1b1))['length'],_0x9e76c7=_0x5218e6['filter'](_0x202a63=>_0x202a63[_0x4d4e0(0x1c5)]==='FAIL')['length'],_0x1da90c=_0x5218e6['filter'](_0x531a8d=>_0x531a8d[_0x4d4e0(0x1c5)]===_0x4d4e0(0x192))[_0x4d4e0(0x1cb)];console[_0x4d4e0(0x14b)]('━'[_0x4d4e0(0x1a9)](0x3c)),console['log']('Test\x20Summary'),console['log']('━'[_0x4d4e0(0x1a9)](0x3c)),console[_0x4d4e0(0x14b)]('Total:\x20\x20\x20\x20'+_0x5218e6[_0x4d4e0(0x1cb)]),console['log'](_0x4d4e0(0x19e)+a5_0x30cc29['green'](_0x1af56d)),console[_0x4d4e0(0x14b)](_0x4d4e0(0x187)+a5_0x30cc29['red'](_0x9e76c7));_0x1da90c>0x0&&console[_0x4d4e0(0x14b)]('Errors:\x20\x20\x20'+a5_0x30cc29[_0x4d4e0(0x164)](_0x1da90c));console[_0x4d4e0(0x14b)]('Duration:\x20'+formatElapsed(_0xe7743a)),console['log']('━'[_0x4d4e0(0x1a9)](0x3c));const _0x71912=_0x5218e6[_0x4d4e0(0x157)](_0x285a21=>_0x285a21['status']!==_0x4d4e0(0x1b1));if(_0x71912[_0x4d4e0(0x1cb)]>0x0){console[_0x4d4e0(0x14b)](),console['log'](_0x4d4e0(0x14c));for(const _0xf37b16 of _0x71912){const _0x426f3c=a5_0x30cc29[_0x4d4e0(0x164)]('✗'),_0x5db1e8=_0xf37b16[_0x4d4e0(0x1a0)][_0x4d4e0(0x1cb)]>0x32?_0xf37b16[_0x4d4e0(0x1a0)][_0x4d4e0(0x1bf)](0x0,0x32)+_0x4d4e0(0x15f):_0xf37b16[_0x4d4e0(0x1a0)];console[_0x4d4e0(0x14b)]('\x20\x20'+_0x426f3c+'\x20'+_0xf37b16[_0x4d4e0(0x163)]+':\x20'+_0x5db1e8);}}const _0x30f261={'summary':{'total':_0x5218e6[_0x4d4e0(0x1cb)],'passed':_0x1af56d,'failed':_0x9e76c7,'errors':_0x1da90c>0x0?_0x1da90c:undefined,'duration_ms':_0xe7743a},'tests':_0x5218e6,'agent':{'project':_0x1b3616['projectName'],'name':_0x1b3616[_0x4d4e0(0x1a3)],'site':_0x2337eb},'timestamp':new Date(_0x20cc30)[_0x4d4e0(0x150)]()};try{const _0x2affc4=buildCachedTestRun(_0x77074b,{'site':_0x2337eb,'projectId':_0x58e9e2,'projectName':_0x1b3616[_0x4d4e0(0x176)],'agentId':_0x25cf50,'agentName':_0x1b3616[_0x4d4e0(0x1a3)],'testYmlPath':a5_0x209112[_0x4d4e0(0x1dd)](_0x1b3616[_0x4d4e0(0x1b4)])});saveLastTestRun(_0x2affc4);}catch{}if(_0x50923f!=='table'||_0x53eb0e){const _0x37889b=formatResults(_0x30f261,_0x50923f);if(_0x53eb0e)try{a5_0x454be6[_0x4d4e0(0x15a)](_0x53eb0e,_0x37889b,_0x4d4e0(0x1aa)),console[_0x4d4e0(0x14b)](),console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x19c)]('Output\x20written\x20to:\x20'+_0x53eb0e));}catch(_0x8fbf36){return console[_0x4d4e0(0x14b)](),console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x164)](_0x4d4e0(0x1bd)+_0x8fbf36)),0x1;}else console['log'](),console['log'](_0x37889b);}return _0x71912['length']>0x0?0x1:0x0;}async[a5_0x4054c3(0x149)](_0x1838fc,_0x3b886a){const _0x1db64a=a5_0x4054c3,{options:_0x407ef2,tdx:_0x16fdb4}=_0x1838fc,{definition:_0x2362e0,agentInfo:_0x5b9c48,outputFormat:_0xc56503,outputFile:_0x5521b6}=_0x3b886a,_0x461555=_0x407ef2[_0x1db64a(0x1d8)],_0x489b7e=loadLastTestRun();if(!_0x489b7e)return console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x164)](_0x1db64a(0x1b2))),console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x19c)](_0x1db64a(0x1c7))),0x1;if(_0x489b7e['agent'][_0x1db64a(0x1a3)]!==_0x5b9c48['agentName'])return console[_0x1db64a(0x14b)](a5_0x30cc29['red'](_0x1db64a(0x190)+_0x489b7e[_0x1db64a(0x1d5)][_0x1db64a(0x1a3)]+_0x1db64a(0x186)+_0x5b9c48[_0x1db64a(0x1a3)]+'\x22.')),console['log'](a5_0x30cc29[_0x1db64a(0x19c)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x51ef13=new Set(_0x489b7e[_0x1db64a(0x1b8)][_0x1db64a(0x159)](_0x504f29=>_0x504f29[_0x1db64a(0x172)])),_0x3ef9d2=_0x2362e0[_0x1db64a(0x1b5)][_0x1db64a(0x157)](_0x3495d4=>!_0x51ef13[_0x1db64a(0x1cc)](_0x3495d4[_0x1db64a(0x163)]));if(_0x3ef9d2[_0x1db64a(0x1cb)]>0x0&&_0x489b7e[_0x1db64a(0x1d8)]!==_0x461555)return console[_0x1db64a(0x14b)](a5_0x30cc29['red'](_0x1db64a(0x1a2))),console[_0x1db64a(0x14b)](a5_0x30cc29['dim'](_0x1db64a(0x17b)+_0x489b7e['site']+_0x1db64a(0x1a1)+_0x461555+'\x22.')),console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x19c)](_0x1db64a(0x196)+_0x489b7e[_0x1db64a(0x1d8)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0xc5615e=_0x2362e0[_0x1db64a(0x1b5)][_0x1db64a(0x157)](_0x36c7b1=>_0x51ef13[_0x1db64a(0x1cc)](_0x36c7b1[_0x1db64a(0x163)])),_0x562266=_0x3ef9d2;let _0x5a9db6;try{_0x5a9db6=await setupEvaluatorAgent(_0x16fdb4[_0x1db64a(0x166)],_0x407ef2[_0x1db64a(0x191)]);}catch(_0x187447){const _0x3405d9=_0x187447 instanceof Error?_0x187447['message']:String(_0x187447);return console[_0x1db64a(0x14b)](a5_0x30cc29['red'](_0x1db64a(0x199)+_0x3405d9)),0x1;}console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x17e)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x1db64a(0x14b)](_0x1db64a(0x168)+a5_0x30cc29[_0x1db64a(0x1b0)](_0x489b7e['timestamp'])),console[_0x1db64a(0x14b)](_0x1db64a(0x169)+a5_0x30cc29[_0x1db64a(0x1b0)](_0x489b7e['agent']['projectName']+'/'+_0x489b7e[_0x1db64a(0x1d5)]['agentName']));_0x562266[_0x1db64a(0x1cb)]>0x0&&console[_0x1db64a(0x14b)](_0x1db64a(0x151)+a5_0x30cc29[_0x1db64a(0x1c2)](_0x562266[_0x1db64a(0x1cb)]));console[_0x1db64a(0x14b)]();const _0x14d05e=[],_0x58fe52=Date['now'](),_0x4d9cda=createCommandSpinner(_0x1db64a(0x19a));if(_0xc5615e[_0x1db64a(0x1cb)]>0x0)try{const _0x424d8f=await reevaluateFromCache(_0x16fdb4['llm'],_0x489b7e,{'tests':_0xc5615e},{'evaluatorId':_0x5a9db6,'onTestStart':(_0x55badd,_0x293d4a,_0x53227e)=>{const _0x16d8d3=_0x1db64a;_0x4d9cda['text']=_0x16d8d3(0x189)+(_0x293d4a+0x1)+'/'+_0x53227e+':\x20'+_0x55badd+_0x16d8d3(0x15f);if(!_0x4d9cda[_0x16d8d3(0x1d9)])_0x4d9cda['start']();},'onTestComplete':(_0x1aba78,_0x5cb5ec)=>{const _0x74cce1=_0x1db64a;_0x4d9cda[_0x74cce1(0x179)]();if(_0x5cb5ec[_0x74cce1(0x1c5)]===_0x74cce1(0x1b1))console[_0x74cce1(0x14b)](a5_0x30cc29[_0x74cce1(0x1a6)](_0x74cce1(0x16c)+_0x1aba78)+a5_0x30cc29[_0x74cce1(0x19c)](_0x74cce1(0x18f)));else _0x5cb5ec[_0x74cce1(0x1c5)]==='FAIL'?console[_0x74cce1(0x14b)](a5_0x30cc29['red'](_0x74cce1(0x1ca)+_0x1aba78+'\x20-\x20'+_0x5cb5ec[_0x74cce1(0x1a0)])+a5_0x30cc29[_0x74cce1(0x19c)](_0x74cce1(0x18f))):console[_0x74cce1(0x14b)](a5_0x30cc29['red'](_0x74cce1(0x1c0)+_0x1aba78+_0x74cce1(0x1ac)+_0x5cb5ec[_0x74cce1(0x1a0)]));_0x5cb5ec[_0x74cce1(0x1bb)]&&console[_0x74cce1(0x14b)](a5_0x30cc29['dim'](_0x74cce1(0x183)+_0x5cb5ec['conversation_url'])),_0x14d05e[_0x74cce1(0x1c3)](_0x5cb5ec);},'onTestSkipped':(_0x21b680,_0x54d799)=>{const _0x26697f=_0x1db64a;_0x4d9cda['stop'](),console['log'](a5_0x30cc29[_0x26697f(0x1c2)]('⚠\x20SKIPPED:\x20'+_0x21b680+'\x20-\x20'+_0x54d799));}});for(const _0x44a5ec of _0x424d8f){!_0x14d05e[_0x1db64a(0x1c4)](_0x4a393b=>_0x4a393b[_0x1db64a(0x163)]===_0x44a5ec[_0x1db64a(0x163)])&&_0x14d05e[_0x1db64a(0x1c3)](_0x44a5ec);}}catch(_0x131e5b){_0x4d9cda[_0x1db64a(0x179)]();const _0x21729f=_0x131e5b instanceof Error?_0x131e5b[_0x1db64a(0x1d6)]:String(_0x131e5b);return console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x164)](_0x1db64a(0x1a4)+_0x21729f)),0x1;}_0x4d9cda['stop']();if(_0x562266[_0x1db64a(0x1cb)]>0x0){console[_0x1db64a(0x14b)](),console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x17e)](_0x1db64a(0x18e)));const {projectId:_0x36e555,agentId:_0x18ff33}=_0x489b7e[_0x1db64a(0x1d5)];for(const _0x58b879 of _0x562266){console[_0x1db64a(0x14b)](_0x1db64a(0x16d)+a5_0x30cc29['white'](_0x58b879[_0x1db64a(0x163)]));const _0x59c796=createCommandSpinner('Round\x201/'+_0x58b879[_0x1db64a(0x1c8)][_0x1db64a(0x1cb)]+_0x1db64a(0x1da));_0x59c796['start']();try{const {result:_0x522886}=await runTest(_0x16fdb4[_0x1db64a(0x166)],_0x58b879,{'agentId':_0x18ff33,'projectId':_0x36e555,'site':_0x489b7e['site'],'noEval':![],'evaluatorId':_0x5a9db6,'onRoundStart':(_0xeb7ca2,_0x487cdf)=>{const _0x20b876=_0x1db64a;_0x59c796[_0x20b876(0x170)]=_0x20b876(0x1be)+(_0xeb7ca2+0x1)+'/'+_0x487cdf+_0x20b876(0x1da);},'onRoundComplete':(_0x2ac300,_0x308e39,_0x14effe)=>{const _0x54622f=_0x1db64a,_0x4fd4a3=formatElapsed(_0x308e39);_0x14effe?console[_0x54622f(0x14b)](_0x54622f(0x177)+(_0x2ac300+0x1)+'/'+_0x58b879[_0x54622f(0x1c8)][_0x54622f(0x1cb)]+'...\x20'+a5_0x30cc29[_0x54622f(0x1a6)]('✓')+'\x20('+_0x4fd4a3+')'):console['log'](_0x54622f(0x177)+(_0x2ac300+0x1)+'/'+_0x58b879[_0x54622f(0x1c8)][_0x54622f(0x1cb)]+'...\x20'+a5_0x30cc29['red']('✗'));},'onEvaluationStart':()=>{const _0x26a18c=_0x1db64a;_0x59c796[_0x26a18c(0x170)]=_0x26a18c(0x17c);},'onEvaluationComplete':_0x117bc4=>{const _0x3a4aee=_0x1db64a,_0x15807f=formatElapsed(_0x117bc4);console[_0x3a4aee(0x14b)]('\x20\x20Evaluating...\x20'+a5_0x30cc29[_0x3a4aee(0x1a6)]('✓')+'\x20('+_0x15807f+')');}});_0x59c796['stop'](),_0x14d05e['push'](_0x522886);if(_0x522886[_0x1db64a(0x1c5)]==='PASS')console['log'](a5_0x30cc29[_0x1db64a(0x1a6)](_0x1db64a(0x16c)+_0x522886[_0x1db64a(0x1a0)])+a5_0x30cc29['dim'](_0x1db64a(0x152)));else _0x522886[_0x1db64a(0x1c5)]===_0x1db64a(0x19b)?console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x164)]('✗\x20FAIL:\x20'+_0x522886[_0x1db64a(0x1a0)])+a5_0x30cc29[_0x1db64a(0x19c)](_0x1db64a(0x152))):console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x164)]('✗\x20ERROR:\x20'+_0x522886[_0x1db64a(0x1a0)]));_0x522886[_0x1db64a(0x1bb)]&&console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x19c)]('\x20\x20Conversation:\x20'+_0x522886[_0x1db64a(0x1bb)]));}catch(_0x1314f5){_0x59c796[_0x1db64a(0x179)]();const _0x3f1d22=_0x1314f5 instanceof Error?_0x1314f5[_0x1db64a(0x1d6)]:String(_0x1314f5);console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x164)](_0x1db64a(0x1c0)+_0x3f1d22)),_0x14d05e[_0x1db64a(0x1c3)]({'name':_0x58b879[_0x1db64a(0x163)],'status':_0x1db64a(0x192),'reason':_0x3f1d22,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console['log']();const _0x4bf85b=Date[_0x1db64a(0x174)]()-_0x58fe52,_0x25611d=_0x14d05e['filter'](_0x1d1204=>_0x1d1204['status']===_0x1db64a(0x1b1))['length'],_0x266f72=_0x14d05e[_0x1db64a(0x157)](_0x4217c7=>_0x4217c7[_0x1db64a(0x1c5)]==='FAIL')[_0x1db64a(0x1cb)],_0x1493ec=_0x14d05e[_0x1db64a(0x157)](_0x49a1c6=>_0x49a1c6[_0x1db64a(0x1c5)]===_0x1db64a(0x192))[_0x1db64a(0x1cb)];console[_0x1db64a(0x14b)]('━'[_0x1db64a(0x1a9)](0x3c)),console[_0x1db64a(0x14b)]('Re-evaluation\x20Summary'),console[_0x1db64a(0x14b)]('━'[_0x1db64a(0x1a9)](0x3c)),console[_0x1db64a(0x14b)](_0x1db64a(0x1c9)+_0x14d05e[_0x1db64a(0x1cb)]),console[_0x1db64a(0x14b)](_0x1db64a(0x19e)+a5_0x30cc29['green'](_0x25611d)),console[_0x1db64a(0x14b)](_0x1db64a(0x187)+a5_0x30cc29[_0x1db64a(0x164)](_0x266f72));_0x1493ec>0x0&&console[_0x1db64a(0x14b)](_0x1db64a(0x1b9)+a5_0x30cc29[_0x1db64a(0x164)](_0x1493ec));console[_0x1db64a(0x14b)](_0x1db64a(0x188)+formatElapsed(_0x4bf85b)),console[_0x1db64a(0x14b)]('━'['repeat'](0x3c));const _0x27eb86={'summary':{'total':_0x14d05e[_0x1db64a(0x1cb)],'passed':_0x25611d,'failed':_0x266f72,'errors':_0x1493ec>0x0?_0x1493ec:undefined,'duration_ms':_0x4bf85b},'tests':_0x14d05e,'agent':{'project':_0x5b9c48['projectName'],'name':_0x5b9c48[_0x1db64a(0x1a3)],'site':_0x461555},'timestamp':new Date(_0x58fe52)['toISOString']()};if(_0xc56503!==_0x1db64a(0x1c1)||_0x5521b6){const _0x23add4=formatResults(_0x27eb86,_0xc56503);if(_0x5521b6)try{a5_0x454be6[_0x1db64a(0x15a)](_0x5521b6,_0x23add4,'utf-8'),console[_0x1db64a(0x14b)](),console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x19c)](_0x1db64a(0x185)+_0x5521b6));}catch(_0x211888){return console[_0x1db64a(0x14b)](),console['log'](a5_0x30cc29[_0x1db64a(0x164)](_0x1db64a(0x1bd)+_0x211888)),0x1;}else console[_0x1db64a(0x14b)](),console['log'](_0x23add4);}const _0xb74677=_0x14d05e[_0x1db64a(0x157)](_0x19ac6a=>_0x19ac6a[_0x1db64a(0x1c5)]!=='PASS');return _0xb74677[_0x1db64a(0x1cb)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x1f0b00=a6_0x4608;(function(_0x38e954,_0x2feb0b){const _0xd46857=a6_0x4608,_0x10a263=_0x38e954();while(!![]){try{const _0x4497a3=-parseInt(_0xd46857(0x108))/0x1+parseInt(_0xd46857(0xfd))/0x2+-parseInt(_0xd46857(0xe9))/0x3+parseInt(_0xd46857(0xe7))/0x4*(parseInt(_0xd46857(0xf3))/0x5)+-parseInt(_0xd46857(0xd3))/0x6*(parseInt(_0xd46857(0xdb))/0x7)+-parseInt(_0xd46857(0xe6))/0x8*(parseInt(_0xd46857(0x10f))/0x9)+-parseInt(_0xd46857(0xf9))/0xa*(-parseInt(_0xd46857(0x10e))/0xb);if(_0x4497a3===_0x2feb0b)break;else _0x10a263['push'](_0x10a263['shift']());}catch(_0x3621d2){_0x10a263['push'](_0x10a263['shift']());}}}(a6_0x1455,0xbb36e));function a6_0x1455(){const _0x1540a4=['8UQwrDV','12zUdkFw','\x0aStack\x20trace:\x0a','2749569DqTjNn','status','set-cookie2','stack','PUT','POST','cookie','includes','entries','name','2408410VWlmAh','request','set-cookie','toUpperCase','cdp','.\x20Valid\x20types:\x20','50AerCEg','startsWith','Results\x20saved\x20to\x20','proxy-authorization','1631436uTQMFB','length','\x22.\x20','GET','api','cas','method','type','join','Invalid\x20API\x20type:\x20','color','1477551PqItSj','Error:\x20','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','file','workflow','isArray','5628458HhuWXC','5590764wQfVTE','indexOf','headers','toLowerCase','has','x-xsrf-token','noColor','12iFSbfC','verbose','llm-proxy','DELETE','message','validate','description','Endpoint\x20must\x20start\x20with\x20/:\x20','3629689qLMitI','output','error','.\x20Valid\x20methods:\x20','Invalid\x20header\x20format:\x20\x22','execute','data','x-trino-user','substring','trim','readBodyFromFile'];a6_0x1455=function(){return _0x1540a4;};return a6_0x1455();}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_0x4608(_0x5c2a18,_0x13cae4){_0x5c2a18=_0x5c2a18-0xd1;const _0x145532=a6_0x1455();let _0x4608e8=_0x145532[_0x5c2a18];return _0x4608e8;}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization',a6_0x1f0b00(0xfc),a6_0x1f0b00(0xef),a6_0x1f0b00(0xf5),a6_0x1f0b00(0xeb),a6_0x1f0b00(0xd1),'x-auth-token',a6_0x1f0b00(0xe2)]);function isSensitiveHeader(_0xe726b0){const _0x28131b=a6_0x1f0b00;return SENSITIVE_HEADERS[_0x28131b(0x113)](_0xe726b0[_0x28131b(0x112)]());}function parseHeader(_0x2cf91d){const _0x2abaea=a6_0x1f0b00,_0xcb4b33=_0x2cf91d[_0x2abaea(0x110)](':');if(_0xcb4b33===-0x1)throw new Error(_0x2abaea(0xdf)+_0x2cf91d+_0x2abaea(0xff)+_0x2abaea(0x10a));const _0x441312=_0x2cf91d[_0x2abaea(0xe3)](0x0,_0xcb4b33)[_0x2abaea(0xe4)](),_0x147c69=_0x2cf91d[_0x2abaea(0xe3)](_0xcb4b33+0x1)[_0x2abaea(0xe4)]();if(!_0x441312)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x2cf91d+'\x22');return[_0x441312,_0x147c69];}export class ApiCommand extends BaseCommand{[a6_0x1f0b00(0xf2)]=a6_0x1f0b00(0x101);[a6_0x1f0b00(0xd9)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x1f0b00(0xd8)](_0x49e181){const _0x171f8d=a6_0x1f0b00,{args:_0xcf7cb2,options:_0x2d34d6}=_0x49e181,_0x13a3b1=_0x2d34d6;if(_0xcf7cb2['length']===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x361516=_0xcf7cb2[0x0];if(!_0x361516[_0x171f8d(0xfa)]('/'))return _0x171f8d(0xda)+_0x361516;const _0x383a21=_0x13a3b1[_0x171f8d(0xe1)],_0x2a79e2=_0x13a3b1[_0x171f8d(0x10b)];if(_0x383a21&&_0x2a79e2)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x7efabf=_0x13a3b1[_0x171f8d(0x103)]||_0x171f8d(0x100),_0x38badf=[_0x171f8d(0x100),_0x171f8d(0xee),_0x171f8d(0xed),_0x171f8d(0xd6),'PATCH'];if(!_0x38badf['includes'](_0x7efabf[_0x171f8d(0xf6)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x7efabf+_0x171f8d(0xde)+_0x38badf[_0x171f8d(0x105)](',\x20');const _0x2f7e8e=_0x13a3b1[_0x171f8d(0x104)]||'td',_0x76e7e3=['td',_0x171f8d(0xf7),_0x171f8d(0x10c),'trino','llm',_0x171f8d(0xd5),_0x171f8d(0x102)];if(!_0x76e7e3[_0x171f8d(0xf0)](_0x2f7e8e))return _0x171f8d(0x106)+_0x2f7e8e+_0x171f8d(0xf8)+_0x76e7e3[_0x171f8d(0x105)](',\x20');return undefined;}async[a6_0x1f0b00(0xe0)](_0x52b169){const _0x4775f5=a6_0x1f0b00,{options:_0x43bbea,args:_0x1e79c8,tdx:_0x491597}=_0x52b169,_0x156306=_0x43bbea,_0x369a47=_0x1e79c8[0x0],_0x534e7a=(_0x156306[_0x4775f5(0x103)]||_0x4775f5(0x100))[_0x4775f5(0xf6)](),_0x40a78f=_0x156306[_0x4775f5(0xe1)],_0x45de70=_0x156306[_0x4775f5(0x10b)],_0x177809=_0x156306['header'],_0x11f24d=_0x156306[_0x4775f5(0x104)]||'td';try{const _0x25ae92={};if(_0x177809){const _0x102e8d=Array[_0x4775f5(0x10d)](_0x177809)?_0x177809:[_0x177809];for(const _0x3c0180 of _0x102e8d){const [_0x38f3b8,_0x16f3ce]=parseHeader(_0x3c0180);_0x25ae92[_0x38f3b8]=_0x16f3ce;}}let _0xb6020b;if(_0x40a78f)_0xb6020b=_0x40a78f;else{if(_0x45de70)try{_0xb6020b=RawAPI[_0x4775f5(0xe5)](_0x45de70);}catch(_0xfe56e7){return console[_0x4775f5(0xdd)](_0x4775f5(0x109)+(_0xfe56e7 instanceof Error?_0xfe56e7[_0x4775f5(0xd7)]:String(_0xfe56e7))),0x1;}}const _0x2dcaa1={'method':_0x534e7a,'apiType':_0x11f24d,'includeHeaders':_0x43bbea['verbose']};_0xb6020b&&(_0x2dcaa1['body']=_0xb6020b);Object['keys'](_0x25ae92)[_0x4775f5(0xfe)]>0x0&&(_0x2dcaa1[_0x4775f5(0x111)]=_0x25ae92);if(_0x43bbea[_0x4775f5(0xd4)]){const _0x2bc467=resolveSite(_0x43bbea['site']),_0x136e51=getEndpoint(_0x2bc467,_0x11f24d),_0x2edcf5=''+_0x136e51+_0x369a47;console[_0x4775f5(0xdd)]('>\x20'+_0x534e7a+'\x20'+_0x2edcf5);const _0x54030c=getAuthHeaders(_0x2bc467),_0x3db2ed={..._0x54030c,..._0x25ae92};for(const [_0x112f19,_0x32cf77]of Object['entries'](_0x3db2ed)){!isSensitiveHeader(_0x112f19)&&console['error']('>\x20'+_0x112f19+':\x20'+_0x32cf77);}_0xb6020b&&console['error']('>'),console[_0x4775f5(0xdd)]('');}const _0x24a518=await _0x491597[_0x4775f5(0x101)][_0x4775f5(0xf4)](_0x369a47,_0x2dcaa1);if(_0x43bbea[_0x4775f5(0xd4)]&&_0x24a518['headers']){console[_0x4775f5(0xdd)]('<\x20HTTP/1.1\x20'+_0x24a518[_0x4775f5(0xea)]);for(const [_0x130c37,_0x5a2450]of Object[_0x4775f5(0xf1)](_0x24a518[_0x4775f5(0x111)])){!isSensitiveHeader(_0x130c37)&&console[_0x4775f5(0xdd)]('<\x20'+_0x130c37+':\x20'+_0x5a2450);}console['error']('');}const _0x42b024=Boolean(_0x43bbea[_0x4775f5(0xdc)]),_0x251372={'color':_0x43bbea[_0x4775f5(0x107)],'noColor':_0x43bbea[_0x4775f5(0xd2)]||_0x42b024&&!_0x43bbea[_0x4775f5(0x107)]},_0x3a6d5a=colorizeJSON(_0x24a518[_0x4775f5(0xe1)],_0x251372);return _0x43bbea[_0x4775f5(0xdc)]?(writeFileSync(_0x43bbea[_0x4775f5(0xdc)],_0x3a6d5a),console[_0x4775f5(0xdd)](_0x4775f5(0xfb)+_0x43bbea[_0x4775f5(0xdc)])):console['log'](_0x3a6d5a),0x0;}catch(_0x4668fb){return _0x4668fb instanceof Error?(console[_0x4775f5(0xdd)]('Error:\x20'+_0x4668fb['message']),_0x43bbea['verbose']&&_0x4668fb[_0x4775f5(0xec)]&&console['error'](_0x4775f5(0xe8)+_0x4668fb[_0x4775f5(0xec)])):console['error'](_0x4775f5(0x109)+String(_0x4668fb)),0x1;}}}
1
+ const a6_0x3ab92d=a6_0x4436;function a6_0x4436(_0x1887bd,_0x108869){_0x1887bd=_0x1887bd-0x14a;const _0x22ab8a=a6_0x22ab();let _0x4436b6=_0x22ab8a[_0x1887bd];return _0x4436b6;}(function(_0x35efab,_0x240d87){const _0x396c17=a6_0x4436,_0x279a41=_0x35efab();while(!![]){try{const _0x199e0a=parseInt(_0x396c17(0x181))/0x1*(parseInt(_0x396c17(0x16a))/0x2)+-parseInt(_0x396c17(0x186))/0x3+-parseInt(_0x396c17(0x168))/0x4+-parseInt(_0x396c17(0x173))/0x5*(-parseInt(_0x396c17(0x182))/0x6)+parseInt(_0x396c17(0x169))/0x7+-parseInt(_0x396c17(0x165))/0x8*(-parseInt(_0x396c17(0x177))/0x9)+parseInt(_0x396c17(0x174))/0xa*(-parseInt(_0x396c17(0x172))/0xb);if(_0x199e0a===_0x240d87)break;else _0x279a41['push'](_0x279a41['shift']());}catch(_0x3a1b0c){_0x279a41['push'](_0x279a41['shift']());}}}(a6_0x22ab,0xf158b));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';function a6_0x22ab(){const _0x109450=['file','stack','proxy-authorization','toUpperCase','authorization','headers','GET','Invalid\x20header\x20format:\x20\x22','output','trim','data','request','set-cookie2','body','workflow','has','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','\x22.\x20','cookie','noColor','56EVRsOH','entries','status','7559328eMDTEc','11336661qylqiQ','2jLspnh','startsWith','llm','color','llm-proxy','length','validate','isArray','1109383vNARNp','779365SqXPXx','40gPDeKW','readBodyFromFile','header','7101GgFKhD','DELETE','execute','keys','Results\x20saved\x20to\x20','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','x-auth-token','type','cas','method','525109kZNuAe','60nesdnI','error','substring','cdp','1281258vcArem','POST','api','message','includes','\x0aStack\x20trace:\x0a','Endpoint\x20must\x20start\x20with\x20/:\x20','verbose','log','x-trino-user','.\x20Valid\x20types:\x20','set-cookie','Error:\x20'];a6_0x22ab=function(){return _0x109450;};return a6_0x22ab();}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_0x3ab92d(0x155),a6_0x3ab92d(0x153),a6_0x3ab92d(0x163),a6_0x3ab92d(0x14f),a6_0x3ab92d(0x15d),'x-xsrf-token',a6_0x3ab92d(0x17d),a6_0x3ab92d(0x14d)]);function isSensitiveHeader(_0xc0bff7){const _0x4e8897=a6_0x3ab92d;return SENSITIVE_HEADERS[_0x4e8897(0x160)](_0xc0bff7['toLowerCase']());}function parseHeader(_0x2fc97e){const _0x3e7dc1=a6_0x3ab92d,_0x1b42e5=_0x2fc97e['indexOf'](':');if(_0x1b42e5===-0x1)throw new Error(_0x3e7dc1(0x158)+_0x2fc97e+_0x3e7dc1(0x162)+_0x3e7dc1(0x17c));const _0x5cfae0=_0x2fc97e[_0x3e7dc1(0x184)](0x0,_0x1b42e5)['trim'](),_0x11c220=_0x2fc97e[_0x3e7dc1(0x184)](_0x1b42e5+0x1)[_0x3e7dc1(0x15a)]();if(!_0x5cfae0)throw new Error(_0x3e7dc1(0x161)+_0x2fc97e+'\x22');return[_0x5cfae0,_0x11c220];}export class ApiCommand extends BaseCommand{['name']=a6_0x3ab92d(0x188);['description']='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x3ab92d(0x170)](_0x2548df){const _0x91bb86=a6_0x3ab92d,{args:_0x315753,options:_0x51953b}=_0x2548df,_0x5c699b=_0x51953b;if(_0x315753[_0x91bb86(0x16f)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x2df350=_0x315753[0x0];if(!_0x2df350[_0x91bb86(0x16b)]('/'))return _0x91bb86(0x14a)+_0x2df350;const _0x3f04ca=_0x5c699b[_0x91bb86(0x15b)],_0x1b76c0=_0x5c699b[_0x91bb86(0x151)];if(_0x3f04ca&&_0x1b76c0)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x960fa5=_0x5c699b[_0x91bb86(0x180)]||_0x91bb86(0x157),_0x4e7783=[_0x91bb86(0x157),_0x91bb86(0x187),'PUT',_0x91bb86(0x178),'PATCH'];if(!_0x4e7783[_0x91bb86(0x18a)](_0x960fa5[_0x91bb86(0x154)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x960fa5+'.\x20Valid\x20methods:\x20'+_0x4e7783['join'](',\x20');const _0x3af774=_0x5c699b[_0x91bb86(0x17e)]||'td',_0x4a7e04=['td',_0x91bb86(0x185),_0x91bb86(0x15f),'trino',_0x91bb86(0x16c),_0x91bb86(0x16e),_0x91bb86(0x17f)];if(!_0x4a7e04['includes'](_0x3af774))return'Invalid\x20API\x20type:\x20'+_0x3af774+_0x91bb86(0x14e)+_0x4a7e04['join'](',\x20');return undefined;}async[a6_0x3ab92d(0x179)](_0x2113f5){const _0x1360b8=a6_0x3ab92d,{options:_0x517680,args:_0x3cd8dc,tdx:_0x1469ab}=_0x2113f5,_0x55aa25=_0x517680,_0x1c6f9d=_0x3cd8dc[0x0],_0x518ff6=(_0x55aa25[_0x1360b8(0x180)]||_0x1360b8(0x157))[_0x1360b8(0x154)](),_0x16c3b9=_0x55aa25[_0x1360b8(0x15b)],_0x1310e7=_0x55aa25[_0x1360b8(0x151)],_0x26e02b=_0x55aa25[_0x1360b8(0x176)],_0x10d4bc=_0x55aa25[_0x1360b8(0x17e)]||'td';try{const _0x44791e={};if(_0x26e02b){const _0x11cc49=Array[_0x1360b8(0x171)](_0x26e02b)?_0x26e02b:[_0x26e02b];for(const _0x2996a4 of _0x11cc49){const [_0x3e088b,_0x5eff6b]=parseHeader(_0x2996a4);_0x44791e[_0x3e088b]=_0x5eff6b;}}let _0x57bae4;if(_0x16c3b9)_0x57bae4=_0x16c3b9;else{if(_0x1310e7)try{_0x57bae4=RawAPI[_0x1360b8(0x175)](_0x1310e7);}catch(_0x477341){return console[_0x1360b8(0x183)](_0x1360b8(0x150)+(_0x477341 instanceof Error?_0x477341[_0x1360b8(0x189)]:String(_0x477341))),0x1;}}const _0x2b24d5={'method':_0x518ff6,'apiType':_0x10d4bc,'includeHeaders':_0x517680[_0x1360b8(0x14b)]};_0x57bae4&&(_0x2b24d5[_0x1360b8(0x15e)]=_0x57bae4);Object[_0x1360b8(0x17a)](_0x44791e)[_0x1360b8(0x16f)]>0x0&&(_0x2b24d5[_0x1360b8(0x156)]=_0x44791e);if(_0x517680['verbose']){const _0x128a89=resolveSite(_0x517680['site']),_0x5a5885=getEndpoint(_0x128a89,_0x10d4bc),_0x2b9418=''+_0x5a5885+_0x1c6f9d;console[_0x1360b8(0x183)]('>\x20'+_0x518ff6+'\x20'+_0x2b9418);const _0xc5b1ea=getAuthHeaders(_0x128a89),_0x3d4e76={..._0xc5b1ea,..._0x44791e};for(const [_0x3718ad,_0xa50dfc]of Object[_0x1360b8(0x166)](_0x3d4e76)){!isSensitiveHeader(_0x3718ad)&&console[_0x1360b8(0x183)]('>\x20'+_0x3718ad+':\x20'+_0xa50dfc);}_0x57bae4&&console[_0x1360b8(0x183)]('>'),console[_0x1360b8(0x183)]('');}const _0x3e7854=await _0x1469ab[_0x1360b8(0x188)][_0x1360b8(0x15c)](_0x1c6f9d,_0x2b24d5);if(_0x517680[_0x1360b8(0x14b)]&&_0x3e7854[_0x1360b8(0x156)]){console[_0x1360b8(0x183)]('<\x20HTTP/1.1\x20'+_0x3e7854[_0x1360b8(0x167)]);for(const [_0x4e212a,_0x14c11a]of Object['entries'](_0x3e7854[_0x1360b8(0x156)])){!isSensitiveHeader(_0x4e212a)&&console[_0x1360b8(0x183)]('<\x20'+_0x4e212a+':\x20'+_0x14c11a);}console[_0x1360b8(0x183)]('');}const _0x1820e9=Boolean(_0x517680[_0x1360b8(0x159)]),_0x3d683d={'color':_0x517680['color'],'noColor':_0x517680[_0x1360b8(0x164)]||_0x1820e9&&!_0x517680[_0x1360b8(0x16d)]},_0x405549=colorizeJSON(_0x3e7854['data'],_0x3d683d);return _0x517680['output']?(writeFileSync(_0x517680[_0x1360b8(0x159)],_0x405549),console[_0x1360b8(0x183)](_0x1360b8(0x17b)+_0x517680[_0x1360b8(0x159)])):console[_0x1360b8(0x14c)](_0x405549),0x0;}catch(_0x402ee6){return _0x402ee6 instanceof Error?(console[_0x1360b8(0x183)](_0x1360b8(0x150)+_0x402ee6[_0x1360b8(0x189)]),_0x517680[_0x1360b8(0x14b)]&&_0x402ee6[_0x1360b8(0x152)]&&console[_0x1360b8(0x183)](_0x1360b8(0x18b)+_0x402ee6[_0x1360b8(0x152)])):console['error'](_0x1360b8(0x150)+String(_0x402ee6)),0x1;}}}
@@ -1 +1 @@
1
- function a7_0x522e(){const _0xddeff8=['Opening\x20browser\x20for\x20authentication...','Setting\x20up\x20authentication\x20for\x20site:\x20','756JWkCLL','join','apikey','552eSRsQQ','User:\x20','Choose\x20how\x20to\x20sign\x20in:','\x20\x20tdx','oauth','error','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','message','✓\x20Authentication\x20successful\x0a','Name:\x20','logLevel','\x20and\x20','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','tdx:\x20auth\x20setup','✗\x20Validation\x20failed:\x20','\x20(profile:\x20','method','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','auth:setup','trim','193180QVheuA','No\x20credential\x20found','status','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','profile','1908388RWRpTq','auth','accountName','getUserInfo','create','57ReNIHp','log','Use\x20an\x20API\x20key','access_token','name','API\x20key\x20cannot\x20be\x20empty','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','496496OrdaEm','2977569JsBUcl','dim','cyan','warn','✓\x20Default\x20site\x20set\x20to\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','select','N/A','execute','red','\x20for\x20profile:\x20','/oauth/authorize','password','96lTSqIJ','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','jobs','\x0aSetup\x20cancelled','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','ERROR','✓\x20Signed\x20in\x20successfully','3731766VOiJPl','/users/initiate_sso\x20(account:\x20','first_name','all','27002sxOxdo','Credential\x20type:\x20OAuth','Read\x20credential\x20from\x20keychain','green','last_name','site','56736hMlTKl','Enter\x20your\x20TD\x20API\x20key:','API\x20key','account_id','You\x20can\x20find\x20your\x20API\x20key\x20at:','Setup\x20cancelled','10DbxFrn','description','\x20--profile\x20','/app/mp/ak','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','filter','OAuth\x20tokens','apiKey','email','yellow','\x20(site:\x20','System\x20keychain\x20is\x20not\x20available','bold','us01','✓\x20Profile\x20\x27','For\x20scripts\x20or\x20headless\x20servers'];a7_0x522e=function(){return _0xddeff8;};return a7_0x522e();}const a7_0x3696fb=a7_0x19a6;(function(_0x35a75f,_0x1e5d8a){const _0x52ee15=a7_0x19a6,_0x3d8fe2=_0x35a75f();while(!![]){try{const _0x53a682=-parseInt(_0x52ee15(0x16c))/0x1*(-parseInt(_0x52ee15(0x18c))/0x2)+-parseInt(_0x52ee15(0x188))/0x3+-parseInt(_0x52ee15(0x167))/0x4+parseInt(_0x52ee15(0x162))/0x5*(parseInt(_0x52ee15(0x181))/0x6)+-parseInt(_0x52ee15(0x148))/0x7*(parseInt(_0x52ee15(0x192))/0x8)+-parseInt(_0x52ee15(0x174))/0x9*(parseInt(_0x52ee15(0x198))/0xa)+parseInt(_0x52ee15(0x173))/0xb*(parseInt(_0x52ee15(0x14b))/0xc);if(_0x53a682===_0x1e5d8a)break;else _0x3d8fe2['push'](_0x3d8fe2['shift']());}catch(_0x16e121){_0x3d8fe2['push'](_0x3d8fe2['shift']());}}}(a7_0x522e,0x9dc31));function a7_0x19a6(_0x450f1a,_0x492d45){_0x450f1a=_0x450f1a-0x139;const _0x522ea5=a7_0x522e();let _0x19a65b=_0x522ea5[_0x450f1a];return _0x19a65b;}import{BaseCommand,printAuthError}from'./command.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';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x4fe0b1 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_0x596024 from'chalk';export async function runOAuthLoginFlow(_0x5661bf,_0x522110,_0x487d06,_0x5438e1){const _0x2075f8=a7_0x19a6,_0x3c1653=await isKeychainAvailable();if(!_0x3c1653)throw new Error(_0x2075f8(0x152)+_0x2075f8(0x15e));let _0x2a4b7b=_0x5438e1?.['accountName'];if(!_0x2a4b7b){const _0x5d52a4=await a7_0x4fe0b1({'type':'text','name':_0x2075f8(0x169),'message':'Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):'});if(_0x5d52a4[_0x2075f8(0x169)]===undefined)throw new Error(_0x2075f8(0x197));_0x2a4b7b=_0x5d52a4[_0x2075f8(0x169)][_0x2075f8(0x161)]()||undefined;}const _0xe20464=getConsoleUrl(_0x5661bf);console[_0x2075f8(0x16d)](_0x2075f8(0x146));_0x2a4b7b?console[_0x2075f8(0x16d)]('\x20\x20'+_0xe20464+_0x2075f8(0x189)+_0x2a4b7b+')'):console[_0x2075f8(0x16d)]('\x20\x20'+_0xe20464+_0x2075f8(0x17f));console[_0x2075f8(0x16d)](_0x2075f8(0x172));const _0x6dcd4=loadGlobalProxy()||process.env.HTTPS_PROXY||process.env.HTTP_PROXY,_0x5a44e7=await startOAuthFlow(_0x5661bf,{'accountName':_0x2a4b7b,'proxy':_0x6dcd4});console['log']('Validating\x20OAuth\x20tokens...');const _0x5274b5=TDX['create']({'site':_0x5661bf,'accessToken':_0x5a44e7[_0x2075f8(0x16f)],'logLevel':_0x487d06??LogLevel[_0x2075f8(0x186)]}),_0x3d4586=await _0x5274b5['jobs'][_0x2075f8(0x16a)]();console[_0x2075f8(0x16d)](a7_0x596024[_0x2075f8(0x18f)](_0x2075f8(0x187))),console['log']('\x20\x20'+a7_0x596024[_0x2075f8(0x176)](_0x5661bf+':'+_0x3d4586[_0x2075f8(0x195)])+'\x20\x20user_id:'+_0x3d4586['id']+'\x20\x20('+_0x3d4586['email']+')');!_0x2a4b7b&&(console['log'](a7_0x596024[_0x2075f8(0x175)](_0x2075f8(0x15f))),console[_0x2075f8(0x16d)](a7_0x596024['dim']('\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>')),console[_0x2075f8(0x16d)](a7_0x596024['dim'](_0x2075f8(0x158))));await saveOAuthTokens(_0x5a44e7,_0x522110),console[_0x2075f8(0x16d)](_0x2075f8(0x151)+(_0x522110?_0x2075f8(0x15b)+_0x522110+')':''));if(_0x522110){const _0x18bec2={'site':_0x5661bf};saveProfileToUserConfig(_0x522110,_0x18bec2),console[_0x2075f8(0x16d)](_0x2075f8(0x144)+_0x522110+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x5661bf),console[_0x2075f8(0x16d)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x5661bf);const _0x19e75c=_0x522110?_0x2075f8(0x19a)+_0x522110:'';console['log'](),console[_0x2075f8(0x16d)](_0x2075f8(0x15d)),console[_0x2075f8(0x16d)](_0x2075f8(0x14e)+_0x19e75c+_0x2075f8(0x179)),console[_0x2075f8(0x16d)](_0x2075f8(0x14e)+_0x19e75c+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export async function promptAuthMethod(){const _0x5aaeab=a7_0x19a6,_0x218dd9=await a7_0x4fe0b1({'type':_0x5aaeab(0x17a),'name':_0x5aaeab(0x15c),'message':_0x5aaeab(0x14d),'choices':[{'title':'Sign\x20in\x20with\x20browser\x20(recommended)','description':_0x5aaeab(0x182),'value':_0x5aaeab(0x14f)},{'title':_0x5aaeab(0x16e),'description':_0x5aaeab(0x145),'value':_0x5aaeab(0x14a)}]});return _0x218dd9[_0x5aaeab(0x15c)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x3696fb(0x170)]=a7_0x3696fb(0x160);[a7_0x3696fb(0x199)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x3696fb(0x17c)](_0x31ca54){const _0x5bc819=a7_0x3696fb,{options:_0xe38671}=_0x31ca54,_0xdc5ffe=_0xe38671[_0x5bc819(0x166)];console['log'](a7_0x596024[_0x5bc819(0x142)](_0x5bc819(0x159)));const _0x247396=_0xe38671[_0x5bc819(0x191)]||_0x5bc819(0x143),_0x254832=await promptSiteSelection(_0x247396,_0xdc5ffe,_0x5bc819(0x197));if(!_0x254832)return 0x1;const _0x59654c=resolveSite(_0x254832),_0x2e8e71=await promptAuthMethod();if(!_0x2e8e71)return console[_0x5bc819(0x16d)]('\x0aSetup\x20cancelled'),0x1;if(_0x2e8e71===_0x5bc819(0x14f)){const {accountName:_0x187775}=_0xe38671;return await runOAuthLoginFlow(_0x59654c,_0xdc5ffe,_0xe38671[_0x5bc819(0x156)]??LogLevel[_0x5bc819(0x186)],{'accountName':_0x187775}),0x0;}console[_0x5bc819(0x16d)](_0x5bc819(0x147)+_0x59654c),console['log'](_0x5bc819(0x196)),console[_0x5bc819(0x16d)]('\x20\x20'+getConsoleUrl(_0x59654c,_0x5bc819(0x19b)));const _0x66372e=await a7_0x4fe0b1({'type':_0x5bc819(0x180),'name':_0x5bc819(0x13d),'message':_0x5bc819(0x193),'validate':_0x45a95d=>{const _0x371ed4=_0x5bc819;if(!_0x45a95d||!_0x45a95d[_0x371ed4(0x161)]())return _0x371ed4(0x171);return!![];}});if(!_0x66372e[_0x5bc819(0x13d)])return console[_0x5bc819(0x16d)](_0x5bc819(0x184)),0x1;const _0x3b3b6d=_0x66372e[_0x5bc819(0x13d)];console['log']('Validating\x20API\x20key...');try{const _0x37466c=TDX[_0x5bc819(0x16b)]({'site':_0x59654c,'apiKey':_0x3b3b6d[_0x5bc819(0x161)](),'logLevel':_0xe38671[_0x5bc819(0x156)]??LogLevel[_0x5bc819(0x186)]}),_0x427c75=await _0x37466c[_0x5bc819(0x183)][_0x5bc819(0x16a)]();console[_0x5bc819(0x16d)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x427c75[_0x5bc819(0x13e)]+')');const _0x535f38=await isKeychainAvailable();_0x535f38?(await saveAPIKeyAsync(_0x3b3b6d[_0x5bc819(0x161)](),_0x59654c,_0xdc5ffe),console[_0x5bc819(0x16d)](_0x5bc819(0x185)+(_0xdc5ffe?_0x5bc819(0x15b)+_0xdc5ffe+')':''))):(console[_0x5bc819(0x177)](a7_0x596024[_0x5bc819(0x13f)](_0x5bc819(0x165))),console[_0x5bc819(0x177)](a7_0x596024[_0x5bc819(0x13f)](_0x5bc819(0x13a))));if(_0xdc5ffe){const _0x5846be={'site':_0x59654c};saveProfileToUserConfig(_0xdc5ffe,_0x5846be),console[_0x5bc819(0x16d)](_0x5bc819(0x144)+_0xdc5ffe+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x59654c),console[_0x5bc819(0x16d)](_0x5bc819(0x178)+_0x59654c);const _0x432acd=_0xdc5ffe?'\x20--profile\x20'+_0xdc5ffe:'';return console[_0x5bc819(0x16d)](),console['log'](_0x5bc819(0x15d)),console[_0x5bc819(0x16d)](_0x5bc819(0x14e)+_0x432acd+_0x5bc819(0x179)),console[_0x5bc819(0x16d)](_0x5bc819(0x14e)+_0x432acd+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x59c743){if(_0x59c743 instanceof HTTPClientError&&_0x59c743[_0x5bc819(0x164)]===0x191)return printAuthError(_0x59c743),0x1;return console['error'](a7_0x596024[_0x5bc819(0x17d)](_0x5bc819(0x15a)+(_0x59c743 instanceof Error?_0x59c743[_0x5bc819(0x153)]:String(_0x59c743)))),console['error']('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x3696fb(0x168);[a7_0x3696fb(0x199)]=a7_0x3696fb(0x139);async[a7_0x3696fb(0x17c)](_0x495380){const _0x5de233=a7_0x3696fb,{options:_0x5e8fdd,tdx:_0x299fe0}=_0x495380,_0x2a701d=_0x5e8fdd['site'],_0x33d5bb=_0x5e8fdd[_0x5de233(0x166)],_0x4d812b=_0x33d5bb?_0x33d5bb:_0x5de233(0x17b);console[_0x5de233(0x16d)]('tdx\x20profile:\x20'+_0x4d812b+_0x5de233(0x140)+_0x2a701d+')');const _0x5c7f2e=await getOAuthTokens(_0x33d5bb);if(_0x5c7f2e)console[_0x5de233(0x16d)](_0x5de233(0x18d)),console[_0x5de233(0x16d)](_0x5de233(0x18e)+(_0x33d5bb?'\x20(profile:\x20'+_0x33d5bb+')':''));else{const _0x48cc01=await resolveAPIKeyAsync(_0x2a701d,_0x33d5bb);if(_0x48cc01){const {source:_0x31428f,isDeprecated:_0xeae7be}=_0x48cc01,_0x1787ce='Read\x20credential\x20from\x20'+_0x31428f;console[_0x5de233(0x16d)](_0xeae7be?a7_0x596024['yellow'](_0x1787ce):_0x1787ce);}else console['log'](a7_0x596024[_0x5de233(0x13f)](_0x5de233(0x163)));}try{const _0x21b3c1=await _0x299fe0['jobs'][_0x5de233(0x16a)]();return console[_0x5de233(0x16d)](a7_0x596024['green'](_0x5de233(0x154))),console[_0x5de233(0x16d)](_0x5de233(0x14c)+_0x21b3c1[_0x5de233(0x13e)]),(_0x21b3c1[_0x5de233(0x18a)]||_0x21b3c1[_0x5de233(0x190)])&&console[_0x5de233(0x16d)](_0x5de233(0x155)+[_0x21b3c1[_0x5de233(0x18a)],_0x21b3c1[_0x5de233(0x190)]][_0x5de233(0x13b)](Boolean)[_0x5de233(0x149)]('\x20')),0x0;}catch(_0x5d5f2b){return _0x5d5f2b instanceof HTTPClientError&&_0x5d5f2b['status']===0x191?printAuthError(_0x5d5f2b,!![],_0x33d5bb):console[_0x5de233(0x150)](a7_0x596024[_0x5de233(0x17d)](_0x5de233(0x15a)+(_0x5d5f2b instanceof Error?_0x5d5f2b[_0x5de233(0x153)]:String(_0x5d5f2b)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']='auth:clear';[a7_0x3696fb(0x199)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async['execute'](_0x1ddde1){const _0x19ca33=a7_0x3696fb,{options:_0x12e37e}=_0x1ddde1,_0x53209f=_0x12e37e[_0x19ca33(0x166)];console['log'](a7_0x596024[_0x19ca33(0x142)]('tdx:\x20auth\x20clear'));const _0x183ecb=await isKeychainAvailable();if(!_0x183ecb)return console[_0x19ca33(0x150)](a7_0x596024[_0x19ca33(0x17d)](_0x19ca33(0x141))),0x1;const [_0x525d3b,_0x5e7f4b]=await Promise[_0x19ca33(0x18b)]([deleteKeychainAPIKey(_0x53209f),deleteOAuthTokens(_0x53209f)]);if(_0x525d3b||_0x5e7f4b){clearCredentialCache();const _0x2b161a=[_0x525d3b&&_0x19ca33(0x194),_0x5e7f4b&&_0x19ca33(0x13c)]['filter'](Boolean)[_0x19ca33(0x149)](_0x19ca33(0x157));return console[_0x19ca33(0x16d)]('✓\x20'+_0x2b161a+'\x20removed\x20from\x20keychain'+(_0x53209f?_0x19ca33(0x15b)+_0x53209f+')':'')),0x0;}else return console[_0x19ca33(0x16d)]('No\x20credentials\x20found\x20in\x20keychain'+(_0x53209f?_0x19ca33(0x17e)+_0x53209f:'')),0x1;}}
1
+ const a7_0x3aba64=a7_0x2581;(function(_0x5721b5,_0x1aa985){const _0x19877b=a7_0x2581,_0x423cd5=_0x5721b5();while(!![]){try{const _0x5f4e85=-parseInt(_0x19877b(0x1d2))/0x1+-parseInt(_0x19877b(0x18f))/0x2+-parseInt(_0x19877b(0x1e4))/0x3+parseInt(_0x19877b(0x1eb))/0x4*(parseInt(_0x19877b(0x1d4))/0x5)+-parseInt(_0x19877b(0x1cd))/0x6*(-parseInt(_0x19877b(0x1a4))/0x7)+parseInt(_0x19877b(0x1d6))/0x8*(parseInt(_0x19877b(0x1c9))/0x9)+-parseInt(_0x19877b(0x1e0))/0xa*(parseInt(_0x19877b(0x1d3))/0xb);if(_0x5f4e85===_0x1aa985)break;else _0x423cd5['push'](_0x423cd5['shift']());}catch(_0x44bace){_0x423cd5['push'](_0x423cd5['shift']());}}}(a7_0x5d5a,0x67c91));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync,loadGlobalProxy}from'../core/config.js';function a7_0x5d5a(){const _0x3754e5=['jobs','\x20removed\x20from\x20keychain','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','10DbDHqZ','execute','auth:clear','User:\x20','1071651HShJqt','error','warn','site','getUserInfo','✗\x20Validation\x20failed:\x20','Read\x20credential\x20from\x20keychain','8mroDIz','cyan','method','Enter\x20your\x20TD\x20API\x20key:','N/A','ERROR','create','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20--profile\x20','Validating\x20API\x20key...','accountName','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','778568hBhDNS','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','No\x20credential\x20found','log','tdx:\x20auth\x20clear','You\x20can\x20find\x20your\x20API\x20key\x20at:','first_name','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','\x27\x20registered','select','Sign\x20in\x20with\x20browser\x20(recommended)','\x20(profile:\x20','Read\x20credential\x20from\x20','oauth','Setup\x20cancelled','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','No\x20credentials\x20found\x20in\x20keychain','Setup\x20API\x20key\x20authentication\x20interactively','access_token','status','\x20(site:\x20','7lUMnHO','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Remove\x20API\x20key\x20from\x20system\x20keychain','filter','yellow','Opening\x20browser\x20for\x20authentication...','Choose\x20how\x20to\x20sign\x20in:','✓\x20Authentication\x20successful\x0a','✓\x20Profile\x20\x27','logLevel','/users/initiate_sso\x20(account:\x20','\x20\x20tdx','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','API\x20key','auth','name','✓\x20Default\x20site\x20set\x20to\x20','password','tdx\x20profile:\x20','profile','\x20\x20(','apiKey','join','red','\x0aSetup\x20cancelled','/app/mp/ak','/oauth/authorize','\x20for\x20profile:\x20','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','✓\x20Signed\x20in\x20successfully','us01','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','auth:setup','\x20and\x20','trim','18ihEijL','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','description','dim','4830198kzMWmG','bold','API\x20key\x20cannot\x20be\x20empty','all','email','307658oeTNIS','2449843BEwLYY','1879295LDNjtP','Use\x20an\x20API\x20key','580904EOawbb','For\x20scripts\x20or\x20headless\x20servers','Setting\x20up\x20authentication\x20for\x20site:\x20','account_id','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>'];a7_0x5d5a=function(){return _0x3754e5;};return a7_0x5d5a();}import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';function a7_0x2581(_0x3203b3,_0x275f52){_0x3203b3=_0x3203b3-0x186;const _0x5d5a19=a7_0x5d5a();let _0x2581b3=_0x5d5a19[_0x3203b3];return _0x2581b3;}import{promptSiteSelection}from'../core/constants.js';import a7_0x358af6 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_0x178e47 from'chalk';export async function runOAuthLoginFlow(_0x254ab8,_0x1df469,_0x522f7c,_0x24e50c){const _0x2f220b=a7_0x2581,_0x2ba5a7=await isKeychainAvailable();if(!_0x2ba5a7)throw new Error(_0x2f220b(0x1c1)+_0x2f220b(0x1b1));let _0x1a530c=_0x24e50c?.[_0x2f220b(0x18d)];if(!_0x1a530c){const _0x463826=await a7_0x358af6({'type':'text','name':_0x2f220b(0x18d),'message':_0x2f220b(0x1c2)});if(_0x463826[_0x2f220b(0x18d)]===undefined)throw new Error(_0x2f220b(0x19d));_0x1a530c=_0x463826[_0x2f220b(0x18d)][_0x2f220b(0x1c8)]()||undefined;}const _0x17ac24=getConsoleUrl(_0x254ab8);console[_0x2f220b(0x192)](_0x2f220b(0x1aa));_0x1a530c?console['log']('\x20\x20'+_0x17ac24+_0x2f220b(0x1af)+_0x1a530c+')'):console[_0x2f220b(0x192)]('\x20\x20'+_0x17ac24+_0x2f220b(0x1bf));console[_0x2f220b(0x192)]('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0xa7763d=loadGlobalProxy()||process.env.HTTPS_PROXY||process.env.HTTP_PROXY,_0x45814a=await startOAuthFlow(_0x254ab8,{'accountName':_0x1a530c,'proxy':_0xa7763d});console[_0x2f220b(0x192)]('Validating\x20OAuth\x20tokens...');const _0x596bba=TDX[_0x2f220b(0x188)]({'site':_0x254ab8,'accessToken':_0x45814a[_0x2f220b(0x1a1)],'logLevel':_0x522f7c??LogLevel[_0x2f220b(0x187)]}),_0x333ac7=await _0x596bba[_0x2f220b(0x1db)][_0x2f220b(0x1e8)]();console[_0x2f220b(0x192)](a7_0x178e47['green'](_0x2f220b(0x1c3))),console[_0x2f220b(0x192)]('\x20\x20'+a7_0x178e47[_0x2f220b(0x1ec)](_0x254ab8+':'+_0x333ac7[_0x2f220b(0x1d9)])+'\x20\x20user_id:'+_0x333ac7['id']+_0x2f220b(0x1b9)+_0x333ac7[_0x2f220b(0x1d1)]+')');!_0x1a530c&&(console['log'](a7_0x178e47[_0x2f220b(0x1cc)](_0x2f220b(0x1c5))),console[_0x2f220b(0x192)](a7_0x178e47['dim'](_0x2f220b(0x1da))),console[_0x2f220b(0x192)](a7_0x178e47[_0x2f220b(0x1cc)](_0x2f220b(0x190))));await saveOAuthTokens(_0x45814a,_0x1df469),console[_0x2f220b(0x192)](_0x2f220b(0x1a5)+(_0x1df469?_0x2f220b(0x19a)+_0x1df469+')':''));if(_0x1df469){const _0x37cbc4={'site':_0x254ab8};saveProfileToUserConfig(_0x1df469,_0x37cbc4),console[_0x2f220b(0x192)](_0x2f220b(0x1ad)+_0x1df469+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x254ab8),console['log']('✓\x20Default\x20site\x20set\x20to\x20'+_0x254ab8);const _0x270ad1=_0x1df469?_0x2f220b(0x18b)+_0x1df469:'';console[_0x2f220b(0x192)](),console[_0x2f220b(0x192)](_0x2f220b(0x1de)),console['log']('\x20\x20tdx'+_0x270ad1+_0x2f220b(0x18a)),console[_0x2f220b(0x192)](_0x2f220b(0x1b0)+_0x270ad1+_0x2f220b(0x1a6));}export async function promptAuthMethod(){const _0x4bdca0=a7_0x2581,_0x15f12e=await a7_0x358af6({'type':_0x4bdca0(0x198),'name':_0x4bdca0(0x1ed),'message':_0x4bdca0(0x1ab),'choices':[{'title':_0x4bdca0(0x199),'description':_0x4bdca0(0x196),'value':'oauth'},{'title':_0x4bdca0(0x1d5),'description':_0x4bdca0(0x1d7),'value':'apikey'}]});return _0x15f12e['method']||null;}export class AuthSetupCommand extends BaseCommand{['name']=a7_0x3aba64(0x1c6);[a7_0x3aba64(0x1cb)]=a7_0x3aba64(0x1a0);async[a7_0x3aba64(0x1e1)](_0x2c4f70){const _0x1de965=a7_0x3aba64,{options:_0x383b06}=_0x2c4f70,_0x95f1de=_0x383b06[_0x1de965(0x1b8)];console[_0x1de965(0x192)](a7_0x178e47[_0x1de965(0x1ce)]('tdx:\x20auth\x20setup'));const _0x3bd5aa=_0x383b06[_0x1de965(0x1e7)]||_0x1de965(0x1c4),_0xb0d331=await promptSiteSelection(_0x3bd5aa,_0x95f1de,_0x1de965(0x19d));if(!_0xb0d331)return 0x1;const _0x3ffa86=resolveSite(_0xb0d331),_0x59f526=await promptAuthMethod();if(!_0x59f526)return console[_0x1de965(0x192)](_0x1de965(0x1bd)),0x1;if(_0x59f526===_0x1de965(0x19c)){const {accountName:_0x4b6775}=_0x383b06;return await runOAuthLoginFlow(_0x3ffa86,_0x95f1de,_0x383b06[_0x1de965(0x1ae)]??LogLevel[_0x1de965(0x187)],{'accountName':_0x4b6775}),0x0;}console[_0x1de965(0x192)](_0x1de965(0x1d8)+_0x3ffa86),console[_0x1de965(0x192)](_0x1de965(0x194)),console[_0x1de965(0x192)]('\x20\x20'+getConsoleUrl(_0x3ffa86,_0x1de965(0x1be)));const _0x8083b2=await a7_0x358af6({'type':_0x1de965(0x1b6),'name':_0x1de965(0x1ba),'message':_0x1de965(0x1ee),'validate':_0x56a100=>{const _0x4333a3=_0x1de965;if(!_0x56a100||!_0x56a100['trim']())return _0x4333a3(0x1cf);return!![];}});if(!_0x8083b2[_0x1de965(0x1ba)])return console['log']('\x0aSetup\x20cancelled'),0x1;const _0x3096bc=_0x8083b2['apiKey'];console['log'](_0x1de965(0x18c));try{const _0xc4aaa7=TDX[_0x1de965(0x188)]({'site':_0x3ffa86,'apiKey':_0x3096bc[_0x1de965(0x1c8)](),'logLevel':_0x383b06[_0x1de965(0x1ae)]??LogLevel['ERROR']}),_0x5e3014=await _0xc4aaa7[_0x1de965(0x1db)][_0x1de965(0x1e8)]();console['log'](_0x1de965(0x1df)+_0x5e3014[_0x1de965(0x1d1)]+')');const _0x7d8c63=await isKeychainAvailable();_0x7d8c63?(await saveAPIKeyAsync(_0x3096bc['trim'](),_0x3ffa86,_0x95f1de),console[_0x1de965(0x192)](_0x1de965(0x1dd)+(_0x95f1de?_0x1de965(0x19a)+_0x95f1de+')':''))):(console[_0x1de965(0x1e6)](a7_0x178e47[_0x1de965(0x1a9)](_0x1de965(0x18e))),console[_0x1de965(0x1e6)](a7_0x178e47[_0x1de965(0x1a9)](_0x1de965(0x189))));if(_0x95f1de){const _0x38c9a3={'site':_0x3ffa86};saveProfileToUserConfig(_0x95f1de,_0x38c9a3),console['log'](_0x1de965(0x1ad)+_0x95f1de+_0x1de965(0x197));}else saveDefaultSiteToUserConfig(_0x3ffa86),console[_0x1de965(0x192)](_0x1de965(0x1b5)+_0x3ffa86);const _0x110c9f=_0x95f1de?_0x1de965(0x18b)+_0x95f1de:'';return console[_0x1de965(0x192)](),console[_0x1de965(0x192)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log'](_0x1de965(0x1b0)+_0x110c9f+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x1de965(0x192)]('\x20\x20tdx'+_0x110c9f+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x2a202c){if(_0x2a202c instanceof HTTPClientError&&_0x2a202c[_0x1de965(0x1a2)]===0x191)return printAuthError(_0x2a202c),0x1;return console['error'](a7_0x178e47[_0x1de965(0x1bc)](_0x1de965(0x1e9)+(_0x2a202c instanceof Error?_0x2a202c['message']:String(_0x2a202c)))),console[_0x1de965(0x1e5)](_0x1de965(0x19e)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x3aba64(0x1b4)]=a7_0x3aba64(0x1b3);[a7_0x3aba64(0x1cb)]=a7_0x3aba64(0x1ca);async[a7_0x3aba64(0x1e1)](_0x4f9625){const _0x236fae=a7_0x3aba64,{options:_0x323623,tdx:_0x432a3f}=_0x4f9625,_0x2f4c87=_0x323623['site'],_0x4092e5=_0x323623[_0x236fae(0x1b8)],_0x137833=_0x4092e5?_0x4092e5:_0x236fae(0x186);console[_0x236fae(0x192)](_0x236fae(0x1b7)+_0x137833+_0x236fae(0x1a3)+_0x2f4c87+')');const _0x1f9ed6=await getOAuthTokens(_0x4092e5);if(_0x1f9ed6)console[_0x236fae(0x192)]('Credential\x20type:\x20OAuth'),console[_0x236fae(0x192)](_0x236fae(0x1ea)+(_0x4092e5?_0x236fae(0x19a)+_0x4092e5+')':''));else{const _0x2c5731=await resolveAPIKeyAsync(_0x2f4c87,_0x4092e5);if(_0x2c5731){const {source:_0x21c98f,isDeprecated:_0x389589}=_0x2c5731,_0x2d3110=_0x236fae(0x19b)+_0x21c98f;console['log'](_0x389589?a7_0x178e47[_0x236fae(0x1a9)](_0x2d3110):_0x2d3110);}else console['log'](a7_0x178e47[_0x236fae(0x1a9)](_0x236fae(0x191)));}try{const _0x3bf799=await _0x432a3f['jobs']['getUserInfo']();return console[_0x236fae(0x192)](a7_0x178e47['green'](_0x236fae(0x1ac))),console['log'](_0x236fae(0x1e3)+_0x3bf799[_0x236fae(0x1d1)]),(_0x3bf799[_0x236fae(0x195)]||_0x3bf799['last_name'])&&console[_0x236fae(0x192)]('Name:\x20'+[_0x3bf799[_0x236fae(0x195)],_0x3bf799['last_name']][_0x236fae(0x1a8)](Boolean)['join']('\x20')),0x0;}catch(_0x544de8){return _0x544de8 instanceof HTTPClientError&&_0x544de8[_0x236fae(0x1a2)]===0x191?printAuthError(_0x544de8,!![],_0x4092e5):console[_0x236fae(0x1e5)](a7_0x178e47[_0x236fae(0x1bc)]('✗\x20Validation\x20failed:\x20'+(_0x544de8 instanceof Error?_0x544de8['message']:String(_0x544de8)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x3aba64(0x1b4)]=a7_0x3aba64(0x1e2);[a7_0x3aba64(0x1cb)]=a7_0x3aba64(0x1a7);async[a7_0x3aba64(0x1e1)](_0x4a08bc){const _0x4994b1=a7_0x3aba64,{options:_0x5dc371}=_0x4a08bc,_0x39dc21=_0x5dc371[_0x4994b1(0x1b8)];console['log'](a7_0x178e47[_0x4994b1(0x1ce)](_0x4994b1(0x193)));const _0x31efb8=await isKeychainAvailable();if(!_0x31efb8)return console['error'](a7_0x178e47[_0x4994b1(0x1bc)]('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x1ce3fb,_0x6f8cea]=await Promise[_0x4994b1(0x1d0)]([deleteKeychainAPIKey(_0x39dc21),deleteOAuthTokens(_0x39dc21)]);if(_0x1ce3fb||_0x6f8cea){clearCredentialCache();const _0x31e396=[_0x1ce3fb&&_0x4994b1(0x1b2),_0x6f8cea&&'OAuth\x20tokens']['filter'](Boolean)[_0x4994b1(0x1bb)](_0x4994b1(0x1c7));return console[_0x4994b1(0x192)]('✓\x20'+_0x31e396+_0x4994b1(0x1dc)+(_0x39dc21?_0x4994b1(0x19a)+_0x39dc21+')':'')),0x0;}else return console[_0x4994b1(0x192)](_0x4994b1(0x19f)+(_0x39dc21?_0x4994b1(0x1c0)+_0x39dc21:'')),0x1;}}
@@ -1 +1 @@
1
- {"version":3,"file":"cas-command.d.ts","sourceRoot":"","sources":["../../src/commands/cas-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAqBhE;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,+BAA+B;IAE7C,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAmCxD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,oCAAoC;IAElD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAuDxD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,4CAA4C;IAE1D,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAuFxD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,gCAAgC;IAE9C,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAmNxD;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;IACjD,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,WAAW,qDAAqD;IAEnE,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CA2FxD;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,WAAW,6CAA6C;IAE3D,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CA0DxD"}
1
+ {"version":3,"file":"cas-command.d.ts","sourceRoot":"","sources":["../../src/commands/cas-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAqBhE;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,+BAA+B;IAE7C,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAmCxD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,oCAAoC;IAElD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAuDxD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,4CAA4C;IAE1D,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAuFxD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,gCAAgC;IAE9C,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAgPxD;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;IACjD,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,WAAW,qDAAqD;IAEnE,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CA2FxD;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,WAAW,6CAA6C;IAE3D,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CA0DxD"}