@treasuredata/tdx 2026.8.0 → 2026.8.2

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 (263) 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.d.ts +9 -0
  12. package/dist/commands/auth-command.d.ts.map +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/auth-command.js.map +1 -1
  15. package/dist/commands/cas-command.js +1 -1
  16. package/dist/commands/cas-segment-command.js +1 -1
  17. package/dist/commands/chat-command.js +1 -1
  18. package/dist/commands/claude-command.d.ts +10 -1
  19. package/dist/commands/claude-command.d.ts.map +1 -1
  20. package/dist/commands/claude-command.js +1 -1
  21. package/dist/commands/claude-command.js.map +1 -1
  22. package/dist/commands/claude-statusline-command.js +1 -1
  23. package/dist/commands/claude-usage-command.js +1 -1
  24. package/dist/commands/command.js +1 -1
  25. package/dist/commands/connection-command.js +1 -1
  26. package/dist/commands/databases.js +1 -1
  27. package/dist/commands/delivery-command.js +1 -1
  28. package/dist/commands/describe.js +1 -1
  29. package/dist/commands/engage-always-on-campaign-pull-command.js +1 -1
  30. package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
  31. package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
  32. package/dist/commands/engage-campaign-pull-command.js +1 -1
  33. package/dist/commands/engage-campaign-push-command.js +1 -1
  34. package/dist/commands/engage-campaign-validate-command.js +1 -1
  35. package/dist/commands/engage-command.js +1 -1
  36. package/dist/commands/engage-template-pull-command.js +1 -1
  37. package/dist/commands/engage-template-push-command.js +1 -1
  38. package/dist/commands/engage-template-validate-command.js +1 -1
  39. package/dist/commands/job-command.js +1 -1
  40. package/dist/commands/journey-command.js +1 -1
  41. package/dist/commands/journey-validate-command.js +1 -1
  42. package/dist/commands/llm-command.js +1 -1
  43. package/dist/commands/mcp-command.js +1 -1
  44. package/dist/commands/parent-segment-command.js +1 -1
  45. package/dist/commands/policy-command.js +1 -1
  46. package/dist/commands/profile-command.js +1 -1
  47. package/dist/commands/profiles-command.js +1 -1
  48. package/dist/commands/query-command.js +1 -1
  49. package/dist/commands/schedule-command.js +1 -1
  50. package/dist/commands/segment-command.js +1 -1
  51. package/dist/commands/segment-create-command.js +1 -1
  52. package/dist/commands/segment-fields-command.js +1 -1
  53. package/dist/commands/segment-move-command.js +1 -1
  54. package/dist/commands/segment-pull-command.js +1 -1
  55. package/dist/commands/segment-push-command.js +1 -1
  56. package/dist/commands/segment-update-command.js +1 -1
  57. package/dist/commands/segment-use-command.js +1 -1
  58. package/dist/commands/segment-validate-command.js +1 -1
  59. package/dist/commands/segments.js +1 -1
  60. package/dist/commands/show.js +1 -1
  61. package/dist/commands/status-command.js +1 -1
  62. package/dist/commands/table-deleted.js +1 -1
  63. package/dist/commands/tables.js +1 -1
  64. package/dist/commands/unset-command.js +1 -1
  65. package/dist/commands/upgrade-command.js +1 -1
  66. package/dist/commands/use-command.js +1 -1
  67. package/dist/commands/user-command.js +1 -1
  68. package/dist/commands/work-command.js +1 -1
  69. package/dist/commands/workflow-command.js +1 -1
  70. package/dist/core/auth.js +1 -1
  71. package/dist/core/command-output.js +1 -1
  72. package/dist/core/config.js +1 -1
  73. package/dist/core/connection-cache.js +1 -1
  74. package/dist/core/constants.js +1 -1
  75. package/dist/core/credential-cache.js +1 -1
  76. package/dist/core/global-context.js +1 -1
  77. package/dist/core/keychain.js +1 -1
  78. package/dist/core/oauth-keychain.js +1 -1
  79. package/dist/core/oauth.js +1 -1
  80. package/dist/core/profile.js +1 -1
  81. package/dist/core/project-config.js +1 -1
  82. package/dist/core/session.js +1 -1
  83. package/dist/core/site-mismatch.js +1 -1
  84. package/dist/core/user-cache.js +1 -1
  85. package/dist/core/version.js +1 -1
  86. package/dist/index.js +1 -1
  87. package/dist/mcp/server.js +1 -1
  88. package/dist/mcp/tools/index.js +1 -1
  89. package/dist/mcp/tools/tdx-run.js +1 -1
  90. package/dist/mcp/tools/tdx-search.js +1 -1
  91. package/dist/mcp/tools/work-create-item.js +1 -1
  92. package/dist/mcp/utils.js +1 -1
  93. package/dist/proxy/claude-usage-tracker.js +1 -1
  94. package/dist/proxy/passthrough-server.js +1 -1
  95. package/dist/proxy/sse-usage-parser.js +1 -1
  96. package/dist/sdk/agent/agent-config.js +1 -1
  97. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  98. package/dist/sdk/agent/agent-yaml.js +1 -1
  99. package/dist/sdk/agent/test/evaluator.js +1 -1
  100. package/dist/sdk/agent/test/executor.js +1 -1
  101. package/dist/sdk/agent/test/index.js +1 -1
  102. package/dist/sdk/agent/test/output.js +1 -1
  103. package/dist/sdk/agent/test/parser.js +1 -1
  104. package/dist/sdk/agent/tool-target-registry.js +1 -1
  105. package/dist/sdk/api.js +1 -1
  106. package/dist/sdk/auth-token.d.ts +23 -0
  107. package/dist/sdk/auth-token.d.ts.map +1 -0
  108. package/dist/sdk/auth-token.js +1 -0
  109. package/dist/sdk/auth-token.js.map +1 -0
  110. package/dist/sdk/cas/cas-api-client.js +1 -1
  111. package/dist/sdk/cas/cas-audience-schema.d.ts +2 -0
  112. package/dist/sdk/cas/cas-audience-schema.d.ts.map +1 -1
  113. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  114. package/dist/sdk/cas/cas-audience-schema.js.map +1 -1
  115. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  116. package/dist/sdk/cas/cas-audience-yaml.d.ts.map +1 -1
  117. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  118. package/dist/sdk/cas/cas-audience-yaml.js.map +1 -1
  119. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  120. package/dist/sdk/cas/index.js +1 -1
  121. package/dist/sdk/cas/pull-workflow.js +1 -1
  122. package/dist/sdk/cas/push-workflow.d.ts.map +1 -1
  123. package/dist/sdk/cas/push-workflow.js +1 -1
  124. package/dist/sdk/cas/push-workflow.js.map +1 -1
  125. package/dist/sdk/cas/types.d.ts +2 -0
  126. package/dist/sdk/cas/types.d.ts.map +1 -1
  127. package/dist/sdk/cas/validate-files.js +1 -1
  128. package/dist/sdk/client/cdp-api-client.js +1 -1
  129. package/dist/sdk/client/delivery-api-client.js +1 -1
  130. package/dist/sdk/client/endpoints.js +1 -1
  131. package/dist/sdk/client/engage-api-client.js +1 -1
  132. package/dist/sdk/client/http-client.js +1 -1
  133. package/dist/sdk/client/llm-api-client.js +1 -1
  134. package/dist/sdk/client/oauth-refresh.js +1 -1
  135. package/dist/sdk/client/rate-limiter.js +1 -1
  136. package/dist/sdk/client/td-api-client.js +1 -1
  137. package/dist/sdk/client/trino-api-client.js +1 -1
  138. package/dist/sdk/client/workflow-client.js +1 -1
  139. package/dist/sdk/connection-validator.js +1 -1
  140. package/dist/sdk/connection.js +1 -1
  141. package/dist/sdk/delivery.js +1 -1
  142. package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
  143. package/dist/sdk/engage/always-on-campaign-push.js +1 -1
  144. package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
  145. package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
  146. package/dist/sdk/engage/campaign-pull.js +1 -1
  147. package/dist/sdk/engage/campaign-push.js +1 -1
  148. package/dist/sdk/engage/campaign-validator.js +1 -1
  149. package/dist/sdk/engage/campaign-yaml.js +1 -1
  150. package/dist/sdk/engage/template-pull.js +1 -1
  151. package/dist/sdk/engage/template-push.js +1 -1
  152. package/dist/sdk/engage/template-validator.js +1 -1
  153. package/dist/sdk/engage/template-yaml.js +1 -1
  154. package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
  155. package/dist/sdk/engage/types/campaign-def.js +1 -1
  156. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  157. package/dist/sdk/engage/types/template-schema.js +1 -1
  158. package/dist/sdk/engage.js +1 -1
  159. package/dist/sdk/errors.js +1 -1
  160. package/dist/sdk/index.js +1 -1
  161. package/dist/sdk/io/index.js +1 -1
  162. package/dist/sdk/io/node-filesystem.js +1 -1
  163. package/dist/sdk/job.js +1 -1
  164. package/dist/sdk/journey.js +1 -1
  165. package/dist/sdk/llm/chat-cache.js +1 -1
  166. package/dist/sdk/llm/index.js +1 -1
  167. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  168. package/dist/sdk/llm/model-factors.js +1 -1
  169. package/dist/sdk/llm/user-settings.js +1 -1
  170. package/dist/sdk/personalization.js +1 -1
  171. package/dist/sdk/policy.js +1 -1
  172. package/dist/sdk/query/deleted-table-validation.js +1 -1
  173. package/dist/sdk/query/index.js +1 -1
  174. package/dist/sdk/query/sql-parser.js +1 -1
  175. package/dist/sdk/realtime.js +1 -1
  176. package/dist/sdk/schedule.js +1 -1
  177. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  178. package/dist/sdk/segment/fields-display.js +1 -1
  179. package/dist/sdk/segment/file-discovery.js +1 -1
  180. package/dist/sdk/segment/journey-utils.js +1 -1
  181. package/dist/sdk/segment/journey-validator.js +1 -1
  182. package/dist/sdk/segment/journey-yaml.js +1 -1
  183. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  184. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  185. package/dist/sdk/segment/pull-workflow.js +1 -1
  186. package/dist/sdk/segment/push-recovery.js +1 -1
  187. package/dist/sdk/segment/push-workflow.js +1 -1
  188. package/dist/sdk/segment/resolution-context.js +1 -1
  189. package/dist/sdk/segment/segment-path-parser.js +1 -1
  190. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  191. package/dist/sdk/segment/segment-validator.js +1 -1
  192. package/dist/sdk/segment/target-resolution.js +1 -1
  193. package/dist/sdk/segment/tdx-config.js +1 -1
  194. package/dist/sdk/segment/types/activation-schema.js +1 -1
  195. package/dist/sdk/segment/types/journey-def.js +1 -1
  196. package/dist/sdk/segment/types/journey-schema.js +1 -1
  197. package/dist/sdk/segment/types/segment-def.js +1 -1
  198. package/dist/sdk/segment/types/segment-schema.js +1 -1
  199. package/dist/sdk/segment/validate-files.js +1 -1
  200. package/dist/sdk/segment/yaml-validator.js +1 -1
  201. package/dist/sdk/segment.js +1 -1
  202. package/dist/sdk/types/cas.d.ts +4 -0
  203. package/dist/sdk/types/cas.d.ts.map +1 -1
  204. package/dist/sdk/types/index.js +1 -1
  205. package/dist/sdk/types/progress.js +1 -1
  206. package/dist/sdk/types/workspace.js +1 -1
  207. package/dist/sdk/user.js +1 -1
  208. package/dist/sdk/util/format-detector.js +1 -1
  209. package/dist/sdk/util/formatters.js +1 -1
  210. package/dist/sdk/util/index.js +1 -1
  211. package/dist/sdk/util/paginate.js +1 -1
  212. package/dist/sdk/util/tree-formatter.js +1 -1
  213. package/dist/sdk/util/tree-search.js +1 -1
  214. package/dist/sdk/workflow/archive-validation.js +1 -1
  215. package/dist/sdk/workflow/clone-workflow.js +1 -1
  216. package/dist/sdk/workflow/index.js +1 -1
  217. package/dist/sdk/workflow/pull-workflow.js +1 -1
  218. package/dist/sdk/workflow/push-workflow.js +1 -1
  219. package/dist/sdk/workflow/task-graph.js +1 -1
  220. package/dist/sdk/workflow/tdx-config.js +1 -1
  221. package/dist/sdk/workflow/workflow-utils.js +1 -1
  222. package/dist/sdk/workspace/access-tracker.js +1 -1
  223. package/dist/sdk/workspace/frontmatter.js +1 -1
  224. package/dist/sdk/workspace/git.js +1 -1
  225. package/dist/sdk/workspace/index.js +1 -1
  226. package/dist/sdk/workspace/templates.js +1 -1
  227. package/dist/sdk/workspace/weekly.js +1 -1
  228. package/dist/sdk/workspace/wikilinks.js +1 -1
  229. package/dist/test-utils/command-runner.js +1 -1
  230. package/dist/test-utils/factories.js +1 -1
  231. package/dist/test-utils/fixtures.js +1 -1
  232. package/dist/test-utils/http-mock.js +1 -1
  233. package/dist/test-utils/index.js +1 -1
  234. package/dist/utils/async.js +1 -1
  235. package/dist/utils/claude-code-state.js +1 -1
  236. package/dist/utils/colors.js +1 -1
  237. package/dist/utils/diff.js +1 -1
  238. package/dist/utils/file-permissions.js +1 -1
  239. package/dist/utils/file-reader.js +1 -1
  240. package/dist/utils/github-releases.js +1 -1
  241. package/dist/utils/global-cache.js +1 -1
  242. package/dist/utils/json-loader.js +1 -1
  243. package/dist/utils/local-cache.js +1 -1
  244. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  245. package/dist/utils/logger/formatters/index.js +1 -1
  246. package/dist/utils/logger/handlers/console-handler.js +1 -1
  247. package/dist/utils/logger/handlers/file-handler.js +1 -1
  248. package/dist/utils/logger/handlers/index.js +1 -1
  249. package/dist/utils/logger/handlers/null-handler.js +1 -1
  250. package/dist/utils/logger/index.js +1 -1
  251. package/dist/utils/logger/logger.js +1 -1
  252. package/dist/utils/logger/types.js +1 -1
  253. package/dist/utils/option-validation.js +1 -1
  254. package/dist/utils/process.js +1 -1
  255. package/dist/utils/prompt.js +1 -1
  256. package/dist/utils/proxy-fetch.js +1 -1
  257. package/dist/utils/spinner.js +1 -1
  258. package/dist/utils/sse-parser.js +1 -1
  259. package/dist/utils/string-utils.js +1 -1
  260. package/dist/utils/table-ref-parser.js +1 -1
  261. package/dist/utils/tdx-logger.js +1 -1
  262. package/dist/utils/version-check.js +1 -1
  263. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x16dd8c=a3_0x2787;(function(_0x3db77,_0x380892){const _0x1c23d8=a3_0x2787,_0x5c51d9=_0x3db77();while(!![]){try{const _0x86cf9c=-parseInt(_0x1c23d8(0x1e6))/0x1+parseInt(_0x1c23d8(0x1e4))/0x2*(-parseInt(_0x1c23d8(0x1ef))/0x3)+-parseInt(_0x1c23d8(0x1da))/0x4+-parseInt(_0x1c23d8(0x1ee))/0x5*(-parseInt(_0x1c23d8(0x1e0))/0x6)+parseInt(_0x1c23d8(0x1f1))/0x7*(-parseInt(_0x1c23d8(0x1ea))/0x8)+parseInt(_0x1c23d8(0x1dd))/0x9*(parseInt(_0x1c23d8(0x1ed))/0xa)+-parseInt(_0x1c23d8(0x1e7))/0xb*(-parseInt(_0x1c23d8(0x1db))/0xc);if(_0x86cf9c===_0x380892)break;else _0x5c51d9['push'](_0x5c51d9['shift']());}catch(_0x5336cd){_0x5c51d9['push'](_0x5c51d9['shift']());}}}(a3_0x44c6,0xefbf8));import{BaseCommand}from'./command.js';function a3_0x44c6(){const _0x8bc90=['4kIOero','cause','1394622qRPCRv','24497znaPPA','verbose','Parent\x20name:\x20','216XwMdoO','message','data','2403090bDwayt','5NfWfgZ','303174VtnWbr','resolveParentId','268933hmDxnW','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','length','error','List\x20activations\x20for\x20a\x20segment','Listing\x20activations\x20for\x20segment\x20\x27','Resolved\x20child\x20ID:\x20','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Child\x20name:\x20','Error:\x20Segment\x20name\x20is\x20required','7696784lZbvpo','16680WCbVpK','resolveSegmentId','36vtyWEn','\x27...','Site:\x20','8900934hQlXyC','✔\x20Found\x20','activations','segment'];a3_0x44c6=function(){return _0x8bc90;};return a3_0x44c6();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a3_0x2787(_0x590ca4,_0x3e50d5){_0x590ca4=_0x590ca4-0x1d8;const _0x44c61f=a3_0x44c6();let _0x278728=_0x44c61f[_0x590ca4];return _0x278728;}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{['name']=a3_0x16dd8c(0x1e2);['description']=a3_0x16dd8c(0x1f5);async['execute'](_0x30f67e){const _0x3e12b5=a3_0x16dd8c,{options:_0x151889,args:_0x590d17,tdx:_0x3c9e1e}=_0x30f67e;if(_0x590d17[_0x3e12b5(0x1f3)]===0x0)return console[_0x3e12b5(0x1f4)](_0x3e12b5(0x1d9)),console['error'](_0x3e12b5(0x1f8)),0x1;try{const {parentId:_0x43ea3b,childId:_0xcc361e}=parseSegmentRef(_0x590d17[0x0]);if(!_0xcc361e)return console[_0x3e12b5(0x1f4)](_0x3e12b5(0x1f2)),console[_0x3e12b5(0x1f4)](_0x3e12b5(0x1f8)),0x1;_0x151889[_0x3e12b5(0x1e8)]&&(console[_0x3e12b5(0x1f4)](_0x3e12b5(0x1df)+_0x151889['site']),console['error'](_0x3e12b5(0x1e9)+_0x43ea3b),console['error'](_0x3e12b5(0x1d8)+_0xcc361e));const _0x297ea5=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x43ea3b+_0x3e12b5(0x1de),()=>_0x3c9e1e[_0x3e12b5(0x1e3)][_0x3e12b5(0x1f0)](_0x43ea3b),{'verbose':_0x151889[_0x3e12b5(0x1e8)]}),_0xc83bc3=_0x297ea5[_0x3e12b5(0x1ec)];_0x151889[_0x3e12b5(0x1e8)]&&console[_0x3e12b5(0x1f4)]('Resolved\x20parent\x20ID:\x20'+_0xc83bc3);const _0xbbc241=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0xcc361e+_0x3e12b5(0x1de),()=>_0x3c9e1e[_0x3e12b5(0x1e3)][_0x3e12b5(0x1dc)](_0xc83bc3,_0xcc361e),{'verbose':_0x151889[_0x3e12b5(0x1e8)]}),_0x118fdc=_0xbbc241['data'];_0x151889['verbose']&&console[_0x3e12b5(0x1f4)](_0x3e12b5(0x1f7)+_0x118fdc);const _0x470c1c=await withSpinner(_0x3e12b5(0x1f6)+_0xcc361e+_0x3e12b5(0x1de),()=>_0x3c9e1e[_0x3e12b5(0x1e3)]['listActivations'](_0xc83bc3,_0x118fdc),{'verbose':_0x151889['verbose']}),_0x2fa23a=_0x470c1c[_0x3e12b5(0x1ec)];return console[_0x3e12b5(0x1f4)](_0x3e12b5(0x1e1)+_0x2fa23a['length']+'\x20activation'+(_0x2fa23a['length']!==0x1?'s':'')),await handleSDKOutput(_0x2fa23a,_0x151889),0x0;}catch(_0x3d38c5){if(_0x3d38c5 instanceof SDKError)return console[_0x3e12b5(0x1f4)]('Error:\x20'+_0x3d38c5[_0x3e12b5(0x1eb)]),_0x3d38c5[_0x3e12b5(0x1e5)]&&console[_0x3e12b5(0x1f4)]('\x20\x20Cause:\x20'+_0x3d38c5[_0x3e12b5(0x1e5)]),0x1;throw _0x3d38c5;}}}
