@treasuredata/tdx 0.23.1 → 0.24.0

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 (164) 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/mcp-command.js +1 -1
  24. package/dist/commands/parent-segment-command.js +1 -1
  25. package/dist/commands/profile-command.js +1 -1
  26. package/dist/commands/profiles-command.js +1 -1
  27. package/dist/commands/query-command.js +1 -1
  28. package/dist/commands/schedule-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/status-command.js +1 -1
  40. package/dist/commands/tables.js +1 -1
  41. package/dist/commands/unset-command.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/core/version.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/mcp/server.js +1 -1
  60. package/dist/mcp/tools/index.js +1 -1
  61. package/dist/mcp/tools/tdx-run.js +1 -1
  62. package/dist/mcp/tools/tdx-search.js +1 -1
  63. package/dist/mcp/utils.js +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/passthrough-server.js +1 -1
  66. package/dist/proxy/sse-usage-parser.js +1 -1
  67. package/dist/sdk/agent/agent-config.js +1 -1
  68. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  69. package/dist/sdk/agent/agent-yaml.js +1 -1
  70. package/dist/sdk/agent/test/evaluator.js +1 -1
  71. package/dist/sdk/agent/test/executor.js +1 -1
  72. package/dist/sdk/agent/test/index.js +1 -1
  73. package/dist/sdk/agent/test/output.js +1 -1
  74. package/dist/sdk/agent/test/parser.js +1 -1
  75. package/dist/sdk/api.js +1 -1
  76. package/dist/sdk/client/cdp-api-client.js +1 -1
  77. package/dist/sdk/client/endpoints.js +1 -1
  78. package/dist/sdk/client/engage-api-client.js +1 -1
  79. package/dist/sdk/client/http-client.js +1 -1
  80. package/dist/sdk/client/llm-api-client.js +1 -1
  81. package/dist/sdk/client/rate-limiter.js +1 -1
  82. package/dist/sdk/client/td-api-client.js +1 -1
  83. package/dist/sdk/client/trino-api-client.js +1 -1
  84. package/dist/sdk/client/workflow-client.js +1 -1
  85. package/dist/sdk/connection-validator.js +1 -1
  86. package/dist/sdk/connection.js +1 -1
  87. package/dist/sdk/engage.js +1 -1
  88. package/dist/sdk/errors.js +1 -1
  89. package/dist/sdk/index.js +1 -1
  90. package/dist/sdk/io/index.js +1 -1
  91. package/dist/sdk/io/node-filesystem.js +1 -1
  92. package/dist/sdk/job.js +1 -1
  93. package/dist/sdk/journey.js +1 -1
  94. package/dist/sdk/llm/chat-cache.js +1 -1
  95. package/dist/sdk/llm/index.js +1 -1
  96. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  97. package/dist/sdk/llm/model-factors.js +1 -1
  98. package/dist/sdk/query/index.js +1 -1
  99. package/dist/sdk/query/sql-parser.js +1 -1
  100. package/dist/sdk/schedule.js +1 -1
  101. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  102. package/dist/sdk/segment/fields-display.js +1 -1
  103. package/dist/sdk/segment/file-discovery.js +1 -1
  104. package/dist/sdk/segment/journey-utils.js +1 -1
  105. package/dist/sdk/segment/journey-yaml.js +1 -1
  106. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  107. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  108. package/dist/sdk/segment/pull-workflow.js +1 -1
  109. package/dist/sdk/segment/push-workflow.js +1 -1
  110. package/dist/sdk/segment/resolution-context.js +1 -1
  111. package/dist/sdk/segment/segment-path-parser.js +1 -1
  112. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  113. package/dist/sdk/segment/target-resolution.js +1 -1
  114. package/dist/sdk/segment/tdx-config.js +1 -1
  115. package/dist/sdk/segment/validate-files.js +1 -1
  116. package/dist/sdk/segment/yaml-validator.js +1 -1
  117. package/dist/sdk/segment.js +1 -1
  118. package/dist/sdk/types/index.js +1 -1
  119. package/dist/sdk/types/progress.js +1 -1
  120. package/dist/sdk/user.js +1 -1
  121. package/dist/sdk/util/format-detector.js +1 -1
  122. package/dist/sdk/util/formatters.js +1 -1
  123. package/dist/sdk/util/index.js +1 -1
  124. package/dist/sdk/util/tree-formatter.js +1 -1
  125. package/dist/sdk/workflow/archive-validation.js +1 -1
  126. package/dist/sdk/workflow/clone-workflow.js +1 -1
  127. package/dist/sdk/workflow/index.js +1 -1
  128. package/dist/sdk/workflow/pull-workflow.js +1 -1
  129. package/dist/sdk/workflow/push-workflow.js +1 -1
  130. package/dist/sdk/workflow/tdx-config.js +1 -1
  131. package/dist/sdk/workflow/workflow-utils.js +1 -1
  132. package/dist/test-utils/command-runner.js +1 -1
  133. package/dist/test-utils/factories.js +1 -1
  134. package/dist/test-utils/fixtures.js +1 -1
  135. package/dist/test-utils/http-mock.js +1 -1
  136. package/dist/test-utils/index.js +1 -1
  137. package/dist/utils/async.js +1 -1
  138. package/dist/utils/colors.js +1 -1
  139. package/dist/utils/diff.js +1 -1
  140. package/dist/utils/file-permissions.js +1 -1
  141. package/dist/utils/global-cache.js +1 -1
  142. package/dist/utils/json-loader.js +1 -1
  143. package/dist/utils/local-cache.js +1 -1
  144. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  145. package/dist/utils/logger/formatters/index.js +1 -1
  146. package/dist/utils/logger/handlers/console-handler.js +1 -1
  147. package/dist/utils/logger/handlers/file-handler.js +1 -1
  148. package/dist/utils/logger/handlers/index.js +1 -1
  149. package/dist/utils/logger/handlers/null-handler.js +1 -1
  150. package/dist/utils/logger/index.js +1 -1
  151. package/dist/utils/logger/logger.js +1 -1
  152. package/dist/utils/logger/types.js +1 -1
  153. package/dist/utils/option-validation.js +1 -1
  154. package/dist/utils/port.js +1 -1
  155. package/dist/utils/process.js +1 -1
  156. package/dist/utils/process.js.map +1 -1
  157. package/dist/utils/prompt.js +1 -1
  158. package/dist/utils/spinner.js +1 -1
  159. package/dist/utils/sse-parser.js +1 -1
  160. package/dist/utils/string-utils.js +1 -1
  161. package/dist/utils/table-ref-parser.js +1 -1
  162. package/dist/utils/tdx-logger.js +1 -1
  163. package/dist/utils/version-check.js +1 -1
  164. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x1952b6=a3_0x5adb;(function(_0x169d63,_0xe25af1){const _0x1979e6=a3_0x5adb,_0x42b727=_0x169d63();while(!![]){try{const _0x26770f=parseInt(_0x1979e6(0x184))/0x1*(-parseInt(_0x1979e6(0x18c))/0x2)+parseInt(_0x1979e6(0x18a))/0x3*(-parseInt(_0x1979e6(0x175))/0x4)+-parseInt(_0x1979e6(0x189))/0x5*(parseInt(_0x1979e6(0x182))/0x6)+-parseInt(_0x1979e6(0x17c))/0x7*(-parseInt(_0x1979e6(0x187))/0x8)+parseInt(_0x1979e6(0x17d))/0x9*(-parseInt(_0x1979e6(0x18d))/0xa)+parseInt(_0x1979e6(0x16b))/0xb+parseInt(_0x1979e6(0x185))/0xc*(parseInt(_0x1979e6(0x179))/0xd);if(_0x26770f===_0xe25af1)break;else _0x42b727['push'](_0x42b727['shift']());}catch(_0xe43675){_0x42b727['push'](_0x42b727['shift']());}}}(a3_0xdfc9,0xd40bc));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a3_0x5adb(_0x864062,_0x1c2f57){_0x864062=_0x864062-0x16b;const _0xdfc955=a3_0xdfc9();let _0x5adb77=_0xdfc955[_0x864062];return _0x5adb77;}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_0x1952b6(0x17a);[a3_0x1952b6(0x180)]=a3_0x1952b6(0x174);async[a3_0x1952b6(0x16c)](_0x3ab4f5){const _0x2550b8=a3_0x1952b6,{options:_0x2aaae0,args:_0x3bbba1,tdx:_0x234ebe}=_0x3ab4f5;if(_0x3bbba1[_0x2550b8(0x188)]===0x0)return console['error']('Error:\x20Segment\x20name\x20is\x20required'),console[_0x2550b8(0x171)](_0x2550b8(0x16f)),0x1;try{const {parentId:_0x97b75a,childId:_0x57194f}=parseSegmentRef(_0x3bbba1[0x0]);if(!_0x57194f)return console[_0x2550b8(0x171)](_0x2550b8(0x181)),console[_0x2550b8(0x171)](_0x2550b8(0x16f)),0x1;_0x2aaae0[_0x2550b8(0x16e)]&&(console[_0x2550b8(0x171)](_0x2550b8(0x178)+_0x2aaae0[_0x2550b8(0x172)]),console[_0x2550b8(0x171)]('Parent\x20name:\x20'+_0x97b75a),console[_0x2550b8(0x171)](_0x2550b8(0x17e)+_0x57194f));const _0x2a0f32=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x97b75a+'\x27...',()=>_0x234ebe[_0x2550b8(0x173)][_0x2550b8(0x183)](_0x97b75a),{'verbose':_0x2aaae0[_0x2550b8(0x16e)]}),_0xed2636=_0x2a0f32[_0x2550b8(0x18b)];_0x2aaae0[_0x2550b8(0x16e)]&&console[_0x2550b8(0x171)](_0x2550b8(0x186)+_0xed2636);const _0x26d7de=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x57194f+'\x27...',()=>_0x234ebe[_0x2550b8(0x173)][_0x2550b8(0x177)](_0xed2636,_0x57194f),{'verbose':_0x2aaae0[_0x2550b8(0x16e)]}),_0x55de00=_0x26d7de['data'];_0x2aaae0[_0x2550b8(0x16e)]&&console[_0x2550b8(0x171)](_0x2550b8(0x170)+_0x55de00);const _0x432ea5=await withSpinner(_0x2550b8(0x176)+_0x57194f+'\x27...',()=>_0x234ebe[_0x2550b8(0x173)]['listActivations'](_0xed2636,_0x55de00),{'verbose':_0x2aaae0['verbose']}),_0x47047e=_0x432ea5[_0x2550b8(0x18b)];return console[_0x2550b8(0x171)]('✔\x20Found\x20'+_0x47047e[_0x2550b8(0x188)]+'\x20activation'+(_0x47047e[_0x2550b8(0x188)]!==0x1?'s':'')),await handleSDKOutput(_0x47047e,_0x2aaae0),0x0;}catch(_0x45ec8f){if(_0x45ec8f instanceof SDKError)return console[_0x2550b8(0x171)]('Error:\x20'+_0x45ec8f[_0x2550b8(0x16d)]),_0x45ec8f[_0x2550b8(0x17f)]&&console[_0x2550b8(0x171)](_0x2550b8(0x17b)+_0x45ec8f[_0x2550b8(0x17f)]),0x1;throw _0x45ec8f;}}}function a3_0xdfc9(){const _0x4b7ef6=['12ShiFNA','resolveParentId','31vYadra','17054472LrCaUr','Resolved\x20parent\x20ID:\x20','120hvWxxi','length','3463765cnnvNi','8334HfwWkO','data','53056IJUXkq','491130aXBXFI','10695784QypiFJ','execute','message','verbose','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Resolved\x20child\x20ID:\x20','error','site','segment','List\x20activations\x20for\x20a\x20segment','1148itINKI','Listing\x20activations\x20for\x20segment\x20\x27','resolveSegmentId','Site:\x20','26iDSqaX','activations','\x20\x20Cause:\x20','646331fSAxAK','243BlRgUT','Child\x20name:\x20','cause','description','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'];a3_0xdfc9=function(){return _0x4b7ef6;};return a3_0xdfc9();}
