@treasuredata/tdx 2026.3.44 → 2026.3.46

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 (221) 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.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/cas-command.js +1 -1
  12. package/dist/commands/cas-segment-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/delivery-command.js +1 -1
  21. package/dist/commands/describe.js +1 -1
  22. package/dist/commands/engage-campaign-pull-command.js +1 -1
  23. package/dist/commands/engage-campaign-push-command.js +1 -1
  24. package/dist/commands/engage-campaign-validate-command.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/engage-template-pull-command.js +1 -1
  27. package/dist/commands/engage-template-push-command.js +1 -1
  28. package/dist/commands/engage-template-validate-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.js +1 -1
  31. package/dist/commands/journey-validate-command.js +1 -1
  32. package/dist/commands/llm-command.js +1 -1
  33. package/dist/commands/mcp-command.js +1 -1
  34. package/dist/commands/parent-segment-command.js +1 -1
  35. package/dist/commands/policy-command.js +1 -1
  36. package/dist/commands/profile-command.js +1 -1
  37. package/dist/commands/profiles-command.js +1 -1
  38. package/dist/commands/query-command.js +1 -1
  39. package/dist/commands/schedule-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/status-command.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/work-command.js +1 -1
  57. package/dist/commands/workflow-command.js +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/command-output.js +1 -1
  60. package/dist/core/config.js +1 -1
  61. package/dist/core/connection-cache.js +1 -1
  62. package/dist/core/constants.js +1 -1
  63. package/dist/core/credential-cache.js +1 -1
  64. package/dist/core/global-context.js +1 -1
  65. package/dist/core/keychain.js +1 -1
  66. package/dist/core/oauth-keychain.js +1 -1
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/tools/index.js +1 -1
  76. package/dist/mcp/tools/tdx-run.js +1 -1
  77. package/dist/mcp/tools/tdx-search.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  141. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  142. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  143. package/dist/sdk/segment/fields-display.js +1 -1
  144. package/dist/sdk/segment/file-discovery.js +1 -1
  145. package/dist/sdk/segment/journey-utils.js +1 -1
  146. package/dist/sdk/segment/journey-validator.js +1 -1
  147. package/dist/sdk/segment/journey-yaml.js +1 -1
  148. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  149. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  150. package/dist/sdk/segment/pull-workflow.js +1 -1
  151. package/dist/sdk/segment/push-recovery.js +1 -1
  152. package/dist/sdk/segment/push-workflow.js +1 -1
  153. package/dist/sdk/segment/resolution-context.js +1 -1
  154. package/dist/sdk/segment/segment-path-parser.js +1 -1
  155. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  156. package/dist/sdk/segment/segment-validator.js +1 -1
  157. package/dist/sdk/segment/target-resolution.js +1 -1
  158. package/dist/sdk/segment/tdx-config.js +1 -1
  159. package/dist/sdk/segment/types/activation-schema.js +1 -1
  160. package/dist/sdk/segment/types/journey-def.js +1 -1
  161. package/dist/sdk/segment/types/journey-schema.js +1 -1
  162. package/dist/sdk/segment/types/segment-def.js +1 -1
  163. package/dist/sdk/segment/types/segment-schema.js +1 -1
  164. package/dist/sdk/segment/validate-files.js +1 -1
  165. package/dist/sdk/segment/yaml-validator.js +1 -1
  166. package/dist/sdk/segment.js +1 -1
  167. package/dist/sdk/types/index.js +1 -1
  168. package/dist/sdk/types/progress.js +1 -1
  169. package/dist/sdk/types/workspace.js +1 -1
  170. package/dist/sdk/user.js +1 -1
  171. package/dist/sdk/util/format-detector.js +1 -1
  172. package/dist/sdk/util/formatters.js +1 -1
  173. package/dist/sdk/util/index.js +1 -1
  174. package/dist/sdk/util/paginate.js +1 -1
  175. package/dist/sdk/util/tree-formatter.js +1 -1
  176. package/dist/sdk/workflow/archive-validation.js +1 -1
  177. package/dist/sdk/workflow/clone-workflow.js +1 -1
  178. package/dist/sdk/workflow/index.js +1 -1
  179. package/dist/sdk/workflow/pull-workflow.js +1 -1
  180. package/dist/sdk/workflow/push-workflow.js +1 -1
  181. package/dist/sdk/workflow/tdx-config.js +1 -1
  182. package/dist/sdk/workflow/workflow-utils.js +1 -1
  183. package/dist/sdk/workspace/frontmatter.js +1 -1
  184. package/dist/sdk/workspace/git.js +1 -1
  185. package/dist/sdk/workspace/index.js +1 -1
  186. package/dist/sdk/workspace/templates.js +1 -1
  187. package/dist/sdk/workspace/weekly.js +1 -1
  188. package/dist/sdk/workspace/wikilinks.js +1 -1
  189. package/dist/test-utils/command-runner.js +1 -1
  190. package/dist/test-utils/factories.js +1 -1
  191. package/dist/test-utils/fixtures.js +1 -1
  192. package/dist/test-utils/http-mock.js +1 -1
  193. package/dist/test-utils/index.js +1 -1
  194. package/dist/utils/async.js +1 -1
  195. package/dist/utils/colors.js +1 -1
  196. package/dist/utils/diff.js +1 -1
  197. package/dist/utils/file-permissions.js +1 -1
  198. package/dist/utils/file-reader.js +1 -1
  199. package/dist/utils/github-releases.js +1 -1
  200. package/dist/utils/global-cache.js +1 -1
  201. package/dist/utils/json-loader.js +1 -1
  202. package/dist/utils/local-cache.js +1 -1
  203. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  204. package/dist/utils/logger/formatters/index.js +1 -1
  205. package/dist/utils/logger/handlers/console-handler.js +1 -1
  206. package/dist/utils/logger/handlers/file-handler.js +1 -1
  207. package/dist/utils/logger/handlers/index.js +1 -1
  208. package/dist/utils/logger/handlers/null-handler.js +1 -1
  209. package/dist/utils/logger/index.js +1 -1
  210. package/dist/utils/logger/logger.js +1 -1
  211. package/dist/utils/logger/types.js +1 -1
  212. package/dist/utils/option-validation.js +1 -1
  213. package/dist/utils/process.js +1 -1
  214. package/dist/utils/prompt.js +1 -1
  215. package/dist/utils/spinner.js +1 -1
  216. package/dist/utils/sse-parser.js +1 -1
  217. package/dist/utils/string-utils.js +1 -1
  218. package/dist/utils/table-ref-parser.js +1 -1
  219. package/dist/utils/tdx-logger.js +1 -1
  220. package/dist/utils/version-check.js +1 -1
  221. package/package.json +1 -1