1
+ const a3_0x11e068=a3_0x2b69;(function(_0xd16b0d,_0x34f7c2){const _0x47ace5=a3_0x2b69,_0xfbbaae=_0xd16b0d();while(!![]){try{const _0x18012e=parseInt(_0x47ace5(0x71))/0x1+parseInt(_0x47ace5(0x78))/0x2+-parseInt(_0x47ace5(0x72))/0x3+parseInt(_0x47ace5(0x85))/0x4*(parseInt(_0x47ace5(0x6e))/0x5)+-parseInt(_0x47ace5(0x75))/0x6*(parseInt(_0x47ace5(0x7e))/0x7)+-parseInt(_0x47ace5(0x67))/0x8+parseInt(_0x47ace5(0x7a))/0x9;if(_0x18012e===_0x34f7c2)break;else _0xfbbaae['push'](_0xfbbaae['shift']());}catch(_0x15c854){_0xfbbaae['push'](_0xfbbaae['shift']());}}}(a3_0x2810,0x944a2));function a3_0x2b69(_0x4b36b9,_0x134428){_0x4b36b9=_0x4b36b9-0x67;const _0x2810d3=a3_0x2810();let _0x2b69df=_0x2810d3[_0x4b36b9];return _0x2b69df;}import{BaseCommand}from'./command.js';function a3_0x2810(){const _0x42c029=['cause','Error:\x20','error','Resolving\x20child\x20segment\x20\x27','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','length','1630wAKmtF','Resolving\x20parent\x20segment\x20\x27','resolveSegmentId','1061320hufPVR','2319267CCeANw','verbose','activations','21738MCEMwt','List\x20activations\x20for\x20a\x20segment','site','2165860xEwzdp','resolveParentId','5095476dzJCsn','\x27...','description','Child\x20name:\x20','1757RwwoLB','\x20activation','Site:\x20','segment','execute','Parent\x20name:\x20','listActivations','9008XzMXGs','\x20\x20Cause:\x20','Resolved\x20parent\x20ID:\x20','message','data','Error:\x20Segment\x20name\x20is\x20required','9237680yRrNOw'];a3_0x2810=function(){return _0x42c029;};return a3_0x2810();}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_0x11e068(0x74);[a3_0x11e068(0x7c)]=a3_0x11e068(0x76);async[a3_0x11e068(0x82)](_0x9c1c61){const _0x4603ac=a3_0x11e068,{options:_0x5db56c,args:_0x2e6710,tdx:_0x34c619}=_0x9c1c61;if(_0x2e6710['length']===0x0)return console['error'](_0x4603ac(0x8a)),console[_0x4603ac(0x6a)](_0x4603ac(0x6c)),0x1;try{const {parentId:_0x15783e,childId:_0x415962}=parseSegmentRef(_0x2e6710[0x0]);if(!_0x415962)return console[_0x4603ac(0x6a)]('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x4603ac(0x6a)](_0x4603ac(0x6c)),0x1;_0x5db56c[_0x4603ac(0x73)]&&(console[_0x4603ac(0x6a)](_0x4603ac(0x80)+_0x5db56c[_0x4603ac(0x77)]),console[_0x4603ac(0x6a)](_0x4603ac(0x83)+_0x15783e),console['error'](_0x4603ac(0x7d)+_0x415962));const _0x4db79b=await withSpinner(_0x4603ac(0x6f)+_0x15783e+'\x27...',()=>_0x34c619[_0x4603ac(0x81)][_0x4603ac(0x79)](_0x15783e),{'verbose':_0x5db56c[_0x4603ac(0x73)]}),_0x579b47=_0x4db79b[_0x4603ac(0x89)];_0x5db56c['verbose']&&console['error'](_0x4603ac(0x87)+_0x579b47);const _0xc91125=await withSpinner(_0x4603ac(0x6b)+_0x415962+_0x4603ac(0x7b),()=>_0x34c619['segment'][_0x4603ac(0x70)](_0x579b47,_0x415962),{'verbose':_0x5db56c[_0x4603ac(0x73)]}),_0x345d7b=_0xc91125[_0x4603ac(0x89)];_0x5db56c['verbose']&&console[_0x4603ac(0x6a)]('Resolved\x20child\x20ID:\x20'+_0x345d7b);const _0x4da30c=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x415962+'\x27...',()=>_0x34c619[_0x4603ac(0x81)][_0x4603ac(0x84)](_0x579b47,_0x345d7b),{'verbose':_0x5db56c[_0x4603ac(0x73)]}),_0x22b8c9=_0x4da30c[_0x4603ac(0x89)];return console[_0x4603ac(0x6a)]('✔\x20Found\x20'+_0x22b8c9[_0x4603ac(0x6d)]+_0x4603ac(0x7f)+(_0x22b8c9[_0x4603ac(0x6d)]!==0x1?'s':'')),await handleSDKOutput(_0x22b8c9,_0x5db56c),0x0;}catch(_0x30c70e){if(_0x30c70e instanceof SDKError)return console['error'](_0x4603ac(0x69)+_0x30c70e[_0x4603ac(0x88)]),_0x30c70e[_0x4603ac(0x68)]&&console['error'](_0x4603ac(0x86)+_0x30c70e[_0x4603ac(0x68)]),0x1;throw _0x30c70e;}}}
@@ -1 +1 @@
1
- const a4_0x4969e3=a4_0x11f8;function a4_0x11f8(_0x18e552,_0x364de2){_0x18e552=_0x18e552-0x1c1;const _0x572122=a4_0x5721();let _0x11f859=_0x572122[_0x18e552];return _0x11f859;}(function(_0x20c214,_0x459c55){const _0x4dcfcd=a4_0x11f8,_0x518ae7=_0x20c214();while(!![]){try{const _0x565990=parseInt(_0x4dcfcd(0x238))/0x1+-parseInt(_0x4dcfcd(0x273))/0x2*(parseInt(_0x4dcfcd(0x1dd))/0x3)+-parseInt(_0x4dcfcd(0x256))/0x4+-parseInt(_0x4dcfcd(0x205))/0x5+-parseInt(_0x4dcfcd(0x1ee))/0x6*(-parseInt(_0x4dcfcd(0x1c7))/0x7)+parseInt(_0x4dcfcd(0x276))/0x8+-parseInt(_0x4dcfcd(0x203))/0x9*(-parseInt(_0x4dcfcd(0x274))/0xa);if(_0x565990===_0x459c55)break;else _0x518ae7['push'](_0x518ae7['shift']());}catch(_0x5243b2){_0x518ae7['push'](_0x518ae7['shift']());}}}(a4_0x5721,0xe72a0));import a4_0x10edef from'chalk';import a4_0x4aa9f6 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(_0x158746){const _0x3ce226=a4_0x11f8,_0x2230b7=[];if(_0x158746[_0x3ce226(0x1e2)]!==undefined)_0x2230b7[_0x3ce226(0x22b)](_0x158746[_0x3ce226(0x1e2)]+_0x3ce226(0x1cb));if(_0x158746[_0x3ce226(0x288)]!==undefined&&_0x158746[_0x3ce226(0x288)]>0x0)_0x2230b7['push'](a4_0x10edef[_0x3ce226(0x287)](_0x158746[_0x3ce226(0x288)]+_0x3ce226(0x268)));if(_0x158746['created']!==undefined&&_0x158746[_0x3ce226(0x245)]>0x0)_0x2230b7['push'](a4_0x10edef['green'](_0x158746[_0x3ce226(0x245)]+'\x20created'));if(_0x158746[_0x3ce226(0x258)]!==undefined&&_0x158746[_0x3ce226(0x258)]>0x0)_0x2230b7[_0x3ce226(0x22b)](a4_0x10edef[_0x3ce226(0x25f)](_0x158746[_0x3ce226(0x258)]+'\x20updated'));if(_0x158746['unchanged']!==undefined&&_0x158746[_0x3ce226(0x1d1)]>0x0)_0x2230b7[_0x3ce226(0x22b)](a4_0x10edef[_0x3ce226(0x226)](_0x158746[_0x3ce226(0x1d1)]+_0x3ce226(0x283)));if(_0x158746[_0x3ce226(0x285)]!==undefined&&_0x158746[_0x3ce226(0x285)]>0x0)_0x2230b7[_0x3ce226(0x22b)](a4_0x10edef[_0x3ce226(0x202)](_0x158746[_0x3ce226(0x285)]+_0x3ce226(0x208)));return _0x2230b7[_0x3ce226(0x242)](',\x20');}function displayDiffs(_0xa4f86d,_0x5d31c5,_0x42887b,_0x39bbe7,_0x2d47ac,_0x438d7e,_0x572f74,_0x16dbb4,_0xae182c){const _0x21e2d0=a4_0x11f8;for(const _0x484563 of _0xa4f86d){if(_0x484563[_0x21e2d0(0x225)]){const _0x4f730c=_0x484563[_0x21e2d0(0x24a)]||_0x484563[_0x21e2d0(0x267)];console[_0x21e2d0(0x25d)](_0x21e2d0(0x1e1)+_0x4f730c+'\x27:'),console[_0x21e2d0(0x25d)]('─'['repeat'](0x3c)),console['log'](_0x484563[_0x21e2d0(0x225)]),console[_0x21e2d0(0x25d)]('─'[_0x21e2d0(0x1d2)](0x3c));}}for(const _0x4792ea of _0x5d31c5){_0x4792ea['diff']&&(console[_0x21e2d0(0x25d)](_0x21e2d0(0x23a)+_0x4792ea[_0x21e2d0(0x267)]+'\x27:'),console[_0x21e2d0(0x25d)]('─'[_0x21e2d0(0x1d2)](0x3c)),console[_0x21e2d0(0x25d)](_0x4792ea[_0x21e2d0(0x225)]),console[_0x21e2d0(0x25d)]('─'[_0x21e2d0(0x1d2)](0x3c)));}for(const _0xf587b6 of _0x42887b){_0xf587b6[_0x21e2d0(0x225)]&&(console[_0x21e2d0(0x25d)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0xf587b6['name']+'\x27:'),console[_0x21e2d0(0x25d)]('─'[_0x21e2d0(0x1d2)](0x3c)),console[_0x21e2d0(0x25d)](_0xf587b6['diff']),console[_0x21e2d0(0x25d)]('─'[_0x21e2d0(0x1d2)](0x3c)));}for(const _0x2a610d of _0x39bbe7){_0x2a610d[_0x21e2d0(0x225)]&&(console[_0x21e2d0(0x25d)](_0x21e2d0(0x228)+_0x2a610d[_0x21e2d0(0x267)]+'\x27:'),console[_0x21e2d0(0x25d)]('─'[_0x21e2d0(0x1d2)](0x3c)),console['log'](_0x2a610d[_0x21e2d0(0x225)]),console[_0x21e2d0(0x25d)]('─'[_0x21e2d0(0x1d2)](0x3c)));}for(const _0xc03a41 of _0x2d47ac){_0xc03a41['diff']&&(console[_0x21e2d0(0x25d)]('\x0aChanges\x20to\x20integration\x20\x27'+_0xc03a41['name']+'\x27:'),console['log']('─'[_0x21e2d0(0x1d2)](0x3c)),console[_0x21e2d0(0x25d)](_0xc03a41[_0x21e2d0(0x225)]),console['log']('─'[_0x21e2d0(0x1d2)](0x3c)));}for(const _0x59f824 of _0x438d7e){_0x59f824[_0x21e2d0(0x225)]&&(console[_0x21e2d0(0x25d)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x59f824[_0x21e2d0(0x267)]+'\x27:'),console[_0x21e2d0(0x25d)]('─'['repeat'](0x3c)),console[_0x21e2d0(0x25d)](_0x59f824['diff']),console[_0x21e2d0(0x25d)]('─'['repeat'](0x3c)));}for(const _0x273b7a of _0x572f74){_0x273b7a[_0x21e2d0(0x225)]&&(console['log'](_0x21e2d0(0x22c)+_0x273b7a[_0x21e2d0(0x267)]+'\x27:'),console[_0x21e2d0(0x25d)]('─'[_0x21e2d0(0x1d2)](0x3c)),console[_0x21e2d0(0x25d)](_0x273b7a[_0x21e2d0(0x225)]),console[_0x21e2d0(0x25d)]('─'['repeat'](0x3c)));}for(const _0x1e250d of _0x16dbb4){_0x1e250d[_0x21e2d0(0x225)]&&(console['log']('\x0aChanges\x20to\x20form\x20interface\x20\x27'+_0x1e250d[_0x21e2d0(0x267)]+'\x27:'),console[_0x21e2d0(0x25d)]('─'[_0x21e2d0(0x1d2)](0x3c)),console[_0x21e2d0(0x25d)](_0x1e250d['diff']),console[_0x21e2d0(0x25d)]('─'['repeat'](0x3c)));}for(const _0x1dd682 of _0xae182c){_0x1dd682[_0x21e2d0(0x225)]&&(console[_0x21e2d0(0x25d)](_0x21e2d0(0x1d8)+_0x1dd682[_0x21e2d0(0x267)]+'\x27:'),console[_0x21e2d0(0x25d)]('─'['repeat'](0x3c)),console[_0x21e2d0(0x25d)](_0x1dd682[_0x21e2d0(0x225)]),console[_0x21e2d0(0x25d)]('─'['repeat'](0x3c)));}}function a4_0x5721(){const _0xc69259=['\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','arg-dir','llm','name','\x20new','Using\x20context\x20project:\x20','\x20files\x20to\x20','New\x20project\x20name\x20is\x20required','pullProject','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20\x20Form\x20Interface\x20\x22','\x0aWrite\x20','Using\x20project:\x20','\x20|\x20','Pushing\x20agent\x20from\x20\x22','182194nqzEzz','10CcWUYs','\x22...','199216GOEsMw','parse','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','cyan','New\x20project:\x20','\x20changed','description','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','prompts','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x0a✔\x20Pushed\x20','cwd-config','dirname','\x20unchanged','Agent:\x20','errors','\x20\x20Experimental\x20Artifacts:\x20','green','new','\x22\x20to\x20\x22','Using\x20current\x20project:\x20','context','New\x20project\x20ID:\x20','Using\x20local\x20project:\x20','Pulling\x20agent\x20\x22','7Nxxzpa','MISSING_ARGUMENT','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20total','Errors:','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','\x20\x20Chat\x20Interfaces:\x20','\x0aErrors\x20found:','\x20\x20Source:\x20','unchanged','repeat','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','integrations','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','agent:push','\x0aChanges\x20to\x20chat\x20interface\x20\x27','\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','textKnowledgeBases','\x20resources?','Chat:\x20','45oUUnjJ','\x0aChanges:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x0aChanges\x20to\x20agent\x20\x27','total','Project\x20cloned\x20successfully','✔\x20Context\x20set:\x20','Project:\x20','agent:clone','Summary:','No\x20tdx.json\x20found\x20in\x20','Writing\x20files...','\x20\x20Integrations:\x20','cloneProject','dim','Status:\x20','6730242KIiZKp','outputPath','outputDir','\x20files?','tdx.json','Clone\x20\x22','Agent\x20pulled\x20successfully','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','error','projectId','projectName','\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)','<new-name>','\x0aProject\x20pushed\x20with\x20errors','newProjectId','action','\x0a✔\x20Pulled\x20','hasChanges','experimentalArtifacts','\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','red','28219410aWcBFH','counts','5090565LpuDMu','\x20=\x20','\x0aPush\x20','\x20errors','pushProject','\x20\x20Chat\x20Interface\x20\x22','yes','no_context','\x20\x20tdx\x20agent\x20clone\x20agents/','utf-8','Source:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','knowledgeBases','agent:pull','session','Would\x20pull\x20agent:\x20','found','\x20\x20Knowledge\x20Base\x20\x22','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','cwd','Output\x20path:\x20','-\x20no\x20files\x20written','chatInterfaces','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','execute','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20\x20Form\x20Interfaces:\x20','\x20\x20Agent\x20\x22','Failed\x20to\x20push\x20agent:\x20','\x20--name\x20','\x20--profile\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','diff','gray','dryRun','\x0aChanges\x20to\x20prompt\x20\x27','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','site','push','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','llm_project','formInterfaces','force','Cancelled','\x0aError:','\x22:\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','message','\x20\x20tdx\x20agent\x20pull\x20','\x20\x20Integration\x20\x22','Would\x20clone:','80128oPQHwF','sourceProjectName','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Project\x20cloned\x20with\x20errors','output','-\x20nothing\x20pushed','agent','\x20\x20Knowledge\x20Bases:\x20','Output:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','join','Using\x20project\x20from\x20','Dry\x20run\x20-\x20no\x20changes\x20made','created','INVALID_ARGUMENT','Dry\x20run\x20-\x20no\x20files\x20written','experimentalKnowledgeBases','reason','agentName','\x20resources\x20to\x20\x27','\x20\x20Prompt\x20\x22','Pushing\x20to\x20project...','projectDir','no_local_folder','\x20\x20Target:\x20','Analyzing\x20changes\x20to\x20push...','\x20\x20Prompts:\x20','agent.yml','\x20\x20Experimental\x20Artifact\x20\x22','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','4123244Rnkbod','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','updated','\x20\x20Agents:\x20','Analyzing\x20project\x20\x22','Cannot\x20clone\x20from\x20context\x20project\x20\x22','agents','log','Cloning\x20\x22','yellow','llmProject','\x22\x20from\x20project\x20\x22','\x20successfully','Using\x20project\x20from\x20context:\x20'];a4_0x5721=function(){return _0xc69259;};return a4_0x5721();}export class AgentPullCommand extends BaseCommand{['name']=a4_0x4969e3(0x212);[a4_0x4969e3(0x27c)]=a4_0x4969e3(0x241);async['execute'](_0x294d24){const _0x2d07f1=a4_0x4969e3,{options:_0x44f087,args:_0x4fa4fd,tdx:_0x2f0049}=_0x294d24,_0x2feb67=_0x4fa4fd[0x0],_0x1ec47d=_0x4fa4fd[0x1],_0x2a48e1=_0x44f087[_0x2d07f1(0x23c)],_0x2c3f35=_0x44f087['dryRun'],_0x4d9a23=_0x44f087[_0x2d07f1(0x22f)],_0x5794a1=_0x44f087[_0x2d07f1(0x20b)],_0xb79af5=_0x44f087[_0x2d07f1(0x260)],_0x319946=_0x44f087[_0x2d07f1(0x23e)];let _0x24b6d7;if(_0x2feb67){const _0x3d299d=a4_0x4aa9f6[_0x2d07f1(0x242)](_0x2feb67,_0x2d07f1(0x1f2));if(existsSync(_0x3d299d))try{const _0x3d313e=JSON[_0x2d07f1(0x277)](readFileSync(_0x3d299d,_0x2d07f1(0x20e)));_0x3d313e[_0x2d07f1(0x22d)]&&(_0x24b6d7={'llm_project':_0x3d313e[_0x2d07f1(0x22d)]});}catch{}}const _0x54515d=findAgentConfigPath(process[_0x2d07f1(0x218)]());let _0x47c830;if(_0x54515d)try{const _0x5a8742=JSON['parse'](readFileSync(_0x54515d,'utf-8'));_0x5a8742['llm_project']&&(_0x47c830={'llm_project':_0x5a8742[_0x2d07f1(0x22d)]});}catch{}const _0x4611e2=resolveAgentPullArgs({'arg':_0x2feb67,'agentNameArg':_0x1ec47d,'agentFlag':_0x319946,'contextProject':_0xb79af5,'argDirConfig':_0x24b6d7,'cwdConfigPath':_0x54515d||undefined,'cwdConfig':_0x47c830}),{projectNameOrId:_0x513d5d,targetAgentName:_0x463c6d,existingOutputDir:_0x20ffd6,source:_0x2d4335}=_0x4611e2;if(_0x2d4335===_0x2d07f1(0x265))console[_0x2d07f1(0x25d)](a4_0x10edef[_0x2d07f1(0x1ec)](_0x2d07f1(0x243)+a4_0x4aa9f6['join'](_0x2feb67,'tdx.json')+':\x20'+_0x513d5d));else{if(_0x2d4335===_0x2d07f1(0x281))console[_0x2d07f1(0x25d)](a4_0x10edef[_0x2d07f1(0x1ec)](_0x2d07f1(0x270)+_0x513d5d));else _0x2d4335===_0x2d07f1(0x1c3)&&console[_0x2d07f1(0x25d)](a4_0x10edef['dim'](_0x2d07f1(0x263)+_0x513d5d));}if(!_0x513d5d)return _0x319946?(console[_0x2d07f1(0x25d)](a4_0x10edef['yellow']('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x2d07f1(0x25d)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0x2d07f1(0x25d)](_0x2d07f1(0x1f5))):(console['log'](a4_0x10edef[_0x2d07f1(0x25f)](_0x2d07f1(0x229))),console[_0x2d07f1(0x25d)](_0x2d07f1(0x1cd)),console[_0x2d07f1(0x25d)](_0x2d07f1(0x201)),console[_0x2d07f1(0x25d)](_0x2d07f1(0x233)),console['log'](_0x2d07f1(0x224)),console[_0x2d07f1(0x25d)](_0x2d07f1(0x1d9))),0x1;if(_0x463c6d){const {data:_0x324f6a}=await withSpinner(_0x2d07f1(0x1c6)+_0x463c6d+_0x2d07f1(0x261)+_0x513d5d+_0x2d07f1(0x275),()=>_0x2f0049[_0x2d07f1(0x266)]['pullAgent'](_0x513d5d,_0x463c6d,_0x2a48e1,{'dryRun':_0x2c3f35,'force':_0x4d9a23}));if(_0x2c3f35)return console['log'](a4_0x10edef[_0x2d07f1(0x25f)](_0x2d07f1(0x247))),console[_0x2d07f1(0x25d)](_0x2d07f1(0x214)+_0x324f6a['agentName']),console['log'](_0x2d07f1(0x219)+_0x324f6a['outputPath']),_0x324f6a[_0x2d07f1(0x225)]&&(console[_0x2d07f1(0x25d)](_0x2d07f1(0x1de)),console[_0x2d07f1(0x25d)]('─'[_0x2d07f1(0x1d2)](0x3c)),console['log'](_0x324f6a[_0x2d07f1(0x225)]),console[_0x2d07f1(0x25d)]('─'[_0x2d07f1(0x1d2)](0x3c))),0x0;return console[_0x2d07f1(0x25d)](a4_0x10edef['green'](_0x2d07f1(0x1f4))),console[_0x2d07f1(0x25d)](_0x2d07f1(0x284)+_0x324f6a[_0x2d07f1(0x24a)]),console['log'](_0x2d07f1(0x240)+_0x324f6a[_0x2d07f1(0x1ef)]),console['log'](_0x2d07f1(0x1ed)+(_0x324f6a['isNew']?a4_0x10edef[_0x2d07f1(0x287)](_0x2d07f1(0x288)):_0x324f6a[_0x2d07f1(0x1ff)]?a4_0x10edef['yellow']('updated'):a4_0x10edef[_0x2d07f1(0x226)](_0x2d07f1(0x1d1)))),0x0;}const _0xb1803c=_0x20ffd6||_0x2a48e1,{data:_0x10890e}=await withSpinner(_0x2d07f1(0x25a)+_0x513d5d+_0x2d07f1(0x275),()=>_0x2f0049['llm'][_0x2d07f1(0x26c)](_0x513d5d,_0xb1803c,{'dryRun':!![]})),_0x57716d=_0x10890e[_0x2d07f1(0x204)][_0x2d07f1(0x25c)]['new']+_0x10890e[_0x2d07f1(0x204)][_0x2d07f1(0x211)][_0x2d07f1(0x288)]+_0x10890e[_0x2d07f1(0x204)][_0x2d07f1(0x1da)][_0x2d07f1(0x288)]+_0x10890e[_0x2d07f1(0x204)]['prompts']['new']+_0x10890e[_0x2d07f1(0x204)][_0x2d07f1(0x1d4)][_0x2d07f1(0x288)]+_0x10890e[_0x2d07f1(0x204)][_0x2d07f1(0x248)][_0x2d07f1(0x288)]+_0x10890e[_0x2d07f1(0x204)]['experimentalArtifacts'][_0x2d07f1(0x288)]+_0x10890e[_0x2d07f1(0x204)][_0x2d07f1(0x22e)][_0x2d07f1(0x288)]+_0x10890e[_0x2d07f1(0x204)][_0x2d07f1(0x21b)][_0x2d07f1(0x288)],_0x4a8c6c=_0x10890e[_0x2d07f1(0x204)]['agents'][_0x2d07f1(0x258)]+_0x10890e[_0x2d07f1(0x204)]['knowledgeBases'][_0x2d07f1(0x258)]+_0x10890e[_0x2d07f1(0x204)][_0x2d07f1(0x1da)][_0x2d07f1(0x258)]+_0x10890e['counts']['prompts'][_0x2d07f1(0x258)]+_0x10890e[_0x2d07f1(0x204)]['integrations']['updated']+_0x10890e[_0x2d07f1(0x204)]['experimentalKnowledgeBases'][_0x2d07f1(0x258)]+_0x10890e[_0x2d07f1(0x204)]['experimentalArtifacts'][_0x2d07f1(0x258)]+_0x10890e[_0x2d07f1(0x204)]['formInterfaces'][_0x2d07f1(0x258)]+_0x10890e[_0x2d07f1(0x204)][_0x2d07f1(0x21b)][_0x2d07f1(0x258)],_0x7d9f85=_0x10890e['counts'][_0x2d07f1(0x25c)][_0x2d07f1(0x1d1)]+_0x10890e[_0x2d07f1(0x204)][_0x2d07f1(0x211)][_0x2d07f1(0x1d1)]+_0x10890e[_0x2d07f1(0x204)]['textKnowledgeBases']['unchanged']+_0x10890e[_0x2d07f1(0x204)][_0x2d07f1(0x27e)]['unchanged']+_0x10890e[_0x2d07f1(0x204)]['integrations'][_0x2d07f1(0x1d1)]+_0x10890e[_0x2d07f1(0x204)][_0x2d07f1(0x248)][_0x2d07f1(0x1d1)]+_0x10890e[_0x2d07f1(0x204)]['experimentalArtifacts'][_0x2d07f1(0x1d1)]+_0x10890e[_0x2d07f1(0x204)][_0x2d07f1(0x22e)]['unchanged']+_0x10890e[_0x2d07f1(0x204)][_0x2d07f1(0x21b)][_0x2d07f1(0x1d1)];console['log']('\x0aPull\x20summary\x20for\x20\x27'+_0x10890e[_0x2d07f1(0x1f8)]+'\x27:'),console[_0x2d07f1(0x25d)]('\x20\x20'+a4_0x10edef[_0x2d07f1(0x287)]('+\x20'+_0x57716d+'\x20new')+_0x2d07f1(0x271)+a4_0x10edef['yellow']('~\x20'+_0x4a8c6c+_0x2d07f1(0x27b))+_0x2d07f1(0x271)+a4_0x10edef[_0x2d07f1(0x1ec)]('=\x20'+_0x7d9f85+'\x20unchanged')),console[_0x2d07f1(0x25d)]('\x20\x20Agents:\x20'+formatCountSummary(_0x10890e['counts'][_0x2d07f1(0x25c)])),console[_0x2d07f1(0x25d)](_0x2d07f1(0x23f)+formatCountSummary(_0x10890e['counts'][_0x2d07f1(0x211)])),console[_0x2d07f1(0x25d)](_0x2d07f1(0x27f)+formatCountSummary(_0x10890e['counts'][_0x2d07f1(0x1da)])),console[_0x2d07f1(0x25d)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x10890e[_0x2d07f1(0x204)][_0x2d07f1(0x27e)])),console[_0x2d07f1(0x25d)](_0x2d07f1(0x1ea)+formatCountSummary(_0x10890e[_0x2d07f1(0x204)][_0x2d07f1(0x1d4)])),console[_0x2d07f1(0x25d)](_0x2d07f1(0x21f)+formatCountSummary(_0x10890e[_0x2d07f1(0x204)][_0x2d07f1(0x22e)])),console['log']('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x10890e['counts'][_0x2d07f1(0x21b)]));const _0x5438ab=_0x10890e[_0x2d07f1(0x204)][_0x2d07f1(0x248)][_0x2d07f1(0x1e2)]>0x0||_0x10890e[_0x2d07f1(0x204)][_0x2d07f1(0x200)][_0x2d07f1(0x1e2)]>0x0;_0x5438ab&&(console[_0x2d07f1(0x25d)](_0x2d07f1(0x1d6)+formatCountSummary(_0x10890e[_0x2d07f1(0x204)][_0x2d07f1(0x248)])),console[_0x2d07f1(0x25d)](_0x2d07f1(0x286)+formatCountSummary(_0x10890e[_0x2d07f1(0x204)][_0x2d07f1(0x200)])));console['log'](_0x2d07f1(0x250)+a4_0x10edef[_0x2d07f1(0x279)](_0x10890e[_0x2d07f1(0x1f0)])),displayDiffs(_0x10890e['agents'],_0x10890e[_0x2d07f1(0x211)],_0x10890e[_0x2d07f1(0x1da)],_0x10890e[_0x2d07f1(0x27e)],_0x10890e['integrations'],_0x10890e[_0x2d07f1(0x248)],_0x10890e['experimentalArtifacts'],_0x10890e[_0x2d07f1(0x22e)],_0x10890e[_0x2d07f1(0x21b)]);if(_0x2c3f35)return console[_0x2d07f1(0x25d)](a4_0x10edef[_0x2d07f1(0x25f)](_0x2d07f1(0x1ca))),0x0;if(_0x57716d===0x0&&_0x4a8c6c===0x0)return console[_0x2d07f1(0x25d)](a4_0x10edef[_0x2d07f1(0x287)](_0x2d07f1(0x21c))),saveSessionContext({'llm_project':_0x10890e[_0x2d07f1(0x1f8)]},_0x44f087[_0x2d07f1(0x213)]),console[_0x2d07f1(0x25d)](a4_0x10edef[_0x2d07f1(0x287)]('✔\x20Context\x20set:\x20'+a4_0x10edef[_0x2d07f1(0x1ec)](_0x2d07f1(0x22d))+_0x2d07f1(0x206)+a4_0x10edef['cyan'](_0x10890e['projectName']))),0x0;if(!_0x5794a1&&!_0x4d9a23){if(!isInteractive())return console[_0x2d07f1(0x1f6)](a4_0x10edef[_0x2d07f1(0x202)](_0x2d07f1(0x231)),_0x2d07f1(0x1df)),console[_0x2d07f1(0x1f6)](a4_0x10edef[_0x2d07f1(0x1ec)](_0x2d07f1(0x278))),0x1;const _0x3f6e4c=await confirmKey(_0x2d07f1(0x26f)+(_0x57716d+_0x4a8c6c)+_0x2d07f1(0x1f1));if(!_0x3f6e4c)return console[_0x2d07f1(0x25d)](a4_0x10edef[_0x2d07f1(0x25f)](_0x2d07f1(0x230)),_0x2d07f1(0x21a)),0x1;}const {data:_0x47200f}=await withSpinner(_0x2d07f1(0x1e9),()=>_0x2f0049[_0x2d07f1(0x266)][_0x2d07f1(0x26c)](_0x513d5d,_0xb1803c,{'force':_0x4d9a23}));return console[_0x2d07f1(0x25d)](a4_0x10edef['green'](_0x2d07f1(0x1fe)+(_0x57716d+_0x4a8c6c)+_0x2d07f1(0x26a)+_0x47200f[_0x2d07f1(0x1f0)])),saveSessionContext({'llm_project':_0x47200f[_0x2d07f1(0x1f8)]},_0x44f087['session']),console[_0x2d07f1(0x25d)](a4_0x10edef[_0x2d07f1(0x287)](_0x2d07f1(0x1e4)+a4_0x10edef['dim']('llm_project')+_0x2d07f1(0x206)+a4_0x10edef[_0x2d07f1(0x279)](_0x47200f['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x4969e3(0x267)]=a4_0x4969e3(0x1e6);[a4_0x4969e3(0x27c)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async['execute'](_0x53c0bb){const _0x159df6=a4_0x4969e3,{options:_0x2e2be8,args:_0x31393c,tdx:_0x46f7fc}=_0x53c0bb,_0x275bb8=_0x31393c[0x0],_0x435a72=_0x2e2be8[_0x159df6(0x267)],_0x1298a7=_0x2e2be8['dryRun'],_0x2692f3=_0x2e2be8[_0x159df6(0x20b)],_0x1fcc16=_0x2e2be8[_0x159df6(0x22a)],_0x472ddf=_0x2e2be8[_0x159df6(0x260)];let _0x523879;const _0x5009ac=findAgentConfigPath(process['cwd']());if(_0x275bb8){const _0x39d3a8=a4_0x4aa9f6[_0x159df6(0x242)](_0x275bb8,_0x159df6(0x1f2));existsSync(_0x39d3a8)?(_0x523879=_0x275bb8,console[_0x159df6(0x25d)](a4_0x10edef[_0x159df6(0x1ec)](_0x159df6(0x1c5)+_0x275bb8))):_0x523879=_0x275bb8;}else{if(_0x5009ac)_0x523879=a4_0x4aa9f6['dirname'](_0x5009ac),console[_0x159df6(0x25d)](a4_0x10edef[_0x159df6(0x1ec)](_0x159df6(0x1c2)+_0x523879));else{if(_0x472ddf){const _0x4fdaf9=sanitizeForFilesystem(_0x472ddf);let _0xf9278a=_0x4fdaf9,_0x267dfa=a4_0x4aa9f6['join'](process[_0x159df6(0x218)](),_0x159df6(0x25c),_0x4fdaf9,_0x159df6(0x1f2));if(!existsSync(_0x267dfa)){const _0x4d10da=normalizeName(_0x472ddf),_0x3bf793=a4_0x4aa9f6['join'](process[_0x159df6(0x218)](),_0x159df6(0x25c),_0x4d10da,_0x159df6(0x1f2));existsSync(_0x3bf793)&&(_0xf9278a=_0x4d10da,_0x267dfa=_0x3bf793);}if(existsSync(_0x267dfa))_0x523879=a4_0x4aa9f6[_0x159df6(0x282)](_0x267dfa),console['log'](a4_0x10edef[_0x159df6(0x1ec)](_0x159df6(0x1c5)+_0x523879));else{const _0x120d20=_0x2e2be8['profile'];if(_0x120d20)throw new SDKError(ErrorCode[_0x159df6(0x246)],_0x159df6(0x25b)+_0x472ddf+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x159df6(0x1e0)+_0x159df6(0x257)+(_0x159df6(0x235)+_0x472ddf+'\x0a')+(_0x159df6(0x20d)+_0xf9278a+_0x159df6(0x222)+(_0x435a72||_0x159df6(0x1fa))+_0x159df6(0x223)+_0x120d20)});_0x523879=_0x472ddf,console['log'](a4_0x10edef[_0x159df6(0x1ec)](_0x159df6(0x269)+_0x472ddf));}}}}if(!_0x523879)return console['log'](a4_0x10edef['yellow'](_0x159df6(0x217))),console[_0x159df6(0x25d)](_0x159df6(0x210)),console[_0x159df6(0x25d)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console['log'](_0x159df6(0x1f9)),console[_0x159df6(0x25d)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x435a72)throw new SDKError(ErrorCode[_0x159df6(0x1c8)],_0x159df6(0x26b),undefined,{'helpText':_0x159df6(0x255)});if(!_0x2692f3&&!_0x1298a7){if(!isInteractive())return console[_0x159df6(0x1f6)](a4_0x10edef[_0x159df6(0x202)](_0x159df6(0x231)),_0x159df6(0x1df)),console['error'](a4_0x10edef[_0x159df6(0x1ec)](_0x159df6(0x278))),0x1;const _0x3f86b8=await confirmKey(_0x159df6(0x1f3)+_0x523879+'\x22\x20to\x20new\x20project\x20\x22'+_0x435a72+'\x22?');if(!_0x3f86b8)return console[_0x159df6(0x25d)](a4_0x10edef[_0x159df6(0x25f)](_0x159df6(0x230))),0x1;}const {data:_0x5e37c}=await withSpinner(_0x159df6(0x25e)+_0x523879+_0x159df6(0x1c1)+_0x435a72+_0x159df6(0x275),()=>_0x46f7fc[_0x159df6(0x266)][_0x159df6(0x1eb)](_0x523879,_0x435a72,{'dryRun':_0x1298a7}));if(_0x1298a7){console[_0x159df6(0x25d)](a4_0x10edef[_0x159df6(0x25f)](_0x159df6(0x244))),console[_0x159df6(0x25d)](_0x159df6(0x20f)+_0x5e37c[_0x159df6(0x239)]),console[_0x159df6(0x25d)](_0x159df6(0x27a)+_0x435a72),console[_0x159df6(0x25d)](_0x159df6(0x237)),console[_0x159df6(0x25d)](_0x159df6(0x259)+_0x5e37c['counts'][_0x159df6(0x25c)][_0x159df6(0x245)]),console[_0x159df6(0x25d)](_0x159df6(0x23f)+_0x5e37c[_0x159df6(0x204)][_0x159df6(0x211)][_0x159df6(0x245)]),console[_0x159df6(0x25d)](_0x159df6(0x252)+_0x5e37c[_0x159df6(0x204)][_0x159df6(0x27e)]['created']),console['log'](_0x159df6(0x21f)+_0x5e37c['counts'][_0x159df6(0x22e)]['created']),console[_0x159df6(0x25d)](_0x159df6(0x1ce)+_0x5e37c[_0x159df6(0x204)][_0x159df6(0x21b)][_0x159df6(0x245)]);const _0x14b0b7=_0x5e37c['counts'][_0x159df6(0x248)][_0x159df6(0x245)]>0x0||_0x5e37c[_0x159df6(0x204)]['experimentalArtifacts'][_0x159df6(0x245)]>0x0;return _0x14b0b7&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x5e37c[_0x159df6(0x204)][_0x159df6(0x248)][_0x159df6(0x245)]),console[_0x159df6(0x25d)](_0x159df6(0x286)+_0x5e37c[_0x159df6(0x204)][_0x159df6(0x200)][_0x159df6(0x245)])),0x0;}const _0x4ef751=_0x5e37c[_0x159df6(0x204)][_0x159df6(0x25c)][_0x159df6(0x285)]>0x0||_0x5e37c['counts']['knowledgeBases'][_0x159df6(0x285)]>0x0||_0x5e37c[_0x159df6(0x204)][_0x159df6(0x27e)][_0x159df6(0x285)]>0x0||_0x5e37c['counts']['formInterfaces'][_0x159df6(0x285)]>0x0||_0x5e37c[_0x159df6(0x204)][_0x159df6(0x21b)]['errors']>0x0||_0x5e37c[_0x159df6(0x204)][_0x159df6(0x248)][_0x159df6(0x285)]>0x0||_0x5e37c[_0x159df6(0x204)][_0x159df6(0x200)][_0x159df6(0x285)]>0x0;_0x4ef751?console[_0x159df6(0x25d)](a4_0x10edef['yellow'](_0x159df6(0x23b))):console[_0x159df6(0x25d)](a4_0x10edef[_0x159df6(0x287)](_0x159df6(0x1e3)));console[_0x159df6(0x25d)](_0x159df6(0x20f)+_0x5e37c[_0x159df6(0x239)]),console[_0x159df6(0x25d)](_0x159df6(0x27a)+_0x5e37c['newProjectName']),console[_0x159df6(0x25d)](_0x159df6(0x1c4)+_0x5e37c[_0x159df6(0x1fc)]),console[_0x159df6(0x25d)](),console['log'](_0x159df6(0x1e7)),console['log'](_0x159df6(0x259)+formatCountSummary(_0x5e37c[_0x159df6(0x204)][_0x159df6(0x25c)])),console[_0x159df6(0x25d)](_0x159df6(0x23f)+formatCountSummary(_0x5e37c['counts'][_0x159df6(0x211)])),console[_0x159df6(0x25d)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x5e37c[_0x159df6(0x204)][_0x159df6(0x27e)])),console[_0x159df6(0x25d)](_0x159df6(0x1ea)+formatCountSummary(_0x5e37c[_0x159df6(0x204)][_0x159df6(0x1d4)])),console[_0x159df6(0x25d)](_0x159df6(0x21f)+formatCountSummary(_0x5e37c[_0x159df6(0x204)]['formInterfaces'])),console[_0x159df6(0x25d)](_0x159df6(0x1ce)+formatCountSummary(_0x5e37c['counts'][_0x159df6(0x21b)]));const _0x664040=_0x5e37c['counts'][_0x159df6(0x248)]['created']>0x0||_0x5e37c[_0x159df6(0x204)][_0x159df6(0x248)][_0x159df6(0x258)]>0x0||_0x5e37c[_0x159df6(0x204)][_0x159df6(0x248)][_0x159df6(0x1d1)]>0x0||_0x5e37c[_0x159df6(0x204)][_0x159df6(0x200)][_0x159df6(0x245)]>0x0||_0x5e37c[_0x159df6(0x204)]['experimentalArtifacts'][_0x159df6(0x258)]>0x0||_0x5e37c[_0x159df6(0x204)]['experimentalArtifacts'][_0x159df6(0x1d1)]>0x0;_0x664040&&(console[_0x159df6(0x25d)](_0x159df6(0x1d6)+formatCountSummary(_0x5e37c[_0x159df6(0x204)]['experimentalKnowledgeBases'])),console[_0x159df6(0x25d)](_0x159df6(0x286)+formatCountSummary(_0x5e37c['counts'][_0x159df6(0x200)])));if(_0x4ef751){console['log'](),console['log'](a4_0x10edef[_0x159df6(0x202)](_0x159df6(0x1cc)));for(const _0x1640ce of _0x5e37c[_0x159df6(0x25c)]){_0x1640ce['action']===_0x159df6(0x1f6)&&console[_0x159df6(0x25d)](a4_0x10edef['red']('\x20\x20Agent\x20\x22'+_0x1640ce[_0x159df6(0x24a)]+_0x159df6(0x232)+_0x1640ce[_0x159df6(0x1f6)]));}for(const _0x2fd662 of _0x5e37c[_0x159df6(0x211)]){_0x2fd662['action']==='error'&&console[_0x159df6(0x25d)](a4_0x10edef['red'](_0x159df6(0x216)+_0x2fd662[_0x159df6(0x267)]+'\x22:\x20'+_0x2fd662[_0x159df6(0x1f6)]));}for(const _0x5053b2 of _0x5e37c[_0x159df6(0x27e)]){_0x5053b2[_0x159df6(0x1fd)]==='error'&&console[_0x159df6(0x25d)](a4_0x10edef[_0x159df6(0x202)](_0x159df6(0x24c)+_0x5053b2[_0x159df6(0x267)]+_0x159df6(0x232)+_0x5053b2[_0x159df6(0x1f6)]));}for(const _0x39789a of _0x5e37c[_0x159df6(0x1d4)]){_0x39789a[_0x159df6(0x1fd)]===_0x159df6(0x1f6)&&console[_0x159df6(0x25d)](a4_0x10edef['red']('\x20\x20Integration\x20\x22'+_0x39789a['name']+_0x159df6(0x232)+_0x39789a[_0x159df6(0x1f6)]));}for(const _0x3174c3 of _0x5e37c['formInterfaces']){_0x3174c3[_0x159df6(0x1fd)]===_0x159df6(0x1f6)&&console[_0x159df6(0x25d)](a4_0x10edef['red'](_0x159df6(0x26e)+_0x3174c3[_0x159df6(0x267)]+_0x159df6(0x232)+_0x3174c3['error']));}for(const _0x2496f9 of _0x5e37c[_0x159df6(0x21b)]){_0x2496f9[_0x159df6(0x1fd)]===_0x159df6(0x1f6)&&console['log'](a4_0x10edef['red'](_0x159df6(0x20a)+_0x2496f9[_0x159df6(0x267)]+_0x159df6(0x232)+_0x2496f9[_0x159df6(0x1f6)]));}for(const _0x161e03 of _0x5e37c['experimentalKnowledgeBases']){_0x161e03['action']==='error'&&console[_0x159df6(0x25d)](a4_0x10edef[_0x159df6(0x202)](_0x159df6(0x264)+_0x161e03['name']+'\x22:\x20'+_0x161e03[_0x159df6(0x1f6)]));}for(const _0x4c1d51 of _0x5e37c['experimentalArtifacts']){_0x4c1d51['action']==='error'&&console[_0x159df6(0x25d)](a4_0x10edef[_0x159df6(0x202)](_0x159df6(0x254)+_0x4c1d51[_0x159df6(0x267)]+_0x159df6(0x232)+_0x4c1d51[_0x159df6(0x1f6)]));}return 0x1;}console[_0x159df6(0x25d)]();const _0x48e1ce=getLLMProjectUrl(_0x1fcc16,_0x5e37c[_0x159df6(0x1fc)]);return console[_0x159df6(0x25d)](_0x159df6(0x1e5)+a4_0x10edef[_0x159df6(0x279)](_0x48e1ce)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x4969e3(0x267)]=a4_0x4969e3(0x1d7);['description']=a4_0x4969e3(0x27d);async[a4_0x4969e3(0x21d)](_0x1a7eb1){const _0x1d1c94=a4_0x4969e3,{options:_0x146ef9,args:_0x2fcfa4,tdx:_0x38d01d}=_0x1a7eb1;let _0x11ed3c=_0x2fcfa4[0x0]||process[_0x1d1c94(0x218)]();const _0x389e08=_0x146ef9[_0x1d1c94(0x227)],_0x4c23b5=_0x146ef9['force'],_0x130be3=_0x146ef9[_0x1d1c94(0x20b)],_0x3c3622=_0x146ef9[_0x1d1c94(0x22a)],_0x156e58=a4_0x4aa9f6[_0x1d1c94(0x242)](_0x11ed3c,_0x1d1c94(0x253)),_0x371325=existsSync(_0x156e58);if(_0x371325){const {data:_0x2018e8}=await withSpinner(_0x1d1c94(0x272)+_0x11ed3c+_0x1d1c94(0x275),()=>_0x38d01d[_0x1d1c94(0x266)]['pushAgent'](_0x11ed3c,{'dryRun':_0x389e08,'force':_0x4c23b5}));if(_0x389e08)return console[_0x1d1c94(0x25d)](a4_0x10edef[_0x1d1c94(0x25f)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x1d1c94(0x25d)]('Would\x20push\x20agent:\x20'+_0x2018e8['agentName']),0x0;if(_0x2018e8[_0x1d1c94(0x1fd)]===_0x1d1c94(0x1f6))return console[_0x1d1c94(0x25d)](a4_0x10edef[_0x1d1c94(0x202)](_0x1d1c94(0x221)+_0x2018e8[_0x1d1c94(0x1f6)])),0x1;console[_0x1d1c94(0x25d)](a4_0x10edef[_0x1d1c94(0x287)]('Agent\x20'+_0x2018e8[_0x1d1c94(0x1fd)]+_0x1d1c94(0x262))),console[_0x1d1c94(0x25d)](_0x1d1c94(0x284)+_0x2018e8[_0x1d1c94(0x24a)]);if(_0x2018e8['agentId']&&_0x2018e8['projectId']){const _0x50548c=getLLMAgentChatUrl(_0x3c3622,_0x2018e8[_0x1d1c94(0x1f7)],_0x2018e8['agentId']);console[_0x1d1c94(0x25d)](_0x1d1c94(0x1dc)+a4_0x10edef[_0x1d1c94(0x279)](_0x50548c));}return 0x0;}const _0xa4e6e7=_0x146ef9[_0x1d1c94(0x260)],_0x1307b4=resolveProjectFromContext(_0x11ed3c,_0xa4e6e7);if(_0x1307b4[_0x1d1c94(0x215)])_0x11ed3c=_0x1307b4[_0x1d1c94(0x24e)],_0x1307b4['source']==='context'&&console['log'](a4_0x10edef[_0x1d1c94(0x1ec)](_0x1d1c94(0x270)+_0x11ed3c));else{let _0x1805a2=_0x1d1c94(0x1d5);_0x1307b4[_0x1d1c94(0x249)]===_0x1d1c94(0x24f)&&(_0x1805a2=_0x1307b4[_0x1d1c94(0x234)]+_0x1d1c94(0x1d3)+_0x1307b4[_0x1d1c94(0x260)]+_0x1d1c94(0x21e));throw new SDKError(ErrorCode[_0x1d1c94(0x246)],_0x1307b4[_0x1d1c94(0x249)]===_0x1d1c94(0x20c)?_0x1307b4['message']:_0x1d1c94(0x1e8)+_0x11ed3c,undefined,{'helpText':_0x1805a2});}const {data:_0x885a6c}=await withSpinner(_0x1d1c94(0x251),()=>_0x38d01d['llm'][_0x1d1c94(0x209)](_0x11ed3c,{'dryRun':!![]})),_0x657a21=_0x885a6c['counts']['agents'][_0x1d1c94(0x285)]>0x0;if(_0x657a21){console['log'](a4_0x10edef[_0x1d1c94(0x202)](_0x1d1c94(0x1cf)));for(const _0x209516 of _0x885a6c[_0x1d1c94(0x25c)]){_0x209516[_0x1d1c94(0x1fd)]==='error'&&console[_0x1d1c94(0x25d)](a4_0x10edef[_0x1d1c94(0x202)]('\x20\x20Agent\x20\x22'+_0x209516[_0x1d1c94(0x24a)]+_0x1d1c94(0x232)+_0x209516['error']));}return 0x1;}const _0xcac6fd=_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x25c)]['created']+_0x885a6c[_0x1d1c94(0x204)]['knowledgeBases'][_0x1d1c94(0x245)]+_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x1da)][_0x1d1c94(0x245)]+_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x27e)][_0x1d1c94(0x245)]+_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x1d4)]['created']+_0x885a6c['counts'][_0x1d1c94(0x248)][_0x1d1c94(0x245)]+_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x200)][_0x1d1c94(0x245)]+_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x22e)]['created']+_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x21b)][_0x1d1c94(0x245)],_0x99af28=_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x25c)][_0x1d1c94(0x258)]+_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x211)][_0x1d1c94(0x258)]+_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x1da)][_0x1d1c94(0x258)]+_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x27e)][_0x1d1c94(0x258)]+_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x1d4)][_0x1d1c94(0x258)]+_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x248)]['updated']+_0x885a6c[_0x1d1c94(0x204)]['experimentalArtifacts'][_0x1d1c94(0x258)]+_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x22e)][_0x1d1c94(0x258)]+_0x885a6c['counts'][_0x1d1c94(0x21b)][_0x1d1c94(0x258)],_0x4fb112=_0x885a6c['counts']['agents'][_0x1d1c94(0x1d1)]+_0x885a6c[_0x1d1c94(0x204)]['knowledgeBases'][_0x1d1c94(0x1d1)]+_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x1da)]['unchanged']+_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x27e)][_0x1d1c94(0x1d1)]+_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x1d4)][_0x1d1c94(0x1d1)]+_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x248)]['unchanged']+_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x200)]['unchanged']+_0x885a6c[_0x1d1c94(0x204)]['formInterfaces'][_0x1d1c94(0x1d1)]+_0x885a6c['counts'][_0x1d1c94(0x21b)][_0x1d1c94(0x1d1)];console[_0x1d1c94(0x25d)]('\x0aPush\x20summary\x20for\x20\x27'+_0x885a6c[_0x1d1c94(0x1f8)]+'\x27:'),console['log']('\x20\x20'+a4_0x10edef[_0x1d1c94(0x287)]('+\x20'+_0xcac6fd+_0x1d1c94(0x268))+'\x20|\x20'+a4_0x10edef[_0x1d1c94(0x25f)]('~\x20'+_0x99af28+_0x1d1c94(0x27b))+_0x1d1c94(0x271)+a4_0x10edef[_0x1d1c94(0x1ec)]('=\x20'+_0x4fb112+_0x1d1c94(0x283))),console[_0x1d1c94(0x25d)]('\x20\x20Agents:\x20'+formatCountSummary(_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x25c)])),console['log'](_0x1d1c94(0x23f)+formatCountSummary(_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x211)])),console[_0x1d1c94(0x25d)](_0x1d1c94(0x27f)+formatCountSummary(_0x885a6c['counts'][_0x1d1c94(0x1da)])),console[_0x1d1c94(0x25d)](_0x1d1c94(0x252)+formatCountSummary(_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x27e)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x1d4)])),console[_0x1d1c94(0x25d)](_0x1d1c94(0x21f)+formatCountSummary(_0x885a6c['counts'][_0x1d1c94(0x22e)])),console['log'](_0x1d1c94(0x1ce)+formatCountSummary(_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x21b)]));const _0x2810f8=_0x885a6c['counts'][_0x1d1c94(0x248)][_0x1d1c94(0x245)]>0x0||_0x885a6c[_0x1d1c94(0x204)]['experimentalKnowledgeBases'][_0x1d1c94(0x258)]>0x0||_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x248)][_0x1d1c94(0x1d1)]>0x0||_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x200)][_0x1d1c94(0x245)]>0x0||_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x200)]['updated']>0x0||_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x200)][_0x1d1c94(0x1d1)]>0x0;_0x2810f8&&(console[_0x1d1c94(0x25d)](_0x1d1c94(0x1d6)+formatCountSummary(_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x248)])),console[_0x1d1c94(0x25d)](_0x1d1c94(0x286)+formatCountSummary(_0x885a6c[_0x1d1c94(0x204)][_0x1d1c94(0x200)])));console[_0x1d1c94(0x25d)](_0x1d1c94(0x1d0)+a4_0x10edef[_0x1d1c94(0x279)](_0x11ed3c)),displayDiffs(_0x885a6c[_0x1d1c94(0x25c)],_0x885a6c[_0x1d1c94(0x211)],_0x885a6c[_0x1d1c94(0x1da)],_0x885a6c[_0x1d1c94(0x27e)],_0x885a6c['integrations'],_0x885a6c['experimentalKnowledgeBases'],_0x885a6c[_0x1d1c94(0x200)],_0x885a6c[_0x1d1c94(0x22e)],_0x885a6c[_0x1d1c94(0x21b)]);if(_0x389e08)return console['log'](a4_0x10edef[_0x1d1c94(0x25f)](_0x1d1c94(0x1c9))),0x0;if(_0xcac6fd===0x0&&_0x99af28===0x0){console[_0x1d1c94(0x25d)](a4_0x10edef[_0x1d1c94(0x287)](_0x1d1c94(0x26d)));const _0x861856=getLLMProjectUrl(_0x3c3622,_0x885a6c['projectId']);return console[_0x1d1c94(0x25d)](_0x1d1c94(0x1e5)+a4_0x10edef[_0x1d1c94(0x279)](_0x861856)),0x0;}if(!_0x130be3&&!_0x4c23b5){if(!isInteractive())return console[_0x1d1c94(0x1f6)](a4_0x10edef['red']('\x0aError:'),_0x1d1c94(0x1df)),console[_0x1d1c94(0x1f6)](a4_0x10edef[_0x1d1c94(0x1ec)](_0x1d1c94(0x278))),0x1;const _0x724c3f=await confirmKey(_0x1d1c94(0x207)+(_0xcac6fd+_0x99af28)+_0x1d1c94(0x1db));if(!_0x724c3f)return console['log'](a4_0x10edef['yellow'](_0x1d1c94(0x230)),_0x1d1c94(0x23d)),0x1;}const {data:_0x2b5fc8}=await withSpinner(_0x1d1c94(0x24d),()=>_0x38d01d[_0x1d1c94(0x266)][_0x1d1c94(0x209)](_0x11ed3c,{'force':_0x4c23b5})),_0x17eddc=_0x2b5fc8['counts'][_0x1d1c94(0x25c)][_0x1d1c94(0x285)]>0x0||_0x2b5fc8[_0x1d1c94(0x204)]['knowledgeBases']['errors']>0x0||_0x2b5fc8['counts'][_0x1d1c94(0x1da)][_0x1d1c94(0x285)]>0x0||_0x2b5fc8[_0x1d1c94(0x204)][_0x1d1c94(0x27e)][_0x1d1c94(0x285)]>0x0||_0x2b5fc8[_0x1d1c94(0x204)]['formInterfaces']['errors']>0x0||_0x2b5fc8[_0x1d1c94(0x204)]['chatInterfaces'][_0x1d1c94(0x285)]>0x0;if(_0x17eddc){console[_0x1d1c94(0x25d)](a4_0x10edef[_0x1d1c94(0x25f)](_0x1d1c94(0x1fb))),console[_0x1d1c94(0x25d)](),console[_0x1d1c94(0x25d)](a4_0x10edef[_0x1d1c94(0x202)](_0x1d1c94(0x1cc)));for(const _0x2df932 of _0x2b5fc8[_0x1d1c94(0x25c)]){_0x2df932[_0x1d1c94(0x1fd)]===_0x1d1c94(0x1f6)&&console[_0x1d1c94(0x25d)](a4_0x10edef[_0x1d1c94(0x202)](_0x1d1c94(0x220)+_0x2df932[_0x1d1c94(0x24a)]+_0x1d1c94(0x232)+_0x2df932[_0x1d1c94(0x1f6)]));}for(const _0x5eee7a of _0x2b5fc8[_0x1d1c94(0x211)]){_0x5eee7a['action']===_0x1d1c94(0x1f6)&&console[_0x1d1c94(0x25d)](a4_0x10edef[_0x1d1c94(0x202)](_0x1d1c94(0x216)+_0x5eee7a[_0x1d1c94(0x267)]+'\x22:\x20'+_0x5eee7a['error']));}for(const _0x1a885f of _0x2b5fc8[_0x1d1c94(0x1da)]){_0x1a885f['action']===_0x1d1c94(0x1f6)&&console[_0x1d1c94(0x25d)](a4_0x10edef[_0x1d1c94(0x202)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x1a885f['name']+_0x1d1c94(0x232)+_0x1a885f[_0x1d1c94(0x1f6)]));}for(const _0x516b33 of _0x2b5fc8[_0x1d1c94(0x27e)]){_0x516b33[_0x1d1c94(0x1fd)]==='error'&&console[_0x1d1c94(0x25d)](a4_0x10edef[_0x1d1c94(0x202)](_0x1d1c94(0x24c)+_0x516b33[_0x1d1c94(0x267)]+_0x1d1c94(0x232)+_0x516b33['error']));}for(const _0x2ebb98 of _0x2b5fc8[_0x1d1c94(0x1d4)]){_0x2ebb98[_0x1d1c94(0x1fd)]===_0x1d1c94(0x1f6)&&console['log'](a4_0x10edef['red'](_0x1d1c94(0x236)+_0x2ebb98['name']+_0x1d1c94(0x232)+_0x2ebb98['error']));}for(const _0x4c930d of _0x2b5fc8['formInterfaces']){_0x4c930d[_0x1d1c94(0x1fd)]===_0x1d1c94(0x1f6)&&console[_0x1d1c94(0x25d)](a4_0x10edef[_0x1d1c94(0x202)](_0x1d1c94(0x26e)+_0x4c930d['name']+_0x1d1c94(0x232)+_0x4c930d[_0x1d1c94(0x1f6)]));}for(const _0x4dd16a of _0x2b5fc8[_0x1d1c94(0x21b)]){_0x4dd16a[_0x1d1c94(0x1fd)]==='error'&&console[_0x1d1c94(0x25d)](a4_0x10edef[_0x1d1c94(0x202)](_0x1d1c94(0x20a)+_0x4dd16a[_0x1d1c94(0x267)]+_0x1d1c94(0x232)+_0x4dd16a['error']));}return 0x1;}console[_0x1d1c94(0x25d)](a4_0x10edef[_0x1d1c94(0x287)](_0x1d1c94(0x280)+(_0xcac6fd+_0x99af28)+_0x1d1c94(0x24b)+_0x2b5fc8[_0x1d1c94(0x1f8)]+'\x27'));const _0x3f2809=getLLMProjectUrl(_0x3c3622,_0x2b5fc8[_0x1d1c94(0x1f7)]);return console[_0x1d1c94(0x25d)](_0x1d1c94(0x1e5)+a4_0x10edef[_0x1d1c94(0x279)](_0x3f2809)),0x0;}}
1
+ const a4_0x36eeb0=a4_0x571a;(function(_0x7d4b47,_0x201f95){const _0x58060e=a4_0x571a,_0x123801=_0x7d4b47();while(!![]){try{const _0x481aa0=-parseInt(_0x58060e(0x205))/0x1+parseInt(_0x58060e(0x261))/0x2+-parseInt(_0x58060e(0x21d))/0x3+-parseInt(_0x58060e(0x21b))/0x4+parseInt(_0x58060e(0x1f9))/0x5+parseInt(_0x58060e(0x1cd))/0x6*(-parseInt(_0x58060e(0x255))/0x7)+parseInt(_0x58060e(0x223))/0x8;if(_0x481aa0===_0x201f95)break;else _0x123801['push'](_0x123801['shift']());}catch(_0x376579){_0x123801['push'](_0x123801['shift']());}}}(a4_0x2003,0x518a7));import a4_0x1f75c6 from'chalk';import a4_0x2c93ff from'path';function a4_0x2003(){const _0x24de6f=['\x20errors','\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','force','yes','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','llmProject','dirname','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Agent:\x20','\x20=\x20','\x0aPull\x20summary\x20for\x20\x27','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','agent','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','agent:clone','-\x20no\x20files\x20written','agent:pull','cwd-config','\x20total','Pulling\x20agent\x20\x22','Using\x20project\x20from\x20','Cloning\x20\x22','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','751499aeWBqN','action','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','site','formInterfaces','cloneProject','name','tdx.json','\x20\x20Source:\x20','\x20\x20Chat\x20Interfaces:\x20','push','234818oeskTg','llm','\x20\x20Integration\x20\x22','\x0aChanges:','cyan','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','join','found','llm_project','Using\x20current\x20project:\x20','Summary:','\x20updated','counts','\x0aPush\x20summary\x20for\x20\x27','projectName','session','Using\x20project\x20from\x20context:\x20','log','yellow','Pushing\x20to\x20project...','INVALID_ARGUMENT','dryRun','repeat','\x20\x20Chat\x20Interface\x20\x22','\x20\x20Agents:\x20','Using\x20context\x20project:\x20','agentId','-\x20nothing\x20pushed','\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','total','red','cwd','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20changed','reason','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','\x20|\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','agents','textKnowledgeBases','Errors:','prompts','24FiJzPn','Failed\x20to\x20push\x20agent:\x20','Would\x20pull\x20agent:\x20','sourceProjectName','agent:push','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x0aChanges\x20to\x20form\x20interface\x20\x27','pullProject','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20Integrations:\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','New\x20project\x20ID:\x20','chatInterfaces','created','Analyzing\x20changes\x20to\x20push...','Would\x20clone:','error','Agent\x20pulled\x20successfully','projectDir','knowledgeBases','\x20--name\x20','✔\x20Context\x20set:\x20','\x0aWrite\x20','New\x20project\x20name\x20is\x20required','pushProject','Source:\x20','\x20files?','Dry\x20run\x20-\x20no\x20changes\x20made','\x20new','new','\x22\x20from\x20project\x20\x22','\x22:\x20','context','\x20resources?','\x20successfully','gray','newProjectName','Cannot\x20clone\x20from\x20context\x20project\x20\x22','parse','\x0aChanges\x20to\x20agent\x20\x27','Agent\x20','experimentalKnowledgeBases','Cancelled','\x20unchanged','3012950oQIgAP','Pushing\x20agent\x20from\x20\x22','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x22\x20to\x20\x22','\x20\x20Form\x20Interfaces:\x20','\x20\x20Prompts:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0a✔\x20Pushed\x20','Status:\x20','unchanged','New\x20project:\x20','628259OyObzg','execute','Output:\x20','\x20\x20Prompt\x20\x22','diff','dim','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','no_context','Dry\x20run\x20-\x20no\x20files\x20written','Using\x20local\x20project:\x20','\x0aChanges\x20to\x20integration\x20\x27','Using\x20project:\x20','\x0aChanges\x20to\x20prompt\x20\x27','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20Knowledge\x20Bases:\x20','Project:\x20','Analyzing\x20project\x20\x22','No\x20tdx.json\x20found\x20in\x20','updated','utf-8','projectId','\x20\x20Knowledge\x20Base\x20\x22','536772FksCWs','outputPath','1352034gUNSLn','integrations','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x0aChanges\x20to\x20chat\x20interface\x20\x27','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\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','10052400SFabSz','outputDir','message','\x20\x20Agent\x20\x22','Project\x20cloned\x20with\x20errors','MISSING_ARGUMENT','\x20files\x20to\x20','\x20\x20Target:\x20','Clone\x20\x22','\x0aError:','pushAgent','\x0aProject\x20pushed\x20with\x20errors','Output\x20path:\x20','\x22...','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','description','Writing\x20files...','agentName','agent.yml','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','green','no_local_folder','profile','experimentalArtifacts','errors','Chat:\x20','\x20\x20Form\x20Interface\x20\x22'];a4_0x2003=function(){return _0x24de6f;};return a4_0x2003();}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(_0x3e27b6){const _0x31a8a4=a4_0x571a,_0x442319=[];if(_0x3e27b6[_0x31a8a4(0x1c0)]!==undefined)_0x442319[_0x31a8a4(0x260)](_0x3e27b6['total']+_0x31a8a4(0x250));if(_0x3e27b6['new']!==undefined&&_0x3e27b6[_0x31a8a4(0x1ea)]>0x0)_0x442319[_0x31a8a4(0x260)](a4_0x1f75c6[_0x31a8a4(0x237)](_0x3e27b6[_0x31a8a4(0x1ea)]+_0x31a8a4(0x1e9)));if(_0x3e27b6[_0x31a8a4(0x1da)]!==undefined&&_0x3e27b6[_0x31a8a4(0x1da)]>0x0)_0x442319['push'](a4_0x1f75c6[_0x31a8a4(0x237)](_0x3e27b6['created']+'\x20created'));if(_0x3e27b6[_0x31a8a4(0x217)]!==undefined&&_0x3e27b6[_0x31a8a4(0x217)]>0x0)_0x442319[_0x31a8a4(0x260)](a4_0x1f75c6['yellow'](_0x3e27b6[_0x31a8a4(0x217)]+_0x31a8a4(0x26d)));if(_0x3e27b6[_0x31a8a4(0x203)]!==undefined&&_0x3e27b6[_0x31a8a4(0x203)]>0x0)_0x442319[_0x31a8a4(0x260)](a4_0x1f75c6['gray'](_0x3e27b6['unchanged']+_0x31a8a4(0x1f8)));if(_0x3e27b6[_0x31a8a4(0x23b)]!==undefined&&_0x3e27b6[_0x31a8a4(0x23b)]>0x0)_0x442319[_0x31a8a4(0x260)](a4_0x1f75c6['red'](_0x3e27b6[_0x31a8a4(0x23b)]+_0x31a8a4(0x23e)));return _0x442319[_0x31a8a4(0x268)](',\x20');}function displayDiffs(_0x2ffa4f,_0x9d833f,_0x4f4331,_0x276b1c,_0x5e58de,_0x4b72e1,_0x1d1914,_0x22bd58,_0x2cc75d){const _0x2742ba=a4_0x571a;for(const _0xc17d05 of _0x2ffa4f){if(_0xc17d05[_0x2742ba(0x209)]){const _0x4521fd=_0xc17d05[_0x2742ba(0x234)]||_0xc17d05['name'];console[_0x2742ba(0x1b4)](_0x2742ba(0x1f4)+_0x4521fd+'\x27:'),console[_0x2742ba(0x1b4)]('─'['repeat'](0x3c)),console[_0x2742ba(0x1b4)](_0xc17d05[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c));}}for(const _0x1e899d of _0x9d833f){_0x1e899d[_0x2742ba(0x209)]&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x20b)+_0x1e899d[_0x2742ba(0x25c)]+'\x27:'),console['log']('─'[_0x2742ba(0x1b9)](0x3c)),console[_0x2742ba(0x1b4)](_0x1e899d[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)));}for(const _0x2a50b1 of _0x4f4331){_0x2a50b1['diff']&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x24b)+_0x2a50b1[_0x2742ba(0x25c)]+'\x27:'),console['log']('─'[_0x2742ba(0x1b9)](0x3c)),console[_0x2742ba(0x1b4)](_0x2a50b1[_0x2742ba(0x209)]),console['log']('─'[_0x2742ba(0x1b9)](0x3c)));}for(const _0x31e068 of _0x276b1c){_0x31e068[_0x2742ba(0x209)]&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x211)+_0x31e068['name']+'\x27:'),console[_0x2742ba(0x1b4)]('─'['repeat'](0x3c)),console[_0x2742ba(0x1b4)](_0x31e068[_0x2742ba(0x209)]),console['log']('─'['repeat'](0x3c)));}for(const _0x4362d5 of _0x5e58de){_0x4362d5[_0x2742ba(0x209)]&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x20f)+_0x4362d5[_0x2742ba(0x25c)]+'\x27:'),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)),console[_0x2742ba(0x1b4)](_0x4362d5[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)));}for(const _0x47e612 of _0x4b72e1){_0x47e612['diff']&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x254)+_0x47e612[_0x2742ba(0x25c)]+'\x27:'),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)),console[_0x2742ba(0x1b4)](_0x47e612[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)));}for(const _0x3b9cea of _0x1d1914){_0x3b9cea[_0x2742ba(0x209)]&&(console[_0x2742ba(0x1b4)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x3b9cea[_0x2742ba(0x25c)]+'\x27:'),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)),console[_0x2742ba(0x1b4)](_0x3b9cea[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)));}for(const _0x1f33a4 of _0x22bd58){_0x1f33a4[_0x2742ba(0x209)]&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x1d3)+_0x1f33a4[_0x2742ba(0x25c)]+'\x27:'),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)),console[_0x2742ba(0x1b4)](_0x1f33a4[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)));}for(const _0x4256c6 of _0x2cc75d){_0x4256c6['diff']&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x220)+_0x4256c6[_0x2742ba(0x25c)]+'\x27:'),console['log']('─'[_0x2742ba(0x1b9)](0x3c)),console['log'](_0x4256c6[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)));}}function a4_0x571a(_0x1c5970,_0x2394ca){_0x1c5970=_0x1c5970-0x1b3;const _0x200383=a4_0x2003();let _0x571a67=_0x200383[_0x1c5970];return _0x571a67;}export class AgentPullCommand extends BaseCommand{[a4_0x36eeb0(0x25c)]=a4_0x36eeb0(0x24e);[a4_0x36eeb0(0x232)]=a4_0x36eeb0(0x266);async[a4_0x36eeb0(0x206)](_0x1912e5){const _0x4d2025=a4_0x36eeb0,{options:_0x17e537,args:_0x102bde,tdx:_0x241ce6}=_0x1912e5,_0xc525fe=_0x102bde[0x0],_0x2b2200=_0x102bde[0x1],_0x45a4a4=_0x17e537['output'],_0x4b7962=_0x17e537['dryRun'],_0x4f60de=_0x17e537[_0x4d2025(0x240)],_0x42bd8d=_0x17e537[_0x4d2025(0x241)],_0x4adb41=_0x17e537[_0x4d2025(0x243)],_0xb23fe0=_0x17e537[_0x4d2025(0x24a)];let _0x996e9d;if(_0xc525fe){const _0x37deb7=a4_0x2c93ff[_0x4d2025(0x268)](_0xc525fe,_0x4d2025(0x25d));if(existsSync(_0x37deb7))try{const _0x16cf47=JSON[_0x4d2025(0x1f3)](readFileSync(_0x37deb7,'utf-8'));_0x16cf47['llm_project']&&(_0x996e9d={'llm_project':_0x16cf47[_0x4d2025(0x26a)]});}catch{}}const _0x5b0d25=findAgentConfigPath(process['cwd']());let _0x35361b;if(_0x5b0d25)try{const _0x49b6a9=JSON['parse'](readFileSync(_0x5b0d25,_0x4d2025(0x218)));_0x49b6a9[_0x4d2025(0x26a)]&&(_0x35361b={'llm_project':_0x49b6a9['llm_project']});}catch{}const _0x2f0b25=resolveAgentPullArgs({'arg':_0xc525fe,'agentNameArg':_0x2b2200,'agentFlag':_0xb23fe0,'contextProject':_0x4adb41,'argDirConfig':_0x996e9d,'cwdConfigPath':_0x5b0d25||undefined,'cwdConfig':_0x35361b}),{projectNameOrId:_0x3c2128,targetAgentName:_0x35d92d,existingOutputDir:_0x30c015,source:_0x49297c}=_0x2f0b25;if(_0x49297c==='arg-dir')console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x20a)](_0x4d2025(0x252)+a4_0x2c93ff[_0x4d2025(0x268)](_0xc525fe,_0x4d2025(0x25d))+':\x20'+_0x3c2128));else{if(_0x49297c===_0x4d2025(0x24f))console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x20a)](_0x4d2025(0x210)+_0x3c2128));else _0x49297c===_0x4d2025(0x1ed)&&console['log'](a4_0x1f75c6['dim'](_0x4d2025(0x1b3)+_0x3c2128));}if(!_0x3c2128)return _0xb23fe0?(console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x1b5)](_0x4d2025(0x1ff))),console[_0x4d2025(0x1b4)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0x4d2025(0x1b4)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console['log'](a4_0x1f75c6['yellow'](_0x4d2025(0x221))),console['log'](_0x4d2025(0x231)),console[_0x4d2025(0x1b4)](_0x4d2025(0x23f)),console['log'](_0x4d2025(0x1bf)),console[_0x4d2025(0x1b4)](_0x4d2025(0x222)),console[_0x4d2025(0x1b4)]('\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(_0x35d92d){const {data:_0x522451}=await withSpinner(_0x4d2025(0x251)+_0x35d92d+_0x4d2025(0x1eb)+_0x3c2128+'\x22...',()=>_0x241ce6[_0x4d2025(0x262)]['pullAgent'](_0x3c2128,_0x35d92d,_0x45a4a4,{'dryRun':_0x4b7962,'force':_0x4f60de}));if(_0x4b7962)return console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x1b5)](_0x4d2025(0x20d))),console[_0x4d2025(0x1b4)](_0x4d2025(0x1cf)+_0x522451['agentName']),console[_0x4d2025(0x1b4)](_0x4d2025(0x22f)+_0x522451[_0x4d2025(0x21c)]),_0x522451['diff']&&(console[_0x4d2025(0x1b4)](_0x4d2025(0x264)),console[_0x4d2025(0x1b4)]('─'[_0x4d2025(0x1b9)](0x3c)),console[_0x4d2025(0x1b4)](_0x522451[_0x4d2025(0x209)]),console[_0x4d2025(0x1b4)]('─'[_0x4d2025(0x1b9)](0x3c))),0x0;return console['log'](a4_0x1f75c6[_0x4d2025(0x237)](_0x4d2025(0x1de))),console[_0x4d2025(0x1b4)](_0x4d2025(0x246)+_0x522451[_0x4d2025(0x234)]),console[_0x4d2025(0x1b4)](_0x4d2025(0x207)+_0x522451[_0x4d2025(0x21c)]),console[_0x4d2025(0x1b4)](_0x4d2025(0x202)+(_0x522451['isNew']?a4_0x1f75c6[_0x4d2025(0x237)]('new'):_0x522451['hasChanges']?a4_0x1f75c6[_0x4d2025(0x1b5)](_0x4d2025(0x217)):a4_0x1f75c6[_0x4d2025(0x1f0)](_0x4d2025(0x203)))),0x0;}const _0x161b62=_0x30c015||_0x45a4a4,{data:_0x195aee}=await withSpinner(_0x4d2025(0x215)+_0x3c2128+_0x4d2025(0x230),()=>_0x241ce6['llm'][_0x4d2025(0x1d4)](_0x3c2128,_0x161b62,{'dryRun':!![]})),_0x237059=_0x195aee['counts'][_0x4d2025(0x1c9)][_0x4d2025(0x1ea)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1e0)][_0x4d2025(0x1ea)]+_0x195aee['counts'][_0x4d2025(0x1ca)]['new']+_0x195aee['counts'][_0x4d2025(0x1cc)][_0x4d2025(0x1ea)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x21e)]['new']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1f6)][_0x4d2025(0x1ea)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x23a)][_0x4d2025(0x1ea)]+_0x195aee[_0x4d2025(0x26e)]['formInterfaces']['new']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1d9)][_0x4d2025(0x1ea)],_0x3570e2=_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1c9)][_0x4d2025(0x217)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1e0)]['updated']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1ca)][_0x4d2025(0x217)]+_0x195aee['counts']['prompts'][_0x4d2025(0x217)]+_0x195aee[_0x4d2025(0x26e)]['integrations']['updated']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1f6)][_0x4d2025(0x217)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x23a)][_0x4d2025(0x217)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x25a)][_0x4d2025(0x217)]+_0x195aee['counts'][_0x4d2025(0x1d9)][_0x4d2025(0x217)],_0x30bbde=_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1c9)][_0x4d2025(0x203)]+_0x195aee['counts'][_0x4d2025(0x1e0)]['unchanged']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1ca)]['unchanged']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1cc)]['unchanged']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x21e)][_0x4d2025(0x203)]+_0x195aee[_0x4d2025(0x26e)]['experimentalKnowledgeBases'][_0x4d2025(0x203)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x23a)][_0x4d2025(0x203)]+_0x195aee['counts'][_0x4d2025(0x25a)][_0x4d2025(0x203)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1d9)][_0x4d2025(0x203)];console['log'](_0x4d2025(0x248)+_0x195aee[_0x4d2025(0x270)]+'\x27:'),console[_0x4d2025(0x1b4)]('\x20\x20'+a4_0x1f75c6[_0x4d2025(0x237)]('+\x20'+_0x237059+'\x20new')+_0x4d2025(0x1c7)+a4_0x1f75c6['yellow']('~\x20'+_0x3570e2+'\x20changed')+'\x20|\x20'+a4_0x1f75c6[_0x4d2025(0x20a)]('=\x20'+_0x30bbde+'\x20unchanged')),console['log'](_0x4d2025(0x1bb)+formatCountSummary(_0x195aee['counts'][_0x4d2025(0x1c9)])),console[_0x4d2025(0x1b4)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x195aee[_0x4d2025(0x26e)]['knowledgeBases'])),console[_0x4d2025(0x1b4)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1ca)])),console[_0x4d2025(0x1b4)](_0x4d2025(0x1fe)+formatCountSummary(_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1cc)])),console[_0x4d2025(0x1b4)](_0x4d2025(0x1d6)+formatCountSummary(_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x21e)])),console[_0x4d2025(0x1b4)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x195aee['counts']['formInterfaces'])),console[_0x4d2025(0x1b4)](_0x4d2025(0x25f)+formatCountSummary(_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1d9)]));const _0x2f1eff=_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1f6)][_0x4d2025(0x1c0)]>0x0||_0x195aee['counts'][_0x4d2025(0x23a)]['total']>0x0;_0x2f1eff&&(console[_0x4d2025(0x1b4)](_0x4d2025(0x267)+formatCountSummary(_0x195aee['counts'][_0x4d2025(0x1f6)])),console[_0x4d2025(0x1b4)](_0x4d2025(0x1d5)+formatCountSummary(_0x195aee['counts'][_0x4d2025(0x23a)])));console[_0x4d2025(0x1b4)](_0x4d2025(0x22a)+a4_0x1f75c6[_0x4d2025(0x265)](_0x195aee[_0x4d2025(0x224)])),displayDiffs(_0x195aee[_0x4d2025(0x1c9)],_0x195aee[_0x4d2025(0x1e0)],_0x195aee[_0x4d2025(0x1ca)],_0x195aee[_0x4d2025(0x1cc)],_0x195aee[_0x4d2025(0x21e)],_0x195aee[_0x4d2025(0x1f6)],_0x195aee[_0x4d2025(0x23a)],_0x195aee[_0x4d2025(0x25a)],_0x195aee[_0x4d2025(0x1d9)]);if(_0x4b7962)return console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x1b5)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x237059===0x0&&_0x3570e2===0x0)return console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x237)](_0x4d2025(0x1c8))),saveSessionContext({'llm_project':_0x195aee['projectName']},_0x17e537['session']),console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x237)](_0x4d2025(0x1e2)+a4_0x1f75c6[_0x4d2025(0x20a)](_0x4d2025(0x26a))+_0x4d2025(0x247)+a4_0x1f75c6[_0x4d2025(0x265)](_0x195aee[_0x4d2025(0x270)]))),0x0;if(!_0x42bd8d&&!_0x4f60de){if(!isInteractive())return console[_0x4d2025(0x1dd)](a4_0x1f75c6[_0x4d2025(0x1c1)](_0x4d2025(0x22c)),_0x4d2025(0x1fb)),console[_0x4d2025(0x1dd)](a4_0x1f75c6[_0x4d2025(0x20a)](_0x4d2025(0x200))),0x1;const _0x22799e=await confirmKey(_0x4d2025(0x1e3)+(_0x237059+_0x3570e2)+_0x4d2025(0x1e7));if(!_0x22799e)return console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x1b5)](_0x4d2025(0x1f7)),_0x4d2025(0x24d)),0x1;}const {data:_0x2c0eba}=await withSpinner(_0x4d2025(0x233),()=>_0x241ce6[_0x4d2025(0x262)][_0x4d2025(0x1d4)](_0x3c2128,_0x161b62,{'force':_0x4f60de}));return console['log'](a4_0x1f75c6[_0x4d2025(0x237)]('\x0a✔\x20Pulled\x20'+(_0x237059+_0x3570e2)+_0x4d2025(0x229)+_0x2c0eba[_0x4d2025(0x224)])),saveSessionContext({'llm_project':_0x2c0eba[_0x4d2025(0x270)]},_0x17e537[_0x4d2025(0x271)]),console['log'](a4_0x1f75c6['green'](_0x4d2025(0x1e2)+a4_0x1f75c6[_0x4d2025(0x20a)](_0x4d2025(0x26a))+'\x20=\x20'+a4_0x1f75c6['cyan'](_0x2c0eba[_0x4d2025(0x270)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x36eeb0(0x25c)]=a4_0x36eeb0(0x24c);[a4_0x36eeb0(0x232)]=a4_0x36eeb0(0x212);async['execute'](_0x13c57e){const _0x30a963=a4_0x36eeb0,{options:_0x2463bf,args:_0x279c0e,tdx:_0x4443aa}=_0x13c57e,_0x4a6d51=_0x279c0e[0x0],_0x386488=_0x2463bf[_0x30a963(0x25c)],_0x27038c=_0x2463bf[_0x30a963(0x1b8)],_0x33f833=_0x2463bf['yes'],_0x21636a=_0x2463bf['site'],_0x43ee3c=_0x2463bf['llmProject'];let _0x28f999;const _0x466f5b=findAgentConfigPath(process['cwd']());if(_0x4a6d51){const _0x35dbe1=a4_0x2c93ff['join'](_0x4a6d51,'tdx.json');existsSync(_0x35dbe1)?(_0x28f999=_0x4a6d51,console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x20a)](_0x30a963(0x20e)+_0x4a6d51))):_0x28f999=_0x4a6d51;}else{if(_0x466f5b)_0x28f999=a4_0x2c93ff[_0x30a963(0x244)](_0x466f5b),console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x20a)](_0x30a963(0x26b)+_0x28f999));else{if(_0x43ee3c){const _0x10c8a4=sanitizeForFilesystem(_0x43ee3c);let _0x3b2ffe=_0x10c8a4,_0x149d78=a4_0x2c93ff['join'](process[_0x30a963(0x1c2)](),_0x30a963(0x1c9),_0x10c8a4,'tdx.json');if(!existsSync(_0x149d78)){const _0xf5f5c8=normalizeName(_0x43ee3c),_0x6b659=a4_0x2c93ff[_0x30a963(0x268)](process[_0x30a963(0x1c2)](),_0x30a963(0x1c9),_0xf5f5c8,'tdx.json');existsSync(_0x6b659)&&(_0x3b2ffe=_0xf5f5c8,_0x149d78=_0x6b659);}if(existsSync(_0x149d78))_0x28f999=a4_0x2c93ff[_0x30a963(0x244)](_0x149d78),console['log'](a4_0x1f75c6[_0x30a963(0x20a)]('Using\x20local\x20project:\x20'+_0x28f999));else{const _0x412223=_0x2463bf[_0x30a963(0x239)];if(_0x412223)throw new SDKError(ErrorCode[_0x30a963(0x1b7)],_0x30a963(0x1f2)+_0x43ee3c+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x30a963(0x236)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+('\x20\x20tdx\x20agent\x20pull\x20'+_0x43ee3c+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x3b2ffe+_0x30a963(0x1e1)+(_0x386488||'<new-name>')+'\x20--profile\x20'+_0x412223)});_0x28f999=_0x43ee3c,console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x20a)](_0x30a963(0x1bc)+_0x43ee3c));}}}}if(!_0x28f999)return console['log'](a4_0x1f75c6[_0x30a963(0x1b5)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x30a963(0x1b4)](_0x30a963(0x1c3)),console[_0x30a963(0x1b4)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x30a963(0x1b4)](_0x30a963(0x1c6)),console[_0x30a963(0x1b4)](_0x30a963(0x258)),0x1;if(!_0x386488)throw new SDKError(ErrorCode[_0x30a963(0x228)],_0x30a963(0x1e4),undefined,{'helpText':_0x30a963(0x242)});if(!_0x33f833&&!_0x27038c){if(!isInteractive())return console[_0x30a963(0x1dd)](a4_0x1f75c6[_0x30a963(0x1c1)](_0x30a963(0x22c)),_0x30a963(0x1fb)),console['error'](a4_0x1f75c6['dim'](_0x30a963(0x200))),0x1;const _0x45d3d1=await confirmKey(_0x30a963(0x22b)+_0x28f999+'\x22\x20to\x20new\x20project\x20\x22'+_0x386488+'\x22?');if(!_0x45d3d1)return console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1b5)](_0x30a963(0x1f7))),0x1;}const {data:_0x1ac9c5}=await withSpinner(_0x30a963(0x253)+_0x28f999+_0x30a963(0x1fc)+_0x386488+_0x30a963(0x230),()=>_0x4443aa[_0x30a963(0x262)][_0x30a963(0x25b)](_0x28f999,_0x386488,{'dryRun':_0x27038c}));if(_0x27038c){console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1b5)](_0x30a963(0x1e8))),console['log']('Source:\x20'+_0x1ac9c5['sourceProjectName']),console['log'](_0x30a963(0x204)+_0x386488),console['log'](_0x30a963(0x1dc)),console[_0x30a963(0x1b4)]('\x20\x20Agents:\x20'+_0x1ac9c5['counts'][_0x30a963(0x1c9)][_0x30a963(0x1da)]),console[_0x30a963(0x1b4)](_0x30a963(0x213)+_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1e0)][_0x30a963(0x1da)]),console['log'](_0x30a963(0x1fe)+_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1cc)][_0x30a963(0x1da)]),console[_0x30a963(0x1b4)](_0x30a963(0x1fd)+_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x25a)][_0x30a963(0x1da)]),console[_0x30a963(0x1b4)](_0x30a963(0x25f)+_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1d9)][_0x30a963(0x1da)]);const _0x28e77f=_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1f6)][_0x30a963(0x1da)]>0x0||_0x1ac9c5[_0x30a963(0x26e)]['experimentalArtifacts'][_0x30a963(0x1da)]>0x0;return _0x28e77f&&(console[_0x30a963(0x1b4)](_0x30a963(0x267)+_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1f6)][_0x30a963(0x1da)]),console[_0x30a963(0x1b4)](_0x30a963(0x1d5)+_0x1ac9c5['counts']['experimentalArtifacts'][_0x30a963(0x1da)])),0x0;}const _0x50063c=_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1c9)][_0x30a963(0x23b)]>0x0||_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1e0)]['errors']>0x0||_0x1ac9c5['counts'][_0x30a963(0x1cc)]['errors']>0x0||_0x1ac9c5['counts']['formInterfaces']['errors']>0x0||_0x1ac9c5[_0x30a963(0x26e)]['chatInterfaces'][_0x30a963(0x23b)]>0x0||_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1f6)]['errors']>0x0||_0x1ac9c5[_0x30a963(0x26e)]['experimentalArtifacts'][_0x30a963(0x23b)]>0x0;_0x50063c?console[_0x30a963(0x1b4)](a4_0x1f75c6['yellow'](_0x30a963(0x227))):console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x237)]('Project\x20cloned\x20successfully'));console[_0x30a963(0x1b4)](_0x30a963(0x1e6)+_0x1ac9c5[_0x30a963(0x1d0)]),console['log'](_0x30a963(0x204)+_0x1ac9c5[_0x30a963(0x1f1)]),console['log'](_0x30a963(0x1d8)+_0x1ac9c5['newProjectId']),console[_0x30a963(0x1b4)](),console[_0x30a963(0x1b4)](_0x30a963(0x26c)),console['log'](_0x30a963(0x1bb)+formatCountSummary(_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1c9)])),console[_0x30a963(0x1b4)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1e0)])),console[_0x30a963(0x1b4)](_0x30a963(0x1fe)+formatCountSummary(_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1cc)])),console[_0x30a963(0x1b4)](_0x30a963(0x1d6)+formatCountSummary(_0x1ac9c5[_0x30a963(0x26e)]['integrations'])),console[_0x30a963(0x1b4)](_0x30a963(0x1fd)+formatCountSummary(_0x1ac9c5['counts'][_0x30a963(0x25a)])),console[_0x30a963(0x1b4)](_0x30a963(0x25f)+formatCountSummary(_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1d9)]));const _0x584ccd=_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1f6)]['created']>0x0||_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1f6)][_0x30a963(0x217)]>0x0||_0x1ac9c5[_0x30a963(0x26e)]['experimentalKnowledgeBases'][_0x30a963(0x203)]>0x0||_0x1ac9c5['counts'][_0x30a963(0x23a)][_0x30a963(0x1da)]>0x0||_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x23a)][_0x30a963(0x217)]>0x0||_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x23a)][_0x30a963(0x203)]>0x0;_0x584ccd&&(console[_0x30a963(0x1b4)](_0x30a963(0x267)+formatCountSummary(_0x1ac9c5['counts'][_0x30a963(0x1f6)])),console[_0x30a963(0x1b4)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x23a)])));if(_0x50063c){console[_0x30a963(0x1b4)](),console[_0x30a963(0x1b4)](a4_0x1f75c6['red'](_0x30a963(0x1cb)));for(const _0x1b0ba2 of _0x1ac9c5[_0x30a963(0x1c9)]){_0x1b0ba2['action']===_0x30a963(0x1dd)&&console[_0x30a963(0x1b4)](a4_0x1f75c6['red']('\x20\x20Agent\x20\x22'+_0x1b0ba2[_0x30a963(0x234)]+_0x30a963(0x1ec)+_0x1b0ba2[_0x30a963(0x1dd)]));}for(const _0x23d550 of _0x1ac9c5[_0x30a963(0x1e0)]){_0x23d550[_0x30a963(0x256)]===_0x30a963(0x1dd)&&console['log'](a4_0x1f75c6[_0x30a963(0x1c1)](_0x30a963(0x21a)+_0x23d550[_0x30a963(0x25c)]+_0x30a963(0x1ec)+_0x23d550['error']));}for(const _0x42834d of _0x1ac9c5[_0x30a963(0x1cc)]){_0x42834d['action']===_0x30a963(0x1dd)&&console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1c1)]('\x20\x20Prompt\x20\x22'+_0x42834d[_0x30a963(0x25c)]+_0x30a963(0x1ec)+_0x42834d[_0x30a963(0x1dd)]));}for(const _0x352944 of _0x1ac9c5[_0x30a963(0x21e)]){_0x352944[_0x30a963(0x256)]===_0x30a963(0x1dd)&&console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1c1)](_0x30a963(0x263)+_0x352944[_0x30a963(0x25c)]+'\x22:\x20'+_0x352944[_0x30a963(0x1dd)]));}for(const _0x168df6 of _0x1ac9c5[_0x30a963(0x25a)]){_0x168df6[_0x30a963(0x256)]==='error'&&console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1c1)](_0x30a963(0x23d)+_0x168df6[_0x30a963(0x25c)]+'\x22:\x20'+_0x168df6[_0x30a963(0x1dd)]));}for(const _0x31afc4 of _0x1ac9c5['chatInterfaces']){_0x31afc4[_0x30a963(0x256)]==='error'&&console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1c1)]('\x20\x20Chat\x20Interface\x20\x22'+_0x31afc4['name']+_0x30a963(0x1ec)+_0x31afc4[_0x30a963(0x1dd)]));}for(const _0x30dae1 of _0x1ac9c5[_0x30a963(0x1f6)]){_0x30dae1[_0x30a963(0x256)]===_0x30a963(0x1dd)&&console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1c1)](_0x30a963(0x249)+_0x30dae1[_0x30a963(0x25c)]+_0x30a963(0x1ec)+_0x30dae1[_0x30a963(0x1dd)]));}for(const _0x570b50 of _0x1ac9c5[_0x30a963(0x23a)]){_0x570b50[_0x30a963(0x256)]===_0x30a963(0x1dd)&&console['log'](a4_0x1f75c6['red']('\x20\x20Experimental\x20Artifact\x20\x22'+_0x570b50[_0x30a963(0x25c)]+_0x30a963(0x1ec)+_0x570b50['error']));}return 0x1;}console[_0x30a963(0x1b4)]();const _0x4dbb4d=getLLMProjectUrl(_0x21636a,_0x1ac9c5['newProjectId']);return console['log']('Project:\x20'+a4_0x1f75c6[_0x30a963(0x265)](_0x4dbb4d)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x36eeb0(0x25c)]=a4_0x36eeb0(0x1d1);[a4_0x36eeb0(0x232)]=a4_0x36eeb0(0x257);async[a4_0x36eeb0(0x206)](_0x56df93){const _0x31f9fe=a4_0x36eeb0,{options:_0x53655b,args:_0x500f33,tdx:_0x15cf94}=_0x56df93;let _0x1521b8=_0x500f33[0x0]||process[_0x31f9fe(0x1c2)]();const _0x222b1d=_0x53655b[_0x31f9fe(0x1b8)],_0x504701=_0x53655b[_0x31f9fe(0x240)],_0x3514f7=_0x53655b[_0x31f9fe(0x241)],_0x59bd9e=_0x53655b[_0x31f9fe(0x259)],_0x101197=a4_0x2c93ff[_0x31f9fe(0x268)](_0x1521b8,_0x31f9fe(0x235)),_0x52f1e5=existsSync(_0x101197);if(_0x52f1e5){const {data:_0x221a1e}=await withSpinner(_0x31f9fe(0x1fa)+_0x1521b8+_0x31f9fe(0x230),()=>_0x15cf94[_0x31f9fe(0x262)][_0x31f9fe(0x22d)](_0x1521b8,{'dryRun':_0x222b1d,'force':_0x504701}));if(_0x222b1d)return console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1b5)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x31f9fe(0x1b4)]('Would\x20push\x20agent:\x20'+_0x221a1e['agentName']),0x0;if(_0x221a1e[_0x31f9fe(0x256)]==='error')return console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x1ce)+_0x221a1e['error'])),0x1;console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x237)](_0x31f9fe(0x1f5)+_0x221a1e[_0x31f9fe(0x256)]+_0x31f9fe(0x1ef))),console[_0x31f9fe(0x1b4)](_0x31f9fe(0x246)+_0x221a1e['agentName']);if(_0x221a1e['agentId']&&_0x221a1e[_0x31f9fe(0x219)]){const _0x43bd0a=getLLMAgentChatUrl(_0x59bd9e,_0x221a1e[_0x31f9fe(0x219)],_0x221a1e[_0x31f9fe(0x1bd)]);console['log'](_0x31f9fe(0x23c)+a4_0x1f75c6[_0x31f9fe(0x265)](_0x43bd0a));}return 0x0;}const _0x14c8a7=_0x53655b[_0x31f9fe(0x243)],_0x5904f5=resolveProjectFromContext(_0x1521b8,_0x14c8a7);if(_0x5904f5[_0x31f9fe(0x269)])_0x1521b8=_0x5904f5[_0x31f9fe(0x1df)],_0x5904f5['source']===_0x31f9fe(0x1ed)&&console[_0x31f9fe(0x1b4)](a4_0x1f75c6['dim']('Using\x20project:\x20'+_0x1521b8));else{let _0x337af1='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x5904f5[_0x31f9fe(0x1c5)]===_0x31f9fe(0x238)&&(_0x337af1=_0x5904f5[_0x31f9fe(0x225)]+_0x31f9fe(0x245)+_0x5904f5[_0x31f9fe(0x243)]+_0x31f9fe(0x21f));throw new SDKError(ErrorCode[_0x31f9fe(0x1b7)],_0x5904f5[_0x31f9fe(0x1c5)]===_0x31f9fe(0x20c)?_0x5904f5[_0x31f9fe(0x225)]:_0x31f9fe(0x216)+_0x1521b8,undefined,{'helpText':_0x337af1});}const {data:_0x52bb31}=await withSpinner(_0x31f9fe(0x1db),()=>_0x15cf94[_0x31f9fe(0x262)]['pushProject'](_0x1521b8,{'dryRun':!![]})),_0x4d0448=_0x52bb31['counts'][_0x31f9fe(0x1c9)][_0x31f9fe(0x23b)]>0x0;if(_0x4d0448){console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1c1)]('\x0aErrors\x20found:'));for(const _0x53787 of _0x52bb31[_0x31f9fe(0x1c9)]){_0x53787[_0x31f9fe(0x256)]===_0x31f9fe(0x1dd)&&console['log'](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x226)+_0x53787[_0x31f9fe(0x234)]+_0x31f9fe(0x1ec)+_0x53787[_0x31f9fe(0x1dd)]));}return 0x1;}const _0x1c9622=_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1c9)][_0x31f9fe(0x1da)]+_0x52bb31['counts']['knowledgeBases'][_0x31f9fe(0x1da)]+_0x52bb31['counts'][_0x31f9fe(0x1ca)][_0x31f9fe(0x1da)]+_0x52bb31[_0x31f9fe(0x26e)]['prompts'][_0x31f9fe(0x1da)]+_0x52bb31['counts'][_0x31f9fe(0x21e)][_0x31f9fe(0x1da)]+_0x52bb31['counts'][_0x31f9fe(0x1f6)][_0x31f9fe(0x1da)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x23a)][_0x31f9fe(0x1da)]+_0x52bb31['counts'][_0x31f9fe(0x25a)]['created']+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1d9)]['created'],_0x1ae29a=_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1c9)][_0x31f9fe(0x217)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1e0)][_0x31f9fe(0x217)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1ca)][_0x31f9fe(0x217)]+_0x52bb31['counts']['prompts'][_0x31f9fe(0x217)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x21e)]['updated']+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1f6)]['updated']+_0x52bb31['counts']['experimentalArtifacts'][_0x31f9fe(0x217)]+_0x52bb31[_0x31f9fe(0x26e)]['formInterfaces'][_0x31f9fe(0x217)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1d9)][_0x31f9fe(0x217)],_0x522a16=_0x52bb31[_0x31f9fe(0x26e)]['agents'][_0x31f9fe(0x203)]+_0x52bb31['counts'][_0x31f9fe(0x1e0)][_0x31f9fe(0x203)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1ca)][_0x31f9fe(0x203)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1cc)]['unchanged']+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x21e)]['unchanged']+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1f6)][_0x31f9fe(0x203)]+_0x52bb31[_0x31f9fe(0x26e)]['experimentalArtifacts'][_0x31f9fe(0x203)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x25a)]['unchanged']+_0x52bb31[_0x31f9fe(0x26e)]['chatInterfaces']['unchanged'];console[_0x31f9fe(0x1b4)](_0x31f9fe(0x26f)+_0x52bb31[_0x31f9fe(0x270)]+'\x27:'),console[_0x31f9fe(0x1b4)]('\x20\x20'+a4_0x1f75c6[_0x31f9fe(0x237)]('+\x20'+_0x1c9622+_0x31f9fe(0x1e9))+_0x31f9fe(0x1c7)+a4_0x1f75c6[_0x31f9fe(0x1b5)]('~\x20'+_0x1ae29a+_0x31f9fe(0x1c4))+'\x20|\x20'+a4_0x1f75c6[_0x31f9fe(0x20a)]('=\x20'+_0x522a16+_0x31f9fe(0x1f8))),console[_0x31f9fe(0x1b4)]('\x20\x20Agents:\x20'+formatCountSummary(_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1c9)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x52bb31['counts'][_0x31f9fe(0x1e0)])),console[_0x31f9fe(0x1b4)](_0x31f9fe(0x1d2)+formatCountSummary(_0x52bb31[_0x31f9fe(0x26e)]['textKnowledgeBases'])),console[_0x31f9fe(0x1b4)](_0x31f9fe(0x1fe)+formatCountSummary(_0x52bb31['counts'][_0x31f9fe(0x1cc)])),console[_0x31f9fe(0x1b4)](_0x31f9fe(0x1d6)+formatCountSummary(_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x21e)])),console[_0x31f9fe(0x1b4)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x52bb31['counts'][_0x31f9fe(0x25a)])),console['log'](_0x31f9fe(0x25f)+formatCountSummary(_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1d9)]));const _0x562b2c=_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1f6)][_0x31f9fe(0x1da)]>0x0||_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1f6)][_0x31f9fe(0x217)]>0x0||_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1f6)][_0x31f9fe(0x203)]>0x0||_0x52bb31['counts'][_0x31f9fe(0x23a)][_0x31f9fe(0x1da)]>0x0||_0x52bb31[_0x31f9fe(0x26e)]['experimentalArtifacts'][_0x31f9fe(0x217)]>0x0||_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x23a)][_0x31f9fe(0x203)]>0x0;_0x562b2c&&(console[_0x31f9fe(0x1b4)](_0x31f9fe(0x267)+formatCountSummary(_0x52bb31['counts'][_0x31f9fe(0x1f6)])),console[_0x31f9fe(0x1b4)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x52bb31[_0x31f9fe(0x26e)]['experimentalArtifacts'])));console[_0x31f9fe(0x1b4)](_0x31f9fe(0x25e)+a4_0x1f75c6[_0x31f9fe(0x265)](_0x1521b8)),displayDiffs(_0x52bb31['agents'],_0x52bb31[_0x31f9fe(0x1e0)],_0x52bb31['textKnowledgeBases'],_0x52bb31[_0x31f9fe(0x1cc)],_0x52bb31[_0x31f9fe(0x21e)],_0x52bb31['experimentalKnowledgeBases'],_0x52bb31[_0x31f9fe(0x23a)],_0x52bb31[_0x31f9fe(0x25a)],_0x52bb31[_0x31f9fe(0x1d9)]);if(_0x222b1d)return console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1b5)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x1c9622===0x0&&_0x1ae29a===0x0){console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x237)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x4384a0=getLLMProjectUrl(_0x59bd9e,_0x52bb31[_0x31f9fe(0x219)]);return console['log']('Project:\x20'+a4_0x1f75c6['cyan'](_0x4384a0)),0x0;}if(!_0x3514f7&&!_0x504701){if(!isInteractive())return console['error'](a4_0x1f75c6[_0x31f9fe(0x1c1)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a4_0x1f75c6['dim'](_0x31f9fe(0x200))),0x1;const _0x41da07=await confirmKey('\x0aPush\x20'+(_0x1c9622+_0x1ae29a)+_0x31f9fe(0x1ee));if(!_0x41da07)return console['log'](a4_0x1f75c6['yellow'](_0x31f9fe(0x1f7)),_0x31f9fe(0x1be)),0x1;}const {data:_0x51a762}=await withSpinner(_0x31f9fe(0x1b6),()=>_0x15cf94[_0x31f9fe(0x262)][_0x31f9fe(0x1e5)](_0x1521b8,{'force':_0x504701})),_0x4910cf=_0x51a762[_0x31f9fe(0x26e)][_0x31f9fe(0x1c9)]['errors']>0x0||_0x51a762['counts'][_0x31f9fe(0x1e0)][_0x31f9fe(0x23b)]>0x0||_0x51a762[_0x31f9fe(0x26e)][_0x31f9fe(0x1ca)][_0x31f9fe(0x23b)]>0x0||_0x51a762[_0x31f9fe(0x26e)][_0x31f9fe(0x1cc)][_0x31f9fe(0x23b)]>0x0||_0x51a762[_0x31f9fe(0x26e)]['formInterfaces']['errors']>0x0||_0x51a762['counts'][_0x31f9fe(0x1d9)][_0x31f9fe(0x23b)]>0x0;if(_0x4910cf){console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1b5)](_0x31f9fe(0x22e))),console[_0x31f9fe(0x1b4)](),console[_0x31f9fe(0x1b4)](a4_0x1f75c6['red'](_0x31f9fe(0x1cb)));for(const _0x58a0c2 of _0x51a762[_0x31f9fe(0x1c9)]){_0x58a0c2[_0x31f9fe(0x256)]===_0x31f9fe(0x1dd)&&console['log'](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x226)+_0x58a0c2[_0x31f9fe(0x234)]+_0x31f9fe(0x1ec)+_0x58a0c2[_0x31f9fe(0x1dd)]));}for(const _0x136b45 of _0x51a762[_0x31f9fe(0x1e0)]){_0x136b45[_0x31f9fe(0x256)]==='error'&&console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1c1)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x136b45['name']+_0x31f9fe(0x1ec)+_0x136b45[_0x31f9fe(0x1dd)]));}for(const _0x256516 of _0x51a762['textKnowledgeBases']){_0x256516[_0x31f9fe(0x256)]===_0x31f9fe(0x1dd)&&console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x1d7)+_0x256516[_0x31f9fe(0x25c)]+_0x31f9fe(0x1ec)+_0x256516[_0x31f9fe(0x1dd)]));}for(const _0x1dda2b of _0x51a762[_0x31f9fe(0x1cc)]){_0x1dda2b[_0x31f9fe(0x256)]===_0x31f9fe(0x1dd)&&console['log'](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x208)+_0x1dda2b[_0x31f9fe(0x25c)]+_0x31f9fe(0x1ec)+_0x1dda2b['error']));}for(const _0x12aa59 of _0x51a762[_0x31f9fe(0x21e)]){_0x12aa59[_0x31f9fe(0x256)]===_0x31f9fe(0x1dd)&&console[_0x31f9fe(0x1b4)](a4_0x1f75c6['red'](_0x31f9fe(0x263)+_0x12aa59[_0x31f9fe(0x25c)]+'\x22:\x20'+_0x12aa59[_0x31f9fe(0x1dd)]));}for(const _0x2c6502 of _0x51a762[_0x31f9fe(0x25a)]){_0x2c6502['action']===_0x31f9fe(0x1dd)&&console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x23d)+_0x2c6502['name']+_0x31f9fe(0x1ec)+_0x2c6502['error']));}for(const _0x2db326 of _0x51a762[_0x31f9fe(0x1d9)]){_0x2db326['action']===_0x31f9fe(0x1dd)&&console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x1ba)+_0x2db326[_0x31f9fe(0x25c)]+_0x31f9fe(0x1ec)+_0x2db326[_0x31f9fe(0x1dd)]));}return 0x1;}console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x237)](_0x31f9fe(0x201)+(_0x1c9622+_0x1ae29a)+'\x20resources\x20to\x20\x27'+_0x51a762[_0x31f9fe(0x270)]+'\x27'));const _0x2094a6=getLLMProjectUrl(_0x59bd9e,_0x51a762[_0x31f9fe(0x219)]);return console[_0x31f9fe(0x1b4)](_0x31f9fe(0x214)+a4_0x1f75c6['cyan'](_0x2094a6)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x8fc2c8=a5_0x1f90;(function(_0x1b5512,_0xe6813){const _0x2c8a21=a5_0x1f90,_0x3a8cd3=_0x1b5512();while(!![]){try{const _0x1f587c=parseInt(_0x2c8a21(0x93))/0x1+-parseInt(_0x2c8a21(0x91))/0x2*(parseInt(_0x2c8a21(0xb9))/0x3)+parseInt(_0x2c8a21(0xf3))/0x4+parseInt(_0x2c8a21(0xfe))/0x5*(parseInt(_0x2c8a21(0xde))/0x6)+-parseInt(_0x2c8a21(0x96))/0x7*(parseInt(_0x2c8a21(0xb4))/0x8)+parseInt(_0x2c8a21(0x84))/0x9*(parseInt(_0x2c8a21(0xf6))/0xa)+parseInt(_0x2c8a21(0xe8))/0xb*(-parseInt(_0x2c8a21(0x10b))/0xc);if(_0x1f587c===_0xe6813)break;else _0x3a8cd3['push'](_0x3a8cd3['shift']());}catch(_0x521287){_0x3a8cd3['push'](_0x3a8cd3['shift']());}}}(a5_0x45ef,0x48dc5));import*as a5_0x5751c9 from'node:fs';import*as a5_0x1b6af4 from'node:path';import a5_0x5924a0 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x45ef(){const _0x158fda=['toISOString','Project\x20path:\x20','No\x20tests\x20found\x20with\x20tags:\x20','Round\x20','dim','stop','filter','substring','358790MvUGUg','message','104320CWTCGp','yellow','\x20-\x20','212709dsRmYX','toLowerCase','multiple_agents','agent:test','Re-evaluating\x20','llmProject','✗\x20FAIL:\x20','Agent:\x20',':\x20Sending\x20user\x20input...','⚠\x20SKIPPED:\x20','Executing\x20new\x20tests...','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Test\x20Configuration:','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','\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','source','Passed:\x20\x20\x20','verbose','white','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Available\x20tags:\x20','Either\x20switch\x20to\x20the\x20\x22','Running\x20agent\x20tests...','resolveAgentId','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','text','Available\x20tests:\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','execute','40agtCMI','Evaluating\x20response...','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','green','table','6foqvFD','No\x20tests\x20have\x20tags\x20defined.','✗\x20ERROR:\x20','\x20\x20Site:\x20','red','not\x20found','Error\x20writing\x20output\x20file:\x20','projectDir','context','Run\x20\x27tdx\x20agent\x20pull\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Output\x20written\x20to:\x20','Failed:\x20\x20\x20','join','ERROR','Test\x20','resolve','testName','forEach','cyan','\x20\x20Round\x20','Site:\x20','no_context','writeFileSync','find','testYmlPath','...\x20','✓\x20PASS:\x20','reeval','Errors:\x20\x20\x20','status','no_tests','json','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','tags','isSpinning','round','6HAjzUP','404','size','push','jsonl','test.yml','some','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','\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)','tsv','11RWiahn','repeat','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','\x20(new)','Cached\x20run\x20is\x20from\x20site\x20\x22','trim','\x20\x20Evaluating...\x20','reason','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','length','site','1724940cRxsSu','agent','PASS','3610FPYCRX','start','Re-evaluating\x20cached\x20test\x20run...','executeReeval','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','split','conversation_url','Re-evaluation\x20Summary','2500765dEBIxe','includes','timestamp','\x22:\x20','name','FAIL','tests','log','...','found','/<agent-name>','\x20\x20Project:\x20','\x20\x20-\x20','7323468zSTmVQ','projectName','utf-8','llm','now','agentName','rounds','No\x20tests\x20found\x20matching:\x20','has','output','Conversation\x20URL:\x20','description','9567fzuEpy','basename','map','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Running\x20test:\x20'];a5_0x45ef=function(){return _0x158fda;};return a5_0x45ef();}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x1f90(_0x559ee1,_0x9c0dc2){_0x559ee1=_0x559ee1-0x7a;const _0x45efd6=a5_0x45ef();let _0x1f900d=_0x45efd6[_0x559ee1];return _0x1f900d;}export class AgentTestCommand extends BaseCommand{[a5_0x8fc2c8(0x102)]=a5_0x8fc2c8(0x99);[a5_0x8fc2c8(0x83)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x8fc2c8(0xb3)](_0x3b745a){const _0xad6a56=a5_0x8fc2c8,{options:_0x310b9c,args:_0x44d6b8,tdx:_0x3a4fc9}=_0x3b745a,_0x1a4909=_0x44d6b8[0x0]||'.',_0x252987=_0x310b9c['dryRun'],_0x1c5e85=_0x310b9c,_0x4e3154=_0x1c5e85['eval']===![],_0xa175cf=_0x1c5e85[_0xad6a56(0xd5)],_0x4a22fe=_0x1c5e85[_0xad6a56(0x102)],_0x175590=_0x1c5e85[_0xad6a56(0xdb)],_0x118961=_0x310b9c[_0xad6a56(0xf2)],_0x27dc5d=_0x1c5e85[_0xad6a56(0x81)];if(_0xa175cf&&_0x4e3154)return console[_0xad6a56(0x105)](a5_0x5924a0[_0xad6a56(0xbd)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x4fc48a=_0xad6a56(0xb8);if(_0x1c5e85[_0xad6a56(0xd9)])_0x4fc48a=_0xad6a56(0xd9);else{if(_0x1c5e85[_0xad6a56(0xe2)])_0x4fc48a=_0xad6a56(0xe2);else{if(_0x1c5e85[_0xad6a56(0xe7)])_0x4fc48a='tsv';else{if(_0x1c5e85[_0xad6a56(0xb8)])_0x4fc48a='table';}}}const _0x3a7160=_0x1c5e85[_0xad6a56(0x9b)];let _0x505826=_0x1a4909;const _0x3f5b0a=a5_0x5751c9['existsSync'](_0x1a4909),_0x3063e4=_0x1a4909==='.';if(!_0x3f5b0a||_0x3063e4){const _0x570c13=resolveProjectFromContext(_0x1a4909,_0x3a7160,{'requireFile':_0xad6a56(0xe3)});if(_0x570c13[_0xad6a56(0x107)])_0x505826=_0x570c13[_0xad6a56(0xc0)],_0x570c13[_0xad6a56(0xa6)]===_0xad6a56(0xc1)&&console[_0xad6a56(0x105)](a5_0x5924a0[_0xad6a56(0x8d)]('Using\x20agent:\x20'+_0x505826));else switch(_0x570c13[_0xad6a56(0xef)]){case _0xad6a56(0xcf):console[_0xad6a56(0x105)](a5_0x5924a0[_0xad6a56(0x94)](_0x570c13[_0xad6a56(0x92)])),console[_0xad6a56(0x105)](),console[_0xad6a56(0x105)]('Usage:'),console[_0xad6a56(0x105)](_0xad6a56(0xa5)),console['log'](_0xad6a56(0xe6)),console['log'](),console[_0xad6a56(0x105)](_0xad6a56(0xda));return 0x1;case'no_local_folder':console['log'](a5_0x5924a0[_0xad6a56(0x94)](_0x570c13['message'])),console[_0xad6a56(0x105)](),console[_0xad6a56(0x105)](_0xad6a56(0xc2)+_0x570c13[_0xad6a56(0x9b)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0xad6a56(0x98):{const _0x4f2277=a5_0x1b6af4[_0xad6a56(0x85)](_0x570c13['projectDir']);console[_0xad6a56(0x105)](a5_0x5924a0[_0xad6a56(0x94)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x570c13[_0xad6a56(0x9b)]+'\x22:'));for(const _0x29eaf8 of _0x570c13['agentDirs']){console['log'](_0xad6a56(0x10a)+_0x29eaf8);}return console[_0xad6a56(0x105)](),console['log']('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x4f2277+_0xad6a56(0x108)),0x1;}case _0xad6a56(0xd8):console[_0xad6a56(0x105)](a5_0x5924a0[_0xad6a56(0x94)](_0xad6a56(0xa4)+_0x570c13[_0xad6a56(0x9b)]+'\x22.')),console[_0xad6a56(0x105)](a5_0x5924a0[_0xad6a56(0x8d)](_0xad6a56(0x8a)+_0x570c13[_0xad6a56(0xc0)])),console[_0xad6a56(0x105)](),console[_0xad6a56(0x105)](_0xad6a56(0xf0));return 0x1;}}const {definition:_0x3a3a64,agentInfo:_0x34e852}=parseTestFile(_0x505826);let _0xb262e2=_0x3a3a64[_0xad6a56(0x104)];if(_0x4a22fe){const _0x1a93e1=_0x4a22fe[_0xad6a56(0xfb)](',')[_0xad6a56(0x86)](_0x2ace2c=>_0x2ace2c[_0xad6a56(0xed)]());_0xb262e2=_0x3a3a64[_0xad6a56(0x104)][_0xad6a56(0x8f)](_0x3f79e1=>_0x1a93e1['includes'](_0x3f79e1[_0xad6a56(0x102)]));if(_0xb262e2[_0xad6a56(0xf1)]===0x0)return console[_0xad6a56(0x105)](a5_0x5924a0[_0xad6a56(0x94)](_0xad6a56(0x7f)+_0x4a22fe)),console[_0xad6a56(0x105)](a5_0x5924a0['dim'](_0xad6a56(0xb1)+_0x3a3a64['tests'][_0xad6a56(0x86)](_0x492e5a=>_0x492e5a[_0xad6a56(0x102)])[_0xad6a56(0xc6)](',\x20'))),0x1;}if(_0x175590){const _0x4a8504=_0x175590['split'](',')['map'](_0x1dc667=>_0x1dc667[_0xad6a56(0xed)]()['toLowerCase']());_0xb262e2=_0xb262e2['filter'](_0x43e98a=>_0x43e98a[_0xad6a56(0xdb)]?.[_0xad6a56(0xe4)](_0x46d6ac=>_0x4a8504[_0xad6a56(0xff)](_0x46d6ac[_0xad6a56(0x97)]())));if(_0xb262e2[_0xad6a56(0xf1)]===0x0){console['log'](a5_0x5924a0[_0xad6a56(0x94)](_0xad6a56(0x8b)+_0x175590));const _0x361bbb=new Set();return _0x3a3a64[_0xad6a56(0x104)][_0xad6a56(0xcb)](_0x1ac6bd=>_0x1ac6bd[_0xad6a56(0xdb)]?.[_0xad6a56(0xcb)](_0x3c7368=>_0x361bbb['add'](_0x3c7368))),_0x361bbb[_0xad6a56(0xe0)]>0x0?console[_0xad6a56(0x105)](a5_0x5924a0[_0xad6a56(0x8d)](_0xad6a56(0xab)+[..._0x361bbb][_0xad6a56(0xc6)](',\x20'))):console[_0xad6a56(0x105)](a5_0x5924a0['dim'](_0xad6a56(0xba))),0x1;}}if(_0xa175cf)return this['executeReeval'](_0x3b745a,{'definition':{'tests':_0xb262e2},'agentInfo':_0x34e852,'outputFormat':_0x4fc48a,'outputFile':_0x27dc5d,'testNames':_0x4a22fe});if(_0x252987){console[_0xad6a56(0x105)](a5_0x5924a0[_0xad6a56(0xcc)](_0xad6a56(0xa2))),console[_0xad6a56(0x105)](_0xad6a56(0xbc)+a5_0x5924a0[_0xad6a56(0xa9)](_0x118961)),console[_0xad6a56(0x105)](_0xad6a56(0x109)+a5_0x5924a0[_0xad6a56(0xa9)](_0x34e852['projectName'])),console[_0xad6a56(0x105)]('\x20\x20Agent:\x20'+a5_0x5924a0[_0xad6a56(0xa9)](_0x34e852[_0xad6a56(0x7d)])),console[_0xad6a56(0x105)](),console[_0xad6a56(0x105)]('Tests\x20found:\x20'+a5_0x5924a0['white'](_0xb262e2[_0xad6a56(0xf1)]));for(let _0x1c4305=0x0;_0x1c4305<_0xb262e2['length'];_0x1c4305++){const _0x3c7e49=_0xb262e2[_0x1c4305],_0x55580c=_0x3c7e49[_0xad6a56(0x7e)][_0xad6a56(0xf1)]===0x1?_0xad6a56(0xdd):_0xad6a56(0x7e),_0x533579=_0x3c7e49[_0xad6a56(0xdb)]?.[_0xad6a56(0xf1)]?'\x20['+_0x3c7e49[_0xad6a56(0xdb)][_0xad6a56(0xc6)](',\x20')+']':'';console['log']('\x20\x20'+(_0x1c4305+0x1)+'.\x20'+a5_0x5924a0[_0xad6a56(0xa9)](_0x3c7e49[_0xad6a56(0x102)])+'\x20('+_0x3c7e49[_0xad6a56(0x7e)][_0xad6a56(0xf1)]+'\x20'+_0x55580c+')'+a5_0x5924a0['dim'](_0x533579));}return 0x0;}let _0x3a0ab2,_0x3e6283;try{_0x3a0ab2=await _0x3a4fc9[_0xad6a56(0x7b)]['resolveProjectId'](_0x34e852[_0xad6a56(0x10c)]);}catch(_0x5e640e){const _0x5c4983=_0x5e640e instanceof Error?_0x5e640e[_0xad6a56(0x92)]:String(_0x5e640e);return _0x5c4983[_0xad6a56(0xff)](_0xad6a56(0xdf))||_0x5c4983[_0xad6a56(0x97)]()[_0xad6a56(0xff)](_0xad6a56(0xbe))?console[_0xad6a56(0x105)](a5_0x5924a0[_0xad6a56(0xbd)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x34e852[_0xad6a56(0x10c)])):console['log'](a5_0x5924a0['red'](_0xad6a56(0xb6)+_0x34e852[_0xad6a56(0x10c)]+_0xad6a56(0x101)+_0x5c4983)),0x1;}try{_0x3e6283=await _0x3a4fc9[_0xad6a56(0x7b)][_0xad6a56(0xae)](_0x34e852[_0xad6a56(0x7d)],_0x3a0ab2);}catch(_0x24f7df){const _0x373b54=_0x24f7df instanceof Error?_0x24f7df['message']:String(_0x24f7df);return _0x373b54[_0xad6a56(0xff)](_0xad6a56(0xdf))||_0x373b54[_0xad6a56(0x97)]()[_0xad6a56(0xff)](_0xad6a56(0xbe))?console[_0xad6a56(0x105)](a5_0x5924a0['red'](_0xad6a56(0xa1)+_0x34e852['agentName'])):console[_0xad6a56(0x105)](a5_0x5924a0['red'](_0xad6a56(0x87)+_0x34e852[_0xad6a56(0x7d)]+_0xad6a56(0x101)+_0x373b54)),0x1;}let _0x3db12c;if(!_0x4e3154)try{_0x3db12c=await setupEvaluatorAgent(_0x3a4fc9[_0xad6a56(0x7b)],_0x310b9c['verbose']);}catch(_0x1a47f2){const _0xda9e6b=_0x1a47f2 instanceof Error?_0x1a47f2[_0xad6a56(0x92)]:String(_0x1a47f2);return console[_0xad6a56(0x105)](a5_0x5924a0[_0xad6a56(0xbd)](_0xad6a56(0xea)+_0xda9e6b)),0x1;}console[_0xad6a56(0x105)](a5_0x5924a0[_0xad6a56(0xcc)](_0xad6a56(0xad))),console[_0xad6a56(0x105)](_0xad6a56(0xce)+a5_0x5924a0[_0xad6a56(0xa9)](_0x118961)),console[_0xad6a56(0x105)](_0xad6a56(0x9d)+a5_0x5924a0[_0xad6a56(0xa9)](_0x34e852['projectName']+'/'+_0x34e852[_0xad6a56(0x7d)])),console[_0xad6a56(0x105)]();const _0x47eef1=[],_0x5ee965=[],_0x540cb0=Date[_0xad6a56(0x7c)]();for(let _0x5626fd=0x0;_0x5626fd<_0xb262e2[_0xad6a56(0xf1)];_0x5626fd++){const _0x96a932=_0xb262e2[_0x5626fd];_0xb262e2[_0xad6a56(0xf1)]>0x1?console[_0xad6a56(0x105)](_0xad6a56(0xc8)+(_0x5626fd+0x1)+'/'+_0xb262e2[_0xad6a56(0xf1)]+':\x20'+a5_0x5924a0[_0xad6a56(0xa9)](_0x96a932[_0xad6a56(0x102)])):console[_0xad6a56(0x105)](_0xad6a56(0x88)+a5_0x5924a0['white'](_0x96a932[_0xad6a56(0x102)]));const _0x33b41f=createCommandSpinner('Round\x201/'+_0x96a932[_0xad6a56(0x7e)][_0xad6a56(0xf1)]+_0xad6a56(0x9e));_0x33b41f[_0xad6a56(0xf7)]();try{const {result:_0x4c91ca,conversation:_0x1516f5}=await runTest(_0x3a4fc9[_0xad6a56(0x7b)],_0x96a932,{'agentId':_0x3e6283,'projectId':_0x3a0ab2,'site':_0x118961,'noEval':_0x4e3154,'evaluatorId':_0x3db12c,'onRoundStart':(_0x9ec793,_0x376626)=>{const _0x160551=_0xad6a56;_0x33b41f['text']=_0x160551(0x8c)+(_0x9ec793+0x1)+'/'+_0x376626+_0x160551(0x9e);},'onRoundComplete':(_0x7c3e04,_0x45b7b2,_0x13244)=>{const _0x4bcd18=_0xad6a56,_0x4a33df=formatElapsed(_0x45b7b2);_0x13244?console[_0x4bcd18(0x105)]('\x20\x20Round\x20'+(_0x7c3e04+0x1)+'/'+_0x96a932['rounds']['length']+_0x4bcd18(0xd3)+a5_0x5924a0[_0x4bcd18(0xb7)]('✓')+'\x20('+_0x4a33df+')'):console[_0x4bcd18(0x105)](_0x4bcd18(0xcd)+(_0x7c3e04+0x1)+'/'+_0x96a932[_0x4bcd18(0x7e)][_0x4bcd18(0xf1)]+_0x4bcd18(0xd3)+a5_0x5924a0[_0x4bcd18(0xbd)]('✗'));},'onEvaluationStart':()=>{const _0x2fdc97=_0xad6a56;_0x33b41f['text']=_0x2fdc97(0xb5);},'onEvaluationComplete':_0x39e43b=>{const _0x33811d=_0xad6a56,_0x5a02ed=formatElapsed(_0x39e43b);console['log'](_0x33811d(0xee)+a5_0x5924a0[_0x33811d(0xb7)]('✓')+'\x20('+_0x5a02ed+')');}});_0x33b41f[_0xad6a56(0x8e)](),_0x47eef1[_0xad6a56(0xe1)](_0x4c91ca),_0x5ee965[_0xad6a56(0xe1)](_0x1516f5);if(_0x4c91ca[_0xad6a56(0xd7)]==='PASS')console[_0xad6a56(0x105)](a5_0x5924a0[_0xad6a56(0xb7)](_0xad6a56(0xd4)+_0x4c91ca[_0xad6a56(0xef)]));else _0x4c91ca['status']===_0xad6a56(0x103)?console[_0xad6a56(0x105)](a5_0x5924a0[_0xad6a56(0xbd)](_0xad6a56(0x9c)+_0x4c91ca['reason'])):console[_0xad6a56(0x105)](a5_0x5924a0[_0xad6a56(0xbd)](_0xad6a56(0xbb)+_0x4c91ca[_0xad6a56(0xef)]));_0x4c91ca[_0xad6a56(0xfc)]&&console['log'](a5_0x5924a0[_0xad6a56(0x8d)](_0xad6a56(0x82)+_0x4c91ca[_0xad6a56(0xfc)])),console[_0xad6a56(0x105)]();}catch(_0x1750e9){_0x33b41f[_0xad6a56(0x8e)]();const _0x4fb94b=_0x1750e9 instanceof Error?_0x1750e9[_0xad6a56(0x92)]:String(_0x1750e9);console[_0xad6a56(0x105)](a5_0x5924a0[_0xad6a56(0xbd)]('✗\x20ERROR:\x20'+_0x4fb94b)),console[_0xad6a56(0x105)](),_0x47eef1[_0xad6a56(0xe1)]({'name':_0x96a932[_0xad6a56(0x102)],'status':_0xad6a56(0xc7),'reason':_0x4fb94b,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x2b3d38=Date[_0xad6a56(0x7c)]()-_0x540cb0,_0x4b98c1=_0x47eef1[_0xad6a56(0x8f)](_0x4ef20c=>_0x4ef20c[_0xad6a56(0xd7)]===_0xad6a56(0xf5))[_0xad6a56(0xf1)],_0x1cf510=_0x47eef1[_0xad6a56(0x8f)](_0x4c1525=>_0x4c1525[_0xad6a56(0xd7)]===_0xad6a56(0x103))[_0xad6a56(0xf1)],_0x31f580=_0x47eef1[_0xad6a56(0x8f)](_0x433d43=>_0x433d43[_0xad6a56(0xd7)]===_0xad6a56(0xc7))[_0xad6a56(0xf1)];console[_0xad6a56(0x105)]('━'[_0xad6a56(0xe9)](0x3c)),console[_0xad6a56(0x105)]('Test\x20Summary'),console[_0xad6a56(0x105)]('━'[_0xad6a56(0xe9)](0x3c)),console[_0xad6a56(0x105)]('Total:\x20\x20\x20\x20'+_0x47eef1[_0xad6a56(0xf1)]),console[_0xad6a56(0x105)](_0xad6a56(0xa7)+a5_0x5924a0[_0xad6a56(0xb7)](_0x4b98c1)),console[_0xad6a56(0x105)](_0xad6a56(0xc5)+a5_0x5924a0[_0xad6a56(0xbd)](_0x1cf510));_0x31f580>0x0&&console['log'](_0xad6a56(0xd6)+a5_0x5924a0[_0xad6a56(0xbd)](_0x31f580));console['log']('Duration:\x20'+formatElapsed(_0x2b3d38)),console[_0xad6a56(0x105)]('━'[_0xad6a56(0xe9)](0x3c));const _0x230306=_0x47eef1['filter'](_0x14769d=>_0x14769d[_0xad6a56(0xd7)]!=='PASS');if(_0x230306[_0xad6a56(0xf1)]>0x0){console[_0xad6a56(0x105)](),console[_0xad6a56(0x105)]('Failed\x20Tests:');for(const _0xe66323 of _0x230306){const _0x3b8be8=a5_0x5924a0[_0xad6a56(0xbd)]('✗'),_0x2addfe=_0xe66323[_0xad6a56(0xef)]['length']>0x32?_0xe66323[_0xad6a56(0xef)][_0xad6a56(0x90)](0x0,0x32)+_0xad6a56(0x106):_0xe66323[_0xad6a56(0xef)];console['log']('\x20\x20'+_0x3b8be8+'\x20'+_0xe66323[_0xad6a56(0x102)]+':\x20'+_0x2addfe);}}const _0x1bac3f={'summary':{'total':_0x47eef1[_0xad6a56(0xf1)],'passed':_0x4b98c1,'failed':_0x1cf510,'errors':_0x31f580>0x0?_0x31f580:undefined,'duration_ms':_0x2b3d38},'tests':_0x47eef1,'agent':{'project':_0x34e852['projectName'],'name':_0x34e852[_0xad6a56(0x7d)],'site':_0x118961},'timestamp':new Date(_0x540cb0)['toISOString']()};try{const _0x4940c9=buildCachedTestRun(_0x5ee965,{'site':_0x118961,'projectId':_0x3a0ab2,'projectName':_0x34e852[_0xad6a56(0x10c)],'agentId':_0x3e6283,'agentName':_0x34e852[_0xad6a56(0x7d)],'testYmlPath':a5_0x1b6af4[_0xad6a56(0xc9)](_0x34e852[_0xad6a56(0xd2)])});saveLastTestRun(_0x4940c9);}catch{}if(_0x4fc48a!==_0xad6a56(0xb8)||_0x27dc5d){const _0x41de2c=formatResults(_0x1bac3f,_0x4fc48a);if(_0x27dc5d)try{a5_0x5751c9[_0xad6a56(0xd0)](_0x27dc5d,_0x41de2c,_0xad6a56(0x7a)),console[_0xad6a56(0x105)](),console[_0xad6a56(0x105)](a5_0x5924a0[_0xad6a56(0x8d)](_0xad6a56(0xc4)+_0x27dc5d));}catch(_0x3e34f3){return console['log'](),console[_0xad6a56(0x105)](a5_0x5924a0[_0xad6a56(0xbd)](_0xad6a56(0xbf)+_0x3e34f3)),0x1;}else console[_0xad6a56(0x105)](),console['log'](_0x41de2c);}return _0x230306['length']>0x0?0x1:0x0;}async[a5_0x8fc2c8(0xf9)](_0x3cfc7f,_0x4fd196){const _0x290c68=a5_0x8fc2c8,{options:_0x282ac5,tdx:_0x39a6c1}=_0x3cfc7f,{definition:_0x8b43b3,agentInfo:_0x360065,outputFormat:_0x6320e6,outputFile:_0x4952e7}=_0x4fd196,_0xba37be=_0x282ac5[_0x290c68(0xf2)],_0x375808=loadLastTestRun();if(!_0x375808)return console[_0x290c68(0x105)](a5_0x5924a0[_0x290c68(0xbd)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x290c68(0x105)](a5_0x5924a0['dim'](_0x290c68(0xc3))),0x1;if(_0x375808[_0x290c68(0xf4)][_0x290c68(0x7d)]!==_0x360065[_0x290c68(0x7d)])return console['log'](a5_0x5924a0['red'](_0x290c68(0xb2)+_0x375808[_0x290c68(0xf4)][_0x290c68(0x7d)]+_0x290c68(0xa3)+_0x360065[_0x290c68(0x7d)]+'\x22.')),console[_0x290c68(0x105)](a5_0x5924a0['dim'](_0x290c68(0xfa))),0x1;const _0x3baf8a=new Set(_0x375808['conversations']['map'](_0x2ab0dc=>_0x2ab0dc[_0x290c68(0xca)])),_0x32c85d=_0x8b43b3['tests'][_0x290c68(0x8f)](_0x3fdc4e=>!_0x3baf8a[_0x290c68(0x80)](_0x3fdc4e[_0x290c68(0x102)]));if(_0x32c85d['length']>0x0&&_0x375808[_0x290c68(0xf2)]!==_0xba37be)return console[_0x290c68(0x105)](a5_0x5924a0[_0x290c68(0xbd)](_0x290c68(0xaa))),console[_0x290c68(0x105)](a5_0x5924a0[_0x290c68(0x8d)](_0x290c68(0xec)+_0x375808[_0x290c68(0xf2)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0xba37be+'\x22.')),console['log'](a5_0x5924a0['dim'](_0x290c68(0xac)+_0x375808[_0x290c68(0xf2)]+_0x290c68(0xe5))),0x1;const _0xe6470c=_0x8b43b3[_0x290c68(0x104)][_0x290c68(0x8f)](_0x45d583=>_0x3baf8a[_0x290c68(0x80)](_0x45d583[_0x290c68(0x102)])),_0x34a9de=_0x32c85d;let _0x1b21c8;try{_0x1b21c8=await setupEvaluatorAgent(_0x39a6c1[_0x290c68(0x7b)],_0x282ac5[_0x290c68(0xa8)]);}catch(_0x2dbd66){const _0x837a0c=_0x2dbd66 instanceof Error?_0x2dbd66[_0x290c68(0x92)]:String(_0x2dbd66);return console['log'](a5_0x5924a0[_0x290c68(0xbd)](_0x290c68(0xea)+_0x837a0c)),0x1;}console[_0x290c68(0x105)](a5_0x5924a0[_0x290c68(0xcc)](_0x290c68(0xf8))),console[_0x290c68(0x105)]('Cached\x20run\x20from:\x20'+a5_0x5924a0['white'](_0x375808[_0x290c68(0x100)])),console[_0x290c68(0x105)](_0x290c68(0x9d)+a5_0x5924a0[_0x290c68(0xa9)](_0x375808[_0x290c68(0xf4)]['projectName']+'/'+_0x375808['agent'][_0x290c68(0x7d)]));_0x34a9de[_0x290c68(0xf1)]>0x0&&console[_0x290c68(0x105)]('New\x20tests\x20to\x20execute:\x20'+a5_0x5924a0[_0x290c68(0x94)](_0x34a9de[_0x290c68(0xf1)]));console[_0x290c68(0x105)]();const _0x4e3dbe=[],_0x396571=Date[_0x290c68(0x7c)](),_0x170025=createCommandSpinner('Re-evaluating...');if(_0xe6470c[_0x290c68(0xf1)]>0x0)try{const _0x2877d0=await reevaluateFromCache(_0x39a6c1[_0x290c68(0x7b)],_0x375808,{'tests':_0xe6470c},{'evaluatorId':_0x1b21c8,'onTestStart':(_0x5bc552,_0x14801e,_0x45ee43)=>{const _0x9bce7d=_0x290c68;_0x170025[_0x9bce7d(0xb0)]=_0x9bce7d(0x9a)+(_0x14801e+0x1)+'/'+_0x45ee43+':\x20'+_0x5bc552+_0x9bce7d(0x106);if(!_0x170025[_0x9bce7d(0xdc)])_0x170025[_0x9bce7d(0xf7)]();},'onTestComplete':(_0x418e52,_0x1b0b13)=>{const _0x36d92b=_0x290c68;_0x170025['stop']();if(_0x1b0b13[_0x36d92b(0xd7)]===_0x36d92b(0xf5))console[_0x36d92b(0x105)](a5_0x5924a0[_0x36d92b(0xb7)](_0x36d92b(0xd4)+_0x418e52)+a5_0x5924a0[_0x36d92b(0x8d)]('\x20(cached)'));else _0x1b0b13[_0x36d92b(0xd7)]===_0x36d92b(0x103)?console[_0x36d92b(0x105)](a5_0x5924a0['red'](_0x36d92b(0x9c)+_0x418e52+_0x36d92b(0x95)+_0x1b0b13['reason'])+a5_0x5924a0[_0x36d92b(0x8d)]('\x20(cached)')):console[_0x36d92b(0x105)](a5_0x5924a0[_0x36d92b(0xbd)](_0x36d92b(0xbb)+_0x418e52+_0x36d92b(0x95)+_0x1b0b13['reason']));_0x1b0b13['conversation_url']&&console[_0x36d92b(0x105)](a5_0x5924a0[_0x36d92b(0x8d)]('\x20\x20Conversation:\x20'+_0x1b0b13['conversation_url'])),_0x4e3dbe['push'](_0x1b0b13);},'onTestSkipped':(_0x4647d4,_0x2e5ebe)=>{const _0x4f942f=_0x290c68;_0x170025[_0x4f942f(0x8e)](),console[_0x4f942f(0x105)](a5_0x5924a0[_0x4f942f(0x94)](_0x4f942f(0x9f)+_0x4647d4+'\x20-\x20'+_0x2e5ebe));}});for(const _0x54222d of _0x2877d0){!_0x4e3dbe[_0x290c68(0xd1)](_0x17e5cd=>_0x17e5cd[_0x290c68(0x102)]===_0x54222d[_0x290c68(0x102)])&&_0x4e3dbe[_0x290c68(0xe1)](_0x54222d);}}catch(_0x14eea1){_0x170025[_0x290c68(0x8e)]();const _0x12bf44=_0x14eea1 instanceof Error?_0x14eea1[_0x290c68(0x92)]:String(_0x14eea1);return console[_0x290c68(0x105)](a5_0x5924a0[_0x290c68(0xbd)](_0x290c68(0xaf)+_0x12bf44)),0x1;}_0x170025[_0x290c68(0x8e)]();if(_0x34a9de[_0x290c68(0xf1)]>0x0){console[_0x290c68(0x105)](),console[_0x290c68(0x105)](a5_0x5924a0[_0x290c68(0xcc)](_0x290c68(0xa0)));const {projectId:_0x30aa60,agentId:_0x54097c}=_0x375808[_0x290c68(0xf4)];for(const _0x4d78d5 of _0x34a9de){console['log']('Running:\x20'+a5_0x5924a0[_0x290c68(0xa9)](_0x4d78d5['name']));const _0x56d51c=createCommandSpinner('Round\x201/'+_0x4d78d5[_0x290c68(0x7e)][_0x290c68(0xf1)]+_0x290c68(0x9e));_0x56d51c[_0x290c68(0xf7)]();try{const {result:_0x175464}=await runTest(_0x39a6c1['llm'],_0x4d78d5,{'agentId':_0x54097c,'projectId':_0x30aa60,'site':_0x375808[_0x290c68(0xf2)],'noEval':![],'evaluatorId':_0x1b21c8,'onRoundStart':(_0x6bef97,_0x3c8a00)=>{const _0x262d56=_0x290c68;_0x56d51c[_0x262d56(0xb0)]=_0x262d56(0x8c)+(_0x6bef97+0x1)+'/'+_0x3c8a00+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x8d9154,_0xcc4aa0,_0x35297c)=>{const _0x430aad=_0x290c68,_0x35d127=formatElapsed(_0xcc4aa0);_0x35297c?console[_0x430aad(0x105)](_0x430aad(0xcd)+(_0x8d9154+0x1)+'/'+_0x4d78d5[_0x430aad(0x7e)][_0x430aad(0xf1)]+'...\x20'+a5_0x5924a0[_0x430aad(0xb7)]('✓')+'\x20('+_0x35d127+')'):console[_0x430aad(0x105)](_0x430aad(0xcd)+(_0x8d9154+0x1)+'/'+_0x4d78d5[_0x430aad(0x7e)][_0x430aad(0xf1)]+_0x430aad(0xd3)+a5_0x5924a0[_0x430aad(0xbd)]('✗'));},'onEvaluationStart':()=>{const _0x1766e9=_0x290c68;_0x56d51c[_0x1766e9(0xb0)]='Evaluating\x20response...';},'onEvaluationComplete':_0x5824f6=>{const _0x5bff20=_0x290c68,_0x1344cc=formatElapsed(_0x5824f6);console['log'](_0x5bff20(0xee)+a5_0x5924a0[_0x5bff20(0xb7)]('✓')+'\x20('+_0x1344cc+')');}});_0x56d51c['stop'](),_0x4e3dbe[_0x290c68(0xe1)](_0x175464);if(_0x175464['status']===_0x290c68(0xf5))console[_0x290c68(0x105)](a5_0x5924a0[_0x290c68(0xb7)](_0x290c68(0xd4)+_0x175464[_0x290c68(0xef)])+a5_0x5924a0[_0x290c68(0x8d)](_0x290c68(0xeb)));else _0x175464['status']===_0x290c68(0x103)?console['log'](a5_0x5924a0[_0x290c68(0xbd)]('✗\x20FAIL:\x20'+_0x175464['reason'])+a5_0x5924a0[_0x290c68(0x8d)]('\x20(new)')):console[_0x290c68(0x105)](a5_0x5924a0['red'](_0x290c68(0xbb)+_0x175464[_0x290c68(0xef)]));_0x175464[_0x290c68(0xfc)]&&console[_0x290c68(0x105)](a5_0x5924a0[_0x290c68(0x8d)]('\x20\x20Conversation:\x20'+_0x175464[_0x290c68(0xfc)]));}catch(_0x1d8e3e){_0x56d51c[_0x290c68(0x8e)]();const _0x145d8f=_0x1d8e3e instanceof Error?_0x1d8e3e['message']:String(_0x1d8e3e);console['log'](a5_0x5924a0['red'](_0x290c68(0xbb)+_0x145d8f)),_0x4e3dbe[_0x290c68(0xe1)]({'name':_0x4d78d5[_0x290c68(0x102)],'status':_0x290c68(0xc7),'reason':_0x145d8f,'timestamp':new Date()[_0x290c68(0x89)](),'duration_ms':0x0});}}}console[_0x290c68(0x105)]();const _0xd2c576=Date[_0x290c68(0x7c)]()-_0x396571,_0x405798=_0x4e3dbe['filter'](_0x299b01=>_0x299b01[_0x290c68(0xd7)]==='PASS')[_0x290c68(0xf1)],_0x269f10=_0x4e3dbe['filter'](_0x5a82e2=>_0x5a82e2[_0x290c68(0xd7)]===_0x290c68(0x103))[_0x290c68(0xf1)],_0x18c139=_0x4e3dbe[_0x290c68(0x8f)](_0x54d10d=>_0x54d10d[_0x290c68(0xd7)]===_0x290c68(0xc7))['length'];console[_0x290c68(0x105)]('━'[_0x290c68(0xe9)](0x3c)),console[_0x290c68(0x105)](_0x290c68(0xfd)),console[_0x290c68(0x105)]('━'['repeat'](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x4e3dbe[_0x290c68(0xf1)]),console['log'](_0x290c68(0xa7)+a5_0x5924a0[_0x290c68(0xb7)](_0x405798)),console[_0x290c68(0x105)]('Failed:\x20\x20\x20'+a5_0x5924a0[_0x290c68(0xbd)](_0x269f10));_0x18c139>0x0&&console[_0x290c68(0x105)](_0x290c68(0xd6)+a5_0x5924a0[_0x290c68(0xbd)](_0x18c139));console[_0x290c68(0x105)]('Duration:\x20'+formatElapsed(_0xd2c576)),console[_0x290c68(0x105)]('━'[_0x290c68(0xe9)](0x3c));const _0x4bbfe8={'summary':{'total':_0x4e3dbe[_0x290c68(0xf1)],'passed':_0x405798,'failed':_0x269f10,'errors':_0x18c139>0x0?_0x18c139:undefined,'duration_ms':_0xd2c576},'tests':_0x4e3dbe,'agent':{'project':_0x360065[_0x290c68(0x10c)],'name':_0x360065[_0x290c68(0x7d)],'site':_0xba37be},'timestamp':new Date(_0x396571)[_0x290c68(0x89)]()};if(_0x6320e6!=='table'||_0x4952e7){const _0x5b310f=formatResults(_0x4bbfe8,_0x6320e6);if(_0x4952e7)try{a5_0x5751c9[_0x290c68(0xd0)](_0x4952e7,_0x5b310f,_0x290c68(0x7a)),console['log'](),console[_0x290c68(0x105)](a5_0x5924a0[_0x290c68(0x8d)](_0x290c68(0xc4)+_0x4952e7));}catch(_0x2f75dc){return console[_0x290c68(0x105)](),console[_0x290c68(0x105)](a5_0x5924a0['red'](_0x290c68(0xbf)+_0x2f75dc)),0x1;}else console[_0x290c68(0x105)](),console[_0x290c68(0x105)](_0x5b310f);}const _0xbb96f=_0x4e3dbe[_0x290c68(0x8f)](_0x186978=>_0x186978[_0x290c68(0xd7)]!==_0x290c68(0xf5));return _0xbb96f[_0x290c68(0xf1)]>0x0?0x1:0x0;}}
1
+ const a5_0x1eeba6=a5_0x4f3a;(function(_0x19fc27,_0x1983ee){const _0x210449=a5_0x4f3a,_0x5e934f=_0x19fc27();while(!![]){try{const _0x3d5401=-parseInt(_0x210449(0x1de))/0x1+-parseInt(_0x210449(0x22e))/0x2+parseInt(_0x210449(0x218))/0x3+-parseInt(_0x210449(0x1bc))/0x4*(parseInt(_0x210449(0x20b))/0x5)+parseInt(_0x210449(0x20a))/0x6*(parseInt(_0x210449(0x1cb))/0x7)+parseInt(_0x210449(0x1bb))/0x8*(-parseInt(_0x210449(0x219))/0x9)+parseInt(_0x210449(0x24a))/0xa;if(_0x3d5401===_0x1983ee)break;else _0x5e934f['push'](_0x5e934f['shift']());}catch(_0x574884){_0x5e934f['push'](_0x5e934f['shift']());}}}(a5_0x5645,0xad794));import*as a5_0x11b47f from'node:fs';import*as a5_0x28d6f4 from'node:path';import a5_0x7e9951 from'chalk';import{BaseCommand}from'./command.js';function a5_0x5645(){const _0x2be640=['567721NmTekB','Conversation\x20URL:\x20','table','filter','conversation_url','Run\x20tests\x20for\x20an\x20LLM\x20agent','output','round','Output\x20written\x20to:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','jsonl','✗\x20ERROR:\x20','Test\x20Configuration:','agent:test','no_context','Project\x20path:\x20','agentDirs','No\x20tests\x20found\x20matching:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','New\x20tests\x20to\x20execute:\x20','has','\x20\x20-\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','Round\x201/','Executing\x20new\x20tests...','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','\x20(cached)','repeat','FAIL','\x20\x20Project:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','tags','Test\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Using\x20agent:\x20','✗\x20FAIL:\x20','map','Round\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','timestamp','site','execute','rounds','1485948xlZMJZ','35QfvQHe','not\x20found','No\x20tests\x20found\x20with\x20tags:\x20','message','writeFileSync','\x27\x20to\x20create\x20the\x20folder\x20structure.','Re-evaluating...','multiple_agents','Running:\x20','projectDir','\x22:\x20','found','tests','256869LHgscP','288qjhSgo','forEach','log','join','Total:\x20\x20\x20\x20','Re-evaluating\x20cached\x20test\x20run...','name','toLowerCase','red','Duration:\x20','isSpinning','executeReeval','includes','utf-8','testName','\x20-\x20','✓\x20PASS:\x20','size','\x20\x20Evaluating...\x20','...','404','1329940KPNmko','Either\x20switch\x20to\x20the\x20\x22','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','no_tests','some','Re-evaluation\x20Summary','llm','push','description','Failed\x20Tests:','ERROR','testYmlPath','dim','projectName','Errors:\x20\x20\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','cyan','add',':\x20Sending\x20user\x20input...','text','resolveProjectId','...\x20','Tests\x20found:\x20','Agent:\x20','llmProject','toISOString','reason','green','35814560zRnfGj','agentName','eval','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Usage:','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Site:\x20','status','stop','270376sjRtuV','508568jXVOqt','PASS','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','\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','context','start','source','resolveAgentId','dryRun','resolve','split','Passed:\x20\x20\x20','verbose','agent','Evaluating\x20response...','7GJicSH','length','substring','reeval','Error\x20writing\x20output\x20file:\x20','trim','basename','\x20\x20Conversation:\x20','⚠\x20SKIPPED:\x20','conversations','now','yellow','find','\x20\x20Agent:\x20','\x20\x20Round\x20','json','Available\x20tags:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','white'];a5_0x5645=function(){return _0x2be640;};return a5_0x5645();}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';function a5_0x4f3a(_0x251af2,_0x200b02){_0x251af2=_0x251af2-0x1bb;const _0x56459f=a5_0x5645();let _0x4f3a26=_0x56459f[_0x251af2];return _0x4f3a26;}export class AgentTestCommand extends BaseCommand{[a5_0x1eeba6(0x21f)]=a5_0x1eeba6(0x1eb);[a5_0x1eeba6(0x236)]=a5_0x1eeba6(0x1e3);async[a5_0x1eeba6(0x208)](_0x4c842e){const _0x20b479=a5_0x1eeba6,{options:_0x235eeb,args:_0x4903c1,tdx:_0xfd7234}=_0x4c842e,_0x4a9771=_0x4903c1[0x0]||'.',_0x59078c=_0x235eeb[_0x20b479(0x1c4)],_0x3b1db6=_0x235eeb,_0x4f501b=_0x3b1db6[_0x20b479(0x24c)]===![],_0x1b57c6=_0x3b1db6[_0x20b479(0x1ce)],_0x1f6363=_0x3b1db6[_0x20b479(0x21f)],_0x5c81e3=_0x3b1db6[_0x20b479(0x1fe)],_0x1762d8=_0x235eeb[_0x20b479(0x207)],_0x373669=_0x3b1db6[_0x20b479(0x1e4)];if(_0x1b57c6&&_0x4f501b)return console['log'](a5_0x7e9951[_0x20b479(0x221)](_0x20b479(0x23d))),0x1;let _0x1d5313='table';if(_0x3b1db6['json'])_0x1d5313=_0x20b479(0x1da);else{if(_0x3b1db6[_0x20b479(0x1e8)])_0x1d5313='jsonl';else{if(_0x3b1db6['tsv'])_0x1d5313='tsv';else{if(_0x3b1db6['table'])_0x1d5313=_0x20b479(0x1e0);}}}const _0x1eb7f=_0x3b1db6[_0x20b479(0x246)];let _0x561d8e=_0x4a9771;const _0x49dd35=a5_0x11b47f['existsSync'](_0x4a9771),_0x3347b2=_0x4a9771==='.';if(!_0x49dd35||_0x3347b2){const _0x53bcfe=resolveProjectFromContext(_0x4a9771,_0x1eb7f,{'requireFile':'test.yml'});if(_0x53bcfe[_0x20b479(0x216)])_0x561d8e=_0x53bcfe['projectDir'],_0x53bcfe[_0x20b479(0x1c2)]===_0x20b479(0x1c0)&&console[_0x20b479(0x21b)](a5_0x7e9951['dim'](_0x20b479(0x201)+_0x561d8e));else switch(_0x53bcfe[_0x20b479(0x248)]){case _0x20b479(0x1ec):console[_0x20b479(0x21b)](a5_0x7e9951['yellow'](_0x53bcfe[_0x20b479(0x20e)])),console[_0x20b479(0x21b)](),console['log'](_0x20b479(0x24e)),console['log'](_0x20b479(0x1bf)),console[_0x20b479(0x21b)](_0x20b479(0x205)),console[_0x20b479(0x21b)](),console[_0x20b479(0x21b)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case'no_local_folder':console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x1d6)](_0x53bcfe['message'])),console[_0x20b479(0x21b)](),console['log'](_0x20b479(0x1e7)+_0x53bcfe[_0x20b479(0x246)]+_0x20b479(0x210));return 0x1;case _0x20b479(0x212):{const _0xaf72fa=a5_0x28d6f4[_0x20b479(0x1d1)](_0x53bcfe[_0x20b479(0x214)]);console[_0x20b479(0x21b)](a5_0x7e9951['yellow'](_0x20b479(0x24d)+_0x53bcfe[_0x20b479(0x246)]+'\x22:'));for(const _0x3e4d35 of _0x53bcfe[_0x20b479(0x1ee)]){console[_0x20b479(0x21b)](_0x20b479(0x1f3)+_0x3e4d35);}return console['log'](),console[_0x20b479(0x21b)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0xaf72fa+'/<agent-name>'),0x1;}case _0x20b479(0x231):console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x1d6)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x53bcfe[_0x20b479(0x246)]+'\x22.')),console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x23a)](_0x20b479(0x1ed)+_0x53bcfe['projectDir'])),console[_0x20b479(0x21b)](),console['log'](_0x20b479(0x230));return 0x1;}}const {definition:_0x5b5439,agentInfo:_0x375398}=parseTestFile(_0x561d8e);let _0x6c2cc0=_0x5b5439[_0x20b479(0x217)];if(_0x1f6363){const _0x42a3a9=_0x1f6363[_0x20b479(0x1c6)](',')[_0x20b479(0x203)](_0x16bc93=>_0x16bc93[_0x20b479(0x1d0)]());_0x6c2cc0=_0x5b5439[_0x20b479(0x217)][_0x20b479(0x1e1)](_0x1ad3d2=>_0x42a3a9[_0x20b479(0x225)](_0x1ad3d2[_0x20b479(0x21f)]));if(_0x6c2cc0[_0x20b479(0x1cc)]===0x0)return console['log'](a5_0x7e9951['yellow'](_0x20b479(0x1ef)+_0x1f6363)),console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x23a)]('Available\x20tests:\x20'+_0x5b5439['tests'][_0x20b479(0x203)](_0x367c4b=>_0x367c4b[_0x20b479(0x21f)])[_0x20b479(0x21c)](',\x20'))),0x1;}if(_0x5c81e3){const _0x58dbf2=_0x5c81e3[_0x20b479(0x1c6)](',')['map'](_0x5fe8cc=>_0x5fe8cc['trim']()[_0x20b479(0x220)]());_0x6c2cc0=_0x6c2cc0[_0x20b479(0x1e1)](_0x7dab92=>_0x7dab92[_0x20b479(0x1fe)]?.[_0x20b479(0x232)](_0x501199=>_0x58dbf2[_0x20b479(0x225)](_0x501199[_0x20b479(0x220)]())));if(_0x6c2cc0[_0x20b479(0x1cc)]===0x0){console['log'](a5_0x7e9951[_0x20b479(0x1d6)](_0x20b479(0x20d)+_0x5c81e3));const _0x57fa00=new Set();return _0x5b5439[_0x20b479(0x217)][_0x20b479(0x21a)](_0x165a2a=>_0x165a2a[_0x20b479(0x1fe)]?.[_0x20b479(0x21a)](_0x2c541a=>_0x57fa00[_0x20b479(0x23f)](_0x2c541a))),_0x57fa00[_0x20b479(0x22a)]>0x0?console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x23a)](_0x20b479(0x1db)+[..._0x57fa00][_0x20b479(0x21c)](',\x20'))):console[_0x20b479(0x21b)](a5_0x7e9951['dim']('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x1b57c6)return this[_0x20b479(0x224)](_0x4c842e,{'definition':{'tests':_0x6c2cc0},'agentInfo':_0x375398,'outputFormat':_0x1d5313,'outputFile':_0x373669,'testNames':_0x1f6363});if(_0x59078c){console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x23e)](_0x20b479(0x1ea))),console[_0x20b479(0x21b)]('\x20\x20Site:\x20'+a5_0x7e9951['white'](_0x1762d8)),console['log'](_0x20b479(0x1fb)+a5_0x7e9951['white'](_0x375398[_0x20b479(0x23b)])),console[_0x20b479(0x21b)](_0x20b479(0x1d8)+a5_0x7e9951[_0x20b479(0x1dd)](_0x375398[_0x20b479(0x24b)])),console[_0x20b479(0x21b)](),console[_0x20b479(0x21b)](_0x20b479(0x244)+a5_0x7e9951[_0x20b479(0x1dd)](_0x6c2cc0[_0x20b479(0x1cc)]));for(let _0x3bef6e=0x0;_0x3bef6e<_0x6c2cc0[_0x20b479(0x1cc)];_0x3bef6e++){const _0x1fa817=_0x6c2cc0[_0x3bef6e],_0x3a33cd=_0x1fa817['rounds'][_0x20b479(0x1cc)]===0x1?_0x20b479(0x1e5):_0x20b479(0x209),_0x474802=_0x1fa817['tags']?.[_0x20b479(0x1cc)]?'\x20['+_0x1fa817[_0x20b479(0x1fe)][_0x20b479(0x21c)](',\x20')+']':'';console[_0x20b479(0x21b)]('\x20\x20'+(_0x3bef6e+0x1)+'.\x20'+a5_0x7e9951[_0x20b479(0x1dd)](_0x1fa817[_0x20b479(0x21f)])+'\x20('+_0x1fa817[_0x20b479(0x209)][_0x20b479(0x1cc)]+'\x20'+_0x3a33cd+')'+a5_0x7e9951[_0x20b479(0x23a)](_0x474802));}return 0x0;}let _0x25c749,_0x37c9c8;try{_0x25c749=await _0xfd7234[_0x20b479(0x234)][_0x20b479(0x242)](_0x375398[_0x20b479(0x23b)]);}catch(_0x55de34){const _0x2bdd44=_0x55de34 instanceof Error?_0x55de34[_0x20b479(0x20e)]:String(_0x55de34);return _0x2bdd44[_0x20b479(0x225)](_0x20b479(0x22d))||_0x2bdd44['toLowerCase']()[_0x20b479(0x225)](_0x20b479(0x20c))?console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x375398[_0x20b479(0x23b)])):console[_0x20b479(0x21b)](a5_0x7e9951['red'](_0x20b479(0x1be)+_0x375398['projectName']+_0x20b479(0x215)+_0x2bdd44)),0x1;}try{_0x37c9c8=await _0xfd7234[_0x20b479(0x234)][_0x20b479(0x1c3)](_0x375398[_0x20b479(0x24b)],_0x25c749);}catch(_0x4a9979){const _0x51ceb2=_0x4a9979 instanceof Error?_0x4a9979['message']:String(_0x4a9979);return _0x51ceb2[_0x20b479(0x225)]('404')||_0x51ceb2[_0x20b479(0x220)]()[_0x20b479(0x225)]('not\x20found')?console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)](_0x20b479(0x1fc)+_0x375398[_0x20b479(0x24b)])):console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x375398['agentName']+_0x20b479(0x215)+_0x51ceb2)),0x1;}let _0x12fa7a;if(!_0x4f501b)try{_0x12fa7a=await setupEvaluatorAgent(_0xfd7234[_0x20b479(0x234)],_0x235eeb[_0x20b479(0x1c8)]);}catch(_0x133409){const _0x548037=_0x133409 instanceof Error?_0x133409[_0x20b479(0x20e)]:String(_0x133409);return console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)](_0x20b479(0x1f0)+_0x548037)),0x1;}console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x23e)]('Running\x20agent\x20tests...')),console[_0x20b479(0x21b)](_0x20b479(0x250)+a5_0x7e9951[_0x20b479(0x1dd)](_0x1762d8)),console[_0x20b479(0x21b)](_0x20b479(0x245)+a5_0x7e9951['white'](_0x375398[_0x20b479(0x23b)]+'/'+_0x375398[_0x20b479(0x24b)])),console[_0x20b479(0x21b)]();const _0x4741b8=[],_0x143e71=[],_0x4d23b5=Date[_0x20b479(0x1d5)]();for(let _0xf7eb9c=0x0;_0xf7eb9c<_0x6c2cc0[_0x20b479(0x1cc)];_0xf7eb9c++){const _0x4055c2=_0x6c2cc0[_0xf7eb9c];_0x6c2cc0[_0x20b479(0x1cc)]>0x1?console[_0x20b479(0x21b)](_0x20b479(0x1ff)+(_0xf7eb9c+0x1)+'/'+_0x6c2cc0[_0x20b479(0x1cc)]+':\x20'+a5_0x7e9951[_0x20b479(0x1dd)](_0x4055c2[_0x20b479(0x21f)])):console[_0x20b479(0x21b)]('Running\x20test:\x20'+a5_0x7e9951[_0x20b479(0x1dd)](_0x4055c2[_0x20b479(0x21f)]));const _0x2666cf=createCommandSpinner(_0x20b479(0x1f5)+_0x4055c2[_0x20b479(0x209)][_0x20b479(0x1cc)]+_0x20b479(0x240));_0x2666cf[_0x20b479(0x1c1)]();try{const {result:_0x23d66d,conversation:_0x4dcf09}=await runTest(_0xfd7234[_0x20b479(0x234)],_0x4055c2,{'agentId':_0x37c9c8,'projectId':_0x25c749,'site':_0x1762d8,'noEval':_0x4f501b,'evaluatorId':_0x12fa7a,'onRoundStart':(_0x2141b9,_0x27da12)=>{const _0x4e7e7f=_0x20b479;_0x2666cf[_0x4e7e7f(0x241)]=_0x4e7e7f(0x204)+(_0x2141b9+0x1)+'/'+_0x27da12+_0x4e7e7f(0x240);},'onRoundComplete':(_0xd773e9,_0x4cecd4,_0x228b0f)=>{const _0x1763e9=_0x20b479,_0x1f01ef=formatElapsed(_0x4cecd4);_0x228b0f?console[_0x1763e9(0x21b)]('\x20\x20Round\x20'+(_0xd773e9+0x1)+'/'+_0x4055c2[_0x1763e9(0x209)][_0x1763e9(0x1cc)]+'...\x20'+a5_0x7e9951['green']('✓')+'\x20('+_0x1f01ef+')'):console[_0x1763e9(0x21b)](_0x1763e9(0x1d9)+(_0xd773e9+0x1)+'/'+_0x4055c2[_0x1763e9(0x209)][_0x1763e9(0x1cc)]+_0x1763e9(0x243)+a5_0x7e9951[_0x1763e9(0x221)]('✗'));},'onEvaluationStart':()=>{const _0x11a60d=_0x20b479;_0x2666cf[_0x11a60d(0x241)]='Evaluating\x20response...';},'onEvaluationComplete':_0x530d79=>{const _0x2143ea=_0x20b479,_0x59fb31=formatElapsed(_0x530d79);console[_0x2143ea(0x21b)]('\x20\x20Evaluating...\x20'+a5_0x7e9951[_0x2143ea(0x249)]('✓')+'\x20('+_0x59fb31+')');}});_0x2666cf[_0x20b479(0x252)](),_0x4741b8[_0x20b479(0x235)](_0x23d66d),_0x143e71['push'](_0x4dcf09);if(_0x23d66d[_0x20b479(0x251)]===_0x20b479(0x1bd))console[_0x20b479(0x21b)](a5_0x7e9951['green']('✓\x20PASS:\x20'+_0x23d66d[_0x20b479(0x248)]));else _0x23d66d[_0x20b479(0x251)]===_0x20b479(0x1fa)?console[_0x20b479(0x21b)](a5_0x7e9951['red'](_0x20b479(0x202)+_0x23d66d['reason'])):console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)](_0x20b479(0x1e9)+_0x23d66d['reason']));_0x23d66d[_0x20b479(0x1e2)]&&console[_0x20b479(0x21b)](a5_0x7e9951['dim'](_0x20b479(0x1df)+_0x23d66d[_0x20b479(0x1e2)])),console['log']();}catch(_0x3d09fb){_0x2666cf[_0x20b479(0x252)]();const _0x5cdc30=_0x3d09fb instanceof Error?_0x3d09fb[_0x20b479(0x20e)]:String(_0x3d09fb);console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)]('✗\x20ERROR:\x20'+_0x5cdc30)),console[_0x20b479(0x21b)](),_0x4741b8['push']({'name':_0x4055c2['name'],'status':_0x20b479(0x238),'reason':_0x5cdc30,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x28776c=Date[_0x20b479(0x1d5)]()-_0x4d23b5,_0x379b21=_0x4741b8[_0x20b479(0x1e1)](_0x1fc965=>_0x1fc965[_0x20b479(0x251)]===_0x20b479(0x1bd))['length'],_0x34141b=_0x4741b8[_0x20b479(0x1e1)](_0x5edf62=>_0x5edf62[_0x20b479(0x251)]===_0x20b479(0x1fa))[_0x20b479(0x1cc)],_0x17ae92=_0x4741b8[_0x20b479(0x1e1)](_0x3a868f=>_0x3a868f[_0x20b479(0x251)]==='ERROR')[_0x20b479(0x1cc)];console[_0x20b479(0x21b)]('━'[_0x20b479(0x1f9)](0x3c)),console['log']('Test\x20Summary'),console[_0x20b479(0x21b)]('━'[_0x20b479(0x1f9)](0x3c)),console[_0x20b479(0x21b)](_0x20b479(0x21d)+_0x4741b8[_0x20b479(0x1cc)]),console[_0x20b479(0x21b)](_0x20b479(0x1c7)+a5_0x7e9951[_0x20b479(0x249)](_0x379b21)),console[_0x20b479(0x21b)]('Failed:\x20\x20\x20'+a5_0x7e9951[_0x20b479(0x221)](_0x34141b));_0x17ae92>0x0&&console[_0x20b479(0x21b)]('Errors:\x20\x20\x20'+a5_0x7e9951['red'](_0x17ae92));console[_0x20b479(0x21b)](_0x20b479(0x222)+formatElapsed(_0x28776c)),console[_0x20b479(0x21b)]('━'[_0x20b479(0x1f9)](0x3c));const _0x25dd57=_0x4741b8[_0x20b479(0x1e1)](_0x1cf4ba=>_0x1cf4ba[_0x20b479(0x251)]!==_0x20b479(0x1bd));if(_0x25dd57[_0x20b479(0x1cc)]>0x0){console[_0x20b479(0x21b)](),console[_0x20b479(0x21b)](_0x20b479(0x237));for(const _0xab20ac of _0x25dd57){const _0x4abb02=a5_0x7e9951[_0x20b479(0x221)]('✗'),_0x2cb58d=_0xab20ac[_0x20b479(0x248)]['length']>0x32?_0xab20ac[_0x20b479(0x248)][_0x20b479(0x1cd)](0x0,0x32)+_0x20b479(0x22c):_0xab20ac[_0x20b479(0x248)];console[_0x20b479(0x21b)]('\x20\x20'+_0x4abb02+'\x20'+_0xab20ac['name']+':\x20'+_0x2cb58d);}}const _0x426451={'summary':{'total':_0x4741b8['length'],'passed':_0x379b21,'failed':_0x34141b,'errors':_0x17ae92>0x0?_0x17ae92:undefined,'duration_ms':_0x28776c},'tests':_0x4741b8,'agent':{'project':_0x375398[_0x20b479(0x23b)],'name':_0x375398[_0x20b479(0x24b)],'site':_0x1762d8},'timestamp':new Date(_0x4d23b5)['toISOString']()};try{const _0x14bd9b=buildCachedTestRun(_0x143e71,{'site':_0x1762d8,'projectId':_0x25c749,'projectName':_0x375398['projectName'],'agentId':_0x37c9c8,'agentName':_0x375398[_0x20b479(0x24b)],'testYmlPath':a5_0x28d6f4[_0x20b479(0x1c5)](_0x375398[_0x20b479(0x239)])});saveLastTestRun(_0x14bd9b);}catch{}if(_0x1d5313!==_0x20b479(0x1e0)||_0x373669){const _0x433b11=formatResults(_0x426451,_0x1d5313);if(_0x373669)try{a5_0x11b47f[_0x20b479(0x20f)](_0x373669,_0x433b11,_0x20b479(0x226)),console[_0x20b479(0x21b)](),console[_0x20b479(0x21b)](a5_0x7e9951['dim'](_0x20b479(0x1e6)+_0x373669));}catch(_0x4e6938){return console[_0x20b479(0x21b)](),console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)]('Error\x20writing\x20output\x20file:\x20'+_0x4e6938)),0x1;}else console['log'](),console['log'](_0x433b11);}return _0x25dd57[_0x20b479(0x1cc)]>0x0?0x1:0x0;}async[a5_0x1eeba6(0x224)](_0x5ec8ef,_0x147b40){const _0x4d1328=a5_0x1eeba6,{options:_0xdee4f4,tdx:_0x2634dc}=_0x5ec8ef,{definition:_0x37e42c,agentInfo:_0x2a6598,outputFormat:_0x4e711f,outputFile:_0x325a71}=_0x147b40,_0x1d42eb=_0xdee4f4[_0x4d1328(0x207)],_0x439fcd=loadLastTestRun();if(!_0x439fcd)return console['log'](a5_0x7e9951[_0x4d1328(0x221)](_0x4d1328(0x1dc))),console[_0x4d1328(0x21b)](a5_0x7e9951['dim'](_0x4d1328(0x200))),0x1;if(_0x439fcd[_0x4d1328(0x1c9)][_0x4d1328(0x24b)]!==_0x2a6598['agentName'])return console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x221)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x439fcd[_0x4d1328(0x1c9)][_0x4d1328(0x24b)]+_0x4d1328(0x1fd)+_0x2a6598[_0x4d1328(0x24b)]+'\x22.')),console['log'](a5_0x7e9951['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x1c667d=new Set(_0x439fcd[_0x4d1328(0x1d4)][_0x4d1328(0x203)](_0x350825=>_0x350825[_0x4d1328(0x227)])),_0xd5ed56=_0x37e42c[_0x4d1328(0x217)][_0x4d1328(0x1e1)](_0x4e21b5=>!_0x1c667d[_0x4d1328(0x1f2)](_0x4e21b5[_0x4d1328(0x21f)]));if(_0xd5ed56[_0x4d1328(0x1cc)]>0x0&&_0x439fcd['site']!==_0x1d42eb)return console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x221)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x23a)](_0x4d1328(0x1f4)+_0x439fcd['site']+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x1d42eb+'\x22.')),console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x23a)](_0x4d1328(0x22f)+_0x439fcd['site']+_0x4d1328(0x1f7))),0x1;const _0x2bf14e=_0x37e42c[_0x4d1328(0x217)][_0x4d1328(0x1e1)](_0x1103c5=>_0x1c667d['has'](_0x1103c5[_0x4d1328(0x21f)])),_0x42b5e4=_0xd5ed56;let _0x350d4c;try{_0x350d4c=await setupEvaluatorAgent(_0x2634dc['llm'],_0xdee4f4[_0x4d1328(0x1c8)]);}catch(_0x3385db){const _0x37e3cf=_0x3385db instanceof Error?_0x3385db['message']:String(_0x3385db);return console['log'](a5_0x7e9951[_0x4d1328(0x221)](_0x4d1328(0x1f0)+_0x37e3cf)),0x1;}console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x23e)](_0x4d1328(0x21e))),console['log']('Cached\x20run\x20from:\x20'+a5_0x7e9951[_0x4d1328(0x1dd)](_0x439fcd[_0x4d1328(0x206)])),console[_0x4d1328(0x21b)](_0x4d1328(0x245)+a5_0x7e9951[_0x4d1328(0x1dd)](_0x439fcd[_0x4d1328(0x1c9)][_0x4d1328(0x23b)]+'/'+_0x439fcd[_0x4d1328(0x1c9)][_0x4d1328(0x24b)]));_0x42b5e4[_0x4d1328(0x1cc)]>0x0&&console[_0x4d1328(0x21b)](_0x4d1328(0x1f1)+a5_0x7e9951[_0x4d1328(0x1d6)](_0x42b5e4[_0x4d1328(0x1cc)]));console[_0x4d1328(0x21b)]();const _0x447816=[],_0x2f65b7=Date['now'](),_0x4a552f=createCommandSpinner(_0x4d1328(0x211));if(_0x2bf14e[_0x4d1328(0x1cc)]>0x0)try{const _0x59919f=await reevaluateFromCache(_0x2634dc[_0x4d1328(0x234)],_0x439fcd,{'tests':_0x2bf14e},{'evaluatorId':_0x350d4c,'onTestStart':(_0xec8c22,_0x289cba,_0x327488)=>{const _0x52cb01=_0x4d1328;_0x4a552f['text']='Re-evaluating\x20'+(_0x289cba+0x1)+'/'+_0x327488+':\x20'+_0xec8c22+'...';if(!_0x4a552f[_0x52cb01(0x223)])_0x4a552f['start']();},'onTestComplete':(_0x5e06be,_0x3575e7)=>{const _0x3b228d=_0x4d1328;_0x4a552f[_0x3b228d(0x252)]();if(_0x3575e7[_0x3b228d(0x251)]===_0x3b228d(0x1bd))console[_0x3b228d(0x21b)](a5_0x7e9951['green'](_0x3b228d(0x229)+_0x5e06be)+a5_0x7e9951[_0x3b228d(0x23a)](_0x3b228d(0x1f8)));else _0x3575e7[_0x3b228d(0x251)]==='FAIL'?console[_0x3b228d(0x21b)](a5_0x7e9951['red']('✗\x20FAIL:\x20'+_0x5e06be+_0x3b228d(0x228)+_0x3575e7['reason'])+a5_0x7e9951['dim'](_0x3b228d(0x1f8))):console[_0x3b228d(0x21b)](a5_0x7e9951[_0x3b228d(0x221)](_0x3b228d(0x1e9)+_0x5e06be+_0x3b228d(0x228)+_0x3575e7[_0x3b228d(0x248)]));_0x3575e7[_0x3b228d(0x1e2)]&&console[_0x3b228d(0x21b)](a5_0x7e9951[_0x3b228d(0x23a)](_0x3b228d(0x1d2)+_0x3575e7[_0x3b228d(0x1e2)])),_0x447816['push'](_0x3575e7);},'onTestSkipped':(_0x2c20d8,_0x3c8895)=>{const _0x4f8625=_0x4d1328;_0x4a552f[_0x4f8625(0x252)](),console[_0x4f8625(0x21b)](a5_0x7e9951[_0x4f8625(0x1d6)](_0x4f8625(0x1d3)+_0x2c20d8+_0x4f8625(0x228)+_0x3c8895));}});for(const _0x272e9f of _0x59919f){!_0x447816[_0x4d1328(0x1d7)](_0x385c5c=>_0x385c5c[_0x4d1328(0x21f)]===_0x272e9f[_0x4d1328(0x21f)])&&_0x447816['push'](_0x272e9f);}}catch(_0x4856b1){_0x4a552f[_0x4d1328(0x252)]();const _0x13a177=_0x4856b1 instanceof Error?_0x4856b1[_0x4d1328(0x20e)]:String(_0x4856b1);return console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x221)](_0x4d1328(0x24f)+_0x13a177)),0x1;}_0x4a552f[_0x4d1328(0x252)]();if(_0x42b5e4['length']>0x0){console[_0x4d1328(0x21b)](),console['log'](a5_0x7e9951[_0x4d1328(0x23e)](_0x4d1328(0x1f6)));const {projectId:_0xca95c0,agentId:_0x56be0b}=_0x439fcd[_0x4d1328(0x1c9)];for(const _0x534016 of _0x42b5e4){console[_0x4d1328(0x21b)](_0x4d1328(0x213)+a5_0x7e9951['white'](_0x534016[_0x4d1328(0x21f)]));const _0xaff219=createCommandSpinner(_0x4d1328(0x1f5)+_0x534016[_0x4d1328(0x209)][_0x4d1328(0x1cc)]+_0x4d1328(0x240));_0xaff219[_0x4d1328(0x1c1)]();try{const {result:_0x346122}=await runTest(_0x2634dc['llm'],_0x534016,{'agentId':_0x56be0b,'projectId':_0xca95c0,'site':_0x439fcd[_0x4d1328(0x207)],'noEval':![],'evaluatorId':_0x350d4c,'onRoundStart':(_0xe20d2e,_0x314b5d)=>{const _0x363567=_0x4d1328;_0xaff219['text']=_0x363567(0x204)+(_0xe20d2e+0x1)+'/'+_0x314b5d+_0x363567(0x240);},'onRoundComplete':(_0x529a87,_0x1278c9,_0x4b0a8e)=>{const _0x27eca3=_0x4d1328,_0x3cddcd=formatElapsed(_0x1278c9);_0x4b0a8e?console[_0x27eca3(0x21b)](_0x27eca3(0x1d9)+(_0x529a87+0x1)+'/'+_0x534016[_0x27eca3(0x209)][_0x27eca3(0x1cc)]+_0x27eca3(0x243)+a5_0x7e9951[_0x27eca3(0x249)]('✓')+'\x20('+_0x3cddcd+')'):console[_0x27eca3(0x21b)]('\x20\x20Round\x20'+(_0x529a87+0x1)+'/'+_0x534016['rounds']['length']+_0x27eca3(0x243)+a5_0x7e9951[_0x27eca3(0x221)]('✗'));},'onEvaluationStart':()=>{const _0x5870f8=_0x4d1328;_0xaff219[_0x5870f8(0x241)]=_0x5870f8(0x1ca);},'onEvaluationComplete':_0x3e2585=>{const _0x5f2f34=_0x4d1328,_0x3b3009=formatElapsed(_0x3e2585);console[_0x5f2f34(0x21b)](_0x5f2f34(0x22b)+a5_0x7e9951['green']('✓')+'\x20('+_0x3b3009+')');}});_0xaff219[_0x4d1328(0x252)](),_0x447816[_0x4d1328(0x235)](_0x346122);if(_0x346122[_0x4d1328(0x251)]===_0x4d1328(0x1bd))console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x249)](_0x4d1328(0x229)+_0x346122[_0x4d1328(0x248)])+a5_0x7e9951[_0x4d1328(0x23a)]('\x20(new)'));else _0x346122[_0x4d1328(0x251)]===_0x4d1328(0x1fa)?console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x221)](_0x4d1328(0x202)+_0x346122[_0x4d1328(0x248)])+a5_0x7e9951['dim']('\x20(new)')):console['log'](a5_0x7e9951['red']('✗\x20ERROR:\x20'+_0x346122[_0x4d1328(0x248)]));_0x346122['conversation_url']&&console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x23a)]('\x20\x20Conversation:\x20'+_0x346122[_0x4d1328(0x1e2)]));}catch(_0xcb19a7){_0xaff219[_0x4d1328(0x252)]();const _0x28c10d=_0xcb19a7 instanceof Error?_0xcb19a7[_0x4d1328(0x20e)]:String(_0xcb19a7);console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x221)](_0x4d1328(0x1e9)+_0x28c10d)),_0x447816[_0x4d1328(0x235)]({'name':_0x534016[_0x4d1328(0x21f)],'status':'ERROR','reason':_0x28c10d,'timestamp':new Date()[_0x4d1328(0x247)](),'duration_ms':0x0});}}}console['log']();const _0x89e063=Date[_0x4d1328(0x1d5)]()-_0x2f65b7,_0x55926b=_0x447816[_0x4d1328(0x1e1)](_0x4c6bc9=>_0x4c6bc9[_0x4d1328(0x251)]===_0x4d1328(0x1bd))['length'],_0x4cd68b=_0x447816[_0x4d1328(0x1e1)](_0xb53d3e=>_0xb53d3e[_0x4d1328(0x251)]===_0x4d1328(0x1fa))[_0x4d1328(0x1cc)],_0x557f24=_0x447816['filter'](_0x270645=>_0x270645['status']===_0x4d1328(0x238))[_0x4d1328(0x1cc)];console[_0x4d1328(0x21b)]('━'['repeat'](0x3c)),console[_0x4d1328(0x21b)](_0x4d1328(0x233)),console['log']('━'[_0x4d1328(0x1f9)](0x3c)),console[_0x4d1328(0x21b)]('Total:\x20\x20\x20\x20'+_0x447816[_0x4d1328(0x1cc)]),console['log'](_0x4d1328(0x1c7)+a5_0x7e9951['green'](_0x55926b)),console['log']('Failed:\x20\x20\x20'+a5_0x7e9951['red'](_0x4cd68b));_0x557f24>0x0&&console['log'](_0x4d1328(0x23c)+a5_0x7e9951[_0x4d1328(0x221)](_0x557f24));console['log'](_0x4d1328(0x222)+formatElapsed(_0x89e063)),console['log']('━'[_0x4d1328(0x1f9)](0x3c));const _0x4204c6={'summary':{'total':_0x447816[_0x4d1328(0x1cc)],'passed':_0x55926b,'failed':_0x4cd68b,'errors':_0x557f24>0x0?_0x557f24:undefined,'duration_ms':_0x89e063},'tests':_0x447816,'agent':{'project':_0x2a6598[_0x4d1328(0x23b)],'name':_0x2a6598[_0x4d1328(0x24b)],'site':_0x1d42eb},'timestamp':new Date(_0x2f65b7)[_0x4d1328(0x247)]()};if(_0x4e711f!==_0x4d1328(0x1e0)||_0x325a71){const _0x3facdb=formatResults(_0x4204c6,_0x4e711f);if(_0x325a71)try{a5_0x11b47f[_0x4d1328(0x20f)](_0x325a71,_0x3facdb,_0x4d1328(0x226)),console[_0x4d1328(0x21b)](),console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x23a)]('Output\x20written\x20to:\x20'+_0x325a71));}catch(_0x5841ab){return console[_0x4d1328(0x21b)](),console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x221)](_0x4d1328(0x1cf)+_0x5841ab)),0x1;}else console[_0x4d1328(0x21b)](),console[_0x4d1328(0x21b)](_0x3facdb);}const _0x372df4=_0x447816[_0x4d1328(0x1e1)](_0x9f6cda=>_0x9f6cda[_0x4d1328(0x251)]!==_0x4d1328(0x1bd));return _0x372df4['length']>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- function a6_0x265d(){const _0x14b20f=['message','has','log','8153tLzijP','136jfDfTT','header','cdp','length','startsWith','set-cookie2','cas','x-trino-user','request','body','data','indexOf','us01','Error:\x20','x-auth-token','output','description','keys','150126EusrdN','file','toLowerCase','GET','set-cookie','color','api','82505NbqRxp','PUT','trim','POST','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','site','type','trino','Invalid\x20header\x20format:\x20\x22','29820650wdGSZT','<\x20HTTP/1.1\x20','join','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','llm','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','10335856AaJBky','104WgTPxe','\x0aStack\x20trace:\x0a','status','entries','execute','isArray','includes','method','92709hStZpN','verbose','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','error','3831951lzPAVO','toUpperCase','headers','name','357iXcsVn','Endpoint\x20must\x20start\x20with\x20/:\x20'];a6_0x265d=function(){return _0x14b20f;};return a6_0x265d();}const a6_0x153f4e=a6_0x2c89;(function(_0x226cf1,_0x24a548){const _0x251c8b=a6_0x2c89,_0x301692=_0x226cf1();while(!![]){try{const _0x26a7ef=parseInt(_0x251c8b(0xdb))/0x1*(-parseInt(_0x251c8b(0xc6))/0x2)+-parseInt(_0x251c8b(0xd2))/0x3+-parseInt(_0x251c8b(0xdc))/0x4*(parseInt(_0x251c8b(0xb6))/0x5)+-parseInt(_0x251c8b(0xee))/0x6*(-parseInt(_0x251c8b(0xd6))/0x7)+-parseInt(_0x251c8b(0xc5))/0x8+-parseInt(_0x251c8b(0xce))/0x9+parseInt(_0x251c8b(0xbf))/0xa;if(_0x26a7ef===_0x24a548)break;else _0x301692['push'](_0x301692['shift']());}catch(_0x9bec92){_0x301692['push'](_0x301692['shift']());}}}(a6_0x265d,0xa952a));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';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization','proxy-authorization','cookie',a6_0x153f4e(0xf2),a6_0x153f4e(0xe1),'x-xsrf-token',a6_0x153f4e(0xea),a6_0x153f4e(0xe3)]);function isSensitiveHeader(_0x20e04b){const _0x23ca2b=a6_0x153f4e;return SENSITIVE_HEADERS[_0x23ca2b(0xd9)](_0x20e04b[_0x23ca2b(0xf0)]());}function a6_0x2c89(_0x467039,_0x47d533){_0x467039=_0x467039-0xb6;const _0x265d6f=a6_0x265d();let _0x2c892d=_0x265d6f[_0x467039];return _0x2c892d;}function parseHeader(_0x128a48){const _0xcb763b=a6_0x153f4e,_0xcfffce=_0x128a48[_0xcb763b(0xe7)](':');if(_0xcfffce===-0x1)throw new Error(_0xcb763b(0xbe)+_0x128a48+'\x22.\x20'+_0xcb763b(0xc4));const _0x338386=_0x128a48['substring'](0x0,_0xcfffce)[_0xcb763b(0xb8)](),_0x174e12=_0x128a48['substring'](_0xcfffce+0x1)['trim']();if(!_0x338386)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x128a48+'\x22');return[_0x338386,_0x174e12];}export class ApiCommand extends BaseCommand{[a6_0x153f4e(0xd5)]=a6_0x153f4e(0xf4);[a6_0x153f4e(0xec)]=a6_0x153f4e(0xd0);['validate'](_0x58dc1){const _0x3deeb4=a6_0x153f4e,{args:_0x172f78,options:_0xa1d681}=_0x58dc1,_0x1160db=_0xa1d681;if(_0x172f78[_0x3deeb4(0xdf)]===0x0)return _0x3deeb4(0xc2);const _0x254208=_0x172f78[0x0];if(!_0x254208[_0x3deeb4(0xe0)]('/'))return _0x3deeb4(0xd7)+_0x254208;const _0x3fcdf9=_0x1160db[_0x3deeb4(0xe6)],_0x18cd33=_0x1160db['file'];if(_0x3fcdf9&&_0x18cd33)return _0x3deeb4(0xba);const _0x4e6d5b=_0x1160db[_0x3deeb4(0xcd)]||_0x3deeb4(0xf1),_0x4a4a44=[_0x3deeb4(0xf1),_0x3deeb4(0xb9),_0x3deeb4(0xb7),'DELETE','PATCH'];if(!_0x4a4a44[_0x3deeb4(0xcc)](_0x4e6d5b[_0x3deeb4(0xd3)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x4e6d5b+'.\x20Valid\x20methods:\x20'+_0x4a4a44[_0x3deeb4(0xc1)](',\x20');const _0x2d5cb6=_0x1160db[_0x3deeb4(0xbc)]||'td',_0x6c677b=['td',_0x3deeb4(0xde),'workflow',_0x3deeb4(0xbd),_0x3deeb4(0xc3),'llm-proxy',_0x3deeb4(0xe2)];if(!_0x6c677b[_0x3deeb4(0xcc)](_0x2d5cb6))return'Invalid\x20API\x20type:\x20'+_0x2d5cb6+'.\x20Valid\x20types:\x20'+_0x6c677b['join'](',\x20');return undefined;}async[a6_0x153f4e(0xca)](_0x2918b7){const _0xb27b3f=a6_0x153f4e,{options:_0x2c50f4,args:_0x17d03c,tdx:_0x2b07b3}=_0x2918b7,_0x1b104d=_0x2c50f4,_0x6cb58b=_0x17d03c[0x0],_0x36486a=(_0x1b104d[_0xb27b3f(0xcd)]||'GET')[_0xb27b3f(0xd3)](),_0x2f4e10=_0x1b104d[_0xb27b3f(0xe6)],_0x1324d7=_0x1b104d[_0xb27b3f(0xef)],_0x280320=_0x1b104d[_0xb27b3f(0xdd)],_0x21cc61=_0x1b104d['type']||'td';try{const _0x3bdd0e={};if(_0x280320){const _0x3f533a=Array[_0xb27b3f(0xcb)](_0x280320)?_0x280320:[_0x280320];for(const _0x119666 of _0x3f533a){const [_0x591a7c,_0x3d74d6]=parseHeader(_0x119666);_0x3bdd0e[_0x591a7c]=_0x3d74d6;}}let _0x452c30;if(_0x2f4e10)_0x452c30=_0x2f4e10;else{if(_0x1324d7)try{_0x452c30=RawAPI['readBodyFromFile'](_0x1324d7);}catch(_0x103eeb){return console[_0xb27b3f(0xd1)](_0xb27b3f(0xe9)+(_0x103eeb instanceof Error?_0x103eeb[_0xb27b3f(0xd8)]:String(_0x103eeb))),0x1;}}const _0x13e6b6={'method':_0x36486a,'apiType':_0x21cc61,'includeHeaders':_0x2c50f4['verbose']};_0x452c30&&(_0x13e6b6[_0xb27b3f(0xe5)]=_0x452c30);Object[_0xb27b3f(0xed)](_0x3bdd0e)[_0xb27b3f(0xdf)]>0x0&&(_0x13e6b6[_0xb27b3f(0xd4)]=_0x3bdd0e);if(_0x2c50f4['verbose']){const _0x37aa55=resolveSite(_0x2c50f4[_0xb27b3f(0xbb)]??_0xb27b3f(0xe8)),_0x5cd6d1=getEndpoint(_0x37aa55,_0x21cc61),_0xb42a16=''+_0x5cd6d1+_0x6cb58b;console[_0xb27b3f(0xd1)]('>\x20'+_0x36486a+'\x20'+_0xb42a16);const _0x54ccea=getAuthHeaders(_0x37aa55),_0x27d012={..._0x54ccea,..._0x3bdd0e};for(const [_0x44a49e,_0x1099c4]of Object[_0xb27b3f(0xc9)](_0x27d012)){!isSensitiveHeader(_0x44a49e)&&console[_0xb27b3f(0xd1)]('>\x20'+_0x44a49e+':\x20'+_0x1099c4);}_0x452c30&&console[_0xb27b3f(0xd1)]('>'),console['error']('');}const _0x28c69e=await _0x2b07b3[_0xb27b3f(0xf4)][_0xb27b3f(0xe4)](_0x6cb58b,_0x13e6b6);if(_0x2c50f4[_0xb27b3f(0xcf)]&&_0x28c69e[_0xb27b3f(0xd4)]){console[_0xb27b3f(0xd1)](_0xb27b3f(0xc0)+_0x28c69e[_0xb27b3f(0xc8)]);for(const [_0x5385fd,_0x514bc0]of Object['entries'](_0x28c69e[_0xb27b3f(0xd4)])){!isSensitiveHeader(_0x5385fd)&&console[_0xb27b3f(0xd1)]('<\x20'+_0x5385fd+':\x20'+_0x514bc0);}console[_0xb27b3f(0xd1)]('');}const _0x336dcf=Boolean(_0x2c50f4[_0xb27b3f(0xeb)]),_0x51627={'color':_0x2c50f4[_0xb27b3f(0xf3)],'noColor':_0x2c50f4['noColor']||_0x336dcf&&!_0x2c50f4[_0xb27b3f(0xf3)]},_0x1ccb2a=colorizeJSON(_0x28c69e[_0xb27b3f(0xe6)],_0x51627);return _0x2c50f4[_0xb27b3f(0xeb)]?(writeFileSync(_0x2c50f4[_0xb27b3f(0xeb)],_0x1ccb2a),console[_0xb27b3f(0xd1)]('Results\x20saved\x20to\x20'+_0x2c50f4['output'])):console[_0xb27b3f(0xda)](_0x1ccb2a),0x0;}catch(_0xd16613){return _0xd16613 instanceof Error?(console['error'](_0xb27b3f(0xe9)+_0xd16613[_0xb27b3f(0xd8)]),_0x2c50f4[_0xb27b3f(0xcf)]&&_0xd16613['stack']&&console[_0xb27b3f(0xd1)](_0xb27b3f(0xc7)+_0xd16613['stack'])):console[_0xb27b3f(0xd1)](_0xb27b3f(0xe9)+String(_0xd16613)),0x1;}}}
1
+ const a6_0x28267b=a6_0xeb4d;(function(_0x221944,_0x537e5c){const _0x1d9659=a6_0xeb4d,_0x14f78c=_0x221944();while(!![]){try{const _0xc15141=-parseInt(_0x1d9659(0x1d6))/0x1*(parseInt(_0x1d9659(0x200))/0x2)+-parseInt(_0x1d9659(0x1d9))/0x3*(parseInt(_0x1d9659(0x1ca))/0x4)+parseInt(_0x1d9659(0x20a))/0x5*(parseInt(_0x1d9659(0x1cf))/0x6)+-parseInt(_0x1d9659(0x1f4))/0x7+parseInt(_0x1d9659(0x1c3))/0x8*(-parseInt(_0x1d9659(0x1f8))/0x9)+parseInt(_0x1d9659(0x1f0))/0xa*(-parseInt(_0x1d9659(0x1db))/0xb)+parseInt(_0x1d9659(0x1cc))/0xc;if(_0xc15141===_0x537e5c)break;else _0x14f78c['push'](_0x14f78c['shift']());}catch(_0x361981){_0x14f78c['push'](_0x14f78c['shift']());}}}(a6_0x77cc,0x357ba));function a6_0xeb4d(_0xdac4fd,_0x28645d){_0xdac4fd=_0xdac4fd-0x1c3;const _0x77cc5d=a6_0x77cc();let _0xeb4de0=_0x77cc5d[_0xdac4fd];return _0xeb4de0;}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';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x28267b(0x1e0),a6_0x28267b(0x1e4),a6_0x28267b(0x1f5),'set-cookie','set-cookie2',a6_0x28267b(0x1f7),'x-auth-token',a6_0x28267b(0x1d2)]);function isSensitiveHeader(_0x2c5856){const _0x5bdea1=a6_0x28267b;return SENSITIVE_HEADERS['has'](_0x2c5856[_0x5bdea1(0x1e8)]());}function parseHeader(_0x202414){const _0x5d360f=a6_0x28267b,_0x25b43a=_0x202414[_0x5d360f(0x1dc)](':');if(_0x25b43a===-0x1)throw new Error(_0x5d360f(0x1c8)+_0x202414+_0x5d360f(0x1d4)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x494c70=_0x202414[_0x5d360f(0x1f9)](0x0,_0x25b43a)[_0x5d360f(0x1ea)](),_0x5638ad=_0x202414['substring'](_0x25b43a+0x1)[_0x5d360f(0x1ea)]();if(!_0x494c70)throw new Error(_0x5d360f(0x1d3)+_0x202414+'\x22');return[_0x494c70,_0x5638ad];}export class ApiCommand extends BaseCommand{[a6_0x28267b(0x205)]=a6_0x28267b(0x203);[a6_0x28267b(0x1d0)]=a6_0x28267b(0x1e6);[a6_0x28267b(0x1ed)](_0x54c8ed){const _0x506c88=a6_0x28267b,{args:_0x1fe732,options:_0x11d41c}=_0x54c8ed,_0x9be196=_0x11d41c;if(_0x1fe732['length']===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x363d46=_0x1fe732[0x0];if(!_0x363d46['startsWith']('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x363d46;const _0x5d63ff=_0x9be196['data'],_0x29f59c=_0x9be196[_0x506c88(0x1de)];if(_0x5d63ff&&_0x29f59c)return _0x506c88(0x1e3);const _0x4c32bf=_0x9be196[_0x506c88(0x1f1)]||_0x506c88(0x1e1),_0xb94286=[_0x506c88(0x1e1),'POST',_0x506c88(0x1e9),'DELETE',_0x506c88(0x201)];if(!_0xb94286[_0x506c88(0x1e7)](_0x4c32bf['toUpperCase']()))return _0x506c88(0x1e2)+_0x4c32bf+_0x506c88(0x1eb)+_0xb94286[_0x506c88(0x1cb)](',\x20');const _0x3e566b=_0x9be196[_0x506c88(0x206)]||'td',_0x1bc3b7=['td',_0x506c88(0x1ec),_0x506c88(0x1ee),_0x506c88(0x1fc),_0x506c88(0x1fa),_0x506c88(0x1df),'cas'];if(!_0x1bc3b7[_0x506c88(0x1e7)](_0x3e566b))return _0x506c88(0x1c9)+_0x3e566b+_0x506c88(0x1c7)+_0x1bc3b7[_0x506c88(0x1cb)](',\x20');return undefined;}async[a6_0x28267b(0x207)](_0x3d60ec){const _0x378147=a6_0x28267b,{options:_0x1df3f3,args:_0x467100,tdx:_0x35ee08}=_0x3d60ec,_0x27c79a=_0x1df3f3,_0xf51a91=_0x467100[0x0],_0x4a2857=(_0x27c79a[_0x378147(0x1f1)]||_0x378147(0x1e1))[_0x378147(0x1f6)](),_0x31b7a7=_0x27c79a[_0x378147(0x1d7)],_0x50c5b1=_0x27c79a[_0x378147(0x1de)],_0x49bf0c=_0x27c79a[_0x378147(0x204)],_0x580aca=_0x27c79a['type']||'td';try{const _0x3b01ce={};if(_0x49bf0c){const _0x3319b3=Array[_0x378147(0x1ce)](_0x49bf0c)?_0x49bf0c:[_0x49bf0c];for(const _0x9ab822 of _0x3319b3){const [_0x334a55,_0x2a11f0]=parseHeader(_0x9ab822);_0x3b01ce[_0x334a55]=_0x2a11f0;}}let _0xaf8816;if(_0x31b7a7)_0xaf8816=_0x31b7a7;else{if(_0x50c5b1)try{_0xaf8816=RawAPI[_0x378147(0x1fd)](_0x50c5b1);}catch(_0x19c070){return console['error'](_0x378147(0x1da)+(_0x19c070 instanceof Error?_0x19c070[_0x378147(0x1f3)]:String(_0x19c070))),0x1;}}const _0x532942={'method':_0x4a2857,'apiType':_0x580aca,'includeHeaders':_0x1df3f3[_0x378147(0x1f2)]};_0xaf8816&&(_0x532942[_0x378147(0x1d8)]=_0xaf8816);Object[_0x378147(0x1dd)](_0x3b01ce)[_0x378147(0x1d5)]>0x0&&(_0x532942[_0x378147(0x209)]=_0x3b01ce);if(_0x1df3f3['verbose']){const _0x52d312=resolveSite(_0x1df3f3['site']??_0x378147(0x1fb)),_0x9536bc=getEndpoint(_0x52d312,_0x580aca),_0x9d978f=''+_0x9536bc+_0xf51a91;console[_0x378147(0x1c5)]('>\x20'+_0x4a2857+'\x20'+_0x9d978f);const _0x5ea8b2=getAuthHeaders(_0x52d312),_0x314637={..._0x5ea8b2,..._0x3b01ce};for(const [_0x3b430a,_0x3a1050]of Object['entries'](_0x314637)){!isSensitiveHeader(_0x3b430a)&&console[_0x378147(0x1c5)]('>\x20'+_0x3b430a+':\x20'+_0x3a1050);}_0xaf8816&&console[_0x378147(0x1c5)]('>'),console[_0x378147(0x1c5)]('');}const _0xddaa37=await _0x35ee08[_0x378147(0x203)][_0x378147(0x202)](_0xf51a91,_0x532942);if(_0x1df3f3[_0x378147(0x1f2)]&&_0xddaa37[_0x378147(0x209)]){console[_0x378147(0x1c5)]('<\x20HTTP/1.1\x20'+_0xddaa37[_0x378147(0x1ff)]);for(const [_0xbf1d5,_0x5aa252]of Object[_0x378147(0x1d1)](_0xddaa37[_0x378147(0x209)])){!isSensitiveHeader(_0xbf1d5)&&console[_0x378147(0x1c5)]('<\x20'+_0xbf1d5+':\x20'+_0x5aa252);}console['error']('');}const _0x4fbc70=Boolean(_0x1df3f3['output']),_0x627ee6={'color':_0x1df3f3[_0x378147(0x208)],'noColor':_0x1df3f3[_0x378147(0x1c4)]||_0x4fbc70&&!_0x1df3f3['color']},_0x1d5748=colorizeJSON(_0xddaa37[_0x378147(0x1d7)],_0x627ee6);return _0x1df3f3[_0x378147(0x1fe)]?(writeFileSync(_0x1df3f3[_0x378147(0x1fe)],_0x1d5748),console[_0x378147(0x1c5)](_0x378147(0x1ef)+_0x1df3f3[_0x378147(0x1fe)])):console[_0x378147(0x1cd)](_0x1d5748),0x0;}catch(_0x2d5d86){return _0x2d5d86 instanceof Error?(console['error'](_0x378147(0x1da)+_0x2d5d86[_0x378147(0x1f3)]),_0x1df3f3['verbose']&&_0x2d5d86['stack']&&console['error'](_0x378147(0x1c6)+_0x2d5d86[_0x378147(0x1e5)])):console[_0x378147(0x1c5)](_0x378147(0x1da)+String(_0x2d5d86)),0x1;}}}function a6_0x77cc(){const _0x323479=['stack','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','includes','toLowerCase','PUT','trim','.\x20Valid\x20methods:\x20','cdp','validate','workflow','Results\x20saved\x20to\x20','4330bzLAYN','method','verbose','message','485961VJnKrO','cookie','toUpperCase','x-xsrf-token','39843XHofKI','substring','llm','us01','trino','readBodyFromFile','output','status','20666mKAOrR','PATCH','request','api','header','name','type','execute','color','headers','873995ZUrFhF','632AGvCpt','noColor','error','\x0aStack\x20trace:\x0a','.\x20Valid\x20types:\x20','Invalid\x20header\x20format:\x20\x22','Invalid\x20API\x20type:\x20','683772shjkap','join','11819340twoyVW','log','isArray','6BekWAc','description','entries','x-trino-user','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','\x22.\x20','length','1gQqIOf','data','body','6AdFvyB','Error:\x20','4301DArYDq','indexOf','keys','file','llm-proxy','authorization','GET','Invalid\x20HTTP\x20method:\x20','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','proxy-authorization'];a6_0x77cc=function(){return _0x323479;};return a6_0x77cc();}
@@ -42,6 +42,15 @@ export declare class AuthStatusCommand extends BaseCommand {
42
42
  readonly description = "Show authentication status and validate API key";
43
43
  execute(context: CommandContext): Promise<number>;
44
44
  }
