@treasuredata/tdx 0.20.1 → 0.20.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) 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/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/llm-proxy.js +1 -1
  24. package/dist/commands/mcp-command.js +1 -1
  25. package/dist/commands/parent-segment-command.js +1 -1
  26. package/dist/commands/profile-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/schedule-command.js +1 -1
  30. package/dist/commands/segment-command.js +1 -1
  31. package/dist/commands/segment-create-command.js +1 -1
  32. package/dist/commands/segment-fields-command.js +1 -1
  33. package/dist/commands/segment-pull-command.js +1 -1
  34. package/dist/commands/segment-push-command.js +1 -1
  35. package/dist/commands/segment-update-command.js +1 -1
  36. package/dist/commands/segment-use-command.js +1 -1
  37. package/dist/commands/segment-validate-command.js +1 -1
  38. package/dist/commands/segments.js +1 -1
  39. package/dist/commands/show.js +1 -1
  40. package/dist/commands/status-command.js +1 -1
  41. package/dist/commands/tables.js +1 -1
  42. package/dist/commands/unset-command.js +1 -1
  43. package/dist/commands/use-command.js +1 -1
  44. package/dist/commands/user-command.js +1 -1
  45. package/dist/commands/workflow-command.js +1 -1
  46. package/dist/core/auth.js +1 -1
  47. package/dist/core/command-output.js +1 -1
  48. package/dist/core/config.js +1 -1
  49. package/dist/core/connection-cache.js +1 -1
  50. package/dist/core/constants.js +1 -1
  51. package/dist/core/credential-cache.js +1 -1
  52. package/dist/core/global-context.js +1 -1
  53. package/dist/core/keychain.js +1 -1
  54. package/dist/core/profile.js +1 -1
  55. package/dist/core/project-config.js +1 -1
  56. package/dist/core/session.js +1 -1
  57. package/dist/core/user-cache.js +1 -1
  58. package/dist/core/version.js +1 -1
  59. package/dist/index.js +1 -1
  60. package/dist/mcp/server.js +1 -1
  61. package/dist/mcp/tools/index.js +1 -1
  62. package/dist/mcp/tools/tdx-run.js +1 -1
  63. package/dist/mcp/tools/tdx-search.js +1 -1
  64. package/dist/mcp/utils.js +1 -1
  65. package/dist/proxy/anthropic-adapter.js +1 -1
  66. package/dist/proxy/claude-usage-tracker.js +1 -1
  67. package/dist/proxy/context-signature.js +1 -1
  68. package/dist/proxy/conversation-utils.js +1 -1
  69. package/dist/proxy/passthrough-server.js +1 -1
  70. package/dist/proxy/server.js +1 -1
  71. package/dist/proxy/session-cache.js +1 -1
  72. package/dist/proxy/sse-usage-parser.js +1 -1
  73. package/dist/sdk/agent/agent-config.js +1 -1
  74. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  75. package/dist/sdk/agent/agent-yaml.js +1 -1
  76. package/dist/sdk/agent/test/evaluator.js +1 -1
  77. package/dist/sdk/agent/test/executor.js +1 -1
  78. package/dist/sdk/agent/test/index.js +1 -1
  79. package/dist/sdk/agent/test/output.js +1 -1
  80. package/dist/sdk/agent/test/parser.js +1 -1
  81. package/dist/sdk/api.js +1 -1
  82. package/dist/sdk/client/cdp-api-client.js +1 -1
  83. package/dist/sdk/client/endpoints.js +1 -1
  84. package/dist/sdk/client/engage-api-client.js +1 -1
  85. package/dist/sdk/client/http-client.js +1 -1
  86. package/dist/sdk/client/llm-api-client.js +1 -1
  87. package/dist/sdk/client/rate-limiter.js +1 -1
  88. package/dist/sdk/client/td-api-client.js +1 -1
  89. package/dist/sdk/client/trino-api-client.js +1 -1
  90. package/dist/sdk/client/workflow-client.js +1 -1
  91. package/dist/sdk/connection-validator.js +1 -1
  92. package/dist/sdk/connection.js +1 -1
  93. package/dist/sdk/engage.js +1 -1
  94. package/dist/sdk/errors.js +1 -1
  95. package/dist/sdk/index.js +1 -1
  96. package/dist/sdk/io/index.js +1 -1
  97. package/dist/sdk/io/node-filesystem.js +1 -1
  98. package/dist/sdk/job.js +1 -1
  99. package/dist/sdk/journey.js +1 -1
  100. package/dist/sdk/llm/chat-cache.js +1 -1
  101. package/dist/sdk/llm/index.js +1 -1
  102. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  103. package/dist/sdk/llm/model-aliases.js +1 -1
  104. package/dist/sdk/llm/model-factors.js +1 -1
  105. package/dist/sdk/query/index.js +1 -1
  106. package/dist/sdk/query/sql-parser.js +1 -1
  107. package/dist/sdk/schedule.js +1 -1
  108. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  109. package/dist/sdk/segment/fields-display.js +1 -1
  110. package/dist/sdk/segment/file-discovery.js +1 -1
  111. package/dist/sdk/segment/journey-utils.js +1 -1
  112. package/dist/sdk/segment/journey-yaml.js +1 -1
  113. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  114. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  115. package/dist/sdk/segment/pull-workflow.js +1 -1
  116. package/dist/sdk/segment/push-workflow.js +1 -1
  117. package/dist/sdk/segment/resolution-context.js +1 -1
  118. package/dist/sdk/segment/segment-path-parser.js +1 -1
  119. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  120. package/dist/sdk/segment/target-resolution.js +1 -1
  121. package/dist/sdk/segment/tdx-config.js +1 -1
  122. package/dist/sdk/segment/validate-files.js +1 -1
  123. package/dist/sdk/segment/yaml-validator.js +1 -1
  124. package/dist/sdk/segment.js +1 -1
  125. package/dist/sdk/types/index.js +1 -1
  126. package/dist/sdk/types/progress.js +1 -1
  127. package/dist/sdk/user.js +1 -1
  128. package/dist/sdk/util/format-detector.js +1 -1
  129. package/dist/sdk/util/formatters.js +1 -1
  130. package/dist/sdk/util/index.js +1 -1
  131. package/dist/sdk/util/tree-formatter.js +1 -1
  132. package/dist/sdk/workflow/archive-validation.js +1 -1
  133. package/dist/sdk/workflow/clone-workflow.js +1 -1
  134. package/dist/sdk/workflow/index.js +1 -1
  135. package/dist/sdk/workflow/pull-workflow.js +1 -1
  136. package/dist/sdk/workflow/push-workflow.js +1 -1
  137. package/dist/sdk/workflow/tdx-config.js +1 -1
  138. package/dist/sdk/workflow/workflow-utils.js +1 -1
  139. package/dist/test-utils/command-runner.js +1 -1
  140. package/dist/test-utils/factories.js +1 -1
  141. package/dist/test-utils/fixtures.js +1 -1
  142. package/dist/test-utils/http-mock.js +1 -1
  143. package/dist/test-utils/index.js +1 -1
  144. package/dist/utils/async.js +1 -1
  145. package/dist/utils/colors.js +1 -1
  146. package/dist/utils/diff.js +1 -1
  147. package/dist/utils/file-permissions.js +1 -1
  148. package/dist/utils/global-cache.js +1 -1
  149. package/dist/utils/json-loader.js +1 -1
  150. package/dist/utils/local-cache.js +1 -1
  151. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  152. package/dist/utils/logger/formatters/index.js +1 -1
  153. package/dist/utils/logger/handlers/console-handler.js +1 -1
  154. package/dist/utils/logger/handlers/file-handler.js +1 -1
  155. package/dist/utils/logger/handlers/index.js +1 -1
  156. package/dist/utils/logger/handlers/null-handler.js +1 -1
  157. package/dist/utils/logger/index.js +1 -1
  158. package/dist/utils/logger/logger.js +1 -1
  159. package/dist/utils/logger/types.js +1 -1
  160. package/dist/utils/option-validation.js +1 -1
  161. package/dist/utils/port.js +1 -1
  162. package/dist/utils/process.js +1 -1
  163. package/dist/utils/prompt.js +1 -1
  164. package/dist/utils/spinner.js +1 -1
  165. package/dist/utils/sse-parser.js +1 -1
  166. package/dist/utils/string-utils.js +1 -1
  167. package/dist/utils/table-ref-parser.js +1 -1
  168. package/dist/utils/tdx-logger.js +1 -1
  169. package/dist/utils/version-check.js +1 -1
  170. package/package.json +1 -1