@@ -1 +1 @@
1
- function a3_0x4022(_0xce824a,_0x1ba097){_0xce824a=_0xce824a-0x172;const _0x4db470=a3_0x4db4();let _0x4022c6=_0x4db470[_0xce824a];return _0x4022c6;}const a3_0x3c9ae8=a3_0x4022;(function(_0x519295,_0x337208){const _0x2b4c82=a3_0x4022,_0x21e631=_0x519295();while(!![]){try{const _0x58ded4=parseInt(_0x2b4c82(0x175))/0x1+parseInt(_0x2b4c82(0x18c))/0x2+-parseInt(_0x2b4c82(0x183))/0x3+parseInt(_0x2b4c82(0x191))/0x4+-parseInt(_0x2b4c82(0x17f))/0x5*(-parseInt(_0x2b4c82(0x172))/0x6)+-parseInt(_0x2b4c82(0x18d))/0x7*(-parseInt(_0x2b4c82(0x17e))/0x8)+-parseInt(_0x2b4c82(0x18f))/0x9;if(_0x58ded4===_0x337208)break;else _0x21e631['push'](_0x21e631['shift']());}catch(_0x123569){_0x21e631['push'](_0x21e631['shift']());}}}(a3_0x4db4,0xe3040));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a3_0x4db4(){const _0x407736=['resolveParentId','listActivations','description','12YEzswl','length','List\x20activations\x20for\x20a\x20segment','1605756ElWmny','Listing\x20activations\x20for\x20segment\x20\x27','resolveSegmentId','Child\x20name:\x20','\x20\x20Cause:\x20','Error:\x20','error','\x20activation','segment','56issZnm','4277160kisnVl','message','cause','Resolved\x20child\x20ID:\x20','3820557ndhSTW','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Error:\x20Segment\x20name\x20is\x20required','Resolving\x20child\x20segment\x20\x27','name','data','verbose','Resolved\x20parent\x20ID:\x20','Site:\x20','2364398YlsYTY','1040011fTnQyi','activations','30650670QeFwYw','\x27...','280700pQSHeG'];a3_0x4db4=function(){return _0x407736;};return a3_0x4db4();}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x3c9ae8(0x187)]=a3_0x3c9ae8(0x18e);[a3_0x3c9ae8(0x194)]=a3_0x3c9ae8(0x174);async['execute'](_0x16e364){const _0x56e822=a3_0x3c9ae8,{options:_0x4d960b,args:_0x40d180,tdx:_0x52fe54}=_0x16e364;if(_0x40d180[_0x56e822(0x173)]===0x0)return console[_0x56e822(0x17b)](_0x56e822(0x185)),console[_0x56e822(0x17b)](_0x56e822(0x184)),0x1;try{const {parentId:_0x529475,childId:_0x497c2d}=parseSegmentRef(_0x40d180[0x0]);if(!_0x497c2d)return console['error']('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console['error'](_0x56e822(0x184)),0x1;_0x4d960b[_0x56e822(0x189)]&&(console[_0x56e822(0x17b)](_0x56e822(0x18b)+_0x4d960b['site']),console[_0x56e822(0x17b)]('Parent\x20name:\x20'+_0x529475),console[_0x56e822(0x17b)](_0x56e822(0x178)+_0x497c2d));const _0x470a2b=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x529475+_0x56e822(0x190),()=>_0x52fe54[_0x56e822(0x17d)][_0x56e822(0x192)](_0x529475),{'verbose':_0x4d960b[_0x56e822(0x189)]}),_0x59344c=_0x470a2b[_0x56e822(0x188)];_0x4d960b[_0x56e822(0x189)]&&console['error'](_0x56e822(0x18a)+_0x59344c);const _0x3c550c=await withSpinner(_0x56e822(0x186)+_0x497c2d+_0x56e822(0x190),()=>_0x52fe54['segment'][_0x56e822(0x177)](_0x59344c,_0x497c2d),{'verbose':_0x4d960b['verbose']}),_0x33ac36=_0x3c550c['data'];_0x4d960b['verbose']&&console[_0x56e822(0x17b)](_0x56e822(0x182)+_0x33ac36);const _0x15319c=await withSpinner(_0x56e822(0x176)+_0x497c2d+_0x56e822(0x190),()=>_0x52fe54[_0x56e822(0x17d)][_0x56e822(0x193)](_0x59344c,_0x33ac36),{'verbose':_0x4d960b[_0x56e822(0x189)]}),_0x41de47=_0x15319c[_0x56e822(0x188)];return console[_0x56e822(0x17b)]('✔\x20Found\x20'+_0x41de47['length']+_0x56e822(0x17c)+(_0x41de47['length']!==0x1?'s':'')),await handleSDKOutput(_0x41de47,_0x4d960b),0x0;}catch(_0x3159cb){if(_0x3159cb instanceof SDKError)return console[_0x56e822(0x17b)](_0x56e822(0x17a)+_0x3159cb[_0x56e822(0x180)]),_0x3159cb[_0x56e822(0x181)]&&console['error'](_0x56e822(0x179)+_0x3159cb[_0x56e822(0x181)]),0x1;throw _0x3159cb;}}}
1
+ function a3_0x10e2(){const _0x48a2da=['length','1315323yEHfvd','274522ODfVRX','List\x20activations\x20for\x20a\x20segment','site','Error:\x20Segment\x20name\x20is\x20required','error','Site:\x20','Parent\x20name:\x20','segment','Resolved\x20child\x20ID:\x20','311997MyZswj','listActivations','Resolved\x20parent\x20ID:\x20','Resolving\x20child\x20segment\x20\x27','✔\x20Found\x20','name','verbose','22856571blZyrc','cause','Child\x20name:\x20','3161500lgqfPF','Resolving\x20parent\x20segment\x20\x27','10qKrEyf','execute','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','Error:\x20','\x27...','data','Listing\x20activations\x20for\x20segment\x20\x27','1514456zYElGj','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','110202dJgIbS','resolveSegmentId','28PiZAZT'];a3_0x10e2=function(){return _0x48a2da;};return a3_0x10e2();}function a3_0x4578(_0x5811b7,_0x53691a){_0x5811b7=_0x5811b7-0x6b;const _0x10e2dc=a3_0x10e2();let _0x45786c=_0x10e2dc[_0x5811b7];return _0x45786c;}const a3_0x2fb0fb=a3_0x4578;(function(_0x3ee9cf,_0x397290){const _0x170ee5=a3_0x4578,_0x106a05=_0x3ee9cf();while(!![]){try{const _0x4089da=-parseInt(_0x170ee5(0x85))/0x1+parseInt(_0x170ee5(0x7c))/0x2+-parseInt(_0x170ee5(0x7b))/0x3+-parseInt(_0x170ee5(0x6c))/0x4+parseInt(_0x170ee5(0x6e))/0x5*(parseInt(_0x170ee5(0x77))/0x6)+parseInt(_0x170ee5(0x79))/0x7*(-parseInt(_0x170ee5(0x75))/0x8)+parseInt(_0x170ee5(0x8c))/0x9;if(_0x4089da===_0x397290)break;else _0x106a05['push'](_0x106a05['shift']());}catch(_0x2f9d1){_0x106a05['push'](_0x106a05['shift']());}}}(a3_0x10e2,0x65755));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x2fb0fb(0x8a)]='activations';['description']=a3_0x2fb0fb(0x7d);async[a3_0x2fb0fb(0x6f)](_0xb7063){const _0xb37557=a3_0x2fb0fb,{options:_0x19ab48,args:_0x1d1a47,tdx:_0x90b691}=_0xb7063;if(_0x1d1a47['length']===0x0)return console[_0xb37557(0x80)](_0xb37557(0x7f)),console[_0xb37557(0x80)](_0xb37557(0x76)),0x1;try{const {parentId:_0x5e705f,childId:_0x4539cb}=parseSegmentRef(_0x1d1a47[0x0]);if(!_0x4539cb)return console[_0xb37557(0x80)](_0xb37557(0x70)),console['error'](_0xb37557(0x76)),0x1;_0x19ab48[_0xb37557(0x8b)]&&(console[_0xb37557(0x80)](_0xb37557(0x81)+_0x19ab48[_0xb37557(0x7e)]),console[_0xb37557(0x80)](_0xb37557(0x82)+_0x5e705f),console[_0xb37557(0x80)](_0xb37557(0x6b)+_0x4539cb));const _0x7157c4=await withSpinner(_0xb37557(0x6d)+_0x5e705f+'\x27...',()=>_0x90b691[_0xb37557(0x83)]['resolveParentId'](_0x5e705f),{'verbose':_0x19ab48[_0xb37557(0x8b)]}),_0x114191=_0x7157c4['data'];_0x19ab48[_0xb37557(0x8b)]&&console['error'](_0xb37557(0x87)+_0x114191);const _0x3cd401=await withSpinner(_0xb37557(0x88)+_0x4539cb+_0xb37557(0x72),()=>_0x90b691[_0xb37557(0x83)][_0xb37557(0x78)](_0x114191,_0x4539cb),{'verbose':_0x19ab48[_0xb37557(0x8b)]}),_0x7c51c2=_0x3cd401[_0xb37557(0x73)];_0x19ab48[_0xb37557(0x8b)]&&console['error'](_0xb37557(0x84)+_0x7c51c2);const _0x555a1e=await withSpinner(_0xb37557(0x74)+_0x4539cb+_0xb37557(0x72),()=>_0x90b691[_0xb37557(0x83)][_0xb37557(0x86)](_0x114191,_0x7c51c2),{'verbose':_0x19ab48[_0xb37557(0x8b)]}),_0x10879c=_0x555a1e[_0xb37557(0x73)];return console[_0xb37557(0x80)](_0xb37557(0x89)+_0x10879c[_0xb37557(0x7a)]+'\x20activation'+(_0x10879c['length']!==0x1?'s':'')),await handleSDKOutput(_0x10879c,_0x19ab48),0x0;}catch(_0x181066){if(_0x181066 instanceof SDKError)return console[_0xb37557(0x80)](_0xb37557(0x71)+_0x181066['message']),_0x181066[_0xb37557(0x8d)]&&console[_0xb37557(0x80)]('\x20\x20Cause:\x20'+_0x181066[_0xb37557(0x8d)]),0x1;throw _0x181066;}}}
@@ -1 +1 @@
1
- const a4_0x1398f9=a4_0x48f0;(function(_0x1a77b2,_0x371396){const _0x50cb30=a4_0x48f0,_0x489032=_0x1a77b2();while(!![]){try{const _0x4191a6=-parseInt(_0x50cb30(0x10c))/0x1*(-parseInt(_0x50cb30(0x126))/0x2)+parseInt(_0x50cb30(0x16d))/0x3*(-parseInt(_0x50cb30(0x134))/0x4)+-parseInt(_0x50cb30(0x11f))/0x5*(-parseInt(_0x50cb30(0x165))/0x6)+parseInt(_0x50cb30(0x17a))/0x7+parseInt(_0x50cb30(0x111))/0x8*(-parseInt(_0x50cb30(0x182))/0x9)+-parseInt(_0x50cb30(0x105))/0xa+parseInt(_0x50cb30(0x14a))/0xb;if(_0x4191a6===_0x371396)break;else _0x489032['push'](_0x489032['shift']());}catch(_0x4c3578){_0x489032['push'](_0x489032['shift']());}}}(a4_0x41b9,0xccf4d));import a4_0x49ca42 from'chalk';import a4_0x3b5cbc 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(_0x9c72ea){const _0x15164e=a4_0x48f0,_0xabb4ee=[];if(_0x9c72ea[_0x15164e(0x16a)]!==undefined)_0xabb4ee[_0x15164e(0xcf)](_0x9c72ea['total']+_0x15164e(0xf9));if(_0x9c72ea[_0x15164e(0x10f)]!==undefined&&_0x9c72ea['new']>0x0)_0xabb4ee[_0x15164e(0xcf)](a4_0x49ca42[_0x15164e(0xd6)](_0x9c72ea[_0x15164e(0x10f)]+_0x15164e(0xe5)));if(_0x9c72ea[_0x15164e(0x164)]!==undefined&&_0x9c72ea[_0x15164e(0x164)]>0x0)_0xabb4ee[_0x15164e(0xcf)](a4_0x49ca42[_0x15164e(0xd6)](_0x9c72ea[_0x15164e(0x164)]+'\x20created'));if(_0x9c72ea['updated']!==undefined&&_0x9c72ea[_0x15164e(0x157)]>0x0)_0xabb4ee[_0x15164e(0xcf)](a4_0x49ca42['yellow'](_0x9c72ea[_0x15164e(0x157)]+'\x20updated'));if(_0x9c72ea['unchanged']!==undefined&&_0x9c72ea['unchanged']>0x0)_0xabb4ee[_0x15164e(0xcf)](a4_0x49ca42['gray'](_0x9c72ea['unchanged']+_0x15164e(0x17d)));if(_0x9c72ea['errors']!==undefined&&_0x9c72ea[_0x15164e(0x16f)]>0x0)_0xabb4ee[_0x15164e(0xcf)](a4_0x49ca42[_0x15164e(0xd9)](_0x9c72ea[_0x15164e(0x16f)]+_0x15164e(0x10d)));return _0xabb4ee['join'](',\x20');}function displayDiffs(_0x109258,_0x43e1a1,_0x1202fa,_0x276459,_0x5a65f2,_0x27928d,_0x3bedef){const _0x4e519f=a4_0x48f0;for(const _0x4f1da3 of _0x109258){if(_0x4f1da3[_0x4e519f(0x102)]){const _0x2de0bd=_0x4f1da3[_0x4e519f(0x11b)]||_0x4f1da3['name'];console[_0x4e519f(0xdc)](_0x4e519f(0x16b)+_0x2de0bd+'\x27:'),console['log']('─'[_0x4e519f(0x106)](0x3c)),console[_0x4e519f(0xdc)](_0x4f1da3[_0x4e519f(0x102)]),console[_0x4e519f(0xdc)]('─'[_0x4e519f(0x106)](0x3c));}}for(const _0x179ebd of _0x43e1a1){_0x179ebd['diff']&&(console[_0x4e519f(0xdc)](_0x4e519f(0xd5)+_0x179ebd['name']+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x4e519f(0xdc)](_0x179ebd[_0x4e519f(0x102)]),console[_0x4e519f(0xdc)]('─'[_0x4e519f(0x106)](0x3c)));}for(const _0x21d356 of _0x1202fa){_0x21d356[_0x4e519f(0x102)]&&(console[_0x4e519f(0xdc)](_0x4e519f(0xf6)+_0x21d356['name']+'\x27:'),console[_0x4e519f(0xdc)]('─'[_0x4e519f(0x106)](0x3c)),console[_0x4e519f(0xdc)](_0x21d356['diff']),console[_0x4e519f(0xdc)]('─'[_0x4e519f(0x106)](0x3c)));}for(const _0x696303 of _0x276459){_0x696303['diff']&&(console[_0x4e519f(0xdc)](_0x4e519f(0x108)+_0x696303[_0x4e519f(0xe0)]+'\x27:'),console[_0x4e519f(0xdc)]('─'[_0x4e519f(0x106)](0x3c)),console[_0x4e519f(0xdc)](_0x696303[_0x4e519f(0x102)]),console['log']('─'[_0x4e519f(0x106)](0x3c)));}for(const _0x559736 of _0x5a65f2){_0x559736['diff']&&(console['log']('\x0aChanges\x20to\x20integration\x20\x27'+_0x559736[_0x4e519f(0xe0)]+'\x27:'),console[_0x4e519f(0xdc)]('─'['repeat'](0x3c)),console[_0x4e519f(0xdc)](_0x559736[_0x4e519f(0x102)]),console['log']('─'[_0x4e519f(0x106)](0x3c)));}for(const _0x4f1267 of _0x27928d){_0x4f1267[_0x4e519f(0x102)]&&(console[_0x4e519f(0xdc)](_0x4e519f(0x109)+_0x4f1267[_0x4e519f(0xe0)]+'\x27:'),console[_0x4e519f(0xdc)]('─'[_0x4e519f(0x106)](0x3c)),console[_0x4e519f(0xdc)](_0x4f1267['diff']),console[_0x4e519f(0xdc)]('─'[_0x4e519f(0x106)](0x3c)));}for(const _0x3903e3 of _0x3bedef){_0x3903e3[_0x4e519f(0x102)]&&(console['log'](_0x4e519f(0x139)+_0x3903e3[_0x4e519f(0xe0)]+'\x27:'),console[_0x4e519f(0xdc)]('─'[_0x4e519f(0x106)](0x3c)),console[_0x4e519f(0xdc)](_0x3903e3[_0x4e519f(0x102)]),console['log']('─'[_0x4e519f(0x106)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x1398f9(0xe0)]=a4_0x1398f9(0x116);[a4_0x1398f9(0x147)]=a4_0x1398f9(0xfa);async[a4_0x1398f9(0x115)](_0x48517b){const _0x477c76=a4_0x1398f9,{options:_0x58d654,args:_0xbb53a1,tdx:_0xb0615d}=_0x48517b,_0x216367=_0xbb53a1[0x0],_0x5841c6=_0xbb53a1[0x1],_0x3c320d=_0x58d654['output'],_0x1bacb9=_0x58d654['dryRun'],_0xec6260=_0x58d654['force'],_0x3af281=_0x58d654['yes'],_0x274b4c=_0x58d654[_0x477c76(0xf8)],_0x3fa5e5=_0x58d654[_0x477c76(0x119)];let _0x1a8584;if(_0x216367){const _0x54df6c=a4_0x3b5cbc[_0x477c76(0x10a)](_0x216367,_0x477c76(0x127));if(existsSync(_0x54df6c))try{const _0xa53820=JSON[_0x477c76(0x118)](readFileSync(_0x54df6c,'utf-8'));_0xa53820[_0x477c76(0x143)]&&(_0x1a8584={'llm_project':_0xa53820['llm_project']});}catch{}}const _0x2dca4e=findAgentConfigPath(process[_0x477c76(0xda)]());let _0x3338de;if(_0x2dca4e)try{const _0x488bfb=JSON[_0x477c76(0x118)](readFileSync(_0x2dca4e,_0x477c76(0x176)));_0x488bfb[_0x477c76(0x143)]&&(_0x3338de={'llm_project':_0x488bfb[_0x477c76(0x143)]});}catch{}const _0x23984f=resolveAgentPullArgs({'arg':_0x216367,'agentNameArg':_0x5841c6,'agentFlag':_0x3fa5e5,'contextProject':_0x274b4c,'argDirConfig':_0x1a8584,'cwdConfigPath':_0x2dca4e||undefined,'cwdConfig':_0x3338de}),{projectNameOrId:_0x56a2d9,targetAgentName:_0x33008c,existingOutputDir:_0x112e06,source:_0x177c14}=_0x23984f;if(_0x177c14===_0x477c76(0x15e))console[_0x477c76(0xdc)](a4_0x49ca42[_0x477c76(0x17c)](_0x477c76(0x181)+a4_0x3b5cbc[_0x477c76(0x10a)](_0x216367,_0x477c76(0x127))+':\x20'+_0x56a2d9));else{if(_0x177c14===_0x477c76(0x13c))console[_0x477c76(0xdc)](a4_0x49ca42[_0x477c76(0x17c)](_0x477c76(0x123)+_0x56a2d9));else _0x177c14===_0x477c76(0x183)&&console[_0x477c76(0xdc)](a4_0x49ca42[_0x477c76(0x17c)]('Using\x20project\x20from\x20context:\x20'+_0x56a2d9));}if(!_0x56a2d9)return _0x3fa5e5?(console[_0x477c76(0xdc)](a4_0x49ca42[_0x477c76(0xe8)](_0x477c76(0xef))),console[_0x477c76(0xdc)](_0x477c76(0x13d)),console[_0x477c76(0xdc)](_0x477c76(0x146))):(console[_0x477c76(0xdc)](a4_0x49ca42[_0x477c76(0xe8)](_0x477c76(0xce))),console[_0x477c76(0xdc)](_0x477c76(0x120)),console['log'](_0x477c76(0x10b)),console['log'](_0x477c76(0xd4)),console[_0x477c76(0xdc)](_0x477c76(0x188)),console['log'](_0x477c76(0x179))),0x1;if(_0x33008c){const {data:_0x58bda3}=await withSpinner('Pulling\x20agent\x20\x22'+_0x33008c+'\x22\x20from\x20project\x20\x22'+_0x56a2d9+'\x22...',()=>_0xb0615d[_0x477c76(0xcd)][_0x477c76(0x154)](_0x56a2d9,_0x33008c,_0x3c320d,{'dryRun':_0x1bacb9,'force':_0xec6260}));if(_0x1bacb9)return console[_0x477c76(0xdc)](a4_0x49ca42['yellow'](_0x477c76(0x15b))),console[_0x477c76(0xdc)](_0x477c76(0x12f)+_0x58bda3['agentName']),console[_0x477c76(0xdc)](_0x477c76(0x140)+_0x58bda3[_0x477c76(0x151)]),_0x58bda3[_0x477c76(0x102)]&&(console[_0x477c76(0xdc)](_0x477c76(0x159)),console['log']('─'[_0x477c76(0x106)](0x3c)),console[_0x477c76(0xdc)](_0x58bda3[_0x477c76(0x102)]),console[_0x477c76(0xdc)]('─'[_0x477c76(0x106)](0x3c))),0x0;return console[_0x477c76(0xdc)](a4_0x49ca42[_0x477c76(0xd6)](_0x477c76(0xf3))),console[_0x477c76(0xdc)](_0x477c76(0xfb)+_0x58bda3[_0x477c76(0x11b)]),console[_0x477c76(0xdc)]('Output:\x20'+_0x58bda3[_0x477c76(0x151)]),console[_0x477c76(0xdc)]('Status:\x20'+(_0x58bda3[_0x477c76(0x128)]?a4_0x49ca42[_0x477c76(0xd6)](_0x477c76(0x10f)):_0x58bda3[_0x477c76(0xdd)]?a4_0x49ca42['yellow']('updated'):a4_0x49ca42[_0x477c76(0xf4)](_0x477c76(0xd3)))),0x0;}const _0x493b69=_0x112e06||_0x3c320d,{data:_0x442f26}=await withSpinner(_0x477c76(0x113)+_0x56a2d9+_0x477c76(0xd1),()=>_0xb0615d[_0x477c76(0xcd)]['pullProject'](_0x56a2d9,_0x493b69,{'dryRun':!![]})),_0x2e7c26=_0x442f26[_0x477c76(0xd7)][_0x477c76(0x15d)][_0x477c76(0x10f)]+_0x442f26['counts'][_0x477c76(0x152)][_0x477c76(0x10f)]+_0x442f26[_0x477c76(0xd7)][_0x477c76(0xe6)]['new']+_0x442f26[_0x477c76(0xd7)][_0x477c76(0x153)][_0x477c76(0x10f)]+_0x442f26[_0x477c76(0xd7)][_0x477c76(0x160)][_0x477c76(0x10f)]+_0x442f26[_0x477c76(0xd7)]['experimentalKnowledgeBases']['new']+_0x442f26[_0x477c76(0xd7)]['experimentalArtifacts'][_0x477c76(0x10f)],_0x309218=_0x442f26[_0x477c76(0xd7)][_0x477c76(0x15d)][_0x477c76(0x157)]+_0x442f26[_0x477c76(0xd7)][_0x477c76(0x152)]['updated']+_0x442f26[_0x477c76(0xd7)][_0x477c76(0xe6)][_0x477c76(0x157)]+_0x442f26[_0x477c76(0xd7)][_0x477c76(0x153)][_0x477c76(0x157)]+_0x442f26[_0x477c76(0xd7)][_0x477c76(0x160)][_0x477c76(0x157)]+_0x442f26['counts'][_0x477c76(0x14c)][_0x477c76(0x157)]+_0x442f26['counts'][_0x477c76(0x13e)][_0x477c76(0x157)],_0x4be52a=_0x442f26[_0x477c76(0xd7)][_0x477c76(0x15d)]['unchanged']+_0x442f26['counts'][_0x477c76(0x152)][_0x477c76(0xd3)]+_0x442f26['counts'][_0x477c76(0xe6)][_0x477c76(0xd3)]+_0x442f26[_0x477c76(0xd7)][_0x477c76(0x153)][_0x477c76(0xd3)]+_0x442f26[_0x477c76(0xd7)][_0x477c76(0x160)]['unchanged']+_0x442f26[_0x477c76(0xd7)][_0x477c76(0x14c)]['unchanged']+_0x442f26[_0x477c76(0xd7)][_0x477c76(0x13e)][_0x477c76(0xd3)];console[_0x477c76(0xdc)](_0x477c76(0xf2)+_0x442f26[_0x477c76(0xf0)]+'\x27:'),console[_0x477c76(0xdc)]('\x20\x20'+a4_0x49ca42[_0x477c76(0xd6)]('+\x20'+_0x2e7c26+_0x477c76(0xe5))+_0x477c76(0x132)+a4_0x49ca42[_0x477c76(0xe8)]('~\x20'+_0x309218+_0x477c76(0x13a))+_0x477c76(0x132)+a4_0x49ca42[_0x477c76(0x17c)]('=\x20'+_0x4be52a+_0x477c76(0x17d))),console['log'](_0x477c76(0x149)+formatCountSummary(_0x442f26['counts'][_0x477c76(0x15d)])),console[_0x477c76(0xdc)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x442f26[_0x477c76(0xd7)]['knowledgeBases'])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x442f26['counts']['textKnowledgeBases'])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x442f26[_0x477c76(0xd7)][_0x477c76(0x153)])),console['log'](_0x477c76(0xd0)+formatCountSummary(_0x442f26[_0x477c76(0xd7)]['integrations']));const _0x2011fd=_0x442f26[_0x477c76(0xd7)]['experimentalKnowledgeBases'][_0x477c76(0x16a)]>0x0||_0x442f26['counts']['experimentalArtifacts'][_0x477c76(0x16a)]>0x0;_0x2011fd&&(console[_0x477c76(0xdc)](_0x477c76(0xd8)+formatCountSummary(_0x442f26[_0x477c76(0xd7)][_0x477c76(0x14c)])),console[_0x477c76(0xdc)](_0x477c76(0xde)+formatCountSummary(_0x442f26['counts']['experimentalArtifacts'])));console['log'](_0x477c76(0x12c)+a4_0x49ca42[_0x477c76(0x163)](_0x442f26[_0x477c76(0x12e)])),displayDiffs(_0x442f26[_0x477c76(0x15d)],_0x442f26[_0x477c76(0x152)],_0x442f26['textKnowledgeBases'],_0x442f26['prompts'],_0x442f26['integrations'],_0x442f26[_0x477c76(0x14c)],_0x442f26[_0x477c76(0x13e)]);if(_0x1bacb9)return console['log'](a4_0x49ca42['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x2e7c26===0x0&&_0x309218===0x0)return console[_0x477c76(0xdc)](a4_0x49ca42['green'](_0x477c76(0x155))),saveSessionContext({'llm_project':_0x442f26[_0x477c76(0xf0)]},_0x58d654[_0x477c76(0x168)]),console['log'](a4_0x49ca42['green']('✔\x20Context\x20set:\x20'+a4_0x49ca42[_0x477c76(0x17c)]('llm_project')+_0x477c76(0xd2)+a4_0x49ca42['cyan'](_0x442f26[_0x477c76(0xf0)]))),0x0;if(!_0x3af281&&!_0xec6260){if(!isInteractive())return console['error'](a4_0x49ca42[_0x477c76(0xd9)](_0x477c76(0x11e)),_0x477c76(0xdf)),console[_0x477c76(0x166)](a4_0x49ca42[_0x477c76(0x17c)](_0x477c76(0xe1))),0x1;const _0x3a9c1e=await confirmKey('\x0aWrite\x20'+(_0x2e7c26+_0x309218)+_0x477c76(0x14b));if(!_0x3a9c1e)return console[_0x477c76(0xdc)](a4_0x49ca42['yellow']('Cancelled'),_0x477c76(0x17f)),0x1;}const {data:_0x4c20be}=await withSpinner(_0x477c76(0xea),()=>_0xb0615d[_0x477c76(0xcd)][_0x477c76(0x10e)](_0x56a2d9,_0x493b69,{'force':_0xec6260}));return console[_0x477c76(0xdc)](a4_0x49ca42[_0x477c76(0xd6)](_0x477c76(0xfd)+(_0x2e7c26+_0x309218)+_0x477c76(0x177)+_0x4c20be[_0x477c76(0x12e)])),saveSessionContext({'llm_project':_0x4c20be[_0x477c76(0xf0)]},_0x58d654[_0x477c76(0x168)]),console[_0x477c76(0xdc)](a4_0x49ca42[_0x477c76(0xd6)](_0x477c76(0x16e)+a4_0x49ca42['dim'](_0x477c76(0x143))+_0x477c76(0xd2)+a4_0x49ca42[_0x477c76(0x163)](_0x4c20be[_0x477c76(0xf0)]))),0x0;}}function a4_0x41b9(){const _0x4e538f=['Using\x20project:\x20','found','dryRun','166OpJwGz','tdx.json','isNew','\x22\x20to\x20\x22','no_context','agent:push','\x20\x20Target:\x20','\x0aProject\x20pushed\x20with\x20errors','outputDir','Would\x20pull\x20agent:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','Dry\x20run\x20-\x20no\x20changes\x20made','\x20|\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','2944372FOnKXr','pushProject','projectId','Analyzing\x20changes\x20to\x20push...','source','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20changed','\x20\x20Integration\x20\x22','cwd-config','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','experimentalArtifacts','\x20\x20Agent\x20\x22','Output\x20path:\x20','Cancelled','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','llm_project','newProjectName','\x20\x20Knowledge\x20Base\x20\x22','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','description','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20\x20Agents:\x20','12763421dTtOFd','\x20files?','experimentalKnowledgeBases','Project\x20cloned\x20with\x20errors','Project\x20cloned\x20successfully','agentId','Would\x20clone:','outputPath','knowledgeBases','prompts','pullAgent','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','agent.yml','updated','Failed\x20to\x20push\x20agent:\x20','\x0aChanges:','\x20--profile\x20','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','agents','arg-dir','yes','integrations','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x0aPush\x20summary\x20for\x20\x27','cyan','created','514014mSRvvL','error','Would\x20push\x20agent:\x20','session','Using\x20local\x20project:\x20','total','\x0aChanges\x20to\x20agent\x20\x27','dirname','6WFnnhB','✔\x20Context\x20set:\x20','errors','\x0a✔\x20Pushed\x20','\x20\x20Source:\x20','\x20\x20Prompts:\x20','no_local_folder','\x22\x20to\x20a\x20different\x20profile','\x0aErrors\x20found:','utf-8','\x20files\x20to\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\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','2085251RHAWvN','Agent\x20','dim','\x20unchanged','No\x20tdx.json\x20found\x20in\x20','-\x20no\x20files\x20written','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Using\x20project\x20from\x20','1700577VkPBfK','context','<new-name>','newProjectId','reason','\x0aPush\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','sourceProjectName','Pushing\x20agent\x20from\x20\x22','llm','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','push','\x20\x20Integrations:\x20','\x22...','\x20=\x20','unchanged','\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','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','green','counts','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','red','cwd','agent:clone','log','hasChanges','\x20\x20Experimental\x20Artifacts:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','name','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','action','\x20\x20tdx\x20agent\x20pull\x20','INVALID_ARGUMENT','\x20new','textKnowledgeBases','MISSING_ARGUMENT','yellow','Using\x20context\x20project:\x20','Writing\x20files...','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Using\x20current\x20project:\x20','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','cloneProject','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','projectName','Source:\x20','\x0aPull\x20summary\x20for\x20\x27','Agent\x20pulled\x20successfully','gray','New\x20project:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x22:\x20','llmProject','\x20total','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','Agent:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x0a✔\x20Pulled\x20','Pushing\x20to\x20project...','\x20\x20Experimental\x20Artifact\x20\x22','pushAgent','-\x20nothing\x20pushed','diff','\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\x20Prompt\x20\x22','8906240GKPXbb','repeat','projectDir','\x0aChanges\x20to\x20prompt\x20\x27','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','join','\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','13605xplerI','\x20errors','pullProject','new','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','32YpQyCK','Errors:','Analyzing\x20project\x20\x22','\x20successfully','execute','agent:pull','Project:\x20','parse','agent','\x27\x20to\x20create\x20the\x20folder\x20structure.','agentName','\x20resources?','site','\x0aError:','80rdOHAq','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\x20Knowledge\x20Bases:\x20','profile'];a4_0x41b9=function(){return _0x4e538f;};return a4_0x41b9();}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x1398f9(0xdb);['description']=a4_0x1398f9(0x110);async[a4_0x1398f9(0x115)](_0x4b1ef8){const _0x4eca6a=a4_0x1398f9,{options:_0x484367,args:_0x56c11d,tdx:_0x2a60cd}=_0x4b1ef8,_0x3ad84b=_0x56c11d[0x0],_0x7bcfae=_0x484367[_0x4eca6a(0xe0)],_0x2000f2=_0x484367[_0x4eca6a(0x125)],_0x6e77a8=_0x484367['yes'],_0x35a7eb=_0x484367[_0x4eca6a(0x11d)],_0x515087=_0x484367['llmProject'];let _0x37a3f1;const _0x46aa77=findAgentConfigPath(process[_0x4eca6a(0xda)]());if(_0x3ad84b){const _0x539bf7=a4_0x3b5cbc[_0x4eca6a(0x10a)](_0x3ad84b,_0x4eca6a(0x127));existsSync(_0x539bf7)?(_0x37a3f1=_0x3ad84b,console[_0x4eca6a(0xdc)](a4_0x49ca42[_0x4eca6a(0x17c)](_0x4eca6a(0x169)+_0x3ad84b))):_0x37a3f1=_0x3ad84b;}else{if(_0x46aa77)_0x37a3f1=a4_0x3b5cbc[_0x4eca6a(0x16c)](_0x46aa77),console[_0x4eca6a(0xdc)](a4_0x49ca42[_0x4eca6a(0x17c)](_0x4eca6a(0xec)+_0x37a3f1));else{if(_0x515087){const _0x22adef=sanitizeForFilesystem(_0x515087);let _0x1cca2b=_0x22adef,_0x264515=a4_0x3b5cbc[_0x4eca6a(0x10a)](process[_0x4eca6a(0xda)](),_0x4eca6a(0x15d),_0x22adef,'tdx.json');if(!existsSync(_0x264515)){const _0x52e178=normalizeName(_0x515087),_0x4fe0f0=a4_0x3b5cbc['join'](process[_0x4eca6a(0xda)](),'agents',_0x52e178,'tdx.json');existsSync(_0x4fe0f0)&&(_0x1cca2b=_0x52e178,_0x264515=_0x4fe0f0);}if(existsSync(_0x264515))_0x37a3f1=a4_0x3b5cbc[_0x4eca6a(0x16c)](_0x264515),console[_0x4eca6a(0xdc)](a4_0x49ca42[_0x4eca6a(0x17c)](_0x4eca6a(0x169)+_0x37a3f1));else{const _0x567bde=_0x484367[_0x4eca6a(0x122)];if(_0x567bde)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4eca6a(0x133)+_0x515087+_0x4eca6a(0x174),undefined,{'helpText':_0x4eca6a(0xfc)+_0x4eca6a(0x178)+(_0x4eca6a(0xe3)+_0x515087+'\x0a')+(_0x4eca6a(0x130)+_0x1cca2b+'\x20--name\x20'+(_0x7bcfae||_0x4eca6a(0x184))+_0x4eca6a(0x15a)+_0x567bde)});_0x37a3f1=_0x515087,console[_0x4eca6a(0xdc)](a4_0x49ca42['dim'](_0x4eca6a(0xe9)+_0x515087));}}}}if(!_0x37a3f1)return console[_0x4eca6a(0xdc)](a4_0x49ca42[_0x4eca6a(0xe8)](_0x4eca6a(0xed))),console['log'](_0x4eca6a(0x161)),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x4eca6a(0xdc)](_0x4eca6a(0x103)),console[_0x4eca6a(0xdc)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x7bcfae)throw new SDKError(ErrorCode[_0x4eca6a(0xe7)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x6e77a8&&!_0x2000f2){if(!isInteractive())return console[_0x4eca6a(0x166)](a4_0x49ca42[_0x4eca6a(0xd9)]('\x0aError:'),_0x4eca6a(0xdf)),console['error'](a4_0x49ca42[_0x4eca6a(0x17c)](_0x4eca6a(0xe1))),0x1;const _0x341c7d=await confirmKey('Clone\x20\x22'+_0x37a3f1+'\x22\x20to\x20new\x20project\x20\x22'+_0x7bcfae+'\x22?');if(!_0x341c7d)return console[_0x4eca6a(0xdc)](a4_0x49ca42['yellow']('Cancelled')),0x1;}const {data:_0xe7329b}=await withSpinner('Cloning\x20\x22'+_0x37a3f1+_0x4eca6a(0x129)+_0x7bcfae+_0x4eca6a(0xd1),()=>_0x2a60cd[_0x4eca6a(0xcd)][_0x4eca6a(0xee)](_0x37a3f1,_0x7bcfae,{'dryRun':_0x2000f2}));if(_0x2000f2){console[_0x4eca6a(0xdc)](a4_0x49ca42['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x4eca6a(0xdc)](_0x4eca6a(0xf1)+_0xe7329b['sourceProjectName']),console[_0x4eca6a(0xdc)](_0x4eca6a(0xf5)+_0x7bcfae),console[_0x4eca6a(0xdc)](_0x4eca6a(0x150)),console[_0x4eca6a(0xdc)]('\x20\x20Agents:\x20'+_0xe7329b[_0x4eca6a(0xd7)]['agents'][_0x4eca6a(0x164)]),console[_0x4eca6a(0xdc)]('\x20\x20Knowledge\x20Bases:\x20'+_0xe7329b[_0x4eca6a(0xd7)][_0x4eca6a(0x152)][_0x4eca6a(0x164)]),console[_0x4eca6a(0xdc)]('\x20\x20Prompts:\x20'+_0xe7329b['counts'][_0x4eca6a(0x153)][_0x4eca6a(0x164)]);const _0x4725fa=_0xe7329b[_0x4eca6a(0xd7)][_0x4eca6a(0x14c)][_0x4eca6a(0x164)]>0x0||_0xe7329b[_0x4eca6a(0xd7)][_0x4eca6a(0x13e)][_0x4eca6a(0x164)]>0x0;return _0x4725fa&&(console[_0x4eca6a(0xdc)](_0x4eca6a(0xd8)+_0xe7329b[_0x4eca6a(0xd7)][_0x4eca6a(0x14c)][_0x4eca6a(0x164)]),console[_0x4eca6a(0xdc)](_0x4eca6a(0xde)+_0xe7329b['counts'][_0x4eca6a(0x13e)][_0x4eca6a(0x164)])),0x0;}const _0x583d54=_0xe7329b[_0x4eca6a(0xd7)][_0x4eca6a(0x15d)]['errors']>0x0||_0xe7329b[_0x4eca6a(0xd7)][_0x4eca6a(0x152)]['errors']>0x0||_0xe7329b[_0x4eca6a(0xd7)][_0x4eca6a(0x153)][_0x4eca6a(0x16f)]>0x0||_0xe7329b[_0x4eca6a(0xd7)][_0x4eca6a(0x14c)][_0x4eca6a(0x16f)]>0x0||_0xe7329b[_0x4eca6a(0xd7)][_0x4eca6a(0x13e)]['errors']>0x0;_0x583d54?console[_0x4eca6a(0xdc)](a4_0x49ca42[_0x4eca6a(0xe8)](_0x4eca6a(0x14d))):console[_0x4eca6a(0xdc)](a4_0x49ca42['green'](_0x4eca6a(0x14e)));console[_0x4eca6a(0xdc)](_0x4eca6a(0xf1)+_0xe7329b[_0x4eca6a(0xcb)]),console[_0x4eca6a(0xdc)](_0x4eca6a(0xf5)+_0xe7329b[_0x4eca6a(0x144)]),console[_0x4eca6a(0xdc)]('New\x20project\x20ID:\x20'+_0xe7329b[_0x4eca6a(0x185)]),console[_0x4eca6a(0xdc)](),console[_0x4eca6a(0xdc)]('Summary:'),console['log'](_0x4eca6a(0x149)+formatCountSummary(_0xe7329b[_0x4eca6a(0xd7)][_0x4eca6a(0x15d)])),console[_0x4eca6a(0xdc)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0xe7329b[_0x4eca6a(0xd7)]['knowledgeBases'])),console[_0x4eca6a(0xdc)](_0x4eca6a(0x172)+formatCountSummary(_0xe7329b[_0x4eca6a(0xd7)][_0x4eca6a(0x153)])),console[_0x4eca6a(0xdc)](_0x4eca6a(0xd0)+formatCountSummary(_0xe7329b['counts'][_0x4eca6a(0x160)]));const _0xff3756=_0xe7329b[_0x4eca6a(0xd7)][_0x4eca6a(0x14c)][_0x4eca6a(0x164)]>0x0||_0xe7329b[_0x4eca6a(0xd7)][_0x4eca6a(0x14c)]['updated']>0x0||_0xe7329b['counts'][_0x4eca6a(0x14c)][_0x4eca6a(0xd3)]>0x0||_0xe7329b[_0x4eca6a(0xd7)][_0x4eca6a(0x13e)]['created']>0x0||_0xe7329b[_0x4eca6a(0xd7)][_0x4eca6a(0x13e)][_0x4eca6a(0x157)]>0x0||_0xe7329b[_0x4eca6a(0xd7)][_0x4eca6a(0x13e)][_0x4eca6a(0xd3)]>0x0;_0xff3756&&(console[_0x4eca6a(0xdc)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0xe7329b[_0x4eca6a(0xd7)]['experimentalKnowledgeBases'])),console[_0x4eca6a(0xdc)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0xe7329b['counts'][_0x4eca6a(0x13e)])));if(_0x583d54){console[_0x4eca6a(0xdc)](),console[_0x4eca6a(0xdc)](a4_0x49ca42[_0x4eca6a(0xd9)]('Errors:'));for(const _0x4217dd of _0xe7329b['agents']){_0x4217dd[_0x4eca6a(0xe2)]===_0x4eca6a(0x166)&&console[_0x4eca6a(0xdc)](a4_0x49ca42[_0x4eca6a(0xd9)](_0x4eca6a(0x13f)+_0x4217dd[_0x4eca6a(0x11b)]+_0x4eca6a(0xf7)+_0x4217dd[_0x4eca6a(0x166)]));}for(const _0x25b307 of _0xe7329b[_0x4eca6a(0x152)]){_0x25b307[_0x4eca6a(0xe2)]==='error'&&console[_0x4eca6a(0xdc)](a4_0x49ca42[_0x4eca6a(0xd9)](_0x4eca6a(0x145)+_0x25b307[_0x4eca6a(0xe0)]+_0x4eca6a(0xf7)+_0x25b307[_0x4eca6a(0x166)]));}for(const _0x2158e7 of _0xe7329b[_0x4eca6a(0x153)]){_0x2158e7['action']===_0x4eca6a(0x166)&&console['log'](a4_0x49ca42[_0x4eca6a(0xd9)](_0x4eca6a(0x104)+_0x2158e7[_0x4eca6a(0xe0)]+_0x4eca6a(0xf7)+_0x2158e7['error']));}for(const _0x4b14c7 of _0xe7329b[_0x4eca6a(0x160)]){_0x4b14c7['action']===_0x4eca6a(0x166)&&console[_0x4eca6a(0xdc)](a4_0x49ca42[_0x4eca6a(0xd9)](_0x4eca6a(0x13b)+_0x4b14c7['name']+'\x22:\x20'+_0x4b14c7[_0x4eca6a(0x166)]));}for(const _0x4eb241 of _0xe7329b['experimentalKnowledgeBases']){_0x4eb241['action']==='error'&&console[_0x4eca6a(0xdc)](a4_0x49ca42[_0x4eca6a(0xd9)](_0x4eca6a(0x15c)+_0x4eb241[_0x4eca6a(0xe0)]+_0x4eca6a(0xf7)+_0x4eb241['error']));}for(const _0x361b39 of _0xe7329b[_0x4eca6a(0x13e)]){_0x361b39['action']==='error'&&console[_0x4eca6a(0xdc)](a4_0x49ca42[_0x4eca6a(0xd9)](_0x4eca6a(0xff)+_0x361b39[_0x4eca6a(0xe0)]+'\x22:\x20'+_0x361b39[_0x4eca6a(0x166)]));}return 0x1;}console[_0x4eca6a(0xdc)]();const _0x346635=getLLMProjectUrl(_0x35a7eb,_0xe7329b['newProjectId']);return console['log'](_0x4eca6a(0x117)+a4_0x49ca42['cyan'](_0x346635)),0x0;}}function a4_0x48f0(_0x5cc169,_0x678e73){_0x5cc169=_0x5cc169-0xcb;const _0x41b9ec=a4_0x41b9();let _0x48f041=_0x41b9ec[_0x5cc169];return _0x48f041;}export class AgentPushCommand extends BaseCommand{[a4_0x1398f9(0xe0)]=a4_0x1398f9(0x12b);[a4_0x1398f9(0x147)]=a4_0x1398f9(0x180);async[a4_0x1398f9(0x115)](_0x55eece){const _0x3717c4=a4_0x1398f9,{options:_0x258a68,args:_0x3ba411,tdx:_0x1e58ca}=_0x55eece;let _0x5bd57e=_0x3ba411[0x0]||process[_0x3717c4(0xda)]();const _0x437a86=_0x258a68['dryRun'],_0xa342d2=_0x258a68['force'],_0x3fd5f3=_0x258a68[_0x3717c4(0x15f)],_0x122a8e=_0x258a68['site'],_0x1fd4ad=a4_0x3b5cbc[_0x3717c4(0x10a)](_0x5bd57e,_0x3717c4(0x156)),_0x107b66=existsSync(_0x1fd4ad);if(_0x107b66){const {data:_0x3512a7}=await withSpinner(_0x3717c4(0xcc)+_0x5bd57e+_0x3717c4(0xd1),()=>_0x1e58ca['llm'][_0x3717c4(0x100)](_0x5bd57e,{'dryRun':_0x437a86,'force':_0xa342d2}));if(_0x437a86)return console[_0x3717c4(0xdc)](a4_0x49ca42['yellow'](_0x3717c4(0x131))),console[_0x3717c4(0xdc)](_0x3717c4(0x167)+_0x3512a7[_0x3717c4(0x11b)]),0x0;if(_0x3512a7[_0x3717c4(0xe2)]==='error')return console[_0x3717c4(0xdc)](a4_0x49ca42['red'](_0x3717c4(0x158)+_0x3512a7['error'])),0x1;console[_0x3717c4(0xdc)](a4_0x49ca42['green'](_0x3717c4(0x17b)+_0x3512a7[_0x3717c4(0xe2)]+_0x3717c4(0x114))),console[_0x3717c4(0xdc)](_0x3717c4(0xfb)+_0x3512a7[_0x3717c4(0x11b)]);if(_0x3512a7[_0x3717c4(0x14f)]&&_0x3512a7[_0x3717c4(0x136)]){const _0x3253f6=getLLMAgentChatUrl(_0x122a8e,_0x3512a7['projectId'],_0x3512a7[_0x3717c4(0x14f)]);console[_0x3717c4(0xdc)]('Chat:\x20'+a4_0x49ca42['cyan'](_0x3253f6));}return 0x0;}const _0x363777=_0x258a68[_0x3717c4(0xf8)],_0x2fcdca=resolveProjectFromContext(_0x5bd57e,_0x363777);if(_0x2fcdca[_0x3717c4(0x124)])_0x5bd57e=_0x2fcdca[_0x3717c4(0x107)],_0x2fcdca[_0x3717c4(0x138)]==='context'&&console[_0x3717c4(0xdc)](a4_0x49ca42[_0x3717c4(0x17c)](_0x3717c4(0x123)+_0x5bd57e));else{let _0xc0616e='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x2fcdca[_0x3717c4(0x186)]===_0x3717c4(0x173)&&(_0xc0616e=_0x2fcdca['message']+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x2fcdca[_0x3717c4(0xf8)]+_0x3717c4(0x11a));throw new SDKError(ErrorCode[_0x3717c4(0xe4)],_0x2fcdca[_0x3717c4(0x186)]===_0x3717c4(0x12a)?_0x2fcdca['message']:_0x3717c4(0x17e)+_0x5bd57e,undefined,{'helpText':_0xc0616e});}const {data:_0x384629}=await withSpinner(_0x3717c4(0x137),()=>_0x1e58ca[_0x3717c4(0xcd)][_0x3717c4(0x135)](_0x5bd57e,{'dryRun':!![]})),_0x57655b=_0x384629['counts'][_0x3717c4(0x15d)]['errors']>0x0;if(_0x57655b){console[_0x3717c4(0xdc)](a4_0x49ca42[_0x3717c4(0xd9)](_0x3717c4(0x175)));for(const _0x2c8f20 of _0x384629[_0x3717c4(0x15d)]){_0x2c8f20[_0x3717c4(0xe2)]===_0x3717c4(0x166)&&console[_0x3717c4(0xdc)](a4_0x49ca42[_0x3717c4(0xd9)](_0x3717c4(0x13f)+_0x2c8f20[_0x3717c4(0x11b)]+_0x3717c4(0xf7)+_0x2c8f20[_0x3717c4(0x166)]));}return 0x1;}const _0x119779=_0x384629[_0x3717c4(0xd7)][_0x3717c4(0x15d)][_0x3717c4(0x164)]+_0x384629[_0x3717c4(0xd7)][_0x3717c4(0x152)][_0x3717c4(0x164)]+_0x384629['counts']['textKnowledgeBases']['created']+_0x384629['counts'][_0x3717c4(0x153)]['created']+_0x384629[_0x3717c4(0xd7)][_0x3717c4(0x160)][_0x3717c4(0x164)]+_0x384629[_0x3717c4(0xd7)][_0x3717c4(0x14c)]['created']+_0x384629['counts'][_0x3717c4(0x13e)][_0x3717c4(0x164)],_0x34714b=_0x384629['counts'][_0x3717c4(0x15d)][_0x3717c4(0x157)]+_0x384629[_0x3717c4(0xd7)][_0x3717c4(0x152)]['updated']+_0x384629[_0x3717c4(0xd7)][_0x3717c4(0xe6)][_0x3717c4(0x157)]+_0x384629['counts']['prompts'][_0x3717c4(0x157)]+_0x384629[_0x3717c4(0xd7)][_0x3717c4(0x160)][_0x3717c4(0x157)]+_0x384629['counts'][_0x3717c4(0x14c)][_0x3717c4(0x157)]+_0x384629[_0x3717c4(0xd7)]['experimentalArtifacts'][_0x3717c4(0x157)],_0x3cec7d=_0x384629[_0x3717c4(0xd7)]['agents'][_0x3717c4(0xd3)]+_0x384629[_0x3717c4(0xd7)]['knowledgeBases']['unchanged']+_0x384629['counts'][_0x3717c4(0xe6)]['unchanged']+_0x384629[_0x3717c4(0xd7)][_0x3717c4(0x153)]['unchanged']+_0x384629[_0x3717c4(0xd7)][_0x3717c4(0x160)]['unchanged']+_0x384629[_0x3717c4(0xd7)]['experimentalKnowledgeBases'][_0x3717c4(0xd3)]+_0x384629[_0x3717c4(0xd7)]['experimentalArtifacts'][_0x3717c4(0xd3)];console[_0x3717c4(0xdc)](_0x3717c4(0x162)+_0x384629[_0x3717c4(0xf0)]+'\x27:'),console[_0x3717c4(0xdc)]('\x20\x20'+a4_0x49ca42[_0x3717c4(0xd6)]('+\x20'+_0x119779+'\x20new')+_0x3717c4(0x132)+a4_0x49ca42[_0x3717c4(0xe8)]('~\x20'+_0x34714b+'\x20changed')+_0x3717c4(0x132)+a4_0x49ca42['dim']('=\x20'+_0x3cec7d+_0x3717c4(0x17d))),console[_0x3717c4(0xdc)](_0x3717c4(0x149)+formatCountSummary(_0x384629['counts'][_0x3717c4(0x15d)])),console[_0x3717c4(0xdc)](_0x3717c4(0x121)+formatCountSummary(_0x384629[_0x3717c4(0xd7)]['knowledgeBases'])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x384629[_0x3717c4(0xd7)][_0x3717c4(0xe6)])),console[_0x3717c4(0xdc)](_0x3717c4(0x172)+formatCountSummary(_0x384629[_0x3717c4(0xd7)]['prompts'])),console[_0x3717c4(0xdc)](_0x3717c4(0xd0)+formatCountSummary(_0x384629[_0x3717c4(0xd7)][_0x3717c4(0x160)]));const _0x53a13d=_0x384629[_0x3717c4(0xd7)][_0x3717c4(0x14c)][_0x3717c4(0x164)]>0x0||_0x384629[_0x3717c4(0xd7)][_0x3717c4(0x14c)][_0x3717c4(0x157)]>0x0||_0x384629['counts'][_0x3717c4(0x14c)][_0x3717c4(0xd3)]>0x0||_0x384629[_0x3717c4(0xd7)][_0x3717c4(0x13e)][_0x3717c4(0x164)]>0x0||_0x384629[_0x3717c4(0xd7)][_0x3717c4(0x13e)][_0x3717c4(0x157)]>0x0||_0x384629[_0x3717c4(0xd7)][_0x3717c4(0x13e)][_0x3717c4(0xd3)]>0x0;_0x53a13d&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x384629[_0x3717c4(0xd7)]['experimentalKnowledgeBases'])),console[_0x3717c4(0xdc)](_0x3717c4(0xde)+formatCountSummary(_0x384629[_0x3717c4(0xd7)]['experimentalArtifacts'])));console[_0x3717c4(0xdc)](_0x3717c4(0x171)+a4_0x49ca42['cyan'](_0x5bd57e)),displayDiffs(_0x384629[_0x3717c4(0x15d)],_0x384629[_0x3717c4(0x152)],_0x384629[_0x3717c4(0xe6)],_0x384629[_0x3717c4(0x153)],_0x384629[_0x3717c4(0x160)],_0x384629[_0x3717c4(0x14c)],_0x384629[_0x3717c4(0x13e)]);if(_0x437a86)return console[_0x3717c4(0xdc)](a4_0x49ca42[_0x3717c4(0xe8)](_0x3717c4(0x142))),0x0;if(_0x119779===0x0&&_0x34714b===0x0){console[_0x3717c4(0xdc)](a4_0x49ca42[_0x3717c4(0xd6)](_0x3717c4(0xeb)));const _0x398f7a=getLLMProjectUrl(_0x122a8e,_0x384629[_0x3717c4(0x136)]);return console[_0x3717c4(0xdc)](_0x3717c4(0x117)+a4_0x49ca42[_0x3717c4(0x163)](_0x398f7a)),0x0;}if(!_0x3fd5f3&&!_0xa342d2){if(!isInteractive())return console['error'](a4_0x49ca42[_0x3717c4(0xd9)](_0x3717c4(0x11e)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3717c4(0x166)](a4_0x49ca42[_0x3717c4(0x17c)](_0x3717c4(0xe1))),0x1;const _0x479bb0=await confirmKey(_0x3717c4(0x187)+(_0x119779+_0x34714b)+_0x3717c4(0x11c));if(!_0x479bb0)return console[_0x3717c4(0xdc)](a4_0x49ca42['yellow'](_0x3717c4(0x141)),_0x3717c4(0x101)),0x1;}const {data:_0x35a40b}=await withSpinner(_0x3717c4(0xfe),()=>_0x1e58ca[_0x3717c4(0xcd)][_0x3717c4(0x135)](_0x5bd57e,{'force':_0xa342d2})),_0x4164d8=_0x35a40b[_0x3717c4(0xd7)][_0x3717c4(0x15d)][_0x3717c4(0x16f)]>0x0||_0x35a40b[_0x3717c4(0xd7)][_0x3717c4(0x152)][_0x3717c4(0x16f)]>0x0||_0x35a40b[_0x3717c4(0xd7)]['textKnowledgeBases']['errors']>0x0||_0x35a40b[_0x3717c4(0xd7)][_0x3717c4(0x153)]['errors']>0x0;if(_0x4164d8){console[_0x3717c4(0xdc)](a4_0x49ca42[_0x3717c4(0xe8)](_0x3717c4(0x12d))),console['log'](),console[_0x3717c4(0xdc)](a4_0x49ca42['red'](_0x3717c4(0x112)));for(const _0x4d2cc6 of _0x35a40b[_0x3717c4(0x15d)]){_0x4d2cc6[_0x3717c4(0xe2)]===_0x3717c4(0x166)&&console[_0x3717c4(0xdc)](a4_0x49ca42[_0x3717c4(0xd9)](_0x3717c4(0x13f)+_0x4d2cc6['agentName']+'\x22:\x20'+_0x4d2cc6[_0x3717c4(0x166)]));}for(const _0x4eb7b4 of _0x35a40b['knowledgeBases']){_0x4eb7b4['action']===_0x3717c4(0x166)&&console['log'](a4_0x49ca42[_0x3717c4(0xd9)](_0x3717c4(0x145)+_0x4eb7b4[_0x3717c4(0xe0)]+_0x3717c4(0xf7)+_0x4eb7b4[_0x3717c4(0x166)]));}for(const _0xb6d893 of _0x35a40b[_0x3717c4(0xe6)]){_0xb6d893[_0x3717c4(0xe2)]===_0x3717c4(0x166)&&console[_0x3717c4(0xdc)](a4_0x49ca42[_0x3717c4(0xd9)](_0x3717c4(0x148)+_0xb6d893[_0x3717c4(0xe0)]+_0x3717c4(0xf7)+_0xb6d893[_0x3717c4(0x166)]));}for(const _0x4e2176 of _0x35a40b['prompts']){_0x4e2176[_0x3717c4(0xe2)]===_0x3717c4(0x166)&&console[_0x3717c4(0xdc)](a4_0x49ca42[_0x3717c4(0xd9)](_0x3717c4(0x104)+_0x4e2176['name']+_0x3717c4(0xf7)+_0x4e2176[_0x3717c4(0x166)]));}for(const _0x2f4a33 of _0x35a40b[_0x3717c4(0x160)]){_0x2f4a33[_0x3717c4(0xe2)]==='error'&&console[_0x3717c4(0xdc)](a4_0x49ca42[_0x3717c4(0xd9)](_0x3717c4(0x13b)+_0x2f4a33[_0x3717c4(0xe0)]+_0x3717c4(0xf7)+_0x2f4a33[_0x3717c4(0x166)]));}return 0x1;}console[_0x3717c4(0xdc)](a4_0x49ca42[_0x3717c4(0xd6)](_0x3717c4(0x170)+(_0x119779+_0x34714b)+'\x20resources\x20to\x20\x27'+_0x35a40b[_0x3717c4(0xf0)]+'\x27'));const _0x329486=getLLMProjectUrl(_0x122a8e,_0x35a40b[_0x3717c4(0x136)]);return console[_0x3717c4(0xdc)](_0x3717c4(0x117)+a4_0x49ca42['cyan'](_0x329486)),0x0;}}
1
+ const a4_0x20fc4f=a4_0x2490;function a4_0x2490(_0x5c882d,_0x3b81e1){_0x5c882d=_0x5c882d-0xce;const _0x41226e=a4_0x4122();let _0x2490f4=_0x41226e[_0x5c882d];return _0x2490f4;}(function(_0x334d7b,_0x534165){const _0x14ae8d=a4_0x2490,_0x1e3544=_0x334d7b();while(!![]){try{const _0x5f64ca=parseInt(_0x14ae8d(0x153))/0x1*(-parseInt(_0x14ae8d(0x129))/0x2)+-parseInt(_0x14ae8d(0x186))/0x3+-parseInt(_0x14ae8d(0x180))/0x4*(parseInt(_0x14ae8d(0x124))/0x5)+-parseInt(_0x14ae8d(0x160))/0x6+-parseInt(_0x14ae8d(0x16c))/0x7*(-parseInt(_0x14ae8d(0x12b))/0x8)+-parseInt(_0x14ae8d(0x11b))/0x9*(-parseInt(_0x14ae8d(0x147))/0xa)+parseInt(_0x14ae8d(0xdc))/0xb;if(_0x5f64ca===_0x534165)break;else _0x1e3544['push'](_0x1e3544['shift']());}catch(_0x56efc9){_0x1e3544['push'](_0x1e3544['shift']());}}}(a4_0x4122,0x4f2dd));import a4_0x582d5d from'chalk';import a4_0x23dbd1 from'path';import{existsSync,readFileSync}from'fs';function a4_0x4122(){const _0x795058=['agentId','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x22:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','284828WRgTJW','llmProject','8DEUnPy','source','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x22\x20to\x20new\x20project\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','tdx.json','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20=\x20','green','integrations','-\x20nothing\x20pushed','Output\x20path:\x20','\x20unchanged','push','pushAgent','output','counts','Errors:','\x20--profile\x20','agent.yml','dirname','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','updated','Analyzing\x20project\x20\x22','\x20\x20Target:\x20','No\x20tdx.json\x20found\x20in\x20','parse','10HfrpoX','\x20\x20Prompt\x20\x22','projectName','Summary:','message','\x0aWrite\x20','cwd','projectId','MISSING_ARGUMENT','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','<new-name>','agentName','2odJsCX','Status:\x20','utf-8','\x0aProject\x20pushed\x20with\x20errors','session','force','context','repeat','cyan','\x0aPush\x20','\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','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','3267816FCdRie','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\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','experimentalArtifacts','yes','agent','Project\x20cloned\x20successfully','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20\x20Prompts:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x22...','cwd-config','149828mkcdRq','\x20\x20Integration\x20\x22','\x0aErrors\x20found:','join','textKnowledgeBases','reason','prompts','\x0aPush\x20summary\x20for\x20\x27','site','-\x20no\x20files\x20written','action','errors','pullAgent','arg-dir','llm_project','unchanged','dim','\x0aPull\x20summary\x20for\x20\x27','\x20\x20Integrations:\x20','Source:\x20','20sKnJAz','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Using\x20local\x20project:\x20','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20tdx\x20agent\x20pull\x20','\x20\x20Agent\x20\x22','1405851gyUPfI','\x20\x20tdx\x20agent\x20clone\x20agents/','Using\x20project\x20from\x20','created','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Dry\x20run\x20-\x20no\x20files\x20written','error','newProjectName','Project:\x20','agents','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Using\x20context\x20project:\x20','agent:clone','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','newProjectId','\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','14159343WAmUCN','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','experimentalKnowledgeBases','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x0aChanges\x20to\x20agent\x20\x27','agent:pull','Cancelled','\x0aChanges:','\x20\x20Experimental\x20Artifact\x20\x22','no_local_folder','\x20resources\x20to\x20\x27','Failed\x20to\x20push\x20agent:\x20','gray','\x20files?','Would\x20pull\x20agent:\x20','Dry\x20run\x20-\x20no\x20changes\x20made','New\x20project\x20ID:\x20','\x0a✔\x20Pushed\x20','diff','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','✔\x20Context\x20set:\x20','Using\x20current\x20project:\x20','isNew','Analyzing\x20changes\x20to\x20push...','\x20--name\x20','Agent:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','execute','hasChanges','llm','\x20|\x20','\x20new','Using\x20project:\x20','total','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','New\x20project\x20name\x20is\x20required','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)','\x20successfully','New\x20project:\x20','outputDir','\x20files\x20to\x20','red','\x20changed','\x20total','description','log','\x0aError:','\x0aChanges\x20to\x20integration\x20\x27','\x20\x20Knowledge\x20Bases:\x20','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20errors','name','\x20created','cloneProject','knowledgeBases','\x0aChanges\x20to\x20prompt\x20\x27','Agent\x20','agent:push','sourceProjectName','\x20\x20Agents:\x20','3053349SzzUND','outputPath','Agent\x20pulled\x20successfully','new','\x20updated','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Writing\x20files...','yellow','dryRun','25480gPMqrA'];a4_0x4122=function(){return _0x795058;};return a4_0x4122();}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(_0x3c8377){const _0x1f394e=a4_0x2490,_0x5cf416=[];if(_0x3c8377[_0x1f394e(0x100)]!==undefined)_0x5cf416[_0x1f394e(0x139)](_0x3c8377[_0x1f394e(0x100)]+_0x1f394e(0x10a));if(_0x3c8377[_0x1f394e(0x11e)]!==undefined&&_0x3c8377[_0x1f394e(0x11e)]>0x0)_0x5cf416[_0x1f394e(0x139)](a4_0x582d5d[_0x1f394e(0x134)](_0x3c8377[_0x1f394e(0x11e)]+_0x1f394e(0xfe)));if(_0x3c8377[_0x1f394e(0xcf)]!==undefined&&_0x3c8377[_0x1f394e(0xcf)]>0x0)_0x5cf416[_0x1f394e(0x139)](a4_0x582d5d[_0x1f394e(0x134)](_0x3c8377[_0x1f394e(0xcf)]+_0x1f394e(0x113)));if(_0x3c8377[_0x1f394e(0x142)]!==undefined&&_0x3c8377['updated']>0x0)_0x5cf416[_0x1f394e(0x139)](a4_0x582d5d[_0x1f394e(0x122)](_0x3c8377[_0x1f394e(0x142)]+_0x1f394e(0x11f)));if(_0x3c8377['unchanged']!==undefined&&_0x3c8377[_0x1f394e(0x17b)]>0x0)_0x5cf416[_0x1f394e(0x139)](a4_0x582d5d[_0x1f394e(0xea)](_0x3c8377[_0x1f394e(0x17b)]+_0x1f394e(0x138)));if(_0x3c8377[_0x1f394e(0x177)]!==undefined&&_0x3c8377[_0x1f394e(0x177)]>0x0)_0x5cf416[_0x1f394e(0x139)](a4_0x582d5d[_0x1f394e(0x108)](_0x3c8377[_0x1f394e(0x177)]+_0x1f394e(0x111)));return _0x5cf416[_0x1f394e(0x16f)](',\x20');}function displayDiffs(_0x214930,_0x23927c,_0x28274c,_0x3bac84,_0xba3b4b,_0x2525b3,_0x425cdd){const _0x3e12d0=a4_0x2490;for(const _0x38bc36 of _0x214930){if(_0x38bc36['diff']){const _0x5848d2=_0x38bc36[_0x3e12d0(0x152)]||_0x38bc36['name'];console['log'](_0x3e12d0(0xe2)+_0x5848d2+'\x27:'),console[_0x3e12d0(0x10c)]('─'[_0x3e12d0(0x15a)](0x3c)),console['log'](_0x38bc36[_0x3e12d0(0xf0)]),console[_0x3e12d0(0x10c)]('─'[_0x3e12d0(0x15a)](0x3c));}}for(const _0x5c8243 of _0x23927c){_0x5c8243[_0x3e12d0(0xf0)]&&(console[_0x3e12d0(0x10c)](_0x3e12d0(0x101)+_0x5c8243[_0x3e12d0(0x112)]+'\x27:'),console['log']('─'[_0x3e12d0(0x15a)](0x3c)),console[_0x3e12d0(0x10c)](_0x5c8243[_0x3e12d0(0xf0)]),console[_0x3e12d0(0x10c)]('─'[_0x3e12d0(0x15a)](0x3c)));}for(const _0x139754 of _0x28274c){_0x139754['diff']&&(console['log']('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x139754['name']+'\x27:'),console[_0x3e12d0(0x10c)]('─'[_0x3e12d0(0x15a)](0x3c)),console[_0x3e12d0(0x10c)](_0x139754[_0x3e12d0(0xf0)]),console['log']('─'['repeat'](0x3c)));}for(const _0x409b98 of _0x3bac84){_0x409b98['diff']&&(console[_0x3e12d0(0x10c)](_0x3e12d0(0x116)+_0x409b98[_0x3e12d0(0x112)]+'\x27:'),console[_0x3e12d0(0x10c)]('─'[_0x3e12d0(0x15a)](0x3c)),console[_0x3e12d0(0x10c)](_0x409b98[_0x3e12d0(0xf0)]),console[_0x3e12d0(0x10c)]('─'[_0x3e12d0(0x15a)](0x3c)));}for(const _0xea61cf of _0xba3b4b){_0xea61cf[_0x3e12d0(0xf0)]&&(console[_0x3e12d0(0x10c)](_0x3e12d0(0x10e)+_0xea61cf[_0x3e12d0(0x112)]+'\x27:'),console[_0x3e12d0(0x10c)]('─'[_0x3e12d0(0x15a)](0x3c)),console['log'](_0xea61cf[_0x3e12d0(0xf0)]),console[_0x3e12d0(0x10c)]('─'['repeat'](0x3c)));}for(const _0x35085d of _0x2525b3){_0x35085d[_0x3e12d0(0xf0)]&&(console[_0x3e12d0(0x10c)](_0x3e12d0(0xf2)+_0x35085d[_0x3e12d0(0x112)]+'\x27:'),console[_0x3e12d0(0x10c)]('─'[_0x3e12d0(0x15a)](0x3c)),console[_0x3e12d0(0x10c)](_0x35085d['diff']),console[_0x3e12d0(0x10c)]('─'[_0x3e12d0(0x15a)](0x3c)));}for(const _0x4f6ec5 of _0x425cdd){_0x4f6ec5[_0x3e12d0(0xf0)]&&(console['log'](_0x3e12d0(0x141)+_0x4f6ec5[_0x3e12d0(0x112)]+'\x27:'),console[_0x3e12d0(0x10c)]('─'[_0x3e12d0(0x15a)](0x3c)),console['log'](_0x4f6ec5[_0x3e12d0(0xf0)]),console['log']('─'[_0x3e12d0(0x15a)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x20fc4f(0x112)]=a4_0x20fc4f(0xe3);['description']=a4_0x20fc4f(0x12e);async['execute'](_0x15758a){const _0x492f93=a4_0x20fc4f,{options:_0x22230f,args:_0x2c7192,tdx:_0xafac4e}=_0x15758a,_0x37a2ae=_0x2c7192[0x0],_0x4ca12b=_0x2c7192[0x1],_0x4797a3=_0x22230f[_0x492f93(0x13b)],_0x420ad6=_0x22230f[_0x492f93(0x123)],_0x48e489=_0x22230f[_0x492f93(0x158)],_0x7e028=_0x22230f['yes'],_0xce2113=_0x22230f['llmProject'],_0x5c5f37=_0x22230f[_0x492f93(0x165)];let _0x5e132c;if(_0x37a2ae){const _0x43b9d3=a4_0x23dbd1['join'](_0x37a2ae,_0x492f93(0x131));if(existsSync(_0x43b9d3))try{const _0x3dec50=JSON['parse'](readFileSync(_0x43b9d3,'utf-8'));_0x3dec50[_0x492f93(0x17a)]&&(_0x5e132c={'llm_project':_0x3dec50[_0x492f93(0x17a)]});}catch{}}const _0x1ae28f=findAgentConfigPath(process[_0x492f93(0x14d)]());let _0x21d5e5;if(_0x1ae28f)try{const _0x39520b=JSON[_0x492f93(0x146)](readFileSync(_0x1ae28f,_0x492f93(0x155)));_0x39520b[_0x492f93(0x17a)]&&(_0x21d5e5={'llm_project':_0x39520b[_0x492f93(0x17a)]});}catch{}const _0x216d1a=resolveAgentPullArgs({'arg':_0x37a2ae,'agentNameArg':_0x4ca12b,'agentFlag':_0x5c5f37,'contextProject':_0xce2113,'argDirConfig':_0x5e132c,'cwdConfigPath':_0x1ae28f||undefined,'cwdConfig':_0x21d5e5}),{projectNameOrId:_0xc01792,targetAgentName:_0x262541,existingOutputDir:_0x37048e,source:_0x494264}=_0x216d1a;if(_0x494264===_0x492f93(0x179))console[_0x492f93(0x10c)](a4_0x582d5d[_0x492f93(0x17c)](_0x492f93(0xce)+a4_0x23dbd1['join'](_0x37a2ae,'tdx.json')+':\x20'+_0xc01792));else{if(_0x494264===_0x492f93(0x16b))console['log'](a4_0x582d5d[_0x492f93(0x17c)](_0x492f93(0xff)+_0xc01792));else _0x494264===_0x492f93(0x159)&&console['log'](a4_0x582d5d[_0x492f93(0x17c)]('Using\x20project\x20from\x20context:\x20'+_0xc01792));}if(!_0xc01792)return _0x5c5f37?(console[_0x492f93(0x10c)](a4_0x582d5d['yellow']('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x492f93(0x10c)](_0x492f93(0xd9)),console['log'](_0x492f93(0xf1))):(console[_0x492f93(0x10c)](a4_0x582d5d[_0x492f93(0x122)](_0x492f93(0x126))),console[_0x492f93(0x10c)](_0x492f93(0x103)),console[_0x492f93(0x10c)](_0x492f93(0xe1)),console[_0x492f93(0x10c)](_0x492f93(0xdb)),console[_0x492f93(0x10c)](_0x492f93(0x162)),console['log'](_0x492f93(0x15d))),0x1;if(_0x262541){const {data:_0x4ee8ba}=await withSpinner('Pulling\x20agent\x20\x22'+_0x262541+'\x22\x20from\x20project\x20\x22'+_0xc01792+_0x492f93(0x16a),()=>_0xafac4e[_0x492f93(0xfc)][_0x492f93(0x178)](_0xc01792,_0x262541,_0x4797a3,{'dryRun':_0x420ad6,'force':_0x48e489}));if(_0x420ad6)return console[_0x492f93(0x10c)](a4_0x582d5d[_0x492f93(0x122)](_0x492f93(0xd1))),console['log'](_0x492f93(0xec)+_0x4ee8ba[_0x492f93(0x152)]),console[_0x492f93(0x10c)](_0x492f93(0x137)+_0x4ee8ba[_0x492f93(0x11c)]),_0x4ee8ba[_0x492f93(0xf0)]&&(console['log'](_0x492f93(0xe5)),console['log']('─'[_0x492f93(0x15a)](0x3c)),console[_0x492f93(0x10c)](_0x4ee8ba['diff']),console[_0x492f93(0x10c)]('─'['repeat'](0x3c))),0x0;return console[_0x492f93(0x10c)](a4_0x582d5d[_0x492f93(0x134)](_0x492f93(0x11d))),console[_0x492f93(0x10c)](_0x492f93(0xf8)+_0x4ee8ba['agentName']),console[_0x492f93(0x10c)]('Output:\x20'+_0x4ee8ba[_0x492f93(0x11c)]),console[_0x492f93(0x10c)](_0x492f93(0x154)+(_0x4ee8ba[_0x492f93(0xf5)]?a4_0x582d5d[_0x492f93(0x134)]('new'):_0x4ee8ba[_0x492f93(0xfb)]?a4_0x582d5d['yellow'](_0x492f93(0x142)):a4_0x582d5d[_0x492f93(0xea)]('unchanged'))),0x0;}const _0x4739e6=_0x37048e||_0x4797a3,{data:_0x4d4dfb}=await withSpinner(_0x492f93(0x143)+_0xc01792+'\x22...',()=>_0xafac4e['llm']['pullProject'](_0xc01792,_0x4739e6,{'dryRun':!![]})),_0x151a14=_0x4d4dfb[_0x492f93(0x13c)][_0x492f93(0xd5)][_0x492f93(0x11e)]+_0x4d4dfb[_0x492f93(0x13c)][_0x492f93(0x115)][_0x492f93(0x11e)]+_0x4d4dfb['counts'][_0x492f93(0x170)][_0x492f93(0x11e)]+_0x4d4dfb[_0x492f93(0x13c)][_0x492f93(0x172)][_0x492f93(0x11e)]+_0x4d4dfb[_0x492f93(0x13c)]['integrations'][_0x492f93(0x11e)]+_0x4d4dfb[_0x492f93(0x13c)][_0x492f93(0xdf)][_0x492f93(0x11e)]+_0x4d4dfb[_0x492f93(0x13c)][_0x492f93(0x163)][_0x492f93(0x11e)],_0x3b96a7=_0x4d4dfb[_0x492f93(0x13c)][_0x492f93(0xd5)][_0x492f93(0x142)]+_0x4d4dfb[_0x492f93(0x13c)][_0x492f93(0x115)][_0x492f93(0x142)]+_0x4d4dfb[_0x492f93(0x13c)][_0x492f93(0x170)][_0x492f93(0x142)]+_0x4d4dfb['counts'][_0x492f93(0x172)]['updated']+_0x4d4dfb['counts']['integrations'][_0x492f93(0x142)]+_0x4d4dfb[_0x492f93(0x13c)][_0x492f93(0xdf)][_0x492f93(0x142)]+_0x4d4dfb[_0x492f93(0x13c)][_0x492f93(0x163)][_0x492f93(0x142)],_0x50a298=_0x4d4dfb[_0x492f93(0x13c)]['agents'][_0x492f93(0x17b)]+_0x4d4dfb[_0x492f93(0x13c)][_0x492f93(0x115)][_0x492f93(0x17b)]+_0x4d4dfb[_0x492f93(0x13c)]['textKnowledgeBases'][_0x492f93(0x17b)]+_0x4d4dfb[_0x492f93(0x13c)][_0x492f93(0x172)][_0x492f93(0x17b)]+_0x4d4dfb[_0x492f93(0x13c)]['integrations'][_0x492f93(0x17b)]+_0x4d4dfb['counts'][_0x492f93(0xdf)]['unchanged']+_0x4d4dfb[_0x492f93(0x13c)][_0x492f93(0x163)]['unchanged'];console[_0x492f93(0x10c)](_0x492f93(0x17d)+_0x4d4dfb[_0x492f93(0x149)]+'\x27:'),console[_0x492f93(0x10c)]('\x20\x20'+a4_0x582d5d['green']('+\x20'+_0x151a14+_0x492f93(0xfe))+'\x20|\x20'+a4_0x582d5d['yellow']('~\x20'+_0x3b96a7+_0x492f93(0x109))+_0x492f93(0xfd)+a4_0x582d5d[_0x492f93(0x17c)]('=\x20'+_0x50a298+_0x492f93(0x138))),console[_0x492f93(0x10c)]('\x20\x20Agents:\x20'+formatCountSummary(_0x4d4dfb[_0x492f93(0x13c)]['agents'])),console['log'](_0x492f93(0x10f)+formatCountSummary(_0x4d4dfb['counts'][_0x492f93(0x115)])),console[_0x492f93(0x10c)](_0x492f93(0x110)+formatCountSummary(_0x4d4dfb[_0x492f93(0x13c)][_0x492f93(0x170)])),console['log'](_0x492f93(0x168)+formatCountSummary(_0x4d4dfb[_0x492f93(0x13c)]['prompts'])),console[_0x492f93(0x10c)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x4d4dfb[_0x492f93(0x13c)][_0x492f93(0x135)]));const _0x2f82e6=_0x4d4dfb['counts']['experimentalKnowledgeBases']['total']>0x0||_0x4d4dfb[_0x492f93(0x13c)][_0x492f93(0x163)][_0x492f93(0x100)]>0x0;_0x2f82e6&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4d4dfb[_0x492f93(0x13c)]['experimentalKnowledgeBases'])),console[_0x492f93(0x10c)](_0x492f93(0x183)+formatCountSummary(_0x4d4dfb[_0x492f93(0x13c)]['experimentalArtifacts'])));console[_0x492f93(0x10c)](_0x492f93(0x144)+a4_0x582d5d[_0x492f93(0x15b)](_0x4d4dfb[_0x492f93(0x106)])),displayDiffs(_0x4d4dfb[_0x492f93(0xd5)],_0x4d4dfb['knowledgeBases'],_0x4d4dfb['textKnowledgeBases'],_0x4d4dfb[_0x492f93(0x172)],_0x4d4dfb[_0x492f93(0x135)],_0x4d4dfb[_0x492f93(0xdf)],_0x4d4dfb[_0x492f93(0x163)]);if(_0x420ad6)return console[_0x492f93(0x10c)](a4_0x582d5d[_0x492f93(0x122)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x151a14===0x0&&_0x3b96a7===0x0)return console[_0x492f93(0x10c)](a4_0x582d5d[_0x492f93(0x134)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x4d4dfb['projectName']},_0x22230f[_0x492f93(0x157)]),console[_0x492f93(0x10c)](a4_0x582d5d[_0x492f93(0x134)](_0x492f93(0xf3)+a4_0x582d5d[_0x492f93(0x17c)](_0x492f93(0x17a))+_0x492f93(0x133)+a4_0x582d5d[_0x492f93(0x15b)](_0x4d4dfb[_0x492f93(0x149)]))),0x0;if(!_0x7e028&&!_0x48e489){if(!isInteractive())return console[_0x492f93(0xd2)](a4_0x582d5d[_0x492f93(0x108)](_0x492f93(0x10d)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x492f93(0xd2)](a4_0x582d5d[_0x492f93(0x17c)](_0x492f93(0x128))),0x1;const _0x1d5f2b=await confirmKey(_0x492f93(0x14c)+(_0x151a14+_0x3b96a7)+_0x492f93(0xeb));if(!_0x1d5f2b)return console[_0x492f93(0x10c)](a4_0x582d5d[_0x492f93(0x122)]('Cancelled'),_0x492f93(0x175)),0x1;}const {data:_0x3446a2}=await withSpinner(_0x492f93(0x121),()=>_0xafac4e[_0x492f93(0xfc)]['pullProject'](_0xc01792,_0x4739e6,{'force':_0x48e489}));return console[_0x492f93(0x10c)](a4_0x582d5d[_0x492f93(0x134)]('\x0a✔\x20Pulled\x20'+(_0x151a14+_0x3b96a7)+_0x492f93(0x107)+_0x3446a2[_0x492f93(0x106)])),saveSessionContext({'llm_project':_0x3446a2['projectName']},_0x22230f[_0x492f93(0x157)]),console[_0x492f93(0x10c)](a4_0x582d5d[_0x492f93(0x134)](_0x492f93(0xf3)+a4_0x582d5d[_0x492f93(0x17c)]('llm_project')+'\x20=\x20'+a4_0x582d5d[_0x492f93(0x15b)](_0x3446a2[_0x492f93(0x149)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x20fc4f(0xd8);[a4_0x20fc4f(0x10b)]=a4_0x20fc4f(0x15e);async[a4_0x20fc4f(0xfa)](_0xa52336){const _0x3a97b5=a4_0x20fc4f,{options:_0x45c581,args:_0x2398e8,tdx:_0x146990}=_0xa52336,_0x6d1ed8=_0x2398e8[0x0],_0x2025f9=_0x45c581[_0x3a97b5(0x112)],_0x481a69=_0x45c581[_0x3a97b5(0x123)],_0x2b8740=_0x45c581[_0x3a97b5(0x164)],_0x2af459=_0x45c581[_0x3a97b5(0x174)],_0x5c119a=_0x45c581['llmProject'];let _0x483e81;const _0x46f6d9=findAgentConfigPath(process['cwd']());if(_0x6d1ed8){const _0x496d7c=a4_0x23dbd1[_0x3a97b5(0x16f)](_0x6d1ed8,_0x3a97b5(0x131));existsSync(_0x496d7c)?(_0x483e81=_0x6d1ed8,console[_0x3a97b5(0x10c)](a4_0x582d5d[_0x3a97b5(0x17c)](_0x3a97b5(0x182)+_0x6d1ed8))):_0x483e81=_0x6d1ed8;}else{if(_0x46f6d9)_0x483e81=a4_0x23dbd1[_0x3a97b5(0x140)](_0x46f6d9),console['log'](a4_0x582d5d[_0x3a97b5(0x17c)](_0x3a97b5(0xf4)+_0x483e81));else{if(_0x5c119a){const _0x47417b=sanitizeForFilesystem(_0x5c119a);let _0x4d06d2=_0x47417b,_0x411c17=a4_0x23dbd1[_0x3a97b5(0x16f)](process[_0x3a97b5(0x14d)](),'agents',_0x47417b,_0x3a97b5(0x131));if(!existsSync(_0x411c17)){const _0x2ba7f1=normalizeName(_0x5c119a),_0x18e500=a4_0x23dbd1['join'](process[_0x3a97b5(0x14d)](),_0x3a97b5(0xd5),_0x2ba7f1,_0x3a97b5(0x131));existsSync(_0x18e500)&&(_0x4d06d2=_0x2ba7f1,_0x411c17=_0x18e500);}if(existsSync(_0x411c17))_0x483e81=a4_0x23dbd1[_0x3a97b5(0x140)](_0x411c17),console[_0x3a97b5(0x10c)](a4_0x582d5d[_0x3a97b5(0x17c)](_0x3a97b5(0x182)+_0x483e81));else{const _0x48bea5=_0x45c581['profile'];if(_0x48bea5)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x5c119a+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x3a97b5(0xd6)+_0x3a97b5(0xdd)+(_0x3a97b5(0x184)+_0x5c119a+'\x0a')+(_0x3a97b5(0x187)+_0x4d06d2+_0x3a97b5(0xf7)+(_0x2025f9||_0x3a97b5(0x151))+_0x3a97b5(0x13e)+_0x48bea5)});_0x483e81=_0x5c119a,console[_0x3a97b5(0x10c)](a4_0x582d5d[_0x3a97b5(0x17c)](_0x3a97b5(0xd7)+_0x5c119a));}}}}if(!_0x483e81)return console[_0x3a97b5(0x10c)](a4_0x582d5d[_0x3a97b5(0x122)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console['log'](_0x3a97b5(0x130)),console['log'](_0x3a97b5(0x15f)),console[_0x3a97b5(0x10c)](_0x3a97b5(0xe0)),console[_0x3a97b5(0x10c)](_0x3a97b5(0x161)),0x1;if(!_0x2025f9)throw new SDKError(ErrorCode[_0x3a97b5(0x14f)],_0x3a97b5(0x102),undefined,{'helpText':_0x3a97b5(0x167)});if(!_0x2b8740&&!_0x481a69){if(!isInteractive())return console['error'](a4_0x582d5d[_0x3a97b5(0x108)](_0x3a97b5(0x10d)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3a97b5(0xd2)](a4_0x582d5d[_0x3a97b5(0x17c)](_0x3a97b5(0x128))),0x1;const _0x49a4a7=await confirmKey('Clone\x20\x22'+_0x483e81+_0x3a97b5(0x12f)+_0x2025f9+'\x22?');if(!_0x49a4a7)return console[_0x3a97b5(0x10c)](a4_0x582d5d[_0x3a97b5(0x122)](_0x3a97b5(0xe4))),0x1;}const {data:_0x34c50c}=await withSpinner('Cloning\x20\x22'+_0x483e81+'\x22\x20to\x20\x22'+_0x2025f9+_0x3a97b5(0x16a),()=>_0x146990['llm'][_0x3a97b5(0x114)](_0x483e81,_0x2025f9,{'dryRun':_0x481a69}));if(_0x481a69){console['log'](a4_0x582d5d['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x3a97b5(0x10c)](_0x3a97b5(0x17f)+_0x34c50c['sourceProjectName']),console[_0x3a97b5(0x10c)](_0x3a97b5(0x105)+_0x2025f9),console[_0x3a97b5(0x10c)]('Would\x20clone:'),console[_0x3a97b5(0x10c)]('\x20\x20Agents:\x20'+_0x34c50c['counts']['agents'][_0x3a97b5(0xcf)]),console[_0x3a97b5(0x10c)](_0x3a97b5(0x10f)+_0x34c50c[_0x3a97b5(0x13c)]['knowledgeBases'][_0x3a97b5(0xcf)]),console['log'](_0x3a97b5(0x168)+_0x34c50c[_0x3a97b5(0x13c)][_0x3a97b5(0x172)][_0x3a97b5(0xcf)]);const _0x58b254=_0x34c50c[_0x3a97b5(0x13c)][_0x3a97b5(0xdf)][_0x3a97b5(0xcf)]>0x0||_0x34c50c[_0x3a97b5(0x13c)][_0x3a97b5(0x163)][_0x3a97b5(0xcf)]>0x0;return _0x58b254&&(console['log'](_0x3a97b5(0x12d)+_0x34c50c['counts'][_0x3a97b5(0xdf)]['created']),console[_0x3a97b5(0x10c)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x34c50c[_0x3a97b5(0x13c)][_0x3a97b5(0x163)][_0x3a97b5(0xcf)])),0x0;}const _0x23c520=_0x34c50c[_0x3a97b5(0x13c)][_0x3a97b5(0xd5)][_0x3a97b5(0x177)]>0x0||_0x34c50c[_0x3a97b5(0x13c)]['knowledgeBases'][_0x3a97b5(0x177)]>0x0||_0x34c50c['counts']['prompts'][_0x3a97b5(0x177)]>0x0||_0x34c50c[_0x3a97b5(0x13c)][_0x3a97b5(0xdf)]['errors']>0x0||_0x34c50c['counts'][_0x3a97b5(0x163)][_0x3a97b5(0x177)]>0x0;_0x23c520?console[_0x3a97b5(0x10c)](a4_0x582d5d[_0x3a97b5(0x122)]('Project\x20cloned\x20with\x20errors')):console[_0x3a97b5(0x10c)](a4_0x582d5d[_0x3a97b5(0x134)](_0x3a97b5(0x166)));console[_0x3a97b5(0x10c)](_0x3a97b5(0x17f)+_0x34c50c[_0x3a97b5(0x119)]),console[_0x3a97b5(0x10c)](_0x3a97b5(0x105)+_0x34c50c[_0x3a97b5(0xd3)]),console['log'](_0x3a97b5(0xee)+_0x34c50c[_0x3a97b5(0xda)]),console[_0x3a97b5(0x10c)](),console['log'](_0x3a97b5(0x14a)),console['log'](_0x3a97b5(0x11a)+formatCountSummary(_0x34c50c[_0x3a97b5(0x13c)][_0x3a97b5(0xd5)])),console[_0x3a97b5(0x10c)](_0x3a97b5(0x10f)+formatCountSummary(_0x34c50c[_0x3a97b5(0x13c)][_0x3a97b5(0x115)])),console[_0x3a97b5(0x10c)](_0x3a97b5(0x168)+formatCountSummary(_0x34c50c[_0x3a97b5(0x13c)][_0x3a97b5(0x172)])),console[_0x3a97b5(0x10c)](_0x3a97b5(0x17e)+formatCountSummary(_0x34c50c[_0x3a97b5(0x13c)][_0x3a97b5(0x135)]));const _0x16a7de=_0x34c50c['counts']['experimentalKnowledgeBases'][_0x3a97b5(0xcf)]>0x0||_0x34c50c[_0x3a97b5(0x13c)][_0x3a97b5(0xdf)][_0x3a97b5(0x142)]>0x0||_0x34c50c[_0x3a97b5(0x13c)]['experimentalKnowledgeBases'][_0x3a97b5(0x17b)]>0x0||_0x34c50c['counts'][_0x3a97b5(0x163)][_0x3a97b5(0xcf)]>0x0||_0x34c50c[_0x3a97b5(0x13c)][_0x3a97b5(0x163)][_0x3a97b5(0x142)]>0x0||_0x34c50c[_0x3a97b5(0x13c)][_0x3a97b5(0x163)][_0x3a97b5(0x17b)]>0x0;_0x16a7de&&(console[_0x3a97b5(0x10c)](_0x3a97b5(0x12d)+formatCountSummary(_0x34c50c[_0x3a97b5(0x13c)][_0x3a97b5(0xdf)])),console[_0x3a97b5(0x10c)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x34c50c[_0x3a97b5(0x13c)][_0x3a97b5(0x163)])));if(_0x23c520){console[_0x3a97b5(0x10c)](),console['log'](a4_0x582d5d[_0x3a97b5(0x108)](_0x3a97b5(0x13d)));for(const _0x25811e of _0x34c50c[_0x3a97b5(0xd5)]){_0x25811e[_0x3a97b5(0x176)]===_0x3a97b5(0xd2)&&console[_0x3a97b5(0x10c)](a4_0x582d5d[_0x3a97b5(0x108)](_0x3a97b5(0x185)+_0x25811e[_0x3a97b5(0x152)]+'\x22:\x20'+_0x25811e[_0x3a97b5(0xd2)]));}for(const _0x2733e1 of _0x34c50c['knowledgeBases']){_0x2733e1[_0x3a97b5(0x176)]===_0x3a97b5(0xd2)&&console[_0x3a97b5(0x10c)](a4_0x582d5d[_0x3a97b5(0x108)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x2733e1[_0x3a97b5(0x112)]+'\x22:\x20'+_0x2733e1[_0x3a97b5(0xd2)]));}for(const _0x5cd208 of _0x34c50c[_0x3a97b5(0x172)]){_0x5cd208[_0x3a97b5(0x176)]===_0x3a97b5(0xd2)&&console['log'](a4_0x582d5d[_0x3a97b5(0x108)](_0x3a97b5(0x148)+_0x5cd208[_0x3a97b5(0x112)]+_0x3a97b5(0x127)+_0x5cd208['error']));}for(const _0x4f5b40 of _0x34c50c['integrations']){_0x4f5b40['action']===_0x3a97b5(0xd2)&&console[_0x3a97b5(0x10c)](a4_0x582d5d[_0x3a97b5(0x108)](_0x3a97b5(0x16d)+_0x4f5b40['name']+'\x22:\x20'+_0x4f5b40[_0x3a97b5(0xd2)]));}for(const _0xfa96e2 of _0x34c50c[_0x3a97b5(0xdf)]){_0xfa96e2[_0x3a97b5(0x176)]===_0x3a97b5(0xd2)&&console['log'](a4_0x582d5d[_0x3a97b5(0x108)](_0x3a97b5(0xf9)+_0xfa96e2[_0x3a97b5(0x112)]+'\x22:\x20'+_0xfa96e2[_0x3a97b5(0xd2)]));}for(const _0x15c1c5 of _0x34c50c[_0x3a97b5(0x163)]){_0x15c1c5[_0x3a97b5(0x176)]===_0x3a97b5(0xd2)&&console['log'](a4_0x582d5d[_0x3a97b5(0x108)](_0x3a97b5(0xe6)+_0x15c1c5[_0x3a97b5(0x112)]+_0x3a97b5(0x127)+_0x15c1c5[_0x3a97b5(0xd2)]));}return 0x1;}console[_0x3a97b5(0x10c)]();const _0x5e6040=getLLMProjectUrl(_0x2af459,_0x34c50c['newProjectId']);return console[_0x3a97b5(0x10c)]('Project:\x20'+a4_0x582d5d[_0x3a97b5(0x15b)](_0x5e6040)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x20fc4f(0x112)]=a4_0x20fc4f(0x118);[a4_0x20fc4f(0x10b)]=a4_0x20fc4f(0xd0);async[a4_0x20fc4f(0xfa)](_0x2bf788){const _0x2d2039=a4_0x20fc4f,{options:_0x1e136d,args:_0x2ed364,tdx:_0x4ce3b5}=_0x2bf788;let _0x4a76a8=_0x2ed364[0x0]||process[_0x2d2039(0x14d)]();const _0x525477=_0x1e136d[_0x2d2039(0x123)],_0x2e0640=_0x1e136d['force'],_0x270dcf=_0x1e136d[_0x2d2039(0x164)],_0x167493=_0x1e136d['site'],_0x3ba2ad=a4_0x23dbd1[_0x2d2039(0x16f)](_0x4a76a8,_0x2d2039(0x13f)),_0x5e5c74=existsSync(_0x3ba2ad);if(_0x5e5c74){const {data:_0x4fef49}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x4a76a8+_0x2d2039(0x16a),()=>_0x4ce3b5[_0x2d2039(0xfc)][_0x2d2039(0x13a)](_0x4a76a8,{'dryRun':_0x525477,'force':_0x2e0640}));if(_0x525477)return console['log'](a4_0x582d5d[_0x2d2039(0x122)](_0x2d2039(0xed))),console[_0x2d2039(0x10c)]('Would\x20push\x20agent:\x20'+_0x4fef49[_0x2d2039(0x152)]),0x0;if(_0x4fef49['action']==='error')return console['log'](a4_0x582d5d[_0x2d2039(0x108)](_0x2d2039(0xe9)+_0x4fef49[_0x2d2039(0xd2)])),0x1;console[_0x2d2039(0x10c)](a4_0x582d5d[_0x2d2039(0x134)](_0x2d2039(0x117)+_0x4fef49['action']+_0x2d2039(0x104))),console[_0x2d2039(0x10c)](_0x2d2039(0xf8)+_0x4fef49[_0x2d2039(0x152)]);if(_0x4fef49[_0x2d2039(0x125)]&&_0x4fef49['projectId']){const _0x227587=getLLMAgentChatUrl(_0x167493,_0x4fef49[_0x2d2039(0x14e)],_0x4fef49[_0x2d2039(0x125)]);console[_0x2d2039(0x10c)]('Chat:\x20'+a4_0x582d5d[_0x2d2039(0x15b)](_0x227587));}return 0x0;}const _0x3713f0=_0x1e136d[_0x2d2039(0x12a)],_0x5ce65a=resolveProjectFromContext(_0x4a76a8,_0x3713f0);if(_0x5ce65a['found'])_0x4a76a8=_0x5ce65a['projectDir'],_0x5ce65a[_0x2d2039(0x12c)]===_0x2d2039(0x159)&&console[_0x2d2039(0x10c)](a4_0x582d5d[_0x2d2039(0x17c)](_0x2d2039(0xff)+_0x4a76a8));else{let _0x1640bd=_0x2d2039(0xde);_0x5ce65a['reason']===_0x2d2039(0xe7)&&(_0x1640bd=_0x5ce65a[_0x2d2039(0x14b)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x5ce65a[_0x2d2039(0x12a)]+_0x2d2039(0x169));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5ce65a[_0x2d2039(0x171)]==='no_context'?_0x5ce65a[_0x2d2039(0x14b)]:_0x2d2039(0x145)+_0x4a76a8,undefined,{'helpText':_0x1640bd});}const {data:_0x427e83}=await withSpinner(_0x2d2039(0xf6),()=>_0x4ce3b5[_0x2d2039(0xfc)]['pushProject'](_0x4a76a8,{'dryRun':!![]})),_0xda6baa=_0x427e83[_0x2d2039(0x13c)][_0x2d2039(0xd5)][_0x2d2039(0x177)]>0x0;if(_0xda6baa){console['log'](a4_0x582d5d[_0x2d2039(0x108)](_0x2d2039(0x16e)));for(const _0x4ef4d7 of _0x427e83['agents']){_0x4ef4d7[_0x2d2039(0x176)]===_0x2d2039(0xd2)&&console[_0x2d2039(0x10c)](a4_0x582d5d['red'](_0x2d2039(0x185)+_0x4ef4d7['agentName']+_0x2d2039(0x127)+_0x4ef4d7[_0x2d2039(0xd2)]));}return 0x1;}const _0x5da46b=_0x427e83['counts'][_0x2d2039(0xd5)]['created']+_0x427e83['counts']['knowledgeBases'][_0x2d2039(0xcf)]+_0x427e83['counts'][_0x2d2039(0x170)][_0x2d2039(0xcf)]+_0x427e83[_0x2d2039(0x13c)][_0x2d2039(0x172)]['created']+_0x427e83[_0x2d2039(0x13c)][_0x2d2039(0x135)][_0x2d2039(0xcf)]+_0x427e83[_0x2d2039(0x13c)][_0x2d2039(0xdf)][_0x2d2039(0xcf)]+_0x427e83[_0x2d2039(0x13c)][_0x2d2039(0x163)][_0x2d2039(0xcf)],_0x40361b=_0x427e83[_0x2d2039(0x13c)][_0x2d2039(0xd5)][_0x2d2039(0x142)]+_0x427e83[_0x2d2039(0x13c)][_0x2d2039(0x115)]['updated']+_0x427e83['counts'][_0x2d2039(0x170)][_0x2d2039(0x142)]+_0x427e83['counts'][_0x2d2039(0x172)][_0x2d2039(0x142)]+_0x427e83['counts'][_0x2d2039(0x135)][_0x2d2039(0x142)]+_0x427e83[_0x2d2039(0x13c)][_0x2d2039(0xdf)]['updated']+_0x427e83['counts'][_0x2d2039(0x163)][_0x2d2039(0x142)],_0x554bc0=_0x427e83['counts'][_0x2d2039(0xd5)][_0x2d2039(0x17b)]+_0x427e83[_0x2d2039(0x13c)][_0x2d2039(0x115)][_0x2d2039(0x17b)]+_0x427e83[_0x2d2039(0x13c)][_0x2d2039(0x170)][_0x2d2039(0x17b)]+_0x427e83['counts'][_0x2d2039(0x172)][_0x2d2039(0x17b)]+_0x427e83['counts']['integrations']['unchanged']+_0x427e83['counts'][_0x2d2039(0xdf)][_0x2d2039(0x17b)]+_0x427e83[_0x2d2039(0x13c)][_0x2d2039(0x163)][_0x2d2039(0x17b)];console['log'](_0x2d2039(0x173)+_0x427e83[_0x2d2039(0x149)]+'\x27:'),console['log']('\x20\x20'+a4_0x582d5d[_0x2d2039(0x134)]('+\x20'+_0x5da46b+_0x2d2039(0xfe))+_0x2d2039(0xfd)+a4_0x582d5d[_0x2d2039(0x122)]('~\x20'+_0x40361b+'\x20changed')+_0x2d2039(0xfd)+a4_0x582d5d[_0x2d2039(0x17c)]('=\x20'+_0x554bc0+'\x20unchanged')),console[_0x2d2039(0x10c)](_0x2d2039(0x11a)+formatCountSummary(_0x427e83[_0x2d2039(0x13c)][_0x2d2039(0xd5)])),console[_0x2d2039(0x10c)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x427e83[_0x2d2039(0x13c)][_0x2d2039(0x115)])),console[_0x2d2039(0x10c)](_0x2d2039(0x110)+formatCountSummary(_0x427e83['counts']['textKnowledgeBases'])),console[_0x2d2039(0x10c)](_0x2d2039(0x168)+formatCountSummary(_0x427e83[_0x2d2039(0x13c)]['prompts'])),console[_0x2d2039(0x10c)](_0x2d2039(0x17e)+formatCountSummary(_0x427e83[_0x2d2039(0x13c)][_0x2d2039(0x135)]));const _0x44c65a=_0x427e83[_0x2d2039(0x13c)][_0x2d2039(0xdf)][_0x2d2039(0xcf)]>0x0||_0x427e83[_0x2d2039(0x13c)]['experimentalKnowledgeBases']['updated']>0x0||_0x427e83[_0x2d2039(0x13c)][_0x2d2039(0xdf)][_0x2d2039(0x17b)]>0x0||_0x427e83['counts'][_0x2d2039(0x163)][_0x2d2039(0xcf)]>0x0||_0x427e83[_0x2d2039(0x13c)][_0x2d2039(0x163)][_0x2d2039(0x142)]>0x0||_0x427e83[_0x2d2039(0x13c)]['experimentalArtifacts'][_0x2d2039(0x17b)]>0x0;_0x44c65a&&(console[_0x2d2039(0x10c)](_0x2d2039(0x12d)+formatCountSummary(_0x427e83[_0x2d2039(0x13c)]['experimentalKnowledgeBases'])),console[_0x2d2039(0x10c)](_0x2d2039(0x183)+formatCountSummary(_0x427e83[_0x2d2039(0x13c)][_0x2d2039(0x163)])));console[_0x2d2039(0x10c)]('\x20\x20Source:\x20'+a4_0x582d5d[_0x2d2039(0x15b)](_0x4a76a8)),displayDiffs(_0x427e83[_0x2d2039(0xd5)],_0x427e83[_0x2d2039(0x115)],_0x427e83[_0x2d2039(0x170)],_0x427e83[_0x2d2039(0x172)],_0x427e83['integrations'],_0x427e83['experimentalKnowledgeBases'],_0x427e83[_0x2d2039(0x163)]);if(_0x525477)return console[_0x2d2039(0x10c)](a4_0x582d5d[_0x2d2039(0x122)](_0x2d2039(0x150))),0x0;if(_0x5da46b===0x0&&_0x40361b===0x0){console[_0x2d2039(0x10c)](a4_0x582d5d[_0x2d2039(0x134)](_0x2d2039(0x132)));const _0x3fcde8=getLLMProjectUrl(_0x167493,_0x427e83[_0x2d2039(0x14e)]);return console[_0x2d2039(0x10c)](_0x2d2039(0xd4)+a4_0x582d5d[_0x2d2039(0x15b)](_0x3fcde8)),0x0;}if(!_0x270dcf&&!_0x2e0640){if(!isInteractive())return console['error'](a4_0x582d5d['red'](_0x2d2039(0x10d)),_0x2d2039(0x181)),console['error'](a4_0x582d5d[_0x2d2039(0x17c)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2e584d=await confirmKey(_0x2d2039(0x15c)+(_0x5da46b+_0x40361b)+'\x20resources?');if(!_0x2e584d)return console['log'](a4_0x582d5d[_0x2d2039(0x122)]('Cancelled'),_0x2d2039(0x136)),0x1;}const {data:_0x50d044}=await withSpinner('Pushing\x20to\x20project...',()=>_0x4ce3b5[_0x2d2039(0xfc)]['pushProject'](_0x4a76a8,{'force':_0x2e0640})),_0x4fde86=_0x50d044[_0x2d2039(0x13c)][_0x2d2039(0xd5)][_0x2d2039(0x177)]>0x0||_0x50d044['counts'][_0x2d2039(0x115)][_0x2d2039(0x177)]>0x0||_0x50d044['counts'][_0x2d2039(0x170)][_0x2d2039(0x177)]>0x0||_0x50d044[_0x2d2039(0x13c)][_0x2d2039(0x172)][_0x2d2039(0x177)]>0x0;if(_0x4fde86){console['log'](a4_0x582d5d[_0x2d2039(0x122)](_0x2d2039(0x156))),console[_0x2d2039(0x10c)](),console[_0x2d2039(0x10c)](a4_0x582d5d[_0x2d2039(0x108)](_0x2d2039(0x13d)));for(const _0x352315 of _0x50d044[_0x2d2039(0xd5)]){_0x352315[_0x2d2039(0x176)]===_0x2d2039(0xd2)&&console[_0x2d2039(0x10c)](a4_0x582d5d[_0x2d2039(0x108)](_0x2d2039(0x185)+_0x352315[_0x2d2039(0x152)]+_0x2d2039(0x127)+_0x352315[_0x2d2039(0xd2)]));}for(const _0x1f4556 of _0x50d044['knowledgeBases']){_0x1f4556[_0x2d2039(0x176)]===_0x2d2039(0xd2)&&console['log'](a4_0x582d5d[_0x2d2039(0x108)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x1f4556['name']+_0x2d2039(0x127)+_0x1f4556[_0x2d2039(0xd2)]));}for(const _0x546bcd of _0x50d044[_0x2d2039(0x170)]){_0x546bcd['action']===_0x2d2039(0xd2)&&console['log'](a4_0x582d5d[_0x2d2039(0x108)](_0x2d2039(0x120)+_0x546bcd[_0x2d2039(0x112)]+_0x2d2039(0x127)+_0x546bcd['error']));}for(const _0x16014b of _0x50d044[_0x2d2039(0x172)]){_0x16014b['action']==='error'&&console[_0x2d2039(0x10c)](a4_0x582d5d[_0x2d2039(0x108)]('\x20\x20Prompt\x20\x22'+_0x16014b[_0x2d2039(0x112)]+_0x2d2039(0x127)+_0x16014b[_0x2d2039(0xd2)]));}for(const _0x476afa of _0x50d044[_0x2d2039(0x135)]){_0x476afa[_0x2d2039(0x176)]==='error'&&console[_0x2d2039(0x10c)](a4_0x582d5d[_0x2d2039(0x108)](_0x2d2039(0x16d)+_0x476afa[_0x2d2039(0x112)]+'\x22:\x20'+_0x476afa[_0x2d2039(0xd2)]));}return 0x1;}console['log'](a4_0x582d5d[_0x2d2039(0x134)](_0x2d2039(0xef)+(_0x5da46b+_0x40361b)+_0x2d2039(0xe8)+_0x50d044[_0x2d2039(0x149)]+'\x27'));const _0x5a7329=getLLMProjectUrl(_0x167493,_0x50d044['projectId']);return console[_0x2d2039(0x10c)](_0x2d2039(0xd4)+a4_0x582d5d[_0x2d2039(0x15b)](_0x5a7329)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x5e3a8c=a5_0x38ef;(function(_0x4c7384,_0x3aecfe){const _0x519a28=a5_0x38ef,_0x32ddb6=_0x4c7384();while(!![]){try{const _0x1c228c=-parseInt(_0x519a28(0x113))/0x1*(-parseInt(_0x519a28(0x13f))/0x2)+-parseInt(_0x519a28(0xde))/0x3*(-parseInt(_0x519a28(0xfb))/0x4)+parseInt(_0x519a28(0xd4))/0x5*(parseInt(_0x519a28(0x144))/0x6)+-parseInt(_0x519a28(0xf4))/0x7+-parseInt(_0x519a28(0x133))/0x8+-parseInt(_0x519a28(0x106))/0x9*(parseInt(_0x519a28(0xe8))/0xa)+parseInt(_0x519a28(0x115))/0xb*(parseInt(_0x519a28(0x137))/0xc);if(_0x1c228c===_0x3aecfe)break;else _0x32ddb6['push'](_0x32ddb6['shift']());}catch(_0x5d5798){_0x32ddb6['push'](_0x32ddb6['shift']());}}}(a5_0x6f41,0x7c87e));import*as a5_0x596e83 from'node:fs';function a5_0x6f41(){const _0x1d7961=['message','white','\x20\x20Site:\x20','Failed:\x20\x20\x20','includes','64797aMXxfs','\x20(cached)','11lQgWza','No\x20tests\x20found\x20with\x20tags:\x20','resolve','stop','source','isSpinning','json','\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','Conversation\x20URL:\x20','Re-evaluating\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','404','no_tests','join','green','New\x20tests\x20to\x20execute:\x20','Passed:\x20\x20\x20','table','✗\x20FAIL:\x20','agent:test','PASS','Re-evaluating...','Error:\x20No\x20previous\x20test\x20run\x20found.','red','execute','\x20-\x20','name','Round\x201/','found','dim','501376nlQzJb','llmProject','Agent:\x20','\x20\x20Project:\x20','6162792lenzQi','reason','length','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','jsonl','map','\x20\x20Round\x20','conversations','22ZFJLfP','toISOString','timestamp','Evaluating\x20response...','dryRun','1864542bxoKIB','Run\x20\x27tdx\x20agent\x20pull\x20','push','\x20\x20Agent:\x20','start','Failed\x20Tests:','status','site','text','Test\x20Configuration:','Usage:','existsSync',':\x20Sending\x20user\x20input...','Total:\x20\x20\x20\x20','yellow','filter','add','toLowerCase','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','...','tests','llm','\x22:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','executeReeval','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','cyan','writeFileSync','Re-evaluating\x20cached\x20test\x20run...','Site:\x20','10xpRgYN','Running\x20test:\x20','split','Output\x20written\x20to:\x20','reeval','ERROR','some','projectName','resolveProjectId','...\x20','698553OAoYml','not\x20found','⚠\x20SKIPPED:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','projectDir','Cached\x20run\x20from:\x20','tags','✗\x20ERROR:\x20','resolveAgentId','conversation_url','2197330IEcNJr','utf-8','Error\x20writing\x20output\x20file:\x20','size','agentDirs','agent','output','Errors:\x20\x20\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','rounds','no_context','Running:\x20','4403112AzfvxP','now','log','Round\x20','\x20\x20Conversation:\x20','No\x20tests\x20have\x20tags\x20defined.','FAIL','4QwuFnu','repeat','Run\x20tests\x20for\x20an\x20LLM\x20agent','\x22,\x20but\x20current\x20site\x20is\x20\x22','\x20\x20Evaluating...\x20','trim','tsv','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Duration:\x20','agentName','\x20(new)','36QjGjYb','forEach','Either\x20switch\x20to\x20the\x20\x22','Test\x20Summary','substring','eval','✓\x20PASS:\x20','Using\x20agent:\x20'];a5_0x6f41=function(){return _0x1d7961;};return a5_0x6f41();}import*as a5_0x2a1811 from'node:path';import a5_0x225b3b from'chalk';function a5_0x38ef(_0x5c5738,_0x246f30){_0x5c5738=_0x5c5738-0xd2;const _0x6f4129=a5_0x6f41();let _0x38effe=_0x6f4129[_0x5c5738];return _0x38effe;}import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x5e3a8c(0x12f)]=a5_0x5e3a8c(0x128);['description']=a5_0x5e3a8c(0xfd);async[a5_0x5e3a8c(0x12d)](_0x18cbec){const _0x4b150b=a5_0x5e3a8c,{options:_0x558fc9,args:_0xb74ac1,tdx:_0x248516}=_0x18cbec,_0x298f3d=_0xb74ac1[0x0]||'.',_0x518229=_0x558fc9[_0x4b150b(0x143)],_0x2ec385=_0x558fc9,_0x1a85cf=_0x2ec385[_0x4b150b(0x10b)]===![],_0x481fd1=_0x2ec385[_0x4b150b(0xd8)],_0x3c76bd=_0x2ec385[_0x4b150b(0x12f)],_0xa36379=_0x2ec385[_0x4b150b(0xe4)],_0x1af158=_0x558fc9['site'],_0xe68694=_0x2ec385[_0x4b150b(0xee)];if(_0x481fd1&&_0x1a85cf)return console[_0x4b150b(0xf6)](a5_0x225b3b[_0x4b150b(0x12c)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0xa191e0='table';if(_0x2ec385[_0x4b150b(0x11b)])_0xa191e0=_0x4b150b(0x11b);else{if(_0x2ec385[_0x4b150b(0x13b)])_0xa191e0=_0x4b150b(0x13b);else{if(_0x2ec385[_0x4b150b(0x101)])_0xa191e0=_0x4b150b(0x101);else{if(_0x2ec385[_0x4b150b(0x126)])_0xa191e0=_0x4b150b(0x126);}}}const _0x372b12=_0x2ec385[_0x4b150b(0x134)];let _0x3ad3e2=_0x298f3d;const _0x13b536=a5_0x596e83[_0x4b150b(0x14f)](_0x298f3d),_0x986d5b=_0x298f3d==='.';if(!_0x13b536||_0x986d5b){const _0x15f7c0=resolveProjectFromContext(_0x298f3d,_0x372b12,{'requireFile':'test.yml'});if(_0x15f7c0[_0x4b150b(0x131)])_0x3ad3e2=_0x15f7c0[_0x4b150b(0xe2)],_0x15f7c0[_0x4b150b(0x119)]==='context'&&console[_0x4b150b(0xf6)](a5_0x225b3b[_0x4b150b(0x132)](_0x4b150b(0x10d)+_0x3ad3e2));else switch(_0x15f7c0[_0x4b150b(0x138)]){case _0x4b150b(0xf2):console['log'](a5_0x225b3b['yellow'](_0x15f7c0[_0x4b150b(0x10e)])),console[_0x4b150b(0xf6)](),console[_0x4b150b(0xf6)](_0x4b150b(0x14e)),console[_0x4b150b(0xf6)](_0x4b150b(0x11c)),console[_0x4b150b(0xf6)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x4b150b(0xf6)](),console[_0x4b150b(0xf6)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case'no_local_folder':console[_0x4b150b(0xf6)](a5_0x225b3b[_0x4b150b(0x152)](_0x15f7c0[_0x4b150b(0x10e)])),console[_0x4b150b(0xf6)](),console[_0x4b150b(0xf6)](_0x4b150b(0x145)+_0x15f7c0[_0x4b150b(0x134)]+_0x4b150b(0xe1));return 0x1;case'multiple_agents':{const _0x316b60=a5_0x2a1811['basename'](_0x15f7c0[_0x4b150b(0xe2)]);console[_0x4b150b(0xf6)](a5_0x225b3b['yellow']('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x15f7c0[_0x4b150b(0x134)]+'\x22:'));for(const _0x3fd8ff of _0x15f7c0[_0x4b150b(0xec)]){console['log']('\x20\x20-\x20'+_0x3fd8ff);}return console[_0x4b150b(0xf6)](),console[_0x4b150b(0xf6)](_0x4b150b(0x11f)+_0x316b60+'/<agent-name>'),0x1;}case _0x4b150b(0x121):console['log'](a5_0x225b3b[_0x4b150b(0x152)](_0x4b150b(0x102)+_0x15f7c0['llmProject']+'\x22.')),console[_0x4b150b(0xf6)](a5_0x225b3b['dim']('Project\x20path:\x20'+_0x15f7c0[_0x4b150b(0xe2)])),console[_0x4b150b(0xf6)](),console['log']('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x5a6dd9,agentInfo:_0x5d2a4d}=parseTestFile(_0x3ad3e2);let _0x57bd2d=_0x5a6dd9[_0x4b150b(0x159)];if(_0x3c76bd){const _0xe2e1e2=_0x3c76bd[_0x4b150b(0xd6)](',')[_0x4b150b(0x13c)](_0x17d13b=>_0x17d13b['trim']());_0x57bd2d=_0x5a6dd9[_0x4b150b(0x159)]['filter'](_0xfffd71=>_0xe2e1e2['includes'](_0xfffd71['name']));if(_0x57bd2d['length']===0x0)return console['log'](a5_0x225b3b[_0x4b150b(0x152)]('No\x20tests\x20found\x20matching:\x20'+_0x3c76bd)),console['log'](a5_0x225b3b['dim']('Available\x20tests:\x20'+_0x5a6dd9[_0x4b150b(0x159)][_0x4b150b(0x13c)](_0xae02e=>_0xae02e[_0x4b150b(0x12f)])[_0x4b150b(0x122)](',\x20'))),0x1;}if(_0xa36379){const _0x5e5b39=_0xa36379['split'](',')[_0x4b150b(0x13c)](_0xb71a36=>_0xb71a36[_0x4b150b(0x100)]()[_0x4b150b(0x155)]());_0x57bd2d=_0x57bd2d['filter'](_0x5302a1=>_0x5302a1[_0x4b150b(0xe4)]?.[_0x4b150b(0xda)](_0x212f3e=>_0x5e5b39[_0x4b150b(0x112)](_0x212f3e['toLowerCase']())));if(_0x57bd2d['length']===0x0){console['log'](a5_0x225b3b[_0x4b150b(0x152)](_0x4b150b(0x116)+_0xa36379));const _0x15871c=new Set();return _0x5a6dd9[_0x4b150b(0x159)][_0x4b150b(0x107)](_0x398bc1=>_0x398bc1['tags']?.['forEach'](_0x1eddaa=>_0x15871c[_0x4b150b(0x154)](_0x1eddaa))),_0x15871c[_0x4b150b(0xeb)]>0x0?console[_0x4b150b(0xf6)](a5_0x225b3b[_0x4b150b(0x132)]('Available\x20tags:\x20'+[..._0x15871c][_0x4b150b(0x122)](',\x20'))):console[_0x4b150b(0xf6)](a5_0x225b3b[_0x4b150b(0x132)](_0x4b150b(0xf9))),0x1;}}if(_0x481fd1)return this[_0x4b150b(0x15d)](_0x18cbec,{'definition':{'tests':_0x57bd2d},'agentInfo':_0x5d2a4d,'outputFormat':_0xa191e0,'outputFile':_0xe68694,'testNames':_0x3c76bd});if(_0x518229){console[_0x4b150b(0xf6)](a5_0x225b3b[_0x4b150b(0x15f)](_0x4b150b(0x14d))),console[_0x4b150b(0xf6)](_0x4b150b(0x110)+a5_0x225b3b[_0x4b150b(0x10f)](_0x1af158)),console[_0x4b150b(0xf6)](_0x4b150b(0x136)+a5_0x225b3b[_0x4b150b(0x10f)](_0x5d2a4d[_0x4b150b(0xdb)])),console['log'](_0x4b150b(0x147)+a5_0x225b3b[_0x4b150b(0x10f)](_0x5d2a4d[_0x4b150b(0x104)])),console[_0x4b150b(0xf6)](),console[_0x4b150b(0xf6)]('Tests\x20found:\x20'+a5_0x225b3b[_0x4b150b(0x10f)](_0x57bd2d[_0x4b150b(0x139)]));for(let _0x1de33f=0x0;_0x1de33f<_0x57bd2d[_0x4b150b(0x139)];_0x1de33f++){const _0x359a3d=_0x57bd2d[_0x1de33f],_0x28d024=_0x359a3d[_0x4b150b(0xf1)][_0x4b150b(0x139)]===0x1?'round':_0x4b150b(0xf1),_0x2b7ddd=_0x359a3d['tags']?.[_0x4b150b(0x139)]?'\x20['+_0x359a3d[_0x4b150b(0xe4)]['join'](',\x20')+']':'';console['log']('\x20\x20'+(_0x1de33f+0x1)+'.\x20'+a5_0x225b3b[_0x4b150b(0x10f)](_0x359a3d[_0x4b150b(0x12f)])+'\x20('+_0x359a3d[_0x4b150b(0xf1)][_0x4b150b(0x139)]+'\x20'+_0x28d024+')'+a5_0x225b3b[_0x4b150b(0x132)](_0x2b7ddd));}return 0x0;}let _0x40cff0,_0x862e57;try{_0x40cff0=await _0x248516[_0x4b150b(0x15a)][_0x4b150b(0xdc)](_0x5d2a4d['projectName']);}catch(_0x54f173){const _0x20d1e5=_0x54f173 instanceof Error?_0x54f173['message']:String(_0x54f173);return _0x20d1e5[_0x4b150b(0x112)](_0x4b150b(0x120))||_0x20d1e5[_0x4b150b(0x155)]()[_0x4b150b(0x112)](_0x4b150b(0xdf))?console[_0x4b150b(0xf6)](a5_0x225b3b[_0x4b150b(0x12c)](_0x4b150b(0x15c)+_0x5d2a4d[_0x4b150b(0xdb)])):console[_0x4b150b(0xf6)](a5_0x225b3b['red'](_0x4b150b(0x15e)+_0x5d2a4d['projectName']+_0x4b150b(0x15b)+_0x20d1e5)),0x1;}try{_0x862e57=await _0x248516[_0x4b150b(0x15a)][_0x4b150b(0xe6)](_0x5d2a4d[_0x4b150b(0x104)],_0x40cff0);}catch(_0x4bdb9b){const _0x591f0d=_0x4bdb9b instanceof Error?_0x4bdb9b[_0x4b150b(0x10e)]:String(_0x4bdb9b);return _0x591f0d[_0x4b150b(0x112)](_0x4b150b(0x120))||_0x591f0d[_0x4b150b(0x155)]()[_0x4b150b(0x112)](_0x4b150b(0xdf))?console[_0x4b150b(0xf6)](a5_0x225b3b['red'](_0x4b150b(0x157)+_0x5d2a4d['agentName'])):console[_0x4b150b(0xf6)](a5_0x225b3b['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x5d2a4d[_0x4b150b(0x104)]+_0x4b150b(0x15b)+_0x591f0d)),0x1;}let _0x14888f;if(!_0x1a85cf)try{_0x14888f=await setupEvaluatorAgent(_0x248516[_0x4b150b(0x15a)],_0x558fc9['verbose']);}catch(_0x90b2ab){const _0x59a85d=_0x90b2ab instanceof Error?_0x90b2ab['message']:String(_0x90b2ab);return console[_0x4b150b(0xf6)](a5_0x225b3b[_0x4b150b(0x12c)](_0x4b150b(0xf0)+_0x59a85d)),0x1;}console[_0x4b150b(0xf6)](a5_0x225b3b['cyan']('Running\x20agent\x20tests...')),console[_0x4b150b(0xf6)](_0x4b150b(0xd3)+a5_0x225b3b[_0x4b150b(0x10f)](_0x1af158)),console['log'](_0x4b150b(0x135)+a5_0x225b3b['white'](_0x5d2a4d['projectName']+'/'+_0x5d2a4d[_0x4b150b(0x104)])),console[_0x4b150b(0xf6)]();const _0x546505=[],_0x4a6fb5=[],_0x5cbed3=Date['now']();for(let _0x39635c=0x0;_0x39635c<_0x57bd2d[_0x4b150b(0x139)];_0x39635c++){const _0x441bf3=_0x57bd2d[_0x39635c];_0x57bd2d[_0x4b150b(0x139)]>0x1?console['log']('Test\x20'+(_0x39635c+0x1)+'/'+_0x57bd2d[_0x4b150b(0x139)]+':\x20'+a5_0x225b3b['white'](_0x441bf3[_0x4b150b(0x12f)])):console['log'](_0x4b150b(0xd5)+a5_0x225b3b[_0x4b150b(0x10f)](_0x441bf3['name']));const _0x3ed2b9=createCommandSpinner(_0x4b150b(0x130)+_0x441bf3[_0x4b150b(0xf1)][_0x4b150b(0x139)]+_0x4b150b(0x150));_0x3ed2b9[_0x4b150b(0x148)]();try{const {result:_0x2b1e2c,conversation:_0x3fd27c}=await runTest(_0x248516[_0x4b150b(0x15a)],_0x441bf3,{'agentId':_0x862e57,'projectId':_0x40cff0,'site':_0x1af158,'noEval':_0x1a85cf,'evaluatorId':_0x14888f,'onRoundStart':(_0x388b95,_0x4c7f7f)=>{const _0x1eed3b=_0x4b150b;_0x3ed2b9[_0x1eed3b(0x14c)]=_0x1eed3b(0xf7)+(_0x388b95+0x1)+'/'+_0x4c7f7f+_0x1eed3b(0x150);},'onRoundComplete':(_0x51dc07,_0x302dbb,_0xfc057b)=>{const _0x171d5a=_0x4b150b,_0x26c2fc=formatElapsed(_0x302dbb);_0xfc057b?console[_0x171d5a(0xf6)](_0x171d5a(0x13d)+(_0x51dc07+0x1)+'/'+_0x441bf3[_0x171d5a(0xf1)][_0x171d5a(0x139)]+_0x171d5a(0xdd)+a5_0x225b3b['green']('✓')+'\x20('+_0x26c2fc+')'):console['log'](_0x171d5a(0x13d)+(_0x51dc07+0x1)+'/'+_0x441bf3[_0x171d5a(0xf1)][_0x171d5a(0x139)]+_0x171d5a(0xdd)+a5_0x225b3b[_0x171d5a(0x12c)]('✗'));},'onEvaluationStart':()=>{const _0x30ff60=_0x4b150b;_0x3ed2b9[_0x30ff60(0x14c)]=_0x30ff60(0x142);},'onEvaluationComplete':_0x23d679=>{const _0x180a87=_0x4b150b,_0x490187=formatElapsed(_0x23d679);console[_0x180a87(0xf6)](_0x180a87(0xff)+a5_0x225b3b[_0x180a87(0x123)]('✓')+'\x20('+_0x490187+')');}});_0x3ed2b9[_0x4b150b(0x118)](),_0x546505[_0x4b150b(0x146)](_0x2b1e2c),_0x4a6fb5[_0x4b150b(0x146)](_0x3fd27c);if(_0x2b1e2c[_0x4b150b(0x14a)]===_0x4b150b(0x129))console['log'](a5_0x225b3b[_0x4b150b(0x123)](_0x4b150b(0x10c)+_0x2b1e2c['reason']));else _0x2b1e2c[_0x4b150b(0x14a)]===_0x4b150b(0xfa)?console[_0x4b150b(0xf6)](a5_0x225b3b[_0x4b150b(0x12c)]('✗\x20FAIL:\x20'+_0x2b1e2c[_0x4b150b(0x138)])):console[_0x4b150b(0xf6)](a5_0x225b3b[_0x4b150b(0x12c)](_0x4b150b(0xe5)+_0x2b1e2c['reason']));_0x2b1e2c[_0x4b150b(0xe7)]&&console[_0x4b150b(0xf6)](a5_0x225b3b[_0x4b150b(0x132)](_0x4b150b(0x11d)+_0x2b1e2c[_0x4b150b(0xe7)])),console['log']();}catch(_0x2dac1d){_0x3ed2b9[_0x4b150b(0x118)]();const _0x2b8bfa=_0x2dac1d instanceof Error?_0x2dac1d[_0x4b150b(0x10e)]:String(_0x2dac1d);console['log'](a5_0x225b3b[_0x4b150b(0x12c)](_0x4b150b(0xe5)+_0x2b8bfa)),console[_0x4b150b(0xf6)](),_0x546505[_0x4b150b(0x146)]({'name':_0x441bf3[_0x4b150b(0x12f)],'status':'ERROR','reason':_0x2b8bfa,'timestamp':new Date()[_0x4b150b(0x140)](),'duration_ms':0x0});}}const _0x5325ad=Date['now']()-_0x5cbed3,_0x52a741=_0x546505[_0x4b150b(0x153)](_0x2e0236=>_0x2e0236[_0x4b150b(0x14a)]===_0x4b150b(0x129))['length'],_0x1d57da=_0x546505[_0x4b150b(0x153)](_0x5394f8=>_0x5394f8[_0x4b150b(0x14a)]==='FAIL')[_0x4b150b(0x139)],_0x461cbd=_0x546505[_0x4b150b(0x153)](_0x4f17cb=>_0x4f17cb[_0x4b150b(0x14a)]===_0x4b150b(0xd9))[_0x4b150b(0x139)];console[_0x4b150b(0xf6)]('━'[_0x4b150b(0xfc)](0x3c)),console['log'](_0x4b150b(0x109)),console[_0x4b150b(0xf6)]('━'['repeat'](0x3c)),console['log'](_0x4b150b(0x151)+_0x546505['length']),console[_0x4b150b(0xf6)](_0x4b150b(0x125)+a5_0x225b3b[_0x4b150b(0x123)](_0x52a741)),console['log']('Failed:\x20\x20\x20'+a5_0x225b3b[_0x4b150b(0x12c)](_0x1d57da));_0x461cbd>0x0&&console['log'](_0x4b150b(0xef)+a5_0x225b3b['red'](_0x461cbd));console['log'](_0x4b150b(0x103)+formatElapsed(_0x5325ad)),console[_0x4b150b(0xf6)]('━'[_0x4b150b(0xfc)](0x3c));const _0x3319f2=_0x546505['filter'](_0xa04be3=>_0xa04be3[_0x4b150b(0x14a)]!=='PASS');if(_0x3319f2[_0x4b150b(0x139)]>0x0){console['log'](),console[_0x4b150b(0xf6)](_0x4b150b(0x149));for(const _0x49985f of _0x3319f2){const _0x44c93c=a5_0x225b3b['red']('✗'),_0x37f343=_0x49985f[_0x4b150b(0x138)][_0x4b150b(0x139)]>0x32?_0x49985f[_0x4b150b(0x138)][_0x4b150b(0x10a)](0x0,0x32)+_0x4b150b(0x158):_0x49985f[_0x4b150b(0x138)];console[_0x4b150b(0xf6)]('\x20\x20'+_0x44c93c+'\x20'+_0x49985f['name']+':\x20'+_0x37f343);}}const _0x1b8188={'summary':{'total':_0x546505[_0x4b150b(0x139)],'passed':_0x52a741,'failed':_0x1d57da,'errors':_0x461cbd>0x0?_0x461cbd:undefined,'duration_ms':_0x5325ad},'tests':_0x546505,'agent':{'project':_0x5d2a4d[_0x4b150b(0xdb)],'name':_0x5d2a4d[_0x4b150b(0x104)],'site':_0x1af158},'timestamp':new Date(_0x5cbed3)[_0x4b150b(0x140)]()};try{const _0xf961a0=buildCachedTestRun(_0x4a6fb5,{'site':_0x1af158,'projectId':_0x40cff0,'projectName':_0x5d2a4d['projectName'],'agentId':_0x862e57,'agentName':_0x5d2a4d[_0x4b150b(0x104)],'testYmlPath':a5_0x2a1811[_0x4b150b(0x117)](_0x5d2a4d['testYmlPath'])});saveLastTestRun(_0xf961a0);}catch{}if(_0xa191e0!=='table'||_0xe68694){const _0x52adda=formatResults(_0x1b8188,_0xa191e0);if(_0xe68694)try{a5_0x596e83[_0x4b150b(0x160)](_0xe68694,_0x52adda,_0x4b150b(0xe9)),console['log'](),console[_0x4b150b(0xf6)](a5_0x225b3b[_0x4b150b(0x132)](_0x4b150b(0xd7)+_0xe68694));}catch(_0x128674){return console[_0x4b150b(0xf6)](),console[_0x4b150b(0xf6)](a5_0x225b3b[_0x4b150b(0x12c)](_0x4b150b(0xea)+_0x128674)),0x1;}else console[_0x4b150b(0xf6)](),console[_0x4b150b(0xf6)](_0x52adda);}return _0x3319f2[_0x4b150b(0x139)]>0x0?0x1:0x0;}async[a5_0x5e3a8c(0x15d)](_0x17c75b,_0x2b77a6){const _0x4a09a9=a5_0x5e3a8c,{options:_0x587d10,tdx:_0x2b4f35}=_0x17c75b,{definition:_0x3a2e7d,agentInfo:_0x4eafa2,outputFormat:_0x39db3f,outputFile:_0x25ae03}=_0x2b77a6,_0xe6152=_0x587d10['site'],_0x1f2b90=loadLastTestRun();if(!_0x1f2b90)return console[_0x4a09a9(0xf6)](a5_0x225b3b[_0x4a09a9(0x12c)](_0x4a09a9(0x12b))),console[_0x4a09a9(0xf6)](a5_0x225b3b['dim']('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x1f2b90[_0x4a09a9(0xed)][_0x4a09a9(0x104)]!==_0x4eafa2[_0x4a09a9(0x104)])return console[_0x4a09a9(0xf6)](a5_0x225b3b[_0x4a09a9(0x12c)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x1f2b90[_0x4a09a9(0xed)]['agentName']+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x4eafa2[_0x4a09a9(0x104)]+'\x22.')),console[_0x4a09a9(0xf6)](a5_0x225b3b['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x14f2fb=new Set(_0x1f2b90[_0x4a09a9(0x13e)][_0x4a09a9(0x13c)](_0x4d98ff=>_0x4d98ff['testName'])),_0x723df8=_0x3a2e7d[_0x4a09a9(0x159)]['filter'](_0x17a99a=>!_0x14f2fb['has'](_0x17a99a[_0x4a09a9(0x12f)]));if(_0x723df8[_0x4a09a9(0x139)]>0x0&&_0x1f2b90[_0x4a09a9(0x14b)]!==_0xe6152)return console['log'](a5_0x225b3b[_0x4a09a9(0x12c)](_0x4a09a9(0x13a))),console['log'](a5_0x225b3b['dim']('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x1f2b90[_0x4a09a9(0x14b)]+_0x4a09a9(0xfe)+_0xe6152+'\x22.')),console['log'](a5_0x225b3b[_0x4a09a9(0x132)](_0x4a09a9(0x108)+_0x1f2b90[_0x4a09a9(0x14b)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x3371ab=_0x3a2e7d[_0x4a09a9(0x159)]['filter'](_0x327327=>_0x14f2fb['has'](_0x327327['name'])),_0x393f8f=_0x723df8;let _0x4e25ad;try{_0x4e25ad=await setupEvaluatorAgent(_0x2b4f35[_0x4a09a9(0x15a)],_0x587d10['verbose']);}catch(_0x160dc4){const _0x3c0a02=_0x160dc4 instanceof Error?_0x160dc4[_0x4a09a9(0x10e)]:String(_0x160dc4);return console[_0x4a09a9(0xf6)](a5_0x225b3b[_0x4a09a9(0x12c)](_0x4a09a9(0xf0)+_0x3c0a02)),0x1;}console[_0x4a09a9(0xf6)](a5_0x225b3b[_0x4a09a9(0x15f)](_0x4a09a9(0xd2))),console[_0x4a09a9(0xf6)](_0x4a09a9(0xe3)+a5_0x225b3b['white'](_0x1f2b90[_0x4a09a9(0x141)])),console[_0x4a09a9(0xf6)](_0x4a09a9(0x135)+a5_0x225b3b[_0x4a09a9(0x10f)](_0x1f2b90[_0x4a09a9(0xed)][_0x4a09a9(0xdb)]+'/'+_0x1f2b90[_0x4a09a9(0xed)][_0x4a09a9(0x104)]));_0x393f8f[_0x4a09a9(0x139)]>0x0&&console[_0x4a09a9(0xf6)](_0x4a09a9(0x124)+a5_0x225b3b['yellow'](_0x393f8f[_0x4a09a9(0x139)]));console[_0x4a09a9(0xf6)]();const _0x3f02c2=[],_0x8fb1b8=Date[_0x4a09a9(0xf5)](),_0x2e5272=createCommandSpinner(_0x4a09a9(0x12a));if(_0x3371ab['length']>0x0)try{const _0x574887=await reevaluateFromCache(_0x2b4f35[_0x4a09a9(0x15a)],_0x1f2b90,{'tests':_0x3371ab},{'evaluatorId':_0x4e25ad,'onTestStart':(_0x5d5fa4,_0x6e4e8a,_0x3a783f)=>{const _0x3c0f1f=_0x4a09a9;_0x2e5272['text']=_0x3c0f1f(0x11e)+(_0x6e4e8a+0x1)+'/'+_0x3a783f+':\x20'+_0x5d5fa4+_0x3c0f1f(0x158);if(!_0x2e5272[_0x3c0f1f(0x11a)])_0x2e5272[_0x3c0f1f(0x148)]();},'onTestComplete':(_0x419253,_0x5c5824)=>{const _0x14edc0=_0x4a09a9;_0x2e5272[_0x14edc0(0x118)]();if(_0x5c5824[_0x14edc0(0x14a)]===_0x14edc0(0x129))console[_0x14edc0(0xf6)](a5_0x225b3b[_0x14edc0(0x123)](_0x14edc0(0x10c)+_0x419253)+a5_0x225b3b[_0x14edc0(0x132)]('\x20(cached)'));else _0x5c5824['status']==='FAIL'?console[_0x14edc0(0xf6)](a5_0x225b3b[_0x14edc0(0x12c)](_0x14edc0(0x127)+_0x419253+_0x14edc0(0x12e)+_0x5c5824[_0x14edc0(0x138)])+a5_0x225b3b[_0x14edc0(0x132)](_0x14edc0(0x114))):console[_0x14edc0(0xf6)](a5_0x225b3b[_0x14edc0(0x12c)](_0x14edc0(0xe5)+_0x419253+'\x20-\x20'+_0x5c5824[_0x14edc0(0x138)]));_0x5c5824['conversation_url']&&console[_0x14edc0(0xf6)](a5_0x225b3b['dim'](_0x14edc0(0xf8)+_0x5c5824['conversation_url'])),_0x3f02c2[_0x14edc0(0x146)](_0x5c5824);},'onTestSkipped':(_0xaaec28,_0xb5ade6)=>{const _0x3c7314=_0x4a09a9;_0x2e5272[_0x3c7314(0x118)](),console[_0x3c7314(0xf6)](a5_0x225b3b[_0x3c7314(0x152)](_0x3c7314(0xe0)+_0xaaec28+_0x3c7314(0x12e)+_0xb5ade6));}});for(const _0x51e067 of _0x574887){!_0x3f02c2['find'](_0x4fdbd4=>_0x4fdbd4[_0x4a09a9(0x12f)]===_0x51e067[_0x4a09a9(0x12f)])&&_0x3f02c2[_0x4a09a9(0x146)](_0x51e067);}}catch(_0x2f141f){_0x2e5272['stop']();const _0x2d84b4=_0x2f141f instanceof Error?_0x2f141f[_0x4a09a9(0x10e)]:String(_0x2f141f);return console[_0x4a09a9(0xf6)](a5_0x225b3b[_0x4a09a9(0x12c)](_0x4a09a9(0x156)+_0x2d84b4)),0x1;}_0x2e5272[_0x4a09a9(0x118)]();if(_0x393f8f[_0x4a09a9(0x139)]>0x0){console[_0x4a09a9(0xf6)](),console[_0x4a09a9(0xf6)](a5_0x225b3b['cyan']('Executing\x20new\x20tests...'));const {projectId:_0x142c80,agentId:_0xb58a77}=_0x1f2b90[_0x4a09a9(0xed)];for(const _0x5b9ce0 of _0x393f8f){console['log'](_0x4a09a9(0xf3)+a5_0x225b3b[_0x4a09a9(0x10f)](_0x5b9ce0[_0x4a09a9(0x12f)]));const _0x28b776=createCommandSpinner(_0x4a09a9(0x130)+_0x5b9ce0[_0x4a09a9(0xf1)][_0x4a09a9(0x139)]+':\x20Sending\x20user\x20input...');_0x28b776[_0x4a09a9(0x148)]();try{const {result:_0x244ae2}=await runTest(_0x2b4f35['llm'],_0x5b9ce0,{'agentId':_0xb58a77,'projectId':_0x142c80,'site':_0x1f2b90[_0x4a09a9(0x14b)],'noEval':![],'evaluatorId':_0x4e25ad,'onRoundStart':(_0x511f4d,_0x4c5329)=>{const _0x1f3d4b=_0x4a09a9;_0x28b776[_0x1f3d4b(0x14c)]=_0x1f3d4b(0xf7)+(_0x511f4d+0x1)+'/'+_0x4c5329+_0x1f3d4b(0x150);},'onRoundComplete':(_0x310779,_0x5e60fb,_0x2b4526)=>{const _0x4c7e7f=_0x4a09a9,_0x198b3a=formatElapsed(_0x5e60fb);_0x2b4526?console[_0x4c7e7f(0xf6)](_0x4c7e7f(0x13d)+(_0x310779+0x1)+'/'+_0x5b9ce0[_0x4c7e7f(0xf1)][_0x4c7e7f(0x139)]+'...\x20'+a5_0x225b3b['green']('✓')+'\x20('+_0x198b3a+')'):console[_0x4c7e7f(0xf6)](_0x4c7e7f(0x13d)+(_0x310779+0x1)+'/'+_0x5b9ce0[_0x4c7e7f(0xf1)][_0x4c7e7f(0x139)]+_0x4c7e7f(0xdd)+a5_0x225b3b[_0x4c7e7f(0x12c)]('✗'));},'onEvaluationStart':()=>{const _0x5af343=_0x4a09a9;_0x28b776[_0x5af343(0x14c)]='Evaluating\x20response...';},'onEvaluationComplete':_0x33ed00=>{const _0x4f7b2d=_0x4a09a9,_0x205902=formatElapsed(_0x33ed00);console[_0x4f7b2d(0xf6)](_0x4f7b2d(0xff)+a5_0x225b3b['green']('✓')+'\x20('+_0x205902+')');}});_0x28b776[_0x4a09a9(0x118)](),_0x3f02c2['push'](_0x244ae2);if(_0x244ae2[_0x4a09a9(0x14a)]==='PASS')console[_0x4a09a9(0xf6)](a5_0x225b3b[_0x4a09a9(0x123)](_0x4a09a9(0x10c)+_0x244ae2['reason'])+a5_0x225b3b['dim']('\x20(new)'));else _0x244ae2[_0x4a09a9(0x14a)]===_0x4a09a9(0xfa)?console['log'](a5_0x225b3b['red'](_0x4a09a9(0x127)+_0x244ae2[_0x4a09a9(0x138)])+a5_0x225b3b[_0x4a09a9(0x132)](_0x4a09a9(0x105))):console[_0x4a09a9(0xf6)](a5_0x225b3b[_0x4a09a9(0x12c)](_0x4a09a9(0xe5)+_0x244ae2[_0x4a09a9(0x138)]));_0x244ae2[_0x4a09a9(0xe7)]&&console[_0x4a09a9(0xf6)](a5_0x225b3b[_0x4a09a9(0x132)]('\x20\x20Conversation:\x20'+_0x244ae2[_0x4a09a9(0xe7)]));}catch(_0x6b6d48){_0x28b776[_0x4a09a9(0x118)]();const _0x30304e=_0x6b6d48 instanceof Error?_0x6b6d48[_0x4a09a9(0x10e)]:String(_0x6b6d48);console[_0x4a09a9(0xf6)](a5_0x225b3b[_0x4a09a9(0x12c)](_0x4a09a9(0xe5)+_0x30304e)),_0x3f02c2[_0x4a09a9(0x146)]({'name':_0x5b9ce0['name'],'status':_0x4a09a9(0xd9),'reason':_0x30304e,'timestamp':new Date()[_0x4a09a9(0x140)](),'duration_ms':0x0});}}}console[_0x4a09a9(0xf6)]();const _0x3fcd4d=Date[_0x4a09a9(0xf5)]()-_0x8fb1b8,_0x24743b=_0x3f02c2[_0x4a09a9(0x153)](_0x1662e2=>_0x1662e2[_0x4a09a9(0x14a)]===_0x4a09a9(0x129))['length'],_0xe8cb0c=_0x3f02c2[_0x4a09a9(0x153)](_0x5961cf=>_0x5961cf[_0x4a09a9(0x14a)]==='FAIL')[_0x4a09a9(0x139)],_0x284651=_0x3f02c2[_0x4a09a9(0x153)](_0x34abe1=>_0x34abe1[_0x4a09a9(0x14a)]===_0x4a09a9(0xd9))['length'];console[_0x4a09a9(0xf6)]('━'[_0x4a09a9(0xfc)](0x3c)),console['log']('Re-evaluation\x20Summary'),console[_0x4a09a9(0xf6)]('━'['repeat'](0x3c)),console['log'](_0x4a09a9(0x151)+_0x3f02c2[_0x4a09a9(0x139)]),console[_0x4a09a9(0xf6)](_0x4a09a9(0x125)+a5_0x225b3b['green'](_0x24743b)),console[_0x4a09a9(0xf6)](_0x4a09a9(0x111)+a5_0x225b3b['red'](_0xe8cb0c));_0x284651>0x0&&console[_0x4a09a9(0xf6)](_0x4a09a9(0xef)+a5_0x225b3b[_0x4a09a9(0x12c)](_0x284651));console['log'](_0x4a09a9(0x103)+formatElapsed(_0x3fcd4d)),console[_0x4a09a9(0xf6)]('━'['repeat'](0x3c));const _0xc0dffe={'summary':{'total':_0x3f02c2['length'],'passed':_0x24743b,'failed':_0xe8cb0c,'errors':_0x284651>0x0?_0x284651:undefined,'duration_ms':_0x3fcd4d},'tests':_0x3f02c2,'agent':{'project':_0x4eafa2[_0x4a09a9(0xdb)],'name':_0x4eafa2['agentName'],'site':_0xe6152},'timestamp':new Date(_0x8fb1b8)[_0x4a09a9(0x140)]()};if(_0x39db3f!==_0x4a09a9(0x126)||_0x25ae03){const _0x18e760=formatResults(_0xc0dffe,_0x39db3f);if(_0x25ae03)try{a5_0x596e83[_0x4a09a9(0x160)](_0x25ae03,_0x18e760,'utf-8'),console[_0x4a09a9(0xf6)](),console[_0x4a09a9(0xf6)](a5_0x225b3b[_0x4a09a9(0x132)](_0x4a09a9(0xd7)+_0x25ae03));}catch(_0x5ba1e2){return console['log'](),console['log'](a5_0x225b3b[_0x4a09a9(0x12c)](_0x4a09a9(0xea)+_0x5ba1e2)),0x1;}else console['log'](),console['log'](_0x18e760);}const _0x237a71=_0x3f02c2[_0x4a09a9(0x153)](_0x8b4520=>_0x8b4520[_0x4a09a9(0x14a)]!==_0x4a09a9(0x129));return _0x237a71['length']>0x0?0x1:0x0;}}
1
+ function a5_0x1ba0(){const _0x4d1124=['found','map','⚠\x20SKIPPED:\x20','toISOString','existsSync','conversations','35QBfuNJ','No\x20tests\x20found\x20matching:\x20','dim','length','utf-8','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','402672JiqNhw','Run\x20\x27tdx\x20agent\x20pull\x20','tsv','execute','jsonl','\x20\x20Conversation:\x20','/<agent-name>','PASS','Agent:\x20','substring','✓\x20PASS:\x20','FAIL','filter','text','projectName','agentDirs','✗\x20ERROR:\x20','red','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','tags','resolveAgentId','No\x20tests\x20found\x20with\x20tags:\x20','green','projectDir','message','...\x20','\x20-\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','push','testName','output','status','Site:\x20','Executing\x20new\x20tests...','14936592nzbxTW','Re-evaluating...','agentName','410iEVGAD','Running:\x20','rounds','231216XAsAFo','log','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Using\x20agent:\x20','has','split','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Project\x20path:\x20','404','\x20\x20Evaluating...\x20','tests','join','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Evaluating\x20response...','site','Errors:\x20\x20\x20','agent:test','eval','Running\x20agent\x20tests...','Either\x20switch\x20to\x20the\x20\x22','Available\x20tests:\x20','Test\x20','216854DCJlzC','723SkJPIZ','find','9708KYSjvz','Test\x20Configuration:','dryRun','\x22:\x20','llm','Error:\x20No\x20previous\x20test\x20run\x20found.','verbose','white','Re-evaluating\x20cached\x20test\x20run...','\x20(cached)','Passed:\x20\x20\x20','no_tests','executeReeval','source','writeFileSync','Available\x20tags:\x20','name','agent','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','\x20(new)','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Re-evaluating\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Error\x20writing\x20output\x20file:\x20','ERROR','\x22,\x20but\x20current\x20site\x20is\x20\x22','1063755tMCcgA','conversation_url','New\x20tests\x20to\x20execute:\x20','start','62942CLfMve','stop','resolveProjectId','basename','99uaESvO','now','cyan','\x27\x20to\x20create\x20the\x20folder\x20structure.','Round\x20','llmProject','Round\x201/',':\x20Sending\x20user\x20input...','\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)','table','Failed:\x20\x20\x20','Failed\x20Tests:','trim','No\x20tests\x20have\x20tags\x20defined.','\x20\x20Agent:\x20','Conversation\x20URL:\x20','not\x20found','yellow','repeat','Total:\x20\x20\x20\x20','\x20\x20Round\x20','reeval','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','forEach','\x20\x20Site:\x20','3mTvhjY','...','Re-evaluation\x20Summary','toLowerCase','includes','description','json','Cached\x20run\x20is\x20from\x20site\x20\x22','Duration:\x20','\x20\x20-\x20','✗\x20FAIL:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','\x20\x20Project:\x20','reason'];a5_0x1ba0=function(){return _0x4d1124;};return a5_0x1ba0();}const a5_0x41256e=a5_0x2692;(function(_0x259a7a,_0x472bc5){const _0x304f3a=a5_0x2692,_0x3dd4ba=_0x259a7a();while(!![]){try{const _0x46b8ff=-parseInt(_0x304f3a(0xf4))/0x1*(parseInt(_0x304f3a(0xb6))/0x2)+parseInt(_0x304f3a(0xb7))/0x3*(parseInt(_0x304f3a(0xb9))/0x4)+-parseInt(_0x304f3a(0xd3))/0x5+parseInt(_0x304f3a(0x10e))/0x6*(-parseInt(_0x304f3a(0x108))/0x7)+parseInt(_0x304f3a(0xa0))/0x8*(-parseInt(_0x304f3a(0xdb))/0x9)+parseInt(_0x304f3a(0x9d))/0xa*(-parseInt(_0x304f3a(0xd7))/0xb)+parseInt(_0x304f3a(0x9a))/0xc;if(_0x46b8ff===_0x472bc5)break;else _0x3dd4ba['push'](_0x3dd4ba['shift']());}catch(_0x4e5737){_0x3dd4ba['push'](_0x3dd4ba['shift']());}}}(a5_0x1ba0,0x62833));function a5_0x2692(_0x2ade61,_0x148e96){_0x2ade61=_0x2ade61-0x89;const _0x1ba037=a5_0x1ba0();let _0x2692c3=_0x1ba037[_0x2ade61];return _0x2692c3;}import*as a5_0x34117f from'node:fs';import*as a5_0x5417e6 from'node:path';import a5_0x1f9909 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0x41256e(0xb0);[a5_0x41256e(0xf9)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x41256e(0x111)](_0x46dea9){const _0x30d188=a5_0x41256e,{options:_0x4c93ed,args:_0x528398,tdx:_0x130e3b}=_0x46dea9,_0x8f9560=_0x528398[0x0]||'.',_0x37b6fc=_0x4c93ed[_0x30d188(0xbb)],_0x1b21b9=_0x4c93ed,_0x17936a=_0x1b21b9[_0x30d188(0xb1)]===![],_0xc5c736=_0x1b21b9[_0x30d188(0xf0)],_0xcfe7d6=_0x1b21b9[_0x30d188(0xc9)],_0x455457=_0x1b21b9[_0x30d188(0x8b)],_0x4f6573=_0x4c93ed[_0x30d188(0xae)],_0x2919e2=_0x1b21b9[_0x30d188(0x96)];if(_0xc5c736&&_0x17936a)return console[_0x30d188(0xa1)](a5_0x1f9909[_0x30d188(0x89)](_0x30d188(0xcd))),0x1;let _0x2d7bdd=_0x30d188(0xe4);if(_0x1b21b9[_0x30d188(0xfa)])_0x2d7bdd=_0x30d188(0xfa);else{if(_0x1b21b9['jsonl'])_0x2d7bdd=_0x30d188(0x112);else{if(_0x1b21b9[_0x30d188(0x110)])_0x2d7bdd=_0x30d188(0x110);else{if(_0x1b21b9[_0x30d188(0xe4)])_0x2d7bdd=_0x30d188(0xe4);}}}const _0x42df54=_0x1b21b9[_0x30d188(0xe0)];let _0x260976=_0x8f9560;const _0x21d9f2=a5_0x34117f[_0x30d188(0x106)](_0x8f9560),_0x7fd3ff=_0x8f9560==='.';if(!_0x21d9f2||_0x7fd3ff){const _0x5d6769=resolveProjectFromContext(_0x8f9560,_0x42df54,{'requireFile':'test.yml'});if(_0x5d6769[_0x30d188(0x102)])_0x260976=_0x5d6769['projectDir'],_0x5d6769[_0x30d188(0xc6)]==='context'&&console[_0x30d188(0xa1)](a5_0x1f9909[_0x30d188(0x10a)](_0x30d188(0xa3)+_0x260976));else switch(_0x5d6769[_0x30d188(0x101)]){case'no_context':console[_0x30d188(0xa1)](a5_0x1f9909[_0x30d188(0xec)](_0x5d6769[_0x30d188(0x90)])),console[_0x30d188(0xa1)](),console['log']('Usage:'),console[_0x30d188(0xa1)]('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console[_0x30d188(0xa1)](_0x30d188(0xe3)),console[_0x30d188(0xa1)](),console[_0x30d188(0xa1)](_0x30d188(0x8a));return 0x1;case'no_local_folder':console[_0x30d188(0xa1)](a5_0x1f9909[_0x30d188(0xec)](_0x5d6769['message'])),console['log'](),console[_0x30d188(0xa1)](_0x30d188(0x10f)+_0x5d6769[_0x30d188(0xe0)]+_0x30d188(0xde));return 0x1;case'multiple_agents':{const _0x12a2da=a5_0x5417e6[_0x30d188(0xda)](_0x5d6769[_0x30d188(0x8f)]);console[_0x30d188(0xa1)](a5_0x1f9909[_0x30d188(0xec)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x5d6769[_0x30d188(0xe0)]+'\x22:'));for(const _0xe11abb of _0x5d6769[_0x30d188(0x11d)]){console[_0x30d188(0xa1)](_0x30d188(0xfd)+_0xe11abb);}return console[_0x30d188(0xa1)](),console[_0x30d188(0xa1)](_0x30d188(0xcb)+_0x12a2da+_0x30d188(0x114)),0x1;}case _0x30d188(0xc4):console[_0x30d188(0xa1)](a5_0x1f9909[_0x30d188(0xec)](_0x30d188(0xa6)+_0x5d6769[_0x30d188(0xe0)]+'\x22.')),console[_0x30d188(0xa1)](a5_0x1f9909[_0x30d188(0x10a)](_0x30d188(0xa7)+_0x5d6769[_0x30d188(0x8f)])),console['log'](),console['log'](_0x30d188(0x93));return 0x1;}}const {definition:_0xa3474d,agentInfo:_0x353ebb}=parseTestFile(_0x260976);let _0x569228=_0xa3474d[_0x30d188(0xaa)];if(_0xcfe7d6){const _0xcac80a=_0xcfe7d6[_0x30d188(0xa5)](',')[_0x30d188(0x103)](_0x3c12e0=>_0x3c12e0[_0x30d188(0xe7)]());_0x569228=_0xa3474d['tests'][_0x30d188(0x11a)](_0x2d7b4b=>_0xcac80a[_0x30d188(0xf8)](_0x2d7b4b['name']));if(_0x569228[_0x30d188(0x10b)]===0x0)return console[_0x30d188(0xa1)](a5_0x1f9909[_0x30d188(0xec)](_0x30d188(0x109)+_0xcfe7d6)),console['log'](a5_0x1f9909[_0x30d188(0x10a)](_0x30d188(0xb4)+_0xa3474d[_0x30d188(0xaa)][_0x30d188(0x103)](_0x1d2242=>_0x1d2242[_0x30d188(0xc9)])['join'](',\x20'))),0x1;}if(_0x455457){const _0x2f8f8e=_0x455457['split'](',')[_0x30d188(0x103)](_0x480a1f=>_0x480a1f[_0x30d188(0xe7)]()[_0x30d188(0xf7)]());_0x569228=_0x569228[_0x30d188(0x11a)](_0x3d1072=>_0x3d1072[_0x30d188(0x8b)]?.['some'](_0x3db19f=>_0x2f8f8e[_0x30d188(0xf8)](_0x3db19f[_0x30d188(0xf7)]())));if(_0x569228[_0x30d188(0x10b)]===0x0){console[_0x30d188(0xa1)](a5_0x1f9909[_0x30d188(0xec)](_0x30d188(0x8d)+_0x455457));const _0x20effc=new Set();return _0xa3474d[_0x30d188(0xaa)][_0x30d188(0xf2)](_0x38b677=>_0x38b677[_0x30d188(0x8b)]?.[_0x30d188(0xf2)](_0x3c1d97=>_0x20effc['add'](_0x3c1d97))),_0x20effc['size']>0x0?console[_0x30d188(0xa1)](a5_0x1f9909[_0x30d188(0x10a)](_0x30d188(0xc8)+[..._0x20effc][_0x30d188(0xab)](',\x20'))):console['log'](a5_0x1f9909[_0x30d188(0x10a)](_0x30d188(0xe8))),0x1;}}if(_0xc5c736)return this[_0x30d188(0xc5)](_0x46dea9,{'definition':{'tests':_0x569228},'agentInfo':_0x353ebb,'outputFormat':_0x2d7bdd,'outputFile':_0x2919e2,'testNames':_0xcfe7d6});if(_0x37b6fc){console[_0x30d188(0xa1)](a5_0x1f9909['cyan'](_0x30d188(0xba))),console[_0x30d188(0xa1)](_0x30d188(0xf3)+a5_0x1f9909[_0x30d188(0xc0)](_0x4f6573)),console['log'](_0x30d188(0x100)+a5_0x1f9909[_0x30d188(0xc0)](_0x353ebb[_0x30d188(0x11c)])),console[_0x30d188(0xa1)](_0x30d188(0xe9)+a5_0x1f9909[_0x30d188(0xc0)](_0x353ebb['agentName'])),console[_0x30d188(0xa1)](),console[_0x30d188(0xa1)]('Tests\x20found:\x20'+a5_0x1f9909['white'](_0x569228[_0x30d188(0x10b)]));for(let _0x4749eb=0x0;_0x4749eb<_0x569228[_0x30d188(0x10b)];_0x4749eb++){const _0x524813=_0x569228[_0x4749eb],_0x4751bb=_0x524813[_0x30d188(0x9f)][_0x30d188(0x10b)]===0x1?'round':_0x30d188(0x9f),_0x5a048d=_0x524813[_0x30d188(0x8b)]?.[_0x30d188(0x10b)]?'\x20['+_0x524813['tags'][_0x30d188(0xab)](',\x20')+']':'';console[_0x30d188(0xa1)]('\x20\x20'+(_0x4749eb+0x1)+'.\x20'+a5_0x1f9909[_0x30d188(0xc0)](_0x524813[_0x30d188(0xc9)])+'\x20('+_0x524813['rounds'][_0x30d188(0x10b)]+'\x20'+_0x4751bb+')'+a5_0x1f9909[_0x30d188(0x10a)](_0x5a048d));}return 0x0;}let _0xc4d790,_0x56d305;try{_0xc4d790=await _0x130e3b[_0x30d188(0xbd)][_0x30d188(0xd9)](_0x353ebb[_0x30d188(0x11c)]);}catch(_0x1bddd4){const _0x5cd565=_0x1bddd4 instanceof Error?_0x1bddd4['message']:String(_0x1bddd4);return _0x5cd565['includes'](_0x30d188(0xa8))||_0x5cd565[_0x30d188(0xf7)]()['includes'](_0x30d188(0xeb))?console[_0x30d188(0xa1)](a5_0x1f9909[_0x30d188(0x89)](_0x30d188(0xa2)+_0x353ebb[_0x30d188(0x11c)])):console[_0x30d188(0xa1)](a5_0x1f9909[_0x30d188(0x89)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x353ebb[_0x30d188(0x11c)]+_0x30d188(0xbc)+_0x5cd565)),0x1;}try{_0x56d305=await _0x130e3b[_0x30d188(0xbd)][_0x30d188(0x8c)](_0x353ebb['agentName'],_0xc4d790);}catch(_0x4c9367){const _0x563a8f=_0x4c9367 instanceof Error?_0x4c9367['message']:String(_0x4c9367);return _0x563a8f[_0x30d188(0xf8)](_0x30d188(0xa8))||_0x563a8f[_0x30d188(0xf7)]()[_0x30d188(0xf8)]('not\x20found')?console['log'](a5_0x1f9909[_0x30d188(0x89)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x353ebb[_0x30d188(0x9c)])):console[_0x30d188(0xa1)](a5_0x1f9909[_0x30d188(0x89)](_0x30d188(0x10d)+_0x353ebb[_0x30d188(0x9c)]+_0x30d188(0xbc)+_0x563a8f)),0x1;}let _0x3b35d1;if(!_0x17936a)try{_0x3b35d1=await setupEvaluatorAgent(_0x130e3b[_0x30d188(0xbd)],_0x4c93ed[_0x30d188(0xbf)]);}catch(_0x24a8a6){const _0x4e4cdf=_0x24a8a6 instanceof Error?_0x24a8a6[_0x30d188(0x90)]:String(_0x24a8a6);return console[_0x30d188(0xa1)](a5_0x1f9909[_0x30d188(0x89)](_0x30d188(0xff)+_0x4e4cdf)),0x1;}console[_0x30d188(0xa1)](a5_0x1f9909[_0x30d188(0xdd)](_0x30d188(0xb2))),console[_0x30d188(0xa1)](_0x30d188(0x98)+a5_0x1f9909[_0x30d188(0xc0)](_0x4f6573)),console[_0x30d188(0xa1)](_0x30d188(0x116)+a5_0x1f9909[_0x30d188(0xc0)](_0x353ebb[_0x30d188(0x11c)]+'/'+_0x353ebb['agentName'])),console['log']();const _0x27f6c8=[],_0x42902d=[],_0x570ba9=Date[_0x30d188(0xdc)]();for(let _0x31d367=0x0;_0x31d367<_0x569228[_0x30d188(0x10b)];_0x31d367++){const _0x4ebbfb=_0x569228[_0x31d367];_0x569228['length']>0x1?console[_0x30d188(0xa1)](_0x30d188(0xb5)+(_0x31d367+0x1)+'/'+_0x569228[_0x30d188(0x10b)]+':\x20'+a5_0x1f9909[_0x30d188(0xc0)](_0x4ebbfb[_0x30d188(0xc9)])):console[_0x30d188(0xa1)]('Running\x20test:\x20'+a5_0x1f9909[_0x30d188(0xc0)](_0x4ebbfb[_0x30d188(0xc9)]));const _0x34c06f=createCommandSpinner(_0x30d188(0xe1)+_0x4ebbfb[_0x30d188(0x9f)][_0x30d188(0x10b)]+_0x30d188(0xe2));_0x34c06f[_0x30d188(0xd6)]();try{const {result:_0x216e37,conversation:_0x197787}=await runTest(_0x130e3b[_0x30d188(0xbd)],_0x4ebbfb,{'agentId':_0x56d305,'projectId':_0xc4d790,'site':_0x4f6573,'noEval':_0x17936a,'evaluatorId':_0x3b35d1,'onRoundStart':(_0x9d8141,_0x2d1bd5)=>{const _0x403123=_0x30d188;_0x34c06f[_0x403123(0x11b)]=_0x403123(0xdf)+(_0x9d8141+0x1)+'/'+_0x2d1bd5+_0x403123(0xe2);},'onRoundComplete':(_0x64a0fc,_0x1d627c,_0xf624b6)=>{const _0x291b21=_0x30d188,_0x33b75b=formatElapsed(_0x1d627c);_0xf624b6?console[_0x291b21(0xa1)]('\x20\x20Round\x20'+(_0x64a0fc+0x1)+'/'+_0x4ebbfb[_0x291b21(0x9f)][_0x291b21(0x10b)]+'...\x20'+a5_0x1f9909['green']('✓')+'\x20('+_0x33b75b+')'):console[_0x291b21(0xa1)](_0x291b21(0xef)+(_0x64a0fc+0x1)+'/'+_0x4ebbfb[_0x291b21(0x9f)][_0x291b21(0x10b)]+_0x291b21(0x91)+a5_0x1f9909[_0x291b21(0x89)]('✗'));},'onEvaluationStart':()=>{const _0x50c4c9=_0x30d188;_0x34c06f[_0x50c4c9(0x11b)]=_0x50c4c9(0xad);},'onEvaluationComplete':_0x2d4428=>{const _0x375d6b=_0x30d188,_0x1c9dd1=formatElapsed(_0x2d4428);console[_0x375d6b(0xa1)](_0x375d6b(0xa9)+a5_0x1f9909[_0x375d6b(0x8e)]('✓')+'\x20('+_0x1c9dd1+')');}});_0x34c06f[_0x30d188(0xd8)](),_0x27f6c8['push'](_0x216e37),_0x42902d[_0x30d188(0x94)](_0x197787);if(_0x216e37[_0x30d188(0x97)]===_0x30d188(0x115))console[_0x30d188(0xa1)](a5_0x1f9909[_0x30d188(0x8e)](_0x30d188(0x118)+_0x216e37[_0x30d188(0x101)]));else _0x216e37[_0x30d188(0x97)]===_0x30d188(0x119)?console[_0x30d188(0xa1)](a5_0x1f9909[_0x30d188(0x89)](_0x30d188(0xfe)+_0x216e37['reason'])):console[_0x30d188(0xa1)](a5_0x1f9909[_0x30d188(0x89)]('✗\x20ERROR:\x20'+_0x216e37[_0x30d188(0x101)]));_0x216e37[_0x30d188(0xd4)]&&console[_0x30d188(0xa1)](a5_0x1f9909['dim'](_0x30d188(0xea)+_0x216e37[_0x30d188(0xd4)])),console[_0x30d188(0xa1)]();}catch(_0x3671fe){_0x34c06f[_0x30d188(0xd8)]();const _0x4b9142=_0x3671fe instanceof Error?_0x3671fe[_0x30d188(0x90)]:String(_0x3671fe);console[_0x30d188(0xa1)](a5_0x1f9909['red'](_0x30d188(0x11e)+_0x4b9142)),console['log'](),_0x27f6c8[_0x30d188(0x94)]({'name':_0x4ebbfb[_0x30d188(0xc9)],'status':_0x30d188(0xd1),'reason':_0x4b9142,'timestamp':new Date()[_0x30d188(0x105)](),'duration_ms':0x0});}}const _0x1170bf=Date[_0x30d188(0xdc)]()-_0x570ba9,_0x485f00=_0x27f6c8[_0x30d188(0x11a)](_0x3c0054=>_0x3c0054['status']===_0x30d188(0x115))[_0x30d188(0x10b)],_0x717e4f=_0x27f6c8['filter'](_0x2d5d6b=>_0x2d5d6b['status']===_0x30d188(0x119))['length'],_0x17d259=_0x27f6c8[_0x30d188(0x11a)](_0x1fef51=>_0x1fef51[_0x30d188(0x97)]===_0x30d188(0xd1))[_0x30d188(0x10b)];console[_0x30d188(0xa1)]('━'[_0x30d188(0xed)](0x3c)),console[_0x30d188(0xa1)]('Test\x20Summary'),console['log']('━'[_0x30d188(0xed)](0x3c)),console[_0x30d188(0xa1)](_0x30d188(0xee)+_0x27f6c8[_0x30d188(0x10b)]),console[_0x30d188(0xa1)](_0x30d188(0xc3)+a5_0x1f9909[_0x30d188(0x8e)](_0x485f00)),console[_0x30d188(0xa1)]('Failed:\x20\x20\x20'+a5_0x1f9909[_0x30d188(0x89)](_0x717e4f));_0x17d259>0x0&&console[_0x30d188(0xa1)](_0x30d188(0xaf)+a5_0x1f9909[_0x30d188(0x89)](_0x17d259));console[_0x30d188(0xa1)](_0x30d188(0xfc)+formatElapsed(_0x1170bf)),console[_0x30d188(0xa1)]('━'['repeat'](0x3c));const _0x337807=_0x27f6c8[_0x30d188(0x11a)](_0x224b04=>_0x224b04['status']!=='PASS');if(_0x337807[_0x30d188(0x10b)]>0x0){console[_0x30d188(0xa1)](),console[_0x30d188(0xa1)](_0x30d188(0xe6));for(const _0x5ee2ce of _0x337807){const _0xe3a9f2=a5_0x1f9909[_0x30d188(0x89)]('✗'),_0x398496=_0x5ee2ce[_0x30d188(0x101)]['length']>0x32?_0x5ee2ce[_0x30d188(0x101)][_0x30d188(0x117)](0x0,0x32)+_0x30d188(0xf5):_0x5ee2ce[_0x30d188(0x101)];console[_0x30d188(0xa1)]('\x20\x20'+_0xe3a9f2+'\x20'+_0x5ee2ce[_0x30d188(0xc9)]+':\x20'+_0x398496);}}const _0x314d75={'summary':{'total':_0x27f6c8[_0x30d188(0x10b)],'passed':_0x485f00,'failed':_0x717e4f,'errors':_0x17d259>0x0?_0x17d259:undefined,'duration_ms':_0x1170bf},'tests':_0x27f6c8,'agent':{'project':_0x353ebb[_0x30d188(0x11c)],'name':_0x353ebb[_0x30d188(0x9c)],'site':_0x4f6573},'timestamp':new Date(_0x570ba9)[_0x30d188(0x105)]()};try{const _0x58de94=buildCachedTestRun(_0x42902d,{'site':_0x4f6573,'projectId':_0xc4d790,'projectName':_0x353ebb['projectName'],'agentId':_0x56d305,'agentName':_0x353ebb[_0x30d188(0x9c)],'testYmlPath':a5_0x5417e6['resolve'](_0x353ebb['testYmlPath'])});saveLastTestRun(_0x58de94);}catch{}if(_0x2d7bdd!==_0x30d188(0xe4)||_0x2919e2){const _0x14e574=formatResults(_0x314d75,_0x2d7bdd);if(_0x2919e2)try{a5_0x34117f[_0x30d188(0xc7)](_0x2919e2,_0x14e574,_0x30d188(0x10c)),console[_0x30d188(0xa1)](),console[_0x30d188(0xa1)](a5_0x1f9909['dim']('Output\x20written\x20to:\x20'+_0x2919e2));}catch(_0x3d519f){return console[_0x30d188(0xa1)](),console[_0x30d188(0xa1)](a5_0x1f9909[_0x30d188(0x89)](_0x30d188(0xd0)+_0x3d519f)),0x1;}else console['log'](),console[_0x30d188(0xa1)](_0x14e574);}return _0x337807[_0x30d188(0x10b)]>0x0?0x1:0x0;}async['executeReeval'](_0x4e629e,_0xe2935c){const _0x318138=a5_0x41256e,{options:_0x328582,tdx:_0x2db12d}=_0x4e629e,{definition:_0x293829,agentInfo:_0x44d8e2,outputFormat:_0x26b92e,outputFile:_0x5181a7}=_0xe2935c,_0x550db7=_0x328582[_0x318138(0xae)],_0x1368d0=loadLastTestRun();if(!_0x1368d0)return console[_0x318138(0xa1)](a5_0x1f9909['red'](_0x318138(0xbe))),console[_0x318138(0xa1)](a5_0x1f9909[_0x318138(0x10a)](_0x318138(0xac))),0x1;if(_0x1368d0[_0x318138(0xca)][_0x318138(0x9c)]!==_0x44d8e2[_0x318138(0x9c)])return console[_0x318138(0xa1)](a5_0x1f9909[_0x318138(0x89)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x1368d0[_0x318138(0xca)]['agentName']+_0x318138(0xcf)+_0x44d8e2[_0x318138(0x9c)]+'\x22.')),console[_0x318138(0xa1)](a5_0x1f9909[_0x318138(0x10a)](_0x318138(0xf1))),0x1;const _0x538c33=new Set(_0x1368d0[_0x318138(0x107)][_0x318138(0x103)](_0x55665e=>_0x55665e[_0x318138(0x95)])),_0x1acf84=_0x293829[_0x318138(0xaa)]['filter'](_0x4e2dc1=>!_0x538c33[_0x318138(0xa4)](_0x4e2dc1['name']));if(_0x1acf84[_0x318138(0x10b)]>0x0&&_0x1368d0['site']!==_0x550db7)return console['log'](a5_0x1f9909[_0x318138(0x89)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x318138(0xa1)](a5_0x1f9909[_0x318138(0x10a)](_0x318138(0xfb)+_0x1368d0['site']+_0x318138(0xd2)+_0x550db7+'\x22.')),console['log'](a5_0x1f9909[_0x318138(0x10a)](_0x318138(0xb3)+_0x1368d0[_0x318138(0xae)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x359f2e=_0x293829[_0x318138(0xaa)][_0x318138(0x11a)](_0x5e49dc=>_0x538c33['has'](_0x5e49dc[_0x318138(0xc9)])),_0x3a0a09=_0x1acf84;let _0x25171e;try{_0x25171e=await setupEvaluatorAgent(_0x2db12d[_0x318138(0xbd)],_0x328582[_0x318138(0xbf)]);}catch(_0x1043a1){const _0x6c6d9c=_0x1043a1 instanceof Error?_0x1043a1[_0x318138(0x90)]:String(_0x1043a1);return console[_0x318138(0xa1)](a5_0x1f9909['red'](_0x318138(0xff)+_0x6c6d9c)),0x1;}console[_0x318138(0xa1)](a5_0x1f9909['cyan'](_0x318138(0xc1))),console[_0x318138(0xa1)]('Cached\x20run\x20from:\x20'+a5_0x1f9909['white'](_0x1368d0['timestamp'])),console[_0x318138(0xa1)](_0x318138(0x116)+a5_0x1f9909['white'](_0x1368d0[_0x318138(0xca)]['projectName']+'/'+_0x1368d0[_0x318138(0xca)]['agentName']));_0x3a0a09[_0x318138(0x10b)]>0x0&&console[_0x318138(0xa1)](_0x318138(0xd5)+a5_0x1f9909['yellow'](_0x3a0a09[_0x318138(0x10b)]));console[_0x318138(0xa1)]();const _0x3443c5=[],_0x7c8932=Date[_0x318138(0xdc)](),_0x2a1d7b=createCommandSpinner(_0x318138(0x9b));if(_0x359f2e['length']>0x0)try{const _0x183649=await reevaluateFromCache(_0x2db12d['llm'],_0x1368d0,{'tests':_0x359f2e},{'evaluatorId':_0x25171e,'onTestStart':(_0x423b0b,_0x4c2172,_0x109c7e)=>{const _0x34ff99=_0x318138;_0x2a1d7b[_0x34ff99(0x11b)]=_0x34ff99(0xce)+(_0x4c2172+0x1)+'/'+_0x109c7e+':\x20'+_0x423b0b+'...';if(!_0x2a1d7b['isSpinning'])_0x2a1d7b[_0x34ff99(0xd6)]();},'onTestComplete':(_0xb44166,_0x30ac8d)=>{const _0x1455a9=_0x318138;_0x2a1d7b[_0x1455a9(0xd8)]();if(_0x30ac8d[_0x1455a9(0x97)]===_0x1455a9(0x115))console[_0x1455a9(0xa1)](a5_0x1f9909['green'](_0x1455a9(0x118)+_0xb44166)+a5_0x1f9909[_0x1455a9(0x10a)](_0x1455a9(0xc2)));else _0x30ac8d['status']===_0x1455a9(0x119)?console[_0x1455a9(0xa1)](a5_0x1f9909[_0x1455a9(0x89)](_0x1455a9(0xfe)+_0xb44166+'\x20-\x20'+_0x30ac8d[_0x1455a9(0x101)])+a5_0x1f9909['dim'](_0x1455a9(0xc2))):console[_0x1455a9(0xa1)](a5_0x1f9909['red']('✗\x20ERROR:\x20'+_0xb44166+_0x1455a9(0x92)+_0x30ac8d[_0x1455a9(0x101)]));_0x30ac8d['conversation_url']&&console[_0x1455a9(0xa1)](a5_0x1f9909[_0x1455a9(0x10a)](_0x1455a9(0x113)+_0x30ac8d[_0x1455a9(0xd4)])),_0x3443c5[_0x1455a9(0x94)](_0x30ac8d);},'onTestSkipped':(_0xcaf00c,_0x28d995)=>{const _0xd53b44=_0x318138;_0x2a1d7b['stop'](),console[_0xd53b44(0xa1)](a5_0x1f9909['yellow'](_0xd53b44(0x104)+_0xcaf00c+_0xd53b44(0x92)+_0x28d995));}});for(const _0x5146e4 of _0x183649){!_0x3443c5[_0x318138(0xb8)](_0x4620d4=>_0x4620d4['name']===_0x5146e4[_0x318138(0xc9)])&&_0x3443c5[_0x318138(0x94)](_0x5146e4);}}catch(_0x573991){_0x2a1d7b[_0x318138(0xd8)]();const _0x3e6498=_0x573991 instanceof Error?_0x573991[_0x318138(0x90)]:String(_0x573991);return console[_0x318138(0xa1)](a5_0x1f9909[_0x318138(0x89)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x3e6498)),0x1;}_0x2a1d7b['stop']();if(_0x3a0a09[_0x318138(0x10b)]>0x0){console[_0x318138(0xa1)](),console[_0x318138(0xa1)](a5_0x1f9909[_0x318138(0xdd)](_0x318138(0x99)));const {projectId:_0x5aefe5,agentId:_0x5868ac}=_0x1368d0[_0x318138(0xca)];for(const _0x434e9f of _0x3a0a09){console[_0x318138(0xa1)](_0x318138(0x9e)+a5_0x1f9909[_0x318138(0xc0)](_0x434e9f['name']));const _0x354103=createCommandSpinner(_0x318138(0xe1)+_0x434e9f['rounds'][_0x318138(0x10b)]+_0x318138(0xe2));_0x354103[_0x318138(0xd6)]();try{const {result:_0x18795f}=await runTest(_0x2db12d[_0x318138(0xbd)],_0x434e9f,{'agentId':_0x5868ac,'projectId':_0x5aefe5,'site':_0x1368d0[_0x318138(0xae)],'noEval':![],'evaluatorId':_0x25171e,'onRoundStart':(_0x38ae55,_0x4098ac)=>{const _0x5a7a54=_0x318138;_0x354103['text']='Round\x20'+(_0x38ae55+0x1)+'/'+_0x4098ac+_0x5a7a54(0xe2);},'onRoundComplete':(_0x40df65,_0x506038,_0x24092a)=>{const _0x1c0e93=_0x318138,_0x88ee0b=formatElapsed(_0x506038);_0x24092a?console[_0x1c0e93(0xa1)]('\x20\x20Round\x20'+(_0x40df65+0x1)+'/'+_0x434e9f[_0x1c0e93(0x9f)][_0x1c0e93(0x10b)]+'...\x20'+a5_0x1f9909['green']('✓')+'\x20('+_0x88ee0b+')'):console[_0x1c0e93(0xa1)](_0x1c0e93(0xef)+(_0x40df65+0x1)+'/'+_0x434e9f['rounds'][_0x1c0e93(0x10b)]+'...\x20'+a5_0x1f9909[_0x1c0e93(0x89)]('✗'));},'onEvaluationStart':()=>{const _0x3a8fb4=_0x318138;_0x354103[_0x3a8fb4(0x11b)]=_0x3a8fb4(0xad);},'onEvaluationComplete':_0x1c34fc=>{const _0x4fcac9=_0x318138,_0x4e29ab=formatElapsed(_0x1c34fc);console['log'](_0x4fcac9(0xa9)+a5_0x1f9909[_0x4fcac9(0x8e)]('✓')+'\x20('+_0x4e29ab+')');}});_0x354103[_0x318138(0xd8)](),_0x3443c5['push'](_0x18795f);if(_0x18795f[_0x318138(0x97)]===_0x318138(0x115))console[_0x318138(0xa1)](a5_0x1f9909['green'](_0x318138(0x118)+_0x18795f[_0x318138(0x101)])+a5_0x1f9909[_0x318138(0x10a)](_0x318138(0xcc)));else _0x18795f[_0x318138(0x97)]===_0x318138(0x119)?console['log'](a5_0x1f9909[_0x318138(0x89)](_0x318138(0xfe)+_0x18795f['reason'])+a5_0x1f9909[_0x318138(0x10a)](_0x318138(0xcc))):console[_0x318138(0xa1)](a5_0x1f9909[_0x318138(0x89)](_0x318138(0x11e)+_0x18795f['reason']));_0x18795f['conversation_url']&&console[_0x318138(0xa1)](a5_0x1f9909[_0x318138(0x10a)]('\x20\x20Conversation:\x20'+_0x18795f[_0x318138(0xd4)]));}catch(_0xed867f){_0x354103[_0x318138(0xd8)]();const _0x701e10=_0xed867f instanceof Error?_0xed867f[_0x318138(0x90)]:String(_0xed867f);console['log'](a5_0x1f9909[_0x318138(0x89)](_0x318138(0x11e)+_0x701e10)),_0x3443c5[_0x318138(0x94)]({'name':_0x434e9f[_0x318138(0xc9)],'status':_0x318138(0xd1),'reason':_0x701e10,'timestamp':new Date()[_0x318138(0x105)](),'duration_ms':0x0});}}}console['log']();const _0x24c401=Date[_0x318138(0xdc)]()-_0x7c8932,_0x1e08bb=_0x3443c5[_0x318138(0x11a)](_0x31b9d9=>_0x31b9d9[_0x318138(0x97)]===_0x318138(0x115))[_0x318138(0x10b)],_0x14cf4d=_0x3443c5[_0x318138(0x11a)](_0x54a607=>_0x54a607[_0x318138(0x97)]===_0x318138(0x119))['length'],_0x5ba5cf=_0x3443c5[_0x318138(0x11a)](_0x44a7a7=>_0x44a7a7[_0x318138(0x97)]===_0x318138(0xd1))[_0x318138(0x10b)];console['log']('━'[_0x318138(0xed)](0x3c)),console[_0x318138(0xa1)](_0x318138(0xf6)),console[_0x318138(0xa1)]('━'[_0x318138(0xed)](0x3c)),console['log'](_0x318138(0xee)+_0x3443c5[_0x318138(0x10b)]),console['log'](_0x318138(0xc3)+a5_0x1f9909[_0x318138(0x8e)](_0x1e08bb)),console['log'](_0x318138(0xe5)+a5_0x1f9909[_0x318138(0x89)](_0x14cf4d));_0x5ba5cf>0x0&&console[_0x318138(0xa1)](_0x318138(0xaf)+a5_0x1f9909[_0x318138(0x89)](_0x5ba5cf));console[_0x318138(0xa1)](_0x318138(0xfc)+formatElapsed(_0x24c401)),console['log']('━'[_0x318138(0xed)](0x3c));const _0x2c5461={'summary':{'total':_0x3443c5[_0x318138(0x10b)],'passed':_0x1e08bb,'failed':_0x14cf4d,'errors':_0x5ba5cf>0x0?_0x5ba5cf:undefined,'duration_ms':_0x24c401},'tests':_0x3443c5,'agent':{'project':_0x44d8e2[_0x318138(0x11c)],'name':_0x44d8e2[_0x318138(0x9c)],'site':_0x550db7},'timestamp':new Date(_0x7c8932)[_0x318138(0x105)]()};if(_0x26b92e!==_0x318138(0xe4)||_0x5181a7){const _0x30c747=formatResults(_0x2c5461,_0x26b92e);if(_0x5181a7)try{a5_0x34117f[_0x318138(0xc7)](_0x5181a7,_0x30c747,_0x318138(0x10c)),console[_0x318138(0xa1)](),console['log'](a5_0x1f9909['dim']('Output\x20written\x20to:\x20'+_0x5181a7));}catch(_0x4aaf6f){return console['log'](),console[_0x318138(0xa1)](a5_0x1f9909['red']('Error\x20writing\x20output\x20file:\x20'+_0x4aaf6f)),0x1;}else console[_0x318138(0xa1)](),console[_0x318138(0xa1)](_0x30c747);}const _0x236e00=_0x3443c5[_0x318138(0x11a)](_0x473e69=>_0x473e69['status']!==_0x318138(0x115));return _0x236e00[_0x318138(0x10b)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x20b66d=a6_0x5252;(function(_0x1aed35,_0x4ef8de){const _0x25f647=a6_0x5252,_0x2be5ef=_0x1aed35();while(!![]){try{const _0x3a2396=parseInt(_0x25f647(0x1af))/0x1+-parseInt(_0x25f647(0x18f))/0x2*(parseInt(_0x25f647(0x17a))/0x3)+-parseInt(_0x25f647(0x19b))/0x4*(-parseInt(_0x25f647(0x193))/0x5)+-parseInt(_0x25f647(0x1a2))/0x6*(-parseInt(_0x25f647(0x1a4))/0x7)+parseInt(_0x25f647(0x180))/0x8*(parseInt(_0x25f647(0x1a8))/0x9)+parseInt(_0x25f647(0x19a))/0xa+-parseInt(_0x25f647(0x1ab))/0xb;if(_0x3a2396===_0x4ef8de)break;else _0x2be5ef['push'](_0x2be5ef['shift']());}catch(_0x1d2330){_0x2be5ef['push'](_0x2be5ef['shift']());}}}(a6_0x46e3,0x3cca6));function a6_0x46e3(){const _0x2c24f6=['x-xsrf-token','3128rdaSuR','Results\x20saved\x20to\x20','entries','trino','has','status','message','\x0aStack\x20trace:\x0a','GET','llm','data','api','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','isArray','site','694ZbQauY','toLowerCase','\x22.\x20','cas','5OSVCtr','proxy-authorization','trim','Invalid\x20HTTP\x20method:\x20','color','indexOf','noColor','1994330NWfPPi','315048RNpjmL','substring','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','startsWith','workflow','x-auth-token','headers','913446YKbiqm','file','21kQkjkL','Error:\x20','cdp','output','4797fetyMa','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','.\x20Valid\x20methods:\x20','8427903SiAbtW','log','DELETE','error','456326yKTtxQ','<\x20HTTP/1.1\x20','execute','request','verbose','Invalid\x20API\x20type:\x20','cookie','set-cookie2','.\x20Valid\x20types:\x20','Endpoint\x20must\x20start\x20with\x20/:\x20','toUpperCase','x-trino-user','readBodyFromFile','keys','Invalid\x20header\x20format:\x20\x22','type','includes','PATCH','authorization','body','validate','3324zzQnTz','join','llm-proxy','stack','method'];a6_0x46e3=function(){return _0x2c24f6;};return a6_0x46e3();}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_0x20b66d(0x177),a6_0x20b66d(0x194),a6_0x20b66d(0x16b),'set-cookie',a6_0x20b66d(0x16c),a6_0x20b66d(0x17f),a6_0x20b66d(0x1a0),a6_0x20b66d(0x170)]);function isSensitiveHeader(_0xeab30c){const _0x339a80=a6_0x20b66d;return SENSITIVE_HEADERS[_0x339a80(0x184)](_0xeab30c[_0x339a80(0x190)]());}function a6_0x5252(_0x1e56ed,_0x1af654){_0x1e56ed=_0x1e56ed-0x169;const _0x46e343=a6_0x46e3();let _0x5252ab=_0x46e343[_0x1e56ed];return _0x5252ab;}function parseHeader(_0x5db8d8){const _0x2b4743=a6_0x20b66d,_0x5985dd=_0x5db8d8[_0x2b4743(0x198)](':');if(_0x5985dd===-0x1)throw new Error(_0x2b4743(0x173)+_0x5db8d8+_0x2b4743(0x191)+_0x2b4743(0x18c));const _0x2e8c98=_0x5db8d8['substring'](0x0,_0x5985dd)[_0x2b4743(0x195)](),_0x5b5196=_0x5db8d8[_0x2b4743(0x19c)](_0x5985dd+0x1)['trim']();if(!_0x2e8c98)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x5db8d8+'\x22');return[_0x2e8c98,_0x5b5196];}export class ApiCommand extends BaseCommand{['name']='api';['description']='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x20b66d(0x179)](_0x531a64){const _0x442453=a6_0x20b66d,{args:_0x36a313,options:_0x28e911}=_0x531a64,_0x501fa4=_0x28e911;if(_0x36a313['length']===0x0)return _0x442453(0x19d);const _0x18b4ef=_0x36a313[0x0];if(!_0x18b4ef[_0x442453(0x19e)]('/'))return _0x442453(0x16e)+_0x18b4ef;const _0x229c92=_0x501fa4[_0x442453(0x18a)],_0x410843=_0x501fa4[_0x442453(0x1a3)];if(_0x229c92&&_0x410843)return _0x442453(0x1a9);const _0x25b041=_0x501fa4[_0x442453(0x17e)]||_0x442453(0x188),_0x27b833=[_0x442453(0x188),'POST','PUT',_0x442453(0x1ad),_0x442453(0x176)];if(!_0x27b833[_0x442453(0x175)](_0x25b041['toUpperCase']()))return _0x442453(0x196)+_0x25b041+_0x442453(0x1aa)+_0x27b833[_0x442453(0x17b)](',\x20');const _0x46e2d2=_0x501fa4[_0x442453(0x174)]||'td',_0x150df5=['td',_0x442453(0x1a6),_0x442453(0x19f),_0x442453(0x183),_0x442453(0x189),_0x442453(0x17c),_0x442453(0x192)];if(!_0x150df5[_0x442453(0x175)](_0x46e2d2))return _0x442453(0x16a)+_0x46e2d2+_0x442453(0x16d)+_0x150df5['join'](',\x20');return undefined;}async[a6_0x20b66d(0x1b1)](_0x3c8503){const _0x27d6e6=a6_0x20b66d,{options:_0x49ea0e,args:_0xb1f177,tdx:_0xb4bae0}=_0x3c8503,_0x41ef58=_0x49ea0e,_0x7e5779=_0xb1f177[0x0],_0xa05c59=(_0x41ef58[_0x27d6e6(0x17e)]||_0x27d6e6(0x188))[_0x27d6e6(0x16f)](),_0x5e8ef8=_0x41ef58[_0x27d6e6(0x18a)],_0x48918c=_0x41ef58[_0x27d6e6(0x1a3)],_0x5c24ba=_0x41ef58['header'],_0xd1d58a=_0x41ef58[_0x27d6e6(0x174)]||'td';try{const _0x2534d2={};if(_0x5c24ba){const _0x103df2=Array[_0x27d6e6(0x18d)](_0x5c24ba)?_0x5c24ba:[_0x5c24ba];for(const _0xde254d of _0x103df2){const [_0xf89941,_0x454746]=parseHeader(_0xde254d);_0x2534d2[_0xf89941]=_0x454746;}}let _0x1b929d;if(_0x5e8ef8)_0x1b929d=_0x5e8ef8;else{if(_0x48918c)try{_0x1b929d=RawAPI[_0x27d6e6(0x171)](_0x48918c);}catch(_0x2b9015){return console['error'](_0x27d6e6(0x1a5)+(_0x2b9015 instanceof Error?_0x2b9015[_0x27d6e6(0x186)]:String(_0x2b9015))),0x1;}}const _0x35ac69={'method':_0xa05c59,'apiType':_0xd1d58a,'includeHeaders':_0x49ea0e[_0x27d6e6(0x169)]};_0x1b929d&&(_0x35ac69[_0x27d6e6(0x178)]=_0x1b929d);Object[_0x27d6e6(0x172)](_0x2534d2)['length']>0x0&&(_0x35ac69[_0x27d6e6(0x1a1)]=_0x2534d2);if(_0x49ea0e[_0x27d6e6(0x169)]){const _0x52a5c3=resolveSite(_0x49ea0e[_0x27d6e6(0x18e)]),_0x599514=getEndpoint(_0x52a5c3,_0xd1d58a),_0x1b7ed6=''+_0x599514+_0x7e5779;console[_0x27d6e6(0x1ae)]('>\x20'+_0xa05c59+'\x20'+_0x1b7ed6);const _0x2433f5=getAuthHeaders(_0x52a5c3),_0x158693={..._0x2433f5,..._0x2534d2};for(const [_0x3413b2,_0x39a961]of Object[_0x27d6e6(0x182)](_0x158693)){!isSensitiveHeader(_0x3413b2)&&console['error']('>\x20'+_0x3413b2+':\x20'+_0x39a961);}_0x1b929d&&console['error']('>'),console[_0x27d6e6(0x1ae)]('');}const _0x57f89a=await _0xb4bae0[_0x27d6e6(0x18b)][_0x27d6e6(0x1b2)](_0x7e5779,_0x35ac69);if(_0x49ea0e['verbose']&&_0x57f89a[_0x27d6e6(0x1a1)]){console[_0x27d6e6(0x1ae)](_0x27d6e6(0x1b0)+_0x57f89a[_0x27d6e6(0x185)]);for(const [_0x5500a4,_0x31d018]of Object[_0x27d6e6(0x182)](_0x57f89a[_0x27d6e6(0x1a1)])){!isSensitiveHeader(_0x5500a4)&&console[_0x27d6e6(0x1ae)]('<\x20'+_0x5500a4+':\x20'+_0x31d018);}console[_0x27d6e6(0x1ae)]('');}const _0x40e97e=Boolean(_0x49ea0e[_0x27d6e6(0x1a7)]),_0x6cd0a8={'color':_0x49ea0e[_0x27d6e6(0x197)],'noColor':_0x49ea0e[_0x27d6e6(0x199)]||_0x40e97e&&!_0x49ea0e['color']},_0x4ebfd2=colorizeJSON(_0x57f89a[_0x27d6e6(0x18a)],_0x6cd0a8);return _0x49ea0e[_0x27d6e6(0x1a7)]?(writeFileSync(_0x49ea0e[_0x27d6e6(0x1a7)],_0x4ebfd2),console['error'](_0x27d6e6(0x181)+_0x49ea0e[_0x27d6e6(0x1a7)])):console[_0x27d6e6(0x1ac)](_0x4ebfd2),0x0;}catch(_0x3d1c5b){return _0x3d1c5b instanceof Error?(console[_0x27d6e6(0x1ae)](_0x27d6e6(0x1a5)+_0x3d1c5b['message']),_0x49ea0e[_0x27d6e6(0x169)]&&_0x3d1c5b['stack']&&console[_0x27d6e6(0x1ae)](_0x27d6e6(0x187)+_0x3d1c5b[_0x27d6e6(0x17d)])):console['error']('Error:\x20'+String(_0x3d1c5b)),0x1;}}}
1
+ const a6_0x2e1d83=a6_0x1735;(function(_0x192fa0,_0x12ca95){const _0x516bae=a6_0x1735,_0x49dd61=_0x192fa0();while(!![]){try{const _0x338f3b=-parseInt(_0x516bae(0x1a4))/0x1+parseInt(_0x516bae(0x1b5))/0x2*(parseInt(_0x516bae(0x1b2))/0x3)+-parseInt(_0x516bae(0x18f))/0x4+parseInt(_0x516bae(0x1ad))/0x5*(parseInt(_0x516bae(0x1bf))/0x6)+parseInt(_0x516bae(0x1b8))/0x7+parseInt(_0x516bae(0x186))/0x8*(-parseInt(_0x516bae(0x1af))/0x9)+-parseInt(_0x516bae(0x193))/0xa;if(_0x338f3b===_0x12ca95)break;else _0x49dd61['push'](_0x49dd61['shift']());}catch(_0x54d420){_0x49dd61['push'](_0x49dd61['shift']());}}}(a6_0x312d,0x5409e));function a6_0x1735(_0x27ca2a,_0x77dddf){_0x27ca2a=_0x27ca2a-0x17f;const _0x312da5=a6_0x312d();let _0x173508=_0x312da5[_0x27ca2a];return _0x173508;}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_0x2e1d83(0x1a7),'proxy-authorization',a6_0x2e1d83(0x1b3),a6_0x2e1d83(0x189),'set-cookie2','x-xsrf-token',a6_0x2e1d83(0x182),a6_0x2e1d83(0x1be)]);function isSensitiveHeader(_0x4bd631){const _0x5d5ed=a6_0x2e1d83;return SENSITIVE_HEADERS[_0x5d5ed(0x1bd)](_0x4bd631['toLowerCase']());}function parseHeader(_0x2f15c1){const _0x4caa06=a6_0x2e1d83,_0x3fe894=_0x2f15c1['indexOf'](':');if(_0x3fe894===-0x1)throw new Error(_0x4caa06(0x181)+_0x2f15c1+_0x4caa06(0x1a0)+_0x4caa06(0x18a));const _0x4aa92a=_0x2f15c1[_0x4caa06(0x1bb)](0x0,_0x3fe894)[_0x4caa06(0x1ac)](),_0x353dcb=_0x2f15c1['substring'](_0x3fe894+0x1)[_0x4caa06(0x1ac)]();if(!_0x4aa92a)throw new Error(_0x4caa06(0x1ab)+_0x2f15c1+'\x22');return[_0x4aa92a,_0x353dcb];}export class ApiCommand extends BaseCommand{['name']=a6_0x2e1d83(0x188);[a6_0x2e1d83(0x195)]=a6_0x2e1d83(0x187);[a6_0x2e1d83(0x1b1)](_0x445d1a){const _0x5b064d=a6_0x2e1d83,{args:_0x12022e,options:_0x471d0a}=_0x445d1a,_0xee04c0=_0x471d0a;if(_0x12022e[_0x5b064d(0x18d)]===0x0)return _0x5b064d(0x184);const _0x4943c0=_0x12022e[0x0];if(!_0x4943c0['startsWith']('/'))return _0x5b064d(0x196)+_0x4943c0;const _0x17bc44=_0xee04c0[_0x5b064d(0x18b)],_0x22d91a=_0xee04c0[_0x5b064d(0x19e)];if(_0x17bc44&&_0x22d91a)return _0x5b064d(0x19d);const _0x56e31c=_0xee04c0[_0x5b064d(0x191)]||_0x5b064d(0x190),_0x53edaa=[_0x5b064d(0x190),_0x5b064d(0x1b6),_0x5b064d(0x1a6),'DELETE',_0x5b064d(0x183)];if(!_0x53edaa[_0x5b064d(0x1a9)](_0x56e31c[_0x5b064d(0x194)]()))return _0x5b064d(0x19f)+_0x56e31c+_0x5b064d(0x1ae)+_0x53edaa['join'](',\x20');const _0x586c24=_0xee04c0['type']||'td',_0xbfa0e7=['td',_0x5b064d(0x1a1),_0x5b064d(0x180),'trino',_0x5b064d(0x1bc),_0x5b064d(0x1b7),'cas'];if(!_0xbfa0e7[_0x5b064d(0x1a9)](_0x586c24))return'Invalid\x20API\x20type:\x20'+_0x586c24+_0x5b064d(0x19c)+_0xbfa0e7[_0x5b064d(0x19b)](',\x20');return undefined;}async['execute'](_0x124e7c){const _0x4b3dc5=a6_0x2e1d83,{options:_0x1d636,args:_0x4426b9,tdx:_0x37c3cb}=_0x124e7c,_0x359a04=_0x1d636,_0x3593da=_0x4426b9[0x0],_0x5b36c7=(_0x359a04[_0x4b3dc5(0x191)]||_0x4b3dc5(0x190))[_0x4b3dc5(0x194)](),_0x31de9c=_0x359a04['data'],_0x17ccbf=_0x359a04[_0x4b3dc5(0x19e)],_0x4ab18d=_0x359a04['header'],_0x49e583=_0x359a04['type']||'td';try{const _0x4ce60a={};if(_0x4ab18d){const _0x2e4807=Array[_0x4b3dc5(0x1b4)](_0x4ab18d)?_0x4ab18d:[_0x4ab18d];for(const _0x45a436 of _0x2e4807){const [_0xc2ba26,_0x25cb15]=parseHeader(_0x45a436);_0x4ce60a[_0xc2ba26]=_0x25cb15;}}let _0x36363e;if(_0x31de9c)_0x36363e=_0x31de9c;else{if(_0x17ccbf)try{_0x36363e=RawAPI[_0x4b3dc5(0x18e)](_0x17ccbf);}catch(_0x594cf4){return console[_0x4b3dc5(0x19a)](_0x4b3dc5(0x199)+(_0x594cf4 instanceof Error?_0x594cf4[_0x4b3dc5(0x1b0)]:String(_0x594cf4))),0x1;}}const _0x14f46e={'method':_0x5b36c7,'apiType':_0x49e583,'includeHeaders':_0x1d636['verbose']};_0x36363e&&(_0x14f46e[_0x4b3dc5(0x17f)]=_0x36363e);Object[_0x4b3dc5(0x18c)](_0x4ce60a)['length']>0x0&&(_0x14f46e['headers']=_0x4ce60a);if(_0x1d636[_0x4b3dc5(0x198)]){const _0x1d74ed=resolveSite(_0x1d636[_0x4b3dc5(0x1ba)]),_0x2a823e=getEndpoint(_0x1d74ed,_0x49e583),_0x2476fe=''+_0x2a823e+_0x3593da;console[_0x4b3dc5(0x19a)]('>\x20'+_0x5b36c7+'\x20'+_0x2476fe);const _0x3e0589=getAuthHeaders(_0x1d74ed),_0x2d5178={..._0x3e0589,..._0x4ce60a};for(const [_0x372e7d,_0x528651]of Object[_0x4b3dc5(0x1c0)](_0x2d5178)){!isSensitiveHeader(_0x372e7d)&&console[_0x4b3dc5(0x19a)]('>\x20'+_0x372e7d+':\x20'+_0x528651);}_0x36363e&&console[_0x4b3dc5(0x19a)]('>'),console['error']('');}const _0x5589d6=await _0x37c3cb[_0x4b3dc5(0x188)][_0x4b3dc5(0x1b9)](_0x3593da,_0x14f46e);if(_0x1d636[_0x4b3dc5(0x198)]&&_0x5589d6[_0x4b3dc5(0x1a2)]){console['error']('<\x20HTTP/1.1\x20'+_0x5589d6[_0x4b3dc5(0x197)]);for(const [_0x1364d1,_0x44dc81]of Object[_0x4b3dc5(0x1c0)](_0x5589d6[_0x4b3dc5(0x1a2)])){!isSensitiveHeader(_0x1364d1)&&console[_0x4b3dc5(0x19a)]('<\x20'+_0x1364d1+':\x20'+_0x44dc81);}console['error']('');}const _0x3067f0=Boolean(_0x1d636['output']),_0x3eb921={'color':_0x1d636[_0x4b3dc5(0x185)],'noColor':_0x1d636[_0x4b3dc5(0x1aa)]||_0x3067f0&&!_0x1d636[_0x4b3dc5(0x185)]},_0x47dab0=colorizeJSON(_0x5589d6[_0x4b3dc5(0x18b)],_0x3eb921);return _0x1d636[_0x4b3dc5(0x1a3)]?(writeFileSync(_0x1d636['output'],_0x47dab0),console[_0x4b3dc5(0x19a)]('Results\x20saved\x20to\x20'+_0x1d636[_0x4b3dc5(0x1a3)])):console[_0x4b3dc5(0x1a8)](_0x47dab0),0x0;}catch(_0x7bd479){return _0x7bd479 instanceof Error?(console[_0x4b3dc5(0x19a)](_0x4b3dc5(0x199)+_0x7bd479[_0x4b3dc5(0x1b0)]),_0x1d636[_0x4b3dc5(0x198)]&&_0x7bd479[_0x4b3dc5(0x1a5)]&&console[_0x4b3dc5(0x19a)](_0x4b3dc5(0x192)+_0x7bd479[_0x4b3dc5(0x1a5)])):console[_0x4b3dc5(0x19a)]('Error:\x20'+String(_0x7bd479)),0x1;}}}function a6_0x312d(){const _0x5bf6af=['description','Endpoint\x20must\x20start\x20with\x20/:\x20','status','verbose','Error:\x20','error','join','.\x20Valid\x20types:\x20','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','file','Invalid\x20HTTP\x20method:\x20','\x22.\x20','cdp','headers','output','163970orjmVi','stack','PUT','authorization','log','includes','noColor','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','trim','2495HUWQVH','.\x20Valid\x20methods:\x20','9vkDIwi','message','validate','6CqPLFO','cookie','isArray','624770cvXzAv','POST','llm-proxy','3186946WLwCUp','request','site','substring','llm','has','x-trino-user','1926bAynLp','entries','body','workflow','Invalid\x20header\x20format:\x20\x22','x-auth-token','PATCH','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','color','2637464bgPkHo','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','api','set-cookie','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','data','keys','length','readBodyFromFile','1299824iTiwYI','GET','method','\x0aStack\x20trace:\x0a','773960AtXJAK','toUpperCase'];a6_0x312d=function(){return _0x5bf6af;};return a6_0x312d();}
@@ -1 +1 @@
1
- const a7_0x3a2a81=a7_0x26c2;function a7_0x15a9(){const _0x1d818d=['✗\x20Validation\x20failed:\x20','2504thDRSA','execute','site','\x20and\x20','warn','Validating\x20API\x20key...','882890iEnuSQ','create','profile','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','281238LYFUVf','OAuth\x20tokens','20UZQVGo','Choose\x20authentication\x20method:','bold','\x0aSetup\x20cancelled','77mZCnyF','join','tdx:\x20auth\x20clear','System\x20keychain\x20is\x20not\x20available','error','26gbyMIZ','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','7763ErvQEB','logLevel','\x20--profile\x20','getUserInfo','jobs','Read\x20credential\x20from\x20','apikey','password','API\x20key','select','all','auth:clear','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Name:\x20','auth:setup','No\x20credentials\x20found\x20in\x20keychain','status','17811JbjQwn','Credential\x20type:\x20OAuth','Remove\x20API\x20key\x20from\x20system\x20keychain','10jjnVEu','trim','\x20(profile:\x20','log','94015aSVXrk','4698jyHcpm','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20\x20tdx','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','Setup\x20API\x20key\x20authentication\x20interactively','tdx:\x20auth\x20setup','514201xbXYqA','ERROR','/app/mp/ak','method','Read\x20credential\x20from\x20keychain','Setup\x20cancelled','✓\x20Authentication\x20successful\x0a','User:\x20','\x20for\x20profile:\x20','tdx\x20profile:\x20','red','green','Setting\x20up\x20authentication\x20for\x20site:\x20','No\x20credential\x20found','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','last_name','filter','email','\x20(site:\x20','N/A','Enter\x20your\x20TD\x20API\x20key:','7765932ORuqcg','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','yellow','name','description','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','apiKey','oauth'];a7_0x15a9=function(){return _0x1d818d;};return a7_0x15a9();}(function(_0x53c121,_0x2c2edc){const _0x3a87b6=a7_0x26c2,_0x3b8a54=_0x53c121();while(!![]){try{const _0x2458aa=parseInt(_0x3a87b6(0x146))/0x1+parseInt(_0x3a87b6(0x13b))/0x2*(parseInt(_0x3a87b6(0x11a))/0x3)+-parseInt(_0x3a87b6(0x11c))/0x4*(parseInt(_0x3a87b6(0x13f))/0x5)+parseInt(_0x3a87b6(0x140))/0x6*(parseInt(_0x3a87b6(0x127))/0x7)+parseInt(_0x3a87b6(0x110))/0x8*(-parseInt(_0x3a87b6(0x138))/0x9)+parseInt(_0x3a87b6(0x116))/0xa*(parseInt(_0x3a87b6(0x120))/0xb)+-parseInt(_0x3a87b6(0x107))/0xc*(parseInt(_0x3a87b6(0x125))/0xd);if(_0x2458aa===_0x2c2edc)break;else _0x3b8a54['push'](_0x3b8a54['shift']());}catch(_0x1ba6c8){_0x3b8a54['push'](_0x3b8a54['shift']());}}}(a7_0x15a9,0x70ae1));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a7_0x26c2(_0x25032c,_0x445f3d){_0x25032c=_0x25032c-0xf8;const _0x15a92a=a7_0x15a9();let _0x26c2f1=_0x15a92a[_0x25032c];return _0x26c2f1;}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x31d3b1 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_0x109f01 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x3a2a81(0x10a)]=a7_0x3a2a81(0x135);[a7_0x3a2a81(0x10b)]=a7_0x3a2a81(0x144);async[a7_0x3a2a81(0x111)](_0x34120d){const _0x5a6d64=a7_0x3a2a81,{options:_0x587c44}=_0x34120d,_0x22e079=_0x587c44[_0x5a6d64(0x118)];console[_0x5a6d64(0x13e)](a7_0x109f01['bold'](_0x5a6d64(0x145)));const _0x59983d=_0x587c44[_0x5a6d64(0x112)]||'us01',_0x1c5582=await promptSiteSelection(_0x59983d,_0x22e079,_0x5a6d64(0x14b));if(!_0x1c5582)return 0x1;const _0x4dc7ee=resolveSite(_0x1c5582);if(isOAuthSupported(_0x4dc7ee)){const _0x5544b4=await a7_0x31d3b1({'type':_0x5a6d64(0x130),'name':_0x5a6d64(0x149),'message':_0x5a6d64(0x11d),'choices':[{'title':'OAuth\x20(browser\x20login)','value':_0x5a6d64(0x10e)},{'title':'API\x20Key','value':_0x5a6d64(0x12d)}]});if(!_0x5544b4[_0x5a6d64(0x149)])return console[_0x5a6d64(0x13e)](_0x5a6d64(0x11f)),0x1;if(_0x5544b4[_0x5a6d64(0x149)]==='oauth')return await runOAuthLoginFlow(_0x4dc7ee,_0x22e079,_0x587c44[_0x5a6d64(0x128)]??LogLevel[_0x5a6d64(0x147)]),0x0;}console[_0x5a6d64(0x13e)](_0x5a6d64(0xfd)+_0x4dc7ee),console[_0x5a6d64(0x13e)](_0x5a6d64(0x141)),console[_0x5a6d64(0x13e)]('\x20\x20'+getConsoleUrl(_0x4dc7ee,_0x5a6d64(0x148)));const _0x3b3aac=await a7_0x31d3b1({'type':_0x5a6d64(0x12e),'name':_0x5a6d64(0x10d),'message':_0x5a6d64(0x106),'validate':_0x4de801=>{const _0x547dbd=_0x5a6d64;if(!_0x4de801||!_0x4de801[_0x547dbd(0x13c)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x3b3aac[_0x5a6d64(0x10d)])return console['log'](_0x5a6d64(0x11f)),0x1;const _0x3d6457=_0x3b3aac['apiKey'];console[_0x5a6d64(0x13e)](_0x5a6d64(0x115));try{const _0x4e4bd9=TDX[_0x5a6d64(0x117)]({'site':_0x4dc7ee,'apiKey':_0x3d6457[_0x5a6d64(0x13c)](),'logLevel':_0x587c44[_0x5a6d64(0x128)]??LogLevel[_0x5a6d64(0x147)]}),_0x1160f8=await _0x4e4bd9[_0x5a6d64(0x12b)][_0x5a6d64(0x12a)]();console[_0x5a6d64(0x13e)](_0x5a6d64(0x100)+_0x1160f8[_0x5a6d64(0x103)]+')');const _0xf15d32=await isKeychainAvailable();_0xf15d32?(await saveAPIKeyAsync(_0x3d6457['trim'](),_0x4dc7ee,_0x22e079),console[_0x5a6d64(0x13e)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x22e079?_0x5a6d64(0x13d)+_0x22e079+')':''))):(console[_0x5a6d64(0x114)](a7_0x109f01[_0x5a6d64(0x109)](_0x5a6d64(0x119))),console[_0x5a6d64(0x114)](a7_0x109f01[_0x5a6d64(0x109)](_0x5a6d64(0x143))));if(_0x22e079){const _0x210a35={'site':_0x4dc7ee};saveProfileToUserConfig(_0x22e079,_0x210a35),console[_0x5a6d64(0x13e)]('✓\x20Profile\x20\x27'+_0x22e079+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x4dc7ee),console[_0x5a6d64(0x13e)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x4dc7ee);const _0x445d1e=_0x22e079?_0x5a6d64(0x129)+_0x22e079:'';return console[_0x5a6d64(0x13e)](),console[_0x5a6d64(0x13e)](_0x5a6d64(0x10c)),console['log'](_0x5a6d64(0x142)+_0x445d1e+_0x5a6d64(0x126)),console[_0x5a6d64(0x13e)](_0x5a6d64(0x142)+_0x445d1e+_0x5a6d64(0x133)),0x0;}catch(_0x4bc381){if(_0x4bc381 instanceof HTTPClientError&&_0x4bc381[_0x5a6d64(0x137)]===0x191)return printAuthError(_0x4bc381),0x1;return console[_0x5a6d64(0x124)](a7_0x109f01['red'](_0x5a6d64(0x10f)+(_0x4bc381 instanceof Error?_0x4bc381['message']:String(_0x4bc381)))),console[_0x5a6d64(0x124)](_0x5a6d64(0x108)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x3a2a81(0x10a)]='auth';[a7_0x3a2a81(0x10b)]=a7_0x3a2a81(0xff);async[a7_0x3a2a81(0x111)](_0x10c392){const _0x220248=a7_0x3a2a81,{options:_0x39becf,tdx:_0x580ac1}=_0x10c392,_0x1b88ff=_0x39becf[_0x220248(0x112)],_0x7dfd2b=_0x39becf[_0x220248(0x118)],_0x368ed0=_0x7dfd2b?_0x7dfd2b:_0x220248(0x105);console[_0x220248(0x13e)](_0x220248(0xfa)+_0x368ed0+_0x220248(0x104)+_0x1b88ff+')');const _0x4266a9=await getOAuthTokens(_0x7dfd2b);if(_0x4266a9)console['log'](_0x220248(0x139)),console[_0x220248(0x13e)](_0x220248(0x14a)+(_0x7dfd2b?'\x20(profile:\x20'+_0x7dfd2b+')':''));else{const _0x1e95bb=await resolveAPIKeyAsync(_0x1b88ff,_0x7dfd2b);if(_0x1e95bb){const {source:_0x1950fc,isDeprecated:_0x5d11ff}=_0x1e95bb,_0x5b8197=_0x220248(0x12c)+_0x1950fc;console['log'](_0x5d11ff?a7_0x109f01['yellow'](_0x5b8197):_0x5b8197);}else console[_0x220248(0x13e)](a7_0x109f01[_0x220248(0x109)](_0x220248(0xfe)));}try{const _0x513282=await _0x580ac1['jobs'][_0x220248(0x12a)]();return console['log'](a7_0x109f01[_0x220248(0xfc)](_0x220248(0x14c))),console['log'](_0x220248(0xf8)+_0x513282['email']),(_0x513282['first_name']||_0x513282[_0x220248(0x101)])&&console[_0x220248(0x13e)](_0x220248(0x134)+[_0x513282['first_name'],_0x513282[_0x220248(0x101)]][_0x220248(0x102)](Boolean)[_0x220248(0x121)]('\x20')),0x0;}catch(_0x5debc5){return _0x5debc5 instanceof HTTPClientError&&_0x5debc5[_0x220248(0x137)]===0x191?printAuthError(_0x5debc5,!![],_0x7dfd2b):console[_0x220248(0x124)](a7_0x109f01[_0x220248(0xfb)](_0x220248(0x10f)+(_0x5debc5 instanceof Error?_0x5debc5['message']:String(_0x5debc5)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x3a2a81(0x10a)]=a7_0x3a2a81(0x132);[a7_0x3a2a81(0x10b)]=a7_0x3a2a81(0x13a);async[a7_0x3a2a81(0x111)](_0x335ba1){const _0x2b9f52=a7_0x3a2a81,{options:_0x4014be}=_0x335ba1,_0x5ca5c5=_0x4014be['profile'];console[_0x2b9f52(0x13e)](a7_0x109f01[_0x2b9f52(0x11e)](_0x2b9f52(0x122)));const _0x2e3289=await isKeychainAvailable();if(!_0x2e3289)return console['error'](a7_0x109f01['red'](_0x2b9f52(0x123))),0x1;const [_0xd53441,_0x32c8e0]=await Promise[_0x2b9f52(0x131)]([deleteKeychainAPIKey(_0x5ca5c5),deleteOAuthTokens(_0x5ca5c5)]);if(_0xd53441||_0x32c8e0){clearCredentialCache();const _0x309e99=[_0xd53441&&_0x2b9f52(0x12f),_0x32c8e0&&_0x2b9f52(0x11b)][_0x2b9f52(0x102)](Boolean)['join'](_0x2b9f52(0x113));return console['log']('✓\x20'+_0x309e99+'\x20removed\x20from\x20keychain'+(_0x5ca5c5?_0x2b9f52(0x13d)+_0x5ca5c5+')':'')),0x0;}else return console[_0x2b9f52(0x13e)](_0x2b9f52(0x136)+(_0x5ca5c5?_0x2b9f52(0xf9)+_0x5ca5c5:'')),0x1;}}
1
+ const a7_0x3cebe4=a7_0x4993;(function(_0x884887,_0x28fba1){const _0x2667fa=a7_0x4993,_0x543a96=_0x884887();while(!![]){try{const _0x51203d=-parseInt(_0x2667fa(0x15f))/0x1+-parseInt(_0x2667fa(0x149))/0x2+parseInt(_0x2667fa(0x16d))/0x3*(-parseInt(_0x2667fa(0x138))/0x4)+-parseInt(_0x2667fa(0x132))/0x5+-parseInt(_0x2667fa(0x147))/0x6+parseInt(_0x2667fa(0x14e))/0x7*(-parseInt(_0x2667fa(0x150))/0x8)+parseInt(_0x2667fa(0x13f))/0x9;if(_0x51203d===_0x28fba1)break;else _0x543a96['push'](_0x543a96['shift']());}catch(_0x3c0949){_0x543a96['push'](_0x543a96['shift']());}}}(a7_0x56ae,0x88dba));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';function a7_0x4993(_0x5722ff,_0x5e0779){_0x5722ff=_0x5722ff-0x125;const _0x56aeff=a7_0x56ae();let _0x4993bd=_0x56aeff[_0x5722ff];return _0x4993bd;}import{clearCredentialCache}from'../core/credential-cache.js';import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x31725f 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_0x3e0e32 from'chalk';export class AuthSetupCommand extends BaseCommand{['name']=a7_0x3cebe4(0x12c);[a7_0x3cebe4(0x16f)]=a7_0x3cebe4(0x142);async[a7_0x3cebe4(0x14d)](_0x1b052d){const _0x28521e=a7_0x3cebe4,{options:_0x2bbbcc}=_0x1b052d,_0x79ce47=_0x2bbbcc[_0x28521e(0x14f)];console[_0x28521e(0x148)](a7_0x3e0e32[_0x28521e(0x16a)](_0x28521e(0x153)));const _0x2ef540=_0x2bbbcc[_0x28521e(0x12f)]||'us01',_0x35b74a=await promptSiteSelection(_0x2ef540,_0x79ce47,_0x28521e(0x14b));if(!_0x35b74a)return 0x1;const _0x1177b1=resolveSite(_0x35b74a);if(isOAuthSupported(_0x1177b1)){const _0x25a9b7=await a7_0x31725f({'type':_0x28521e(0x155),'name':_0x28521e(0x154),'message':_0x28521e(0x166),'choices':[{'title':_0x28521e(0x169),'value':_0x28521e(0x144)},{'title':_0x28521e(0x128),'value':_0x28521e(0x15c)}]});if(!_0x25a9b7[_0x28521e(0x154)])return console[_0x28521e(0x148)]('\x0aSetup\x20cancelled'),0x1;if(_0x25a9b7[_0x28521e(0x154)]===_0x28521e(0x144))return await runOAuthLoginFlow(_0x1177b1,_0x79ce47,_0x2bbbcc[_0x28521e(0x159)]??LogLevel[_0x28521e(0x129)]),0x0;}console['log'](_0x28521e(0x136)+_0x1177b1),console['log'](_0x28521e(0x13d)),console[_0x28521e(0x148)]('\x20\x20'+getConsoleUrl(_0x1177b1,'/app/mp/ak'));const _0x42f67b=await a7_0x31725f({'type':_0x28521e(0x145),'name':'apiKey','message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x4392e5=>{const _0x265577=_0x28521e;if(!_0x4392e5||!_0x4392e5[_0x265577(0x13e)]())return _0x265577(0x16c);return!![];}});if(!_0x42f67b[_0x28521e(0x162)])return console['log'](_0x28521e(0x15e)),0x1;const _0x47c39e=_0x42f67b[_0x28521e(0x162)];console['log']('Validating\x20API\x20key...');try{const _0xc79ecd=TDX[_0x28521e(0x12d)]({'site':_0x1177b1,'apiKey':_0x47c39e[_0x28521e(0x13e)](),'logLevel':_0x2bbbcc[_0x28521e(0x159)]??LogLevel['ERROR']}),_0x257e46=await _0xc79ecd['jobs']['getUserInfo']();console[_0x28521e(0x148)](_0x28521e(0x16e)+_0x257e46[_0x28521e(0x137)]+')');const _0x86929f=await isKeychainAvailable();_0x86929f?(await saveAPIKeyAsync(_0x47c39e['trim'](),_0x1177b1,_0x79ce47),console[_0x28521e(0x148)](_0x28521e(0x12a)+(_0x79ce47?'\x20(profile:\x20'+_0x79ce47+')':''))):(console['warn'](a7_0x3e0e32[_0x28521e(0x146)](_0x28521e(0x164))),console[_0x28521e(0x168)](a7_0x3e0e32['yellow']('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x79ce47){const _0x1977e4={'site':_0x1177b1};saveProfileToUserConfig(_0x79ce47,_0x1977e4),console[_0x28521e(0x148)](_0x28521e(0x141)+_0x79ce47+_0x28521e(0x126));}else saveDefaultSiteToUserConfig(_0x1177b1),console[_0x28521e(0x148)](_0x28521e(0x157)+_0x1177b1);const _0x199bec=_0x79ce47?_0x28521e(0x152)+_0x79ce47:'';return console[_0x28521e(0x148)](),console[_0x28521e(0x148)](_0x28521e(0x167)),console[_0x28521e(0x148)](_0x28521e(0x131)+_0x199bec+_0x28521e(0x14c)),console[_0x28521e(0x148)](_0x28521e(0x131)+_0x199bec+_0x28521e(0x134)),0x0;}catch(_0x5738cb){if(_0x5738cb instanceof HTTPClientError&&_0x5738cb[_0x28521e(0x140)]===0x191)return printAuthError(_0x5738cb),0x1;return console[_0x28521e(0x171)](a7_0x3e0e32['red'](_0x28521e(0x135)+(_0x5738cb instanceof Error?_0x5738cb['message']:String(_0x5738cb)))),console[_0x28521e(0x171)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x3cebe4(0x16b);['description']=a7_0x3cebe4(0x173);async[a7_0x3cebe4(0x14d)](_0x4183a9){const _0x1cfda4=a7_0x3cebe4,{options:_0x4784c8,tdx:_0x267456}=_0x4183a9,_0x514307=_0x4784c8['site'],_0x16fe3b=_0x4784c8[_0x1cfda4(0x14f)],_0x4adba8=_0x16fe3b?_0x16fe3b:'N/A';console[_0x1cfda4(0x148)](_0x1cfda4(0x12e)+_0x4adba8+_0x1cfda4(0x133)+_0x514307+')');const _0x141725=await getOAuthTokens(_0x16fe3b);if(_0x141725)console[_0x1cfda4(0x148)](_0x1cfda4(0x125)),console[_0x1cfda4(0x148)](_0x1cfda4(0x175)+(_0x16fe3b?_0x1cfda4(0x13a)+_0x16fe3b+')':''));else{const _0xf7506=await resolveAPIKeyAsync(_0x514307,_0x16fe3b);if(_0xf7506){const {source:_0x3e4ff6,isDeprecated:_0x4b5ebb}=_0xf7506,_0x1d7acd='Read\x20credential\x20from\x20'+_0x3e4ff6;console['log'](_0x4b5ebb?a7_0x3e0e32['yellow'](_0x1d7acd):_0x1d7acd);}else console[_0x1cfda4(0x148)](a7_0x3e0e32[_0x1cfda4(0x146)](_0x1cfda4(0x160)));}try{const _0x1b569c=await _0x267456['jobs'][_0x1cfda4(0x172)]();return console[_0x1cfda4(0x148)](a7_0x3e0e32['green'](_0x1cfda4(0x174))),console[_0x1cfda4(0x148)]('User:\x20'+_0x1b569c['email']),(_0x1b569c[_0x1cfda4(0x127)]||_0x1b569c[_0x1cfda4(0x165)])&&console['log'](_0x1cfda4(0x156)+[_0x1b569c[_0x1cfda4(0x127)],_0x1b569c[_0x1cfda4(0x165)]][_0x1cfda4(0x13b)](Boolean)[_0x1cfda4(0x151)]('\x20')),0x0;}catch(_0x4c9b94){return _0x4c9b94 instanceof HTTPClientError&&_0x4c9b94[_0x1cfda4(0x140)]===0x191?printAuthError(_0x4c9b94,!![],_0x16fe3b):console[_0x1cfda4(0x171)](a7_0x3e0e32[_0x1cfda4(0x130)](_0x1cfda4(0x135)+(_0x4c9b94 instanceof Error?_0x4c9b94[_0x1cfda4(0x143)]:String(_0x4c9b94)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x3cebe4(0x161)]=a7_0x3cebe4(0x163);[a7_0x3cebe4(0x16f)]=a7_0x3cebe4(0x15a);async[a7_0x3cebe4(0x14d)](_0x3d6563){const _0x411baa=a7_0x3cebe4,{options:_0x1ba7ad}=_0x3d6563,_0x5fa7f5=_0x1ba7ad[_0x411baa(0x14f)];console[_0x411baa(0x148)](a7_0x3e0e32[_0x411baa(0x16a)](_0x411baa(0x13c)));const _0x51bad2=await isKeychainAvailable();if(!_0x51bad2)return console[_0x411baa(0x171)](a7_0x3e0e32[_0x411baa(0x130)](_0x411baa(0x15d))),0x1;const [_0x4ca7ec,_0x3561dd]=await Promise[_0x411baa(0x170)]([deleteKeychainAPIKey(_0x5fa7f5),deleteOAuthTokens(_0x5fa7f5)]);if(_0x4ca7ec||_0x3561dd){clearCredentialCache();const _0x546cd9=[_0x4ca7ec&&_0x411baa(0x158),_0x3561dd&&_0x411baa(0x139)][_0x411baa(0x13b)](Boolean)['join']('\x20and\x20');return console['log']('✓\x20'+_0x546cd9+_0x411baa(0x15b)+(_0x5fa7f5?_0x411baa(0x13a)+_0x5fa7f5+')':'')),0x0;}else return console[_0x411baa(0x148)](_0x411baa(0x14a)+(_0x5fa7f5?_0x411baa(0x12b)+_0x5fa7f5:'')),0x1;}}function a7_0x56ae(){const _0x1c0084=['site','red','\x20\x20tdx','2343565zurgWz','\x20(site:\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','✗\x20Validation\x20failed:\x20','Setting\x20up\x20authentication\x20for\x20site:\x20','email','4158968LlbWSf','OAuth\x20tokens','\x20(profile:\x20','filter','tdx:\x20auth\x20clear','You\x20can\x20find\x20your\x20API\x20key\x20at:','trim','38771109cVqNCn','status','✓\x20Profile\x20\x27','Setup\x20API\x20key\x20authentication\x20interactively','message','oauth','password','yellow','4666692TZtbwp','log','822980eIgIvb','No\x20credentials\x20found\x20in\x20keychain','Setup\x20cancelled','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','execute','11844gHyPaU','profile','2344yRiHdk','join','\x20--profile\x20','tdx:\x20auth\x20setup','method','select','Name:\x20','✓\x20Default\x20site\x20set\x20to\x20','API\x20key','logLevel','Remove\x20API\x20key\x20from\x20system\x20keychain','\x20removed\x20from\x20keychain','apikey','System\x20keychain\x20is\x20not\x20available','\x0aSetup\x20cancelled','553848Qfinoi','No\x20credential\x20found','name','apiKey','auth:clear','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','last_name','Choose\x20authentication\x20method:','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','warn','OAuth\x20(browser\x20login)','bold','auth','API\x20key\x20cannot\x20be\x20empty','3DGNTWd','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','description','all','error','getUserInfo','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','✓\x20Authentication\x20successful\x0a','Read\x20credential\x20from\x20keychain','Credential\x20type:\x20OAuth','\x27\x20registered','first_name','API\x20Key','ERROR','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','\x20for\x20profile:\x20','auth:setup','create','tdx\x20profile:\x20'];a7_0x56ae=function(){return _0x1c0084;};return a7_0x56ae();}
@@ -1 +1 @@
1
- const a8_0x34058a=a8_0x787a;(function(_0x288892,_0x377348){const _0x59294a=a8_0x787a,_0x5c2cca=_0x288892();while(!![]){try{const _0x481659=-parseInt(_0x59294a(0x1c1))/0x1+parseInt(_0x59294a(0x1ca))/0x2+-parseInt(_0x59294a(0x1b9))/0x3+parseInt(_0x59294a(0x1bc))/0x4*(-parseInt(_0x59294a(0x1a7))/0x5)+parseInt(_0x59294a(0x1cd))/0x6+-parseInt(_0x59294a(0x1ba))/0x7*(-parseInt(_0x59294a(0x1a5))/0x8)+-parseInt(_0x59294a(0x1ab))/0x9;if(_0x481659===_0x377348)break;else _0x5c2cca['push'](_0x5c2cca['shift']());}catch(_0x27565a){_0x5c2cca['push'](_0x5c2cca['shift']());}}}(a8_0x2ab9,0x5abaa));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{isKeychainAvailable}from'../core/keychain.js';import{saveOAuthTokens}from'../core/oauth-keychain.js';import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x5795d1 from'chalk';function a8_0x787a(_0x13abc7,_0x33e063){_0x13abc7=_0x13abc7-0x1a3;const _0x2ab903=a8_0x2ab9();let _0x787a00=_0x2ab903[_0x13abc7];return _0x787a00;}export async function runOAuthLoginFlow(_0x5d859f,_0x11a795,_0x55a7ba){const _0x5d825c=a8_0x787a;if(!isOAuthSupported(_0x5d859f))throw new Error(_0x5d825c(0x1bf)+_0x5d859f+'.\x20'+_0x5d825c(0x1cb)+_0x5d825c(0x1a6));const _0x40bab2=await isKeychainAvailable();if(!_0x40bab2)throw new Error(_0x5d825c(0x1af)+_0x5d825c(0x1a6));const _0x2370f1=getConsoleUrl(_0x5d859f);console[_0x5d825c(0x1c7)](_0x5d825c(0x1bb)),console[_0x5d825c(0x1c7)]('\x20\x20'+_0x2370f1+_0x5d825c(0x1c0)),console['log'](_0x5d825c(0x1ae));const _0x13f03b=await startOAuthFlow(_0x5d859f);console['log'](_0x5d825c(0x1cc));const _0x564cc3=TDX[_0x5d825c(0x1be)]({'site':_0x5d859f,'accessToken':_0x13f03b[_0x5d825c(0x1c5)],'logLevel':_0x55a7ba??LogLevel[_0x5d825c(0x1b1)]}),_0x81c76d=await _0x564cc3[_0x5d825c(0x1c4)][_0x5d825c(0x1b8)]();console['log'](a8_0x5795d1[_0x5d825c(0x1bd)](_0x5d825c(0x1c8)+_0x81c76d[_0x5d825c(0x1b7)]+')')),await saveOAuthTokens(_0x13f03b,_0x11a795),console[_0x5d825c(0x1c7)](_0x5d825c(0x1c3)+(_0x11a795?_0x5d825c(0x1a9)+_0x11a795+')':''));if(_0x11a795){const _0x5127f0={'site':_0x5d859f};saveProfileToUserConfig(_0x11a795,_0x5127f0),console[_0x5d825c(0x1c7)](_0x5d825c(0x1ad)+_0x11a795+'\x27\x20registered');}const _0x269202=_0x11a795?_0x5d825c(0x1b2)+_0x11a795:'';console[_0x5d825c(0x1c7)](),console[_0x5d825c(0x1c7)](_0x5d825c(0x1aa)),console[_0x5d825c(0x1c7)](_0x5d825c(0x1c2)+_0x269202+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x5d825c(0x1c7)](_0x5d825c(0x1c2)+_0x269202+_0x5d825c(0x1a3));}function a8_0x2ab9(){const _0x5d0c26=['jobs','access_token','bold','log','✓\x20Authentication\x20successful\x20(User:\x20','tdx:\x20auth\x20login','834864siktVv','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','Validating\x20OAuth\x20tokens...','2181654zOEASb','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','profile','8rJjRic','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','40VmKvBB','name','\x20(profile:\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','3777453YpoNAe','Login\x20via\x20OAuth\x20(opens\x20browser)','✓\x20Profile\x20\x27','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','description','ERROR','\x20--profile\x20','logLevel','us01','execute','auth:login','email','getUserInfo','528705kGNIkS','5098765WJjbMZ','Opening\x20browser\x20for\x20authentication...','88808vnkntY','green','create','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','/oauth/authorize','364242duITJN','\x20\x20tdx','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'];a8_0x2ab9=function(){return _0x5d0c26;};return a8_0x2ab9();}export class AuthLoginCommand extends BaseCommand{[a8_0x34058a(0x1a8)]=a8_0x34058a(0x1b6);[a8_0x34058a(0x1b0)]=a8_0x34058a(0x1ac);async[a8_0x34058a(0x1b5)](_0x184e8b){const _0x236f97=a8_0x34058a,{options:_0x34b2dd}=_0x184e8b,_0x2cfc0c=_0x34b2dd[_0x236f97(0x1a4)];console[_0x236f97(0x1c7)](a8_0x5795d1[_0x236f97(0x1c6)](_0x236f97(0x1c9)));const _0xed47d6=_0x34b2dd['site']||_0x236f97(0x1b4),_0x1ee2da=await promptSiteSelection(_0xed47d6,_0x2cfc0c,'Login\x20cancelled');if(!_0x1ee2da)return 0x1;const _0x3354d=resolveSite(_0x1ee2da);return console[_0x236f97(0x1c7)]('Authenticating\x20via\x20OAuth\x20for\x20site:\x20'+_0x3354d),await runOAuthLoginFlow(_0x3354d,_0x2cfc0c,_0x34b2dd[_0x236f97(0x1b3)]??LogLevel[_0x236f97(0x1b1)]),0x0;}}
1
+ const a8_0x13fa93=a8_0x1f59;(function(_0x3bc290,_0x3acba6){const _0x11ff0a=a8_0x1f59,_0x256866=_0x3bc290();while(!![]){try{const _0x44c3e7=-parseInt(_0x11ff0a(0x179))/0x1+-parseInt(_0x11ff0a(0x172))/0x2+-parseInt(_0x11ff0a(0x16f))/0x3+-parseInt(_0x11ff0a(0x166))/0x4+parseInt(_0x11ff0a(0x162))/0x5*(parseInt(_0x11ff0a(0x183))/0x6)+parseInt(_0x11ff0a(0x163))/0x7*(-parseInt(_0x11ff0a(0x17a))/0x8)+parseInt(_0x11ff0a(0x174))/0x9;if(_0x44c3e7===_0x3acba6)break;else _0x256866['push'](_0x256866['shift']());}catch(_0x2fa074){_0x256866['push'](_0x256866['shift']());}}}(a8_0x4b9e,0x22f52));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a8_0x1f59(_0x59ced0,_0x3966e1){_0x59ced0=_0x59ced0-0x162;const _0x4b9e5a=a8_0x4b9e();let _0x1f59df=_0x4b9e5a[_0x59ced0];return _0x1f59df;}import{isKeychainAvailable}from'../core/keychain.js';import{saveOAuthTokens}from'../core/oauth-keychain.js';import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x221729 from'chalk';export async function runOAuthLoginFlow(_0x1439c4,_0x43642e,_0x4d74be){const _0xd38513=a8_0x1f59;if(!isOAuthSupported(_0x1439c4))throw new Error(_0xd38513(0x178)+_0x1439c4+'.\x20'+'OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20'+_0xd38513(0x173));const _0x426a2e=await isKeychainAvailable();if(!_0x426a2e)throw new Error(_0xd38513(0x170)+_0xd38513(0x173));const _0x57ff4a=getConsoleUrl(_0x1439c4);console[_0xd38513(0x175)](_0xd38513(0x176)),console['log']('\x20\x20'+_0x57ff4a+'/oauth/authorize'),console['log'](_0xd38513(0x182));const _0x2cc66d=await startOAuthFlow(_0x1439c4);console['log'](_0xd38513(0x164));const _0x425715=TDX[_0xd38513(0x186)]({'site':_0x1439c4,'accessToken':_0x2cc66d[_0xd38513(0x181)],'logLevel':_0x4d74be??LogLevel[_0xd38513(0x185)]}),_0x4ed2f9=await _0x425715['jobs'][_0xd38513(0x17c)]();console[_0xd38513(0x175)](a8_0x221729[_0xd38513(0x167)](_0xd38513(0x168)+_0x4ed2f9[_0xd38513(0x177)]+')')),await saveOAuthTokens(_0x2cc66d,_0x43642e),console[_0xd38513(0x175)](_0xd38513(0x17d)+(_0x43642e?_0xd38513(0x171)+_0x43642e+')':''));if(_0x43642e){const _0x4818c1={'site':_0x1439c4};saveProfileToUserConfig(_0x43642e,_0x4818c1),console[_0xd38513(0x175)](_0xd38513(0x16a)+_0x43642e+_0xd38513(0x180));}const _0x5dfedb=_0x43642e?'\x20--profile\x20'+_0x43642e:'';console[_0xd38513(0x175)](),console['log'](_0xd38513(0x16c)),console[_0xd38513(0x175)]('\x20\x20tdx'+_0x5dfedb+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0xd38513(0x175)](_0xd38513(0x169)+_0x5dfedb+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}function a8_0x4b9e(){const _0x87ae64=['green','✓\x20Authentication\x20successful\x20(User:\x20','\x20\x20tdx','✓\x20Profile\x20\x27','logLevel','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','site','profile','542868iFcYzF','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','\x20(profile:\x20','466976fHPurk','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','5144922ZfEEnv','log','Opening\x20browser\x20for\x20authentication...','email','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','27213HLvLKm','16ftdxcn','execute','getUserInfo','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','description','\x27\x20registered','access_token','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','6PScgyc','auth:login','ERROR','create','name','954745HySUeW','369201PkAUcx','Validating\x20OAuth\x20tokens...','us01','289112qQGGGI'];a8_0x4b9e=function(){return _0x87ae64;};return a8_0x4b9e();}export class AuthLoginCommand extends BaseCommand{[a8_0x13fa93(0x187)]=a8_0x13fa93(0x184);[a8_0x13fa93(0x17f)]='Login\x20via\x20OAuth\x20(opens\x20browser)';async[a8_0x13fa93(0x17b)](_0x189327){const _0x1d49ab=a8_0x13fa93,{options:_0x2e3121}=_0x189327,_0x4f70d2=_0x2e3121[_0x1d49ab(0x16e)];console[_0x1d49ab(0x175)](a8_0x221729['bold']('tdx:\x20auth\x20login'));const _0x513680=_0x2e3121[_0x1d49ab(0x16d)]||_0x1d49ab(0x165),_0x54e2e7=await promptSiteSelection(_0x513680,_0x4f70d2,'Login\x20cancelled');if(!_0x54e2e7)return 0x1;const _0x47eb28=resolveSite(_0x54e2e7);return console[_0x1d49ab(0x175)](_0x1d49ab(0x17e)+_0x47eb28),await runOAuthLoginFlow(_0x47eb28,_0x4f70d2,_0x2e3121[_0x1d49ab(0x16b)]??LogLevel[_0x1d49ab(0x185)]),0x0;}}