45
+ /**
46
+ * Print the current OAuth bearer token for command-based authentication.
47
+ * Usage: tdx auth token
48
+ */
49
+ export declare class AuthTokenCommand extends BaseCommand {
50
+ readonly name = "auth:token";
51
+ readonly description = "Print the current OAuth access token";
52
+ execute(context: CommandContext): Promise<number>;
53
+ }
45
54
  /**
46
55
  * Auth clear command - Remove API key from keychain
47
56
  * Usage: tdx auth clear [--profile <name>]
@@ -1 +1 @@
1
- {"version":3,"file":"auth-command.d.ts","sourceRoot":"","sources":["../../src/commands/auth-command.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAkB,MAAM,cAAc,CAAC;AAQhF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAenE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGlD,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,QAAQ,EACnB,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GACjC,OAAO,CAAC,IAAI,CAAC,CAiFf;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC,CAmB3E;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,gDAAgD;IAE9D,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAuHxD;AAED;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,QAAQ,CAAC,IAAI,UAAU;IACvB,QAAQ,CAAC,WAAW,qDAAqD;IAEnE,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAmDxD;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,yCAAyC;IAEvD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAgCxD"}
1
+ {"version":3,"file":"auth-command.d.ts","sourceRoot":"","sources":["../../src/commands/auth-command.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAkB,MAAM,cAAc,CAAC;AAShF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAenE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGlD,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,QAAQ,EACnB,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GACjC,OAAO,CAAC,IAAI,CAAC,CAiFf;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC,CAmB3E;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,gDAAgD;IAE9D,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAuHxD;AAED;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,QAAQ,CAAC,IAAI,UAAU;IACvB,QAAQ,CAAC,WAAW,qDAAqD;IAEnE,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAmDxD;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,0CAA0C;IAExD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAUxD;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,yCAAyC;IAEvD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAgCxD"}
@@ -1 +1 @@
1
- function a7_0x52e2(_0x478bcc,_0x4d49c1){_0x478bcc=_0x478bcc-0x10e;const _0x1d027d=a7_0x1d02();let _0x52e2eb=_0x1d027d[_0x478bcc];return _0x52e2eb;}const a7_0x424227=a7_0x52e2;(function(_0x172bb6,_0x2476b3){const _0x34dc9e=a7_0x52e2,_0x194404=_0x172bb6();while(!![]){try{const _0x184f3c=-parseInt(_0x34dc9e(0x14e))/0x1*(-parseInt(_0x34dc9e(0x13a))/0x2)+-parseInt(_0x34dc9e(0x14c))/0x3+-parseInt(_0x34dc9e(0x162))/0x4*(-parseInt(_0x34dc9e(0x12c))/0x5)+parseInt(_0x34dc9e(0x137))/0x6+-parseInt(_0x34dc9e(0x160))/0x7+-parseInt(_0x34dc9e(0x11f))/0x8*(parseInt(_0x34dc9e(0x120))/0x9)+parseInt(_0x34dc9e(0x16e))/0xa*(parseInt(_0x34dc9e(0x12a))/0xb);if(_0x184f3c===_0x2476b3)break;else _0x194404['push'](_0x194404['shift']());}catch(_0x35ff6c){_0x194404['push'](_0x194404['shift']());}}}(a7_0x1d02,0xb682c));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';function a7_0x1d02(){const _0x31cf07=['N/A','No\x20credential\x20found','/app/mp/ak','/users/initiate_sso\x20(account:\x20','\x20for\x20profile:\x20','✗\x20Validation\x20failed:\x20','OAuth\x20tokens','us01','Sign\x20in\x20with\x20browser\x20(recommended)','password','737828ohZFbV','Read\x20credential\x20from\x20keychain','8936lTahLp','✓\x20Authentication\x20successful\x0a','tdx\x20profile:\x20','\x20\x20(','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','trim','Enter\x20your\x20TD\x20API\x20key:','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','User:\x20','6412530HGXkhy','✓\x20Default\x20site\x20set\x20to\x20','logLevel','\x20\x20tdx','green','yellow','log','warn','all','System\x20keychain\x20is\x20not\x20available','ERROR','✓\x20Profile\x20\x27','\x20and\x20','auth:clear','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20--profile\x20','Read\x20credential\x20from\x20','access_token','auth','Opening\x20browser\x20for\x20authentication...','dim','6920704UtynpI','9vBnCEm','getUserInfo','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','join','oauth','red','account_id','status','Validating\x20API\x20key...','site','11NuAqjX','\x20removed\x20from\x20keychain','165PCKPsZ','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','create','last_name','Setup\x20cancelled','message','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','auth:setup','profile','\x27\x20registered','2484720jQHBHU','apiKey','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','6758tjAsYr','/oauth/authorize','Name:\x20','description','email','bold','Choose\x20how\x20to\x20sign\x20in:','jobs','accountName','filter','\x20(site:\x20','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','execute','tdx:\x20auth\x20clear','error','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','1882437kNorQv','No\x20credentials\x20found\x20in\x20keychain','360TkjuKU','\x20\x20user_id:','name','Setting\x20up\x20authentication\x20for\x20site:\x20','method','Use\x20an\x20API\x20key','\x20(profile:\x20','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...'];a7_0x1d02=function(){return _0x31cf07;};return a7_0x1d02();}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_0x3bce3d 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_0x2bad8e from'chalk';export async function runOAuthLoginFlow(_0x28ef67,_0xb2de42,_0x421119,_0x22b860){const _0x3b1918=a7_0x52e2,_0x4e439b=await isKeychainAvailable();if(!_0x4e439b)throw new Error(_0x3b1918(0x12d)+_0x3b1918(0x122));let _0x32f6ae=_0x22b860?.['accountName'];if(!_0x32f6ae){const _0x2d726a=await a7_0x3bce3d({'type':'text','name':_0x3b1918(0x142),'message':_0x3b1918(0x147)});if(_0x2d726a[_0x3b1918(0x142)]===undefined)throw new Error(_0x3b1918(0x130));_0x32f6ae=_0x2d726a[_0x3b1918(0x142)][_0x3b1918(0x169)]()||undefined;}const _0x757431=getConsoleUrl(_0x28ef67);console[_0x3b1918(0x110)](_0x3b1918(0x11d));_0x32f6ae?console['log']('\x20\x20'+_0x757431+_0x3b1918(0x159)+_0x32f6ae+')'):console[_0x3b1918(0x110)]('\x20\x20'+_0x757431+_0x3b1918(0x13b));console['log'](_0x3b1918(0x155));const _0x5c92af=loadGlobalProxy()||process.env.HTTPS_PROXY||process.env.HTTP_PROXY,_0xdf59a3=await startOAuthFlow(_0x28ef67,{'accountName':_0x32f6ae,'proxy':_0x5c92af});console[_0x3b1918(0x110)]('Validating\x20OAuth\x20tokens...');const _0x29ac5e=TDX[_0x3b1918(0x12e)]({'site':_0x28ef67,'accessToken':_0xdf59a3[_0x3b1918(0x11b)],'logLevel':_0x421119??LogLevel[_0x3b1918(0x114)]}),_0x4fc871=await _0x29ac5e[_0x3b1918(0x141)][_0x3b1918(0x121)]();console[_0x3b1918(0x110)](a7_0x2bad8e[_0x3b1918(0x10e)]('✓\x20Signed\x20in\x20successfully')),console['log']('\x20\x20'+a7_0x2bad8e['cyan'](_0x28ef67+':'+_0x4fc871[_0x3b1918(0x126)])+_0x3b1918(0x14f)+_0x4fc871['id']+_0x3b1918(0x165)+_0x4fc871[_0x3b1918(0x13e)]+')');!_0x32f6ae&&(console[_0x3b1918(0x110)](a7_0x2bad8e[_0x3b1918(0x11e)](_0x3b1918(0x16c))),console[_0x3b1918(0x110)](a7_0x2bad8e['dim'](_0x3b1918(0x139))),console[_0x3b1918(0x110)](a7_0x2bad8e[_0x3b1918(0x11e)](_0x3b1918(0x167))));await saveOAuthTokens(_0xdf59a3,_0xb2de42),console[_0x3b1918(0x110)](_0x3b1918(0x16b)+(_0xb2de42?_0x3b1918(0x154)+_0xb2de42+')':''));if(_0xb2de42){const _0x303cb8={'site':_0x28ef67};saveProfileToUserConfig(_0xb2de42,_0x303cb8),console[_0x3b1918(0x110)](_0x3b1918(0x115)+_0xb2de42+_0x3b1918(0x136));}else saveDefaultSiteToUserConfig(_0x28ef67),console[_0x3b1918(0x110)](_0x3b1918(0x16f)+_0x28ef67);const _0x319db9=_0xb2de42?_0x3b1918(0x119)+_0xb2de42:'';console['log'](),console['log'](_0x3b1918(0x168)),console['log']('\x20\x20tdx'+_0x319db9+_0x3b1918(0x118)),console[_0x3b1918(0x110)](_0x3b1918(0x171)+_0x319db9+_0x3b1918(0x14b));}export async function promptAuthMethod(){const _0x196288=a7_0x52e2,_0x3fba8a=await a7_0x3bce3d({'type':'select','name':_0x196288(0x152),'message':_0x196288(0x140),'choices':[{'title':_0x196288(0x15e),'description':'Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','value':_0x196288(0x124)},{'title':_0x196288(0x153),'description':'For\x20scripts\x20or\x20headless\x20servers','value':'apikey'}]});return _0x3fba8a[_0x196288(0x152)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x424227(0x150)]=a7_0x424227(0x134);[a7_0x424227(0x13d)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x424227(0x148)](_0x10b923){const _0x2aaa37=a7_0x424227,{options:_0x5bbad9}=_0x10b923,_0x169678=_0x5bbad9[_0x2aaa37(0x135)];console['log'](a7_0x2bad8e[_0x2aaa37(0x13f)]('tdx:\x20auth\x20setup'));const _0x34a173=_0x5bbad9['site']||_0x2aaa37(0x15d),_0x318f9d=await promptSiteSelection(_0x34a173,_0x169678,_0x2aaa37(0x130));if(!_0x318f9d)return 0x1;const _0x5ee56e=resolveSite(_0x318f9d),_0x13e45d=await promptAuthMethod();if(!_0x13e45d)return console[_0x2aaa37(0x110)]('\x0aSetup\x20cancelled'),0x1;if(_0x13e45d==='oauth'){const {accountName:_0x55bf8a}=_0x5bbad9;return await runOAuthLoginFlow(_0x5ee56e,_0x169678,_0x5bbad9[_0x2aaa37(0x170)]??LogLevel[_0x2aaa37(0x114)],{'accountName':_0x55bf8a}),0x0;}console[_0x2aaa37(0x110)](_0x2aaa37(0x151)+_0x5ee56e),console[_0x2aaa37(0x110)](_0x2aaa37(0x166)),console[_0x2aaa37(0x110)]('\x20\x20'+getConsoleUrl(_0x5ee56e,_0x2aaa37(0x158)));const _0x2c8617=await a7_0x3bce3d({'type':_0x2aaa37(0x15f),'name':_0x2aaa37(0x138),'message':_0x2aaa37(0x16a),'validate':_0x4c69fb=>{const _0x370eac=_0x2aaa37;if(!_0x4c69fb||!_0x4c69fb[_0x370eac(0x169)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x2c8617[_0x2aaa37(0x138)])return console[_0x2aaa37(0x110)]('\x0aSetup\x20cancelled'),0x1;const _0x331a10=_0x2c8617[_0x2aaa37(0x138)];console[_0x2aaa37(0x110)](_0x2aaa37(0x128));try{const _0x45ba75=TDX[_0x2aaa37(0x12e)]({'site':_0x5ee56e,'apiKey':_0x331a10[_0x2aaa37(0x169)](),'logLevel':_0x5bbad9[_0x2aaa37(0x170)]??LogLevel[_0x2aaa37(0x114)]}),_0x435c3d=await _0x45ba75['jobs'][_0x2aaa37(0x121)]();console[_0x2aaa37(0x110)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x435c3d['email']+')');const _0x23a1ca=await isKeychainAvailable();_0x23a1ca?(await saveAPIKeyAsync(_0x331a10[_0x2aaa37(0x169)](),_0x5ee56e,_0x169678),console[_0x2aaa37(0x110)](_0x2aaa37(0x133)+(_0x169678?_0x2aaa37(0x154)+_0x169678+')':''))):(console[_0x2aaa37(0x111)](a7_0x2bad8e['yellow'](_0x2aaa37(0x146))),console[_0x2aaa37(0x111)](a7_0x2bad8e[_0x2aaa37(0x10f)](_0x2aaa37(0x132))));if(_0x169678){const _0x3c8b68={'site':_0x5ee56e};saveProfileToUserConfig(_0x169678,_0x3c8b68),console[_0x2aaa37(0x110)](_0x2aaa37(0x115)+_0x169678+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x5ee56e),console[_0x2aaa37(0x110)](_0x2aaa37(0x16f)+_0x5ee56e);const _0x2c3e3d=_0x169678?_0x2aaa37(0x119)+_0x169678:'';return console[_0x2aaa37(0x110)](),console[_0x2aaa37(0x110)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x2aaa37(0x110)]('\x20\x20tdx'+_0x2c3e3d+_0x2aaa37(0x118)),console[_0x2aaa37(0x110)](_0x2aaa37(0x171)+_0x2c3e3d+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x216e62){if(_0x216e62 instanceof HTTPClientError&&_0x216e62[_0x2aaa37(0x127)]===0x191)return printAuthError(_0x216e62),0x1;return console[_0x2aaa37(0x14a)](a7_0x2bad8e['red'](_0x2aaa37(0x15b)+(_0x216e62 instanceof Error?_0x216e62[_0x2aaa37(0x131)]:String(_0x216e62)))),console['error'](_0x2aaa37(0x145)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x424227(0x11c);[a7_0x424227(0x13d)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x424227(0x148)](_0x2391e3){const _0x3ea004=a7_0x424227,{options:_0x3f677c,tdx:_0x1e88da}=_0x2391e3,_0x15e15e=_0x3f677c[_0x3ea004(0x129)],_0x2f1d97=_0x3f677c['profile'],_0x11a0fa=_0x2f1d97?_0x2f1d97:_0x3ea004(0x156);console[_0x3ea004(0x110)](_0x3ea004(0x164)+_0x11a0fa+_0x3ea004(0x144)+_0x15e15e+')');const _0x3b8e48=await getOAuthTokens(_0x2f1d97);if(_0x3b8e48)console[_0x3ea004(0x110)]('Credential\x20type:\x20OAuth'),console['log'](_0x3ea004(0x161)+(_0x2f1d97?_0x3ea004(0x154)+_0x2f1d97+')':''));else{const _0x1e9822=await resolveAPIKeyAsync(_0x15e15e,_0x2f1d97);if(_0x1e9822){const {source:_0x295469,isDeprecated:_0x49e38d}=_0x1e9822,_0xbfc5a5=_0x3ea004(0x11a)+_0x295469;console[_0x3ea004(0x110)](_0x49e38d?a7_0x2bad8e[_0x3ea004(0x10f)](_0xbfc5a5):_0xbfc5a5);}else console[_0x3ea004(0x110)](a7_0x2bad8e[_0x3ea004(0x10f)](_0x3ea004(0x157)));}try{const _0xcd1934=await _0x1e88da['jobs'][_0x3ea004(0x121)]();return console[_0x3ea004(0x110)](a7_0x2bad8e[_0x3ea004(0x10e)](_0x3ea004(0x163))),console[_0x3ea004(0x110)](_0x3ea004(0x16d)+_0xcd1934['email']),(_0xcd1934['first_name']||_0xcd1934['last_name'])&&console[_0x3ea004(0x110)](_0x3ea004(0x13c)+[_0xcd1934['first_name'],_0xcd1934[_0x3ea004(0x12f)]]['filter'](Boolean)[_0x3ea004(0x123)]('\x20')),0x0;}catch(_0x468e60){return _0x468e60 instanceof HTTPClientError&&_0x468e60['status']===0x191?printAuthError(_0x468e60,!![],_0x2f1d97):console[_0x3ea004(0x14a)](a7_0x2bad8e['red'](_0x3ea004(0x15b)+(_0x468e60 instanceof Error?_0x468e60[_0x3ea004(0x131)]:String(_0x468e60)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x424227(0x117);[a7_0x424227(0x13d)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async['execute'](_0x521920){const _0x1adc52=a7_0x424227,{options:_0x508ec4}=_0x521920,_0x198f9a=_0x508ec4['profile'];console['log'](a7_0x2bad8e['bold'](_0x1adc52(0x149)));const _0x2027b7=await isKeychainAvailable();if(!_0x2027b7)return console[_0x1adc52(0x14a)](a7_0x2bad8e[_0x1adc52(0x125)](_0x1adc52(0x113))),0x1;const [_0x17edf4,_0x43ac6b]=await Promise[_0x1adc52(0x112)]([deleteKeychainAPIKey(_0x198f9a),deleteOAuthTokens(_0x198f9a)]);if(_0x17edf4||_0x43ac6b){clearCredentialCache();const _0x4fc89f=[_0x17edf4&&'API\x20key',_0x43ac6b&&_0x1adc52(0x15c)][_0x1adc52(0x143)](Boolean)['join'](_0x1adc52(0x116));return console[_0x1adc52(0x110)]('✓\x20'+_0x4fc89f+_0x1adc52(0x12b)+(_0x198f9a?'\x20(profile:\x20'+_0x198f9a+')':'')),0x0;}else return console[_0x1adc52(0x110)](_0x1adc52(0x14d)+(_0x198f9a?_0x1adc52(0x15a)+_0x198f9a:'')),0x1;}}
1
+ function a7_0x1b6b(){const _0x11edb5=['\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','Sign\x20in\x20with\x20browser\x20(recommended)','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','\x27\x20registered','profile','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','apiKey','message','Setting\x20up\x20authentication\x20for\x20site:\x20','tdx:\x20auth\x20clear','2544230TvAkoP','logLevel','auth:setup','jobs','/app/mp/ak','\x20\x20tdx','us01','all','You\x20can\x20find\x20your\x20API\x20key\x20at:','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','✗\x20Validation\x20failed:\x20','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','getUserInfo','Name:\x20','cyan','yellow','29577eimzGC','red','No\x20credential\x20found','/users/initiate_sso\x20(account:\x20','\x20and\x20','Opening\x20browser\x20for\x20authentication...','\x20(profile:\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','\x20\x20user_id:','auth','✓\x20Profile\x20\x27','select','Use\x20an\x20API\x20key','bold','537345YGCAdj','Choose\x20how\x20to\x20sign\x20in:','auth:clear','error','For\x20scripts\x20or\x20headless\x20servers','Validating\x20API\x20key...','method','2996040Fazytf','Validating\x20OAuth\x20tokens...','User:\x20','Setup\x20cancelled','password','first_name','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','last_name','System\x20keychain\x20is\x20not\x20available','/oauth/authorize','Print\x20the\x20current\x20OAuth\x20access\x20token','No\x20credentials\x20found\x20in\x20keychain','email','Credential\x20type:\x20OAuth','API\x20key\x20cannot\x20be\x20empty','OAuth\x20tokens','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','\x20--profile\x20','oauth','name','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','execute','tdx:\x20auth\x20setup','2556631RAdVsk','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','filter','\x20(site:\x20','✓\x20Authentication\x20successful\x0a','accountName','status','Remove\x20API\x20key\x20from\x20system\x20keychain','join','apikey','1130GgKWdh','green','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','Read\x20credential\x20from\x20','\x0aSetup\x20cancelled','N/A','\x20for\x20profile:\x20','trim','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','ERROR','site','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','✓\x20Default\x20site\x20set\x20to\x20','1384524ETkisK','access_token','create','auth:token','API\x20key','✓\x20Signed\x20in\x20successfully','description','warn','\x20\x20(','log','1968VeRjKg','6cHkVNe'];a7_0x1b6b=function(){return _0x11edb5;};return a7_0x1b6b();}const a7_0x42bd4e=a7_0x4d33;(function(_0x12404f,_0x388b69){const _0x8620db=a7_0x4d33,_0xf8ff1b=_0x12404f();while(!![]){try{const _0x2227f9=-parseInt(_0x8620db(0x89))/0x1+parseInt(_0x8620db(0xc0))/0x2*(parseInt(_0x8620db(0x6c))/0x3)+-parseInt(_0x8620db(0xcd))/0x4+-parseInt(_0x8620db(0x79))/0x5*(parseInt(_0x8620db(0x6d))/0x6)+parseInt(_0x8620db(0xb6))/0x7+parseInt(_0x8620db(0x9e))/0x8+parseInt(_0x8620db(0x97))/0x9;if(_0x2227f9===_0x388b69)break;else _0xf8ff1b['push'](_0xf8ff1b['shift']());}catch(_0x192d96){_0xf8ff1b['push'](_0xf8ff1b['shift']());}}}(a7_0x1b6b,0x45b59));import{BaseCommand,printAuthError}from'./command.js';import{resolveOAuthAccessToken}from'../sdk/auth-token.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync,loadGlobalProxy}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x3d0940 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_0x9e0d82 from'chalk';export async function runOAuthLoginFlow(_0x41339c,_0x29f0da,_0x109c68,_0x2c9ba4){const _0x10bcfb=a7_0x4d33,_0x2cc274=await isKeychainAvailable();if(!_0x2cc274)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+_0x10bcfb(0x70));let _0xfe6955=_0x2c9ba4?.[_0x10bcfb(0xbb)];if(!_0xfe6955){const _0x18b18e=await a7_0x3d0940({'type':'text','name':'accountName','message':_0x10bcfb(0x71)});if(_0x18b18e['accountName']===undefined)throw new Error(_0x10bcfb(0xa1));_0xfe6955=_0x18b18e[_0x10bcfb(0xbb)][_0x10bcfb(0xc7)]()||undefined;}const _0x5542f2=getConsoleUrl(_0x41339c);console[_0x10bcfb(0x6b)](_0x10bcfb(0x8e));_0xfe6955?console[_0x10bcfb(0x6b)]('\x20\x20'+_0x5542f2+_0x10bcfb(0x8c)+_0xfe6955+')'):console[_0x10bcfb(0x6b)]('\x20\x20'+_0x5542f2+_0x10bcfb(0xa8));console['log'](_0x10bcfb(0xc2));const _0x2f1a67=loadGlobalProxy()||process.env.HTTPS_PROXY||process.env.HTTP_PROXY,_0x30ef48=await startOAuthFlow(_0x41339c,{'accountName':_0xfe6955,'proxy':_0x2f1a67});console[_0x10bcfb(0x6b)](_0x10bcfb(0x9f));const _0x4807bb=TDX[_0x10bcfb(0xcf)]({'site':_0x41339c,'accessToken':_0x30ef48[_0x10bcfb(0xce)],'logLevel':_0x109c68??LogLevel['ERROR']}),_0x6f4b94=await _0x4807bb[_0x10bcfb(0x7c)][_0x10bcfb(0x85)]();console[_0x10bcfb(0x6b)](a7_0x9e0d82[_0x10bcfb(0xc1)](_0x10bcfb(0x67))),console[_0x10bcfb(0x6b)]('\x20\x20'+a7_0x9e0d82[_0x10bcfb(0x87)](_0x41339c+':'+_0x6f4b94['account_id'])+_0x10bcfb(0x91)+_0x6f4b94['id']+_0x10bcfb(0x6a)+_0x6f4b94['email']+')');!_0xfe6955&&(console['log'](a7_0x9e0d82['dim'](_0x10bcfb(0x6e))),console[_0x10bcfb(0x6b)](a7_0x9e0d82['dim'](_0x10bcfb(0x74))),console[_0x10bcfb(0x6b)](a7_0x9e0d82['dim'](_0x10bcfb(0xaf))));await saveOAuthTokens(_0x30ef48,_0x29f0da),console[_0x10bcfb(0x6b)](_0x10bcfb(0xa5)+(_0x29f0da?_0x10bcfb(0x8f)+_0x29f0da+')':''));if(_0x29f0da){const _0x5c7266={'site':_0x41339c};saveProfileToUserConfig(_0x29f0da,_0x5c7266),console[_0x10bcfb(0x6b)](_0x10bcfb(0x93)+_0x29f0da+_0x10bcfb(0x72));}else saveDefaultSiteToUserConfig(_0x41339c),console['log'](_0x10bcfb(0xcc)+_0x41339c);const _0x5de05b=_0x29f0da?'\x20--profile\x20'+_0x29f0da:'';console[_0x10bcfb(0x6b)](),console[_0x10bcfb(0x6b)](_0x10bcfb(0x82)),console['log'](_0x10bcfb(0x7e)+_0x5de05b+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x10bcfb(0x6b)](_0x10bcfb(0x7e)+_0x5de05b+_0x10bcfb(0x90));}function a7_0x4d33(_0xf18cd4,_0x3f9975){_0xf18cd4=_0xf18cd4-0x66;const _0x1b6b09=a7_0x1b6b();let _0x4d334e=_0x1b6b09[_0xf18cd4];return _0x4d334e;}export async function promptAuthMethod(){const _0x391a10=a7_0x4d33,_0xeb5a92=await a7_0x3d0940({'type':_0x391a10(0x94),'name':_0x391a10(0x9d),'message':_0x391a10(0x98),'choices':[{'title':_0x391a10(0x6f),'description':_0x391a10(0xb7),'value':'oauth'},{'title':_0x391a10(0x95),'description':_0x391a10(0x9b),'value':_0x391a10(0xbf)}]});return _0xeb5a92[_0x391a10(0x9d)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x42bd4e(0xb2)]=a7_0x42bd4e(0x7b);[a7_0x42bd4e(0x68)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x42bd4e(0xb4)](_0x494e8d){const _0x48f354=a7_0x42bd4e,{options:_0xbf79ab}=_0x494e8d,_0x119e1d=_0xbf79ab[_0x48f354(0x73)];console[_0x48f354(0x6b)](a7_0x9e0d82['bold'](_0x48f354(0xb5)));const _0xee8aaa=_0xbf79ab[_0x48f354(0xca)]||_0x48f354(0x7f),_0x505a2b=await promptSiteSelection(_0xee8aaa,_0x119e1d,_0x48f354(0xa1));if(!_0x505a2b)return 0x1;const _0x1263ef=resolveSite(_0x505a2b),_0x2b3942=await promptAuthMethod();if(!_0x2b3942)return console['log'](_0x48f354(0xc4)),0x1;if(_0x2b3942===_0x48f354(0xb1)){const {accountName:_0x1aa189}=_0xbf79ab;return await runOAuthLoginFlow(_0x1263ef,_0x119e1d,_0xbf79ab[_0x48f354(0x7a)]??LogLevel[_0x48f354(0xc9)],{'accountName':_0x1aa189}),0x0;}console[_0x48f354(0x6b)](_0x48f354(0x77)+_0x1263ef),console['log'](_0x48f354(0x81)),console[_0x48f354(0x6b)]('\x20\x20'+getConsoleUrl(_0x1263ef,_0x48f354(0x7d)));const _0x52b6e9=await a7_0x3d0940({'type':_0x48f354(0xa2),'name':_0x48f354(0x75),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x5f3f06=>{const _0x152108=_0x48f354;if(!_0x5f3f06||!_0x5f3f06[_0x152108(0xc7)]())return _0x152108(0xad);return!![];}});if(!_0x52b6e9[_0x48f354(0x75)])return console[_0x48f354(0x6b)](_0x48f354(0xc4)),0x1;const _0x2903ba=_0x52b6e9[_0x48f354(0x75)];console['log'](_0x48f354(0x9c));try{const _0x2f8343=TDX[_0x48f354(0xcf)]({'site':_0x1263ef,'apiKey':_0x2903ba[_0x48f354(0xc7)](),'logLevel':_0xbf79ab[_0x48f354(0x7a)]??LogLevel[_0x48f354(0xc9)]}),_0x153fc6=await _0x2f8343['jobs'][_0x48f354(0x85)]();console[_0x48f354(0x6b)](_0x48f354(0xcb)+_0x153fc6[_0x48f354(0xab)]+')');const _0x2c9456=await isKeychainAvailable();_0x2c9456?(await saveAPIKeyAsync(_0x2903ba[_0x48f354(0xc7)](),_0x1263ef,_0x119e1d),console[_0x48f354(0x6b)](_0x48f354(0xc8)+(_0x119e1d?_0x48f354(0x8f)+_0x119e1d+')':''))):(console[_0x48f354(0x69)](a7_0x9e0d82['yellow']('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console['warn'](a7_0x9e0d82['yellow'](_0x48f354(0x84))));if(_0x119e1d){const _0xdd8811={'site':_0x1263ef};saveProfileToUserConfig(_0x119e1d,_0xdd8811),console[_0x48f354(0x6b)](_0x48f354(0x93)+_0x119e1d+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x1263ef),console['log'](_0x48f354(0xcc)+_0x1263ef);const _0x323ba8=_0x119e1d?_0x48f354(0xb0)+_0x119e1d:'';return console['log'](),console[_0x48f354(0x6b)](_0x48f354(0x82)),console[_0x48f354(0x6b)](_0x48f354(0x7e)+_0x323ba8+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x48f354(0x6b)](_0x48f354(0x7e)+_0x323ba8+_0x48f354(0x90)),0x0;}catch(_0x5a5c01){if(_0x5a5c01 instanceof HTTPClientError&&_0x5a5c01[_0x48f354(0xbc)]===0x191)return printAuthError(_0x5a5c01),0x1;return console[_0x48f354(0x9a)](a7_0x9e0d82[_0x48f354(0x8a)](_0x48f354(0x83)+(_0x5a5c01 instanceof Error?_0x5a5c01[_0x48f354(0x76)]:String(_0x5a5c01)))),console[_0x48f354(0x9a)](_0x48f354(0xb3)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x42bd4e(0xb2)]=a7_0x42bd4e(0x92);['description']=a7_0x42bd4e(0xa4);async['execute'](_0x2bbc3f){const _0x887826=a7_0x42bd4e,{options:_0x313548,tdx:_0x1f42a7}=_0x2bbc3f,_0x1b75d0=_0x313548[_0x887826(0xca)],_0x4eb0c4=_0x313548['profile'],_0x3136c5=_0x4eb0c4?_0x4eb0c4:_0x887826(0xc5);console[_0x887826(0x6b)]('tdx\x20profile:\x20'+_0x3136c5+_0x887826(0xb9)+_0x1b75d0+')');const _0x48903c=await getOAuthTokens(_0x4eb0c4);if(_0x48903c)console[_0x887826(0x6b)](_0x887826(0xac)),console[_0x887826(0x6b)]('Read\x20credential\x20from\x20keychain'+(_0x4eb0c4?_0x887826(0x8f)+_0x4eb0c4+')':''));else{const _0x302f74=await resolveAPIKeyAsync(_0x1b75d0,_0x4eb0c4);if(_0x302f74){const {source:_0x64e039,isDeprecated:_0x1047fa}=_0x302f74,_0x4022d9=_0x887826(0xc3)+_0x64e039;console[_0x887826(0x6b)](_0x1047fa?a7_0x9e0d82['yellow'](_0x4022d9):_0x4022d9);}else console[_0x887826(0x6b)](a7_0x9e0d82[_0x887826(0x88)](_0x887826(0x8b)));}try{const _0x3366ae=await _0x1f42a7[_0x887826(0x7c)][_0x887826(0x85)]();return console[_0x887826(0x6b)](a7_0x9e0d82['green'](_0x887826(0xba))),console[_0x887826(0x6b)](_0x887826(0xa0)+_0x3366ae['email']),(_0x3366ae[_0x887826(0xa3)]||_0x3366ae[_0x887826(0xa6)])&&console[_0x887826(0x6b)](_0x887826(0x86)+[_0x3366ae[_0x887826(0xa3)],_0x3366ae[_0x887826(0xa6)]][_0x887826(0xb8)](Boolean)[_0x887826(0xbe)]('\x20')),0x0;}catch(_0x152637){return _0x152637 instanceof HTTPClientError&&_0x152637[_0x887826(0xbc)]===0x191?printAuthError(_0x152637,!![],_0x4eb0c4):console[_0x887826(0x9a)](a7_0x9e0d82[_0x887826(0x8a)](_0x887826(0x83)+(_0x152637 instanceof Error?_0x152637['message']:String(_0x152637)))),0x1;}}}export class AuthTokenCommand extends BaseCommand{[a7_0x42bd4e(0xb2)]=a7_0x42bd4e(0xd0);['description']=a7_0x42bd4e(0xa9);async['execute'](_0x22af48){const _0x5dce7a=a7_0x42bd4e,{options:_0x2bb805}=_0x22af48,_0x3f793f=await resolveOAuthAccessToken({'site':resolveSite(_0x2bb805['site']||_0x5dce7a(0x7f)),'profile':_0x2bb805[_0x5dce7a(0x73)],'proxy':loadGlobalProxy()});return console['log'](_0x3f793f),0x0;}}export class AuthClearCommand extends BaseCommand{[a7_0x42bd4e(0xb2)]=a7_0x42bd4e(0x99);[a7_0x42bd4e(0x68)]=a7_0x42bd4e(0xbd);async[a7_0x42bd4e(0xb4)](_0x3f3900){const _0x36dd51=a7_0x42bd4e,{options:_0x53c158}=_0x3f3900,_0x35895a=_0x53c158[_0x36dd51(0x73)];console[_0x36dd51(0x6b)](a7_0x9e0d82[_0x36dd51(0x96)](_0x36dd51(0x78)));const _0x232d58=await isKeychainAvailable();if(!_0x232d58)return console[_0x36dd51(0x9a)](a7_0x9e0d82[_0x36dd51(0x8a)](_0x36dd51(0xa7))),0x1;const [_0xd4e1fc,_0x40271c]=await Promise[_0x36dd51(0x80)]([deleteKeychainAPIKey(_0x35895a),deleteOAuthTokens(_0x35895a)]);if(_0xd4e1fc||_0x40271c){clearCredentialCache();const _0x4b6b98=[_0xd4e1fc&&_0x36dd51(0x66),_0x40271c&&_0x36dd51(0xae)][_0x36dd51(0xb8)](Boolean)[_0x36dd51(0xbe)](_0x36dd51(0x8d));return console[_0x36dd51(0x6b)]('✓\x20'+_0x4b6b98+'\x20removed\x20from\x20keychain'+(_0x35895a?_0x36dd51(0x8f)+_0x35895a+')':'')),0x0;}else return console[_0x36dd51(0x6b)](_0x36dd51(0xaa)+(_0x35895a?_0x36dd51(0xc6)+_0x35895a:'')),0x1;}}