@treasuredata/tdx 2026.3.36 → 2026.3.37

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 (219) 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.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/frontmatter.js +1 -1
  182. package/dist/sdk/workspace/git.js +1 -1
  183. package/dist/sdk/workspace/index.js +1 -1
  184. package/dist/sdk/workspace/templates.js +1 -1
  185. package/dist/sdk/workspace/weekly.js +1 -1
  186. package/dist/sdk/workspace/wikilinks.js +1 -1
  187. package/dist/test-utils/command-runner.js +1 -1
  188. package/dist/test-utils/factories.js +1 -1
  189. package/dist/test-utils/fixtures.js +1 -1
  190. package/dist/test-utils/http-mock.js +1 -1
  191. package/dist/test-utils/index.js +1 -1
  192. package/dist/utils/async.js +1 -1
  193. package/dist/utils/colors.js +1 -1
  194. package/dist/utils/diff.js +1 -1
  195. package/dist/utils/file-permissions.js +1 -1
  196. package/dist/utils/file-reader.js +1 -1
  197. package/dist/utils/github-releases.js +1 -1
  198. package/dist/utils/global-cache.js +1 -1
  199. package/dist/utils/json-loader.js +1 -1
  200. package/dist/utils/local-cache.js +1 -1
  201. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  202. package/dist/utils/logger/formatters/index.js +1 -1
  203. package/dist/utils/logger/handlers/console-handler.js +1 -1
  204. package/dist/utils/logger/handlers/file-handler.js +1 -1
  205. package/dist/utils/logger/handlers/index.js +1 -1
  206. package/dist/utils/logger/handlers/null-handler.js +1 -1
  207. package/dist/utils/logger/index.js +1 -1
  208. package/dist/utils/logger/logger.js +1 -1
  209. package/dist/utils/logger/types.js +1 -1
  210. package/dist/utils/option-validation.js +1 -1
  211. package/dist/utils/process.js +1 -1
  212. package/dist/utils/prompt.js +1 -1
  213. package/dist/utils/spinner.js +1 -1
  214. package/dist/utils/sse-parser.js +1 -1
  215. package/dist/utils/string-utils.js +1 -1
  216. package/dist/utils/table-ref-parser.js +1 -1
  217. package/dist/utils/tdx-logger.js +1 -1
  218. package/dist/utils/version-check.js +1 -1
  219. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x120f6e=a3_0x3a65;(function(_0x5bcaa7,_0x524e90){const _0x354fdc=a3_0x3a65,_0x2a43c2=_0x5bcaa7();while(!![]){try{const _0x39fa63=parseInt(_0x354fdc(0x176))/0x1*(parseInt(_0x354fdc(0x166))/0x2)+-parseInt(_0x354fdc(0x16f))/0x3+-parseInt(_0x354fdc(0x178))/0x4*(-parseInt(_0x354fdc(0x17c))/0x5)+-parseInt(_0x354fdc(0x165))/0x6*(parseInt(_0x354fdc(0x16e))/0x7)+parseInt(_0x354fdc(0x161))/0x8+parseInt(_0x354fdc(0x17f))/0x9*(parseInt(_0x354fdc(0x174))/0xa)+-parseInt(_0x354fdc(0x182))/0xb*(parseInt(_0x354fdc(0x17b))/0xc);if(_0x39fa63===_0x524e90)break;else _0x2a43c2['push'](_0x2a43c2['shift']());}catch(_0x232916){_0x2a43c2['push'](_0x2a43c2['shift']());}}}(a3_0x337e,0x54dd8));function a3_0x3a65(_0x187b63,_0x40bdf1){_0x187b63=_0x187b63-0x15f;const _0x337e64=a3_0x337e();let _0x3a65cf=_0x337e64[_0x187b63];return _0x3a65cf;}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_0x120f6e(0x169)]=a3_0x120f6e(0x162);[a3_0x120f6e(0x177)]=a3_0x120f6e(0x16d);async[a3_0x120f6e(0x164)](_0x4a8c91){const _0x3f9b0c=a3_0x120f6e,{options:_0x24c479,args:_0xfd279c,tdx:_0x3c287d}=_0x4a8c91;if(_0xfd279c[_0x3f9b0c(0x171)]===0x0)return console[_0x3f9b0c(0x179)]('Error:\x20Segment\x20name\x20is\x20required'),console[_0x3f9b0c(0x179)](_0x3f9b0c(0x16b)),0x1;try{const {parentId:_0x457b4a,childId:_0x1462df}=parseSegmentRef(_0xfd279c[0x0]);if(!_0x1462df)return console[_0x3f9b0c(0x179)]('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x3f9b0c(0x179)](_0x3f9b0c(0x16b)),0x1;_0x24c479['verbose']&&(console[_0x3f9b0c(0x179)](_0x3f9b0c(0x180)+_0x24c479[_0x3f9b0c(0x170)]),console[_0x3f9b0c(0x179)](_0x3f9b0c(0x163)+_0x457b4a),console['error'](_0x3f9b0c(0x160)+_0x1462df));const _0x4fc4c2=await withSpinner(_0x3f9b0c(0x17d)+_0x457b4a+_0x3f9b0c(0x172),()=>_0x3c287d[_0x3f9b0c(0x16c)]['resolveParentId'](_0x457b4a),{'verbose':_0x24c479['verbose']}),_0x4dbf2f=_0x4fc4c2[_0x3f9b0c(0x16a)];_0x24c479['verbose']&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x4dbf2f);const _0x15440d=await withSpinner(_0x3f9b0c(0x167)+_0x1462df+_0x3f9b0c(0x172),()=>_0x3c287d['segment'][_0x3f9b0c(0x173)](_0x4dbf2f,_0x1462df),{'verbose':_0x24c479[_0x3f9b0c(0x168)]}),_0x18ca03=_0x15440d['data'];_0x24c479[_0x3f9b0c(0x168)]&&console[_0x3f9b0c(0x179)](_0x3f9b0c(0x184)+_0x18ca03);const _0x1846de=await withSpinner(_0x3f9b0c(0x17e)+_0x1462df+_0x3f9b0c(0x172),()=>_0x3c287d['segment'][_0x3f9b0c(0x15f)](_0x4dbf2f,_0x18ca03),{'verbose':_0x24c479[_0x3f9b0c(0x168)]}),_0x57f2d9=_0x1846de[_0x3f9b0c(0x16a)];return console[_0x3f9b0c(0x179)](_0x3f9b0c(0x183)+_0x57f2d9[_0x3f9b0c(0x171)]+'\x20activation'+(_0x57f2d9[_0x3f9b0c(0x171)]!==0x1?'s':'')),await handleSDKOutput(_0x57f2d9,_0x24c479),0x0;}catch(_0x51b1e2){if(_0x51b1e2 instanceof SDKError)return console[_0x3f9b0c(0x179)](_0x3f9b0c(0x17a)+_0x51b1e2[_0x3f9b0c(0x181)]),_0x51b1e2[_0x3f9b0c(0x175)]&&console[_0x3f9b0c(0x179)]('\x20\x20Cause:\x20'+_0x51b1e2['cause']),0x1;throw _0x51b1e2;}}}function a3_0x337e(){const _0x145fbc=['resolveSegmentId','10dlNuSU','cause','23KhcQIC','description','356fPRNOt','error','Error:\x20','757668YfDyco','17475eynLUb','Resolving\x20parent\x20segment\x20\x27','Listing\x20activations\x20for\x20segment\x20\x27','6014232bYxFFR','Site:\x20','message','121ZavfBh','✔\x20Found\x20','Resolved\x20child\x20ID:\x20','listActivations','Child\x20name:\x20','5543808QMwVXA','activations','Parent\x20name:\x20','execute','1638CFOrfJ','17250SYZYVK','Resolving\x20child\x20segment\x20\x27','verbose','name','data','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','segment','List\x20activations\x20for\x20a\x20segment','13279cvLwYH','931908vVAHJs','site','length','\x27...'];a3_0x337e=function(){return _0x145fbc;};return a3_0x337e();}
1
+ const a3_0x409031=a3_0xf6c1;(function(_0x1c8f8c,_0x320cf6){const _0x31eacd=a3_0xf6c1,_0x5b7e51=_0x1c8f8c();while(!![]){try{const _0x160657=parseInt(_0x31eacd(0xc1))/0x1*(-parseInt(_0x31eacd(0xc4))/0x2)+parseInt(_0x31eacd(0xc2))/0x3+-parseInt(_0x31eacd(0xb9))/0x4*(-parseInt(_0x31eacd(0xb0))/0x5)+parseInt(_0x31eacd(0xac))/0x6*(-parseInt(_0x31eacd(0xc7))/0x7)+-parseInt(_0x31eacd(0xa9))/0x8+parseInt(_0x31eacd(0xbd))/0x9*(parseInt(_0x31eacd(0xa7))/0xa)+parseInt(_0x31eacd(0xc6))/0xb*(-parseInt(_0x31eacd(0xba))/0xc);if(_0x160657===_0x320cf6)break;else _0x5b7e51['push'](_0x5b7e51['shift']());}catch(_0x2d6bb2){_0x5b7e51['push'](_0x5b7e51['shift']());}}}(a3_0x3515,0xc0596));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a3_0xf6c1(_0x4a463d,_0x513d22){_0x4a463d=_0x4a463d-0xa5;const _0x3515ec=a3_0x3515();let _0xf6c189=_0x3515ec[_0x4a463d];return _0xf6c189;}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_0x409031(0xb7)]=a3_0x409031(0xbc);[a3_0x409031(0xca)]='List\x20activations\x20for\x20a\x20segment';async[a3_0x409031(0xbf)](_0x134f22){const _0x3fb2bd=a3_0x409031,{options:_0x40a564,args:_0x5a63b8,tdx:_0x186b29}=_0x134f22;if(_0x5a63b8[_0x3fb2bd(0xae)]===0x0)return console['error'](_0x3fb2bd(0xbe)),console['error']('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x26c96b,childId:_0x32510e}=parseSegmentRef(_0x5a63b8[0x0]);if(!_0x32510e)return console[_0x3fb2bd(0xaf)](_0x3fb2bd(0xb1)),console['error'](_0x3fb2bd(0xc9)),0x1;_0x40a564[_0x3fb2bd(0xab)]&&(console[_0x3fb2bd(0xaf)](_0x3fb2bd(0xc5)+_0x40a564[_0x3fb2bd(0xaa)]),console[_0x3fb2bd(0xaf)]('Parent\x20name:\x20'+_0x26c96b),console[_0x3fb2bd(0xaf)](_0x3fb2bd(0xb6)+_0x32510e));const _0x4b6946=await withSpinner(_0x3fb2bd(0xb4)+_0x26c96b+_0x3fb2bd(0xb8),()=>_0x186b29[_0x3fb2bd(0xbb)][_0x3fb2bd(0xc3)](_0x26c96b),{'verbose':_0x40a564['verbose']}),_0x5509e4=_0x4b6946[_0x3fb2bd(0xc0)];_0x40a564[_0x3fb2bd(0xab)]&&console[_0x3fb2bd(0xaf)](_0x3fb2bd(0xa5)+_0x5509e4);const _0x22232c=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x32510e+'\x27...',()=>_0x186b29['segment']['resolveSegmentId'](_0x5509e4,_0x32510e),{'verbose':_0x40a564['verbose']}),_0x5ab60f=_0x22232c[_0x3fb2bd(0xc0)];_0x40a564[_0x3fb2bd(0xab)]&&console[_0x3fb2bd(0xaf)](_0x3fb2bd(0xa6)+_0x5ab60f);const _0x7735a2=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x32510e+_0x3fb2bd(0xb8),()=>_0x186b29[_0x3fb2bd(0xbb)][_0x3fb2bd(0xb3)](_0x5509e4,_0x5ab60f),{'verbose':_0x40a564['verbose']}),_0x4848fe=_0x7735a2[_0x3fb2bd(0xc0)];return console[_0x3fb2bd(0xaf)](_0x3fb2bd(0xb5)+_0x4848fe[_0x3fb2bd(0xae)]+_0x3fb2bd(0xa8)+(_0x4848fe[_0x3fb2bd(0xae)]!==0x1?'s':'')),await handleSDKOutput(_0x4848fe,_0x40a564),0x0;}catch(_0x50b982){if(_0x50b982 instanceof SDKError)return console['error'](_0x3fb2bd(0xad)+_0x50b982['message']),_0x50b982[_0x3fb2bd(0xc8)]&&console[_0x3fb2bd(0xaf)](_0x3fb2bd(0xb2)+_0x50b982['cause']),0x1;throw _0x50b982;}}}function a3_0x3515(){const _0x3120ea=['92ZMumWR','Site:\x20','116633uygMJE','7DKPXIW','cause','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','description','Resolved\x20parent\x20ID:\x20','Resolved\x20child\x20ID:\x20','90tzWcZf','\x20activation','1207280NDnjDp','site','verbose','6111594zfzwzV','Error:\x20','length','error','5586165HLlUuz','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','\x20\x20Cause:\x20','listActivations','Resolving\x20parent\x20segment\x20\x27','✔\x20Found\x20','Child\x20name:\x20','name','\x27...','4EsLquW','924zmZFQt','segment','activations','872631QPNkZN','Error:\x20Segment\x20name\x20is\x20required','execute','data','15998OcqmAu','4559538xCJATR','resolveParentId'];a3_0x3515=function(){return _0x3120ea;};return a3_0x3515();}
@@ -1 +1 @@
1
- const a4_0x395696=a4_0x5309;(function(_0x4f3a9d,_0x4604b0){const _0x48fb99=a4_0x5309,_0x50fc37=_0x4f3a9d();while(!![]){try{const _0x53bdea=-parseInt(_0x48fb99(0x135))/0x1+parseInt(_0x48fb99(0x10a))/0x2*(parseInt(_0x48fb99(0x157))/0x3)+-parseInt(_0x48fb99(0xf6))/0x4+parseInt(_0x48fb99(0x105))/0x5+-parseInt(_0x48fb99(0x160))/0x6*(parseInt(_0x48fb99(0x16e))/0x7)+-parseInt(_0x48fb99(0x15d))/0x8*(parseInt(_0x48fb99(0x13c))/0x9)+parseInt(_0x48fb99(0xd0))/0xa;if(_0x53bdea===_0x4604b0)break;else _0x50fc37['push'](_0x50fc37['shift']());}catch(_0x15777e){_0x50fc37['push'](_0x50fc37['shift']());}}}(a4_0x3699,0xa8c62));import a4_0x3cffb6 from'chalk';import a4_0x2aed81 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(_0x281328){const _0x3966c8=a4_0x5309,_0x1318d8=[];if(_0x281328[_0x3966c8(0xd6)]!==undefined)_0x1318d8[_0x3966c8(0xd9)](_0x281328[_0x3966c8(0xd6)]+_0x3966c8(0xbd));if(_0x281328['new']!==undefined&&_0x281328['new']>0x0)_0x1318d8[_0x3966c8(0xd9)](a4_0x3cffb6[_0x3966c8(0x116)](_0x281328['new']+_0x3966c8(0x137)));if(_0x281328['created']!==undefined&&_0x281328[_0x3966c8(0xe0)]>0x0)_0x1318d8[_0x3966c8(0xd9)](a4_0x3cffb6[_0x3966c8(0x116)](_0x281328['created']+_0x3966c8(0x143)));if(_0x281328[_0x3966c8(0xd5)]!==undefined&&_0x281328[_0x3966c8(0xd5)]>0x0)_0x1318d8[_0x3966c8(0xd9)](a4_0x3cffb6['yellow'](_0x281328[_0x3966c8(0xd5)]+'\x20updated'));if(_0x281328[_0x3966c8(0x114)]!==undefined&&_0x281328['unchanged']>0x0)_0x1318d8[_0x3966c8(0xd9)](a4_0x3cffb6[_0x3966c8(0x164)](_0x281328[_0x3966c8(0x114)]+_0x3966c8(0x13a)));if(_0x281328[_0x3966c8(0x133)]!==undefined&&_0x281328[_0x3966c8(0x133)]>0x0)_0x1318d8[_0x3966c8(0xd9)](a4_0x3cffb6[_0x3966c8(0x10c)](_0x281328['errors']+_0x3966c8(0x109)));return _0x1318d8[_0x3966c8(0xe2)](',\x20');}function a4_0x5309(_0x57002e,_0x5db8ce){_0x57002e=_0x57002e-0xbb;const _0x36999f=a4_0x3699();let _0x530931=_0x36999f[_0x57002e];return _0x530931;}function displayDiffs(_0x3d6c05,_0x31d944,_0x2dfbae,_0x30ef4f,_0x43f26d,_0x520456,_0x3f0a49){const _0x264574=a4_0x5309;for(const _0x4d7984 of _0x3d6c05){if(_0x4d7984[_0x264574(0x16b)]){const _0x5b874f=_0x4d7984[_0x264574(0xe9)]||_0x4d7984[_0x264574(0xbb)];console[_0x264574(0x159)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x5b874f+'\x27:'),console['log']('─'[_0x264574(0xe5)](0x3c)),console[_0x264574(0x159)](_0x4d7984[_0x264574(0x16b)]),console[_0x264574(0x159)]('─'['repeat'](0x3c));}}for(const _0x3469ab of _0x31d944){_0x3469ab[_0x264574(0x16b)]&&(console[_0x264574(0x159)](_0x264574(0x167)+_0x3469ab[_0x264574(0xbb)]+'\x27:'),console[_0x264574(0x159)]('─'['repeat'](0x3c)),console['log'](_0x3469ab['diff']),console[_0x264574(0x159)]('─'[_0x264574(0xe5)](0x3c)));}for(const _0x44446b of _0x2dfbae){_0x44446b[_0x264574(0x16b)]&&(console['log'](_0x264574(0xc0)+_0x44446b[_0x264574(0xbb)]+'\x27:'),console[_0x264574(0x159)]('─'[_0x264574(0xe5)](0x3c)),console[_0x264574(0x159)](_0x44446b[_0x264574(0x16b)]),console[_0x264574(0x159)]('─'[_0x264574(0xe5)](0x3c)));}for(const _0x356a06 of _0x30ef4f){_0x356a06['diff']&&(console[_0x264574(0x159)](_0x264574(0x10f)+_0x356a06[_0x264574(0xbb)]+'\x27:'),console['log']('─'[_0x264574(0xe5)](0x3c)),console['log'](_0x356a06['diff']),console[_0x264574(0x159)]('─'[_0x264574(0xe5)](0x3c)));}for(const _0x114130 of _0x43f26d){_0x114130[_0x264574(0x16b)]&&(console[_0x264574(0x159)](_0x264574(0xc9)+_0x114130['name']+'\x27:'),console[_0x264574(0x159)]('─'['repeat'](0x3c)),console[_0x264574(0x159)](_0x114130[_0x264574(0x16b)]),console['log']('─'['repeat'](0x3c)));}for(const _0x23696a of _0x520456){_0x23696a[_0x264574(0x16b)]&&(console[_0x264574(0x159)](_0x264574(0xeb)+_0x23696a[_0x264574(0xbb)]+'\x27:'),console['log']('─'[_0x264574(0xe5)](0x3c)),console[_0x264574(0x159)](_0x23696a[_0x264574(0x16b)]),console['log']('─'[_0x264574(0xe5)](0x3c)));}for(const _0x1c6bde of _0x3f0a49){_0x1c6bde[_0x264574(0x16b)]&&(console[_0x264574(0x159)](_0x264574(0x119)+_0x1c6bde[_0x264574(0xbb)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x264574(0x159)](_0x1c6bde[_0x264574(0x16b)]),console[_0x264574(0x159)]('─'[_0x264574(0xe5)](0x3c)));}}function a4_0x3699(){const _0x1493f6=['6716470POkifg','textKnowledgeBases','agentId','Output\x20path:\x20','\x20errors','2QGSgHj','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','red','prompts','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x0aChanges\x20to\x20prompt\x20\x27','New\x20project:\x20','\x20\x20Source:\x20','Agent\x20pulled\x20successfully','Would\x20pull\x20agent:\x20','unchanged','outputPath','green','Status:\x20','Pushing\x20to\x20project...','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','dim','llm','knowledgeBases','execute','\x0a✔\x20Pulled\x20','projectId','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','llmProject','cwd','cloneProject','Errors:','experimentalKnowledgeBases','\x20\x20Experimental\x20Artifact\x20\x22','llm_project','newProjectId','\x22:\x20','error','\x20=\x20','\x22\x20from\x20project\x20\x22','-\x20no\x20files\x20written','reason','\x20\x20Text\x20Knowledge\x20Bases:\x20','Project:\x20','\x22...','\x20\x20Integration\x20\x22','errors','\x0aChanges:','1099324JOHtjV','sourceProjectName','\x20new','hasChanges','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20unchanged','new','9vWRZtW','site','\x0aProject\x20pushed\x20with\x20errors','Agent\x20','Cloning\x20\x22','Cannot\x20clone\x20from\x20context\x20project\x20\x22','No\x20tdx.json\x20found\x20in\x20','\x20created','\x0aPush\x20summary\x20for\x20\x27','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','projectName','\x0aError:','\x20resources?','INVALID_ARGUMENT','Output:\x20','Cancelled','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20\x20Target:\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','yellow','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Using\x20project\x20from\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\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','no_context','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','3562044actRNm','pushAgent','log','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','\x20\x20Prompts:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','2896688ansxIA','\x20changed','newProjectName','289830trIzoF','\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','Project\x20cloned\x20successfully','dirname','gray','\x22\x20to\x20new\x20project\x20\x22','Dry\x20run\x20-\x20no\x20changes\x20made','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\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','Using\x20local\x20project:\x20','\x20files\x20to\x20','diff','experimentalArtifacts','action','35tduTZS','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','agents','\x0aPush\x20','name','parse','\x20total','output','\x20resources\x20to\x20\x27','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','pullProject','New\x20project\x20name\x20is\x20required','\x20\x20Experimental\x20Artifacts:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aPull\x20summary\x20for\x20\x27','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','description','\x20|\x20','\x0aChanges\x20to\x20integration\x20\x27','dryRun','context','yes','utf-8','MISSING_ARGUMENT','agent:push','9335770AWeFhl','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','outputDir','\x20\x20Agent\x20\x22','source','updated','total','force','tdx.json','push','counts','agent.yml','Pushing\x20agent\x20from\x20\x22','\x20\x20Integrations:\x20','found','Failed\x20to\x20push\x20agent:\x20','created','Would\x20push\x20agent:\x20','join','Analyzing\x20changes\x20to\x20push...','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','repeat','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20\x20Knowledge\x20Bases:\x20','\x20\x20Agents:\x20','agentName','\x20--profile\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x22\x20to\x20a\x20different\x20profile','Agent:\x20','✔\x20Context\x20set:\x20','integrations','arg-dir','pushProject','agent:pull','\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--name\x20','cyan','4279944NFYuWa','no_local_folder','-\x20nothing\x20pushed','Using\x20context\x20project:\x20','session','Writing\x20files...','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)','Summary:','agent:clone','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x0aErrors\x20found:','message','Chat:\x20','Source:\x20'];a4_0x3699=function(){return _0x1493f6;};return a4_0x3699();}export class AgentPullCommand extends BaseCommand{['name']=a4_0x395696(0xf2);[a4_0x395696(0xc7)]=a4_0x395696(0x15c);async['execute'](_0x58dc0a){const _0x1916b6=a4_0x395696,{options:_0x3f8723,args:_0x5ef2a5,tdx:_0xe7de5d}=_0x58dc0a,_0x3d5a1f=_0x5ef2a5[0x0],_0x1bcb13=_0x5ef2a5[0x1],_0x1cd823=_0x3f8723[_0x1916b6(0xbe)],_0x460257=_0x3f8723['dryRun'],_0x5c58f9=_0x3f8723[_0x1916b6(0xd7)],_0x84ac2b=_0x3f8723[_0x1916b6(0xcc)],_0x4ffb5a=_0x3f8723[_0x1916b6(0x121)],_0x31d164=_0x3f8723['agent'];let _0x5ac213;if(_0x3d5a1f){const _0x29b297=a4_0x2aed81['join'](_0x3d5a1f,_0x1916b6(0xd8));if(existsSync(_0x29b297))try{const _0x5ab928=JSON['parse'](readFileSync(_0x29b297,_0x1916b6(0xcd)));_0x5ab928['llm_project']&&(_0x5ac213={'llm_project':_0x5ab928['llm_project']});}catch{}}const _0x2e5e80=findAgentConfigPath(process['cwd']());let _0x2a9b0f;if(_0x2e5e80)try{const _0x59437d=JSON[_0x1916b6(0xbc)](readFileSync(_0x2e5e80,_0x1916b6(0xcd)));_0x59437d['llm_project']&&(_0x2a9b0f={'llm_project':_0x59437d['llm_project']});}catch{}const _0x18f2fa=resolveAgentPullArgs({'arg':_0x3d5a1f,'agentNameArg':_0x1bcb13,'agentFlag':_0x31d164,'contextProject':_0x4ffb5a,'argDirConfig':_0x5ac213,'cwdConfigPath':_0x2e5e80||undefined,'cwdConfig':_0x2a9b0f}),{projectNameOrId:_0x36707f,targetAgentName:_0x159d9a,existingOutputDir:_0x486821,source:_0x11b7b9}=_0x18f2fa;if(_0x11b7b9===_0x1916b6(0xf0))console['log'](a4_0x3cffb6[_0x1916b6(0x11a)](_0x1916b6(0x151)+a4_0x2aed81[_0x1916b6(0xe2)](_0x3d5a1f,_0x1916b6(0xd8))+':\x20'+_0x36707f));else{if(_0x11b7b9==='cwd-config')console[_0x1916b6(0x159)](a4_0x3cffb6[_0x1916b6(0x11a)]('Using\x20project:\x20'+_0x36707f));else _0x11b7b9===_0x1916b6(0xcb)&&console[_0x1916b6(0x159)](a4_0x3cffb6['dim']('Using\x20project\x20from\x20context:\x20'+_0x36707f));}if(!_0x36707f)return _0x31d164?(console[_0x1916b6(0x159)](a4_0x3cffb6['yellow']('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x1916b6(0x159)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0x1916b6(0x159)](_0x1916b6(0x145))):(console['log'](a4_0x3cffb6[_0x1916b6(0x14f)](_0x1916b6(0x156))),console[_0x1916b6(0x159)](_0x1916b6(0xfc)),console[_0x1916b6(0x159)](_0x1916b6(0x161)),console[_0x1916b6(0x159)](_0x1916b6(0x153)),console['log'](_0x1916b6(0x168)),console[_0x1916b6(0x159)](_0x1916b6(0x15a))),0x1;if(_0x159d9a){const {data:_0x5d5987}=await withSpinner('Pulling\x20agent\x20\x22'+_0x159d9a+_0x1916b6(0x12c)+_0x36707f+_0x1916b6(0x131),()=>_0xe7de5d['llm']['pullAgent'](_0x36707f,_0x159d9a,_0x1cd823,{'dryRun':_0x460257,'force':_0x5c58f9}));if(_0x460257)return console[_0x1916b6(0x159)](a4_0x3cffb6[_0x1916b6(0x14f)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x1916b6(0x159)](_0x1916b6(0x113)+_0x5d5987[_0x1916b6(0xe9)]),console[_0x1916b6(0x159)](_0x1916b6(0x108)+_0x5d5987[_0x1916b6(0x115)]),_0x5d5987[_0x1916b6(0x16b)]&&(console[_0x1916b6(0x159)](_0x1916b6(0x134)),console[_0x1916b6(0x159)]('─'['repeat'](0x3c)),console[_0x1916b6(0x159)](_0x5d5987[_0x1916b6(0x16b)]),console[_0x1916b6(0x159)]('─'[_0x1916b6(0xe5)](0x3c))),0x0;return console[_0x1916b6(0x159)](a4_0x3cffb6['green'](_0x1916b6(0x112))),console[_0x1916b6(0x159)](_0x1916b6(0xed)+_0x5d5987[_0x1916b6(0xe9)]),console['log'](_0x1916b6(0x14a)+_0x5d5987['outputPath']),console['log'](_0x1916b6(0x117)+(_0x5d5987['isNew']?a4_0x3cffb6[_0x1916b6(0x116)](_0x1916b6(0x13b)):_0x5d5987[_0x1916b6(0x138)]?a4_0x3cffb6[_0x1916b6(0x14f)](_0x1916b6(0xd5)):a4_0x3cffb6['gray']('unchanged'))),0x0;}const _0x184c9c=_0x486821||_0x1cd823,{data:_0x4e9c3b}=await withSpinner('Analyzing\x20project\x20\x22'+_0x36707f+_0x1916b6(0x131),()=>_0xe7de5d[_0x1916b6(0x11b)]['pullProject'](_0x36707f,_0x184c9c,{'dryRun':!![]})),_0x23ea08=_0x4e9c3b['counts'][_0x1916b6(0x171)][_0x1916b6(0x13b)]+_0x4e9c3b[_0x1916b6(0xda)][_0x1916b6(0x11c)]['new']+_0x4e9c3b['counts'][_0x1916b6(0x106)][_0x1916b6(0x13b)]+_0x4e9c3b['counts'][_0x1916b6(0x10d)][_0x1916b6(0x13b)]+_0x4e9c3b[_0x1916b6(0xda)][_0x1916b6(0xef)][_0x1916b6(0x13b)]+_0x4e9c3b[_0x1916b6(0xda)][_0x1916b6(0x125)][_0x1916b6(0x13b)]+_0x4e9c3b[_0x1916b6(0xda)][_0x1916b6(0x16c)][_0x1916b6(0x13b)],_0x5de673=_0x4e9c3b[_0x1916b6(0xda)][_0x1916b6(0x171)]['updated']+_0x4e9c3b[_0x1916b6(0xda)][_0x1916b6(0x11c)][_0x1916b6(0xd5)]+_0x4e9c3b['counts'][_0x1916b6(0x106)][_0x1916b6(0xd5)]+_0x4e9c3b['counts']['prompts'][_0x1916b6(0xd5)]+_0x4e9c3b[_0x1916b6(0xda)][_0x1916b6(0xef)]['updated']+_0x4e9c3b[_0x1916b6(0xda)][_0x1916b6(0x125)][_0x1916b6(0xd5)]+_0x4e9c3b[_0x1916b6(0xda)]['experimentalArtifacts'][_0x1916b6(0xd5)],_0x4ed758=_0x4e9c3b[_0x1916b6(0xda)][_0x1916b6(0x171)][_0x1916b6(0x114)]+_0x4e9c3b['counts'][_0x1916b6(0x11c)][_0x1916b6(0x114)]+_0x4e9c3b[_0x1916b6(0xda)][_0x1916b6(0x106)]['unchanged']+_0x4e9c3b[_0x1916b6(0xda)][_0x1916b6(0x10d)][_0x1916b6(0x114)]+_0x4e9c3b[_0x1916b6(0xda)][_0x1916b6(0xef)][_0x1916b6(0x114)]+_0x4e9c3b[_0x1916b6(0xda)][_0x1916b6(0x125)]['unchanged']+_0x4e9c3b['counts'][_0x1916b6(0x16c)][_0x1916b6(0x114)];console[_0x1916b6(0x159)](_0x1916b6(0xc5)+_0x4e9c3b['projectName']+'\x27:'),console[_0x1916b6(0x159)]('\x20\x20'+a4_0x3cffb6[_0x1916b6(0x116)]('+\x20'+_0x23ea08+_0x1916b6(0x137))+_0x1916b6(0xc8)+a4_0x3cffb6[_0x1916b6(0x14f)]('~\x20'+_0x5de673+_0x1916b6(0x15e))+_0x1916b6(0xc8)+a4_0x3cffb6[_0x1916b6(0x11a)]('=\x20'+_0x4ed758+_0x1916b6(0x13a))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x4e9c3b[_0x1916b6(0xda)][_0x1916b6(0x171)])),console['log'](_0x1916b6(0xe7)+formatCountSummary(_0x4e9c3b[_0x1916b6(0xda)][_0x1916b6(0x11c)])),console[_0x1916b6(0x159)](_0x1916b6(0x12f)+formatCountSummary(_0x4e9c3b[_0x1916b6(0xda)][_0x1916b6(0x106)])),console[_0x1916b6(0x159)](_0x1916b6(0x15b)+formatCountSummary(_0x4e9c3b[_0x1916b6(0xda)][_0x1916b6(0x10d)])),console[_0x1916b6(0x159)](_0x1916b6(0xdd)+formatCountSummary(_0x4e9c3b[_0x1916b6(0xda)]['integrations']));const _0x2090fe=_0x4e9c3b[_0x1916b6(0xda)][_0x1916b6(0x125)][_0x1916b6(0xd6)]>0x0||_0x4e9c3b[_0x1916b6(0xda)][_0x1916b6(0x16c)][_0x1916b6(0xd6)]>0x0;_0x2090fe&&(console[_0x1916b6(0x159)](_0x1916b6(0xe6)+formatCountSummary(_0x4e9c3b[_0x1916b6(0xda)][_0x1916b6(0x125)])),console['log'](_0x1916b6(0xc3)+formatCountSummary(_0x4e9c3b[_0x1916b6(0xda)][_0x1916b6(0x16c)])));console['log'](_0x1916b6(0x14d)+a4_0x3cffb6[_0x1916b6(0xf5)](_0x4e9c3b[_0x1916b6(0xd2)])),displayDiffs(_0x4e9c3b[_0x1916b6(0x171)],_0x4e9c3b[_0x1916b6(0x11c)],_0x4e9c3b[_0x1916b6(0x106)],_0x4e9c3b['prompts'],_0x4e9c3b['integrations'],_0x4e9c3b['experimentalKnowledgeBases'],_0x4e9c3b[_0x1916b6(0x16c)]);if(_0x460257)return console[_0x1916b6(0x159)](a4_0x3cffb6['yellow'](_0x1916b6(0x150))),0x0;if(_0x23ea08===0x0&&_0x5de673===0x0)return console[_0x1916b6(0x159)](a4_0x3cffb6['green'](_0x1916b6(0xc4))),saveSessionContext({'llm_project':_0x4e9c3b[_0x1916b6(0x146)]},_0x3f8723[_0x1916b6(0xfa)]),console[_0x1916b6(0x159)](a4_0x3cffb6[_0x1916b6(0x116)](_0x1916b6(0xee)+a4_0x3cffb6[_0x1916b6(0x11a)](_0x1916b6(0x127))+_0x1916b6(0x12b)+a4_0x3cffb6[_0x1916b6(0xf5)](_0x4e9c3b['projectName']))),0x0;if(!_0x84ac2b&&!_0x5c58f9){if(!isInteractive())return console[_0x1916b6(0x12a)](a4_0x3cffb6['red'](_0x1916b6(0x147)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1916b6(0x12a)](a4_0x3cffb6[_0x1916b6(0x11a)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x6427e4=await confirmKey('\x0aWrite\x20'+(_0x23ea08+_0x5de673)+'\x20files?');if(!_0x6427e4)return console[_0x1916b6(0x159)](a4_0x3cffb6[_0x1916b6(0x14f)]('Cancelled'),_0x1916b6(0x12d)),0x1;}const {data:_0x130e19}=await withSpinner(_0x1916b6(0xfb),()=>_0xe7de5d[_0x1916b6(0x11b)][_0x1916b6(0xc1)](_0x36707f,_0x184c9c,{'force':_0x5c58f9}));return console[_0x1916b6(0x159)](a4_0x3cffb6[_0x1916b6(0x116)](_0x1916b6(0x11e)+(_0x23ea08+_0x5de673)+_0x1916b6(0x16a)+_0x130e19['outputDir'])),saveSessionContext({'llm_project':_0x130e19[_0x1916b6(0x146)]},_0x3f8723[_0x1916b6(0xfa)]),console[_0x1916b6(0x159)](a4_0x3cffb6[_0x1916b6(0x116)]('✔\x20Context\x20set:\x20'+a4_0x3cffb6[_0x1916b6(0x11a)]('llm_project')+_0x1916b6(0x12b)+a4_0x3cffb6[_0x1916b6(0xf5)](_0x130e19[_0x1916b6(0x146)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x395696(0xfe);[a4_0x395696(0xc7)]=a4_0x395696(0x170);async[a4_0x395696(0x11d)](_0x372461){const _0x8f267e=a4_0x395696,{options:_0x1b8abb,args:_0x5c8a56,tdx:_0x16d4fc}=_0x372461,_0x4c2c37=_0x5c8a56[0x0],_0x47c91f=_0x1b8abb[_0x8f267e(0xbb)],_0x3aa49f=_0x1b8abb[_0x8f267e(0xca)],_0x563bb9=_0x1b8abb[_0x8f267e(0xcc)],_0x14de93=_0x1b8abb[_0x8f267e(0x13d)],_0x5378c3=_0x1b8abb['llmProject'];let _0x11d2e5;const _0x328813=findAgentConfigPath(process[_0x8f267e(0x122)]());if(_0x4c2c37){const _0x2ffc5f=a4_0x2aed81[_0x8f267e(0xe2)](_0x4c2c37,_0x8f267e(0xd8));existsSync(_0x2ffc5f)?(_0x11d2e5=_0x4c2c37,console[_0x8f267e(0x159)](a4_0x3cffb6[_0x8f267e(0x11a)]('Using\x20local\x20project:\x20'+_0x4c2c37))):_0x11d2e5=_0x4c2c37;}else{if(_0x328813)_0x11d2e5=a4_0x2aed81[_0x8f267e(0x163)](_0x328813),console[_0x8f267e(0x159)](a4_0x3cffb6['dim']('Using\x20current\x20project:\x20'+_0x11d2e5));else{if(_0x5378c3){const _0x564b81=sanitizeForFilesystem(_0x5378c3);let _0x4443e0=_0x564b81,_0x5af539=a4_0x2aed81[_0x8f267e(0xe2)](process[_0x8f267e(0x122)](),_0x8f267e(0x171),_0x564b81,'tdx.json');if(!existsSync(_0x5af539)){const _0x57e331=normalizeName(_0x5378c3),_0x16be25=a4_0x2aed81[_0x8f267e(0xe2)](process[_0x8f267e(0x122)](),_0x8f267e(0x171),_0x57e331,'tdx.json');existsSync(_0x16be25)&&(_0x4443e0=_0x57e331,_0x5af539=_0x16be25);}if(existsSync(_0x5af539))_0x11d2e5=a4_0x2aed81[_0x8f267e(0x163)](_0x5af539),console[_0x8f267e(0x159)](a4_0x3cffb6['dim'](_0x8f267e(0x169)+_0x11d2e5));else{const _0x5c0c9a=_0x1b8abb['profile'];if(_0x5c0c9a)throw new SDKError(ErrorCode[_0x8f267e(0x149)],_0x8f267e(0x141)+_0x5378c3+_0x8f267e(0xec),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x8f267e(0x10b)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x5378c3+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x4443e0+_0x8f267e(0xf4)+(_0x47c91f||'<new-name>')+_0x8f267e(0xea)+_0x5c0c9a)});_0x11d2e5=_0x5378c3,console['log'](a4_0x3cffb6[_0x8f267e(0x11a)](_0x8f267e(0xf9)+_0x5378c3));}}}}if(!_0x11d2e5)return console['log'](a4_0x3cffb6[_0x8f267e(0x14f)](_0x8f267e(0x120))),console['log'](_0x8f267e(0x152)),console[_0x8f267e(0x159)](_0x8f267e(0xd1)),console[_0x8f267e(0x159)](_0x8f267e(0xf3)),console[_0x8f267e(0x159)](_0x8f267e(0x139)),0x1;if(!_0x47c91f)throw new SDKError(ErrorCode[_0x8f267e(0xce)],_0x8f267e(0xc2),undefined,{'helpText':_0x8f267e(0x14c)});if(!_0x563bb9&&!_0x3aa49f){if(!isInteractive())return console[_0x8f267e(0x12a)](a4_0x3cffb6[_0x8f267e(0x10c)]('\x0aError:'),_0x8f267e(0xc6)),console[_0x8f267e(0x12a)](a4_0x3cffb6[_0x8f267e(0x11a)](_0x8f267e(0x155))),0x1;const _0x5945e4=await confirmKey('Clone\x20\x22'+_0x11d2e5+_0x8f267e(0x165)+_0x47c91f+'\x22?');if(!_0x5945e4)return console[_0x8f267e(0x159)](a4_0x3cffb6[_0x8f267e(0x14f)](_0x8f267e(0x14b))),0x1;}const {data:_0x49b977}=await withSpinner(_0x8f267e(0x140)+_0x11d2e5+'\x22\x20to\x20\x22'+_0x47c91f+_0x8f267e(0x131),()=>_0x16d4fc['llm'][_0x8f267e(0x123)](_0x11d2e5,_0x47c91f,{'dryRun':_0x3aa49f}));if(_0x3aa49f){console[_0x8f267e(0x159)](a4_0x3cffb6[_0x8f267e(0x14f)](_0x8f267e(0x166))),console[_0x8f267e(0x159)](_0x8f267e(0x104)+_0x49b977[_0x8f267e(0x136)]),console[_0x8f267e(0x159)](_0x8f267e(0x110)+_0x47c91f),console[_0x8f267e(0x159)]('Would\x20clone:'),console[_0x8f267e(0x159)](_0x8f267e(0xe8)+_0x49b977['counts']['agents'][_0x8f267e(0xe0)]),console[_0x8f267e(0x159)](_0x8f267e(0xe7)+_0x49b977['counts'][_0x8f267e(0x11c)][_0x8f267e(0xe0)]),console['log']('\x20\x20Prompts:\x20'+_0x49b977['counts'][_0x8f267e(0x10d)][_0x8f267e(0xe0)]);const _0x14e5e5=_0x49b977[_0x8f267e(0xda)][_0x8f267e(0x125)][_0x8f267e(0xe0)]>0x0||_0x49b977[_0x8f267e(0xda)][_0x8f267e(0x16c)]['created']>0x0;return _0x14e5e5&&(console[_0x8f267e(0x159)](_0x8f267e(0xe6)+_0x49b977[_0x8f267e(0xda)][_0x8f267e(0x125)][_0x8f267e(0xe0)]),console[_0x8f267e(0x159)](_0x8f267e(0xc3)+_0x49b977[_0x8f267e(0xda)][_0x8f267e(0x16c)][_0x8f267e(0xe0)])),0x0;}const _0x5247b8=_0x49b977[_0x8f267e(0xda)][_0x8f267e(0x171)]['errors']>0x0||_0x49b977[_0x8f267e(0xda)][_0x8f267e(0x11c)][_0x8f267e(0x133)]>0x0||_0x49b977[_0x8f267e(0xda)]['prompts'][_0x8f267e(0x133)]>0x0||_0x49b977[_0x8f267e(0xda)][_0x8f267e(0x125)][_0x8f267e(0x133)]>0x0||_0x49b977[_0x8f267e(0xda)][_0x8f267e(0x16c)]['errors']>0x0;_0x5247b8?console[_0x8f267e(0x159)](a4_0x3cffb6[_0x8f267e(0x14f)]('Project\x20cloned\x20with\x20errors')):console[_0x8f267e(0x159)](a4_0x3cffb6[_0x8f267e(0x116)](_0x8f267e(0x162)));console[_0x8f267e(0x159)]('Source:\x20'+_0x49b977[_0x8f267e(0x136)]),console[_0x8f267e(0x159)](_0x8f267e(0x110)+_0x49b977[_0x8f267e(0x15f)]),console[_0x8f267e(0x159)]('New\x20project\x20ID:\x20'+_0x49b977[_0x8f267e(0x128)]),console[_0x8f267e(0x159)](),console[_0x8f267e(0x159)](_0x8f267e(0xfd)),console['log'](_0x8f267e(0xe8)+formatCountSummary(_0x49b977['counts']['agents'])),console[_0x8f267e(0x159)](_0x8f267e(0xe7)+formatCountSummary(_0x49b977[_0x8f267e(0xda)][_0x8f267e(0x11c)])),console[_0x8f267e(0x159)](_0x8f267e(0x15b)+formatCountSummary(_0x49b977[_0x8f267e(0xda)]['prompts'])),console[_0x8f267e(0x159)](_0x8f267e(0xdd)+formatCountSummary(_0x49b977[_0x8f267e(0xda)]['integrations']));const _0x4c60b8=_0x49b977[_0x8f267e(0xda)][_0x8f267e(0x125)][_0x8f267e(0xe0)]>0x0||_0x49b977[_0x8f267e(0xda)]['experimentalKnowledgeBases']['updated']>0x0||_0x49b977[_0x8f267e(0xda)][_0x8f267e(0x125)][_0x8f267e(0x114)]>0x0||_0x49b977[_0x8f267e(0xda)][_0x8f267e(0x16c)][_0x8f267e(0xe0)]>0x0||_0x49b977['counts'][_0x8f267e(0x16c)][_0x8f267e(0xd5)]>0x0||_0x49b977[_0x8f267e(0xda)]['experimentalArtifacts']['unchanged']>0x0;_0x4c60b8&&(console['log'](_0x8f267e(0xe6)+formatCountSummary(_0x49b977[_0x8f267e(0xda)][_0x8f267e(0x125)])),console[_0x8f267e(0x159)](_0x8f267e(0xc3)+formatCountSummary(_0x49b977['counts']['experimentalArtifacts'])));if(_0x5247b8){console['log'](),console['log'](a4_0x3cffb6[_0x8f267e(0x10c)](_0x8f267e(0x124)));for(const _0x592211 of _0x49b977[_0x8f267e(0x171)]){_0x592211['action']===_0x8f267e(0x12a)&&console['log'](a4_0x3cffb6[_0x8f267e(0x10c)](_0x8f267e(0xd3)+_0x592211[_0x8f267e(0xe9)]+'\x22:\x20'+_0x592211[_0x8f267e(0x12a)]));}for(const _0x146997 of _0x49b977[_0x8f267e(0x11c)]){_0x146997[_0x8f267e(0x16d)]===_0x8f267e(0x12a)&&console[_0x8f267e(0x159)](a4_0x3cffb6[_0x8f267e(0x10c)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x146997['name']+'\x22:\x20'+_0x146997[_0x8f267e(0x12a)]));}for(const _0x2c0bb1 of _0x49b977[_0x8f267e(0x10d)]){_0x2c0bb1[_0x8f267e(0x16d)]===_0x8f267e(0x12a)&&console[_0x8f267e(0x159)](a4_0x3cffb6['red']('\x20\x20Prompt\x20\x22'+_0x2c0bb1[_0x8f267e(0xbb)]+_0x8f267e(0x129)+_0x2c0bb1['error']));}for(const _0x1010b8 of _0x49b977['integrations']){_0x1010b8[_0x8f267e(0x16d)]===_0x8f267e(0x12a)&&console[_0x8f267e(0x159)](a4_0x3cffb6['red'](_0x8f267e(0x132)+_0x1010b8[_0x8f267e(0xbb)]+_0x8f267e(0x129)+_0x1010b8[_0x8f267e(0x12a)]));}for(const _0x29b1ff of _0x49b977[_0x8f267e(0x125)]){_0x29b1ff['action']==='error'&&console['log'](a4_0x3cffb6[_0x8f267e(0x10c)](_0x8f267e(0xe4)+_0x29b1ff[_0x8f267e(0xbb)]+'\x22:\x20'+_0x29b1ff['error']));}for(const _0x495df4 of _0x49b977[_0x8f267e(0x16c)]){_0x495df4[_0x8f267e(0x16d)]===_0x8f267e(0x12a)&&console['log'](a4_0x3cffb6[_0x8f267e(0x10c)](_0x8f267e(0x126)+_0x495df4[_0x8f267e(0xbb)]+_0x8f267e(0x129)+_0x495df4[_0x8f267e(0x12a)]));}return 0x1;}console[_0x8f267e(0x159)]();const _0x4aeb0c=getLLMProjectUrl(_0x14de93,_0x49b977[_0x8f267e(0x128)]);return console[_0x8f267e(0x159)](_0x8f267e(0x130)+a4_0x3cffb6[_0x8f267e(0xf5)](_0x4aeb0c)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x395696(0xbb)]=a4_0x395696(0xcf);[a4_0x395696(0xc7)]=a4_0x395696(0x14e);async[a4_0x395696(0x11d)](_0x5dc7b3){const _0x4d8c0c=a4_0x395696,{options:_0x54c3eb,args:_0x626e3e,tdx:_0x218597}=_0x5dc7b3;let _0x273578=_0x626e3e[0x0]||process[_0x4d8c0c(0x122)]();const _0x549805=_0x54c3eb[_0x4d8c0c(0xca)],_0x22d894=_0x54c3eb['force'],_0x257563=_0x54c3eb[_0x4d8c0c(0xcc)],_0x3ab8c2=_0x54c3eb[_0x4d8c0c(0x13d)],_0x34e221=a4_0x2aed81[_0x4d8c0c(0xe2)](_0x273578,_0x4d8c0c(0xdb)),_0x2936fa=existsSync(_0x34e221);if(_0x2936fa){const {data:_0x6c1d01}=await withSpinner(_0x4d8c0c(0xdc)+_0x273578+'\x22...',()=>_0x218597['llm'][_0x4d8c0c(0x158)](_0x273578,{'dryRun':_0x549805,'force':_0x22d894}));if(_0x549805)return console[_0x4d8c0c(0x159)](a4_0x3cffb6['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x4d8c0c(0x159)](_0x4d8c0c(0xe1)+_0x6c1d01[_0x4d8c0c(0xe9)]),0x0;if(_0x6c1d01[_0x4d8c0c(0x16d)]==='error')return console[_0x4d8c0c(0x159)](a4_0x3cffb6[_0x4d8c0c(0x10c)](_0x4d8c0c(0xdf)+_0x6c1d01['error'])),0x1;console['log'](a4_0x3cffb6[_0x4d8c0c(0x116)](_0x4d8c0c(0x13f)+_0x6c1d01[_0x4d8c0c(0x16d)]+'\x20successfully')),console['log'](_0x4d8c0c(0xed)+_0x6c1d01[_0x4d8c0c(0xe9)]);if(_0x6c1d01[_0x4d8c0c(0x107)]&&_0x6c1d01[_0x4d8c0c(0x11f)]){const _0x148b72=getLLMAgentChatUrl(_0x3ab8c2,_0x6c1d01[_0x4d8c0c(0x11f)],_0x6c1d01[_0x4d8c0c(0x107)]);console[_0x4d8c0c(0x159)](_0x4d8c0c(0x103)+a4_0x3cffb6[_0x4d8c0c(0xf5)](_0x148b72));}return 0x0;}const _0x5d63c5=_0x54c3eb['llmProject'],_0x5b5549=resolveProjectFromContext(_0x273578,_0x5d63c5);if(_0x5b5549[_0x4d8c0c(0xde)])_0x273578=_0x5b5549['projectDir'],_0x5b5549[_0x4d8c0c(0xd4)]===_0x4d8c0c(0xcb)&&console['log'](a4_0x3cffb6[_0x4d8c0c(0x11a)]('Using\x20project:\x20'+_0x273578));else{let _0x19ef60=_0x4d8c0c(0x16f);_0x5b5549[_0x4d8c0c(0x12e)]===_0x4d8c0c(0xf7)&&(_0x19ef60=_0x5b5549['message']+_0x4d8c0c(0xff)+_0x5b5549[_0x4d8c0c(0x121)]+_0x4d8c0c(0x100));throw new SDKError(ErrorCode[_0x4d8c0c(0x149)],_0x5b5549[_0x4d8c0c(0x12e)]===_0x4d8c0c(0x154)?_0x5b5549[_0x4d8c0c(0x102)]:_0x4d8c0c(0x142)+_0x273578,undefined,{'helpText':_0x19ef60});}const {data:_0x4b6de6}=await withSpinner(_0x4d8c0c(0xe3),()=>_0x218597[_0x4d8c0c(0x11b)][_0x4d8c0c(0xf1)](_0x273578,{'dryRun':!![]})),_0x2cdaa3=_0x4b6de6['counts'][_0x4d8c0c(0x171)]['errors']>0x0;if(_0x2cdaa3){console[_0x4d8c0c(0x159)](a4_0x3cffb6[_0x4d8c0c(0x10c)](_0x4d8c0c(0x101)));for(const _0x32a185 of _0x4b6de6[_0x4d8c0c(0x171)]){_0x32a185[_0x4d8c0c(0x16d)]===_0x4d8c0c(0x12a)&&console[_0x4d8c0c(0x159)](a4_0x3cffb6[_0x4d8c0c(0x10c)](_0x4d8c0c(0xd3)+_0x32a185[_0x4d8c0c(0xe9)]+_0x4d8c0c(0x129)+_0x32a185[_0x4d8c0c(0x12a)]));}return 0x1;}const _0x5bc1f4=_0x4b6de6[_0x4d8c0c(0xda)]['agents'][_0x4d8c0c(0xe0)]+_0x4b6de6[_0x4d8c0c(0xda)][_0x4d8c0c(0x11c)][_0x4d8c0c(0xe0)]+_0x4b6de6['counts'][_0x4d8c0c(0x106)][_0x4d8c0c(0xe0)]+_0x4b6de6['counts']['prompts'][_0x4d8c0c(0xe0)]+_0x4b6de6[_0x4d8c0c(0xda)][_0x4d8c0c(0xef)][_0x4d8c0c(0xe0)]+_0x4b6de6[_0x4d8c0c(0xda)][_0x4d8c0c(0x125)]['created']+_0x4b6de6[_0x4d8c0c(0xda)]['experimentalArtifacts'][_0x4d8c0c(0xe0)],_0x537d2c=_0x4b6de6[_0x4d8c0c(0xda)][_0x4d8c0c(0x171)]['updated']+_0x4b6de6['counts'][_0x4d8c0c(0x11c)][_0x4d8c0c(0xd5)]+_0x4b6de6[_0x4d8c0c(0xda)][_0x4d8c0c(0x106)]['updated']+_0x4b6de6[_0x4d8c0c(0xda)][_0x4d8c0c(0x10d)][_0x4d8c0c(0xd5)]+_0x4b6de6[_0x4d8c0c(0xda)][_0x4d8c0c(0xef)][_0x4d8c0c(0xd5)]+_0x4b6de6[_0x4d8c0c(0xda)][_0x4d8c0c(0x125)][_0x4d8c0c(0xd5)]+_0x4b6de6[_0x4d8c0c(0xda)][_0x4d8c0c(0x16c)]['updated'],_0x3ac0fd=_0x4b6de6[_0x4d8c0c(0xda)][_0x4d8c0c(0x171)]['unchanged']+_0x4b6de6['counts']['knowledgeBases']['unchanged']+_0x4b6de6[_0x4d8c0c(0xda)][_0x4d8c0c(0x106)]['unchanged']+_0x4b6de6['counts'][_0x4d8c0c(0x10d)][_0x4d8c0c(0x114)]+_0x4b6de6['counts'][_0x4d8c0c(0xef)][_0x4d8c0c(0x114)]+_0x4b6de6['counts'][_0x4d8c0c(0x125)][_0x4d8c0c(0x114)]+_0x4b6de6[_0x4d8c0c(0xda)]['experimentalArtifacts'][_0x4d8c0c(0x114)];console[_0x4d8c0c(0x159)](_0x4d8c0c(0x144)+_0x4b6de6[_0x4d8c0c(0x146)]+'\x27:'),console['log']('\x20\x20'+a4_0x3cffb6[_0x4d8c0c(0x116)]('+\x20'+_0x5bc1f4+_0x4d8c0c(0x137))+_0x4d8c0c(0xc8)+a4_0x3cffb6['yellow']('~\x20'+_0x537d2c+_0x4d8c0c(0x15e))+_0x4d8c0c(0xc8)+a4_0x3cffb6['dim']('=\x20'+_0x3ac0fd+_0x4d8c0c(0x13a))),console[_0x4d8c0c(0x159)](_0x4d8c0c(0xe8)+formatCountSummary(_0x4b6de6['counts'][_0x4d8c0c(0x171)])),console[_0x4d8c0c(0x159)](_0x4d8c0c(0xe7)+formatCountSummary(_0x4b6de6[_0x4d8c0c(0xda)]['knowledgeBases'])),console[_0x4d8c0c(0x159)](_0x4d8c0c(0x12f)+formatCountSummary(_0x4b6de6['counts'][_0x4d8c0c(0x106)])),console[_0x4d8c0c(0x159)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x4b6de6[_0x4d8c0c(0xda)][_0x4d8c0c(0x10d)])),console[_0x4d8c0c(0x159)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x4b6de6[_0x4d8c0c(0xda)][_0x4d8c0c(0xef)]));const _0x4868ca=_0x4b6de6[_0x4d8c0c(0xda)][_0x4d8c0c(0x125)][_0x4d8c0c(0xe0)]>0x0||_0x4b6de6[_0x4d8c0c(0xda)][_0x4d8c0c(0x125)][_0x4d8c0c(0xd5)]>0x0||_0x4b6de6[_0x4d8c0c(0xda)][_0x4d8c0c(0x125)]['unchanged']>0x0||_0x4b6de6[_0x4d8c0c(0xda)][_0x4d8c0c(0x16c)][_0x4d8c0c(0xe0)]>0x0||_0x4b6de6[_0x4d8c0c(0xda)][_0x4d8c0c(0x16c)][_0x4d8c0c(0xd5)]>0x0||_0x4b6de6['counts'][_0x4d8c0c(0x16c)][_0x4d8c0c(0x114)]>0x0;_0x4868ca&&(console[_0x4d8c0c(0x159)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4b6de6[_0x4d8c0c(0xda)][_0x4d8c0c(0x125)])),console[_0x4d8c0c(0x159)](_0x4d8c0c(0xc3)+formatCountSummary(_0x4b6de6[_0x4d8c0c(0xda)][_0x4d8c0c(0x16c)])));console['log'](_0x4d8c0c(0x111)+a4_0x3cffb6[_0x4d8c0c(0xf5)](_0x273578)),displayDiffs(_0x4b6de6[_0x4d8c0c(0x171)],_0x4b6de6[_0x4d8c0c(0x11c)],_0x4b6de6[_0x4d8c0c(0x106)],_0x4b6de6[_0x4d8c0c(0x10d)],_0x4b6de6[_0x4d8c0c(0xef)],_0x4b6de6[_0x4d8c0c(0x125)],_0x4b6de6[_0x4d8c0c(0x16c)]);if(_0x549805)return console['log'](a4_0x3cffb6[_0x4d8c0c(0x14f)](_0x4d8c0c(0x10e))),0x0;if(_0x5bc1f4===0x0&&_0x537d2c===0x0){console[_0x4d8c0c(0x159)](a4_0x3cffb6[_0x4d8c0c(0x116)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x14b8cc=getLLMProjectUrl(_0x3ab8c2,_0x4b6de6['projectId']);return console[_0x4d8c0c(0x159)](_0x4d8c0c(0x130)+a4_0x3cffb6[_0x4d8c0c(0xf5)](_0x14b8cc)),0x0;}if(!_0x257563&&!_0x22d894){if(!isInteractive())return console[_0x4d8c0c(0x12a)](a4_0x3cffb6[_0x4d8c0c(0x10c)](_0x4d8c0c(0x147)),_0x4d8c0c(0xc6)),console[_0x4d8c0c(0x12a)](a4_0x3cffb6[_0x4d8c0c(0x11a)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x21c82e=await confirmKey(_0x4d8c0c(0x172)+(_0x5bc1f4+_0x537d2c)+_0x4d8c0c(0x148));if(!_0x21c82e)return console[_0x4d8c0c(0x159)](a4_0x3cffb6[_0x4d8c0c(0x14f)](_0x4d8c0c(0x14b)),_0x4d8c0c(0xf8)),0x1;}const {data:_0x2defa8}=await withSpinner(_0x4d8c0c(0x118),()=>_0x218597[_0x4d8c0c(0x11b)][_0x4d8c0c(0xf1)](_0x273578,{'force':_0x22d894})),_0xd2e4df=_0x2defa8[_0x4d8c0c(0xda)][_0x4d8c0c(0x171)][_0x4d8c0c(0x133)]>0x0||_0x2defa8[_0x4d8c0c(0xda)][_0x4d8c0c(0x11c)][_0x4d8c0c(0x133)]>0x0||_0x2defa8[_0x4d8c0c(0xda)][_0x4d8c0c(0x106)][_0x4d8c0c(0x133)]>0x0||_0x2defa8['counts'][_0x4d8c0c(0x10d)][_0x4d8c0c(0x133)]>0x0;if(_0xd2e4df){console[_0x4d8c0c(0x159)](a4_0x3cffb6['yellow'](_0x4d8c0c(0x13e))),console[_0x4d8c0c(0x159)](),console[_0x4d8c0c(0x159)](a4_0x3cffb6['red']('Errors:'));for(const _0x5b1d3b of _0x2defa8[_0x4d8c0c(0x171)]){_0x5b1d3b[_0x4d8c0c(0x16d)]==='error'&&console['log'](a4_0x3cffb6['red'](_0x4d8c0c(0xd3)+_0x5b1d3b[_0x4d8c0c(0xe9)]+'\x22:\x20'+_0x5b1d3b[_0x4d8c0c(0x12a)]));}for(const _0x56bddc of _0x2defa8[_0x4d8c0c(0x11c)]){_0x56bddc[_0x4d8c0c(0x16d)]===_0x4d8c0c(0x12a)&&console[_0x4d8c0c(0x159)](a4_0x3cffb6[_0x4d8c0c(0x10c)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x56bddc[_0x4d8c0c(0xbb)]+_0x4d8c0c(0x129)+_0x56bddc[_0x4d8c0c(0x12a)]));}for(const _0x5da2e0 of _0x2defa8[_0x4d8c0c(0x106)]){_0x5da2e0[_0x4d8c0c(0x16d)]===_0x4d8c0c(0x12a)&&console[_0x4d8c0c(0x159)](a4_0x3cffb6[_0x4d8c0c(0x10c)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x5da2e0[_0x4d8c0c(0xbb)]+'\x22:\x20'+_0x5da2e0[_0x4d8c0c(0x12a)]));}for(const _0x4c1e8b of _0x2defa8[_0x4d8c0c(0x10d)]){_0x4c1e8b['action']===_0x4d8c0c(0x12a)&&console[_0x4d8c0c(0x159)](a4_0x3cffb6[_0x4d8c0c(0x10c)]('\x20\x20Prompt\x20\x22'+_0x4c1e8b[_0x4d8c0c(0xbb)]+_0x4d8c0c(0x129)+_0x4c1e8b[_0x4d8c0c(0x12a)]));}for(const _0x439082 of _0x2defa8['integrations']){_0x439082[_0x4d8c0c(0x16d)]==='error'&&console[_0x4d8c0c(0x159)](a4_0x3cffb6[_0x4d8c0c(0x10c)](_0x4d8c0c(0x132)+_0x439082['name']+_0x4d8c0c(0x129)+_0x439082[_0x4d8c0c(0x12a)]));}return 0x1;}console[_0x4d8c0c(0x159)](a4_0x3cffb6[_0x4d8c0c(0x116)]('\x0a✔\x20Pushed\x20'+(_0x5bc1f4+_0x537d2c)+_0x4d8c0c(0xbf)+_0x2defa8[_0x4d8c0c(0x146)]+'\x27'));const _0xc908af=getLLMProjectUrl(_0x3ab8c2,_0x2defa8[_0x4d8c0c(0x11f)]);return console[_0x4d8c0c(0x159)](_0x4d8c0c(0x130)+a4_0x3cffb6[_0x4d8c0c(0xf5)](_0xc908af)),0x0;}}
1
+ const a4_0x1b5248=a4_0x164f;(function(_0x4002bc,_0x1768b8){const _0x4cd8ea=a4_0x164f,_0x443e52=_0x4002bc();while(!![]){try{const _0x28e4b1=parseInt(_0x4cd8ea(0x20c))/0x1*(-parseInt(_0x4cd8ea(0x1f1))/0x2)+parseInt(_0x4cd8ea(0x1f8))/0x3+-parseInt(_0x4cd8ea(0x239))/0x4+-parseInt(_0x4cd8ea(0x212))/0x5+-parseInt(_0x4cd8ea(0x1cb))/0x6+parseInt(_0x4cd8ea(0x201))/0x7*(-parseInt(_0x4cd8ea(0x1fa))/0x8)+parseInt(_0x4cd8ea(0x1f2))/0x9*(parseInt(_0x4cd8ea(0x234))/0xa);if(_0x28e4b1===_0x1768b8)break;else _0x443e52['push'](_0x443e52['shift']());}catch(_0x2e1e3c){_0x443e52['push'](_0x443e52['shift']());}}}(a4_0x1088,0x7c99a));function a4_0x1088(){const _0x3e53f8=['\x20\x20Knowledge\x20Bases:\x20','output','\x20\x20Prompt\x20\x22','New\x20project:\x20','Pushing\x20agent\x20from\x20\x22','\x0aWrite\x20','textKnowledgeBases','experimentalKnowledgeBases','total','\x20resources?','\x0aPush\x20summary\x20for\x20\x27','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20resources\x20to\x20\x27','Cannot\x20clone\x20from\x20context\x20project\x20\x22','prompts','isNew','force','\x0aChanges\x20to\x20agent\x20\x27','message','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20tdx\x20agent\x20pull\x20','\x0a✔\x20Pulled\x20','errors','profile','agentId','\x22\x20to\x20a\x20different\x20profile','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Writing\x20files...','New\x20project\x20name\x20is\x20required','\x20\x20Prompts:\x20','cloneProject','Chat:\x20','Analyzing\x20changes\x20to\x20push...','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','tdx.json','reason','-\x20nothing\x20pushed','llm_project','\x0aChanges\x20to\x20integration\x20\x27','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','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)','-\x20no\x20files\x20written','\x0aError:','unchanged','no_local_folder','\x0aProject\x20pushed\x20with\x20errors','Would\x20pull\x20agent:\x20','action','\x20\x20Agents:\x20','Project:\x20','outputDir','join','knowledgeBases','diff','2724084JzYgCW','\x20\x20Agent\x20\x22','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x20files?','\x20changed','pushAgent','experimentalArtifacts','Project\x20cloned\x20with\x20errors','\x20\x20Source:\x20','error','Agent\x20pulled\x20successfully','\x20unchanged','\x20\x20Experimental\x20Artifacts:\x20','\x20new','✔\x20Context\x20set:\x20','Errors:','pushProject','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Using\x20context\x20project:\x20','gray','Dry\x20run\x20-\x20no\x20files\x20written','\x22:\x20','push','llmProject','MISSING_ARGUMENT','\x20\x20Knowledge\x20Base\x20\x22','\x22...','Failed\x20to\x20push\x20agent:\x20','llm','agent:clone','site','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Cloning\x20\x22','Pulling\x20agent\x20\x22','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Output\x20path:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','127114XtjvSq','81tThykQ','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','created','Using\x20project\x20from\x20','No\x20tdx.json\x20found\x20in\x20','Cancelled','1568901LCeITW','red','22272PGyMVC','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20--name\x20','dryRun','Status:\x20','\x20=\x20','\x20total','2485aUhaCJ','pullAgent','context','\x20successfully','New\x20project\x20ID:\x20','projectName','agentName','agents','execute','newProjectId','INVALID_ARGUMENT','12yLADDW','\x20updated','arg-dir','Pushing\x20to\x20project...','Output:\x20','newProjectName','4227210RruIzC','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20--profile\x20','Agent\x20','name','dim','updated','\x20\x20Target:\x20','projectId','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Clone\x20\x22','projectDir','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x22\x20to\x20new\x20project\x20\x22','counts','cwd','sourceProjectName','Using\x20current\x20project:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20Integration\x20\x22','\x20\x20Integrations:\x20','Using\x20project\x20from\x20context:\x20','no_context','agent:push','\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','repeat','cyan','integrations','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Using\x20project:\x20','outputPath','description','\x0aChanges:','\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)','3402450dibqYT','Source:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','session','pullProject','97400OFUFaw','\x20\x20Experimental\x20Artifact\x20\x22','agent.yml','Using\x20local\x20project:\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x22\x20to\x20\x22','\x20created','yellow','Would\x20clone:','utf-8','\x0aErrors\x20found:','Would\x20push\x20agent:\x20','\x20|\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x0aPush\x20','log','new','yes','\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','green','\x20errors','\x0aPull\x20summary\x20for\x20\x27'];a4_0x1088=function(){return _0x3e53f8;};return a4_0x1088();}import a4_0x30a017 from'chalk';import a4_0x27fc33 from'path';import{existsSync,readFileSync}from'fs';function a4_0x164f(_0x5c1609,_0x29de97){_0x5c1609=_0x5c1609-0x195;const _0x1088d0=a4_0x1088();let _0x164f1e=_0x1088d0[_0x5c1609];return _0x164f1e;}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(_0x46eca8){const _0x51d16e=a4_0x164f,_0x540463=[];if(_0x46eca8[_0x51d16e(0x19d)]!==undefined)_0x540463['push'](_0x46eca8[_0x51d16e(0x19d)]+_0x51d16e(0x200));if(_0x46eca8[_0x51d16e(0x249)]!==undefined&&_0x46eca8[_0x51d16e(0x249)]>0x0)_0x540463[_0x51d16e(0x1e1)](a4_0x30a017['green'](_0x46eca8[_0x51d16e(0x249)]+_0x51d16e(0x1d8)));if(_0x46eca8['created']!==undefined&&_0x46eca8[_0x51d16e(0x1f4)]>0x0)_0x540463[_0x51d16e(0x1e1)](a4_0x30a017['green'](_0x46eca8[_0x51d16e(0x1f4)]+_0x51d16e(0x23f)));if(_0x46eca8[_0x51d16e(0x218)]!==undefined&&_0x46eca8['updated']>0x0)_0x540463[_0x51d16e(0x1e1)](a4_0x30a017[_0x51d16e(0x240)](_0x46eca8['updated']+_0x51d16e(0x20d)));if(_0x46eca8['unchanged']!==undefined&&_0x46eca8[_0x51d16e(0x1c0)]>0x0)_0x540463[_0x51d16e(0x1e1)](a4_0x30a017[_0x51d16e(0x1de)](_0x46eca8[_0x51d16e(0x1c0)]+_0x51d16e(0x1d6)));if(_0x46eca8[_0x51d16e(0x1ab)]!==undefined&&_0x46eca8['errors']>0x0)_0x540463[_0x51d16e(0x1e1)](a4_0x30a017['red'](_0x46eca8[_0x51d16e(0x1ab)]+_0x51d16e(0x24d)));return _0x540463[_0x51d16e(0x1c8)](',\x20');}function displayDiffs(_0x149ef5,_0x5b1390,_0x1e593c,_0x2cab6a,_0x38dba3,_0x221c9e,_0x509457){const _0x31ca4c=a4_0x164f;for(const _0xc78617 of _0x149ef5){if(_0xc78617[_0x31ca4c(0x1ca)]){const _0x292ade=_0xc78617[_0x31ca4c(0x207)]||_0xc78617[_0x31ca4c(0x216)];console[_0x31ca4c(0x248)](_0x31ca4c(0x1a6)+_0x292ade+'\x27:'),console[_0x31ca4c(0x248)]('─'[_0x31ca4c(0x22b)](0x3c)),console[_0x31ca4c(0x248)](_0xc78617['diff']),console[_0x31ca4c(0x248)]('─'[_0x31ca4c(0x22b)](0x3c));}}for(const _0x37ba43 of _0x5b1390){_0x37ba43[_0x31ca4c(0x1ca)]&&(console['log'](_0x31ca4c(0x246)+_0x37ba43[_0x31ca4c(0x216)]+'\x27:'),console['log']('─'[_0x31ca4c(0x22b)](0x3c)),console[_0x31ca4c(0x248)](_0x37ba43['diff']),console['log']('─'['repeat'](0x3c)));}for(const _0x25ef95 of _0x1e593c){_0x25ef95['diff']&&(console[_0x31ca4c(0x248)](_0x31ca4c(0x1f0)+_0x25ef95[_0x31ca4c(0x216)]+'\x27:'),console[_0x31ca4c(0x248)]('─'[_0x31ca4c(0x22b)](0x3c)),console['log'](_0x25ef95[_0x31ca4c(0x1ca)]),console[_0x31ca4c(0x248)]('─'['repeat'](0x3c)));}for(const _0x4b170b of _0x2cab6a){_0x4b170b[_0x31ca4c(0x1ca)]&&(console[_0x31ca4c(0x248)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x4b170b[_0x31ca4c(0x216)]+'\x27:'),console[_0x31ca4c(0x248)]('─'[_0x31ca4c(0x22b)](0x3c)),console['log'](_0x4b170b['diff']),console[_0x31ca4c(0x248)]('─'['repeat'](0x3c)));}for(const _0x64e41b of _0x38dba3){_0x64e41b[_0x31ca4c(0x1ca)]&&(console[_0x31ca4c(0x248)](_0x31ca4c(0x1bb)+_0x64e41b[_0x31ca4c(0x216)]+'\x27:'),console[_0x31ca4c(0x248)]('─'[_0x31ca4c(0x22b)](0x3c)),console[_0x31ca4c(0x248)](_0x64e41b[_0x31ca4c(0x1ca)]),console[_0x31ca4c(0x248)]('─'[_0x31ca4c(0x22b)](0x3c)));}for(const _0x325fdc of _0x221c9e){_0x325fdc['diff']&&(console[_0x31ca4c(0x248)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x325fdc[_0x31ca4c(0x216)]+'\x27:'),console[_0x31ca4c(0x248)]('─'['repeat'](0x3c)),console[_0x31ca4c(0x248)](_0x325fdc[_0x31ca4c(0x1ca)]),console[_0x31ca4c(0x248)]('─'[_0x31ca4c(0x22b)](0x3c)));}for(const _0x45602f of _0x509457){_0x45602f[_0x31ca4c(0x1ca)]&&(console[_0x31ca4c(0x248)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x45602f['name']+'\x27:'),console[_0x31ca4c(0x248)]('─'['repeat'](0x3c)),console[_0x31ca4c(0x248)](_0x45602f[_0x31ca4c(0x1ca)]),console['log']('─'[_0x31ca4c(0x22b)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';['description']='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x1b5248(0x209)](_0x502ef8){const _0x1263b1=a4_0x1b5248,{options:_0x450f02,args:_0x32e4e7,tdx:_0x45efba}=_0x502ef8,_0xb2586=_0x32e4e7[0x0],_0x5afa32=_0x32e4e7[0x1],_0x4e6f81=_0x450f02[_0x1263b1(0x196)],_0x21b230=_0x450f02[_0x1263b1(0x1fd)],_0x534842=_0x450f02[_0x1263b1(0x1a5)],_0x3aec86=_0x450f02[_0x1263b1(0x24a)],_0x47914d=_0x450f02[_0x1263b1(0x1e2)],_0x49c96b=_0x450f02['agent'];let _0x3fd22b;if(_0xb2586){const _0x250d5e=a4_0x27fc33[_0x1263b1(0x1c8)](_0xb2586,_0x1263b1(0x1b7));if(existsSync(_0x250d5e))try{const _0x3da4cc=JSON['parse'](readFileSync(_0x250d5e,'utf-8'));_0x3da4cc['llm_project']&&(_0x3fd22b={'llm_project':_0x3da4cc[_0x1263b1(0x1ba)]});}catch{}}const _0x16a2eb=findAgentConfigPath(process['cwd']());let _0x1a76cc;if(_0x16a2eb)try{const _0x422b8d=JSON['parse'](readFileSync(_0x16a2eb,_0x1263b1(0x242)));_0x422b8d[_0x1263b1(0x1ba)]&&(_0x1a76cc={'llm_project':_0x422b8d[_0x1263b1(0x1ba)]});}catch{}const _0x34db2f=resolveAgentPullArgs({'arg':_0xb2586,'agentNameArg':_0x5afa32,'agentFlag':_0x49c96b,'contextProject':_0x47914d,'argDirConfig':_0x3fd22b,'cwdConfigPath':_0x16a2eb||undefined,'cwdConfig':_0x1a76cc}),{projectNameOrId:_0x2227eb,targetAgentName:_0x3884f3,existingOutputDir:_0x415d47,source:_0x3ae08e}=_0x34db2f;if(_0x3ae08e===_0x1263b1(0x20e))console[_0x1263b1(0x248)](a4_0x30a017['dim'](_0x1263b1(0x1f5)+a4_0x27fc33[_0x1263b1(0x1c8)](_0xb2586,_0x1263b1(0x1b7))+':\x20'+_0x2227eb));else{if(_0x3ae08e==='cwd-config')console['log'](a4_0x30a017['dim'](_0x1263b1(0x22f)+_0x2227eb));else _0x3ae08e===_0x1263b1(0x203)&&console[_0x1263b1(0x248)](a4_0x30a017[_0x1263b1(0x217)](_0x1263b1(0x227)+_0x2227eb));}if(!_0x2227eb)return _0x49c96b?(console[_0x1263b1(0x248)](a4_0x30a017[_0x1263b1(0x240)](_0x1263b1(0x236))),console[_0x1263b1(0x248)](_0x1263b1(0x1cd)),console[_0x1263b1(0x248)](_0x1263b1(0x1ed))):(console[_0x1263b1(0x248)](a4_0x30a017[_0x1263b1(0x240)](_0x1263b1(0x1bc))),console[_0x1263b1(0x248)](_0x1263b1(0x1bd)),console[_0x1263b1(0x248)](_0x1263b1(0x24b)),console[_0x1263b1(0x248)](_0x1263b1(0x22a)),console[_0x1263b1(0x248)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project'),console[_0x1263b1(0x248)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x3884f3){const {data:_0xc02a1}=await withSpinner(_0x1263b1(0x1ec)+_0x3884f3+'\x22\x20from\x20project\x20\x22'+_0x2227eb+_0x1263b1(0x1e5),()=>_0x45efba[_0x1263b1(0x1e7)][_0x1263b1(0x202)](_0x2227eb,_0x3884f3,_0x4e6f81,{'dryRun':_0x21b230,'force':_0x534842}));if(_0x21b230)return console[_0x1263b1(0x248)](a4_0x30a017['yellow'](_0x1263b1(0x1df))),console['log'](_0x1263b1(0x1c3)+_0xc02a1[_0x1263b1(0x207)]),console['log'](_0x1263b1(0x1ef)+_0xc02a1[_0x1263b1(0x230)]),_0xc02a1[_0x1263b1(0x1ca)]&&(console[_0x1263b1(0x248)](_0x1263b1(0x232)),console[_0x1263b1(0x248)]('─'[_0x1263b1(0x22b)](0x3c)),console['log'](_0xc02a1['diff']),console[_0x1263b1(0x248)]('─'['repeat'](0x3c))),0x0;return console['log'](a4_0x30a017['green'](_0x1263b1(0x1d5))),console['log']('Agent:\x20'+_0xc02a1[_0x1263b1(0x207)]),console[_0x1263b1(0x248)](_0x1263b1(0x210)+_0xc02a1['outputPath']),console[_0x1263b1(0x248)](_0x1263b1(0x1fe)+(_0xc02a1[_0x1263b1(0x1a4)]?a4_0x30a017['green'](_0x1263b1(0x249)):_0xc02a1['hasChanges']?a4_0x30a017[_0x1263b1(0x240)](_0x1263b1(0x218)):a4_0x30a017['gray'](_0x1263b1(0x1c0)))),0x0;}const _0x45d87c=_0x415d47||_0x4e6f81,{data:_0x4d73b6}=await withSpinner('Analyzing\x20project\x20\x22'+_0x2227eb+_0x1263b1(0x1e5),()=>_0x45efba[_0x1263b1(0x1e7)][_0x1263b1(0x238)](_0x2227eb,_0x45d87c,{'dryRun':!![]})),_0x2e32fd=_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x208)][_0x1263b1(0x249)]+_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x1c9)][_0x1263b1(0x249)]+_0x4d73b6['counts']['textKnowledgeBases']['new']+_0x4d73b6[_0x1263b1(0x220)]['prompts'][_0x1263b1(0x249)]+_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x22d)][_0x1263b1(0x249)]+_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x19c)]['new']+_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x1d1)][_0x1263b1(0x249)],_0x2da48d=_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x208)]['updated']+_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x1c9)]['updated']+_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x19b)][_0x1263b1(0x218)]+_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x1a3)][_0x1263b1(0x218)]+_0x4d73b6['counts'][_0x1263b1(0x22d)][_0x1263b1(0x218)]+_0x4d73b6[_0x1263b1(0x220)]['experimentalKnowledgeBases'][_0x1263b1(0x218)]+_0x4d73b6[_0x1263b1(0x220)]['experimentalArtifacts']['updated'],_0x5bdcc1=_0x4d73b6['counts'][_0x1263b1(0x208)]['unchanged']+_0x4d73b6['counts'][_0x1263b1(0x1c9)]['unchanged']+_0x4d73b6['counts'][_0x1263b1(0x19b)]['unchanged']+_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x1a3)][_0x1263b1(0x1c0)]+_0x4d73b6['counts'][_0x1263b1(0x22d)][_0x1263b1(0x1c0)]+_0x4d73b6[_0x1263b1(0x220)]['experimentalKnowledgeBases'][_0x1263b1(0x1c0)]+_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x1d1)][_0x1263b1(0x1c0)];console['log'](_0x1263b1(0x24e)+_0x4d73b6[_0x1263b1(0x206)]+'\x27:'),console[_0x1263b1(0x248)]('\x20\x20'+a4_0x30a017[_0x1263b1(0x24c)]('+\x20'+_0x2e32fd+_0x1263b1(0x1d8))+_0x1263b1(0x245)+a4_0x30a017['yellow']('~\x20'+_0x2da48d+'\x20changed')+'\x20|\x20'+a4_0x30a017['dim']('=\x20'+_0x5bdcc1+'\x20unchanged')),console['log'](_0x1263b1(0x1c5)+formatCountSummary(_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x208)])),console[_0x1263b1(0x248)](_0x1263b1(0x195)+formatCountSummary(_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x1c9)])),console[_0x1263b1(0x248)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x19b)])),console['log'](_0x1263b1(0x1b2)+formatCountSummary(_0x4d73b6['counts'][_0x1263b1(0x1a3)])),console['log'](_0x1263b1(0x226)+formatCountSummary(_0x4d73b6[_0x1263b1(0x220)]['integrations']));const _0x29a438=_0x4d73b6['counts'][_0x1263b1(0x19c)]['total']>0x0||_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x1d1)]['total']>0x0;_0x29a438&&(console[_0x1263b1(0x248)](_0x1263b1(0x213)+formatCountSummary(_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x19c)])),console[_0x1263b1(0x248)](_0x1263b1(0x1d7)+formatCountSummary(_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x1d1)])));console['log'](_0x1263b1(0x219)+a4_0x30a017[_0x1263b1(0x22c)](_0x4d73b6[_0x1263b1(0x1c7)])),displayDiffs(_0x4d73b6[_0x1263b1(0x208)],_0x4d73b6[_0x1263b1(0x1c9)],_0x4d73b6['textKnowledgeBases'],_0x4d73b6[_0x1263b1(0x1a3)],_0x4d73b6[_0x1263b1(0x22d)],_0x4d73b6[_0x1263b1(0x19c)],_0x4d73b6[_0x1263b1(0x1d1)]);if(_0x21b230)return console[_0x1263b1(0x248)](a4_0x30a017[_0x1263b1(0x240)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x2e32fd===0x0&&_0x2da48d===0x0)return console['log'](a4_0x30a017[_0x1263b1(0x24c)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x4d73b6[_0x1263b1(0x206)]},_0x450f02[_0x1263b1(0x237)]),console[_0x1263b1(0x248)](a4_0x30a017[_0x1263b1(0x24c)](_0x1263b1(0x1d9)+a4_0x30a017['dim'](_0x1263b1(0x1ba))+'\x20=\x20'+a4_0x30a017[_0x1263b1(0x22c)](_0x4d73b6[_0x1263b1(0x206)]))),0x0;if(!_0x3aec86&&!_0x534842){if(!isInteractive())return console['error'](a4_0x30a017['red'](_0x1263b1(0x1bf)),_0x1263b1(0x21b)),console[_0x1263b1(0x1d4)](a4_0x30a017[_0x1263b1(0x217)](_0x1263b1(0x1a8))),0x1;const _0x129003=await confirmKey(_0x1263b1(0x19a)+(_0x2e32fd+_0x2da48d)+_0x1263b1(0x1ce));if(!_0x129003)return console[_0x1263b1(0x248)](a4_0x30a017[_0x1263b1(0x240)](_0x1263b1(0x1f7)),_0x1263b1(0x1be)),0x1;}const {data:_0xb5a8f0}=await withSpinner(_0x1263b1(0x1b0),()=>_0x45efba[_0x1263b1(0x1e7)][_0x1263b1(0x238)](_0x2227eb,_0x45d87c,{'force':_0x534842}));return console['log'](a4_0x30a017['green'](_0x1263b1(0x1aa)+(_0x2e32fd+_0x2da48d)+'\x20files\x20to\x20'+_0xb5a8f0[_0x1263b1(0x1c7)])),saveSessionContext({'llm_project':_0xb5a8f0[_0x1263b1(0x206)]},_0x450f02[_0x1263b1(0x237)]),console[_0x1263b1(0x248)](a4_0x30a017[_0x1263b1(0x24c)](_0x1263b1(0x1d9)+a4_0x30a017[_0x1263b1(0x217)](_0x1263b1(0x1ba))+_0x1263b1(0x1ff)+a4_0x30a017[_0x1263b1(0x22c)](_0xb5a8f0['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x1b5248(0x216)]=a4_0x1b5248(0x1e8);[a4_0x1b5248(0x231)]=a4_0x1b5248(0x22e);async['execute'](_0xcb2227){const _0x4c4061=a4_0x1b5248,{options:_0x3424c8,args:_0x374159,tdx:_0x4a222c}=_0xcb2227,_0x287dcf=_0x374159[0x0],_0xb94cbf=_0x3424c8[_0x4c4061(0x216)],_0x1b0e0e=_0x3424c8['dryRun'],_0x2b56c8=_0x3424c8[_0x4c4061(0x24a)],_0x49ef3a=_0x3424c8[_0x4c4061(0x1e9)],_0x13dc95=_0x3424c8['llmProject'];let _0x250fdf;const _0x123eff=findAgentConfigPath(process[_0x4c4061(0x221)]());if(_0x287dcf){const _0x56865d=a4_0x27fc33[_0x4c4061(0x1c8)](_0x287dcf,_0x4c4061(0x1b7));existsSync(_0x56865d)?(_0x250fdf=_0x287dcf,console[_0x4c4061(0x248)](a4_0x30a017['dim'](_0x4c4061(0x23c)+_0x287dcf))):_0x250fdf=_0x287dcf;}else{if(_0x123eff)_0x250fdf=a4_0x27fc33['dirname'](_0x123eff),console[_0x4c4061(0x248)](a4_0x30a017[_0x4c4061(0x217)](_0x4c4061(0x223)+_0x250fdf));else{if(_0x13dc95){const _0xf371b3=sanitizeForFilesystem(_0x13dc95);let _0x184738=_0xf371b3,_0x34c7d0=a4_0x27fc33[_0x4c4061(0x1c8)](process['cwd'](),_0x4c4061(0x208),_0xf371b3,_0x4c4061(0x1b7));if(!existsSync(_0x34c7d0)){const _0x23ad7f=normalizeName(_0x13dc95),_0x49834c=a4_0x27fc33[_0x4c4061(0x1c8)](process[_0x4c4061(0x221)](),_0x4c4061(0x208),_0x23ad7f,_0x4c4061(0x1b7));existsSync(_0x49834c)&&(_0x184738=_0x23ad7f,_0x34c7d0=_0x49834c);}if(existsSync(_0x34c7d0))_0x250fdf=a4_0x27fc33['dirname'](_0x34c7d0),console[_0x4c4061(0x248)](a4_0x30a017[_0x4c4061(0x217)]('Using\x20local\x20project:\x20'+_0x250fdf));else{const _0x115c2c=_0x3424c8[_0x4c4061(0x1ac)];if(_0x115c2c)throw new SDKError(ErrorCode[_0x4c4061(0x20b)],_0x4c4061(0x1a2)+_0x13dc95+_0x4c4061(0x1ae),undefined,{'helpText':_0x4c4061(0x1dc)+_0x4c4061(0x1f3)+(_0x4c4061(0x1a9)+_0x13dc95+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x184738+_0x4c4061(0x1fc)+(_0xb94cbf||'<new-name>')+_0x4c4061(0x214)+_0x115c2c)});_0x250fdf=_0x13dc95,console[_0x4c4061(0x248)](a4_0x30a017[_0x4c4061(0x217)](_0x4c4061(0x1dd)+_0x13dc95));}}}}if(!_0x250fdf)return console[_0x4c4061(0x248)](a4_0x30a017[_0x4c4061(0x240)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x4c4061(0x248)](_0x4c4061(0x224)),console[_0x4c4061(0x248)](_0x4c4061(0x1af)),console['log'](_0x4c4061(0x233)),console[_0x4c4061(0x248)](_0x4c4061(0x1fb)),0x1;if(!_0xb94cbf)throw new SDKError(ErrorCode[_0x4c4061(0x1e3)],_0x4c4061(0x1b1),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x2b56c8&&!_0x1b0e0e){if(!isInteractive())return console[_0x4c4061(0x1d4)](a4_0x30a017[_0x4c4061(0x1f9)](_0x4c4061(0x1bf)),_0x4c4061(0x21b)),console['error'](a4_0x30a017[_0x4c4061(0x217)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x15a910=await confirmKey(_0x4c4061(0x21c)+_0x250fdf+_0x4c4061(0x21f)+_0xb94cbf+'\x22?');if(!_0x15a910)return console['log'](a4_0x30a017[_0x4c4061(0x240)](_0x4c4061(0x1f7))),0x1;}const {data:_0x5436f8}=await withSpinner(_0x4c4061(0x1eb)+_0x250fdf+_0x4c4061(0x23e)+_0xb94cbf+'\x22...',()=>_0x4a222c[_0x4c4061(0x1e7)][_0x4c4061(0x1b3)](_0x250fdf,_0xb94cbf,{'dryRun':_0x1b0e0e}));if(_0x1b0e0e){console['log'](a4_0x30a017[_0x4c4061(0x240)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x4c4061(0x248)](_0x4c4061(0x235)+_0x5436f8[_0x4c4061(0x222)]),console['log'](_0x4c4061(0x198)+_0xb94cbf),console[_0x4c4061(0x248)](_0x4c4061(0x241)),console[_0x4c4061(0x248)](_0x4c4061(0x1c5)+_0x5436f8['counts'][_0x4c4061(0x208)][_0x4c4061(0x1f4)]),console[_0x4c4061(0x248)](_0x4c4061(0x195)+_0x5436f8['counts'][_0x4c4061(0x1c9)][_0x4c4061(0x1f4)]),console['log'](_0x4c4061(0x1b2)+_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x1a3)][_0x4c4061(0x1f4)]);const _0x1b24a4=_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x19c)][_0x4c4061(0x1f4)]>0x0||_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x1d1)][_0x4c4061(0x1f4)]>0x0;return _0x1b24a4&&(console['log'](_0x4c4061(0x213)+_0x5436f8[_0x4c4061(0x220)]['experimentalKnowledgeBases']['created']),console['log'](_0x4c4061(0x1d7)+_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x1d1)]['created'])),0x0;}const _0x2697a2=_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x208)][_0x4c4061(0x1ab)]>0x0||_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x1c9)][_0x4c4061(0x1ab)]>0x0||_0x5436f8['counts'][_0x4c4061(0x1a3)][_0x4c4061(0x1ab)]>0x0||_0x5436f8['counts'][_0x4c4061(0x19c)]['errors']>0x0||_0x5436f8[_0x4c4061(0x220)]['experimentalArtifacts'][_0x4c4061(0x1ab)]>0x0;_0x2697a2?console[_0x4c4061(0x248)](a4_0x30a017[_0x4c4061(0x240)](_0x4c4061(0x1d2))):console[_0x4c4061(0x248)](a4_0x30a017['green']('Project\x20cloned\x20successfully'));console['log'](_0x4c4061(0x235)+_0x5436f8[_0x4c4061(0x222)]),console[_0x4c4061(0x248)](_0x4c4061(0x198)+_0x5436f8[_0x4c4061(0x211)]),console[_0x4c4061(0x248)](_0x4c4061(0x205)+_0x5436f8[_0x4c4061(0x20a)]),console[_0x4c4061(0x248)](),console[_0x4c4061(0x248)]('Summary:'),console[_0x4c4061(0x248)](_0x4c4061(0x1c5)+formatCountSummary(_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x208)])),console[_0x4c4061(0x248)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x1c9)])),console[_0x4c4061(0x248)](_0x4c4061(0x1b2)+formatCountSummary(_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x1a3)])),console[_0x4c4061(0x248)](_0x4c4061(0x226)+formatCountSummary(_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x22d)]));const _0x23de76=_0x5436f8[_0x4c4061(0x220)]['experimentalKnowledgeBases'][_0x4c4061(0x1f4)]>0x0||_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x19c)]['updated']>0x0||_0x5436f8[_0x4c4061(0x220)]['experimentalKnowledgeBases'][_0x4c4061(0x1c0)]>0x0||_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x1d1)][_0x4c4061(0x1f4)]>0x0||_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x1d1)][_0x4c4061(0x218)]>0x0||_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x1d1)][_0x4c4061(0x1c0)]>0x0;_0x23de76&&(console[_0x4c4061(0x248)](_0x4c4061(0x213)+formatCountSummary(_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x19c)])),console[_0x4c4061(0x248)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x1d1)])));if(_0x2697a2){console[_0x4c4061(0x248)](),console['log'](a4_0x30a017['red'](_0x4c4061(0x1da)));for(const _0x16aba0 of _0x5436f8[_0x4c4061(0x208)]){_0x16aba0[_0x4c4061(0x1c4)]==='error'&&console[_0x4c4061(0x248)](a4_0x30a017['red'](_0x4c4061(0x1cc)+_0x16aba0['agentName']+_0x4c4061(0x1e0)+_0x16aba0[_0x4c4061(0x1d4)]));}for(const _0x5d2c56 of _0x5436f8[_0x4c4061(0x1c9)]){_0x5d2c56[_0x4c4061(0x1c4)]==='error'&&console[_0x4c4061(0x248)](a4_0x30a017[_0x4c4061(0x1f9)](_0x4c4061(0x1e4)+_0x5d2c56[_0x4c4061(0x216)]+_0x4c4061(0x1e0)+_0x5d2c56[_0x4c4061(0x1d4)]));}for(const _0x5ba6a2 of _0x5436f8[_0x4c4061(0x1a3)]){_0x5ba6a2[_0x4c4061(0x1c4)]==='error'&&console[_0x4c4061(0x248)](a4_0x30a017[_0x4c4061(0x1f9)](_0x4c4061(0x197)+_0x5ba6a2[_0x4c4061(0x216)]+_0x4c4061(0x1e0)+_0x5ba6a2[_0x4c4061(0x1d4)]));}for(const _0x285554 of _0x5436f8['integrations']){_0x285554['action']===_0x4c4061(0x1d4)&&console[_0x4c4061(0x248)](a4_0x30a017[_0x4c4061(0x1f9)](_0x4c4061(0x225)+_0x285554[_0x4c4061(0x216)]+'\x22:\x20'+_0x285554[_0x4c4061(0x1d4)]));}for(const _0x25d7e0 of _0x5436f8[_0x4c4061(0x19c)]){_0x25d7e0['action']===_0x4c4061(0x1d4)&&console[_0x4c4061(0x248)](a4_0x30a017[_0x4c4061(0x1f9)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x25d7e0[_0x4c4061(0x216)]+_0x4c4061(0x1e0)+_0x25d7e0[_0x4c4061(0x1d4)]));}for(const _0x2e0cfc of _0x5436f8['experimentalArtifacts']){_0x2e0cfc[_0x4c4061(0x1c4)]===_0x4c4061(0x1d4)&&console[_0x4c4061(0x248)](a4_0x30a017['red'](_0x4c4061(0x23a)+_0x2e0cfc['name']+'\x22:\x20'+_0x2e0cfc[_0x4c4061(0x1d4)]));}return 0x1;}console[_0x4c4061(0x248)]();const _0x566a30=getLLMProjectUrl(_0x49ef3a,_0x5436f8[_0x4c4061(0x20a)]);return console[_0x4c4061(0x248)](_0x4c4061(0x1c6)+a4_0x30a017['cyan'](_0x566a30)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x1b5248(0x229);[a4_0x1b5248(0x231)]=a4_0x1b5248(0x21e);async[a4_0x1b5248(0x209)](_0x2860f9){const _0x50f4c3=a4_0x1b5248,{options:_0x552aa9,args:_0x26bd35,tdx:_0xf07f7d}=_0x2860f9;let _0x5a4da8=_0x26bd35[0x0]||process[_0x50f4c3(0x221)]();const _0x343690=_0x552aa9['dryRun'],_0x1e7df1=_0x552aa9[_0x50f4c3(0x1a5)],_0x2b9344=_0x552aa9[_0x50f4c3(0x24a)],_0x5f1650=_0x552aa9[_0x50f4c3(0x1e9)],_0x6e07f7=a4_0x27fc33['join'](_0x5a4da8,_0x50f4c3(0x23b)),_0x20c48b=existsSync(_0x6e07f7);if(_0x20c48b){const {data:_0x3f8d77}=await withSpinner(_0x50f4c3(0x199)+_0x5a4da8+_0x50f4c3(0x1e5),()=>_0xf07f7d[_0x50f4c3(0x1e7)][_0x50f4c3(0x1d0)](_0x5a4da8,{'dryRun':_0x343690,'force':_0x1e7df1}));if(_0x343690)return console['log'](a4_0x30a017[_0x50f4c3(0x240)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x50f4c3(0x248)](_0x50f4c3(0x244)+_0x3f8d77[_0x50f4c3(0x207)]),0x0;if(_0x3f8d77[_0x50f4c3(0x1c4)]===_0x50f4c3(0x1d4))return console[_0x50f4c3(0x248)](a4_0x30a017[_0x50f4c3(0x1f9)](_0x50f4c3(0x1e6)+_0x3f8d77[_0x50f4c3(0x1d4)])),0x1;console[_0x50f4c3(0x248)](a4_0x30a017[_0x50f4c3(0x24c)](_0x50f4c3(0x215)+_0x3f8d77[_0x50f4c3(0x1c4)]+_0x50f4c3(0x204))),console[_0x50f4c3(0x248)]('Agent:\x20'+_0x3f8d77['agentName']);if(_0x3f8d77[_0x50f4c3(0x1ad)]&&_0x3f8d77[_0x50f4c3(0x21a)]){const _0x338190=getLLMAgentChatUrl(_0x5f1650,_0x3f8d77[_0x50f4c3(0x21a)],_0x3f8d77[_0x50f4c3(0x1ad)]);console[_0x50f4c3(0x248)](_0x50f4c3(0x1b4)+a4_0x30a017[_0x50f4c3(0x22c)](_0x338190));}return 0x0;}const _0x406619=_0x552aa9[_0x50f4c3(0x1e2)],_0x8bdd51=resolveProjectFromContext(_0x5a4da8,_0x406619);if(_0x8bdd51['found'])_0x5a4da8=_0x8bdd51[_0x50f4c3(0x21d)],_0x8bdd51['source']==='context'&&console[_0x50f4c3(0x248)](a4_0x30a017[_0x50f4c3(0x217)](_0x50f4c3(0x22f)+_0x5a4da8));else{let _0x265d2d=_0x50f4c3(0x23d);_0x8bdd51[_0x50f4c3(0x1b8)]===_0x50f4c3(0x1c1)&&(_0x265d2d=_0x8bdd51[_0x50f4c3(0x1a7)]+_0x50f4c3(0x1b6)+_0x8bdd51[_0x50f4c3(0x1e2)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x50f4c3(0x20b)],_0x8bdd51[_0x50f4c3(0x1b8)]===_0x50f4c3(0x228)?_0x8bdd51['message']:_0x50f4c3(0x1f6)+_0x5a4da8,undefined,{'helpText':_0x265d2d});}const {data:_0x113d40}=await withSpinner(_0x50f4c3(0x1b5),()=>_0xf07f7d[_0x50f4c3(0x1e7)]['pushProject'](_0x5a4da8,{'dryRun':!![]})),_0x45f9f8=_0x113d40[_0x50f4c3(0x220)]['agents']['errors']>0x0;if(_0x45f9f8){console['log'](a4_0x30a017['red'](_0x50f4c3(0x243)));for(const _0x5f47d8 of _0x113d40['agents']){_0x5f47d8['action']===_0x50f4c3(0x1d4)&&console[_0x50f4c3(0x248)](a4_0x30a017[_0x50f4c3(0x1f9)](_0x50f4c3(0x1cc)+_0x5f47d8[_0x50f4c3(0x207)]+_0x50f4c3(0x1e0)+_0x5f47d8['error']));}return 0x1;}const _0x4610aa=_0x113d40['counts'][_0x50f4c3(0x208)]['created']+_0x113d40['counts']['knowledgeBases']['created']+_0x113d40[_0x50f4c3(0x220)]['textKnowledgeBases'][_0x50f4c3(0x1f4)]+_0x113d40[_0x50f4c3(0x220)]['prompts']['created']+_0x113d40[_0x50f4c3(0x220)]['integrations'][_0x50f4c3(0x1f4)]+_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x19c)][_0x50f4c3(0x1f4)]+_0x113d40[_0x50f4c3(0x220)]['experimentalArtifacts'][_0x50f4c3(0x1f4)],_0x2d5d8a=_0x113d40[_0x50f4c3(0x220)]['agents'][_0x50f4c3(0x218)]+_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x1c9)][_0x50f4c3(0x218)]+_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x19b)][_0x50f4c3(0x218)]+_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x1a3)][_0x50f4c3(0x218)]+_0x113d40['counts']['integrations'][_0x50f4c3(0x218)]+_0x113d40[_0x50f4c3(0x220)]['experimentalKnowledgeBases'][_0x50f4c3(0x218)]+_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x1d1)]['updated'],_0x20eda6=_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x208)][_0x50f4c3(0x1c0)]+_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x1c9)]['unchanged']+_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x19b)][_0x50f4c3(0x1c0)]+_0x113d40['counts'][_0x50f4c3(0x1a3)][_0x50f4c3(0x1c0)]+_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x22d)]['unchanged']+_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x19c)][_0x50f4c3(0x1c0)]+_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x1d1)][_0x50f4c3(0x1c0)];console[_0x50f4c3(0x248)](_0x50f4c3(0x19f)+_0x113d40[_0x50f4c3(0x206)]+'\x27:'),console['log']('\x20\x20'+a4_0x30a017[_0x50f4c3(0x24c)]('+\x20'+_0x4610aa+_0x50f4c3(0x1d8))+'\x20|\x20'+a4_0x30a017[_0x50f4c3(0x240)]('~\x20'+_0x2d5d8a+_0x50f4c3(0x1cf))+_0x50f4c3(0x245)+a4_0x30a017[_0x50f4c3(0x217)]('=\x20'+_0x20eda6+_0x50f4c3(0x1d6))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x208)])),console[_0x50f4c3(0x248)](_0x50f4c3(0x195)+formatCountSummary(_0x113d40[_0x50f4c3(0x220)]['knowledgeBases'])),console['log'](_0x50f4c3(0x1a0)+formatCountSummary(_0x113d40[_0x50f4c3(0x220)]['textKnowledgeBases'])),console['log'](_0x50f4c3(0x1b2)+formatCountSummary(_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x1a3)])),console[_0x50f4c3(0x248)](_0x50f4c3(0x226)+formatCountSummary(_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x22d)]));const _0x4deff8=_0x113d40['counts']['experimentalKnowledgeBases'][_0x50f4c3(0x1f4)]>0x0||_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x19c)][_0x50f4c3(0x218)]>0x0||_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x19c)]['unchanged']>0x0||_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x1d1)][_0x50f4c3(0x1f4)]>0x0||_0x113d40['counts'][_0x50f4c3(0x1d1)][_0x50f4c3(0x218)]>0x0||_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x1d1)]['unchanged']>0x0;_0x4deff8&&(console['log'](_0x50f4c3(0x213)+formatCountSummary(_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x19c)])),console[_0x50f4c3(0x248)](_0x50f4c3(0x1d7)+formatCountSummary(_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x1d1)])));console[_0x50f4c3(0x248)](_0x50f4c3(0x1d3)+a4_0x30a017['cyan'](_0x5a4da8)),displayDiffs(_0x113d40[_0x50f4c3(0x208)],_0x113d40[_0x50f4c3(0x1c9)],_0x113d40[_0x50f4c3(0x19b)],_0x113d40[_0x50f4c3(0x1a3)],_0x113d40[_0x50f4c3(0x22d)],_0x113d40['experimentalKnowledgeBases'],_0x113d40['experimentalArtifacts']);if(_0x343690)return console[_0x50f4c3(0x248)](a4_0x30a017[_0x50f4c3(0x240)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x4610aa===0x0&&_0x2d5d8a===0x0){console[_0x50f4c3(0x248)](a4_0x30a017[_0x50f4c3(0x24c)](_0x50f4c3(0x1ee)));const _0x1c088b=getLLMProjectUrl(_0x5f1650,_0x113d40[_0x50f4c3(0x21a)]);return console[_0x50f4c3(0x248)](_0x50f4c3(0x1c6)+a4_0x30a017['cyan'](_0x1c088b)),0x0;}if(!_0x2b9344&&!_0x1e7df1){if(!isInteractive())return console[_0x50f4c3(0x1d4)](a4_0x30a017['red'](_0x50f4c3(0x1bf)),_0x50f4c3(0x21b)),console[_0x50f4c3(0x1d4)](a4_0x30a017[_0x50f4c3(0x217)](_0x50f4c3(0x1a8))),0x1;const _0x389f22=await confirmKey(_0x50f4c3(0x247)+(_0x4610aa+_0x2d5d8a)+_0x50f4c3(0x19e));if(!_0x389f22)return console[_0x50f4c3(0x248)](a4_0x30a017['yellow']('Cancelled'),_0x50f4c3(0x1b9)),0x1;}const {data:_0x45aeee}=await withSpinner(_0x50f4c3(0x20f),()=>_0xf07f7d['llm'][_0x50f4c3(0x1db)](_0x5a4da8,{'force':_0x1e7df1})),_0x899f9e=_0x45aeee[_0x50f4c3(0x220)][_0x50f4c3(0x208)][_0x50f4c3(0x1ab)]>0x0||_0x45aeee['counts'][_0x50f4c3(0x1c9)][_0x50f4c3(0x1ab)]>0x0||_0x45aeee[_0x50f4c3(0x220)][_0x50f4c3(0x19b)]['errors']>0x0||_0x45aeee[_0x50f4c3(0x220)][_0x50f4c3(0x1a3)][_0x50f4c3(0x1ab)]>0x0;if(_0x899f9e){console[_0x50f4c3(0x248)](a4_0x30a017['yellow'](_0x50f4c3(0x1c2))),console['log'](),console[_0x50f4c3(0x248)](a4_0x30a017[_0x50f4c3(0x1f9)](_0x50f4c3(0x1da)));for(const _0x3a8b39 of _0x45aeee[_0x50f4c3(0x208)]){_0x3a8b39[_0x50f4c3(0x1c4)]===_0x50f4c3(0x1d4)&&console['log'](a4_0x30a017[_0x50f4c3(0x1f9)](_0x50f4c3(0x1cc)+_0x3a8b39['agentName']+'\x22:\x20'+_0x3a8b39[_0x50f4c3(0x1d4)]));}for(const _0x5d4102 of _0x45aeee[_0x50f4c3(0x1c9)]){_0x5d4102['action']==='error'&&console[_0x50f4c3(0x248)](a4_0x30a017[_0x50f4c3(0x1f9)](_0x50f4c3(0x1e4)+_0x5d4102[_0x50f4c3(0x216)]+_0x50f4c3(0x1e0)+_0x5d4102['error']));}for(const _0x263940 of _0x45aeee[_0x50f4c3(0x19b)]){_0x263940[_0x50f4c3(0x1c4)]===_0x50f4c3(0x1d4)&&console['log'](a4_0x30a017[_0x50f4c3(0x1f9)](_0x50f4c3(0x1ea)+_0x263940[_0x50f4c3(0x216)]+_0x50f4c3(0x1e0)+_0x263940[_0x50f4c3(0x1d4)]));}for(const _0x558b71 of _0x45aeee[_0x50f4c3(0x1a3)]){_0x558b71[_0x50f4c3(0x1c4)]==='error'&&console[_0x50f4c3(0x248)](a4_0x30a017['red'](_0x50f4c3(0x197)+_0x558b71[_0x50f4c3(0x216)]+'\x22:\x20'+_0x558b71['error']));}for(const _0xf35aa2 of _0x45aeee['integrations']){_0xf35aa2[_0x50f4c3(0x1c4)]===_0x50f4c3(0x1d4)&&console[_0x50f4c3(0x248)](a4_0x30a017[_0x50f4c3(0x1f9)]('\x20\x20Integration\x20\x22'+_0xf35aa2[_0x50f4c3(0x216)]+_0x50f4c3(0x1e0)+_0xf35aa2[_0x50f4c3(0x1d4)]));}return 0x1;}console[_0x50f4c3(0x248)](a4_0x30a017[_0x50f4c3(0x24c)]('\x0a✔\x20Pushed\x20'+(_0x4610aa+_0x2d5d8a)+_0x50f4c3(0x1a1)+_0x45aeee['projectName']+'\x27'));const _0x4e475f=getLLMProjectUrl(_0x5f1650,_0x45aeee[_0x50f4c3(0x21a)]);return console[_0x50f4c3(0x248)](_0x50f4c3(0x1c6)+a4_0x30a017[_0x50f4c3(0x22c)](_0x4e475f)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x519acd=a5_0x7ac6;(function(_0x4f5417,_0xe5b247){const _0x2b323a=a5_0x7ac6,_0x487253=_0x4f5417();while(!![]){try{const _0x402da8=-parseInt(_0x2b323a(0x107))/0x1*(parseInt(_0x2b323a(0xff))/0x2)+parseInt(_0x2b323a(0x126))/0x3+-parseInt(_0x2b323a(0x163))/0x4*(-parseInt(_0x2b323a(0x147))/0x5)+parseInt(_0x2b323a(0xd3))/0x6+parseInt(_0x2b323a(0x115))/0x7*(-parseInt(_0x2b323a(0xe3))/0x8)+-parseInt(_0x2b323a(0x162))/0x9+parseInt(_0x2b323a(0x142))/0xa*(parseInt(_0x2b323a(0x140))/0xb);if(_0x402da8===_0xe5b247)break;else _0x487253['push'](_0x487253['shift']());}catch(_0x1dc925){_0x487253['push'](_0x487253['shift']());}}}(a5_0x15e5,0xdd054));import*as a5_0x47a9b3 from'node:fs';import*as a5_0x3e4bf1 from'node:path';import a5_0x7e878b from'chalk';import{BaseCommand}from'./command.js';function a5_0x15e5(){const _0x32a28a=['Tests\x20found:\x20','yellow','name','Re-evaluating\x20cached\x20test\x20run...','conversation_url','isSpinning','eval','context','\x20\x20Round\x20','\x20\x20Evaluating...\x20','\x20(cached)','resolveProjectId','\x20(new)','374857QvqZSf','text','Error\x20writing\x20output\x20file:\x20','push','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','/<agent-name>','\x20-\x20','Failed:\x20\x20\x20','message','New\x20tests\x20to\x20execute:\x20','\x22:\x20','utf-8','Passed:\x20\x20\x20','includes','ERROR','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','green','5073339OixaUc','Errors:\x20\x20\x20','verbose','some','forEach','tags','found','writeFileSync','dryRun','Failed\x20Tests:','\x27\x20to\x20create\x20the\x20folder\x20structure.','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','toISOString','Re-evaluating...','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','stop','404','timestamp','Output\x20written\x20to:\x20','Re-evaluation\x20Summary','join','projectName',':\x20Sending\x20user\x20input...','find','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','json','99sliCdR','split','601070ZeSGtC','Agent:\x20','✗\x20ERROR:\x20','log','map','93165ishMrl','Executing\x20new\x20tests...','output','Total:\x20\x20\x20\x20','red','trim','dim','...','no_context','table','Running\x20test:\x20','Evaluating\x20response...','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','llm','tests','Running\x20agent\x20tests...','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','execute','Either\x20switch\x20to\x20the\x20\x22','Cached\x20run\x20is\x20from\x20site\x20\x22','length','FAIL','cyan','Round\x201/','Test\x20Configuration:','8036919iQpxIo','252NMcpMj','site','Error:\x20No\x20previous\x20test\x20run\x20found.','size','Round\x20','now','Test\x20Summary','basename','Test\x20','1334706CJMdzh','round','test.yml','testName','projectDir','\x22,\x20but\x20current\x20site\x20is\x20\x22','reason','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Using\x20agent:\x20','Cached\x20run\x20from:\x20','resolveAgentId','PASS','⚠\x20SKIPPED:\x20','✗\x20FAIL:\x20','✓\x20PASS:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','232SBmnBQ','testYmlPath','toLowerCase','\x20\x20Agent:\x20','tsv','\x20\x20Conversation:\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','Duration:\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','repeat','white','\x20\x20Site:\x20','status','existsSync','No\x20tests\x20have\x20tags\x20defined.','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Re-evaluating\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','add','llmProject','filter','not\x20found','no_local_folder','No\x20tests\x20found\x20with\x20tags:\x20','...\x20','\x20\x20-\x20','Run\x20\x27tdx\x20agent\x20pull\x20','start','2lQBVmy','has','agentName','reeval','agent','rounds','executeReeval','Site:\x20','277136mtMZJE'];a5_0x15e5=function(){return _0x32a28a;};return a5_0x15e5();}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x7ac6(_0x1804de,_0x3ed74b){_0x1804de=_0x1804de-0xcf;const _0x15e5f6=a5_0x15e5();let _0x7ac6e3=_0x15e5f6[_0x1804de];return _0x7ac6e3;}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x519acd(0x10a)]='agent:test';['description']=a5_0x519acd(0xe9);async[a5_0x519acd(0x15a)](_0x7e6e65){const _0x5069a2=a5_0x519acd,{options:_0x268c7a,args:_0x4e911d,tdx:_0x574954}=_0x7e6e65,_0x25ffa3=_0x4e911d[0x0]||'.',_0x40271a=_0x268c7a[_0x5069a2(0x12e)],_0x89614=_0x268c7a,_0x491a90=_0x89614[_0x5069a2(0x10e)]===![],_0x3e6762=_0x89614[_0x5069a2(0x102)],_0x238928=_0x89614[_0x5069a2(0x10a)],_0x3f508f=_0x89614[_0x5069a2(0x12b)],_0x1fb7e0=_0x268c7a['site'],_0x12fc12=_0x89614[_0x5069a2(0x149)];if(_0x3e6762&&_0x491a90)return console['log'](a5_0x7e878b[_0x5069a2(0x14b)](_0x5069a2(0xda))),0x1;let _0x3d74ef=_0x5069a2(0x150);if(_0x89614[_0x5069a2(0x13f)])_0x3d74ef=_0x5069a2(0x13f);else{if(_0x89614['jsonl'])_0x3d74ef='jsonl';else{if(_0x89614[_0x5069a2(0xe7)])_0x3d74ef='tsv';else{if(_0x89614[_0x5069a2(0x150)])_0x3d74ef='table';}}}const _0x2d6470=_0x89614[_0x5069a2(0xf6)];let _0x1669af=_0x25ffa3;const _0xd709aa=a5_0x47a9b3[_0x5069a2(0xf0)](_0x25ffa3),_0x456f9b=_0x25ffa3==='.';if(!_0xd709aa||_0x456f9b){const _0x282fb9=resolveProjectFromContext(_0x25ffa3,_0x2d6470,{'requireFile':_0x5069a2(0xd5)});if(_0x282fb9[_0x5069a2(0x12c)])_0x1669af=_0x282fb9[_0x5069a2(0xd7)],_0x282fb9['source']===_0x5069a2(0x10f)&&console['log'](a5_0x7e878b[_0x5069a2(0x14d)](_0x5069a2(0xdb)+_0x1669af));else switch(_0x282fb9['reason']){case _0x5069a2(0x14f):console['log'](a5_0x7e878b['yellow'](_0x282fb9[_0x5069a2(0x11d)])),console[_0x5069a2(0x145)](),console[_0x5069a2(0x145)]('Usage:'),console[_0x5069a2(0x145)]('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console['log'](_0x5069a2(0xeb)),console['log'](),console[_0x5069a2(0x145)](_0x5069a2(0xe2));return 0x1;case _0x5069a2(0xf9):console[_0x5069a2(0x145)](a5_0x7e878b['yellow'](_0x282fb9['message'])),console[_0x5069a2(0x145)](),console[_0x5069a2(0x145)](_0x5069a2(0xfd)+_0x282fb9[_0x5069a2(0xf6)]+_0x5069a2(0x130));return 0x1;case'multiple_agents':{const _0x36946e=a5_0x3e4bf1[_0x5069a2(0xd1)](_0x282fb9[_0x5069a2(0xd7)]);console[_0x5069a2(0x145)](a5_0x7e878b[_0x5069a2(0x109)](_0x5069a2(0x159)+_0x282fb9[_0x5069a2(0xf6)]+'\x22:'));for(const _0x1383ee of _0x282fb9['agentDirs']){console[_0x5069a2(0x145)](_0x5069a2(0xfc)+_0x1383ee);}return console['log'](),console[_0x5069a2(0x145)](_0x5069a2(0x153)+_0x36946e+_0x5069a2(0x11a)),0x1;}case'no_tests':console[_0x5069a2(0x145)](a5_0x7e878b['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x282fb9[_0x5069a2(0xf6)]+'\x22.')),console[_0x5069a2(0x145)](a5_0x7e878b[_0x5069a2(0x14d)]('Project\x20path:\x20'+_0x282fb9[_0x5069a2(0xd7)])),console['log'](),console[_0x5069a2(0x145)](_0x5069a2(0x155));return 0x1;}}const {definition:_0x1200ae,agentInfo:_0x35eb01}=parseTestFile(_0x1669af);let _0xd41767=_0x1200ae[_0x5069a2(0x157)];if(_0x238928){const _0x123e09=_0x238928[_0x5069a2(0x141)](',')[_0x5069a2(0x146)](_0x5f3109=>_0x5f3109['trim']());_0xd41767=_0x1200ae['tests']['filter'](_0x49082a=>_0x123e09[_0x5069a2(0x122)](_0x49082a[_0x5069a2(0x10a)]));if(_0xd41767['length']===0x0)return console[_0x5069a2(0x145)](a5_0x7e878b['yellow']('No\x20tests\x20found\x20matching:\x20'+_0x238928)),console['log'](a5_0x7e878b[_0x5069a2(0x14d)]('Available\x20tests:\x20'+_0x1200ae[_0x5069a2(0x157)][_0x5069a2(0x146)](_0x4a0ade=>_0x4a0ade[_0x5069a2(0x10a)])[_0x5069a2(0x13a)](',\x20'))),0x1;}if(_0x3f508f){const _0x476798=_0x3f508f[_0x5069a2(0x141)](',')[_0x5069a2(0x146)](_0x585413=>_0x585413[_0x5069a2(0x14c)]()[_0x5069a2(0xe5)]());_0xd41767=_0xd41767[_0x5069a2(0xf7)](_0x4c6cad=>_0x4c6cad[_0x5069a2(0x12b)]?.[_0x5069a2(0x129)](_0xa82394=>_0x476798[_0x5069a2(0x122)](_0xa82394[_0x5069a2(0xe5)]())));if(_0xd41767['length']===0x0){console[_0x5069a2(0x145)](a5_0x7e878b[_0x5069a2(0x109)](_0x5069a2(0xfa)+_0x3f508f));const _0x2a666a=new Set();return _0x1200ae[_0x5069a2(0x157)][_0x5069a2(0x12a)](_0x5b1d29=>_0x5b1d29['tags']?.[_0x5069a2(0x12a)](_0x3715b9=>_0x2a666a[_0x5069a2(0xf5)](_0x3715b9))),_0x2a666a[_0x5069a2(0x166)]>0x0?console[_0x5069a2(0x145)](a5_0x7e878b[_0x5069a2(0x14d)]('Available\x20tags:\x20'+[..._0x2a666a]['join'](',\x20'))):console[_0x5069a2(0x145)](a5_0x7e878b[_0x5069a2(0x14d)](_0x5069a2(0xf1))),0x1;}}if(_0x3e6762)return this[_0x5069a2(0x105)](_0x7e6e65,{'definition':{'tests':_0xd41767},'agentInfo':_0x35eb01,'outputFormat':_0x3d74ef,'outputFile':_0x12fc12,'testNames':_0x238928});if(_0x40271a){console[_0x5069a2(0x145)](a5_0x7e878b['cyan'](_0x5069a2(0x161))),console['log'](_0x5069a2(0xee)+a5_0x7e878b[_0x5069a2(0xed)](_0x1fb7e0)),console[_0x5069a2(0x145)]('\x20\x20Project:\x20'+a5_0x7e878b[_0x5069a2(0xed)](_0x35eb01[_0x5069a2(0x13b)])),console['log'](_0x5069a2(0xe6)+a5_0x7e878b[_0x5069a2(0xed)](_0x35eb01[_0x5069a2(0x101)])),console[_0x5069a2(0x145)](),console[_0x5069a2(0x145)](_0x5069a2(0x108)+a5_0x7e878b['white'](_0xd41767[_0x5069a2(0x15d)]));for(let _0x1049f4=0x0;_0x1049f4<_0xd41767['length'];_0x1049f4++){const _0x21f99f=_0xd41767[_0x1049f4],_0x2d6589=_0x21f99f[_0x5069a2(0x104)]['length']===0x1?_0x5069a2(0xd4):_0x5069a2(0x104),_0x42c902=_0x21f99f[_0x5069a2(0x12b)]?.[_0x5069a2(0x15d)]?'\x20['+_0x21f99f['tags'][_0x5069a2(0x13a)](',\x20')+']':'';console[_0x5069a2(0x145)]('\x20\x20'+(_0x1049f4+0x1)+'.\x20'+a5_0x7e878b['white'](_0x21f99f[_0x5069a2(0x10a)])+'\x20('+_0x21f99f['rounds'][_0x5069a2(0x15d)]+'\x20'+_0x2d6589+')'+a5_0x7e878b[_0x5069a2(0x14d)](_0x42c902));}return 0x0;}let _0x2050f2,_0x3b3b9d;try{_0x2050f2=await _0x574954['llm'][_0x5069a2(0x113)](_0x35eb01[_0x5069a2(0x13b)]);}catch(_0xfd5967){const _0x470f95=_0xfd5967 instanceof Error?_0xfd5967[_0x5069a2(0x11d)]:String(_0xfd5967);return _0x470f95[_0x5069a2(0x122)]('404')||_0x470f95[_0x5069a2(0xe5)]()[_0x5069a2(0x122)](_0x5069a2(0xf8))?console['log'](a5_0x7e878b[_0x5069a2(0x14b)](_0x5069a2(0x154)+_0x35eb01[_0x5069a2(0x13b)])):console[_0x5069a2(0x145)](a5_0x7e878b[_0x5069a2(0x14b)](_0x5069a2(0x134)+_0x35eb01['projectName']+_0x5069a2(0x11f)+_0x470f95)),0x1;}try{_0x3b3b9d=await _0x574954[_0x5069a2(0x156)][_0x5069a2(0xdd)](_0x35eb01['agentName'],_0x2050f2);}catch(_0x5d2fe8){const _0x3e2713=_0x5d2fe8 instanceof Error?_0x5d2fe8['message']:String(_0x5d2fe8);return _0x3e2713['includes'](_0x5069a2(0x136))||_0x3e2713['toLowerCase']()[_0x5069a2(0x122)](_0x5069a2(0xf8))?console[_0x5069a2(0x145)](a5_0x7e878b[_0x5069a2(0x14b)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x35eb01['agentName'])):console[_0x5069a2(0x145)](a5_0x7e878b[_0x5069a2(0x14b)](_0x5069a2(0x119)+_0x35eb01[_0x5069a2(0x101)]+_0x5069a2(0x11f)+_0x3e2713)),0x1;}let _0x24a523;if(!_0x491a90)try{_0x24a523=await setupEvaluatorAgent(_0x574954[_0x5069a2(0x156)],_0x268c7a[_0x5069a2(0x128)]);}catch(_0x3e1d62){const _0x1dd66d=_0x3e1d62 instanceof Error?_0x3e1d62[_0x5069a2(0x11d)]:String(_0x3e1d62);return console[_0x5069a2(0x145)](a5_0x7e878b[_0x5069a2(0x14b)](_0x5069a2(0xf2)+_0x1dd66d)),0x1;}console[_0x5069a2(0x145)](a5_0x7e878b[_0x5069a2(0x15f)](_0x5069a2(0x158))),console[_0x5069a2(0x145)](_0x5069a2(0x106)+a5_0x7e878b['white'](_0x1fb7e0)),console[_0x5069a2(0x145)](_0x5069a2(0x143)+a5_0x7e878b[_0x5069a2(0xed)](_0x35eb01[_0x5069a2(0x13b)]+'/'+_0x35eb01['agentName'])),console[_0x5069a2(0x145)]();const _0x24a516=[],_0x3cc0bd=[],_0xfb479f=Date[_0x5069a2(0xcf)]();for(let _0x15364b=0x0;_0x15364b<_0xd41767[_0x5069a2(0x15d)];_0x15364b++){const _0xe3eb7b=_0xd41767[_0x15364b];_0xd41767[_0x5069a2(0x15d)]>0x1?console[_0x5069a2(0x145)](_0x5069a2(0xd2)+(_0x15364b+0x1)+'/'+_0xd41767['length']+':\x20'+a5_0x7e878b['white'](_0xe3eb7b[_0x5069a2(0x10a)])):console[_0x5069a2(0x145)](_0x5069a2(0x151)+a5_0x7e878b['white'](_0xe3eb7b[_0x5069a2(0x10a)]));const _0x493c2f=createCommandSpinner(_0x5069a2(0x160)+_0xe3eb7b['rounds']['length']+_0x5069a2(0x13c));_0x493c2f['start']();try{const {result:_0x5af53d,conversation:_0x4dfd23}=await runTest(_0x574954['llm'],_0xe3eb7b,{'agentId':_0x3b3b9d,'projectId':_0x2050f2,'site':_0x1fb7e0,'noEval':_0x491a90,'evaluatorId':_0x24a523,'onRoundStart':(_0x1f56e5,_0x5a6b12)=>{const _0x2f1c0b=_0x5069a2;_0x493c2f[_0x2f1c0b(0x116)]=_0x2f1c0b(0x167)+(_0x1f56e5+0x1)+'/'+_0x5a6b12+_0x2f1c0b(0x13c);},'onRoundComplete':(_0x1d1f3f,_0x3795be,_0x218066)=>{const _0x55fe75=_0x5069a2,_0x3ae3ae=formatElapsed(_0x3795be);_0x218066?console[_0x55fe75(0x145)](_0x55fe75(0x110)+(_0x1d1f3f+0x1)+'/'+_0xe3eb7b[_0x55fe75(0x104)]['length']+_0x55fe75(0xfb)+a5_0x7e878b[_0x55fe75(0x125)]('✓')+'\x20('+_0x3ae3ae+')'):console[_0x55fe75(0x145)]('\x20\x20Round\x20'+(_0x1d1f3f+0x1)+'/'+_0xe3eb7b[_0x55fe75(0x104)][_0x55fe75(0x15d)]+'...\x20'+a5_0x7e878b[_0x55fe75(0x14b)]('✗'));},'onEvaluationStart':()=>{const _0x3ce990=_0x5069a2;_0x493c2f[_0x3ce990(0x116)]='Evaluating\x20response...';},'onEvaluationComplete':_0x13bf94=>{const _0x11205c=_0x5069a2,_0x3c8135=formatElapsed(_0x13bf94);console[_0x11205c(0x145)](_0x11205c(0x111)+a5_0x7e878b[_0x11205c(0x125)]('✓')+'\x20('+_0x3c8135+')');}});_0x493c2f['stop'](),_0x24a516[_0x5069a2(0x118)](_0x5af53d),_0x3cc0bd[_0x5069a2(0x118)](_0x4dfd23);if(_0x5af53d[_0x5069a2(0xef)]===_0x5069a2(0xde))console[_0x5069a2(0x145)](a5_0x7e878b[_0x5069a2(0x125)](_0x5069a2(0xe1)+_0x5af53d[_0x5069a2(0xd9)]));else _0x5af53d[_0x5069a2(0xef)]===_0x5069a2(0x15e)?console[_0x5069a2(0x145)](a5_0x7e878b['red']('✗\x20FAIL:\x20'+_0x5af53d[_0x5069a2(0xd9)])):console[_0x5069a2(0x145)](a5_0x7e878b[_0x5069a2(0x14b)](_0x5069a2(0x144)+_0x5af53d[_0x5069a2(0xd9)]));_0x5af53d[_0x5069a2(0x10c)]&&console[_0x5069a2(0x145)](a5_0x7e878b[_0x5069a2(0x14d)]('Conversation\x20URL:\x20'+_0x5af53d[_0x5069a2(0x10c)])),console[_0x5069a2(0x145)]();}catch(_0x30efa0){_0x493c2f['stop']();const _0x215606=_0x30efa0 instanceof Error?_0x30efa0[_0x5069a2(0x11d)]:String(_0x30efa0);console['log'](a5_0x7e878b[_0x5069a2(0x14b)](_0x5069a2(0x144)+_0x215606)),console[_0x5069a2(0x145)](),_0x24a516[_0x5069a2(0x118)]({'name':_0xe3eb7b[_0x5069a2(0x10a)],'status':_0x5069a2(0x123),'reason':_0x215606,'timestamp':new Date()[_0x5069a2(0x132)](),'duration_ms':0x0});}}const _0x10bc1f=Date[_0x5069a2(0xcf)]()-_0xfb479f,_0x27736b=_0x24a516['filter'](_0x18dec0=>_0x18dec0['status']===_0x5069a2(0xde))[_0x5069a2(0x15d)],_0x4ef7f6=_0x24a516[_0x5069a2(0xf7)](_0x4a5132=>_0x4a5132[_0x5069a2(0xef)]===_0x5069a2(0x15e))['length'],_0x31025a=_0x24a516[_0x5069a2(0xf7)](_0x4a6762=>_0x4a6762[_0x5069a2(0xef)]==='ERROR')[_0x5069a2(0x15d)];console[_0x5069a2(0x145)]('━'[_0x5069a2(0xec)](0x3c)),console[_0x5069a2(0x145)](_0x5069a2(0xd0)),console['log']('━'['repeat'](0x3c)),console[_0x5069a2(0x145)]('Total:\x20\x20\x20\x20'+_0x24a516[_0x5069a2(0x15d)]),console['log'](_0x5069a2(0x121)+a5_0x7e878b['green'](_0x27736b)),console[_0x5069a2(0x145)](_0x5069a2(0x11c)+a5_0x7e878b[_0x5069a2(0x14b)](_0x4ef7f6));_0x31025a>0x0&&console[_0x5069a2(0x145)](_0x5069a2(0x127)+a5_0x7e878b['red'](_0x31025a));console[_0x5069a2(0x145)](_0x5069a2(0xea)+formatElapsed(_0x10bc1f)),console[_0x5069a2(0x145)]('━'[_0x5069a2(0xec)](0x3c));const _0x311fff=_0x24a516['filter'](_0x5b59df=>_0x5b59df[_0x5069a2(0xef)]!=='PASS');if(_0x311fff[_0x5069a2(0x15d)]>0x0){console[_0x5069a2(0x145)](),console[_0x5069a2(0x145)](_0x5069a2(0x12f));for(const _0x117a2e of _0x311fff){const _0x25f60a=a5_0x7e878b[_0x5069a2(0x14b)]('✗'),_0x430e28=_0x117a2e[_0x5069a2(0xd9)][_0x5069a2(0x15d)]>0x32?_0x117a2e[_0x5069a2(0xd9)]['substring'](0x0,0x32)+_0x5069a2(0x14e):_0x117a2e[_0x5069a2(0xd9)];console['log']('\x20\x20'+_0x25f60a+'\x20'+_0x117a2e[_0x5069a2(0x10a)]+':\x20'+_0x430e28);}}const _0x437e9d={'summary':{'total':_0x24a516[_0x5069a2(0x15d)],'passed':_0x27736b,'failed':_0x4ef7f6,'errors':_0x31025a>0x0?_0x31025a:undefined,'duration_ms':_0x10bc1f},'tests':_0x24a516,'agent':{'project':_0x35eb01['projectName'],'name':_0x35eb01[_0x5069a2(0x101)],'site':_0x1fb7e0},'timestamp':new Date(_0xfb479f)['toISOString']()};try{const _0x483507=buildCachedTestRun(_0x3cc0bd,{'site':_0x1fb7e0,'projectId':_0x2050f2,'projectName':_0x35eb01[_0x5069a2(0x13b)],'agentId':_0x3b3b9d,'agentName':_0x35eb01[_0x5069a2(0x101)],'testYmlPath':a5_0x3e4bf1['resolve'](_0x35eb01[_0x5069a2(0xe4)])});saveLastTestRun(_0x483507);}catch{}if(_0x3d74ef!=='table'||_0x12fc12){const _0x5e7381=formatResults(_0x437e9d,_0x3d74ef);if(_0x12fc12)try{a5_0x47a9b3[_0x5069a2(0x12d)](_0x12fc12,_0x5e7381,_0x5069a2(0x120)),console[_0x5069a2(0x145)](),console[_0x5069a2(0x145)](a5_0x7e878b[_0x5069a2(0x14d)](_0x5069a2(0x138)+_0x12fc12));}catch(_0x22f3cc){return console[_0x5069a2(0x145)](),console[_0x5069a2(0x145)](a5_0x7e878b['red'](_0x5069a2(0x117)+_0x22f3cc)),0x1;}else console['log'](),console[_0x5069a2(0x145)](_0x5e7381);}return _0x311fff[_0x5069a2(0x15d)]>0x0?0x1:0x0;}async[a5_0x519acd(0x105)](_0x17305a,_0x1ce7fa){const _0x2e23b4=a5_0x519acd,{options:_0x5a848e,tdx:_0x463f9b}=_0x17305a,{definition:_0x31fe9e,agentInfo:_0x25856c,outputFormat:_0x21c6d1,outputFile:_0x4303f9}=_0x1ce7fa,_0x5281f9=_0x5a848e[_0x2e23b4(0x164)],_0x3bbb4b=loadLastTestRun();if(!_0x3bbb4b)return console[_0x2e23b4(0x145)](a5_0x7e878b[_0x2e23b4(0x14b)](_0x2e23b4(0x165))),console[_0x2e23b4(0x145)](a5_0x7e878b[_0x2e23b4(0x14d)](_0x2e23b4(0x13e))),0x1;if(_0x3bbb4b[_0x2e23b4(0x103)][_0x2e23b4(0x101)]!==_0x25856c['agentName'])return console[_0x2e23b4(0x145)](a5_0x7e878b['red'](_0x2e23b4(0xf4)+_0x3bbb4b[_0x2e23b4(0x103)][_0x2e23b4(0x101)]+_0x2e23b4(0x124)+_0x25856c[_0x2e23b4(0x101)]+'\x22.')),console['log'](a5_0x7e878b[_0x2e23b4(0x14d)](_0x2e23b4(0x131))),0x1;const _0x949ac9=new Set(_0x3bbb4b['conversations'][_0x2e23b4(0x146)](_0x264eb0=>_0x264eb0[_0x2e23b4(0xd6)])),_0xbd934c=_0x31fe9e[_0x2e23b4(0x157)]['filter'](_0x53a7cd=>!_0x949ac9[_0x2e23b4(0x100)](_0x53a7cd[_0x2e23b4(0x10a)]));if(_0xbd934c[_0x2e23b4(0x15d)]>0x0&&_0x3bbb4b[_0x2e23b4(0x164)]!==_0x5281f9)return console[_0x2e23b4(0x145)](a5_0x7e878b['red']('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x2e23b4(0x145)](a5_0x7e878b[_0x2e23b4(0x14d)](_0x2e23b4(0x15c)+_0x3bbb4b[_0x2e23b4(0x164)]+_0x2e23b4(0xd8)+_0x5281f9+'\x22.')),console[_0x2e23b4(0x145)](a5_0x7e878b[_0x2e23b4(0x14d)](_0x2e23b4(0x15b)+_0x3bbb4b[_0x2e23b4(0x164)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x1c412a=_0x31fe9e[_0x2e23b4(0x157)][_0x2e23b4(0xf7)](_0x433eaa=>_0x949ac9[_0x2e23b4(0x100)](_0x433eaa[_0x2e23b4(0x10a)])),_0x35b2ff=_0xbd934c;let _0x254b11;try{_0x254b11=await setupEvaluatorAgent(_0x463f9b[_0x2e23b4(0x156)],_0x5a848e[_0x2e23b4(0x128)]);}catch(_0x18abff){const _0x45bd8d=_0x18abff instanceof Error?_0x18abff[_0x2e23b4(0x11d)]:String(_0x18abff);return console[_0x2e23b4(0x145)](a5_0x7e878b[_0x2e23b4(0x14b)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x45bd8d)),0x1;}console[_0x2e23b4(0x145)](a5_0x7e878b[_0x2e23b4(0x15f)](_0x2e23b4(0x10b))),console['log'](_0x2e23b4(0xdc)+a5_0x7e878b[_0x2e23b4(0xed)](_0x3bbb4b[_0x2e23b4(0x137)])),console[_0x2e23b4(0x145)](_0x2e23b4(0x143)+a5_0x7e878b[_0x2e23b4(0xed)](_0x3bbb4b[_0x2e23b4(0x103)][_0x2e23b4(0x13b)]+'/'+_0x3bbb4b[_0x2e23b4(0x103)][_0x2e23b4(0x101)]));_0x35b2ff[_0x2e23b4(0x15d)]>0x0&&console['log'](_0x2e23b4(0x11e)+a5_0x7e878b[_0x2e23b4(0x109)](_0x35b2ff[_0x2e23b4(0x15d)]));console[_0x2e23b4(0x145)]();const _0x55fa16=[],_0x2611ce=Date[_0x2e23b4(0xcf)](),_0x14dc52=createCommandSpinner(_0x2e23b4(0x133));if(_0x1c412a[_0x2e23b4(0x15d)]>0x0)try{const _0xd00a1e=await reevaluateFromCache(_0x463f9b[_0x2e23b4(0x156)],_0x3bbb4b,{'tests':_0x1c412a},{'evaluatorId':_0x254b11,'onTestStart':(_0x287278,_0x546a27,_0xc478a1)=>{const _0x22148f=_0x2e23b4;_0x14dc52[_0x22148f(0x116)]=_0x22148f(0xf3)+(_0x546a27+0x1)+'/'+_0xc478a1+':\x20'+_0x287278+_0x22148f(0x14e);if(!_0x14dc52[_0x22148f(0x10d)])_0x14dc52['start']();},'onTestComplete':(_0x3b588e,_0x4c4428)=>{const _0x452495=_0x2e23b4;_0x14dc52['stop']();if(_0x4c4428['status']===_0x452495(0xde))console[_0x452495(0x145)](a5_0x7e878b[_0x452495(0x125)]('✓\x20PASS:\x20'+_0x3b588e)+a5_0x7e878b[_0x452495(0x14d)](_0x452495(0x112)));else _0x4c4428[_0x452495(0xef)]===_0x452495(0x15e)?console[_0x452495(0x145)](a5_0x7e878b['red'](_0x452495(0xe0)+_0x3b588e+_0x452495(0x11b)+_0x4c4428[_0x452495(0xd9)])+a5_0x7e878b['dim'](_0x452495(0x112))):console[_0x452495(0x145)](a5_0x7e878b[_0x452495(0x14b)]('✗\x20ERROR:\x20'+_0x3b588e+_0x452495(0x11b)+_0x4c4428[_0x452495(0xd9)]));_0x4c4428[_0x452495(0x10c)]&&console[_0x452495(0x145)](a5_0x7e878b[_0x452495(0x14d)]('\x20\x20Conversation:\x20'+_0x4c4428[_0x452495(0x10c)])),_0x55fa16[_0x452495(0x118)](_0x4c4428);},'onTestSkipped':(_0x39a4d4,_0xd005eb)=>{const _0x1b48c9=_0x2e23b4;_0x14dc52[_0x1b48c9(0x135)](),console[_0x1b48c9(0x145)](a5_0x7e878b[_0x1b48c9(0x109)](_0x1b48c9(0xdf)+_0x39a4d4+'\x20-\x20'+_0xd005eb));}});for(const _0x3159ad of _0xd00a1e){!_0x55fa16[_0x2e23b4(0x13d)](_0xdb6454=>_0xdb6454[_0x2e23b4(0x10a)]===_0x3159ad[_0x2e23b4(0x10a)])&&_0x55fa16[_0x2e23b4(0x118)](_0x3159ad);}}catch(_0x13a2c2){_0x14dc52[_0x2e23b4(0x135)]();const _0x33df5d=_0x13a2c2 instanceof Error?_0x13a2c2[_0x2e23b4(0x11d)]:String(_0x13a2c2);return console['log'](a5_0x7e878b[_0x2e23b4(0x14b)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x33df5d)),0x1;}_0x14dc52[_0x2e23b4(0x135)]();if(_0x35b2ff['length']>0x0){console[_0x2e23b4(0x145)](),console['log'](a5_0x7e878b[_0x2e23b4(0x15f)](_0x2e23b4(0x148)));const {projectId:_0x2b09b3,agentId:_0x28caf5}=_0x3bbb4b['agent'];for(const _0x4880e7 of _0x35b2ff){console[_0x2e23b4(0x145)]('Running:\x20'+a5_0x7e878b[_0x2e23b4(0xed)](_0x4880e7['name']));const _0x1bb704=createCommandSpinner(_0x2e23b4(0x160)+_0x4880e7[_0x2e23b4(0x104)][_0x2e23b4(0x15d)]+_0x2e23b4(0x13c));_0x1bb704[_0x2e23b4(0xfe)]();try{const {result:_0x19b922}=await runTest(_0x463f9b[_0x2e23b4(0x156)],_0x4880e7,{'agentId':_0x28caf5,'projectId':_0x2b09b3,'site':_0x3bbb4b[_0x2e23b4(0x164)],'noEval':![],'evaluatorId':_0x254b11,'onRoundStart':(_0x429ff3,_0x2094f9)=>{const _0x500011=_0x2e23b4;_0x1bb704[_0x500011(0x116)]=_0x500011(0x167)+(_0x429ff3+0x1)+'/'+_0x2094f9+_0x500011(0x13c);},'onRoundComplete':(_0x27ffd2,_0x45c1d0,_0x17c373)=>{const _0x2c8055=_0x2e23b4,_0x47192f=formatElapsed(_0x45c1d0);_0x17c373?console['log'](_0x2c8055(0x110)+(_0x27ffd2+0x1)+'/'+_0x4880e7[_0x2c8055(0x104)][_0x2c8055(0x15d)]+_0x2c8055(0xfb)+a5_0x7e878b['green']('✓')+'\x20('+_0x47192f+')'):console[_0x2c8055(0x145)](_0x2c8055(0x110)+(_0x27ffd2+0x1)+'/'+_0x4880e7[_0x2c8055(0x104)][_0x2c8055(0x15d)]+_0x2c8055(0xfb)+a5_0x7e878b[_0x2c8055(0x14b)]('✗'));},'onEvaluationStart':()=>{const _0x4d506c=_0x2e23b4;_0x1bb704[_0x4d506c(0x116)]=_0x4d506c(0x152);},'onEvaluationComplete':_0x49e9bc=>{const _0x51792f=_0x2e23b4,_0x88f344=formatElapsed(_0x49e9bc);console[_0x51792f(0x145)]('\x20\x20Evaluating...\x20'+a5_0x7e878b[_0x51792f(0x125)]('✓')+'\x20('+_0x88f344+')');}});_0x1bb704[_0x2e23b4(0x135)](),_0x55fa16[_0x2e23b4(0x118)](_0x19b922);if(_0x19b922[_0x2e23b4(0xef)]==='PASS')console['log'](a5_0x7e878b[_0x2e23b4(0x125)](_0x2e23b4(0xe1)+_0x19b922[_0x2e23b4(0xd9)])+a5_0x7e878b['dim'](_0x2e23b4(0x114)));else _0x19b922[_0x2e23b4(0xef)]==='FAIL'?console['log'](a5_0x7e878b['red'](_0x2e23b4(0xe0)+_0x19b922[_0x2e23b4(0xd9)])+a5_0x7e878b['dim']('\x20(new)')):console['log'](a5_0x7e878b[_0x2e23b4(0x14b)](_0x2e23b4(0x144)+_0x19b922['reason']));_0x19b922['conversation_url']&&console['log'](a5_0x7e878b['dim'](_0x2e23b4(0xe8)+_0x19b922[_0x2e23b4(0x10c)]));}catch(_0x27a62b){_0x1bb704[_0x2e23b4(0x135)]();const _0x5dee31=_0x27a62b instanceof Error?_0x27a62b[_0x2e23b4(0x11d)]:String(_0x27a62b);console[_0x2e23b4(0x145)](a5_0x7e878b[_0x2e23b4(0x14b)](_0x2e23b4(0x144)+_0x5dee31)),_0x55fa16[_0x2e23b4(0x118)]({'name':_0x4880e7[_0x2e23b4(0x10a)],'status':_0x2e23b4(0x123),'reason':_0x5dee31,'timestamp':new Date()[_0x2e23b4(0x132)](),'duration_ms':0x0});}}}console[_0x2e23b4(0x145)]();const _0x14855d=Date[_0x2e23b4(0xcf)]()-_0x2611ce,_0x3da338=_0x55fa16[_0x2e23b4(0xf7)](_0x29b148=>_0x29b148[_0x2e23b4(0xef)]===_0x2e23b4(0xde))['length'],_0x31b0d7=_0x55fa16['filter'](_0x5e5f71=>_0x5e5f71[_0x2e23b4(0xef)]===_0x2e23b4(0x15e))[_0x2e23b4(0x15d)],_0x5063d2=_0x55fa16[_0x2e23b4(0xf7)](_0x24d25c=>_0x24d25c['status']==='ERROR')['length'];console[_0x2e23b4(0x145)]('━'[_0x2e23b4(0xec)](0x3c)),console[_0x2e23b4(0x145)](_0x2e23b4(0x139)),console[_0x2e23b4(0x145)]('━'[_0x2e23b4(0xec)](0x3c)),console[_0x2e23b4(0x145)](_0x2e23b4(0x14a)+_0x55fa16['length']),console[_0x2e23b4(0x145)](_0x2e23b4(0x121)+a5_0x7e878b['green'](_0x3da338)),console[_0x2e23b4(0x145)]('Failed:\x20\x20\x20'+a5_0x7e878b[_0x2e23b4(0x14b)](_0x31b0d7));_0x5063d2>0x0&&console[_0x2e23b4(0x145)]('Errors:\x20\x20\x20'+a5_0x7e878b[_0x2e23b4(0x14b)](_0x5063d2));console[_0x2e23b4(0x145)](_0x2e23b4(0xea)+formatElapsed(_0x14855d)),console[_0x2e23b4(0x145)]('━'[_0x2e23b4(0xec)](0x3c));const _0x282692={'summary':{'total':_0x55fa16[_0x2e23b4(0x15d)],'passed':_0x3da338,'failed':_0x31b0d7,'errors':_0x5063d2>0x0?_0x5063d2:undefined,'duration_ms':_0x14855d},'tests':_0x55fa16,'agent':{'project':_0x25856c[_0x2e23b4(0x13b)],'name':_0x25856c[_0x2e23b4(0x101)],'site':_0x5281f9},'timestamp':new Date(_0x2611ce)['toISOString']()};if(_0x21c6d1!=='table'||_0x4303f9){const _0x1fbb0f=formatResults(_0x282692,_0x21c6d1);if(_0x4303f9)try{a5_0x47a9b3[_0x2e23b4(0x12d)](_0x4303f9,_0x1fbb0f,_0x2e23b4(0x120)),console[_0x2e23b4(0x145)](),console[_0x2e23b4(0x145)](a5_0x7e878b[_0x2e23b4(0x14d)](_0x2e23b4(0x138)+_0x4303f9));}catch(_0x5bd274){return console[_0x2e23b4(0x145)](),console['log'](a5_0x7e878b[_0x2e23b4(0x14b)](_0x2e23b4(0x117)+_0x5bd274)),0x1;}else console['log'](),console['log'](_0x1fbb0f);}const _0x2703e5=_0x55fa16[_0x2e23b4(0xf7)](_0x5453c7=>_0x5453c7[_0x2e23b4(0xef)]!==_0x2e23b4(0xde));return _0x2703e5[_0x2e23b4(0x15d)]>0x0?0x1:0x0;}}
1
+ const a5_0x3e5468=a5_0xa540;(function(_0x2c07f6,_0x52a4b7){const _0xc6924=a5_0xa540,_0x41ff59=_0x2c07f6();while(!![]){try{const _0x5abad9=parseInt(_0xc6924(0x211))/0x1+-parseInt(_0xc6924(0x22f))/0x2*(-parseInt(_0xc6924(0x1f9))/0x3)+-parseInt(_0xc6924(0x203))/0x4+parseInt(_0xc6924(0x1cc))/0x5+-parseInt(_0xc6924(0x234))/0x6+-parseInt(_0xc6924(0x225))/0x7+parseInt(_0xc6924(0x202))/0x8;if(_0x5abad9===_0x52a4b7)break;else _0x41ff59['push'](_0x41ff59['shift']());}catch(_0x344cc8){_0x41ff59['push'](_0x41ff59['shift']());}}}(a5_0xdde3,0xb1fe3));import*as a5_0x61f3f8 from'node:fs';import*as a5_0x2ddc07 from'node:path';function a5_0xa540(_0x4e0a7f,_0x503f16){_0x4e0a7f=_0x4e0a7f-0x1a9;const _0xdde3c3=a5_0xdde3();let _0xa54003=_0xdde3c3[_0x4e0a7f];return _0xa54003;}import a5_0x1ae528 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';function a5_0xdde3(){const _0xe8db2e=['Re-evaluating...','green','404','9785132hrYRIF','multiple_agents','tsv','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','\x20(new)','rounds','tags','Usage:','Passed:\x20\x20\x20','51478qvycwK','message','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','No\x20tests\x20found\x20with\x20tags:\x20','white','348066NJFwWs','llmProject','...','log','includes','Run\x20tests\x20for\x20an\x20LLM\x20agent','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','stop','✗\x20ERROR:\x20Project\x20not\x20found:\x20','✗\x20FAIL:\x20','start','not\x20found','\x20(cached)','Running:\x20','join','round','executeReeval','ERROR','no_context','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','⚠\x20SKIPPED:\x20','Running\x20agent\x20tests...','Cached\x20run\x20from:\x20','toISOString','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','toLowerCase','substring','Re-evaluating\x20cached\x20test\x20run...',':\x20Sending\x20user\x20input...','New\x20tests\x20to\x20execute:\x20','Tests\x20found:\x20','\x22:\x20','reason','timestamp','jsonl','\x20\x20Project:\x20','Duration:\x20','Evaluating\x20response...','testYmlPath','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Output\x20written\x20to:\x20','FAIL','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','writeFileSync','✗\x20ERROR:\x20','text','852325AFLykt','length','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','status','testName','red','Failed:\x20\x20\x20','push','Agent:\x20','✓\x20PASS:\x20','dryRun','\x20\x20Evaluating...\x20','Executing\x20new\x20tests...','Available\x20tests:\x20','projectDir','/<agent-name>','execute','Round\x20','Round\x201/','No\x20tests\x20have\x20tags\x20defined.','projectName','Available\x20tags:\x20','context','\x22,\x20but\x20current\x20site\x20is\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','table','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','some','name','output','filter','llm','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','cyan','test.yml','PASS','resolveProjectId','source','\x20\x20Round\x20','\x20\x20Site:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','\x20\x20Conversation:\x20','conversations','now','102wuGjqX','\x20\x20-\x20','Re-evaluation\x20Summary','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','yellow','Site:\x20','forEach','dim','trim','8644928aWiDhH','565036PiIgFr','...\x20','repeat','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Total:\x20\x20\x20\x20','eval','Test\x20Summary','found','Error\x20writing\x20output\x20file:\x20','isSpinning','reeval','Test\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','map','199998tiKyuo','agent','no_tests','has','\x20-\x20','site','Either\x20switch\x20to\x20the\x20\x22','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','agentDirs','split','\x20\x20Agent:\x20','conversation_url','verbose','utf-8','tests','Conversation\x20URL:\x20','agentName'];a5_0xdde3=function(){return _0xe8db2e;};return a5_0xdde3();}export class AgentTestCommand extends BaseCommand{[a5_0x3e5468(0x1e9)]='agent:test';['description']=a5_0x3e5468(0x239);async[a5_0x3e5468(0x1dd)](_0x81b9b5){const _0x9f3741=a5_0x3e5468,{options:_0x8c886f,args:_0x4b8353,tdx:_0x14169c}=_0x81b9b5,_0x53fc85=_0x4b8353[0x0]||'.',_0x2f8aad=_0x8c886f[_0x9f3741(0x1d7)],_0x362e1c=_0x8c886f,_0x397ed0=_0x362e1c[_0x9f3741(0x208)]===![],_0x2bdeb3=_0x362e1c[_0x9f3741(0x20d)],_0x7107e2=_0x362e1c['name'],_0x3efbd4=_0x362e1c[_0x9f3741(0x22c)],_0x1940df=_0x8c886f['site'],_0x5df971=_0x362e1c[_0x9f3741(0x1ea)];if(_0x2bdeb3&&_0x397ed0)return console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x1d2)](_0x9f3741(0x1e7))),0x1;let _0x47efa2=_0x9f3741(0x1e6);if(_0x362e1c['json'])_0x47efa2='json';else{if(_0x362e1c['jsonl'])_0x47efa2=_0x9f3741(0x1c0);else{if(_0x362e1c[_0x9f3741(0x227)])_0x47efa2=_0x9f3741(0x227);else{if(_0x362e1c[_0x9f3741(0x1e6)])_0x47efa2=_0x9f3741(0x1e6);}}}const _0x27da61=_0x362e1c[_0x9f3741(0x235)];let _0x585284=_0x53fc85;const _0x5da5f6=a5_0x61f3f8['existsSync'](_0x53fc85),_0x111615=_0x53fc85==='.';if(!_0x5da5f6||_0x111615){const _0x3446ba=resolveProjectFromContext(_0x53fc85,_0x27da61,{'requireFile':_0x9f3741(0x1ef)});if(_0x3446ba[_0x9f3741(0x20a)])_0x585284=_0x3446ba['projectDir'],_0x3446ba[_0x9f3741(0x1f2)]===_0x9f3741(0x1e3)&&console['log'](a5_0x1ae528[_0x9f3741(0x200)]('Using\x20agent:\x20'+_0x585284));else switch(_0x3446ba[_0x9f3741(0x1be)]){case _0x9f3741(0x1b0):console['log'](a5_0x1ae528[_0x9f3741(0x1fd)](_0x3446ba[_0x9f3741(0x230)])),console[_0x9f3741(0x237)](),console[_0x9f3741(0x237)](_0x9f3741(0x22d)),console[_0x9f3741(0x237)](_0x9f3741(0x218)),console[_0x9f3741(0x237)](_0x9f3741(0x1ed)),console[_0x9f3741(0x237)](),console[_0x9f3741(0x237)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case'no_local_folder':console['log'](a5_0x1ae528[_0x9f3741(0x1fd)](_0x3446ba[_0x9f3741(0x230)])),console[_0x9f3741(0x237)](),console[_0x9f3741(0x237)](_0x9f3741(0x1f5)+_0x3446ba[_0x9f3741(0x235)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x9f3741(0x226):{const _0x3aa2d6=a5_0x2ddc07['basename'](_0x3446ba['projectDir']);console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x1fd)](_0x9f3741(0x206)+_0x3446ba[_0x9f3741(0x235)]+'\x22:'));for(const _0x54ef64 of _0x3446ba[_0x9f3741(0x219)]){console[_0x9f3741(0x237)](_0x9f3741(0x1fa)+_0x54ef64);}return console[_0x9f3741(0x237)](),console['log'](_0x9f3741(0x228)+_0x3aa2d6+_0x9f3741(0x1dc)),0x1;}case _0x9f3741(0x213):console[_0x9f3741(0x237)](a5_0x1ae528['yellow'](_0x9f3741(0x23a)+_0x3446ba['llmProject']+'\x22.')),console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x200)]('Project\x20path:\x20'+_0x3446ba[_0x9f3741(0x1db)])),console[_0x9f3741(0x237)](),console[_0x9f3741(0x237)](_0x9f3741(0x1c5));return 0x1;}}const {definition:_0x340eef,agentInfo:_0x4b916c}=parseTestFile(_0x585284);let _0x33f218=_0x340eef[_0x9f3741(0x21f)];if(_0x7107e2){const _0x3263b0=_0x7107e2['split'](',')['map'](_0x5f2d48=>_0x5f2d48[_0x9f3741(0x201)]());_0x33f218=_0x340eef['tests'][_0x9f3741(0x1eb)](_0x3840d3=>_0x3263b0[_0x9f3741(0x238)](_0x3840d3[_0x9f3741(0x1e9)]));if(_0x33f218[_0x9f3741(0x1cd)]===0x0)return console['log'](a5_0x1ae528['yellow']('No\x20tests\x20found\x20matching:\x20'+_0x7107e2)),console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x200)](_0x9f3741(0x1da)+_0x340eef[_0x9f3741(0x21f)][_0x9f3741(0x210)](_0x40d5d2=>_0x40d5d2[_0x9f3741(0x1e9)])[_0x9f3741(0x1ac)](',\x20'))),0x1;}if(_0x3efbd4){const _0x254ce0=_0x3efbd4[_0x9f3741(0x21a)](',')[_0x9f3741(0x210)](_0x5aee6a=>_0x5aee6a[_0x9f3741(0x201)]()[_0x9f3741(0x1b7)]());_0x33f218=_0x33f218[_0x9f3741(0x1eb)](_0x165285=>_0x165285[_0x9f3741(0x22c)]?.[_0x9f3741(0x1e8)](_0x1d0461=>_0x254ce0['includes'](_0x1d0461[_0x9f3741(0x1b7)]())));if(_0x33f218[_0x9f3741(0x1cd)]===0x0){console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x1fd)](_0x9f3741(0x232)+_0x3efbd4));const _0x12ed79=new Set();return _0x340eef['tests']['forEach'](_0x3dec32=>_0x3dec32[_0x9f3741(0x22c)]?.[_0x9f3741(0x1ff)](_0x34b370=>_0x12ed79['add'](_0x34b370))),_0x12ed79['size']>0x0?console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x200)](_0x9f3741(0x1e2)+[..._0x12ed79][_0x9f3741(0x1ac)](',\x20'))):console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x200)](_0x9f3741(0x1e0))),0x1;}}if(_0x2bdeb3)return this[_0x9f3741(0x1ae)](_0x81b9b5,{'definition':{'tests':_0x33f218},'agentInfo':_0x4b916c,'outputFormat':_0x47efa2,'outputFile':_0x5df971,'testNames':_0x7107e2});if(_0x2f8aad){console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x1ee)]('Test\x20Configuration:')),console[_0x9f3741(0x237)](_0x9f3741(0x1f4)+a5_0x1ae528[_0x9f3741(0x233)](_0x1940df)),console[_0x9f3741(0x237)](_0x9f3741(0x1c1)+a5_0x1ae528[_0x9f3741(0x233)](_0x4b916c['projectName'])),console['log'](_0x9f3741(0x21b)+a5_0x1ae528['white'](_0x4b916c[_0x9f3741(0x221)])),console[_0x9f3741(0x237)](),console[_0x9f3741(0x237)](_0x9f3741(0x1bc)+a5_0x1ae528[_0x9f3741(0x233)](_0x33f218[_0x9f3741(0x1cd)]));for(let _0x53d678=0x0;_0x53d678<_0x33f218['length'];_0x53d678++){const _0x51d9c5=_0x33f218[_0x53d678],_0x3e4249=_0x51d9c5[_0x9f3741(0x22b)][_0x9f3741(0x1cd)]===0x1?_0x9f3741(0x1ad):'rounds',_0x369f6e=_0x51d9c5[_0x9f3741(0x22c)]?.[_0x9f3741(0x1cd)]?'\x20['+_0x51d9c5[_0x9f3741(0x22c)][_0x9f3741(0x1ac)](',\x20')+']':'';console[_0x9f3741(0x237)]('\x20\x20'+(_0x53d678+0x1)+'.\x20'+a5_0x1ae528['white'](_0x51d9c5[_0x9f3741(0x1e9)])+'\x20('+_0x51d9c5[_0x9f3741(0x22b)][_0x9f3741(0x1cd)]+'\x20'+_0x3e4249+')'+a5_0x1ae528[_0x9f3741(0x200)](_0x369f6e));}return 0x0;}let _0x4afc7d,_0xbdd9ed;try{_0x4afc7d=await _0x14169c[_0x9f3741(0x1ec)][_0x9f3741(0x1f1)](_0x4b916c[_0x9f3741(0x1e1)]);}catch(_0x43b889){const _0xd0b3a4=_0x43b889 instanceof Error?_0x43b889[_0x9f3741(0x230)]:String(_0x43b889);return _0xd0b3a4[_0x9f3741(0x238)](_0x9f3741(0x224))||_0xd0b3a4['toLowerCase']()[_0x9f3741(0x238)](_0x9f3741(0x1a9))?console['log'](a5_0x1ae528['red'](_0x9f3741(0x23c)+_0x4b916c[_0x9f3741(0x1e1)])):console['log'](a5_0x1ae528[_0x9f3741(0x1d2)](_0x9f3741(0x1e5)+_0x4b916c['projectName']+'\x22:\x20'+_0xd0b3a4)),0x1;}try{_0xbdd9ed=await _0x14169c[_0x9f3741(0x1ec)]['resolveAgentId'](_0x4b916c[_0x9f3741(0x221)],_0x4afc7d);}catch(_0x3f3841){const _0x165863=_0x3f3841 instanceof Error?_0x3f3841[_0x9f3741(0x230)]:String(_0x3f3841);return _0x165863['includes'](_0x9f3741(0x224))||_0x165863[_0x9f3741(0x1b7)]()[_0x9f3741(0x238)]('not\x20found')?console['log'](a5_0x1ae528['red'](_0x9f3741(0x229)+_0x4b916c[_0x9f3741(0x221)])):console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x1d2)](_0x9f3741(0x1fc)+_0x4b916c['agentName']+_0x9f3741(0x1bd)+_0x165863)),0x1;}let _0x1d0e61;if(!_0x397ed0)try{_0x1d0e61=await setupEvaluatorAgent(_0x14169c[_0x9f3741(0x1ec)],_0x8c886f[_0x9f3741(0x21d)]);}catch(_0xda45d2){const _0x54c40a=_0xda45d2 instanceof Error?_0xda45d2[_0x9f3741(0x230)]:String(_0xda45d2);return console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x1d2)](_0x9f3741(0x1ce)+_0x54c40a)),0x1;}console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x1ee)](_0x9f3741(0x1b3))),console[_0x9f3741(0x237)](_0x9f3741(0x1fe)+a5_0x1ae528[_0x9f3741(0x233)](_0x1940df)),console[_0x9f3741(0x237)](_0x9f3741(0x1d5)+a5_0x1ae528['white'](_0x4b916c[_0x9f3741(0x1e1)]+'/'+_0x4b916c[_0x9f3741(0x221)])),console[_0x9f3741(0x237)]();const _0xeeb2b2=[],_0x471ef1=[],_0x1c8b6e=Date['now']();for(let _0x111cf0=0x0;_0x111cf0<_0x33f218['length'];_0x111cf0++){const _0x147791=_0x33f218[_0x111cf0];_0x33f218['length']>0x1?console[_0x9f3741(0x237)](_0x9f3741(0x20e)+(_0x111cf0+0x1)+'/'+_0x33f218['length']+':\x20'+a5_0x1ae528['white'](_0x147791[_0x9f3741(0x1e9)])):console[_0x9f3741(0x237)]('Running\x20test:\x20'+a5_0x1ae528[_0x9f3741(0x233)](_0x147791[_0x9f3741(0x1e9)]));const _0x1e15e3=createCommandSpinner(_0x9f3741(0x1df)+_0x147791[_0x9f3741(0x22b)]['length']+_0x9f3741(0x1ba));_0x1e15e3[_0x9f3741(0x23e)]();try{const {result:_0xf3ca2f,conversation:_0x75eb96}=await runTest(_0x14169c[_0x9f3741(0x1ec)],_0x147791,{'agentId':_0xbdd9ed,'projectId':_0x4afc7d,'site':_0x1940df,'noEval':_0x397ed0,'evaluatorId':_0x1d0e61,'onRoundStart':(_0x553fa1,_0x1b6ed9)=>{const _0x51a8e2=_0x9f3741;_0x1e15e3[_0x51a8e2(0x1cb)]=_0x51a8e2(0x1de)+(_0x553fa1+0x1)+'/'+_0x1b6ed9+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x42d3a2,_0x566bff,_0x4eda18)=>{const _0x41cabc=_0x9f3741,_0x4df814=formatElapsed(_0x566bff);_0x4eda18?console[_0x41cabc(0x237)]('\x20\x20Round\x20'+(_0x42d3a2+0x1)+'/'+_0x147791[_0x41cabc(0x22b)]['length']+_0x41cabc(0x204)+a5_0x1ae528[_0x41cabc(0x223)]('✓')+'\x20('+_0x4df814+')'):console[_0x41cabc(0x237)](_0x41cabc(0x1f3)+(_0x42d3a2+0x1)+'/'+_0x147791[_0x41cabc(0x22b)][_0x41cabc(0x1cd)]+_0x41cabc(0x204)+a5_0x1ae528['red']('✗'));},'onEvaluationStart':()=>{const _0x123d7a=_0x9f3741;_0x1e15e3[_0x123d7a(0x1cb)]=_0x123d7a(0x1c3);},'onEvaluationComplete':_0x2cecdb=>{const _0x382d39=_0x9f3741,_0x52570a=formatElapsed(_0x2cecdb);console[_0x382d39(0x237)](_0x382d39(0x1d8)+a5_0x1ae528[_0x382d39(0x223)]('✓')+'\x20('+_0x52570a+')');}});_0x1e15e3[_0x9f3741(0x23b)](),_0xeeb2b2[_0x9f3741(0x1d4)](_0xf3ca2f),_0x471ef1[_0x9f3741(0x1d4)](_0x75eb96);if(_0xf3ca2f[_0x9f3741(0x1d0)]==='PASS')console['log'](a5_0x1ae528[_0x9f3741(0x223)](_0x9f3741(0x1d6)+_0xf3ca2f[_0x9f3741(0x1be)]));else _0xf3ca2f[_0x9f3741(0x1d0)]==='FAIL'?console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x1d2)]('✗\x20FAIL:\x20'+_0xf3ca2f[_0x9f3741(0x1be)])):console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x1d2)](_0x9f3741(0x1ca)+_0xf3ca2f[_0x9f3741(0x1be)]));_0xf3ca2f[_0x9f3741(0x21c)]&&console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x200)](_0x9f3741(0x220)+_0xf3ca2f[_0x9f3741(0x21c)])),console[_0x9f3741(0x237)]();}catch(_0x2ee059){_0x1e15e3[_0x9f3741(0x23b)]();const _0x8da214=_0x2ee059 instanceof Error?_0x2ee059[_0x9f3741(0x230)]:String(_0x2ee059);console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x1d2)](_0x9f3741(0x1ca)+_0x8da214)),console[_0x9f3741(0x237)](),_0xeeb2b2[_0x9f3741(0x1d4)]({'name':_0x147791[_0x9f3741(0x1e9)],'status':'ERROR','reason':_0x8da214,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x570e2e=Date[_0x9f3741(0x1f8)]()-_0x1c8b6e,_0xd35662=_0xeeb2b2[_0x9f3741(0x1eb)](_0x15d36c=>_0x15d36c[_0x9f3741(0x1d0)]==='PASS')[_0x9f3741(0x1cd)],_0x5b0157=_0xeeb2b2[_0x9f3741(0x1eb)](_0x462ea0=>_0x462ea0[_0x9f3741(0x1d0)]===_0x9f3741(0x1c7))[_0x9f3741(0x1cd)],_0x128245=_0xeeb2b2[_0x9f3741(0x1eb)](_0x58918a=>_0x58918a['status']===_0x9f3741(0x1af))['length'];console[_0x9f3741(0x237)]('━'['repeat'](0x3c)),console[_0x9f3741(0x237)](_0x9f3741(0x209)),console[_0x9f3741(0x237)]('━'[_0x9f3741(0x205)](0x3c)),console['log'](_0x9f3741(0x207)+_0xeeb2b2[_0x9f3741(0x1cd)]),console[_0x9f3741(0x237)](_0x9f3741(0x22e)+a5_0x1ae528[_0x9f3741(0x223)](_0xd35662)),console[_0x9f3741(0x237)](_0x9f3741(0x1d3)+a5_0x1ae528[_0x9f3741(0x1d2)](_0x5b0157));_0x128245>0x0&&console[_0x9f3741(0x237)]('Errors:\x20\x20\x20'+a5_0x1ae528[_0x9f3741(0x1d2)](_0x128245));console[_0x9f3741(0x237)](_0x9f3741(0x1c2)+formatElapsed(_0x570e2e)),console[_0x9f3741(0x237)]('━'[_0x9f3741(0x205)](0x3c));const _0x32c3af=_0xeeb2b2[_0x9f3741(0x1eb)](_0x124410=>_0x124410[_0x9f3741(0x1d0)]!=='PASS');if(_0x32c3af[_0x9f3741(0x1cd)]>0x0){console[_0x9f3741(0x237)](),console[_0x9f3741(0x237)]('Failed\x20Tests:');for(const _0x1c2bbb of _0x32c3af){const _0x327213=a5_0x1ae528[_0x9f3741(0x1d2)]('✗'),_0x22325e=_0x1c2bbb[_0x9f3741(0x1be)][_0x9f3741(0x1cd)]>0x32?_0x1c2bbb['reason'][_0x9f3741(0x1b8)](0x0,0x32)+_0x9f3741(0x236):_0x1c2bbb['reason'];console[_0x9f3741(0x237)]('\x20\x20'+_0x327213+'\x20'+_0x1c2bbb[_0x9f3741(0x1e9)]+':\x20'+_0x22325e);}}const _0x41f192={'summary':{'total':_0xeeb2b2[_0x9f3741(0x1cd)],'passed':_0xd35662,'failed':_0x5b0157,'errors':_0x128245>0x0?_0x128245:undefined,'duration_ms':_0x570e2e},'tests':_0xeeb2b2,'agent':{'project':_0x4b916c[_0x9f3741(0x1e1)],'name':_0x4b916c[_0x9f3741(0x221)],'site':_0x1940df},'timestamp':new Date(_0x1c8b6e)[_0x9f3741(0x1b5)]()};try{const _0x3d2ffc=buildCachedTestRun(_0x471ef1,{'site':_0x1940df,'projectId':_0x4afc7d,'projectName':_0x4b916c[_0x9f3741(0x1e1)],'agentId':_0xbdd9ed,'agentName':_0x4b916c[_0x9f3741(0x221)],'testYmlPath':a5_0x2ddc07['resolve'](_0x4b916c[_0x9f3741(0x1c4)])});saveLastTestRun(_0x3d2ffc);}catch{}if(_0x47efa2!==_0x9f3741(0x1e6)||_0x5df971){const _0x2bee0f=formatResults(_0x41f192,_0x47efa2);if(_0x5df971)try{a5_0x61f3f8['writeFileSync'](_0x5df971,_0x2bee0f,_0x9f3741(0x21e)),console[_0x9f3741(0x237)](),console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x200)](_0x9f3741(0x1c6)+_0x5df971));}catch(_0x1b101b){return console[_0x9f3741(0x237)](),console['log'](a5_0x1ae528[_0x9f3741(0x1d2)](_0x9f3741(0x20b)+_0x1b101b)),0x1;}else console['log'](),console['log'](_0x2bee0f);}return _0x32c3af['length']>0x0?0x1:0x0;}async[a5_0x3e5468(0x1ae)](_0x11ce46,_0x2412d2){const _0x4addd4=a5_0x3e5468,{options:_0x56b639,tdx:_0x4ceafa}=_0x11ce46,{definition:_0x2ce365,agentInfo:_0x4fa2ba,outputFormat:_0x1b4b11,outputFile:_0x328f13}=_0x2412d2,_0x2a726f=_0x56b639[_0x4addd4(0x216)],_0x5a990e=loadLastTestRun();if(!_0x5a990e)return console[_0x4addd4(0x237)](a5_0x1ae528[_0x4addd4(0x1d2)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console['log'](a5_0x1ae528[_0x4addd4(0x200)](_0x4addd4(0x1c8))),0x1;if(_0x5a990e['agent']['agentName']!==_0x4fa2ba[_0x4addd4(0x221)])return console[_0x4addd4(0x237)](a5_0x1ae528[_0x4addd4(0x1d2)](_0x4addd4(0x231)+_0x5a990e[_0x4addd4(0x212)]['agentName']+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x4fa2ba['agentName']+'\x22.')),console[_0x4addd4(0x237)](a5_0x1ae528[_0x4addd4(0x200)](_0x4addd4(0x20f))),0x1;const _0x5879d4=new Set(_0x5a990e[_0x4addd4(0x1f7)]['map'](_0x33b6c5=>_0x33b6c5[_0x4addd4(0x1d1)])),_0x493fcf=_0x2ce365[_0x4addd4(0x21f)][_0x4addd4(0x1eb)](_0x2b6476=>!_0x5879d4[_0x4addd4(0x214)](_0x2b6476['name']));if(_0x493fcf['length']>0x0&&_0x5a990e['site']!==_0x2a726f)return console['log'](a5_0x1ae528[_0x4addd4(0x1d2)](_0x4addd4(0x1b1))),console['log'](a5_0x1ae528[_0x4addd4(0x200)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x5a990e['site']+_0x4addd4(0x1e4)+_0x2a726f+'\x22.')),console[_0x4addd4(0x237)](a5_0x1ae528[_0x4addd4(0x200)](_0x4addd4(0x217)+_0x5a990e[_0x4addd4(0x216)]+_0x4addd4(0x1cf))),0x1;const _0x4c649f=_0x2ce365[_0x4addd4(0x21f)][_0x4addd4(0x1eb)](_0x58c2ce=>_0x5879d4[_0x4addd4(0x214)](_0x58c2ce[_0x4addd4(0x1e9)])),_0x5189ce=_0x493fcf;let _0x2ba1f4;try{_0x2ba1f4=await setupEvaluatorAgent(_0x4ceafa[_0x4addd4(0x1ec)],_0x56b639[_0x4addd4(0x21d)]);}catch(_0x3ec9e7){const _0x45dd53=_0x3ec9e7 instanceof Error?_0x3ec9e7[_0x4addd4(0x230)]:String(_0x3ec9e7);return console['log'](a5_0x1ae528[_0x4addd4(0x1d2)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x45dd53)),0x1;}console['log'](a5_0x1ae528[_0x4addd4(0x1ee)](_0x4addd4(0x1b9))),console[_0x4addd4(0x237)](_0x4addd4(0x1b4)+a5_0x1ae528[_0x4addd4(0x233)](_0x5a990e[_0x4addd4(0x1bf)])),console[_0x4addd4(0x237)](_0x4addd4(0x1d5)+a5_0x1ae528[_0x4addd4(0x233)](_0x5a990e[_0x4addd4(0x212)][_0x4addd4(0x1e1)]+'/'+_0x5a990e[_0x4addd4(0x212)][_0x4addd4(0x221)]));_0x5189ce['length']>0x0&&console[_0x4addd4(0x237)](_0x4addd4(0x1bb)+a5_0x1ae528['yellow'](_0x5189ce['length']));console[_0x4addd4(0x237)]();const _0x2bf330=[],_0x3db3a0=Date[_0x4addd4(0x1f8)](),_0x54750f=createCommandSpinner(_0x4addd4(0x222));if(_0x4c649f[_0x4addd4(0x1cd)]>0x0)try{const _0x44f860=await reevaluateFromCache(_0x4ceafa[_0x4addd4(0x1ec)],_0x5a990e,{'tests':_0x4c649f},{'evaluatorId':_0x2ba1f4,'onTestStart':(_0x2452fa,_0x2e5f81,_0x1a75b1)=>{const _0x4a44e8=_0x4addd4;_0x54750f['text']='Re-evaluating\x20'+(_0x2e5f81+0x1)+'/'+_0x1a75b1+':\x20'+_0x2452fa+_0x4a44e8(0x236);if(!_0x54750f[_0x4a44e8(0x20c)])_0x54750f[_0x4a44e8(0x23e)]();},'onTestComplete':(_0x37226a,_0x4dbce9)=>{const _0x476cee=_0x4addd4;_0x54750f['stop']();if(_0x4dbce9[_0x476cee(0x1d0)]===_0x476cee(0x1f0))console[_0x476cee(0x237)](a5_0x1ae528[_0x476cee(0x223)]('✓\x20PASS:\x20'+_0x37226a)+a5_0x1ae528['dim'](_0x476cee(0x1aa)));else _0x4dbce9['status']===_0x476cee(0x1c7)?console[_0x476cee(0x237)](a5_0x1ae528['red']('✗\x20FAIL:\x20'+_0x37226a+'\x20-\x20'+_0x4dbce9[_0x476cee(0x1be)])+a5_0x1ae528[_0x476cee(0x200)]('\x20(cached)')):console['log'](a5_0x1ae528[_0x476cee(0x1d2)]('✗\x20ERROR:\x20'+_0x37226a+_0x476cee(0x215)+_0x4dbce9[_0x476cee(0x1be)]));_0x4dbce9[_0x476cee(0x21c)]&&console[_0x476cee(0x237)](a5_0x1ae528[_0x476cee(0x200)](_0x476cee(0x1f6)+_0x4dbce9[_0x476cee(0x21c)])),_0x2bf330['push'](_0x4dbce9);},'onTestSkipped':(_0x2bb90b,_0x2a3920)=>{const _0xe4ad2=_0x4addd4;_0x54750f['stop'](),console[_0xe4ad2(0x237)](a5_0x1ae528[_0xe4ad2(0x1fd)](_0xe4ad2(0x1b2)+_0x2bb90b+_0xe4ad2(0x215)+_0x2a3920));}});for(const _0x5447ab of _0x44f860){!_0x2bf330['find'](_0x2a5edb=>_0x2a5edb['name']===_0x5447ab['name'])&&_0x2bf330[_0x4addd4(0x1d4)](_0x5447ab);}}catch(_0x512843){_0x54750f[_0x4addd4(0x23b)]();const _0x3af8a5=_0x512843 instanceof Error?_0x512843[_0x4addd4(0x230)]:String(_0x512843);return console[_0x4addd4(0x237)](a5_0x1ae528[_0x4addd4(0x1d2)](_0x4addd4(0x1b6)+_0x3af8a5)),0x1;}_0x54750f[_0x4addd4(0x23b)]();if(_0x5189ce['length']>0x0){console[_0x4addd4(0x237)](),console[_0x4addd4(0x237)](a5_0x1ae528[_0x4addd4(0x1ee)](_0x4addd4(0x1d9)));const {projectId:_0x49e6c8,agentId:_0xbe886e}=_0x5a990e['agent'];for(const _0x39a168 of _0x5189ce){console['log'](_0x4addd4(0x1ab)+a5_0x1ae528[_0x4addd4(0x233)](_0x39a168[_0x4addd4(0x1e9)]));const _0x4b0417=createCommandSpinner(_0x4addd4(0x1df)+_0x39a168[_0x4addd4(0x22b)][_0x4addd4(0x1cd)]+_0x4addd4(0x1ba));_0x4b0417['start']();try{const {result:_0x18c700}=await runTest(_0x4ceafa[_0x4addd4(0x1ec)],_0x39a168,{'agentId':_0xbe886e,'projectId':_0x49e6c8,'site':_0x5a990e['site'],'noEval':![],'evaluatorId':_0x2ba1f4,'onRoundStart':(_0x447e61,_0x211ac4)=>{const _0xd9c00c=_0x4addd4;_0x4b0417[_0xd9c00c(0x1cb)]=_0xd9c00c(0x1de)+(_0x447e61+0x1)+'/'+_0x211ac4+_0xd9c00c(0x1ba);},'onRoundComplete':(_0x361349,_0x5cbfeb,_0x1f2445)=>{const _0x21097c=_0x4addd4,_0x583b83=formatElapsed(_0x5cbfeb);_0x1f2445?console[_0x21097c(0x237)](_0x21097c(0x1f3)+(_0x361349+0x1)+'/'+_0x39a168['rounds'][_0x21097c(0x1cd)]+'...\x20'+a5_0x1ae528[_0x21097c(0x223)]('✓')+'\x20('+_0x583b83+')'):console['log'](_0x21097c(0x1f3)+(_0x361349+0x1)+'/'+_0x39a168['rounds'][_0x21097c(0x1cd)]+_0x21097c(0x204)+a5_0x1ae528[_0x21097c(0x1d2)]('✗'));},'onEvaluationStart':()=>{const _0x3343ae=_0x4addd4;_0x4b0417[_0x3343ae(0x1cb)]=_0x3343ae(0x1c3);},'onEvaluationComplete':_0x412b45=>{const _0x3a9933=_0x4addd4,_0x40f575=formatElapsed(_0x412b45);console[_0x3a9933(0x237)](_0x3a9933(0x1d8)+a5_0x1ae528[_0x3a9933(0x223)]('✓')+'\x20('+_0x40f575+')');}});_0x4b0417[_0x4addd4(0x23b)](),_0x2bf330['push'](_0x18c700);if(_0x18c700['status']==='PASS')console[_0x4addd4(0x237)](a5_0x1ae528[_0x4addd4(0x223)]('✓\x20PASS:\x20'+_0x18c700[_0x4addd4(0x1be)])+a5_0x1ae528[_0x4addd4(0x200)](_0x4addd4(0x22a)));else _0x18c700[_0x4addd4(0x1d0)]==='FAIL'?console['log'](a5_0x1ae528['red'](_0x4addd4(0x23d)+_0x18c700['reason'])+a5_0x1ae528[_0x4addd4(0x200)](_0x4addd4(0x22a))):console[_0x4addd4(0x237)](a5_0x1ae528[_0x4addd4(0x1d2)](_0x4addd4(0x1ca)+_0x18c700[_0x4addd4(0x1be)]));_0x18c700[_0x4addd4(0x21c)]&&console[_0x4addd4(0x237)](a5_0x1ae528[_0x4addd4(0x200)](_0x4addd4(0x1f6)+_0x18c700['conversation_url']));}catch(_0x569d8c){_0x4b0417[_0x4addd4(0x23b)]();const _0x592a6c=_0x569d8c instanceof Error?_0x569d8c[_0x4addd4(0x230)]:String(_0x569d8c);console[_0x4addd4(0x237)](a5_0x1ae528[_0x4addd4(0x1d2)](_0x4addd4(0x1ca)+_0x592a6c)),_0x2bf330[_0x4addd4(0x1d4)]({'name':_0x39a168['name'],'status':_0x4addd4(0x1af),'reason':_0x592a6c,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console['log']();const _0x27552f=Date[_0x4addd4(0x1f8)]()-_0x3db3a0,_0x3f1d6b=_0x2bf330[_0x4addd4(0x1eb)](_0x833f1d=>_0x833f1d[_0x4addd4(0x1d0)]===_0x4addd4(0x1f0))['length'],_0x5f23ce=_0x2bf330['filter'](_0xf08baf=>_0xf08baf[_0x4addd4(0x1d0)]==='FAIL')['length'],_0x408985=_0x2bf330['filter'](_0x1ac553=>_0x1ac553[_0x4addd4(0x1d0)]==='ERROR')[_0x4addd4(0x1cd)];console[_0x4addd4(0x237)]('━'['repeat'](0x3c)),console[_0x4addd4(0x237)](_0x4addd4(0x1fb)),console[_0x4addd4(0x237)]('━'[_0x4addd4(0x205)](0x3c)),console['log'](_0x4addd4(0x207)+_0x2bf330['length']),console[_0x4addd4(0x237)]('Passed:\x20\x20\x20'+a5_0x1ae528[_0x4addd4(0x223)](_0x3f1d6b)),console[_0x4addd4(0x237)](_0x4addd4(0x1d3)+a5_0x1ae528[_0x4addd4(0x1d2)](_0x5f23ce));_0x408985>0x0&&console[_0x4addd4(0x237)]('Errors:\x20\x20\x20'+a5_0x1ae528[_0x4addd4(0x1d2)](_0x408985));console[_0x4addd4(0x237)](_0x4addd4(0x1c2)+formatElapsed(_0x27552f)),console['log']('━'[_0x4addd4(0x205)](0x3c));const _0x3489f3={'summary':{'total':_0x2bf330['length'],'passed':_0x3f1d6b,'failed':_0x5f23ce,'errors':_0x408985>0x0?_0x408985:undefined,'duration_ms':_0x27552f},'tests':_0x2bf330,'agent':{'project':_0x4fa2ba[_0x4addd4(0x1e1)],'name':_0x4fa2ba['agentName'],'site':_0x2a726f},'timestamp':new Date(_0x3db3a0)[_0x4addd4(0x1b5)]()};if(_0x1b4b11!==_0x4addd4(0x1e6)||_0x328f13){const _0x5bcc53=formatResults(_0x3489f3,_0x1b4b11);if(_0x328f13)try{a5_0x61f3f8[_0x4addd4(0x1c9)](_0x328f13,_0x5bcc53,'utf-8'),console[_0x4addd4(0x237)](),console[_0x4addd4(0x237)](a5_0x1ae528[_0x4addd4(0x200)](_0x4addd4(0x1c6)+_0x328f13));}catch(_0x47e77a){return console[_0x4addd4(0x237)](),console[_0x4addd4(0x237)](a5_0x1ae528[_0x4addd4(0x1d2)](_0x4addd4(0x20b)+_0x47e77a)),0x1;}else console[_0x4addd4(0x237)](),console[_0x4addd4(0x237)](_0x5bcc53);}const _0x39a666=_0x2bf330['filter'](_0x55b0f6=>_0x55b0f6[_0x4addd4(0x1d0)]!==_0x4addd4(0x1f0));return _0x39a666[_0x4addd4(0x1cd)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x1e08ea=a6_0x3729;function a6_0x5955(){const _0x22d183=['header','output','length','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','148opXKrr','581sTOlzA','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','color','trim','1719216edUtiD','PUT','validate','8962290aOnwsF','set-cookie','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','join','14fMzlya','.\x20Valid\x20types:\x20','name','headers','includes','request','57087rIjRCo','readBodyFromFile','type','verbose','.\x20Valid\x20methods:\x20','body','method','substring','api','110586TMTPkJ','set-cookie2','Invalid\x20header\x20format:\x20\x22','stack','noColor','data','\x22.\x20','Invalid\x20HTTP\x20method:\x20','5766816tHpJdW','Error:\x20','entries','proxy-authorization','startsWith','6955470lPHPQH','x-trino-user','58423YsLKIr','message','GET','error','status','workflow','indexOf','file','Invalid\x20API\x20type:\x20','site','authorization','keys','<\x20HTTP/1.1\x20','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','cas','\x0aStack\x20trace:\x0a','toLowerCase','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','llm','x-xsrf-token'];a6_0x5955=function(){return _0x22d183;};return a6_0x5955();}(function(_0x4f17ef,_0x241a78){const _0x57e135=a6_0x3729,_0x3f2878=_0x4f17ef();while(!![]){try{const _0x341da8=-parseInt(_0x57e135(0x1e6))/0x1*(-parseInt(_0x57e135(0x1c8))/0x2)+-parseInt(_0x57e135(0x1ce))/0x3*(-parseInt(_0x57e135(0x1fe))/0x4)+parseInt(_0x57e135(0x1e4))/0x5+-parseInt(_0x57e135(0x1d7))/0x6*(parseInt(_0x57e135(0x1ff))/0x7)+parseInt(_0x57e135(0x1df))/0x8+parseInt(_0x57e135(0x203))/0x9+-parseInt(_0x57e135(0x206))/0xa;if(_0x341da8===_0x241a78)break;else _0x3f2878['push'](_0x3f2878['shift']());}catch(_0x3739e4){_0x3f2878['push'](_0x3f2878['shift']());}}}(a6_0x5955,0xf1b32));import{BaseCommand}from'./command.js';function a6_0x3729(_0x1b4c31,_0x43fb5e){_0x1b4c31=_0x1b4c31-0x1c5;const _0x595500=a6_0x5955();let _0x3729ed=_0x595500[_0x1b4c31];return _0x3729ed;}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_0x1e08ea(0x1f0),a6_0x1e08ea(0x1e2),'cookie',a6_0x1e08ea(0x1c5),a6_0x1e08ea(0x1d8),a6_0x1e08ea(0x1f9),'x-auth-token',a6_0x1e08ea(0x1e5)]);function isSensitiveHeader(_0x11255a){const _0x3ed815=a6_0x1e08ea;return SENSITIVE_HEADERS['has'](_0x11255a[_0x3ed815(0x1f6)]());}function parseHeader(_0x389b83){const _0x2b1ef5=a6_0x1e08ea,_0x4f83b9=_0x389b83[_0x2b1ef5(0x1ec)](':');if(_0x4f83b9===-0x1)throw new Error(_0x2b1ef5(0x1d9)+_0x389b83+_0x2b1ef5(0x1dd)+_0x2b1ef5(0x1f7));const _0x52f3ad=_0x389b83[_0x2b1ef5(0x1d5)](0x0,_0x4f83b9)['trim'](),_0x2d3a57=_0x389b83[_0x2b1ef5(0x1d5)](_0x4f83b9+0x1)[_0x2b1ef5(0x202)]();if(!_0x52f3ad)throw new Error(_0x2b1ef5(0x200)+_0x389b83+'\x22');return[_0x52f3ad,_0x2d3a57];}export class ApiCommand extends BaseCommand{[a6_0x1e08ea(0x1ca)]=a6_0x1e08ea(0x1d6);['description']=a6_0x1e08ea(0x1c6);[a6_0x1e08ea(0x205)](_0x252183){const _0x41ef77=a6_0x1e08ea,{args:_0x5c404c,options:_0x44a08c}=_0x252183,_0x185a66=_0x44a08c;if(_0x5c404c[_0x41ef77(0x1fc)]===0x0)return _0x41ef77(0x1f3);const _0x30196b=_0x5c404c[0x0];if(!_0x30196b[_0x41ef77(0x1e3)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x30196b;const _0x490aa4=_0x185a66[_0x41ef77(0x1dc)],_0x1a7ff6=_0x185a66[_0x41ef77(0x1ed)];if(_0x490aa4&&_0x1a7ff6)return _0x41ef77(0x1fd);const _0x53f4cb=_0x185a66[_0x41ef77(0x1d4)]||_0x41ef77(0x1e8),_0x25ef1c=[_0x41ef77(0x1e8),'POST',_0x41ef77(0x204),'DELETE','PATCH'];if(!_0x25ef1c[_0x41ef77(0x1cc)](_0x53f4cb['toUpperCase']()))return _0x41ef77(0x1de)+_0x53f4cb+_0x41ef77(0x1d2)+_0x25ef1c[_0x41ef77(0x1c7)](',\x20');const _0x3e0d65=_0x185a66[_0x41ef77(0x1d0)]||'td',_0x58ba31=['td','cdp',_0x41ef77(0x1eb),'trino',_0x41ef77(0x1f8),'llm-proxy',_0x41ef77(0x1f4)];if(!_0x58ba31[_0x41ef77(0x1cc)](_0x3e0d65))return _0x41ef77(0x1ee)+_0x3e0d65+_0x41ef77(0x1c9)+_0x58ba31['join'](',\x20');return undefined;}async['execute'](_0x8dbb86){const _0x4018aa=a6_0x1e08ea,{options:_0xb9d5a9,args:_0x396627,tdx:_0x164760}=_0x8dbb86,_0xd53c3b=_0xb9d5a9,_0x3af0b7=_0x396627[0x0],_0x116ced=(_0xd53c3b['method']||_0x4018aa(0x1e8))['toUpperCase'](),_0x4a9367=_0xd53c3b['data'],_0x28169e=_0xd53c3b[_0x4018aa(0x1ed)],_0x2234ad=_0xd53c3b[_0x4018aa(0x1fa)],_0x406fd6=_0xd53c3b[_0x4018aa(0x1d0)]||'td';try{const _0x38f648={};if(_0x2234ad){const _0x147ec0=Array['isArray'](_0x2234ad)?_0x2234ad:[_0x2234ad];for(const _0x37827f of _0x147ec0){const [_0x47a9a0,_0x5b4dfc]=parseHeader(_0x37827f);_0x38f648[_0x47a9a0]=_0x5b4dfc;}}let _0x3c0bfa;if(_0x4a9367)_0x3c0bfa=_0x4a9367;else{if(_0x28169e)try{_0x3c0bfa=RawAPI[_0x4018aa(0x1cf)](_0x28169e);}catch(_0x3d611b){return console['error'](_0x4018aa(0x1e0)+(_0x3d611b instanceof Error?_0x3d611b[_0x4018aa(0x1e7)]:String(_0x3d611b))),0x1;}}const _0x54f3ca={'method':_0x116ced,'apiType':_0x406fd6,'includeHeaders':_0xb9d5a9[_0x4018aa(0x1d1)]};_0x3c0bfa&&(_0x54f3ca[_0x4018aa(0x1d3)]=_0x3c0bfa);Object[_0x4018aa(0x1f1)](_0x38f648)[_0x4018aa(0x1fc)]>0x0&&(_0x54f3ca['headers']=_0x38f648);if(_0xb9d5a9[_0x4018aa(0x1d1)]){const _0x46fbc4=resolveSite(_0xb9d5a9[_0x4018aa(0x1ef)]),_0x2c09b8=getEndpoint(_0x46fbc4,_0x406fd6),_0x183c00=''+_0x2c09b8+_0x3af0b7;console['error']('>\x20'+_0x116ced+'\x20'+_0x183c00);const _0x1dd83e=getAuthHeaders(_0x46fbc4),_0x2bb7ea={..._0x1dd83e,..._0x38f648};for(const [_0x588760,_0x13d492]of Object[_0x4018aa(0x1e1)](_0x2bb7ea)){!isSensitiveHeader(_0x588760)&&console['error']('>\x20'+_0x588760+':\x20'+_0x13d492);}_0x3c0bfa&&console['error']('>'),console[_0x4018aa(0x1e9)]('');}const _0x5b2310=await _0x164760[_0x4018aa(0x1d6)][_0x4018aa(0x1cd)](_0x3af0b7,_0x54f3ca);if(_0xb9d5a9[_0x4018aa(0x1d1)]&&_0x5b2310[_0x4018aa(0x1cb)]){console['error'](_0x4018aa(0x1f2)+_0x5b2310[_0x4018aa(0x1ea)]);for(const [_0x4eb8d3,_0x5be315]of Object[_0x4018aa(0x1e1)](_0x5b2310[_0x4018aa(0x1cb)])){!isSensitiveHeader(_0x4eb8d3)&&console[_0x4018aa(0x1e9)]('<\x20'+_0x4eb8d3+':\x20'+_0x5be315);}console[_0x4018aa(0x1e9)]('');}const _0xbe816c=Boolean(_0xb9d5a9[_0x4018aa(0x1fb)]),_0x2ec928={'color':_0xb9d5a9[_0x4018aa(0x201)],'noColor':_0xb9d5a9[_0x4018aa(0x1db)]||_0xbe816c&&!_0xb9d5a9[_0x4018aa(0x201)]},_0x15f199=colorizeJSON(_0x5b2310[_0x4018aa(0x1dc)],_0x2ec928);return _0xb9d5a9[_0x4018aa(0x1fb)]?(writeFileSync(_0xb9d5a9[_0x4018aa(0x1fb)],_0x15f199),console['error']('Results\x20saved\x20to\x20'+_0xb9d5a9[_0x4018aa(0x1fb)])):console['log'](_0x15f199),0x0;}catch(_0x526208){return _0x526208 instanceof Error?(console[_0x4018aa(0x1e9)]('Error:\x20'+_0x526208[_0x4018aa(0x1e7)]),_0xb9d5a9['verbose']&&_0x526208[_0x4018aa(0x1da)]&&console[_0x4018aa(0x1e9)](_0x4018aa(0x1f5)+_0x526208[_0x4018aa(0x1da)])):console[_0x4018aa(0x1e9)](_0x4018aa(0x1e0)+String(_0x526208)),0x1;}}}
1
+ const a6_0x1c179f=a6_0x2abc;(function(_0x1b0fa3,_0x333f71){const _0x414cc7=a6_0x2abc,_0x33d8d7=_0x1b0fa3();while(!![]){try{const _0x5a1473=parseInt(_0x414cc7(0x1c9))/0x1*(-parseInt(_0x414cc7(0x1cc))/0x2)+parseInt(_0x414cc7(0x1d2))/0x3+parseInt(_0x414cc7(0x1e8))/0x4*(parseInt(_0x414cc7(0x1ed))/0x5)+-parseInt(_0x414cc7(0x1ee))/0x6*(-parseInt(_0x414cc7(0x1dd))/0x7)+-parseInt(_0x414cc7(0x1f2))/0x8*(parseInt(_0x414cc7(0x1d7))/0x9)+-parseInt(_0x414cc7(0x1c4))/0xa*(parseInt(_0x414cc7(0x1cb))/0xb)+parseInt(_0x414cc7(0x1d0))/0xc;if(_0x5a1473===_0x333f71)break;else _0x33d8d7['push'](_0x33d8d7['shift']());}catch(_0x3ca774){_0x33d8d7['push'](_0x33d8d7['shift']());}}}(a6_0xace0,0xa0951));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_0x1c179f(0x1ea),a6_0x1c179f(0x1f0),a6_0x1c179f(0x1af),a6_0x1c179f(0x1f3),'set-cookie2','x-xsrf-token','x-auth-token','x-trino-user']);function a6_0xace0(){const _0x14ae16=['6426dphPzx','data','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','startsWith','.\x20Valid\x20methods:\x20','keys','7rHINti','log','trino','validate','readBodyFromFile','workflow','DELETE','cdp','POST','body','api','4AaovUX','\x0aStack\x20trace:\x0a','authorization','isArray','Results\x20saved\x20to\x20','1663565CLsKHw','1943454uOBier','includes','proxy-authorization','llm','13544SKTpPe','set-cookie','toUpperCase','noColor','Invalid\x20header\x20format:\x20\x22','cookie','Invalid\x20API\x20type:\x20','error','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','has','output','name','Invalid\x20HTTP\x20method:\x20','status','GET','entries','trim','execute','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','indexOf','method','request','description','length','llm-proxy','cas','10KgxoBv','PATCH','substring','join','headers','176zdXXOW','.\x20Valid\x20types:\x20','3660437mxQBGl','3314bgjuGU','site','toLowerCase','verbose','21346260sQAnbG','file','166407cPQKUp','<\x20HTTP/1.1\x20','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','type','Endpoint\x20must\x20start\x20with\x20/:\x20'];a6_0xace0=function(){return _0x14ae16;};return a6_0xace0();}function isSensitiveHeader(_0x434f44){const _0x3b67e8=a6_0x1c179f;return SENSITIVE_HEADERS[_0x3b67e8(0x1b3)](_0x434f44[_0x3b67e8(0x1ce)]());}function a6_0x2abc(_0xb2ab5,_0x133def){_0xb2ab5=_0xb2ab5-0x1ac;const _0xace093=a6_0xace0();let _0x2abc3e=_0xace093[_0xb2ab5];return _0x2abc3e;}function parseHeader(_0x1e63d7){const _0x25eb30=a6_0x1c179f,_0x2dfd4c=_0x1e63d7[_0x25eb30(0x1bd)](':');if(_0x2dfd4c===-0x1)throw new Error(_0x25eb30(0x1ae)+_0x1e63d7+'\x22.\x20'+_0x25eb30(0x1bc));const _0x2888df=_0x1e63d7[_0x25eb30(0x1c6)](0x0,_0x2dfd4c)[_0x25eb30(0x1ba)](),_0x50d092=_0x1e63d7[_0x25eb30(0x1c6)](_0x2dfd4c+0x1)[_0x25eb30(0x1ba)]();if(!_0x2888df)throw new Error(_0x25eb30(0x1b2)+_0x1e63d7+'\x22');return[_0x2888df,_0x50d092];}export class ApiCommand extends BaseCommand{[a6_0x1c179f(0x1b5)]=a6_0x1c179f(0x1e7);[a6_0x1c179f(0x1c0)]=a6_0x1c179f(0x1d4);[a6_0x1c179f(0x1e0)](_0x553768){const _0x240216=a6_0x1c179f,{args:_0x44332f,options:_0x39e59a}=_0x553768,_0x55ac88=_0x39e59a;if(_0x44332f[_0x240216(0x1c1)]===0x0)return _0x240216(0x1d9);const _0x5a47a7=_0x44332f[0x0];if(!_0x5a47a7[_0x240216(0x1da)]('/'))return _0x240216(0x1d6)+_0x5a47a7;const _0x44ea7e=_0x55ac88['data'],_0x430a97=_0x55ac88[_0x240216(0x1d1)];if(_0x44ea7e&&_0x430a97)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x31ddfb=_0x55ac88[_0x240216(0x1be)]||_0x240216(0x1b8),_0x55bf26=[_0x240216(0x1b8),_0x240216(0x1e5),'PUT',_0x240216(0x1e3),_0x240216(0x1c5)];if(!_0x55bf26[_0x240216(0x1ef)](_0x31ddfb[_0x240216(0x1ac)]()))return _0x240216(0x1b6)+_0x31ddfb+_0x240216(0x1db)+_0x55bf26[_0x240216(0x1c7)](',\x20');const _0x14e6ce=_0x55ac88['type']||'td',_0x462861=['td',_0x240216(0x1e4),_0x240216(0x1e2),_0x240216(0x1df),_0x240216(0x1f1),_0x240216(0x1c2),_0x240216(0x1c3)];if(!_0x462861[_0x240216(0x1ef)](_0x14e6ce))return _0x240216(0x1b0)+_0x14e6ce+_0x240216(0x1ca)+_0x462861['join'](',\x20');return undefined;}async[a6_0x1c179f(0x1bb)](_0x4ab56d){const _0x4051ea=a6_0x1c179f,{options:_0x2be5e5,args:_0x1b826a,tdx:_0x4c5d83}=_0x4ab56d,_0x1fa3d7=_0x2be5e5,_0x1192bb=_0x1b826a[0x0],_0x2b8c16=(_0x1fa3d7['method']||_0x4051ea(0x1b8))[_0x4051ea(0x1ac)](),_0x2f25b3=_0x1fa3d7[_0x4051ea(0x1d8)],_0x1a0699=_0x1fa3d7['file'],_0x4a4b01=_0x1fa3d7['header'],_0xe59e2d=_0x1fa3d7[_0x4051ea(0x1d5)]||'td';try{const _0x3462e2={};if(_0x4a4b01){const _0x13c1d2=Array[_0x4051ea(0x1eb)](_0x4a4b01)?_0x4a4b01:[_0x4a4b01];for(const _0x385f15 of _0x13c1d2){const [_0x1b9bb,_0x5d819c]=parseHeader(_0x385f15);_0x3462e2[_0x1b9bb]=_0x5d819c;}}let _0x56a5f6;if(_0x2f25b3)_0x56a5f6=_0x2f25b3;else{if(_0x1a0699)try{_0x56a5f6=RawAPI[_0x4051ea(0x1e1)](_0x1a0699);}catch(_0x4de23b){return console[_0x4051ea(0x1b1)]('Error:\x20'+(_0x4de23b instanceof Error?_0x4de23b['message']:String(_0x4de23b))),0x1;}}const _0x1d7bf0={'method':_0x2b8c16,'apiType':_0xe59e2d,'includeHeaders':_0x2be5e5[_0x4051ea(0x1cf)]};_0x56a5f6&&(_0x1d7bf0[_0x4051ea(0x1e6)]=_0x56a5f6);Object[_0x4051ea(0x1dc)](_0x3462e2)[_0x4051ea(0x1c1)]>0x0&&(_0x1d7bf0[_0x4051ea(0x1c8)]=_0x3462e2);if(_0x2be5e5['verbose']){const _0x5e1741=resolveSite(_0x2be5e5[_0x4051ea(0x1cd)]),_0x40f91c=getEndpoint(_0x5e1741,_0xe59e2d),_0x37b7a0=''+_0x40f91c+_0x1192bb;console[_0x4051ea(0x1b1)]('>\x20'+_0x2b8c16+'\x20'+_0x37b7a0);const _0x1845fd=getAuthHeaders(_0x5e1741),_0x496886={..._0x1845fd,..._0x3462e2};for(const [_0x10ab59,_0x4dbbbb]of Object[_0x4051ea(0x1b9)](_0x496886)){!isSensitiveHeader(_0x10ab59)&&console[_0x4051ea(0x1b1)]('>\x20'+_0x10ab59+':\x20'+_0x4dbbbb);}_0x56a5f6&&console['error']('>'),console[_0x4051ea(0x1b1)]('');}const _0x254b83=await _0x4c5d83['api'][_0x4051ea(0x1bf)](_0x1192bb,_0x1d7bf0);if(_0x2be5e5['verbose']&&_0x254b83['headers']){console[_0x4051ea(0x1b1)](_0x4051ea(0x1d3)+_0x254b83[_0x4051ea(0x1b7)]);for(const [_0x3b17a2,_0x7d425e]of Object[_0x4051ea(0x1b9)](_0x254b83['headers'])){!isSensitiveHeader(_0x3b17a2)&&console[_0x4051ea(0x1b1)]('<\x20'+_0x3b17a2+':\x20'+_0x7d425e);}console[_0x4051ea(0x1b1)]('');}const _0x1885d2=Boolean(_0x2be5e5[_0x4051ea(0x1b4)]),_0x3a76f4={'color':_0x2be5e5['color'],'noColor':_0x2be5e5[_0x4051ea(0x1ad)]||_0x1885d2&&!_0x2be5e5['color']},_0x3e3324=colorizeJSON(_0x254b83[_0x4051ea(0x1d8)],_0x3a76f4);return _0x2be5e5['output']?(writeFileSync(_0x2be5e5[_0x4051ea(0x1b4)],_0x3e3324),console['error'](_0x4051ea(0x1ec)+_0x2be5e5[_0x4051ea(0x1b4)])):console[_0x4051ea(0x1de)](_0x3e3324),0x0;}catch(_0x4258cc){return _0x4258cc instanceof Error?(console[_0x4051ea(0x1b1)]('Error:\x20'+_0x4258cc['message']),_0x2be5e5['verbose']&&_0x4258cc['stack']&&console[_0x4051ea(0x1b1)](_0x4051ea(0x1e9)+_0x4258cc['stack'])):console[_0x4051ea(0x1b1)]('Error:\x20'+String(_0x4258cc)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x106402=a7_0x2ab3;(function(_0x484f6c,_0x33d95b){const _0x56f454=a7_0x2ab3,_0xe794d6=_0x484f6c();while(!![]){try{const _0x58bf5a=-parseInt(_0x56f454(0x102))/0x1*(parseInt(_0x56f454(0x100))/0x2)+parseInt(_0x56f454(0x107))/0x3+-parseInt(_0x56f454(0xe0))/0x4*(parseInt(_0x56f454(0xe8))/0x5)+parseInt(_0x56f454(0xdc))/0x6+-parseInt(_0x56f454(0xdd))/0x7*(parseInt(_0x56f454(0xd2))/0x8)+-parseInt(_0x56f454(0xe6))/0x9+-parseInt(_0x56f454(0x10b))/0xa*(-parseInt(_0x56f454(0xf9))/0xb);if(_0x58bf5a===_0x33d95b)break;else _0xe794d6['push'](_0xe794d6['shift']());}catch(_0x5b6b1e){_0xe794d6['push'](_0xe794d6['shift']());}}}(a7_0xed30,0x67775));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';function a7_0xed30(){const _0x6ce0a6=['16EqJobN','System\x20keychain\x20is\x20not\x20available','execute','tdx:\x20auth\x20setup','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','No\x20credential\x20found','apikey','yellow','Enter\x20your\x20TD\x20API\x20key:','message','2666814WBLEBq','874727MTHvap','filter','API\x20key','1724YtskxR','email','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','last_name','name','\x20(profile:\x20','1422225qXnryv','auth','2895qKjfZa','first_name','log','Setup\x20API\x20key\x20authentication\x20interactively','method','password','Remove\x20API\x20key\x20from\x20system\x20keychain','No\x20credentials\x20found\x20in\x20keychain','getUserInfo','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','tdx:\x20auth\x20clear','Read\x20credential\x20from\x20','description','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','OAuth\x20(browser\x20login)','jobs','site','11wwCzQC','warn','oauth','Choose\x20authentication\x20method:','logLevel','bold','API\x20key\x20cannot\x20be\x20empty','19816nfilRl','Name:\x20','46bnrCFO','✗\x20Validation\x20failed:\x20','ERROR','join','You\x20can\x20find\x20your\x20API\x20key\x20at:','2451969IOGAji','Setup\x20cancelled','N/A','auth:clear','2752690aRJBHd','red','error','profile','Validating\x20API\x20key...','✓\x20Profile\x20\x27','OAuth\x20tokens','/app/mp/ak','\x20\x20tdx','apiKey','trim','\x20and\x20','\x27\x20registered','API\x20Key','create','status','\x20for\x20profile:\x20','\x20(site:\x20','all','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','Setting\x20up\x20authentication\x20for\x20site:\x20'];a7_0xed30=function(){return _0x6ce0a6;};return a7_0xed30();}import{getOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a7_0x2ab3(_0x23b734,_0xf93da2){_0x23b734=_0x23b734-0xc6;const _0xed30c3=a7_0xed30();let _0x2ab36a=_0xed30c3[_0x23b734];return _0x2ab36a;}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_0x5b5975 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_0x32b3e4 from'chalk';export class AuthSetupCommand extends BaseCommand{['name']='auth:setup';[a7_0x106402(0xf4)]=a7_0x106402(0xeb);async[a7_0x106402(0xd4)](_0x64f174){const _0x25d90a=a7_0x106402,{options:_0xd8f9be}=_0x64f174,_0xb3ea97=_0xd8f9be[_0x25d90a(0x10e)];console[_0x25d90a(0xea)](a7_0x32b3e4[_0x25d90a(0xfe)](_0x25d90a(0xd5)));const _0x94073a=_0xd8f9be[_0x25d90a(0xf8)]||'us01',_0x507e26=await promptSiteSelection(_0x94073a,_0xb3ea97,_0x25d90a(0x108));if(!_0x507e26)return 0x1;const _0x216491=resolveSite(_0x507e26);if(isOAuthSupported(_0x216491)){const _0x2a2d40=await a7_0x5b5975({'type':'select','name':_0x25d90a(0xec),'message':_0x25d90a(0xfc),'choices':[{'title':_0x25d90a(0xf6),'value':_0x25d90a(0xfb)},{'title':_0x25d90a(0xca),'value':_0x25d90a(0xd8)}]});if(!_0x2a2d40[_0x25d90a(0xec)])return console['log']('\x0aSetup\x20cancelled'),0x1;if(_0x2a2d40[_0x25d90a(0xec)]==='oauth')return await runOAuthLoginFlow(_0x216491,_0xb3ea97,_0xd8f9be[_0x25d90a(0xfd)]??LogLevel['ERROR']),0x0;}console['log'](_0x25d90a(0xd1)+_0x216491),console[_0x25d90a(0xea)](_0x25d90a(0x106)),console[_0x25d90a(0xea)]('\x20\x20'+getConsoleUrl(_0x216491,_0x25d90a(0x112)));const _0x510e02=await a7_0x5b5975({'type':_0x25d90a(0xed),'name':'apiKey','message':_0x25d90a(0xda),'validate':_0x10edbb=>{const _0x11f14e=_0x25d90a;if(!_0x10edbb||!_0x10edbb[_0x11f14e(0xc7)]())return _0x11f14e(0xff);return!![];}});if(!_0x510e02[_0x25d90a(0xc6)])return console[_0x25d90a(0xea)]('\x0aSetup\x20cancelled'),0x1;const _0x17d4c8=_0x510e02[_0x25d90a(0xc6)];console[_0x25d90a(0xea)](_0x25d90a(0x10f));try{const _0x10f406=TDX[_0x25d90a(0xcb)]({'site':_0x216491,'apiKey':_0x17d4c8[_0x25d90a(0xc7)](),'logLevel':_0xd8f9be[_0x25d90a(0xfd)]??LogLevel[_0x25d90a(0x104)]}),_0x11dc6d=await _0x10f406[_0x25d90a(0xf7)][_0x25d90a(0xf0)]();console[_0x25d90a(0xea)](_0x25d90a(0xd6)+_0x11dc6d[_0x25d90a(0xe1)]+')');const _0x27ca4b=await isKeychainAvailable();_0x27ca4b?(await saveAPIKeyAsync(_0x17d4c8['trim'](),_0x216491,_0xb3ea97),console[_0x25d90a(0xea)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0xb3ea97?'\x20(profile:\x20'+_0xb3ea97+')':''))):(console[_0x25d90a(0xfa)](a7_0x32b3e4[_0x25d90a(0xd9)](_0x25d90a(0xf1))),console[_0x25d90a(0xfa)](a7_0x32b3e4[_0x25d90a(0xd9)](_0x25d90a(0xe2))));if(_0xb3ea97){const _0x140477={'site':_0x216491};saveProfileToUserConfig(_0xb3ea97,_0x140477),console[_0x25d90a(0xea)](_0x25d90a(0x110)+_0xb3ea97+_0x25d90a(0xc9));}else saveDefaultSiteToUserConfig(_0x216491),console[_0x25d90a(0xea)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x216491);const _0x1d36eb=_0xb3ea97?'\x20--profile\x20'+_0xb3ea97:'';return console[_0x25d90a(0xea)](),console[_0x25d90a(0xea)](_0x25d90a(0xd0)),console['log'](_0x25d90a(0x113)+_0x1d36eb+_0x25d90a(0xf5)),console[_0x25d90a(0xea)](_0x25d90a(0x113)+_0x1d36eb+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x27fc69){if(_0x27fc69 instanceof HTTPClientError&&_0x27fc69[_0x25d90a(0xcc)]===0x191)return printAuthError(_0x27fc69),0x1;return console[_0x25d90a(0x10d)](a7_0x32b3e4[_0x25d90a(0x10c)](_0x25d90a(0x103)+(_0x27fc69 instanceof Error?_0x27fc69[_0x25d90a(0xdb)]:String(_0x27fc69)))),console[_0x25d90a(0x10d)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x106402(0xe4)]=a7_0x106402(0xe7);[a7_0x106402(0xf4)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x106402(0xd4)](_0xe9cd97){const _0x2cba7b=a7_0x106402,{options:_0x4ec379,tdx:_0x18c969}=_0xe9cd97,_0x3ec5ab=_0x4ec379[_0x2cba7b(0xf8)],_0x5b6481=_0x4ec379[_0x2cba7b(0x10e)],_0x3034d=_0x5b6481?_0x5b6481:_0x2cba7b(0x109);console[_0x2cba7b(0xea)]('tdx\x20profile:\x20'+_0x3034d+_0x2cba7b(0xce)+_0x3ec5ab+')');const _0x138ca4=await getOAuthTokens(_0x5b6481);if(_0x138ca4)console[_0x2cba7b(0xea)]('Credential\x20type:\x20OAuth'),console[_0x2cba7b(0xea)]('Read\x20credential\x20from\x20keychain'+(_0x5b6481?_0x2cba7b(0xe5)+_0x5b6481+')':''));else{const _0x28cda3=await resolveAPIKeyAsync(_0x3ec5ab,_0x5b6481);if(_0x28cda3){const {source:_0x4494c1,isDeprecated:_0x365d8b}=_0x28cda3,_0x561cc3=_0x2cba7b(0xf3)+_0x4494c1;console[_0x2cba7b(0xea)](_0x365d8b?a7_0x32b3e4[_0x2cba7b(0xd9)](_0x561cc3):_0x561cc3);}else console[_0x2cba7b(0xea)](a7_0x32b3e4['yellow'](_0x2cba7b(0xd7)));}try{const _0x51632d=await _0x18c969[_0x2cba7b(0xf7)]['getUserInfo']();return console[_0x2cba7b(0xea)](a7_0x32b3e4['green']('✓\x20Authentication\x20successful\x0a')),console[_0x2cba7b(0xea)]('User:\x20'+_0x51632d[_0x2cba7b(0xe1)]),(_0x51632d[_0x2cba7b(0xe9)]||_0x51632d[_0x2cba7b(0xe3)])&&console[_0x2cba7b(0xea)](_0x2cba7b(0x101)+[_0x51632d['first_name'],_0x51632d[_0x2cba7b(0xe3)]][_0x2cba7b(0xde)](Boolean)[_0x2cba7b(0x105)]('\x20')),0x0;}catch(_0x5668a2){return _0x5668a2 instanceof HTTPClientError&&_0x5668a2[_0x2cba7b(0xcc)]===0x191?printAuthError(_0x5668a2,!![],_0x5b6481):console['error'](a7_0x32b3e4['red'](_0x2cba7b(0x103)+(_0x5668a2 instanceof Error?_0x5668a2[_0x2cba7b(0xdb)]:String(_0x5668a2)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x106402(0xe4)]=a7_0x106402(0x10a);['description']=a7_0x106402(0xee);async[a7_0x106402(0xd4)](_0x5e9b29){const _0x1c15e7=a7_0x106402,{options:_0x5628c1}=_0x5e9b29,_0xb73da0=_0x5628c1[_0x1c15e7(0x10e)];console[_0x1c15e7(0xea)](a7_0x32b3e4[_0x1c15e7(0xfe)](_0x1c15e7(0xf2)));const _0x1103e7=await isKeychainAvailable();if(!_0x1103e7)return console['error'](a7_0x32b3e4[_0x1c15e7(0x10c)](_0x1c15e7(0xd3))),0x1;const [_0x556465,_0x13071a]=await Promise[_0x1c15e7(0xcf)]([deleteKeychainAPIKey(_0xb73da0),deleteOAuthTokens(_0xb73da0)]);if(_0x556465||_0x13071a){clearCredentialCache();const _0x2f07ba=[_0x556465&&_0x1c15e7(0xdf),_0x13071a&&_0x1c15e7(0x111)][_0x1c15e7(0xde)](Boolean)[_0x1c15e7(0x105)](_0x1c15e7(0xc8));return console[_0x1c15e7(0xea)]('✓\x20'+_0x2f07ba+'\x20removed\x20from\x20keychain'+(_0xb73da0?_0x1c15e7(0xe5)+_0xb73da0+')':'')),0x0;}else return console['log'](_0x1c15e7(0xef)+(_0xb73da0?_0x1c15e7(0xcd)+_0xb73da0:'')),0x1;}}
1
+ const a7_0x4e9ffb=a7_0x5cc8;(function(_0x5a3db8,_0x53c917){const _0x307b53=a7_0x5cc8,_0x3ebae8=_0x5a3db8();while(!![]){try{const _0x387ee4=parseInt(_0x307b53(0x153))/0x1+-parseInt(_0x307b53(0x144))/0x2+-parseInt(_0x307b53(0x12f))/0x3+-parseInt(_0x307b53(0x134))/0x4*(-parseInt(_0x307b53(0x11e))/0x5)+-parseInt(_0x307b53(0x11b))/0x6+-parseInt(_0x307b53(0x12a))/0x7*(parseInt(_0x307b53(0x151))/0x8)+-parseInt(_0x307b53(0x125))/0x9*(-parseInt(_0x307b53(0x141))/0xa);if(_0x387ee4===_0x53c917)break;else _0x3ebae8['push'](_0x3ebae8['shift']());}catch(_0x566665){_0x3ebae8['push'](_0x3ebae8['shift']());}}}(a7_0xf15a,0xf2bec));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_0x5cc8(_0x3a6ea9,_0x485a2f){_0x3a6ea9=_0x3a6ea9-0x10b;const _0xf15a18=a7_0xf15a();let _0x5cc88e=_0xf15a18[_0x3a6ea9];return _0x5cc88e;}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_0x4232ab 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_0x53de96 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x4e9ffb(0x119)]=a7_0x4e9ffb(0x127);[a7_0x4e9ffb(0x11c)]=a7_0x4e9ffb(0x148);async['execute'](_0x57b09e){const _0x4a8cf1=a7_0x4e9ffb,{options:_0x52b467}=_0x57b09e,_0x319ffc=_0x52b467[_0x4a8cf1(0x137)];console[_0x4a8cf1(0x10e)](a7_0x53de96['bold'](_0x4a8cf1(0x120)));const _0x275a14=_0x52b467[_0x4a8cf1(0x154)]||'us01',_0x39996a=await promptSiteSelection(_0x275a14,_0x319ffc,'Setup\x20cancelled');if(!_0x39996a)return 0x1;const _0x259579=resolveSite(_0x39996a);if(isOAuthSupported(_0x259579)){const _0x55838c=await a7_0x4232ab({'type':_0x4a8cf1(0x138),'name':_0x4a8cf1(0x124),'message':'Choose\x20authentication\x20method:','choices':[{'title':_0x4a8cf1(0x131),'value':_0x4a8cf1(0x115)},{'title':_0x4a8cf1(0x156),'value':_0x4a8cf1(0x112)}]});if(!_0x55838c['method'])return console[_0x4a8cf1(0x10e)](_0x4a8cf1(0x12c)),0x1;if(_0x55838c[_0x4a8cf1(0x124)]==='oauth')return await runOAuthLoginFlow(_0x259579,_0x319ffc,_0x52b467[_0x4a8cf1(0x143)]??LogLevel[_0x4a8cf1(0x133)]),0x0;}console[_0x4a8cf1(0x10e)](_0x4a8cf1(0x12d)+_0x259579),console[_0x4a8cf1(0x10e)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console['log']('\x20\x20'+getConsoleUrl(_0x259579,_0x4a8cf1(0x136)));const _0x554fc5=await a7_0x4232ab({'type':_0x4a8cf1(0x114),'name':_0x4a8cf1(0x12b),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x46b1a2=>{const _0x106abf=_0x4a8cf1;if(!_0x46b1a2||!_0x46b1a2[_0x106abf(0x10c)]())return _0x106abf(0x146);return!![];}});if(!_0x554fc5[_0x4a8cf1(0x12b)])return console[_0x4a8cf1(0x10e)](_0x4a8cf1(0x12c)),0x1;const _0x43be0b=_0x554fc5[_0x4a8cf1(0x12b)];console[_0x4a8cf1(0x10e)](_0x4a8cf1(0x142));try{const _0x43f2a9=TDX[_0x4a8cf1(0x116)]({'site':_0x259579,'apiKey':_0x43be0b[_0x4a8cf1(0x10c)](),'logLevel':_0x52b467[_0x4a8cf1(0x143)]??LogLevel[_0x4a8cf1(0x133)]}),_0x440a34=await _0x43f2a9['jobs'][_0x4a8cf1(0x145)]();console[_0x4a8cf1(0x10e)](_0x4a8cf1(0x129)+_0x440a34['email']+')');const _0x4fc848=await isKeychainAvailable();_0x4fc848?(await saveAPIKeyAsync(_0x43be0b['trim'](),_0x259579,_0x319ffc),console[_0x4a8cf1(0x10e)](_0x4a8cf1(0x10b)+(_0x319ffc?_0x4a8cf1(0x147)+_0x319ffc+')':''))):(console[_0x4a8cf1(0x126)](a7_0x53de96[_0x4a8cf1(0x111)](_0x4a8cf1(0x13b))),console[_0x4a8cf1(0x126)](a7_0x53de96['yellow']('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x319ffc){const _0x1aa422={'site':_0x259579};saveProfileToUserConfig(_0x319ffc,_0x1aa422),console[_0x4a8cf1(0x10e)]('✓\x20Profile\x20\x27'+_0x319ffc+_0x4a8cf1(0x121));}else saveDefaultSiteToUserConfig(_0x259579),console[_0x4a8cf1(0x10e)](_0x4a8cf1(0x10d)+_0x259579);const _0xb992f=_0x319ffc?_0x4a8cf1(0x14f)+_0x319ffc:'';return console['log'](),console[_0x4a8cf1(0x10e)](_0x4a8cf1(0x110)),console['log'](_0x4a8cf1(0x150)+_0xb992f+_0x4a8cf1(0x14b)),console[_0x4a8cf1(0x10e)](_0x4a8cf1(0x150)+_0xb992f+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x517287){if(_0x517287 instanceof HTTPClientError&&_0x517287[_0x4a8cf1(0x14c)]===0x191)return printAuthError(_0x517287),0x1;return console[_0x4a8cf1(0x158)](a7_0x53de96[_0x4a8cf1(0x122)](_0x4a8cf1(0x140)+(_0x517287 instanceof Error?_0x517287[_0x4a8cf1(0x117)]:String(_0x517287)))),console[_0x4a8cf1(0x158)](_0x4a8cf1(0x12e)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x4e9ffb(0x11a);['description']=a7_0x4e9ffb(0x159);async['execute'](_0x5ac0b2){const _0x23d59d=a7_0x4e9ffb,{options:_0x29aea8,tdx:_0x20abe0}=_0x5ac0b2,_0x2e4b73=_0x29aea8[_0x23d59d(0x154)],_0x11dc13=_0x29aea8[_0x23d59d(0x137)],_0x3945d2=_0x11dc13?_0x11dc13:_0x23d59d(0x14a);console[_0x23d59d(0x10e)](_0x23d59d(0x11d)+_0x3945d2+_0x23d59d(0x135)+_0x2e4b73+')');const _0x5acbdd=await getOAuthTokens(_0x11dc13);if(_0x5acbdd)console[_0x23d59d(0x10e)]('Credential\x20type:\x20OAuth'),console[_0x23d59d(0x10e)]('Read\x20credential\x20from\x20keychain'+(_0x11dc13?_0x23d59d(0x147)+_0x11dc13+')':''));else{const _0x2a872a=await resolveAPIKeyAsync(_0x2e4b73,_0x11dc13);if(_0x2a872a){const {source:_0x2ed289,isDeprecated:_0xca7415}=_0x2a872a,_0x27a901='Read\x20credential\x20from\x20'+_0x2ed289;console[_0x23d59d(0x10e)](_0xca7415?a7_0x53de96[_0x23d59d(0x111)](_0x27a901):_0x27a901);}else console[_0x23d59d(0x10e)](a7_0x53de96[_0x23d59d(0x111)](_0x23d59d(0x14d)));}try{const _0x5ceafc=await _0x20abe0[_0x23d59d(0x128)][_0x23d59d(0x145)]();return console[_0x23d59d(0x10e)](a7_0x53de96[_0x23d59d(0x139)](_0x23d59d(0x123))),console[_0x23d59d(0x10e)](_0x23d59d(0x157)+_0x5ceafc[_0x23d59d(0x130)]),(_0x5ceafc[_0x23d59d(0x11f)]||_0x5ceafc['last_name'])&&console[_0x23d59d(0x10e)](_0x23d59d(0x113)+[_0x5ceafc['first_name'],_0x5ceafc[_0x23d59d(0x13f)]][_0x23d59d(0x13c)](Boolean)[_0x23d59d(0x132)]('\x20')),0x0;}catch(_0x50afa4){return _0x50afa4 instanceof HTTPClientError&&_0x50afa4[_0x23d59d(0x14c)]===0x191?printAuthError(_0x50afa4,!![],_0x11dc13):console[_0x23d59d(0x158)](a7_0x53de96[_0x23d59d(0x122)]('✗\x20Validation\x20failed:\x20'+(_0x50afa4 instanceof Error?_0x50afa4[_0x23d59d(0x117)]:String(_0x50afa4)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x4e9ffb(0x119)]=a7_0x4e9ffb(0x155);[a7_0x4e9ffb(0x11c)]=a7_0x4e9ffb(0x14e);async[a7_0x4e9ffb(0x10f)](_0x216583){const _0xb0d5ae=a7_0x4e9ffb,{options:_0x310248}=_0x216583,_0x3adff6=_0x310248['profile'];console[_0xb0d5ae(0x10e)](a7_0x53de96['bold']('tdx:\x20auth\x20clear'));const _0x424d37=await isKeychainAvailable();if(!_0x424d37)return console[_0xb0d5ae(0x158)](a7_0x53de96[_0xb0d5ae(0x122)](_0xb0d5ae(0x13a))),0x1;const [_0x17f548,_0x4aad1e]=await Promise[_0xb0d5ae(0x149)]([deleteKeychainAPIKey(_0x3adff6),deleteOAuthTokens(_0x3adff6)]);if(_0x17f548||_0x4aad1e){clearCredentialCache();const _0x30105c=[_0x17f548&&_0xb0d5ae(0x13e),_0x4aad1e&&'OAuth\x20tokens']['filter'](Boolean)['join'](_0xb0d5ae(0x118));return console[_0xb0d5ae(0x10e)]('✓\x20'+_0x30105c+_0xb0d5ae(0x13d)+(_0x3adff6?_0xb0d5ae(0x147)+_0x3adff6+')':'')),0x0;}else return console[_0xb0d5ae(0x10e)]('No\x20credentials\x20found\x20in\x20keychain'+(_0x3adff6?_0xb0d5ae(0x152)+_0x3adff6:'')),0x1;}}function a7_0xf15a(){const _0x43e034=['✗\x20Validation\x20failed:\x20','2860710sZBrel','Validating\x20API\x20key...','logLevel','1988758vltlmY','getUserInfo','API\x20key\x20cannot\x20be\x20empty','\x20(profile:\x20','Setup\x20API\x20key\x20authentication\x20interactively','all','N/A','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','status','No\x20credential\x20found','Remove\x20API\x20key\x20from\x20system\x20keychain','\x20--profile\x20','\x20\x20tdx','1192656OWPsEn','\x20for\x20profile:\x20','153647zXionj','site','auth:clear','API\x20Key','User:\x20','error','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','trim','✓\x20Default\x20site\x20set\x20to\x20','log','execute','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','yellow','apikey','Name:\x20','password','oauth','create','message','\x20and\x20','name','auth','1056966nvKdpM','description','tdx\x20profile:\x20','85IyWqZY','first_name','tdx:\x20auth\x20setup','\x27\x20registered','red','✓\x20Authentication\x20successful\x0a','method','81QhoJKC','warn','auth:setup','jobs','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','63srccXb','apiKey','\x0aSetup\x20cancelled','Setting\x20up\x20authentication\x20for\x20site:\x20','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','3049803GUAYJi','email','OAuth\x20(browser\x20login)','join','ERROR','422324zpLZry','\x20(site:\x20','/app/mp/ak','profile','select','green','System\x20keychain\x20is\x20not\x20available','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','filter','\x20removed\x20from\x20keychain','API\x20key','last_name'];a7_0xf15a=function(){return _0x43e034;};return a7_0xf15a();}
@@ -1 +1 @@
1
- const a8_0x507130=a8_0x250a;(function(_0x513095,_0x48ca13){const _0x3005a1=a8_0x250a,_0x21802b=_0x513095();while(!![]){try{const _0xcb9b8=-parseInt(_0x3005a1(0x162))/0x1+parseInt(_0x3005a1(0x160))/0x2+parseInt(_0x3005a1(0x14d))/0x3*(-parseInt(_0x3005a1(0x15c))/0x4)+parseInt(_0x3005a1(0x15d))/0x5+parseInt(_0x3005a1(0x14c))/0x6*(parseInt(_0x3005a1(0x161))/0x7)+parseInt(_0x3005a1(0x16c))/0x8+-parseInt(_0x3005a1(0x149))/0x9*(parseInt(_0x3005a1(0x154))/0xa);if(_0xcb9b8===_0x48ca13)break;else _0x21802b['push'](_0x21802b['shift']());}catch(_0x5b4a08){_0x21802b['push'](_0x21802b['shift']());}}}(a8_0x43f5,0x79b06));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';function a8_0x250a(_0xfdfe99,_0x5cc6ae){_0xfdfe99=_0xfdfe99-0x147;const _0x43f524=a8_0x43f5();let _0x250ae4=_0x43f524[_0xfdfe99];return _0x250ae4;}import{saveProfileToUserConfig}from'../core/profile.js';function a8_0x43f5(){const _0x5c69dd=['email','207TMiBrU','us01','ERROR','528nHxlmB','33756KIfBKP','✓\x20Authentication\x20successful\x20(User:\x20','description','tdx:\x20auth\x20login','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','/oauth/authorize','bold','369750DZsHHu','create','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','name','Login\x20cancelled','log','logLevel','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','168aIDYha','3742065FtPLma','\x20\x20tdx','green','59468asnDWq','34951haqnUT','315310DLUfuW','Opening\x20browser\x20for\x20authentication...','profile','site','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','\x20--profile\x20','jobs','✓\x20Profile\x20\x27','access_token','execute','7353808CXycmV','auth:login'];a8_0x43f5=function(){return _0x5c69dd;};return a8_0x43f5();}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_0x13db31 from'chalk';export async function runOAuthLoginFlow(_0x3725ea,_0x5bae6c,_0x3d62df){const _0x42a6e4=a8_0x250a;if(!isOAuthSupported(_0x3725ea))throw new Error('OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20'+_0x3725ea+'.\x20'+_0x42a6e4(0x166)+_0x42a6e4(0x15b));const _0x4fccf6=await isKeychainAvailable();if(!_0x4fccf6)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+_0x42a6e4(0x15b));const _0x294a32=getConsoleUrl(_0x3725ea);console['log'](_0x42a6e4(0x163)),console[_0x42a6e4(0x159)]('\x20\x20'+_0x294a32+_0x42a6e4(0x152)),console[_0x42a6e4(0x159)]('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0x18868f=await startOAuthFlow(_0x3725ea);console['log']('Validating\x20OAuth\x20tokens...');const _0x3ebf58=TDX[_0x42a6e4(0x155)]({'site':_0x3725ea,'accessToken':_0x18868f[_0x42a6e4(0x16a)],'logLevel':_0x3d62df??LogLevel[_0x42a6e4(0x14b)]}),_0x5dd6f6=await _0x3ebf58[_0x42a6e4(0x168)]['getUserInfo']();console[_0x42a6e4(0x159)](a8_0x13db31[_0x42a6e4(0x15f)](_0x42a6e4(0x14e)+_0x5dd6f6[_0x42a6e4(0x148)]+')')),await saveOAuthTokens(_0x18868f,_0x5bae6c),console[_0x42a6e4(0x159)]('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x5bae6c?'\x20(profile:\x20'+_0x5bae6c+')':''));if(_0x5bae6c){const _0x54d0c3={'site':_0x3725ea};saveProfileToUserConfig(_0x5bae6c,_0x54d0c3),console[_0x42a6e4(0x159)](_0x42a6e4(0x169)+_0x5bae6c+'\x27\x20registered');}const _0x14d345=_0x5bae6c?_0x42a6e4(0x167)+_0x5bae6c:'';console[_0x42a6e4(0x159)](),console[_0x42a6e4(0x159)](_0x42a6e4(0x156)),console[_0x42a6e4(0x159)](_0x42a6e4(0x15e)+_0x14d345+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x42a6e4(0x159)](_0x42a6e4(0x15e)+_0x14d345+_0x42a6e4(0x151));}export class AuthLoginCommand extends BaseCommand{[a8_0x507130(0x157)]=a8_0x507130(0x147);[a8_0x507130(0x14f)]='Login\x20via\x20OAuth\x20(opens\x20browser)';async[a8_0x507130(0x16b)](_0x1ff988){const _0x53eb7a=a8_0x507130,{options:_0x1f206e}=_0x1ff988,_0x352b76=_0x1f206e[_0x53eb7a(0x164)];console[_0x53eb7a(0x159)](a8_0x13db31[_0x53eb7a(0x153)](_0x53eb7a(0x150)));const _0x17175f=_0x1f206e[_0x53eb7a(0x165)]||_0x53eb7a(0x14a),_0x109f2c=await promptSiteSelection(_0x17175f,_0x352b76,_0x53eb7a(0x158));if(!_0x109f2c)return 0x1;const _0x17a623=resolveSite(_0x109f2c);return console[_0x53eb7a(0x159)]('Authenticating\x20via\x20OAuth\x20for\x20site:\x20'+_0x17a623),await runOAuthLoginFlow(_0x17a623,_0x352b76,_0x1f206e[_0x53eb7a(0x15a)]??LogLevel[_0x53eb7a(0x14b)]),0x0;}}
1
+ const a8_0x56d19c=a8_0x246d;(function(_0x1d9584,_0x1448a4){const _0x3b5b8a=a8_0x246d,_0x1f1c33=_0x1d9584();while(!![]){try{const _0x3a4c1e=parseInt(_0x3b5b8a(0x1f6))/0x1*(parseInt(_0x3b5b8a(0x1fc))/0x2)+parseInt(_0x3b5b8a(0x1f5))/0x3*(-parseInt(_0x3b5b8a(0x21a))/0x4)+parseInt(_0x3b5b8a(0x208))/0x5*(-parseInt(_0x3b5b8a(0x217))/0x6)+-parseInt(_0x3b5b8a(0x1ff))/0x7+-parseInt(_0x3b5b8a(0x212))/0x8+parseInt(_0x3b5b8a(0x209))/0x9+parseInt(_0x3b5b8a(0x20f))/0xa*(parseInt(_0x3b5b8a(0x219))/0xb);if(_0x3a4c1e===_0x1448a4)break;else _0x1f1c33['push'](_0x1f1c33['shift']());}catch(_0x2d414c){_0x1f1c33['push'](_0x1f1c33['shift']());}}}(a8_0x5616,0x55754));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';function a8_0x5616(){const _0x4b6a0d=['logLevel','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','green','Login\x20via\x20OAuth\x20(opens\x20browser)','execute','10MOETNC','1470915hVbIMG','✓\x20Profile\x20\x27','auth:login','✓\x20Authentication\x20successful\x20(User:\x20','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','site','10607880dWGlGT','tdx:\x20auth\x20login','\x27\x20registered','1533368GlOumS','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','us01','access_token','\x20\x20tdx','2016348oauuSE','log','11ROCPoB','8852FjRjFD','email','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','258IbiDDe','16mKRnQs','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','\x20(profile:\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','create','description','72626uRzMPn','\x20--profile\x20','/oauth/authorize','2807630JdkmCN','Opening\x20browser\x20for\x20authentication...','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','ERROR'];a8_0x5616=function(){return _0x4b6a0d;};return a8_0x5616();}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';function a8_0x246d(_0xea2b4d,_0x3edda7){_0xea2b4d=_0xea2b4d-0x1f2;const _0x5616fd=a8_0x5616();let _0x246d72=_0x5616fd[_0xea2b4d];return _0x246d72;}import{LogLevel}from'../utils/tdx-logger.js';import a8_0x3bef8d from'chalk';export async function runOAuthLoginFlow(_0x52fdad,_0x412a97,_0x2e32ae){const _0x12bf87=a8_0x246d;if(!isOAuthSupported(_0x52fdad))throw new Error(_0x12bf87(0x213)+_0x52fdad+'.\x20'+'OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20'+_0x12bf87(0x204));const _0x29474e=await isKeychainAvailable();if(!_0x29474e)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+_0x12bf87(0x204));const _0x7fdee9=getConsoleUrl(_0x52fdad);console[_0x12bf87(0x218)](_0x12bf87(0x200)),console[_0x12bf87(0x218)]('\x20\x20'+_0x7fdee9+_0x12bf87(0x1fe)),console[_0x12bf87(0x218)](_0x12bf87(0x1f7));const _0x368948=await startOAuthFlow(_0x52fdad);console[_0x12bf87(0x218)]('Validating\x20OAuth\x20tokens...');const _0xb4009e=TDX[_0x12bf87(0x1fa)]({'site':_0x52fdad,'accessToken':_0x368948[_0x12bf87(0x215)],'logLevel':_0x2e32ae??LogLevel[_0x12bf87(0x202)]}),_0x4e4300=await _0xb4009e['jobs']['getUserInfo']();console[_0x12bf87(0x218)](a8_0x3bef8d[_0x12bf87(0x205)](_0x12bf87(0x20c)+_0x4e4300[_0x12bf87(0x1f2)]+')')),await saveOAuthTokens(_0x368948,_0x412a97),console['log'](_0x12bf87(0x20d)+(_0x412a97?_0x12bf87(0x1f8)+_0x412a97+')':''));if(_0x412a97){const _0x35fd5b={'site':_0x52fdad};saveProfileToUserConfig(_0x412a97,_0x35fd5b),console[_0x12bf87(0x218)](_0x12bf87(0x20a)+_0x412a97+_0x12bf87(0x211));}const _0x1142ee=_0x412a97?_0x12bf87(0x1fd)+_0x412a97:'';console[_0x12bf87(0x218)](),console['log'](_0x12bf87(0x201)),console['log']('\x20\x20tdx'+_0x1142ee+_0x12bf87(0x1f9)),console[_0x12bf87(0x218)](_0x12bf87(0x216)+_0x1142ee+_0x12bf87(0x1f4));}export class AuthLoginCommand extends BaseCommand{['name']=a8_0x56d19c(0x20b);[a8_0x56d19c(0x1fb)]=a8_0x56d19c(0x206);async[a8_0x56d19c(0x207)](_0x57137a){const _0x17bec5=a8_0x56d19c,{options:_0x357f37}=_0x57137a,_0x4ed82f=_0x357f37['profile'];console[_0x17bec5(0x218)](a8_0x3bef8d['bold'](_0x17bec5(0x210)));const _0x41567d=_0x357f37[_0x17bec5(0x20e)]||_0x17bec5(0x214),_0x2bc543=await promptSiteSelection(_0x41567d,_0x4ed82f,'Login\x20cancelled');if(!_0x2bc543)return 0x1;const _0x577bea=resolveSite(_0x2bc543);return console[_0x17bec5(0x218)](_0x17bec5(0x1f3)+_0x577bea),await runOAuthLoginFlow(_0x577bea,_0x4ed82f,_0x357f37[_0x17bec5(0x203)]??LogLevel['ERROR']),0x0;}}