@@ -1 +1 @@
1
- function a3_0x2a26(_0x5e9cba,_0x2d3de2){_0x5e9cba=_0x5e9cba-0x125;const _0x389d09=a3_0x389d();let _0x2a2620=_0x389d09[_0x5e9cba];return _0x2a2620;}const a3_0x2dd838=a3_0x2a26;function a3_0x389d(){const _0x3809af=['data','execute','Error:\x20','Resolved\x20parent\x20ID:\x20','8204640VtxwvD','3246RBYAJw','verbose','1QrhCOP','181418jGmZHA','segment','Parent\x20name:\x20','\x20\x20Cause:\x20','List\x20activations\x20for\x20a\x20segment','\x27...','1071iVZlbg','Resolved\x20child\x20ID:\x20','activations','10912qsIGOn','102504Mzzvmj','cause','resolveSegmentId','Site:\x20','2685bFOAjG','9142HuRDEB','Child\x20name:\x20','1240035WcLQrR','✔\x20Found\x20','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','length','\x20activation','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','error','4472864ADUQOY','Error:\x20Segment\x20name\x20is\x20required','site','Resolving\x20parent\x20segment\x20\x27','resolveParentId','Listing\x20activations\x20for\x20segment\x20\x27'];a3_0x389d=function(){return _0x3809af;};return a3_0x389d();}(function(_0x14cfee,_0x5e1a5e){const _0x2ad8f5=a3_0x2a26,_0x3ced24=_0x14cfee();while(!![]){try{const _0x53920c=parseInt(_0x2ad8f5(0x145))/0x1*(parseInt(_0x2ad8f5(0x146))/0x2)+-parseInt(_0x2ad8f5(0x131))/0x3+parseInt(_0x2ad8f5(0x129))/0x4*(-parseInt(_0x2ad8f5(0x12e))/0x5)+-parseInt(_0x2ad8f5(0x143))/0x6*(-parseInt(_0x2ad8f5(0x12f))/0x7)+parseInt(_0x2ad8f5(0x12a))/0x8*(parseInt(_0x2ad8f5(0x126))/0x9)+parseInt(_0x2ad8f5(0x142))/0xa+-parseInt(_0x2ad8f5(0x138))/0xb;if(_0x53920c===_0x5e1a5e)break;else _0x3ced24['push'](_0x3ced24['shift']());}catch(_0x522c69){_0x3ced24['push'](_0x3ced24['shift']());}}}(a3_0x389d,0xd15d9));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{['name']=a3_0x2dd838(0x128);['description']=a3_0x2dd838(0x14a);async[a3_0x2dd838(0x13f)](_0x169039){const _0x54a418=a3_0x2dd838,{options:_0x56fe29,args:_0x10a992,tdx:_0x2f0dfa}=_0x169039;if(_0x10a992['length']===0x0)return console[_0x54a418(0x137)](_0x54a418(0x139)),console[_0x54a418(0x137)](_0x54a418(0x136)),0x1;try{const {parentId:_0x3e4df7,childId:_0xb7757f}=parseSegmentRef(_0x10a992[0x0]);if(!_0xb7757f)return console[_0x54a418(0x137)](_0x54a418(0x133)),console[_0x54a418(0x137)](_0x54a418(0x136)),0x1;_0x56fe29[_0x54a418(0x144)]&&(console[_0x54a418(0x137)](_0x54a418(0x12d)+_0x56fe29[_0x54a418(0x13a)]),console[_0x54a418(0x137)](_0x54a418(0x148)+_0x3e4df7),console['error'](_0x54a418(0x130)+_0xb7757f));const _0x1f372f=await withSpinner(_0x54a418(0x13b)+_0x3e4df7+'\x27...',()=>_0x2f0dfa[_0x54a418(0x147)][_0x54a418(0x13c)](_0x3e4df7),{'verbose':_0x56fe29[_0x54a418(0x144)]}),_0x494f4e=_0x1f372f[_0x54a418(0x13e)];_0x56fe29[_0x54a418(0x144)]&&console['error'](_0x54a418(0x141)+_0x494f4e);const _0x5a9af9=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0xb7757f+_0x54a418(0x125),()=>_0x2f0dfa['segment'][_0x54a418(0x12c)](_0x494f4e,_0xb7757f),{'verbose':_0x56fe29[_0x54a418(0x144)]}),_0x3cdbbe=_0x5a9af9['data'];_0x56fe29[_0x54a418(0x144)]&&console[_0x54a418(0x137)](_0x54a418(0x127)+_0x3cdbbe);const _0x109ef5=await withSpinner(_0x54a418(0x13d)+_0xb7757f+_0x54a418(0x125),()=>_0x2f0dfa[_0x54a418(0x147)]['listActivations'](_0x494f4e,_0x3cdbbe),{'verbose':_0x56fe29['verbose']}),_0x599dc8=_0x109ef5[_0x54a418(0x13e)];return console[_0x54a418(0x137)](_0x54a418(0x132)+_0x599dc8['length']+_0x54a418(0x135)+(_0x599dc8[_0x54a418(0x134)]!==0x1?'s':'')),await handleSDKOutput(_0x599dc8,_0x56fe29),0x0;}catch(_0xcb8178){if(_0xcb8178 instanceof SDKError)return console[_0x54a418(0x137)](_0x54a418(0x140)+_0xcb8178['message']),_0xcb8178[_0x54a418(0x12b)]&&console[_0x54a418(0x137)](_0x54a418(0x149)+_0xcb8178[_0x54a418(0x12b)]),0x1;throw _0xcb8178;}}}
1
+ const a3_0x540eba=a3_0x2d1f;(function(_0x1e64ba,_0x113c6c){const _0x2714cf=a3_0x2d1f,_0x1e0168=_0x1e64ba();while(!![]){try{const _0x57cea3=parseInt(_0x2714cf(0xa8))/0x1+parseInt(_0x2714cf(0xab))/0x2+parseInt(_0x2714cf(0xae))/0x3+parseInt(_0x2714cf(0xa4))/0x4*(-parseInt(_0x2714cf(0xbd))/0x5)+-parseInt(_0x2714cf(0xbc))/0x6*(parseInt(_0x2714cf(0xb4))/0x7)+parseInt(_0x2714cf(0xbb))/0x8*(parseInt(_0x2714cf(0xa3))/0x9)+-parseInt(_0x2714cf(0xa2))/0xa*(parseInt(_0x2714cf(0xa7))/0xb);if(_0x57cea3===_0x113c6c)break;else _0x1e0168['push'](_0x1e0168['shift']());}catch(_0x3bc857){_0x1e0168['push'](_0x1e0168['shift']());}}}(a3_0x5507,0x7e343));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_0x540eba(0xaf)]=a3_0x540eba(0xad);[a3_0x540eba(0xb0)]=a3_0x540eba(0xa0);async[a3_0x540eba(0xb3)](_0x12ad50){const _0x177dfe=a3_0x540eba,{options:_0x11636f,args:_0x3d1f86,tdx:_0x510887}=_0x12ad50;if(_0x3d1f86[_0x177dfe(0xba)]===0x0)return console[_0x177dfe(0xb6)]('Error:\x20Segment\x20name\x20is\x20required'),console[_0x177dfe(0xb6)](_0x177dfe(0xa9)),0x1;try{const {parentId:_0x23b658,childId:_0x43c80c}=parseSegmentRef(_0x3d1f86[0x0]);if(!_0x43c80c)return console[_0x177dfe(0xb6)](_0x177dfe(0xb5)),console[_0x177dfe(0xb6)](_0x177dfe(0xa9)),0x1;_0x11636f[_0x177dfe(0xa6)]&&(console['error'](_0x177dfe(0xb7)+_0x11636f[_0x177dfe(0x9c)]),console[_0x177dfe(0xb6)](_0x177dfe(0x9e)+_0x23b658),console['error'](_0x177dfe(0xa1)+_0x43c80c));const _0x353ac5=await withSpinner(_0x177dfe(0x99)+_0x23b658+_0x177dfe(0xb2),()=>_0x510887[_0x177dfe(0x96)][_0x177dfe(0x9a)](_0x23b658),{'verbose':_0x11636f[_0x177dfe(0xa6)]}),_0x1a6db2=_0x353ac5['data'];_0x11636f[_0x177dfe(0xa6)]&&console[_0x177dfe(0xb6)](_0x177dfe(0xaa)+_0x1a6db2);const _0x3255ad=await withSpinner(_0x177dfe(0x97)+_0x43c80c+_0x177dfe(0xb2),()=>_0x510887[_0x177dfe(0x96)][_0x177dfe(0x9d)](_0x1a6db2,_0x43c80c),{'verbose':_0x11636f['verbose']}),_0x4a9780=_0x3255ad[_0x177dfe(0xb8)];_0x11636f[_0x177dfe(0xa6)]&&console['error'](_0x177dfe(0x9f)+_0x4a9780);const _0x5dea00=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x43c80c+'\x27...',()=>_0x510887[_0x177dfe(0x96)][_0x177dfe(0xb9)](_0x1a6db2,_0x4a9780),{'verbose':_0x11636f[_0x177dfe(0xa6)]}),_0x4fff8c=_0x5dea00[_0x177dfe(0xb8)];return console[_0x177dfe(0xb6)](_0x177dfe(0x9b)+_0x4fff8c[_0x177dfe(0xba)]+_0x177dfe(0xa5)+(_0x4fff8c['length']!==0x1?'s':'')),await handleSDKOutput(_0x4fff8c,_0x11636f),0x0;}catch(_0xc72313){if(_0xc72313 instanceof SDKError)return console[_0x177dfe(0xb6)](_0x177dfe(0x98)+_0xc72313['message']),_0xc72313[_0x177dfe(0xac)]&&console['error'](_0x177dfe(0xb1)+_0xc72313[_0x177dfe(0xac)]),0x1;throw _0xc72313;}}}function a3_0x2d1f(_0x779adc,_0x3104e5){_0x779adc=_0x779adc-0x96;const _0x55079d=a3_0x5507();let _0x2d1fa3=_0x55079d[_0x779adc];return _0x2d1fa3;}function a3_0x5507(){const _0x54f806=['24363bQEzZE','60136buvcPE','\x20activation','verbose','11CJZYgj','814011fMDOzf','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Resolved\x20parent\x20ID:\x20','1756776gifiDr','cause','activations','2408607TzISdM','name','description','\x20\x20Cause:\x20','\x27...','execute','7tHDhXQ','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','error','Site:\x20','data','listActivations','length','520LIWfdA','5141082QSMqhX','285XCfdVn','segment','Resolving\x20child\x20segment\x20\x27','Error:\x20','Resolving\x20parent\x20segment\x20\x27','resolveParentId','✔\x20Found\x20','site','resolveSegmentId','Parent\x20name:\x20','Resolved\x20child\x20ID:\x20','List\x20activations\x20for\x20a\x20segment','Child\x20name:\x20','4405070YCnDzB'];a3_0x5507=function(){return _0x54f806;};return a3_0x5507();}
@@ -1 +1 @@
1
- const a4_0x1d306b=a4_0x3fe4;(function(_0x588dcf,_0x2025c1){const _0x390750=a4_0x3fe4,_0x40a005=_0x588dcf();while(!![]){try{const _0x5b2a25=parseInt(_0x390750(0x208))/0x1+parseInt(_0x390750(0x1b3))/0x2*(parseInt(_0x390750(0x1cd))/0x3)+-parseInt(_0x390750(0x1fb))/0x4+parseInt(_0x390750(0x1c4))/0x5+parseInt(_0x390750(0x1bb))/0x6*(-parseInt(_0x390750(0x23e))/0x7)+parseInt(_0x390750(0x1c9))/0x8+parseInt(_0x390750(0x1c6))/0x9;if(_0x5b2a25===_0x2025c1)break;else _0x40a005['push'](_0x40a005['shift']());}catch(_0x129d94){_0x40a005['push'](_0x40a005['shift']());}}}(a4_0x481f,0x7c71c));import a4_0xc7962c from'chalk';import a4_0x4d96fd 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';function a4_0x481f(){const _0x3cb6dd=['\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20updated','\x20=\x20','\x20changed','Agent:\x20','created','Clone\x20\x22','pullAgent','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Using\x20local\x20project:\x20','push','action','gray','log','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20Knowledge\x20Base\x20\x22','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','green','textKnowledgeBases','session','updated','Using\x20project:\x20','\x22\x20to\x20new\x20project\x20\x22','\x0aErrors\x20found:','\x20successfully','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','3633732fxObFW','cwd','Output:\x20','name','outputDir','reason','pushProject','\x0aPush\x20','source','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','✔\x20Context\x20set:\x20','projectId','\x0aWrite\x20','16860mxoLgZ','Source:\x20','agents','Errors:','\x20\x20tdx\x20agent\x20pull\x20','\x20\x20Prompt\x20\x22','\x20\x20tdx\x20agent\x20clone\x20agents/','Pushing\x20to\x20project...','counts','\x0aPush\x20summary\x20for\x20\x27','no_context','prompts','found','\x20total','Analyzing\x20project\x20\x22','cyan','pullProject','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','Agent\x20pulled\x20successfully','Status:\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Failed\x20to\x20push\x20agent:\x20','llmProject','diff','No\x20tdx.json\x20found\x20in\x20','\x20files\x20to\x20','Dry\x20run\x20-\x20no\x20changes\x20made','llm','\x22...','tdx.json','New\x20project:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','agent:pull','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','parse','Output\x20path:\x20','Chat:\x20','Cancelled','\x22\x20to\x20\x22','\x0a✔\x20Pulled\x20','\x0aChanges\x20to\x20agent\x20\x27','Would\x20pull\x20agent:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','llm_project','agentId','\x22:\x20','total','projectName','join','force','-\x20nothing\x20pushed','context','Project:\x20','447503TtFMvU','Would\x20clone:','description','message','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Agent\x20','repeat','Writing\x20files...','yes','knowledgeBases','agentName','error','INVALID_ARGUMENT','Pushing\x20agent\x20from\x20\x22','New\x20project\x20ID:\x20','output','\x20\x20Prompts:\x20','\x20\x20Agents:\x20','\x20new','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20--name\x20','\x20|\x20','\x0a✔\x20Pushed\x20','sourceProjectName','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20created','\x20\x20Knowledge\x20Bases:\x20','execute','dim','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','140958XonELV','outputPath','\x20\x20Integrations:\x20','-\x20no\x20files\x20written','\x20\x20Agent\x20\x22','\x20\x20Integration\x20\x22','no_local_folder','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','48nhtRiN','Using\x20context\x20project:\x20','\x0aChanges:','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Cloning\x20\x22','red','New\x20project\x20name\x20is\x20required','\x0aError:','Pulling\x20agent\x20\x22','2242370JkNfQI','\x20errors','266382JrJjlO','newProjectId','\x20resources\x20to\x20\x27','5275104sGvBWK','isNew','\x20--profile\x20','hasChanges','33nEUDgP','\x0aPull\x20summary\x20for\x20\x27','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','agent:clone','Dry\x20run\x20-\x20no\x20files\x20written','<new-name>','site','unchanged','errors','dirname','dryRun','\x20unchanged','cloneProject','Analyzing\x20changes\x20to\x20push...','utf-8','yellow','new','integrations','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'];a4_0x481f=function(){return _0x3cb6dd;};return a4_0x481f();}function a4_0x3fe4(_0x418f92,_0x58b9aa){_0x418f92=_0x418f92-0x1b2;const _0x481f7b=a4_0x481f();let _0x3fe49c=_0x481f7b[_0x418f92];return _0x3fe49c;}import{findAgentConfigPath,resolveProjectFromContext}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(_0x46d5af){const _0x54eaa1=a4_0x3fe4,_0x4dad8b=[];if(_0x46d5af[_0x54eaa1(0x237)]!==undefined)_0x4dad8b[_0x54eaa1(0x1eb)](_0x46d5af['total']+_0x54eaa1(0x215));if(_0x46d5af[_0x54eaa1(0x1de)]!==undefined&&_0x46d5af[_0x54eaa1(0x1de)]>0x0)_0x4dad8b[_0x54eaa1(0x1eb)](a4_0xc7962c[_0x54eaa1(0x1f2)](_0x46d5af['new']+_0x54eaa1(0x250)));if(_0x46d5af[_0x54eaa1(0x1e6)]!==undefined&&_0x46d5af[_0x54eaa1(0x1e6)]>0x0)_0x4dad8b[_0x54eaa1(0x1eb)](a4_0xc7962c[_0x54eaa1(0x1f2)](_0x46d5af[_0x54eaa1(0x1e6)]+_0x54eaa1(0x257)));if(_0x46d5af[_0x54eaa1(0x1f5)]!==undefined&&_0x46d5af[_0x54eaa1(0x1f5)]>0x0)_0x4dad8b[_0x54eaa1(0x1eb)](a4_0xc7962c[_0x54eaa1(0x1dd)](_0x46d5af[_0x54eaa1(0x1f5)]+_0x54eaa1(0x1e2)));if(_0x46d5af[_0x54eaa1(0x1d5)]!==undefined&&_0x46d5af['unchanged']>0x0)_0x4dad8b[_0x54eaa1(0x1eb)](a4_0xc7962c[_0x54eaa1(0x1ed)](_0x46d5af[_0x54eaa1(0x1d5)]+_0x54eaa1(0x1d9)));if(_0x46d5af[_0x54eaa1(0x1d6)]!==undefined&&_0x46d5af[_0x54eaa1(0x1d6)]>0x0)_0x4dad8b['push'](a4_0xc7962c[_0x54eaa1(0x1c0)](_0x46d5af[_0x54eaa1(0x1d6)]+_0x54eaa1(0x1c5)));return _0x4dad8b[_0x54eaa1(0x239)](',\x20');}function displayDiffs(_0x42f125,_0x23c459,_0x256317,_0x5a9d7b,_0xb71834=[]){const _0x30d5c8=a4_0x3fe4;for(const _0x968760 of _0x42f125){if(_0x968760[_0x30d5c8(0x21f)]){const _0x5a8cda=_0x968760[_0x30d5c8(0x248)]||_0x968760[_0x30d5c8(0x1fe)];console[_0x30d5c8(0x1ee)](_0x30d5c8(0x231)+_0x5a8cda+'\x27:'),console['log']('─'[_0x30d5c8(0x244)](0x3c)),console['log'](_0x968760[_0x30d5c8(0x21f)]),console[_0x30d5c8(0x1ee)]('─'[_0x30d5c8(0x244)](0x3c));}}for(const _0x318b6c of _0x23c459){_0x318b6c['diff']&&(console['log']('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x318b6c[_0x30d5c8(0x1fe)]+'\x27:'),console[_0x30d5c8(0x1ee)]('─'[_0x30d5c8(0x244)](0x3c)),console[_0x30d5c8(0x1ee)](_0x318b6c['diff']),console[_0x30d5c8(0x1ee)]('─'[_0x30d5c8(0x244)](0x3c)));}for(const _0x4d1acd of _0x256317){_0x4d1acd[_0x30d5c8(0x21f)]&&(console[_0x30d5c8(0x1ee)](_0x30d5c8(0x1e1)+_0x4d1acd['name']+'\x27:'),console['log']('─'[_0x30d5c8(0x244)](0x3c)),console['log'](_0x4d1acd[_0x30d5c8(0x21f)]),console[_0x30d5c8(0x1ee)]('─'[_0x30d5c8(0x244)](0x3c)));}for(const _0x41f98e of _0x5a9d7b){_0x41f98e[_0x30d5c8(0x21f)]&&(console[_0x30d5c8(0x1ee)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x41f98e[_0x30d5c8(0x1fe)]+'\x27:'),console[_0x30d5c8(0x1ee)]('─'[_0x30d5c8(0x244)](0x3c)),console[_0x30d5c8(0x1ee)](_0x41f98e['diff']),console['log']('─'[_0x30d5c8(0x244)](0x3c)));}for(const _0x5293b7 of _0xb71834){_0x5293b7[_0x30d5c8(0x21f)]&&(console[_0x30d5c8(0x1ee)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x5293b7[_0x30d5c8(0x1fe)]+'\x27:'),console[_0x30d5c8(0x1ee)]('─'[_0x30d5c8(0x244)](0x3c)),console[_0x30d5c8(0x1ee)](_0x5293b7[_0x30d5c8(0x21f)]),console[_0x30d5c8(0x1ee)]('─'[_0x30d5c8(0x244)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x1d306b(0x228);['description']='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x1d306b(0x259)](_0x8a8f78){const _0x557754=a4_0x1d306b,{options:_0x46f18f,args:_0xaf7694,tdx:_0xf41345}=_0x8a8f78,_0x3b5879=_0xaf7694[0x0],_0x8e6368=_0xaf7694[0x1],_0x546383=_0x46f18f[_0x557754(0x24d)],_0x5d7042=_0x46f18f[_0x557754(0x1d8)],_0x3c9cca=_0x46f18f[_0x557754(0x23a)],_0x1ba291=_0x46f18f['yes'],_0x38a59f=_0x46f18f[_0x557754(0x21e)];let _0x5191af,_0x13fea0;const _0x156f80=findAgentConfigPath(process[_0x557754(0x1fc)]());if(_0x3b5879){const _0x37d56d=a4_0x4d96fd[_0x557754(0x239)](_0x3b5879,_0x557754(0x225));if(existsSync(_0x37d56d))try{const _0x2e2af4=JSON[_0x557754(0x22b)](readFileSync(_0x37d56d,_0x557754(0x1dc)));_0x5191af=_0x2e2af4[_0x557754(0x234)],_0x13fea0=_0x3b5879,console[_0x557754(0x1ee)](a4_0xc7962c['dim']('Using\x20project\x20from\x20'+_0x37d56d+':\x20'+_0x5191af));}catch{_0x5191af=_0x3b5879;}else _0x5191af=_0x3b5879;}else{if(_0x156f80)try{const _0x19147d=JSON['parse'](readFileSync(_0x156f80,_0x557754(0x1dc)));_0x5191af=_0x19147d[_0x557754(0x234)],_0x13fea0=a4_0x4d96fd[_0x557754(0x1d7)](_0x156f80),console['log'](a4_0xc7962c['dim'](_0x557754(0x1f6)+_0x5191af));}catch{_0x5191af=_0x38a59f;}else _0x5191af=_0x38a59f;}if(!_0x5191af)return console[_0x557754(0x1ee)](a4_0xc7962c[_0x557754(0x1dd)](_0x557754(0x1f1))),console['log']('Usage:\x20tdx\x20agent\x20pull\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)'),console[_0x557754(0x1ee)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x557754(0x1ee)](_0x557754(0x1b2)),console['log'](_0x557754(0x219)),0x1;if(_0x8e6368){const {data:_0x39d8ea}=await withSpinner(_0x557754(0x1c3)+_0x8e6368+'\x22\x20from\x20project\x20\x22'+_0x5191af+_0x557754(0x224),()=>_0xf41345[_0x557754(0x223)][_0x557754(0x1e8)](_0x5191af,_0x8e6368,_0x546383,{'dryRun':_0x5d7042,'force':_0x3c9cca}));if(_0x5d7042)return console[_0x557754(0x1ee)](a4_0xc7962c['yellow'](_0x557754(0x1d2))),console[_0x557754(0x1ee)](_0x557754(0x232)+_0x39d8ea[_0x557754(0x248)]),console['log'](_0x557754(0x22c)+_0x39d8ea['outputPath']),_0x39d8ea[_0x557754(0x21f)]&&(console[_0x557754(0x1ee)](_0x557754(0x1bd)),console[_0x557754(0x1ee)]('─'[_0x557754(0x244)](0x3c)),console[_0x557754(0x1ee)](_0x39d8ea[_0x557754(0x21f)]),console[_0x557754(0x1ee)]('─'[_0x557754(0x244)](0x3c))),0x0;return console[_0x557754(0x1ee)](a4_0xc7962c[_0x557754(0x1f2)](_0x557754(0x21a))),console[_0x557754(0x1ee)](_0x557754(0x1e5)+_0x39d8ea['agentName']),console[_0x557754(0x1ee)](_0x557754(0x1fd)+_0x39d8ea[_0x557754(0x1b4)]),console['log'](_0x557754(0x21b)+(_0x39d8ea[_0x557754(0x1ca)]?a4_0xc7962c[_0x557754(0x1f2)](_0x557754(0x1de)):_0x39d8ea[_0x557754(0x1cc)]?a4_0xc7962c[_0x557754(0x1dd)]('updated'):a4_0xc7962c['gray'](_0x557754(0x1d5)))),0x0;}const _0xdea496=_0x13fea0||_0x546383,{data:_0x2f6c94}=await withSpinner(_0x557754(0x216)+_0x5191af+'\x22...',()=>_0xf41345[_0x557754(0x223)][_0x557754(0x218)](_0x5191af,_0xdea496,{'dryRun':!![]})),_0x58f59c=_0x2f6c94['counts'][_0x557754(0x20a)][_0x557754(0x1de)]+_0x2f6c94[_0x557754(0x210)]['knowledgeBases'][_0x557754(0x1de)]+_0x2f6c94[_0x557754(0x210)]['textKnowledgeBases'][_0x557754(0x1de)]+_0x2f6c94[_0x557754(0x210)][_0x557754(0x213)][_0x557754(0x1de)]+_0x2f6c94[_0x557754(0x210)][_0x557754(0x1df)][_0x557754(0x1de)],_0x1d9721=_0x2f6c94['counts'][_0x557754(0x20a)][_0x557754(0x1f5)]+_0x2f6c94[_0x557754(0x210)][_0x557754(0x247)][_0x557754(0x1f5)]+_0x2f6c94[_0x557754(0x210)]['textKnowledgeBases'][_0x557754(0x1f5)]+_0x2f6c94[_0x557754(0x210)][_0x557754(0x213)][_0x557754(0x1f5)]+_0x2f6c94[_0x557754(0x210)][_0x557754(0x1df)][_0x557754(0x1f5)],_0x251b6b=_0x2f6c94['counts'][_0x557754(0x20a)][_0x557754(0x1d5)]+_0x2f6c94[_0x557754(0x210)][_0x557754(0x247)][_0x557754(0x1d5)]+_0x2f6c94[_0x557754(0x210)]['textKnowledgeBases'][_0x557754(0x1d5)]+_0x2f6c94[_0x557754(0x210)][_0x557754(0x213)][_0x557754(0x1d5)]+_0x2f6c94[_0x557754(0x210)][_0x557754(0x1df)]['unchanged'];console[_0x557754(0x1ee)](_0x557754(0x1ce)+_0x2f6c94[_0x557754(0x238)]+'\x27:'),console['log']('\x20\x20'+a4_0xc7962c[_0x557754(0x1f2)]('+\x20'+_0x58f59c+_0x557754(0x250))+'\x20|\x20'+a4_0xc7962c[_0x557754(0x1dd)]('~\x20'+_0x1d9721+_0x557754(0x1e4))+'\x20|\x20'+a4_0xc7962c['dim']('=\x20'+_0x251b6b+'\x20unchanged')),console[_0x557754(0x1ee)](_0x557754(0x24f)+formatCountSummary(_0x2f6c94[_0x557754(0x210)][_0x557754(0x20a)])),console[_0x557754(0x1ee)](_0x557754(0x258)+formatCountSummary(_0x2f6c94['counts']['knowledgeBases'])),console[_0x557754(0x1ee)](_0x557754(0x229)+formatCountSummary(_0x2f6c94[_0x557754(0x210)]['textKnowledgeBases'])),console[_0x557754(0x1ee)](_0x557754(0x24e)+formatCountSummary(_0x2f6c94['counts'][_0x557754(0x213)])),console[_0x557754(0x1ee)](_0x557754(0x1b5)+formatCountSummary(_0x2f6c94[_0x557754(0x210)][_0x557754(0x1df)])),console['log']('\x20\x20Target:\x20'+a4_0xc7962c[_0x557754(0x217)](_0x2f6c94[_0x557754(0x1ff)])),displayDiffs(_0x2f6c94[_0x557754(0x20a)],_0x2f6c94['knowledgeBases'],_0x2f6c94['textKnowledgeBases'],_0x2f6c94[_0x557754(0x213)],_0x2f6c94[_0x557754(0x1df)]);if(_0x5d7042)return console['log'](a4_0xc7962c[_0x557754(0x1dd)](_0x557754(0x233))),0x0;if(_0x58f59c===0x0&&_0x1d9721===0x0)return console[_0x557754(0x1ee)](a4_0xc7962c[_0x557754(0x1f2)](_0x557754(0x227))),saveSessionContext({'llm_project':_0x2f6c94[_0x557754(0x238)]},_0x46f18f[_0x557754(0x1f4)]),console[_0x557754(0x1ee)](a4_0xc7962c[_0x557754(0x1f2)](_0x557754(0x205)+a4_0xc7962c[_0x557754(0x25a)]('llm_project')+'\x20=\x20'+a4_0xc7962c['cyan'](_0x2f6c94['projectName']))),0x0;if(!_0x1ba291&&!_0x3c9cca){if(!isInteractive())return console[_0x557754(0x249)](a4_0xc7962c['red'](_0x557754(0x1c2)),_0x557754(0x1e0)),console[_0x557754(0x249)](a4_0xc7962c['dim'](_0x557754(0x1fa))),0x1;const _0x10c5cf=await confirmKey(_0x557754(0x207)+(_0x58f59c+_0x1d9721)+'\x20files?');if(!_0x10c5cf)return console[_0x557754(0x1ee)](a4_0xc7962c['yellow'](_0x557754(0x22e)),_0x557754(0x1b6)),0x1;}const {data:_0x5f3313}=await withSpinner(_0x557754(0x245),()=>_0xf41345[_0x557754(0x223)][_0x557754(0x218)](_0x5191af,_0xdea496,{'force':_0x3c9cca}));return console[_0x557754(0x1ee)](a4_0xc7962c['green'](_0x557754(0x230)+(_0x58f59c+_0x1d9721)+_0x557754(0x221)+_0x5f3313[_0x557754(0x1ff)])),saveSessionContext({'llm_project':_0x5f3313[_0x557754(0x238)]},_0x46f18f[_0x557754(0x1f4)]),console[_0x557754(0x1ee)](a4_0xc7962c[_0x557754(0x1f2)](_0x557754(0x205)+a4_0xc7962c[_0x557754(0x25a)](_0x557754(0x234))+_0x557754(0x1e3)+a4_0xc7962c[_0x557754(0x217)](_0x5f3313['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x1d306b(0x1fe)]=a4_0x1d306b(0x1d1);['description']='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x1d306b(0x259)](_0x5c1f0c){const _0x2d8c14=a4_0x1d306b,{options:_0x955d79,args:_0x2f726b,tdx:_0x5bbe22}=_0x5c1f0c,_0x5024e4=_0x2f726b[0x0],_0x1351b6=_0x955d79[_0x2d8c14(0x1fe)],_0x28e525=_0x955d79['dryRun'],_0x4a4a68=_0x955d79[_0x2d8c14(0x246)],_0x59a46f=_0x955d79['site'],_0x2916df=_0x955d79['llmProject'];let _0x3a6da7;const _0x486a5f=findAgentConfigPath(process[_0x2d8c14(0x1fc)]());if(_0x5024e4){const _0x19c88e=a4_0x4d96fd[_0x2d8c14(0x239)](_0x5024e4,_0x2d8c14(0x225));existsSync(_0x19c88e)?(_0x3a6da7=_0x5024e4,console['log'](a4_0xc7962c[_0x2d8c14(0x25a)](_0x2d8c14(0x1ea)+_0x5024e4))):_0x3a6da7=_0x5024e4;}else{if(_0x486a5f)_0x3a6da7=a4_0x4d96fd[_0x2d8c14(0x1d7)](_0x486a5f),console['log'](a4_0xc7962c['dim']('Using\x20current\x20project:\x20'+_0x3a6da7));else{if(_0x2916df){const _0x15461a=sanitizeForFilesystem(_0x2916df);let _0x132811=_0x15461a,_0x48a7bd=a4_0x4d96fd['join'](process[_0x2d8c14(0x1fc)](),_0x2d8c14(0x20a),_0x15461a,_0x2d8c14(0x225));if(!existsSync(_0x48a7bd)){const _0x2d99ce=normalizeName(_0x2916df),_0x5a6c76=a4_0x4d96fd[_0x2d8c14(0x239)](process[_0x2d8c14(0x1fc)](),_0x2d8c14(0x20a),_0x2d99ce,_0x2d8c14(0x225));existsSync(_0x5a6c76)&&(_0x132811=_0x2d99ce,_0x48a7bd=_0x5a6c76);}if(existsSync(_0x48a7bd))_0x3a6da7=a4_0x4d96fd[_0x2d8c14(0x1d7)](_0x48a7bd),console[_0x2d8c14(0x1ee)](a4_0xc7962c[_0x2d8c14(0x25a)]('Using\x20local\x20project:\x20'+_0x3a6da7));else{const _0x5918c6=_0x955d79['profile'];if(_0x5918c6)throw new SDKError(ErrorCode[_0x2d8c14(0x24a)],_0x2d8c14(0x242)+_0x2916df+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x2d8c14(0x1ef)+_0x2d8c14(0x256)+(_0x2d8c14(0x20c)+_0x2916df+'\x0a')+(_0x2d8c14(0x20e)+_0x132811+_0x2d8c14(0x252)+(_0x1351b6||_0x2d8c14(0x1d3))+_0x2d8c14(0x1cb)+_0x5918c6)});_0x3a6da7=_0x2916df,console[_0x2d8c14(0x1ee)](a4_0xc7962c[_0x2d8c14(0x25a)](_0x2d8c14(0x1bc)+_0x2916df));}}}}if(!_0x3a6da7)return console['log'](a4_0xc7962c['yellow']('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x2d8c14(0x1ee)](_0x2d8c14(0x1cf)),console[_0x2d8c14(0x1ee)](_0x2d8c14(0x1d0)),console[_0x2d8c14(0x1ee)](_0x2d8c14(0x22a)),console['log']('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x1351b6)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x2d8c14(0x1c1),undefined,{'helpText':_0x2d8c14(0x204)});if(!_0x4a4a68&&!_0x28e525){if(!isInteractive())return console['error'](a4_0xc7962c['red'](_0x2d8c14(0x1c2)),_0x2d8c14(0x1e0)),console[_0x2d8c14(0x249)](a4_0xc7962c[_0x2d8c14(0x25a)](_0x2d8c14(0x1fa))),0x1;const _0x30454e=await confirmKey(_0x2d8c14(0x1e7)+_0x3a6da7+_0x2d8c14(0x1f7)+_0x1351b6+'\x22?');if(!_0x30454e)return console['log'](a4_0xc7962c[_0x2d8c14(0x1dd)](_0x2d8c14(0x22e))),0x1;}const {data:_0x463e54}=await withSpinner(_0x2d8c14(0x1bf)+_0x3a6da7+_0x2d8c14(0x22f)+_0x1351b6+_0x2d8c14(0x224),()=>_0x5bbe22[_0x2d8c14(0x223)][_0x2d8c14(0x1da)](_0x3a6da7,_0x1351b6,{'dryRun':_0x28e525}));if(_0x28e525)return console[_0x2d8c14(0x1ee)](a4_0xc7962c[_0x2d8c14(0x1dd)](_0x2d8c14(0x222))),console[_0x2d8c14(0x1ee)](_0x2d8c14(0x209)+_0x463e54[_0x2d8c14(0x255)]),console[_0x2d8c14(0x1ee)]('New\x20project:\x20'+_0x1351b6),console[_0x2d8c14(0x1ee)](_0x2d8c14(0x23f)),console[_0x2d8c14(0x1ee)](_0x2d8c14(0x24f)+_0x463e54[_0x2d8c14(0x210)]['agents']['created']),console[_0x2d8c14(0x1ee)](_0x2d8c14(0x258)+_0x463e54['counts'][_0x2d8c14(0x247)][_0x2d8c14(0x1e6)]),console[_0x2d8c14(0x1ee)](_0x2d8c14(0x24e)+_0x463e54['counts'][_0x2d8c14(0x213)][_0x2d8c14(0x1e6)]),0x0;const _0xa74782=_0x463e54[_0x2d8c14(0x210)]['agents'][_0x2d8c14(0x1d6)]>0x0||_0x463e54[_0x2d8c14(0x210)][_0x2d8c14(0x247)][_0x2d8c14(0x1d6)]>0x0||_0x463e54['counts']['prompts'][_0x2d8c14(0x1d6)]>0x0;_0xa74782?console[_0x2d8c14(0x1ee)](a4_0xc7962c[_0x2d8c14(0x1dd)]('Project\x20cloned\x20with\x20errors')):console[_0x2d8c14(0x1ee)](a4_0xc7962c[_0x2d8c14(0x1f2)]('Project\x20cloned\x20successfully'));console['log'](_0x2d8c14(0x209)+_0x463e54[_0x2d8c14(0x255)]),console['log'](_0x2d8c14(0x226)+_0x463e54['newProjectName']),console['log'](_0x2d8c14(0x24c)+_0x463e54[_0x2d8c14(0x1c7)]),console[_0x2d8c14(0x1ee)](),console[_0x2d8c14(0x1ee)]('Summary:'),console[_0x2d8c14(0x1ee)](_0x2d8c14(0x24f)+formatCountSummary(_0x463e54[_0x2d8c14(0x210)][_0x2d8c14(0x20a)])),console[_0x2d8c14(0x1ee)](_0x2d8c14(0x258)+formatCountSummary(_0x463e54[_0x2d8c14(0x210)][_0x2d8c14(0x247)])),console['log'](_0x2d8c14(0x24e)+formatCountSummary(_0x463e54[_0x2d8c14(0x210)][_0x2d8c14(0x213)])),console['log'](_0x2d8c14(0x1b5)+formatCountSummary(_0x463e54['counts'][_0x2d8c14(0x1df)]));if(_0xa74782){console['log'](),console[_0x2d8c14(0x1ee)](a4_0xc7962c[_0x2d8c14(0x1c0)](_0x2d8c14(0x20b)));for(const _0x1b5913 of _0x463e54[_0x2d8c14(0x20a)]){_0x1b5913['action']===_0x2d8c14(0x249)&&console[_0x2d8c14(0x1ee)](a4_0xc7962c['red'](_0x2d8c14(0x1b7)+_0x1b5913['agentName']+'\x22:\x20'+_0x1b5913['error']));}for(const _0x55a8e6 of _0x463e54[_0x2d8c14(0x247)]){_0x55a8e6['action']===_0x2d8c14(0x249)&&console[_0x2d8c14(0x1ee)](a4_0xc7962c[_0x2d8c14(0x1c0)](_0x2d8c14(0x1f0)+_0x55a8e6[_0x2d8c14(0x1fe)]+_0x2d8c14(0x236)+_0x55a8e6[_0x2d8c14(0x249)]));}for(const _0x362ff7 of _0x463e54[_0x2d8c14(0x213)]){_0x362ff7[_0x2d8c14(0x1ec)]===_0x2d8c14(0x249)&&console[_0x2d8c14(0x1ee)](a4_0xc7962c[_0x2d8c14(0x1c0)](_0x2d8c14(0x20d)+_0x362ff7[_0x2d8c14(0x1fe)]+'\x22:\x20'+_0x362ff7[_0x2d8c14(0x249)]));}for(const _0x152b84 of _0x463e54[_0x2d8c14(0x1df)]){_0x152b84[_0x2d8c14(0x1ec)]===_0x2d8c14(0x249)&&console[_0x2d8c14(0x1ee)](a4_0xc7962c[_0x2d8c14(0x1c0)](_0x2d8c14(0x1b8)+_0x152b84[_0x2d8c14(0x1fe)]+_0x2d8c14(0x236)+_0x152b84[_0x2d8c14(0x249)]));}return 0x1;}console['log']();const _0x4764e7=getLLMProjectUrl(_0x59a46f,_0x463e54[_0x2d8c14(0x1c7)]);return console[_0x2d8c14(0x1ee)](_0x2d8c14(0x23d)+a4_0xc7962c[_0x2d8c14(0x217)](_0x4764e7)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x1d306b(0x1fe)]='agent:push';[a4_0x1d306b(0x240)]=a4_0x1d306b(0x1be);async[a4_0x1d306b(0x259)](_0x43492d){const _0x4c3183=a4_0x1d306b,{options:_0x965cbe,args:_0x24abb8,tdx:_0x1701b2}=_0x43492d;let _0x3db005=_0x24abb8[0x0]||process['cwd']();const _0x334555=_0x965cbe[_0x4c3183(0x1d8)],_0x18fb61=_0x965cbe[_0x4c3183(0x23a)],_0x457ddc=_0x965cbe[_0x4c3183(0x246)],_0x3b59df=_0x965cbe[_0x4c3183(0x1d4)],_0x30f252=a4_0x4d96fd[_0x4c3183(0x239)](_0x3db005,'agent.yml'),_0x48484=existsSync(_0x30f252);if(_0x48484){const {data:_0x4efaf8}=await withSpinner(_0x4c3183(0x24b)+_0x3db005+_0x4c3183(0x224),()=>_0x1701b2['llm']['pushAgent'](_0x3db005,{'dryRun':_0x334555,'force':_0x18fb61}));if(_0x334555)return console['log'](a4_0xc7962c[_0x4c3183(0x1dd)](_0x4c3183(0x222))),console[_0x4c3183(0x1ee)]('Would\x20push\x20agent:\x20'+_0x4efaf8[_0x4c3183(0x248)]),0x0;if(_0x4efaf8[_0x4c3183(0x1ec)]===_0x4c3183(0x249))return console['log'](a4_0xc7962c[_0x4c3183(0x1c0)](_0x4c3183(0x21d)+_0x4efaf8[_0x4c3183(0x249)])),0x1;console['log'](a4_0xc7962c[_0x4c3183(0x1f2)](_0x4c3183(0x243)+_0x4efaf8[_0x4c3183(0x1ec)]+_0x4c3183(0x1f9))),console[_0x4c3183(0x1ee)](_0x4c3183(0x1e5)+_0x4efaf8['agentName']);if(_0x4efaf8['agentId']&&_0x4efaf8[_0x4c3183(0x206)]){const _0x36ad1b=getLLMAgentChatUrl(_0x3b59df,_0x4efaf8[_0x4c3183(0x206)],_0x4efaf8[_0x4c3183(0x235)]);console[_0x4c3183(0x1ee)](_0x4c3183(0x22d)+a4_0xc7962c[_0x4c3183(0x217)](_0x36ad1b));}return 0x0;}const _0x5777c2=_0x965cbe[_0x4c3183(0x21e)],_0x4ca7bc=resolveProjectFromContext(_0x3db005,_0x5777c2);if(_0x4ca7bc[_0x4c3183(0x214)])_0x3db005=_0x4ca7bc['projectDir'],_0x4ca7bc[_0x4c3183(0x203)]===_0x4c3183(0x23c)&&console[_0x4c3183(0x1ee)](a4_0xc7962c[_0x4c3183(0x25a)]('Using\x20project:\x20'+_0x3db005));else{let _0x51f8ac=_0x4c3183(0x1ba);_0x4ca7bc[_0x4c3183(0x200)]===_0x4c3183(0x1b9)&&(_0x51f8ac=_0x4ca7bc[_0x4c3183(0x241)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x4ca7bc[_0x4c3183(0x21e)]+_0x4c3183(0x25b));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4ca7bc[_0x4c3183(0x200)]===_0x4c3183(0x212)?_0x4ca7bc[_0x4c3183(0x241)]:_0x4c3183(0x220)+_0x3db005,undefined,{'helpText':_0x51f8ac});}const {data:_0x3c23d6}=await withSpinner(_0x4c3183(0x1db),()=>_0x1701b2[_0x4c3183(0x223)][_0x4c3183(0x201)](_0x3db005,{'dryRun':!![]})),_0x116fe3=_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x20a)][_0x4c3183(0x1d6)]>0x0;if(_0x116fe3){console[_0x4c3183(0x1ee)](a4_0xc7962c[_0x4c3183(0x1c0)](_0x4c3183(0x1f8)));for(const _0x344d92 of _0x3c23d6[_0x4c3183(0x20a)]){_0x344d92[_0x4c3183(0x1ec)]===_0x4c3183(0x249)&&console[_0x4c3183(0x1ee)](a4_0xc7962c['red'](_0x4c3183(0x1b7)+_0x344d92[_0x4c3183(0x248)]+'\x22:\x20'+_0x344d92[_0x4c3183(0x249)]));}return 0x1;}const _0x9bfeee=_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x20a)]['created']+_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x247)][_0x4c3183(0x1e6)]+_0x3c23d6['counts']['textKnowledgeBases']['created']+_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x213)][_0x4c3183(0x1e6)]+_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x1df)]['created'],_0x270ccc=_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x20a)][_0x4c3183(0x1f5)]+_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x247)][_0x4c3183(0x1f5)]+_0x3c23d6[_0x4c3183(0x210)]['textKnowledgeBases']['updated']+_0x3c23d6['counts'][_0x4c3183(0x213)][_0x4c3183(0x1f5)]+_0x3c23d6['counts']['integrations'][_0x4c3183(0x1f5)],_0x4bc85f=_0x3c23d6['counts'][_0x4c3183(0x20a)][_0x4c3183(0x1d5)]+_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x247)][_0x4c3183(0x1d5)]+_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x1f3)][_0x4c3183(0x1d5)]+_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x213)]['unchanged']+_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x1df)]['unchanged'];console[_0x4c3183(0x1ee)](_0x4c3183(0x211)+_0x3c23d6['projectName']+'\x27:'),console[_0x4c3183(0x1ee)]('\x20\x20'+a4_0xc7962c[_0x4c3183(0x1f2)]('+\x20'+_0x9bfeee+'\x20new')+_0x4c3183(0x253)+a4_0xc7962c[_0x4c3183(0x1dd)]('~\x20'+_0x270ccc+_0x4c3183(0x1e4))+_0x4c3183(0x253)+a4_0xc7962c['dim']('=\x20'+_0x4bc85f+_0x4c3183(0x1d9))),console['log'](_0x4c3183(0x24f)+formatCountSummary(_0x3c23d6['counts']['agents'])),console[_0x4c3183(0x1ee)](_0x4c3183(0x258)+formatCountSummary(_0x3c23d6['counts']['knowledgeBases'])),console[_0x4c3183(0x1ee)](_0x4c3183(0x229)+formatCountSummary(_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x1f3)])),console[_0x4c3183(0x1ee)](_0x4c3183(0x24e)+formatCountSummary(_0x3c23d6[_0x4c3183(0x210)][_0x4c3183(0x213)])),console['log'](_0x4c3183(0x1b5)+formatCountSummary(_0x3c23d6[_0x4c3183(0x210)]['integrations'])),console[_0x4c3183(0x1ee)]('\x20\x20Source:\x20'+a4_0xc7962c[_0x4c3183(0x217)](_0x3db005)),displayDiffs(_0x3c23d6[_0x4c3183(0x20a)],_0x3c23d6[_0x4c3183(0x247)],_0x3c23d6[_0x4c3183(0x1f3)],_0x3c23d6[_0x4c3183(0x213)],_0x3c23d6[_0x4c3183(0x1df)]);if(_0x334555)return console[_0x4c3183(0x1ee)](a4_0xc7962c[_0x4c3183(0x1dd)](_0x4c3183(0x251))),0x0;if(_0x9bfeee===0x0&&_0x270ccc===0x0){console[_0x4c3183(0x1ee)](a4_0xc7962c['green'](_0x4c3183(0x21c)));const _0x40ff7b=getLLMProjectUrl(_0x3b59df,_0x3c23d6['projectId']);return console['log'](_0x4c3183(0x23d)+a4_0xc7962c['cyan'](_0x40ff7b)),0x0;}if(!_0x457ddc&&!_0x18fb61){if(!isInteractive())return console[_0x4c3183(0x249)](a4_0xc7962c[_0x4c3183(0x1c0)](_0x4c3183(0x1c2)),_0x4c3183(0x1e0)),console[_0x4c3183(0x249)](a4_0xc7962c[_0x4c3183(0x25a)](_0x4c3183(0x1fa))),0x1;const _0x43ac9a=await confirmKey(_0x4c3183(0x202)+(_0x9bfeee+_0x270ccc)+'\x20resources?');if(!_0x43ac9a)return console[_0x4c3183(0x1ee)](a4_0xc7962c[_0x4c3183(0x1dd)](_0x4c3183(0x22e)),_0x4c3183(0x23b)),0x1;}const {data:_0x16d30f}=await withSpinner(_0x4c3183(0x20f),()=>_0x1701b2['llm'][_0x4c3183(0x201)](_0x3db005,{'force':_0x18fb61})),_0x820067=_0x16d30f[_0x4c3183(0x210)][_0x4c3183(0x20a)][_0x4c3183(0x1d6)]>0x0||_0x16d30f['counts']['knowledgeBases'][_0x4c3183(0x1d6)]>0x0||_0x16d30f[_0x4c3183(0x210)]['textKnowledgeBases'][_0x4c3183(0x1d6)]>0x0||_0x16d30f[_0x4c3183(0x210)][_0x4c3183(0x213)][_0x4c3183(0x1d6)]>0x0;if(_0x820067){console[_0x4c3183(0x1ee)](a4_0xc7962c[_0x4c3183(0x1dd)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x4c3183(0x1ee)](),console[_0x4c3183(0x1ee)](a4_0xc7962c[_0x4c3183(0x1c0)]('Errors:'));for(const _0x377f99 of _0x16d30f['agents']){_0x377f99[_0x4c3183(0x1ec)]===_0x4c3183(0x249)&&console['log'](a4_0xc7962c[_0x4c3183(0x1c0)]('\x20\x20Agent\x20\x22'+_0x377f99['agentName']+'\x22:\x20'+_0x377f99['error']));}for(const _0xc63086 of _0x16d30f['knowledgeBases']){_0xc63086[_0x4c3183(0x1ec)]===_0x4c3183(0x249)&&console[_0x4c3183(0x1ee)](a4_0xc7962c[_0x4c3183(0x1c0)](_0x4c3183(0x1f0)+_0xc63086[_0x4c3183(0x1fe)]+_0x4c3183(0x236)+_0xc63086['error']));}for(const _0xed3a6c of _0x16d30f[_0x4c3183(0x1f3)]){_0xed3a6c[_0x4c3183(0x1ec)]===_0x4c3183(0x249)&&console[_0x4c3183(0x1ee)](a4_0xc7962c['red'](_0x4c3183(0x1e9)+_0xed3a6c[_0x4c3183(0x1fe)]+_0x4c3183(0x236)+_0xed3a6c[_0x4c3183(0x249)]));}for(const _0x17b81e of _0x16d30f[_0x4c3183(0x213)]){_0x17b81e[_0x4c3183(0x1ec)]===_0x4c3183(0x249)&&console[_0x4c3183(0x1ee)](a4_0xc7962c['red'](_0x4c3183(0x20d)+_0x17b81e[_0x4c3183(0x1fe)]+_0x4c3183(0x236)+_0x17b81e[_0x4c3183(0x249)]));}for(const _0x138329 of _0x16d30f['integrations']){_0x138329[_0x4c3183(0x1ec)]==='error'&&console[_0x4c3183(0x1ee)](a4_0xc7962c[_0x4c3183(0x1c0)](_0x4c3183(0x1b8)+_0x138329[_0x4c3183(0x1fe)]+'\x22:\x20'+_0x138329['error']));}return 0x1;}console[_0x4c3183(0x1ee)](a4_0xc7962c[_0x4c3183(0x1f2)](_0x4c3183(0x254)+(_0x9bfeee+_0x270ccc)+_0x4c3183(0x1c8)+_0x16d30f[_0x4c3183(0x238)]+'\x27'));const _0x2bf740=getLLMProjectUrl(_0x3b59df,_0x16d30f['projectId']);return console['log'](_0x4c3183(0x23d)+a4_0xc7962c[_0x4c3183(0x217)](_0x2bf740)),0x0;}}
1
+ const a4_0x1a91f1=a4_0x2ef2;(function(_0x1362bb,_0x2c4be7){const _0x1c157d=a4_0x2ef2,_0x218019=_0x1362bb();while(!![]){try{const _0x10209e=-parseInt(_0x1c157d(0x232))/0x1*(parseInt(_0x1c157d(0x229))/0x2)+parseInt(_0x1c157d(0x1ef))/0x3+-parseInt(_0x1c157d(0x26b))/0x4*(-parseInt(_0x1c157d(0x227))/0x5)+-parseInt(_0x1c157d(0x22c))/0x6*(-parseInt(_0x1c157d(0x1fc))/0x7)+parseInt(_0x1c157d(0x274))/0x8*(parseInt(_0x1c157d(0x23d))/0x9)+parseInt(_0x1c157d(0x217))/0xa*(-parseInt(_0x1c157d(0x273))/0xb)+parseInt(_0x1c157d(0x277))/0xc;if(_0x10209e===_0x2c4be7)break;else _0x218019['push'](_0x218019['shift']());}catch(_0x32dd25){_0x218019['push'](_0x218019['shift']());}}}(a4_0x4f0f,0xe7d59));import a4_0x190fa from'chalk';function a4_0x4f0f(){const _0x3dc64e=['\x20\x20Target:\x20','message','agent:push','profile','114822XhHvnr','\x0aWrite\x20','sourceProjectName','\x0aErrors\x20found:','Would\x20push\x20agent:\x20','created','\x0aChanges:','Summary:','\x20\x20Text\x20Knowledge\x20Base\x20\x22','INVALID_ARGUMENT','prompts','Chat:\x20','agentId','Cancelled','new','error','\x20\x20Prompt\x20\x22','Using\x20project:\x20','total','\x20resources\x20to\x20\x27','no_context','\x0aProject\x20pushed\x20with\x20errors','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','push','errors','llmProject','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aChanges\x20to\x20integration\x20\x27','Using\x20context\x20project:\x20','utf-8','session','action','cwd','New\x20project\x20name\x20is\x20required','-\x20no\x20files\x20written','No\x20tdx.json\x20found\x20in\x20','textKnowledgeBases','repeat','green','\x20errors','red','Using\x20current\x20project:\x20','parse','Analyzing\x20project\x20\x22','Project:\x20','pullProject','3956hwgAyQ','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','diff','updated','Clone\x20\x22','\x20successfully','\x20\x20Knowledge\x20Base\x20\x22','\x20\x20Integration\x20\x22','98131ipwalw','232QSiFHH','cloneProject','\x0aPull\x20summary\x20for\x20\x27','16103880VqvCEX','counts','Dry\x20run\x20-\x20no\x20files\x20written','\x20=\x20','outputDir','\x20\x20Agents:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20|\x20','execute','Using\x20local\x20project:\x20','\x20new','\x0a✔\x20Pulled\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Agent:\x20','agentName','dim','\x0aPush\x20summary\x20for\x20\x27','hasChanges','log','llm_project','description','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x22...','Failed\x20to\x20push\x20agent:\x20','output','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x0a✔\x20Pushed\x20','Would\x20pull\x20agent:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','yes','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x20total','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','yellow','llm','\x20--name\x20','1698957FFccZm','gray','\x20\x20Knowledge\x20Bases:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Usage:\x20tdx\x20agent\x20pull\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)','force','Using\x20project\x20from\x20','\x20\x20Source:\x20','\x20updated','\x20\x20Agent\x20\x22','source','\x20\x20Prompts:\x20','648361uekdpd','site','pushProject','knowledgeBases','name','\x20files?','cyan','Status:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','context','New\x20project:\x20','reason','pullAgent','\x0aError:','\x20resources?','outputPath','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Project\x20cloned\x20successfully','\x20unchanged','projectDir','Analyzing\x20changes\x20to\x20push...','projectName','no_local_folder','\x20created','-\x20nothing\x20pushed','join','Errors:','1070MnSYnT','\x0aChanges\x20to\x20agent\x20\x27','\x22\x20to\x20a\x20different\x20profile','agents','<new-name>','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20--profile\x20','integrations','dryRun','\x20\x20tdx\x20agent\x20pull\x20','newProjectId','dirname','Pushing\x20agent\x20from\x20\x22','pushAgent','Agent\x20','Output\x20path:\x20','755QJLbBA','\x20\x20Integrations:\x20','196qzDMCO','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Output:\x20','12HQvpvO','agent:clone','unchanged','✔\x20Context\x20set:\x20','\x20changed','tdx.json','7232UEWfVt','agent:pull','\x22:\x20','New\x20project\x20ID:\x20','\x20files\x20to\x20','projectId','Agent\x20pulled\x20successfully'];a4_0x4f0f=function(){return _0x3dc64e;};return a4_0x4f0f();}import a4_0x22708e 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}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(_0xa0f743){const _0x40929f=a4_0x2ef2,_0x3decb7=[];if(_0xa0f743[_0x40929f(0x24f)]!==undefined)_0x3decb7[_0x40929f(0x254)](_0xa0f743[_0x40929f(0x24f)]+_0x40929f(0x1ea));if(_0xa0f743[_0x40929f(0x24b)]!==undefined&&_0xa0f743['new']>0x0)_0x3decb7['push'](a4_0x190fa[_0x40929f(0x263)](_0xa0f743[_0x40929f(0x24b)]+_0x40929f(0x1d4)));if(_0xa0f743[_0x40929f(0x242)]!==undefined&&_0xa0f743[_0x40929f(0x242)]>0x0)_0x3decb7[_0x40929f(0x254)](a4_0x190fa[_0x40929f(0x263)](_0xa0f743[_0x40929f(0x242)]+_0x40929f(0x213)));if(_0xa0f743[_0x40929f(0x26e)]!==undefined&&_0xa0f743[_0x40929f(0x26e)]>0x0)_0x3decb7[_0x40929f(0x254)](a4_0x190fa[_0x40929f(0x1ec)](_0xa0f743[_0x40929f(0x26e)]+_0x40929f(0x1f8)));if(_0xa0f743[_0x40929f(0x22e)]!==undefined&&_0xa0f743[_0x40929f(0x22e)]>0x0)_0x3decb7[_0x40929f(0x254)](a4_0x190fa[_0x40929f(0x1f0)](_0xa0f743['unchanged']+_0x40929f(0x20e)));if(_0xa0f743['errors']!==undefined&&_0xa0f743[_0x40929f(0x255)]>0x0)_0x3decb7['push'](a4_0x190fa[_0x40929f(0x265)](_0xa0f743[_0x40929f(0x255)]+_0x40929f(0x264)));return _0x3decb7[_0x40929f(0x215)](',\x20');}function displayDiffs(_0x3651cf,_0xf63ba,_0x2822fa,_0x5d6b95,_0x63d16b=[]){const _0x5cc755=a4_0x2ef2;for(const _0x630dbf of _0x3651cf){if(_0x630dbf[_0x5cc755(0x26d)]){const _0x2275e2=_0x630dbf[_0x5cc755(0x1d9)]||_0x630dbf['name'];console[_0x5cc755(0x1dd)](_0x5cc755(0x218)+_0x2275e2+'\x27:'),console[_0x5cc755(0x1dd)]('─'['repeat'](0x3c)),console[_0x5cc755(0x1dd)](_0x630dbf[_0x5cc755(0x26d)]),console[_0x5cc755(0x1dd)]('─'[_0x5cc755(0x262)](0x3c));}}for(const _0x46d555 of _0xf63ba){_0x46d555[_0x5cc755(0x26d)]&&(console['log'](_0x5cc755(0x20c)+_0x46d555[_0x5cc755(0x200)]+'\x27:'),console['log']('─'[_0x5cc755(0x262)](0x3c)),console[_0x5cc755(0x1dd)](_0x46d555[_0x5cc755(0x26d)]),console[_0x5cc755(0x1dd)]('─'['repeat'](0x3c)));}for(const _0x8f95da of _0x2822fa){_0x8f95da[_0x5cc755(0x26d)]&&(console[_0x5cc755(0x1dd)](_0x5cc755(0x204)+_0x8f95da[_0x5cc755(0x200)]+'\x27:'),console[_0x5cc755(0x1dd)]('─'[_0x5cc755(0x262)](0x3c)),console['log'](_0x8f95da['diff']),console['log']('─'[_0x5cc755(0x262)](0x3c)));}for(const _0x45e61c of _0x5d6b95){_0x45e61c[_0x5cc755(0x26d)]&&(console[_0x5cc755(0x1dd)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x45e61c[_0x5cc755(0x200)]+'\x27:'),console[_0x5cc755(0x1dd)]('─'[_0x5cc755(0x262)](0x3c)),console[_0x5cc755(0x1dd)](_0x45e61c[_0x5cc755(0x26d)]),console[_0x5cc755(0x1dd)]('─'[_0x5cc755(0x262)](0x3c)));}for(const _0x3e7265 of _0x63d16b){_0x3e7265[_0x5cc755(0x26d)]&&(console[_0x5cc755(0x1dd)](_0x5cc755(0x258)+_0x3e7265[_0x5cc755(0x200)]+'\x27:'),console[_0x5cc755(0x1dd)]('─'['repeat'](0x3c)),console[_0x5cc755(0x1dd)](_0x3e7265['diff']),console[_0x5cc755(0x1dd)]('─'[_0x5cc755(0x262)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x1a91f1(0x233);[a4_0x1a91f1(0x1df)]=a4_0x1a91f1(0x1f2);async['execute'](_0x2d075c){const _0x58be93=a4_0x1a91f1,{options:_0x3b6a0a,args:_0x438080,tdx:_0x291723}=_0x2d075c,_0x570aee=_0x438080[0x0],_0x22c6f8=_0x438080[0x1],_0x27438f=_0x3b6a0a[_0x58be93(0x1e3)],_0x44b2be=_0x3b6a0a[_0x58be93(0x21f)],_0x380faa=_0x3b6a0a[_0x58be93(0x1f5)],_0x513e8e=_0x3b6a0a[_0x58be93(0x1e8)],_0x2b2915=_0x3b6a0a[_0x58be93(0x256)];let _0x481be1,_0x35675b;const _0x3dc382=findAgentConfigPath(process['cwd']());if(_0x570aee){const _0x41f1ba=a4_0x22708e[_0x58be93(0x215)](_0x570aee,'tdx.json');if(existsSync(_0x41f1ba))try{const _0x31b82f=JSON[_0x58be93(0x267)](readFileSync(_0x41f1ba,_0x58be93(0x25a)));_0x481be1=_0x31b82f[_0x58be93(0x1de)],_0x35675b=_0x570aee,console[_0x58be93(0x1dd)](a4_0x190fa[_0x58be93(0x1da)](_0x58be93(0x1f6)+_0x41f1ba+':\x20'+_0x481be1));}catch{_0x481be1=_0x570aee;}else _0x481be1=_0x570aee;}else{if(_0x3dc382)try{const _0x10e9ea=JSON[_0x58be93(0x267)](readFileSync(_0x3dc382,'utf-8'));_0x481be1=_0x10e9ea['llm_project'],_0x35675b=a4_0x22708e[_0x58be93(0x222)](_0x3dc382),console[_0x58be93(0x1dd)](a4_0x190fa[_0x58be93(0x1da)]('Using\x20project:\x20'+_0x481be1));}catch{_0x481be1=_0x2b2915;}else _0x481be1=_0x2b2915;}if(!_0x481be1)return console['log'](a4_0x190fa[_0x58be93(0x1ec)](_0x58be93(0x1e9))),console[_0x58be93(0x1dd)](_0x58be93(0x1f4)),console[_0x58be93(0x1dd)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console[_0x58be93(0x1dd)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent'),0x1;if(_0x22c6f8){const {data:_0x34277b}=await withSpinner('Pulling\x20agent\x20\x22'+_0x22c6f8+'\x22\x20from\x20project\x20\x22'+_0x481be1+'\x22...',()=>_0x291723[_0x58be93(0x1ed)][_0x58be93(0x208)](_0x481be1,_0x22c6f8,_0x27438f,{'dryRun':_0x44b2be,'force':_0x380faa}));if(_0x44b2be)return console[_0x58be93(0x1dd)](a4_0x190fa['yellow'](_0x58be93(0x279))),console[_0x58be93(0x1dd)](_0x58be93(0x1e6)+_0x34277b['agentName']),console[_0x58be93(0x1dd)](_0x58be93(0x226)+_0x34277b['outputPath']),_0x34277b[_0x58be93(0x26d)]&&(console[_0x58be93(0x1dd)](_0x58be93(0x243)),console[_0x58be93(0x1dd)]('─'[_0x58be93(0x262)](0x3c)),console[_0x58be93(0x1dd)](_0x34277b[_0x58be93(0x26d)]),console[_0x58be93(0x1dd)]('─'['repeat'](0x3c))),0x0;return console[_0x58be93(0x1dd)](a4_0x190fa[_0x58be93(0x263)](_0x58be93(0x238))),console[_0x58be93(0x1dd)]('Agent:\x20'+_0x34277b[_0x58be93(0x1d9)]),console[_0x58be93(0x1dd)](_0x58be93(0x22b)+_0x34277b[_0x58be93(0x20b)]),console[_0x58be93(0x1dd)](_0x58be93(0x203)+(_0x34277b['isNew']?a4_0x190fa['green'](_0x58be93(0x24b)):_0x34277b[_0x58be93(0x1dc)]?a4_0x190fa['yellow']('updated'):a4_0x190fa[_0x58be93(0x1f0)](_0x58be93(0x22e)))),0x0;}const _0x45294f=_0x35675b||_0x27438f,{data:_0x2e156e}=await withSpinner(_0x58be93(0x268)+_0x481be1+_0x58be93(0x1e1),()=>_0x291723[_0x58be93(0x1ed)][_0x58be93(0x26a)](_0x481be1,_0x45294f,{'dryRun':!![]})),_0x2a1b85=_0x2e156e['counts'][_0x58be93(0x21a)]['new']+_0x2e156e[_0x58be93(0x278)][_0x58be93(0x1ff)][_0x58be93(0x24b)]+_0x2e156e[_0x58be93(0x278)][_0x58be93(0x261)][_0x58be93(0x24b)]+_0x2e156e['counts'][_0x58be93(0x247)][_0x58be93(0x24b)]+_0x2e156e[_0x58be93(0x278)]['integrations'][_0x58be93(0x24b)],_0x427365=_0x2e156e[_0x58be93(0x278)]['agents'][_0x58be93(0x26e)]+_0x2e156e[_0x58be93(0x278)]['knowledgeBases'][_0x58be93(0x26e)]+_0x2e156e[_0x58be93(0x278)][_0x58be93(0x261)][_0x58be93(0x26e)]+_0x2e156e[_0x58be93(0x278)][_0x58be93(0x247)]['updated']+_0x2e156e[_0x58be93(0x278)]['integrations'][_0x58be93(0x26e)],_0x1450ae=_0x2e156e[_0x58be93(0x278)][_0x58be93(0x21a)][_0x58be93(0x22e)]+_0x2e156e['counts'][_0x58be93(0x1ff)][_0x58be93(0x22e)]+_0x2e156e[_0x58be93(0x278)]['textKnowledgeBases'][_0x58be93(0x22e)]+_0x2e156e[_0x58be93(0x278)][_0x58be93(0x247)][_0x58be93(0x22e)]+_0x2e156e[_0x58be93(0x278)][_0x58be93(0x21e)]['unchanged'];console[_0x58be93(0x1dd)](_0x58be93(0x276)+_0x2e156e[_0x58be93(0x211)]+'\x27:'),console['log']('\x20\x20'+a4_0x190fa[_0x58be93(0x263)]('+\x20'+_0x2a1b85+_0x58be93(0x1d4))+_0x58be93(0x27e)+a4_0x190fa['yellow']('~\x20'+_0x427365+_0x58be93(0x230))+_0x58be93(0x27e)+a4_0x190fa['dim']('=\x20'+_0x1450ae+'\x20unchanged')),console[_0x58be93(0x1dd)](_0x58be93(0x27c)+formatCountSummary(_0x2e156e[_0x58be93(0x278)][_0x58be93(0x21a)])),console[_0x58be93(0x1dd)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2e156e[_0x58be93(0x278)]['knowledgeBases'])),console[_0x58be93(0x1dd)](_0x58be93(0x21c)+formatCountSummary(_0x2e156e[_0x58be93(0x278)][_0x58be93(0x261)])),console[_0x58be93(0x1dd)](_0x58be93(0x1fb)+formatCountSummary(_0x2e156e['counts'][_0x58be93(0x247)])),console[_0x58be93(0x1dd)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x2e156e['counts']['integrations'])),console[_0x58be93(0x1dd)](_0x58be93(0x239)+a4_0x190fa[_0x58be93(0x202)](_0x2e156e[_0x58be93(0x27b)])),displayDiffs(_0x2e156e['agents'],_0x2e156e['knowledgeBases'],_0x2e156e[_0x58be93(0x261)],_0x2e156e[_0x58be93(0x247)],_0x2e156e[_0x58be93(0x21e)]);if(_0x44b2be)return console[_0x58be93(0x1dd)](a4_0x190fa['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x2a1b85===0x0&&_0x427365===0x0)return console[_0x58be93(0x1dd)](a4_0x190fa[_0x58be93(0x263)](_0x58be93(0x257))),saveSessionContext({'llm_project':_0x2e156e[_0x58be93(0x211)]},_0x3b6a0a[_0x58be93(0x25b)]),console[_0x58be93(0x1dd)](a4_0x190fa[_0x58be93(0x263)](_0x58be93(0x22f)+a4_0x190fa['dim'](_0x58be93(0x1de))+_0x58be93(0x27a)+a4_0x190fa[_0x58be93(0x202)](_0x2e156e[_0x58be93(0x211)]))),0x0;if(!_0x513e8e&&!_0x380faa){if(!isInteractive())return console[_0x58be93(0x24c)](a4_0x190fa[_0x58be93(0x265)](_0x58be93(0x209)),_0x58be93(0x1d6)),console[_0x58be93(0x24c)](a4_0x190fa[_0x58be93(0x1da)](_0x58be93(0x1f3))),0x1;const _0x2c2322=await confirmKey(_0x58be93(0x23e)+(_0x2a1b85+_0x427365)+_0x58be93(0x201));if(!_0x2c2322)return console[_0x58be93(0x1dd)](a4_0x190fa[_0x58be93(0x1ec)](_0x58be93(0x24a)),_0x58be93(0x25f)),0x1;}const {data:_0x5f424e}=await withSpinner('Writing\x20files...',()=>_0x291723[_0x58be93(0x1ed)][_0x58be93(0x26a)](_0x481be1,_0x45294f,{'force':_0x380faa}));return console[_0x58be93(0x1dd)](a4_0x190fa[_0x58be93(0x263)](_0x58be93(0x1d5)+(_0x2a1b85+_0x427365)+_0x58be93(0x236)+_0x5f424e['outputDir'])),saveSessionContext({'llm_project':_0x5f424e[_0x58be93(0x211)]},_0x3b6a0a[_0x58be93(0x25b)]),console[_0x58be93(0x1dd)](a4_0x190fa[_0x58be93(0x263)](_0x58be93(0x22f)+a4_0x190fa[_0x58be93(0x1da)](_0x58be93(0x1de))+_0x58be93(0x27a)+a4_0x190fa[_0x58be93(0x202)](_0x5f424e[_0x58be93(0x211)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x1a91f1(0x22d);[a4_0x1a91f1(0x1df)]=a4_0x1a91f1(0x1d7);async[a4_0x1a91f1(0x27f)](_0x1bbf0a){const _0x34f468=a4_0x1a91f1,{options:_0x367a03,args:_0x49e038,tdx:_0x322097}=_0x1bbf0a,_0x45b03d=_0x49e038[0x0],_0x4a2dab=_0x367a03[_0x34f468(0x200)],_0x3aa147=_0x367a03['dryRun'],_0x484f4e=_0x367a03[_0x34f468(0x1e8)],_0x1978c7=_0x367a03[_0x34f468(0x1fd)],_0x4555d6=_0x367a03[_0x34f468(0x256)];let _0x37d349;const _0x5aceff=findAgentConfigPath(process[_0x34f468(0x25d)]());if(_0x45b03d){const _0x2445a8=a4_0x22708e[_0x34f468(0x215)](_0x45b03d,_0x34f468(0x231));existsSync(_0x2445a8)?(_0x37d349=_0x45b03d,console[_0x34f468(0x1dd)](a4_0x190fa[_0x34f468(0x1da)](_0x34f468(0x280)+_0x45b03d))):_0x37d349=_0x45b03d;}else{if(_0x5aceff)_0x37d349=a4_0x22708e[_0x34f468(0x222)](_0x5aceff),console['log'](a4_0x190fa['dim'](_0x34f468(0x266)+_0x37d349));else{if(_0x4555d6){const _0x2a8e72=sanitizeForFilesystem(_0x4555d6);let _0x372b00=_0x2a8e72,_0x8f54e4=a4_0x22708e[_0x34f468(0x215)](process[_0x34f468(0x25d)](),_0x34f468(0x21a),_0x2a8e72,'tdx.json');if(!existsSync(_0x8f54e4)){const _0x526688=normalizeName(_0x4555d6),_0x1321de=a4_0x22708e[_0x34f468(0x215)](process[_0x34f468(0x25d)](),_0x34f468(0x21a),_0x526688,_0x34f468(0x231));existsSync(_0x1321de)&&(_0x372b00=_0x526688,_0x8f54e4=_0x1321de);}if(existsSync(_0x8f54e4))_0x37d349=a4_0x22708e['dirname'](_0x8f54e4),console[_0x34f468(0x1dd)](a4_0x190fa['dim'](_0x34f468(0x280)+_0x37d349));else{const _0x4f17f2=_0x367a03[_0x34f468(0x23c)];if(_0x4f17f2)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x4555d6+_0x34f468(0x219),undefined,{'helpText':_0x34f468(0x26c)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x34f468(0x220)+_0x4555d6+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x372b00+_0x34f468(0x1ee)+(_0x4a2dab||_0x34f468(0x21b))+_0x34f468(0x21d)+_0x4f17f2)});_0x37d349=_0x4555d6,console[_0x34f468(0x1dd)](a4_0x190fa[_0x34f468(0x1da)](_0x34f468(0x259)+_0x4555d6));}}}}if(!_0x37d349)return console[_0x34f468(0x1dd)](a4_0x190fa[_0x34f468(0x1ec)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x34f468(0x1dd)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x34f468(0x1dd)](_0x34f468(0x1e0)),console[_0x34f468(0x1dd)]('\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)'),console[_0x34f468(0x1dd)](_0x34f468(0x1eb)),0x1;if(!_0x4a2dab)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x34f468(0x25e),undefined,{'helpText':_0x34f468(0x22a)});if(!_0x484f4e&&!_0x3aa147){if(!isInteractive())return console[_0x34f468(0x24c)](a4_0x190fa['red'](_0x34f468(0x209)),_0x34f468(0x1d6)),console['error'](a4_0x190fa[_0x34f468(0x1da)](_0x34f468(0x1f3))),0x1;const _0xd2f28a=await confirmKey(_0x34f468(0x26f)+_0x37d349+'\x22\x20to\x20new\x20project\x20\x22'+_0x4a2dab+'\x22?');if(!_0xd2f28a)return console[_0x34f468(0x1dd)](a4_0x190fa['yellow'](_0x34f468(0x24a))),0x1;}const {data:_0x5d6833}=await withSpinner('Cloning\x20\x22'+_0x37d349+'\x22\x20to\x20\x22'+_0x4a2dab+'\x22...',()=>_0x322097[_0x34f468(0x1ed)][_0x34f468(0x275)](_0x37d349,_0x4a2dab,{'dryRun':_0x3aa147}));if(_0x3aa147)return console[_0x34f468(0x1dd)](a4_0x190fa[_0x34f468(0x1ec)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x34f468(0x1dd)]('Source:\x20'+_0x5d6833[_0x34f468(0x23f)]),console['log'](_0x34f468(0x206)+_0x4a2dab),console['log']('Would\x20clone:'),console[_0x34f468(0x1dd)](_0x34f468(0x27c)+_0x5d6833[_0x34f468(0x278)][_0x34f468(0x21a)][_0x34f468(0x242)]),console[_0x34f468(0x1dd)](_0x34f468(0x1f1)+_0x5d6833[_0x34f468(0x278)][_0x34f468(0x1ff)]['created']),console['log'](_0x34f468(0x1fb)+_0x5d6833[_0x34f468(0x278)]['prompts'][_0x34f468(0x242)]),0x0;const _0x2cc789=_0x5d6833[_0x34f468(0x278)][_0x34f468(0x21a)][_0x34f468(0x255)]>0x0||_0x5d6833[_0x34f468(0x278)]['knowledgeBases'][_0x34f468(0x255)]>0x0||_0x5d6833[_0x34f468(0x278)][_0x34f468(0x247)][_0x34f468(0x255)]>0x0;_0x2cc789?console[_0x34f468(0x1dd)](a4_0x190fa['yellow']('Project\x20cloned\x20with\x20errors')):console[_0x34f468(0x1dd)](a4_0x190fa[_0x34f468(0x263)](_0x34f468(0x20d)));console[_0x34f468(0x1dd)]('Source:\x20'+_0x5d6833['sourceProjectName']),console[_0x34f468(0x1dd)](_0x34f468(0x206)+_0x5d6833['newProjectName']),console[_0x34f468(0x1dd)](_0x34f468(0x235)+_0x5d6833[_0x34f468(0x221)]),console[_0x34f468(0x1dd)](),console[_0x34f468(0x1dd)](_0x34f468(0x244)),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x5d6833['counts'][_0x34f468(0x21a)])),console[_0x34f468(0x1dd)](_0x34f468(0x1f1)+formatCountSummary(_0x5d6833[_0x34f468(0x278)][_0x34f468(0x1ff)])),console[_0x34f468(0x1dd)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x5d6833[_0x34f468(0x278)][_0x34f468(0x247)])),console[_0x34f468(0x1dd)](_0x34f468(0x228)+formatCountSummary(_0x5d6833[_0x34f468(0x278)][_0x34f468(0x21e)]));if(_0x2cc789){console[_0x34f468(0x1dd)](),console['log'](a4_0x190fa['red']('Errors:'));for(const _0x533040 of _0x5d6833[_0x34f468(0x21a)]){_0x533040[_0x34f468(0x25c)]===_0x34f468(0x24c)&&console[_0x34f468(0x1dd)](a4_0x190fa['red'](_0x34f468(0x1f9)+_0x533040[_0x34f468(0x1d9)]+_0x34f468(0x234)+_0x533040[_0x34f468(0x24c)]));}for(const _0x5eb2c4 of _0x5d6833['knowledgeBases']){_0x5eb2c4['action']===_0x34f468(0x24c)&&console[_0x34f468(0x1dd)](a4_0x190fa['red'](_0x34f468(0x271)+_0x5eb2c4[_0x34f468(0x200)]+'\x22:\x20'+_0x5eb2c4[_0x34f468(0x24c)]));}for(const _0x336fa0 of _0x5d6833['prompts']){_0x336fa0[_0x34f468(0x25c)]===_0x34f468(0x24c)&&console[_0x34f468(0x1dd)](a4_0x190fa[_0x34f468(0x265)](_0x34f468(0x24d)+_0x336fa0['name']+'\x22:\x20'+_0x336fa0['error']));}for(const _0x459311 of _0x5d6833[_0x34f468(0x21e)]){_0x459311['action']===_0x34f468(0x24c)&&console[_0x34f468(0x1dd)](a4_0x190fa[_0x34f468(0x265)](_0x34f468(0x272)+_0x459311[_0x34f468(0x200)]+_0x34f468(0x234)+_0x459311['error']));}return 0x1;}console[_0x34f468(0x1dd)]();const _0x185875=getLLMProjectUrl(_0x1978c7,_0x5d6833[_0x34f468(0x221)]);return console['log'](_0x34f468(0x269)+a4_0x190fa[_0x34f468(0x202)](_0x185875)),0x0;}}function a4_0x2ef2(_0x148e67,_0x25387e){_0x148e67=_0x148e67-0x1d4;const _0x4f0f99=a4_0x4f0f();let _0x2ef2eb=_0x4f0f99[_0x148e67];return _0x2ef2eb;}export class AgentPushCommand extends BaseCommand{[a4_0x1a91f1(0x200)]=a4_0x1a91f1(0x23b);[a4_0x1a91f1(0x1df)]=a4_0x1a91f1(0x253);async[a4_0x1a91f1(0x27f)](_0x1ed24c){const _0x26a7d2=a4_0x1a91f1,{options:_0x24d562,args:_0x32d35e,tdx:_0x27ce1b}=_0x1ed24c;let _0x33c4a1=_0x32d35e[0x0]||process[_0x26a7d2(0x25d)]();const _0x55a462=_0x24d562[_0x26a7d2(0x21f)],_0x413205=_0x24d562[_0x26a7d2(0x1f5)],_0x3eb3f3=_0x24d562[_0x26a7d2(0x1e8)],_0x50c0a7=_0x24d562[_0x26a7d2(0x1fd)],_0x4fbe60=a4_0x22708e['join'](_0x33c4a1,'agent.yml'),_0x1a26f6=existsSync(_0x4fbe60);if(_0x1a26f6){const {data:_0x5bd253}=await withSpinner(_0x26a7d2(0x223)+_0x33c4a1+'\x22...',()=>_0x27ce1b[_0x26a7d2(0x1ed)][_0x26a7d2(0x224)](_0x33c4a1,{'dryRun':_0x55a462,'force':_0x413205}));if(_0x55a462)return console['log'](a4_0x190fa['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console['log'](_0x26a7d2(0x241)+_0x5bd253['agentName']),0x0;if(_0x5bd253[_0x26a7d2(0x25c)]===_0x26a7d2(0x24c))return console[_0x26a7d2(0x1dd)](a4_0x190fa[_0x26a7d2(0x265)](_0x26a7d2(0x1e2)+_0x5bd253[_0x26a7d2(0x24c)])),0x1;console[_0x26a7d2(0x1dd)](a4_0x190fa[_0x26a7d2(0x263)](_0x26a7d2(0x225)+_0x5bd253[_0x26a7d2(0x25c)]+_0x26a7d2(0x270))),console[_0x26a7d2(0x1dd)](_0x26a7d2(0x1d8)+_0x5bd253['agentName']);if(_0x5bd253[_0x26a7d2(0x249)]&&_0x5bd253[_0x26a7d2(0x237)]){const _0x368086=getLLMAgentChatUrl(_0x50c0a7,_0x5bd253['projectId'],_0x5bd253['agentId']);console[_0x26a7d2(0x1dd)](_0x26a7d2(0x248)+a4_0x190fa[_0x26a7d2(0x202)](_0x368086));}return 0x0;}const _0x24121b=_0x24d562[_0x26a7d2(0x256)],_0x4e577f=resolveProjectFromContext(_0x33c4a1,_0x24121b);if(_0x4e577f['found'])_0x33c4a1=_0x4e577f[_0x26a7d2(0x20f)],_0x4e577f[_0x26a7d2(0x1fa)]===_0x26a7d2(0x205)&&console['log'](a4_0x190fa[_0x26a7d2(0x1da)](_0x26a7d2(0x24e)+_0x33c4a1));else{let _0x1c2215='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x4e577f['reason']===_0x26a7d2(0x212)&&(_0x1c2215=_0x4e577f[_0x26a7d2(0x23a)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x4e577f['llmProject']+_0x26a7d2(0x27d));throw new SDKError(ErrorCode[_0x26a7d2(0x246)],_0x4e577f[_0x26a7d2(0x207)]===_0x26a7d2(0x251)?_0x4e577f[_0x26a7d2(0x23a)]:_0x26a7d2(0x260)+_0x33c4a1,undefined,{'helpText':_0x1c2215});}const {data:_0x22e19e}=await withSpinner(_0x26a7d2(0x210),()=>_0x27ce1b[_0x26a7d2(0x1ed)][_0x26a7d2(0x1fe)](_0x33c4a1,{'dryRun':!![]})),_0x53fddc=_0x22e19e[_0x26a7d2(0x278)][_0x26a7d2(0x21a)]['errors']>0x0;if(_0x53fddc){console[_0x26a7d2(0x1dd)](a4_0x190fa[_0x26a7d2(0x265)](_0x26a7d2(0x240)));for(const _0x3d865d of _0x22e19e[_0x26a7d2(0x21a)]){_0x3d865d['action']===_0x26a7d2(0x24c)&&console[_0x26a7d2(0x1dd)](a4_0x190fa['red'](_0x26a7d2(0x1f9)+_0x3d865d['agentName']+_0x26a7d2(0x234)+_0x3d865d[_0x26a7d2(0x24c)]));}return 0x1;}const _0x1153e4=_0x22e19e[_0x26a7d2(0x278)]['agents'][_0x26a7d2(0x242)]+_0x22e19e[_0x26a7d2(0x278)][_0x26a7d2(0x1ff)][_0x26a7d2(0x242)]+_0x22e19e[_0x26a7d2(0x278)]['textKnowledgeBases'][_0x26a7d2(0x242)]+_0x22e19e['counts'][_0x26a7d2(0x247)][_0x26a7d2(0x242)]+_0x22e19e['counts'][_0x26a7d2(0x21e)]['created'],_0x346de9=_0x22e19e[_0x26a7d2(0x278)][_0x26a7d2(0x21a)][_0x26a7d2(0x26e)]+_0x22e19e['counts'][_0x26a7d2(0x1ff)][_0x26a7d2(0x26e)]+_0x22e19e['counts'][_0x26a7d2(0x261)][_0x26a7d2(0x26e)]+_0x22e19e[_0x26a7d2(0x278)][_0x26a7d2(0x247)][_0x26a7d2(0x26e)]+_0x22e19e[_0x26a7d2(0x278)][_0x26a7d2(0x21e)][_0x26a7d2(0x26e)],_0x41e91a=_0x22e19e[_0x26a7d2(0x278)][_0x26a7d2(0x21a)][_0x26a7d2(0x22e)]+_0x22e19e[_0x26a7d2(0x278)]['knowledgeBases'][_0x26a7d2(0x22e)]+_0x22e19e[_0x26a7d2(0x278)]['textKnowledgeBases'][_0x26a7d2(0x22e)]+_0x22e19e[_0x26a7d2(0x278)][_0x26a7d2(0x247)][_0x26a7d2(0x22e)]+_0x22e19e[_0x26a7d2(0x278)][_0x26a7d2(0x21e)][_0x26a7d2(0x22e)];console[_0x26a7d2(0x1dd)](_0x26a7d2(0x1db)+_0x22e19e[_0x26a7d2(0x211)]+'\x27:'),console[_0x26a7d2(0x1dd)]('\x20\x20'+a4_0x190fa[_0x26a7d2(0x263)]('+\x20'+_0x1153e4+_0x26a7d2(0x1d4))+_0x26a7d2(0x27e)+a4_0x190fa[_0x26a7d2(0x1ec)]('~\x20'+_0x346de9+_0x26a7d2(0x230))+_0x26a7d2(0x27e)+a4_0x190fa[_0x26a7d2(0x1da)]('=\x20'+_0x41e91a+_0x26a7d2(0x20e))),console[_0x26a7d2(0x1dd)]('\x20\x20Agents:\x20'+formatCountSummary(_0x22e19e[_0x26a7d2(0x278)][_0x26a7d2(0x21a)])),console[_0x26a7d2(0x1dd)](_0x26a7d2(0x1f1)+formatCountSummary(_0x22e19e['counts'][_0x26a7d2(0x1ff)])),console[_0x26a7d2(0x1dd)](_0x26a7d2(0x21c)+formatCountSummary(_0x22e19e['counts'][_0x26a7d2(0x261)])),console[_0x26a7d2(0x1dd)](_0x26a7d2(0x1fb)+formatCountSummary(_0x22e19e[_0x26a7d2(0x278)]['prompts'])),console[_0x26a7d2(0x1dd)](_0x26a7d2(0x228)+formatCountSummary(_0x22e19e[_0x26a7d2(0x278)][_0x26a7d2(0x21e)])),console['log'](_0x26a7d2(0x1f7)+a4_0x190fa['cyan'](_0x33c4a1)),displayDiffs(_0x22e19e[_0x26a7d2(0x21a)],_0x22e19e[_0x26a7d2(0x1ff)],_0x22e19e['textKnowledgeBases'],_0x22e19e[_0x26a7d2(0x247)],_0x22e19e[_0x26a7d2(0x21e)]);if(_0x55a462)return console[_0x26a7d2(0x1dd)](a4_0x190fa[_0x26a7d2(0x1ec)](_0x26a7d2(0x1e7))),0x0;if(_0x1153e4===0x0&&_0x346de9===0x0){console[_0x26a7d2(0x1dd)](a4_0x190fa[_0x26a7d2(0x263)](_0x26a7d2(0x1e4)));const _0x17f12a=getLLMProjectUrl(_0x50c0a7,_0x22e19e[_0x26a7d2(0x237)]);return console['log'](_0x26a7d2(0x269)+a4_0x190fa[_0x26a7d2(0x202)](_0x17f12a)),0x0;}if(!_0x3eb3f3&&!_0x413205){if(!isInteractive())return console['error'](a4_0x190fa['red']('\x0aError:'),_0x26a7d2(0x1d6)),console[_0x26a7d2(0x24c)](a4_0x190fa[_0x26a7d2(0x1da)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xeffb9f=await confirmKey('\x0aPush\x20'+(_0x1153e4+_0x346de9)+_0x26a7d2(0x20a));if(!_0xeffb9f)return console[_0x26a7d2(0x1dd)](a4_0x190fa[_0x26a7d2(0x1ec)]('Cancelled'),_0x26a7d2(0x214)),0x1;}const {data:_0x2b05ee}=await withSpinner('Pushing\x20to\x20project...',()=>_0x27ce1b['llm'][_0x26a7d2(0x1fe)](_0x33c4a1,{'force':_0x413205})),_0x3ea4a5=_0x2b05ee[_0x26a7d2(0x278)]['agents']['errors']>0x0||_0x2b05ee[_0x26a7d2(0x278)][_0x26a7d2(0x1ff)]['errors']>0x0||_0x2b05ee[_0x26a7d2(0x278)][_0x26a7d2(0x261)][_0x26a7d2(0x255)]>0x0||_0x2b05ee[_0x26a7d2(0x278)][_0x26a7d2(0x247)][_0x26a7d2(0x255)]>0x0;if(_0x3ea4a5){console[_0x26a7d2(0x1dd)](a4_0x190fa['yellow'](_0x26a7d2(0x252))),console[_0x26a7d2(0x1dd)](),console['log'](a4_0x190fa['red'](_0x26a7d2(0x216)));for(const _0x415ea7 of _0x2b05ee[_0x26a7d2(0x21a)]){_0x415ea7['action']===_0x26a7d2(0x24c)&&console[_0x26a7d2(0x1dd)](a4_0x190fa['red']('\x20\x20Agent\x20\x22'+_0x415ea7[_0x26a7d2(0x1d9)]+_0x26a7d2(0x234)+_0x415ea7['error']));}for(const _0x23d599 of _0x2b05ee[_0x26a7d2(0x1ff)]){_0x23d599[_0x26a7d2(0x25c)]==='error'&&console['log'](a4_0x190fa['red'](_0x26a7d2(0x271)+_0x23d599['name']+_0x26a7d2(0x234)+_0x23d599[_0x26a7d2(0x24c)]));}for(const _0x250123 of _0x2b05ee[_0x26a7d2(0x261)]){_0x250123[_0x26a7d2(0x25c)]===_0x26a7d2(0x24c)&&console[_0x26a7d2(0x1dd)](a4_0x190fa[_0x26a7d2(0x265)](_0x26a7d2(0x245)+_0x250123[_0x26a7d2(0x200)]+_0x26a7d2(0x234)+_0x250123[_0x26a7d2(0x24c)]));}for(const _0x2cd3c5 of _0x2b05ee['prompts']){_0x2cd3c5['action']===_0x26a7d2(0x24c)&&console[_0x26a7d2(0x1dd)](a4_0x190fa['red'](_0x26a7d2(0x24d)+_0x2cd3c5[_0x26a7d2(0x200)]+_0x26a7d2(0x234)+_0x2cd3c5['error']));}for(const _0x2e3236 of _0x2b05ee[_0x26a7d2(0x21e)]){_0x2e3236['action']===_0x26a7d2(0x24c)&&console[_0x26a7d2(0x1dd)](a4_0x190fa['red']('\x20\x20Integration\x20\x22'+_0x2e3236[_0x26a7d2(0x200)]+_0x26a7d2(0x234)+_0x2e3236[_0x26a7d2(0x24c)]));}return 0x1;}console[_0x26a7d2(0x1dd)](a4_0x190fa[_0x26a7d2(0x263)](_0x26a7d2(0x1e5)+(_0x1153e4+_0x346de9)+_0x26a7d2(0x250)+_0x2b05ee[_0x26a7d2(0x211)]+'\x27'));const _0x1acb1c=getLLMProjectUrl(_0x50c0a7,_0x2b05ee[_0x26a7d2(0x237)]);return console['log'](_0x26a7d2(0x269)+a4_0x190fa[_0x26a7d2(0x202)](_0x1acb1c)),0x0;}}
@@ -1 +1 @@
1
- function a5_0x59ce(_0x5adbdc,_0x3f5dd5){_0x5adbdc=_0x5adbdc-0xe4;const _0x193a3d=a5_0x193a();let _0x59ce9a=_0x193a3d[_0x5adbdc];return _0x59ce9a;}const a5_0x39e9d9=a5_0x59ce;(function(_0xbbf366,_0x350a7f){const _0x57b77c=a5_0x59ce,_0x1675ff=_0xbbf366();while(!![]){try{const _0xf710e4=-parseInt(_0x57b77c(0xf6))/0x1*(-parseInt(_0x57b77c(0x133))/0x2)+parseInt(_0x57b77c(0x14a))/0x3*(parseInt(_0x57b77c(0xff))/0x4)+parseInt(_0x57b77c(0x125))/0x5*(parseInt(_0x57b77c(0x13d))/0x6)+-parseInt(_0x57b77c(0x13f))/0x7*(parseInt(_0x57b77c(0x167))/0x8)+parseInt(_0x57b77c(0x143))/0x9+parseInt(_0x57b77c(0xf1))/0xa*(-parseInt(_0x57b77c(0x14e))/0xb)+parseInt(_0x57b77c(0xe7))/0xc*(-parseInt(_0x57b77c(0x161))/0xd);if(_0xf710e4===_0x350a7f)break;else _0x1675ff['push'](_0x1675ff['shift']());}catch(_0x11f94e){_0x1675ff['push'](_0x1675ff['shift']());}}}(a5_0x193a,0xb3576));import*as a5_0x2385cc from'node:fs';import*as a5_0xe8eedc from'node:path';import a5_0x2c39cf from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x193a(){const _0x517239=['message','reason','495IcaMUU','\x20\x20Conversation:\x20','resolveAgentId','Site:\x20','Evaluating\x20response...','jsonl','resolveProjectId','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','executeReeval','FAIL',':\x20Sending\x20user\x20input...','find','now','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','...','Total:\x20\x20\x20\x20','Either\x20switch\x20to\x20the\x20\x22','split','\x20(cached)','65vcFizT','\x27\x20to\x20create\x20the\x20folder\x20structure.','length','stop','source','Re-evaluating...','72kKFHMP','status','verbose','name','json','Using\x20agent:\x20','substring','isSpinning','map','execute','add','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Running:\x20','site','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','⚠\x20SKIPPED:\x20','some','Error:\x20No\x20previous\x20test\x20run\x20found.','Test\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','yellow','join','text','6031560ftjqJw','forEach','trim','basename','push','agentName','✗\x20FAIL:\x20','repeat','Run\x20tests\x20for\x20an\x20LLM\x20agent','Output\x20written\x20to:\x20','177770oFwviq','llmProject','\x20-\x20','reeval','Test\x20Summary','690044vNYeCF','\x22:\x20','\x20\x20Site:\x20','tags','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','projectName','start','multiple_agents','Executing\x20new\x20tests...','344KiqPyy','log','\x20(new)','found','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','New\x20tests\x20to\x20execute:\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)','No\x20tests\x20found\x20matching:\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','PASS','testName','white','red','no_context','\x22,\x20but\x20current\x20site\x20is\x20\x22','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','cyan','llm','Test\x20Configuration:','agent','Running\x20agent\x20tests...','Errors:\x20\x20\x20','tests','green','\x20\x20Evaluating...\x20','filter','...\x20','includes','toLowerCase','ERROR','\x20\x20Round\x20','Conversation\x20URL:\x20','timestamp','rounds','Error\x20writing\x20output\x20file:\x20','toISOString','Agent:\x20','eval','570NZQwPT','utf-8','testYmlPath','✓\x20PASS:\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Available\x20tags:\x20','✗\x20ERROR:\x20','context','test.yml','No\x20tests\x20have\x20tags\x20defined.','tsv','404','no_local_folder','size','4aiiryV','description','table','dim','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','has','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Failed\x20Tests:','conversation_url','Passed:\x20\x20\x20','73068tsRDEV','projectDir','278782jZRYVw','/<agent-name>','\x20\x20Project:\x20','writeFileSync','1689345SrGUgh','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','not\x20found','\x20\x20-\x20','Usage:','50583RVySoi','Cached\x20run\x20from:\x20'];a5_0x193a=function(){return _0x517239;};return a5_0x193a();}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x39e9d9(0x16a)]='agent:test';[a5_0x39e9d9(0x134)]=a5_0x39e9d9(0xef);async[a5_0x39e9d9(0x170)](_0x40662e){const _0x2f099=a5_0x39e9d9,{options:_0x55e501,args:_0x5bce9f,tdx:_0x224a42}=_0x40662e,_0xf9ff53=_0x5bce9f[0x0]||'.',_0x9995b1=_0x55e501['dryRun'],_0x2e0cb2=_0x55e501,_0x42ed6d=_0x2e0cb2[_0x2f099(0x124)]===![],_0x21bf2f=_0x2e0cb2[_0x2f099(0xf4)],_0x38a1e7=_0x2e0cb2[_0x2f099(0x16a)],_0x3c072c=_0x2e0cb2[_0x2f099(0xf9)],_0x480bef=_0x55e501[_0x2f099(0x174)],_0x1f7e54=_0x2e0cb2['output'];if(_0x21bf2f&&_0x42ed6d)return console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x10b)](_0x2f099(0x155))),0x1;let _0x226dd1='table';if(_0x2e0cb2[_0x2f099(0x16b)])_0x226dd1=_0x2f099(0x16b);else{if(_0x2e0cb2[_0x2f099(0x153)])_0x226dd1=_0x2f099(0x153);else{if(_0x2e0cb2[_0x2f099(0x12f)])_0x226dd1=_0x2f099(0x12f);else{if(_0x2e0cb2['table'])_0x226dd1='table';}}}const _0x20a274=_0x2e0cb2[_0x2f099(0xf2)];let _0x2cf2c9=_0xf9ff53;const _0x476723=a5_0x2385cc['existsSync'](_0xf9ff53),_0x327ea2=_0xf9ff53==='.';if(!_0x476723||_0x327ea2){const _0x5739ec=resolveProjectFromContext(_0xf9ff53,_0x20a274,{'requireFile':_0x2f099(0x12d)});if(_0x5739ec[_0x2f099(0x102)])_0x2cf2c9=_0x5739ec['projectDir'],_0x5739ec[_0x2f099(0x165)]===_0x2f099(0x12c)&&console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x136)](_0x2f099(0x16c)+_0x2cf2c9));else switch(_0x5739ec[_0x2f099(0x14d)]){case _0x2f099(0x10c):console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0xe4)](_0x5739ec[_0x2f099(0x14c)])),console['log'](),console[_0x2f099(0x100)](_0x2f099(0x149)),console[_0x2f099(0x100)](_0x2f099(0x175)),console['log'](_0x2f099(0x105)),console['log'](),console[_0x2f099(0x100)](_0x2f099(0x172));return 0x1;case _0x2f099(0x131):console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0xe4)](_0x5739ec[_0x2f099(0x14c)])),console[_0x2f099(0x100)](),console[_0x2f099(0x100)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x5739ec['llmProject']+_0x2f099(0x162));return 0x1;case _0x2f099(0xfd):{const _0x3f72df=a5_0xe8eedc[_0x2f099(0xea)](_0x5739ec[_0x2f099(0x13e)]);console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0xe4)](_0x2f099(0x144)+_0x5739ec[_0x2f099(0xf2)]+'\x22:'));for(const _0x2e5094 of _0x5739ec['agentDirs']){console[_0x2f099(0x100)](_0x2f099(0x148)+_0x2e5094);}return console['log'](),console[_0x2f099(0x100)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x3f72df+_0x2f099(0x140)),0x1;}case'no_tests':console[_0x2f099(0x100)](a5_0x2c39cf['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x5739ec['llmProject']+'\x22.')),console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x136)]('Project\x20path:\x20'+_0x5739ec['projectDir'])),console[_0x2f099(0x100)](),console[_0x2f099(0x100)](_0x2f099(0x137));return 0x1;}}const {definition:_0x574d92,agentInfo:_0x5b98f2}=parseTestFile(_0x2cf2c9);let _0x355cbb=_0x574d92[_0x2f099(0x115)];if(_0x38a1e7){const _0x49589b=_0x38a1e7[_0x2f099(0x15f)](',')['map'](_0x52d2e3=>_0x52d2e3['trim']());_0x355cbb=_0x574d92[_0x2f099(0x115)]['filter'](_0x4d59f5=>_0x49589b[_0x2f099(0x11a)](_0x4d59f5[_0x2f099(0x16a)]));if(_0x355cbb['length']===0x0)return console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0xe4)](_0x2f099(0x106)+_0x38a1e7)),console[_0x2f099(0x100)](a5_0x2c39cf['dim']('Available\x20tests:\x20'+_0x574d92['tests'][_0x2f099(0x16f)](_0xec7bd3=>_0xec7bd3[_0x2f099(0x16a)])[_0x2f099(0xe5)](',\x20'))),0x1;}if(_0x3c072c){const _0x39e15b=_0x3c072c[_0x2f099(0x15f)](',')[_0x2f099(0x16f)](_0x3a3980=>_0x3a3980[_0x2f099(0xe9)]()['toLowerCase']());_0x355cbb=_0x355cbb[_0x2f099(0x118)](_0x39911a=>_0x39911a[_0x2f099(0xf9)]?.[_0x2f099(0x178)](_0xdd4331=>_0x39e15b[_0x2f099(0x11a)](_0xdd4331['toLowerCase']())));if(_0x355cbb[_0x2f099(0x163)]===0x0){console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0xe4)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x3c072c));const _0x4fcf5a=new Set();return _0x574d92[_0x2f099(0x115)][_0x2f099(0xe8)](_0x37e6f4=>_0x37e6f4[_0x2f099(0xf9)]?.[_0x2f099(0xe8)](_0x3697a0=>_0x4fcf5a[_0x2f099(0x171)](_0x3697a0))),_0x4fcf5a[_0x2f099(0x132)]>0x0?console['log'](a5_0x2c39cf[_0x2f099(0x136)](_0x2f099(0x12a)+[..._0x4fcf5a][_0x2f099(0xe5)](',\x20'))):console['log'](a5_0x2c39cf[_0x2f099(0x136)](_0x2f099(0x12e))),0x1;}}if(_0x21bf2f)return this[_0x2f099(0x156)](_0x40662e,{'definition':{'tests':_0x355cbb},'agentInfo':_0x5b98f2,'outputFormat':_0x226dd1,'outputFile':_0x1f7e54,'testNames':_0x38a1e7});if(_0x9995b1){console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x10f)](_0x2f099(0x111))),console[_0x2f099(0x100)](_0x2f099(0xf8)+a5_0x2c39cf['white'](_0x480bef)),console[_0x2f099(0x100)](_0x2f099(0x141)+a5_0x2c39cf[_0x2f099(0x10a)](_0x5b98f2[_0x2f099(0xfb)])),console[_0x2f099(0x100)]('\x20\x20Agent:\x20'+a5_0x2c39cf['white'](_0x5b98f2['agentName'])),console[_0x2f099(0x100)](),console['log']('Tests\x20found:\x20'+a5_0x2c39cf[_0x2f099(0x10a)](_0x355cbb['length']));for(let _0x1835a5=0x0;_0x1835a5<_0x355cbb[_0x2f099(0x163)];_0x1835a5++){const _0x124da4=_0x355cbb[_0x1835a5],_0x3e097c=_0x124da4['rounds'][_0x2f099(0x163)]===0x1?'round':_0x2f099(0x120),_0x5b49a5=_0x124da4[_0x2f099(0xf9)]?.[_0x2f099(0x163)]?'\x20['+_0x124da4[_0x2f099(0xf9)][_0x2f099(0xe5)](',\x20')+']':'';console[_0x2f099(0x100)]('\x20\x20'+(_0x1835a5+0x1)+'.\x20'+a5_0x2c39cf[_0x2f099(0x10a)](_0x124da4['name'])+'\x20('+_0x124da4['rounds'][_0x2f099(0x163)]+'\x20'+_0x3e097c+')'+a5_0x2c39cf[_0x2f099(0x136)](_0x5b49a5));}return 0x0;}let _0x577859,_0x30e64f;try{_0x577859=await _0x224a42[_0x2f099(0x110)][_0x2f099(0x154)](_0x5b98f2[_0x2f099(0xfb)]);}catch(_0x292eb4){const _0x85ada0=_0x292eb4 instanceof Error?_0x292eb4['message']:String(_0x292eb4);return _0x85ada0[_0x2f099(0x11a)](_0x2f099(0x130))||_0x85ada0[_0x2f099(0x11b)]()[_0x2f099(0x11a)]('not\x20found')?console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x10b)](_0x2f099(0x139)+_0x5b98f2[_0x2f099(0xfb)])):console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x10b)](_0x2f099(0x17b)+_0x5b98f2['projectName']+_0x2f099(0xf7)+_0x85ada0)),0x1;}try{_0x30e64f=await _0x224a42[_0x2f099(0x110)][_0x2f099(0x150)](_0x5b98f2[_0x2f099(0xec)],_0x577859);}catch(_0x445ccc){const _0x2a3b80=_0x445ccc instanceof Error?_0x445ccc[_0x2f099(0x14c)]:String(_0x445ccc);return _0x2a3b80[_0x2f099(0x11a)]('404')||_0x2a3b80[_0x2f099(0x11b)]()[_0x2f099(0x11a)](_0x2f099(0x147))?console[_0x2f099(0x100)](a5_0x2c39cf['red'](_0x2f099(0x176)+_0x5b98f2[_0x2f099(0xec)])):console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x10b)](_0x2f099(0x15b)+_0x5b98f2[_0x2f099(0xec)]+'\x22:\x20'+_0x2a3b80)),0x1;}let _0xa24850;if(!_0x42ed6d)try{_0xa24850=await setupEvaluatorAgent(_0x224a42[_0x2f099(0x110)],_0x55e501[_0x2f099(0x169)]);}catch(_0x10d9fe){const _0x81175=_0x10d9fe instanceof Error?_0x10d9fe[_0x2f099(0x14c)]:String(_0x10d9fe);return console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x10b)](_0x2f099(0x146)+_0x81175)),0x1;}console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x10f)](_0x2f099(0x113))),console[_0x2f099(0x100)](_0x2f099(0x151)+a5_0x2c39cf[_0x2f099(0x10a)](_0x480bef)),console[_0x2f099(0x100)](_0x2f099(0x123)+a5_0x2c39cf[_0x2f099(0x10a)](_0x5b98f2['projectName']+'/'+_0x5b98f2[_0x2f099(0xec)])),console[_0x2f099(0x100)]();const _0x5bd007=[],_0x564aa0=[],_0x3f89ad=Date[_0x2f099(0x15a)]();for(let _0x3ec97a=0x0;_0x3ec97a<_0x355cbb['length'];_0x3ec97a++){const _0x33c4e7=_0x355cbb[_0x3ec97a];_0x355cbb['length']>0x1?console[_0x2f099(0x100)](_0x2f099(0x17a)+(_0x3ec97a+0x1)+'/'+_0x355cbb[_0x2f099(0x163)]+':\x20'+a5_0x2c39cf[_0x2f099(0x10a)](_0x33c4e7[_0x2f099(0x16a)])):console[_0x2f099(0x100)]('Running\x20test:\x20'+a5_0x2c39cf[_0x2f099(0x10a)](_0x33c4e7[_0x2f099(0x16a)]));const _0x45d23d=createCommandSpinner('Round\x201/'+_0x33c4e7[_0x2f099(0x120)][_0x2f099(0x163)]+':\x20Sending\x20user\x20input...');_0x45d23d['start']();try{const {result:_0x3b8706,conversation:_0x2179e3}=await runTest(_0x224a42[_0x2f099(0x110)],_0x33c4e7,{'agentId':_0x30e64f,'projectId':_0x577859,'site':_0x480bef,'noEval':_0x42ed6d,'evaluatorId':_0xa24850,'onRoundStart':(_0x3e5b72,_0x2b6c21)=>{const _0x5263e7=_0x2f099;_0x45d23d[_0x5263e7(0xe6)]='Round\x20'+(_0x3e5b72+0x1)+'/'+_0x2b6c21+_0x5263e7(0x158);},'onRoundComplete':(_0x5b9ae2,_0x4fd629,_0x39c1ff)=>{const _0x30ccda=_0x2f099,_0x16e4ce=formatElapsed(_0x4fd629);_0x39c1ff?console[_0x30ccda(0x100)](_0x30ccda(0x11d)+(_0x5b9ae2+0x1)+'/'+_0x33c4e7['rounds'][_0x30ccda(0x163)]+_0x30ccda(0x119)+a5_0x2c39cf[_0x30ccda(0x116)]('✓')+'\x20('+_0x16e4ce+')'):console[_0x30ccda(0x100)](_0x30ccda(0x11d)+(_0x5b9ae2+0x1)+'/'+_0x33c4e7[_0x30ccda(0x120)][_0x30ccda(0x163)]+'...\x20'+a5_0x2c39cf[_0x30ccda(0x10b)]('✗'));},'onEvaluationStart':()=>{const _0x3ba425=_0x2f099;_0x45d23d['text']=_0x3ba425(0x152);},'onEvaluationComplete':_0x179eeb=>{const _0x135d8b=_0x2f099,_0xa1818e=formatElapsed(_0x179eeb);console[_0x135d8b(0x100)](_0x135d8b(0x117)+a5_0x2c39cf[_0x135d8b(0x116)]('✓')+'\x20('+_0xa1818e+')');}});_0x45d23d[_0x2f099(0x164)](),_0x5bd007[_0x2f099(0xeb)](_0x3b8706),_0x564aa0[_0x2f099(0xeb)](_0x2179e3);if(_0x3b8706['status']==='PASS')console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x116)](_0x2f099(0x128)+_0x3b8706[_0x2f099(0x14d)]));else _0x3b8706['status']===_0x2f099(0x157)?console['log'](a5_0x2c39cf['red'](_0x2f099(0xed)+_0x3b8706[_0x2f099(0x14d)])):console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x10b)]('✗\x20ERROR:\x20'+_0x3b8706[_0x2f099(0x14d)]));_0x3b8706[_0x2f099(0x13b)]&&console['log'](a5_0x2c39cf[_0x2f099(0x136)](_0x2f099(0x11e)+_0x3b8706['conversation_url'])),console['log']();}catch(_0x1a0912){_0x45d23d[_0x2f099(0x164)]();const _0x383524=_0x1a0912 instanceof Error?_0x1a0912[_0x2f099(0x14c)]:String(_0x1a0912);console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x10b)](_0x2f099(0x12b)+_0x383524)),console[_0x2f099(0x100)](),_0x5bd007['push']({'name':_0x33c4e7[_0x2f099(0x16a)],'status':_0x2f099(0x11c),'reason':_0x383524,'timestamp':new Date()[_0x2f099(0x122)](),'duration_ms':0x0});}}const _0x4413ec=Date[_0x2f099(0x15a)]()-_0x3f89ad,_0x28e9d3=_0x5bd007['filter'](_0x5f5da5=>_0x5f5da5[_0x2f099(0x168)]===_0x2f099(0x108))['length'],_0x19c92b=_0x5bd007['filter'](_0x2d55f9=>_0x2d55f9[_0x2f099(0x168)]==='FAIL')[_0x2f099(0x163)],_0x27fbbd=_0x5bd007[_0x2f099(0x118)](_0x4d1f85=>_0x4d1f85[_0x2f099(0x168)]==='ERROR')[_0x2f099(0x163)];console[_0x2f099(0x100)]('━'['repeat'](0x3c)),console[_0x2f099(0x100)](_0x2f099(0xf5)),console[_0x2f099(0x100)]('━'[_0x2f099(0xee)](0x3c)),console['log'](_0x2f099(0x15d)+_0x5bd007['length']),console[_0x2f099(0x100)](_0x2f099(0x13c)+a5_0x2c39cf[_0x2f099(0x116)](_0x28e9d3)),console[_0x2f099(0x100)]('Failed:\x20\x20\x20'+a5_0x2c39cf[_0x2f099(0x10b)](_0x19c92b));_0x27fbbd>0x0&&console[_0x2f099(0x100)](_0x2f099(0x114)+a5_0x2c39cf[_0x2f099(0x10b)](_0x27fbbd));console['log']('Duration:\x20'+formatElapsed(_0x4413ec)),console['log']('━'[_0x2f099(0xee)](0x3c));const _0x1bbf3e=_0x5bd007[_0x2f099(0x118)](_0x1e3bab=>_0x1e3bab[_0x2f099(0x168)]!==_0x2f099(0x108));if(_0x1bbf3e[_0x2f099(0x163)]>0x0){console[_0x2f099(0x100)](),console['log'](_0x2f099(0x13a));for(const _0x3f7373 of _0x1bbf3e){const _0x47f006=a5_0x2c39cf['red']('✗'),_0x107ba8=_0x3f7373['reason']['length']>0x32?_0x3f7373[_0x2f099(0x14d)][_0x2f099(0x16d)](0x0,0x32)+_0x2f099(0x15c):_0x3f7373[_0x2f099(0x14d)];console[_0x2f099(0x100)]('\x20\x20'+_0x47f006+'\x20'+_0x3f7373['name']+':\x20'+_0x107ba8);}}const _0x53e66e={'summary':{'total':_0x5bd007['length'],'passed':_0x28e9d3,'failed':_0x19c92b,'errors':_0x27fbbd>0x0?_0x27fbbd:undefined,'duration_ms':_0x4413ec},'tests':_0x5bd007,'agent':{'project':_0x5b98f2[_0x2f099(0xfb)],'name':_0x5b98f2['agentName'],'site':_0x480bef},'timestamp':new Date(_0x3f89ad)['toISOString']()};try{const _0xd4404f=buildCachedTestRun(_0x564aa0,{'site':_0x480bef,'projectId':_0x577859,'projectName':_0x5b98f2[_0x2f099(0xfb)],'agentId':_0x30e64f,'agentName':_0x5b98f2['agentName'],'testYmlPath':a5_0xe8eedc['resolve'](_0x5b98f2[_0x2f099(0x127)])});saveLastTestRun(_0xd4404f);}catch{}if(_0x226dd1!==_0x2f099(0x135)||_0x1f7e54){const _0x8839c5=formatResults(_0x53e66e,_0x226dd1);if(_0x1f7e54)try{a5_0x2385cc[_0x2f099(0x142)](_0x1f7e54,_0x8839c5,_0x2f099(0x126)),console[_0x2f099(0x100)](),console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x136)](_0x2f099(0xf0)+_0x1f7e54));}catch(_0x27c983){return console[_0x2f099(0x100)](),console[_0x2f099(0x100)](a5_0x2c39cf[_0x2f099(0x10b)](_0x2f099(0x121)+_0x27c983)),0x1;}else console['log'](),console[_0x2f099(0x100)](_0x8839c5);}return _0x1bbf3e['length']>0x0?0x1:0x0;}async[a5_0x39e9d9(0x156)](_0x583cc4,_0xb291af){const _0x18425b=a5_0x39e9d9,{options:_0x4ffdde,tdx:_0x5439a4}=_0x583cc4,{definition:_0x2cd15e,agentInfo:_0x4bb7c1,outputFormat:_0x4e8254,outputFile:_0x15d5fb}=_0xb291af,_0x561e67=_0x4ffdde[_0x18425b(0x174)],_0x908771=loadLastTestRun();if(!_0x908771)return console[_0x18425b(0x100)](a5_0x2c39cf[_0x18425b(0x10b)](_0x18425b(0x179))),console['log'](a5_0x2c39cf[_0x18425b(0x136)](_0x18425b(0x103))),0x1;if(_0x908771['agent'][_0x18425b(0xec)]!==_0x4bb7c1[_0x18425b(0xec)])return console[_0x18425b(0x100)](a5_0x2c39cf[_0x18425b(0x10b)](_0x18425b(0x129)+_0x908771[_0x18425b(0x112)]['agentName']+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x4bb7c1[_0x18425b(0xec)]+'\x22.')),console[_0x18425b(0x100)](a5_0x2c39cf[_0x18425b(0x136)](_0x18425b(0xfa))),0x1;const _0x32b392=new Set(_0x908771['conversations'][_0x18425b(0x16f)](_0xc563bd=>_0xc563bd[_0x18425b(0x109)])),_0xaf195e=_0x2cd15e[_0x18425b(0x115)][_0x18425b(0x118)](_0x3d1219=>!_0x32b392[_0x18425b(0x138)](_0x3d1219['name']));if(_0xaf195e[_0x18425b(0x163)]>0x0&&_0x908771[_0x18425b(0x174)]!==_0x561e67)return console[_0x18425b(0x100)](a5_0x2c39cf['red'](_0x18425b(0x10e))),console[_0x18425b(0x100)](a5_0x2c39cf[_0x18425b(0x136)](_0x18425b(0x107)+_0x908771[_0x18425b(0x174)]+_0x18425b(0x10d)+_0x561e67+'\x22.')),console[_0x18425b(0x100)](a5_0x2c39cf[_0x18425b(0x136)](_0x18425b(0x15e)+_0x908771[_0x18425b(0x174)]+_0x18425b(0x145))),0x1;const _0x559d7b=_0x2cd15e['tests'][_0x18425b(0x118)](_0x54583f=>_0x32b392[_0x18425b(0x138)](_0x54583f[_0x18425b(0x16a)])),_0x1a10b6=_0xaf195e;let _0x4a439f;try{_0x4a439f=await setupEvaluatorAgent(_0x5439a4[_0x18425b(0x110)],_0x4ffdde[_0x18425b(0x169)]);}catch(_0x2a02e2){const _0x532afc=_0x2a02e2 instanceof Error?_0x2a02e2[_0x18425b(0x14c)]:String(_0x2a02e2);return console[_0x18425b(0x100)](a5_0x2c39cf[_0x18425b(0x10b)](_0x18425b(0x146)+_0x532afc)),0x1;}console['log'](a5_0x2c39cf['cyan']('Re-evaluating\x20cached\x20test\x20run...')),console[_0x18425b(0x100)](_0x18425b(0x14b)+a5_0x2c39cf[_0x18425b(0x10a)](_0x908771[_0x18425b(0x11f)])),console[_0x18425b(0x100)](_0x18425b(0x123)+a5_0x2c39cf[_0x18425b(0x10a)](_0x908771[_0x18425b(0x112)][_0x18425b(0xfb)]+'/'+_0x908771[_0x18425b(0x112)][_0x18425b(0xec)]));_0x1a10b6[_0x18425b(0x163)]>0x0&&console[_0x18425b(0x100)](_0x18425b(0x104)+a5_0x2c39cf['yellow'](_0x1a10b6[_0x18425b(0x163)]));console[_0x18425b(0x100)]();const _0x423391=[],_0xc86f78=Date[_0x18425b(0x15a)](),_0x38e0a6=createCommandSpinner(_0x18425b(0x166));if(_0x559d7b[_0x18425b(0x163)]>0x0)try{const _0x2ee70b=await reevaluateFromCache(_0x5439a4['llm'],_0x908771,{'tests':_0x559d7b},{'evaluatorId':_0x4a439f,'onTestStart':(_0xc68d71,_0x4f9a4b,_0xcf3a30)=>{const _0x479c51=_0x18425b;_0x38e0a6[_0x479c51(0xe6)]='Re-evaluating\x20'+(_0x4f9a4b+0x1)+'/'+_0xcf3a30+':\x20'+_0xc68d71+'...';if(!_0x38e0a6[_0x479c51(0x16e)])_0x38e0a6[_0x479c51(0xfc)]();},'onTestComplete':(_0x4611cd,_0x43c4f8)=>{const _0x1a1fc1=_0x18425b;_0x38e0a6[_0x1a1fc1(0x164)]();if(_0x43c4f8['status']==='PASS')console[_0x1a1fc1(0x100)](a5_0x2c39cf['green'](_0x1a1fc1(0x128)+_0x4611cd)+a5_0x2c39cf[_0x1a1fc1(0x136)]('\x20(cached)'));else _0x43c4f8[_0x1a1fc1(0x168)]===_0x1a1fc1(0x157)?console[_0x1a1fc1(0x100)](a5_0x2c39cf[_0x1a1fc1(0x10b)]('✗\x20FAIL:\x20'+_0x4611cd+_0x1a1fc1(0xf3)+_0x43c4f8[_0x1a1fc1(0x14d)])+a5_0x2c39cf[_0x1a1fc1(0x136)](_0x1a1fc1(0x160))):console[_0x1a1fc1(0x100)](a5_0x2c39cf[_0x1a1fc1(0x10b)](_0x1a1fc1(0x12b)+_0x4611cd+_0x1a1fc1(0xf3)+_0x43c4f8[_0x1a1fc1(0x14d)]));_0x43c4f8[_0x1a1fc1(0x13b)]&&console[_0x1a1fc1(0x100)](a5_0x2c39cf[_0x1a1fc1(0x136)](_0x1a1fc1(0x14f)+_0x43c4f8[_0x1a1fc1(0x13b)])),_0x423391[_0x1a1fc1(0xeb)](_0x43c4f8);},'onTestSkipped':(_0x8fc7cb,_0x718566)=>{const _0x1eb3e8=_0x18425b;_0x38e0a6[_0x1eb3e8(0x164)](),console['log'](a5_0x2c39cf[_0x1eb3e8(0xe4)](_0x1eb3e8(0x177)+_0x8fc7cb+_0x1eb3e8(0xf3)+_0x718566));}});for(const _0x56d00e of _0x2ee70b){!_0x423391[_0x18425b(0x159)](_0x593e6e=>_0x593e6e['name']===_0x56d00e[_0x18425b(0x16a)])&&_0x423391[_0x18425b(0xeb)](_0x56d00e);}}catch(_0x5afe40){_0x38e0a6[_0x18425b(0x164)]();const _0x55d827=_0x5afe40 instanceof Error?_0x5afe40[_0x18425b(0x14c)]:String(_0x5afe40);return console[_0x18425b(0x100)](a5_0x2c39cf[_0x18425b(0x10b)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x55d827)),0x1;}_0x38e0a6[_0x18425b(0x164)]();if(_0x1a10b6[_0x18425b(0x163)]>0x0){console[_0x18425b(0x100)](),console[_0x18425b(0x100)](a5_0x2c39cf[_0x18425b(0x10f)](_0x18425b(0xfe)));const {projectId:_0x49b01b,agentId:_0x18138e}=_0x908771[_0x18425b(0x112)];for(const _0x458809 of _0x1a10b6){console[_0x18425b(0x100)](_0x18425b(0x173)+a5_0x2c39cf['white'](_0x458809[_0x18425b(0x16a)]));const _0x4aef3c=createCommandSpinner('Round\x201/'+_0x458809['rounds'][_0x18425b(0x163)]+_0x18425b(0x158));_0x4aef3c['start']();try{const {result:_0x22023e}=await runTest(_0x5439a4[_0x18425b(0x110)],_0x458809,{'agentId':_0x18138e,'projectId':_0x49b01b,'site':_0x908771[_0x18425b(0x174)],'noEval':![],'evaluatorId':_0x4a439f,'onRoundStart':(_0x1a3cc6,_0x45fa05)=>{const _0x43ae85=_0x18425b;_0x4aef3c[_0x43ae85(0xe6)]='Round\x20'+(_0x1a3cc6+0x1)+'/'+_0x45fa05+_0x43ae85(0x158);},'onRoundComplete':(_0x28fcb4,_0x1fd40a,_0x1be9cb)=>{const _0x8eb58=_0x18425b,_0x149eec=formatElapsed(_0x1fd40a);_0x1be9cb?console[_0x8eb58(0x100)](_0x8eb58(0x11d)+(_0x28fcb4+0x1)+'/'+_0x458809[_0x8eb58(0x120)][_0x8eb58(0x163)]+'...\x20'+a5_0x2c39cf[_0x8eb58(0x116)]('✓')+'\x20('+_0x149eec+')'):console[_0x8eb58(0x100)](_0x8eb58(0x11d)+(_0x28fcb4+0x1)+'/'+_0x458809[_0x8eb58(0x120)][_0x8eb58(0x163)]+_0x8eb58(0x119)+a5_0x2c39cf[_0x8eb58(0x10b)]('✗'));},'onEvaluationStart':()=>{const _0x45aea9=_0x18425b;_0x4aef3c[_0x45aea9(0xe6)]=_0x45aea9(0x152);},'onEvaluationComplete':_0x457f6d=>{const _0x155ef1=_0x18425b,_0x388ff3=formatElapsed(_0x457f6d);console['log']('\x20\x20Evaluating...\x20'+a5_0x2c39cf[_0x155ef1(0x116)]('✓')+'\x20('+_0x388ff3+')');}});_0x4aef3c['stop'](),_0x423391[_0x18425b(0xeb)](_0x22023e);if(_0x22023e[_0x18425b(0x168)]===_0x18425b(0x108))console['log'](a5_0x2c39cf[_0x18425b(0x116)](_0x18425b(0x128)+_0x22023e[_0x18425b(0x14d)])+a5_0x2c39cf[_0x18425b(0x136)](_0x18425b(0x101)));else _0x22023e[_0x18425b(0x168)]===_0x18425b(0x157)?console[_0x18425b(0x100)](a5_0x2c39cf['red'](_0x18425b(0xed)+_0x22023e[_0x18425b(0x14d)])+a5_0x2c39cf['dim'](_0x18425b(0x101))):console[_0x18425b(0x100)](a5_0x2c39cf[_0x18425b(0x10b)](_0x18425b(0x12b)+_0x22023e[_0x18425b(0x14d)]));_0x22023e['conversation_url']&&console[_0x18425b(0x100)](a5_0x2c39cf['dim']('\x20\x20Conversation:\x20'+_0x22023e[_0x18425b(0x13b)]));}catch(_0x2d3962){_0x4aef3c[_0x18425b(0x164)]();const _0x2d076b=_0x2d3962 instanceof Error?_0x2d3962['message']:String(_0x2d3962);console[_0x18425b(0x100)](a5_0x2c39cf[_0x18425b(0x10b)](_0x18425b(0x12b)+_0x2d076b)),_0x423391['push']({'name':_0x458809['name'],'status':_0x18425b(0x11c),'reason':_0x2d076b,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x18425b(0x100)]();const _0x3bb3e9=Date['now']()-_0xc86f78,_0x2a9f40=_0x423391[_0x18425b(0x118)](_0x39739f=>_0x39739f[_0x18425b(0x168)]===_0x18425b(0x108))[_0x18425b(0x163)],_0x18b231=_0x423391['filter'](_0x327ca6=>_0x327ca6[_0x18425b(0x168)]==='FAIL')['length'],_0x4fc769=_0x423391[_0x18425b(0x118)](_0x4298af=>_0x4298af[_0x18425b(0x168)]===_0x18425b(0x11c))[_0x18425b(0x163)];console['log']('━'[_0x18425b(0xee)](0x3c)),console[_0x18425b(0x100)]('Re-evaluation\x20Summary'),console['log']('━'[_0x18425b(0xee)](0x3c)),console['log'](_0x18425b(0x15d)+_0x423391['length']),console[_0x18425b(0x100)]('Passed:\x20\x20\x20'+a5_0x2c39cf[_0x18425b(0x116)](_0x2a9f40)),console['log']('Failed:\x20\x20\x20'+a5_0x2c39cf[_0x18425b(0x10b)](_0x18b231));_0x4fc769>0x0&&console[_0x18425b(0x100)](_0x18425b(0x114)+a5_0x2c39cf[_0x18425b(0x10b)](_0x4fc769));console[_0x18425b(0x100)]('Duration:\x20'+formatElapsed(_0x3bb3e9)),console[_0x18425b(0x100)]('━'['repeat'](0x3c));const _0x1c58cf={'summary':{'total':_0x423391[_0x18425b(0x163)],'passed':_0x2a9f40,'failed':_0x18b231,'errors':_0x4fc769>0x0?_0x4fc769:undefined,'duration_ms':_0x3bb3e9},'tests':_0x423391,'agent':{'project':_0x4bb7c1[_0x18425b(0xfb)],'name':_0x4bb7c1[_0x18425b(0xec)],'site':_0x561e67},'timestamp':new Date(_0xc86f78)[_0x18425b(0x122)]()};if(_0x4e8254!==_0x18425b(0x135)||_0x15d5fb){const _0x388f19=formatResults(_0x1c58cf,_0x4e8254);if(_0x15d5fb)try{a5_0x2385cc[_0x18425b(0x142)](_0x15d5fb,_0x388f19,_0x18425b(0x126)),console[_0x18425b(0x100)](),console['log'](a5_0x2c39cf[_0x18425b(0x136)]('Output\x20written\x20to:\x20'+_0x15d5fb));}catch(_0xf53dbf){return console[_0x18425b(0x100)](),console[_0x18425b(0x100)](a5_0x2c39cf[_0x18425b(0x10b)]('Error\x20writing\x20output\x20file:\x20'+_0xf53dbf)),0x1;}else console[_0x18425b(0x100)](),console[_0x18425b(0x100)](_0x388f19);}const _0x2fcc4a=_0x423391[_0x18425b(0x118)](_0x2bd390=>_0x2bd390[_0x18425b(0x168)]!==_0x18425b(0x108));return _0x2fcc4a[_0x18425b(0x163)]>0x0?0x1:0x0;}}
1
+ const a5_0x38f582=a5_0x17e1;(function(_0x2e9ed8,_0x29958c){const _0x4f7351=a5_0x17e1,_0xf424bc=_0x2e9ed8();while(!![]){try{const _0x5252e5=parseInt(_0x4f7351(0x14a))/0x1+-parseInt(_0x4f7351(0x102))/0x2+-parseInt(_0x4f7351(0x109))/0x3+-parseInt(_0x4f7351(0x178))/0x4*(parseInt(_0x4f7351(0x174))/0x5)+parseInt(_0x4f7351(0x139))/0x6+-parseInt(_0x4f7351(0x106))/0x7+-parseInt(_0x4f7351(0x11e))/0x8*(-parseInt(_0x4f7351(0x165))/0x9);if(_0x5252e5===_0x29958c)break;else _0xf424bc['push'](_0xf424bc['shift']());}catch(_0x16a45f){_0xf424bc['push'](_0xf424bc['shift']());}}}(a5_0x450d,0x3ef01));import*as a5_0x1bba5a from'node:fs';import*as a5_0x3c7a89 from'node:path';import a5_0x3434a6 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x17e1(_0x1374fb,_0x3c8e13){_0x1374fb=_0x1374fb-0xf0;const _0x450dba=a5_0x450d();let _0x17e14c=_0x450dba[_0x1374fb];return _0x17e14c;}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x450d(){const _0x55578c=['Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','jsonl','utf-8','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','\x20(new)','Site:\x20','Re-evaluating\x20cached\x20test\x20run...','writeFileSync','agent:test','Running:\x20','verbose','Failed\x20Tests:','name','Output\x20written\x20to:\x20','Test\x20Configuration:','text','404','push','Total:\x20\x20\x20\x20','source','test.yml','log','9IKKVQp','\x20-\x20','Running\x20test:\x20','site','\x22,\x20but\x20current\x20site\x20is\x20\x22','dryRun','isSpinning','trim','Run\x20\x27tdx\x20agent\x20pull\x20','\x20\x20Round\x20','✗\x20ERROR:\x20','message','Cached\x20run\x20from:\x20','tests','Re-evaluating\x20','5LEHaQQ','No\x20tests\x20found\x20matching:\x20','tags','yellow','1446048JXAIGN','stop','length','Error\x20writing\x20output\x20file:\x20','\x20\x20Agent:\x20','no_context','tsv','resolveProjectId','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Evaluating\x20response...','\x20\x20Conversation:\x20','includes','testYmlPath','round','Usage:','context','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','red','No\x20tests\x20have\x20tags\x20defined.','✗\x20FAIL:\x20','description','New\x20tests\x20to\x20execute:\x20','Re-evaluation\x20Summary','conversation_url','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Test\x20','agentDirs','execute','\x27\x20to\x20create\x20the\x20folder\x20structure.','status','map','find','no_local_folder','274366epvBzx','add','forEach','table','1414224Jsqipp','Available\x20tests:\x20','✓\x20PASS:\x20','789372QHEYiG','repeat','...\x20','timestamp','conversations','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','resolve','Test\x20Summary','\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','Agent:\x20','found','has','/<agent-name>','now','\x22:\x20','Re-evaluating...','Duration:\x20','Errors:\x20\x20\x20','projectName','agentName','toLowerCase','4432968kivUda','llm','Either\x20switch\x20to\x20the\x20\x22','PASS','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','resolveAgentId','Cached\x20run\x20is\x20from\x20site\x20\x22','agent','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','dim','reeval','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','\x20(cached)','rounds','split','Available\x20tags:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','green','\x20\x20Evaluating...\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','join','ERROR','white','substring','FAIL','multiple_agents','2795376KcxLos',':\x20Sending\x20user\x20input...','basename','projectDir','Conversation\x20URL:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','reason','eval','Passed:\x20\x20\x20','...','Round\x20','executeReeval','start','Project\x20path:\x20','No\x20tests\x20found\x20with\x20tags:\x20','llmProject','testName','201627EKMuVT','toISOString','some','filter','json'];a5_0x450d=function(){return _0x55578c;};return a5_0x450d();}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x38f582(0x15b)]=a5_0x38f582(0x157);[a5_0x38f582(0xf5)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x38f582(0xfc)](_0x4c2afc){const _0x4f4ef9=a5_0x38f582,{options:_0x1662f5,args:_0x17304c,tdx:_0x333807}=_0x4c2afc,_0x4fe3bf=_0x17304c[0x0]||'.',_0x43e8ff=_0x1662f5[_0x4f4ef9(0x16a)],_0x59a384=_0x1662f5,_0x14bb01=_0x59a384[_0x4f4ef9(0x140)]===![],_0x1081df=_0x59a384[_0x4f4ef9(0x128)],_0x262eee=_0x59a384[_0x4f4ef9(0x15b)],_0x169c95=_0x59a384[_0x4f4ef9(0x176)],_0x55f2d1=_0x1662f5[_0x4f4ef9(0x168)],_0x1054a9=_0x59a384['output'];if(_0x1081df&&_0x14bb01)return console['log'](a5_0x3434a6[_0x4f4ef9(0xf2)](_0x4f4ef9(0x10e))),0x1;let _0x26a155=_0x4f4ef9(0x105);if(_0x59a384[_0x4f4ef9(0x14e)])_0x26a155=_0x4f4ef9(0x14e);else{if(_0x59a384[_0x4f4ef9(0x150)])_0x26a155=_0x4f4ef9(0x150);else{if(_0x59a384[_0x4f4ef9(0x17e)])_0x26a155='tsv';else{if(_0x59a384['table'])_0x26a155=_0x4f4ef9(0x105);}}}const _0x2a9bb6=_0x59a384['llmProject'];let _0x22644c=_0x4fe3bf;const _0x27abc2=a5_0x1bba5a['existsSync'](_0x4fe3bf),_0x52808e=_0x4fe3bf==='.';if(!_0x27abc2||_0x52808e){const _0x3fd631=resolveProjectFromContext(_0x4fe3bf,_0x2a9bb6,{'requireFile':_0x4f4ef9(0x163)});if(_0x3fd631[_0x4f4ef9(0x113)])_0x22644c=_0x3fd631['projectDir'],_0x3fd631[_0x4f4ef9(0x162)]===_0x4f4ef9(0xf0)&&console[_0x4f4ef9(0x164)](a5_0x3434a6['dim']('Using\x20agent:\x20'+_0x22644c));else switch(_0x3fd631[_0x4f4ef9(0x13f)]){case _0x4f4ef9(0x17d):console['log'](a5_0x3434a6[_0x4f4ef9(0x177)](_0x3fd631[_0x4f4ef9(0x170)])),console[_0x4f4ef9(0x164)](),console[_0x4f4ef9(0x164)](_0x4f4ef9(0x186)),console[_0x4f4ef9(0x164)](_0x4f4ef9(0x111)),console[_0x4f4ef9(0x164)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x4f4ef9(0x164)](),console[_0x4f4ef9(0x164)](_0x4f4ef9(0x14f));return 0x1;case _0x4f4ef9(0x101):console['log'](a5_0x3434a6[_0x4f4ef9(0x177)](_0x3fd631['message'])),console[_0x4f4ef9(0x164)](),console[_0x4f4ef9(0x164)](_0x4f4ef9(0x16d)+_0x3fd631['llmProject']+_0x4f4ef9(0xfd));return 0x1;case _0x4f4ef9(0x138):{const _0x72c920=a5_0x3c7a89[_0x4f4ef9(0x13b)](_0x3fd631[_0x4f4ef9(0x13c)]);console[_0x4f4ef9(0x164)](a5_0x3434a6[_0x4f4ef9(0x177)](_0x4f4ef9(0x129)+_0x3fd631['llmProject']+'\x22:'));for(const _0x478a41 of _0x3fd631[_0x4f4ef9(0xfb)]){console['log']('\x20\x20-\x20'+_0x478a41);}return console[_0x4f4ef9(0x164)](),console[_0x4f4ef9(0x164)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x72c920+_0x4f4ef9(0x115)),0x1;}case'no_tests':console['log'](a5_0x3434a6[_0x4f4ef9(0x177)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x3fd631[_0x4f4ef9(0x148)]+'\x22.')),console[_0x4f4ef9(0x164)](a5_0x3434a6[_0x4f4ef9(0x127)](_0x4f4ef9(0x146)+_0x3fd631[_0x4f4ef9(0x13c)])),console[_0x4f4ef9(0x164)](),console[_0x4f4ef9(0x164)](_0x4f4ef9(0x122));return 0x1;}}const {definition:_0x431442,agentInfo:_0x2faeff}=parseTestFile(_0x22644c);let _0x2772d9=_0x431442[_0x4f4ef9(0x172)];if(_0x262eee){const _0x506b4c=_0x262eee[_0x4f4ef9(0x12d)](',')[_0x4f4ef9(0xff)](_0x1c43fd=>_0x1c43fd[_0x4f4ef9(0x16c)]());_0x2772d9=_0x431442['tests']['filter'](_0x461d47=>_0x506b4c[_0x4f4ef9(0x183)](_0x461d47['name']));if(_0x2772d9[_0x4f4ef9(0x17a)]===0x0)return console['log'](a5_0x3434a6['yellow'](_0x4f4ef9(0x175)+_0x262eee)),console[_0x4f4ef9(0x164)](a5_0x3434a6[_0x4f4ef9(0x127)](_0x4f4ef9(0x107)+_0x431442[_0x4f4ef9(0x172)][_0x4f4ef9(0xff)](_0x1c1357=>_0x1c1357[_0x4f4ef9(0x15b)])[_0x4f4ef9(0x133)](',\x20'))),0x1;}if(_0x169c95){const _0xa60bdc=_0x169c95['split'](',')[_0x4f4ef9(0xff)](_0x37f6be=>_0x37f6be['trim']()['toLowerCase']());_0x2772d9=_0x2772d9['filter'](_0x56249e=>_0x56249e[_0x4f4ef9(0x176)]?.[_0x4f4ef9(0x14c)](_0xdbd987=>_0xa60bdc['includes'](_0xdbd987[_0x4f4ef9(0x11d)]())));if(_0x2772d9[_0x4f4ef9(0x17a)]===0x0){console[_0x4f4ef9(0x164)](a5_0x3434a6[_0x4f4ef9(0x177)](_0x4f4ef9(0x147)+_0x169c95));const _0x3a7a7c=new Set();return _0x431442[_0x4f4ef9(0x172)][_0x4f4ef9(0x104)](_0x30231c=>_0x30231c[_0x4f4ef9(0x176)]?.[_0x4f4ef9(0x104)](_0x14e8e6=>_0x3a7a7c[_0x4f4ef9(0x103)](_0x14e8e6))),_0x3a7a7c['size']>0x0?console[_0x4f4ef9(0x164)](a5_0x3434a6[_0x4f4ef9(0x127)](_0x4f4ef9(0x12e)+[..._0x3a7a7c]['join'](',\x20'))):console[_0x4f4ef9(0x164)](a5_0x3434a6[_0x4f4ef9(0x127)](_0x4f4ef9(0xf3))),0x1;}}if(_0x1081df)return this[_0x4f4ef9(0x144)](_0x4c2afc,{'definition':{'tests':_0x2772d9},'agentInfo':_0x2faeff,'outputFormat':_0x26a155,'outputFile':_0x1054a9,'testNames':_0x262eee});if(_0x43e8ff){console[_0x4f4ef9(0x164)](a5_0x3434a6['cyan'](_0x4f4ef9(0x15d))),console[_0x4f4ef9(0x164)]('\x20\x20Site:\x20'+a5_0x3434a6['white'](_0x55f2d1)),console['log']('\x20\x20Project:\x20'+a5_0x3434a6['white'](_0x2faeff[_0x4f4ef9(0x11b)])),console[_0x4f4ef9(0x164)](_0x4f4ef9(0x17c)+a5_0x3434a6[_0x4f4ef9(0x135)](_0x2faeff['agentName'])),console[_0x4f4ef9(0x164)](),console['log']('Tests\x20found:\x20'+a5_0x3434a6[_0x4f4ef9(0x135)](_0x2772d9[_0x4f4ef9(0x17a)]));for(let _0x346d42=0x0;_0x346d42<_0x2772d9[_0x4f4ef9(0x17a)];_0x346d42++){const _0x18d2f3=_0x2772d9[_0x346d42],_0x439bf6=_0x18d2f3['rounds'][_0x4f4ef9(0x17a)]===0x1?_0x4f4ef9(0x185):_0x4f4ef9(0x12c),_0x3ddf27=_0x18d2f3[_0x4f4ef9(0x176)]?.[_0x4f4ef9(0x17a)]?'\x20['+_0x18d2f3[_0x4f4ef9(0x176)]['join'](',\x20')+']':'';console['log']('\x20\x20'+(_0x346d42+0x1)+'.\x20'+a5_0x3434a6[_0x4f4ef9(0x135)](_0x18d2f3[_0x4f4ef9(0x15b)])+'\x20('+_0x18d2f3[_0x4f4ef9(0x12c)][_0x4f4ef9(0x17a)]+'\x20'+_0x439bf6+')'+a5_0x3434a6['dim'](_0x3ddf27));}return 0x0;}let _0x4d5b90,_0x2a9d56;try{_0x4d5b90=await _0x333807[_0x4f4ef9(0x11f)][_0x4f4ef9(0x17f)](_0x2faeff[_0x4f4ef9(0x11b)]);}catch(_0xe1a80c){const _0x5a2dea=_0xe1a80c instanceof Error?_0xe1a80c['message']:String(_0xe1a80c);return _0x5a2dea['includes'](_0x4f4ef9(0x15f))||_0x5a2dea[_0x4f4ef9(0x11d)]()['includes']('not\x20found')?console[_0x4f4ef9(0x164)](a5_0x3434a6[_0x4f4ef9(0xf2)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x2faeff[_0x4f4ef9(0x11b)])):console['log'](a5_0x3434a6[_0x4f4ef9(0xf2)](_0x4f4ef9(0xf1)+_0x2faeff[_0x4f4ef9(0x11b)]+'\x22:\x20'+_0x5a2dea)),0x1;}try{_0x2a9d56=await _0x333807[_0x4f4ef9(0x11f)][_0x4f4ef9(0x123)](_0x2faeff[_0x4f4ef9(0x11c)],_0x4d5b90);}catch(_0x510bfc){const _0x4d4d25=_0x510bfc instanceof Error?_0x510bfc['message']:String(_0x510bfc);return _0x4d4d25[_0x4f4ef9(0x183)](_0x4f4ef9(0x15f))||_0x4d4d25['toLowerCase']()['includes']('not\x20found')?console[_0x4f4ef9(0x164)](a5_0x3434a6[_0x4f4ef9(0xf2)](_0x4f4ef9(0x12f)+_0x2faeff[_0x4f4ef9(0x11c)])):console['log'](a5_0x3434a6[_0x4f4ef9(0xf2)](_0x4f4ef9(0x12a)+_0x2faeff[_0x4f4ef9(0x11c)]+_0x4f4ef9(0x117)+_0x4d4d25)),0x1;}let _0x4e7f84;if(!_0x14bb01)try{_0x4e7f84=await setupEvaluatorAgent(_0x333807[_0x4f4ef9(0x11f)],_0x1662f5['verbose']);}catch(_0x4199bc){const _0x239d32=_0x4199bc instanceof Error?_0x4199bc['message']:String(_0x4199bc);return console[_0x4f4ef9(0x164)](a5_0x3434a6[_0x4f4ef9(0xf2)](_0x4f4ef9(0x13e)+_0x239d32)),0x1;}console[_0x4f4ef9(0x164)](a5_0x3434a6['cyan']('Running\x20agent\x20tests...')),console[_0x4f4ef9(0x164)](_0x4f4ef9(0x154)+a5_0x3434a6[_0x4f4ef9(0x135)](_0x55f2d1)),console[_0x4f4ef9(0x164)](_0x4f4ef9(0x112)+a5_0x3434a6[_0x4f4ef9(0x135)](_0x2faeff['projectName']+'/'+_0x2faeff[_0x4f4ef9(0x11c)])),console[_0x4f4ef9(0x164)]();const _0xf6a18b=[],_0x51e392=[],_0x879c40=Date[_0x4f4ef9(0x116)]();for(let _0x39659c=0x0;_0x39659c<_0x2772d9['length'];_0x39659c++){const _0x106aef=_0x2772d9[_0x39659c];_0x2772d9[_0x4f4ef9(0x17a)]>0x1?console[_0x4f4ef9(0x164)](_0x4f4ef9(0xfa)+(_0x39659c+0x1)+'/'+_0x2772d9[_0x4f4ef9(0x17a)]+':\x20'+a5_0x3434a6['white'](_0x106aef[_0x4f4ef9(0x15b)])):console[_0x4f4ef9(0x164)](_0x4f4ef9(0x167)+a5_0x3434a6[_0x4f4ef9(0x135)](_0x106aef[_0x4f4ef9(0x15b)]));const _0x342207=createCommandSpinner('Round\x201/'+_0x106aef[_0x4f4ef9(0x12c)]['length']+_0x4f4ef9(0x13a));_0x342207['start']();try{const {result:_0x297aaa,conversation:_0x4ac154}=await runTest(_0x333807[_0x4f4ef9(0x11f)],_0x106aef,{'agentId':_0x2a9d56,'projectId':_0x4d5b90,'site':_0x55f2d1,'noEval':_0x14bb01,'evaluatorId':_0x4e7f84,'onRoundStart':(_0x53e604,_0x244011)=>{const _0x118004=_0x4f4ef9;_0x342207[_0x118004(0x15e)]=_0x118004(0x143)+(_0x53e604+0x1)+'/'+_0x244011+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x1481bd,_0x433301,_0x381434)=>{const _0x157251=_0x4f4ef9,_0x4e2212=formatElapsed(_0x433301);_0x381434?console[_0x157251(0x164)](_0x157251(0x16e)+(_0x1481bd+0x1)+'/'+_0x106aef[_0x157251(0x12c)]['length']+_0x157251(0x10b)+a5_0x3434a6['green']('✓')+'\x20('+_0x4e2212+')'):console[_0x157251(0x164)](_0x157251(0x16e)+(_0x1481bd+0x1)+'/'+_0x106aef[_0x157251(0x12c)]['length']+_0x157251(0x10b)+a5_0x3434a6[_0x157251(0xf2)]('✗'));},'onEvaluationStart':()=>{const _0x38f2e2=_0x4f4ef9;_0x342207[_0x38f2e2(0x15e)]=_0x38f2e2(0x181);},'onEvaluationComplete':_0x2db98c=>{const _0x175abc=_0x4f4ef9,_0x6ce0c6=formatElapsed(_0x2db98c);console[_0x175abc(0x164)](_0x175abc(0x131)+a5_0x3434a6[_0x175abc(0x130)]('✓')+'\x20('+_0x6ce0c6+')');}});_0x342207[_0x4f4ef9(0x179)](),_0xf6a18b[_0x4f4ef9(0x160)](_0x297aaa),_0x51e392[_0x4f4ef9(0x160)](_0x4ac154);if(_0x297aaa['status']===_0x4f4ef9(0x121))console[_0x4f4ef9(0x164)](a5_0x3434a6[_0x4f4ef9(0x130)](_0x4f4ef9(0x108)+_0x297aaa[_0x4f4ef9(0x13f)]));else _0x297aaa[_0x4f4ef9(0xfe)]===_0x4f4ef9(0x137)?console[_0x4f4ef9(0x164)](a5_0x3434a6[_0x4f4ef9(0xf2)]('✗\x20FAIL:\x20'+_0x297aaa['reason'])):console[_0x4f4ef9(0x164)](a5_0x3434a6[_0x4f4ef9(0xf2)](_0x4f4ef9(0x16f)+_0x297aaa['reason']));_0x297aaa[_0x4f4ef9(0xf8)]&&console['log'](a5_0x3434a6[_0x4f4ef9(0x127)](_0x4f4ef9(0x13d)+_0x297aaa[_0x4f4ef9(0xf8)])),console[_0x4f4ef9(0x164)]();}catch(_0x4fb694){_0x342207[_0x4f4ef9(0x179)]();const _0x24873e=_0x4fb694 instanceof Error?_0x4fb694[_0x4f4ef9(0x170)]:String(_0x4fb694);console[_0x4f4ef9(0x164)](a5_0x3434a6[_0x4f4ef9(0xf2)]('✗\x20ERROR:\x20'+_0x24873e)),console[_0x4f4ef9(0x164)](),_0xf6a18b[_0x4f4ef9(0x160)]({'name':_0x106aef['name'],'status':_0x4f4ef9(0x134),'reason':_0x24873e,'timestamp':new Date()[_0x4f4ef9(0x14b)](),'duration_ms':0x0});}}const _0x55a703=Date[_0x4f4ef9(0x116)]()-_0x879c40,_0x5bd0af=_0xf6a18b[_0x4f4ef9(0x14d)](_0x1d0655=>_0x1d0655[_0x4f4ef9(0xfe)]===_0x4f4ef9(0x121))[_0x4f4ef9(0x17a)],_0x3c8a71=_0xf6a18b['filter'](_0x24aa57=>_0x24aa57[_0x4f4ef9(0xfe)]==='FAIL')[_0x4f4ef9(0x17a)],_0x1ec554=_0xf6a18b[_0x4f4ef9(0x14d)](_0x132aed=>_0x132aed[_0x4f4ef9(0xfe)]==='ERROR')[_0x4f4ef9(0x17a)];console[_0x4f4ef9(0x164)]('━'[_0x4f4ef9(0x10a)](0x3c)),console[_0x4f4ef9(0x164)](_0x4f4ef9(0x110)),console[_0x4f4ef9(0x164)]('━'[_0x4f4ef9(0x10a)](0x3c)),console['log'](_0x4f4ef9(0x161)+_0xf6a18b[_0x4f4ef9(0x17a)]),console[_0x4f4ef9(0x164)](_0x4f4ef9(0x141)+a5_0x3434a6[_0x4f4ef9(0x130)](_0x5bd0af)),console[_0x4f4ef9(0x164)]('Failed:\x20\x20\x20'+a5_0x3434a6[_0x4f4ef9(0xf2)](_0x3c8a71));_0x1ec554>0x0&&console[_0x4f4ef9(0x164)](_0x4f4ef9(0x11a)+a5_0x3434a6[_0x4f4ef9(0xf2)](_0x1ec554));console[_0x4f4ef9(0x164)](_0x4f4ef9(0x119)+formatElapsed(_0x55a703)),console[_0x4f4ef9(0x164)]('━'[_0x4f4ef9(0x10a)](0x3c));const _0x799a1a=_0xf6a18b[_0x4f4ef9(0x14d)](_0x3946e4=>_0x3946e4['status']!==_0x4f4ef9(0x121));if(_0x799a1a['length']>0x0){console[_0x4f4ef9(0x164)](),console[_0x4f4ef9(0x164)](_0x4f4ef9(0x15a));for(const _0x61eaed of _0x799a1a){const _0x47ea83=a5_0x3434a6[_0x4f4ef9(0xf2)]('✗'),_0x324f79=_0x61eaed['reason'][_0x4f4ef9(0x17a)]>0x32?_0x61eaed[_0x4f4ef9(0x13f)][_0x4f4ef9(0x136)](0x0,0x32)+_0x4f4ef9(0x142):_0x61eaed[_0x4f4ef9(0x13f)];console['log']('\x20\x20'+_0x47ea83+'\x20'+_0x61eaed[_0x4f4ef9(0x15b)]+':\x20'+_0x324f79);}}const _0x149c8d={'summary':{'total':_0xf6a18b[_0x4f4ef9(0x17a)],'passed':_0x5bd0af,'failed':_0x3c8a71,'errors':_0x1ec554>0x0?_0x1ec554:undefined,'duration_ms':_0x55a703},'tests':_0xf6a18b,'agent':{'project':_0x2faeff[_0x4f4ef9(0x11b)],'name':_0x2faeff[_0x4f4ef9(0x11c)],'site':_0x55f2d1},'timestamp':new Date(_0x879c40)[_0x4f4ef9(0x14b)]()};try{const _0x120c1e=buildCachedTestRun(_0x51e392,{'site':_0x55f2d1,'projectId':_0x4d5b90,'projectName':_0x2faeff[_0x4f4ef9(0x11b)],'agentId':_0x2a9d56,'agentName':_0x2faeff[_0x4f4ef9(0x11c)],'testYmlPath':a5_0x3c7a89[_0x4f4ef9(0x10f)](_0x2faeff[_0x4f4ef9(0x184)])});saveLastTestRun(_0x120c1e);}catch{}if(_0x26a155!==_0x4f4ef9(0x105)||_0x1054a9){const _0x22bb83=formatResults(_0x149c8d,_0x26a155);if(_0x1054a9)try{a5_0x1bba5a[_0x4f4ef9(0x156)](_0x1054a9,_0x22bb83,_0x4f4ef9(0x151)),console[_0x4f4ef9(0x164)](),console[_0x4f4ef9(0x164)](a5_0x3434a6[_0x4f4ef9(0x127)](_0x4f4ef9(0x15c)+_0x1054a9));}catch(_0x3eb4da){return console[_0x4f4ef9(0x164)](),console['log'](a5_0x3434a6[_0x4f4ef9(0xf2)](_0x4f4ef9(0x17b)+_0x3eb4da)),0x1;}else console[_0x4f4ef9(0x164)](),console['log'](_0x22bb83);}return _0x799a1a[_0x4f4ef9(0x17a)]>0x0?0x1:0x0;}async[a5_0x38f582(0x144)](_0x3c754a,_0x53e351){const _0x2974f6=a5_0x38f582,{options:_0x59e55b,tdx:_0x52ece0}=_0x3c754a,{definition:_0x393194,agentInfo:_0x90e57e,outputFormat:_0x17dbd5,outputFile:_0x1369a9}=_0x53e351,_0x32a270=_0x59e55b[_0x2974f6(0x168)],_0x4b3bd9=loadLastTestRun();if(!_0x4b3bd9)return console[_0x2974f6(0x164)](a5_0x3434a6['red']('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x2974f6(0x164)](a5_0x3434a6[_0x2974f6(0x127)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x4b3bd9['agent'][_0x2974f6(0x11c)]!==_0x90e57e[_0x2974f6(0x11c)])return console['log'](a5_0x3434a6[_0x2974f6(0xf2)](_0x2974f6(0x152)+_0x4b3bd9[_0x2974f6(0x125)]['agentName']+_0x2974f6(0xf9)+_0x90e57e[_0x2974f6(0x11c)]+'\x22.')),console['log'](a5_0x3434a6[_0x2974f6(0x127)](_0x2974f6(0x126))),0x1;const _0x689ef0=new Set(_0x4b3bd9[_0x2974f6(0x10d)]['map'](_0x245357=>_0x245357[_0x2974f6(0x149)])),_0x10839a=_0x393194[_0x2974f6(0x172)][_0x2974f6(0x14d)](_0x55705b=>!_0x689ef0['has'](_0x55705b['name']));if(_0x10839a[_0x2974f6(0x17a)]>0x0&&_0x4b3bd9[_0x2974f6(0x168)]!==_0x32a270)return console['log'](a5_0x3434a6[_0x2974f6(0xf2)](_0x2974f6(0x132))),console[_0x2974f6(0x164)](a5_0x3434a6[_0x2974f6(0x127)](_0x2974f6(0x124)+_0x4b3bd9[_0x2974f6(0x168)]+_0x2974f6(0x169)+_0x32a270+'\x22.')),console[_0x2974f6(0x164)](a5_0x3434a6[_0x2974f6(0x127)](_0x2974f6(0x120)+_0x4b3bd9[_0x2974f6(0x168)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x32b1da=_0x393194[_0x2974f6(0x172)][_0x2974f6(0x14d)](_0x1b1e4d=>_0x689ef0[_0x2974f6(0x114)](_0x1b1e4d['name'])),_0x1409c5=_0x10839a;let _0x1a8ad5;try{_0x1a8ad5=await setupEvaluatorAgent(_0x52ece0[_0x2974f6(0x11f)],_0x59e55b[_0x2974f6(0x159)]);}catch(_0x1a9ed7){const _0x5b00fa=_0x1a9ed7 instanceof Error?_0x1a9ed7[_0x2974f6(0x170)]:String(_0x1a9ed7);return console[_0x2974f6(0x164)](a5_0x3434a6['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x5b00fa)),0x1;}console[_0x2974f6(0x164)](a5_0x3434a6['cyan'](_0x2974f6(0x155))),console[_0x2974f6(0x164)](_0x2974f6(0x171)+a5_0x3434a6['white'](_0x4b3bd9[_0x2974f6(0x10c)])),console[_0x2974f6(0x164)](_0x2974f6(0x112)+a5_0x3434a6['white'](_0x4b3bd9[_0x2974f6(0x125)]['projectName']+'/'+_0x4b3bd9[_0x2974f6(0x125)][_0x2974f6(0x11c)]));_0x1409c5[_0x2974f6(0x17a)]>0x0&&console[_0x2974f6(0x164)](_0x2974f6(0xf6)+a5_0x3434a6[_0x2974f6(0x177)](_0x1409c5['length']));console[_0x2974f6(0x164)]();const _0x321d94=[],_0x236c67=Date[_0x2974f6(0x116)](),_0x5e2b26=createCommandSpinner(_0x2974f6(0x118));if(_0x32b1da[_0x2974f6(0x17a)]>0x0)try{const _0x573aad=await reevaluateFromCache(_0x52ece0[_0x2974f6(0x11f)],_0x4b3bd9,{'tests':_0x32b1da},{'evaluatorId':_0x1a8ad5,'onTestStart':(_0x2f637f,_0x365ee8,_0x4f1ab3)=>{const _0x30bccc=_0x2974f6;_0x5e2b26[_0x30bccc(0x15e)]=_0x30bccc(0x173)+(_0x365ee8+0x1)+'/'+_0x4f1ab3+':\x20'+_0x2f637f+'...';if(!_0x5e2b26[_0x30bccc(0x16b)])_0x5e2b26[_0x30bccc(0x145)]();},'onTestComplete':(_0x248706,_0x30e0e8)=>{const _0x1fc6e0=_0x2974f6;_0x5e2b26['stop']();if(_0x30e0e8[_0x1fc6e0(0xfe)]==='PASS')console[_0x1fc6e0(0x164)](a5_0x3434a6[_0x1fc6e0(0x130)](_0x1fc6e0(0x108)+_0x248706)+a5_0x3434a6[_0x1fc6e0(0x127)](_0x1fc6e0(0x12b)));else _0x30e0e8[_0x1fc6e0(0xfe)]===_0x1fc6e0(0x137)?console['log'](a5_0x3434a6[_0x1fc6e0(0xf2)](_0x1fc6e0(0xf4)+_0x248706+_0x1fc6e0(0x166)+_0x30e0e8[_0x1fc6e0(0x13f)])+a5_0x3434a6[_0x1fc6e0(0x127)](_0x1fc6e0(0x12b))):console[_0x1fc6e0(0x164)](a5_0x3434a6[_0x1fc6e0(0xf2)](_0x1fc6e0(0x16f)+_0x248706+_0x1fc6e0(0x166)+_0x30e0e8[_0x1fc6e0(0x13f)]));_0x30e0e8['conversation_url']&&console['log'](a5_0x3434a6[_0x1fc6e0(0x127)]('\x20\x20Conversation:\x20'+_0x30e0e8[_0x1fc6e0(0xf8)])),_0x321d94['push'](_0x30e0e8);},'onTestSkipped':(_0x34b0cb,_0x1c3b5a)=>{const _0xff4490=_0x2974f6;_0x5e2b26[_0xff4490(0x179)](),console['log'](a5_0x3434a6['yellow']('⚠\x20SKIPPED:\x20'+_0x34b0cb+'\x20-\x20'+_0x1c3b5a));}});for(const _0x21d44d of _0x573aad){!_0x321d94[_0x2974f6(0x100)](_0x51a1de=>_0x51a1de['name']===_0x21d44d[_0x2974f6(0x15b)])&&_0x321d94['push'](_0x21d44d);}}catch(_0x2efb0a){_0x5e2b26[_0x2974f6(0x179)]();const _0x33790b=_0x2efb0a instanceof Error?_0x2efb0a[_0x2974f6(0x170)]:String(_0x2efb0a);return console[_0x2974f6(0x164)](a5_0x3434a6[_0x2974f6(0xf2)](_0x2974f6(0x180)+_0x33790b)),0x1;}_0x5e2b26[_0x2974f6(0x179)]();if(_0x1409c5['length']>0x0){console[_0x2974f6(0x164)](),console[_0x2974f6(0x164)](a5_0x3434a6['cyan']('Executing\x20new\x20tests...'));const {projectId:_0x53a30c,agentId:_0x1b96a0}=_0x4b3bd9[_0x2974f6(0x125)];for(const _0x1b864e of _0x1409c5){console[_0x2974f6(0x164)](_0x2974f6(0x158)+a5_0x3434a6['white'](_0x1b864e[_0x2974f6(0x15b)]));const _0x52947c=createCommandSpinner('Round\x201/'+_0x1b864e[_0x2974f6(0x12c)][_0x2974f6(0x17a)]+_0x2974f6(0x13a));_0x52947c[_0x2974f6(0x145)]();try{const {result:_0x524079}=await runTest(_0x52ece0[_0x2974f6(0x11f)],_0x1b864e,{'agentId':_0x1b96a0,'projectId':_0x53a30c,'site':_0x4b3bd9['site'],'noEval':![],'evaluatorId':_0x1a8ad5,'onRoundStart':(_0x4f71b4,_0xd0eb46)=>{const _0xdcef3f=_0x2974f6;_0x52947c[_0xdcef3f(0x15e)]=_0xdcef3f(0x143)+(_0x4f71b4+0x1)+'/'+_0xd0eb46+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x4b6d55,_0x108e1d,_0x77b7bd)=>{const _0x4c8998=_0x2974f6,_0x5a76a4=formatElapsed(_0x108e1d);_0x77b7bd?console[_0x4c8998(0x164)](_0x4c8998(0x16e)+(_0x4b6d55+0x1)+'/'+_0x1b864e[_0x4c8998(0x12c)][_0x4c8998(0x17a)]+_0x4c8998(0x10b)+a5_0x3434a6[_0x4c8998(0x130)]('✓')+'\x20('+_0x5a76a4+')'):console[_0x4c8998(0x164)](_0x4c8998(0x16e)+(_0x4b6d55+0x1)+'/'+_0x1b864e['rounds']['length']+_0x4c8998(0x10b)+a5_0x3434a6[_0x4c8998(0xf2)]('✗'));},'onEvaluationStart':()=>{const _0x4ef9fe=_0x2974f6;_0x52947c['text']=_0x4ef9fe(0x181);},'onEvaluationComplete':_0x52e942=>{const _0x20729b=_0x2974f6,_0x3dad54=formatElapsed(_0x52e942);console[_0x20729b(0x164)]('\x20\x20Evaluating...\x20'+a5_0x3434a6[_0x20729b(0x130)]('✓')+'\x20('+_0x3dad54+')');}});_0x52947c[_0x2974f6(0x179)](),_0x321d94[_0x2974f6(0x160)](_0x524079);if(_0x524079['status']===_0x2974f6(0x121))console[_0x2974f6(0x164)](a5_0x3434a6[_0x2974f6(0x130)]('✓\x20PASS:\x20'+_0x524079[_0x2974f6(0x13f)])+a5_0x3434a6[_0x2974f6(0x127)](_0x2974f6(0x153)));else _0x524079['status']===_0x2974f6(0x137)?console[_0x2974f6(0x164)](a5_0x3434a6[_0x2974f6(0xf2)](_0x2974f6(0xf4)+_0x524079[_0x2974f6(0x13f)])+a5_0x3434a6[_0x2974f6(0x127)](_0x2974f6(0x153))):console[_0x2974f6(0x164)](a5_0x3434a6[_0x2974f6(0xf2)](_0x2974f6(0x16f)+_0x524079[_0x2974f6(0x13f)]));_0x524079[_0x2974f6(0xf8)]&&console['log'](a5_0x3434a6['dim'](_0x2974f6(0x182)+_0x524079['conversation_url']));}catch(_0x22bc68){_0x52947c[_0x2974f6(0x179)]();const _0x4e15e6=_0x22bc68 instanceof Error?_0x22bc68[_0x2974f6(0x170)]:String(_0x22bc68);console[_0x2974f6(0x164)](a5_0x3434a6['red'](_0x2974f6(0x16f)+_0x4e15e6)),_0x321d94[_0x2974f6(0x160)]({'name':_0x1b864e[_0x2974f6(0x15b)],'status':_0x2974f6(0x134),'reason':_0x4e15e6,'timestamp':new Date()[_0x2974f6(0x14b)](),'duration_ms':0x0});}}}console[_0x2974f6(0x164)]();const _0x4cf4c6=Date[_0x2974f6(0x116)]()-_0x236c67,_0xa8bb9a=_0x321d94['filter'](_0x1cdee7=>_0x1cdee7[_0x2974f6(0xfe)]===_0x2974f6(0x121))[_0x2974f6(0x17a)],_0x24201a=_0x321d94[_0x2974f6(0x14d)](_0x28750e=>_0x28750e[_0x2974f6(0xfe)]===_0x2974f6(0x137))[_0x2974f6(0x17a)],_0x25d813=_0x321d94[_0x2974f6(0x14d)](_0x1f3456=>_0x1f3456['status']===_0x2974f6(0x134))[_0x2974f6(0x17a)];console[_0x2974f6(0x164)]('━'[_0x2974f6(0x10a)](0x3c)),console[_0x2974f6(0x164)](_0x2974f6(0xf7)),console[_0x2974f6(0x164)]('━'[_0x2974f6(0x10a)](0x3c)),console['log'](_0x2974f6(0x161)+_0x321d94['length']),console[_0x2974f6(0x164)](_0x2974f6(0x141)+a5_0x3434a6[_0x2974f6(0x130)](_0xa8bb9a)),console['log']('Failed:\x20\x20\x20'+a5_0x3434a6[_0x2974f6(0xf2)](_0x24201a));_0x25d813>0x0&&console[_0x2974f6(0x164)](_0x2974f6(0x11a)+a5_0x3434a6[_0x2974f6(0xf2)](_0x25d813));console[_0x2974f6(0x164)]('Duration:\x20'+formatElapsed(_0x4cf4c6)),console[_0x2974f6(0x164)]('━'['repeat'](0x3c));const _0x981888={'summary':{'total':_0x321d94[_0x2974f6(0x17a)],'passed':_0xa8bb9a,'failed':_0x24201a,'errors':_0x25d813>0x0?_0x25d813:undefined,'duration_ms':_0x4cf4c6},'tests':_0x321d94,'agent':{'project':_0x90e57e['projectName'],'name':_0x90e57e[_0x2974f6(0x11c)],'site':_0x32a270},'timestamp':new Date(_0x236c67)[_0x2974f6(0x14b)]()};if(_0x17dbd5!=='table'||_0x1369a9){const _0x5b1dd9=formatResults(_0x981888,_0x17dbd5);if(_0x1369a9)try{a5_0x1bba5a[_0x2974f6(0x156)](_0x1369a9,_0x5b1dd9,'utf-8'),console[_0x2974f6(0x164)](),console[_0x2974f6(0x164)](a5_0x3434a6['dim'](_0x2974f6(0x15c)+_0x1369a9));}catch(_0x1d7afd){return console[_0x2974f6(0x164)](),console[_0x2974f6(0x164)](a5_0x3434a6[_0x2974f6(0xf2)](_0x2974f6(0x17b)+_0x1d7afd)),0x1;}else console[_0x2974f6(0x164)](),console[_0x2974f6(0x164)](_0x5b1dd9);}const _0x1a6f9f=_0x321d94[_0x2974f6(0x14d)](_0x285a50=>_0x285a50['status']!=='PASS');return _0x1a6f9f[_0x2974f6(0x17a)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0xe72bc9=a6_0x265a;(function(_0x52c269,_0x33e75d){const _0x57c87f=a6_0x265a,_0x3b2610=_0x52c269();while(!![]){try{const _0x5539ba=parseInt(_0x57c87f(0x13e))/0x1*(-parseInt(_0x57c87f(0x146))/0x2)+parseInt(_0x57c87f(0x171))/0x3+parseInt(_0x57c87f(0x149))/0x4+-parseInt(_0x57c87f(0x158))/0x5*(-parseInt(_0x57c87f(0x13c))/0x6)+-parseInt(_0x57c87f(0x151))/0x7*(-parseInt(_0x57c87f(0x172))/0x8)+parseInt(_0x57c87f(0x168))/0x9+-parseInt(_0x57c87f(0x142))/0xa;if(_0x5539ba===_0x33e75d)break;else _0x3b2610['push'](_0x3b2610['shift']());}catch(_0x2fa8f3){_0x3b2610['push'](_0x3b2610['shift']());}}}(a6_0x2e7b,0xdcc0a));import{BaseCommand}from'./command.js';function a6_0x265a(_0xa4c80a,_0x5f3322){_0xa4c80a=_0xa4c80a-0x138;const _0x2e7b58=a6_0x2e7b();let _0x265ae9=_0x2e7b58[_0xa4c80a];return _0x265ae9;}import{RawAPI}from'../sdk/api.js';function a6_0x2e7b(){const _0x2078ff=['has','toLowerCase','trim','includes','35HzFmUt','\x0aStack\x20trace:\x0a','message','length','noColor','log','name','137665nkWoqC','readBodyFromFile','indexOf','error','data','x-xsrf-token','PATCH','set-cookie','authorization','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','substring','stack','proxy-authorization','x-trino-user','.\x20Valid\x20types:\x20','startsWith','6556662fAoQUs','Results\x20saved\x20to\x20','toUpperCase','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','Invalid\x20header\x20format:\x20\x22','workflow','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','cdp','llm','399555YggwGD','711496atDoZa','status','headers','entries','trino','Error:\x20','POST','type','description','file','174CGuSfU','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','1fsxpTQ','header','output','join','15318420duqfyb','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','color','site','1579670OHdGqm','isArray','GET','4484136SfGEIS','method','api','verbose'];a6_0x2e7b=function(){return _0x2078ff;};return a6_0x2e7b();}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_0xe72bc9(0x160),a6_0xe72bc9(0x164),'cookie',a6_0xe72bc9(0x15f),'set-cookie2',a6_0xe72bc9(0x15d),'x-auth-token',a6_0xe72bc9(0x165)]);function isSensitiveHeader(_0x39eb0b){const _0x182506=a6_0xe72bc9;return SENSITIVE_HEADERS[_0x182506(0x14d)](_0x39eb0b[_0x182506(0x14e)]());}function parseHeader(_0x220cfc){const _0x46dcae=a6_0xe72bc9,_0x48228d=_0x220cfc[_0x46dcae(0x15a)](':');if(_0x48228d===-0x1)throw new Error(_0x46dcae(0x16c)+_0x220cfc+'\x22.\x20'+_0x46dcae(0x143));const _0x2e1fec=_0x220cfc[_0x46dcae(0x162)](0x0,_0x48228d)['trim'](),_0x2ccb88=_0x220cfc['substring'](_0x48228d+0x1)[_0x46dcae(0x14f)]();if(!_0x2e1fec)throw new Error(_0x46dcae(0x161)+_0x220cfc+'\x22');return[_0x2e1fec,_0x2ccb88];}export class ApiCommand extends BaseCommand{[a6_0xe72bc9(0x157)]=a6_0xe72bc9(0x14b);[a6_0xe72bc9(0x13a)]=a6_0xe72bc9(0x16e);['validate'](_0x1c58e7){const _0x2926f0=a6_0xe72bc9,{args:_0x5dd772,options:_0x591b4b}=_0x1c58e7,_0x40539c=_0x591b4b;if(_0x5dd772['length']===0x0)return _0x2926f0(0x13d);const _0x16d6ed=_0x5dd772[0x0];if(!_0x16d6ed[_0x2926f0(0x167)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x16d6ed;const _0x355484=_0x40539c[_0x2926f0(0x15c)],_0x44e86d=_0x40539c[_0x2926f0(0x13b)];if(_0x355484&&_0x44e86d)return _0x2926f0(0x16b);const _0xc3906d=_0x40539c[_0x2926f0(0x14a)]||_0x2926f0(0x148),_0x2c0f26=[_0x2926f0(0x148),_0x2926f0(0x138),'PUT','DELETE',_0x2926f0(0x15e)];if(!_0x2c0f26[_0x2926f0(0x150)](_0xc3906d[_0x2926f0(0x16a)]()))return'Invalid\x20HTTP\x20method:\x20'+_0xc3906d+'.\x20Valid\x20methods:\x20'+_0x2c0f26[_0x2926f0(0x141)](',\x20');const _0x2485da=_0x40539c[_0x2926f0(0x139)]||'td',_0x572759=['td',_0x2926f0(0x16f),_0x2926f0(0x16d),_0x2926f0(0x176),_0x2926f0(0x170),'llm-proxy'];if(!_0x572759['includes'](_0x2485da))return'Invalid\x20API\x20type:\x20'+_0x2485da+_0x2926f0(0x166)+_0x572759['join'](',\x20');return undefined;}async['execute'](_0x16b82e){const _0x35bb04=a6_0xe72bc9,{options:_0x5e3917,args:_0x1f6cdd,tdx:_0x3f9a51}=_0x16b82e,_0x2c18d9=_0x5e3917,_0x52b77f=_0x1f6cdd[0x0],_0x2f38b9=(_0x2c18d9['method']||'GET')[_0x35bb04(0x16a)](),_0x12a1aa=_0x2c18d9[_0x35bb04(0x15c)],_0x18e1fb=_0x2c18d9[_0x35bb04(0x13b)],_0x49d6d5=_0x2c18d9[_0x35bb04(0x13f)],_0x585220=_0x2c18d9[_0x35bb04(0x139)]||'td';try{const _0xddb69f={};if(_0x49d6d5){const _0x2563b9=Array[_0x35bb04(0x147)](_0x49d6d5)?_0x49d6d5:[_0x49d6d5];for(const _0x2847f7 of _0x2563b9){const [_0x38e750,_0x53236b]=parseHeader(_0x2847f7);_0xddb69f[_0x38e750]=_0x53236b;}}let _0x384d6b;if(_0x12a1aa)_0x384d6b=_0x12a1aa;else{if(_0x18e1fb)try{_0x384d6b=RawAPI[_0x35bb04(0x159)](_0x18e1fb);}catch(_0x528d1b){return console[_0x35bb04(0x15b)]('Error:\x20'+(_0x528d1b instanceof Error?_0x528d1b[_0x35bb04(0x153)]:String(_0x528d1b))),0x1;}}const _0x5ed025={'method':_0x2f38b9,'apiType':_0x585220,'includeHeaders':_0x5e3917[_0x35bb04(0x14c)]};_0x384d6b&&(_0x5ed025['body']=_0x384d6b);Object['keys'](_0xddb69f)[_0x35bb04(0x154)]>0x0&&(_0x5ed025[_0x35bb04(0x174)]=_0xddb69f);if(_0x5e3917[_0x35bb04(0x14c)]){const _0x399bca=resolveSite(_0x5e3917[_0x35bb04(0x145)]),_0x47c1f8=getEndpoint(_0x399bca,_0x585220),_0x603d72=''+_0x47c1f8+_0x52b77f;console[_0x35bb04(0x15b)]('>\x20'+_0x2f38b9+'\x20'+_0x603d72);const _0x9a2f64=getAuthHeaders(_0x399bca),_0x56fab0={..._0x9a2f64,..._0xddb69f};for(const [_0x16d4c4,_0xb975e1]of Object[_0x35bb04(0x175)](_0x56fab0)){!isSensitiveHeader(_0x16d4c4)&&console[_0x35bb04(0x15b)]('>\x20'+_0x16d4c4+':\x20'+_0xb975e1);}_0x384d6b&&console[_0x35bb04(0x15b)]('>'),console[_0x35bb04(0x15b)]('');}const _0x42f2b9=await _0x3f9a51['api']['request'](_0x52b77f,_0x5ed025);if(_0x5e3917[_0x35bb04(0x14c)]&&_0x42f2b9[_0x35bb04(0x174)]){console[_0x35bb04(0x15b)]('<\x20HTTP/1.1\x20'+_0x42f2b9[_0x35bb04(0x173)]);for(const [_0xe1b1c3,_0x187ba1]of Object['entries'](_0x42f2b9[_0x35bb04(0x174)])){!isSensitiveHeader(_0xe1b1c3)&&console[_0x35bb04(0x15b)]('<\x20'+_0xe1b1c3+':\x20'+_0x187ba1);}console[_0x35bb04(0x15b)]('');}const _0x2eda0e=Boolean(_0x5e3917['output']),_0x3777c4={'color':_0x5e3917['color'],'noColor':_0x5e3917[_0x35bb04(0x155)]||_0x2eda0e&&!_0x5e3917[_0x35bb04(0x144)]},_0xfafb71=colorizeJSON(_0x42f2b9['data'],_0x3777c4);return _0x5e3917[_0x35bb04(0x140)]?(writeFileSync(_0x5e3917[_0x35bb04(0x140)],_0xfafb71),console['error'](_0x35bb04(0x169)+_0x5e3917[_0x35bb04(0x140)])):console[_0x35bb04(0x156)](_0xfafb71),0x0;}catch(_0x5491ab){return _0x5491ab instanceof Error?(console[_0x35bb04(0x15b)](_0x35bb04(0x177)+_0x5491ab['message']),_0x5e3917[_0x35bb04(0x14c)]&&_0x5491ab[_0x35bb04(0x163)]&&console[_0x35bb04(0x15b)](_0x35bb04(0x152)+_0x5491ab['stack'])):console[_0x35bb04(0x15b)](_0x35bb04(0x177)+String(_0x5491ab)),0x1;}}}
1
+ const a6_0x11d806=a6_0x4b77;(function(_0x3c6e55,_0xf3a705){const _0x16f8e5=a6_0x4b77,_0x2b81af=_0x3c6e55();while(!![]){try{const _0x463cd2=parseInt(_0x16f8e5(0x92))/0x1*(parseInt(_0x16f8e5(0x7a))/0x2)+-parseInt(_0x16f8e5(0x73))/0x3+parseInt(_0x16f8e5(0x90))/0x4*(-parseInt(_0x16f8e5(0xa0))/0x5)+-parseInt(_0x16f8e5(0x8f))/0x6*(-parseInt(_0x16f8e5(0x78))/0x7)+parseInt(_0x16f8e5(0x93))/0x8+-parseInt(_0x16f8e5(0x99))/0x9*(parseInt(_0x16f8e5(0x8b))/0xa)+-parseInt(_0x16f8e5(0x96))/0xb*(-parseInt(_0x16f8e5(0x76))/0xc);if(_0x463cd2===_0xf3a705)break;else _0x2b81af['push'](_0x2b81af['shift']());}catch(_0x3c7246){_0x2b81af['push'](_0x2b81af['shift']());}}}(a6_0x4dde,0x71335));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';function a6_0x4b77(_0x75a92,_0x220d48){_0x75a92=_0x75a92-0x6f;const _0x4ddecf=a6_0x4dde();let _0x4b775a=_0x4ddecf[_0x75a92];return _0x4b775a;}function a6_0x4dde(){const _0x1c6e92=['Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','49ybKqUU','api','1050454dzZBEb','type','trino','site','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','method','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','body','has','.\x20Valid\x20methods:\x20','POST','GET','set-cookie','x-trino-user','.\x20Valid\x20types:\x20','toUpperCase','<\x20HTTP/1.1\x20','410mMlwXb','indexOf','PATCH','entries','372324zOZIae','3628796VpgYEu','description','1FxQlzr','4534128QpGESU','output','authorization','2255FrqvEr','DELETE','Invalid\x20header\x20format:\x20\x22','106569eAgorJ','trim','stack','join','error','verbose','Error:\x20','5fYlTVN','status','substring','startsWith','readBodyFromFile','Endpoint\x20must\x20start\x20with\x20/:\x20','llm','toLowerCase','Invalid\x20API\x20type:\x20','cdp','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','headers','file','cookie','\x0aStack\x20trace:\x0a','validate','execute','data','message','noColor','log','name','x-xsrf-token','Invalid\x20HTTP\x20method:\x20','set-cookie2','2061696Nuflde','workflow','length','59544bAybCm'];a6_0x4dde=function(){return _0x1c6e92;};return a6_0x4dde();}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_0x11d806(0x95),'proxy-authorization',a6_0x11d806(0xad),a6_0x11d806(0x86),a6_0x11d806(0x72),a6_0x11d806(0x70),'x-auth-token',a6_0x11d806(0x87)]);function isSensitiveHeader(_0x1d04fe){const _0x3e7ade=a6_0x11d806;return SENSITIVE_HEADERS[_0x3e7ade(0x82)](_0x1d04fe[_0x3e7ade(0xa7)]());}function parseHeader(_0x56015b){const _0x28c42b=a6_0x11d806,_0x23e596=_0x56015b[_0x28c42b(0x8c)](':');if(_0x23e596===-0x1)throw new Error(_0x28c42b(0x98)+_0x56015b+'\x22.\x20'+_0x28c42b(0x80));const _0xd1f0c9=_0x56015b['substring'](0x0,_0x23e596)[_0x28c42b(0x9a)](),_0x3884a8=_0x56015b[_0x28c42b(0xa2)](_0x23e596+0x1)[_0x28c42b(0x9a)]();if(!_0xd1f0c9)throw new Error(_0x28c42b(0x7e)+_0x56015b+'\x22');return[_0xd1f0c9,_0x3884a8];}export class ApiCommand extends BaseCommand{[a6_0x11d806(0x6f)]=a6_0x11d806(0x79);[a6_0x11d806(0x91)]=a6_0x11d806(0x77);[a6_0x11d806(0xaf)](_0x48678f){const _0x354928=a6_0x11d806,{args:_0x3a11b7,options:_0x513184}=_0x48678f,_0x4bd74a=_0x513184;if(_0x3a11b7[_0x354928(0x75)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x427fa6=_0x3a11b7[0x0];if(!_0x427fa6[_0x354928(0xa3)]('/'))return _0x354928(0xa5)+_0x427fa6;const _0x40fd55=_0x4bd74a['data'],_0x250529=_0x4bd74a[_0x354928(0xac)];if(_0x40fd55&&_0x250529)return _0x354928(0xaa);const _0x4e80a0=_0x4bd74a[_0x354928(0x7f)]||_0x354928(0x85),_0x46a999=[_0x354928(0x85),_0x354928(0x84),'PUT',_0x354928(0x97),_0x354928(0x8d)];if(!_0x46a999['includes'](_0x4e80a0[_0x354928(0x89)]()))return _0x354928(0x71)+_0x4e80a0+_0x354928(0x83)+_0x46a999[_0x354928(0x9c)](',\x20');const _0x53b01e=_0x4bd74a['type']||'td',_0x1f180c=['td',_0x354928(0xa9),_0x354928(0x74),_0x354928(0x7c),_0x354928(0xa6),'llm-proxy'];if(!_0x1f180c['includes'](_0x53b01e))return _0x354928(0xa8)+_0x53b01e+_0x354928(0x88)+_0x1f180c['join'](',\x20');return undefined;}async[a6_0x11d806(0xb0)](_0x563122){const _0x142acf=a6_0x11d806,{options:_0xc7dea9,args:_0x7b69b2,tdx:_0x10db0b}=_0x563122,_0xbc8f2f=_0xc7dea9,_0x186050=_0x7b69b2[0x0],_0x9320e6=(_0xbc8f2f['method']||_0x142acf(0x85))[_0x142acf(0x89)](),_0x31fb5a=_0xbc8f2f[_0x142acf(0xb1)],_0x274c5b=_0xbc8f2f['file'],_0x204245=_0xbc8f2f['header'],_0x469196=_0xbc8f2f[_0x142acf(0x7b)]||'td';try{const _0x12e13e={};if(_0x204245){const _0x470a39=Array['isArray'](_0x204245)?_0x204245:[_0x204245];for(const _0xa6e5a3 of _0x470a39){const [_0x44cf37,_0xfa6356]=parseHeader(_0xa6e5a3);_0x12e13e[_0x44cf37]=_0xfa6356;}}let _0x7b88fc;if(_0x31fb5a)_0x7b88fc=_0x31fb5a;else{if(_0x274c5b)try{_0x7b88fc=RawAPI[_0x142acf(0xa4)](_0x274c5b);}catch(_0x3d4516){return console[_0x142acf(0x9d)](_0x142acf(0x9f)+(_0x3d4516 instanceof Error?_0x3d4516[_0x142acf(0xb2)]:String(_0x3d4516))),0x1;}}const _0x36df5d={'method':_0x9320e6,'apiType':_0x469196,'includeHeaders':_0xc7dea9[_0x142acf(0x9e)]};_0x7b88fc&&(_0x36df5d[_0x142acf(0x81)]=_0x7b88fc);Object['keys'](_0x12e13e)[_0x142acf(0x75)]>0x0&&(_0x36df5d['headers']=_0x12e13e);if(_0xc7dea9[_0x142acf(0x9e)]){const _0x242338=resolveSite(_0xc7dea9[_0x142acf(0x7d)]),_0x3bce32=getEndpoint(_0x242338,_0x469196),_0x40b267=''+_0x3bce32+_0x186050;console[_0x142acf(0x9d)]('>\x20'+_0x9320e6+'\x20'+_0x40b267);const _0x5a8619=getAuthHeaders(_0x242338),_0x56722a={..._0x5a8619,..._0x12e13e};for(const [_0x322259,_0x43c693]of Object['entries'](_0x56722a)){!isSensitiveHeader(_0x322259)&&console[_0x142acf(0x9d)]('>\x20'+_0x322259+':\x20'+_0x43c693);}_0x7b88fc&&console[_0x142acf(0x9d)]('>'),console['error']('');}const _0x2455b9=await _0x10db0b['api']['request'](_0x186050,_0x36df5d);if(_0xc7dea9['verbose']&&_0x2455b9[_0x142acf(0xab)]){console['error'](_0x142acf(0x8a)+_0x2455b9[_0x142acf(0xa1)]);for(const [_0x44d9ce,_0x5144f5]of Object[_0x142acf(0x8e)](_0x2455b9[_0x142acf(0xab)])){!isSensitiveHeader(_0x44d9ce)&&console[_0x142acf(0x9d)]('<\x20'+_0x44d9ce+':\x20'+_0x5144f5);}console[_0x142acf(0x9d)]('');}const _0x4d8980=Boolean(_0xc7dea9[_0x142acf(0x94)]),_0x3dc8a8={'color':_0xc7dea9['color'],'noColor':_0xc7dea9[_0x142acf(0xb3)]||_0x4d8980&&!_0xc7dea9['color']},_0x67dcf9=colorizeJSON(_0x2455b9['data'],_0x3dc8a8);return _0xc7dea9[_0x142acf(0x94)]?(writeFileSync(_0xc7dea9[_0x142acf(0x94)],_0x67dcf9),console['error']('Results\x20saved\x20to\x20'+_0xc7dea9[_0x142acf(0x94)])):console[_0x142acf(0xb4)](_0x67dcf9),0x0;}catch(_0x4121e0){return _0x4121e0 instanceof Error?(console[_0x142acf(0x9d)](_0x142acf(0x9f)+_0x4121e0[_0x142acf(0xb2)]),_0xc7dea9[_0x142acf(0x9e)]&&_0x4121e0[_0x142acf(0x9b)]&&console[_0x142acf(0x9d)](_0x142acf(0xae)+_0x4121e0[_0x142acf(0x9b)])):console[_0x142acf(0x9d)](_0x142acf(0x9f)+String(_0x4121e0)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x14d0db=a7_0x1959;(function(_0x4fa23d,_0x108e9c){const _0xc226ed=a7_0x1959,_0x20d070=_0x4fa23d();while(!![]){try{const _0x2c70a8=parseInt(_0xc226ed(0x208))/0x1+-parseInt(_0xc226ed(0x1d0))/0x2*(-parseInt(_0xc226ed(0x1f2))/0x3)+-parseInt(_0xc226ed(0x1d3))/0x4*(-parseInt(_0xc226ed(0x1df))/0x5)+-parseInt(_0xc226ed(0x219))/0x6*(-parseInt(_0xc226ed(0x1d5))/0x7)+-parseInt(_0xc226ed(0x1cb))/0x8+-parseInt(_0xc226ed(0x210))/0x9*(-parseInt(_0xc226ed(0x217))/0xa)+parseInt(_0xc226ed(0x1e6))/0xb*(-parseInt(_0xc226ed(0x209))/0xc);if(_0x2c70a8===_0x108e9c)break;else _0x20d070['push'](_0x20d070['shift']());}catch(_0x5cb2f7){_0x20d070['push'](_0x20d070['shift']());}}}(a7_0x4f54,0x5e3b2));function a7_0x1959(_0x19ad33,_0x367b19){_0x19ad33=_0x19ad33-0x1ca;const _0x4f54a2=a7_0x4f54();let _0x19590e=_0x4f54a2[_0x19ad33];return _0x19590e;}function a7_0x4f54(){const _0x1c2061=['password','377931JmRiEu','auth:setup','last_name','Name:\x20','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','trim','tdx\x20profile:\x20','Enter\x20your\x20TD\x20API\x20key:','\x20(site:\x20','name','API\x20key\x20cannot\x20be\x20empty','✓\x20API\x20key\x20removed\x20from\x20keychain','bold','Select\x20your\x20Treasure\x20Data\x20site:','filter','Validating\x20API\x20key...','✓\x20Authentication\x20successful\x0a','Read\x20credential\x20from\x20','✗\x20Validation\x20failed:\x20','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','profile','jobs','376422PKiUfe','630348OfoySn','join','Remove\x20API\x20key\x20from\x20system\x20keychain','red','customSite','✓\x20Profile\x20\x27','log','1640097fUPkZw','\x20\x20tdx','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','test','You\x20can\x20find\x20your\x20API\x20key\x20at:','getUserInfo','30KPSzRK','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','340482IxiZtj','us01','N/A','3319088zWMoNi','error','\x20--profile\x20','warn','Enter\x20site\x20name:','4nWmBGb','User:\x20','message','69724roLieO','create','49qsdSlo','execute','✓\x20Default\x20site\x20set\x20to\x20','Setting\x20up\x20authentication\x20for\x20site:\x20','site','No\x20credential\x20found','\x20for\x20profile:\x20','other','description','first_name','65sfYAwu','tdx:\x20auth\x20setup','System\x20keychain\x20is\x20not\x20available','email','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','auth:clear','Site\x20name\x20cannot\x20be\x20empty','209jnouVT','ERROR','\x0aSetup\x20cancelled','tdx:\x20auth\x20clear','No\x20API\x20key\x20found\x20in\x20keychain','\x20(profile:\x20','select','yellow','status','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','apiKey'];a7_0x4f54=function(){return _0x1c2061;};return a7_0x4f54();}import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x1418b1 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_0x1bf0b from'chalk';export class AuthSetupCommand extends BaseCommand{['name']=a7_0x14d0db(0x1f3);[a7_0x14d0db(0x1dd)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x14d0db(0x1d6)](_0x3580bb){const _0x580863=a7_0x14d0db,{options:_0x52a63c}=_0x3580bb,_0x592625=_0x52a63c[_0x580863(0x206)];console[_0x580863(0x20f)](a7_0x1bf0b[_0x580863(0x1fe)](_0x580863(0x1e0)));const _0x458039=_0x52a63c['site']||_0x580863(0x21a),{choices:_0xfe2b57,initialIndex:_0x3d8741}=buildSiteChoices(_0x458039),_0x34a5ca=_0x592625?_0x580863(0x212)+_0x592625+'):':_0x580863(0x1ff),_0x4037e2=await a7_0x1418b1({'type':_0x580863(0x1ec),'name':'site','message':_0x34a5ca,'choices':_0xfe2b57,'initial':_0x3d8741});if(!_0x4037e2[_0x580863(0x1d9)])return console['log']('\x0aSetup\x20cancelled'),0x1;let _0x313241;if(_0x4037e2[_0x580863(0x1d9)]===_0x580863(0x1dc)){const _0x15f2d6=await a7_0x1418b1({'type':'text','name':_0x580863(0x20d),'message':_0x580863(0x1cf),'initial':_0x580863(0x21a),'validate':_0x5ac87f=>{const _0xfd3a8d=_0x580863;if(!_0x5ac87f||!_0x5ac87f[_0xfd3a8d(0x1f7)]())return _0xfd3a8d(0x1e5);if(!/^[a-z0-9-]+$/[_0xfd3a8d(0x214)](_0x5ac87f[_0xfd3a8d(0x1f7)]()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x15f2d6[_0x580863(0x20d)])return console['log'](_0x580863(0x1e8)),0x1;_0x313241=_0x15f2d6[_0x580863(0x20d)];}else _0x313241=_0x4037e2[_0x580863(0x1d9)];const _0x212281=resolveSite(_0x313241);console[_0x580863(0x20f)](_0x580863(0x1d8)+_0x212281),console[_0x580863(0x20f)](_0x580863(0x215)),console[_0x580863(0x20f)]('\x20\x20'+getConsoleUrl(_0x212281,'/app/mp/ak'));const _0x47bee4=await a7_0x1418b1({'type':_0x580863(0x1f1),'name':_0x580863(0x1f0),'message':_0x580863(0x1f9),'validate':_0x324273=>{const _0x15672c=_0x580863;if(!_0x324273||!_0x324273[_0x15672c(0x1f7)]())return _0x15672c(0x1fc);return!![];}});if(!_0x47bee4['apiKey'])return console['log'](_0x580863(0x1e8)),0x1;const _0x18a622=_0x47bee4[_0x580863(0x1f0)];console[_0x580863(0x20f)](_0x580863(0x201));try{const _0x1efcfd=TDX[_0x580863(0x1d4)]({'site':_0x212281,'apiKey':_0x18a622[_0x580863(0x1f7)](),'logLevel':_0x52a63c['logLevel']??LogLevel[_0x580863(0x1e7)]}),_0x3dc04e=await _0x1efcfd[_0x580863(0x207)][_0x580863(0x216)]();console[_0x580863(0x20f)](_0x580863(0x205)+_0x3dc04e['email']+')');const _0x16d2f3=await isKeychainAvailable();_0x16d2f3?(await saveAPIKeyAsync(_0x18a622[_0x580863(0x1f7)](),_0x212281,_0x592625),console['log'](_0x580863(0x1ef)+(_0x592625?_0x580863(0x1eb)+_0x592625+')':''))):(console[_0x580863(0x1ce)](a7_0x1bf0b[_0x580863(0x1ed)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x580863(0x1ce)](a7_0x1bf0b[_0x580863(0x1ed)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x592625){const _0x23c1b4={'site':_0x212281};saveProfileToUserConfig(_0x592625,_0x23c1b4),console[_0x580863(0x20f)](_0x580863(0x20e)+_0x592625+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x212281),console['log'](_0x580863(0x1d7)+_0x212281);const _0xcbac2b=_0x592625?_0x580863(0x1cd)+_0x592625:'';return console['log'](),console[_0x580863(0x20f)](_0x580863(0x213)),console[_0x580863(0x20f)](_0x580863(0x211)+_0xcbac2b+_0x580863(0x1e3)),console[_0x580863(0x20f)](_0x580863(0x211)+_0xcbac2b+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x43d618){if(_0x43d618 instanceof HTTPClientError&&_0x43d618[_0x580863(0x1ee)]===0x191)return printAuthError(_0x43d618),0x1;return console[_0x580863(0x1cc)](a7_0x1bf0b[_0x580863(0x20c)](_0x580863(0x204)+(_0x43d618 instanceof Error?_0x43d618[_0x580863(0x1d2)]:String(_0x43d618)))),console['error'](_0x580863(0x218)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x14d0db(0x1fb)]='auth';[a7_0x14d0db(0x1dd)]=a7_0x14d0db(0x1f6);async[a7_0x14d0db(0x1d6)](_0x35db32){const _0x1dad62=a7_0x14d0db,{options:_0x194e2e,tdx:_0x5efadd}=_0x35db32,_0x4d1ef8=_0x194e2e['site'],_0x34f009=_0x194e2e['profile'],_0x2ee092=_0x34f009?_0x34f009:_0x1dad62(0x1ca);console[_0x1dad62(0x20f)](_0x1dad62(0x1f8)+_0x2ee092+_0x1dad62(0x1fa)+_0x4d1ef8+')');const _0x41a687=await resolveAPIKeyAsync(_0x4d1ef8,_0x34f009);if(_0x41a687){const {source:_0x115f1f,isDeprecated:_0x1166a5}=_0x41a687,_0x3abbba=_0x1dad62(0x203)+_0x115f1f;console['log'](_0x1166a5?a7_0x1bf0b[_0x1dad62(0x1ed)](_0x3abbba):_0x3abbba);}else console[_0x1dad62(0x20f)](a7_0x1bf0b['yellow'](_0x1dad62(0x1da)));try{const _0x260d76=await _0x5efadd[_0x1dad62(0x207)][_0x1dad62(0x216)]();return console['log'](a7_0x1bf0b['green'](_0x1dad62(0x202))),console[_0x1dad62(0x20f)](_0x1dad62(0x1d1)+_0x260d76[_0x1dad62(0x1e2)]),(_0x260d76['first_name']||_0x260d76[_0x1dad62(0x1f4)])&&console['log'](_0x1dad62(0x1f5)+[_0x260d76[_0x1dad62(0x1de)],_0x260d76[_0x1dad62(0x1f4)]][_0x1dad62(0x200)](Boolean)[_0x1dad62(0x20a)]('\x20')),0x0;}catch(_0x53541f){return _0x53541f instanceof HTTPClientError&&_0x53541f[_0x1dad62(0x1ee)]===0x191?printAuthError(_0x53541f,!![],_0x34f009):console[_0x1dad62(0x1cc)](a7_0x1bf0b[_0x1dad62(0x20c)]('✗\x20Validation\x20failed:\x20'+(_0x53541f instanceof Error?_0x53541f['message']:String(_0x53541f)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x14d0db(0x1fb)]=a7_0x14d0db(0x1e4);[a7_0x14d0db(0x1dd)]=a7_0x14d0db(0x20b);async[a7_0x14d0db(0x1d6)](_0x125669){const _0x290340=a7_0x14d0db,{options:_0x4bdf98}=_0x125669,_0x8b7bea=_0x4bdf98['profile'];console['log'](a7_0x1bf0b[_0x290340(0x1fe)](_0x290340(0x1e9)));const _0x4ce88f=await isKeychainAvailable();if(!_0x4ce88f)return console[_0x290340(0x1cc)](a7_0x1bf0b[_0x290340(0x20c)](_0x290340(0x1e1))),0x1;const _0x17cd01=await deleteKeychainAPIKey(_0x8b7bea);return _0x17cd01?(clearCredentialCache(),console[_0x290340(0x20f)](_0x290340(0x1fd)+(_0x8b7bea?_0x290340(0x1eb)+_0x8b7bea+')':'')),0x0):(console['log'](_0x290340(0x1ea)+(_0x8b7bea?_0x290340(0x1db)+_0x8b7bea:'')),0x1);}}
1
+ const a7_0x88300e=a7_0x1b3b;(function(_0x577a2a,_0xbc47d6){const _0x464244=a7_0x1b3b,_0x5f43d2=_0x577a2a();while(!![]){try{const _0x348538=parseInt(_0x464244(0xd6))/0x1*(-parseInt(_0x464244(0xd9))/0x2)+-parseInt(_0x464244(0xca))/0x3+parseInt(_0x464244(0xd8))/0x4+parseInt(_0x464244(0xf4))/0x5+-parseInt(_0x464244(0x111))/0x6+-parseInt(_0x464244(0x10d))/0x7*(-parseInt(_0x464244(0xcb))/0x8)+parseInt(_0x464244(0xce))/0x9*(parseInt(_0x464244(0xf0))/0xa);if(_0x348538===_0xbc47d6)break;else _0x5f43d2['push'](_0x5f43d2['shift']());}catch(_0x3e842d){_0x5f43d2['push'](_0x5f43d2['shift']());}}}(a7_0x1be0,0x721f6));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x29b2c4 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_0x12e1e6 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x88300e(0xcf)]=a7_0x88300e(0x106);[a7_0x88300e(0xdd)]=a7_0x88300e(0x108);async[a7_0x88300e(0x109)](_0x1e11db){const _0x557aa0=a7_0x88300e,{options:_0x350d6f}=_0x1e11db,_0xa0315d=_0x350d6f['profile'];console[_0x557aa0(0xdf)](a7_0x12e1e6[_0x557aa0(0x10c)](_0x557aa0(0xda)));const _0x36f3b0=_0x350d6f[_0x557aa0(0xe8)]||_0x557aa0(0xf5),{choices:_0x5a6e49,initialIndex:_0x2335ab}=buildSiteChoices(_0x36f3b0),_0x3b9318=_0xa0315d?_0x557aa0(0xf3)+_0xa0315d+'):':_0x557aa0(0xeb),_0x129c35=await a7_0x29b2c4({'type':_0x557aa0(0xf6),'name':_0x557aa0(0xe8),'message':_0x3b9318,'choices':_0x5a6e49,'initial':_0x2335ab});if(!_0x129c35[_0x557aa0(0xe8)])return console[_0x557aa0(0xdf)](_0x557aa0(0xd4)),0x1;let _0x3162b7;if(_0x129c35[_0x557aa0(0xe8)]===_0x557aa0(0xfc)){const _0x589f05=await a7_0x29b2c4({'type':_0x557aa0(0x100),'name':_0x557aa0(0xc7),'message':_0x557aa0(0xde),'initial':_0x557aa0(0xf5),'validate':_0x164705=>{const _0xbcc646=_0x557aa0;if(!_0x164705||!_0x164705['trim']())return _0xbcc646(0xe0);if(!/^[a-z0-9-]+$/['test'](_0x164705[_0xbcc646(0xcc)]()))return _0xbcc646(0xed);return!![];}});if(!_0x589f05[_0x557aa0(0xc7)])return console[_0x557aa0(0xdf)]('\x0aSetup\x20cancelled'),0x1;_0x3162b7=_0x589f05[_0x557aa0(0xc7)];}else _0x3162b7=_0x129c35[_0x557aa0(0xe8)];const _0x2d821e=resolveSite(_0x3162b7);console['log']('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x2d821e),console[_0x557aa0(0xdf)](_0x557aa0(0xe4)),console[_0x557aa0(0xdf)]('\x20\x20'+getConsoleUrl(_0x2d821e,_0x557aa0(0xe1)));const _0x37293e=await a7_0x29b2c4({'type':_0x557aa0(0x114),'name':_0x557aa0(0xef),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x2f81d4=>{const _0x18be27=_0x557aa0;if(!_0x2f81d4||!_0x2f81d4[_0x18be27(0xcc)]())return _0x18be27(0x10a);return!![];}});if(!_0x37293e['apiKey'])return console[_0x557aa0(0xdf)](_0x557aa0(0xd4)),0x1;const _0x4c08f1=_0x37293e['apiKey'];console[_0x557aa0(0xdf)](_0x557aa0(0xe3));try{const _0x4c6713=TDX[_0x557aa0(0xe6)]({'site':_0x2d821e,'apiKey':_0x4c08f1[_0x557aa0(0xcc)](),'logLevel':_0x350d6f[_0x557aa0(0xea)]??LogLevel[_0x557aa0(0xfa)]}),_0x199077=await _0x4c6713[_0x557aa0(0xc8)]['getUserInfo']();console[_0x557aa0(0xdf)](_0x557aa0(0x112)+_0x199077['email']+')');const _0x3840bc=await isKeychainAvailable();_0x3840bc?(await saveAPIKeyAsync(_0x4c08f1[_0x557aa0(0xcc)](),_0x2d821e,_0xa0315d),console[_0x557aa0(0xdf)](_0x557aa0(0xd7)+(_0xa0315d?_0x557aa0(0x10b)+_0xa0315d+')':''))):(console[_0x557aa0(0x104)](a7_0x12e1e6[_0x557aa0(0xee)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console['warn'](a7_0x12e1e6[_0x557aa0(0xee)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0xa0315d){const _0x1193e3={'site':_0x2d821e};saveProfileToUserConfig(_0xa0315d,_0x1193e3),console['log']('✓\x20Profile\x20\x27'+_0xa0315d+_0x557aa0(0x113));}else saveDefaultSiteToUserConfig(_0x2d821e),console['log'](_0x557aa0(0xdb)+_0x2d821e);const _0x476cdc=_0xa0315d?'\x20--profile\x20'+_0xa0315d:'';return console['log'](),console['log'](_0x557aa0(0xd2)),console[_0x557aa0(0xdf)](_0x557aa0(0xe2)+_0x476cdc+_0x557aa0(0xf9)),console[_0x557aa0(0xdf)](_0x557aa0(0xe2)+_0x476cdc+_0x557aa0(0x107)),0x0;}catch(_0x184bed){if(_0x184bed instanceof HTTPClientError&&_0x184bed[_0x557aa0(0xfe)]===0x191)return printAuthError(_0x184bed),0x1;return console[_0x557aa0(0xe9)](a7_0x12e1e6[_0x557aa0(0x110)](_0x557aa0(0xd3)+(_0x184bed instanceof Error?_0x184bed[_0x557aa0(0x103)]:String(_0x184bed)))),console[_0x557aa0(0xe9)](_0x557aa0(0xff)),0x1;}}}function a7_0x1b3b(_0x3b52de,_0x31e05f){_0x3b52de=_0x3b52de-0xc6;const _0x1be023=a7_0x1be0();let _0x1b3b8c=_0x1be023[_0x3b52de];return _0x1b3b8c;}function a7_0x1be0(){const _0x50bd89=['status','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','text','profile','join','message','warn','getUserInfo','auth:setup','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Setup\x20API\x20key\x20authentication\x20interactively','execute','API\x20key\x20cannot\x20be\x20empty','\x20(profile:\x20','bold','7ylwhqt','green','N/A','red','3896322ulaqTU','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','\x27\x20registered','password','first_name','customSite','jobs','last_name','173310yFWYRk','4291096upkKYo','trim','\x20for\x20profile:\x20','509139xoBcGL','name','Name:\x20','User:\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','✗\x20Validation\x20failed:\x20','\x0aSetup\x20cancelled','\x20(site:\x20','168AYpnms','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','2051020dVBnzI','6778AzciQm','tdx:\x20auth\x20setup','✓\x20Default\x20site\x20set\x20to\x20','auth','description','Enter\x20site\x20name:','log','Site\x20name\x20cannot\x20be\x20empty','/app/mp/ak','\x20\x20tdx','Validating\x20API\x20key...','You\x20can\x20find\x20your\x20API\x20key\x20at:','tdx:\x20auth\x20clear','create','email','site','error','logLevel','Select\x20your\x20Treasure\x20Data\x20site:','auth:clear','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','yellow','apiKey','30eibIMp','Remove\x20API\x20key\x20from\x20system\x20keychain','System\x20keychain\x20is\x20not\x20available','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','2625500lQKXMA','us01','select','No\x20credential\x20found','No\x20API\x20key\x20found\x20in\x20keychain','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','ERROR','Read\x20credential\x20from\x20','other','✓\x20API\x20key\x20removed\x20from\x20keychain'];a7_0x1be0=function(){return _0x50bd89;};return a7_0x1be0();}export class AuthStatusCommand extends BaseCommand{[a7_0x88300e(0xcf)]=a7_0x88300e(0xdc);[a7_0x88300e(0xdd)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x88300e(0x109)](_0x1e1208){const _0x1588cb=a7_0x88300e,{options:_0x5d1957,tdx:_0x16029d}=_0x1e1208,_0x1de46e=_0x5d1957[_0x1588cb(0xe8)],_0x31e13f=_0x5d1957[_0x1588cb(0x101)],_0x29bc35=_0x31e13f?_0x31e13f:_0x1588cb(0x10f);console[_0x1588cb(0xdf)]('tdx\x20profile:\x20'+_0x29bc35+_0x1588cb(0xd5)+_0x1de46e+')');const _0x2eacb7=await resolveAPIKeyAsync(_0x1de46e,_0x31e13f);if(_0x2eacb7){const {source:_0x3a4bb4,isDeprecated:_0x1dd7f3}=_0x2eacb7,_0x13b5d7=_0x1588cb(0xfb)+_0x3a4bb4;console[_0x1588cb(0xdf)](_0x1dd7f3?a7_0x12e1e6[_0x1588cb(0xee)](_0x13b5d7):_0x13b5d7);}else console[_0x1588cb(0xdf)](a7_0x12e1e6['yellow'](_0x1588cb(0xf7)));try{const _0x59e380=await _0x16029d[_0x1588cb(0xc8)][_0x1588cb(0x105)]();return console[_0x1588cb(0xdf)](a7_0x12e1e6[_0x1588cb(0x10e)]('✓\x20Authentication\x20successful\x0a')),console[_0x1588cb(0xdf)](_0x1588cb(0xd1)+_0x59e380[_0x1588cb(0xe7)]),(_0x59e380[_0x1588cb(0xc6)]||_0x59e380[_0x1588cb(0xc9)])&&console['log'](_0x1588cb(0xd0)+[_0x59e380[_0x1588cb(0xc6)],_0x59e380[_0x1588cb(0xc9)]]['filter'](Boolean)[_0x1588cb(0x102)]('\x20')),0x0;}catch(_0x5e9190){return _0x5e9190 instanceof HTTPClientError&&_0x5e9190[_0x1588cb(0xfe)]===0x191?printAuthError(_0x5e9190,!![],_0x31e13f):console[_0x1588cb(0xe9)](a7_0x12e1e6['red']('✗\x20Validation\x20failed:\x20'+(_0x5e9190 instanceof Error?_0x5e9190[_0x1588cb(0x103)]:String(_0x5e9190)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x88300e(0xec);['description']=a7_0x88300e(0xf1);async[a7_0x88300e(0x109)](_0x76fd8c){const _0x55a5da=a7_0x88300e,{options:_0x4f556f}=_0x76fd8c,_0x29a563=_0x4f556f[_0x55a5da(0x101)];console['log'](a7_0x12e1e6['bold'](_0x55a5da(0xe5)));const _0x1211aa=await isKeychainAvailable();if(!_0x1211aa)return console[_0x55a5da(0xe9)](a7_0x12e1e6[_0x55a5da(0x110)](_0x55a5da(0xf2))),0x1;const _0x30b7b4=await deleteKeychainAPIKey(_0x29a563);return _0x30b7b4?(clearCredentialCache(),console[_0x55a5da(0xdf)](_0x55a5da(0xfd)+(_0x29a563?'\x20(profile:\x20'+_0x29a563+')':'')),0x0):(console[_0x55a5da(0xdf)](_0x55a5da(0xf8)+(_0x29a563?_0x55a5da(0xcd)+_0x29a563:'')),0x1);}}
@@ -1 +1 @@
1
- const a8_0x1bbb32=a8_0x30ac;(function(_0x451960,_0x2d9efe){const _0xf1d81=a8_0x30ac,_0x596a3b=_0x451960();while(!![]){try{const _0x41b89e=parseInt(_0xf1d81(0xd3))/0x1+-parseInt(_0xf1d81(0xda))/0x2*(parseInt(_0xf1d81(0xc2))/0x3)+-parseInt(_0xf1d81(0xca))/0x4+parseInt(_0xf1d81(0xcf))/0x5*(parseInt(_0xf1d81(0xe7))/0x6)+-parseInt(_0xf1d81(0xdf))/0x7+-parseInt(_0xf1d81(0xd4))/0x8+parseInt(_0xf1d81(0xcb))/0x9;if(_0x41b89e===_0x2d9efe)break;else _0x596a3b['push'](_0x596a3b['shift']());}catch(_0x27ff60){_0x596a3b['push'](_0x596a3b['shift']());}}}(a8_0x133e,0x36e2f));function a8_0x133e(){const _0x2d4a9e=['getDefaultAgent','getOrCreateDefaultAgent','432246tKMrOc','stack','--agent\x20flag','resolveAgentId','includes','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','Resolving\x20project\x20\x27','Resolving\x20agent\x20\x27','200608wraCUr','4521492wnesbQ','Getting\x20default\x20agent...','args','resolveProjectId','5UodWHy','Using\x20agent\x20from\x20','getAgentId','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','377082zexNRc','1552688jSGrZI','Continuing\x20chat:\x20','claude-4.5-haiku','llm','content','handleChatEvent','4qBcszl','data','message','llmAgent','Using\x20cached\x20default\x20agent:\x20','2409134DzBuXe','verbose','Error:\x20','code','chatId','streamChat','agent','\x27...','1331454WCIMVK','execute','join','\x20\x20Cause:\x20','CHAT_NOT_FOUND','chat','validate','404','error','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','cause','description','type'];a8_0x133e=function(){return _0x2d4a9e;};return a8_0x133e();}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';function a8_0x30ac(_0x16a0fd,_0x5cb761){_0x16a0fd=_0x16a0fd-0xbe;const _0x133e73=a8_0x133e();let _0x30ac85=_0x133e73[_0x16a0fd];return _0x30ac85;}import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function handleSDKError(_0x3347f2,_0x38028f){const _0x14199e=a8_0x30ac;if(_0x3347f2 instanceof SDKError)console[_0x14199e(0xef)](_0x14199e(0xe1)+_0x3347f2[_0x14199e(0xdc)]),_0x38028f[_0x14199e(0xe0)]&&(_0x3347f2[_0x14199e(0xf1)]&&console['error'](_0x14199e(0xea)+_0x3347f2['cause']),_0x3347f2[_0x14199e(0xc3)]&&(console[_0x14199e(0xef)]('\x0aStack\x20trace:'),console[_0x14199e(0xef)](_0x3347f2[_0x14199e(0xc3)])));else throw _0x3347f2;}export class ChatCommand extends BaseCommand{['name']='chat';[a8_0x1bbb32(0xbe)]=a8_0x1bbb32(0xd2);[a8_0x1bbb32(0xed)](_0x38176e){const _0x35e66e=a8_0x1bbb32,_0xec61ff=_0x38176e[_0x35e66e(0xcd)][_0x35e66e(0xe9)]('\x20');if(!_0xec61ff)return _0x35e66e(0xc7);return undefined;}async['streamChat'](_0x3151b6,_0x5a7726,_0x27e23d,_0x3b4b6b,_0x3580b4){const _0x59966d=a8_0x1bbb32;for await(const _0x3bda09 of _0x3151b6[_0x59966d(0xd7)][_0x59966d(0xec)](_0x5a7726,{'agentId':_0x27e23d,'chatId':_0x3b4b6b})){if(_0x3bda09[_0x59966d(0xbf)]==='metadata'){const _0x59de40=_0x3bda09[_0x59966d(0xdb)][_0x59966d(0xe3)];saveLastChatId(_0x59de40),_0x3580b4&&console['error']('Chat\x20session:\x20'+_0x59de40);}else _0x3bda09[_0x59966d(0xbf)]==='event'&&this[_0x59966d(0xd9)](_0x3bda09[_0x59966d(0xdb)]);}}async[a8_0x1bbb32(0xd1)](_0x3c007c,_0x290e74,_0xf71a02,_0x42306c,_0x37430b){const _0x108023=a8_0x1bbb32,_0x59c5d3=_0x290e74||_0xf71a02;if(_0x59c5d3){const {projectName:_0x58aefe,agentName:_0x439eda}=parseAgentRef(_0x59c5d3),_0x4e3f00=_0x439eda||_0x59c5d3,_0xfd4fd8=_0x439eda?_0x58aefe:_0x42306c;if(!_0xfd4fd8)throw new Error(_0x108023(0xf0));if(_0x37430b){const _0x48b87c=_0x290e74?_0x108023(0xc4):'session\x20context';console[_0x108023(0xef)](_0x108023(0xd0)+_0x48b87c+':\x20'+_0xfd4fd8+'/'+_0x4e3f00);}const _0x11d6a9=await withSpinner(_0x108023(0xc8)+_0xfd4fd8+'\x27...',()=>_0x3c007c[_0x108023(0xd7)][_0x108023(0xce)](_0xfd4fd8),{'verbose':_0x37430b}),_0x19a56b=await withSpinner(_0x108023(0xc9)+_0x4e3f00+_0x108023(0xe6),()=>_0x3c007c[_0x108023(0xd7)][_0x108023(0xc5)](_0x4e3f00,_0x11d6a9[_0x108023(0xdb)]),{'verbose':_0x37430b});return _0x19a56b['data'];}else{const _0xa6ca9f=_0x3c007c['llm'][_0x108023(0xc0)]();if(_0xa6ca9f)return _0x37430b&&console[_0x108023(0xef)](_0x108023(0xde)+_0xa6ca9f['name']),_0xa6ca9f['id'];const _0x8d2dcd=await withSpinner(_0x108023(0xcc),()=>_0x3c007c['llm'][_0x108023(0xc1)](_0x108023(0xd6),0x0),{'verbose':_0x37430b});return _0x8d2dcd[_0x108023(0xdb)]['id'];}}async[a8_0x1bbb32(0xe8)](_0x53ae59){const _0x26776c=a8_0x1bbb32,{options:_0x2661d1,args:_0x525811,tdx:_0x3954ad}=_0x53ae59,_0x2e2326=_0x525811[_0x26776c(0xe9)]('\x20'),_0x2dcab6=_0x2661d1,_0x44e609=_0x2dcab6[_0x26776c(0xe5)],_0x2c92d6=_0x2dcab6[_0x26776c(0xdd)],_0x4e1bf7=_0x2dcab6['llmProject'],_0x2feed5=_0x2dcab6['new'];try{let _0x2504cb,_0x23d886;!_0x2feed5&&(_0x23d886=loadLastChatId(),_0x23d886&&_0x2661d1[_0x26776c(0xe0)]&&console[_0x26776c(0xef)](_0x26776c(0xd5)+_0x23d886));(_0x2feed5||!_0x23d886)&&(_0x2504cb=await this[_0x26776c(0xd1)](_0x3954ad,_0x44e609,_0x2c92d6,_0x4e1bf7,_0x2661d1[_0x26776c(0xe0)]));try{await this[_0x26776c(0xe4)](_0x3954ad,_0x2e2326,_0x2504cb,_0x23d886,_0x2661d1[_0x26776c(0xe0)]);}catch(_0x400cbb){const _0x3ceb16=_0x400cbb instanceof SDKError&&_0x400cbb[_0x26776c(0xe2)]===ErrorCode[_0x26776c(0xeb)]||_0x400cbb instanceof Error&&_0x400cbb[_0x26776c(0xdc)][_0x26776c(0xc6)](_0x26776c(0xee));if(_0x3ceb16)_0x2661d1[_0x26776c(0xe0)]&&console[_0x26776c(0xef)]('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0x2504cb&&(_0x2504cb=await this[_0x26776c(0xd1)](_0x3954ad,_0x44e609,_0x2c92d6,_0x4e1bf7,_0x2661d1['verbose'])),await this['streamChat'](_0x3954ad,_0x2e2326,_0x2504cb,undefined,_0x2661d1[_0x26776c(0xe0)]);else throw _0x400cbb;}return console['log'](),0x0;}catch(_0x2849d7){return console['error'](),handleSDKError(_0x2849d7,_0x2661d1),0x1;}}[a8_0x1bbb32(0xd9)](_0x544fdc){const _0x34a775=a8_0x1bbb32;if(_0x34a775(0xd8)in _0x544fdc)process['stdout']['write'](_0x544fdc[_0x34a775(0xd8)]);else'error'in _0x544fdc&&console['error']('\x0aError:\x20'+_0x544fdc[_0x34a775(0xef)]);}}
1
+ const a8_0x2da9b5=a8_0x42ef;function a8_0x42ef(_0x46985d,_0x2214cc){_0x46985d=_0x46985d-0x17b;const _0x1046f8=a8_0x1046();let _0x42ef33=_0x1046f8[_0x46985d];return _0x42ef33;}(function(_0x2317e6,_0x32f274){const _0x4f2d4f=a8_0x42ef,_0x2f2aaa=_0x2317e6();while(!![]){try{const _0x18c9f4=parseInt(_0x4f2d4f(0x184))/0x1*(-parseInt(_0x4f2d4f(0x17b))/0x2)+-parseInt(_0x4f2d4f(0x1ae))/0x3+-parseInt(_0x4f2d4f(0x182))/0x4+-parseInt(_0x4f2d4f(0x1b1))/0x5+parseInt(_0x4f2d4f(0x18c))/0x6+-parseInt(_0x4f2d4f(0x17d))/0x7*(parseInt(_0x4f2d4f(0x17f))/0x8)+parseInt(_0x4f2d4f(0x17c))/0x9;if(_0x18c9f4===_0x32f274)break;else _0x2f2aaa['push'](_0x2f2aaa['shift']());}catch(_0x441de8){_0x2f2aaa['push'](_0x2f2aaa['shift']());}}}(a8_0x1046,0x84f5a));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function a8_0x1046(){const _0x50aad0=['cause','agent','new','join','name','includes','2958474YiDtJC','metadata','llm','2508615GNwLhK','stdout','CHAT_NOT_FOUND','828382TRbLmM','28334403yaWKHd','7RdXiTW','session\x20context','3639992uJSCPB','llmProject','content','1989704VzqYVn','message','2dmSzCE','streamChat','execute','chatId','log','args','stack','claude-4.5-haiku','3990138hqCrQc','--agent\x20flag','Continuing\x20chat:\x20','event','getAgentId','data','resolveAgentId','type','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','write','chat','resolveProjectId','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','verbose','Resolving\x20agent\x20\x27','\x0aStack\x20trace:','getOrCreateDefaultAgent','\x27...','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','error','llmAgent','Using\x20agent\x20from\x20','handleChatEvent','validate','getDefaultAgent','Using\x20cached\x20default\x20agent:\x20','Error:\x20','Resolving\x20project\x20\x27'];a8_0x1046=function(){return _0x50aad0;};return a8_0x1046();}function handleSDKError(_0x146fd6,_0x4c5bbd){const _0x2b08c1=a8_0x42ef;if(_0x146fd6 instanceof SDKError)console[_0x2b08c1(0x19f)](_0x2b08c1(0x1a6)+_0x146fd6['message']),_0x4c5bbd[_0x2b08c1(0x199)]&&(_0x146fd6['cause']&&console[_0x2b08c1(0x19f)]('\x20\x20Cause:\x20'+_0x146fd6[_0x2b08c1(0x1a8)]),_0x146fd6[_0x2b08c1(0x18a)]&&(console[_0x2b08c1(0x19f)](_0x2b08c1(0x19b)),console[_0x2b08c1(0x19f)](_0x146fd6[_0x2b08c1(0x18a)])));else throw _0x146fd6;}export class ChatCommand extends BaseCommand{[a8_0x2da9b5(0x1ac)]=a8_0x2da9b5(0x196);['description']=a8_0x2da9b5(0x194);[a8_0x2da9b5(0x1a3)](_0x596a6a){const _0x26afe=a8_0x2da9b5,_0xe453c0=_0x596a6a[_0x26afe(0x189)][_0x26afe(0x1ab)]('\x20');if(!_0xe453c0)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async['streamChat'](_0x1563eb,_0x10c442,_0x38324e,_0x2584a7,_0x42a82f){const _0xb7f965=a8_0x2da9b5;for await(const _0x4d15a5 of _0x1563eb[_0xb7f965(0x1b0)]['chat'](_0x10c442,{'agentId':_0x38324e,'chatId':_0x2584a7})){if(_0x4d15a5[_0xb7f965(0x193)]===_0xb7f965(0x1af)){const _0x134002=_0x4d15a5[_0xb7f965(0x191)][_0xb7f965(0x187)];saveLastChatId(_0x134002),_0x42a82f&&console['error']('Chat\x20session:\x20'+_0x134002);}else _0x4d15a5[_0xb7f965(0x193)]===_0xb7f965(0x18f)&&this[_0xb7f965(0x1a2)](_0x4d15a5['data']);}}async[a8_0x2da9b5(0x190)](_0x9a5e17,_0x194920,_0xe65752,_0x5792b2,_0x46fce2){const _0x457a0d=a8_0x2da9b5,_0x3b28ad=_0x194920||_0xe65752;if(_0x3b28ad){const {projectName:_0x56b5b7,agentName:_0x5a2fbc}=parseAgentRef(_0x3b28ad),_0x5ceb1c=_0x5a2fbc||_0x3b28ad,_0x27c9d6=_0x5a2fbc?_0x56b5b7:_0x5792b2;if(!_0x27c9d6)throw new Error(_0x457a0d(0x19e));if(_0x46fce2){const _0x375baf=_0x194920?_0x457a0d(0x18d):_0x457a0d(0x17e);console[_0x457a0d(0x19f)](_0x457a0d(0x1a1)+_0x375baf+':\x20'+_0x27c9d6+'/'+_0x5ceb1c);}const _0x2a22ed=await withSpinner(_0x457a0d(0x1a7)+_0x27c9d6+_0x457a0d(0x19d),()=>_0x9a5e17[_0x457a0d(0x1b0)][_0x457a0d(0x197)](_0x27c9d6),{'verbose':_0x46fce2}),_0x49c26d=await withSpinner(_0x457a0d(0x19a)+_0x5ceb1c+'\x27...',()=>_0x9a5e17[_0x457a0d(0x1b0)][_0x457a0d(0x192)](_0x5ceb1c,_0x2a22ed[_0x457a0d(0x191)]),{'verbose':_0x46fce2});return _0x49c26d[_0x457a0d(0x191)];}else{const _0x36e513=_0x9a5e17[_0x457a0d(0x1b0)][_0x457a0d(0x1a4)]();if(_0x36e513)return _0x46fce2&&console[_0x457a0d(0x19f)](_0x457a0d(0x1a5)+_0x36e513[_0x457a0d(0x1ac)]),_0x36e513['id'];const _0x17fa08=await withSpinner('Getting\x20default\x20agent...',()=>_0x9a5e17[_0x457a0d(0x1b0)][_0x457a0d(0x19c)](_0x457a0d(0x18b),0x0),{'verbose':_0x46fce2});return _0x17fa08[_0x457a0d(0x191)]['id'];}}async[a8_0x2da9b5(0x186)](_0x35d399){const _0x50c43a=a8_0x2da9b5,{options:_0x503dfc,args:_0x6a317a,tdx:_0x3398ed}=_0x35d399,_0x51acaf=_0x6a317a[_0x50c43a(0x1ab)]('\x20'),_0x216ad4=_0x503dfc,_0xbf982c=_0x216ad4[_0x50c43a(0x1a9)],_0x2a3b13=_0x216ad4[_0x50c43a(0x1a0)],_0x20254d=_0x216ad4[_0x50c43a(0x180)],_0x54f00d=_0x216ad4[_0x50c43a(0x1aa)];try{let _0x2d2dee,_0x5cba0d;!_0x54f00d&&(_0x5cba0d=loadLastChatId(),_0x5cba0d&&_0x503dfc['verbose']&&console[_0x50c43a(0x19f)](_0x50c43a(0x18e)+_0x5cba0d));(_0x54f00d||!_0x5cba0d)&&(_0x2d2dee=await this[_0x50c43a(0x190)](_0x3398ed,_0xbf982c,_0x2a3b13,_0x20254d,_0x503dfc[_0x50c43a(0x199)]));try{await this[_0x50c43a(0x185)](_0x3398ed,_0x51acaf,_0x2d2dee,_0x5cba0d,_0x503dfc[_0x50c43a(0x199)]);}catch(_0x198bdc){const _0x521655=_0x198bdc instanceof SDKError&&_0x198bdc['code']===ErrorCode[_0x50c43a(0x1b3)]||_0x198bdc instanceof Error&&_0x198bdc[_0x50c43a(0x183)][_0x50c43a(0x1ad)]('404');if(_0x521655)_0x503dfc['verbose']&&console[_0x50c43a(0x19f)](_0x50c43a(0x198)),!_0x2d2dee&&(_0x2d2dee=await this[_0x50c43a(0x190)](_0x3398ed,_0xbf982c,_0x2a3b13,_0x20254d,_0x503dfc[_0x50c43a(0x199)])),await this['streamChat'](_0x3398ed,_0x51acaf,_0x2d2dee,undefined,_0x503dfc[_0x50c43a(0x199)]);else throw _0x198bdc;}return console[_0x50c43a(0x188)](),0x0;}catch(_0xeec73){return console[_0x50c43a(0x19f)](),handleSDKError(_0xeec73,_0x503dfc),0x1;}}['handleChatEvent'](_0x3972e4){const _0x332a9f=a8_0x2da9b5;if(_0x332a9f(0x181)in _0x3972e4)process[_0x332a9f(0x1b2)][_0x332a9f(0x195)](_0x3972e4[_0x332a9f(0x181)]);else _0x332a9f(0x19f)in _0x3972e4&&console[_0x332a9f(0x19f)]('\x0aError:\x20'+_0x3972e4[_0x332a9f(0x19f)]);}}