1
+ const a3_0x2cef9c=a3_0x48d0;(function(_0x33bb1c,_0x2483bd){const _0x2701c0=a3_0x48d0,_0x3409f6=_0x33bb1c();while(!![]){try{const _0x2a93d6=-parseInt(_0x2701c0(0xc3))/0x1*(parseInt(_0x2701c0(0xaf))/0x2)+parseInt(_0x2701c0(0xab))/0x3+parseInt(_0x2701c0(0xcb))/0x4+-parseInt(_0x2701c0(0xb5))/0x5+-parseInt(_0x2701c0(0xac))/0x6+-parseInt(_0x2701c0(0xaa))/0x7*(parseInt(_0x2701c0(0xb6))/0x8)+parseInt(_0x2701c0(0xb4))/0x9;if(_0x2a93d6===_0x2483bd)break;else _0x3409f6['push'](_0x3409f6['shift']());}catch(_0x2851e6){_0x3409f6['push'](_0x3409f6['shift']());}}}(a3_0x1a9b,0x48d83));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a3_0x48d0(_0x29876a,_0x380935){_0x29876a=_0x29876a-0xaa;const _0x1a9b02=a3_0x1a9b();let _0x48d0f8=_0x1a9b02[_0x29876a];return _0x48d0f8;}import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x2cef9c(0xb1)]='activations';[a3_0x2cef9c(0xb9)]=a3_0x2cef9c(0xc1);async[a3_0x2cef9c(0xc6)](_0x28050b){const _0x24561d=a3_0x2cef9c,{options:_0x4822f8,args:_0x4fe797,tdx:_0x52f197}=_0x28050b;if(_0x4fe797[_0x24561d(0xb0)]===0x0)return console[_0x24561d(0xc0)]('Error:\x20Segment\x20name\x20is\x20required'),console[_0x24561d(0xc0)](_0x24561d(0xb8)),0x1;try{const {parentId:_0x1b4122,childId:_0x24a914}=parseSegmentRef(_0x4fe797[0x0]);if(!_0x24a914)return console[_0x24561d(0xc0)](_0x24561d(0xc9)),console[_0x24561d(0xc0)](_0x24561d(0xb8)),0x1;_0x4822f8[_0x24561d(0xbf)]&&(console[_0x24561d(0xc0)](_0x24561d(0xbe)+_0x4822f8[_0x24561d(0xae)]),console[_0x24561d(0xc0)]('Parent\x20name:\x20'+_0x1b4122),console[_0x24561d(0xc0)](_0x24561d(0xc4)+_0x24a914));const _0x5c6490=await withSpinner(_0x24561d(0xb7)+_0x1b4122+_0x24561d(0xc7),()=>_0x52f197['segment'][_0x24561d(0xb2)](_0x1b4122),{'verbose':_0x4822f8[_0x24561d(0xbf)]}),_0x124ccf=_0x5c6490[_0x24561d(0xc2)];_0x4822f8['verbose']&&console[_0x24561d(0xc0)]('Resolved\x20parent\x20ID:\x20'+_0x124ccf);const _0x1ee0a4=await withSpinner(_0x24561d(0xbd)+_0x24a914+_0x24561d(0xc7),()=>_0x52f197[_0x24561d(0xca)][_0x24561d(0xcc)](_0x124ccf,_0x24a914),{'verbose':_0x4822f8[_0x24561d(0xbf)]}),_0xcf5ee9=_0x1ee0a4[_0x24561d(0xc2)];_0x4822f8[_0x24561d(0xbf)]&&console['error'](_0x24561d(0xc8)+_0xcf5ee9);const _0x446c20=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x24a914+_0x24561d(0xc7),()=>_0x52f197[_0x24561d(0xca)][_0x24561d(0xc5)](_0x124ccf,_0xcf5ee9),{'verbose':_0x4822f8[_0x24561d(0xbf)]}),_0xfd2000=_0x446c20[_0x24561d(0xc2)];return console[_0x24561d(0xc0)](_0x24561d(0xbc)+_0xfd2000[_0x24561d(0xb0)]+_0x24561d(0xb3)+(_0xfd2000[_0x24561d(0xb0)]!==0x1?'s':'')),await handleSDKOutput(_0xfd2000,_0x4822f8),0x0;}catch(_0x456ff1){if(_0x456ff1 instanceof SDKError)return console[_0x24561d(0xc0)]('Error:\x20'+_0x456ff1[_0x24561d(0xba)]),_0x456ff1[_0x24561d(0xbb)]&&console['error'](_0x24561d(0xad)+_0x456ff1[_0x24561d(0xbb)]),0x1;throw _0x456ff1;}}}function a3_0x1a9b(){const _0x1c49fe=['\x20\x20Cause:\x20','site','648486WuurXw','length','name','resolveParentId','\x20activation','12917421ThMiBC','2413620hGBtFx','344wXjgzc','Resolving\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','description','message','cause','✔\x20Found\x20','Resolving\x20child\x20segment\x20\x27','Site:\x20','verbose','error','List\x20activations\x20for\x20a\x20segment','data','1WggAOY','Child\x20name:\x20','listActivations','execute','\x27...','Resolved\x20child\x20ID:\x20','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','segment','1172036yEXMyL','resolveSegmentId','39263TQMlSD','199530CoWNSW','2689578jLwiOF'];a3_0x1a9b=function(){return _0x1c49fe;};return a3_0x1a9b();}
@@ -1 +1 @@
1
- const a4_0x1e86be=a4_0x3749;function a4_0x3749(_0x49dd69,_0x6e655d){_0x49dd69=_0x49dd69-0x1d8;const _0x970283=a4_0x9702();let _0x3749a6=_0x970283[_0x49dd69];return _0x3749a6;}(function(_0x40bc2f,_0x40469e){const _0x40ae59=a4_0x3749,_0x152afb=_0x40bc2f();while(!![]){try{const _0x85db6a=-parseInt(_0x40ae59(0x211))/0x1*(parseInt(_0x40ae59(0x22e))/0x2)+parseInt(_0x40ae59(0x227))/0x3*(-parseInt(_0x40ae59(0x257))/0x4)+-parseInt(_0x40ae59(0x26f))/0x5+parseInt(_0x40ae59(0x222))/0x6*(parseInt(_0x40ae59(0x1e4))/0x7)+parseInt(_0x40ae59(0x249))/0x8*(parseInt(_0x40ae59(0x266))/0x9)+-parseInt(_0x40ae59(0x207))/0xa*(parseInt(_0x40ae59(0x284))/0xb)+parseInt(_0x40ae59(0x25b))/0xc*(parseInt(_0x40ae59(0x220))/0xd);if(_0x85db6a===_0x40469e)break;else _0x152afb['push'](_0x152afb['shift']());}catch(_0x5c0e55){_0x152afb['push'](_0x152afb['shift']());}}}(a4_0x9702,0x88cc0));function a4_0x9702(){const _0x4d3d0d=['agents','320kpJckR','pullProject','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\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)','red','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Using\x20current\x20project:\x20','-\x20nothing\x20pushed','\x22:\x20','\x20--name\x20','4731EitCtl','\x0a✔\x20Pushed\x20','no_context','site','yes','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x0aPush\x20','\x20\x20tdx\x20agent\x20pull\x20','newProjectId','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20\x20Integrations:\x20','outputDir','Using\x20context\x20project:\x20','cloneProject','\x20\x20Source:\x20','156swbvRx','INVALID_ARGUMENT','22668GphENh','counts','\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','found','pullAgent','96378JjHTSj','dryRun','pushProject','message','Using\x20local\x20project:\x20','\x20created','integrations','202kAiFKM','\x20total','context','Failed\x20to\x20push\x20agent:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x0aChanges\x20to\x20prompt\x20\x27','\x22\x20to\x20new\x20project\x20\x22','execute','yellow','Writing\x20files...','\x27\x20to\x20create\x20the\x20folder\x20structure.','name','New\x20project\x20name\x20is\x20required','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Agent\x20\x22','Cloning\x20\x22','Project:\x20','no_local_folder','log','join','llm','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)','\x20files?','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','llm_project','\x20\x20Integration\x20\x22','textKnowledgeBases','4911648DubLkj','projectDir','Agent\x20pulled\x20successfully','green','output','Agent\x20','\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','Errors:','\x20files\x20to\x20','agent:push','\x22\x20to\x20a\x20different\x20profile','Would\x20push\x20agent:\x20','profile','unchanged','76GuNomi','Using\x20project:\x20','Pushing\x20agent\x20from\x20\x22','Output\x20path:\x20','2720988cZGyJN','prompts','\x0aChanges\x20to\x20integration\x20\x27','New\x20project\x20ID:\x20','\x22...','agentId','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20\x20Knowledge\x20Bases:\x20','Project\x20cloned\x20successfully','outputPath','Using\x20project\x20from\x20','9uoGnww','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20Prompt\x20\x22','New\x20project:\x20','\x20unchanged','projectName','\x20=\x20','\x20errors','✔\x20Context\x20set:\x20','3487195tYJRsY','Cancelled','Dry\x20run\x20-\x20no\x20changes\x20made','cyan','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','Would\x20pull\x20agent:\x20','push','\x20\x20Knowledge\x20Base\x20\x22','total','\x20updated','agentName','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','tdx.json','\x20changed','\x22\x20from\x20project\x20\x22','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x0a✔\x20Pulled\x20','reason','Agent:\x20','cwd','360734TrwQiv','diff','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','dirname','\x20resources\x20to\x20\x27','\x0aProject\x20pushed\x20with\x20errors','Clone\x20\x22','-\x20no\x20files\x20written','Chat:\x20','Pulling\x20agent\x20\x22','\x20successfully','created','\x20\x20tdx\x20agent\x20clone\x20agents/','description','session','Summary:','\x20resources?','llmProject','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','112hiCDuj','errors','\x0aChanges\x20to\x20agent\x20\x27','action','newProjectName','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','hasChanges','\x0aError:','repeat','dim','Status:\x20','isNew','\x20\x20Agents:\x20','force','new','\x20--profile\x20','source','agent:clone','gray','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','updated','\x0aChanges:','Output:\x20','No\x20tdx.json\x20found\x20in\x20','\x20new','\x20|\x20','projectId','parse','pushAgent','\x20\x20Prompts:\x20','error','sourceProjectName','\x0aWrite\x20','knowledgeBases'];a4_0x9702=function(){return _0x4d3d0d;};return a4_0x9702();}import a4_0x1e3c51 from'chalk';import a4_0x14c103 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(_0x38d4c7){const _0x4ecc15=a4_0x3749,_0x5e1919=[];if(_0x38d4c7[_0x4ecc15(0x277)]!==undefined)_0x5e1919[_0x4ecc15(0x275)](_0x38d4c7[_0x4ecc15(0x277)]+_0x4ecc15(0x22f));if(_0x38d4c7[_0x4ecc15(0x1f2)]!==undefined&&_0x38d4c7['new']>0x0)_0x5e1919[_0x4ecc15(0x275)](a4_0x1e3c51[_0x4ecc15(0x24c)](_0x38d4c7[_0x4ecc15(0x1f2)]+_0x4ecc15(0x1fc)));if(_0x38d4c7[_0x4ecc15(0x1dc)]!==undefined&&_0x38d4c7[_0x4ecc15(0x1dc)]>0x0)_0x5e1919[_0x4ecc15(0x275)](a4_0x1e3c51[_0x4ecc15(0x24c)](_0x38d4c7[_0x4ecc15(0x1dc)]+_0x4ecc15(0x22c)));if(_0x38d4c7[_0x4ecc15(0x1f8)]!==undefined&&_0x38d4c7['updated']>0x0)_0x5e1919[_0x4ecc15(0x275)](a4_0x1e3c51[_0x4ecc15(0x236)](_0x38d4c7['updated']+_0x4ecc15(0x278)));if(_0x38d4c7[_0x4ecc15(0x256)]!==undefined&&_0x38d4c7[_0x4ecc15(0x256)]>0x0)_0x5e1919[_0x4ecc15(0x275)](a4_0x1e3c51[_0x4ecc15(0x1f6)](_0x38d4c7[_0x4ecc15(0x256)]+'\x20unchanged'));if(_0x38d4c7['errors']!==undefined&&_0x38d4c7[_0x4ecc15(0x1e5)]>0x0)_0x5e1919['push'](a4_0x1e3c51[_0x4ecc15(0x20b)](_0x38d4c7[_0x4ecc15(0x1e5)]+_0x4ecc15(0x26d)));return _0x5e1919['join'](',\x20');}function displayDiffs(_0x5c1418,_0x36b7db,_0x1935ab,_0x5252d7,_0x24deef=[]){const _0x23c09b=a4_0x3749;for(const _0x242f75 of _0x5c1418){if(_0x242f75[_0x23c09b(0x285)]){const _0xda7545=_0x242f75['agentName']||_0x242f75[_0x23c09b(0x239)];console['log'](_0x23c09b(0x1e6)+_0xda7545+'\x27:'),console[_0x23c09b(0x240)]('─'[_0x23c09b(0x1ec)](0x3c)),console[_0x23c09b(0x240)](_0x242f75[_0x23c09b(0x285)]),console['log']('─'[_0x23c09b(0x1ec)](0x3c));}}for(const _0x3641dc of _0x36b7db){_0x3641dc[_0x23c09b(0x285)]&&(console['log'](_0x23c09b(0x232)+_0x3641dc[_0x23c09b(0x239)]+'\x27:'),console[_0x23c09b(0x240)]('─'[_0x23c09b(0x1ec)](0x3c)),console['log'](_0x3641dc[_0x23c09b(0x285)]),console[_0x23c09b(0x240)]('─'['repeat'](0x3c)));}for(const _0x1759ec of _0x1935ab){_0x1759ec[_0x23c09b(0x285)]&&(console[_0x23c09b(0x240)](_0x23c09b(0x209)+_0x1759ec[_0x23c09b(0x239)]+'\x27:'),console[_0x23c09b(0x240)]('─'[_0x23c09b(0x1ec)](0x3c)),console['log'](_0x1759ec[_0x23c09b(0x285)]),console[_0x23c09b(0x240)]('─'[_0x23c09b(0x1ec)](0x3c)));}for(const _0x3ef328 of _0x5252d7){_0x3ef328[_0x23c09b(0x285)]&&(console['log'](_0x23c09b(0x233)+_0x3ef328['name']+'\x27:'),console[_0x23c09b(0x240)]('─'[_0x23c09b(0x1ec)](0x3c)),console['log'](_0x3ef328[_0x23c09b(0x285)]),console[_0x23c09b(0x240)]('─'[_0x23c09b(0x1ec)](0x3c)));}for(const _0x287cb8 of _0x24deef){_0x287cb8['diff']&&(console['log'](_0x23c09b(0x25d)+_0x287cb8[_0x23c09b(0x239)]+'\x27:'),console[_0x23c09b(0x240)]('─'[_0x23c09b(0x1ec)](0x3c)),console[_0x23c09b(0x240)](_0x287cb8[_0x23c09b(0x285)]),console[_0x23c09b(0x240)]('─'[_0x23c09b(0x1ec)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x1e86be(0x239)]='agent:pull';[a4_0x1e86be(0x1de)]=a4_0x1e86be(0x21a);async[a4_0x1e86be(0x235)](_0x356b00){const _0x4e43c0=a4_0x1e86be,{options:_0x5cdf47,args:_0x580438,tdx:_0x34fc6b}=_0x356b00,_0x4a6958=_0x580438[0x0],_0x137607=_0x580438[0x1],_0x1ebe40=_0x5cdf47[_0x4e43c0(0x24d)],_0x323584=_0x5cdf47[_0x4e43c0(0x228)],_0xa58865=_0x5cdf47['force'],_0x517a2d=_0x5cdf47[_0x4e43c0(0x215)],_0x3615a5=_0x5cdf47[_0x4e43c0(0x1e2)];let _0x3567c0,_0xc5df0c;const _0x5204b7=findAgentConfigPath(process['cwd']());if(_0x4a6958){const _0x1c456c=a4_0x14c103[_0x4e43c0(0x241)](_0x4a6958,_0x4e43c0(0x27b));if(existsSync(_0x1c456c))try{const _0xe23ab1=JSON[_0x4e43c0(0x1ff)](readFileSync(_0x1c456c,'utf-8'));_0x3567c0=_0xe23ab1[_0x4e43c0(0x246)],_0xc5df0c=_0x4a6958,console[_0x4e43c0(0x240)](a4_0x1e3c51[_0x4e43c0(0x1ed)](_0x4e43c0(0x265)+_0x1c456c+':\x20'+_0x3567c0));}catch{_0x3567c0=_0x4a6958;}else _0x3567c0=_0x4a6958;}else{if(_0x5204b7)try{const _0x2ac947=JSON[_0x4e43c0(0x1ff)](readFileSync(_0x5204b7,'utf-8'));_0x3567c0=_0x2ac947[_0x4e43c0(0x246)],_0xc5df0c=a4_0x14c103[_0x4e43c0(0x287)](_0x5204b7),console[_0x4e43c0(0x240)](a4_0x1e3c51['dim'](_0x4e43c0(0x258)+_0x3567c0));}catch{_0x3567c0=_0x3615a5;}else _0x3567c0=_0x3615a5;}if(!_0x3567c0)return console[_0x4e43c0(0x240)](a4_0x1e3c51['yellow'](_0x4e43c0(0x20c))),console[_0x4e43c0(0x240)](_0x4e43c0(0x243)),console[_0x4e43c0(0x240)](_0x4e43c0(0x24f)),console[_0x4e43c0(0x240)](_0x4e43c0(0x224)),console['log'](_0x4e43c0(0x273)),0x1;if(_0x137607){const {data:_0x4f6bfb}=await withSpinner(_0x4e43c0(0x1da)+_0x137607+_0x4e43c0(0x27d)+_0x3567c0+_0x4e43c0(0x25f),()=>_0x34fc6b['llm'][_0x4e43c0(0x226)](_0x3567c0,_0x137607,_0x1ebe40,{'dryRun':_0x323584,'force':_0xa58865}));if(_0x323584)return console[_0x4e43c0(0x240)](a4_0x1e3c51[_0x4e43c0(0x236)](_0x4e43c0(0x267))),console[_0x4e43c0(0x240)](_0x4e43c0(0x274)+_0x4f6bfb[_0x4e43c0(0x279)]),console['log'](_0x4e43c0(0x25a)+_0x4f6bfb[_0x4e43c0(0x264)]),_0x4f6bfb[_0x4e43c0(0x285)]&&(console[_0x4e43c0(0x240)](_0x4e43c0(0x1f9)),console[_0x4e43c0(0x240)]('─'[_0x4e43c0(0x1ec)](0x3c)),console['log'](_0x4f6bfb[_0x4e43c0(0x285)]),console[_0x4e43c0(0x240)]('─'[_0x4e43c0(0x1ec)](0x3c))),0x0;return console[_0x4e43c0(0x240)](a4_0x1e3c51['green'](_0x4e43c0(0x24b))),console['log']('Agent:\x20'+_0x4f6bfb[_0x4e43c0(0x279)]),console[_0x4e43c0(0x240)](_0x4e43c0(0x1fa)+_0x4f6bfb[_0x4e43c0(0x264)]),console[_0x4e43c0(0x240)](_0x4e43c0(0x1ee)+(_0x4f6bfb[_0x4e43c0(0x1ef)]?a4_0x1e3c51[_0x4e43c0(0x24c)]('new'):_0x4f6bfb[_0x4e43c0(0x1ea)]?a4_0x1e3c51[_0x4e43c0(0x236)](_0x4e43c0(0x1f8)):a4_0x1e3c51['gray']('unchanged'))),0x0;}const _0x33cf89=_0xc5df0c||_0x1ebe40,{data:_0x152cdd}=await withSpinner('Analyzing\x20project\x20\x22'+_0x3567c0+_0x4e43c0(0x25f),()=>_0x34fc6b[_0x4e43c0(0x242)][_0x4e43c0(0x208)](_0x3567c0,_0x33cf89,{'dryRun':!![]})),_0x210a55=_0x152cdd[_0x4e43c0(0x223)][_0x4e43c0(0x206)][_0x4e43c0(0x1f2)]+_0x152cdd['counts'][_0x4e43c0(0x205)][_0x4e43c0(0x1f2)]+_0x152cdd[_0x4e43c0(0x223)][_0x4e43c0(0x248)][_0x4e43c0(0x1f2)]+_0x152cdd[_0x4e43c0(0x223)][_0x4e43c0(0x25c)][_0x4e43c0(0x1f2)]+_0x152cdd[_0x4e43c0(0x223)][_0x4e43c0(0x22d)][_0x4e43c0(0x1f2)],_0x460311=_0x152cdd['counts'][_0x4e43c0(0x206)][_0x4e43c0(0x1f8)]+_0x152cdd[_0x4e43c0(0x223)][_0x4e43c0(0x205)][_0x4e43c0(0x1f8)]+_0x152cdd['counts'][_0x4e43c0(0x248)][_0x4e43c0(0x1f8)]+_0x152cdd['counts']['prompts'][_0x4e43c0(0x1f8)]+_0x152cdd['counts'][_0x4e43c0(0x22d)][_0x4e43c0(0x1f8)],_0x453188=_0x152cdd[_0x4e43c0(0x223)]['agents'][_0x4e43c0(0x256)]+_0x152cdd[_0x4e43c0(0x223)][_0x4e43c0(0x205)]['unchanged']+_0x152cdd[_0x4e43c0(0x223)][_0x4e43c0(0x248)][_0x4e43c0(0x256)]+_0x152cdd[_0x4e43c0(0x223)]['prompts'][_0x4e43c0(0x256)]+_0x152cdd[_0x4e43c0(0x223)][_0x4e43c0(0x22d)][_0x4e43c0(0x256)];console[_0x4e43c0(0x240)]('\x0aPull\x20summary\x20for\x20\x27'+_0x152cdd['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x1e3c51[_0x4e43c0(0x24c)]('+\x20'+_0x210a55+_0x4e43c0(0x1fc))+'\x20|\x20'+a4_0x1e3c51[_0x4e43c0(0x236)]('~\x20'+_0x460311+_0x4e43c0(0x27c))+'\x20|\x20'+a4_0x1e3c51[_0x4e43c0(0x1ed)]('=\x20'+_0x453188+_0x4e43c0(0x26a))),console[_0x4e43c0(0x240)](_0x4e43c0(0x1f0)+formatCountSummary(_0x152cdd[_0x4e43c0(0x223)][_0x4e43c0(0x206)])),console[_0x4e43c0(0x240)](_0x4e43c0(0x262)+formatCountSummary(_0x152cdd['counts'][_0x4e43c0(0x205)])),console['log'](_0x4e43c0(0x216)+formatCountSummary(_0x152cdd['counts']['textKnowledgeBases'])),console[_0x4e43c0(0x240)](_0x4e43c0(0x201)+formatCountSummary(_0x152cdd['counts'][_0x4e43c0(0x25c)])),console[_0x4e43c0(0x240)](_0x4e43c0(0x21b)+formatCountSummary(_0x152cdd['counts'][_0x4e43c0(0x22d)])),console['log']('\x20\x20Target:\x20'+a4_0x1e3c51[_0x4e43c0(0x272)](_0x152cdd[_0x4e43c0(0x21c)])),displayDiffs(_0x152cdd[_0x4e43c0(0x206)],_0x152cdd[_0x4e43c0(0x205)],_0x152cdd[_0x4e43c0(0x248)],_0x152cdd[_0x4e43c0(0x25c)],_0x152cdd['integrations']);if(_0x323584)return console[_0x4e43c0(0x240)](a4_0x1e3c51[_0x4e43c0(0x236)](_0x4e43c0(0x27a))),0x0;if(_0x210a55===0x0&&_0x460311===0x0)return console[_0x4e43c0(0x240)](a4_0x1e3c51['green'](_0x4e43c0(0x1e9))),saveSessionContext({'llm_project':_0x152cdd[_0x4e43c0(0x26b)]},_0x5cdf47['session']),console[_0x4e43c0(0x240)](a4_0x1e3c51[_0x4e43c0(0x24c)]('✔\x20Context\x20set:\x20'+a4_0x1e3c51['dim'](_0x4e43c0(0x246))+'\x20=\x20'+a4_0x1e3c51[_0x4e43c0(0x272)](_0x152cdd[_0x4e43c0(0x26b)]))),0x0;if(!_0x517a2d&&!_0xa58865){if(!isInteractive())return console[_0x4e43c0(0x202)](a4_0x1e3c51[_0x4e43c0(0x20b)](_0x4e43c0(0x1eb)),_0x4e43c0(0x286)),console[_0x4e43c0(0x202)](a4_0x1e3c51[_0x4e43c0(0x1ed)](_0x4e43c0(0x245))),0x1;const _0x579362=await confirmKey(_0x4e43c0(0x204)+(_0x210a55+_0x460311)+_0x4e43c0(0x244));if(!_0x579362)return console[_0x4e43c0(0x240)](a4_0x1e3c51[_0x4e43c0(0x236)](_0x4e43c0(0x270)),_0x4e43c0(0x1d8)),0x1;}const {data:_0x21afef}=await withSpinner(_0x4e43c0(0x237),()=>_0x34fc6b[_0x4e43c0(0x242)][_0x4e43c0(0x208)](_0x3567c0,_0x33cf89,{'force':_0xa58865}));return console[_0x4e43c0(0x240)](a4_0x1e3c51[_0x4e43c0(0x24c)](_0x4e43c0(0x280)+(_0x210a55+_0x460311)+_0x4e43c0(0x251)+_0x21afef[_0x4e43c0(0x21c)])),saveSessionContext({'llm_project':_0x21afef[_0x4e43c0(0x26b)]},_0x5cdf47[_0x4e43c0(0x1df)]),console[_0x4e43c0(0x240)](a4_0x1e3c51[_0x4e43c0(0x24c)](_0x4e43c0(0x26e)+a4_0x1e3c51['dim']('llm_project')+_0x4e43c0(0x26c)+a4_0x1e3c51['cyan'](_0x21afef[_0x4e43c0(0x26b)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x1e86be(0x239)]=a4_0x1e86be(0x1f5);[a4_0x1e86be(0x1de)]=a4_0x1e86be(0x27e);async[a4_0x1e86be(0x235)](_0x3ae690){const _0x22f4ec=a4_0x1e86be,{options:_0x1215d9,args:_0x305a3f,tdx:_0x1cd9be}=_0x3ae690,_0x8befdb=_0x305a3f[0x0],_0x5b06ef=_0x1215d9['name'],_0x46e5c9=_0x1215d9[_0x22f4ec(0x228)],_0x1dc0cd=_0x1215d9['yes'],_0x5171dc=_0x1215d9[_0x22f4ec(0x214)],_0x477326=_0x1215d9[_0x22f4ec(0x1e2)];let _0x5e0483;const _0x201ea1=findAgentConfigPath(process['cwd']());if(_0x8befdb){const _0x4848b1=a4_0x14c103[_0x22f4ec(0x241)](_0x8befdb,'tdx.json');existsSync(_0x4848b1)?(_0x5e0483=_0x8befdb,console['log'](a4_0x1e3c51['dim']('Using\x20local\x20project:\x20'+_0x8befdb))):_0x5e0483=_0x8befdb;}else{if(_0x201ea1)_0x5e0483=a4_0x14c103[_0x22f4ec(0x287)](_0x201ea1),console[_0x22f4ec(0x240)](a4_0x1e3c51[_0x22f4ec(0x1ed)](_0x22f4ec(0x20d)+_0x5e0483));else{if(_0x477326){const _0x3b9a5a=sanitizeForFilesystem(_0x477326);let _0x4e744d=_0x3b9a5a,_0x74970c=a4_0x14c103[_0x22f4ec(0x241)](process[_0x22f4ec(0x283)](),_0x22f4ec(0x206),_0x3b9a5a,_0x22f4ec(0x27b));if(!existsSync(_0x74970c)){const _0x475279=normalizeName(_0x477326),_0xc8ebfa=a4_0x14c103[_0x22f4ec(0x241)](process[_0x22f4ec(0x283)](),_0x22f4ec(0x206),_0x475279,'tdx.json');existsSync(_0xc8ebfa)&&(_0x4e744d=_0x475279,_0x74970c=_0xc8ebfa);}if(existsSync(_0x74970c))_0x5e0483=a4_0x14c103[_0x22f4ec(0x287)](_0x74970c),console[_0x22f4ec(0x240)](a4_0x1e3c51[_0x22f4ec(0x1ed)](_0x22f4ec(0x22b)+_0x5e0483));else{const _0x37a44b=_0x1215d9[_0x22f4ec(0x255)];if(_0x37a44b)throw new SDKError(ErrorCode[_0x22f4ec(0x221)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x477326+_0x22f4ec(0x253),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x22f4ec(0x218)+_0x477326+'\x0a')+(_0x22f4ec(0x1dd)+_0x4e744d+_0x22f4ec(0x210)+(_0x5b06ef||'<new-name>')+_0x22f4ec(0x1f3)+_0x37a44b)});_0x5e0483=_0x477326,console[_0x22f4ec(0x240)](a4_0x1e3c51['dim'](_0x22f4ec(0x21d)+_0x477326));}}}}if(!_0x5e0483)return console['log'](a4_0x1e3c51[_0x22f4ec(0x236)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x22f4ec(0x240)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console['log'](_0x22f4ec(0x20a)),console[_0x22f4ec(0x240)](_0x22f4ec(0x23b)),0x1;if(!_0x5b06ef)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x22f4ec(0x23a),undefined,{'helpText':_0x22f4ec(0x1f7)});if(!_0x1dc0cd&&!_0x46e5c9){if(!isInteractive())return console['error'](a4_0x1e3c51[_0x22f4ec(0x20b)](_0x22f4ec(0x1eb)),_0x22f4ec(0x286)),console[_0x22f4ec(0x202)](a4_0x1e3c51[_0x22f4ec(0x1ed)](_0x22f4ec(0x245))),0x1;const _0xbb4d63=await confirmKey(_0x22f4ec(0x28a)+_0x5e0483+_0x22f4ec(0x234)+_0x5b06ef+'\x22?');if(!_0xbb4d63)return console[_0x22f4ec(0x240)](a4_0x1e3c51['yellow']('Cancelled')),0x1;}const {data:_0x3ecb2a}=await withSpinner(_0x22f4ec(0x23d)+_0x5e0483+'\x22\x20to\x20\x22'+_0x5b06ef+'\x22...',()=>_0x1cd9be[_0x22f4ec(0x242)][_0x22f4ec(0x21e)](_0x5e0483,_0x5b06ef,{'dryRun':_0x46e5c9}));if(_0x46e5c9)return console[_0x22f4ec(0x240)](a4_0x1e3c51[_0x22f4ec(0x236)](_0x22f4ec(0x271))),console[_0x22f4ec(0x240)]('Source:\x20'+_0x3ecb2a[_0x22f4ec(0x203)]),console[_0x22f4ec(0x240)](_0x22f4ec(0x269)+_0x5b06ef),console['log']('Would\x20clone:'),console[_0x22f4ec(0x240)]('\x20\x20Agents:\x20'+_0x3ecb2a['counts'][_0x22f4ec(0x206)][_0x22f4ec(0x1dc)]),console[_0x22f4ec(0x240)](_0x22f4ec(0x262)+_0x3ecb2a[_0x22f4ec(0x223)][_0x22f4ec(0x205)]['created']),console[_0x22f4ec(0x240)](_0x22f4ec(0x201)+_0x3ecb2a[_0x22f4ec(0x223)][_0x22f4ec(0x25c)][_0x22f4ec(0x1dc)]),0x0;const _0x2ed369=_0x3ecb2a[_0x22f4ec(0x223)][_0x22f4ec(0x206)][_0x22f4ec(0x1e5)]>0x0||_0x3ecb2a[_0x22f4ec(0x223)]['knowledgeBases'][_0x22f4ec(0x1e5)]>0x0||_0x3ecb2a[_0x22f4ec(0x223)]['prompts'][_0x22f4ec(0x1e5)]>0x0;_0x2ed369?console[_0x22f4ec(0x240)](a4_0x1e3c51['yellow']('Project\x20cloned\x20with\x20errors')):console[_0x22f4ec(0x240)](a4_0x1e3c51[_0x22f4ec(0x24c)](_0x22f4ec(0x263)));console[_0x22f4ec(0x240)]('Source:\x20'+_0x3ecb2a[_0x22f4ec(0x203)]),console[_0x22f4ec(0x240)](_0x22f4ec(0x269)+_0x3ecb2a[_0x22f4ec(0x1e8)]),console[_0x22f4ec(0x240)](_0x22f4ec(0x25e)+_0x3ecb2a['newProjectId']),console['log'](),console[_0x22f4ec(0x240)](_0x22f4ec(0x1e0)),console[_0x22f4ec(0x240)]('\x20\x20Agents:\x20'+formatCountSummary(_0x3ecb2a['counts']['agents'])),console[_0x22f4ec(0x240)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3ecb2a[_0x22f4ec(0x223)]['knowledgeBases'])),console[_0x22f4ec(0x240)](_0x22f4ec(0x201)+formatCountSummary(_0x3ecb2a['counts'][_0x22f4ec(0x25c)])),console[_0x22f4ec(0x240)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x3ecb2a[_0x22f4ec(0x223)][_0x22f4ec(0x22d)]));if(_0x2ed369){console[_0x22f4ec(0x240)](),console['log'](a4_0x1e3c51[_0x22f4ec(0x20b)](_0x22f4ec(0x250)));for(const _0x81510c of _0x3ecb2a['agents']){_0x81510c[_0x22f4ec(0x1e7)]===_0x22f4ec(0x202)&&console['log'](a4_0x1e3c51[_0x22f4ec(0x20b)](_0x22f4ec(0x23c)+_0x81510c[_0x22f4ec(0x279)]+'\x22:\x20'+_0x81510c[_0x22f4ec(0x202)]));}for(const _0x4ed3c3 of _0x3ecb2a[_0x22f4ec(0x205)]){_0x4ed3c3[_0x22f4ec(0x1e7)]===_0x22f4ec(0x202)&&console['log'](a4_0x1e3c51[_0x22f4ec(0x20b)](_0x22f4ec(0x276)+_0x4ed3c3['name']+_0x22f4ec(0x20f)+_0x4ed3c3['error']));}for(const _0x5a0aee of _0x3ecb2a[_0x22f4ec(0x25c)]){_0x5a0aee[_0x22f4ec(0x1e7)]===_0x22f4ec(0x202)&&console[_0x22f4ec(0x240)](a4_0x1e3c51['red'](_0x22f4ec(0x268)+_0x5a0aee[_0x22f4ec(0x239)]+_0x22f4ec(0x20f)+_0x5a0aee[_0x22f4ec(0x202)]));}for(const _0x50a57f of _0x3ecb2a[_0x22f4ec(0x22d)]){_0x50a57f[_0x22f4ec(0x1e7)]===_0x22f4ec(0x202)&&console['log'](a4_0x1e3c51[_0x22f4ec(0x20b)]('\x20\x20Integration\x20\x22'+_0x50a57f[_0x22f4ec(0x239)]+_0x22f4ec(0x20f)+_0x50a57f['error']));}return 0x1;}console[_0x22f4ec(0x240)]();const _0x3dc33a=getLLMProjectUrl(_0x5171dc,_0x3ecb2a[_0x22f4ec(0x219)]);return console['log'](_0x22f4ec(0x23e)+a4_0x1e3c51['cyan'](_0x3dc33a)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x1e86be(0x252);[a4_0x1e86be(0x1de)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x1e86be(0x235)](_0x4ab63a){const _0x31e9a8=a4_0x1e86be,{options:_0x8923de,args:_0x1a3f56,tdx:_0x12ddb2}=_0x4ab63a;let _0x447e32=_0x1a3f56[0x0]||process[_0x31e9a8(0x283)]();const _0x30829d=_0x8923de[_0x31e9a8(0x228)],_0x5b7469=_0x8923de[_0x31e9a8(0x1f1)],_0x5af446=_0x8923de[_0x31e9a8(0x215)],_0x165d7b=_0x8923de[_0x31e9a8(0x214)],_0x4f3809=a4_0x14c103[_0x31e9a8(0x241)](_0x447e32,'agent.yml'),_0x3fab61=existsSync(_0x4f3809);if(_0x3fab61){const {data:_0x178777}=await withSpinner(_0x31e9a8(0x259)+_0x447e32+_0x31e9a8(0x25f),()=>_0x12ddb2[_0x31e9a8(0x242)][_0x31e9a8(0x200)](_0x447e32,{'dryRun':_0x30829d,'force':_0x5b7469}));if(_0x30829d)return console['log'](a4_0x1e3c51[_0x31e9a8(0x236)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x31e9a8(0x240)](_0x31e9a8(0x254)+_0x178777[_0x31e9a8(0x279)]),0x0;if(_0x178777[_0x31e9a8(0x1e7)]===_0x31e9a8(0x202))return console[_0x31e9a8(0x240)](a4_0x1e3c51[_0x31e9a8(0x20b)](_0x31e9a8(0x231)+_0x178777[_0x31e9a8(0x202)])),0x1;console[_0x31e9a8(0x240)](a4_0x1e3c51['green'](_0x31e9a8(0x24e)+_0x178777[_0x31e9a8(0x1e7)]+_0x31e9a8(0x1db))),console['log'](_0x31e9a8(0x282)+_0x178777[_0x31e9a8(0x279)]);if(_0x178777[_0x31e9a8(0x260)]&&_0x178777[_0x31e9a8(0x1fe)]){const _0x16e095=getLLMAgentChatUrl(_0x165d7b,_0x178777[_0x31e9a8(0x1fe)],_0x178777[_0x31e9a8(0x260)]);console[_0x31e9a8(0x240)](_0x31e9a8(0x1d9)+a4_0x1e3c51[_0x31e9a8(0x272)](_0x16e095));}return 0x0;}const _0x2a5ce3=_0x8923de[_0x31e9a8(0x1e2)],_0x191b25=resolveProjectFromContext(_0x447e32,_0x2a5ce3);if(_0x191b25[_0x31e9a8(0x225)])_0x447e32=_0x191b25[_0x31e9a8(0x24a)],_0x191b25[_0x31e9a8(0x1f4)]===_0x31e9a8(0x230)&&console[_0x31e9a8(0x240)](a4_0x1e3c51[_0x31e9a8(0x1ed)]('Using\x20project:\x20'+_0x447e32));else{let _0x35d3dd='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x191b25[_0x31e9a8(0x281)]===_0x31e9a8(0x23f)&&(_0x35d3dd=_0x191b25[_0x31e9a8(0x22a)]+_0x31e9a8(0x1e3)+_0x191b25[_0x31e9a8(0x1e2)]+_0x31e9a8(0x238));throw new SDKError(ErrorCode[_0x31e9a8(0x221)],_0x191b25[_0x31e9a8(0x281)]===_0x31e9a8(0x213)?_0x191b25[_0x31e9a8(0x22a)]:_0x31e9a8(0x1fb)+_0x447e32,undefined,{'helpText':_0x35d3dd});}const {data:_0x40883b}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x12ddb2[_0x31e9a8(0x242)]['pushProject'](_0x447e32,{'dryRun':!![]})),_0x4b0cc7=_0x40883b[_0x31e9a8(0x223)][_0x31e9a8(0x206)]['errors']>0x0;if(_0x4b0cc7){console['log'](a4_0x1e3c51['red']('\x0aErrors\x20found:'));for(const _0x3ce0cf of _0x40883b[_0x31e9a8(0x206)]){_0x3ce0cf[_0x31e9a8(0x1e7)]===_0x31e9a8(0x202)&&console[_0x31e9a8(0x240)](a4_0x1e3c51[_0x31e9a8(0x20b)]('\x20\x20Agent\x20\x22'+_0x3ce0cf[_0x31e9a8(0x279)]+_0x31e9a8(0x20f)+_0x3ce0cf['error']));}return 0x1;}const _0xa9c106=_0x40883b[_0x31e9a8(0x223)][_0x31e9a8(0x206)][_0x31e9a8(0x1dc)]+_0x40883b['counts'][_0x31e9a8(0x205)]['created']+_0x40883b[_0x31e9a8(0x223)][_0x31e9a8(0x248)][_0x31e9a8(0x1dc)]+_0x40883b[_0x31e9a8(0x223)]['prompts'][_0x31e9a8(0x1dc)]+_0x40883b['counts'][_0x31e9a8(0x22d)][_0x31e9a8(0x1dc)],_0x5cb985=_0x40883b[_0x31e9a8(0x223)]['agents'][_0x31e9a8(0x1f8)]+_0x40883b['counts'][_0x31e9a8(0x205)][_0x31e9a8(0x1f8)]+_0x40883b[_0x31e9a8(0x223)][_0x31e9a8(0x248)][_0x31e9a8(0x1f8)]+_0x40883b['counts'][_0x31e9a8(0x25c)][_0x31e9a8(0x1f8)]+_0x40883b[_0x31e9a8(0x223)][_0x31e9a8(0x22d)]['updated'],_0x8a7c05=_0x40883b[_0x31e9a8(0x223)][_0x31e9a8(0x206)][_0x31e9a8(0x256)]+_0x40883b['counts'][_0x31e9a8(0x205)][_0x31e9a8(0x256)]+_0x40883b[_0x31e9a8(0x223)]['textKnowledgeBases'][_0x31e9a8(0x256)]+_0x40883b[_0x31e9a8(0x223)][_0x31e9a8(0x25c)]['unchanged']+_0x40883b[_0x31e9a8(0x223)][_0x31e9a8(0x22d)][_0x31e9a8(0x256)];console[_0x31e9a8(0x240)]('\x0aPush\x20summary\x20for\x20\x27'+_0x40883b[_0x31e9a8(0x26b)]+'\x27:'),console[_0x31e9a8(0x240)]('\x20\x20'+a4_0x1e3c51['green']('+\x20'+_0xa9c106+'\x20new')+_0x31e9a8(0x1fd)+a4_0x1e3c51['yellow']('~\x20'+_0x5cb985+'\x20changed')+_0x31e9a8(0x1fd)+a4_0x1e3c51[_0x31e9a8(0x1ed)]('=\x20'+_0x8a7c05+_0x31e9a8(0x26a))),console[_0x31e9a8(0x240)]('\x20\x20Agents:\x20'+formatCountSummary(_0x40883b[_0x31e9a8(0x223)]['agents'])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x40883b['counts']['knowledgeBases'])),console[_0x31e9a8(0x240)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x40883b['counts'][_0x31e9a8(0x248)])),console['log'](_0x31e9a8(0x201)+formatCountSummary(_0x40883b['counts'][_0x31e9a8(0x25c)])),console['log'](_0x31e9a8(0x21b)+formatCountSummary(_0x40883b[_0x31e9a8(0x223)][_0x31e9a8(0x22d)])),console[_0x31e9a8(0x240)](_0x31e9a8(0x21f)+a4_0x1e3c51[_0x31e9a8(0x272)](_0x447e32)),displayDiffs(_0x40883b[_0x31e9a8(0x206)],_0x40883b[_0x31e9a8(0x205)],_0x40883b[_0x31e9a8(0x248)],_0x40883b[_0x31e9a8(0x25c)],_0x40883b[_0x31e9a8(0x22d)]);if(_0x30829d)return console[_0x31e9a8(0x240)](a4_0x1e3c51[_0x31e9a8(0x236)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0xa9c106===0x0&&_0x5cb985===0x0){console['log'](a4_0x1e3c51[_0x31e9a8(0x24c)](_0x31e9a8(0x27f)));const _0x326e88=getLLMProjectUrl(_0x165d7b,_0x40883b[_0x31e9a8(0x1fe)]);return console[_0x31e9a8(0x240)](_0x31e9a8(0x23e)+a4_0x1e3c51[_0x31e9a8(0x272)](_0x326e88)),0x0;}if(!_0x5af446&&!_0x5b7469){if(!isInteractive())return console['error'](a4_0x1e3c51['red'](_0x31e9a8(0x1eb)),_0x31e9a8(0x286)),console[_0x31e9a8(0x202)](a4_0x1e3c51[_0x31e9a8(0x1ed)](_0x31e9a8(0x245))),0x1;const _0x5230f0=await confirmKey(_0x31e9a8(0x217)+(_0xa9c106+_0x5cb985)+_0x31e9a8(0x1e1));if(!_0x5230f0)return console['log'](a4_0x1e3c51['yellow'](_0x31e9a8(0x270)),_0x31e9a8(0x20e)),0x1;}const {data:_0x3e2ac1}=await withSpinner('Pushing\x20to\x20project...',()=>_0x12ddb2[_0x31e9a8(0x242)][_0x31e9a8(0x229)](_0x447e32,{'force':_0x5b7469})),_0x5867e3=_0x3e2ac1[_0x31e9a8(0x223)][_0x31e9a8(0x206)][_0x31e9a8(0x1e5)]>0x0||_0x3e2ac1[_0x31e9a8(0x223)][_0x31e9a8(0x205)][_0x31e9a8(0x1e5)]>0x0||_0x3e2ac1[_0x31e9a8(0x223)][_0x31e9a8(0x248)][_0x31e9a8(0x1e5)]>0x0||_0x3e2ac1[_0x31e9a8(0x223)][_0x31e9a8(0x25c)][_0x31e9a8(0x1e5)]>0x0;if(_0x5867e3){console[_0x31e9a8(0x240)](a4_0x1e3c51[_0x31e9a8(0x236)](_0x31e9a8(0x289))),console[_0x31e9a8(0x240)](),console[_0x31e9a8(0x240)](a4_0x1e3c51[_0x31e9a8(0x20b)]('Errors:'));for(const _0x49b59d of _0x3e2ac1[_0x31e9a8(0x206)]){_0x49b59d[_0x31e9a8(0x1e7)]===_0x31e9a8(0x202)&&console[_0x31e9a8(0x240)](a4_0x1e3c51[_0x31e9a8(0x20b)](_0x31e9a8(0x23c)+_0x49b59d[_0x31e9a8(0x279)]+_0x31e9a8(0x20f)+_0x49b59d[_0x31e9a8(0x202)]));}for(const _0x2f5cb5 of _0x3e2ac1[_0x31e9a8(0x205)]){_0x2f5cb5['action']==='error'&&console['log'](a4_0x1e3c51['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x2f5cb5[_0x31e9a8(0x239)]+_0x31e9a8(0x20f)+_0x2f5cb5[_0x31e9a8(0x202)]));}for(const _0x3b264f of _0x3e2ac1[_0x31e9a8(0x248)]){_0x3b264f[_0x31e9a8(0x1e7)]==='error'&&console[_0x31e9a8(0x240)](a4_0x1e3c51[_0x31e9a8(0x20b)](_0x31e9a8(0x261)+_0x3b264f[_0x31e9a8(0x239)]+_0x31e9a8(0x20f)+_0x3b264f[_0x31e9a8(0x202)]));}for(const _0x96af7 of _0x3e2ac1[_0x31e9a8(0x25c)]){_0x96af7[_0x31e9a8(0x1e7)]===_0x31e9a8(0x202)&&console['log'](a4_0x1e3c51['red'](_0x31e9a8(0x268)+_0x96af7[_0x31e9a8(0x239)]+'\x22:\x20'+_0x96af7[_0x31e9a8(0x202)]));}for(const _0xc5dd4e of _0x3e2ac1[_0x31e9a8(0x22d)]){_0xc5dd4e[_0x31e9a8(0x1e7)]===_0x31e9a8(0x202)&&console[_0x31e9a8(0x240)](a4_0x1e3c51[_0x31e9a8(0x20b)](_0x31e9a8(0x247)+_0xc5dd4e['name']+_0x31e9a8(0x20f)+_0xc5dd4e[_0x31e9a8(0x202)]));}return 0x1;}console['log'](a4_0x1e3c51[_0x31e9a8(0x24c)](_0x31e9a8(0x212)+(_0xa9c106+_0x5cb985)+_0x31e9a8(0x288)+_0x3e2ac1[_0x31e9a8(0x26b)]+'\x27'));const _0x1f56fe=getLLMProjectUrl(_0x165d7b,_0x3e2ac1[_0x31e9a8(0x1fe)]);return console[_0x31e9a8(0x240)](_0x31e9a8(0x23e)+a4_0x1e3c51['cyan'](_0x1f56fe)),0x0;}}
1
+ function a4_0x26f0(){const _0x3979f4=['counts','message','1382553OLtRlt','Status:\x20','agent.yml','1271152EsFWEV','dirname','prompts','Would\x20clone:','11144ICNumD','\x22...','errors','\x20\x20Agents:\x20','push','pullProject','Summary:','integrations','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','profile','Writing\x20files...','\x0aPull\x20summary\x20for\x20\x27','join','New\x20project\x20ID:\x20','textKnowledgeBases','\x0aChanges\x20to\x20agent\x20\x27','\x20\x20Agent\x20\x22','\x20unchanged','\x0aChanges\x20to\x20integration\x20\x27','description','agent:clone','cyan','\x0a✔\x20Pushed\x20','log','\x20changed','hasChanges','cloneProject','New\x20project\x20name\x20is\x20required','updated','\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)','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','gray','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x27\x20to\x20create\x20the\x20folder\x20structure.','context','MISSING_ARGUMENT','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20|\x20','\x20\x20Integration\x20\x22','red','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','utf-8','\x20\x20Target:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','dim','no_context','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Agent\x20','Dry\x20run\x20-\x20no\x20changes\x20made','total','Analyzing\x20project\x20\x22','llmProject','Cannot\x20clone\x20from\x20context\x20project\x20\x22','action','Pushing\x20to\x20project...','\x20new','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20Knowledge\x20Base\x20\x22','\x22:\x20','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','\x20errors','llm_project','\x20updated','Pushing\x20agent\x20from\x20\x22','INVALID_ARGUMENT','newProjectId','\x0aPush\x20','\x20resources\x20to\x20\x27','session','reason','projectDir','Agent:\x20','17830JjytwA','name','✔\x20Context\x20set:\x20','\x20\x20Source:\x20','Analyzing\x20changes\x20to\x20push...','\x20\x20Text\x20Knowledge\x20Bases:\x20','Project:\x20','pushAgent','outputPath','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20files?','\x0aPush\x20summary\x20for\x20\x27','\x22\x20to\x20\x22','created','\x20\x20Knowledge\x20Bases:\x20','480bfIqec','Project\x20cloned\x20with\x20errors','llm','Clone\x20\x22','\x20\x20Prompt\x20\x22','force','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','pushProject','Errors:','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x0aChanges:','agentName','tdx.json','yes','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','<new-name>','agents','projectName','\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','Using\x20project:\x20','Output:\x20','site','agent:pull','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','green','\x20=\x20','knowledgeBases','\x20\x20tdx\x20agent\x20pull\x20','isNew','Using\x20local\x20project:\x20','-\x20no\x20files\x20written','outputDir','Cancelled','yellow','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','Using\x20context\x20project:\x20','\x0aErrors\x20found:','707wIsSMG','224079lmbUkz','pullAgent','new','sourceProjectName','-\x20nothing\x20pushed','\x22\x20to\x20a\x20different\x20profile','\x20files\x20to\x20','Using\x20current\x20project:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','error','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','projectId','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','agentId','\x0aProject\x20pushed\x20with\x20errors','New\x20project:\x20','agent:push','execute','Source:\x20','240978QWqMTz','\x0aWrite\x20','source','diff','176050ZKchbA','Output\x20path:\x20','repeat','cwd','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x0aError:','\x20\x20Integrations:\x20','Pulling\x20agent\x20\x22','found','\x20\x20Prompts:\x20','unchanged','parse'];a4_0x26f0=function(){return _0x3979f4;};return a4_0x26f0();}const a4_0x2a5b85=a4_0x3d59;(function(_0x116bc9,_0x1da5ad){const _0x1b56ae=a4_0x3d59,_0x410567=_0x116bc9();while(!![]){try{const _0x1b94aa=-parseInt(_0x1b56ae(0x182))/0x1+parseInt(_0x1b56ae(0x17e))/0x2+-parseInt(_0x1b56ae(0x16b))/0x3+parseInt(_0x1b56ae(0x193))/0x4+parseInt(_0x1b56ae(0x135))/0x5*(-parseInt(_0x1b56ae(0x144))/0x6)+-parseInt(_0x1b56ae(0x16a))/0x7*(-parseInt(_0x1b56ae(0x197))/0x8)+parseInt(_0x1b56ae(0x190))/0x9;if(_0x1b94aa===_0x1da5ad)break;else _0x410567['push'](_0x410567['shift']());}catch(_0x6585f6){_0x410567['push'](_0x410567['shift']());}}}(a4_0x26f0,0x2ffd4));import a4_0x2e7574 from'chalk';import a4_0x136171 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(_0x4455d0){const _0x472ad7=a4_0x3d59,_0x57009e=[];if(_0x4455d0[_0x472ad7(0x11e)]!==undefined)_0x57009e[_0x472ad7(0x19b)](_0x4455d0[_0x472ad7(0x11e)]+'\x20total');if(_0x4455d0[_0x472ad7(0x16d)]!==undefined&&_0x4455d0[_0x472ad7(0x16d)]>0x0)_0x57009e[_0x472ad7(0x19b)](a4_0x2e7574['green'](_0x4455d0[_0x472ad7(0x16d)]+_0x472ad7(0x124)));if(_0x4455d0['created']!==undefined&&_0x4455d0['created']>0x0)_0x57009e[_0x472ad7(0x19b)](a4_0x2e7574[_0x472ad7(0x15d)](_0x4455d0['created']+'\x20created'));if(_0x4455d0[_0x472ad7(0x108)]!==undefined&&_0x4455d0[_0x472ad7(0x108)]>0x0)_0x57009e[_0x472ad7(0x19b)](a4_0x2e7574[_0x472ad7(0x166)](_0x4455d0[_0x472ad7(0x108)]+_0x472ad7(0x12b)));if(_0x4455d0['unchanged']!==undefined&&_0x4455d0['unchanged']>0x0)_0x57009e[_0x472ad7(0x19b)](a4_0x2e7574['gray'](_0x4455d0['unchanged']+_0x472ad7(0xfd)));if(_0x4455d0[_0x472ad7(0x199)]!==undefined&&_0x4455d0[_0x472ad7(0x199)]>0x0)_0x57009e['push'](a4_0x2e7574[_0x472ad7(0x113)](_0x4455d0['errors']+_0x472ad7(0x129)));return _0x57009e[_0x472ad7(0x1a3)](',\x20');}function displayDiffs(_0x2ec010,_0x2d5fa9,_0x10875e,_0x48228d,_0x320ce4=[]){const _0x249d4=a4_0x3d59;for(const _0x4a2ee0 of _0x2ec010){if(_0x4a2ee0[_0x249d4(0x181)]){const _0x5e986e=_0x4a2ee0[_0x249d4(0x150)]||_0x4a2ee0[_0x249d4(0x136)];console[_0x249d4(0x103)](_0x249d4(0xfb)+_0x5e986e+'\x27:'),console['log']('─'[_0x249d4(0x184)](0x3c)),console[_0x249d4(0x103)](_0x4a2ee0['diff']),console[_0x249d4(0x103)]('─'[_0x249d4(0x184)](0x3c));}}for(const _0x225ac2 of _0x2d5fa9){_0x225ac2[_0x249d4(0x181)]&&(console['log'](_0x249d4(0x173)+_0x225ac2[_0x249d4(0x136)]+'\x27:'),console[_0x249d4(0x103)]('─'[_0x249d4(0x184)](0x3c)),console[_0x249d4(0x103)](_0x225ac2[_0x249d4(0x181)]),console[_0x249d4(0x103)]('─'[_0x249d4(0x184)](0x3c)));}for(const _0x28c97f of _0x10875e){_0x28c97f[_0x249d4(0x181)]&&(console[_0x249d4(0x103)](_0x249d4(0x13e)+_0x28c97f[_0x249d4(0x136)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console['log'](_0x28c97f[_0x249d4(0x181)]),console[_0x249d4(0x103)]('─'[_0x249d4(0x184)](0x3c)));}for(const _0x8f5d4d of _0x48228d){_0x8f5d4d[_0x249d4(0x181)]&&(console['log']('\x0aChanges\x20to\x20prompt\x20\x27'+_0x8f5d4d[_0x249d4(0x136)]+'\x27:'),console['log']('─'[_0x249d4(0x184)](0x3c)),console[_0x249d4(0x103)](_0x8f5d4d[_0x249d4(0x181)]),console['log']('─'[_0x249d4(0x184)](0x3c)));}for(const _0x4cecbe of _0x320ce4){_0x4cecbe[_0x249d4(0x181)]&&(console[_0x249d4(0x103)](_0x249d4(0xfe)+_0x4cecbe[_0x249d4(0x136)]+'\x27:'),console[_0x249d4(0x103)]('─'[_0x249d4(0x184)](0x3c)),console['log'](_0x4cecbe['diff']),console[_0x249d4(0x103)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x2a5b85(0x136)]=a4_0x2a5b85(0x15b);[a4_0x2a5b85(0xff)]=a4_0x2a5b85(0x167);async[a4_0x2a5b85(0x17c)](_0x423c02){const _0x83e1f8=a4_0x2a5b85,{options:_0x4ffa76,args:_0x4676fa,tdx:_0x4384f4}=_0x423c02,_0x32bfe7=_0x4676fa[0x0],_0x1bb84f=_0x4676fa[0x1],_0x177db4=_0x4ffa76['output'],_0x80b6b2=_0x4ffa76['dryRun'],_0x302e4e=_0x4ffa76['force'],_0x3834f3=_0x4ffa76[_0x83e1f8(0x152)],_0x4e0025=_0x4ffa76['llmProject'];let _0x43c34e,_0x510a25;const _0x4f1180=findAgentConfigPath(process[_0x83e1f8(0x185)]());if(_0x32bfe7){const _0x2ed40c=a4_0x136171[_0x83e1f8(0x1a3)](_0x32bfe7,'tdx.json');if(existsSync(_0x2ed40c))try{const _0x5b18ec=JSON[_0x83e1f8(0x18d)](readFileSync(_0x2ed40c,'utf-8'));_0x43c34e=_0x5b18ec[_0x83e1f8(0x12a)],_0x510a25=_0x32bfe7,console[_0x83e1f8(0x103)](a4_0x2e7574[_0x83e1f8(0x119)]('Using\x20project\x20from\x20'+_0x2ed40c+':\x20'+_0x43c34e));}catch{_0x43c34e=_0x32bfe7;}else _0x43c34e=_0x32bfe7;}else{if(_0x4f1180)try{const _0x5847b7=JSON[_0x83e1f8(0x18d)](readFileSync(_0x4f1180,_0x83e1f8(0x115)));_0x43c34e=_0x5847b7['llm_project'],_0x510a25=a4_0x136171[_0x83e1f8(0x194)](_0x4f1180),console[_0x83e1f8(0x103)](a4_0x2e7574[_0x83e1f8(0x119)]('Using\x20project:\x20'+_0x43c34e));}catch{_0x43c34e=_0x4e0025;}else _0x43c34e=_0x4e0025;}if(!_0x43c34e)return console[_0x83e1f8(0x103)](a4_0x2e7574[_0x83e1f8(0x166)](_0x83e1f8(0x118))),console['log'](_0x83e1f8(0x128)),console[_0x83e1f8(0x103)](_0x83e1f8(0x157)),console[_0x83e1f8(0x103)]('\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['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent'),0x1;if(_0x1bb84f){const {data:_0x1e60ac}=await withSpinner(_0x83e1f8(0x189)+_0x1bb84f+'\x22\x20from\x20project\x20\x22'+_0x43c34e+_0x83e1f8(0x198),()=>_0x4384f4[_0x83e1f8(0x146)][_0x83e1f8(0x16c)](_0x43c34e,_0x1bb84f,_0x177db4,{'dryRun':_0x80b6b2,'force':_0x302e4e}));if(_0x80b6b2)return console[_0x83e1f8(0x103)](a4_0x2e7574[_0x83e1f8(0x166)]('Dry\x20run\x20-\x20no\x20files\x20written')),console['log']('Would\x20pull\x20agent:\x20'+_0x1e60ac[_0x83e1f8(0x150)]),console[_0x83e1f8(0x103)](_0x83e1f8(0x183)+_0x1e60ac[_0x83e1f8(0x13d)]),_0x1e60ac[_0x83e1f8(0x181)]&&(console[_0x83e1f8(0x103)](_0x83e1f8(0x14f)),console[_0x83e1f8(0x103)]('─'[_0x83e1f8(0x184)](0x3c)),console[_0x83e1f8(0x103)](_0x1e60ac['diff']),console[_0x83e1f8(0x103)]('─'[_0x83e1f8(0x184)](0x3c))),0x0;return console['log'](a4_0x2e7574['green']('Agent\x20pulled\x20successfully')),console[_0x83e1f8(0x103)]('Agent:\x20'+_0x1e60ac['agentName']),console[_0x83e1f8(0x103)](_0x83e1f8(0x159)+_0x1e60ac['outputPath']),console['log'](_0x83e1f8(0x191)+(_0x1e60ac[_0x83e1f8(0x161)]?a4_0x2e7574[_0x83e1f8(0x15d)](_0x83e1f8(0x16d)):_0x1e60ac[_0x83e1f8(0x105)]?a4_0x2e7574[_0x83e1f8(0x166)](_0x83e1f8(0x108)):a4_0x2e7574[_0x83e1f8(0x10b)]('unchanged'))),0x0;}const _0x378fa3=_0x510a25||_0x177db4,{data:_0x2dc41c}=await withSpinner(_0x83e1f8(0x11f)+_0x43c34e+_0x83e1f8(0x198),()=>_0x4384f4['llm'][_0x83e1f8(0x19c)](_0x43c34e,_0x378fa3,{'dryRun':!![]})),_0xfa08a9=_0x2dc41c[_0x83e1f8(0x18e)][_0x83e1f8(0x155)][_0x83e1f8(0x16d)]+_0x2dc41c[_0x83e1f8(0x18e)][_0x83e1f8(0x15f)][_0x83e1f8(0x16d)]+_0x2dc41c[_0x83e1f8(0x18e)][_0x83e1f8(0xfa)][_0x83e1f8(0x16d)]+_0x2dc41c[_0x83e1f8(0x18e)][_0x83e1f8(0x195)][_0x83e1f8(0x16d)]+_0x2dc41c[_0x83e1f8(0x18e)][_0x83e1f8(0x19e)][_0x83e1f8(0x16d)],_0x25849e=_0x2dc41c['counts'][_0x83e1f8(0x155)][_0x83e1f8(0x108)]+_0x2dc41c[_0x83e1f8(0x18e)]['knowledgeBases'][_0x83e1f8(0x108)]+_0x2dc41c[_0x83e1f8(0x18e)][_0x83e1f8(0xfa)][_0x83e1f8(0x108)]+_0x2dc41c[_0x83e1f8(0x18e)]['prompts'][_0x83e1f8(0x108)]+_0x2dc41c['counts'][_0x83e1f8(0x19e)]['updated'],_0x331b5c=_0x2dc41c[_0x83e1f8(0x18e)][_0x83e1f8(0x155)]['unchanged']+_0x2dc41c[_0x83e1f8(0x18e)]['knowledgeBases'][_0x83e1f8(0x18c)]+_0x2dc41c['counts']['textKnowledgeBases']['unchanged']+_0x2dc41c[_0x83e1f8(0x18e)]['prompts'][_0x83e1f8(0x18c)]+_0x2dc41c[_0x83e1f8(0x18e)][_0x83e1f8(0x19e)][_0x83e1f8(0x18c)];console[_0x83e1f8(0x103)](_0x83e1f8(0x1a2)+_0x2dc41c[_0x83e1f8(0x156)]+'\x27:'),console[_0x83e1f8(0x103)]('\x20\x20'+a4_0x2e7574[_0x83e1f8(0x15d)]('+\x20'+_0xfa08a9+_0x83e1f8(0x124))+_0x83e1f8(0x111)+a4_0x2e7574[_0x83e1f8(0x166)]('~\x20'+_0x25849e+_0x83e1f8(0x104))+_0x83e1f8(0x111)+a4_0x2e7574[_0x83e1f8(0x119)]('=\x20'+_0x331b5c+'\x20unchanged')),console[_0x83e1f8(0x103)](_0x83e1f8(0x19a)+formatCountSummary(_0x2dc41c[_0x83e1f8(0x18e)][_0x83e1f8(0x155)])),console[_0x83e1f8(0x103)](_0x83e1f8(0x143)+formatCountSummary(_0x2dc41c['counts'][_0x83e1f8(0x15f)])),console[_0x83e1f8(0x103)](_0x83e1f8(0x13a)+formatCountSummary(_0x2dc41c[_0x83e1f8(0x18e)][_0x83e1f8(0xfa)])),console[_0x83e1f8(0x103)](_0x83e1f8(0x18b)+formatCountSummary(_0x2dc41c[_0x83e1f8(0x18e)]['prompts'])),console[_0x83e1f8(0x103)](_0x83e1f8(0x188)+formatCountSummary(_0x2dc41c[_0x83e1f8(0x18e)][_0x83e1f8(0x19e)])),console['log'](_0x83e1f8(0x116)+a4_0x2e7574[_0x83e1f8(0x101)](_0x2dc41c[_0x83e1f8(0x164)])),displayDiffs(_0x2dc41c[_0x83e1f8(0x155)],_0x2dc41c['knowledgeBases'],_0x2dc41c[_0x83e1f8(0xfa)],_0x2dc41c['prompts'],_0x2dc41c[_0x83e1f8(0x19e)]);if(_0x80b6b2)return console['log'](a4_0x2e7574[_0x83e1f8(0x166)](_0x83e1f8(0x177))),0x0;if(_0xfa08a9===0x0&&_0x25849e===0x0)return console[_0x83e1f8(0x103)](a4_0x2e7574[_0x83e1f8(0x15d)](_0x83e1f8(0x10a))),saveSessionContext({'llm_project':_0x2dc41c[_0x83e1f8(0x156)]},_0x4ffa76[_0x83e1f8(0x131)]),console[_0x83e1f8(0x103)](a4_0x2e7574['green'](_0x83e1f8(0x137)+a4_0x2e7574[_0x83e1f8(0x119)](_0x83e1f8(0x12a))+'\x20=\x20'+a4_0x2e7574['cyan'](_0x2dc41c[_0x83e1f8(0x156)]))),0x0;if(!_0x3834f3&&!_0x302e4e){if(!isInteractive())return console[_0x83e1f8(0x174)](a4_0x2e7574[_0x83e1f8(0x113)]('\x0aError:'),_0x83e1f8(0x14b)),console[_0x83e1f8(0x174)](a4_0x2e7574['dim'](_0x83e1f8(0x10c))),0x1;const _0x27f95b=await confirmKey(_0x83e1f8(0x17f)+(_0xfa08a9+_0x25849e)+_0x83e1f8(0x13f));if(!_0x27f95b)return console[_0x83e1f8(0x103)](a4_0x2e7574[_0x83e1f8(0x166)]('Cancelled'),_0x83e1f8(0x163)),0x1;}const {data:_0x301df0}=await withSpinner(_0x83e1f8(0x1a1),()=>_0x4384f4[_0x83e1f8(0x146)]['pullProject'](_0x43c34e,_0x378fa3,{'force':_0x302e4e}));return console['log'](a4_0x2e7574['green']('\x0a✔\x20Pulled\x20'+(_0xfa08a9+_0x25849e)+_0x83e1f8(0x171)+_0x301df0[_0x83e1f8(0x164)])),saveSessionContext({'llm_project':_0x301df0[_0x83e1f8(0x156)]},_0x4ffa76[_0x83e1f8(0x131)]),console[_0x83e1f8(0x103)](a4_0x2e7574[_0x83e1f8(0x15d)](_0x83e1f8(0x137)+a4_0x2e7574[_0x83e1f8(0x119)](_0x83e1f8(0x12a))+_0x83e1f8(0x15e)+a4_0x2e7574[_0x83e1f8(0x101)](_0x301df0[_0x83e1f8(0x156)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x2a5b85(0x136)]=a4_0x2a5b85(0x100);[a4_0x2a5b85(0xff)]=a4_0x2a5b85(0x153);async[a4_0x2a5b85(0x17c)](_0x5a209c){const _0x3c7291=a4_0x2a5b85,{options:_0x2ec3cd,args:_0x567893,tdx:_0x1b3791}=_0x5a209c,_0x554fb8=_0x567893[0x0],_0x417421=_0x2ec3cd[_0x3c7291(0x136)],_0x1d5852=_0x2ec3cd['dryRun'],_0xdc6bd3=_0x2ec3cd[_0x3c7291(0x152)],_0x2c8c05=_0x2ec3cd[_0x3c7291(0x15a)],_0x1f2347=_0x2ec3cd[_0x3c7291(0x120)];let _0x2ff3fa;const _0x66ec6d=findAgentConfigPath(process[_0x3c7291(0x185)]());if(_0x554fb8){const _0x1fcd39=a4_0x136171[_0x3c7291(0x1a3)](_0x554fb8,'tdx.json');existsSync(_0x1fcd39)?(_0x2ff3fa=_0x554fb8,console[_0x3c7291(0x103)](a4_0x2e7574[_0x3c7291(0x119)](_0x3c7291(0x162)+_0x554fb8))):_0x2ff3fa=_0x554fb8;}else{if(_0x66ec6d)_0x2ff3fa=a4_0x136171[_0x3c7291(0x194)](_0x66ec6d),console[_0x3c7291(0x103)](a4_0x2e7574['dim'](_0x3c7291(0x172)+_0x2ff3fa));else{if(_0x1f2347){const _0x2e0db4=sanitizeForFilesystem(_0x1f2347);let _0x52fc39=_0x2e0db4,_0x4c4302=a4_0x136171[_0x3c7291(0x1a3)](process[_0x3c7291(0x185)](),_0x3c7291(0x155),_0x2e0db4,_0x3c7291(0x151));if(!existsSync(_0x4c4302)){const _0x38adb9=normalizeName(_0x1f2347),_0x247177=a4_0x136171['join'](process[_0x3c7291(0x185)](),_0x3c7291(0x155),_0x38adb9,_0x3c7291(0x151));existsSync(_0x247177)&&(_0x52fc39=_0x38adb9,_0x4c4302=_0x247177);}if(existsSync(_0x4c4302))_0x2ff3fa=a4_0x136171[_0x3c7291(0x194)](_0x4c4302),console[_0x3c7291(0x103)](a4_0x2e7574['dim'](_0x3c7291(0x162)+_0x2ff3fa));else{const _0x41fb40=_0x2ec3cd[_0x3c7291(0x1a0)];if(_0x41fb40)throw new SDKError(ErrorCode[_0x3c7291(0x12d)],_0x3c7291(0x121)+_0x1f2347+_0x3c7291(0x170),undefined,{'helpText':_0x3c7291(0x125)+_0x3c7291(0x110)+(_0x3c7291(0x160)+_0x1f2347+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x52fc39+'\x20--name\x20'+(_0x417421||_0x3c7291(0x154))+'\x20--profile\x20'+_0x41fb40)});_0x2ff3fa=_0x1f2347,console[_0x3c7291(0x103)](a4_0x2e7574[_0x3c7291(0x119)](_0x3c7291(0x168)+_0x1f2347));}}}}if(!_0x2ff3fa)return console[_0x3c7291(0x103)](a4_0x2e7574[_0x3c7291(0x166)](_0x3c7291(0x14e))),console[_0x3c7291(0x103)](_0x3c7291(0x11b)),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x3c7291(0x103)](_0x3c7291(0x109)),console[_0x3c7291(0x103)](_0x3c7291(0x19f)),0x1;if(!_0x417421)throw new SDKError(ErrorCode[_0x3c7291(0x10f)],_0x3c7291(0x107),undefined,{'helpText':_0x3c7291(0x175)});if(!_0xdc6bd3&&!_0x1d5852){if(!isInteractive())return console[_0x3c7291(0x174)](a4_0x2e7574[_0x3c7291(0x113)](_0x3c7291(0x187)),_0x3c7291(0x14b)),console[_0x3c7291(0x174)](a4_0x2e7574[_0x3c7291(0x119)](_0x3c7291(0x10c))),0x1;const _0x4b1a44=await confirmKey(_0x3c7291(0x147)+_0x2ff3fa+'\x22\x20to\x20new\x20project\x20\x22'+_0x417421+'\x22?');if(!_0x4b1a44)return console[_0x3c7291(0x103)](a4_0x2e7574[_0x3c7291(0x166)](_0x3c7291(0x165))),0x1;}const {data:_0xf3541}=await withSpinner('Cloning\x20\x22'+_0x2ff3fa+_0x3c7291(0x141)+_0x417421+_0x3c7291(0x198),()=>_0x1b3791[_0x3c7291(0x146)][_0x3c7291(0x106)](_0x2ff3fa,_0x417421,{'dryRun':_0x1d5852}));if(_0x1d5852)return console['log'](a4_0x2e7574[_0x3c7291(0x166)](_0x3c7291(0x11d))),console[_0x3c7291(0x103)](_0x3c7291(0x17d)+_0xf3541['sourceProjectName']),console[_0x3c7291(0x103)](_0x3c7291(0x17a)+_0x417421),console[_0x3c7291(0x103)](_0x3c7291(0x196)),console[_0x3c7291(0x103)]('\x20\x20Agents:\x20'+_0xf3541[_0x3c7291(0x18e)][_0x3c7291(0x155)][_0x3c7291(0x142)]),console['log'](_0x3c7291(0x143)+_0xf3541[_0x3c7291(0x18e)][_0x3c7291(0x15f)]['created']),console[_0x3c7291(0x103)](_0x3c7291(0x18b)+_0xf3541['counts'][_0x3c7291(0x195)][_0x3c7291(0x142)]),0x0;const _0x39fa68=_0xf3541[_0x3c7291(0x18e)][_0x3c7291(0x155)][_0x3c7291(0x199)]>0x0||_0xf3541['counts']['knowledgeBases'][_0x3c7291(0x199)]>0x0||_0xf3541[_0x3c7291(0x18e)][_0x3c7291(0x195)][_0x3c7291(0x199)]>0x0;_0x39fa68?console['log'](a4_0x2e7574[_0x3c7291(0x166)](_0x3c7291(0x145))):console[_0x3c7291(0x103)](a4_0x2e7574['green']('Project\x20cloned\x20successfully'));console[_0x3c7291(0x103)]('Source:\x20'+_0xf3541[_0x3c7291(0x16e)]),console[_0x3c7291(0x103)]('New\x20project:\x20'+_0xf3541['newProjectName']),console['log'](_0x3c7291(0xf9)+_0xf3541['newProjectId']),console[_0x3c7291(0x103)](),console[_0x3c7291(0x103)](_0x3c7291(0x19d)),console[_0x3c7291(0x103)]('\x20\x20Agents:\x20'+formatCountSummary(_0xf3541['counts'][_0x3c7291(0x155)])),console[_0x3c7291(0x103)](_0x3c7291(0x143)+formatCountSummary(_0xf3541[_0x3c7291(0x18e)][_0x3c7291(0x15f)])),console[_0x3c7291(0x103)](_0x3c7291(0x18b)+formatCountSummary(_0xf3541[_0x3c7291(0x18e)][_0x3c7291(0x195)])),console[_0x3c7291(0x103)](_0x3c7291(0x188)+formatCountSummary(_0xf3541[_0x3c7291(0x18e)][_0x3c7291(0x19e)]));if(_0x39fa68){console['log'](),console['log'](a4_0x2e7574[_0x3c7291(0x113)](_0x3c7291(0x14d)));for(const _0x36ebc4 of _0xf3541['agents']){_0x36ebc4['action']==='error'&&console[_0x3c7291(0x103)](a4_0x2e7574[_0x3c7291(0x113)](_0x3c7291(0xfc)+_0x36ebc4[_0x3c7291(0x150)]+_0x3c7291(0x127)+_0x36ebc4[_0x3c7291(0x174)]));}for(const _0x2bbf7e of _0xf3541[_0x3c7291(0x15f)]){_0x2bbf7e['action']===_0x3c7291(0x174)&&console[_0x3c7291(0x103)](a4_0x2e7574[_0x3c7291(0x113)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x2bbf7e['name']+'\x22:\x20'+_0x2bbf7e[_0x3c7291(0x174)]));}for(const _0x59a03e of _0xf3541['prompts']){_0x59a03e[_0x3c7291(0x122)]===_0x3c7291(0x174)&&console[_0x3c7291(0x103)](a4_0x2e7574[_0x3c7291(0x113)](_0x3c7291(0x148)+_0x59a03e[_0x3c7291(0x136)]+_0x3c7291(0x127)+_0x59a03e[_0x3c7291(0x174)]));}for(const _0x1da145 of _0xf3541[_0x3c7291(0x19e)]){_0x1da145[_0x3c7291(0x122)]===_0x3c7291(0x174)&&console[_0x3c7291(0x103)](a4_0x2e7574['red'](_0x3c7291(0x112)+_0x1da145[_0x3c7291(0x136)]+_0x3c7291(0x127)+_0x1da145[_0x3c7291(0x174)]));}return 0x1;}console[_0x3c7291(0x103)]();const _0x340da2=getLLMProjectUrl(_0x2c8c05,_0xf3541[_0x3c7291(0x12e)]);return console['log']('Project:\x20'+a4_0x2e7574[_0x3c7291(0x101)](_0x340da2)),0x0;}}function a4_0x3d59(_0x56a96b,_0x58d77b){_0x56a96b=_0x56a96b-0xf9;const _0x26f0e2=a4_0x26f0();let _0x3d59cf=_0x26f0e2[_0x56a96b];return _0x3d59cf;}export class AgentPushCommand extends BaseCommand{[a4_0x2a5b85(0x136)]=a4_0x2a5b85(0x17b);[a4_0x2a5b85(0xff)]=a4_0x2a5b85(0x186);async[a4_0x2a5b85(0x17c)](_0x421d99){const _0xd2ef18=a4_0x2a5b85,{options:_0x560625,args:_0x38f69d,tdx:_0x441de4}=_0x421d99;let _0x5e0ca9=_0x38f69d[0x0]||process[_0xd2ef18(0x185)]();const _0x8a086=_0x560625['dryRun'],_0x40508f=_0x560625[_0xd2ef18(0x149)],_0x4771fa=_0x560625['yes'],_0x4013ba=_0x560625[_0xd2ef18(0x15a)],_0x416924=a4_0x136171[_0xd2ef18(0x1a3)](_0x5e0ca9,_0xd2ef18(0x192)),_0x471c68=existsSync(_0x416924);if(_0x471c68){const {data:_0x39bc31}=await withSpinner(_0xd2ef18(0x12c)+_0x5e0ca9+'\x22...',()=>_0x441de4[_0xd2ef18(0x146)][_0xd2ef18(0x13c)](_0x5e0ca9,{'dryRun':_0x8a086,'force':_0x40508f}));if(_0x8a086)return console['log'](a4_0x2e7574[_0xd2ef18(0x166)](_0xd2ef18(0x11d))),console[_0xd2ef18(0x103)]('Would\x20push\x20agent:\x20'+_0x39bc31[_0xd2ef18(0x150)]),0x0;if(_0x39bc31[_0xd2ef18(0x122)]===_0xd2ef18(0x174))return console[_0xd2ef18(0x103)](a4_0x2e7574['red']('Failed\x20to\x20push\x20agent:\x20'+_0x39bc31[_0xd2ef18(0x174)])),0x1;console['log'](a4_0x2e7574[_0xd2ef18(0x15d)](_0xd2ef18(0x11c)+_0x39bc31[_0xd2ef18(0x122)]+'\x20successfully')),console['log'](_0xd2ef18(0x134)+_0x39bc31[_0xd2ef18(0x150)]);if(_0x39bc31[_0xd2ef18(0x178)]&&_0x39bc31[_0xd2ef18(0x176)]){const _0x32abdd=getLLMAgentChatUrl(_0x4013ba,_0x39bc31[_0xd2ef18(0x176)],_0x39bc31[_0xd2ef18(0x178)]);console[_0xd2ef18(0x103)]('Chat:\x20'+a4_0x2e7574['cyan'](_0x32abdd));}return 0x0;}const _0x4a5e59=_0x560625['llmProject'],_0x1cceec=resolveProjectFromContext(_0x5e0ca9,_0x4a5e59);if(_0x1cceec[_0xd2ef18(0x18a)])_0x5e0ca9=_0x1cceec[_0xd2ef18(0x133)],_0x1cceec[_0xd2ef18(0x180)]===_0xd2ef18(0x10e)&&console[_0xd2ef18(0x103)](a4_0x2e7574[_0xd2ef18(0x119)](_0xd2ef18(0x158)+_0x5e0ca9));else{let _0x2a0d37='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x1cceec['reason']==='no_local_folder'&&(_0x2a0d37=_0x1cceec[_0xd2ef18(0x18f)]+_0xd2ef18(0x117)+_0x1cceec[_0xd2ef18(0x120)]+_0xd2ef18(0x10d));throw new SDKError(ErrorCode[_0xd2ef18(0x12d)],_0x1cceec[_0xd2ef18(0x132)]===_0xd2ef18(0x11a)?_0x1cceec[_0xd2ef18(0x18f)]:'No\x20tdx.json\x20found\x20in\x20'+_0x5e0ca9,undefined,{'helpText':_0x2a0d37});}const {data:_0x463ddb}=await withSpinner(_0xd2ef18(0x139),()=>_0x441de4[_0xd2ef18(0x146)][_0xd2ef18(0x14c)](_0x5e0ca9,{'dryRun':!![]})),_0x20d7c1=_0x463ddb['counts'][_0xd2ef18(0x155)][_0xd2ef18(0x199)]>0x0;if(_0x20d7c1){console[_0xd2ef18(0x103)](a4_0x2e7574['red'](_0xd2ef18(0x169)));for(const _0x58e9d5 of _0x463ddb[_0xd2ef18(0x155)]){_0x58e9d5[_0xd2ef18(0x122)]==='error'&&console[_0xd2ef18(0x103)](a4_0x2e7574[_0xd2ef18(0x113)]('\x20\x20Agent\x20\x22'+_0x58e9d5[_0xd2ef18(0x150)]+_0xd2ef18(0x127)+_0x58e9d5['error']));}return 0x1;}const _0x5da6c3=_0x463ddb['counts'][_0xd2ef18(0x155)][_0xd2ef18(0x142)]+_0x463ddb[_0xd2ef18(0x18e)][_0xd2ef18(0x15f)][_0xd2ef18(0x142)]+_0x463ddb['counts'][_0xd2ef18(0xfa)]['created']+_0x463ddb['counts'][_0xd2ef18(0x195)][_0xd2ef18(0x142)]+_0x463ddb['counts'][_0xd2ef18(0x19e)][_0xd2ef18(0x142)],_0xc0018=_0x463ddb[_0xd2ef18(0x18e)][_0xd2ef18(0x155)][_0xd2ef18(0x108)]+_0x463ddb[_0xd2ef18(0x18e)][_0xd2ef18(0x15f)][_0xd2ef18(0x108)]+_0x463ddb[_0xd2ef18(0x18e)][_0xd2ef18(0xfa)][_0xd2ef18(0x108)]+_0x463ddb[_0xd2ef18(0x18e)][_0xd2ef18(0x195)]['updated']+_0x463ddb[_0xd2ef18(0x18e)][_0xd2ef18(0x19e)][_0xd2ef18(0x108)],_0x225fd9=_0x463ddb[_0xd2ef18(0x18e)][_0xd2ef18(0x155)][_0xd2ef18(0x18c)]+_0x463ddb[_0xd2ef18(0x18e)][_0xd2ef18(0x15f)][_0xd2ef18(0x18c)]+_0x463ddb['counts'][_0xd2ef18(0xfa)][_0xd2ef18(0x18c)]+_0x463ddb[_0xd2ef18(0x18e)]['prompts']['unchanged']+_0x463ddb[_0xd2ef18(0x18e)][_0xd2ef18(0x19e)][_0xd2ef18(0x18c)];console[_0xd2ef18(0x103)](_0xd2ef18(0x140)+_0x463ddb[_0xd2ef18(0x156)]+'\x27:'),console[_0xd2ef18(0x103)]('\x20\x20'+a4_0x2e7574[_0xd2ef18(0x15d)]('+\x20'+_0x5da6c3+_0xd2ef18(0x124))+_0xd2ef18(0x111)+a4_0x2e7574[_0xd2ef18(0x166)]('~\x20'+_0xc0018+_0xd2ef18(0x104))+_0xd2ef18(0x111)+a4_0x2e7574['dim']('=\x20'+_0x225fd9+_0xd2ef18(0xfd))),console['log'](_0xd2ef18(0x19a)+formatCountSummary(_0x463ddb['counts'][_0xd2ef18(0x155)])),console[_0xd2ef18(0x103)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x463ddb[_0xd2ef18(0x18e)][_0xd2ef18(0x15f)])),console[_0xd2ef18(0x103)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x463ddb[_0xd2ef18(0x18e)][_0xd2ef18(0xfa)])),console[_0xd2ef18(0x103)](_0xd2ef18(0x18b)+formatCountSummary(_0x463ddb[_0xd2ef18(0x18e)]['prompts'])),console[_0xd2ef18(0x103)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x463ddb[_0xd2ef18(0x18e)][_0xd2ef18(0x19e)])),console[_0xd2ef18(0x103)](_0xd2ef18(0x138)+a4_0x2e7574[_0xd2ef18(0x101)](_0x5e0ca9)),displayDiffs(_0x463ddb[_0xd2ef18(0x155)],_0x463ddb[_0xd2ef18(0x15f)],_0x463ddb[_0xd2ef18(0xfa)],_0x463ddb['prompts'],_0x463ddb[_0xd2ef18(0x19e)]);if(_0x8a086)return console[_0xd2ef18(0x103)](a4_0x2e7574[_0xd2ef18(0x166)](_0xd2ef18(0x15c))),0x0;if(_0x5da6c3===0x0&&_0xc0018===0x0){console[_0xd2ef18(0x103)](a4_0x2e7574[_0xd2ef18(0x15d)](_0xd2ef18(0x114)));const _0xa7c291=getLLMProjectUrl(_0x4013ba,_0x463ddb[_0xd2ef18(0x176)]);return console[_0xd2ef18(0x103)](_0xd2ef18(0x13b)+a4_0x2e7574[_0xd2ef18(0x101)](_0xa7c291)),0x0;}if(!_0x4771fa&&!_0x40508f){if(!isInteractive())return console[_0xd2ef18(0x174)](a4_0x2e7574[_0xd2ef18(0x113)](_0xd2ef18(0x187)),_0xd2ef18(0x14b)),console[_0xd2ef18(0x174)](a4_0x2e7574[_0xd2ef18(0x119)](_0xd2ef18(0x10c))),0x1;const _0x30a4ab=await confirmKey(_0xd2ef18(0x12f)+(_0x5da6c3+_0xc0018)+'\x20resources?');if(!_0x30a4ab)return console['log'](a4_0x2e7574[_0xd2ef18(0x166)]('Cancelled'),_0xd2ef18(0x16f)),0x1;}const {data:_0x3392de}=await withSpinner(_0xd2ef18(0x123),()=>_0x441de4[_0xd2ef18(0x146)][_0xd2ef18(0x14c)](_0x5e0ca9,{'force':_0x40508f})),_0x27281c=_0x3392de[_0xd2ef18(0x18e)]['agents'][_0xd2ef18(0x199)]>0x0||_0x3392de[_0xd2ef18(0x18e)][_0xd2ef18(0x15f)][_0xd2ef18(0x199)]>0x0||_0x3392de['counts']['textKnowledgeBases'][_0xd2ef18(0x199)]>0x0||_0x3392de[_0xd2ef18(0x18e)][_0xd2ef18(0x195)][_0xd2ef18(0x199)]>0x0;if(_0x27281c){console['log'](a4_0x2e7574[_0xd2ef18(0x166)](_0xd2ef18(0x179))),console[_0xd2ef18(0x103)](),console[_0xd2ef18(0x103)](a4_0x2e7574[_0xd2ef18(0x113)](_0xd2ef18(0x14d)));for(const _0x54443b of _0x3392de[_0xd2ef18(0x155)]){_0x54443b['action']===_0xd2ef18(0x174)&&console['log'](a4_0x2e7574[_0xd2ef18(0x113)](_0xd2ef18(0xfc)+_0x54443b[_0xd2ef18(0x150)]+'\x22:\x20'+_0x54443b[_0xd2ef18(0x174)]));}for(const _0x1461e6 of _0x3392de['knowledgeBases']){_0x1461e6[_0xd2ef18(0x122)]===_0xd2ef18(0x174)&&console[_0xd2ef18(0x103)](a4_0x2e7574['red'](_0xd2ef18(0x126)+_0x1461e6['name']+_0xd2ef18(0x127)+_0x1461e6['error']));}for(const _0x1f4260 of _0x3392de['textKnowledgeBases']){_0x1f4260[_0xd2ef18(0x122)]===_0xd2ef18(0x174)&&console[_0xd2ef18(0x103)](a4_0x2e7574[_0xd2ef18(0x113)](_0xd2ef18(0x14a)+_0x1f4260[_0xd2ef18(0x136)]+'\x22:\x20'+_0x1f4260[_0xd2ef18(0x174)]));}for(const _0xb45035 of _0x3392de[_0xd2ef18(0x195)]){_0xb45035[_0xd2ef18(0x122)]===_0xd2ef18(0x174)&&console[_0xd2ef18(0x103)](a4_0x2e7574[_0xd2ef18(0x113)](_0xd2ef18(0x148)+_0xb45035[_0xd2ef18(0x136)]+_0xd2ef18(0x127)+_0xb45035['error']));}for(const _0x5e44eb of _0x3392de['integrations']){_0x5e44eb[_0xd2ef18(0x122)]===_0xd2ef18(0x174)&&console['log'](a4_0x2e7574[_0xd2ef18(0x113)](_0xd2ef18(0x112)+_0x5e44eb[_0xd2ef18(0x136)]+'\x22:\x20'+_0x5e44eb[_0xd2ef18(0x174)]));}return 0x1;}console[_0xd2ef18(0x103)](a4_0x2e7574['green'](_0xd2ef18(0x102)+(_0x5da6c3+_0xc0018)+_0xd2ef18(0x130)+_0x3392de[_0xd2ef18(0x156)]+'\x27'));const _0x21241c=getLLMProjectUrl(_0x4013ba,_0x3392de[_0xd2ef18(0x176)]);return console[_0xd2ef18(0x103)](_0xd2ef18(0x13b)+a4_0x2e7574[_0xd2ef18(0x101)](_0x21241c)),0x0;}}
@@ -1 +1 @@
1
- function a5_0x3c3e(){const _0x584337=['includes','testYmlPath','...','Cached\x20run\x20from:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','\x20\x20Round\x20','Evaluating\x20response...','multiple_agents','forEach','Round\x201/','trim','length','No\x20tests\x20found\x20with\x20tags:\x20','has','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Running\x20test:\x20','eval','Available\x20tags:\x20','white','\x20\x20Agent:\x20','Re-evaluating\x20cached\x20test\x20run...','298470tTQozd','Re-evaluation\x20Summary','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','tags','jsonl','⚠\x20SKIPPED:\x20','tsv','Test\x20Summary','log','text','utf-8','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Executing\x20new\x20tests...','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','PASS','1512151HNsAIP','red','Site:\x20','context','description','Test\x20','Running\x20agent\x20tests...','Project\x20path:\x20','filter','agent','✗\x20FAIL:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','...\x20','agent:test','Using\x20agent:\x20','Duration:\x20','no_local_folder','404','agentDirs','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','testName','Re-evaluating\x20','projectDir','repeat','16005438REciwZ','6158344sQeBQy','Either\x20switch\x20to\x20the\x20\x22','map','Errors:\x20\x20\x20','tests','Output\x20written\x20to:\x20','conversations','\x20(new)','10255230hzoKCd','Passed:\x20\x20\x20','✓\x20PASS:\x20','executeReeval','resolveProjectId','\x20\x20-\x20','site','llm','substring','agentName',':\x20Sending\x20user\x20input...','\x20(cached)','not\x20found','stop','Failed\x20Tests:','toLowerCase','verbose','12351fFRTtc','push','resolveAgentId','reeval','Run\x20\x27tdx\x20agent\x20pull\x20','rounds','status','toISOString','Re-evaluating...','\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','No\x20tests\x20have\x20tags\x20defined.','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','✗\x20ERROR:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','join','add','reason','round','\x22:\x20','size','Total:\x20\x20\x20\x20','existsSync','json','yellow','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','message','\x20\x20Site:\x20','Available\x20tests:\x20','262yhKIHh','cyan','green','2735720lceVub','\x20\x20Conversation:\x20','dim','25xlUpfx','conversation_url','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','start','some','projectName','Tests\x20found:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Failed:\x20\x20\x20','execute','/<agent-name>','llmProject','table','timestamp','\x20-\x20','now','split','name','Error:\x20No\x20previous\x20test\x20run\x20found.','Round\x20','Test\x20Configuration:','\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)','Conversation\x20URL:\x20','FAIL','No\x20tests\x20found\x20matching:\x20','ERROR','Run\x20tests\x20for\x20an\x20LLM\x20agent','7AGKWFb'];a5_0x3c3e=function(){return _0x584337;};return a5_0x3c3e();}const a5_0x152697=a5_0x39ef;function a5_0x39ef(_0x12b592,_0x379e92){_0x12b592=_0x12b592-0x12a;const _0x3c3e7a=a5_0x3c3e();let _0x39ef4b=_0x3c3e7a[_0x12b592];return _0x39ef4b;}(function(_0x3485db,_0xc905ff){const _0x2f94df=a5_0x39ef,_0x505679=_0x3485db();while(!![]){try{const _0x279c22=parseInt(_0x2f94df(0x18e))/0x1+parseInt(_0x2f94df(0x147))/0x2*(parseInt(_0x2f94df(0x12a))/0x3)+parseInt(_0x2f94df(0x14a))/0x4+-parseInt(_0x2f94df(0x14d))/0x5*(-parseInt(_0x2f94df(0x17e))/0x6)+-parseInt(_0x2f94df(0x168))/0x7*(-parseInt(_0x2f94df(0x1a7))/0x8)+-parseInt(_0x2f94df(0x1a6))/0x9+-parseInt(_0x2f94df(0x1af))/0xa;if(_0x279c22===_0xc905ff)break;else _0x505679['push'](_0x505679['shift']());}catch(_0x241ac0){_0x505679['push'](_0x505679['shift']());}}}(a5_0x3c3e,0xe7f05));import*as a5_0x4e0322 from'node:fs';import*as a5_0xb1ada0 from'node:path';import a5_0x67163 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x152697(0x15e)]=a5_0x152697(0x19b);[a5_0x152697(0x192)]=a5_0x152697(0x167);async[a5_0x152697(0x156)](_0xe64d7){const _0x23a13f=a5_0x152697,{options:_0x26ace4,args:_0x1f2dbc,tdx:_0x20a0d7}=_0xe64d7,_0x3736a0=_0x1f2dbc[0x0]||'.',_0x5babca=_0x26ace4['dryRun'],_0x438c55=_0x26ace4,_0xfe680f=_0x438c55[_0x23a13f(0x179)]===![],_0x2aaf68=_0x438c55[_0x23a13f(0x12d)],_0x369ba6=_0x438c55[_0x23a13f(0x15e)],_0x46085a=_0x438c55['tags'],_0x55f205=_0x26ace4[_0x23a13f(0x1b5)],_0x3e7613=_0x438c55['output'];if(_0x2aaf68&&_0xfe680f)return console['log'](a5_0x67163[_0x23a13f(0x18f)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x503587=_0x23a13f(0x159);if(_0x438c55[_0x23a13f(0x141)])_0x503587='json';else{if(_0x438c55[_0x23a13f(0x182)])_0x503587=_0x23a13f(0x182);else{if(_0x438c55[_0x23a13f(0x184)])_0x503587=_0x23a13f(0x184);else{if(_0x438c55[_0x23a13f(0x159)])_0x503587=_0x23a13f(0x159);}}}const _0x2f9562=_0x438c55['llmProject'];let _0x3491da=_0x3736a0;const _0x304c3f=a5_0x4e0322[_0x23a13f(0x140)](_0x3736a0),_0x21a754=_0x3736a0==='.';if(!_0x304c3f||_0x21a754){const _0x108b1c=resolveProjectFromContext(_0x3736a0,_0x2f9562,{'requireFile':'test.yml'});if(_0x108b1c['found'])_0x3491da=_0x108b1c[_0x23a13f(0x1a4)],_0x108b1c['source']===_0x23a13f(0x191)&&console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x14c)](_0x23a13f(0x19c)+_0x3491da));else switch(_0x108b1c[_0x23a13f(0x13b)]){case'no_context':console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x142)](_0x108b1c[_0x23a13f(0x144)])),console[_0x23a13f(0x186)](),console['log']('Usage:'),console['log'](_0x23a13f(0x133)),console['log'](_0x23a13f(0x162)),console[_0x23a13f(0x186)](),console[_0x23a13f(0x186)](_0x23a13f(0x199));return 0x1;case _0x23a13f(0x19e):console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x142)](_0x108b1c[_0x23a13f(0x144)])),console[_0x23a13f(0x186)](),console[_0x23a13f(0x186)](_0x23a13f(0x12e)+_0x108b1c[_0x23a13f(0x158)]+_0x23a13f(0x18b));return 0x1;case _0x23a13f(0x170):{const _0x1f7e8c=a5_0xb1ada0['basename'](_0x108b1c[_0x23a13f(0x1a4)]);console['log'](a5_0x67163[_0x23a13f(0x142)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x108b1c[_0x23a13f(0x158)]+'\x22:'));for(const _0x34bcaa of _0x108b1c[_0x23a13f(0x1a0)]){console[_0x23a13f(0x186)](_0x23a13f(0x1b4)+_0x34bcaa);}return console[_0x23a13f(0x186)](),console['log'](_0x23a13f(0x189)+_0x1f7e8c+_0x23a13f(0x157)),0x1;}case'no_tests':console['log'](a5_0x67163[_0x23a13f(0x142)](_0x23a13f(0x14f)+_0x108b1c[_0x23a13f(0x158)]+'\x22.')),console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x14c)](_0x23a13f(0x195)+_0x108b1c['projectDir'])),console[_0x23a13f(0x186)](),console[_0x23a13f(0x186)](_0x23a13f(0x177));return 0x1;}}const {definition:_0x35e658,agentInfo:_0x20b001}=parseTestFile(_0x3491da);let _0x5a61b3=_0x35e658[_0x23a13f(0x1ab)];if(_0x369ba6){const _0x5b74ab=_0x369ba6['split'](',')[_0x23a13f(0x1a9)](_0x20e908=>_0x20e908[_0x23a13f(0x173)]());_0x5a61b3=_0x35e658[_0x23a13f(0x1ab)][_0x23a13f(0x196)](_0x327c2c=>_0x5b74ab['includes'](_0x327c2c[_0x23a13f(0x15e)]));if(_0x5a61b3[_0x23a13f(0x174)]===0x0)return console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x142)](_0x23a13f(0x165)+_0x369ba6)),console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x14c)](_0x23a13f(0x146)+_0x35e658[_0x23a13f(0x1ab)][_0x23a13f(0x1a9)](_0x47fe37=>_0x47fe37[_0x23a13f(0x15e)])[_0x23a13f(0x139)](',\x20'))),0x1;}if(_0x46085a){const _0x2f797d=_0x46085a[_0x23a13f(0x15d)](',')[_0x23a13f(0x1a9)](_0x492f79=>_0x492f79[_0x23a13f(0x173)]()[_0x23a13f(0x1be)]());_0x5a61b3=_0x5a61b3[_0x23a13f(0x196)](_0x16dfc3=>_0x16dfc3[_0x23a13f(0x181)]?.[_0x23a13f(0x151)](_0x4f7835=>_0x2f797d[_0x23a13f(0x169)](_0x4f7835[_0x23a13f(0x1be)]())));if(_0x5a61b3[_0x23a13f(0x174)]===0x0){console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x142)](_0x23a13f(0x175)+_0x46085a));const _0x444a22=new Set();return _0x35e658[_0x23a13f(0x1ab)][_0x23a13f(0x171)](_0x33b8a2=>_0x33b8a2[_0x23a13f(0x181)]?.['forEach'](_0x2df9a9=>_0x444a22[_0x23a13f(0x13a)](_0x2df9a9))),_0x444a22[_0x23a13f(0x13e)]>0x0?console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x14c)](_0x23a13f(0x17a)+[..._0x444a22][_0x23a13f(0x139)](',\x20'))):console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x14c)](_0x23a13f(0x135))),0x1;}}if(_0x2aaf68)return this[_0x23a13f(0x1b2)](_0xe64d7,{'definition':{'tests':_0x5a61b3},'agentInfo':_0x20b001,'outputFormat':_0x503587,'outputFile':_0x3e7613,'testNames':_0x369ba6});if(_0x5babca){console[_0x23a13f(0x186)](a5_0x67163['cyan'](_0x23a13f(0x161))),console[_0x23a13f(0x186)](_0x23a13f(0x145)+a5_0x67163[_0x23a13f(0x17b)](_0x55f205)),console[_0x23a13f(0x186)]('\x20\x20Project:\x20'+a5_0x67163[_0x23a13f(0x17b)](_0x20b001[_0x23a13f(0x152)])),console[_0x23a13f(0x186)](_0x23a13f(0x17c)+a5_0x67163[_0x23a13f(0x17b)](_0x20b001[_0x23a13f(0x1b8)])),console['log'](),console[_0x23a13f(0x186)](_0x23a13f(0x153)+a5_0x67163[_0x23a13f(0x17b)](_0x5a61b3['length']));for(let _0x470593=0x0;_0x470593<_0x5a61b3[_0x23a13f(0x174)];_0x470593++){const _0x5dabce=_0x5a61b3[_0x470593],_0x49963c=_0x5dabce[_0x23a13f(0x12f)][_0x23a13f(0x174)]===0x1?_0x23a13f(0x13c):_0x23a13f(0x12f),_0x132259=_0x5dabce['tags']?.[_0x23a13f(0x174)]?'\x20['+_0x5dabce[_0x23a13f(0x181)][_0x23a13f(0x139)](',\x20')+']':'';console[_0x23a13f(0x186)]('\x20\x20'+(_0x470593+0x1)+'.\x20'+a5_0x67163[_0x23a13f(0x17b)](_0x5dabce[_0x23a13f(0x15e)])+'\x20('+_0x5dabce['rounds'][_0x23a13f(0x174)]+'\x20'+_0x49963c+')'+a5_0x67163[_0x23a13f(0x14c)](_0x132259));}return 0x0;}let _0x297b0c,_0x3e02bc;try{_0x297b0c=await _0x20a0d7['llm'][_0x23a13f(0x1b3)](_0x20b001[_0x23a13f(0x152)]);}catch(_0x5a7497){const _0x2d9782=_0x5a7497 instanceof Error?_0x5a7497[_0x23a13f(0x144)]:String(_0x5a7497);return _0x2d9782[_0x23a13f(0x169)](_0x23a13f(0x19f))||_0x2d9782[_0x23a13f(0x1be)]()['includes'](_0x23a13f(0x1bb))?console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x18f)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x20b001[_0x23a13f(0x152)])):console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x18f)](_0x23a13f(0x16d)+_0x20b001['projectName']+_0x23a13f(0x13d)+_0x2d9782)),0x1;}try{_0x3e02bc=await _0x20a0d7[_0x23a13f(0x1b6)][_0x23a13f(0x12c)](_0x20b001[_0x23a13f(0x1b8)],_0x297b0c);}catch(_0x58790a){const _0x2526c7=_0x58790a instanceof Error?_0x58790a[_0x23a13f(0x144)]:String(_0x58790a);return _0x2526c7[_0x23a13f(0x169)](_0x23a13f(0x19f))||_0x2526c7['toLowerCase']()[_0x23a13f(0x169)](_0x23a13f(0x1bb))?console[_0x23a13f(0x186)](a5_0x67163['red'](_0x23a13f(0x143)+_0x20b001[_0x23a13f(0x1b8)])):console[_0x23a13f(0x186)](a5_0x67163['red'](_0x23a13f(0x138)+_0x20b001[_0x23a13f(0x1b8)]+'\x22:\x20'+_0x2526c7)),0x1;}let _0x53d768;if(!_0xfe680f)try{_0x53d768=await setupEvaluatorAgent(_0x20a0d7[_0x23a13f(0x1b6)],_0x26ace4['verbose']);}catch(_0x4d8ccf){const _0x3091bc=_0x4d8ccf instanceof Error?_0x4d8ccf[_0x23a13f(0x144)]:String(_0x4d8ccf);return console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x18f)](_0x23a13f(0x180)+_0x3091bc)),0x1;}console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x148)](_0x23a13f(0x194))),console[_0x23a13f(0x186)](_0x23a13f(0x190)+a5_0x67163['white'](_0x55f205)),console[_0x23a13f(0x186)](_0x23a13f(0x134)+a5_0x67163[_0x23a13f(0x17b)](_0x20b001['projectName']+'/'+_0x20b001[_0x23a13f(0x1b8)])),console['log']();const _0x44e960=[],_0x4b9b9b=[],_0x2bb73c=Date[_0x23a13f(0x15c)]();for(let _0x1f2f80=0x0;_0x1f2f80<_0x5a61b3['length'];_0x1f2f80++){const _0x1001f0=_0x5a61b3[_0x1f2f80];_0x5a61b3[_0x23a13f(0x174)]>0x1?console[_0x23a13f(0x186)](_0x23a13f(0x193)+(_0x1f2f80+0x1)+'/'+_0x5a61b3[_0x23a13f(0x174)]+':\x20'+a5_0x67163[_0x23a13f(0x17b)](_0x1001f0[_0x23a13f(0x15e)])):console[_0x23a13f(0x186)](_0x23a13f(0x178)+a5_0x67163[_0x23a13f(0x17b)](_0x1001f0[_0x23a13f(0x15e)]));const _0x2de066=createCommandSpinner(_0x23a13f(0x172)+_0x1001f0['rounds'][_0x23a13f(0x174)]+_0x23a13f(0x1b9));_0x2de066[_0x23a13f(0x150)]();try{const {result:_0x1e682b,conversation:_0x49f206}=await runTest(_0x20a0d7[_0x23a13f(0x1b6)],_0x1001f0,{'agentId':_0x3e02bc,'projectId':_0x297b0c,'site':_0x55f205,'noEval':_0xfe680f,'evaluatorId':_0x53d768,'onRoundStart':(_0x12a3bb,_0x834ac6)=>{const _0x2966b1=_0x23a13f;_0x2de066[_0x2966b1(0x187)]='Round\x20'+(_0x12a3bb+0x1)+'/'+_0x834ac6+_0x2966b1(0x1b9);},'onRoundComplete':(_0x128ab5,_0x232ec9,_0x387ef1)=>{const _0x224012=_0x23a13f,_0x124b6c=formatElapsed(_0x232ec9);_0x387ef1?console[_0x224012(0x186)]('\x20\x20Round\x20'+(_0x128ab5+0x1)+'/'+_0x1001f0[_0x224012(0x12f)]['length']+_0x224012(0x19a)+a5_0x67163[_0x224012(0x149)]('✓')+'\x20('+_0x124b6c+')'):console[_0x224012(0x186)](_0x224012(0x16e)+(_0x128ab5+0x1)+'/'+_0x1001f0[_0x224012(0x12f)]['length']+_0x224012(0x19a)+a5_0x67163[_0x224012(0x18f)]('✗'));},'onEvaluationStart':()=>{const _0x198c68=_0x23a13f;_0x2de066[_0x198c68(0x187)]='Evaluating\x20response...';},'onEvaluationComplete':_0x3956ba=>{const _0xc3847c=_0x23a13f,_0x3ac18e=formatElapsed(_0x3956ba);console['log']('\x20\x20Evaluating...\x20'+a5_0x67163[_0xc3847c(0x149)]('✓')+'\x20('+_0x3ac18e+')');}});_0x2de066[_0x23a13f(0x1bc)](),_0x44e960[_0x23a13f(0x12b)](_0x1e682b),_0x4b9b9b[_0x23a13f(0x12b)](_0x49f206);if(_0x1e682b[_0x23a13f(0x130)]===_0x23a13f(0x18d))console['log'](a5_0x67163[_0x23a13f(0x149)](_0x23a13f(0x1b1)+_0x1e682b[_0x23a13f(0x13b)]));else _0x1e682b['status']===_0x23a13f(0x164)?console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x18f)](_0x23a13f(0x198)+_0x1e682b[_0x23a13f(0x13b)])):console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x18f)](_0x23a13f(0x137)+_0x1e682b[_0x23a13f(0x13b)]));_0x1e682b[_0x23a13f(0x14e)]&&console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x14c)](_0x23a13f(0x163)+_0x1e682b[_0x23a13f(0x14e)])),console[_0x23a13f(0x186)]();}catch(_0x260652){_0x2de066['stop']();const _0x460d2d=_0x260652 instanceof Error?_0x260652['message']:String(_0x260652);console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x18f)](_0x23a13f(0x137)+_0x460d2d)),console[_0x23a13f(0x186)](),_0x44e960[_0x23a13f(0x12b)]({'name':_0x1001f0[_0x23a13f(0x15e)],'status':_0x23a13f(0x166),'reason':_0x460d2d,'timestamp':new Date()[_0x23a13f(0x131)](),'duration_ms':0x0});}}const _0x43d7cb=Date[_0x23a13f(0x15c)]()-_0x2bb73c,_0x1c75dc=_0x44e960[_0x23a13f(0x196)](_0x798d0=>_0x798d0['status']===_0x23a13f(0x18d))[_0x23a13f(0x174)],_0x481829=_0x44e960['filter'](_0x2a8460=>_0x2a8460[_0x23a13f(0x130)]===_0x23a13f(0x164))['length'],_0x3a3297=_0x44e960[_0x23a13f(0x196)](_0x26eed4=>_0x26eed4['status']===_0x23a13f(0x166))[_0x23a13f(0x174)];console['log']('━'[_0x23a13f(0x1a5)](0x3c)),console[_0x23a13f(0x186)](_0x23a13f(0x185)),console[_0x23a13f(0x186)]('━'[_0x23a13f(0x1a5)](0x3c)),console[_0x23a13f(0x186)](_0x23a13f(0x13f)+_0x44e960[_0x23a13f(0x174)]),console[_0x23a13f(0x186)](_0x23a13f(0x1b0)+a5_0x67163[_0x23a13f(0x149)](_0x1c75dc)),console[_0x23a13f(0x186)](_0x23a13f(0x155)+a5_0x67163[_0x23a13f(0x18f)](_0x481829));_0x3a3297>0x0&&console[_0x23a13f(0x186)](_0x23a13f(0x1aa)+a5_0x67163[_0x23a13f(0x18f)](_0x3a3297));console['log'](_0x23a13f(0x19d)+formatElapsed(_0x43d7cb)),console[_0x23a13f(0x186)]('━'[_0x23a13f(0x1a5)](0x3c));const _0x553149=_0x44e960[_0x23a13f(0x196)](_0x455760=>_0x455760[_0x23a13f(0x130)]!==_0x23a13f(0x18d));if(_0x553149['length']>0x0){console['log'](),console['log'](_0x23a13f(0x1bd));for(const _0x235609 of _0x553149){const _0x16534a=a5_0x67163[_0x23a13f(0x18f)]('✗'),_0x125eea=_0x235609[_0x23a13f(0x13b)]['length']>0x32?_0x235609[_0x23a13f(0x13b)][_0x23a13f(0x1b7)](0x0,0x32)+_0x23a13f(0x16b):_0x235609[_0x23a13f(0x13b)];console[_0x23a13f(0x186)]('\x20\x20'+_0x16534a+'\x20'+_0x235609[_0x23a13f(0x15e)]+':\x20'+_0x125eea);}}const _0x37e630={'summary':{'total':_0x44e960['length'],'passed':_0x1c75dc,'failed':_0x481829,'errors':_0x3a3297>0x0?_0x3a3297:undefined,'duration_ms':_0x43d7cb},'tests':_0x44e960,'agent':{'project':_0x20b001['projectName'],'name':_0x20b001[_0x23a13f(0x1b8)],'site':_0x55f205},'timestamp':new Date(_0x2bb73c)[_0x23a13f(0x131)]()};try{const _0x50eb63=buildCachedTestRun(_0x4b9b9b,{'site':_0x55f205,'projectId':_0x297b0c,'projectName':_0x20b001[_0x23a13f(0x152)],'agentId':_0x3e02bc,'agentName':_0x20b001[_0x23a13f(0x1b8)],'testYmlPath':a5_0xb1ada0['resolve'](_0x20b001[_0x23a13f(0x16a)])});saveLastTestRun(_0x50eb63);}catch{}if(_0x503587!=='table'||_0x3e7613){const _0x5b5e7b=formatResults(_0x37e630,_0x503587);if(_0x3e7613)try{a5_0x4e0322['writeFileSync'](_0x3e7613,_0x5b5e7b,_0x23a13f(0x188)),console[_0x23a13f(0x186)](),console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x14c)](_0x23a13f(0x1ac)+_0x3e7613));}catch(_0x3b2231){return console[_0x23a13f(0x186)](),console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x18f)]('Error\x20writing\x20output\x20file:\x20'+_0x3b2231)),0x1;}else console[_0x23a13f(0x186)](),console['log'](_0x5b5e7b);}return _0x553149[_0x23a13f(0x174)]>0x0?0x1:0x0;}async[a5_0x152697(0x1b2)](_0x3bec32,_0x4fbe34){const _0x56db38=a5_0x152697,{options:_0x2396ad,tdx:_0x452baa}=_0x3bec32,{definition:_0x257f1b,agentInfo:_0x38bda8,outputFormat:_0x1e528d,outputFile:_0x440fc0}=_0x4fbe34,_0x4312d6=_0x2396ad[_0x56db38(0x1b5)],_0x93dc12=loadLastTestRun();if(!_0x93dc12)return console['log'](a5_0x67163[_0x56db38(0x18f)](_0x56db38(0x15f))),console['log'](a5_0x67163[_0x56db38(0x14c)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x93dc12[_0x56db38(0x197)][_0x56db38(0x1b8)]!==_0x38bda8[_0x56db38(0x1b8)])return console[_0x56db38(0x186)](a5_0x67163[_0x56db38(0x18f)](_0x56db38(0x1a1)+_0x93dc12['agent'][_0x56db38(0x1b8)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x38bda8[_0x56db38(0x1b8)]+'\x22.')),console[_0x56db38(0x186)](a5_0x67163['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x857666=new Set(_0x93dc12[_0x56db38(0x1ad)][_0x56db38(0x1a9)](_0x29a06d=>_0x29a06d[_0x56db38(0x1a2)])),_0x3239e2=_0x257f1b['tests'][_0x56db38(0x196)](_0x5ac566=>!_0x857666['has'](_0x5ac566[_0x56db38(0x15e)]));if(_0x3239e2[_0x56db38(0x174)]>0x0&&_0x93dc12[_0x56db38(0x1b5)]!==_0x4312d6)return console['log'](a5_0x67163['red'](_0x56db38(0x154))),console[_0x56db38(0x186)](a5_0x67163[_0x56db38(0x14c)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x93dc12[_0x56db38(0x1b5)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x4312d6+'\x22.')),console[_0x56db38(0x186)](a5_0x67163[_0x56db38(0x14c)](_0x56db38(0x1a8)+_0x93dc12[_0x56db38(0x1b5)]+_0x56db38(0x18c))),0x1;const _0x3cea51=_0x257f1b[_0x56db38(0x1ab)][_0x56db38(0x196)](_0x1a9b9a=>_0x857666[_0x56db38(0x176)](_0x1a9b9a['name'])),_0x447d75=_0x3239e2;let _0x535f25;try{_0x535f25=await setupEvaluatorAgent(_0x452baa['llm'],_0x2396ad[_0x56db38(0x1bf)]);}catch(_0x56bf90){const _0x1c7bce=_0x56bf90 instanceof Error?_0x56bf90[_0x56db38(0x144)]:String(_0x56bf90);return console[_0x56db38(0x186)](a5_0x67163[_0x56db38(0x18f)](_0x56db38(0x180)+_0x1c7bce)),0x1;}console[_0x56db38(0x186)](a5_0x67163[_0x56db38(0x148)](_0x56db38(0x17d))),console['log'](_0x56db38(0x16c)+a5_0x67163[_0x56db38(0x17b)](_0x93dc12[_0x56db38(0x15a)])),console[_0x56db38(0x186)](_0x56db38(0x134)+a5_0x67163[_0x56db38(0x17b)](_0x93dc12[_0x56db38(0x197)][_0x56db38(0x152)]+'/'+_0x93dc12[_0x56db38(0x197)][_0x56db38(0x1b8)]));_0x447d75[_0x56db38(0x174)]>0x0&&console[_0x56db38(0x186)]('New\x20tests\x20to\x20execute:\x20'+a5_0x67163[_0x56db38(0x142)](_0x447d75[_0x56db38(0x174)]));console[_0x56db38(0x186)]();const _0x13e0af=[],_0x4e9546=Date[_0x56db38(0x15c)](),_0x4a6dda=createCommandSpinner(_0x56db38(0x132));if(_0x3cea51[_0x56db38(0x174)]>0x0)try{const _0x27fa53=await reevaluateFromCache(_0x452baa['llm'],_0x93dc12,{'tests':_0x3cea51},{'evaluatorId':_0x535f25,'onTestStart':(_0x4b941a,_0x1ac591,_0x786483)=>{const _0x4077cb=_0x56db38;_0x4a6dda[_0x4077cb(0x187)]=_0x4077cb(0x1a3)+(_0x1ac591+0x1)+'/'+_0x786483+':\x20'+_0x4b941a+_0x4077cb(0x16b);if(!_0x4a6dda['isSpinning'])_0x4a6dda[_0x4077cb(0x150)]();},'onTestComplete':(_0x2dff18,_0x52cf11)=>{const _0x269a79=_0x56db38;_0x4a6dda['stop']();if(_0x52cf11[_0x269a79(0x130)]===_0x269a79(0x18d))console[_0x269a79(0x186)](a5_0x67163['green'](_0x269a79(0x1b1)+_0x2dff18)+a5_0x67163[_0x269a79(0x14c)]('\x20(cached)'));else _0x52cf11[_0x269a79(0x130)]===_0x269a79(0x164)?console[_0x269a79(0x186)](a5_0x67163[_0x269a79(0x18f)](_0x269a79(0x198)+_0x2dff18+_0x269a79(0x15b)+_0x52cf11[_0x269a79(0x13b)])+a5_0x67163['dim'](_0x269a79(0x1ba))):console[_0x269a79(0x186)](a5_0x67163[_0x269a79(0x18f)](_0x269a79(0x137)+_0x2dff18+_0x269a79(0x15b)+_0x52cf11[_0x269a79(0x13b)]));_0x52cf11['conversation_url']&&console[_0x269a79(0x186)](a5_0x67163[_0x269a79(0x14c)](_0x269a79(0x14b)+_0x52cf11[_0x269a79(0x14e)])),_0x13e0af[_0x269a79(0x12b)](_0x52cf11);},'onTestSkipped':(_0x45f926,_0x4ac749)=>{const _0x2d3f2b=_0x56db38;_0x4a6dda['stop'](),console[_0x2d3f2b(0x186)](a5_0x67163[_0x2d3f2b(0x142)](_0x2d3f2b(0x183)+_0x45f926+_0x2d3f2b(0x15b)+_0x4ac749));}});for(const _0x2cf925 of _0x27fa53){!_0x13e0af['find'](_0xb8e71f=>_0xb8e71f[_0x56db38(0x15e)]===_0x2cf925[_0x56db38(0x15e)])&&_0x13e0af[_0x56db38(0x12b)](_0x2cf925);}}catch(_0x20b6cb){_0x4a6dda[_0x56db38(0x1bc)]();const _0x5dbd16=_0x20b6cb instanceof Error?_0x20b6cb[_0x56db38(0x144)]:String(_0x20b6cb);return console[_0x56db38(0x186)](a5_0x67163[_0x56db38(0x18f)](_0x56db38(0x136)+_0x5dbd16)),0x1;}_0x4a6dda[_0x56db38(0x1bc)]();if(_0x447d75[_0x56db38(0x174)]>0x0){console[_0x56db38(0x186)](),console[_0x56db38(0x186)](a5_0x67163['cyan'](_0x56db38(0x18a)));const {projectId:_0xbc0b6b,agentId:_0x1e0fa9}=_0x93dc12[_0x56db38(0x197)];for(const _0xa98bd9 of _0x447d75){console['log']('Running:\x20'+a5_0x67163[_0x56db38(0x17b)](_0xa98bd9[_0x56db38(0x15e)]));const _0x38d98c=createCommandSpinner(_0x56db38(0x172)+_0xa98bd9[_0x56db38(0x12f)][_0x56db38(0x174)]+_0x56db38(0x1b9));_0x38d98c[_0x56db38(0x150)]();try{const {result:_0x1e5afd}=await runTest(_0x452baa[_0x56db38(0x1b6)],_0xa98bd9,{'agentId':_0x1e0fa9,'projectId':_0xbc0b6b,'site':_0x93dc12[_0x56db38(0x1b5)],'noEval':![],'evaluatorId':_0x535f25,'onRoundStart':(_0x47f71b,_0x48372b)=>{const _0x164a38=_0x56db38;_0x38d98c[_0x164a38(0x187)]=_0x164a38(0x160)+(_0x47f71b+0x1)+'/'+_0x48372b+_0x164a38(0x1b9);},'onRoundComplete':(_0x39f091,_0x2a4116,_0x48eb29)=>{const _0x27a5ef=_0x56db38,_0x56bde1=formatElapsed(_0x2a4116);_0x48eb29?console[_0x27a5ef(0x186)](_0x27a5ef(0x16e)+(_0x39f091+0x1)+'/'+_0xa98bd9['rounds'][_0x27a5ef(0x174)]+_0x27a5ef(0x19a)+a5_0x67163[_0x27a5ef(0x149)]('✓')+'\x20('+_0x56bde1+')'):console['log'](_0x27a5ef(0x16e)+(_0x39f091+0x1)+'/'+_0xa98bd9[_0x27a5ef(0x12f)][_0x27a5ef(0x174)]+'...\x20'+a5_0x67163[_0x27a5ef(0x18f)]('✗'));},'onEvaluationStart':()=>{const _0x393f89=_0x56db38;_0x38d98c[_0x393f89(0x187)]=_0x393f89(0x16f);},'onEvaluationComplete':_0x2a1e62=>{const _0x39a9c4=_0x56db38,_0x3cdc77=formatElapsed(_0x2a1e62);console[_0x39a9c4(0x186)]('\x20\x20Evaluating...\x20'+a5_0x67163[_0x39a9c4(0x149)]('✓')+'\x20('+_0x3cdc77+')');}});_0x38d98c['stop'](),_0x13e0af[_0x56db38(0x12b)](_0x1e5afd);if(_0x1e5afd[_0x56db38(0x130)]===_0x56db38(0x18d))console[_0x56db38(0x186)](a5_0x67163[_0x56db38(0x149)](_0x56db38(0x1b1)+_0x1e5afd[_0x56db38(0x13b)])+a5_0x67163[_0x56db38(0x14c)](_0x56db38(0x1ae)));else _0x1e5afd[_0x56db38(0x130)]===_0x56db38(0x164)?console[_0x56db38(0x186)](a5_0x67163[_0x56db38(0x18f)](_0x56db38(0x198)+_0x1e5afd[_0x56db38(0x13b)])+a5_0x67163[_0x56db38(0x14c)]('\x20(new)')):console['log'](a5_0x67163[_0x56db38(0x18f)](_0x56db38(0x137)+_0x1e5afd[_0x56db38(0x13b)]));_0x1e5afd['conversation_url']&&console[_0x56db38(0x186)](a5_0x67163[_0x56db38(0x14c)](_0x56db38(0x14b)+_0x1e5afd[_0x56db38(0x14e)]));}catch(_0x1dbf3d){_0x38d98c[_0x56db38(0x1bc)]();const _0x28ab7d=_0x1dbf3d instanceof Error?_0x1dbf3d[_0x56db38(0x144)]:String(_0x1dbf3d);console[_0x56db38(0x186)](a5_0x67163[_0x56db38(0x18f)](_0x56db38(0x137)+_0x28ab7d)),_0x13e0af[_0x56db38(0x12b)]({'name':_0xa98bd9[_0x56db38(0x15e)],'status':'ERROR','reason':_0x28ab7d,'timestamp':new Date()[_0x56db38(0x131)](),'duration_ms':0x0});}}}console[_0x56db38(0x186)]();const _0x4a2bee=Date[_0x56db38(0x15c)]()-_0x4e9546,_0x461bc6=_0x13e0af[_0x56db38(0x196)](_0x2b3fba=>_0x2b3fba[_0x56db38(0x130)]===_0x56db38(0x18d))[_0x56db38(0x174)],_0x566894=_0x13e0af[_0x56db38(0x196)](_0x33797c=>_0x33797c['status']===_0x56db38(0x164))['length'],_0x11e22d=_0x13e0af[_0x56db38(0x196)](_0x1b93cc=>_0x1b93cc[_0x56db38(0x130)]==='ERROR')[_0x56db38(0x174)];console[_0x56db38(0x186)]('━'[_0x56db38(0x1a5)](0x3c)),console['log'](_0x56db38(0x17f)),console[_0x56db38(0x186)]('━'['repeat'](0x3c)),console[_0x56db38(0x186)]('Total:\x20\x20\x20\x20'+_0x13e0af[_0x56db38(0x174)]),console[_0x56db38(0x186)](_0x56db38(0x1b0)+a5_0x67163[_0x56db38(0x149)](_0x461bc6)),console[_0x56db38(0x186)](_0x56db38(0x155)+a5_0x67163[_0x56db38(0x18f)](_0x566894));_0x11e22d>0x0&&console[_0x56db38(0x186)](_0x56db38(0x1aa)+a5_0x67163[_0x56db38(0x18f)](_0x11e22d));console[_0x56db38(0x186)](_0x56db38(0x19d)+formatElapsed(_0x4a2bee)),console[_0x56db38(0x186)]('━'[_0x56db38(0x1a5)](0x3c));const _0x3ef800={'summary':{'total':_0x13e0af[_0x56db38(0x174)],'passed':_0x461bc6,'failed':_0x566894,'errors':_0x11e22d>0x0?_0x11e22d:undefined,'duration_ms':_0x4a2bee},'tests':_0x13e0af,'agent':{'project':_0x38bda8['projectName'],'name':_0x38bda8[_0x56db38(0x1b8)],'site':_0x4312d6},'timestamp':new Date(_0x4e9546)['toISOString']()};if(_0x1e528d!==_0x56db38(0x159)||_0x440fc0){const _0x384183=formatResults(_0x3ef800,_0x1e528d);if(_0x440fc0)try{a5_0x4e0322['writeFileSync'](_0x440fc0,_0x384183,_0x56db38(0x188)),console[_0x56db38(0x186)](),console['log'](a5_0x67163[_0x56db38(0x14c)](_0x56db38(0x1ac)+_0x440fc0));}catch(_0x10e163){return console[_0x56db38(0x186)](),console[_0x56db38(0x186)](a5_0x67163[_0x56db38(0x18f)]('Error\x20writing\x20output\x20file:\x20'+_0x10e163)),0x1;}else console['log'](),console['log'](_0x384183);}const _0x2d0121=_0x13e0af[_0x56db38(0x196)](_0x3fba3b=>_0x3fba3b[_0x56db38(0x130)]!==_0x56db38(0x18d));return _0x2d0121[_0x56db38(0x174)]>0x0?0x1:0x0;}}
1
+ const a5_0x2a47cf=a5_0x43bf;(function(_0x3ca0c1,_0x190fd3){const _0x424f25=a5_0x43bf,_0x50c786=_0x3ca0c1();while(!![]){try{const _0x3ed472=parseInt(_0x424f25(0x12f))/0x1+parseInt(_0x424f25(0xca))/0x2*(-parseInt(_0x424f25(0x10d))/0x3)+-parseInt(_0x424f25(0x105))/0x4+-parseInt(_0x424f25(0x111))/0x5+parseInt(_0x424f25(0x131))/0x6+-parseInt(_0x424f25(0xbd))/0x7*(parseInt(_0x424f25(0xa0))/0x8)+parseInt(_0x424f25(0xb9))/0x9;if(_0x3ed472===_0x190fd3)break;else _0x50c786['push'](_0x50c786['shift']());}catch(_0x458a24){_0x50c786['push'](_0x50c786['shift']());}}}(a5_0x4c89,0xef344));import*as a5_0x2e5583 from'node:fs';function a5_0x43bf(_0x222cc2,_0x50297f){_0x222cc2=_0x222cc2-0x9c;const _0x4c89b3=a5_0x4c89();let _0x43bffd=_0x4c89b3[_0x222cc2];return _0x43bffd;}import*as a5_0x1f59d3 from'node:path';import a5_0x5a7ae9 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x4c89(){const _0x37ebb1=['\x20\x20Evaluating...\x20','no_tests','\x22,\x20but\x20current\x20site\x20is\x20\x22','conversation_url','text','resolve','not\x20found','json','resolveAgentId','404','filter','substring','projectName','agentDirs','log','\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','green','reeval','ERROR','execute','testYmlPath','toISOString','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','\x20\x20Site:\x20','✓\x20PASS:\x20','yellow','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','length','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Usage:','Test\x20Configuration:','join','size','table','Failed:\x20\x20\x20','Available\x20tags:\x20','tests','stop','Run\x20tests\x20for\x20an\x20LLM\x20agent','tsv','verbose','Test\x20Summary','includes','Error:\x20No\x20previous\x20test\x20run\x20found.','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','jsonl','tags','Run\x20\x27tdx\x20agent\x20pull\x20','cyan','...','\x20\x20Round\x20','5714504YHaEXk','...\x20','Re-evaluating\x20cached\x20test\x20run...','push','red','no_context','eval','PASS','2135127RldeVl','white','now','toLowerCase','9249600MfhwcC','\x20\x20Conversation:\x20','existsSync','source','utf-8','found','writeFileSync','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','\x22:\x20','forEach','✗\x20ERROR:\x20Project\x20not\x20found:\x20','has','dim','Cached\x20run\x20is\x20from\x20site\x20\x22','\x27\x20to\x20create\x20the\x20folder\x20structure.','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Either\x20switch\x20to\x20the\x20\x22','Round\x201/','isSpinning','Total:\x20\x20\x20\x20','timestamp','split','executeReeval','start','Running:\x20','Available\x20tests:\x20','✗\x20FAIL:\x20','basename','some','Error\x20writing\x20output\x20file:\x20','1854560pvOgKz','projectDir','2376882fbJFbh','multiple_agents','\x20\x20-\x20','add','FAIL','trim','1242864GmtEKY','Project\x20path:\x20','map','llm','\x20(cached)','No\x20tests\x20have\x20tags\x20defined.','Passed:\x20\x20\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','agentName','Agent:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','no_local_folder','rounds','Failed\x20Tests:','status','message','Duration:\x20','find','\x20-\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','name','agent','agent:test','/<agent-name>','Test\x20','34261506LGKUtD','\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)','Cached\x20run\x20from:\x20','context','49HSTZdj','repeat','dryRun','llmProject','Output\x20written\x20to:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','description','Evaluating\x20response...',':\x20Sending\x20user\x20input...','round','Round\x20','✗\x20ERROR:\x20','Executing\x20new\x20tests...','2ikinro','No\x20tests\x20found\x20with\x20tags:\x20','output','\x20\x20Agent:\x20','resolveProjectId','testName','reason','site'];a5_0x4c89=function(){return _0x37ebb1;};return a5_0x4c89();}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x2a47cf(0xb4)]=a5_0x2a47cf(0xb6);[a5_0x2a47cf(0xc3)]=a5_0x2a47cf(0xf8);async[a5_0x2a47cf(0xe5)](_0x5da814){const _0x3b55be=a5_0x2a47cf,{options:_0x13879a,args:_0x538355,tdx:_0x3fa599}=_0x5da814,_0x21148f=_0x538355[0x0]||'.',_0x4db24b=_0x13879a[_0x3b55be(0xbf)],_0x550b76=_0x13879a,_0x5f578f=_0x550b76[_0x3b55be(0x10b)]===![],_0x18e9e1=_0x550b76[_0x3b55be(0xe3)],_0x80ed5c=_0x550b76['name'],_0x27fa4f=_0x550b76[_0x3b55be(0x100)],_0x296245=_0x13879a[_0x3b55be(0xd1)],_0x48a0f0=_0x550b76[_0x3b55be(0xcc)];if(_0x18e9e1&&_0x5f578f)return console[_0x3b55be(0xe0)](a5_0x5a7ae9[_0x3b55be(0x109)](_0x3b55be(0xa7))),0x1;let _0x4c7626='table';if(_0x550b76[_0x3b55be(0xd9)])_0x4c7626=_0x3b55be(0xd9);else{if(_0x550b76[_0x3b55be(0xff)])_0x4c7626=_0x3b55be(0xff);else{if(_0x550b76[_0x3b55be(0xf9)])_0x4c7626=_0x3b55be(0xf9);else{if(_0x550b76[_0x3b55be(0xf3)])_0x4c7626=_0x3b55be(0xf3);}}}const _0x17c33e=_0x550b76[_0x3b55be(0xc0)];let _0x2b82ee=_0x21148f;const _0x26e18d=a5_0x2e5583[_0x3b55be(0x113)](_0x21148f),_0x35e7cb=_0x21148f==='.';if(!_0x26e18d||_0x35e7cb){const _0x358cbd=resolveProjectFromContext(_0x21148f,_0x17c33e,{'requireFile':'test.yml'});if(_0x358cbd[_0x3b55be(0x116)])_0x2b82ee=_0x358cbd[_0x3b55be(0x130)],_0x358cbd[_0x3b55be(0x114)]===_0x3b55be(0xbc)&&console[_0x3b55be(0xe0)](a5_0x5a7ae9[_0x3b55be(0x11d)]('Using\x20agent:\x20'+_0x2b82ee));else switch(_0x358cbd[_0x3b55be(0xd0)]){case _0x3b55be(0x10a):console['log'](a5_0x5a7ae9[_0x3b55be(0xeb)](_0x358cbd[_0x3b55be(0xaf)])),console[_0x3b55be(0xe0)](),console[_0x3b55be(0xe0)](_0x3b55be(0xef)),console['log'](_0x3b55be(0xe1)),console[_0x3b55be(0xe0)](_0x3b55be(0xba)),console[_0x3b55be(0xe0)](),console[_0x3b55be(0xe0)](_0x3b55be(0xc2));return 0x1;case _0x3b55be(0xab):console[_0x3b55be(0xe0)](a5_0x5a7ae9[_0x3b55be(0xeb)](_0x358cbd[_0x3b55be(0xaf)])),console['log'](),console[_0x3b55be(0xe0)](_0x3b55be(0x101)+_0x358cbd['llmProject']+_0x3b55be(0x11f));return 0x1;case _0x3b55be(0x132):{const _0x4258f5=a5_0x1f59d3[_0x3b55be(0x12c)](_0x358cbd['projectDir']);console[_0x3b55be(0xe0)](a5_0x5a7ae9[_0x3b55be(0xeb)](_0x3b55be(0xe8)+_0x358cbd[_0x3b55be(0xc0)]+'\x22:'));for(const _0x17b8e2 of _0x358cbd[_0x3b55be(0xdf)]){console['log'](_0x3b55be(0x9c)+_0x17b8e2);}return console[_0x3b55be(0xe0)](),console['log']('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x4258f5+_0x3b55be(0xb7)),0x1;}case _0x3b55be(0xd3):console[_0x3b55be(0xe0)](a5_0x5a7ae9[_0x3b55be(0xeb)](_0x3b55be(0xaa)+_0x358cbd['llmProject']+'\x22.')),console[_0x3b55be(0xe0)](a5_0x5a7ae9[_0x3b55be(0x11d)](_0x3b55be(0xa1)+_0x358cbd['projectDir'])),console[_0x3b55be(0xe0)](),console[_0x3b55be(0xe0)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x551b48,agentInfo:_0xfe0be6}=parseTestFile(_0x2b82ee);let _0x3620ab=_0x551b48[_0x3b55be(0xf6)];if(_0x80ed5c){const _0x5f244e=_0x80ed5c[_0x3b55be(0x126)](',')[_0x3b55be(0xa2)](_0x4949ec=>_0x4949ec[_0x3b55be(0x9f)]());_0x3620ab=_0x551b48[_0x3b55be(0xf6)]['filter'](_0x3af9c4=>_0x5f244e[_0x3b55be(0xfc)](_0x3af9c4[_0x3b55be(0xb4)]));if(_0x3620ab[_0x3b55be(0xed)]===0x0)return console['log'](a5_0x5a7ae9[_0x3b55be(0xeb)]('No\x20tests\x20found\x20matching:\x20'+_0x80ed5c)),console[_0x3b55be(0xe0)](a5_0x5a7ae9[_0x3b55be(0x11d)](_0x3b55be(0x12a)+_0x551b48[_0x3b55be(0xf6)][_0x3b55be(0xa2)](_0x3e7df6=>_0x3e7df6[_0x3b55be(0xb4)])[_0x3b55be(0xf1)](',\x20'))),0x1;}if(_0x27fa4f){const _0x4171e9=_0x27fa4f[_0x3b55be(0x126)](',')[_0x3b55be(0xa2)](_0x3fe173=>_0x3fe173[_0x3b55be(0x9f)]()[_0x3b55be(0x110)]());_0x3620ab=_0x3620ab[_0x3b55be(0xdc)](_0x2f5f3c=>_0x2f5f3c[_0x3b55be(0x100)]?.[_0x3b55be(0x12d)](_0xf54a6f=>_0x4171e9['includes'](_0xf54a6f['toLowerCase']())));if(_0x3620ab['length']===0x0){console['log'](a5_0x5a7ae9['yellow'](_0x3b55be(0xcb)+_0x27fa4f));const _0x26cee9=new Set();return _0x551b48[_0x3b55be(0xf6)][_0x3b55be(0x11a)](_0x5a8b5d=>_0x5a8b5d['tags']?.['forEach'](_0x5d61fd=>_0x26cee9[_0x3b55be(0x9d)](_0x5d61fd))),_0x26cee9[_0x3b55be(0xf2)]>0x0?console[_0x3b55be(0xe0)](a5_0x5a7ae9[_0x3b55be(0x11d)](_0x3b55be(0xf5)+[..._0x26cee9][_0x3b55be(0xf1)](',\x20'))):console[_0x3b55be(0xe0)](a5_0x5a7ae9[_0x3b55be(0x11d)](_0x3b55be(0xa5))),0x1;}}if(_0x18e9e1)return this[_0x3b55be(0x127)](_0x5da814,{'definition':{'tests':_0x3620ab},'agentInfo':_0xfe0be6,'outputFormat':_0x4c7626,'outputFile':_0x48a0f0,'testNames':_0x80ed5c});if(_0x4db24b){console[_0x3b55be(0xe0)](a5_0x5a7ae9[_0x3b55be(0x102)](_0x3b55be(0xf0))),console['log'](_0x3b55be(0xe9)+a5_0x5a7ae9[_0x3b55be(0x10e)](_0x296245)),console['log']('\x20\x20Project:\x20'+a5_0x5a7ae9[_0x3b55be(0x10e)](_0xfe0be6[_0x3b55be(0xde)])),console[_0x3b55be(0xe0)](_0x3b55be(0xcd)+a5_0x5a7ae9[_0x3b55be(0x10e)](_0xfe0be6[_0x3b55be(0xa8)])),console[_0x3b55be(0xe0)](),console[_0x3b55be(0xe0)]('Tests\x20found:\x20'+a5_0x5a7ae9[_0x3b55be(0x10e)](_0x3620ab[_0x3b55be(0xed)]));for(let _0x1ebb78=0x0;_0x1ebb78<_0x3620ab['length'];_0x1ebb78++){const _0x267d65=_0x3620ab[_0x1ebb78],_0x103736=_0x267d65[_0x3b55be(0xac)]['length']===0x1?_0x3b55be(0xc6):'rounds',_0x593d3a=_0x267d65[_0x3b55be(0x100)]?.[_0x3b55be(0xed)]?'\x20['+_0x267d65['tags']['join'](',\x20')+']':'';console[_0x3b55be(0xe0)]('\x20\x20'+(_0x1ebb78+0x1)+'.\x20'+a5_0x5a7ae9[_0x3b55be(0x10e)](_0x267d65[_0x3b55be(0xb4)])+'\x20('+_0x267d65[_0x3b55be(0xac)][_0x3b55be(0xed)]+'\x20'+_0x103736+')'+a5_0x5a7ae9[_0x3b55be(0x11d)](_0x593d3a));}return 0x0;}let _0x55a9dc,_0x48a6db;try{_0x55a9dc=await _0x3fa599[_0x3b55be(0xa3)][_0x3b55be(0xce)](_0xfe0be6[_0x3b55be(0xde)]);}catch(_0x50e605){const _0x2c62a7=_0x50e605 instanceof Error?_0x50e605[_0x3b55be(0xaf)]:String(_0x50e605);return _0x2c62a7[_0x3b55be(0xfc)]('404')||_0x2c62a7[_0x3b55be(0x110)]()[_0x3b55be(0xfc)](_0x3b55be(0xd8))?console[_0x3b55be(0xe0)](a5_0x5a7ae9[_0x3b55be(0x109)](_0x3b55be(0x11b)+_0xfe0be6[_0x3b55be(0xde)])):console[_0x3b55be(0xe0)](a5_0x5a7ae9['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0xfe0be6[_0x3b55be(0xde)]+'\x22:\x20'+_0x2c62a7)),0x1;}try{_0x48a6db=await _0x3fa599['llm'][_0x3b55be(0xda)](_0xfe0be6[_0x3b55be(0xa8)],_0x55a9dc);}catch(_0x52b331){const _0x5a7e73=_0x52b331 instanceof Error?_0x52b331[_0x3b55be(0xaf)]:String(_0x52b331);return _0x5a7e73[_0x3b55be(0xfc)](_0x3b55be(0xdb))||_0x5a7e73['toLowerCase']()[_0x3b55be(0xfc)](_0x3b55be(0xd8))?console[_0x3b55be(0xe0)](a5_0x5a7ae9['red']('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0xfe0be6[_0x3b55be(0xa8)])):console[_0x3b55be(0xe0)](a5_0x5a7ae9['red'](_0x3b55be(0xee)+_0xfe0be6['agentName']+_0x3b55be(0x119)+_0x5a7e73)),0x1;}let _0x282795;if(!_0x5f578f)try{_0x282795=await setupEvaluatorAgent(_0x3fa599['llm'],_0x13879a[_0x3b55be(0xfa)]);}catch(_0x4671d8){const _0x2dbb48=_0x4671d8 instanceof Error?_0x4671d8[_0x3b55be(0xaf)]:String(_0x4671d8);return console[_0x3b55be(0xe0)](a5_0x5a7ae9[_0x3b55be(0x109)](_0x3b55be(0xec)+_0x2dbb48)),0x1;}console[_0x3b55be(0xe0)](a5_0x5a7ae9[_0x3b55be(0x102)]('Running\x20agent\x20tests...')),console[_0x3b55be(0xe0)]('Site:\x20'+a5_0x5a7ae9[_0x3b55be(0x10e)](_0x296245)),console[_0x3b55be(0xe0)](_0x3b55be(0xa9)+a5_0x5a7ae9['white'](_0xfe0be6[_0x3b55be(0xde)]+'/'+_0xfe0be6['agentName'])),console[_0x3b55be(0xe0)]();const _0x20a3a5=[],_0x315e4c=[],_0x599759=Date['now']();for(let _0x23cc06=0x0;_0x23cc06<_0x3620ab[_0x3b55be(0xed)];_0x23cc06++){const _0x438dc3=_0x3620ab[_0x23cc06];_0x3620ab[_0x3b55be(0xed)]>0x1?console[_0x3b55be(0xe0)](_0x3b55be(0xb8)+(_0x23cc06+0x1)+'/'+_0x3620ab[_0x3b55be(0xed)]+':\x20'+a5_0x5a7ae9[_0x3b55be(0x10e)](_0x438dc3[_0x3b55be(0xb4)])):console[_0x3b55be(0xe0)]('Running\x20test:\x20'+a5_0x5a7ae9[_0x3b55be(0x10e)](_0x438dc3[_0x3b55be(0xb4)]));const _0x5c5c50=createCommandSpinner(_0x3b55be(0x122)+_0x438dc3[_0x3b55be(0xac)]['length']+_0x3b55be(0xc5));_0x5c5c50[_0x3b55be(0x128)]();try{const {result:_0xaf74a8,conversation:_0x6cb219}=await runTest(_0x3fa599['llm'],_0x438dc3,{'agentId':_0x48a6db,'projectId':_0x55a9dc,'site':_0x296245,'noEval':_0x5f578f,'evaluatorId':_0x282795,'onRoundStart':(_0x4bacab,_0x240c60)=>{const _0x2dba8c=_0x3b55be;_0x5c5c50['text']=_0x2dba8c(0xc7)+(_0x4bacab+0x1)+'/'+_0x240c60+_0x2dba8c(0xc5);},'onRoundComplete':(_0xaca693,_0x2384e1,_0x20d21)=>{const _0x209520=_0x3b55be,_0x1156db=formatElapsed(_0x2384e1);_0x20d21?console[_0x209520(0xe0)](_0x209520(0x104)+(_0xaca693+0x1)+'/'+_0x438dc3[_0x209520(0xac)][_0x209520(0xed)]+_0x209520(0x106)+a5_0x5a7ae9[_0x209520(0xe2)]('✓')+'\x20('+_0x1156db+')'):console[_0x209520(0xe0)](_0x209520(0x104)+(_0xaca693+0x1)+'/'+_0x438dc3['rounds']['length']+'...\x20'+a5_0x5a7ae9['red']('✗'));},'onEvaluationStart':()=>{const _0x599b01=_0x3b55be;_0x5c5c50[_0x599b01(0xd6)]=_0x599b01(0xc4);},'onEvaluationComplete':_0x36df86=>{const _0x2bb511=_0x3b55be,_0x574c5b=formatElapsed(_0x36df86);console[_0x2bb511(0xe0)](_0x2bb511(0xd2)+a5_0x5a7ae9['green']('✓')+'\x20('+_0x574c5b+')');}});_0x5c5c50[_0x3b55be(0xf7)](),_0x20a3a5['push'](_0xaf74a8),_0x315e4c['push'](_0x6cb219);if(_0xaf74a8[_0x3b55be(0xae)]===_0x3b55be(0x10c))console['log'](a5_0x5a7ae9[_0x3b55be(0xe2)](_0x3b55be(0xea)+_0xaf74a8[_0x3b55be(0xd0)]));else _0xaf74a8[_0x3b55be(0xae)]===_0x3b55be(0x9e)?console['log'](a5_0x5a7ae9[_0x3b55be(0x109)](_0x3b55be(0x12b)+_0xaf74a8['reason'])):console['log'](a5_0x5a7ae9[_0x3b55be(0x109)]('✗\x20ERROR:\x20'+_0xaf74a8['reason']));_0xaf74a8['conversation_url']&&console[_0x3b55be(0xe0)](a5_0x5a7ae9[_0x3b55be(0x11d)]('Conversation\x20URL:\x20'+_0xaf74a8[_0x3b55be(0xd5)])),console[_0x3b55be(0xe0)]();}catch(_0x20fa14){_0x5c5c50[_0x3b55be(0xf7)]();const _0xa697c3=_0x20fa14 instanceof Error?_0x20fa14[_0x3b55be(0xaf)]:String(_0x20fa14);console[_0x3b55be(0xe0)](a5_0x5a7ae9[_0x3b55be(0x109)](_0x3b55be(0xc8)+_0xa697c3)),console[_0x3b55be(0xe0)](),_0x20a3a5[_0x3b55be(0x108)]({'name':_0x438dc3[_0x3b55be(0xb4)],'status':_0x3b55be(0xe4),'reason':_0xa697c3,'timestamp':new Date()[_0x3b55be(0xe7)](),'duration_ms':0x0});}}const _0x2bf483=Date[_0x3b55be(0x10f)]()-_0x599759,_0x644b17=_0x20a3a5[_0x3b55be(0xdc)](_0x439795=>_0x439795[_0x3b55be(0xae)]===_0x3b55be(0x10c))[_0x3b55be(0xed)],_0x296f43=_0x20a3a5[_0x3b55be(0xdc)](_0x5b8001=>_0x5b8001['status']==='FAIL')['length'],_0xc45dbe=_0x20a3a5['filter'](_0x2e2972=>_0x2e2972[_0x3b55be(0xae)]==='ERROR')[_0x3b55be(0xed)];console[_0x3b55be(0xe0)]('━'[_0x3b55be(0xbe)](0x3c)),console[_0x3b55be(0xe0)](_0x3b55be(0xfb)),console[_0x3b55be(0xe0)]('━'['repeat'](0x3c)),console[_0x3b55be(0xe0)](_0x3b55be(0x124)+_0x20a3a5[_0x3b55be(0xed)]),console[_0x3b55be(0xe0)]('Passed:\x20\x20\x20'+a5_0x5a7ae9[_0x3b55be(0xe2)](_0x644b17)),console[_0x3b55be(0xe0)](_0x3b55be(0xf4)+a5_0x5a7ae9[_0x3b55be(0x109)](_0x296f43));_0xc45dbe>0x0&&console[_0x3b55be(0xe0)]('Errors:\x20\x20\x20'+a5_0x5a7ae9[_0x3b55be(0x109)](_0xc45dbe));console[_0x3b55be(0xe0)](_0x3b55be(0xb0)+formatElapsed(_0x2bf483)),console[_0x3b55be(0xe0)]('━'['repeat'](0x3c));const _0x48a94f=_0x20a3a5[_0x3b55be(0xdc)](_0x4ad295=>_0x4ad295[_0x3b55be(0xae)]!==_0x3b55be(0x10c));if(_0x48a94f['length']>0x0){console[_0x3b55be(0xe0)](),console[_0x3b55be(0xe0)](_0x3b55be(0xad));for(const _0x57f9d3 of _0x48a94f){const _0x15c5d1=a5_0x5a7ae9[_0x3b55be(0x109)]('✗'),_0x29acd4=_0x57f9d3[_0x3b55be(0xd0)][_0x3b55be(0xed)]>0x32?_0x57f9d3[_0x3b55be(0xd0)][_0x3b55be(0xdd)](0x0,0x32)+'...':_0x57f9d3['reason'];console['log']('\x20\x20'+_0x15c5d1+'\x20'+_0x57f9d3[_0x3b55be(0xb4)]+':\x20'+_0x29acd4);}}const _0x199177={'summary':{'total':_0x20a3a5[_0x3b55be(0xed)],'passed':_0x644b17,'failed':_0x296f43,'errors':_0xc45dbe>0x0?_0xc45dbe:undefined,'duration_ms':_0x2bf483},'tests':_0x20a3a5,'agent':{'project':_0xfe0be6['projectName'],'name':_0xfe0be6[_0x3b55be(0xa8)],'site':_0x296245},'timestamp':new Date(_0x599759)[_0x3b55be(0xe7)]()};try{const _0x3bf806=buildCachedTestRun(_0x315e4c,{'site':_0x296245,'projectId':_0x55a9dc,'projectName':_0xfe0be6['projectName'],'agentId':_0x48a6db,'agentName':_0xfe0be6[_0x3b55be(0xa8)],'testYmlPath':a5_0x1f59d3[_0x3b55be(0xd7)](_0xfe0be6[_0x3b55be(0xe6)])});saveLastTestRun(_0x3bf806);}catch{}if(_0x4c7626!=='table'||_0x48a0f0){const _0x1cf0e3=formatResults(_0x199177,_0x4c7626);if(_0x48a0f0)try{a5_0x2e5583[_0x3b55be(0x117)](_0x48a0f0,_0x1cf0e3,_0x3b55be(0x115)),console[_0x3b55be(0xe0)](),console[_0x3b55be(0xe0)](a5_0x5a7ae9[_0x3b55be(0x11d)](_0x3b55be(0xc1)+_0x48a0f0));}catch(_0x314039){return console[_0x3b55be(0xe0)](),console['log'](a5_0x5a7ae9[_0x3b55be(0x109)](_0x3b55be(0x12e)+_0x314039)),0x1;}else console['log'](),console[_0x3b55be(0xe0)](_0x1cf0e3);}return _0x48a94f['length']>0x0?0x1:0x0;}async[a5_0x2a47cf(0x127)](_0x19bac8,_0x1dc13e){const _0x1e0343=a5_0x2a47cf,{options:_0xe8e451,tdx:_0x59640b}=_0x19bac8,{definition:_0x45eed5,agentInfo:_0x45b23f,outputFormat:_0x5e2391,outputFile:_0x15bfb5}=_0x1dc13e,_0x3bb238=_0xe8e451['site'],_0x44f2b9=loadLastTestRun();if(!_0x44f2b9)return console['log'](a5_0x5a7ae9[_0x1e0343(0x109)](_0x1e0343(0xfd))),console['log'](a5_0x5a7ae9['dim'](_0x1e0343(0x120))),0x1;if(_0x44f2b9[_0x1e0343(0xb5)][_0x1e0343(0xa8)]!==_0x45b23f[_0x1e0343(0xa8)])return console[_0x1e0343(0xe0)](a5_0x5a7ae9[_0x1e0343(0x109)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x44f2b9[_0x1e0343(0xb5)][_0x1e0343(0xa8)]+_0x1e0343(0x118)+_0x45b23f[_0x1e0343(0xa8)]+'\x22.')),console[_0x1e0343(0xe0)](a5_0x5a7ae9[_0x1e0343(0x11d)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x57aa6d=new Set(_0x44f2b9['conversations'][_0x1e0343(0xa2)](_0x418a82=>_0x418a82[_0x1e0343(0xcf)])),_0x55f386=_0x45eed5[_0x1e0343(0xf6)][_0x1e0343(0xdc)](_0x4b6bb4=>!_0x57aa6d[_0x1e0343(0x11c)](_0x4b6bb4[_0x1e0343(0xb4)]));if(_0x55f386[_0x1e0343(0xed)]>0x0&&_0x44f2b9['site']!==_0x3bb238)return console[_0x1e0343(0xe0)](a5_0x5a7ae9[_0x1e0343(0x109)](_0x1e0343(0xb3))),console[_0x1e0343(0xe0)](a5_0x5a7ae9[_0x1e0343(0x11d)](_0x1e0343(0x11e)+_0x44f2b9[_0x1e0343(0xd1)]+_0x1e0343(0xd4)+_0x3bb238+'\x22.')),console[_0x1e0343(0xe0)](a5_0x5a7ae9['dim'](_0x1e0343(0x121)+_0x44f2b9[_0x1e0343(0xd1)]+_0x1e0343(0xfe))),0x1;const _0x5fabb=_0x45eed5[_0x1e0343(0xf6)][_0x1e0343(0xdc)](_0xddea=>_0x57aa6d[_0x1e0343(0x11c)](_0xddea[_0x1e0343(0xb4)])),_0x218f32=_0x55f386;let _0x460ca5;try{_0x460ca5=await setupEvaluatorAgent(_0x59640b[_0x1e0343(0xa3)],_0xe8e451[_0x1e0343(0xfa)]);}catch(_0x130558){const _0x5d2e12=_0x130558 instanceof Error?_0x130558[_0x1e0343(0xaf)]:String(_0x130558);return console[_0x1e0343(0xe0)](a5_0x5a7ae9[_0x1e0343(0x109)](_0x1e0343(0xec)+_0x5d2e12)),0x1;}console['log'](a5_0x5a7ae9[_0x1e0343(0x102)](_0x1e0343(0x107))),console[_0x1e0343(0xe0)](_0x1e0343(0xbb)+a5_0x5a7ae9[_0x1e0343(0x10e)](_0x44f2b9[_0x1e0343(0x125)])),console['log'](_0x1e0343(0xa9)+a5_0x5a7ae9['white'](_0x44f2b9[_0x1e0343(0xb5)]['projectName']+'/'+_0x44f2b9[_0x1e0343(0xb5)][_0x1e0343(0xa8)]));_0x218f32[_0x1e0343(0xed)]>0x0&&console[_0x1e0343(0xe0)]('New\x20tests\x20to\x20execute:\x20'+a5_0x5a7ae9[_0x1e0343(0xeb)](_0x218f32['length']));console[_0x1e0343(0xe0)]();const _0x333ef9=[],_0x1c4506=Date[_0x1e0343(0x10f)](),_0x57ae06=createCommandSpinner('Re-evaluating...');if(_0x5fabb[_0x1e0343(0xed)]>0x0)try{const _0x3ebdea=await reevaluateFromCache(_0x59640b[_0x1e0343(0xa3)],_0x44f2b9,{'tests':_0x5fabb},{'evaluatorId':_0x460ca5,'onTestStart':(_0x13b67b,_0x35f741,_0x5d2de8)=>{const _0x458c5a=_0x1e0343;_0x57ae06[_0x458c5a(0xd6)]='Re-evaluating\x20'+(_0x35f741+0x1)+'/'+_0x5d2de8+':\x20'+_0x13b67b+_0x458c5a(0x103);if(!_0x57ae06[_0x458c5a(0x123)])_0x57ae06[_0x458c5a(0x128)]();},'onTestComplete':(_0x259b97,_0x5b5371)=>{const _0x331825=_0x1e0343;_0x57ae06[_0x331825(0xf7)]();if(_0x5b5371[_0x331825(0xae)]==='PASS')console[_0x331825(0xe0)](a5_0x5a7ae9[_0x331825(0xe2)](_0x331825(0xea)+_0x259b97)+a5_0x5a7ae9[_0x331825(0x11d)](_0x331825(0xa4)));else _0x5b5371[_0x331825(0xae)]===_0x331825(0x9e)?console[_0x331825(0xe0)](a5_0x5a7ae9['red'](_0x331825(0x12b)+_0x259b97+'\x20-\x20'+_0x5b5371[_0x331825(0xd0)])+a5_0x5a7ae9[_0x331825(0x11d)](_0x331825(0xa4))):console[_0x331825(0xe0)](a5_0x5a7ae9[_0x331825(0x109)](_0x331825(0xc8)+_0x259b97+_0x331825(0xb2)+_0x5b5371[_0x331825(0xd0)]));_0x5b5371['conversation_url']&&console['log'](a5_0x5a7ae9[_0x331825(0x11d)](_0x331825(0x112)+_0x5b5371[_0x331825(0xd5)])),_0x333ef9['push'](_0x5b5371);},'onTestSkipped':(_0x27c083,_0x458bab)=>{const _0x301a49=_0x1e0343;_0x57ae06[_0x301a49(0xf7)](),console['log'](a5_0x5a7ae9['yellow']('⚠\x20SKIPPED:\x20'+_0x27c083+_0x301a49(0xb2)+_0x458bab));}});for(const _0x5636dc of _0x3ebdea){!_0x333ef9[_0x1e0343(0xb1)](_0x30cc26=>_0x30cc26[_0x1e0343(0xb4)]===_0x5636dc['name'])&&_0x333ef9[_0x1e0343(0x108)](_0x5636dc);}}catch(_0x4ca51d){_0x57ae06[_0x1e0343(0xf7)]();const _0x43bda8=_0x4ca51d instanceof Error?_0x4ca51d[_0x1e0343(0xaf)]:String(_0x4ca51d);return console[_0x1e0343(0xe0)](a5_0x5a7ae9[_0x1e0343(0x109)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x43bda8)),0x1;}_0x57ae06[_0x1e0343(0xf7)]();if(_0x218f32[_0x1e0343(0xed)]>0x0){console[_0x1e0343(0xe0)](),console[_0x1e0343(0xe0)](a5_0x5a7ae9[_0x1e0343(0x102)](_0x1e0343(0xc9)));const {projectId:_0x46a17a,agentId:_0x2d2ca2}=_0x44f2b9[_0x1e0343(0xb5)];for(const _0x229c00 of _0x218f32){console['log'](_0x1e0343(0x129)+a5_0x5a7ae9[_0x1e0343(0x10e)](_0x229c00[_0x1e0343(0xb4)]));const _0x58a921=createCommandSpinner('Round\x201/'+_0x229c00[_0x1e0343(0xac)][_0x1e0343(0xed)]+_0x1e0343(0xc5));_0x58a921[_0x1e0343(0x128)]();try{const {result:_0x3a4bb7}=await runTest(_0x59640b[_0x1e0343(0xa3)],_0x229c00,{'agentId':_0x2d2ca2,'projectId':_0x46a17a,'site':_0x44f2b9[_0x1e0343(0xd1)],'noEval':![],'evaluatorId':_0x460ca5,'onRoundStart':(_0x8e419d,_0x2da5a3)=>{const _0x13edbc=_0x1e0343;_0x58a921[_0x13edbc(0xd6)]=_0x13edbc(0xc7)+(_0x8e419d+0x1)+'/'+_0x2da5a3+_0x13edbc(0xc5);},'onRoundComplete':(_0xbafb02,_0x413035,_0x44ef6d)=>{const _0x32560e=_0x1e0343,_0x940538=formatElapsed(_0x413035);_0x44ef6d?console[_0x32560e(0xe0)](_0x32560e(0x104)+(_0xbafb02+0x1)+'/'+_0x229c00[_0x32560e(0xac)][_0x32560e(0xed)]+'...\x20'+a5_0x5a7ae9[_0x32560e(0xe2)]('✓')+'\x20('+_0x940538+')'):console['log'](_0x32560e(0x104)+(_0xbafb02+0x1)+'/'+_0x229c00[_0x32560e(0xac)]['length']+'...\x20'+a5_0x5a7ae9[_0x32560e(0x109)]('✗'));},'onEvaluationStart':()=>{const _0x4f3190=_0x1e0343;_0x58a921[_0x4f3190(0xd6)]=_0x4f3190(0xc4);},'onEvaluationComplete':_0x2df09=>{const _0x2391cc=_0x1e0343,_0x2bbcf3=formatElapsed(_0x2df09);console[_0x2391cc(0xe0)]('\x20\x20Evaluating...\x20'+a5_0x5a7ae9['green']('✓')+'\x20('+_0x2bbcf3+')');}});_0x58a921[_0x1e0343(0xf7)](),_0x333ef9[_0x1e0343(0x108)](_0x3a4bb7);if(_0x3a4bb7[_0x1e0343(0xae)]===_0x1e0343(0x10c))console[_0x1e0343(0xe0)](a5_0x5a7ae9[_0x1e0343(0xe2)](_0x1e0343(0xea)+_0x3a4bb7[_0x1e0343(0xd0)])+a5_0x5a7ae9[_0x1e0343(0x11d)]('\x20(new)'));else _0x3a4bb7[_0x1e0343(0xae)]===_0x1e0343(0x9e)?console['log'](a5_0x5a7ae9['red'](_0x1e0343(0x12b)+_0x3a4bb7[_0x1e0343(0xd0)])+a5_0x5a7ae9['dim']('\x20(new)')):console[_0x1e0343(0xe0)](a5_0x5a7ae9[_0x1e0343(0x109)](_0x1e0343(0xc8)+_0x3a4bb7['reason']));_0x3a4bb7['conversation_url']&&console[_0x1e0343(0xe0)](a5_0x5a7ae9[_0x1e0343(0x11d)](_0x1e0343(0x112)+_0x3a4bb7[_0x1e0343(0xd5)]));}catch(_0x406b4d){_0x58a921[_0x1e0343(0xf7)]();const _0x4ab5d9=_0x406b4d instanceof Error?_0x406b4d[_0x1e0343(0xaf)]:String(_0x406b4d);console[_0x1e0343(0xe0)](a5_0x5a7ae9[_0x1e0343(0x109)]('✗\x20ERROR:\x20'+_0x4ab5d9)),_0x333ef9['push']({'name':_0x229c00['name'],'status':_0x1e0343(0xe4),'reason':_0x4ab5d9,'timestamp':new Date()[_0x1e0343(0xe7)](),'duration_ms':0x0});}}}console[_0x1e0343(0xe0)]();const _0x3158fc=Date[_0x1e0343(0x10f)]()-_0x1c4506,_0x24fb2c=_0x333ef9[_0x1e0343(0xdc)](_0x305016=>_0x305016[_0x1e0343(0xae)]===_0x1e0343(0x10c))[_0x1e0343(0xed)],_0x60e7f=_0x333ef9['filter'](_0x4651eb=>_0x4651eb[_0x1e0343(0xae)]===_0x1e0343(0x9e))[_0x1e0343(0xed)],_0x5d9428=_0x333ef9[_0x1e0343(0xdc)](_0x500fd8=>_0x500fd8[_0x1e0343(0xae)]==='ERROR')[_0x1e0343(0xed)];console['log']('━'[_0x1e0343(0xbe)](0x3c)),console['log']('Re-evaluation\x20Summary'),console[_0x1e0343(0xe0)]('━'[_0x1e0343(0xbe)](0x3c)),console[_0x1e0343(0xe0)]('Total:\x20\x20\x20\x20'+_0x333ef9[_0x1e0343(0xed)]),console[_0x1e0343(0xe0)](_0x1e0343(0xa6)+a5_0x5a7ae9[_0x1e0343(0xe2)](_0x24fb2c)),console[_0x1e0343(0xe0)](_0x1e0343(0xf4)+a5_0x5a7ae9['red'](_0x60e7f));_0x5d9428>0x0&&console[_0x1e0343(0xe0)]('Errors:\x20\x20\x20'+a5_0x5a7ae9[_0x1e0343(0x109)](_0x5d9428));console[_0x1e0343(0xe0)]('Duration:\x20'+formatElapsed(_0x3158fc)),console[_0x1e0343(0xe0)]('━'[_0x1e0343(0xbe)](0x3c));const _0x59bec2={'summary':{'total':_0x333ef9[_0x1e0343(0xed)],'passed':_0x24fb2c,'failed':_0x60e7f,'errors':_0x5d9428>0x0?_0x5d9428:undefined,'duration_ms':_0x3158fc},'tests':_0x333ef9,'agent':{'project':_0x45b23f[_0x1e0343(0xde)],'name':_0x45b23f[_0x1e0343(0xa8)],'site':_0x3bb238},'timestamp':new Date(_0x1c4506)[_0x1e0343(0xe7)]()};if(_0x5e2391!==_0x1e0343(0xf3)||_0x15bfb5){const _0x157def=formatResults(_0x59bec2,_0x5e2391);if(_0x15bfb5)try{a5_0x2e5583[_0x1e0343(0x117)](_0x15bfb5,_0x157def,_0x1e0343(0x115)),console[_0x1e0343(0xe0)](),console['log'](a5_0x5a7ae9[_0x1e0343(0x11d)](_0x1e0343(0xc1)+_0x15bfb5));}catch(_0x19ce67){return console[_0x1e0343(0xe0)](),console[_0x1e0343(0xe0)](a5_0x5a7ae9[_0x1e0343(0x109)]('Error\x20writing\x20output\x20file:\x20'+_0x19ce67)),0x1;}else console[_0x1e0343(0xe0)](),console[_0x1e0343(0xe0)](_0x157def);}const _0x3db59a=_0x333ef9['filter'](_0x355122=>_0x355122[_0x1e0343(0xae)]!==_0x1e0343(0x10c));return _0x3db59a['length']>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x298428=a6_0x15e4;(function(_0x556043,_0xac7ffa){const _0x193359=a6_0x15e4,_0x5dd297=_0x556043();while(!![]){try{const _0x19db8e=-parseInt(_0x193359(0xd5))/0x1+-parseInt(_0x193359(0xcb))/0x2*(parseInt(_0x193359(0xc3))/0x3)+parseInt(_0x193359(0xbb))/0x4+-parseInt(_0x193359(0xaf))/0x5*(-parseInt(_0x193359(0xa6))/0x6)+-parseInt(_0x193359(0xa0))/0x7+parseInt(_0x193359(0x9a))/0x8*(parseInt(_0x193359(0xa1))/0x9)+parseInt(_0x193359(0xa2))/0xa;if(_0x19db8e===_0xac7ffa)break;else _0x5dd297['push'](_0x5dd297['shift']());}catch(_0x17827d){_0x5dd297['push'](_0x5dd297['shift']());}}}(a6_0x9884,0xcd90e));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';function a6_0x9884(){const _0x115eeb=['x-xsrf-token','\x0aStack\x20trace:\x0a','status','15MbZgwp','trim','x-trino-user','description','color','set-cookie','x-auth-token','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','392660Vzmffx','cdp','output','readBodyFromFile','data','cookie','Results\x20saved\x20to\x20','name','error','startsWith','1242329BaiVfk','toLowerCase','site','stack','PATCH','includes','llm-proxy','10492616NvPRYZ','method','noColor','Invalid\x20API\x20type:\x20','entries','file','10945851dNseGt','9XfoyPV','14194030vygdWa','toUpperCase','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','POST','5424BLthux','PUT','.\x20Valid\x20types:\x20','body','GET','Invalid\x20HTTP\x20method:\x20','proxy-authorization','set-cookie2','log','9215qdYjKR','<\x20HTTP/1.1\x20','isArray','type','llm','headers','header','verbose','DELETE','Error:\x20','substring','api','930472cRODmV','join','length','message','\x22.\x20'];a6_0x9884=function(){return _0x115eeb;};return a6_0x9884();}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization',a6_0x298428(0xac),a6_0x298428(0xd0),a6_0x298428(0xc8),a6_0x298428(0xad),a6_0x298428(0xc0),a6_0x298428(0xc9),a6_0x298428(0xc5)]);function isSensitiveHeader(_0x2cf4b5){const _0x56e1e6=a6_0x298428;return SENSITIVE_HEADERS['has'](_0x2cf4b5[_0x56e1e6(0xd6)]());}function parseHeader(_0x30dedb){const _0x5b2348=a6_0x298428,_0x50d275=_0x30dedb['indexOf'](':');if(_0x50d275===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x30dedb+_0x5b2348(0xbf)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x53fd11=_0x30dedb['substring'](0x0,_0x50d275)[_0x5b2348(0xc4)](),_0x2562ec=_0x30dedb[_0x5b2348(0xb9)](_0x50d275+0x1)[_0x5b2348(0xc4)]();if(!_0x53fd11)throw new Error(_0x5b2348(0xa4)+_0x30dedb+'\x22');return[_0x53fd11,_0x2562ec];}function a6_0x15e4(_0x65f0c7,_0xcd2a27){_0x65f0c7=_0x65f0c7-0x97;const _0x9884b=a6_0x9884();let _0x15e49e=_0x9884b[_0x65f0c7];return _0x15e49e;}export class ApiCommand extends BaseCommand{[a6_0x298428(0xd2)]=a6_0x298428(0xba);[a6_0x298428(0xc6)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';['validate'](_0x563351){const _0x196bb1=a6_0x298428,{args:_0x68995f,options:_0x318027}=_0x563351,_0x4c19b3=_0x318027;if(_0x68995f[_0x196bb1(0xbd)]===0x0)return _0x196bb1(0xca);const _0x324722=_0x68995f[0x0];if(!_0x324722[_0x196bb1(0xd4)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x324722;const _0x33fa35=_0x4c19b3[_0x196bb1(0xcf)],_0x277e39=_0x4c19b3[_0x196bb1(0x9f)];if(_0x33fa35&&_0x277e39)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x49ce4a=_0x4c19b3[_0x196bb1(0x9b)]||_0x196bb1(0xaa),_0x346893=[_0x196bb1(0xaa),_0x196bb1(0xa5),_0x196bb1(0xa7),_0x196bb1(0xb7),_0x196bb1(0x97)];if(!_0x346893[_0x196bb1(0x98)](_0x49ce4a[_0x196bb1(0xa3)]()))return _0x196bb1(0xab)+_0x49ce4a+'.\x20Valid\x20methods:\x20'+_0x346893[_0x196bb1(0xbc)](',\x20');const _0x563d00=_0x4c19b3[_0x196bb1(0xb2)]||'td',_0x38f98d=['td',_0x196bb1(0xcc),'workflow','trino',_0x196bb1(0xb3),_0x196bb1(0x99)];if(!_0x38f98d['includes'](_0x563d00))return _0x196bb1(0x9d)+_0x563d00+_0x196bb1(0xa8)+_0x38f98d['join'](',\x20');return undefined;}async['execute'](_0x5b7d84){const _0x531665=a6_0x298428,{options:_0xc67d51,args:_0x2b395e,tdx:_0x57f189}=_0x5b7d84,_0x4ac6f7=_0xc67d51,_0x2e89ad=_0x2b395e[0x0],_0x2810c7=(_0x4ac6f7[_0x531665(0x9b)]||_0x531665(0xaa))['toUpperCase'](),_0x2627bd=_0x4ac6f7[_0x531665(0xcf)],_0x373bd2=_0x4ac6f7[_0x531665(0x9f)],_0x1f42d0=_0x4ac6f7[_0x531665(0xb5)],_0x140c90=_0x4ac6f7[_0x531665(0xb2)]||'td';try{const _0x524bf5={};if(_0x1f42d0){const _0x56ec77=Array[_0x531665(0xb1)](_0x1f42d0)?_0x1f42d0:[_0x1f42d0];for(const _0x241163 of _0x56ec77){const [_0x339c46,_0x377d72]=parseHeader(_0x241163);_0x524bf5[_0x339c46]=_0x377d72;}}let _0x4ac837;if(_0x2627bd)_0x4ac837=_0x2627bd;else{if(_0x373bd2)try{_0x4ac837=RawAPI[_0x531665(0xce)](_0x373bd2);}catch(_0x192b83){return console[_0x531665(0xd3)]('Error:\x20'+(_0x192b83 instanceof Error?_0x192b83['message']:String(_0x192b83))),0x1;}}const _0x1a4e26={'method':_0x2810c7,'apiType':_0x140c90,'includeHeaders':_0xc67d51[_0x531665(0xb6)]};_0x4ac837&&(_0x1a4e26[_0x531665(0xa9)]=_0x4ac837);Object['keys'](_0x524bf5)['length']>0x0&&(_0x1a4e26[_0x531665(0xb4)]=_0x524bf5);if(_0xc67d51['verbose']){const _0x48f915=resolveSite(_0xc67d51[_0x531665(0xd7)]),_0x13136e=getEndpoint(_0x48f915,_0x140c90),_0x5069ed=''+_0x13136e+_0x2e89ad;console[_0x531665(0xd3)]('>\x20'+_0x2810c7+'\x20'+_0x5069ed);const _0x52ea61=getAuthHeaders(_0x48f915),_0x3e5fb5={..._0x52ea61,..._0x524bf5};for(const [_0x77517b,_0xc094c4]of Object[_0x531665(0x9e)](_0x3e5fb5)){!isSensitiveHeader(_0x77517b)&&console[_0x531665(0xd3)]('>\x20'+_0x77517b+':\x20'+_0xc094c4);}_0x4ac837&&console['error']('>'),console[_0x531665(0xd3)]('');}const _0x2a9171=await _0x57f189[_0x531665(0xba)]['request'](_0x2e89ad,_0x1a4e26);if(_0xc67d51[_0x531665(0xb6)]&&_0x2a9171[_0x531665(0xb4)]){console[_0x531665(0xd3)](_0x531665(0xb0)+_0x2a9171[_0x531665(0xc2)]);for(const [_0x245775,_0x1265ef]of Object[_0x531665(0x9e)](_0x2a9171[_0x531665(0xb4)])){!isSensitiveHeader(_0x245775)&&console[_0x531665(0xd3)]('<\x20'+_0x245775+':\x20'+_0x1265ef);}console[_0x531665(0xd3)]('');}const _0xc6e344=Boolean(_0xc67d51[_0x531665(0xcd)]),_0x274fc5={'color':_0xc67d51['color'],'noColor':_0xc67d51[_0x531665(0x9c)]||_0xc6e344&&!_0xc67d51[_0x531665(0xc7)]},_0x360c1b=colorizeJSON(_0x2a9171[_0x531665(0xcf)],_0x274fc5);return _0xc67d51[_0x531665(0xcd)]?(writeFileSync(_0xc67d51['output'],_0x360c1b),console[_0x531665(0xd3)](_0x531665(0xd1)+_0xc67d51[_0x531665(0xcd)])):console[_0x531665(0xae)](_0x360c1b),0x0;}catch(_0x3b44d6){return _0x3b44d6 instanceof Error?(console['error']('Error:\x20'+_0x3b44d6[_0x531665(0xbe)]),_0xc67d51[_0x531665(0xb6)]&&_0x3b44d6['stack']&&console[_0x531665(0xd3)](_0x531665(0xc1)+_0x3b44d6[_0x531665(0xd8)])):console['error'](_0x531665(0xb8)+String(_0x3b44d6)),0x1;}}}
1
+ const a6_0x497767=a6_0x1c53;(function(_0x18c1a6,_0x24e893){const _0x2f56db=a6_0x1c53,_0x26cd41=_0x18c1a6();while(!![]){try{const _0x29e5db=parseInt(_0x2f56db(0x205))/0x1*(parseInt(_0x2f56db(0x1f7))/0x2)+parseInt(_0x2f56db(0x1ed))/0x3+parseInt(_0x2f56db(0x1f5))/0x4+parseInt(_0x2f56db(0x1ff))/0x5*(parseInt(_0x2f56db(0x213))/0x6)+-parseInt(_0x2f56db(0x20f))/0x7*(-parseInt(_0x2f56db(0x1fd))/0x8)+parseInt(_0x2f56db(0x1f0))/0x9+-parseInt(_0x2f56db(0x1e0))/0xa;if(_0x29e5db===_0x24e893)break;else _0x26cd41['push'](_0x26cd41['shift']());}catch(_0x3dbd35){_0x26cd41['push'](_0x26cd41['shift']());}}}(a6_0x83d0,0xf2b17));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';function a6_0x1c53(_0x3d7e74,_0x2c34c2){_0x3d7e74=_0x3d7e74-0x1df;const _0x83d0e4=a6_0x83d0();let _0x1c53b8=_0x83d0e4[_0x3d7e74];return _0x1c53b8;}import{getAuthHeaders}from'../core/auth.js';function a6_0x83d0(){const _0xd8590e=['isArray','color','data','message','startsWith','<\x20HTTP/1.1\x20','40631590MjcNMk','PUT','proxy-authorization','description','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','execute','length','file','toUpperCase','output','GET','body','api','3049746IadWsz','.\x20Valid\x20methods:\x20','set-cookie2','830295rRMJSK','x-trino-user','Invalid\x20API\x20type:\x20','substring','type','5474948QePANQ','error','4RQeeOg','has','noColor','headers','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','trim','8nKNECj','includes','1290695mdLqbp','DELETE','Results\x20saved\x20to\x20','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','PATCH','verbose','233677aqbXHo','entries','validate','llm-proxy','POST','Invalid\x20header\x20format:\x20\x22','cookie','Error:\x20','cdp','join','2137303HyrkYb','stack','trino','.\x20Valid\x20types:\x20','42NpzEHl','keys','x-xsrf-token','name','header','toLowerCase','request','set-cookie'];a6_0x83d0=function(){return _0xd8590e;};return a6_0x83d0();}const SENSITIVE_HEADERS=new Set(['authorization',a6_0x497767(0x1e2),a6_0x497767(0x20b),a6_0x497767(0x21a),a6_0x497767(0x1ef),a6_0x497767(0x215),'x-auth-token',a6_0x497767(0x1f1)]);function isSensitiveHeader(_0x4a123a){const _0xbfcf92=a6_0x497767;return SENSITIVE_HEADERS[_0xbfcf92(0x1f8)](_0x4a123a[_0xbfcf92(0x218)]());}function parseHeader(_0xf88fbf){const _0x33abf6=a6_0x497767,_0x459e08=_0xf88fbf['indexOf'](':');if(_0x459e08===-0x1)throw new Error(_0x33abf6(0x20a)+_0xf88fbf+'\x22.\x20'+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x5934ec=_0xf88fbf[_0x33abf6(0x1f3)](0x0,_0x459e08)[_0x33abf6(0x1fc)](),_0x1c31ca=_0xf88fbf[_0x33abf6(0x1f3)](_0x459e08+0x1)[_0x33abf6(0x1fc)]();if(!_0x5934ec)throw new Error(_0x33abf6(0x202)+_0xf88fbf+'\x22');return[_0x5934ec,_0x1c31ca];}export class ApiCommand extends BaseCommand{[a6_0x497767(0x216)]='api';[a6_0x497767(0x1e3)]=a6_0x497767(0x1e4);[a6_0x497767(0x207)](_0x4e0fc5){const _0xf6dd3a=a6_0x497767,{args:_0x13448c,options:_0x51028}=_0x4e0fc5,_0x2b215f=_0x51028;if(_0x13448c[_0xf6dd3a(0x1e6)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x16e52f=_0x13448c[0x0];if(!_0x16e52f[_0xf6dd3a(0x21f)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x16e52f;const _0x5bbdfd=_0x2b215f[_0xf6dd3a(0x21d)],_0x31a4e7=_0x2b215f[_0xf6dd3a(0x1e7)];if(_0x5bbdfd&&_0x31a4e7)return _0xf6dd3a(0x1fb);const _0x14cb58=_0x2b215f['method']||_0xf6dd3a(0x1ea),_0x68caff=[_0xf6dd3a(0x1ea),_0xf6dd3a(0x209),_0xf6dd3a(0x1e1),_0xf6dd3a(0x200),_0xf6dd3a(0x203)];if(!_0x68caff[_0xf6dd3a(0x1fe)](_0x14cb58[_0xf6dd3a(0x1e8)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x14cb58+_0xf6dd3a(0x1ee)+_0x68caff[_0xf6dd3a(0x20e)](',\x20');const _0x14b797=_0x2b215f[_0xf6dd3a(0x1f4)]||'td',_0x1b5eaf=['td',_0xf6dd3a(0x20d),'workflow',_0xf6dd3a(0x211),'llm',_0xf6dd3a(0x208)];if(!_0x1b5eaf['includes'](_0x14b797))return _0xf6dd3a(0x1f2)+_0x14b797+_0xf6dd3a(0x212)+_0x1b5eaf[_0xf6dd3a(0x20e)](',\x20');return undefined;}async[a6_0x497767(0x1e5)](_0xfe63d9){const _0x1eaf41=a6_0x497767,{options:_0x50b27f,args:_0x59ba9d,tdx:_0x56d4d6}=_0xfe63d9,_0x397bb9=_0x50b27f,_0x5033a7=_0x59ba9d[0x0],_0x480da3=(_0x397bb9['method']||'GET')[_0x1eaf41(0x1e8)](),_0x193bfc=_0x397bb9[_0x1eaf41(0x21d)],_0x21b3d2=_0x397bb9['file'],_0x59777f=_0x397bb9[_0x1eaf41(0x217)],_0x2c2c27=_0x397bb9[_0x1eaf41(0x1f4)]||'td';try{const _0x57824f={};if(_0x59777f){const _0xfa7312=Array[_0x1eaf41(0x21b)](_0x59777f)?_0x59777f:[_0x59777f];for(const _0xc52db9 of _0xfa7312){const [_0x2fe60e,_0x3967eb]=parseHeader(_0xc52db9);_0x57824f[_0x2fe60e]=_0x3967eb;}}let _0x23c3be;if(_0x193bfc)_0x23c3be=_0x193bfc;else{if(_0x21b3d2)try{_0x23c3be=RawAPI['readBodyFromFile'](_0x21b3d2);}catch(_0x25cf0c){return console[_0x1eaf41(0x1f6)](_0x1eaf41(0x20c)+(_0x25cf0c instanceof Error?_0x25cf0c['message']:String(_0x25cf0c))),0x1;}}const _0x382bdc={'method':_0x480da3,'apiType':_0x2c2c27,'includeHeaders':_0x50b27f[_0x1eaf41(0x204)]};_0x23c3be&&(_0x382bdc[_0x1eaf41(0x1eb)]=_0x23c3be);Object[_0x1eaf41(0x214)](_0x57824f)[_0x1eaf41(0x1e6)]>0x0&&(_0x382bdc[_0x1eaf41(0x1fa)]=_0x57824f);if(_0x50b27f[_0x1eaf41(0x204)]){const _0x3b9c31=resolveSite(_0x50b27f['site']),_0x120e74=getEndpoint(_0x3b9c31,_0x2c2c27),_0x2ffe5b=''+_0x120e74+_0x5033a7;console[_0x1eaf41(0x1f6)]('>\x20'+_0x480da3+'\x20'+_0x2ffe5b);const _0x20a735=getAuthHeaders(_0x3b9c31),_0x5d1ba1={..._0x20a735,..._0x57824f};for(const [_0x36241e,_0x5b60e4]of Object['entries'](_0x5d1ba1)){!isSensitiveHeader(_0x36241e)&&console[_0x1eaf41(0x1f6)]('>\x20'+_0x36241e+':\x20'+_0x5b60e4);}_0x23c3be&&console[_0x1eaf41(0x1f6)]('>'),console['error']('');}const _0x244232=await _0x56d4d6[_0x1eaf41(0x1ec)][_0x1eaf41(0x219)](_0x5033a7,_0x382bdc);if(_0x50b27f['verbose']&&_0x244232[_0x1eaf41(0x1fa)]){console[_0x1eaf41(0x1f6)](_0x1eaf41(0x1df)+_0x244232['status']);for(const [_0x24bb52,_0x3f78b3]of Object[_0x1eaf41(0x206)](_0x244232['headers'])){!isSensitiveHeader(_0x24bb52)&&console['error']('<\x20'+_0x24bb52+':\x20'+_0x3f78b3);}console[_0x1eaf41(0x1f6)]('');}const _0x58ae22=Boolean(_0x50b27f[_0x1eaf41(0x1e9)]),_0x193d26={'color':_0x50b27f[_0x1eaf41(0x21c)],'noColor':_0x50b27f[_0x1eaf41(0x1f9)]||_0x58ae22&&!_0x50b27f[_0x1eaf41(0x21c)]},_0x4ed925=colorizeJSON(_0x244232[_0x1eaf41(0x21d)],_0x193d26);return _0x50b27f[_0x1eaf41(0x1e9)]?(writeFileSync(_0x50b27f[_0x1eaf41(0x1e9)],_0x4ed925),console[_0x1eaf41(0x1f6)](_0x1eaf41(0x201)+_0x50b27f[_0x1eaf41(0x1e9)])):console['log'](_0x4ed925),0x0;}catch(_0x5d3722){return _0x5d3722 instanceof Error?(console['error'](_0x1eaf41(0x20c)+_0x5d3722[_0x1eaf41(0x21e)]),_0x50b27f['verbose']&&_0x5d3722[_0x1eaf41(0x210)]&&console['error']('\x0aStack\x20trace:\x0a'+_0x5d3722['stack'])):console[_0x1eaf41(0x1f6)](_0x1eaf41(0x20c)+String(_0x5d3722)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0xf89471=a7_0x50c9;(function(_0xbd3870,_0x2b893d){const _0x36638a=a7_0x50c9,_0x5ec960=_0xbd3870();while(!![]){try{const _0x16d8d8=-parseInt(_0x36638a(0x1ee))/0x1+-parseInt(_0x36638a(0x1b4))/0x2*(-parseInt(_0x36638a(0x1ae))/0x3)+parseInt(_0x36638a(0x1ef))/0x4*(parseInt(_0x36638a(0x1a7))/0x5)+-parseInt(_0x36638a(0x1a9))/0x6*(-parseInt(_0x36638a(0x1b6))/0x7)+parseInt(_0x36638a(0x1c1))/0x8+parseInt(_0x36638a(0x1d4))/0x9*(parseInt(_0x36638a(0x1c5))/0xa)+-parseInt(_0x36638a(0x1b7))/0xb;if(_0x16d8d8===_0x2b893d)break;else _0x5ec960['push'](_0x5ec960['shift']());}catch(_0x272a97){_0x5ec960['push'](_0x5ec960['shift']());}}}(a7_0xe43d,0xaeff4));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_0x4cf435 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a7_0x50c9(_0x52ba03,_0x4c8e3a){_0x52ba03=_0x52ba03-0x1a2;const _0xe43d83=a7_0xe43d();let _0x50c958=_0xe43d83[_0x52ba03];return _0x50c958;}import{LogLevel}from'../utils/tdx-logger.js';import a7_0x3fbf5e from'chalk';function a7_0xe43d(){const _0x3d41a1=['yellow','bold','Validating\x20API\x20key...','\x20for\x20profile:\x20','5559516wjugLq','description','N/A','test','trim','\x20--profile\x20','text','warn','profile','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','filter','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','error','status','name','select','apiKey','auth','execute','tdx:\x20auth\x20clear','Setup\x20API\x20key\x20authentication\x20interactively','message','\x0aSetup\x20cancelled','✓\x20Default\x20site\x20set\x20to\x20','Select\x20your\x20Treasure\x20Data\x20site:','462527HKSiSC','78460LXBkPr','us01','tdx\x20profile:\x20','email','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','red','✗\x20Validation\x20failed:\x20','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','first_name','215suBnpX','\x20\x20tdx','20724wXtAHx','No\x20API\x20key\x20found\x20in\x20keychain','getUserInfo','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','other','6zFLMAl','join','green','/app/mp/ak','last_name','Site\x20name\x20cannot\x20be\x20empty','1025318ajKOJT','customSite','2674HeHoyn','29721527GIMUaF','create','\x27\x20registered','Enter\x20site\x20name:','User:\x20','\x20(profile:\x20','\x20(site:\x20','✓\x20Authentication\x20successful\x0a','✓\x20API\x20key\x20removed\x20from\x20keychain','jobs','602856FldVNs','log','password','Setting\x20up\x20authentication\x20for\x20site:\x20','10wFqmgu','API\x20key\x20cannot\x20be\x20empty','site','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Name:\x20','auth:clear','auth:setup','ERROR','System\x20keychain\x20is\x20not\x20available','No\x20credential\x20found'];a7_0xe43d=function(){return _0x3d41a1;};return a7_0xe43d();}export class AuthSetupCommand extends BaseCommand{[a7_0xf89471(0x1e3)]=a7_0xf89471(0x1cc);[a7_0xf89471(0x1d5)]=a7_0xf89471(0x1e9);async['execute'](_0xeb369a){const _0x741c3a=a7_0xf89471,{options:_0x2c4221}=_0xeb369a,_0x5739f6=_0x2c4221['profile'];console[_0x741c3a(0x1c2)](a7_0x3fbf5e[_0x741c3a(0x1d1)]('tdx:\x20auth\x20setup'));const _0x4f27ba=_0x2c4221[_0x741c3a(0x1c7)]||_0x741c3a(0x1f0),{choices:_0x5161ae,initialIndex:_0x34e034}=buildSiteChoices(_0x4f27ba),_0x59c9f9=_0x5739f6?_0x741c3a(0x1dd)+_0x5739f6+'):':_0x741c3a(0x1ed),_0x1e156d=await a7_0x4cf435({'type':_0x741c3a(0x1e4),'name':_0x741c3a(0x1c7),'message':_0x59c9f9,'choices':_0x5161ae,'initial':_0x34e034});if(!_0x1e156d[_0x741c3a(0x1c7)])return console[_0x741c3a(0x1c2)](_0x741c3a(0x1eb)),0x1;let _0x38379f;if(_0x1e156d['site']===_0x741c3a(0x1ad)){const _0x58ab98=await a7_0x4cf435({'type':_0x741c3a(0x1da),'name':'customSite','message':_0x741c3a(0x1ba),'initial':_0x741c3a(0x1f0),'validate':_0x4bc1bd=>{const _0x5dd908=_0x741c3a;if(!_0x4bc1bd||!_0x4bc1bd[_0x5dd908(0x1d8)]())return _0x5dd908(0x1b3);if(!/^[a-z0-9-]+$/[_0x5dd908(0x1d7)](_0x4bc1bd[_0x5dd908(0x1d8)]()))return _0x5dd908(0x1a5);return!![];}});if(!_0x58ab98[_0x741c3a(0x1b5)])return console['log'](_0x741c3a(0x1eb)),0x1;_0x38379f=_0x58ab98[_0x741c3a(0x1b5)];}else _0x38379f=_0x1e156d[_0x741c3a(0x1c7)];const _0x8017ea=resolveSite(_0x38379f);console[_0x741c3a(0x1c2)](_0x741c3a(0x1c4)+_0x8017ea),console[_0x741c3a(0x1c2)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x741c3a(0x1c2)]('\x20\x20'+getConsoleUrl(_0x8017ea,_0x741c3a(0x1b1)));const _0x5d7a07=await a7_0x4cf435({'type':_0x741c3a(0x1c3),'name':_0x741c3a(0x1e5),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x123a9a=>{const _0x2cea23=_0x741c3a;if(!_0x123a9a||!_0x123a9a[_0x2cea23(0x1d8)]())return _0x2cea23(0x1c6);return!![];}});if(!_0x5d7a07['apiKey'])return console[_0x741c3a(0x1c2)]('\x0aSetup\x20cancelled'),0x1;const _0x17b744=_0x5d7a07[_0x741c3a(0x1e5)];console['log'](_0x741c3a(0x1d2));try{const _0x3fd211=TDX[_0x741c3a(0x1b8)]({'site':_0x8017ea,'apiKey':_0x17b744[_0x741c3a(0x1d8)](),'logLevel':_0x2c4221['logLevel']??LogLevel[_0x741c3a(0x1cd)]}),_0x10326b=await _0x3fd211[_0x741c3a(0x1c0)]['getUserInfo']();console[_0x741c3a(0x1c2)](_0x741c3a(0x1e0)+_0x10326b[_0x741c3a(0x1f2)]+')');const _0x5ab155=await isKeychainAvailable();_0x5ab155?(await saveAPIKeyAsync(_0x17b744[_0x741c3a(0x1d8)](),_0x8017ea,_0x5739f6),console['log'](_0x741c3a(0x1a2)+(_0x5739f6?_0x741c3a(0x1bc)+_0x5739f6+')':''))):(console[_0x741c3a(0x1db)](a7_0x3fbf5e[_0x741c3a(0x1d0)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x741c3a(0x1db)](a7_0x3fbf5e[_0x741c3a(0x1d0)](_0x741c3a(0x1de))));if(_0x5739f6){const _0x19ff5c={'site':_0x8017ea};saveProfileToUserConfig(_0x5739f6,_0x19ff5c),console[_0x741c3a(0x1c2)]('✓\x20Profile\x20\x27'+_0x5739f6+_0x741c3a(0x1b9));}else saveDefaultSiteToUserConfig(_0x8017ea),console['log'](_0x741c3a(0x1ec)+_0x8017ea);const _0x27fb8d=_0x5739f6?_0x741c3a(0x1d9)+_0x5739f6:'';return console['log'](),console['log']('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x741c3a(0x1c2)](_0x741c3a(0x1a8)+_0x27fb8d+_0x741c3a(0x1ac)),console[_0x741c3a(0x1c2)](_0x741c3a(0x1a8)+_0x27fb8d+_0x741c3a(0x1c8)),0x0;}catch(_0x10e931){if(_0x10e931 instanceof HTTPClientError&&_0x10e931['status']===0x191)return printAuthError(_0x10e931),0x1;return console[_0x741c3a(0x1e1)](a7_0x3fbf5e[_0x741c3a(0x1a3)](_0x741c3a(0x1a4)+(_0x10e931 instanceof Error?_0x10e931['message']:String(_0x10e931)))),console[_0x741c3a(0x1e1)](_0x741c3a(0x1c9)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0xf89471(0x1e3)]=a7_0xf89471(0x1e6);['description']='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async['execute'](_0xc8ce14){const _0x2d3c37=a7_0xf89471,{options:_0x565b46,tdx:_0x496f58}=_0xc8ce14,_0x372f02=_0x565b46['site'],_0x21f5c5=_0x565b46[_0x2d3c37(0x1dc)],_0x36d036=_0x21f5c5?_0x21f5c5:_0x2d3c37(0x1d6);console[_0x2d3c37(0x1c2)](_0x2d3c37(0x1f1)+_0x36d036+_0x2d3c37(0x1bd)+_0x372f02+')');const _0x5da166=await resolveAPIKeyAsync(_0x372f02,_0x21f5c5);if(_0x5da166){const {source:_0x201785,isDeprecated:_0x31e4d1}=_0x5da166,_0xcc9890='Read\x20credential\x20from\x20'+_0x201785;console['log'](_0x31e4d1?a7_0x3fbf5e[_0x2d3c37(0x1d0)](_0xcc9890):_0xcc9890);}else console[_0x2d3c37(0x1c2)](a7_0x3fbf5e[_0x2d3c37(0x1d0)](_0x2d3c37(0x1cf)));try{const _0x49ebe2=await _0x496f58['jobs'][_0x2d3c37(0x1ab)]();return console[_0x2d3c37(0x1c2)](a7_0x3fbf5e[_0x2d3c37(0x1b0)](_0x2d3c37(0x1be))),console['log'](_0x2d3c37(0x1bb)+_0x49ebe2[_0x2d3c37(0x1f2)]),(_0x49ebe2['first_name']||_0x49ebe2[_0x2d3c37(0x1b2)])&&console[_0x2d3c37(0x1c2)](_0x2d3c37(0x1ca)+[_0x49ebe2[_0x2d3c37(0x1a6)],_0x49ebe2['last_name']][_0x2d3c37(0x1df)](Boolean)[_0x2d3c37(0x1af)]('\x20')),0x0;}catch(_0x576a24){return _0x576a24 instanceof HTTPClientError&&_0x576a24[_0x2d3c37(0x1e2)]===0x191?printAuthError(_0x576a24,!![],_0x21f5c5):console[_0x2d3c37(0x1e1)](a7_0x3fbf5e[_0x2d3c37(0x1a3)]('✗\x20Validation\x20failed:\x20'+(_0x576a24 instanceof Error?_0x576a24[_0x2d3c37(0x1ea)]:String(_0x576a24)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0xf89471(0x1e3)]=a7_0xf89471(0x1cb);[a7_0xf89471(0x1d5)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0xf89471(0x1e7)](_0x396c40){const _0x31a315=a7_0xf89471,{options:_0x261e5e}=_0x396c40,_0xc82cda=_0x261e5e[_0x31a315(0x1dc)];console[_0x31a315(0x1c2)](a7_0x3fbf5e[_0x31a315(0x1d1)](_0x31a315(0x1e8)));const _0x3c9246=await isKeychainAvailable();if(!_0x3c9246)return console[_0x31a315(0x1e1)](a7_0x3fbf5e[_0x31a315(0x1a3)](_0x31a315(0x1ce))),0x1;const _0x49543c=await deleteKeychainAPIKey(_0xc82cda);return _0x49543c?(clearCredentialCache(),console[_0x31a315(0x1c2)](_0x31a315(0x1bf)+(_0xc82cda?_0x31a315(0x1bc)+_0xc82cda+')':'')),0x0):(console[_0x31a315(0x1c2)](_0x31a315(0x1aa)+(_0xc82cda?_0x31a315(0x1d3)+_0xc82cda:'')),0x1);}}
1
+ function a7_0x553e(_0x52471d,_0x5e494e){_0x52471d=_0x52471d-0x7b;const _0x3e25ee=a7_0x3e25();let _0x553ed0=_0x3e25ee[_0x52471d];return _0x553ed0;}const a7_0x5ef7d4=a7_0x553e;(function(_0x5766c6,_0x121695){const _0x41d897=a7_0x553e,_0x301f8c=_0x5766c6();while(!![]){try{const _0x54dac4=parseInt(_0x41d897(0x9a))/0x1+-parseInt(_0x41d897(0xa1))/0x2+-parseInt(_0x41d897(0xae))/0x3+-parseInt(_0x41d897(0xa7))/0x4+-parseInt(_0x41d897(0xb6))/0x5*(parseInt(_0x41d897(0xa3))/0x6)+parseInt(_0x41d897(0xb4))/0x7+parseInt(_0x41d897(0xa0))/0x8*(parseInt(_0x41d897(0xbe))/0x9);if(_0x54dac4===_0x121695)break;else _0x301f8c['push'](_0x301f8c['shift']());}catch(_0x55e18e){_0x301f8c['push'](_0x301f8c['shift']());}}}(a7_0x3e25,0xea1a7));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';function a7_0x3e25(){const _0x43da4a=['\x27\x20registered','bold','green','Remove\x20API\x20key\x20from\x20system\x20keychain','trim','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','profile','execute','605275QzOPEp','last_name','System\x20keychain\x20is\x20not\x20available','password','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','✓\x20API\x20key\x20removed\x20from\x20keychain','30992LqabqW','3561502jiCYgg','test','36giHahi','name','join','site','3060176Pvigsw','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','yellow','\x20\x20tdx','Validating\x20API\x20key...','jobs','\x0aSetup\x20cancelled','2101020lGHOEb','filter','✓\x20Profile\x20\x27','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','✓\x20Authentication\x20successful\x0a','No\x20credential\x20found','9472155rOViZj','log','61620XResvq','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','auth:setup','warn','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20for\x20profile:\x20','auth','other','5391cvLaVo','auth:clear','us01','logLevel','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','customSite','Name:\x20','Select\x20your\x20Treasure\x20Data\x20site:','N/A','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','create','No\x20API\x20key\x20found\x20in\x20keychain','email','status','✓\x20Default\x20site\x20set\x20to\x20','select','Read\x20credential\x20from\x20','apiKey','API\x20key\x20cannot\x20be\x20empty','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','text','tdx:\x20auth\x20clear','first_name','Enter\x20your\x20TD\x20API\x20key:','red','\x20--profile\x20','Site\x20name\x20cannot\x20be\x20empty','Setup\x20API\x20key\x20authentication\x20interactively','description','ERROR','\x20(profile:\x20','error','getUserInfo','message','\x20(site:\x20'];a7_0x3e25=function(){return _0x43da4a;};return a7_0x3e25();}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_0x314409 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_0x2cd97a from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x5ef7d4(0xa4)]=a7_0x5ef7d4(0xb8);[a7_0x5ef7d4(0x8b)]=a7_0x5ef7d4(0x8a);async[a7_0x5ef7d4(0x99)](_0x3d4f26){const _0x54ead9=a7_0x5ef7d4,{options:_0x5b2b32}=_0x3d4f26,_0x47c174=_0x5b2b32[_0x54ead9(0x98)];console['log'](a7_0x2cd97a['bold']('tdx:\x20auth\x20setup'));const _0x3cb360=_0x5b2b32['site']||'us01',{choices:_0x416e04,initialIndex:_0x2e91e7}=buildSiteChoices(_0x3cb360),_0x3df229=_0x47c174?_0x54ead9(0xc9)+_0x47c174+'):':_0x54ead9(0xc7),_0x2a3954=await a7_0x314409({'type':_0x54ead9(0x7e),'name':'site','message':_0x3df229,'choices':_0x416e04,'initial':_0x2e91e7});if(!_0x2a3954[_0x54ead9(0xa6)])return console[_0x54ead9(0xb5)](_0x54ead9(0xad)),0x1;let _0x4a3d4f;if(_0x2a3954[_0x54ead9(0xa6)]===_0x54ead9(0xbd)){const _0x56665c=await a7_0x314409({'type':_0x54ead9(0x83),'name':_0x54ead9(0xc5),'message':'Enter\x20site\x20name:','initial':_0x54ead9(0xc0),'validate':_0x32869f=>{const _0x182809=_0x54ead9;if(!_0x32869f||!_0x32869f['trim']())return _0x182809(0x89);if(!/^[a-z0-9-]+$/[_0x182809(0xa2)](_0x32869f[_0x182809(0x96)]()))return _0x182809(0x97);return!![];}});if(!_0x56665c[_0x54ead9(0xc5)])return console['log'](_0x54ead9(0xad)),0x1;_0x4a3d4f=_0x56665c[_0x54ead9(0xc5)];}else _0x4a3d4f=_0x2a3954['site'];const _0x5bea52=resolveSite(_0x4a3d4f);console[_0x54ead9(0xb5)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x5bea52),console[_0x54ead9(0xb5)](_0x54ead9(0xba)),console[_0x54ead9(0xb5)]('\x20\x20'+getConsoleUrl(_0x5bea52,'/app/mp/ak'));const _0x3aae0e=await a7_0x314409({'type':_0x54ead9(0x9d),'name':_0x54ead9(0x80),'message':_0x54ead9(0x86),'validate':_0x169df6=>{const _0x1636dc=_0x54ead9;if(!_0x169df6||!_0x169df6[_0x1636dc(0x96)]())return _0x1636dc(0x81);return!![];}});if(!_0x3aae0e[_0x54ead9(0x80)])return console[_0x54ead9(0xb5)]('\x0aSetup\x20cancelled'),0x1;const _0x2dc396=_0x3aae0e['apiKey'];console[_0x54ead9(0xb5)](_0x54ead9(0xab));try{const _0x94538=TDX[_0x54ead9(0xca)]({'site':_0x5bea52,'apiKey':_0x2dc396[_0x54ead9(0x96)](),'logLevel':_0x5b2b32[_0x54ead9(0xc1)]??LogLevel[_0x54ead9(0x8c)]}),_0x5c16e5=await _0x94538[_0x54ead9(0xac)][_0x54ead9(0x8f)]();console['log']('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x5c16e5['email']+')');const _0x339128=await isKeychainAvailable();_0x339128?(await saveAPIKeyAsync(_0x2dc396[_0x54ead9(0x96)](),_0x5bea52,_0x47c174),console['log'](_0x54ead9(0x9e)+(_0x47c174?_0x54ead9(0x8d)+_0x47c174+')':''))):(console[_0x54ead9(0xb9)](a7_0x2cd97a['yellow'](_0x54ead9(0xb1))),console['warn'](a7_0x2cd97a[_0x54ead9(0xa9)](_0x54ead9(0xc4))));if(_0x47c174){const _0x27e9e5={'site':_0x5bea52};saveProfileToUserConfig(_0x47c174,_0x27e9e5),console[_0x54ead9(0xb5)](_0x54ead9(0xb0)+_0x47c174+_0x54ead9(0x92));}else saveDefaultSiteToUserConfig(_0x5bea52),console[_0x54ead9(0xb5)](_0x54ead9(0x7d)+_0x5bea52);const _0x48075d=_0x47c174?_0x54ead9(0x88)+_0x47c174:'';return console[_0x54ead9(0xb5)](),console[_0x54ead9(0xb5)](_0x54ead9(0xc3)),console[_0x54ead9(0xb5)]('\x20\x20tdx'+_0x48075d+_0x54ead9(0x82)),console[_0x54ead9(0xb5)](_0x54ead9(0xaa)+_0x48075d+_0x54ead9(0xa8)),0x0;}catch(_0xfc0be8){if(_0xfc0be8 instanceof HTTPClientError&&_0xfc0be8[_0x54ead9(0x7c)]===0x191)return printAuthError(_0xfc0be8),0x1;return console[_0x54ead9(0x8e)](a7_0x2cd97a[_0x54ead9(0x87)]('✗\x20Validation\x20failed:\x20'+(_0xfc0be8 instanceof Error?_0xfc0be8[_0x54ead9(0x90)]:String(_0xfc0be8)))),console[_0x54ead9(0x8e)](_0x54ead9(0xc2)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x5ef7d4(0xa4)]=a7_0x5ef7d4(0xbc);[a7_0x5ef7d4(0x8b)]=a7_0x5ef7d4(0xb7);async[a7_0x5ef7d4(0x99)](_0x404e18){const _0x33e9f3=a7_0x5ef7d4,{options:_0x566564,tdx:_0x5cdf99}=_0x404e18,_0x437ffd=_0x566564[_0x33e9f3(0xa6)],_0x4c1e58=_0x566564['profile'],_0x5bc32c=_0x4c1e58?_0x4c1e58:_0x33e9f3(0xc8);console['log']('tdx\x20profile:\x20'+_0x5bc32c+_0x33e9f3(0x91)+_0x437ffd+')');const _0x45af9d=await resolveAPIKeyAsync(_0x437ffd,_0x4c1e58);if(_0x45af9d){const {source:_0x23724b,isDeprecated:_0x4a7538}=_0x45af9d,_0x3017cb=_0x33e9f3(0x7f)+_0x23724b;console[_0x33e9f3(0xb5)](_0x4a7538?a7_0x2cd97a[_0x33e9f3(0xa9)](_0x3017cb):_0x3017cb);}else console[_0x33e9f3(0xb5)](a7_0x2cd97a[_0x33e9f3(0xa9)](_0x33e9f3(0xb3)));try{const _0x5030d8=await _0x5cdf99[_0x33e9f3(0xac)][_0x33e9f3(0x8f)]();return console['log'](a7_0x2cd97a[_0x33e9f3(0x94)](_0x33e9f3(0xb2))),console[_0x33e9f3(0xb5)]('User:\x20'+_0x5030d8[_0x33e9f3(0x7b)]),(_0x5030d8[_0x33e9f3(0x85)]||_0x5030d8[_0x33e9f3(0x9b)])&&console[_0x33e9f3(0xb5)](_0x33e9f3(0xc6)+[_0x5030d8[_0x33e9f3(0x85)],_0x5030d8[_0x33e9f3(0x9b)]][_0x33e9f3(0xaf)](Boolean)[_0x33e9f3(0xa5)]('\x20')),0x0;}catch(_0x71a6f2){return _0x71a6f2 instanceof HTTPClientError&&_0x71a6f2[_0x33e9f3(0x7c)]===0x191?printAuthError(_0x71a6f2,!![],_0x4c1e58):console[_0x33e9f3(0x8e)](a7_0x2cd97a['red']('✗\x20Validation\x20failed:\x20'+(_0x71a6f2 instanceof Error?_0x71a6f2['message']:String(_0x71a6f2)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x5ef7d4(0xa4)]=a7_0x5ef7d4(0xbf);[a7_0x5ef7d4(0x8b)]=a7_0x5ef7d4(0x95);async[a7_0x5ef7d4(0x99)](_0x1d6726){const _0x3363bc=a7_0x5ef7d4,{options:_0x23fabf}=_0x1d6726,_0x3f6b79=_0x23fabf['profile'];console[_0x3363bc(0xb5)](a7_0x2cd97a[_0x3363bc(0x93)](_0x3363bc(0x84)));const _0x5b27de=await isKeychainAvailable();if(!_0x5b27de)return console[_0x3363bc(0x8e)](a7_0x2cd97a[_0x3363bc(0x87)](_0x3363bc(0x9c))),0x1;const _0x2574da=await deleteKeychainAPIKey(_0x3f6b79);return _0x2574da?(clearCredentialCache(),console[_0x3363bc(0xb5)](_0x3363bc(0x9f)+(_0x3f6b79?'\x20(profile:\x20'+_0x3f6b79+')':'')),0x0):(console['log'](_0x3363bc(0xcb)+(_0x3f6b79?_0x3363bc(0xbb)+_0x3f6b79:'')),0x1);}}
@@ -1 +1 @@
1
- const a8_0x2dccbc=a8_0x1e77;(function(_0x411f01,_0x463255){const _0x17190e=a8_0x1e77,_0xade0ee=_0x411f01();while(!![]){try{const _0x51c8e3=-parseInt(_0x17190e(0xba))/0x1+-parseInt(_0x17190e(0xd6))/0x2*(-parseInt(_0x17190e(0xdc))/0x3)+-parseInt(_0x17190e(0xe9))/0x4+parseInt(_0x17190e(0xc2))/0x5*(parseInt(_0x17190e(0xc8))/0x6)+parseInt(_0x17190e(0xe8))/0x7*(parseInt(_0x17190e(0xe6))/0x8)+parseInt(_0x17190e(0xdb))/0x9+-parseInt(_0x17190e(0xc6))/0xa*(parseInt(_0x17190e(0xe3))/0xb);if(_0x51c8e3===_0x463255)break;else _0xade0ee['push'](_0xade0ee['shift']());}catch(_0x426473){_0xade0ee['push'](_0xade0ee['shift']());}}}(a8_0x18e6,0x27afb));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';function a8_0x1e77(_0x5d3ed3,_0x4e50d7){_0x5d3ed3=_0x5d3ed3-0xba;const _0x18e69d=a8_0x18e6();let _0x1e7792=_0x18e69d[_0x5d3ed3];return _0x1e7792;}import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';function a8_0x18e6(){const _0x2dd80f=['llmProject','execute','\x0aStack\x20trace:','182722WShSiT','verbose','Resolving\x20project\x20\x27','getOrCreateDefaultAgent','includes','1553355VbDQme','3OgcAQY','llm','metadata','llmAgent','Resolving\x20agent\x20\x27','resolveAgentId','\x20\x20Cause:\x20','11MJCNdt','Error:\x20','new','584rUMRAj','chat','20118BPeMgl','148948aqBPzi','cause','CHAT_NOT_FOUND','stack','\x27...','log','--agent\x20flag','name','data','error','join','76725OaDgEO','claude-4.5-haiku','resolveProjectId','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','stdout','write','validate','10euDHTk','streamChat','handleChatEvent','getAgentId','3910310ZANeSW','agent','581370rCGahz','\x0aError:\x20','message','Using\x20agent\x20from\x20','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','Getting\x20default\x20agent...','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','description','chatId','404','type'];a8_0x18e6=function(){return _0x2dd80f;};return a8_0x18e6();}import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function handleSDKError(_0x1e95e3,_0x14d7e2){const _0x4298ff=a8_0x1e77;if(_0x1e95e3 instanceof SDKError)console[_0x4298ff(0xf2)](_0x4298ff(0xe4)+_0x1e95e3[_0x4298ff(0xca)]),_0x14d7e2[_0x4298ff(0xd7)]&&(_0x1e95e3['cause']&&console['error'](_0x4298ff(0xe2)+_0x1e95e3[_0x4298ff(0xea)]),_0x1e95e3[_0x4298ff(0xec)]&&(console[_0x4298ff(0xf2)](_0x4298ff(0xd5)),console[_0x4298ff(0xf2)](_0x1e95e3[_0x4298ff(0xec)])));else throw _0x1e95e3;}export class ChatCommand extends BaseCommand{['name']=a8_0x2dccbc(0xe7);[a8_0x2dccbc(0xcf)]=a8_0x2dccbc(0xbe);[a8_0x2dccbc(0xc1)](_0x5a5ffa){const _0x590157=a8_0x2dccbc,_0xf258f3=_0x5a5ffa['args'][_0x590157(0xf3)]('\x20');if(!_0xf258f3)return _0x590157(0xbd);return undefined;}async['streamChat'](_0xa3cc69,_0x3fef3c,_0xc96992,_0x152b3d,_0x103ace){const _0x105dd6=a8_0x2dccbc;for await(const _0x2402f9 of _0xa3cc69[_0x105dd6(0xdd)][_0x105dd6(0xe7)](_0x3fef3c,{'agentId':_0xc96992,'chatId':_0x152b3d})){if(_0x2402f9[_0x105dd6(0xd2)]===_0x105dd6(0xde)){const _0x4bfa4e=_0x2402f9['data'][_0x105dd6(0xd0)];saveLastChatId(_0x4bfa4e),_0x103ace&&console[_0x105dd6(0xf2)]('Chat\x20session:\x20'+_0x4bfa4e);}else _0x2402f9['type']==='event'&&this[_0x105dd6(0xc4)](_0x2402f9[_0x105dd6(0xf1)]);}}async[a8_0x2dccbc(0xc5)](_0x548622,_0x2a5932,_0x9c78c,_0x156f0d,_0x5d4db3){const _0xb860f1=a8_0x2dccbc,_0x55a810=_0x2a5932||_0x9c78c;if(_0x55a810){const {projectName:_0x4c87e5,agentName:_0x4e3456}=parseAgentRef(_0x55a810),_0x56443f=_0x4e3456||_0x55a810,_0x42a3d6=_0x4e3456?_0x4c87e5:_0x156f0d;if(!_0x42a3d6)throw new Error(_0xb860f1(0xce));if(_0x5d4db3){const _0x43d8c7=_0x2a5932?_0xb860f1(0xef):'session\x20context';console[_0xb860f1(0xf2)](_0xb860f1(0xcb)+_0x43d8c7+':\x20'+_0x42a3d6+'/'+_0x56443f);}const _0x179515=await withSpinner(_0xb860f1(0xd8)+_0x42a3d6+'\x27...',()=>_0x548622['llm'][_0xb860f1(0xbc)](_0x42a3d6),{'verbose':_0x5d4db3}),_0x144dd3=await withSpinner(_0xb860f1(0xe0)+_0x56443f+_0xb860f1(0xed),()=>_0x548622[_0xb860f1(0xdd)][_0xb860f1(0xe1)](_0x56443f,_0x179515[_0xb860f1(0xf1)]),{'verbose':_0x5d4db3});return _0x144dd3[_0xb860f1(0xf1)];}else{const _0x328ed4=_0x548622[_0xb860f1(0xdd)]['getDefaultAgent']();if(_0x328ed4)return _0x5d4db3&&console[_0xb860f1(0xf2)]('Using\x20cached\x20default\x20agent:\x20'+_0x328ed4[_0xb860f1(0xf0)]),_0x328ed4['id'];const _0x344dbb=await withSpinner(_0xb860f1(0xcd),()=>_0x548622[_0xb860f1(0xdd)][_0xb860f1(0xd9)](_0xb860f1(0xbb),0x0),{'verbose':_0x5d4db3});return _0x344dbb[_0xb860f1(0xf1)]['id'];}}async[a8_0x2dccbc(0xd4)](_0x3f051c){const _0x62be23=a8_0x2dccbc,{options:_0x4df2b3,args:_0x17766a,tdx:_0x49a698}=_0x3f051c,_0x41ad88=_0x17766a[_0x62be23(0xf3)]('\x20'),_0x2b2e71=_0x4df2b3,_0x7b2d61=_0x2b2e71[_0x62be23(0xc7)],_0x671b2=_0x2b2e71[_0x62be23(0xdf)],_0x25bc6d=_0x2b2e71[_0x62be23(0xd3)],_0x3b86fc=_0x2b2e71[_0x62be23(0xe5)];try{let _0x3f9dcf,_0x49cf78;!_0x3b86fc&&(_0x49cf78=loadLastChatId(),_0x49cf78&&_0x4df2b3['verbose']&&console[_0x62be23(0xf2)]('Continuing\x20chat:\x20'+_0x49cf78));(_0x3b86fc||!_0x49cf78)&&(_0x3f9dcf=await this['getAgentId'](_0x49a698,_0x7b2d61,_0x671b2,_0x25bc6d,_0x4df2b3[_0x62be23(0xd7)]));try{await this[_0x62be23(0xc3)](_0x49a698,_0x41ad88,_0x3f9dcf,_0x49cf78,_0x4df2b3[_0x62be23(0xd7)]);}catch(_0xe3b004){const _0x52221a=_0xe3b004 instanceof SDKError&&_0xe3b004['code']===ErrorCode[_0x62be23(0xeb)]||_0xe3b004 instanceof Error&&_0xe3b004[_0x62be23(0xca)][_0x62be23(0xda)](_0x62be23(0xd1));if(_0x52221a)_0x4df2b3[_0x62be23(0xd7)]&&console[_0x62be23(0xf2)](_0x62be23(0xcc)),!_0x3f9dcf&&(_0x3f9dcf=await this[_0x62be23(0xc5)](_0x49a698,_0x7b2d61,_0x671b2,_0x25bc6d,_0x4df2b3[_0x62be23(0xd7)])),await this[_0x62be23(0xc3)](_0x49a698,_0x41ad88,_0x3f9dcf,undefined,_0x4df2b3[_0x62be23(0xd7)]);else throw _0xe3b004;}return console[_0x62be23(0xee)](),0x0;}catch(_0x36e9fd){return console['error'](),handleSDKError(_0x36e9fd,_0x4df2b3),0x1;}}[a8_0x2dccbc(0xc4)](_0x207417){const _0x47f3ee=a8_0x2dccbc;if('content'in _0x207417)process[_0x47f3ee(0xbf)][_0x47f3ee(0xc0)](_0x207417['content']);else'error'in _0x207417&&console['error'](_0x47f3ee(0xc9)+_0x207417[_0x47f3ee(0xf2)]);}}
1
+ const a8_0x245f1a=a8_0x17b3;(function(_0x4f2369,_0x5701d){const _0x26cddd=a8_0x17b3,_0x21c600=_0x4f2369();while(!![]){try{const _0x14538f=-parseInt(_0x26cddd(0x17b))/0x1+-parseInt(_0x26cddd(0x18e))/0x2+-parseInt(_0x26cddd(0x180))/0x3*(-parseInt(_0x26cddd(0x187))/0x4)+-parseInt(_0x26cddd(0x17e))/0x5+parseInt(_0x26cddd(0x17c))/0x6+-parseInt(_0x26cddd(0x185))/0x7+parseInt(_0x26cddd(0x16e))/0x8*(parseInt(_0x26cddd(0x17f))/0x9);if(_0x14538f===_0x5701d)break;else _0x21c600['push'](_0x21c600['shift']());}catch(_0xf4ad63){_0x21c600['push'](_0x21c600['shift']());}}}(a8_0x5ee0,0x7d76e));function a8_0x5ee0(){const _0x241335=['join','resolveAgentId','getAgentId','resolveProjectId','streamChat','getOrCreateDefaultAgent','\x0aError:\x20','404','Continuing\x20chat:\x20','event','587396nKvlcL','4677936vBCOcS','error','3854445CkDDuB','19953PuFnxS','9mJvVLe','Error:\x20','session\x20context','content','stack','2241533KPLhYM','Getting\x20default\x20agent...','1216988mntCRv','Using\x20agent\x20from\x20','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','metadata','cause','getDefaultAgent','1385474hYRTgj','stdout','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','log','description','type','validate','chatId','message','CHAT_NOT_FOUND','includes','claude-4.5-haiku','args','Resolving\x20project\x20\x27','name','Using\x20cached\x20default\x20agent:\x20','\x0aStack\x20trace:','\x27...','code','handleChatEvent','verbose','data','llmAgent','4304EmRBYN','chat','llm'];a8_0x5ee0=function(){return _0x241335;};return a8_0x5ee0();}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 handleSDKError(_0x49a70e,_0x125df8){const _0x2b2c73=a8_0x17b3;if(_0x49a70e instanceof SDKError)console[_0x2b2c73(0x17d)](_0x2b2c73(0x181)+_0x49a70e[_0x2b2c73(0x196)]),_0x125df8[_0x2b2c73(0x1a2)]&&(_0x49a70e[_0x2b2c73(0x18c)]&&console['error']('\x20\x20Cause:\x20'+_0x49a70e['cause']),_0x49a70e[_0x2b2c73(0x184)]&&(console['error'](_0x2b2c73(0x19e)),console[_0x2b2c73(0x17d)](_0x49a70e[_0x2b2c73(0x184)])));else throw _0x49a70e;}function a8_0x17b3(_0x3a3a6c,_0x2e62a8){_0x3a3a6c=_0x3a3a6c-0x16e;const _0x5ee009=a8_0x5ee0();let _0x17b383=_0x5ee009[_0x3a3a6c];return _0x17b383;}export class ChatCommand extends BaseCommand{['name']=a8_0x245f1a(0x16f);[a8_0x245f1a(0x192)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a8_0x245f1a(0x194)](_0x879846){const _0x32b060=a8_0x245f1a,_0x45f8e5=_0x879846[_0x32b060(0x19a)]['join']('\x20');if(!_0x45f8e5)return _0x32b060(0x189);return undefined;}async['streamChat'](_0x42cace,_0x55dc46,_0x21ec00,_0x51c54f,_0x45db09){const _0x54416d=a8_0x245f1a;for await(const _0x9d88fb of _0x42cace[_0x54416d(0x170)][_0x54416d(0x16f)](_0x55dc46,{'agentId':_0x21ec00,'chatId':_0x51c54f})){if(_0x9d88fb['type']===_0x54416d(0x18b)){const _0x411fab=_0x9d88fb['data'][_0x54416d(0x195)];saveLastChatId(_0x411fab),_0x45db09&&console[_0x54416d(0x17d)]('Chat\x20session:\x20'+_0x411fab);}else _0x9d88fb[_0x54416d(0x193)]===_0x54416d(0x17a)&&this['handleChatEvent'](_0x9d88fb[_0x54416d(0x1a3)]);}}async[a8_0x245f1a(0x173)](_0x1cc3d4,_0x140a9d,_0x584658,_0x2bf3a1,_0x2b2593){const _0x39d0d6=a8_0x245f1a,_0x896602=_0x140a9d||_0x584658;if(_0x896602){const {projectName:_0x3ad505,agentName:_0x456fd7}=parseAgentRef(_0x896602),_0x1662c1=_0x456fd7||_0x896602,_0x24b424=_0x456fd7?_0x3ad505:_0x2bf3a1;if(!_0x24b424)throw new Error(_0x39d0d6(0x18a));if(_0x2b2593){const _0x3a1474=_0x140a9d?'--agent\x20flag':_0x39d0d6(0x182);console[_0x39d0d6(0x17d)](_0x39d0d6(0x188)+_0x3a1474+':\x20'+_0x24b424+'/'+_0x1662c1);}const _0x24d5d9=await withSpinner(_0x39d0d6(0x19b)+_0x24b424+_0x39d0d6(0x19f),()=>_0x1cc3d4[_0x39d0d6(0x170)][_0x39d0d6(0x174)](_0x24b424),{'verbose':_0x2b2593}),_0x5ef850=await withSpinner('Resolving\x20agent\x20\x27'+_0x1662c1+'\x27...',()=>_0x1cc3d4[_0x39d0d6(0x170)][_0x39d0d6(0x172)](_0x1662c1,_0x24d5d9['data']),{'verbose':_0x2b2593});return _0x5ef850[_0x39d0d6(0x1a3)];}else{const _0x69e917=_0x1cc3d4[_0x39d0d6(0x170)][_0x39d0d6(0x18d)]();if(_0x69e917)return _0x2b2593&&console[_0x39d0d6(0x17d)](_0x39d0d6(0x19d)+_0x69e917[_0x39d0d6(0x19c)]),_0x69e917['id'];const _0x1f23a9=await withSpinner(_0x39d0d6(0x186),()=>_0x1cc3d4['llm'][_0x39d0d6(0x176)](_0x39d0d6(0x199),0x0),{'verbose':_0x2b2593});return _0x1f23a9[_0x39d0d6(0x1a3)]['id'];}}async['execute'](_0x2097b1){const _0x2716e9=a8_0x245f1a,{options:_0x559d1e,args:_0x7f847,tdx:_0x44acc6}=_0x2097b1,_0x3893de=_0x7f847[_0x2716e9(0x171)]('\x20'),_0x3d3d7b=_0x559d1e,_0x44a75d=_0x3d3d7b['agent'],_0x32946b=_0x3d3d7b[_0x2716e9(0x1a4)],_0x3745cb=_0x3d3d7b['llmProject'],_0x35c9b8=_0x3d3d7b['new'];try{let _0x26597a,_0x5dfbeb;!_0x35c9b8&&(_0x5dfbeb=loadLastChatId(),_0x5dfbeb&&_0x559d1e[_0x2716e9(0x1a2)]&&console[_0x2716e9(0x17d)](_0x2716e9(0x179)+_0x5dfbeb));(_0x35c9b8||!_0x5dfbeb)&&(_0x26597a=await this['getAgentId'](_0x44acc6,_0x44a75d,_0x32946b,_0x3745cb,_0x559d1e[_0x2716e9(0x1a2)]));try{await this[_0x2716e9(0x175)](_0x44acc6,_0x3893de,_0x26597a,_0x5dfbeb,_0x559d1e[_0x2716e9(0x1a2)]);}catch(_0x3329ee){const _0x3a550a=_0x3329ee instanceof SDKError&&_0x3329ee[_0x2716e9(0x1a0)]===ErrorCode[_0x2716e9(0x197)]||_0x3329ee instanceof Error&&_0x3329ee[_0x2716e9(0x196)][_0x2716e9(0x198)](_0x2716e9(0x178));if(_0x3a550a)_0x559d1e['verbose']&&console['error'](_0x2716e9(0x190)),!_0x26597a&&(_0x26597a=await this['getAgentId'](_0x44acc6,_0x44a75d,_0x32946b,_0x3745cb,_0x559d1e['verbose'])),await this[_0x2716e9(0x175)](_0x44acc6,_0x3893de,_0x26597a,undefined,_0x559d1e[_0x2716e9(0x1a2)]);else throw _0x3329ee;}return console[_0x2716e9(0x191)](),0x0;}catch(_0x4d38b8){return console[_0x2716e9(0x17d)](),handleSDKError(_0x4d38b8,_0x559d1e),0x1;}}[a8_0x245f1a(0x1a1)](_0x214f21){const _0x339297=a8_0x245f1a;if(_0x339297(0x183)in _0x214f21)process[_0x339297(0x18f)]['write'](_0x214f21[_0x339297(0x183)]);else _0x339297(0x17d)in _0x214f21&&console['error'](_0x339297(0x177)+_0x214f21[_0x339297(0x17d)]);}}