@treasuredata/tdx 0.23.0 → 0.23.1

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 (163) 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/prompt.js +1 -1
  157. package/dist/utils/spinner.js +1 -1
  158. package/dist/utils/sse-parser.js +1 -1
  159. package/dist/utils/string-utils.js +1 -1
  160. package/dist/utils/table-ref-parser.js +1 -1
  161. package/dist/utils/tdx-logger.js +1 -1
  162. package/dist/utils/version-check.js +1 -1
  163. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x127e26=a3_0xe8e5;(function(_0x54c032,_0x35d09d){const _0x23842c=a3_0xe8e5,_0x4830a3=_0x54c032();while(!![]){try{const _0x4b19a2=-parseInt(_0x23842c(0x159))/0x1+-parseInt(_0x23842c(0x143))/0x2+-parseInt(_0x23842c(0x13f))/0x3*(parseInt(_0x23842c(0x15e))/0x4)+parseInt(_0x23842c(0x158))/0x5+parseInt(_0x23842c(0x14e))/0x6+parseInt(_0x23842c(0x140))/0x7*(-parseInt(_0x23842c(0x152))/0x8)+parseInt(_0x23842c(0x149))/0x9;if(_0x4b19a2===_0x35d09d)break;else _0x4830a3['push'](_0x4830a3['shift']());}catch(_0xaec1f0){_0x4830a3['push'](_0x4830a3['shift']());}}}(a3_0x5545,0xf0159));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a3_0x5545(){const _0x58e627=['Listing\x20activations\x20for\x20segment\x20\x27','\x20activation','resolveParentId','resolveSegmentId','68TRdHAZ','activations','data','verbose','✔\x20Found\x20','name','Error:\x20','List\x20activations\x20for\x20a\x20segment','Resolving\x20parent\x20segment\x20\x27','324003DejdTp','7JhuxOP','Site:\x20','execute','2651744UbetDE','Resolved\x20child\x20ID:\x20','Child\x20name:\x20','segment','\x20\x20Cause:\x20','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','33909012HzXgVm','message','cause','length','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','9596796fkrXaP','Error:\x20Segment\x20name\x20is\x20required','Resolving\x20child\x20segment\x20\x27','Resolved\x20parent\x20ID:\x20','10692968fMyFvd','Parent\x20name:\x20','\x27...','site','error','description','8016550dJlKMx','1488549PVIoSd'];a3_0x5545=function(){return _0x58e627;};return a3_0x5545();}function a3_0xe8e5(_0x236c18,_0x1e43fc){_0x236c18=_0x236c18-0x13b;const _0x5545b8=a3_0x5545();let _0xe8e57c=_0x5545b8[_0x236c18];return _0xe8e57c;}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x127e26(0x13b)]=a3_0x127e26(0x15f);[a3_0x127e26(0x157)]=a3_0x127e26(0x13d);async[a3_0x127e26(0x142)](_0x4d02e8){const _0x845dfb=a3_0x127e26,{options:_0x5188c0,args:_0x55d1a8,tdx:_0x2ea68a}=_0x4d02e8;if(_0x55d1a8[_0x845dfb(0x14c)]===0x0)return console[_0x845dfb(0x156)](_0x845dfb(0x14f)),console[_0x845dfb(0x156)](_0x845dfb(0x14d)),0x1;try{const {parentId:_0x449998,childId:_0x27657f}=parseSegmentRef(_0x55d1a8[0x0]);if(!_0x27657f)return console['error'](_0x845dfb(0x148)),console[_0x845dfb(0x156)](_0x845dfb(0x14d)),0x1;_0x5188c0[_0x845dfb(0x161)]&&(console['error'](_0x845dfb(0x141)+_0x5188c0[_0x845dfb(0x155)]),console[_0x845dfb(0x156)](_0x845dfb(0x153)+_0x449998),console[_0x845dfb(0x156)](_0x845dfb(0x145)+_0x27657f));const _0x3c6904=await withSpinner(_0x845dfb(0x13e)+_0x449998+_0x845dfb(0x154),()=>_0x2ea68a[_0x845dfb(0x146)][_0x845dfb(0x15c)](_0x449998),{'verbose':_0x5188c0['verbose']}),_0x5d04f2=_0x3c6904['data'];_0x5188c0['verbose']&&console[_0x845dfb(0x156)](_0x845dfb(0x151)+_0x5d04f2);const _0xa5102e=await withSpinner(_0x845dfb(0x150)+_0x27657f+_0x845dfb(0x154),()=>_0x2ea68a[_0x845dfb(0x146)][_0x845dfb(0x15d)](_0x5d04f2,_0x27657f),{'verbose':_0x5188c0[_0x845dfb(0x161)]}),_0x38b60c=_0xa5102e[_0x845dfb(0x160)];_0x5188c0[_0x845dfb(0x161)]&&console[_0x845dfb(0x156)](_0x845dfb(0x144)+_0x38b60c);const _0x43a3d9=await withSpinner(_0x845dfb(0x15a)+_0x27657f+'\x27...',()=>_0x2ea68a[_0x845dfb(0x146)]['listActivations'](_0x5d04f2,_0x38b60c),{'verbose':_0x5188c0[_0x845dfb(0x161)]}),_0x19f824=_0x43a3d9[_0x845dfb(0x160)];return console[_0x845dfb(0x156)](_0x845dfb(0x162)+_0x19f824[_0x845dfb(0x14c)]+_0x845dfb(0x15b)+(_0x19f824[_0x845dfb(0x14c)]!==0x1?'s':'')),await handleSDKOutput(_0x19f824,_0x5188c0),0x0;}catch(_0x269111){if(_0x269111 instanceof SDKError)return console[_0x845dfb(0x156)](_0x845dfb(0x13c)+_0x269111[_0x845dfb(0x14a)]),_0x269111['cause']&&console[_0x845dfb(0x156)](_0x845dfb(0x147)+_0x269111[_0x845dfb(0x14b)]),0x1;throw _0x269111;}}}
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 +1 @@
1
- const a4_0x3b07ea=a4_0xfd7b;(function(_0x3a5f54,_0x5057d4){const _0x3c8a2e=a4_0xfd7b,_0x447c58=_0x3a5f54();while(!![]){try{const _0x5f8901=parseInt(_0x3c8a2e(0x150))/0x1+parseInt(_0x3c8a2e(0x142))/0x2+-parseInt(_0x3c8a2e(0x19f))/0x3+-parseInt(_0x3c8a2e(0x131))/0x4+parseInt(_0x3c8a2e(0x152))/0x5*(-parseInt(_0x3c8a2e(0x1a0))/0x6)+parseInt(_0x3c8a2e(0x189))/0x7*(-parseInt(_0x3c8a2e(0x15e))/0x8)+parseInt(_0x3c8a2e(0x1b1))/0x9;if(_0x5f8901===_0x5057d4)break;else _0x447c58['push'](_0x447c58['shift']());}catch(_0x3109ca){_0x447c58['push'](_0x447c58['shift']());}}}(a4_0x2dbe,0x1c51a));import a4_0x24f204 from'chalk';import a4_0xfafc92 from'path';import{existsSync,readFileSync}from'fs';function a4_0x2dbe(){const _0x4441e0=['Project:\x20','\x0a✔\x20Pushed\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)','\x0aPull\x20summary\x20for\x20\x27','Failed\x20to\x20push\x20agent:\x20','\x20\x20Prompt\x20\x22','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x27\x20to\x20create\x20the\x20folder\x20structure.','Clone\x20\x22','no_local_folder','total','Summary:','<new-name>','Using\x20project\x20from\x20','llm','\x0aChanges\x20to\x20prompt\x20\x27','tdx.json','Pulling\x20agent\x20\x22','isNew','agents','dryRun','\x22\x20from\x20project\x20\x22','Output\x20path:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','agentId','Agent\x20pulled\x20successfully','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','integrations','Dry\x20run\x20-\x20no\x20files\x20written','agent.yml','prompts','\x20\x20Agent\x20\x22','Using\x20project:\x20','Agent\x20','763588Dwbmcf','\x22\x20to\x20new\x20project\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','red','utf-8','Agent:\x20','repeat','Cannot\x20clone\x20from\x20context\x20project\x20\x22','knowledgeBases','\x20errors','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20changed','✔\x20Context\x20set:\x20','Using\x20local\x20project:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','pullProject','pushProject','hasChanges','dirname','Pushing\x20to\x20project...','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aError:','322134WQMEqd','30kmAjbm','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Project\x20cloned\x20successfully','\x20--profile\x20','INVALID_ARGUMENT','yellow','\x20new','updated','\x20\x20Prompts:\x20','\x0aProject\x20pushed\x20with\x20errors','MISSING_ARGUMENT','message','\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','projectName','\x20files\x20to\x20','parse','Would\x20clone:','4046769iRtSxj','no_context','Cloning\x20\x22','\x22:\x20','New\x20project\x20name\x20is\x20required','gray','\x20=\x20','\x0aErrors\x20found:','context','\x20files?','\x20\x20Knowledge\x20Base\x20\x22','llm_project','\x20--name\x20','\x0aChanges\x20to\x20integration\x20\x27','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Cancelled','log','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','cwd','\x0aChanges:','cyan','No\x20tdx.json\x20found\x20in\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','error','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x22\x20to\x20\x22','pullAgent','Using\x20current\x20project:\x20','\x22\x20to\x20a\x20different\x20profile','action','reason','\x20\x20Integrations:\x20','New\x20project:\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','join','name','\x20\x20tdx\x20agent\x20pull\x20','dim','\x20\x20Text\x20Knowledge\x20Base\x20\x22','377940BqfVZP','-\x20no\x20files\x20written','projectId','Would\x20pull\x20agent:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','diff','outputPath','\x0aPush\x20summary\x20for\x20\x27','\x20successfully','description','newProjectId','session','Errors:','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','agentName','\x0a✔\x20Pulled\x20','\x0aWrite\x20','109886DmIxkq','Pushing\x20agent\x20from\x20\x22','Project\x20cloned\x20with\x20errors','push','Output:\x20','\x20\x20Source:\x20','New\x20project\x20ID:\x20','execute','\x20|\x20','created','\x0aChanges\x20to\x20agent\x20\x27','errors','site','counts','217296OBJsBD','textKnowledgeBases','185855KDdUrN','\x22...','Dry\x20run\x20-\x20no\x20changes\x20made','\x20\x20Knowledge\x20Bases:\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Target:\x20','green','\x20resources?','found','outputDir','yes','Source:\x20','16SlhkFb','\x20updated','\x20unchanged','\x20\x20Agents:\x20','new','Status:\x20','unchanged','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','llmProject'];a4_0x2dbe=function(){return _0x4441e0;};return a4_0x2dbe();}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';function a4_0xfd7b(_0x33f3f9,_0x16fd6e){_0x33f3f9=_0x33f3f9-0x12f;const _0x2dbe1f=a4_0x2dbe();let _0xfd7b63=_0x2dbe1f[_0x33f3f9];return _0xfd7b63;}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(_0x2b2735){const _0x48c887=a4_0xfd7b,_0x42e69d=[];if(_0x2b2735[_0x48c887(0x171)]!==undefined)_0x42e69d[_0x48c887(0x145)](_0x2b2735['total']+'\x20total');if(_0x2b2735[_0x48c887(0x162)]!==undefined&&_0x2b2735['new']>0x0)_0x42e69d[_0x48c887(0x145)](a4_0x24f204[_0x48c887(0x158)](_0x2b2735['new']+_0x48c887(0x1a6)));if(_0x2b2735[_0x48c887(0x14b)]!==undefined&&_0x2b2735[_0x48c887(0x14b)]>0x0)_0x42e69d['push'](a4_0x24f204[_0x48c887(0x158)](_0x2b2735['created']+'\x20created'));if(_0x2b2735[_0x48c887(0x1a7)]!==undefined&&_0x2b2735[_0x48c887(0x1a7)]>0x0)_0x42e69d[_0x48c887(0x145)](a4_0x24f204[_0x48c887(0x1a5)](_0x2b2735['updated']+_0x48c887(0x15f)));if(_0x2b2735[_0x48c887(0x164)]!==undefined&&_0x2b2735['unchanged']>0x0)_0x42e69d['push'](a4_0x24f204[_0x48c887(0x1b6)](_0x2b2735[_0x48c887(0x164)]+_0x48c887(0x160)));if(_0x2b2735[_0x48c887(0x14d)]!==undefined&&_0x2b2735[_0x48c887(0x14d)]>0x0)_0x42e69d['push'](a4_0x24f204[_0x48c887(0x18c)](_0x2b2735['errors']+_0x48c887(0x192)));return _0x42e69d[_0x48c887(0x1d4)](',\x20');}function displayDiffs(_0xcffd91,_0x4e99ff,_0x47317b,_0xeb746c,_0x4d8707=[]){const _0x241fbb=a4_0xfd7b;for(const _0x1d4cec of _0xcffd91){if(_0x1d4cec[_0x241fbb(0x136)]){const _0x31d91d=_0x1d4cec[_0x241fbb(0x13f)]||_0x1d4cec[_0x241fbb(0x1d5)];console['log'](_0x241fbb(0x14c)+_0x31d91d+'\x27:'),console[_0x241fbb(0x1c1)]('─'[_0x241fbb(0x18f)](0x3c)),console[_0x241fbb(0x1c1)](_0x1d4cec['diff']),console[_0x241fbb(0x1c1)]('─'[_0x241fbb(0x18f)](0x3c));}}for(const _0x99d07b of _0x4e99ff){_0x99d07b[_0x241fbb(0x136)]&&(console[_0x241fbb(0x1c1)](_0x241fbb(0x193)+_0x99d07b[_0x241fbb(0x1d5)]+'\x27:'),console[_0x241fbb(0x1c1)]('─'[_0x241fbb(0x18f)](0x3c)),console['log'](_0x99d07b[_0x241fbb(0x136)]),console['log']('─'[_0x241fbb(0x18f)](0x3c)));}for(const _0x38a7a9 of _0x47317b){_0x38a7a9[_0x241fbb(0x136)]&&(console['log'](_0x241fbb(0x16d)+_0x38a7a9[_0x241fbb(0x1d5)]+'\x27:'),console[_0x241fbb(0x1c1)]('─'[_0x241fbb(0x18f)](0x3c)),console[_0x241fbb(0x1c1)](_0x38a7a9[_0x241fbb(0x136)]),console['log']('─'[_0x241fbb(0x18f)](0x3c)));}for(const _0x2fca3c of _0xeb746c){_0x2fca3c['diff']&&(console[_0x241fbb(0x1c1)](_0x241fbb(0x176)+_0x2fca3c['name']+'\x27:'),console[_0x241fbb(0x1c1)]('─'[_0x241fbb(0x18f)](0x3c)),console['log'](_0x2fca3c[_0x241fbb(0x136)]),console[_0x241fbb(0x1c1)]('─'[_0x241fbb(0x18f)](0x3c)));}for(const _0x4704d6 of _0x4d8707){_0x4704d6[_0x241fbb(0x136)]&&(console['log'](_0x241fbb(0x1be)+_0x4704d6[_0x241fbb(0x1d5)]+'\x27:'),console['log']('─'[_0x241fbb(0x18f)](0x3c)),console[_0x241fbb(0x1c1)](_0x4704d6[_0x241fbb(0x136)]),console[_0x241fbb(0x1c1)]('─'[_0x241fbb(0x18f)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x3b07ea(0x1d5)]='agent:pull';['description']=a4_0x3b07ea(0x197);async[a4_0x3b07ea(0x149)](_0x36cefd){const _0x237fe2=a4_0x3b07ea,{options:_0x8f378,args:_0x159a17,tdx:_0x4f7d96}=_0x36cefd,_0x527f28=_0x159a17[0x0],_0x36a093=_0x159a17[0x1],_0x5356cc=_0x8f378['output'],_0x23932f=_0x8f378['dryRun'],_0x40eabe=_0x8f378['force'],_0x301dc2=_0x8f378['yes'],_0xaeb68a=_0x8f378[_0x237fe2(0x166)];let _0x1f5352,_0x2694de;const _0x24c47a=findAgentConfigPath(process[_0x237fe2(0x1c3)]());if(_0x527f28){const _0x79aabb=a4_0xfafc92[_0x237fe2(0x1d4)](_0x527f28,'tdx.json');if(existsSync(_0x79aabb))try{const _0x3bce2a=JSON[_0x237fe2(0x1af)](readFileSync(_0x79aabb,'utf-8'));_0x1f5352=_0x3bce2a['llm_project'],_0x2694de=_0x527f28,console[_0x237fe2(0x1c1)](a4_0x24f204[_0x237fe2(0x12f)](_0x237fe2(0x174)+_0x79aabb+':\x20'+_0x1f5352));}catch{_0x1f5352=_0x527f28;}else _0x1f5352=_0x527f28;}else{if(_0x24c47a)try{const _0x469808=JSON[_0x237fe2(0x1af)](readFileSync(_0x24c47a,_0x237fe2(0x18d)));_0x1f5352=_0x469808[_0x237fe2(0x1bc)],_0x2694de=a4_0xfafc92[_0x237fe2(0x19b)](_0x24c47a),console[_0x237fe2(0x1c1)](a4_0x24f204[_0x237fe2(0x12f)](_0x237fe2(0x187)+_0x1f5352));}catch{_0x1f5352=_0xaeb68a;}else _0x1f5352=_0xaeb68a;}if(!_0x1f5352)return console[_0x237fe2(0x1c1)](a4_0x24f204['yellow'](_0x237fe2(0x1c2))),console['log'](_0x237fe2(0x169)),console[_0x237fe2(0x1c1)](_0x237fe2(0x1c7)),console[_0x237fe2(0x1c1)](_0x237fe2(0x1ac)),console[_0x237fe2(0x1c1)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent'),0x1;if(_0x36a093){const {data:_0x4e2fd4}=await withSpinner(_0x237fe2(0x178)+_0x36a093+_0x237fe2(0x17c)+_0x1f5352+_0x237fe2(0x153),()=>_0x4f7d96[_0x237fe2(0x175)][_0x237fe2(0x1cb)](_0x1f5352,_0x36a093,_0x5356cc,{'dryRun':_0x23932f,'force':_0x40eabe}));if(_0x23932f)return console[_0x237fe2(0x1c1)](a4_0x24f204[_0x237fe2(0x1a5)](_0x237fe2(0x183))),console[_0x237fe2(0x1c1)](_0x237fe2(0x134)+_0x4e2fd4[_0x237fe2(0x13f)]),console[_0x237fe2(0x1c1)](_0x237fe2(0x17d)+_0x4e2fd4[_0x237fe2(0x137)]),_0x4e2fd4[_0x237fe2(0x136)]&&(console[_0x237fe2(0x1c1)](_0x237fe2(0x1c4)),console[_0x237fe2(0x1c1)]('─'[_0x237fe2(0x18f)](0x3c)),console['log'](_0x4e2fd4[_0x237fe2(0x136)]),console[_0x237fe2(0x1c1)]('─'[_0x237fe2(0x18f)](0x3c))),0x0;return console['log'](a4_0x24f204[_0x237fe2(0x158)](_0x237fe2(0x180))),console[_0x237fe2(0x1c1)](_0x237fe2(0x18e)+_0x4e2fd4[_0x237fe2(0x13f)]),console['log'](_0x237fe2(0x146)+_0x4e2fd4['outputPath']),console[_0x237fe2(0x1c1)](_0x237fe2(0x163)+(_0x4e2fd4[_0x237fe2(0x179)]?a4_0x24f204[_0x237fe2(0x158)](_0x237fe2(0x162)):_0x4e2fd4[_0x237fe2(0x19a)]?a4_0x24f204[_0x237fe2(0x1a5)](_0x237fe2(0x1a7)):a4_0x24f204['gray'](_0x237fe2(0x164)))),0x0;}const _0x29eaab=_0x2694de||_0x5356cc,{data:_0x368218}=await withSpinner('Analyzing\x20project\x20\x22'+_0x1f5352+_0x237fe2(0x153),()=>_0x4f7d96['llm'][_0x237fe2(0x198)](_0x1f5352,_0x29eaab,{'dryRun':!![]})),_0xae3837=_0x368218['counts'][_0x237fe2(0x17a)][_0x237fe2(0x162)]+_0x368218[_0x237fe2(0x14f)][_0x237fe2(0x191)][_0x237fe2(0x162)]+_0x368218['counts'][_0x237fe2(0x151)][_0x237fe2(0x162)]+_0x368218[_0x237fe2(0x14f)]['prompts'][_0x237fe2(0x162)]+_0x368218[_0x237fe2(0x14f)]['integrations']['new'],_0xe442ba=_0x368218['counts']['agents'][_0x237fe2(0x1a7)]+_0x368218[_0x237fe2(0x14f)][_0x237fe2(0x191)][_0x237fe2(0x1a7)]+_0x368218[_0x237fe2(0x14f)]['textKnowledgeBases'][_0x237fe2(0x1a7)]+_0x368218['counts']['prompts'][_0x237fe2(0x1a7)]+_0x368218[_0x237fe2(0x14f)]['integrations'][_0x237fe2(0x1a7)],_0x56fa54=_0x368218[_0x237fe2(0x14f)][_0x237fe2(0x17a)][_0x237fe2(0x164)]+_0x368218['counts'][_0x237fe2(0x191)][_0x237fe2(0x164)]+_0x368218[_0x237fe2(0x14f)][_0x237fe2(0x151)][_0x237fe2(0x164)]+_0x368218['counts']['prompts'][_0x237fe2(0x164)]+_0x368218[_0x237fe2(0x14f)][_0x237fe2(0x182)][_0x237fe2(0x164)];console[_0x237fe2(0x1c1)](_0x237fe2(0x16a)+_0x368218[_0x237fe2(0x1ad)]+'\x27:'),console[_0x237fe2(0x1c1)]('\x20\x20'+a4_0x24f204[_0x237fe2(0x158)]('+\x20'+_0xae3837+_0x237fe2(0x1a6))+_0x237fe2(0x14a)+a4_0x24f204[_0x237fe2(0x1a5)]('~\x20'+_0xe442ba+_0x237fe2(0x194))+_0x237fe2(0x14a)+a4_0x24f204[_0x237fe2(0x12f)]('=\x20'+_0x56fa54+'\x20unchanged')),console[_0x237fe2(0x1c1)]('\x20\x20Agents:\x20'+formatCountSummary(_0x368218[_0x237fe2(0x14f)][_0x237fe2(0x17a)])),console[_0x237fe2(0x1c1)](_0x237fe2(0x155)+formatCountSummary(_0x368218[_0x237fe2(0x14f)][_0x237fe2(0x191)])),console[_0x237fe2(0x1c1)](_0x237fe2(0x18b)+formatCountSummary(_0x368218[_0x237fe2(0x14f)][_0x237fe2(0x151)])),console['log'](_0x237fe2(0x1a8)+formatCountSummary(_0x368218[_0x237fe2(0x14f)][_0x237fe2(0x185)])),console[_0x237fe2(0x1c1)](_0x237fe2(0x1d0)+formatCountSummary(_0x368218[_0x237fe2(0x14f)]['integrations'])),console[_0x237fe2(0x1c1)](_0x237fe2(0x157)+a4_0x24f204['cyan'](_0x368218[_0x237fe2(0x15b)])),displayDiffs(_0x368218[_0x237fe2(0x17a)],_0x368218[_0x237fe2(0x191)],_0x368218['textKnowledgeBases'],_0x368218[_0x237fe2(0x185)],_0x368218[_0x237fe2(0x182)]);if(_0x23932f)return console[_0x237fe2(0x1c1)](a4_0x24f204[_0x237fe2(0x1a5)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0xae3837===0x0&&_0xe442ba===0x0)return console[_0x237fe2(0x1c1)](a4_0x24f204['green'](_0x237fe2(0x19d))),saveSessionContext({'llm_project':_0x368218[_0x237fe2(0x1ad)]},_0x8f378['session']),console[_0x237fe2(0x1c1)](a4_0x24f204[_0x237fe2(0x158)](_0x237fe2(0x195)+a4_0x24f204[_0x237fe2(0x12f)](_0x237fe2(0x1bc))+_0x237fe2(0x1b7)+a4_0x24f204[_0x237fe2(0x1c5)](_0x368218[_0x237fe2(0x1ad)]))),0x0;if(!_0x301dc2&&!_0x40eabe){if(!isInteractive())return console[_0x237fe2(0x1c8)](a4_0x24f204['red']('\x0aError:'),_0x237fe2(0x1d3)),console[_0x237fe2(0x1c8)](a4_0x24f204['dim'](_0x237fe2(0x1c9))),0x1;const _0x44aaa0=await confirmKey(_0x237fe2(0x141)+(_0xae3837+_0xe442ba)+_0x237fe2(0x1ba));if(!_0x44aaa0)return console[_0x237fe2(0x1c1)](a4_0x24f204[_0x237fe2(0x1a5)](_0x237fe2(0x1c0)),_0x237fe2(0x132)),0x1;}const {data:_0x5a7dcb}=await withSpinner('Writing\x20files...',()=>_0x4f7d96[_0x237fe2(0x175)][_0x237fe2(0x198)](_0x1f5352,_0x29eaab,{'force':_0x40eabe}));return console['log'](a4_0x24f204[_0x237fe2(0x158)](_0x237fe2(0x140)+(_0xae3837+_0xe442ba)+_0x237fe2(0x1ae)+_0x5a7dcb[_0x237fe2(0x15b)])),saveSessionContext({'llm_project':_0x5a7dcb[_0x237fe2(0x1ad)]},_0x8f378[_0x237fe2(0x13c)]),console[_0x237fe2(0x1c1)](a4_0x24f204['green']('✔\x20Context\x20set:\x20'+a4_0x24f204[_0x237fe2(0x12f)]('llm_project')+_0x237fe2(0x1b7)+a4_0x24f204[_0x237fe2(0x1c5)](_0x5a7dcb[_0x237fe2(0x1ad)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x3b07ea(0x1d5)]='agent:clone';['description']=a4_0x3b07ea(0x165);async['execute'](_0x48c0d0){const _0xec250b=a4_0x3b07ea,{options:_0x3ba86a,args:_0x3e138c,tdx:_0x79f6d8}=_0x48c0d0,_0x4dec24=_0x3e138c[0x0],_0x4e78af=_0x3ba86a[_0xec250b(0x1d5)],_0x259e01=_0x3ba86a[_0xec250b(0x17b)],_0x438d39=_0x3ba86a['yes'],_0x1af2b1=_0x3ba86a[_0xec250b(0x14e)],_0x5926b7=_0x3ba86a[_0xec250b(0x166)];let _0x4da93d;const _0x4e7c34=findAgentConfigPath(process['cwd']());if(_0x4dec24){const _0x2a5e90=a4_0xfafc92[_0xec250b(0x1d4)](_0x4dec24,_0xec250b(0x177));existsSync(_0x2a5e90)?(_0x4da93d=_0x4dec24,console[_0xec250b(0x1c1)](a4_0x24f204[_0xec250b(0x12f)](_0xec250b(0x196)+_0x4dec24))):_0x4da93d=_0x4dec24;}else{if(_0x4e7c34)_0x4da93d=a4_0xfafc92[_0xec250b(0x19b)](_0x4e7c34),console['log'](a4_0x24f204['dim'](_0xec250b(0x1cc)+_0x4da93d));else{if(_0x5926b7){const _0x4368ec=sanitizeForFilesystem(_0x5926b7);let _0x50263f=_0x4368ec,_0x2d3ffa=a4_0xfafc92[_0xec250b(0x1d4)](process[_0xec250b(0x1c3)](),_0xec250b(0x17a),_0x4368ec,_0xec250b(0x177));if(!existsSync(_0x2d3ffa)){const _0xb74439=normalizeName(_0x5926b7),_0x4846eb=a4_0xfafc92['join'](process[_0xec250b(0x1c3)](),_0xec250b(0x17a),_0xb74439,_0xec250b(0x177));existsSync(_0x4846eb)&&(_0x50263f=_0xb74439,_0x2d3ffa=_0x4846eb);}if(existsSync(_0x2d3ffa))_0x4da93d=a4_0xfafc92['dirname'](_0x2d3ffa),console[_0xec250b(0x1c1)](a4_0x24f204['dim']('Using\x20local\x20project:\x20'+_0x4da93d));else{const _0x53c6e9=_0x3ba86a['profile'];if(_0x53c6e9)throw new SDKError(ErrorCode[_0xec250b(0x1a4)],_0xec250b(0x190)+_0x5926b7+_0xec250b(0x1cd),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0xec250b(0x13e)+(_0xec250b(0x1d6)+_0x5926b7+'\x0a')+(_0xec250b(0x135)+_0x50263f+_0xec250b(0x1bd)+(_0x4e78af||_0xec250b(0x173))+_0xec250b(0x1a3)+_0x53c6e9)});_0x4da93d=_0x5926b7,console[_0xec250b(0x1c1)](a4_0x24f204[_0xec250b(0x12f)]('Using\x20context\x20project:\x20'+_0x5926b7));}}}}if(!_0x4da93d)return console[_0xec250b(0x1c1)](a4_0x24f204[_0xec250b(0x1a5)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0xec250b(0x1c1)](_0xec250b(0x181)),console[_0xec250b(0x1c1)](_0xec250b(0x1d2)),console[_0xec250b(0x1c1)]('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console['log'](_0xec250b(0x156)),0x1;if(!_0x4e78af)throw new SDKError(ErrorCode[_0xec250b(0x1aa)],_0xec250b(0x1b5),undefined,{'helpText':_0xec250b(0x1bf)});if(!_0x438d39&&!_0x259e01){if(!isInteractive())return console['error'](a4_0x24f204[_0xec250b(0x18c)](_0xec250b(0x19e)),_0xec250b(0x1d3)),console[_0xec250b(0x1c8)](a4_0x24f204[_0xec250b(0x12f)](_0xec250b(0x1c9))),0x1;const _0x3989a2=await confirmKey(_0xec250b(0x16f)+_0x4da93d+_0xec250b(0x18a)+_0x4e78af+'\x22?');if(!_0x3989a2)return console[_0xec250b(0x1c1)](a4_0x24f204['yellow']('Cancelled')),0x1;}const {data:_0x12a1bc}=await withSpinner(_0xec250b(0x1b3)+_0x4da93d+_0xec250b(0x1ca)+_0x4e78af+_0xec250b(0x153),()=>_0x79f6d8['llm']['cloneProject'](_0x4da93d,_0x4e78af,{'dryRun':_0x259e01}));if(_0x259e01)return console[_0xec250b(0x1c1)](a4_0x24f204[_0xec250b(0x1a5)](_0xec250b(0x154))),console[_0xec250b(0x1c1)](_0xec250b(0x15d)+_0x12a1bc['sourceProjectName']),console['log'](_0xec250b(0x1d1)+_0x4e78af),console['log'](_0xec250b(0x1b0)),console[_0xec250b(0x1c1)](_0xec250b(0x161)+_0x12a1bc['counts']['agents']['created']),console['log'](_0xec250b(0x155)+_0x12a1bc[_0xec250b(0x14f)][_0xec250b(0x191)][_0xec250b(0x14b)]),console[_0xec250b(0x1c1)](_0xec250b(0x1a8)+_0x12a1bc[_0xec250b(0x14f)][_0xec250b(0x185)][_0xec250b(0x14b)]),0x0;const _0x582c27=_0x12a1bc[_0xec250b(0x14f)]['agents']['errors']>0x0||_0x12a1bc[_0xec250b(0x14f)][_0xec250b(0x191)][_0xec250b(0x14d)]>0x0||_0x12a1bc[_0xec250b(0x14f)][_0xec250b(0x185)][_0xec250b(0x14d)]>0x0;_0x582c27?console[_0xec250b(0x1c1)](a4_0x24f204['yellow'](_0xec250b(0x144))):console[_0xec250b(0x1c1)](a4_0x24f204['green'](_0xec250b(0x1a2)));console['log']('Source:\x20'+_0x12a1bc['sourceProjectName']),console[_0xec250b(0x1c1)](_0xec250b(0x1d1)+_0x12a1bc['newProjectName']),console[_0xec250b(0x1c1)](_0xec250b(0x148)+_0x12a1bc['newProjectId']),console[_0xec250b(0x1c1)](),console['log'](_0xec250b(0x172)),console['log'](_0xec250b(0x161)+formatCountSummary(_0x12a1bc[_0xec250b(0x14f)][_0xec250b(0x17a)])),console['log'](_0xec250b(0x155)+formatCountSummary(_0x12a1bc[_0xec250b(0x14f)][_0xec250b(0x191)])),console[_0xec250b(0x1c1)](_0xec250b(0x1a8)+formatCountSummary(_0x12a1bc['counts'][_0xec250b(0x185)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x12a1bc['counts']['integrations']));if(_0x582c27){console[_0xec250b(0x1c1)](),console[_0xec250b(0x1c1)](a4_0x24f204[_0xec250b(0x18c)](_0xec250b(0x13d)));for(const _0x18b272 of _0x12a1bc[_0xec250b(0x17a)]){_0x18b272['action']==='error'&&console[_0xec250b(0x1c1)](a4_0x24f204[_0xec250b(0x18c)]('\x20\x20Agent\x20\x22'+_0x18b272[_0xec250b(0x13f)]+_0xec250b(0x1b4)+_0x18b272[_0xec250b(0x1c8)]));}for(const _0x1c4092 of _0x12a1bc['knowledgeBases']){_0x1c4092[_0xec250b(0x1ce)]===_0xec250b(0x1c8)&&console[_0xec250b(0x1c1)](a4_0x24f204[_0xec250b(0x18c)](_0xec250b(0x1bb)+_0x1c4092[_0xec250b(0x1d5)]+_0xec250b(0x1b4)+_0x1c4092['error']));}for(const _0x48b230 of _0x12a1bc[_0xec250b(0x185)]){_0x48b230[_0xec250b(0x1ce)]===_0xec250b(0x1c8)&&console[_0xec250b(0x1c1)](a4_0x24f204[_0xec250b(0x18c)](_0xec250b(0x16c)+_0x48b230[_0xec250b(0x1d5)]+'\x22:\x20'+_0x48b230[_0xec250b(0x1c8)]));}for(const _0x929c8d of _0x12a1bc['integrations']){_0x929c8d[_0xec250b(0x1ce)]==='error'&&console[_0xec250b(0x1c1)](a4_0x24f204['red']('\x20\x20Integration\x20\x22'+_0x929c8d[_0xec250b(0x1d5)]+_0xec250b(0x1b4)+_0x929c8d['error']));}return 0x1;}console[_0xec250b(0x1c1)]();const _0x3cbfdc=getLLMProjectUrl(_0x1af2b1,_0x12a1bc[_0xec250b(0x13b)]);return console[_0xec250b(0x1c1)](_0xec250b(0x167)+a4_0x24f204[_0xec250b(0x1c5)](_0x3cbfdc)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']='agent:push';[a4_0x3b07ea(0x13a)]=a4_0x3b07ea(0x1a1);async['execute'](_0x5e4523){const _0x5d7551=a4_0x3b07ea,{options:_0xd04724,args:_0x14dc5a,tdx:_0x2ee292}=_0x5e4523;let _0x3a91ef=_0x14dc5a[0x0]||process[_0x5d7551(0x1c3)]();const _0x125620=_0xd04724[_0x5d7551(0x17b)],_0x73f8bd=_0xd04724['force'],_0x1d3eb9=_0xd04724[_0x5d7551(0x15c)],_0x365d11=_0xd04724['site'],_0x26a2e0=a4_0xfafc92['join'](_0x3a91ef,_0x5d7551(0x184)),_0x15873b=existsSync(_0x26a2e0);if(_0x15873b){const {data:_0x527f8f}=await withSpinner(_0x5d7551(0x143)+_0x3a91ef+_0x5d7551(0x153),()=>_0x2ee292[_0x5d7551(0x175)]['pushAgent'](_0x3a91ef,{'dryRun':_0x125620,'force':_0x73f8bd}));if(_0x125620)return console[_0x5d7551(0x1c1)](a4_0x24f204[_0x5d7551(0x1a5)](_0x5d7551(0x154))),console[_0x5d7551(0x1c1)]('Would\x20push\x20agent:\x20'+_0x527f8f[_0x5d7551(0x13f)]),0x0;if(_0x527f8f[_0x5d7551(0x1ce)]==='error')return console['log'](a4_0x24f204[_0x5d7551(0x18c)](_0x5d7551(0x16b)+_0x527f8f['error'])),0x1;console['log'](a4_0x24f204[_0x5d7551(0x158)](_0x5d7551(0x188)+_0x527f8f[_0x5d7551(0x1ce)]+_0x5d7551(0x139))),console[_0x5d7551(0x1c1)](_0x5d7551(0x18e)+_0x527f8f[_0x5d7551(0x13f)]);if(_0x527f8f[_0x5d7551(0x17f)]&&_0x527f8f[_0x5d7551(0x133)]){const _0x453c21=getLLMAgentChatUrl(_0x365d11,_0x527f8f[_0x5d7551(0x133)],_0x527f8f[_0x5d7551(0x17f)]);console[_0x5d7551(0x1c1)]('Chat:\x20'+a4_0x24f204[_0x5d7551(0x1c5)](_0x453c21));}return 0x0;}const _0x2fbbea=_0xd04724[_0x5d7551(0x166)],_0x27217b=resolveProjectFromContext(_0x3a91ef,_0x2fbbea);if(_0x27217b[_0x5d7551(0x15a)])_0x3a91ef=_0x27217b['projectDir'],_0x27217b['source']===_0x5d7551(0x1b9)&&console[_0x5d7551(0x1c1)](a4_0x24f204['dim'](_0x5d7551(0x187)+_0x3a91ef));else{let _0x385f6d='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x27217b['reason']===_0x5d7551(0x170)&&(_0x385f6d=_0x27217b['message']+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x27217b['llmProject']+_0x5d7551(0x16e));throw new SDKError(ErrorCode[_0x5d7551(0x1a4)],_0x27217b[_0x5d7551(0x1cf)]===_0x5d7551(0x1b2)?_0x27217b[_0x5d7551(0x1ab)]:_0x5d7551(0x1c6)+_0x3a91ef,undefined,{'helpText':_0x385f6d});}const {data:_0x59465b}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x2ee292[_0x5d7551(0x175)][_0x5d7551(0x199)](_0x3a91ef,{'dryRun':!![]})),_0x2085c6=_0x59465b[_0x5d7551(0x14f)]['agents'][_0x5d7551(0x14d)]>0x0;if(_0x2085c6){console['log'](a4_0x24f204[_0x5d7551(0x18c)](_0x5d7551(0x1b8)));for(const _0x441b3e of _0x59465b[_0x5d7551(0x17a)]){_0x441b3e['action']===_0x5d7551(0x1c8)&&console[_0x5d7551(0x1c1)](a4_0x24f204['red'](_0x5d7551(0x186)+_0x441b3e['agentName']+'\x22:\x20'+_0x441b3e['error']));}return 0x1;}const _0x3f9a06=_0x59465b['counts'][_0x5d7551(0x17a)][_0x5d7551(0x14b)]+_0x59465b['counts'][_0x5d7551(0x191)][_0x5d7551(0x14b)]+_0x59465b[_0x5d7551(0x14f)]['textKnowledgeBases'][_0x5d7551(0x14b)]+_0x59465b[_0x5d7551(0x14f)]['prompts'][_0x5d7551(0x14b)]+_0x59465b['counts'][_0x5d7551(0x182)][_0x5d7551(0x14b)],_0x4fb69d=_0x59465b['counts'][_0x5d7551(0x17a)][_0x5d7551(0x1a7)]+_0x59465b[_0x5d7551(0x14f)][_0x5d7551(0x191)][_0x5d7551(0x1a7)]+_0x59465b[_0x5d7551(0x14f)][_0x5d7551(0x151)]['updated']+_0x59465b['counts'][_0x5d7551(0x185)]['updated']+_0x59465b[_0x5d7551(0x14f)][_0x5d7551(0x182)][_0x5d7551(0x1a7)],_0x395974=_0x59465b[_0x5d7551(0x14f)]['agents'][_0x5d7551(0x164)]+_0x59465b['counts'][_0x5d7551(0x191)][_0x5d7551(0x164)]+_0x59465b[_0x5d7551(0x14f)][_0x5d7551(0x151)][_0x5d7551(0x164)]+_0x59465b[_0x5d7551(0x14f)]['prompts'][_0x5d7551(0x164)]+_0x59465b[_0x5d7551(0x14f)][_0x5d7551(0x182)][_0x5d7551(0x164)];console[_0x5d7551(0x1c1)](_0x5d7551(0x138)+_0x59465b['projectName']+'\x27:'),console[_0x5d7551(0x1c1)]('\x20\x20'+a4_0x24f204[_0x5d7551(0x158)]('+\x20'+_0x3f9a06+_0x5d7551(0x1a6))+'\x20|\x20'+a4_0x24f204[_0x5d7551(0x1a5)]('~\x20'+_0x4fb69d+'\x20changed')+'\x20|\x20'+a4_0x24f204['dim']('=\x20'+_0x395974+_0x5d7551(0x160))),console['log'](_0x5d7551(0x161)+formatCountSummary(_0x59465b[_0x5d7551(0x14f)]['agents'])),console[_0x5d7551(0x1c1)](_0x5d7551(0x155)+formatCountSummary(_0x59465b[_0x5d7551(0x14f)][_0x5d7551(0x191)])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x59465b[_0x5d7551(0x14f)][_0x5d7551(0x151)])),console[_0x5d7551(0x1c1)](_0x5d7551(0x1a8)+formatCountSummary(_0x59465b[_0x5d7551(0x14f)][_0x5d7551(0x185)])),console[_0x5d7551(0x1c1)](_0x5d7551(0x1d0)+formatCountSummary(_0x59465b[_0x5d7551(0x14f)][_0x5d7551(0x182)])),console[_0x5d7551(0x1c1)](_0x5d7551(0x147)+a4_0x24f204[_0x5d7551(0x1c5)](_0x3a91ef)),displayDiffs(_0x59465b[_0x5d7551(0x17a)],_0x59465b[_0x5d7551(0x191)],_0x59465b[_0x5d7551(0x151)],_0x59465b[_0x5d7551(0x185)],_0x59465b[_0x5d7551(0x182)]);if(_0x125620)return console['log'](a4_0x24f204[_0x5d7551(0x1a5)](_0x5d7551(0x17e))),0x0;if(_0x3f9a06===0x0&&_0x4fb69d===0x0){console[_0x5d7551(0x1c1)](a4_0x24f204[_0x5d7551(0x158)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x38ffae=getLLMProjectUrl(_0x365d11,_0x59465b[_0x5d7551(0x133)]);return console[_0x5d7551(0x1c1)]('Project:\x20'+a4_0x24f204[_0x5d7551(0x1c5)](_0x38ffae)),0x0;}if(!_0x1d3eb9&&!_0x73f8bd){if(!isInteractive())return console['error'](a4_0x24f204[_0x5d7551(0x18c)](_0x5d7551(0x19e)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a4_0x24f204['dim'](_0x5d7551(0x1c9))),0x1;const _0xe7d564=await confirmKey('\x0aPush\x20'+(_0x3f9a06+_0x4fb69d)+_0x5d7551(0x159));if(!_0xe7d564)return console[_0x5d7551(0x1c1)](a4_0x24f204[_0x5d7551(0x1a5)](_0x5d7551(0x1c0)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x2015fa}=await withSpinner(_0x5d7551(0x19c),()=>_0x2ee292[_0x5d7551(0x175)][_0x5d7551(0x199)](_0x3a91ef,{'force':_0x73f8bd})),_0x1e0430=_0x2015fa[_0x5d7551(0x14f)]['agents'][_0x5d7551(0x14d)]>0x0||_0x2015fa[_0x5d7551(0x14f)][_0x5d7551(0x191)][_0x5d7551(0x14d)]>0x0||_0x2015fa[_0x5d7551(0x14f)]['textKnowledgeBases'][_0x5d7551(0x14d)]>0x0||_0x2015fa['counts'][_0x5d7551(0x185)][_0x5d7551(0x14d)]>0x0;if(_0x1e0430){console[_0x5d7551(0x1c1)](a4_0x24f204[_0x5d7551(0x1a5)](_0x5d7551(0x1a9))),console[_0x5d7551(0x1c1)](),console[_0x5d7551(0x1c1)](a4_0x24f204['red'](_0x5d7551(0x13d)));for(const _0xdb6225 of _0x2015fa[_0x5d7551(0x17a)]){_0xdb6225[_0x5d7551(0x1ce)]===_0x5d7551(0x1c8)&&console[_0x5d7551(0x1c1)](a4_0x24f204['red'](_0x5d7551(0x186)+_0xdb6225[_0x5d7551(0x13f)]+_0x5d7551(0x1b4)+_0xdb6225[_0x5d7551(0x1c8)]));}for(const _0x4086e2 of _0x2015fa[_0x5d7551(0x191)]){_0x4086e2[_0x5d7551(0x1ce)]===_0x5d7551(0x1c8)&&console[_0x5d7551(0x1c1)](a4_0x24f204[_0x5d7551(0x18c)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x4086e2[_0x5d7551(0x1d5)]+_0x5d7551(0x1b4)+_0x4086e2[_0x5d7551(0x1c8)]));}for(const _0x2d33ec of _0x2015fa[_0x5d7551(0x151)]){_0x2d33ec[_0x5d7551(0x1ce)]===_0x5d7551(0x1c8)&&console[_0x5d7551(0x1c1)](a4_0x24f204[_0x5d7551(0x18c)](_0x5d7551(0x130)+_0x2d33ec[_0x5d7551(0x1d5)]+_0x5d7551(0x1b4)+_0x2d33ec['error']));}for(const _0x57a23d of _0x2015fa['prompts']){_0x57a23d[_0x5d7551(0x1ce)]===_0x5d7551(0x1c8)&&console[_0x5d7551(0x1c1)](a4_0x24f204[_0x5d7551(0x18c)]('\x20\x20Prompt\x20\x22'+_0x57a23d[_0x5d7551(0x1d5)]+_0x5d7551(0x1b4)+_0x57a23d['error']));}for(const _0x54cb6b of _0x2015fa['integrations']){_0x54cb6b['action']===_0x5d7551(0x1c8)&&console[_0x5d7551(0x1c1)](a4_0x24f204['red']('\x20\x20Integration\x20\x22'+_0x54cb6b[_0x5d7551(0x1d5)]+_0x5d7551(0x1b4)+_0x54cb6b[_0x5d7551(0x1c8)]));}return 0x1;}console[_0x5d7551(0x1c1)](a4_0x24f204[_0x5d7551(0x158)](_0x5d7551(0x168)+(_0x3f9a06+_0x4fb69d)+'\x20resources\x20to\x20\x27'+_0x2015fa[_0x5d7551(0x1ad)]+'\x27'));const _0x20fc33=getLLMProjectUrl(_0x365d11,_0x2015fa[_0x5d7551(0x133)]);return console['log'](_0x5d7551(0x167)+a4_0x24f204['cyan'](_0x20fc33)),0x0;}}
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 +1 @@
1
- function a5_0x374e(_0x3054b9,_0x200a91){_0x3054b9=_0x3054b9-0xa5;const _0x4c9d16=a5_0x4c9d();let _0x374ebd=_0x4c9d16[_0x3054b9];return _0x374ebd;}const a5_0x57b6f6=a5_0x374e;(function(_0x2a40dd,_0x220dde){const _0x4e87a8=a5_0x374e,_0x19872b=_0x2a40dd();while(!![]){try{const _0x165199=parseInt(_0x4e87a8(0xe8))/0x1*(parseInt(_0x4e87a8(0x13f))/0x2)+-parseInt(_0x4e87a8(0xc3))/0x3*(-parseInt(_0x4e87a8(0x127))/0x4)+-parseInt(_0x4e87a8(0x108))/0x5+-parseInt(_0x4e87a8(0x10d))/0x6*(-parseInt(_0x4e87a8(0xba))/0x7)+parseInt(_0x4e87a8(0xd9))/0x8+parseInt(_0x4e87a8(0xcf))/0x9*(parseInt(_0x4e87a8(0xe6))/0xa)+-parseInt(_0x4e87a8(0x112))/0xb;if(_0x165199===_0x220dde)break;else _0x19872b['push'](_0x19872b['shift']());}catch(_0x452c2e){_0x19872b['push'](_0x19872b['shift']());}}}(a5_0x4c9d,0xa3008));function a5_0x4c9d(){const _0x4604d6=['ERROR','...\x20','FAIL','size','Duration:\x20','✗\x20ERROR:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','multiple_agents','timestamp','some',':\x20Sending\x20user\x20input...','output','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20-\x20','Test\x20Configuration:','...','white','Available\x20tests:\x20','includes','Re-evaluation\x20Summary','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','dryRun','4754180qLJgmm','Site:\x20','Round\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Passed:\x20\x20\x20','1249386FXPOLF','Running:\x20','\x20\x20Site:\x20','404','✗\x20FAIL:\x20','3315092RwniCY','\x20\x20Conversation:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','test.yml','agent','\x22:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','log','Error:\x20No\x20previous\x20test\x20run\x20found.','Round\x201/','tags','tsv','\x20(new)','projectName','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Cached\x20run\x20from:\x20','Available\x20tags:\x20','Re-evaluating...','No\x20tests\x20have\x20tags\x20defined.','context','table','116lMmPct','utf-8','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Either\x20switch\x20to\x20the\x20\x22','Re-evaluating\x20cached\x20test\x20run...','Executing\x20new\x20tests...','Output\x20written\x20to:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','\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','filter','eval','Using\x20agent:\x20','repeat','PASS','json','no_local_folder','status','red','testYmlPath','map','rounds','verbose','conversation_url','\x20\x20Project:\x20','84330IeBWuF','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','writeFileSync','llm','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','green','\x20\x20-\x20','toLowerCase','agentName','stop','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','jsonl','Test\x20Summary','not\x20found','forEach','dim','Re-evaluating\x20','Evaluating\x20response...','existsSync','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','description','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','28mhENnP','Failed\x20Tests:','start','New\x20tests\x20to\x20execute:\x20','Conversation\x20URL:\x20','substring','cyan','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','13746oaGYtB','join','message','basename','⚠\x20SKIPPED:\x20','length','projectDir','llmProject','executeReeval','Test\x20','source','split','2626335KAWPVJ','toISOString','now','resolveProjectId','Total:\x20\x20\x20\x20','push','has','round','\x20\x20Evaluating...\x20','\x20(cached)','3611376YVeoqb','execute','✓\x20PASS:\x20','Errors:\x20\x20\x20','found','\x20\x20Round\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Error\x20writing\x20output\x20file:\x20','yellow','Cached\x20run\x20is\x20from\x20site\x20\x22','find','reason','trim','10WOgRse','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','5NBjgay','text','site','resolveAgentId','Failed:\x20\x20\x20','/<agent-name>','agent:test','name','tests','\x20\x20Agent:\x20'];a5_0x4c9d=function(){return _0x4604d6;};return a5_0x4c9d();}import*as a5_0x5ee627 from'node:fs';import*as a5_0x55524e from'node:path';import a5_0x5800bb 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_0x57b6f6(0xef)]=a5_0x57b6f6(0xee);[a5_0x57b6f6(0xb8)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x57b6f6(0xda)](_0x1aaa44){const _0x1cfb7c=a5_0x57b6f6,{options:_0xc98e47,args:_0x3b5d6c,tdx:_0x2c66b0}=_0x1aaa44,_0x20d035=_0x3b5d6c[0x0]||'.',_0x45fdc7=_0xc98e47[_0x1cfb7c(0x107)],_0x4c1fda=_0xc98e47,_0x29bb1c=_0x4c1fda[_0x1cfb7c(0x131)]===![],_0x31288f=_0x4c1fda['reeval'],_0x1f2e9b=_0x4c1fda[_0x1cfb7c(0xef)],_0x1189ea=_0x4c1fda[_0x1cfb7c(0x11c)],_0xdb41ba=_0xc98e47[_0x1cfb7c(0xea)],_0x4772a2=_0x4c1fda[_0x1cfb7c(0xfd)];if(_0x31288f&&_0x29bb1c)return console['log'](a5_0x5800bb[_0x1cfb7c(0x138)](_0x1cfb7c(0xae))),0x1;let _0x1f8ceb=_0x1cfb7c(0x126);if(_0x4c1fda[_0x1cfb7c(0x135)])_0x1f8ceb=_0x1cfb7c(0x135);else{if(_0x4c1fda['jsonl'])_0x1f8ceb=_0x1cfb7c(0xaf);else{if(_0x4c1fda['tsv'])_0x1f8ceb=_0x1cfb7c(0x11d);else{if(_0x4c1fda['table'])_0x1f8ceb=_0x1cfb7c(0x126);}}}const _0x504b7b=_0x4c1fda[_0x1cfb7c(0xca)];let _0x59c2b1=_0x20d035;const _0x1c218d=a5_0x5ee627[_0x1cfb7c(0xb6)](_0x20d035),_0x16a254=_0x20d035==='.';if(!_0x1c218d||_0x16a254){const _0x5b8ea8=resolveProjectFromContext(_0x20d035,_0x504b7b,{'requireFile':_0x1cfb7c(0x115)});if(_0x5b8ea8[_0x1cfb7c(0xdd)])_0x59c2b1=_0x5b8ea8[_0x1cfb7c(0xc9)],_0x5b8ea8[_0x1cfb7c(0xcd)]===_0x1cfb7c(0x125)&&console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0xb3)](_0x1cfb7c(0x132)+_0x59c2b1));else switch(_0x5b8ea8[_0x1cfb7c(0xe4)]){case'no_context':console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0xe1)](_0x5b8ea8['message'])),console['log'](),console[_0x1cfb7c(0x119)]('Usage:'),console[_0x1cfb7c(0x119)](_0x1cfb7c(0x12f)),console[_0x1cfb7c(0x119)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console['log'](),console[_0x1cfb7c(0x119)](_0x1cfb7c(0x129));return 0x1;case _0x1cfb7c(0x136):console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0xe1)](_0x5b8ea8['message'])),console[_0x1cfb7c(0x119)](),console[_0x1cfb7c(0x119)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x5b8ea8[_0x1cfb7c(0xca)]+_0x1cfb7c(0xfe));return 0x1;case _0x1cfb7c(0xf9):{const _0x2b697b=a5_0x55524e[_0x1cfb7c(0xc6)](_0x5b8ea8[_0x1cfb7c(0xc9)]);console[_0x1cfb7c(0x119)](a5_0x5800bb['yellow'](_0x1cfb7c(0x118)+_0x5b8ea8[_0x1cfb7c(0xca)]+'\x22:'));for(const _0x59b690 of _0x5b8ea8['agentDirs']){console['log'](_0x1cfb7c(0xaa)+_0x59b690);}return console[_0x1cfb7c(0x119)](),console['log'](_0x1cfb7c(0xc2)+_0x2b697b+_0x1cfb7c(0xed)),0x1;}case'no_tests':console['log'](a5_0x5800bb[_0x1cfb7c(0xe1)](_0x1cfb7c(0xf8)+_0x5b8ea8[_0x1cfb7c(0xca)]+'\x22.')),console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0xb3)]('Project\x20path:\x20'+_0x5b8ea8[_0x1cfb7c(0xc9)])),console['log'](),console[_0x1cfb7c(0x119)](_0x1cfb7c(0xb9));return 0x1;}}const {definition:_0x37b786,agentInfo:_0x2b82a6}=parseTestFile(_0x59c2b1);let _0x5dc78c=_0x37b786[_0x1cfb7c(0xf0)];if(_0x1f2e9b){const _0x3682a3=_0x1f2e9b[_0x1cfb7c(0xce)](',')[_0x1cfb7c(0x13a)](_0x4ebbd5=>_0x4ebbd5[_0x1cfb7c(0xe5)]());_0x5dc78c=_0x37b786[_0x1cfb7c(0xf0)][_0x1cfb7c(0x130)](_0x444543=>_0x3682a3['includes'](_0x444543[_0x1cfb7c(0xef)]));if(_0x5dc78c[_0x1cfb7c(0xc8)]===0x0)return console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0xe1)]('No\x20tests\x20found\x20matching:\x20'+_0x1f2e9b)),console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0xb3)](_0x1cfb7c(0x103)+_0x37b786[_0x1cfb7c(0xf0)][_0x1cfb7c(0x13a)](_0x4dca0c=>_0x4dca0c[_0x1cfb7c(0xef)])[_0x1cfb7c(0xc4)](',\x20'))),0x1;}if(_0x1189ea){const _0x36dfbf=_0x1189ea['split'](',')[_0x1cfb7c(0x13a)](_0x316593=>_0x316593[_0x1cfb7c(0xe5)]()[_0x1cfb7c(0xab)]());_0x5dc78c=_0x5dc78c['filter'](_0x2db10c=>_0x2db10c['tags']?.[_0x1cfb7c(0xfb)](_0x386a02=>_0x36dfbf[_0x1cfb7c(0x104)](_0x386a02[_0x1cfb7c(0xab)]())));if(_0x5dc78c[_0x1cfb7c(0xc8)]===0x0){console[_0x1cfb7c(0x119)](a5_0x5800bb['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x1189ea));const _0x4878d9=new Set();return _0x37b786[_0x1cfb7c(0xf0)][_0x1cfb7c(0xb2)](_0x1643bc=>_0x1643bc['tags']?.['forEach'](_0x57abbb=>_0x4878d9['add'](_0x57abbb))),_0x4878d9[_0x1cfb7c(0xf5)]>0x0?console[_0x1cfb7c(0x119)](a5_0x5800bb['dim'](_0x1cfb7c(0x122)+[..._0x4878d9][_0x1cfb7c(0xc4)](',\x20'))):console['log'](a5_0x5800bb[_0x1cfb7c(0xb3)](_0x1cfb7c(0x124))),0x1;}}if(_0x31288f)return this['executeReeval'](_0x1aaa44,{'definition':{'tests':_0x5dc78c},'agentInfo':_0x2b82a6,'outputFormat':_0x1f8ceb,'outputFile':_0x4772a2,'testNames':_0x1f2e9b});if(_0x45fdc7){console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0xc0)](_0x1cfb7c(0x100))),console['log'](_0x1cfb7c(0x10f)+a5_0x5800bb[_0x1cfb7c(0x102)](_0xdb41ba)),console[_0x1cfb7c(0x119)](_0x1cfb7c(0x13e)+a5_0x5800bb[_0x1cfb7c(0x102)](_0x2b82a6[_0x1cfb7c(0x11f)])),console[_0x1cfb7c(0x119)](_0x1cfb7c(0xf1)+a5_0x5800bb[_0x1cfb7c(0x102)](_0x2b82a6[_0x1cfb7c(0xac)])),console[_0x1cfb7c(0x119)](),console['log']('Tests\x20found:\x20'+a5_0x5800bb['white'](_0x5dc78c['length']));for(let _0x5a8436=0x0;_0x5a8436<_0x5dc78c['length'];_0x5a8436++){const _0x2c4b4=_0x5dc78c[_0x5a8436],_0x570720=_0x2c4b4[_0x1cfb7c(0x13b)][_0x1cfb7c(0xc8)]===0x1?_0x1cfb7c(0xd6):_0x1cfb7c(0x13b),_0x62bc13=_0x2c4b4[_0x1cfb7c(0x11c)]?.[_0x1cfb7c(0xc8)]?'\x20['+_0x2c4b4[_0x1cfb7c(0x11c)]['join'](',\x20')+']':'';console[_0x1cfb7c(0x119)]('\x20\x20'+(_0x5a8436+0x1)+'.\x20'+a5_0x5800bb[_0x1cfb7c(0x102)](_0x2c4b4[_0x1cfb7c(0xef)])+'\x20('+_0x2c4b4[_0x1cfb7c(0x13b)][_0x1cfb7c(0xc8)]+'\x20'+_0x570720+')'+a5_0x5800bb['dim'](_0x62bc13));}return 0x0;}let _0x3a9150,_0x103726;try{_0x3a9150=await _0x2c66b0['llm'][_0x1cfb7c(0xd2)](_0x2b82a6[_0x1cfb7c(0x11f)]);}catch(_0xe3e94e){const _0x2d355e=_0xe3e94e instanceof Error?_0xe3e94e[_0x1cfb7c(0xc5)]:String(_0xe3e94e);return _0x2d355e[_0x1cfb7c(0x104)](_0x1cfb7c(0x110))||_0x2d355e[_0x1cfb7c(0xab)]()['includes']('not\x20found')?console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0x138)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x2b82a6[_0x1cfb7c(0x11f)])):console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0x138)](_0x1cfb7c(0xa5)+_0x2b82a6[_0x1cfb7c(0x11f)]+_0x1cfb7c(0x117)+_0x2d355e)),0x1;}try{_0x103726=await _0x2c66b0['llm'][_0x1cfb7c(0xeb)](_0x2b82a6[_0x1cfb7c(0xac)],_0x3a9150);}catch(_0x3716da){const _0x23c135=_0x3716da instanceof Error?_0x3716da[_0x1cfb7c(0xc5)]:String(_0x3716da);return _0x23c135['includes'](_0x1cfb7c(0x110))||_0x23c135['toLowerCase']()[_0x1cfb7c(0x104)](_0x1cfb7c(0xb1))?console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0x138)](_0x1cfb7c(0x12e)+_0x2b82a6[_0x1cfb7c(0xac)])):console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0x138)](_0x1cfb7c(0x140)+_0x2b82a6[_0x1cfb7c(0xac)]+'\x22:\x20'+_0x23c135)),0x1;}let _0x138861;if(!_0x29bb1c)try{_0x138861=await setupEvaluatorAgent(_0x2c66b0['llm'],_0xc98e47[_0x1cfb7c(0x13c)]);}catch(_0x1b575f){const _0xefb754=_0x1b575f instanceof Error?_0x1b575f[_0x1cfb7c(0xc5)]:String(_0x1b575f);return console[_0x1cfb7c(0x119)](a5_0x5800bb['red'](_0x1cfb7c(0xe7)+_0xefb754)),0x1;}console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0xc0)]('Running\x20agent\x20tests...')),console[_0x1cfb7c(0x119)](_0x1cfb7c(0x109)+a5_0x5800bb[_0x1cfb7c(0x102)](_0xdb41ba)),console[_0x1cfb7c(0x119)]('Agent:\x20'+a5_0x5800bb['white'](_0x2b82a6['projectName']+'/'+_0x2b82a6['agentName'])),console['log']();const _0x5bd3b7=[],_0x478308=[],_0x599d40=Date['now']();for(let _0x20d0fd=0x0;_0x20d0fd<_0x5dc78c[_0x1cfb7c(0xc8)];_0x20d0fd++){const _0x1fea7d=_0x5dc78c[_0x20d0fd];_0x5dc78c['length']>0x1?console[_0x1cfb7c(0x119)](_0x1cfb7c(0xcc)+(_0x20d0fd+0x1)+'/'+_0x5dc78c[_0x1cfb7c(0xc8)]+':\x20'+a5_0x5800bb[_0x1cfb7c(0x102)](_0x1fea7d[_0x1cfb7c(0xef)])):console[_0x1cfb7c(0x119)]('Running\x20test:\x20'+a5_0x5800bb[_0x1cfb7c(0x102)](_0x1fea7d[_0x1cfb7c(0xef)]));const _0x205777=createCommandSpinner(_0x1cfb7c(0x11b)+_0x1fea7d[_0x1cfb7c(0x13b)][_0x1cfb7c(0xc8)]+':\x20Sending\x20user\x20input...');_0x205777[_0x1cfb7c(0xbc)]();try{const {result:_0x407b02,conversation:_0x42ff81}=await runTest(_0x2c66b0['llm'],_0x1fea7d,{'agentId':_0x103726,'projectId':_0x3a9150,'site':_0xdb41ba,'noEval':_0x29bb1c,'evaluatorId':_0x138861,'onRoundStart':(_0x5263bd,_0x293e6f)=>{const _0x432b14=_0x1cfb7c;_0x205777['text']='Round\x20'+(_0x5263bd+0x1)+'/'+_0x293e6f+_0x432b14(0xfc);},'onRoundComplete':(_0x199aa6,_0x81742a,_0x34a062)=>{const _0x588eb4=_0x1cfb7c,_0x14e8f3=formatElapsed(_0x81742a);_0x34a062?console[_0x588eb4(0x119)](_0x588eb4(0xde)+(_0x199aa6+0x1)+'/'+_0x1fea7d[_0x588eb4(0x13b)][_0x588eb4(0xc8)]+_0x588eb4(0xf3)+a5_0x5800bb[_0x588eb4(0xa9)]('✓')+'\x20('+_0x14e8f3+')'):console[_0x588eb4(0x119)](_0x588eb4(0xde)+(_0x199aa6+0x1)+'/'+_0x1fea7d[_0x588eb4(0x13b)]['length']+_0x588eb4(0xf3)+a5_0x5800bb[_0x588eb4(0x138)]('✗'));},'onEvaluationStart':()=>{const _0x2f7b4b=_0x1cfb7c;_0x205777[_0x2f7b4b(0xe9)]=_0x2f7b4b(0xb5);},'onEvaluationComplete':_0xdbea58=>{const _0x5e29a1=_0x1cfb7c,_0xa373c6=formatElapsed(_0xdbea58);console[_0x5e29a1(0x119)](_0x5e29a1(0xd7)+a5_0x5800bb[_0x5e29a1(0xa9)]('✓')+'\x20('+_0xa373c6+')');}});_0x205777[_0x1cfb7c(0xad)](),_0x5bd3b7[_0x1cfb7c(0xd4)](_0x407b02),_0x478308[_0x1cfb7c(0xd4)](_0x42ff81);if(_0x407b02[_0x1cfb7c(0x137)]===_0x1cfb7c(0x134))console['log'](a5_0x5800bb['green'](_0x1cfb7c(0xdb)+_0x407b02[_0x1cfb7c(0xe4)]));else _0x407b02[_0x1cfb7c(0x137)]===_0x1cfb7c(0xf4)?console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0x138)](_0x1cfb7c(0x111)+_0x407b02[_0x1cfb7c(0xe4)])):console['log'](a5_0x5800bb[_0x1cfb7c(0x138)]('✗\x20ERROR:\x20'+_0x407b02[_0x1cfb7c(0xe4)]));_0x407b02[_0x1cfb7c(0x13d)]&&console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0xb3)](_0x1cfb7c(0xbe)+_0x407b02['conversation_url'])),console[_0x1cfb7c(0x119)]();}catch(_0x2290fe){_0x205777[_0x1cfb7c(0xad)]();const _0x5a8c4d=_0x2290fe instanceof Error?_0x2290fe['message']:String(_0x2290fe);console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0x138)](_0x1cfb7c(0xf7)+_0x5a8c4d)),console[_0x1cfb7c(0x119)](),_0x5bd3b7['push']({'name':_0x1fea7d[_0x1cfb7c(0xef)],'status':'ERROR','reason':_0x5a8c4d,'timestamp':new Date()[_0x1cfb7c(0xd0)](),'duration_ms':0x0});}}const _0x4a5e80=Date[_0x1cfb7c(0xd1)]()-_0x599d40,_0x161a01=_0x5bd3b7[_0x1cfb7c(0x130)](_0xaa4e2=>_0xaa4e2['status']===_0x1cfb7c(0x134))['length'],_0x1a7efe=_0x5bd3b7['filter'](_0x23d48f=>_0x23d48f[_0x1cfb7c(0x137)]===_0x1cfb7c(0xf4))[_0x1cfb7c(0xc8)],_0x5e521e=_0x5bd3b7[_0x1cfb7c(0x130)](_0x1aa5de=>_0x1aa5de[_0x1cfb7c(0x137)]===_0x1cfb7c(0xf2))[_0x1cfb7c(0xc8)];console[_0x1cfb7c(0x119)]('━'[_0x1cfb7c(0x133)](0x3c)),console[_0x1cfb7c(0x119)](_0x1cfb7c(0xb0)),console[_0x1cfb7c(0x119)]('━'['repeat'](0x3c)),console[_0x1cfb7c(0x119)](_0x1cfb7c(0xd3)+_0x5bd3b7[_0x1cfb7c(0xc8)]),console['log'](_0x1cfb7c(0x10c)+a5_0x5800bb[_0x1cfb7c(0xa9)](_0x161a01)),console['log']('Failed:\x20\x20\x20'+a5_0x5800bb[_0x1cfb7c(0x138)](_0x1a7efe));_0x5e521e>0x0&&console['log'](_0x1cfb7c(0xdc)+a5_0x5800bb['red'](_0x5e521e));console[_0x1cfb7c(0x119)](_0x1cfb7c(0xf6)+formatElapsed(_0x4a5e80)),console['log']('━'[_0x1cfb7c(0x133)](0x3c));const _0x417b78=_0x5bd3b7[_0x1cfb7c(0x130)](_0xfbfd3c=>_0xfbfd3c[_0x1cfb7c(0x137)]!=='PASS');if(_0x417b78['length']>0x0){console[_0x1cfb7c(0x119)](),console[_0x1cfb7c(0x119)](_0x1cfb7c(0xbb));for(const _0x26f6bb of _0x417b78){const _0xff6c53=a5_0x5800bb['red']('✗'),_0x1fa641=_0x26f6bb['reason'][_0x1cfb7c(0xc8)]>0x32?_0x26f6bb[_0x1cfb7c(0xe4)][_0x1cfb7c(0xbf)](0x0,0x32)+_0x1cfb7c(0x101):_0x26f6bb['reason'];console[_0x1cfb7c(0x119)]('\x20\x20'+_0xff6c53+'\x20'+_0x26f6bb[_0x1cfb7c(0xef)]+':\x20'+_0x1fa641);}}const _0x4b7d4f={'summary':{'total':_0x5bd3b7[_0x1cfb7c(0xc8)],'passed':_0x161a01,'failed':_0x1a7efe,'errors':_0x5e521e>0x0?_0x5e521e:undefined,'duration_ms':_0x4a5e80},'tests':_0x5bd3b7,'agent':{'project':_0x2b82a6[_0x1cfb7c(0x11f)],'name':_0x2b82a6[_0x1cfb7c(0xac)],'site':_0xdb41ba},'timestamp':new Date(_0x599d40)['toISOString']()};try{const _0x5c8c50=buildCachedTestRun(_0x478308,{'site':_0xdb41ba,'projectId':_0x3a9150,'projectName':_0x2b82a6[_0x1cfb7c(0x11f)],'agentId':_0x103726,'agentName':_0x2b82a6[_0x1cfb7c(0xac)],'testYmlPath':a5_0x55524e['resolve'](_0x2b82a6[_0x1cfb7c(0x139)])});saveLastTestRun(_0x5c8c50);}catch{}if(_0x1f8ceb!=='table'||_0x4772a2){const _0x1a0dda=formatResults(_0x4b7d4f,_0x1f8ceb);if(_0x4772a2)try{a5_0x5ee627[_0x1cfb7c(0xa6)](_0x4772a2,_0x1a0dda,_0x1cfb7c(0x128)),console[_0x1cfb7c(0x119)](),console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0xb3)](_0x1cfb7c(0x12d)+_0x4772a2));}catch(_0xd17c12){return console['log'](),console['log'](a5_0x5800bb[_0x1cfb7c(0x138)](_0x1cfb7c(0xe0)+_0xd17c12)),0x1;}else console[_0x1cfb7c(0x119)](),console[_0x1cfb7c(0x119)](_0x1a0dda);}return _0x417b78['length']>0x0?0x1:0x0;}async[a5_0x57b6f6(0xcb)](_0x3c4052,_0x31e0d1){const _0x4e0d8b=a5_0x57b6f6,{options:_0x4fb354,tdx:_0x1eafcf}=_0x3c4052,{definition:_0x2cf1d7,agentInfo:_0x343a42,outputFormat:_0x205a5d,outputFile:_0xb790a4}=_0x31e0d1,_0x51182c=_0x4fb354[_0x4e0d8b(0xea)],_0x8e3179=loadLastTestRun();if(!_0x8e3179)return console['log'](a5_0x5800bb[_0x4e0d8b(0x138)](_0x4e0d8b(0x11a))),console['log'](a5_0x5800bb[_0x4e0d8b(0xb3)](_0x4e0d8b(0xa8))),0x1;if(_0x8e3179[_0x4e0d8b(0x116)][_0x4e0d8b(0xac)]!==_0x343a42[_0x4e0d8b(0xac)])return console[_0x4e0d8b(0x119)](a5_0x5800bb['red'](_0x4e0d8b(0xc1)+_0x8e3179[_0x4e0d8b(0x116)]['agentName']+_0x4e0d8b(0x10b)+_0x343a42['agentName']+'\x22.')),console['log'](a5_0x5800bb['dim'](_0x4e0d8b(0x120))),0x1;const _0x51dc92=new Set(_0x8e3179['conversations']['map'](_0x59eded=>_0x59eded['testName'])),_0x8c3dc6=_0x2cf1d7['tests'][_0x4e0d8b(0x130)](_0x55e865=>!_0x51dc92[_0x4e0d8b(0xd5)](_0x55e865['name']));if(_0x8c3dc6[_0x4e0d8b(0xc8)]>0x0&&_0x8e3179[_0x4e0d8b(0xea)]!==_0x51182c)return console[_0x4e0d8b(0x119)](a5_0x5800bb[_0x4e0d8b(0x138)](_0x4e0d8b(0xb7))),console[_0x4e0d8b(0x119)](a5_0x5800bb[_0x4e0d8b(0xb3)](_0x4e0d8b(0xe2)+_0x8e3179[_0x4e0d8b(0xea)]+_0x4e0d8b(0x114)+_0x51182c+'\x22.')),console[_0x4e0d8b(0x119)](a5_0x5800bb[_0x4e0d8b(0xb3)](_0x4e0d8b(0x12a)+_0x8e3179['site']+_0x4e0d8b(0x106))),0x1;const _0x57c70a=_0x2cf1d7[_0x4e0d8b(0xf0)]['filter'](_0x21d336=>_0x51dc92[_0x4e0d8b(0xd5)](_0x21d336[_0x4e0d8b(0xef)])),_0x20ff9c=_0x8c3dc6;let _0x3fade2;try{_0x3fade2=await setupEvaluatorAgent(_0x1eafcf['llm'],_0x4fb354[_0x4e0d8b(0x13c)]);}catch(_0x35bbd4){const _0x1fb6e8=_0x35bbd4 instanceof Error?_0x35bbd4[_0x4e0d8b(0xc5)]:String(_0x35bbd4);return console['log'](a5_0x5800bb[_0x4e0d8b(0x138)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x1fb6e8)),0x1;}console['log'](a5_0x5800bb['cyan'](_0x4e0d8b(0x12b))),console[_0x4e0d8b(0x119)](_0x4e0d8b(0x121)+a5_0x5800bb[_0x4e0d8b(0x102)](_0x8e3179[_0x4e0d8b(0xfa)])),console['log']('Agent:\x20'+a5_0x5800bb[_0x4e0d8b(0x102)](_0x8e3179[_0x4e0d8b(0x116)][_0x4e0d8b(0x11f)]+'/'+_0x8e3179[_0x4e0d8b(0x116)][_0x4e0d8b(0xac)]));_0x20ff9c[_0x4e0d8b(0xc8)]>0x0&&console['log'](_0x4e0d8b(0xbd)+a5_0x5800bb['yellow'](_0x20ff9c['length']));console[_0x4e0d8b(0x119)]();const _0x23bcdd=[],_0x228ab9=Date['now'](),_0x22aad3=createCommandSpinner(_0x4e0d8b(0x123));if(_0x57c70a[_0x4e0d8b(0xc8)]>0x0)try{const _0xb6cf56=await reevaluateFromCache(_0x1eafcf[_0x4e0d8b(0xa7)],_0x8e3179,{'tests':_0x57c70a},{'evaluatorId':_0x3fade2,'onTestStart':(_0x50457d,_0x5c86fe,_0xb2007a)=>{const _0x50eb60=_0x4e0d8b;_0x22aad3['text']=_0x50eb60(0xb4)+(_0x5c86fe+0x1)+'/'+_0xb2007a+':\x20'+_0x50457d+_0x50eb60(0x101);if(!_0x22aad3['isSpinning'])_0x22aad3[_0x50eb60(0xbc)]();},'onTestComplete':(_0x24a579,_0x2d66ca)=>{const _0x415722=_0x4e0d8b;_0x22aad3[_0x415722(0xad)]();if(_0x2d66ca[_0x415722(0x137)]===_0x415722(0x134))console[_0x415722(0x119)](a5_0x5800bb[_0x415722(0xa9)](_0x415722(0xdb)+_0x24a579)+a5_0x5800bb['dim'](_0x415722(0xd8)));else _0x2d66ca[_0x415722(0x137)]===_0x415722(0xf4)?console[_0x415722(0x119)](a5_0x5800bb['red'](_0x415722(0x111)+_0x24a579+_0x415722(0xff)+_0x2d66ca[_0x415722(0xe4)])+a5_0x5800bb[_0x415722(0xb3)]('\x20(cached)')):console['log'](a5_0x5800bb['red'](_0x415722(0xf7)+_0x24a579+_0x415722(0xff)+_0x2d66ca[_0x415722(0xe4)]));_0x2d66ca['conversation_url']&&console['log'](a5_0x5800bb[_0x415722(0xb3)](_0x415722(0x113)+_0x2d66ca[_0x415722(0x13d)])),_0x23bcdd[_0x415722(0xd4)](_0x2d66ca);},'onTestSkipped':(_0x5af2df,_0x4b870d)=>{const _0x57af5f=_0x4e0d8b;_0x22aad3[_0x57af5f(0xad)](),console['log'](a5_0x5800bb['yellow'](_0x57af5f(0xc7)+_0x5af2df+_0x57af5f(0xff)+_0x4b870d));}});for(const _0x56459f of _0xb6cf56){!_0x23bcdd[_0x4e0d8b(0xe3)](_0x19fa5e=>_0x19fa5e['name']===_0x56459f[_0x4e0d8b(0xef)])&&_0x23bcdd[_0x4e0d8b(0xd4)](_0x56459f);}}catch(_0x8713ad){_0x22aad3[_0x4e0d8b(0xad)]();const _0x28209e=_0x8713ad instanceof Error?_0x8713ad[_0x4e0d8b(0xc5)]:String(_0x8713ad);return console[_0x4e0d8b(0x119)](a5_0x5800bb[_0x4e0d8b(0x138)](_0x4e0d8b(0xdf)+_0x28209e)),0x1;}_0x22aad3[_0x4e0d8b(0xad)]();if(_0x20ff9c[_0x4e0d8b(0xc8)]>0x0){console[_0x4e0d8b(0x119)](),console[_0x4e0d8b(0x119)](a5_0x5800bb['cyan'](_0x4e0d8b(0x12c)));const {projectId:_0xa401a9,agentId:_0x4925e3}=_0x8e3179['agent'];for(const _0x35f4b1 of _0x20ff9c){console[_0x4e0d8b(0x119)](_0x4e0d8b(0x10e)+a5_0x5800bb[_0x4e0d8b(0x102)](_0x35f4b1[_0x4e0d8b(0xef)]));const _0x5e36db=createCommandSpinner(_0x4e0d8b(0x11b)+_0x35f4b1[_0x4e0d8b(0x13b)][_0x4e0d8b(0xc8)]+':\x20Sending\x20user\x20input...');_0x5e36db[_0x4e0d8b(0xbc)]();try{const {result:_0x7db36c}=await runTest(_0x1eafcf[_0x4e0d8b(0xa7)],_0x35f4b1,{'agentId':_0x4925e3,'projectId':_0xa401a9,'site':_0x8e3179[_0x4e0d8b(0xea)],'noEval':![],'evaluatorId':_0x3fade2,'onRoundStart':(_0x28214a,_0x2b2c8b)=>{const _0x5552d2=_0x4e0d8b;_0x5e36db[_0x5552d2(0xe9)]=_0x5552d2(0x10a)+(_0x28214a+0x1)+'/'+_0x2b2c8b+_0x5552d2(0xfc);},'onRoundComplete':(_0x13527f,_0x2a0366,_0x5bdd99)=>{const _0x522ba6=_0x4e0d8b,_0x3adb69=formatElapsed(_0x2a0366);_0x5bdd99?console[_0x522ba6(0x119)](_0x522ba6(0xde)+(_0x13527f+0x1)+'/'+_0x35f4b1[_0x522ba6(0x13b)][_0x522ba6(0xc8)]+_0x522ba6(0xf3)+a5_0x5800bb[_0x522ba6(0xa9)]('✓')+'\x20('+_0x3adb69+')'):console[_0x522ba6(0x119)](_0x522ba6(0xde)+(_0x13527f+0x1)+'/'+_0x35f4b1['rounds'][_0x522ba6(0xc8)]+_0x522ba6(0xf3)+a5_0x5800bb[_0x522ba6(0x138)]('✗'));},'onEvaluationStart':()=>{const _0x165d05=_0x4e0d8b;_0x5e36db[_0x165d05(0xe9)]=_0x165d05(0xb5);},'onEvaluationComplete':_0x1db6ba=>{const _0xdf72ee=_0x4e0d8b,_0x45f8d7=formatElapsed(_0x1db6ba);console['log'](_0xdf72ee(0xd7)+a5_0x5800bb[_0xdf72ee(0xa9)]('✓')+'\x20('+_0x45f8d7+')');}});_0x5e36db[_0x4e0d8b(0xad)](),_0x23bcdd['push'](_0x7db36c);if(_0x7db36c[_0x4e0d8b(0x137)]===_0x4e0d8b(0x134))console[_0x4e0d8b(0x119)](a5_0x5800bb[_0x4e0d8b(0xa9)](_0x4e0d8b(0xdb)+_0x7db36c[_0x4e0d8b(0xe4)])+a5_0x5800bb[_0x4e0d8b(0xb3)](_0x4e0d8b(0x11e)));else _0x7db36c[_0x4e0d8b(0x137)]===_0x4e0d8b(0xf4)?console[_0x4e0d8b(0x119)](a5_0x5800bb[_0x4e0d8b(0x138)](_0x4e0d8b(0x111)+_0x7db36c[_0x4e0d8b(0xe4)])+a5_0x5800bb[_0x4e0d8b(0xb3)](_0x4e0d8b(0x11e))):console[_0x4e0d8b(0x119)](a5_0x5800bb[_0x4e0d8b(0x138)](_0x4e0d8b(0xf7)+_0x7db36c['reason']));_0x7db36c[_0x4e0d8b(0x13d)]&&console['log'](a5_0x5800bb[_0x4e0d8b(0xb3)](_0x4e0d8b(0x113)+_0x7db36c[_0x4e0d8b(0x13d)]));}catch(_0xe21f77){_0x5e36db[_0x4e0d8b(0xad)]();const _0xe8402b=_0xe21f77 instanceof Error?_0xe21f77[_0x4e0d8b(0xc5)]:String(_0xe21f77);console[_0x4e0d8b(0x119)](a5_0x5800bb[_0x4e0d8b(0x138)]('✗\x20ERROR:\x20'+_0xe8402b)),_0x23bcdd[_0x4e0d8b(0xd4)]({'name':_0x35f4b1[_0x4e0d8b(0xef)],'status':_0x4e0d8b(0xf2),'reason':_0xe8402b,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console['log']();const _0x172cb0=Date['now']()-_0x228ab9,_0x199c5b=_0x23bcdd['filter'](_0x460212=>_0x460212['status']===_0x4e0d8b(0x134))[_0x4e0d8b(0xc8)],_0x27d019=_0x23bcdd[_0x4e0d8b(0x130)](_0x212023=>_0x212023[_0x4e0d8b(0x137)]===_0x4e0d8b(0xf4))[_0x4e0d8b(0xc8)],_0x11112f=_0x23bcdd[_0x4e0d8b(0x130)](_0x2983e4=>_0x2983e4['status']===_0x4e0d8b(0xf2))[_0x4e0d8b(0xc8)];console[_0x4e0d8b(0x119)]('━'[_0x4e0d8b(0x133)](0x3c)),console['log'](_0x4e0d8b(0x105)),console[_0x4e0d8b(0x119)]('━'['repeat'](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x23bcdd[_0x4e0d8b(0xc8)]),console[_0x4e0d8b(0x119)](_0x4e0d8b(0x10c)+a5_0x5800bb[_0x4e0d8b(0xa9)](_0x199c5b)),console[_0x4e0d8b(0x119)](_0x4e0d8b(0xec)+a5_0x5800bb[_0x4e0d8b(0x138)](_0x27d019));_0x11112f>0x0&&console[_0x4e0d8b(0x119)](_0x4e0d8b(0xdc)+a5_0x5800bb[_0x4e0d8b(0x138)](_0x11112f));console[_0x4e0d8b(0x119)](_0x4e0d8b(0xf6)+formatElapsed(_0x172cb0)),console[_0x4e0d8b(0x119)]('━'[_0x4e0d8b(0x133)](0x3c));const _0x51b9be={'summary':{'total':_0x23bcdd['length'],'passed':_0x199c5b,'failed':_0x27d019,'errors':_0x11112f>0x0?_0x11112f:undefined,'duration_ms':_0x172cb0},'tests':_0x23bcdd,'agent':{'project':_0x343a42[_0x4e0d8b(0x11f)],'name':_0x343a42[_0x4e0d8b(0xac)],'site':_0x51182c},'timestamp':new Date(_0x228ab9)['toISOString']()};if(_0x205a5d!==_0x4e0d8b(0x126)||_0xb790a4){const _0x483f00=formatResults(_0x51b9be,_0x205a5d);if(_0xb790a4)try{a5_0x5ee627[_0x4e0d8b(0xa6)](_0xb790a4,_0x483f00,_0x4e0d8b(0x128)),console[_0x4e0d8b(0x119)](),console['log'](a5_0x5800bb[_0x4e0d8b(0xb3)](_0x4e0d8b(0x12d)+_0xb790a4));}catch(_0xb0948b){return console[_0x4e0d8b(0x119)](),console['log'](a5_0x5800bb['red']('Error\x20writing\x20output\x20file:\x20'+_0xb0948b)),0x1;}else console[_0x4e0d8b(0x119)](),console[_0x4e0d8b(0x119)](_0x483f00);}const _0x1aeefc=_0x23bcdd[_0x4e0d8b(0x130)](_0x49f198=>_0x49f198[_0x4e0d8b(0x137)]!==_0x4e0d8b(0x134));return _0x1aeefc[_0x4e0d8b(0xc8)]>0x0?0x1:0x0;}}
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 +1 @@
1
- const a6_0x5836cb=a6_0x4feb;(function(_0x54c946,_0x576eca){const _0x4dbca1=a6_0x4feb,_0x1c26aa=_0x54c946();while(!![]){try{const _0x5494e1=parseInt(_0x4dbca1(0xce))/0x1*(parseInt(_0x4dbca1(0xc6))/0x2)+-parseInt(_0x4dbca1(0xbe))/0x3+parseInt(_0x4dbca1(0xae))/0x4+-parseInt(_0x4dbca1(0xcc))/0x5+-parseInt(_0x4dbca1(0xc5))/0x6*(parseInt(_0x4dbca1(0xc9))/0x7)+parseInt(_0x4dbca1(0xb3))/0x8*(-parseInt(_0x4dbca1(0xe4))/0x9)+parseInt(_0x4dbca1(0xcf))/0xa;if(_0x5494e1===_0x576eca)break;else _0x1c26aa['push'](_0x1c26aa['shift']());}catch(_0x55638a){_0x1c26aa['push'](_0x1c26aa['shift']());}}}(a6_0x33e9,0x39bac));function a6_0x4feb(_0x59b273,_0x487174){_0x59b273=_0x59b273-0xac;const _0x33e9d8=a6_0x33e9();let _0x4feb35=_0x33e9d8[_0x59b273];return _0x4feb35;}import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x5836cb(0xf2),a6_0x5836cb(0xe0),a6_0x5836cb(0xd7),a6_0x5836cb(0xb0),'set-cookie2',a6_0x5836cb(0xeb),a6_0x5836cb(0xe8),'x-trino-user']);function isSensitiveHeader(_0xda3b41){const _0x2dd513=a6_0x5836cb;return SENSITIVE_HEADERS[_0x2dd513(0xaf)](_0xda3b41['toLowerCase']());}function a6_0x33e9(){const _0x49e944=['isArray','Endpoint\x20must\x20start\x20with\x20/:\x20','1146136itbIfw','PUT','verbose','toUpperCase','Invalid\x20header\x20format:\x20\x22','body','includes','request','validate','POST','.\x20Valid\x20methods:\x20','907398WHaaFL','stack','type','trim','startsWith','keys','join','12Bkhpew','111786IbYsfT','\x22.\x20','llm','752563wBnfec','cdp','output','1422930pvEVGo','log','2LSXmMO','12158360Mqufiz','readBodyFromFile','DELETE','site','error','substring','execute','trino','cookie','<\x20HTTP/1.1\x20','file','entries','PATCH','headers','name','length','GET','proxy-authorization','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','Error:\x20','noColor','27QTvnvK','message','workflow','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','x-auth-token','method','llm-proxy','x-xsrf-token','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','header','.\x20Valid\x20types:\x20','color','Invalid\x20API\x20type:\x20','data','authorization','api','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','562836xmzIQW','has','set-cookie'];a6_0x33e9=function(){return _0x49e944;};return a6_0x33e9();}function parseHeader(_0x2bbbdd){const _0x3553af=a6_0x5836cb,_0x2ec33a=_0x2bbbdd['indexOf'](':');if(_0x2ec33a===-0x1)throw new Error(_0x3553af(0xb7)+_0x2bbbdd+_0x3553af(0xc7)+_0x3553af(0xe7));const _0x35e32d=_0x2bbbdd[_0x3553af(0xd4)](0x0,_0x2ec33a)['trim'](),_0xb4feb4=_0x2bbbdd[_0x3553af(0xd4)](_0x2ec33a+0x1)[_0x3553af(0xc1)]();if(!_0x35e32d)throw new Error(_0x3553af(0xec)+_0x2bbbdd+'\x22');return[_0x35e32d,_0xb4feb4];}export class ApiCommand extends BaseCommand{[a6_0x5836cb(0xdd)]=a6_0x5836cb(0xac);['description']=a6_0x5836cb(0xe1);[a6_0x5836cb(0xbb)](_0x19ad66){const _0x5c2600=a6_0x5836cb,{args:_0x497545,options:_0x580f5e}=_0x19ad66,_0x1bc33d=_0x580f5e;if(_0x497545[_0x5c2600(0xde)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0xe47771=_0x497545[0x0];if(!_0xe47771[_0x5c2600(0xc2)]('/'))return _0x5c2600(0xb2)+_0xe47771;const _0x3a9a0f=_0x1bc33d[_0x5c2600(0xf1)],_0x156ca2=_0x1bc33d['file'];if(_0x3a9a0f&&_0x156ca2)return _0x5c2600(0xad);const _0x37b18f=_0x1bc33d['method']||'GET',_0x283e9a=[_0x5c2600(0xdf),_0x5c2600(0xbc),_0x5c2600(0xb4),_0x5c2600(0xd1),_0x5c2600(0xdb)];if(!_0x283e9a['includes'](_0x37b18f[_0x5c2600(0xb6)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x37b18f+_0x5c2600(0xbd)+_0x283e9a[_0x5c2600(0xc4)](',\x20');const _0x4511f7=_0x1bc33d[_0x5c2600(0xc0)]||'td',_0x14bdb0=['td',_0x5c2600(0xca),_0x5c2600(0xe6),_0x5c2600(0xd6),_0x5c2600(0xc8),_0x5c2600(0xea)];if(!_0x14bdb0[_0x5c2600(0xb9)](_0x4511f7))return _0x5c2600(0xf0)+_0x4511f7+_0x5c2600(0xee)+_0x14bdb0[_0x5c2600(0xc4)](',\x20');return undefined;}async[a6_0x5836cb(0xd5)](_0x33722f){const _0x2f0d2f=a6_0x5836cb,{options:_0x5f3b79,args:_0x3ae0c0,tdx:_0x5e7757}=_0x33722f,_0x5eb600=_0x5f3b79,_0x477128=_0x3ae0c0[0x0],_0x442f0f=(_0x5eb600[_0x2f0d2f(0xe9)]||_0x2f0d2f(0xdf))[_0x2f0d2f(0xb6)](),_0x3f8f48=_0x5eb600[_0x2f0d2f(0xf1)],_0x3b294c=_0x5eb600[_0x2f0d2f(0xd9)],_0x366a13=_0x5eb600[_0x2f0d2f(0xed)],_0x3bb86f=_0x5eb600[_0x2f0d2f(0xc0)]||'td';try{const _0x196579={};if(_0x366a13){const _0x874318=Array[_0x2f0d2f(0xb1)](_0x366a13)?_0x366a13:[_0x366a13];for(const _0x107d31 of _0x874318){const [_0x44bcd5,_0x2b8fa7]=parseHeader(_0x107d31);_0x196579[_0x44bcd5]=_0x2b8fa7;}}let _0x8cc9ed;if(_0x3f8f48)_0x8cc9ed=_0x3f8f48;else{if(_0x3b294c)try{_0x8cc9ed=RawAPI[_0x2f0d2f(0xd0)](_0x3b294c);}catch(_0x5a1ba4){return console[_0x2f0d2f(0xd3)](_0x2f0d2f(0xe2)+(_0x5a1ba4 instanceof Error?_0x5a1ba4['message']:String(_0x5a1ba4))),0x1;}}const _0x4f07ca={'method':_0x442f0f,'apiType':_0x3bb86f,'includeHeaders':_0x5f3b79[_0x2f0d2f(0xb5)]};_0x8cc9ed&&(_0x4f07ca[_0x2f0d2f(0xb8)]=_0x8cc9ed);Object[_0x2f0d2f(0xc3)](_0x196579)[_0x2f0d2f(0xde)]>0x0&&(_0x4f07ca['headers']=_0x196579);if(_0x5f3b79[_0x2f0d2f(0xb5)]){const _0x59bc14=resolveSite(_0x5f3b79[_0x2f0d2f(0xd2)]),_0x1ff071=getEndpoint(_0x59bc14,_0x3bb86f),_0x5ef539=''+_0x1ff071+_0x477128;console[_0x2f0d2f(0xd3)]('>\x20'+_0x442f0f+'\x20'+_0x5ef539);const _0x35d93a=getAuthHeaders(_0x59bc14),_0x3cd4ce={..._0x35d93a,..._0x196579};for(const [_0x44119b,_0xe4ea75]of Object[_0x2f0d2f(0xda)](_0x3cd4ce)){!isSensitiveHeader(_0x44119b)&&console[_0x2f0d2f(0xd3)]('>\x20'+_0x44119b+':\x20'+_0xe4ea75);}_0x8cc9ed&&console[_0x2f0d2f(0xd3)]('>'),console['error']('');}const _0x39b091=await _0x5e7757[_0x2f0d2f(0xac)][_0x2f0d2f(0xba)](_0x477128,_0x4f07ca);if(_0x5f3b79[_0x2f0d2f(0xb5)]&&_0x39b091[_0x2f0d2f(0xdc)]){console[_0x2f0d2f(0xd3)](_0x2f0d2f(0xd8)+_0x39b091['status']);for(const [_0x317229,_0x268831]of Object['entries'](_0x39b091[_0x2f0d2f(0xdc)])){!isSensitiveHeader(_0x317229)&&console['error']('<\x20'+_0x317229+':\x20'+_0x268831);}console[_0x2f0d2f(0xd3)]('');}const _0x3b52c5=Boolean(_0x5f3b79['output']),_0xe931f3={'color':_0x5f3b79[_0x2f0d2f(0xef)],'noColor':_0x5f3b79[_0x2f0d2f(0xe3)]||_0x3b52c5&&!_0x5f3b79[_0x2f0d2f(0xef)]},_0xa1844e=colorizeJSON(_0x39b091[_0x2f0d2f(0xf1)],_0xe931f3);return _0x5f3b79[_0x2f0d2f(0xcb)]?(writeFileSync(_0x5f3b79[_0x2f0d2f(0xcb)],_0xa1844e),console[_0x2f0d2f(0xd3)]('Results\x20saved\x20to\x20'+_0x5f3b79[_0x2f0d2f(0xcb)])):console[_0x2f0d2f(0xcd)](_0xa1844e),0x0;}catch(_0x295841){return _0x295841 instanceof Error?(console[_0x2f0d2f(0xd3)](_0x2f0d2f(0xe2)+_0x295841[_0x2f0d2f(0xe5)]),_0x5f3b79['verbose']&&_0x295841['stack']&&console[_0x2f0d2f(0xd3)]('\x0aStack\x20trace:\x0a'+_0x295841[_0x2f0d2f(0xbf)])):console[_0x2f0d2f(0xd3)](_0x2f0d2f(0xe2)+String(_0x295841)),0x1;}}}
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 +1 @@
1
- function a7_0xd3b1(_0x45050a,_0x162a5b){_0x45050a=_0x45050a-0x1ac;const _0x3b675a=a7_0x3b67();let _0xd3b143=_0x3b675a[_0x45050a];return _0xd3b143;}const a7_0x48d991=a7_0xd3b1;(function(_0x56abd1,_0x4c4907){const _0x21bb4a=a7_0xd3b1,_0x9c04fa=_0x56abd1();while(!![]){try{const _0x3f26d0=parseInt(_0x21bb4a(0x1d8))/0x1+-parseInt(_0x21bb4a(0x1b8))/0x2+-parseInt(_0x21bb4a(0x1cc))/0x3+parseInt(_0x21bb4a(0x1c9))/0x4*(parseInt(_0x21bb4a(0x1ea))/0x5)+-parseInt(_0x21bb4a(0x1b1))/0x6+parseInt(_0x21bb4a(0x1db))/0x7+-parseInt(_0x21bb4a(0x1b3))/0x8*(-parseInt(_0x21bb4a(0x1f3))/0x9);if(_0x3f26d0===_0x4c4907)break;else _0x9c04fa['push'](_0x9c04fa['shift']());}catch(_0x1ae14a){_0x9c04fa['push'](_0x9c04fa['shift']());}}}(a7_0x3b67,0x40ec4));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';function a7_0x3b67(){const _0x21c5c6=['customSite','User:\x20','500128EMgkhr','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','\x20(profile:\x20','System\x20keychain\x20is\x20not\x20available','N/A','tdx\x20profile:\x20','✓\x20Default\x20site\x20set\x20to\x20','\x20for\x20profile:\x20','description','red','last_name','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','logLevel','Name:\x20','create','\x0aSetup\x20cancelled','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','16hceoSF','\x20\x20tdx','API\x20key\x20cannot\x20be\x20empty','196908nbmGCH','Enter\x20site\x20name:','profile','No\x20credential\x20found','\x27\x20registered','trim','status','warn','yellow','text','Site\x20name\x20cannot\x20be\x20empty','execute','306747nVrjrP','us01','jobs','1444569KgCvyF','join','apiKey','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','bold','tdx:\x20auth\x20setup','You\x20can\x20find\x20your\x20API\x20key\x20at:','Setting\x20up\x20authentication\x20for\x20site:\x20','test','password','auth:clear','/app/mp/ak','✗\x20Validation\x20failed:\x20','error','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','378960XfXTDr','name','green','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','No\x20API\x20key\x20found\x20in\x20keychain','\x20--profile\x20','✓\x20Profile\x20\x27','Select\x20your\x20Treasure\x20Data\x20site:','262809BElnva','message','Read\x20credential\x20from\x20','auth:setup','first_name','email','tdx:\x20auth\x20clear','\x20(site:\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','other','select','log','2984802wIgSWg','site','72CXqbyS','ERROR','getUserInfo'];a7_0x3b67=function(){return _0x21c5c6;};return a7_0x3b67();}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_0x2f9a9e 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_0x159986 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x48d991(0x1eb)]=a7_0x48d991(0x1f6);[a7_0x48d991(0x1c0)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x48d991(0x1d7)](_0xd0eb94){const _0xf196ac=a7_0x48d991,{options:_0x19fe6a}=_0xd0eb94,_0x1b0ca0=_0x19fe6a['profile'];console[_0xf196ac(0x1b0)](a7_0x159986[_0xf196ac(0x1df)](_0xf196ac(0x1e0)));const _0x1e561b=_0x19fe6a[_0xf196ac(0x1b2)]||_0xf196ac(0x1d9),{choices:_0x5e8824,initialIndex:_0xc90e13}=buildSiteChoices(_0x1e561b),_0x305fcc=_0x1b0ca0?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x1b0ca0+'):':_0xf196ac(0x1f2),_0x595e1c=await a7_0x2f9a9e({'type':_0xf196ac(0x1af),'name':_0xf196ac(0x1b2),'message':_0x305fcc,'choices':_0x5e8824,'initial':_0xc90e13});if(!_0x595e1c[_0xf196ac(0x1b2)])return console[_0xf196ac(0x1b0)](_0xf196ac(0x1c7)),0x1;let _0x15b11e;if(_0x595e1c['site']===_0xf196ac(0x1ae)){const _0x1f3d02=await a7_0x2f9a9e({'type':_0xf196ac(0x1d5),'name':_0xf196ac(0x1b6),'message':_0xf196ac(0x1cd),'initial':_0xf196ac(0x1d9),'validate':_0x1a38a0=>{const _0x22b635=_0xf196ac;if(!_0x1a38a0||!_0x1a38a0[_0x22b635(0x1d1)]())return _0x22b635(0x1d6);if(!/^[a-z0-9-]+$/[_0x22b635(0x1e3)](_0x1a38a0['trim']()))return _0x22b635(0x1ee);return!![];}});if(!_0x1f3d02[_0xf196ac(0x1b6)])return console['log']('\x0aSetup\x20cancelled'),0x1;_0x15b11e=_0x1f3d02['customSite'];}else _0x15b11e=_0x595e1c[_0xf196ac(0x1b2)];const _0x9707c5=resolveSite(_0x15b11e);console['log'](_0xf196ac(0x1e2)+_0x9707c5),console['log'](_0xf196ac(0x1e1)),console[_0xf196ac(0x1b0)]('\x20\x20'+getConsoleUrl(_0x9707c5,_0xf196ac(0x1e6)));const _0x23d6d3=await a7_0x2f9a9e({'type':_0xf196ac(0x1e4),'name':_0xf196ac(0x1dd),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x8b1cb9=>{const _0x9ce80f=_0xf196ac;if(!_0x8b1cb9||!_0x8b1cb9[_0x9ce80f(0x1d1)]())return _0x9ce80f(0x1cb);return!![];}});if(!_0x23d6d3[_0xf196ac(0x1dd)])return console[_0xf196ac(0x1b0)]('\x0aSetup\x20cancelled'),0x1;const _0x10af15=_0x23d6d3[_0xf196ac(0x1dd)];console['log']('Validating\x20API\x20key...');try{const _0x5b734f=TDX[_0xf196ac(0x1c6)]({'site':_0x9707c5,'apiKey':_0x10af15[_0xf196ac(0x1d1)](),'logLevel':_0x19fe6a[_0xf196ac(0x1c4)]??LogLevel[_0xf196ac(0x1b4)]}),_0xe6de5=await _0x5b734f[_0xf196ac(0x1da)][_0xf196ac(0x1b5)]();console['log'](_0xf196ac(0x1c8)+_0xe6de5[_0xf196ac(0x1f8)]+')');const _0x4d510f=await isKeychainAvailable();_0x4d510f?(await saveAPIKeyAsync(_0x10af15[_0xf196ac(0x1d1)](),_0x9707c5,_0x1b0ca0),console['log'](_0xf196ac(0x1c3)+(_0x1b0ca0?'\x20(profile:\x20'+_0x1b0ca0+')':''))):(console['warn'](a7_0x159986[_0xf196ac(0x1d4)](_0xf196ac(0x1b9))),console[_0xf196ac(0x1d3)](a7_0x159986['yellow'](_0xf196ac(0x1ed))));if(_0x1b0ca0){const _0x282a07={'site':_0x9707c5};saveProfileToUserConfig(_0x1b0ca0,_0x282a07),console['log'](_0xf196ac(0x1f1)+_0x1b0ca0+_0xf196ac(0x1d0));}else saveDefaultSiteToUserConfig(_0x9707c5),console[_0xf196ac(0x1b0)](_0xf196ac(0x1be)+_0x9707c5);const _0xfd791f=_0x1b0ca0?_0xf196ac(0x1f0)+_0x1b0ca0:'';return console[_0xf196ac(0x1b0)](),console[_0xf196ac(0x1b0)](_0xf196ac(0x1ad)),console['log'](_0xf196ac(0x1ca)+_0xfd791f+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0xf196ac(0x1b0)](_0xf196ac(0x1ca)+_0xfd791f+_0xf196ac(0x1de)),0x0;}catch(_0x469164){if(_0x469164 instanceof HTTPClientError&&_0x469164['status']===0x191)return printAuthError(_0x469164),0x1;return console[_0xf196ac(0x1e8)](a7_0x159986['red'](_0xf196ac(0x1e7)+(_0x469164 instanceof Error?_0x469164[_0xf196ac(0x1f4)]:String(_0x469164)))),console[_0xf196ac(0x1e8)](_0xf196ac(0x1e9)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x48d991(0x1eb)]='auth';[a7_0x48d991(0x1c0)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x48d991(0x1d7)](_0x236f20){const _0x7b1d9a=a7_0x48d991,{options:_0x2baaa3,tdx:_0x1d2b4d}=_0x236f20,_0x40a69b=_0x2baaa3[_0x7b1d9a(0x1b2)],_0x446434=_0x2baaa3[_0x7b1d9a(0x1ce)],_0x1a2a2a=_0x446434?_0x446434:_0x7b1d9a(0x1bc);console['log'](_0x7b1d9a(0x1bd)+_0x1a2a2a+_0x7b1d9a(0x1ac)+_0x40a69b+')');const _0x3601a6=await resolveAPIKeyAsync(_0x40a69b,_0x446434);if(_0x3601a6){const {source:_0x3bfc2c,isDeprecated:_0x3abc74}=_0x3601a6,_0x37ff0b=_0x7b1d9a(0x1f5)+_0x3bfc2c;console[_0x7b1d9a(0x1b0)](_0x3abc74?a7_0x159986[_0x7b1d9a(0x1d4)](_0x37ff0b):_0x37ff0b);}else console[_0x7b1d9a(0x1b0)](a7_0x159986['yellow'](_0x7b1d9a(0x1cf)));try{const _0x59e597=await _0x1d2b4d[_0x7b1d9a(0x1da)][_0x7b1d9a(0x1b5)]();return console[_0x7b1d9a(0x1b0)](a7_0x159986[_0x7b1d9a(0x1ec)]('✓\x20Authentication\x20successful\x0a')),console[_0x7b1d9a(0x1b0)](_0x7b1d9a(0x1b7)+_0x59e597[_0x7b1d9a(0x1f8)]),(_0x59e597['first_name']||_0x59e597[_0x7b1d9a(0x1c2)])&&console[_0x7b1d9a(0x1b0)](_0x7b1d9a(0x1c5)+[_0x59e597[_0x7b1d9a(0x1f7)],_0x59e597[_0x7b1d9a(0x1c2)]]['filter'](Boolean)[_0x7b1d9a(0x1dc)]('\x20')),0x0;}catch(_0x22a462){return _0x22a462 instanceof HTTPClientError&&_0x22a462[_0x7b1d9a(0x1d2)]===0x191?printAuthError(_0x22a462,!![],_0x446434):console['error'](a7_0x159986[_0x7b1d9a(0x1c1)]('✗\x20Validation\x20failed:\x20'+(_0x22a462 instanceof Error?_0x22a462[_0x7b1d9a(0x1f4)]:String(_0x22a462)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x48d991(0x1eb)]=a7_0x48d991(0x1e5);[a7_0x48d991(0x1c0)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x48d991(0x1d7)](_0x155aaf){const _0x1ce325=a7_0x48d991,{options:_0x28390e}=_0x155aaf,_0x44decf=_0x28390e[_0x1ce325(0x1ce)];console[_0x1ce325(0x1b0)](a7_0x159986[_0x1ce325(0x1df)](_0x1ce325(0x1f9)));const _0x551560=await isKeychainAvailable();if(!_0x551560)return console['error'](a7_0x159986[_0x1ce325(0x1c1)](_0x1ce325(0x1bb))),0x1;const _0x5ccba7=await deleteKeychainAPIKey(_0x44decf);return _0x5ccba7?(clearCredentialCache(),console[_0x1ce325(0x1b0)]('✓\x20API\x20key\x20removed\x20from\x20keychain'+(_0x44decf?_0x1ce325(0x1ba)+_0x44decf+')':'')),0x0):(console['log'](_0x1ce325(0x1ef)+(_0x44decf?_0x1ce325(0x1bf)+_0x44decf:'')),0x1);}}
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 +1 @@
1
- const a8_0x3e6f8f=a8_0x2e3d;(function(_0x3f64c5,_0x306362){const _0x2adcd6=a8_0x2e3d,_0x41bf1e=_0x3f64c5();while(!![]){try{const _0x16bd99=-parseInt(_0x2adcd6(0x12e))/0x1+-parseInt(_0x2adcd6(0x111))/0x2*(parseInt(_0x2adcd6(0x13d))/0x3)+parseInt(_0x2adcd6(0x129))/0x4+-parseInt(_0x2adcd6(0x11f))/0x5*(parseInt(_0x2adcd6(0x122))/0x6)+-parseInt(_0x2adcd6(0x127))/0x7+-parseInt(_0x2adcd6(0x11e))/0x8+parseInt(_0x2adcd6(0x12b))/0x9;if(_0x16bd99===_0x306362)break;else _0x41bf1e['push'](_0x41bf1e['shift']());}catch(_0x326b66){_0x41bf1e['push'](_0x41bf1e['shift']());}}}(a8_0x4af4,0xa63b6));function a8_0x2e3d(_0x222d69,_0x20ad45){_0x222d69=_0x222d69-0x110;const _0x4af467=a8_0x4af4();let _0x2e3d42=_0x4af467[_0x222d69];return _0x2e3d42;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';function a8_0x4af4(){const _0x46d625=['Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','2674609eLclZg','validate','3288248ABYdai','metadata','23727366eKjAOD','claude-4.5-haiku','\x20\x20Cause:\x20','785104EhaCXU','Continuing\x20chat:\x20','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','message','\x27...','--agent\x20flag','404','write','Chat\x20session:\x20','stack','new','getAgentId','cause','resolveAgentId','data','72714WJbIqU','Getting\x20default\x20agent...','type','chat','event','\x0aStack\x20trace:','20klnARn','verbose','llm','content','name','handleChatEvent','Resolving\x20project\x20\x27','includes','error','llmAgent','llmProject','code','agent','2640216OkRHiR','18020ubmwIB','stdout','join','1728NOFlAy','Error:\x20','getOrCreateDefaultAgent','streamChat'];a8_0x4af4=function(){return _0x46d625;};return a8_0x4af4();}import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function handleSDKError(_0x4a204a,_0x5ea663){const _0x466c8d=a8_0x2e3d;if(_0x4a204a instanceof SDKError)console[_0x466c8d(0x119)](_0x466c8d(0x123)+_0x4a204a[_0x466c8d(0x131)]),_0x5ea663[_0x466c8d(0x112)]&&(_0x4a204a[_0x466c8d(0x13a)]&&console[_0x466c8d(0x119)](_0x466c8d(0x12d)+_0x4a204a['cause']),_0x4a204a['stack']&&(console[_0x466c8d(0x119)](_0x466c8d(0x110)),console[_0x466c8d(0x119)](_0x4a204a[_0x466c8d(0x137)])));else throw _0x4a204a;}export class ChatCommand extends BaseCommand{[a8_0x3e6f8f(0x115)]=a8_0x3e6f8f(0x140);['description']='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a8_0x3e6f8f(0x128)](_0x3ea1ea){const _0x420d6c=a8_0x3e6f8f,_0x21ed28=_0x3ea1ea['args'][_0x420d6c(0x121)]('\x20');if(!_0x21ed28)return _0x420d6c(0x130);return undefined;}async[a8_0x3e6f8f(0x125)](_0x1867eb,_0x247b33,_0x129b0b,_0x509d36,_0x2321f6){const _0x27ab39=a8_0x3e6f8f;for await(const _0x3ba00d of _0x1867eb[_0x27ab39(0x113)][_0x27ab39(0x140)](_0x247b33,{'agentId':_0x129b0b,'chatId':_0x509d36})){if(_0x3ba00d[_0x27ab39(0x13f)]===_0x27ab39(0x12a)){const _0x140c0b=_0x3ba00d[_0x27ab39(0x13c)]['chatId'];saveLastChatId(_0x140c0b),_0x2321f6&&console['error'](_0x27ab39(0x136)+_0x140c0b);}else _0x3ba00d[_0x27ab39(0x13f)]===_0x27ab39(0x141)&&this[_0x27ab39(0x116)](_0x3ba00d['data']);}}async[a8_0x3e6f8f(0x139)](_0x43ea66,_0x1fae71,_0x5be818,_0x5e40f8,_0x29e5c0){const _0x3f8876=a8_0x3e6f8f,_0x6789e=_0x1fae71||_0x5be818;if(_0x6789e){const {projectName:_0x4b60a9,agentName:_0x5604c3}=parseAgentRef(_0x6789e),_0x1f4448=_0x5604c3||_0x6789e,_0x4c7af9=_0x5604c3?_0x4b60a9:_0x5e40f8;if(!_0x4c7af9)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x29e5c0){const _0x451165=_0x1fae71?_0x3f8876(0x133):'session\x20context';console[_0x3f8876(0x119)]('Using\x20agent\x20from\x20'+_0x451165+':\x20'+_0x4c7af9+'/'+_0x1f4448);}const _0x337bee=await withSpinner(_0x3f8876(0x117)+_0x4c7af9+_0x3f8876(0x132),()=>_0x43ea66['llm']['resolveProjectId'](_0x4c7af9),{'verbose':_0x29e5c0}),_0xb60d2e=await withSpinner('Resolving\x20agent\x20\x27'+_0x1f4448+_0x3f8876(0x132),()=>_0x43ea66[_0x3f8876(0x113)][_0x3f8876(0x13b)](_0x1f4448,_0x337bee[_0x3f8876(0x13c)]),{'verbose':_0x29e5c0});return _0xb60d2e['data'];}else{const _0x404594=_0x43ea66[_0x3f8876(0x113)]['getDefaultAgent']();if(_0x404594)return _0x29e5c0&&console[_0x3f8876(0x119)]('Using\x20cached\x20default\x20agent:\x20'+_0x404594[_0x3f8876(0x115)]),_0x404594['id'];const _0xdfdc0f=await withSpinner(_0x3f8876(0x13e),()=>_0x43ea66[_0x3f8876(0x113)][_0x3f8876(0x124)](_0x3f8876(0x12c),0x0),{'verbose':_0x29e5c0});return _0xdfdc0f[_0x3f8876(0x13c)]['id'];}}async['execute'](_0xd952f5){const _0x46842e=a8_0x3e6f8f,{options:_0x1c73cc,args:_0x38236d,tdx:_0x4c804a}=_0xd952f5,_0x420eb1=_0x38236d[_0x46842e(0x121)]('\x20'),_0x3d9f22=_0x1c73cc,_0x3fe2be=_0x3d9f22[_0x46842e(0x11d)],_0x3dfad9=_0x3d9f22[_0x46842e(0x11a)],_0x154fe2=_0x3d9f22[_0x46842e(0x11b)],_0x4ee078=_0x3d9f22[_0x46842e(0x138)];try{let _0x401240,_0x5d0fb6;!_0x4ee078&&(_0x5d0fb6=loadLastChatId(),_0x5d0fb6&&_0x1c73cc[_0x46842e(0x112)]&&console['error'](_0x46842e(0x12f)+_0x5d0fb6));(_0x4ee078||!_0x5d0fb6)&&(_0x401240=await this[_0x46842e(0x139)](_0x4c804a,_0x3fe2be,_0x3dfad9,_0x154fe2,_0x1c73cc[_0x46842e(0x112)]));try{await this[_0x46842e(0x125)](_0x4c804a,_0x420eb1,_0x401240,_0x5d0fb6,_0x1c73cc[_0x46842e(0x112)]);}catch(_0x168f33){const _0x40ed23=_0x168f33 instanceof SDKError&&_0x168f33[_0x46842e(0x11c)]===ErrorCode['CHAT_NOT_FOUND']||_0x168f33 instanceof Error&&_0x168f33[_0x46842e(0x131)][_0x46842e(0x118)](_0x46842e(0x134));if(_0x40ed23)_0x1c73cc[_0x46842e(0x112)]&&console[_0x46842e(0x119)](_0x46842e(0x126)),!_0x401240&&(_0x401240=await this[_0x46842e(0x139)](_0x4c804a,_0x3fe2be,_0x3dfad9,_0x154fe2,_0x1c73cc[_0x46842e(0x112)])),await this['streamChat'](_0x4c804a,_0x420eb1,_0x401240,undefined,_0x1c73cc[_0x46842e(0x112)]);else throw _0x168f33;}return console['log'](),0x0;}catch(_0x5afbd9){return console[_0x46842e(0x119)](),handleSDKError(_0x5afbd9,_0x1c73cc),0x1;}}['handleChatEvent'](_0x19b1b9){const _0xc1a6c9=a8_0x3e6f8f;if(_0xc1a6c9(0x114)in _0x19b1b9)process[_0xc1a6c9(0x120)][_0xc1a6c9(0x135)](_0x19b1b9['content']);else _0xc1a6c9(0x119)in _0x19b1b9&&console[_0xc1a6c9(0x119)]('\x0aError:\x20'+_0x19b1b9[_0xc1a6c9(0x119)]);}}
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)]);}}