@treasuredata/tdx 0.16.16 → 0.16.18

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 (169) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/llm-proxy.js +1 -1
  24. package/dist/commands/mcp-command.js +1 -1
  25. package/dist/commands/parent-segment-command.js +1 -1
  26. package/dist/commands/profile-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/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.d.ts.map +1 -1
  62. package/dist/mcp/tools/tdx-run.js +1 -1
  63. package/dist/mcp/tools/tdx-run.js.map +1 -1
  64. package/dist/mcp/tools/tdx-search.js +1 -1
  65. package/dist/mcp/utils.js +1 -1
  66. package/dist/proxy/anthropic-adapter.js +1 -1
  67. package/dist/proxy/claude-usage-tracker.js +1 -1
  68. package/dist/proxy/context-signature.js +1 -1
  69. package/dist/proxy/conversation-utils.js +1 -1
  70. package/dist/proxy/passthrough-server.js +1 -1
  71. package/dist/proxy/server.js +1 -1
  72. package/dist/proxy/session-cache.js +1 -1
  73. package/dist/proxy/sse-usage-parser.js +1 -1
  74. package/dist/sdk/agent/agent-config.js +1 -1
  75. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  76. package/dist/sdk/agent/agent-yaml.js +1 -1
  77. package/dist/sdk/agent/test/evaluator.js +1 -1
  78. package/dist/sdk/agent/test/executor.js +1 -1
  79. package/dist/sdk/agent/test/index.js +1 -1
  80. package/dist/sdk/agent/test/output.js +1 -1
  81. package/dist/sdk/agent/test/parser.js +1 -1
  82. package/dist/sdk/api.js +1 -1
  83. package/dist/sdk/client/cdp-api-client.js +1 -1
  84. package/dist/sdk/client/endpoints.js +1 -1
  85. package/dist/sdk/client/engage-api-client.js +1 -1
  86. package/dist/sdk/client/http-client.js +1 -1
  87. package/dist/sdk/client/llm-api-client.js +1 -1
  88. package/dist/sdk/client/rate-limiter.js +1 -1
  89. package/dist/sdk/client/td-api-client.js +1 -1
  90. package/dist/sdk/client/trino-api-client.js +1 -1
  91. package/dist/sdk/client/workflow-client.js +1 -1
  92. package/dist/sdk/connection-validator.js +1 -1
  93. package/dist/sdk/connection.js +1 -1
  94. package/dist/sdk/engage.js +1 -1
  95. package/dist/sdk/errors.js +1 -1
  96. package/dist/sdk/index.js +1 -1
  97. package/dist/sdk/io/index.js +1 -1
  98. package/dist/sdk/io/node-filesystem.js +1 -1
  99. package/dist/sdk/job.js +1 -1
  100. package/dist/sdk/journey.js +1 -1
  101. package/dist/sdk/llm/chat-cache.js +1 -1
  102. package/dist/sdk/llm/index.js +1 -1
  103. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  104. package/dist/sdk/llm/model-aliases.js +1 -1
  105. package/dist/sdk/llm/model-factors.js +1 -1
  106. package/dist/sdk/query/index.js +1 -1
  107. package/dist/sdk/query/sql-parser.js +1 -1
  108. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  109. package/dist/sdk/segment/fields-display.js +1 -1
  110. package/dist/sdk/segment/file-discovery.js +1 -1
  111. package/dist/sdk/segment/journey-utils.js +1 -1
  112. package/dist/sdk/segment/journey-yaml.js +1 -1
  113. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  114. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  115. package/dist/sdk/segment/pull-workflow.js +1 -1
  116. package/dist/sdk/segment/push-workflow.js +1 -1
  117. package/dist/sdk/segment/resolution-context.js +1 -1
  118. package/dist/sdk/segment/segment-path-parser.js +1 -1
  119. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  120. package/dist/sdk/segment/target-resolution.js +1 -1
  121. package/dist/sdk/segment/tdx-config.js +1 -1
  122. package/dist/sdk/segment/validate-files.js +1 -1
  123. package/dist/sdk/segment/yaml-validator.js +1 -1
  124. package/dist/sdk/segment.js +1 -1
  125. package/dist/sdk/types/index.js +1 -1
  126. package/dist/sdk/types/progress.js +1 -1
  127. package/dist/sdk/user.js +1 -1
  128. package/dist/sdk/util/format-detector.js +1 -1
  129. package/dist/sdk/util/formatters.js +1 -1
  130. package/dist/sdk/util/index.js +1 -1
  131. package/dist/sdk/util/tree-formatter.js +1 -1
  132. package/dist/sdk/workflow/clone-workflow.js +1 -1
  133. package/dist/sdk/workflow/index.js +1 -1
  134. package/dist/sdk/workflow/pull-workflow.js +1 -1
  135. package/dist/sdk/workflow/push-workflow.js +1 -1
  136. package/dist/sdk/workflow/tdx-config.js +1 -1
  137. package/dist/sdk/workflow/workflow-utils.js +1 -1
  138. package/dist/test-utils/command-runner.js +1 -1
  139. package/dist/test-utils/factories.js +1 -1
  140. package/dist/test-utils/fixtures.js +1 -1
  141. package/dist/test-utils/http-mock.js +1 -1
  142. package/dist/test-utils/index.js +1 -1
  143. package/dist/utils/async.js +1 -1
  144. package/dist/utils/colors.js +1 -1
  145. package/dist/utils/diff.js +1 -1
  146. package/dist/utils/file-permissions.js +1 -1
  147. package/dist/utils/global-cache.js +1 -1
  148. package/dist/utils/json-loader.js +1 -1
  149. package/dist/utils/local-cache.js +1 -1
  150. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  151. package/dist/utils/logger/formatters/index.js +1 -1
  152. package/dist/utils/logger/handlers/console-handler.js +1 -1
  153. package/dist/utils/logger/handlers/file-handler.js +1 -1
  154. package/dist/utils/logger/handlers/index.js +1 -1
  155. package/dist/utils/logger/handlers/null-handler.js +1 -1
  156. package/dist/utils/logger/index.js +1 -1
  157. package/dist/utils/logger/logger.js +1 -1
  158. package/dist/utils/logger/types.js +1 -1
  159. package/dist/utils/option-validation.js +1 -1
  160. package/dist/utils/port.js +1 -1
  161. package/dist/utils/process.js +1 -1
  162. package/dist/utils/prompt.js +1 -1
  163. package/dist/utils/spinner.js +1 -1
  164. package/dist/utils/sse-parser.js +1 -1
  165. package/dist/utils/string-utils.js +1 -1
  166. package/dist/utils/table-ref-parser.js +1 -1
  167. package/dist/utils/tdx-logger.js +1 -1
  168. package/dist/utils/version-check.js +1 -1
  169. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x477f4f=a3_0x3d2d;(function(_0x43fc7e,_0x981aaa){const _0x5ef87f=a3_0x3d2d,_0x31dab3=_0x43fc7e();while(!![]){try{const _0x289fd5=parseInt(_0x5ef87f(0x85))/0x1+-parseInt(_0x5ef87f(0x88))/0x2*(parseInt(_0x5ef87f(0x84))/0x3)+parseInt(_0x5ef87f(0x82))/0x4*(-parseInt(_0x5ef87f(0x97))/0x5)+-parseInt(_0x5ef87f(0x87))/0x6*(parseInt(_0x5ef87f(0x92))/0x7)+parseInt(_0x5ef87f(0x86))/0x8*(-parseInt(_0x5ef87f(0x94))/0x9)+-parseInt(_0x5ef87f(0x8b))/0xa+-parseInt(_0x5ef87f(0x8e))/0xb*(-parseInt(_0x5ef87f(0x8a))/0xc);if(_0x289fd5===_0x981aaa)break;else _0x31dab3['push'](_0x31dab3['shift']());}catch(_0x1ce369){_0x31dab3['push'](_0x31dab3['shift']());}}}(a3_0x5cc5,0x70ea2));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a3_0x3d2d(_0x390a7e,_0x28e8d0){_0x390a7e=_0x390a7e-0x79;const _0x5cc546=a3_0x5cc5();let _0x3d2d2d=_0x5cc546[_0x390a7e];return _0x3d2d2d;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x477f4f(0x7c)]=a3_0x477f4f(0x79);['description']=a3_0x477f4f(0x99);async[a3_0x477f4f(0x9b)](_0x33f4b8){const _0x5b72f7=a3_0x477f4f,{options:_0x4efb49,args:_0x1253da,tdx:_0x4b1458}=_0x33f4b8;if(_0x1253da[_0x5b72f7(0x8d)]===0x0)return console['error'](_0x5b72f7(0x93)),console['error'](_0x5b72f7(0x9c)),0x1;try{const {parentId:_0x23ff4b,childId:_0x3dd9de}=parseSegmentRef(_0x1253da[0x0]);if(!_0x3dd9de)return console[_0x5b72f7(0x7e)]('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x5b72f7(0x7e)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x4efb49['verbose']&&(console[_0x5b72f7(0x7e)]('Site:\x20'+_0x4efb49[_0x5b72f7(0x80)]),console[_0x5b72f7(0x7e)](_0x5b72f7(0x7b)+_0x23ff4b),console[_0x5b72f7(0x7e)](_0x5b72f7(0x8f)+_0x3dd9de));const _0x679f5a=await withSpinner(_0x5b72f7(0x98)+_0x23ff4b+_0x5b72f7(0x90),()=>_0x4b1458[_0x5b72f7(0x9a)][_0x5b72f7(0x89)](_0x23ff4b),{'verbose':_0x4efb49[_0x5b72f7(0x83)]}),_0x33baf4=_0x679f5a[_0x5b72f7(0x95)];_0x4efb49[_0x5b72f7(0x83)]&&console[_0x5b72f7(0x7e)](_0x5b72f7(0x9e)+_0x33baf4);const _0x255b94=await withSpinner(_0x5b72f7(0x81)+_0x3dd9de+_0x5b72f7(0x90),()=>_0x4b1458['segment'][_0x5b72f7(0x7f)](_0x33baf4,_0x3dd9de),{'verbose':_0x4efb49['verbose']}),_0x3f403c=_0x255b94[_0x5b72f7(0x95)];_0x4efb49['verbose']&&console['error'](_0x5b72f7(0x8c)+_0x3f403c);const _0x5a27fd=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x3dd9de+_0x5b72f7(0x90),()=>_0x4b1458[_0x5b72f7(0x9a)][_0x5b72f7(0x7d)](_0x33baf4,_0x3f403c),{'verbose':_0x4efb49['verbose']}),_0x96b093=_0x5a27fd[_0x5b72f7(0x95)];return console[_0x5b72f7(0x7e)](_0x5b72f7(0x91)+_0x96b093[_0x5b72f7(0x8d)]+_0x5b72f7(0x9d)+(_0x96b093[_0x5b72f7(0x8d)]!==0x1?'s':'')),await handleSDKOutput(_0x96b093,_0x4efb49),0x0;}catch(_0x4e4da4){if(_0x4e4da4 instanceof SDKError)return console[_0x5b72f7(0x7e)]('Error:\x20'+_0x4e4da4[_0x5b72f7(0x96)]),_0x4e4da4['cause']&&console[_0x5b72f7(0x7e)]('\x20\x20Cause:\x20'+_0x4e4da4[_0x5b72f7(0x7a)]),0x1;throw _0x4e4da4;}}}function a3_0x5cc5(){const _0x5b3f2b=['746091jcshGQ','2312lWnxKF','14694nazePA','75656JwzOzb','resolveParentId','17184iPbyXC','5359790nxmSgh','Resolved\x20child\x20ID:\x20','length','14003SFoXhR','Child\x20name:\x20','\x27...','✔\x20Found\x20','1064JwFBlw','Error:\x20Segment\x20name\x20is\x20required','13329NBuXbF','data','message','25cVGuVG','Resolving\x20parent\x20segment\x20\x27','List\x20activations\x20for\x20a\x20segment','segment','execute','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','\x20activation','Resolved\x20parent\x20ID:\x20','activations','cause','Parent\x20name:\x20','name','listActivations','error','resolveSegmentId','site','Resolving\x20child\x20segment\x20\x27','283348LaNdzE','verbose','33PVCEsn'];a3_0x5cc5=function(){return _0x5b3f2b;};return a3_0x5cc5();}
1
+ const a3_0x280203=a3_0x1d38;(function(_0x1df9b5,_0x2da6f3){const _0x4ad0d3=a3_0x1d38,_0x14f08c=_0x1df9b5();while(!![]){try{const _0x2394ae=-parseInt(_0x4ad0d3(0x10a))/0x1*(parseInt(_0x4ad0d3(0x117))/0x2)+-parseInt(_0x4ad0d3(0x106))/0x3+parseInt(_0x4ad0d3(0xfe))/0x4+-parseInt(_0x4ad0d3(0x10b))/0x5+-parseInt(_0x4ad0d3(0x10f))/0x6+parseInt(_0x4ad0d3(0x109))/0x7+parseInt(_0x4ad0d3(0x111))/0x8;if(_0x2394ae===_0x2da6f3)break;else _0x14f08c['push'](_0x14f08c['shift']());}catch(_0xe63132){_0x14f08c['push'](_0x14f08c['shift']());}}}(a3_0x4e89,0xd3e1a));function a3_0x1d38(_0x4f787d,_0x1cff37){_0x4f787d=_0x4f787d-0xf8;const _0x4e897c=a3_0x4e89();let _0x1d38e0=_0x4e897c[_0x4f787d];return _0x1d38e0;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0x4e89(){const _0xa8c5a6=['activations','cause','error','\x27...','Resolving\x20parent\x20segment\x20\x27','Site:\x20','1499481yLugiy','Resolved\x20child\x20ID:\x20','Resolved\x20parent\x20ID:\x20','2688707LzSVlY','1047kFceec','5263995wTdGLk','listActivations','data','verbose','1550994smtQOu','description','27000608cWwpcv','\x20\x20Cause:\x20','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','List\x20activations\x20for\x20a\x20segment','✔\x20Found\x20','Error:\x20','2218MATvvP','length','\x20activation','segment','site','Error:\x20Segment\x20name\x20is\x20required','Child\x20name:\x20','message','execute','323748JFVekE','Listing\x20activations\x20for\x20segment\x20\x27'];a3_0x4e89=function(){return _0xa8c5a6;};return a3_0x4e89();}export class ActivationsCommand extends BaseCommand{['name']=a3_0x280203(0x100);[a3_0x280203(0x110)]=a3_0x280203(0x114);async[a3_0x280203(0xfd)](_0x220487){const _0x2a5f02=a3_0x280203,{options:_0x6e898c,args:_0x41d7b5,tdx:_0x472f2c}=_0x220487;if(_0x41d7b5[_0x2a5f02(0x118)]===0x0)return console[_0x2a5f02(0x102)](_0x2a5f02(0xfa)),console[_0x2a5f02(0x102)](_0x2a5f02(0x113)),0x1;try{const {parentId:_0x420c4b,childId:_0x420cac}=parseSegmentRef(_0x41d7b5[0x0]);if(!_0x420cac)return console[_0x2a5f02(0x102)]('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x2a5f02(0x102)](_0x2a5f02(0x113)),0x1;_0x6e898c[_0x2a5f02(0x10e)]&&(console[_0x2a5f02(0x102)](_0x2a5f02(0x105)+_0x6e898c[_0x2a5f02(0xf9)]),console[_0x2a5f02(0x102)]('Parent\x20name:\x20'+_0x420c4b),console[_0x2a5f02(0x102)](_0x2a5f02(0xfb)+_0x420cac));const _0x569167=await withSpinner(_0x2a5f02(0x104)+_0x420c4b+_0x2a5f02(0x103),()=>_0x472f2c[_0x2a5f02(0xf8)]['resolveParentId'](_0x420c4b),{'verbose':_0x6e898c['verbose']}),_0x17ac67=_0x569167[_0x2a5f02(0x10d)];_0x6e898c[_0x2a5f02(0x10e)]&&console[_0x2a5f02(0x102)](_0x2a5f02(0x108)+_0x17ac67);const _0x7392b2=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x420cac+_0x2a5f02(0x103),()=>_0x472f2c[_0x2a5f02(0xf8)]['resolveSegmentId'](_0x17ac67,_0x420cac),{'verbose':_0x6e898c[_0x2a5f02(0x10e)]}),_0x5c65ec=_0x7392b2[_0x2a5f02(0x10d)];_0x6e898c[_0x2a5f02(0x10e)]&&console[_0x2a5f02(0x102)](_0x2a5f02(0x107)+_0x5c65ec);const _0x47f89e=await withSpinner(_0x2a5f02(0xff)+_0x420cac+_0x2a5f02(0x103),()=>_0x472f2c[_0x2a5f02(0xf8)][_0x2a5f02(0x10c)](_0x17ac67,_0x5c65ec),{'verbose':_0x6e898c['verbose']}),_0x46e73c=_0x47f89e[_0x2a5f02(0x10d)];return console['error'](_0x2a5f02(0x115)+_0x46e73c[_0x2a5f02(0x118)]+_0x2a5f02(0x119)+(_0x46e73c['length']!==0x1?'s':'')),await handleSDKOutput(_0x46e73c,_0x6e898c),0x0;}catch(_0x12ca40){if(_0x12ca40 instanceof SDKError)return console['error'](_0x2a5f02(0x116)+_0x12ca40[_0x2a5f02(0xfc)]),_0x12ca40[_0x2a5f02(0x101)]&&console[_0x2a5f02(0x102)](_0x2a5f02(0x112)+_0x12ca40['cause']),0x1;throw _0x12ca40;}}}
@@ -1 +1 @@
1
- const a4_0x35ea36=a4_0x159e;(function(_0x2af2ae,_0x3522c8){const _0x1bd7f3=a4_0x159e,_0x323004=_0x2af2ae();while(!![]){try{const _0x15afce=parseInt(_0x1bd7f3(0xc5))/0x1+-parseInt(_0x1bd7f3(0x116))/0x2*(-parseInt(_0x1bd7f3(0x10b))/0x3)+-parseInt(_0x1bd7f3(0xb6))/0x4*(parseInt(_0x1bd7f3(0xcf))/0x5)+-parseInt(_0x1bd7f3(0xe2))/0x6+-parseInt(_0x1bd7f3(0x113))/0x7+-parseInt(_0x1bd7f3(0xbe))/0x8*(-parseInt(_0x1bd7f3(0xe7))/0x9)+parseInt(_0x1bd7f3(0x98))/0xa;if(_0x15afce===_0x3522c8)break;else _0x323004['push'](_0x323004['shift']());}catch(_0x5c3e11){_0x323004['push'](_0x323004['shift']());}}}(a4_0x3574,0x2a254));import a4_0x3e8b03 from'chalk';import a4_0x9a7c69 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';function a4_0x3574(){const _0xd53b88=['sourceProjectName','\x0aChanges\x20to\x20agent\x20\x27','log','Dry\x20run\x20-\x20no\x20changes\x20made','utf-8','Pull\x20cancelled','156763lJWvKp','Pushing\x20to\x20project...','cwd','Failed\x20to\x20push\x20agent:\x20','Pulling\x20agent\x20\x22','dryRun','name','Would\x20clone:','context','\x0aChanges\x20to\x20integration\x20\x27','20ZSfWKi','profile','found','New\x20project:\x20','\x22...','\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','red','llm_project','Analyzing\x20project\x20\x22','created','Using\x20project:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x22\x20from\x20project\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','newProjectId','agentName','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20resources?','green','1323228IgISyf','\x0a✔\x20Pushed\x20','integrations','outputDir','updated','500508rwXHPG','\x20\x20tdx\x20agent\x20pull\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20\x20Knowledge\x20Bases:\x20','yes','dim','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Source:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Project\x20cloned\x20successfully','\x0aWrite\x20','Agent:\x20','New\x20project\x20ID:\x20','prompts','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','Agent\x20','Using\x20local\x20project:\x20','Would\x20push\x20agent:\x20','<new-name>','Errors:','Pushing\x20agent\x20from\x20\x22','pullAgent','llm','\x20\x20Knowledge\x20Base\x20\x22','yellow','✔\x20Context\x20set:\x20','\x20|\x20','\x20total','Writing\x20files...','\x20files?','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','MISSING_ARGUMENT','\x20new','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Push\x20cancelled','Agent\x20pulled\x20successfully','37287SyTcZB','errors','no_context','action','\x20=\x20','hasChanges','description','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','221060PyXnqK','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','dirname','34unvVpF','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20updated','agents','Summary:','Project\x20cloned\x20with\x20errors','\x0aPush\x20','Clone\x20\x22','projectId','llmProject','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20\x20Prompts:\x20','source','reason','New\x20project\x20name\x20is\x20required','Using\x20project\x20from\x20','cloneProject','force','unchanged','projectName','\x20\x20Prompt\x20\x22','Output\x20path:\x20','new','Cloning\x20\x22','\x0aProject\x20pushed\x20with\x20errors','Dry\x20run\x20-\x20no\x20files\x20written','Project:\x20','total','\x20changed','agentId','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','agent.yml','\x0aPull\x20summary\x20for\x20\x27','\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','pushProject','\x20\x20Integrations:\x20','\x22\x20to\x20new\x20project\x20\x22','\x22\x20to\x20a\x20different\x20profile','856940QEYsxf','\x0aChanges:','error','Would\x20pull\x20agent:\x20','No\x20tdx.json\x20found\x20in\x20','\x20unchanged','repeat','execute','site','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20resources\x20to\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)','no_local_folder','INVALID_ARGUMENT','diff','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20\x20Agents:\x20','knowledgeBases','\x20\x20tdx\x20agent\x20clone\x20agents/','\x20--name\x20','Output:\x20','\x20\x20Agent\x20\x22','tdx.json','join','isNew','outputPath','pushAgent','textKnowledgeBases','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x20created','84616slwLKn','cyan','parse','push','counts','\x20\x20Source:\x20','\x22:\x20','message','8sCSGoY'];a4_0x3574=function(){return _0xd53b88;};return a4_0x3574();}import{confirmKey}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a4_0x159e(_0xf8d0c7,_0xce023e){_0xf8d0c7=_0xf8d0c7-0x98;const _0x357451=a4_0x3574();let _0x159ed8=_0x357451[_0xf8d0c7];return _0x159ed8;}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(_0xdaac5a){const _0xabf12e=a4_0x159e,_0x8727ea=[];if(_0xdaac5a['total']!==undefined)_0x8727ea['push'](_0xdaac5a[_0xabf12e(0x131)]+_0xabf12e(0x102));if(_0xdaac5a[_0xabf12e(0x12c)]!==undefined&&_0xdaac5a[_0xabf12e(0x12c)]>0x0)_0x8727ea[_0xabf12e(0xb9)](a4_0x3e8b03[_0xabf12e(0xe1)](_0xdaac5a[_0xabf12e(0x12c)]+_0xabf12e(0x107)));if(_0xdaac5a[_0xabf12e(0xd8)]!==undefined&&_0xdaac5a['created']>0x0)_0x8727ea[_0xabf12e(0xb9)](a4_0x3e8b03['green'](_0xdaac5a['created']+_0xabf12e(0xb5)));if(_0xdaac5a['updated']!==undefined&&_0xdaac5a['updated']>0x0)_0x8727ea[_0xabf12e(0xb9)](a4_0x3e8b03[_0xabf12e(0xff)](_0xdaac5a[_0xabf12e(0xe6)]+_0xabf12e(0x118)));if(_0xdaac5a[_0xabf12e(0x128)]!==undefined&&_0xdaac5a[_0xabf12e(0x128)]>0x0)_0x8727ea[_0xabf12e(0xb9)](a4_0x3e8b03['gray'](_0xdaac5a[_0xabf12e(0x128)]+_0xabf12e(0x9d)));if(_0xdaac5a[_0xabf12e(0x10c)]!==undefined&&_0xdaac5a[_0xabf12e(0x10c)]>0x0)_0x8727ea[_0xabf12e(0xb9)](a4_0x3e8b03[_0xabf12e(0xd5)](_0xdaac5a[_0xabf12e(0x10c)]+'\x20errors'));return _0x8727ea[_0xabf12e(0xaf)](',\x20');}function displayDiffs(_0x4e6f32,_0x1b11e2,_0x541c49,_0x46dec5,_0x33ea57=[]){const _0x5cae26=a4_0x159e;for(const _0x2de4fd of _0x4e6f32){if(_0x2de4fd[_0x5cae26(0xa6)]){const _0x95ddf5=_0x2de4fd['agentName']||_0x2de4fd['name'];console[_0x5cae26(0xc1)](_0x5cae26(0xc0)+_0x95ddf5+'\x27:'),console['log']('─'[_0x5cae26(0x9e)](0x3c)),console[_0x5cae26(0xc1)](_0x2de4fd[_0x5cae26(0xa6)]),console[_0x5cae26(0xc1)]('─'[_0x5cae26(0x9e)](0x3c));}}for(const _0x205d8f of _0x1b11e2){_0x205d8f[_0x5cae26(0xa6)]&&(console['log']('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x205d8f[_0x5cae26(0xcb)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x5cae26(0xc1)](_0x205d8f[_0x5cae26(0xa6)]),console[_0x5cae26(0xc1)]('─'[_0x5cae26(0x9e)](0x3c)));}for(const _0x1b77eb of _0x541c49){_0x1b77eb['diff']&&(console['log'](_0x5cae26(0xda)+_0x1b77eb[_0x5cae26(0xcb)]+'\x27:'),console[_0x5cae26(0xc1)]('─'[_0x5cae26(0x9e)](0x3c)),console['log'](_0x1b77eb[_0x5cae26(0xa6)]),console[_0x5cae26(0xc1)]('─'[_0x5cae26(0x9e)](0x3c)));}for(const _0x2aa858 of _0x46dec5){_0x2aa858[_0x5cae26(0xa6)]&&(console[_0x5cae26(0xc1)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x2aa858[_0x5cae26(0xcb)]+'\x27:'),console[_0x5cae26(0xc1)]('─'[_0x5cae26(0x9e)](0x3c)),console[_0x5cae26(0xc1)](_0x2aa858[_0x5cae26(0xa6)]),console[_0x5cae26(0xc1)]('─'[_0x5cae26(0x9e)](0x3c)));}for(const _0x7b71b9 of _0x33ea57){_0x7b71b9[_0x5cae26(0xa6)]&&(console['log'](_0x5cae26(0xce)+_0x7b71b9['name']+'\x27:'),console[_0x5cae26(0xc1)]('─'[_0x5cae26(0x9e)](0x3c)),console[_0x5cae26(0xc1)](_0x7b71b9['diff']),console[_0x5cae26(0xc1)]('─'[_0x5cae26(0x9e)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';[a4_0x35ea36(0x111)]=a4_0x35ea36(0xa7);async[a4_0x35ea36(0x9f)](_0x417227){const _0x958c5f=a4_0x35ea36,{options:_0x39f7d1,args:_0x50c3eb,tdx:_0x2dbbe4}=_0x417227,_0x34090f=_0x50c3eb[0x0],_0x381626=_0x50c3eb[0x1],_0x3f8cc4=_0x39f7d1['output'],_0x154f9d=_0x39f7d1[_0x958c5f(0xca)],_0x110124=_0x39f7d1[_0x958c5f(0x127)],_0x280a22=_0x39f7d1[_0x958c5f(0xeb)],_0x308612=_0x39f7d1[_0x958c5f(0x11f)];let _0x3863a7,_0x35ed90;const _0x4de8b0=findAgentConfigPath(process['cwd']());if(_0x34090f){const _0x2248ea=a4_0x9a7c69['join'](_0x34090f,_0x958c5f(0xae));if(existsSync(_0x2248ea))try{const _0x5acdf6=JSON[_0x958c5f(0xb8)](readFileSync(_0x2248ea,_0x958c5f(0xc3)));_0x3863a7=_0x5acdf6[_0x958c5f(0xd6)],_0x35ed90=_0x34090f,console['log'](a4_0x3e8b03['dim'](_0x958c5f(0x125)+_0x2248ea+':\x20'+_0x3863a7));}catch{_0x3863a7=_0x34090f;}else _0x3863a7=_0x34090f;}else{if(_0x4de8b0)try{const _0x1bb189=JSON[_0x958c5f(0xb8)](readFileSync(_0x4de8b0,'utf-8'));_0x3863a7=_0x1bb189[_0x958c5f(0xd6)],_0x35ed90=a4_0x9a7c69[_0x958c5f(0x115)](_0x4de8b0),console[_0x958c5f(0xc1)](a4_0x3e8b03[_0x958c5f(0xec)](_0x958c5f(0xd9)+_0x3863a7));}catch{_0x3863a7=_0x308612;}else _0x3863a7=_0x308612;}if(!_0x3863a7)return console['log'](a4_0x3e8b03[_0x958c5f(0xff)](_0x958c5f(0xb4))),console[_0x958c5f(0xc1)]('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x958c5f(0xc1)](_0x958c5f(0xd4)),console[_0x958c5f(0xc1)](_0x958c5f(0x138)),console['log'](_0x958c5f(0xf5)),0x1;if(_0x381626){const {data:_0x476c09}=await withSpinner(_0x958c5f(0xc9)+_0x381626+_0x958c5f(0xdb)+_0x3863a7+_0x958c5f(0xd3),()=>_0x2dbbe4[_0x958c5f(0xfd)][_0x958c5f(0xfc)](_0x3863a7,_0x381626,_0x3f8cc4,{'dryRun':_0x154f9d,'force':_0x110124}));if(_0x154f9d)return console['log'](a4_0x3e8b03[_0x958c5f(0xff)](_0x958c5f(0x12f))),console['log'](_0x958c5f(0x9b)+_0x476c09['agentName']),console[_0x958c5f(0xc1)](_0x958c5f(0x12b)+_0x476c09[_0x958c5f(0xb1)]),_0x476c09[_0x958c5f(0xa6)]&&(console[_0x958c5f(0xc1)](_0x958c5f(0x99)),console['log']('─'[_0x958c5f(0x9e)](0x3c)),console['log'](_0x476c09[_0x958c5f(0xa6)]),console['log']('─'[_0x958c5f(0x9e)](0x3c))),0x0;return console['log'](a4_0x3e8b03[_0x958c5f(0xe1)](_0x958c5f(0x10a))),console[_0x958c5f(0xc1)](_0x958c5f(0xf2)+_0x476c09[_0x958c5f(0xde)]),console[_0x958c5f(0xc1)](_0x958c5f(0xac)+_0x476c09[_0x958c5f(0xb1)]),console[_0x958c5f(0xc1)]('Status:\x20'+(_0x476c09[_0x958c5f(0xb0)]?a4_0x3e8b03[_0x958c5f(0xe1)](_0x958c5f(0x12c)):_0x476c09[_0x958c5f(0x110)]?a4_0x3e8b03[_0x958c5f(0xff)]('updated'):a4_0x3e8b03['gray']('unchanged'))),0x0;}const _0x4884c8=_0x35ed90||_0x3f8cc4,{data:_0x4add31}=await withSpinner(_0x958c5f(0xd7)+_0x3863a7+_0x958c5f(0xd3),()=>_0x2dbbe4[_0x958c5f(0xfd)]['pullProject'](_0x3863a7,_0x4884c8,{'dryRun':!![]})),_0x30122d=_0x4add31['counts']['agents'][_0x958c5f(0x12c)]+_0x4add31[_0x958c5f(0xba)][_0x958c5f(0xa9)]['new']+_0x4add31['counts'][_0x958c5f(0xb3)][_0x958c5f(0x12c)]+_0x4add31['counts'][_0x958c5f(0xf4)][_0x958c5f(0x12c)]+_0x4add31[_0x958c5f(0xba)][_0x958c5f(0xe4)]['new'],_0x1cb663=_0x4add31[_0x958c5f(0xba)][_0x958c5f(0x119)][_0x958c5f(0xe6)]+_0x4add31['counts'][_0x958c5f(0xa9)][_0x958c5f(0xe6)]+_0x4add31[_0x958c5f(0xba)][_0x958c5f(0xb3)][_0x958c5f(0xe6)]+_0x4add31['counts'][_0x958c5f(0xf4)][_0x958c5f(0xe6)]+_0x4add31[_0x958c5f(0xba)][_0x958c5f(0xe4)]['updated'],_0x4be907=_0x4add31[_0x958c5f(0xba)][_0x958c5f(0x119)][_0x958c5f(0x128)]+_0x4add31[_0x958c5f(0xba)][_0x958c5f(0xa9)][_0x958c5f(0x128)]+_0x4add31[_0x958c5f(0xba)][_0x958c5f(0xb3)][_0x958c5f(0x128)]+_0x4add31[_0x958c5f(0xba)]['prompts'][_0x958c5f(0x128)]+_0x4add31[_0x958c5f(0xba)][_0x958c5f(0xe4)][_0x958c5f(0x128)];console['log'](_0x958c5f(0x137)+_0x4add31['projectName']+'\x27:'),console[_0x958c5f(0xc1)]('\x20\x20'+a4_0x3e8b03['green']('+\x20'+_0x30122d+_0x958c5f(0x107))+_0x958c5f(0x101)+a4_0x3e8b03[_0x958c5f(0xff)]('~\x20'+_0x1cb663+_0x958c5f(0x132))+_0x958c5f(0x101)+a4_0x3e8b03[_0x958c5f(0xec)]('=\x20'+_0x4be907+'\x20unchanged')),console[_0x958c5f(0xc1)](_0x958c5f(0xa8)+formatCountSummary(_0x4add31['counts'][_0x958c5f(0x119)])),console[_0x958c5f(0xc1)](_0x958c5f(0xea)+formatCountSummary(_0x4add31[_0x958c5f(0xba)][_0x958c5f(0xa9)])),console[_0x958c5f(0xc1)](_0x958c5f(0xdc)+formatCountSummary(_0x4add31[_0x958c5f(0xba)][_0x958c5f(0xb3)])),console[_0x958c5f(0xc1)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x4add31[_0x958c5f(0xba)][_0x958c5f(0xf4)])),console[_0x958c5f(0xc1)](_0x958c5f(0x13a)+formatCountSummary(_0x4add31[_0x958c5f(0xba)][_0x958c5f(0xe4)])),console[_0x958c5f(0xc1)]('\x20\x20Target:\x20'+a4_0x3e8b03[_0x958c5f(0xb7)](_0x4add31[_0x958c5f(0xe5)])),displayDiffs(_0x4add31[_0x958c5f(0x119)],_0x4add31[_0x958c5f(0xa9)],_0x4add31[_0x958c5f(0xb3)],_0x4add31[_0x958c5f(0xf4)],_0x4add31[_0x958c5f(0xe4)]);if(_0x154f9d)return console['log'](a4_0x3e8b03[_0x958c5f(0xff)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x30122d===0x0&&_0x1cb663===0x0)return console[_0x958c5f(0xc1)](a4_0x3e8b03['green'](_0x958c5f(0xed))),saveSessionContext({'llm_project':_0x4add31[_0x958c5f(0x129)]},_0x39f7d1['session']),console['log'](a4_0x3e8b03['green'](_0x958c5f(0x100)+a4_0x3e8b03[_0x958c5f(0xec)](_0x958c5f(0xd6))+'\x20=\x20'+a4_0x3e8b03[_0x958c5f(0xb7)](_0x4add31[_0x958c5f(0x129)]))),0x0;if(!_0x280a22&&!_0x110124){const _0xb4ff59=await confirmKey(_0x958c5f(0xf1)+(_0x30122d+_0x1cb663)+_0x958c5f(0x104));if(!_0xb4ff59)return console[_0x958c5f(0xc1)](_0x958c5f(0xc4)),0x0;}const {data:_0x1ca010}=await withSpinner(_0x958c5f(0x103),()=>_0x2dbbe4[_0x958c5f(0xfd)]['pullProject'](_0x3863a7,_0x4884c8,{'force':_0x110124}));return console[_0x958c5f(0xc1)](a4_0x3e8b03['green']('\x0a✔\x20Pulled\x20'+(_0x30122d+_0x1cb663)+'\x20files\x20to\x20'+_0x1ca010[_0x958c5f(0xe5)])),saveSessionContext({'llm_project':_0x1ca010[_0x958c5f(0x129)]},_0x39f7d1['session']),console['log'](a4_0x3e8b03[_0x958c5f(0xe1)](_0x958c5f(0x100)+a4_0x3e8b03[_0x958c5f(0xec)](_0x958c5f(0xd6))+_0x958c5f(0x10f)+a4_0x3e8b03['cyan'](_0x1ca010[_0x958c5f(0x129)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']='agent:clone';[a4_0x35ea36(0x111)]=a4_0x35ea36(0x108);async[a4_0x35ea36(0x9f)](_0x4c09a7){const _0x31591d=a4_0x35ea36,{options:_0x17cd60,args:_0x32d32e,tdx:_0x837db3}=_0x4c09a7,_0x5a5ea7=_0x32d32e[0x0],_0x4b6f85=_0x17cd60[_0x31591d(0xcb)],_0xadaa7e=_0x17cd60[_0x31591d(0xca)],_0x485483=_0x17cd60[_0x31591d(0xeb)],_0x221093=_0x17cd60['site'],_0x4d9e25=_0x17cd60[_0x31591d(0x11f)];let _0x69871c;const _0x24b43c=findAgentConfigPath(process[_0x31591d(0xc7)]());if(_0x5a5ea7){const _0x22a2de=a4_0x9a7c69[_0x31591d(0xaf)](_0x5a5ea7,'tdx.json');existsSync(_0x22a2de)?(_0x69871c=_0x5a5ea7,console[_0x31591d(0xc1)](a4_0x3e8b03[_0x31591d(0xec)](_0x31591d(0xf7)+_0x5a5ea7))):_0x69871c=_0x5a5ea7;}else{if(_0x24b43c)_0x69871c=a4_0x9a7c69[_0x31591d(0x115)](_0x24b43c),console['log'](a4_0x3e8b03[_0x31591d(0xec)]('Using\x20current\x20project:\x20'+_0x69871c));else{if(_0x4d9e25){const _0x3fdea0=sanitizeForFilesystem(_0x4d9e25);let _0xe25f8d=_0x3fdea0,_0x4b1914=a4_0x9a7c69['join'](process[_0x31591d(0xc7)](),_0x31591d(0x119),_0x3fdea0,_0x31591d(0xae));if(!existsSync(_0x4b1914)){const _0x450455=normalizeName(_0x4d9e25),_0x47eaab=a4_0x9a7c69[_0x31591d(0xaf)](process[_0x31591d(0xc7)](),'agents',_0x450455,_0x31591d(0xae));existsSync(_0x47eaab)&&(_0xe25f8d=_0x450455,_0x4b1914=_0x47eaab);}if(existsSync(_0x4b1914))_0x69871c=a4_0x9a7c69[_0x31591d(0x115)](_0x4b1914),console['log'](a4_0x3e8b03[_0x31591d(0xec)]('Using\x20local\x20project:\x20'+_0x69871c));else{const _0x2282c8=_0x17cd60[_0x31591d(0xd0)];if(_0x2282c8)throw new SDKError(ErrorCode[_0x31591d(0xa5)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x4d9e25+_0x31591d(0x13c),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x31591d(0xa1)+(_0x31591d(0xe8)+_0x4d9e25+'\x0a')+(_0x31591d(0xaa)+_0xe25f8d+_0x31591d(0xab)+(_0x4b6f85||_0x31591d(0xf9))+'\x20--profile\x20'+_0x2282c8)});_0x69871c=_0x4d9e25,console[_0x31591d(0xc1)](a4_0x3e8b03[_0x31591d(0xec)]('Using\x20context\x20project:\x20'+_0x4d9e25));}}}}if(!_0x69871c)return console[_0x31591d(0xc1)](a4_0x3e8b03[_0x31591d(0xff)](_0x31591d(0x112))),console[_0x31591d(0xc1)](_0x31591d(0x117)),console[_0x31591d(0xc1)](_0x31591d(0x134)),console[_0x31591d(0xc1)](_0x31591d(0xa3)),console[_0x31591d(0xc1)](_0x31591d(0x135)),0x1;if(!_0x4b6f85)throw new SDKError(ErrorCode[_0x31591d(0x106)],_0x31591d(0x124),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x485483&&!_0xadaa7e){const _0x3664c0=await confirmKey(_0x31591d(0x11d)+_0x69871c+_0x31591d(0x13b)+_0x4b6f85+'\x22?');if(!_0x3664c0)return console[_0x31591d(0xc1)]('Clone\x20cancelled'),0x0;}const {data:_0x4b8dae}=await withSpinner(_0x31591d(0x12d)+_0x69871c+'\x22\x20to\x20\x22'+_0x4b6f85+'\x22...',()=>_0x837db3[_0x31591d(0xfd)][_0x31591d(0x126)](_0x69871c,_0x4b6f85,{'dryRun':_0xadaa7e}));if(_0xadaa7e)return console[_0x31591d(0xc1)](a4_0x3e8b03[_0x31591d(0xff)](_0x31591d(0xc2))),console[_0x31591d(0xc1)]('Source:\x20'+_0x4b8dae['sourceProjectName']),console[_0x31591d(0xc1)]('New\x20project:\x20'+_0x4b6f85),console[_0x31591d(0xc1)](_0x31591d(0xcc)),console[_0x31591d(0xc1)]('\x20\x20Agents:\x20'+_0x4b8dae[_0x31591d(0xba)][_0x31591d(0x119)][_0x31591d(0xd8)]),console[_0x31591d(0xc1)]('\x20\x20Knowledge\x20Bases:\x20'+_0x4b8dae[_0x31591d(0xba)][_0x31591d(0xa9)][_0x31591d(0xd8)]),console[_0x31591d(0xc1)](_0x31591d(0x121)+_0x4b8dae[_0x31591d(0xba)][_0x31591d(0xf4)][_0x31591d(0xd8)]),0x0;const _0x177c86=_0x4b8dae[_0x31591d(0xba)][_0x31591d(0x119)]['errors']>0x0||_0x4b8dae[_0x31591d(0xba)][_0x31591d(0xa9)][_0x31591d(0x10c)]>0x0||_0x4b8dae[_0x31591d(0xba)][_0x31591d(0xf4)]['errors']>0x0;_0x177c86?console[_0x31591d(0xc1)](a4_0x3e8b03[_0x31591d(0xff)](_0x31591d(0x11b))):console['log'](a4_0x3e8b03[_0x31591d(0xe1)](_0x31591d(0xf0)));console[_0x31591d(0xc1)](_0x31591d(0xee)+_0x4b8dae[_0x31591d(0xbf)]),console['log'](_0x31591d(0xd2)+_0x4b8dae['newProjectName']),console['log'](_0x31591d(0xf3)+_0x4b8dae[_0x31591d(0xdd)]),console[_0x31591d(0xc1)](),console['log'](_0x31591d(0x11a)),console[_0x31591d(0xc1)]('\x20\x20Agents:\x20'+formatCountSummary(_0x4b8dae['counts']['agents'])),console[_0x31591d(0xc1)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4b8dae[_0x31591d(0xba)][_0x31591d(0xa9)])),console[_0x31591d(0xc1)](_0x31591d(0x121)+formatCountSummary(_0x4b8dae['counts'][_0x31591d(0xf4)])),console[_0x31591d(0xc1)](_0x31591d(0x13a)+formatCountSummary(_0x4b8dae[_0x31591d(0xba)]['integrations']));if(_0x177c86){console[_0x31591d(0xc1)](),console[_0x31591d(0xc1)](a4_0x3e8b03['red']('Errors:'));for(const _0x47f2bf of _0x4b8dae[_0x31591d(0x119)]){_0x47f2bf[_0x31591d(0x10e)]===_0x31591d(0x9a)&&console[_0x31591d(0xc1)](a4_0x3e8b03[_0x31591d(0xd5)]('\x20\x20Agent\x20\x22'+_0x47f2bf[_0x31591d(0xde)]+_0x31591d(0xbc)+_0x47f2bf[_0x31591d(0x9a)]));}for(const _0x32c0ae of _0x4b8dae[_0x31591d(0xa9)]){_0x32c0ae[_0x31591d(0x10e)]===_0x31591d(0x9a)&&console[_0x31591d(0xc1)](a4_0x3e8b03['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x32c0ae[_0x31591d(0xcb)]+_0x31591d(0xbc)+_0x32c0ae[_0x31591d(0x9a)]));}for(const _0xbc7b32 of _0x4b8dae[_0x31591d(0xf4)]){_0xbc7b32[_0x31591d(0x10e)]===_0x31591d(0x9a)&&console[_0x31591d(0xc1)](a4_0x3e8b03[_0x31591d(0xd5)](_0x31591d(0x12a)+_0xbc7b32[_0x31591d(0xcb)]+_0x31591d(0xbc)+_0xbc7b32['error']));}for(const _0x5c0499 of _0x4b8dae[_0x31591d(0xe4)]){_0x5c0499[_0x31591d(0x10e)]===_0x31591d(0x9a)&&console[_0x31591d(0xc1)](a4_0x3e8b03[_0x31591d(0xd5)]('\x20\x20Integration\x20\x22'+_0x5c0499['name']+_0x31591d(0xbc)+_0x5c0499[_0x31591d(0x9a)]));}return 0x1;}console[_0x31591d(0xc1)]();const _0x2cb596=getLLMProjectUrl(_0x221093,_0x4b8dae[_0x31591d(0xdd)]);return console[_0x31591d(0xc1)](_0x31591d(0x130)+a4_0x3e8b03[_0x31591d(0xb7)](_0x2cb596)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x35ea36(0xcb)]='agent:push';[a4_0x35ea36(0x111)]=a4_0x35ea36(0x105);async['execute'](_0x52f1e5){const _0x5929ae=a4_0x35ea36,{options:_0x11bee5,args:_0x5b4502,tdx:_0x3b428c}=_0x52f1e5;let _0xcf7e95=_0x5b4502[0x0]||process[_0x5929ae(0xc7)]();const _0x2f682d=_0x11bee5['dryRun'],_0x127de7=_0x11bee5[_0x5929ae(0x127)],_0x12b05a=_0x11bee5[_0x5929ae(0xeb)],_0x3728e8=_0x11bee5[_0x5929ae(0xa0)],_0x4f7b09=a4_0x9a7c69[_0x5929ae(0xaf)](_0xcf7e95,_0x5929ae(0x136)),_0x481aa9=existsSync(_0x4f7b09);if(_0x481aa9){const {data:_0x397f11}=await withSpinner(_0x5929ae(0xfb)+_0xcf7e95+_0x5929ae(0xd3),()=>_0x3b428c[_0x5929ae(0xfd)][_0x5929ae(0xb2)](_0xcf7e95,{'dryRun':_0x2f682d,'force':_0x127de7}));if(_0x2f682d)return console['log'](a4_0x3e8b03[_0x5929ae(0xff)](_0x5929ae(0xc2))),console[_0x5929ae(0xc1)](_0x5929ae(0xf8)+_0x397f11['agentName']),0x0;if(_0x397f11[_0x5929ae(0x10e)]==='error')return console['log'](a4_0x3e8b03[_0x5929ae(0xd5)](_0x5929ae(0xc8)+_0x397f11[_0x5929ae(0x9a)])),0x1;console[_0x5929ae(0xc1)](a4_0x3e8b03['green'](_0x5929ae(0xf6)+_0x397f11[_0x5929ae(0x10e)]+'\x20successfully')),console[_0x5929ae(0xc1)](_0x5929ae(0xf2)+_0x397f11['agentName']);if(_0x397f11[_0x5929ae(0x133)]&&_0x397f11[_0x5929ae(0x11e)]){const _0x53717f=getLLMAgentChatUrl(_0x3728e8,_0x397f11[_0x5929ae(0x11e)],_0x397f11['agentId']);console[_0x5929ae(0xc1)]('Chat:\x20'+a4_0x3e8b03[_0x5929ae(0xb7)](_0x53717f));}return 0x0;}const _0x2e4290=_0x11bee5['llmProject'],_0x281059=resolveProjectFromContext(_0xcf7e95,_0x2e4290);if(_0x281059[_0x5929ae(0xd1)])_0xcf7e95=_0x281059['projectDir'],_0x281059[_0x5929ae(0x122)]===_0x5929ae(0xcd)&&console[_0x5929ae(0xc1)](a4_0x3e8b03[_0x5929ae(0xec)](_0x5929ae(0xd9)+_0xcf7e95));else{let _0x997a97=_0x5929ae(0x114);_0x281059[_0x5929ae(0x123)]===_0x5929ae(0xa4)&&(_0x997a97=_0x281059[_0x5929ae(0xbd)]+_0x5929ae(0xef)+_0x281059[_0x5929ae(0x11f)]+_0x5929ae(0xdf));throw new SDKError(ErrorCode[_0x5929ae(0xa5)],_0x281059[_0x5929ae(0x123)]===_0x5929ae(0x10d)?_0x281059[_0x5929ae(0xbd)]:_0x5929ae(0x9c)+_0xcf7e95,undefined,{'helpText':_0x997a97});}const {data:_0x5ea8fb}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x3b428c[_0x5929ae(0xfd)][_0x5929ae(0x139)](_0xcf7e95,{'dryRun':!![]})),_0x34537d=_0x5ea8fb['counts']['agents'][_0x5929ae(0x10c)]>0x0;if(_0x34537d){console[_0x5929ae(0xc1)](a4_0x3e8b03[_0x5929ae(0xd5)]('\x0aErrors\x20found:'));for(const _0x350d0e of _0x5ea8fb[_0x5929ae(0x119)]){_0x350d0e[_0x5929ae(0x10e)]===_0x5929ae(0x9a)&&console[_0x5929ae(0xc1)](a4_0x3e8b03[_0x5929ae(0xd5)]('\x20\x20Agent\x20\x22'+_0x350d0e[_0x5929ae(0xde)]+_0x5929ae(0xbc)+_0x350d0e[_0x5929ae(0x9a)]));}return 0x1;}const _0x154e00=_0x5ea8fb['counts']['agents'][_0x5929ae(0xd8)]+_0x5ea8fb['counts'][_0x5929ae(0xa9)][_0x5929ae(0xd8)]+_0x5ea8fb[_0x5929ae(0xba)][_0x5929ae(0xb3)][_0x5929ae(0xd8)]+_0x5ea8fb[_0x5929ae(0xba)]['prompts']['created']+_0x5ea8fb[_0x5929ae(0xba)][_0x5929ae(0xe4)][_0x5929ae(0xd8)],_0x4e14c5=_0x5ea8fb[_0x5929ae(0xba)]['agents']['updated']+_0x5ea8fb[_0x5929ae(0xba)][_0x5929ae(0xa9)][_0x5929ae(0xe6)]+_0x5ea8fb[_0x5929ae(0xba)][_0x5929ae(0xb3)][_0x5929ae(0xe6)]+_0x5ea8fb[_0x5929ae(0xba)]['prompts'][_0x5929ae(0xe6)]+_0x5ea8fb['counts']['integrations'][_0x5929ae(0xe6)],_0x117da8=_0x5ea8fb['counts']['agents']['unchanged']+_0x5ea8fb['counts'][_0x5929ae(0xa9)]['unchanged']+_0x5ea8fb[_0x5929ae(0xba)][_0x5929ae(0xb3)][_0x5929ae(0x128)]+_0x5ea8fb[_0x5929ae(0xba)]['prompts'][_0x5929ae(0x128)]+_0x5ea8fb[_0x5929ae(0xba)][_0x5929ae(0xe4)]['unchanged'];console[_0x5929ae(0xc1)]('\x0aPush\x20summary\x20for\x20\x27'+_0x5ea8fb[_0x5929ae(0x129)]+'\x27:'),console[_0x5929ae(0xc1)]('\x20\x20'+a4_0x3e8b03[_0x5929ae(0xe1)]('+\x20'+_0x154e00+_0x5929ae(0x107))+'\x20|\x20'+a4_0x3e8b03[_0x5929ae(0xff)]('~\x20'+_0x4e14c5+'\x20changed')+'\x20|\x20'+a4_0x3e8b03[_0x5929ae(0xec)]('=\x20'+_0x117da8+_0x5929ae(0x9d))),console[_0x5929ae(0xc1)](_0x5929ae(0xa8)+formatCountSummary(_0x5ea8fb[_0x5929ae(0xba)][_0x5929ae(0x119)])),console[_0x5929ae(0xc1)](_0x5929ae(0xea)+formatCountSummary(_0x5ea8fb[_0x5929ae(0xba)][_0x5929ae(0xa9)])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5ea8fb['counts'][_0x5929ae(0xb3)])),console[_0x5929ae(0xc1)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x5ea8fb[_0x5929ae(0xba)]['prompts'])),console['log'](_0x5929ae(0x13a)+formatCountSummary(_0x5ea8fb['counts']['integrations'])),console[_0x5929ae(0xc1)](_0x5929ae(0xbb)+a4_0x3e8b03[_0x5929ae(0xb7)](_0xcf7e95)),displayDiffs(_0x5ea8fb[_0x5929ae(0x119)],_0x5ea8fb[_0x5929ae(0xa9)],_0x5ea8fb[_0x5929ae(0xb3)],_0x5ea8fb[_0x5929ae(0xf4)],_0x5ea8fb[_0x5929ae(0xe4)]);if(_0x2f682d)return console[_0x5929ae(0xc1)](a4_0x3e8b03[_0x5929ae(0xff)](_0x5929ae(0xe9))),0x0;if(_0x154e00===0x0&&_0x4e14c5===0x0){console[_0x5929ae(0xc1)](a4_0x3e8b03[_0x5929ae(0xe1)](_0x5929ae(0x120)));const _0x18fb04=getLLMProjectUrl(_0x3728e8,_0x5ea8fb['projectId']);return console[_0x5929ae(0xc1)](_0x5929ae(0x130)+a4_0x3e8b03['cyan'](_0x18fb04)),0x0;}if(!_0x12b05a&&!_0x127de7){const _0x170168=await confirmKey(_0x5929ae(0x11c)+(_0x154e00+_0x4e14c5)+_0x5929ae(0xe0));if(!_0x170168)return console[_0x5929ae(0xc1)](_0x5929ae(0x109)),0x0;}const {data:_0x27f897}=await withSpinner(_0x5929ae(0xc6),()=>_0x3b428c[_0x5929ae(0xfd)]['pushProject'](_0xcf7e95,{'force':_0x127de7})),_0x399495=_0x27f897[_0x5929ae(0xba)][_0x5929ae(0x119)][_0x5929ae(0x10c)]>0x0||_0x27f897[_0x5929ae(0xba)]['knowledgeBases'][_0x5929ae(0x10c)]>0x0||_0x27f897['counts'][_0x5929ae(0xb3)][_0x5929ae(0x10c)]>0x0||_0x27f897[_0x5929ae(0xba)][_0x5929ae(0xf4)]['errors']>0x0;if(_0x399495){console[_0x5929ae(0xc1)](a4_0x3e8b03['yellow'](_0x5929ae(0x12e))),console['log'](),console['log'](a4_0x3e8b03[_0x5929ae(0xd5)](_0x5929ae(0xfa)));for(const _0x477061 of _0x27f897['agents']){_0x477061['action']===_0x5929ae(0x9a)&&console['log'](a4_0x3e8b03[_0x5929ae(0xd5)](_0x5929ae(0xad)+_0x477061[_0x5929ae(0xde)]+_0x5929ae(0xbc)+_0x477061[_0x5929ae(0x9a)]));}for(const _0x22c4f0 of _0x27f897[_0x5929ae(0xa9)]){_0x22c4f0[_0x5929ae(0x10e)]===_0x5929ae(0x9a)&&console[_0x5929ae(0xc1)](a4_0x3e8b03[_0x5929ae(0xd5)](_0x5929ae(0xfe)+_0x22c4f0['name']+_0x5929ae(0xbc)+_0x22c4f0[_0x5929ae(0x9a)]));}for(const _0x2043bc of _0x27f897[_0x5929ae(0xb3)]){_0x2043bc[_0x5929ae(0x10e)]===_0x5929ae(0x9a)&&console[_0x5929ae(0xc1)](a4_0x3e8b03[_0x5929ae(0xd5)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x2043bc[_0x5929ae(0xcb)]+_0x5929ae(0xbc)+_0x2043bc[_0x5929ae(0x9a)]));}for(const _0x266fb1 of _0x27f897['prompts']){_0x266fb1[_0x5929ae(0x10e)]===_0x5929ae(0x9a)&&console['log'](a4_0x3e8b03['red']('\x20\x20Prompt\x20\x22'+_0x266fb1['name']+_0x5929ae(0xbc)+_0x266fb1[_0x5929ae(0x9a)]));}for(const _0x905a92 of _0x27f897[_0x5929ae(0xe4)]){_0x905a92[_0x5929ae(0x10e)]==='error'&&console[_0x5929ae(0xc1)](a4_0x3e8b03[_0x5929ae(0xd5)]('\x20\x20Integration\x20\x22'+_0x905a92['name']+'\x22:\x20'+_0x905a92[_0x5929ae(0x9a)]));}return 0x1;}console[_0x5929ae(0xc1)](a4_0x3e8b03[_0x5929ae(0xe1)](_0x5929ae(0xe3)+(_0x154e00+_0x4e14c5)+_0x5929ae(0xa2)+_0x27f897[_0x5929ae(0x129)]+'\x27'));const _0x3167ea=getLLMProjectUrl(_0x3728e8,_0x27f897[_0x5929ae(0x11e)]);return console[_0x5929ae(0xc1)](_0x5929ae(0x130)+a4_0x3e8b03[_0x5929ae(0xb7)](_0x3167ea)),0x0;}}
1
+ const a4_0x381d38=a4_0x2f5f;(function(_0x3cbd4c,_0x240562){const _0x2f562f=a4_0x2f5f,_0x8bc41a=_0x3cbd4c();while(!![]){try{const _0x486730=parseInt(_0x2f562f(0x11b))/0x1+parseInt(_0x2f562f(0x190))/0x2+-parseInt(_0x2f562f(0x180))/0x3+-parseInt(_0x2f562f(0x15e))/0x4+parseInt(_0x2f562f(0x12f))/0x5+-parseInt(_0x2f562f(0x16d))/0x6*(parseInt(_0x2f562f(0x163))/0x7)+-parseInt(_0x2f562f(0x171))/0x8*(-parseInt(_0x2f562f(0x188))/0x9);if(_0x486730===_0x240562)break;else _0x8bc41a['push'](_0x8bc41a['shift']());}catch(_0x3df12d){_0x8bc41a['push'](_0x8bc41a['shift']());}}}(a4_0x105d,0x69e62));import a4_0x2be47d from'chalk';import a4_0x29509f 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}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a4_0x105d(){const _0x291a1b=['agent:pull','1917870yqsjXV','Would\x20pull\x20agent:\x20','created','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Analyzing\x20project\x20\x22','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','MISSING_ARGUMENT','New\x20project\x20ID:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x20\x20tdx\x20agent\x20clone\x20agents/','dryRun','\x20errors','site','\x0aChanges\x20to\x20prompt\x20\x27','Using\x20project\x20from\x20','Project\x20cloned\x20successfully','✔\x20Context\x20set:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Errors:','integrations','updated','\x0aProject\x20pushed\x20with\x20errors','\x20total','errors','knowledgeBases','pullProject','Output:\x20','action','\x22\x20to\x20a\x20different\x20profile','\x20files\x20to\x20','description','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20\x20Prompts:\x20','\x22:\x20','no_local_folder','cyan','\x20\x20Agents:\x20','llm_project','\x0aWrite\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)','agentId','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','outputPath','counts','diff','projectId','2117620EChqUL','Status:\x20','found','sourceProjectName','\x0aChanges:','12747lNriGQ','Dry\x20run\x20-\x20no\x20changes\x20made','Project:\x20','\x20unchanged','gray','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Source:\x20','\x20changed','\x22\x20from\x20project\x20\x22','\x20resources?','972DypVqh','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x20--profile\x20','new','8aOQFFY','Pulling\x20agent\x20\x22','\x22...','Using\x20context\x20project:\x20','\x20\x20Integrations:\x20','\x20files?','\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','\x20|\x20','newProjectId','force','\x22\x20to\x20\x22','Using\x20project:\x20','source','log','No\x20tdx.json\x20found\x20in\x20','1902603qQCHbb','textKnowledgeBases','\x20updated','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','<new-name>','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','unchanged','\x20\x20Agent\x20\x22','2310732igDhWm','dirname','Using\x20local\x20project:\x20','INVALID_ARGUMENT','Clone\x20cancelled','Would\x20push\x20agent:\x20','projectDir','Dry\x20run\x20-\x20no\x20files\x20written','1113862aJAgEX','newProjectName','green','profile','Output\x20path:\x20','prompts','\x20\x20Knowledge\x20Bases:\x20','\x20\x20Knowledge\x20Base\x20\x22','name','Analyzing\x20changes\x20to\x20push...','isNew','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Pull\x20cancelled','llm','session','outputDir','\x20--name\x20','message','\x0a✔\x20Pushed\x20','Pushing\x20to\x20project...','no_context','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','New\x20project:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20=\x20','Agent\x20pulled\x20successfully','pushAgent','reason','Pushing\x20agent\x20from\x20\x22','error','\x0a✔\x20Pulled\x20','repeat','yellow','agent:clone','push','\x20\x20Prompt\x20\x22','tdx.json','projectName','\x20\x20tdx\x20agent\x20pull\x20','Would\x20clone:','\x20new','yes','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','agentName','pullAgent','Using\x20current\x20project:\x20','output','Agent:\x20','Chat:\x20','\x20\x20Target:\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','llmProject','total','Push\x20cancelled','695117FtjzYm','join','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20created','agents','\x0aPull\x20summary\x20for\x20\x27','parse','Clone\x20\x22','red','execute','\x20\x20Text\x20Knowledge\x20Bases:\x20','cwd','pushProject','\x20\x20Integration\x20\x22','dim','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x0aErrors\x20found:','\x20\x20Source:\x20','\x0aChanges\x20to\x20agent\x20\x27'];a4_0x105d=function(){return _0x291a1b;};return a4_0x105d();}import{saveSessionContext}from'../core/session.js';function a4_0x2f5f(_0x2fe361,_0x7ffeab){_0x2fe361=_0x2fe361-0x119;const _0x105d61=a4_0x105d();let _0x2f5fd1=_0x105d61[_0x2fe361];return _0x2f5fd1;}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x56b8a5){const _0x54cde7=a4_0x2f5f,_0x11c4aa=[];if(_0x56b8a5[_0x54cde7(0x119)]!==undefined)_0x11c4aa['push'](_0x56b8a5[_0x54cde7(0x119)]+_0x54cde7(0x145));if(_0x56b8a5['new']!==undefined&&_0x56b8a5[_0x54cde7(0x170)]>0x0)_0x11c4aa['push'](a4_0x2be47d[_0x54cde7(0x192)](_0x56b8a5['new']+_0x54cde7(0x1b8)));if(_0x56b8a5[_0x54cde7(0x131)]!==undefined&&_0x56b8a5['created']>0x0)_0x11c4aa['push'](a4_0x2be47d[_0x54cde7(0x192)](_0x56b8a5[_0x54cde7(0x131)]+_0x54cde7(0x11e)));if(_0x56b8a5['updated']!==undefined&&_0x56b8a5[_0x54cde7(0x143)]>0x0)_0x11c4aa[_0x54cde7(0x1b2)](a4_0x2be47d[_0x54cde7(0x1b0)](_0x56b8a5[_0x54cde7(0x143)]+_0x54cde7(0x182)));if(_0x56b8a5[_0x54cde7(0x186)]!==undefined&&_0x56b8a5[_0x54cde7(0x186)]>0x0)_0x11c4aa['push'](a4_0x2be47d[_0x54cde7(0x167)](_0x56b8a5[_0x54cde7(0x186)]+'\x20unchanged'));if(_0x56b8a5[_0x54cde7(0x146)]!==undefined&&_0x56b8a5[_0x54cde7(0x146)]>0x0)_0x11c4aa['push'](a4_0x2be47d['red'](_0x56b8a5[_0x54cde7(0x146)]+_0x54cde7(0x13a)));return _0x11c4aa[_0x54cde7(0x11c)](',\x20');}function displayDiffs(_0x2a3a99,_0x291424,_0x2740d3,_0x332c27,_0x4eba06=[]){const _0x1b707a=a4_0x2f5f;for(const _0x55f1af of _0x2a3a99){if(_0x55f1af['diff']){const _0x475727=_0x55f1af[_0x1b707a(0x1bb)]||_0x55f1af[_0x1b707a(0x198)];console[_0x1b707a(0x17e)](_0x1b707a(0x12d)+_0x475727+'\x27:'),console[_0x1b707a(0x17e)]('─'[_0x1b707a(0x1af)](0x3c)),console[_0x1b707a(0x17e)](_0x55f1af[_0x1b707a(0x15c)]),console[_0x1b707a(0x17e)]('─'[_0x1b707a(0x1af)](0x3c));}}for(const _0x37e3dc of _0x291424){_0x37e3dc['diff']&&(console[_0x1b707a(0x17e)](_0x1b707a(0x185)+_0x37e3dc[_0x1b707a(0x198)]+'\x27:'),console[_0x1b707a(0x17e)]('─'[_0x1b707a(0x1af)](0x3c)),console[_0x1b707a(0x17e)](_0x37e3dc[_0x1b707a(0x15c)]),console['log']('─'[_0x1b707a(0x1af)](0x3c)));}for(const _0x5738a7 of _0x2740d3){_0x5738a7['diff']&&(console[_0x1b707a(0x17e)](_0x1b707a(0x140)+_0x5738a7[_0x1b707a(0x198)]+'\x27:'),console[_0x1b707a(0x17e)]('─'[_0x1b707a(0x1af)](0x3c)),console[_0x1b707a(0x17e)](_0x5738a7[_0x1b707a(0x15c)]),console[_0x1b707a(0x17e)]('─'[_0x1b707a(0x1af)](0x3c)));}for(const _0x5f2322 of _0x332c27){_0x5f2322[_0x1b707a(0x15c)]&&(console[_0x1b707a(0x17e)](_0x1b707a(0x13c)+_0x5f2322['name']+'\x27:'),console[_0x1b707a(0x17e)]('─'[_0x1b707a(0x1af)](0x3c)),console[_0x1b707a(0x17e)](_0x5f2322[_0x1b707a(0x15c)]),console[_0x1b707a(0x17e)]('─'[_0x1b707a(0x1af)](0x3c)));}for(const _0x183f26 of _0x4eba06){_0x183f26[_0x1b707a(0x15c)]&&(console[_0x1b707a(0x17e)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x183f26[_0x1b707a(0x198)]+'\x27:'),console[_0x1b707a(0x17e)]('─'['repeat'](0x3c)),console[_0x1b707a(0x17e)](_0x183f26[_0x1b707a(0x15c)]),console[_0x1b707a(0x17e)]('─'[_0x1b707a(0x1af)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x381d38(0x198)]=a4_0x381d38(0x12e);[a4_0x381d38(0x14d)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x381d38(0x124)](_0x5a7917){const _0x1f5c35=a4_0x381d38,{options:_0x511413,args:_0x5b3344,tdx:_0x2c0cc5}=_0x5a7917,_0x137172=_0x5b3344[0x0],_0x3e3c33=_0x5b3344[0x1],_0x1d8d43=_0x511413[_0x1f5c35(0x1be)],_0x165614=_0x511413['dryRun'],_0x14caa9=_0x511413[_0x1f5c35(0x17a)],_0x520d64=_0x511413[_0x1f5c35(0x1b9)],_0xf0f611=_0x511413[_0x1f5c35(0x1c3)];let _0x303ba8,_0x579267;const _0xaf0022=findAgentConfigPath(process[_0x1f5c35(0x126)]());if(_0x137172){const _0x4a7ca9=a4_0x29509f['join'](_0x137172,_0x1f5c35(0x1b4));if(existsSync(_0x4a7ca9))try{const _0x4cb110=JSON['parse'](readFileSync(_0x4a7ca9,'utf-8'));_0x303ba8=_0x4cb110[_0x1f5c35(0x155)],_0x579267=_0x137172,console[_0x1f5c35(0x17e)](a4_0x2be47d[_0x1f5c35(0x129)](_0x1f5c35(0x13d)+_0x4a7ca9+':\x20'+_0x303ba8));}catch{_0x303ba8=_0x137172;}else _0x303ba8=_0x137172;}else{if(_0xaf0022)try{const _0x5875b4=JSON[_0x1f5c35(0x121)](readFileSync(_0xaf0022,'utf-8'));_0x303ba8=_0x5875b4[_0x1f5c35(0x155)],_0x579267=a4_0x29509f[_0x1f5c35(0x189)](_0xaf0022),console['log'](a4_0x2be47d['dim'](_0x1f5c35(0x17c)+_0x303ba8));}catch{_0x303ba8=_0xf0f611;}else _0x303ba8=_0xf0f611;}if(!_0x303ba8)return console[_0x1f5c35(0x17e)](a4_0x2be47d[_0x1f5c35(0x1b0)](_0x1f5c35(0x137))),console[_0x1f5c35(0x17e)](_0x1f5c35(0x157)),console[_0x1f5c35(0x17e)](_0x1f5c35(0x177)),console[_0x1f5c35(0x17e)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console[_0x1f5c35(0x17e)](_0x1f5c35(0x159)),0x1;if(_0x3e3c33){const {data:_0x4f434e}=await withSpinner(_0x1f5c35(0x172)+_0x3e3c33+_0x1f5c35(0x16b)+_0x303ba8+_0x1f5c35(0x173),()=>_0x2c0cc5[_0x1f5c35(0x19d)][_0x1f5c35(0x1bc)](_0x303ba8,_0x3e3c33,_0x1d8d43,{'dryRun':_0x165614,'force':_0x14caa9}));if(_0x165614)return console['log'](a4_0x2be47d[_0x1f5c35(0x1b0)](_0x1f5c35(0x18f))),console[_0x1f5c35(0x17e)](_0x1f5c35(0x130)+_0x4f434e['agentName']),console[_0x1f5c35(0x17e)](_0x1f5c35(0x194)+_0x4f434e[_0x1f5c35(0x15a)]),_0x4f434e['diff']&&(console[_0x1f5c35(0x17e)](_0x1f5c35(0x162)),console[_0x1f5c35(0x17e)]('─'[_0x1f5c35(0x1af)](0x3c)),console[_0x1f5c35(0x17e)](_0x4f434e[_0x1f5c35(0x15c)]),console[_0x1f5c35(0x17e)]('─'['repeat'](0x3c))),0x0;return console[_0x1f5c35(0x17e)](a4_0x2be47d['green'](_0x1f5c35(0x1a9))),console[_0x1f5c35(0x17e)](_0x1f5c35(0x1bf)+_0x4f434e['agentName']),console[_0x1f5c35(0x17e)](_0x1f5c35(0x149)+_0x4f434e[_0x1f5c35(0x15a)]),console[_0x1f5c35(0x17e)](_0x1f5c35(0x15f)+(_0x4f434e[_0x1f5c35(0x19a)]?a4_0x2be47d[_0x1f5c35(0x192)](_0x1f5c35(0x170)):_0x4f434e['hasChanges']?a4_0x2be47d[_0x1f5c35(0x1b0)]('updated'):a4_0x2be47d[_0x1f5c35(0x167)](_0x1f5c35(0x186)))),0x0;}const _0xe6243b=_0x579267||_0x1d8d43,{data:_0x282cff}=await withSpinner(_0x1f5c35(0x133)+_0x303ba8+'\x22...',()=>_0x2c0cc5[_0x1f5c35(0x19d)][_0x1f5c35(0x148)](_0x303ba8,_0xe6243b,{'dryRun':!![]})),_0x4b9269=_0x282cff['counts'][_0x1f5c35(0x11f)][_0x1f5c35(0x170)]+_0x282cff[_0x1f5c35(0x15b)]['knowledgeBases'][_0x1f5c35(0x170)]+_0x282cff[_0x1f5c35(0x15b)][_0x1f5c35(0x181)][_0x1f5c35(0x170)]+_0x282cff['counts']['prompts'][_0x1f5c35(0x170)]+_0x282cff[_0x1f5c35(0x15b)]['integrations'][_0x1f5c35(0x170)],_0x3aba09=_0x282cff[_0x1f5c35(0x15b)]['agents']['updated']+_0x282cff[_0x1f5c35(0x15b)][_0x1f5c35(0x147)][_0x1f5c35(0x143)]+_0x282cff[_0x1f5c35(0x15b)]['textKnowledgeBases']['updated']+_0x282cff[_0x1f5c35(0x15b)][_0x1f5c35(0x195)][_0x1f5c35(0x143)]+_0x282cff[_0x1f5c35(0x15b)]['integrations']['updated'],_0x47f67d=_0x282cff[_0x1f5c35(0x15b)]['agents'][_0x1f5c35(0x186)]+_0x282cff[_0x1f5c35(0x15b)][_0x1f5c35(0x147)][_0x1f5c35(0x186)]+_0x282cff[_0x1f5c35(0x15b)][_0x1f5c35(0x181)][_0x1f5c35(0x186)]+_0x282cff[_0x1f5c35(0x15b)][_0x1f5c35(0x195)][_0x1f5c35(0x186)]+_0x282cff[_0x1f5c35(0x15b)][_0x1f5c35(0x142)][_0x1f5c35(0x186)];console[_0x1f5c35(0x17e)](_0x1f5c35(0x120)+_0x282cff[_0x1f5c35(0x1b5)]+'\x27:'),console[_0x1f5c35(0x17e)]('\x20\x20'+a4_0x2be47d[_0x1f5c35(0x192)]('+\x20'+_0x4b9269+_0x1f5c35(0x1b8))+_0x1f5c35(0x178)+a4_0x2be47d['yellow']('~\x20'+_0x3aba09+_0x1f5c35(0x16a))+_0x1f5c35(0x178)+a4_0x2be47d[_0x1f5c35(0x129)]('=\x20'+_0x47f67d+_0x1f5c35(0x166))),console[_0x1f5c35(0x17e)](_0x1f5c35(0x154)+formatCountSummary(_0x282cff[_0x1f5c35(0x15b)][_0x1f5c35(0x11f)])),console[_0x1f5c35(0x17e)](_0x1f5c35(0x196)+formatCountSummary(_0x282cff[_0x1f5c35(0x15b)][_0x1f5c35(0x147)])),console[_0x1f5c35(0x17e)](_0x1f5c35(0x125)+formatCountSummary(_0x282cff[_0x1f5c35(0x15b)][_0x1f5c35(0x181)])),console[_0x1f5c35(0x17e)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x282cff[_0x1f5c35(0x15b)][_0x1f5c35(0x195)])),console[_0x1f5c35(0x17e)](_0x1f5c35(0x175)+formatCountSummary(_0x282cff['counts'][_0x1f5c35(0x142)])),console[_0x1f5c35(0x17e)](_0x1f5c35(0x1c1)+a4_0x2be47d[_0x1f5c35(0x153)](_0x282cff['outputDir'])),displayDiffs(_0x282cff[_0x1f5c35(0x11f)],_0x282cff[_0x1f5c35(0x147)],_0x282cff[_0x1f5c35(0x181)],_0x282cff[_0x1f5c35(0x195)],_0x282cff[_0x1f5c35(0x142)]);if(_0x165614)return console['log'](a4_0x2be47d['yellow'](_0x1f5c35(0x183))),0x0;if(_0x4b9269===0x0&&_0x3aba09===0x0)return console[_0x1f5c35(0x17e)](a4_0x2be47d['green']('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x282cff[_0x1f5c35(0x1b5)]},_0x511413[_0x1f5c35(0x19e)]),console[_0x1f5c35(0x17e)](a4_0x2be47d[_0x1f5c35(0x192)](_0x1f5c35(0x13f)+a4_0x2be47d[_0x1f5c35(0x129)](_0x1f5c35(0x155))+'\x20=\x20'+a4_0x2be47d['cyan'](_0x282cff['projectName']))),0x0;if(!_0x520d64&&!_0x14caa9){const _0x2a9e40=await confirmKey(_0x1f5c35(0x156)+(_0x4b9269+_0x3aba09)+_0x1f5c35(0x176));if(!_0x2a9e40)return console[_0x1f5c35(0x17e)](_0x1f5c35(0x19c)),0x0;}const {data:_0x3a53d8}=await withSpinner('Writing\x20files...',()=>_0x2c0cc5[_0x1f5c35(0x19d)]['pullProject'](_0x303ba8,_0xe6243b,{'force':_0x14caa9}));return console[_0x1f5c35(0x17e)](a4_0x2be47d[_0x1f5c35(0x192)](_0x1f5c35(0x1ae)+(_0x4b9269+_0x3aba09)+_0x1f5c35(0x14c)+_0x3a53d8[_0x1f5c35(0x19f)])),saveSessionContext({'llm_project':_0x3a53d8[_0x1f5c35(0x1b5)]},_0x511413['session']),console[_0x1f5c35(0x17e)](a4_0x2be47d[_0x1f5c35(0x192)](_0x1f5c35(0x13f)+a4_0x2be47d[_0x1f5c35(0x129)]('llm_project')+_0x1f5c35(0x1a8)+a4_0x2be47d[_0x1f5c35(0x153)](_0x3a53d8['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x381d38(0x198)]=a4_0x381d38(0x1b1);[a4_0x381d38(0x14d)]=a4_0x381d38(0x132);async['execute'](_0x43b716){const _0x531fa8=a4_0x381d38,{options:_0x399bf1,args:_0x36f33b,tdx:_0x5a1563}=_0x43b716,_0x2d88dc=_0x36f33b[0x0],_0x6a9cac=_0x399bf1[_0x531fa8(0x198)],_0x41109c=_0x399bf1[_0x531fa8(0x139)],_0x4c91a9=_0x399bf1['yes'],_0x52c803=_0x399bf1[_0x531fa8(0x13b)],_0x193a36=_0x399bf1[_0x531fa8(0x1c3)];let _0x4e1040;const _0x1db6cb=findAgentConfigPath(process[_0x531fa8(0x126)]());if(_0x2d88dc){const _0x23bb3=a4_0x29509f[_0x531fa8(0x11c)](_0x2d88dc,'tdx.json');existsSync(_0x23bb3)?(_0x4e1040=_0x2d88dc,console[_0x531fa8(0x17e)](a4_0x2be47d['dim'](_0x531fa8(0x18a)+_0x2d88dc))):_0x4e1040=_0x2d88dc;}else{if(_0x1db6cb)_0x4e1040=a4_0x29509f[_0x531fa8(0x189)](_0x1db6cb),console[_0x531fa8(0x17e)](a4_0x2be47d[_0x531fa8(0x129)](_0x531fa8(0x1bd)+_0x4e1040));else{if(_0x193a36){const _0x41d96e=sanitizeForFilesystem(_0x193a36);let _0x2b4dcd=_0x41d96e,_0x2934d3=a4_0x29509f['join'](process[_0x531fa8(0x126)](),_0x531fa8(0x11f),_0x41d96e,_0x531fa8(0x1b4));if(!existsSync(_0x2934d3)){const _0x134c48=normalizeName(_0x193a36),_0x1e6117=a4_0x29509f['join'](process[_0x531fa8(0x126)](),_0x531fa8(0x11f),_0x134c48,_0x531fa8(0x1b4));existsSync(_0x1e6117)&&(_0x2b4dcd=_0x134c48,_0x2934d3=_0x1e6117);}if(existsSync(_0x2934d3))_0x4e1040=a4_0x29509f[_0x531fa8(0x189)](_0x2934d3),console[_0x531fa8(0x17e)](a4_0x2be47d[_0x531fa8(0x129)](_0x531fa8(0x18a)+_0x4e1040));else{const _0x368cd5=_0x399bf1[_0x531fa8(0x193)];if(_0x368cd5)throw new SDKError(ErrorCode[_0x531fa8(0x18b)],_0x531fa8(0x168)+_0x193a36+_0x531fa8(0x14b),undefined,{'helpText':_0x531fa8(0x1a7)+_0x531fa8(0x1a5)+(_0x531fa8(0x1b6)+_0x193a36+'\x0a')+(_0x531fa8(0x138)+_0x2b4dcd+_0x531fa8(0x1a0)+(_0x6a9cac||_0x531fa8(0x184))+_0x531fa8(0x16f)+_0x368cd5)});_0x4e1040=_0x193a36,console[_0x531fa8(0x17e)](a4_0x2be47d[_0x531fa8(0x129)](_0x531fa8(0x174)+_0x193a36));}}}}if(!_0x4e1040)return console[_0x531fa8(0x17e)](a4_0x2be47d[_0x531fa8(0x1b0)](_0x531fa8(0x19b))),console[_0x531fa8(0x17e)](_0x531fa8(0x14e)),console[_0x531fa8(0x17e)](_0x531fa8(0x12a)),console[_0x531fa8(0x17e)]('\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']('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x6a9cac)throw new SDKError(ErrorCode[_0x531fa8(0x135)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x531fa8(0x1ba)});if(!_0x4c91a9&&!_0x41109c){const _0x33b438=await confirmKey(_0x531fa8(0x122)+_0x4e1040+'\x22\x20to\x20new\x20project\x20\x22'+_0x6a9cac+'\x22?');if(!_0x33b438)return console['log'](_0x531fa8(0x18c)),0x0;}const {data:_0x41d355}=await withSpinner('Cloning\x20\x22'+_0x4e1040+_0x531fa8(0x17b)+_0x6a9cac+_0x531fa8(0x173),()=>_0x5a1563['llm']['cloneProject'](_0x4e1040,_0x6a9cac,{'dryRun':_0x41109c}));if(_0x41109c)return console['log'](a4_0x2be47d[_0x531fa8(0x1b0)](_0x531fa8(0x164))),console[_0x531fa8(0x17e)](_0x531fa8(0x169)+_0x41d355[_0x531fa8(0x161)]),console[_0x531fa8(0x17e)](_0x531fa8(0x1a6)+_0x6a9cac),console[_0x531fa8(0x17e)](_0x531fa8(0x1b7)),console[_0x531fa8(0x17e)](_0x531fa8(0x154)+_0x41d355[_0x531fa8(0x15b)][_0x531fa8(0x11f)][_0x531fa8(0x131)]),console[_0x531fa8(0x17e)](_0x531fa8(0x196)+_0x41d355[_0x531fa8(0x15b)][_0x531fa8(0x147)]['created']),console[_0x531fa8(0x17e)](_0x531fa8(0x150)+_0x41d355[_0x531fa8(0x15b)][_0x531fa8(0x195)][_0x531fa8(0x131)]),0x0;const _0x581f3d=_0x41d355[_0x531fa8(0x15b)][_0x531fa8(0x11f)]['errors']>0x0||_0x41d355['counts']['knowledgeBases'][_0x531fa8(0x146)]>0x0||_0x41d355[_0x531fa8(0x15b)][_0x531fa8(0x195)][_0x531fa8(0x146)]>0x0;_0x581f3d?console['log'](a4_0x2be47d['yellow']('Project\x20cloned\x20with\x20errors')):console[_0x531fa8(0x17e)](a4_0x2be47d[_0x531fa8(0x192)](_0x531fa8(0x13e)));console[_0x531fa8(0x17e)](_0x531fa8(0x169)+_0x41d355[_0x531fa8(0x161)]),console[_0x531fa8(0x17e)](_0x531fa8(0x1a6)+_0x41d355[_0x531fa8(0x191)]),console[_0x531fa8(0x17e)](_0x531fa8(0x136)+_0x41d355[_0x531fa8(0x179)]),console[_0x531fa8(0x17e)](),console[_0x531fa8(0x17e)]('Summary:'),console['log'](_0x531fa8(0x154)+formatCountSummary(_0x41d355[_0x531fa8(0x15b)][_0x531fa8(0x11f)])),console[_0x531fa8(0x17e)](_0x531fa8(0x196)+formatCountSummary(_0x41d355[_0x531fa8(0x15b)][_0x531fa8(0x147)])),console['log'](_0x531fa8(0x150)+formatCountSummary(_0x41d355[_0x531fa8(0x15b)][_0x531fa8(0x195)])),console[_0x531fa8(0x17e)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x41d355[_0x531fa8(0x15b)][_0x531fa8(0x142)]));if(_0x581f3d){console['log'](),console[_0x531fa8(0x17e)](a4_0x2be47d[_0x531fa8(0x123)](_0x531fa8(0x141)));for(const _0x1020db of _0x41d355[_0x531fa8(0x11f)]){_0x1020db[_0x531fa8(0x14a)]==='error'&&console[_0x531fa8(0x17e)](a4_0x2be47d[_0x531fa8(0x123)](_0x531fa8(0x187)+_0x1020db[_0x531fa8(0x1bb)]+_0x531fa8(0x151)+_0x1020db[_0x531fa8(0x1ad)]));}for(const _0x11221b of _0x41d355['knowledgeBases']){_0x11221b[_0x531fa8(0x14a)]===_0x531fa8(0x1ad)&&console[_0x531fa8(0x17e)](a4_0x2be47d[_0x531fa8(0x123)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x11221b[_0x531fa8(0x198)]+_0x531fa8(0x151)+_0x11221b[_0x531fa8(0x1ad)]));}for(const _0x4fd4ed of _0x41d355[_0x531fa8(0x195)]){_0x4fd4ed[_0x531fa8(0x14a)]===_0x531fa8(0x1ad)&&console[_0x531fa8(0x17e)](a4_0x2be47d[_0x531fa8(0x123)](_0x531fa8(0x1b3)+_0x4fd4ed['name']+_0x531fa8(0x151)+_0x4fd4ed[_0x531fa8(0x1ad)]));}for(const _0x509b6b of _0x41d355[_0x531fa8(0x142)]){_0x509b6b[_0x531fa8(0x14a)]===_0x531fa8(0x1ad)&&console[_0x531fa8(0x17e)](a4_0x2be47d[_0x531fa8(0x123)](_0x531fa8(0x128)+_0x509b6b[_0x531fa8(0x198)]+'\x22:\x20'+_0x509b6b['error']));}return 0x1;}console['log']();const _0x8ba9ea=getLLMProjectUrl(_0x52c803,_0x41d355['newProjectId']);return console[_0x531fa8(0x17e)]('Project:\x20'+a4_0x2be47d['cyan'](_0x8ba9ea)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x381d38(0x198)]='agent:push';['description']=a4_0x381d38(0x134);async['execute'](_0x5a3837){const _0x342383=a4_0x381d38,{options:_0x204596,args:_0xb15eee,tdx:_0x3fffd9}=_0x5a3837;let _0x4f278a=_0xb15eee[0x0]||process['cwd']();const _0x2db04a=_0x204596['dryRun'],_0x4edbb7=_0x204596[_0x342383(0x17a)],_0x1f38a1=_0x204596[_0x342383(0x1b9)],_0x91bc37=_0x204596[_0x342383(0x13b)],_0x4daf3d=a4_0x29509f[_0x342383(0x11c)](_0x4f278a,'agent.yml'),_0x70ba43=existsSync(_0x4daf3d);if(_0x70ba43){const {data:_0x3c3f0a}=await withSpinner(_0x342383(0x1ac)+_0x4f278a+_0x342383(0x173),()=>_0x3fffd9[_0x342383(0x19d)][_0x342383(0x1aa)](_0x4f278a,{'dryRun':_0x2db04a,'force':_0x4edbb7}));if(_0x2db04a)return console['log'](a4_0x2be47d['yellow'](_0x342383(0x164))),console['log'](_0x342383(0x18d)+_0x3c3f0a[_0x342383(0x1bb)]),0x0;if(_0x3c3f0a['action']===_0x342383(0x1ad))return console[_0x342383(0x17e)](a4_0x2be47d['red']('Failed\x20to\x20push\x20agent:\x20'+_0x3c3f0a[_0x342383(0x1ad)])),0x1;console[_0x342383(0x17e)](a4_0x2be47d['green']('Agent\x20'+_0x3c3f0a[_0x342383(0x14a)]+'\x20successfully')),console['log'](_0x342383(0x1bf)+_0x3c3f0a['agentName']);if(_0x3c3f0a[_0x342383(0x158)]&&_0x3c3f0a['projectId']){const _0xab9f2c=getLLMAgentChatUrl(_0x91bc37,_0x3c3f0a['projectId'],_0x3c3f0a[_0x342383(0x158)]);console['log'](_0x342383(0x1c0)+a4_0x2be47d[_0x342383(0x153)](_0xab9f2c));}return 0x0;}const _0xc350e8=_0x204596[_0x342383(0x1c3)],_0x3191bb=resolveProjectFromContext(_0x4f278a,_0xc350e8);if(_0x3191bb[_0x342383(0x160)])_0x4f278a=_0x3191bb[_0x342383(0x18e)],_0x3191bb[_0x342383(0x17d)]==='context'&&console[_0x342383(0x17e)](a4_0x2be47d[_0x342383(0x129)](_0x342383(0x17c)+_0x4f278a));else{let _0x4420d7=_0x342383(0x1c2);_0x3191bb[_0x342383(0x1ab)]===_0x342383(0x152)&&(_0x4420d7=_0x3191bb['message']+_0x342383(0x16e)+_0x3191bb[_0x342383(0x1c3)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3191bb[_0x342383(0x1ab)]===_0x342383(0x1a4)?_0x3191bb[_0x342383(0x1a1)]:_0x342383(0x17f)+_0x4f278a,undefined,{'helpText':_0x4420d7});}const {data:_0x4bb518}=await withSpinner(_0x342383(0x199),()=>_0x3fffd9[_0x342383(0x19d)]['pushProject'](_0x4f278a,{'dryRun':!![]})),_0x5c0d9b=_0x4bb518['counts'][_0x342383(0x11f)][_0x342383(0x146)]>0x0;if(_0x5c0d9b){console[_0x342383(0x17e)](a4_0x2be47d[_0x342383(0x123)](_0x342383(0x12b)));for(const _0x53b70d of _0x4bb518[_0x342383(0x11f)]){_0x53b70d['action']===_0x342383(0x1ad)&&console['log'](a4_0x2be47d[_0x342383(0x123)]('\x20\x20Agent\x20\x22'+_0x53b70d[_0x342383(0x1bb)]+_0x342383(0x151)+_0x53b70d[_0x342383(0x1ad)]));}return 0x1;}const _0x48726f=_0x4bb518[_0x342383(0x15b)][_0x342383(0x11f)]['created']+_0x4bb518['counts'][_0x342383(0x147)][_0x342383(0x131)]+_0x4bb518[_0x342383(0x15b)][_0x342383(0x181)][_0x342383(0x131)]+_0x4bb518[_0x342383(0x15b)][_0x342383(0x195)]['created']+_0x4bb518['counts'][_0x342383(0x142)][_0x342383(0x131)],_0x508a3a=_0x4bb518['counts'][_0x342383(0x11f)][_0x342383(0x143)]+_0x4bb518['counts'][_0x342383(0x147)][_0x342383(0x143)]+_0x4bb518[_0x342383(0x15b)][_0x342383(0x181)][_0x342383(0x143)]+_0x4bb518[_0x342383(0x15b)]['prompts']['updated']+_0x4bb518[_0x342383(0x15b)][_0x342383(0x142)][_0x342383(0x143)],_0xa8ba70=_0x4bb518[_0x342383(0x15b)]['agents'][_0x342383(0x186)]+_0x4bb518[_0x342383(0x15b)]['knowledgeBases']['unchanged']+_0x4bb518[_0x342383(0x15b)][_0x342383(0x181)][_0x342383(0x186)]+_0x4bb518[_0x342383(0x15b)][_0x342383(0x195)]['unchanged']+_0x4bb518[_0x342383(0x15b)][_0x342383(0x142)][_0x342383(0x186)];console[_0x342383(0x17e)]('\x0aPush\x20summary\x20for\x20\x27'+_0x4bb518[_0x342383(0x1b5)]+'\x27:'),console[_0x342383(0x17e)]('\x20\x20'+a4_0x2be47d[_0x342383(0x192)]('+\x20'+_0x48726f+'\x20new')+_0x342383(0x178)+a4_0x2be47d[_0x342383(0x1b0)]('~\x20'+_0x508a3a+_0x342383(0x16a))+_0x342383(0x178)+a4_0x2be47d[_0x342383(0x129)]('=\x20'+_0xa8ba70+_0x342383(0x166))),console[_0x342383(0x17e)](_0x342383(0x154)+formatCountSummary(_0x4bb518[_0x342383(0x15b)]['agents'])),console[_0x342383(0x17e)](_0x342383(0x196)+formatCountSummary(_0x4bb518['counts'][_0x342383(0x147)])),console['log'](_0x342383(0x125)+formatCountSummary(_0x4bb518[_0x342383(0x15b)][_0x342383(0x181)])),console[_0x342383(0x17e)](_0x342383(0x150)+formatCountSummary(_0x4bb518['counts'][_0x342383(0x195)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x4bb518[_0x342383(0x15b)][_0x342383(0x142)])),console[_0x342383(0x17e)](_0x342383(0x12c)+a4_0x2be47d['cyan'](_0x4f278a)),displayDiffs(_0x4bb518[_0x342383(0x11f)],_0x4bb518['knowledgeBases'],_0x4bb518[_0x342383(0x181)],_0x4bb518[_0x342383(0x195)],_0x4bb518[_0x342383(0x142)]);if(_0x2db04a)return console['log'](a4_0x2be47d[_0x342383(0x1b0)](_0x342383(0x14f))),0x0;if(_0x48726f===0x0&&_0x508a3a===0x0){console[_0x342383(0x17e)](a4_0x2be47d[_0x342383(0x192)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x493ca5=getLLMProjectUrl(_0x91bc37,_0x4bb518[_0x342383(0x15d)]);return console[_0x342383(0x17e)](_0x342383(0x165)+a4_0x2be47d[_0x342383(0x153)](_0x493ca5)),0x0;}if(!_0x1f38a1&&!_0x4edbb7){const _0x223d4c=await confirmKey('\x0aPush\x20'+(_0x48726f+_0x508a3a)+_0x342383(0x16c));if(!_0x223d4c)return console['log'](_0x342383(0x11a)),0x0;}const {data:_0x46c747}=await withSpinner(_0x342383(0x1a3),()=>_0x3fffd9[_0x342383(0x19d)][_0x342383(0x127)](_0x4f278a,{'force':_0x4edbb7})),_0x39ba8b=_0x46c747['counts']['agents']['errors']>0x0||_0x46c747[_0x342383(0x15b)][_0x342383(0x147)][_0x342383(0x146)]>0x0||_0x46c747[_0x342383(0x15b)][_0x342383(0x181)][_0x342383(0x146)]>0x0||_0x46c747['counts'][_0x342383(0x195)][_0x342383(0x146)]>0x0;if(_0x39ba8b){console[_0x342383(0x17e)](a4_0x2be47d[_0x342383(0x1b0)](_0x342383(0x144))),console['log'](),console['log'](a4_0x2be47d[_0x342383(0x123)]('Errors:'));for(const _0x335491 of _0x46c747[_0x342383(0x11f)]){_0x335491['action']===_0x342383(0x1ad)&&console[_0x342383(0x17e)](a4_0x2be47d[_0x342383(0x123)](_0x342383(0x187)+_0x335491[_0x342383(0x1bb)]+_0x342383(0x151)+_0x335491['error']));}for(const _0x2da700 of _0x46c747[_0x342383(0x147)]){_0x2da700['action']==='error'&&console[_0x342383(0x17e)](a4_0x2be47d[_0x342383(0x123)](_0x342383(0x197)+_0x2da700[_0x342383(0x198)]+'\x22:\x20'+_0x2da700[_0x342383(0x1ad)]));}for(const _0xc59609 of _0x46c747[_0x342383(0x181)]){_0xc59609['action']===_0x342383(0x1ad)&&console[_0x342383(0x17e)](a4_0x2be47d[_0x342383(0x123)](_0x342383(0x11d)+_0xc59609[_0x342383(0x198)]+'\x22:\x20'+_0xc59609[_0x342383(0x1ad)]));}for(const _0x278039 of _0x46c747[_0x342383(0x195)]){_0x278039[_0x342383(0x14a)]===_0x342383(0x1ad)&&console[_0x342383(0x17e)](a4_0x2be47d['red'](_0x342383(0x1b3)+_0x278039[_0x342383(0x198)]+_0x342383(0x151)+_0x278039[_0x342383(0x1ad)]));}for(const _0x4397b4 of _0x46c747['integrations']){_0x4397b4[_0x342383(0x14a)]===_0x342383(0x1ad)&&console[_0x342383(0x17e)](a4_0x2be47d[_0x342383(0x123)](_0x342383(0x128)+_0x4397b4['name']+_0x342383(0x151)+_0x4397b4[_0x342383(0x1ad)]));}return 0x1;}console[_0x342383(0x17e)](a4_0x2be47d[_0x342383(0x192)](_0x342383(0x1a2)+(_0x48726f+_0x508a3a)+'\x20resources\x20to\x20\x27'+_0x46c747[_0x342383(0x1b5)]+'\x27'));const _0x44f286=getLLMProjectUrl(_0x91bc37,_0x46c747['projectId']);return console['log'](_0x342383(0x165)+a4_0x2be47d[_0x342383(0x153)](_0x44f286)),0x0;}}
@@ -1 +1 @@
1
- function a5_0x32ca(_0x5379ad,_0x5858d9){_0x5379ad=_0x5379ad-0x1b0;const _0x35f844=a5_0x35f8();let _0x32ca04=_0x35f844[_0x5379ad];return _0x32ca04;}const a5_0x5bdb4c=a5_0x32ca;(function(_0x5ba8ee,_0x3daa51){const _0x3e58ed=a5_0x32ca,_0x30efd2=_0x5ba8ee();while(!![]){try{const _0x435248=parseInt(_0x3e58ed(0x23d))/0x1*(parseInt(_0x3e58ed(0x20a))/0x2)+parseInt(_0x3e58ed(0x1de))/0x3*(parseInt(_0x3e58ed(0x1c7))/0x4)+-parseInt(_0x3e58ed(0x1bd))/0x5*(parseInt(_0x3e58ed(0x21c))/0x6)+-parseInt(_0x3e58ed(0x245))/0x7+-parseInt(_0x3e58ed(0x1d2))/0x8*(parseInt(_0x3e58ed(0x23e))/0x9)+-parseInt(_0x3e58ed(0x22b))/0xa*(parseInt(_0x3e58ed(0x1c4))/0xb)+parseInt(_0x3e58ed(0x1ff))/0xc*(parseInt(_0x3e58ed(0x228))/0xd);if(_0x435248===_0x3daa51)break;else _0x30efd2['push'](_0x30efd2['shift']());}catch(_0x5e3b32){_0x30efd2['push'](_0x30efd2['shift']());}}}(a5_0x35f8,0x531c3));import*as a5_0x3fd04c from'node:fs';import*as a5_0x3eaab6 from'node:path';function a5_0x35f8(){const _0x5b4927=['No\x20tests\x20found\x20with\x20tags:\x20','Project\x20path:\x20','status','push','has','llmProject','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','230424TRoKFc','yellow','found','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','testName','Agent:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','✗\x20FAIL:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','message','Error:\x20No\x20previous\x20test\x20run\x20found.','Round\x20','14043CclbCG','context','conversations','Running\x20test:\x20','Error\x20writing\x20output\x20file:\x20','stop','agentDirs','✓\x20PASS:\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','green','executeReeval','No\x20tests\x20found\x20matching:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','resolveAgentId','Executing\x20new\x20tests...','\x27\x20to\x20create\x20the\x20folder\x20structure.','utf-8','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Test\x20Summary','start','length','join','table','filter','agent:test','New\x20tests\x20to\x20execute:\x20','text','Output\x20written\x20to:\x20','\x20\x20Conversation:\x20','Site:\x20','404','name','12DRBKzV','test.yml','projectName','Round\x201/','...','Usage:','writeFileSync','\x20\x20Site:\x20','No\x20tests\x20have\x20tags\x20defined.','Errors:\x20\x20\x20','size','2RBbLqp','✗\x20ERROR:\x20Project\x20not\x20found:\x20','jsonl','existsSync','Re-evaluating...','Failed:\x20\x20\x20','testYmlPath','reason','dryRun','toISOString','json','forEach','/<agent-name>','Test\x20','Re-evaluating\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','\x20\x20Evaluating...\x20','basename','127506UQHski','substring','tests','Failed\x20Tests:','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Cached\x20run\x20from:\x20','Running:\x20','dim','split','no_tests','conversation_url','reeval','8750183fZPvkn','Cached\x20run\x20is\x20from\x20site\x20\x22','tsv','647950pQXadP','\x22:\x20','Using\x20agent:\x20','toLowerCase','eval','map','PASS','not\x20found','trim','agent','\x20-\x20','no_context','agentName','output','Re-evaluation\x20Summary','white','repeat','cyan','567147BJjgwC','9DgwhLb','verbose','round','...\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','Re-evaluating\x20cached\x20test\x20run...','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','3962378GRSmRh','resolveProjectId','resolve','\x20\x20Agent:\x20','Test\x20Configuration:','llm','Available\x20tests:\x20','multiple_agents','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','ERROR','\x20(new)','tags',':\x20Sending\x20user\x20input...','Passed:\x20\x20\x20','includes','site','\x20\x20Round\x20','no_local_folder','Tests\x20found:\x20','isSpinning','Duration:\x20','\x20(cached)','projectDir','Run\x20\x27tdx\x20agent\x20pull\x20','rounds','log','55GzVUgX','\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','FAIL','source','Total:\x20\x20\x20\x20','\x20\x20-\x20','✗\x20ERROR:\x20','55TPHeup','red','now','216YHINPI','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','\x20\x20Project:\x20','some'];a5_0x35f8=function(){return _0x5b4927;};return a5_0x35f8();}import a5_0x4d019f from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0x5bdb4c(0x1f7);['description']='Run\x20tests\x20for\x20an\x20LLM\x20agent';async['execute'](_0x106fbd){const _0x58a428=a5_0x5bdb4c,{options:_0x479aa5,args:_0x2ad365,tdx:_0x37fa4b}=_0x106fbd,_0x5e163f=_0x2ad365[0x0]||'.',_0x332152=_0x479aa5[_0x58a428(0x212)],_0x5ea926=_0x479aa5,_0x37a231=_0x5ea926[_0x58a428(0x22f)]===![],_0x2950f2=_0x5ea926[_0x58a428(0x227)],_0x16c50b=_0x5ea926['name'],_0x52f900=_0x5ea926[_0x58a428(0x250)],_0x1d0195=_0x479aa5[_0x58a428(0x1b2)],_0x249cad=_0x5ea926[_0x58a428(0x238)];if(_0x2950f2&&_0x37a231)return console[_0x58a428(0x1bc)](a5_0x4d019f[_0x58a428(0x1c5)](_0x58a428(0x1ea))),0x1;let _0x3a0ccb=_0x58a428(0x1f5);if(_0x5ea926[_0x58a428(0x214)])_0x3a0ccb=_0x58a428(0x214);else{if(_0x5ea926[_0x58a428(0x20c)])_0x3a0ccb=_0x58a428(0x20c);else{if(_0x5ea926[_0x58a428(0x22a)])_0x3a0ccb='tsv';else{if(_0x5ea926[_0x58a428(0x1f5)])_0x3a0ccb=_0x58a428(0x1f5);}}}const _0x5d40a8=_0x5ea926[_0x58a428(0x1d0)];let _0x421f94=_0x5e163f;const _0x28d9ab=a5_0x3fd04c[_0x58a428(0x20d)](_0x5e163f),_0x479afe=_0x5e163f==='.';if(!_0x28d9ab||_0x479afe){const _0x24e0cb=resolveProjectFromContext(_0x5e163f,_0x5d40a8,{'requireFile':_0x58a428(0x200)});if(_0x24e0cb[_0x58a428(0x1d4)])_0x421f94=_0x24e0cb[_0x58a428(0x1b9)],_0x24e0cb[_0x58a428(0x1c0)]===_0x58a428(0x1df)&&console[_0x58a428(0x1bc)](a5_0x4d019f[_0x58a428(0x223)](_0x58a428(0x22d)+_0x421f94));else switch(_0x24e0cb[_0x58a428(0x211)]){case _0x58a428(0x236):console[_0x58a428(0x1bc)](a5_0x4d019f[_0x58a428(0x1d3)](_0x24e0cb[_0x58a428(0x1db)])),console['log'](),console[_0x58a428(0x1bc)](_0x58a428(0x204)),console['log'](_0x58a428(0x1be)),console[_0x58a428(0x1bc)](_0x58a428(0x242)),console[_0x58a428(0x1bc)](),console[_0x58a428(0x1bc)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x58a428(0x1b4):console[_0x58a428(0x1bc)](a5_0x4d019f[_0x58a428(0x1d3)](_0x24e0cb[_0x58a428(0x1db)])),console['log'](),console[_0x58a428(0x1bc)](_0x58a428(0x1ba)+_0x24e0cb[_0x58a428(0x1d0)]+_0x58a428(0x1ed));return 0x1;case _0x58a428(0x24c):{const _0x2107dd=a5_0x3eaab6[_0x58a428(0x21b)](_0x24e0cb['projectDir']);console[_0x58a428(0x1bc)](a5_0x4d019f[_0x58a428(0x1d3)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x24e0cb[_0x58a428(0x1d0)]+'\x22:'));for(const _0x12bc06 of _0x24e0cb[_0x58a428(0x1e4)]){console[_0x58a428(0x1bc)](_0x58a428(0x1c2)+_0x12bc06);}return console[_0x58a428(0x1bc)](),console[_0x58a428(0x1bc)](_0x58a428(0x244)+_0x2107dd+_0x58a428(0x216)),0x1;}case _0x58a428(0x225):console['log'](a5_0x4d019f[_0x58a428(0x1d3)](_0x58a428(0x1c8)+_0x24e0cb['llmProject']+'\x22.')),console['log'](a5_0x4d019f[_0x58a428(0x223)](_0x58a428(0x1cc)+_0x24e0cb[_0x58a428(0x1b9)])),console['log'](),console[_0x58a428(0x1bc)](_0x58a428(0x1d5));return 0x1;}}const {definition:_0x41a8cb,agentInfo:_0x54035a}=parseTestFile(_0x421f94);let _0x263e97=_0x41a8cb[_0x58a428(0x21e)];if(_0x16c50b){const _0x2ae764=_0x16c50b[_0x58a428(0x224)](',')[_0x58a428(0x230)](_0x489e3c=>_0x489e3c[_0x58a428(0x233)]());_0x263e97=_0x41a8cb[_0x58a428(0x21e)][_0x58a428(0x1f6)](_0x4a56a3=>_0x2ae764[_0x58a428(0x1b1)](_0x4a56a3[_0x58a428(0x1fe)]));if(_0x263e97['length']===0x0)return console[_0x58a428(0x1bc)](a5_0x4d019f[_0x58a428(0x1d3)](_0x58a428(0x1e9)+_0x16c50b)),console['log'](a5_0x4d019f['dim'](_0x58a428(0x24b)+_0x41a8cb['tests'][_0x58a428(0x230)](_0x46db79=>_0x46db79[_0x58a428(0x1fe)])[_0x58a428(0x1f4)](',\x20'))),0x1;}if(_0x52f900){const _0x4c6ab1=_0x52f900[_0x58a428(0x224)](',')[_0x58a428(0x230)](_0x4cd403=>_0x4cd403[_0x58a428(0x233)]()['toLowerCase']());_0x263e97=_0x263e97[_0x58a428(0x1f6)](_0x284692=>_0x284692[_0x58a428(0x250)]?.[_0x58a428(0x1ca)](_0xfdf0b7=>_0x4c6ab1[_0x58a428(0x1b1)](_0xfdf0b7['toLowerCase']())));if(_0x263e97['length']===0x0){console[_0x58a428(0x1bc)](a5_0x4d019f[_0x58a428(0x1d3)](_0x58a428(0x1cb)+_0x52f900));const _0x15cfee=new Set();return _0x41a8cb['tests']['forEach'](_0x14ecc3=>_0x14ecc3[_0x58a428(0x250)]?.[_0x58a428(0x215)](_0x303c14=>_0x15cfee['add'](_0x303c14))),_0x15cfee[_0x58a428(0x209)]>0x0?console[_0x58a428(0x1bc)](a5_0x4d019f[_0x58a428(0x223)]('Available\x20tags:\x20'+[..._0x15cfee][_0x58a428(0x1f4)](',\x20'))):console[_0x58a428(0x1bc)](a5_0x4d019f[_0x58a428(0x223)](_0x58a428(0x207))),0x1;}}if(_0x2950f2)return this[_0x58a428(0x1e8)](_0x106fbd,{'definition':{'tests':_0x263e97},'agentInfo':_0x54035a,'outputFormat':_0x3a0ccb,'outputFile':_0x249cad,'testNames':_0x16c50b});if(_0x332152){console[_0x58a428(0x1bc)](a5_0x4d019f['cyan'](_0x58a428(0x249))),console[_0x58a428(0x1bc)](_0x58a428(0x206)+a5_0x4d019f[_0x58a428(0x23a)](_0x1d0195)),console[_0x58a428(0x1bc)](_0x58a428(0x1c9)+a5_0x4d019f[_0x58a428(0x23a)](_0x54035a[_0x58a428(0x201)])),console['log'](_0x58a428(0x248)+a5_0x4d019f[_0x58a428(0x23a)](_0x54035a[_0x58a428(0x237)])),console[_0x58a428(0x1bc)](),console[_0x58a428(0x1bc)](_0x58a428(0x1b5)+a5_0x4d019f['white'](_0x263e97[_0x58a428(0x1f3)]));for(let _0x2a1a55=0x0;_0x2a1a55<_0x263e97[_0x58a428(0x1f3)];_0x2a1a55++){const _0x5e44c2=_0x263e97[_0x2a1a55],_0x4f3e=_0x5e44c2[_0x58a428(0x1bb)]['length']===0x1?_0x58a428(0x240):_0x58a428(0x1bb),_0x4ce55d=_0x5e44c2[_0x58a428(0x250)]?.[_0x58a428(0x1f3)]?'\x20['+_0x5e44c2[_0x58a428(0x250)]['join'](',\x20')+']':'';console[_0x58a428(0x1bc)]('\x20\x20'+(_0x2a1a55+0x1)+'.\x20'+a5_0x4d019f['white'](_0x5e44c2[_0x58a428(0x1fe)])+'\x20('+_0x5e44c2['rounds'][_0x58a428(0x1f3)]+'\x20'+_0x4f3e+')'+a5_0x4d019f[_0x58a428(0x223)](_0x4ce55d));}return 0x0;}let _0x4cb458,_0x539942;try{_0x4cb458=await _0x37fa4b[_0x58a428(0x24a)][_0x58a428(0x246)](_0x54035a[_0x58a428(0x201)]);}catch(_0xc0cc6c){const _0x3ac0a1=_0xc0cc6c instanceof Error?_0xc0cc6c['message']:String(_0xc0cc6c);return _0x3ac0a1['includes'](_0x58a428(0x1fd))||_0x3ac0a1[_0x58a428(0x22e)]()[_0x58a428(0x1b1)](_0x58a428(0x232))?console[_0x58a428(0x1bc)](a5_0x4d019f['red'](_0x58a428(0x20b)+_0x54035a[_0x58a428(0x201)])):console[_0x58a428(0x1bc)](a5_0x4d019f[_0x58a428(0x1c5)](_0x58a428(0x220)+_0x54035a[_0x58a428(0x201)]+_0x58a428(0x22c)+_0x3ac0a1)),0x1;}try{_0x539942=await _0x37fa4b[_0x58a428(0x24a)][_0x58a428(0x1eb)](_0x54035a[_0x58a428(0x237)],_0x4cb458);}catch(_0x3066dd){const _0x356ebd=_0x3066dd instanceof Error?_0x3066dd[_0x58a428(0x1db)]:String(_0x3066dd);return _0x356ebd[_0x58a428(0x1b1)](_0x58a428(0x1fd))||_0x356ebd[_0x58a428(0x22e)]()['includes'](_0x58a428(0x232))?console[_0x58a428(0x1bc)](a5_0x4d019f[_0x58a428(0x1c5)](_0x58a428(0x1ef)+_0x54035a[_0x58a428(0x237)])):console[_0x58a428(0x1bc)](a5_0x4d019f[_0x58a428(0x1c5)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x54035a[_0x58a428(0x237)]+_0x58a428(0x22c)+_0x356ebd)),0x1;}let _0x599c2d;if(!_0x37a231)try{_0x599c2d=await setupEvaluatorAgent(_0x37fa4b[_0x58a428(0x24a)],_0x479aa5[_0x58a428(0x23f)]);}catch(_0x2c5bdf){const _0x426573=_0x2c5bdf instanceof Error?_0x2c5bdf[_0x58a428(0x1db)]:String(_0x2c5bdf);return console['log'](a5_0x4d019f['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x426573)),0x1;}console['log'](a5_0x4d019f[_0x58a428(0x23c)]('Running\x20agent\x20tests...')),console[_0x58a428(0x1bc)](_0x58a428(0x1fc)+a5_0x4d019f[_0x58a428(0x23a)](_0x1d0195)),console[_0x58a428(0x1bc)](_0x58a428(0x1d7)+a5_0x4d019f[_0x58a428(0x23a)](_0x54035a[_0x58a428(0x201)]+'/'+_0x54035a[_0x58a428(0x237)])),console['log']();const _0x5935d0=[],_0x48cf85=[],_0x2239eb=Date[_0x58a428(0x1c6)]();for(let _0x287886=0x0;_0x287886<_0x263e97[_0x58a428(0x1f3)];_0x287886++){const _0x54230b=_0x263e97[_0x287886];_0x263e97[_0x58a428(0x1f3)]>0x1?console[_0x58a428(0x1bc)](_0x58a428(0x217)+(_0x287886+0x1)+'/'+_0x263e97[_0x58a428(0x1f3)]+':\x20'+a5_0x4d019f[_0x58a428(0x23a)](_0x54230b[_0x58a428(0x1fe)])):console['log'](_0x58a428(0x1e1)+a5_0x4d019f['white'](_0x54230b[_0x58a428(0x1fe)]));const _0x33ab36=createCommandSpinner(_0x58a428(0x202)+_0x54230b[_0x58a428(0x1bb)][_0x58a428(0x1f3)]+_0x58a428(0x251));_0x33ab36['start']();try{const {result:_0x5a5ce6,conversation:_0x12d1e3}=await runTest(_0x37fa4b[_0x58a428(0x24a)],_0x54230b,{'agentId':_0x539942,'projectId':_0x4cb458,'site':_0x1d0195,'noEval':_0x37a231,'evaluatorId':_0x599c2d,'onRoundStart':(_0xa18b91,_0x416a24)=>{const _0x4905df=_0x58a428;_0x33ab36[_0x4905df(0x1f9)]=_0x4905df(0x1dd)+(_0xa18b91+0x1)+'/'+_0x416a24+_0x4905df(0x251);},'onRoundComplete':(_0x2e4ccf,_0x480562,_0x337cf7)=>{const _0x3738ba=_0x58a428,_0x3de4fd=formatElapsed(_0x480562);_0x337cf7?console[_0x3738ba(0x1bc)](_0x3738ba(0x1b3)+(_0x2e4ccf+0x1)+'/'+_0x54230b[_0x3738ba(0x1bb)][_0x3738ba(0x1f3)]+_0x3738ba(0x241)+a5_0x4d019f[_0x3738ba(0x1e7)]('✓')+'\x20('+_0x3de4fd+')'):console[_0x3738ba(0x1bc)]('\x20\x20Round\x20'+(_0x2e4ccf+0x1)+'/'+_0x54230b[_0x3738ba(0x1bb)][_0x3738ba(0x1f3)]+_0x3738ba(0x241)+a5_0x4d019f['red']('✗'));},'onEvaluationStart':()=>{const _0x2f6d38=_0x58a428;_0x33ab36[_0x2f6d38(0x1f9)]='Evaluating\x20response...';},'onEvaluationComplete':_0x403feb=>{const _0x3d9983=_0x58a428,_0x392738=formatElapsed(_0x403feb);console[_0x3d9983(0x1bc)](_0x3d9983(0x21a)+a5_0x4d019f[_0x3d9983(0x1e7)]('✓')+'\x20('+_0x392738+')');}});_0x33ab36[_0x58a428(0x1e3)](),_0x5935d0[_0x58a428(0x1ce)](_0x5a5ce6),_0x48cf85[_0x58a428(0x1ce)](_0x12d1e3);if(_0x5a5ce6['status']===_0x58a428(0x231))console['log'](a5_0x4d019f[_0x58a428(0x1e7)](_0x58a428(0x1e5)+_0x5a5ce6[_0x58a428(0x211)]));else _0x5a5ce6[_0x58a428(0x1cd)]==='FAIL'?console['log'](a5_0x4d019f[_0x58a428(0x1c5)]('✗\x20FAIL:\x20'+_0x5a5ce6['reason'])):console[_0x58a428(0x1bc)](a5_0x4d019f[_0x58a428(0x1c5)](_0x58a428(0x1c3)+_0x5a5ce6[_0x58a428(0x211)]));_0x5a5ce6['conversation_url']&&console[_0x58a428(0x1bc)](a5_0x4d019f[_0x58a428(0x223)]('Conversation\x20URL:\x20'+_0x5a5ce6[_0x58a428(0x226)])),console[_0x58a428(0x1bc)]();}catch(_0x5a9b24){_0x33ab36['stop']();const _0x5dd381=_0x5a9b24 instanceof Error?_0x5a9b24[_0x58a428(0x1db)]:String(_0x5a9b24);console[_0x58a428(0x1bc)](a5_0x4d019f[_0x58a428(0x1c5)](_0x58a428(0x1c3)+_0x5dd381)),console[_0x58a428(0x1bc)](),_0x5935d0['push']({'name':_0x54230b[_0x58a428(0x1fe)],'status':_0x58a428(0x24e),'reason':_0x5dd381,'timestamp':new Date()[_0x58a428(0x213)](),'duration_ms':0x0});}}const _0xc25760=Date['now']()-_0x2239eb,_0x1502b7=_0x5935d0['filter'](_0x132a05=>_0x132a05[_0x58a428(0x1cd)]===_0x58a428(0x231))['length'],_0x31ce3b=_0x5935d0['filter'](_0x3279df=>_0x3279df[_0x58a428(0x1cd)]===_0x58a428(0x1bf))[_0x58a428(0x1f3)],_0x292cbf=_0x5935d0[_0x58a428(0x1f6)](_0xd66b38=>_0xd66b38[_0x58a428(0x1cd)]===_0x58a428(0x24e))['length'];console['log']('━'[_0x58a428(0x23b)](0x3c)),console[_0x58a428(0x1bc)](_0x58a428(0x1f1)),console[_0x58a428(0x1bc)]('━'[_0x58a428(0x23b)](0x3c)),console[_0x58a428(0x1bc)](_0x58a428(0x1c1)+_0x5935d0['length']),console[_0x58a428(0x1bc)](_0x58a428(0x1b0)+a5_0x4d019f[_0x58a428(0x1e7)](_0x1502b7)),console[_0x58a428(0x1bc)](_0x58a428(0x20f)+a5_0x4d019f[_0x58a428(0x1c5)](_0x31ce3b));_0x292cbf>0x0&&console[_0x58a428(0x1bc)](_0x58a428(0x208)+a5_0x4d019f[_0x58a428(0x1c5)](_0x292cbf));console['log'](_0x58a428(0x1b7)+formatElapsed(_0xc25760)),console[_0x58a428(0x1bc)]('━'[_0x58a428(0x23b)](0x3c));const _0x5debcc=_0x5935d0[_0x58a428(0x1f6)](_0x59fb4e=>_0x59fb4e[_0x58a428(0x1cd)]!==_0x58a428(0x231));if(_0x5debcc['length']>0x0){console[_0x58a428(0x1bc)](),console['log'](_0x58a428(0x21f));for(const _0x399ca7 of _0x5debcc){const _0x36a770=a5_0x4d019f[_0x58a428(0x1c5)]('✗'),_0xf2ae7d=_0x399ca7[_0x58a428(0x211)][_0x58a428(0x1f3)]>0x32?_0x399ca7['reason'][_0x58a428(0x21d)](0x0,0x32)+_0x58a428(0x203):_0x399ca7[_0x58a428(0x211)];console[_0x58a428(0x1bc)]('\x20\x20'+_0x36a770+'\x20'+_0x399ca7['name']+':\x20'+_0xf2ae7d);}}const _0xc88a5a={'summary':{'total':_0x5935d0[_0x58a428(0x1f3)],'passed':_0x1502b7,'failed':_0x31ce3b,'errors':_0x292cbf>0x0?_0x292cbf:undefined,'duration_ms':_0xc25760},'tests':_0x5935d0,'agent':{'project':_0x54035a['projectName'],'name':_0x54035a['agentName'],'site':_0x1d0195},'timestamp':new Date(_0x2239eb)[_0x58a428(0x213)]()};try{const _0x27e467=buildCachedTestRun(_0x48cf85,{'site':_0x1d0195,'projectId':_0x4cb458,'projectName':_0x54035a['projectName'],'agentId':_0x539942,'agentName':_0x54035a[_0x58a428(0x237)],'testYmlPath':a5_0x3eaab6[_0x58a428(0x247)](_0x54035a[_0x58a428(0x210)])});saveLastTestRun(_0x27e467);}catch{}if(_0x3a0ccb!==_0x58a428(0x1f5)||_0x249cad){const _0x495092=formatResults(_0xc88a5a,_0x3a0ccb);if(_0x249cad)try{a5_0x3fd04c['writeFileSync'](_0x249cad,_0x495092,'utf-8'),console[_0x58a428(0x1bc)](),console[_0x58a428(0x1bc)](a5_0x4d019f[_0x58a428(0x223)](_0x58a428(0x1fa)+_0x249cad));}catch(_0xf62014){return console[_0x58a428(0x1bc)](),console['log'](a5_0x4d019f[_0x58a428(0x1c5)](_0x58a428(0x1e2)+_0xf62014)),0x1;}else console[_0x58a428(0x1bc)](),console[_0x58a428(0x1bc)](_0x495092);}return _0x5debcc[_0x58a428(0x1f3)]>0x0?0x1:0x0;}async[a5_0x5bdb4c(0x1e8)](_0x5e6260,_0x5d48eb){const _0x271734=a5_0x5bdb4c,{options:_0x63dfa4,tdx:_0x29d506}=_0x5e6260,{definition:_0x4a1194,agentInfo:_0x1cc24a,outputFormat:_0x5ee777,outputFile:_0x582c4b}=_0x5d48eb,_0x483813=_0x63dfa4['site'],_0x1a4949=loadLastTestRun();if(!_0x1a4949)return console[_0x271734(0x1bc)](a5_0x4d019f[_0x271734(0x1c5)](_0x271734(0x1dc))),console['log'](a5_0x4d019f[_0x271734(0x223)](_0x271734(0x219))),0x1;if(_0x1a4949[_0x271734(0x234)]['agentName']!==_0x1cc24a[_0x271734(0x237)])return console[_0x271734(0x1bc)](a5_0x4d019f[_0x271734(0x1c5)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x1a4949[_0x271734(0x234)][_0x271734(0x237)]+_0x271734(0x1d8)+_0x1cc24a[_0x271734(0x237)]+'\x22.')),console[_0x271734(0x1bc)](a5_0x4d019f[_0x271734(0x223)](_0x271734(0x1e6))),0x1;const _0x1e8a1e=new Set(_0x1a4949[_0x271734(0x1e0)][_0x271734(0x230)](_0x22aac9=>_0x22aac9[_0x271734(0x1d6)])),_0x28d10f=_0x4a1194['tests']['filter'](_0x56b71e=>!_0x1e8a1e['has'](_0x56b71e[_0x271734(0x1fe)]));if(_0x28d10f[_0x271734(0x1f3)]>0x0&&_0x1a4949[_0x271734(0x1b2)]!==_0x483813)return console[_0x271734(0x1bc)](a5_0x4d019f[_0x271734(0x1c5)](_0x271734(0x1f0))),console[_0x271734(0x1bc)](a5_0x4d019f[_0x271734(0x223)](_0x271734(0x229)+_0x1a4949[_0x271734(0x1b2)]+_0x271734(0x1da)+_0x483813+'\x22.')),console[_0x271734(0x1bc)](a5_0x4d019f[_0x271734(0x223)]('Either\x20switch\x20to\x20the\x20\x22'+_0x1a4949[_0x271734(0x1b2)]+_0x271734(0x24d))),0x1;const _0x3ef5ec=_0x4a1194[_0x271734(0x21e)][_0x271734(0x1f6)](_0x36ef53=>_0x1e8a1e[_0x271734(0x1cf)](_0x36ef53[_0x271734(0x1fe)])),_0x3806c7=_0x28d10f;let _0x1878b4;try{_0x1878b4=await setupEvaluatorAgent(_0x29d506[_0x271734(0x24a)],_0x63dfa4['verbose']);}catch(_0x18a305){const _0x5a280a=_0x18a305 instanceof Error?_0x18a305[_0x271734(0x1db)]:String(_0x18a305);return console['log'](a5_0x4d019f[_0x271734(0x1c5)](_0x271734(0x1d1)+_0x5a280a)),0x1;}console[_0x271734(0x1bc)](a5_0x4d019f[_0x271734(0x23c)](_0x271734(0x243))),console['log'](_0x271734(0x221)+a5_0x4d019f['white'](_0x1a4949['timestamp'])),console[_0x271734(0x1bc)](_0x271734(0x1d7)+a5_0x4d019f[_0x271734(0x23a)](_0x1a4949[_0x271734(0x234)][_0x271734(0x201)]+'/'+_0x1a4949[_0x271734(0x234)][_0x271734(0x237)]));_0x3806c7[_0x271734(0x1f3)]>0x0&&console[_0x271734(0x1bc)](_0x271734(0x1f8)+a5_0x4d019f[_0x271734(0x1d3)](_0x3806c7[_0x271734(0x1f3)]));console[_0x271734(0x1bc)]();const _0x5c425e=[],_0xeb46fb=Date[_0x271734(0x1c6)](),_0x232631=createCommandSpinner(_0x271734(0x20e));if(_0x3ef5ec[_0x271734(0x1f3)]>0x0)try{const _0x200d48=await reevaluateFromCache(_0x29d506[_0x271734(0x24a)],_0x1a4949,{'tests':_0x3ef5ec},{'evaluatorId':_0x1878b4,'onTestStart':(_0x142b0d,_0x29bc49,_0x2227aa)=>{const _0x55441b=_0x271734;_0x232631[_0x55441b(0x1f9)]=_0x55441b(0x218)+(_0x29bc49+0x1)+'/'+_0x2227aa+':\x20'+_0x142b0d+_0x55441b(0x203);if(!_0x232631[_0x55441b(0x1b6)])_0x232631[_0x55441b(0x1f2)]();},'onTestComplete':(_0x3d34b7,_0x134183)=>{const _0x22576f=_0x271734;_0x232631['stop']();if(_0x134183[_0x22576f(0x1cd)]===_0x22576f(0x231))console[_0x22576f(0x1bc)](a5_0x4d019f['green'](_0x22576f(0x1e5)+_0x3d34b7)+a5_0x4d019f['dim'](_0x22576f(0x1b8)));else _0x134183['status']===_0x22576f(0x1bf)?console[_0x22576f(0x1bc)](a5_0x4d019f[_0x22576f(0x1c5)]('✗\x20FAIL:\x20'+_0x3d34b7+_0x22576f(0x235)+_0x134183[_0x22576f(0x211)])+a5_0x4d019f[_0x22576f(0x223)]('\x20(cached)')):console['log'](a5_0x4d019f[_0x22576f(0x1c5)]('✗\x20ERROR:\x20'+_0x3d34b7+'\x20-\x20'+_0x134183['reason']));_0x134183[_0x22576f(0x226)]&&console[_0x22576f(0x1bc)](a5_0x4d019f[_0x22576f(0x223)](_0x22576f(0x1fb)+_0x134183[_0x22576f(0x226)])),_0x5c425e['push'](_0x134183);},'onTestSkipped':(_0x2aa4a7,_0x357c5e)=>{const _0xee4f01=_0x271734;_0x232631['stop'](),console['log'](a5_0x4d019f[_0xee4f01(0x1d3)]('⚠\x20SKIPPED:\x20'+_0x2aa4a7+_0xee4f01(0x235)+_0x357c5e));}});for(const _0x6bba69 of _0x200d48){!_0x5c425e['find'](_0x44d71c=>_0x44d71c['name']===_0x6bba69[_0x271734(0x1fe)])&&_0x5c425e[_0x271734(0x1ce)](_0x6bba69);}}catch(_0x2e4ec2){_0x232631[_0x271734(0x1e3)]();const _0x975ce4=_0x2e4ec2 instanceof Error?_0x2e4ec2[_0x271734(0x1db)]:String(_0x2e4ec2);return console['log'](a5_0x4d019f[_0x271734(0x1c5)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x975ce4)),0x1;}_0x232631[_0x271734(0x1e3)]();if(_0x3806c7['length']>0x0){console[_0x271734(0x1bc)](),console[_0x271734(0x1bc)](a5_0x4d019f[_0x271734(0x23c)](_0x271734(0x1ec)));const {projectId:_0x3151b7,agentId:_0x2e8a57}=_0x1a4949[_0x271734(0x234)];for(const _0x5e1c4e of _0x3806c7){console[_0x271734(0x1bc)](_0x271734(0x222)+a5_0x4d019f[_0x271734(0x23a)](_0x5e1c4e[_0x271734(0x1fe)]));const _0x14fdc2=createCommandSpinner(_0x271734(0x202)+_0x5e1c4e['rounds'][_0x271734(0x1f3)]+_0x271734(0x251));_0x14fdc2[_0x271734(0x1f2)]();try{const {result:_0x5c7b3b}=await runTest(_0x29d506[_0x271734(0x24a)],_0x5e1c4e,{'agentId':_0x2e8a57,'projectId':_0x3151b7,'site':_0x1a4949['site'],'noEval':![],'evaluatorId':_0x1878b4,'onRoundStart':(_0x230abf,_0x3ca650)=>{const _0x484c82=_0x271734;_0x14fdc2[_0x484c82(0x1f9)]='Round\x20'+(_0x230abf+0x1)+'/'+_0x3ca650+_0x484c82(0x251);},'onRoundComplete':(_0x2cfa5f,_0x217cd0,_0x4742c2)=>{const _0x2b5915=_0x271734,_0x2c80a9=formatElapsed(_0x217cd0);_0x4742c2?console[_0x2b5915(0x1bc)](_0x2b5915(0x1b3)+(_0x2cfa5f+0x1)+'/'+_0x5e1c4e[_0x2b5915(0x1bb)][_0x2b5915(0x1f3)]+_0x2b5915(0x241)+a5_0x4d019f[_0x2b5915(0x1e7)]('✓')+'\x20('+_0x2c80a9+')'):console[_0x2b5915(0x1bc)](_0x2b5915(0x1b3)+(_0x2cfa5f+0x1)+'/'+_0x5e1c4e[_0x2b5915(0x1bb)]['length']+_0x2b5915(0x241)+a5_0x4d019f[_0x2b5915(0x1c5)]('✗'));},'onEvaluationStart':()=>{const _0x307157=_0x271734;_0x14fdc2[_0x307157(0x1f9)]='Evaluating\x20response...';},'onEvaluationComplete':_0x373967=>{const _0x559d23=_0x271734,_0x19b8ce=formatElapsed(_0x373967);console[_0x559d23(0x1bc)](_0x559d23(0x21a)+a5_0x4d019f['green']('✓')+'\x20('+_0x19b8ce+')');}});_0x14fdc2[_0x271734(0x1e3)](),_0x5c425e[_0x271734(0x1ce)](_0x5c7b3b);if(_0x5c7b3b[_0x271734(0x1cd)]===_0x271734(0x231))console[_0x271734(0x1bc)](a5_0x4d019f[_0x271734(0x1e7)](_0x271734(0x1e5)+_0x5c7b3b[_0x271734(0x211)])+a5_0x4d019f[_0x271734(0x223)](_0x271734(0x24f)));else _0x5c7b3b[_0x271734(0x1cd)]===_0x271734(0x1bf)?console[_0x271734(0x1bc)](a5_0x4d019f['red'](_0x271734(0x1d9)+_0x5c7b3b[_0x271734(0x211)])+a5_0x4d019f[_0x271734(0x223)](_0x271734(0x24f))):console[_0x271734(0x1bc)](a5_0x4d019f[_0x271734(0x1c5)](_0x271734(0x1c3)+_0x5c7b3b[_0x271734(0x211)]));_0x5c7b3b[_0x271734(0x226)]&&console['log'](a5_0x4d019f['dim'](_0x271734(0x1fb)+_0x5c7b3b[_0x271734(0x226)]));}catch(_0x539b4f){_0x14fdc2[_0x271734(0x1e3)]();const _0x196a4d=_0x539b4f instanceof Error?_0x539b4f[_0x271734(0x1db)]:String(_0x539b4f);console[_0x271734(0x1bc)](a5_0x4d019f[_0x271734(0x1c5)](_0x271734(0x1c3)+_0x196a4d)),_0x5c425e[_0x271734(0x1ce)]({'name':_0x5e1c4e[_0x271734(0x1fe)],'status':_0x271734(0x24e),'reason':_0x196a4d,'timestamp':new Date()[_0x271734(0x213)](),'duration_ms':0x0});}}}console[_0x271734(0x1bc)]();const _0x4aeac7=Date[_0x271734(0x1c6)]()-_0xeb46fb,_0x2f1616=_0x5c425e[_0x271734(0x1f6)](_0x56477f=>_0x56477f[_0x271734(0x1cd)]===_0x271734(0x231))['length'],_0x529589=_0x5c425e[_0x271734(0x1f6)](_0x368cb5=>_0x368cb5[_0x271734(0x1cd)]===_0x271734(0x1bf))[_0x271734(0x1f3)],_0x16171c=_0x5c425e[_0x271734(0x1f6)](_0x5c4c4a=>_0x5c4c4a[_0x271734(0x1cd)]===_0x271734(0x24e))[_0x271734(0x1f3)];console[_0x271734(0x1bc)]('━'['repeat'](0x3c)),console[_0x271734(0x1bc)](_0x271734(0x239)),console[_0x271734(0x1bc)]('━'[_0x271734(0x23b)](0x3c)),console[_0x271734(0x1bc)](_0x271734(0x1c1)+_0x5c425e['length']),console[_0x271734(0x1bc)](_0x271734(0x1b0)+a5_0x4d019f['green'](_0x2f1616)),console[_0x271734(0x1bc)](_0x271734(0x20f)+a5_0x4d019f[_0x271734(0x1c5)](_0x529589));_0x16171c>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x4d019f['red'](_0x16171c));console[_0x271734(0x1bc)](_0x271734(0x1b7)+formatElapsed(_0x4aeac7)),console[_0x271734(0x1bc)]('━'[_0x271734(0x23b)](0x3c));const _0x38fc2b={'summary':{'total':_0x5c425e[_0x271734(0x1f3)],'passed':_0x2f1616,'failed':_0x529589,'errors':_0x16171c>0x0?_0x16171c:undefined,'duration_ms':_0x4aeac7},'tests':_0x5c425e,'agent':{'project':_0x1cc24a[_0x271734(0x201)],'name':_0x1cc24a[_0x271734(0x237)],'site':_0x483813},'timestamp':new Date(_0xeb46fb)[_0x271734(0x213)]()};if(_0x5ee777!==_0x271734(0x1f5)||_0x582c4b){const _0x28ae44=formatResults(_0x38fc2b,_0x5ee777);if(_0x582c4b)try{a5_0x3fd04c[_0x271734(0x205)](_0x582c4b,_0x28ae44,_0x271734(0x1ee)),console[_0x271734(0x1bc)](),console[_0x271734(0x1bc)](a5_0x4d019f[_0x271734(0x223)](_0x271734(0x1fa)+_0x582c4b));}catch(_0x4a6d06){return console[_0x271734(0x1bc)](),console['log'](a5_0x4d019f[_0x271734(0x1c5)](_0x271734(0x1e2)+_0x4a6d06)),0x1;}else console[_0x271734(0x1bc)](),console['log'](_0x28ae44);}const _0x30b9ab=_0x5c425e[_0x271734(0x1f6)](_0x596d1d=>_0x596d1d['status']!=='PASS');return _0x30b9ab[_0x271734(0x1f3)]>0x0?0x1:0x0;}}
1
+ const a5_0x471453=a5_0x3f95;(function(_0x219c56,_0x3bf7f3){const _0x35eb5b=a5_0x3f95,_0xd66d27=_0x219c56();while(!![]){try{const _0x56ccab=parseInt(_0x35eb5b(0x1b1))/0x1*(parseInt(_0x35eb5b(0x1c9))/0x2)+parseInt(_0x35eb5b(0x221))/0x3+-parseInt(_0x35eb5b(0x210))/0x4*(parseInt(_0x35eb5b(0x1cd))/0x5)+parseInt(_0x35eb5b(0x1d7))/0x6+-parseInt(_0x35eb5b(0x1de))/0x7+-parseInt(_0x35eb5b(0x20b))/0x8*(-parseInt(_0x35eb5b(0x1fe))/0x9)+parseInt(_0x35eb5b(0x225))/0xa*(-parseInt(_0x35eb5b(0x1a7))/0xb);if(_0x56ccab===_0x3bf7f3)break;else _0xd66d27['push'](_0xd66d27['shift']());}catch(_0x30c991){_0xd66d27['push'](_0xd66d27['shift']());}}}(a5_0xbf6c,0xcc9d1));import*as a5_0x3e1c39 from'node:fs';import*as a5_0x1aa8f7 from'node:path';import a5_0x4f4d8f from'chalk';import{BaseCommand}from'./command.js';function a5_0x3f95(_0x145fe4,_0x266cde){_0x145fe4=_0x145fe4-0x1a4;const _0xbf6cd=a5_0xbf6c();let _0x3f956c=_0xbf6cd[_0x145fe4];return _0x3f956c;}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0xbf6c(){const _0x386599=['includes','test.yml','1370637lnKRmC','Running\x20test:\x20','dim','round','forEach','json','✗\x20ERROR:\x20','eval','status','\x20(cached)','\x20\x20Project:\x20','⚠\x20SKIPPED:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','56QaSZPf','Using\x20agent:\x20','message','green','\x20\x20Conversation:\x20','12CRbewQ','\x22:\x20','output','Run\x20\x27tdx\x20agent\x20pull\x20','not\x20found','rounds','\x20(new)','log','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','agentName','Output\x20written\x20to:\x20','Executing\x20new\x20tests...','✓\x20PASS:\x20','timestamp','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Round\x20','llmProject','569841NvJYkc','Errors:\x20\x20\x20','trim','Re-evaluating...','320pKWpDu','✗\x20FAIL:\x20','conversations','\x27\x20to\x20create\x20the\x20folder\x20structure.','Evaluating\x20response...','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','projectDir','FAIL','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Error\x20writing\x20output\x20file:\x20','reeval','Available\x20tests:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','table','...','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','No\x20tests\x20found\x20matching:\x20','Failed\x20Tests:','stop','no_local_folder','\x20\x20Evaluating...\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','/<agent-name>','text','400367PcwtJa','jsonl','\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)','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','start','join','Running\x20agent\x20tests...','Agent:\x20','name','172273rsjoPB','Usage:','\x22,\x20but\x20current\x20site\x20is\x20\x22','Round\x201/','size','\x20-\x20','Passed:\x20\x20\x20','Re-evaluation\x20Summary','Site:\x20','llm','projectName','verbose','execute','\x20\x20-\x20','Running:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','conversation_url','Test\x20','Test\x20Summary','404','tests','white','cyan',':\x20Sending\x20user\x20input...','2VbhbIG','split','agent','context','869150OCaGht','some','source','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','red','repeat','filter','Cached\x20run\x20from:\x20','toISOString','toLowerCase','8533842zfyffs','found','isSpinning','writeFileSync','site','...\x20','resolve','2284009MTKccu','\x20\x20Site:\x20','tags','Tests\x20found:\x20','No\x20tests\x20found\x20with\x20tags:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','no_tests','existsSync','Error:\x20No\x20previous\x20test\x20run\x20found.','length','dryRun','push','Re-evaluating\x20cached\x20test\x20run...','\x20\x20Round\x20','Failed:\x20\x20\x20','basename','yellow','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','PASS','ERROR','utf-8','map','Total:\x20\x20\x20\x20','find','now','testName','has','reason','tsv','resolveAgentId'];a5_0xbf6c=function(){return _0x386599;};return a5_0xbf6c();}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x471453(0x1b0)]='agent:test';['description']='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x471453(0x1bd)](_0x550c67){const _0x2ea18d=a5_0x471453,{options:_0x345c36,args:_0x59d2dc,tdx:_0x9bf81}=_0x550c67,_0x337719=_0x59d2dc[0x0]||'.',_0x3aca6a=_0x345c36[_0x2ea18d(0x1e8)],_0x12c3f9=_0x345c36,_0x491ae0=_0x12c3f9[_0x2ea18d(0x205)]===![],_0x3e6f71=_0x12c3f9[_0x2ea18d(0x230)],_0x266f0e=_0x12c3f9[_0x2ea18d(0x1b0)],_0x45cfeb=_0x12c3f9[_0x2ea18d(0x1e0)],_0x5a8bbf=_0x345c36['site'],_0x1f8cca=_0x12c3f9[_0x2ea18d(0x212)];if(_0x3e6f71&&_0x491ae0)return console['log'](a5_0x4f4d8f['red'](_0x2ea18d(0x1ab))),0x1;let _0x16cff5=_0x2ea18d(0x233);if(_0x12c3f9[_0x2ea18d(0x203)])_0x16cff5=_0x2ea18d(0x203);else{if(_0x12c3f9['jsonl'])_0x16cff5=_0x2ea18d(0x1a8);else{if(_0x12c3f9[_0x2ea18d(0x1fa)])_0x16cff5='tsv';else{if(_0x12c3f9[_0x2ea18d(0x233)])_0x16cff5=_0x2ea18d(0x233);}}}const _0x1c2ebb=_0x12c3f9[_0x2ea18d(0x220)];let _0x501795=_0x337719;const _0x5f3cee=a5_0x3e1c39[_0x2ea18d(0x1e5)](_0x337719),_0x54c696=_0x337719==='.';if(!_0x5f3cee||_0x54c696){const _0x3febe2=resolveProjectFromContext(_0x337719,_0x1c2ebb,{'requireFile':_0x2ea18d(0x1fd)});if(_0x3febe2[_0x2ea18d(0x1d8)])_0x501795=_0x3febe2[_0x2ea18d(0x22b)],_0x3febe2[_0x2ea18d(0x1cf)]===_0x2ea18d(0x1cc)&&console[_0x2ea18d(0x217)](a5_0x4f4d8f['dim'](_0x2ea18d(0x20c)+_0x501795));else switch(_0x3febe2[_0x2ea18d(0x1f9)]){case'no_context':console['log'](a5_0x4f4d8f[_0x2ea18d(0x1ee)](_0x3febe2[_0x2ea18d(0x20d)])),console[_0x2ea18d(0x217)](),console[_0x2ea18d(0x217)](_0x2ea18d(0x1b2)),console[_0x2ea18d(0x217)]('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console[_0x2ea18d(0x217)](_0x2ea18d(0x1a9)),console[_0x2ea18d(0x217)](),console[_0x2ea18d(0x217)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x2ea18d(0x239):console['log'](a5_0x4f4d8f[_0x2ea18d(0x1ee)](_0x3febe2['message'])),console[_0x2ea18d(0x217)](),console[_0x2ea18d(0x217)](_0x2ea18d(0x213)+_0x3febe2['llmProject']+_0x2ea18d(0x228));return 0x1;case'multiple_agents':{const _0x51f379=a5_0x1aa8f7[_0x2ea18d(0x1ed)](_0x3febe2['projectDir']);console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x1ee)](_0x2ea18d(0x22d)+_0x3febe2[_0x2ea18d(0x220)]+'\x22:'));for(const _0x18ff73 of _0x3febe2['agentDirs']){console[_0x2ea18d(0x217)](_0x2ea18d(0x1be)+_0x18ff73);}return console[_0x2ea18d(0x217)](),console['log'](_0x2ea18d(0x1aa)+_0x51f379+_0x2ea18d(0x1a5)),0x1;}case _0x2ea18d(0x1e4):console['log'](a5_0x4f4d8f['yellow'](_0x2ea18d(0x22a)+_0x3febe2[_0x2ea18d(0x220)]+'\x22.')),console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x200)]('Project\x20path:\x20'+_0x3febe2[_0x2ea18d(0x22b)])),console[_0x2ea18d(0x217)](),console[_0x2ea18d(0x217)](_0x2ea18d(0x22e));return 0x1;}}const {definition:_0x41b169,agentInfo:_0x19ad2c}=parseTestFile(_0x501795);let _0x31fe2a=_0x41b169[_0x2ea18d(0x1c5)];if(_0x266f0e){const _0x51f628=_0x266f0e[_0x2ea18d(0x1ca)](',')[_0x2ea18d(0x1f3)](_0x54f271=>_0x54f271['trim']());_0x31fe2a=_0x41b169['tests'][_0x2ea18d(0x1d3)](_0x376748=>_0x51f628[_0x2ea18d(0x1fc)](_0x376748[_0x2ea18d(0x1b0)]));if(_0x31fe2a[_0x2ea18d(0x1e7)]===0x0)return console[_0x2ea18d(0x217)](a5_0x4f4d8f['yellow'](_0x2ea18d(0x236)+_0x266f0e)),console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x200)](_0x2ea18d(0x231)+_0x41b169['tests'][_0x2ea18d(0x1f3)](_0x59a894=>_0x59a894[_0x2ea18d(0x1b0)])[_0x2ea18d(0x1ad)](',\x20'))),0x1;}if(_0x45cfeb){const _0x582608=_0x45cfeb[_0x2ea18d(0x1ca)](',')['map'](_0x679b02=>_0x679b02[_0x2ea18d(0x223)]()[_0x2ea18d(0x1d6)]());_0x31fe2a=_0x31fe2a[_0x2ea18d(0x1d3)](_0x58bad5=>_0x58bad5['tags']?.[_0x2ea18d(0x1ce)](_0x574db9=>_0x582608[_0x2ea18d(0x1fc)](_0x574db9['toLowerCase']())));if(_0x31fe2a[_0x2ea18d(0x1e7)]===0x0){console[_0x2ea18d(0x217)](a5_0x4f4d8f['yellow'](_0x2ea18d(0x1e2)+_0x45cfeb));const _0x2e812c=new Set();return _0x41b169['tests'][_0x2ea18d(0x202)](_0xd70066=>_0xd70066[_0x2ea18d(0x1e0)]?.[_0x2ea18d(0x202)](_0x54327b=>_0x2e812c['add'](_0x54327b))),_0x2e812c[_0x2ea18d(0x1b5)]>0x0?console[_0x2ea18d(0x217)](a5_0x4f4d8f['dim']('Available\x20tags:\x20'+[..._0x2e812c][_0x2ea18d(0x1ad)](',\x20'))):console[_0x2ea18d(0x217)](a5_0x4f4d8f['dim']('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x3e6f71)return this['executeReeval'](_0x550c67,{'definition':{'tests':_0x31fe2a},'agentInfo':_0x19ad2c,'outputFormat':_0x16cff5,'outputFile':_0x1f8cca,'testNames':_0x266f0e});if(_0x3aca6a){console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x1c7)]('Test\x20Configuration:')),console[_0x2ea18d(0x217)](_0x2ea18d(0x1df)+a5_0x4f4d8f[_0x2ea18d(0x1c6)](_0x5a8bbf)),console[_0x2ea18d(0x217)](_0x2ea18d(0x208)+a5_0x4f4d8f[_0x2ea18d(0x1c6)](_0x19ad2c[_0x2ea18d(0x1bb)])),console[_0x2ea18d(0x217)]('\x20\x20Agent:\x20'+a5_0x4f4d8f['white'](_0x19ad2c['agentName'])),console[_0x2ea18d(0x217)](),console['log'](_0x2ea18d(0x1e1)+a5_0x4f4d8f[_0x2ea18d(0x1c6)](_0x31fe2a['length']));for(let _0x5a8098=0x0;_0x5a8098<_0x31fe2a[_0x2ea18d(0x1e7)];_0x5a8098++){const _0x151bde=_0x31fe2a[_0x5a8098],_0x5b1112=_0x151bde['rounds'][_0x2ea18d(0x1e7)]===0x1?_0x2ea18d(0x201):_0x2ea18d(0x215),_0x1e321f=_0x151bde['tags']?.[_0x2ea18d(0x1e7)]?'\x20['+_0x151bde[_0x2ea18d(0x1e0)][_0x2ea18d(0x1ad)](',\x20')+']':'';console[_0x2ea18d(0x217)]('\x20\x20'+(_0x5a8098+0x1)+'.\x20'+a5_0x4f4d8f[_0x2ea18d(0x1c6)](_0x151bde['name'])+'\x20('+_0x151bde[_0x2ea18d(0x215)][_0x2ea18d(0x1e7)]+'\x20'+_0x5b1112+')'+a5_0x4f4d8f['dim'](_0x1e321f));}return 0x0;}let _0x5e7646,_0x861ef9;try{_0x5e7646=await _0x9bf81[_0x2ea18d(0x1ba)]['resolveProjectId'](_0x19ad2c[_0x2ea18d(0x1bb)]);}catch(_0x38b415){const _0x3be1a9=_0x38b415 instanceof Error?_0x38b415['message']:String(_0x38b415);return _0x3be1a9[_0x2ea18d(0x1fc)]('404')||_0x3be1a9[_0x2ea18d(0x1d6)]()['includes'](_0x2ea18d(0x214))?console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x1d1)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x19ad2c[_0x2ea18d(0x1bb)])):console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x1d1)](_0x2ea18d(0x1c0)+_0x19ad2c['projectName']+_0x2ea18d(0x211)+_0x3be1a9)),0x1;}try{_0x861ef9=await _0x9bf81[_0x2ea18d(0x1ba)][_0x2ea18d(0x1fb)](_0x19ad2c[_0x2ea18d(0x219)],_0x5e7646);}catch(_0x16e774){const _0x377460=_0x16e774 instanceof Error?_0x16e774[_0x2ea18d(0x20d)]:String(_0x16e774);return _0x377460[_0x2ea18d(0x1fc)](_0x2ea18d(0x1c4))||_0x377460['toLowerCase']()[_0x2ea18d(0x1fc)](_0x2ea18d(0x214))?console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x1d1)](_0x2ea18d(0x1d0)+_0x19ad2c[_0x2ea18d(0x219)])):console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x1d1)](_0x2ea18d(0x20a)+_0x19ad2c['agentName']+_0x2ea18d(0x211)+_0x377460)),0x1;}let _0x4dd256;if(!_0x491ae0)try{_0x4dd256=await setupEvaluatorAgent(_0x9bf81[_0x2ea18d(0x1ba)],_0x345c36[_0x2ea18d(0x1bc)]);}catch(_0x343fcf){const _0xd5b035=_0x343fcf instanceof Error?_0x343fcf[_0x2ea18d(0x20d)]:String(_0x343fcf);return console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x1d1)](_0x2ea18d(0x1ef)+_0xd5b035)),0x1;}console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x1c7)](_0x2ea18d(0x1ae))),console[_0x2ea18d(0x217)](_0x2ea18d(0x1b9)+a5_0x4f4d8f['white'](_0x5a8bbf)),console[_0x2ea18d(0x217)](_0x2ea18d(0x1af)+a5_0x4f4d8f[_0x2ea18d(0x1c6)](_0x19ad2c[_0x2ea18d(0x1bb)]+'/'+_0x19ad2c['agentName'])),console['log']();const _0x2c4e60=[],_0x54f1e0=[],_0x2ad7b8=Date[_0x2ea18d(0x1f6)]();for(let _0x361e12=0x0;_0x361e12<_0x31fe2a[_0x2ea18d(0x1e7)];_0x361e12++){const _0x2e55a2=_0x31fe2a[_0x361e12];_0x31fe2a['length']>0x1?console['log'](_0x2ea18d(0x1c2)+(_0x361e12+0x1)+'/'+_0x31fe2a[_0x2ea18d(0x1e7)]+':\x20'+a5_0x4f4d8f[_0x2ea18d(0x1c6)](_0x2e55a2['name'])):console[_0x2ea18d(0x217)](_0x2ea18d(0x1ff)+a5_0x4f4d8f['white'](_0x2e55a2[_0x2ea18d(0x1b0)]));const _0x2fec8f=createCommandSpinner(_0x2ea18d(0x1b4)+_0x2e55a2[_0x2ea18d(0x215)]['length']+_0x2ea18d(0x1c8));_0x2fec8f[_0x2ea18d(0x1ac)]();try{const {result:_0xda7819,conversation:_0x7f24ab}=await runTest(_0x9bf81[_0x2ea18d(0x1ba)],_0x2e55a2,{'agentId':_0x861ef9,'projectId':_0x5e7646,'site':_0x5a8bbf,'noEval':_0x491ae0,'evaluatorId':_0x4dd256,'onRoundStart':(_0x34255a,_0xc0c177)=>{const _0x372826=_0x2ea18d;_0x2fec8f[_0x372826(0x1a6)]=_0x372826(0x21f)+(_0x34255a+0x1)+'/'+_0xc0c177+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x371353,_0x170d8c,_0x4e3ac)=>{const _0x100dff=_0x2ea18d,_0x2f1fe1=formatElapsed(_0x170d8c);_0x4e3ac?console[_0x100dff(0x217)](_0x100dff(0x1eb)+(_0x371353+0x1)+'/'+_0x2e55a2[_0x100dff(0x215)][_0x100dff(0x1e7)]+_0x100dff(0x1dc)+a5_0x4f4d8f[_0x100dff(0x20e)]('✓')+'\x20('+_0x2f1fe1+')'):console['log'](_0x100dff(0x1eb)+(_0x371353+0x1)+'/'+_0x2e55a2[_0x100dff(0x215)][_0x100dff(0x1e7)]+'...\x20'+a5_0x4f4d8f[_0x100dff(0x1d1)]('✗'));},'onEvaluationStart':()=>{_0x2fec8f['text']='Evaluating\x20response...';},'onEvaluationComplete':_0x5e7ce6=>{const _0x29718a=_0x2ea18d,_0x174326=formatElapsed(_0x5e7ce6);console[_0x29718a(0x217)](_0x29718a(0x23a)+a5_0x4f4d8f[_0x29718a(0x20e)]('✓')+'\x20('+_0x174326+')');}});_0x2fec8f[_0x2ea18d(0x238)](),_0x2c4e60['push'](_0xda7819),_0x54f1e0['push'](_0x7f24ab);if(_0xda7819['status']===_0x2ea18d(0x1f0))console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x20e)](_0x2ea18d(0x21c)+_0xda7819[_0x2ea18d(0x1f9)]));else _0xda7819[_0x2ea18d(0x206)]===_0x2ea18d(0x22c)?console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x1d1)](_0x2ea18d(0x226)+_0xda7819[_0x2ea18d(0x1f9)])):console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x1d1)](_0x2ea18d(0x204)+_0xda7819[_0x2ea18d(0x1f9)]));_0xda7819['conversation_url']&&console['log'](a5_0x4f4d8f[_0x2ea18d(0x200)]('Conversation\x20URL:\x20'+_0xda7819[_0x2ea18d(0x1c1)])),console['log']();}catch(_0xf4c3a2){_0x2fec8f[_0x2ea18d(0x238)]();const _0x419533=_0xf4c3a2 instanceof Error?_0xf4c3a2['message']:String(_0xf4c3a2);console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x1d1)](_0x2ea18d(0x204)+_0x419533)),console['log'](),_0x2c4e60[_0x2ea18d(0x1e9)]({'name':_0x2e55a2[_0x2ea18d(0x1b0)],'status':_0x2ea18d(0x1f1),'reason':_0x419533,'timestamp':new Date()[_0x2ea18d(0x1d5)](),'duration_ms':0x0});}}const _0x2e331f=Date['now']()-_0x2ad7b8,_0x4e8d52=_0x2c4e60[_0x2ea18d(0x1d3)](_0x370bd1=>_0x370bd1[_0x2ea18d(0x206)]===_0x2ea18d(0x1f0))['length'],_0x3c1335=_0x2c4e60['filter'](_0xb9a822=>_0xb9a822[_0x2ea18d(0x206)]===_0x2ea18d(0x22c))[_0x2ea18d(0x1e7)],_0x5519bb=_0x2c4e60[_0x2ea18d(0x1d3)](_0x256621=>_0x256621[_0x2ea18d(0x206)]===_0x2ea18d(0x1f1))['length'];console['log']('━'[_0x2ea18d(0x1d2)](0x3c)),console[_0x2ea18d(0x217)](_0x2ea18d(0x1c3)),console[_0x2ea18d(0x217)]('━'['repeat'](0x3c)),console[_0x2ea18d(0x217)](_0x2ea18d(0x1f4)+_0x2c4e60['length']),console[_0x2ea18d(0x217)](_0x2ea18d(0x1b7)+a5_0x4f4d8f[_0x2ea18d(0x20e)](_0x4e8d52)),console['log'](_0x2ea18d(0x1ec)+a5_0x4f4d8f[_0x2ea18d(0x1d1)](_0x3c1335));_0x5519bb>0x0&&console[_0x2ea18d(0x217)]('Errors:\x20\x20\x20'+a5_0x4f4d8f['red'](_0x5519bb));console['log']('Duration:\x20'+formatElapsed(_0x2e331f)),console['log']('━'[_0x2ea18d(0x1d2)](0x3c));const _0x1e7280=_0x2c4e60[_0x2ea18d(0x1d3)](_0x481fc1=>_0x481fc1['status']!==_0x2ea18d(0x1f0));if(_0x1e7280[_0x2ea18d(0x1e7)]>0x0){console['log'](),console[_0x2ea18d(0x217)](_0x2ea18d(0x237));for(const _0x5487ab of _0x1e7280){const _0x9527dd=a5_0x4f4d8f[_0x2ea18d(0x1d1)]('✗'),_0x4028d1=_0x5487ab[_0x2ea18d(0x1f9)][_0x2ea18d(0x1e7)]>0x32?_0x5487ab['reason']['substring'](0x0,0x32)+'...':_0x5487ab[_0x2ea18d(0x1f9)];console['log']('\x20\x20'+_0x9527dd+'\x20'+_0x5487ab[_0x2ea18d(0x1b0)]+':\x20'+_0x4028d1);}}const _0x5e625c={'summary':{'total':_0x2c4e60[_0x2ea18d(0x1e7)],'passed':_0x4e8d52,'failed':_0x3c1335,'errors':_0x5519bb>0x0?_0x5519bb:undefined,'duration_ms':_0x2e331f},'tests':_0x2c4e60,'agent':{'project':_0x19ad2c[_0x2ea18d(0x1bb)],'name':_0x19ad2c[_0x2ea18d(0x219)],'site':_0x5a8bbf},'timestamp':new Date(_0x2ad7b8)[_0x2ea18d(0x1d5)]()};try{const _0x8be66b=buildCachedTestRun(_0x54f1e0,{'site':_0x5a8bbf,'projectId':_0x5e7646,'projectName':_0x19ad2c[_0x2ea18d(0x1bb)],'agentId':_0x861ef9,'agentName':_0x19ad2c[_0x2ea18d(0x219)],'testYmlPath':a5_0x1aa8f7[_0x2ea18d(0x1dd)](_0x19ad2c['testYmlPath'])});saveLastTestRun(_0x8be66b);}catch{}if(_0x16cff5!=='table'||_0x1f8cca){const _0x1ec0cd=formatResults(_0x5e625c,_0x16cff5);if(_0x1f8cca)try{a5_0x3e1c39[_0x2ea18d(0x1da)](_0x1f8cca,_0x1ec0cd,_0x2ea18d(0x1f2)),console['log'](),console[_0x2ea18d(0x217)](a5_0x4f4d8f['dim'](_0x2ea18d(0x21a)+_0x1f8cca));}catch(_0x4406a2){return console[_0x2ea18d(0x217)](),console[_0x2ea18d(0x217)](a5_0x4f4d8f[_0x2ea18d(0x1d1)](_0x2ea18d(0x22f)+_0x4406a2)),0x1;}else console[_0x2ea18d(0x217)](),console[_0x2ea18d(0x217)](_0x1ec0cd);}return _0x1e7280[_0x2ea18d(0x1e7)]>0x0?0x1:0x0;}async['executeReeval'](_0x557f79,_0x512afa){const _0x17412c=a5_0x471453,{options:_0x4c1a23,tdx:_0x2a4b50}=_0x557f79,{definition:_0x3017be,agentInfo:_0x2e47a3,outputFormat:_0x4b913c,outputFile:_0x46129b}=_0x512afa,_0x847383=_0x4c1a23[_0x17412c(0x1db)],_0x3b5aa9=loadLastTestRun();if(!_0x3b5aa9)return console[_0x17412c(0x217)](a5_0x4f4d8f[_0x17412c(0x1d1)](_0x17412c(0x1e6))),console[_0x17412c(0x217)](a5_0x4f4d8f[_0x17412c(0x200)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x3b5aa9['agent'][_0x17412c(0x219)]!==_0x2e47a3[_0x17412c(0x219)])return console[_0x17412c(0x217)](a5_0x4f4d8f[_0x17412c(0x1d1)](_0x17412c(0x21e)+_0x3b5aa9[_0x17412c(0x1cb)][_0x17412c(0x219)]+_0x17412c(0x232)+_0x2e47a3[_0x17412c(0x219)]+'\x22.')),console[_0x17412c(0x217)](a5_0x4f4d8f['dim'](_0x17412c(0x218))),0x1;const _0x2e133d=new Set(_0x3b5aa9[_0x17412c(0x227)][_0x17412c(0x1f3)](_0x21937d=>_0x21937d[_0x17412c(0x1f7)])),_0x160de0=_0x3017be[_0x17412c(0x1c5)][_0x17412c(0x1d3)](_0x406407=>!_0x2e133d[_0x17412c(0x1f8)](_0x406407[_0x17412c(0x1b0)]));if(_0x160de0[_0x17412c(0x1e7)]>0x0&&_0x3b5aa9[_0x17412c(0x1db)]!==_0x847383)return console['log'](a5_0x4f4d8f['red'](_0x17412c(0x1e3))),console[_0x17412c(0x217)](a5_0x4f4d8f[_0x17412c(0x200)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x3b5aa9['site']+_0x17412c(0x1b3)+_0x847383+'\x22.')),console[_0x17412c(0x217)](a5_0x4f4d8f[_0x17412c(0x200)]('Either\x20switch\x20to\x20the\x20\x22'+_0x3b5aa9['site']+_0x17412c(0x235))),0x1;const _0x358b34=_0x3017be[_0x17412c(0x1c5)][_0x17412c(0x1d3)](_0x221969=>_0x2e133d[_0x17412c(0x1f8)](_0x221969[_0x17412c(0x1b0)])),_0x569b2f=_0x160de0;let _0x3da6f3;try{_0x3da6f3=await setupEvaluatorAgent(_0x2a4b50[_0x17412c(0x1ba)],_0x4c1a23[_0x17412c(0x1bc)]);}catch(_0x3ea79c){const _0x460c7b=_0x3ea79c instanceof Error?_0x3ea79c[_0x17412c(0x20d)]:String(_0x3ea79c);return console[_0x17412c(0x217)](a5_0x4f4d8f['red'](_0x17412c(0x1ef)+_0x460c7b)),0x1;}console[_0x17412c(0x217)](a5_0x4f4d8f[_0x17412c(0x1c7)](_0x17412c(0x1ea))),console[_0x17412c(0x217)](_0x17412c(0x1d4)+a5_0x4f4d8f[_0x17412c(0x1c6)](_0x3b5aa9[_0x17412c(0x21d)])),console[_0x17412c(0x217)]('Agent:\x20'+a5_0x4f4d8f[_0x17412c(0x1c6)](_0x3b5aa9[_0x17412c(0x1cb)]['projectName']+'/'+_0x3b5aa9[_0x17412c(0x1cb)][_0x17412c(0x219)]));_0x569b2f[_0x17412c(0x1e7)]>0x0&&console['log']('New\x20tests\x20to\x20execute:\x20'+a5_0x4f4d8f['yellow'](_0x569b2f[_0x17412c(0x1e7)]));console['log']();const _0x4eb658=[],_0xea0fc7=Date[_0x17412c(0x1f6)](),_0x12cb29=createCommandSpinner(_0x17412c(0x224));if(_0x358b34['length']>0x0)try{const _0x1ddd9f=await reevaluateFromCache(_0x2a4b50[_0x17412c(0x1ba)],_0x3b5aa9,{'tests':_0x358b34},{'evaluatorId':_0x3da6f3,'onTestStart':(_0x3de2a7,_0xe7dd3b,_0xb1330f)=>{const _0x4fa003=_0x17412c;_0x12cb29[_0x4fa003(0x1a6)]='Re-evaluating\x20'+(_0xe7dd3b+0x1)+'/'+_0xb1330f+':\x20'+_0x3de2a7+_0x4fa003(0x234);if(!_0x12cb29[_0x4fa003(0x1d9)])_0x12cb29[_0x4fa003(0x1ac)]();},'onTestComplete':(_0x3eeb8c,_0x1c2659)=>{const _0x36fe57=_0x17412c;_0x12cb29[_0x36fe57(0x238)]();if(_0x1c2659[_0x36fe57(0x206)]==='PASS')console[_0x36fe57(0x217)](a5_0x4f4d8f[_0x36fe57(0x20e)](_0x36fe57(0x21c)+_0x3eeb8c)+a5_0x4f4d8f[_0x36fe57(0x200)](_0x36fe57(0x207)));else _0x1c2659[_0x36fe57(0x206)]==='FAIL'?console[_0x36fe57(0x217)](a5_0x4f4d8f[_0x36fe57(0x1d1)]('✗\x20FAIL:\x20'+_0x3eeb8c+_0x36fe57(0x1b6)+_0x1c2659[_0x36fe57(0x1f9)])+a5_0x4f4d8f[_0x36fe57(0x200)](_0x36fe57(0x207))):console[_0x36fe57(0x217)](a5_0x4f4d8f[_0x36fe57(0x1d1)]('✗\x20ERROR:\x20'+_0x3eeb8c+'\x20-\x20'+_0x1c2659[_0x36fe57(0x1f9)]));_0x1c2659[_0x36fe57(0x1c1)]&&console[_0x36fe57(0x217)](a5_0x4f4d8f['dim']('\x20\x20Conversation:\x20'+_0x1c2659[_0x36fe57(0x1c1)])),_0x4eb658['push'](_0x1c2659);},'onTestSkipped':(_0x24c619,_0xc878a6)=>{const _0x34066e=_0x17412c;_0x12cb29[_0x34066e(0x238)](),console[_0x34066e(0x217)](a5_0x4f4d8f['yellow'](_0x34066e(0x209)+_0x24c619+_0x34066e(0x1b6)+_0xc878a6));}});for(const _0x1c2081 of _0x1ddd9f){!_0x4eb658[_0x17412c(0x1f5)](_0x2370d7=>_0x2370d7[_0x17412c(0x1b0)]===_0x1c2081['name'])&&_0x4eb658[_0x17412c(0x1e9)](_0x1c2081);}}catch(_0x5631bb){_0x12cb29['stop']();const _0x4a2367=_0x5631bb instanceof Error?_0x5631bb[_0x17412c(0x20d)]:String(_0x5631bb);return console[_0x17412c(0x217)](a5_0x4f4d8f['red'](_0x17412c(0x1a4)+_0x4a2367)),0x1;}_0x12cb29['stop']();if(_0x569b2f['length']>0x0){console[_0x17412c(0x217)](),console['log'](a5_0x4f4d8f[_0x17412c(0x1c7)](_0x17412c(0x21b)));const {projectId:_0xab65d2,agentId:_0x222f8b}=_0x3b5aa9['agent'];for(const _0x518d86 of _0x569b2f){console[_0x17412c(0x217)](_0x17412c(0x1bf)+a5_0x4f4d8f[_0x17412c(0x1c6)](_0x518d86[_0x17412c(0x1b0)]));const _0x11cecf=createCommandSpinner(_0x17412c(0x1b4)+_0x518d86[_0x17412c(0x215)]['length']+':\x20Sending\x20user\x20input...');_0x11cecf[_0x17412c(0x1ac)]();try{const {result:_0x391d6a}=await runTest(_0x2a4b50[_0x17412c(0x1ba)],_0x518d86,{'agentId':_0x222f8b,'projectId':_0xab65d2,'site':_0x3b5aa9[_0x17412c(0x1db)],'noEval':![],'evaluatorId':_0x3da6f3,'onRoundStart':(_0x5898a6,_0x1b82b9)=>{const _0x298d50=_0x17412c;_0x11cecf[_0x298d50(0x1a6)]=_0x298d50(0x21f)+(_0x5898a6+0x1)+'/'+_0x1b82b9+_0x298d50(0x1c8);},'onRoundComplete':(_0x256d1b,_0x2a558d,_0x444d4c)=>{const _0xc88337=_0x17412c,_0x8deba7=formatElapsed(_0x2a558d);_0x444d4c?console[_0xc88337(0x217)](_0xc88337(0x1eb)+(_0x256d1b+0x1)+'/'+_0x518d86[_0xc88337(0x215)][_0xc88337(0x1e7)]+'...\x20'+a5_0x4f4d8f[_0xc88337(0x20e)]('✓')+'\x20('+_0x8deba7+')'):console[_0xc88337(0x217)]('\x20\x20Round\x20'+(_0x256d1b+0x1)+'/'+_0x518d86['rounds'][_0xc88337(0x1e7)]+'...\x20'+a5_0x4f4d8f[_0xc88337(0x1d1)]('✗'));},'onEvaluationStart':()=>{const _0xc327ce=_0x17412c;_0x11cecf[_0xc327ce(0x1a6)]=_0xc327ce(0x229);},'onEvaluationComplete':_0x3e65c6=>{const _0x3bf675=_0x17412c,_0x2f8a1b=formatElapsed(_0x3e65c6);console['log'](_0x3bf675(0x23a)+a5_0x4f4d8f[_0x3bf675(0x20e)]('✓')+'\x20('+_0x2f8a1b+')');}});_0x11cecf[_0x17412c(0x238)](),_0x4eb658[_0x17412c(0x1e9)](_0x391d6a);if(_0x391d6a[_0x17412c(0x206)]===_0x17412c(0x1f0))console['log'](a5_0x4f4d8f['green'](_0x17412c(0x21c)+_0x391d6a[_0x17412c(0x1f9)])+a5_0x4f4d8f[_0x17412c(0x200)](_0x17412c(0x216)));else _0x391d6a[_0x17412c(0x206)]===_0x17412c(0x22c)?console[_0x17412c(0x217)](a5_0x4f4d8f[_0x17412c(0x1d1)]('✗\x20FAIL:\x20'+_0x391d6a[_0x17412c(0x1f9)])+a5_0x4f4d8f[_0x17412c(0x200)](_0x17412c(0x216))):console[_0x17412c(0x217)](a5_0x4f4d8f[_0x17412c(0x1d1)](_0x17412c(0x204)+_0x391d6a[_0x17412c(0x1f9)]));_0x391d6a[_0x17412c(0x1c1)]&&console[_0x17412c(0x217)](a5_0x4f4d8f[_0x17412c(0x200)](_0x17412c(0x20f)+_0x391d6a[_0x17412c(0x1c1)]));}catch(_0x57f6a6){_0x11cecf[_0x17412c(0x238)]();const _0x2308be=_0x57f6a6 instanceof Error?_0x57f6a6[_0x17412c(0x20d)]:String(_0x57f6a6);console['log'](a5_0x4f4d8f[_0x17412c(0x1d1)](_0x17412c(0x204)+_0x2308be)),_0x4eb658[_0x17412c(0x1e9)]({'name':_0x518d86[_0x17412c(0x1b0)],'status':_0x17412c(0x1f1),'reason':_0x2308be,'timestamp':new Date()[_0x17412c(0x1d5)](),'duration_ms':0x0});}}}console[_0x17412c(0x217)]();const _0x362fe9=Date[_0x17412c(0x1f6)]()-_0xea0fc7,_0x49474f=_0x4eb658[_0x17412c(0x1d3)](_0x5c2dfe=>_0x5c2dfe[_0x17412c(0x206)]===_0x17412c(0x1f0))[_0x17412c(0x1e7)],_0x13c7cc=_0x4eb658[_0x17412c(0x1d3)](_0x387704=>_0x387704[_0x17412c(0x206)]===_0x17412c(0x22c))[_0x17412c(0x1e7)],_0x465af4=_0x4eb658['filter'](_0x17522a=>_0x17522a['status']===_0x17412c(0x1f1))[_0x17412c(0x1e7)];console['log']('━'['repeat'](0x3c)),console[_0x17412c(0x217)](_0x17412c(0x1b8)),console[_0x17412c(0x217)]('━'['repeat'](0x3c)),console[_0x17412c(0x217)](_0x17412c(0x1f4)+_0x4eb658[_0x17412c(0x1e7)]),console[_0x17412c(0x217)](_0x17412c(0x1b7)+a5_0x4f4d8f['green'](_0x49474f)),console[_0x17412c(0x217)](_0x17412c(0x1ec)+a5_0x4f4d8f['red'](_0x13c7cc));_0x465af4>0x0&&console['log'](_0x17412c(0x222)+a5_0x4f4d8f[_0x17412c(0x1d1)](_0x465af4));console[_0x17412c(0x217)]('Duration:\x20'+formatElapsed(_0x362fe9)),console[_0x17412c(0x217)]('━'['repeat'](0x3c));const _0x4351e8={'summary':{'total':_0x4eb658['length'],'passed':_0x49474f,'failed':_0x13c7cc,'errors':_0x465af4>0x0?_0x465af4:undefined,'duration_ms':_0x362fe9},'tests':_0x4eb658,'agent':{'project':_0x2e47a3[_0x17412c(0x1bb)],'name':_0x2e47a3[_0x17412c(0x219)],'site':_0x847383},'timestamp':new Date(_0xea0fc7)['toISOString']()};if(_0x4b913c!==_0x17412c(0x233)||_0x46129b){const _0x5ea47b=formatResults(_0x4351e8,_0x4b913c);if(_0x46129b)try{a5_0x3e1c39['writeFileSync'](_0x46129b,_0x5ea47b,_0x17412c(0x1f2)),console[_0x17412c(0x217)](),console[_0x17412c(0x217)](a5_0x4f4d8f[_0x17412c(0x200)](_0x17412c(0x21a)+_0x46129b));}catch(_0x47d3fb){return console['log'](),console[_0x17412c(0x217)](a5_0x4f4d8f['red'](_0x17412c(0x22f)+_0x47d3fb)),0x1;}else console[_0x17412c(0x217)](),console[_0x17412c(0x217)](_0x5ea47b);}const _0x54fa8a=_0x4eb658[_0x17412c(0x1d3)](_0x56e6fe=>_0x56e6fe[_0x17412c(0x206)]!=='PASS');return _0x54fa8a[_0x17412c(0x1e7)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x218b71=a6_0x39ff;(function(_0x416b8c,_0x5bf97c){const _0x550ebe=a6_0x39ff,_0x1e72ee=_0x416b8c();while(!![]){try{const _0x2c87b5=-parseInt(_0x550ebe(0x11c))/0x1+-parseInt(_0x550ebe(0x152))/0x2+parseInt(_0x550ebe(0x146))/0x3+-parseInt(_0x550ebe(0x143))/0x4*(parseInt(_0x550ebe(0x11f))/0x5)+-parseInt(_0x550ebe(0x134))/0x6*(-parseInt(_0x550ebe(0x14e))/0x7)+parseInt(_0x550ebe(0x120))/0x8+parseInt(_0x550ebe(0x127))/0x9*(parseInt(_0x550ebe(0x14d))/0xa);if(_0x2c87b5===_0x5bf97c)break;else _0x1e72ee['push'](_0x1e72ee['shift']());}catch(_0xb2786d){_0x1e72ee['push'](_0x1e72ee['shift']());}}}(a6_0xb773,0x1bd45));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';function a6_0x39ff(_0x4485dc,_0xfba0be){_0x4485dc=_0x4485dc-0x10f;const _0xb77371=a6_0xb773();let _0x39ffd3=_0xb77371[_0x4485dc];return _0x39ffd3;}function a6_0xb773(){const _0x512b4f=['llm','data','includes','error','api','isArray','method','PATCH','color','150132QCkAtZ','Error:\x20','length','81455OLiKgu','1237568IFDBTy','readBodyFromFile','\x22.\x20','log','keys','substring','site','522hxIxmV','indexOf','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','cookie','POST','set-cookie2','verbose','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','GET','trim','proxy-authorization','stack','entries','387546QKsDeS','has','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','DELETE','cdp','Invalid\x20header\x20format:\x20\x22','toLowerCase','PUT','Results\x20saved\x20to\x20','file','validate','.\x20Valid\x20methods:\x20','output','noColor','body','8VokWbp','join','.\x20Valid\x20types:\x20','140274lVttZG','x-xsrf-token','execute','message','description','headers','toUpperCase','19210cmcChD','7naavpp','x-trino-user','<\x20HTTP/1.1\x20','Invalid\x20API\x20type:\x20','161520tWPPXm','status','request','workflow','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','type'];a6_0xb773=function(){return _0x512b4f;};return a6_0xb773();}const SENSITIVE_HEADERS=new Set(['authorization',a6_0x218b71(0x131),a6_0x218b71(0x12a),'set-cookie',a6_0x218b71(0x12c),a6_0x218b71(0x147),'x-auth-token',a6_0x218b71(0x14f)]);function isSensitiveHeader(_0x57f143){const _0x9ad8ad=a6_0x218b71;return SENSITIVE_HEADERS[_0x9ad8ad(0x135)](_0x57f143[_0x9ad8ad(0x13a)]());}function parseHeader(_0x315f37){const _0x1ba55c=a6_0x218b71,_0x134bc1=_0x315f37[_0x1ba55c(0x128)](':');if(_0x134bc1===-0x1)throw new Error(_0x1ba55c(0x139)+_0x315f37+_0x1ba55c(0x122)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x445435=_0x315f37[_0x1ba55c(0x125)](0x0,_0x134bc1)[_0x1ba55c(0x130)](),_0x5d9d36=_0x315f37[_0x1ba55c(0x125)](_0x134bc1+0x1)[_0x1ba55c(0x130)]();if(!_0x445435)throw new Error(_0x1ba55c(0x136)+_0x315f37+'\x22');return[_0x445435,_0x5d9d36];}export class ApiCommand extends BaseCommand{['name']=a6_0x218b71(0x117);[a6_0x218b71(0x14a)]=a6_0x218b71(0x12e);[a6_0x218b71(0x13e)](_0x442382){const _0x20ba35=a6_0x218b71,{args:_0x473f09,options:_0x2fd68d}=_0x442382,_0xf4bed1=_0x2fd68d;if(_0x473f09[_0x20ba35(0x11e)]===0x0)return _0x20ba35(0x129);const _0x2e1da5=_0x473f09[0x0];if(!_0x2e1da5['startsWith']('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x2e1da5;const _0x3ff787=_0xf4bed1[_0x20ba35(0x114)],_0x4090a9=_0xf4bed1[_0x20ba35(0x13d)];if(_0x3ff787&&_0x4090a9)return _0x20ba35(0x111);const _0x251a80=_0xf4bed1[_0x20ba35(0x119)]||_0x20ba35(0x12f),_0x59cb4c=[_0x20ba35(0x12f),_0x20ba35(0x12b),_0x20ba35(0x13b),_0x20ba35(0x137),_0x20ba35(0x11a)];if(!_0x59cb4c[_0x20ba35(0x115)](_0x251a80[_0x20ba35(0x14c)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x251a80+_0x20ba35(0x13f)+_0x59cb4c[_0x20ba35(0x144)](',\x20');const _0xea699d=_0xf4bed1[_0x20ba35(0x112)]||'td',_0xc589c1=['td',_0x20ba35(0x138),_0x20ba35(0x110),'trino',_0x20ba35(0x113),'llm-proxy'];if(!_0xc589c1[_0x20ba35(0x115)](_0xea699d))return _0x20ba35(0x151)+_0xea699d+_0x20ba35(0x145)+_0xc589c1['join'](',\x20');return undefined;}async[a6_0x218b71(0x148)](_0x51cf7f){const _0x27d74e=a6_0x218b71,{options:_0x408e9d,args:_0x1685c5,tdx:_0x35405f}=_0x51cf7f,_0x46baf7=_0x408e9d,_0x56ed7f=_0x1685c5[0x0],_0x121c7b=(_0x46baf7[_0x27d74e(0x119)]||_0x27d74e(0x12f))[_0x27d74e(0x14c)](),_0x19eedb=_0x46baf7[_0x27d74e(0x114)],_0xf03a33=_0x46baf7[_0x27d74e(0x13d)],_0x35fd00=_0x46baf7['header'],_0xbbd665=_0x46baf7['type']||'td';try{const _0xaef98d={};if(_0x35fd00){const _0x9cca1d=Array[_0x27d74e(0x118)](_0x35fd00)?_0x35fd00:[_0x35fd00];for(const _0x397194 of _0x9cca1d){const [_0x2ccaad,_0x1d29b9]=parseHeader(_0x397194);_0xaef98d[_0x2ccaad]=_0x1d29b9;}}let _0x18d161;if(_0x19eedb)_0x18d161=_0x19eedb;else{if(_0xf03a33)try{_0x18d161=RawAPI[_0x27d74e(0x121)](_0xf03a33);}catch(_0x311756){return console[_0x27d74e(0x116)](_0x27d74e(0x11d)+(_0x311756 instanceof Error?_0x311756[_0x27d74e(0x149)]:String(_0x311756))),0x1;}}const _0x70bda3={'method':_0x121c7b,'apiType':_0xbbd665,'includeHeaders':_0x408e9d[_0x27d74e(0x12d)]};_0x18d161&&(_0x70bda3[_0x27d74e(0x142)]=_0x18d161);Object[_0x27d74e(0x124)](_0xaef98d)[_0x27d74e(0x11e)]>0x0&&(_0x70bda3[_0x27d74e(0x14b)]=_0xaef98d);if(_0x408e9d[_0x27d74e(0x12d)]){const _0x1a856a=resolveSite(_0x408e9d[_0x27d74e(0x126)]),_0x2581d1=getEndpoint(_0x1a856a,_0xbbd665),_0x65a385=''+_0x2581d1+_0x56ed7f;console[_0x27d74e(0x116)]('>\x20'+_0x121c7b+'\x20'+_0x65a385);const _0x44be3f=getAuthHeaders(_0x1a856a),_0x5d2819={..._0x44be3f,..._0xaef98d};for(const [_0x4f77d4,_0x256fb9]of Object[_0x27d74e(0x133)](_0x5d2819)){!isSensitiveHeader(_0x4f77d4)&&console[_0x27d74e(0x116)]('>\x20'+_0x4f77d4+':\x20'+_0x256fb9);}_0x18d161&&console[_0x27d74e(0x116)]('>'),console[_0x27d74e(0x116)]('');}const _0x273efa=await _0x35405f[_0x27d74e(0x117)][_0x27d74e(0x10f)](_0x56ed7f,_0x70bda3);if(_0x408e9d[_0x27d74e(0x12d)]&&_0x273efa[_0x27d74e(0x14b)]){console['error'](_0x27d74e(0x150)+_0x273efa[_0x27d74e(0x153)]);for(const [_0x5a5d12,_0x21f3d1]of Object[_0x27d74e(0x133)](_0x273efa['headers'])){!isSensitiveHeader(_0x5a5d12)&&console['error']('<\x20'+_0x5a5d12+':\x20'+_0x21f3d1);}console[_0x27d74e(0x116)]('');}const _0x4e46f4=Boolean(_0x408e9d[_0x27d74e(0x140)]),_0x2e1433={'color':_0x408e9d[_0x27d74e(0x11b)],'noColor':_0x408e9d[_0x27d74e(0x141)]||_0x4e46f4&&!_0x408e9d[_0x27d74e(0x11b)]},_0x4e1db7=colorizeJSON(_0x273efa['data'],_0x2e1433);return _0x408e9d['output']?(writeFileSync(_0x408e9d['output'],_0x4e1db7),console[_0x27d74e(0x116)](_0x27d74e(0x13c)+_0x408e9d[_0x27d74e(0x140)])):console[_0x27d74e(0x123)](_0x4e1db7),0x0;}catch(_0x24e8c7){return _0x24e8c7 instanceof Error?(console[_0x27d74e(0x116)](_0x27d74e(0x11d)+_0x24e8c7['message']),_0x408e9d[_0x27d74e(0x12d)]&&_0x24e8c7[_0x27d74e(0x132)]&&console['error']('\x0aStack\x20trace:\x0a'+_0x24e8c7[_0x27d74e(0x132)])):console[_0x27d74e(0x116)](_0x27d74e(0x11d)+String(_0x24e8c7)),0x1;}}}
1
+ const a6_0x21e70f=a6_0x455a;(function(_0x24fe42,_0x2401e8){const _0x3be248=a6_0x455a,_0x39cf92=_0x24fe42();while(!![]){try{const _0x5dce3c=parseInt(_0x3be248(0xf9))/0x1+-parseInt(_0x3be248(0xcf))/0x2*(parseInt(_0x3be248(0xe0))/0x3)+parseInt(_0x3be248(0xe6))/0x4+-parseInt(_0x3be248(0xe1))/0x5*(-parseInt(_0x3be248(0xee))/0x6)+parseInt(_0x3be248(0xc9))/0x7*(-parseInt(_0x3be248(0xf4))/0x8)+parseInt(_0x3be248(0xd2))/0x9*(-parseInt(_0x3be248(0x108))/0xa)+-parseInt(_0x3be248(0xf2))/0xb*(-parseInt(_0x3be248(0xd8))/0xc);if(_0x5dce3c===_0x2401e8)break;else _0x39cf92['push'](_0x39cf92['shift']());}catch(_0x4a9646){_0x39cf92['push'](_0x39cf92['shift']());}}}(a6_0x284a,0x771f3));function a6_0x284a(){const _0x47f0db=['entries','536223CzaDDv','indexOf','length','Results\x20saved\x20to\x20','startsWith','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','<\x20HTTP/1.1\x20','substring','output','.\x20Valid\x20types:\x20','POST','toUpperCase','Error:\x20','status','noColor','147430JYTyiZ','workflow','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','x-xsrf-token','log','x-trino-user','type','Invalid\x20API\x20type:\x20','1082844BzQOfu','name','message','trino','join','\x0aStack\x20trace:\x0a','401668oqCVHV','has','set-cookie2','171gfAinw','PUT','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','PATCH','stack','method','2115732YClOAj','data','error','validate','cdp','proxy-authorization','api','request','6WHvqni','24205IVWbBv','trim','x-auth-token','toLowerCase','GET','1498628IZdQCW','headers','keys','includes','.\x20Valid\x20methods:\x20','isArray','DELETE','header','294JFCTas','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','file','description','11UrQmPf','color','8ZAzQiY','verbose','body','Endpoint\x20must\x20start\x20with\x20/:\x20'];a6_0x284a=function(){return _0x47f0db;};return a6_0x284a();}import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a6_0x455a(_0xfc51a4,_0x20d64b){_0xfc51a4=_0xfc51a4-0xc9;const _0x284ac5=a6_0x284a();let _0x455aa7=_0x284ac5[_0xfc51a4];return _0x455aa7;}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(['authorization',a6_0x21e70f(0xdd),'cookie','set-cookie',a6_0x21e70f(0xd1),a6_0x21e70f(0x10b),a6_0x21e70f(0xe3),a6_0x21e70f(0x10d)]);function isSensitiveHeader(_0x45a05d){const _0x43d468=a6_0x21e70f;return SENSITIVE_HEADERS[_0x43d468(0xd0)](_0x45a05d[_0x43d468(0xe4)]());}function parseHeader(_0x5cdd15){const _0xefe508=a6_0x21e70f,_0x34409f=_0x5cdd15[_0xefe508(0xfa)](':');if(_0x34409f===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x5cdd15+'\x22.\x20'+_0xefe508(0xfe));const _0x57dbbe=_0x5cdd15[_0xefe508(0x100)](0x0,_0x34409f)[_0xefe508(0xe2)](),_0x5a6948=_0x5cdd15[_0xefe508(0x100)](_0x34409f+0x1)['trim']();if(!_0x57dbbe)throw new Error(_0xefe508(0x10a)+_0x5cdd15+'\x22');return[_0x57dbbe,_0x5a6948];}export class ApiCommand extends BaseCommand{[a6_0x21e70f(0xca)]=a6_0x21e70f(0xde);[a6_0x21e70f(0xf1)]=a6_0x21e70f(0xef);[a6_0x21e70f(0xdb)](_0x100c40){const _0x405f77=a6_0x21e70f,{args:_0xaeab9f,options:_0x304b51}=_0x100c40,_0x8a8417=_0x304b51;if(_0xaeab9f[_0x405f77(0xfb)]===0x0)return _0x405f77(0xd4);const _0x40b44e=_0xaeab9f[0x0];if(!_0x40b44e[_0x405f77(0xfd)]('/'))return _0x405f77(0xf7)+_0x40b44e;const _0x1ca063=_0x8a8417[_0x405f77(0xd9)],_0x3310f7=_0x8a8417[_0x405f77(0xf0)];if(_0x1ca063&&_0x3310f7)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x23c778=_0x8a8417[_0x405f77(0xd7)]||_0x405f77(0xe5),_0x29c5dc=['GET',_0x405f77(0x103),_0x405f77(0xd3),_0x405f77(0xec),_0x405f77(0xd5)];if(!_0x29c5dc['includes'](_0x23c778['toUpperCase']()))return'Invalid\x20HTTP\x20method:\x20'+_0x23c778+_0x405f77(0xea)+_0x29c5dc[_0x405f77(0xcd)](',\x20');const _0x23071a=_0x8a8417[_0x405f77(0x10e)]||'td',_0x49fcd2=['td',_0x405f77(0xdc),_0x405f77(0x109),_0x405f77(0xcc),'llm','llm-proxy'];if(!_0x49fcd2[_0x405f77(0xe9)](_0x23071a))return _0x405f77(0x10f)+_0x23071a+_0x405f77(0x102)+_0x49fcd2[_0x405f77(0xcd)](',\x20');return undefined;}async['execute'](_0x15ba30){const _0x303880=a6_0x21e70f,{options:_0x80c6aa,args:_0x2a4346,tdx:_0x355475}=_0x15ba30,_0x3a4076=_0x80c6aa,_0x5566e6=_0x2a4346[0x0],_0x36e648=(_0x3a4076[_0x303880(0xd7)]||'GET')[_0x303880(0x104)](),_0x30f9c4=_0x3a4076[_0x303880(0xd9)],_0x47f4a6=_0x3a4076[_0x303880(0xf0)],_0x31b3ef=_0x3a4076[_0x303880(0xed)],_0x4d65a1=_0x3a4076[_0x303880(0x10e)]||'td';try{const _0x589d5e={};if(_0x31b3ef){const _0x5cef41=Array[_0x303880(0xeb)](_0x31b3ef)?_0x31b3ef:[_0x31b3ef];for(const _0x174330 of _0x5cef41){const [_0x362cce,_0x2eef1a]=parseHeader(_0x174330);_0x589d5e[_0x362cce]=_0x2eef1a;}}let _0x2488d2;if(_0x30f9c4)_0x2488d2=_0x30f9c4;else{if(_0x47f4a6)try{_0x2488d2=RawAPI['readBodyFromFile'](_0x47f4a6);}catch(_0x47b079){return console[_0x303880(0xda)]('Error:\x20'+(_0x47b079 instanceof Error?_0x47b079[_0x303880(0xcb)]:String(_0x47b079))),0x1;}}const _0x552ac4={'method':_0x36e648,'apiType':_0x4d65a1,'includeHeaders':_0x80c6aa[_0x303880(0xf5)]};_0x2488d2&&(_0x552ac4[_0x303880(0xf6)]=_0x2488d2);Object[_0x303880(0xe8)](_0x589d5e)['length']>0x0&&(_0x552ac4[_0x303880(0xe7)]=_0x589d5e);if(_0x80c6aa[_0x303880(0xf5)]){const _0x1b47c2=resolveSite(_0x80c6aa['site']),_0x3433b8=getEndpoint(_0x1b47c2,_0x4d65a1),_0xf71086=''+_0x3433b8+_0x5566e6;console[_0x303880(0xda)]('>\x20'+_0x36e648+'\x20'+_0xf71086);const _0x3a8bb3=getAuthHeaders(_0x1b47c2),_0x166b33={..._0x3a8bb3,..._0x589d5e};for(const [_0xfe625d,_0x3ae4b8]of Object['entries'](_0x166b33)){!isSensitiveHeader(_0xfe625d)&&console['error']('>\x20'+_0xfe625d+':\x20'+_0x3ae4b8);}_0x2488d2&&console[_0x303880(0xda)]('>'),console[_0x303880(0xda)]('');}const _0x5a6e37=await _0x355475[_0x303880(0xde)][_0x303880(0xdf)](_0x5566e6,_0x552ac4);if(_0x80c6aa[_0x303880(0xf5)]&&_0x5a6e37[_0x303880(0xe7)]){console[_0x303880(0xda)](_0x303880(0xff)+_0x5a6e37[_0x303880(0x106)]);for(const [_0x4ed808,_0x1549d3]of Object[_0x303880(0xf8)](_0x5a6e37[_0x303880(0xe7)])){!isSensitiveHeader(_0x4ed808)&&console['error']('<\x20'+_0x4ed808+':\x20'+_0x1549d3);}console[_0x303880(0xda)]('');}const _0x41322b=Boolean(_0x80c6aa[_0x303880(0x101)]),_0x3ee732={'color':_0x80c6aa[_0x303880(0xf3)],'noColor':_0x80c6aa[_0x303880(0x107)]||_0x41322b&&!_0x80c6aa[_0x303880(0xf3)]},_0x2edcfe=colorizeJSON(_0x5a6e37[_0x303880(0xd9)],_0x3ee732);return _0x80c6aa[_0x303880(0x101)]?(writeFileSync(_0x80c6aa[_0x303880(0x101)],_0x2edcfe),console[_0x303880(0xda)](_0x303880(0xfc)+_0x80c6aa[_0x303880(0x101)])):console[_0x303880(0x10c)](_0x2edcfe),0x0;}catch(_0x34af10){return _0x34af10 instanceof Error?(console['error'](_0x303880(0x105)+_0x34af10[_0x303880(0xcb)]),_0x80c6aa[_0x303880(0xf5)]&&_0x34af10[_0x303880(0xd6)]&&console[_0x303880(0xda)](_0x303880(0xce)+_0x34af10[_0x303880(0xd6)])):console['error'](_0x303880(0x105)+String(_0x34af10)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x76ee0d=a7_0x4167;(function(_0x2d3ce9,_0x30f2a3){const _0x33748c=a7_0x4167,_0x28d31a=_0x2d3ce9();while(!![]){try{const _0x31ba52=-parseInt(_0x33748c(0xc3))/0x1*(parseInt(_0x33748c(0xcf))/0x2)+parseInt(_0x33748c(0xc5))/0x3+-parseInt(_0x33748c(0x8b))/0x4*(parseInt(_0x33748c(0xac))/0x5)+-parseInt(_0x33748c(0xb6))/0x6+-parseInt(_0x33748c(0xc9))/0x7*(-parseInt(_0x33748c(0xc0))/0x8)+parseInt(_0x33748c(0xa5))/0x9*(parseInt(_0x33748c(0x87))/0xa)+parseInt(_0x33748c(0x9f))/0xb*(-parseInt(_0x33748c(0x9a))/0xc);if(_0x31ba52===_0x30f2a3)break;else _0x28d31a['push'](_0x28d31a['shift']());}catch(_0x4ea91b){_0x28d31a['push'](_0x28d31a['shift']());}}}(a7_0x1277,0x40da1));import{BaseCommand,printAuthError}from'./command.js';function a7_0x1277(){const _0x543c93=['Select\x20your\x20Treasure\x20Data\x20site:','40BvHLJI','site','getUserInfo','auth:setup','Setup\x20API\x20key\x20authentication\x20interactively','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','Remove\x20API\x20key\x20from\x20system\x20keychain','us01','red','bold','527334pAOEge','status','✓\x20API\x20key\x20removed\x20from\x20keychain','Enter\x20your\x20TD\x20API\x20key:','last_name','password','trim','You\x20can\x20find\x20your\x20API\x20key\x20at:','tdx:\x20auth\x20clear','tdx:\x20auth\x20setup','18176EnBPGq','\x0aSetup\x20cancelled','\x27\x20registered','724GdhFKg','\x20(profile:\x20','767880HqiFMp','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','auth','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','1589sUjzsI','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','System\x20keychain\x20is\x20not\x20available','✗\x20Validation\x20failed:\x20','log','first_name','2dXiNHg','✓\x20Authentication\x20successful\x0a','\x20for\x20profile:\x20','profile','jobs','190ILUttl','Read\x20credential\x20from\x20','yellow','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','16076cRnMjf','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20--profile\x20','other','apiKey','No\x20credential\x20found','Enter\x20site\x20name:','warn','tdx\x20profile:\x20','\x20\x20tdx','customSite','name','No\x20API\x20key\x20found\x20in\x20keychain','logLevel','Site\x20name\x20cannot\x20be\x20empty','371988xmEaqh','message','✓\x20Profile\x20\x27','auth:clear','description','319EbcptA','test','Setting\x20up\x20authentication\x20for\x20site:\x20','API\x20key\x20cannot\x20be\x20empty','User:\x20','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','243315gUyUjK','error','/app/mp/ak','execute','ERROR','Name:\x20'];a7_0x1277=function(){return _0x543c93;};return a7_0x1277();}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_0x1bb2e2 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a7_0x4167(_0x5007ed,_0x55a35b){_0x5007ed=_0x5007ed-0x87;const _0x127741=a7_0x1277();let _0x4167f9=_0x127741[_0x5007ed];return _0x4167f9;}import{LogLevel}from'../utils/tdx-logger.js';import a7_0x11e408 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x76ee0d(0x96)]=a7_0x76ee0d(0xaf);[a7_0x76ee0d(0x9e)]=a7_0x76ee0d(0xb0);async[a7_0x76ee0d(0xa8)](_0x57e1d4){const _0x5cd636=a7_0x76ee0d,{options:_0x47803f}=_0x57e1d4,_0x45e66c=_0x47803f[_0x5cd636(0xd2)];console[_0x5cd636(0xcd)](a7_0x11e408[_0x5cd636(0xb5)](_0x5cd636(0xbf)));const _0x4cf900=_0x47803f[_0x5cd636(0xad)]||_0x5cd636(0xb3),{choices:_0x3dd22d,initialIndex:_0x1f21fa}=buildSiteChoices(_0x4cf900),_0x578786=_0x45e66c?_0x5cd636(0xb1)+_0x45e66c+'):':_0x5cd636(0xab),_0x29a913=await a7_0x1bb2e2({'type':'select','name':'site','message':_0x578786,'choices':_0x3dd22d,'initial':_0x1f21fa});if(!_0x29a913[_0x5cd636(0xad)])return console['log'](_0x5cd636(0xc1)),0x1;let _0xbddb8a;if(_0x29a913['site']===_0x5cd636(0x8e)){const _0xf62afb=await a7_0x1bb2e2({'type':'text','name':_0x5cd636(0x95),'message':_0x5cd636(0x91),'initial':_0x5cd636(0xb3),'validate':_0x2a680d=>{const _0x2b8f8c=_0x5cd636;if(!_0x2a680d||!_0x2a680d[_0x2b8f8c(0xbc)]())return _0x2b8f8c(0x99);if(!/^[a-z0-9-]+$/[_0x2b8f8c(0xa0)](_0x2a680d[_0x2b8f8c(0xbc)]()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0xf62afb['customSite'])return console[_0x5cd636(0xcd)]('\x0aSetup\x20cancelled'),0x1;_0xbddb8a=_0xf62afb['customSite'];}else _0xbddb8a=_0x29a913[_0x5cd636(0xad)];const _0xd0458c=resolveSite(_0xbddb8a);console[_0x5cd636(0xcd)](_0x5cd636(0xa1)+_0xd0458c),console['log'](_0x5cd636(0xbd)),console[_0x5cd636(0xcd)]('\x20\x20'+getConsoleUrl(_0xd0458c,_0x5cd636(0xa7)));const _0x3ad07b=await a7_0x1bb2e2({'type':_0x5cd636(0xbb),'name':_0x5cd636(0x8f),'message':_0x5cd636(0xb9),'validate':_0xba458e=>{const _0x51bdc7=_0x5cd636;if(!_0xba458e||!_0xba458e[_0x51bdc7(0xbc)]())return _0x51bdc7(0xa2);return!![];}});if(!_0x3ad07b[_0x5cd636(0x8f)])return console[_0x5cd636(0xcd)](_0x5cd636(0xc1)),0x1;const _0x81757a=_0x3ad07b[_0x5cd636(0x8f)];console['log']('Validating\x20API\x20key...');try{const _0xf5441f=TDX['create']({'site':_0xd0458c,'apiKey':_0x81757a[_0x5cd636(0xbc)](),'logLevel':_0x47803f[_0x5cd636(0x98)]??LogLevel[_0x5cd636(0xa9)]}),_0x1ee193=await _0xf5441f[_0x5cd636(0xd3)][_0x5cd636(0xae)]();console[_0x5cd636(0xcd)](_0x5cd636(0xa4)+_0x1ee193['email']+')');const _0x1b5932=await isKeychainAvailable();_0x1b5932?(await saveAPIKeyAsync(_0x81757a[_0x5cd636(0xbc)](),_0xd0458c,_0x45e66c),console[_0x5cd636(0xcd)](_0x5cd636(0xca)+(_0x45e66c?_0x5cd636(0xc4)+_0x45e66c+')':''))):(console[_0x5cd636(0x92)](a7_0x11e408[_0x5cd636(0x89)](_0x5cd636(0xc6))),console[_0x5cd636(0x92)](a7_0x11e408['yellow'](_0x5cd636(0xc8))));if(_0x45e66c){const _0x274740={'site':_0xd0458c};saveProfileToUserConfig(_0x45e66c,_0x274740),console[_0x5cd636(0xcd)](_0x5cd636(0x9c)+_0x45e66c+_0x5cd636(0xc2));}else saveDefaultSiteToUserConfig(_0xd0458c),console[_0x5cd636(0xcd)]('✓\x20Default\x20site\x20set\x20to\x20'+_0xd0458c);const _0x44e44b=_0x45e66c?_0x5cd636(0x8d)+_0x45e66c:'';return console['log'](),console[_0x5cd636(0xcd)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log'](_0x5cd636(0x94)+_0x44e44b+_0x5cd636(0x8c)),console['log']('\x20\x20tdx'+_0x44e44b+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x2bb9f7){if(_0x2bb9f7 instanceof HTTPClientError&&_0x2bb9f7[_0x5cd636(0xb7)]===0x191)return printAuthError(_0x2bb9f7),0x1;return console[_0x5cd636(0xa6)](a7_0x11e408[_0x5cd636(0xb4)]('✗\x20Validation\x20failed:\x20'+(_0x2bb9f7 instanceof Error?_0x2bb9f7[_0x5cd636(0x9b)]:String(_0x2bb9f7)))),console[_0x5cd636(0xa6)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x76ee0d(0x96)]=a7_0x76ee0d(0xc7);[a7_0x76ee0d(0x9e)]=a7_0x76ee0d(0x8a);async[a7_0x76ee0d(0xa8)](_0x4f502d){const _0x618b75=a7_0x76ee0d,{options:_0x54b2f0,tdx:_0x575cec}=_0x4f502d,_0x266def=_0x54b2f0[_0x618b75(0xad)],_0x12daee=_0x54b2f0[_0x618b75(0xd2)],_0x47bd12=_0x12daee?_0x12daee:'N/A';console[_0x618b75(0xcd)](_0x618b75(0x93)+_0x47bd12+'\x20(site:\x20'+_0x266def+')');const _0x1b06e7=await resolveAPIKeyAsync(_0x266def,_0x12daee);if(_0x1b06e7){const {source:_0x585082,isDeprecated:_0x308d90}=_0x1b06e7,_0x5f86e7=_0x618b75(0x88)+_0x585082;console['log'](_0x308d90?a7_0x11e408[_0x618b75(0x89)](_0x5f86e7):_0x5f86e7);}else console[_0x618b75(0xcd)](a7_0x11e408[_0x618b75(0x89)](_0x618b75(0x90)));try{const _0x1e3d01=await _0x575cec[_0x618b75(0xd3)]['getUserInfo']();return console[_0x618b75(0xcd)](a7_0x11e408['green'](_0x618b75(0xd0))),console[_0x618b75(0xcd)](_0x618b75(0xa3)+_0x1e3d01['email']),(_0x1e3d01[_0x618b75(0xce)]||_0x1e3d01['last_name'])&&console['log'](_0x618b75(0xaa)+[_0x1e3d01[_0x618b75(0xce)],_0x1e3d01[_0x618b75(0xba)]]['filter'](Boolean)['join']('\x20')),0x0;}catch(_0x1f51fd){return _0x1f51fd instanceof HTTPClientError&&_0x1f51fd['status']===0x191?printAuthError(_0x1f51fd,!![],_0x12daee):console['error'](a7_0x11e408['red'](_0x618b75(0xcc)+(_0x1f51fd instanceof Error?_0x1f51fd[_0x618b75(0x9b)]:String(_0x1f51fd)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x76ee0d(0x9d);['description']=a7_0x76ee0d(0xb2);async[a7_0x76ee0d(0xa8)](_0x5cb357){const _0x792f34=a7_0x76ee0d,{options:_0x292f53}=_0x5cb357,_0x662d89=_0x292f53[_0x792f34(0xd2)];console[_0x792f34(0xcd)](a7_0x11e408[_0x792f34(0xb5)](_0x792f34(0xbe)));const _0x1b17d0=await isKeychainAvailable();if(!_0x1b17d0)return console['error'](a7_0x11e408[_0x792f34(0xb4)](_0x792f34(0xcb))),0x1;const _0xe309c1=await deleteKeychainAPIKey(_0x662d89);return _0xe309c1?(clearCredentialCache(),console[_0x792f34(0xcd)](_0x792f34(0xb8)+(_0x662d89?_0x792f34(0xc4)+_0x662d89+')':'')),0x0):(console[_0x792f34(0xcd)](_0x792f34(0x97)+(_0x662d89?_0x792f34(0xd1)+_0x662d89:'')),0x1);}}
1
+ const a7_0x3de70e=a7_0x20be;(function(_0x5275ab,_0x45fd9a){const _0x45f509=a7_0x20be,_0x223f87=_0x5275ab();while(!![]){try{const _0x233737=parseInt(_0x45f509(0x7c))/0x1*(parseInt(_0x45f509(0x82))/0x2)+parseInt(_0x45f509(0x6d))/0x3*(-parseInt(_0x45f509(0x79))/0x4)+parseInt(_0x45f509(0x74))/0x5+parseInt(_0x45f509(0xb1))/0x6*(-parseInt(_0x45f509(0x8e))/0x7)+parseInt(_0x45f509(0x9c))/0x8*(parseInt(_0x45f509(0xa6))/0x9)+-parseInt(_0x45f509(0x99))/0xa+parseInt(_0x45f509(0xab))/0xb;if(_0x233737===_0x45fd9a)break;else _0x223f87['push'](_0x223f87['shift']());}catch(_0x3ac8fa){_0x223f87['push'](_0x223f87['shift']());}}}(a7_0x253b,0x78c17));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';function a7_0x253b(){const _0x365787=['No\x20credential\x20found','87kFFCxa','jobs','Site\x20name\x20cannot\x20be\x20empty','\x20(site:\x20','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','first_name','17286WxCnEY','apiKey','filter','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','auth:setup','select','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','text','status','bold','Setup\x20API\x20key\x20authentication\x20interactively','\x20--profile\x20','3907421yUMoeg','description','yellow','profile','site','ERROR','us01','warn','\x0aSetup\x20cancelled','You\x20can\x20find\x20your\x20API\x20key\x20at:','✓\x20Default\x20site\x20set\x20to\x20','9538190kvEWoz','red','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','88PVZflk','customSite','\x20(profile:\x20','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','test','API\x20key\x20cannot\x20be\x20empty','\x20\x20tdx','trim','name','User:\x20','15399ZhncfQ','Read\x20credential\x20from\x20','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','✓\x20API\x20key\x20removed\x20from\x20keychain','getUserInfo','19923453FFAvCO','Remove\x20API\x20key\x20from\x20system\x20keychain','other','create','Enter\x20your\x20TD\x20API\x20key:','execute','6Akcqjo','\x27\x20registered','Enter\x20site\x20name:','Name:\x20','email','✓\x20Authentication\x20successful\x0a','auth','18567LXAiNd','auth:clear','log','error','tdx:\x20auth\x20setup','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','tdx\x20profile:\x20','434375NqUaAT','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','logLevel','green','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','428ZAGsOP','tdx:\x20auth\x20clear'];a7_0x253b=function(){return _0x365787;};return a7_0x253b();}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x18e794 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a7_0x20be(_0x38d2b7,_0x56bbe5){_0x38d2b7=_0x38d2b7-0x67;const _0x253bb=a7_0x253b();let _0x20be02=_0x253bb[_0x38d2b7];return _0x20be02;}import{LogLevel}from'../utils/tdx-logger.js';import a7_0x5e3ec3 from'chalk';export class AuthSetupCommand extends BaseCommand{['name']=a7_0x3de70e(0x86);[a7_0x3de70e(0x8f)]=a7_0x3de70e(0x8c);async[a7_0x3de70e(0xb0)](_0x5eca99){const _0x1f3404=a7_0x3de70e,{options:_0x19e546}=_0x5eca99,_0x2602e=_0x19e546['profile'];console[_0x1f3404(0x6f)](a7_0x5e3ec3[_0x1f3404(0x8b)](_0x1f3404(0x71)));const _0x47c838=_0x19e546[_0x1f3404(0x92)]||'us01',{choices:_0x13ae64,initialIndex:_0x596da5}=buildSiteChoices(_0x47c838),_0x2deb09=_0x2602e?_0x1f3404(0x88)+_0x2602e+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x36cdc0=await a7_0x18e794({'type':_0x1f3404(0x87),'name':_0x1f3404(0x92),'message':_0x2deb09,'choices':_0x13ae64,'initial':_0x596da5});if(!_0x36cdc0[_0x1f3404(0x92)])return console['log'](_0x1f3404(0x96)),0x1;let _0x1b80ac;if(_0x36cdc0['site']===_0x1f3404(0xad)){const _0xc0a390=await a7_0x18e794({'type':_0x1f3404(0x89),'name':'customSite','message':_0x1f3404(0x68),'initial':_0x1f3404(0x94),'validate':_0x247c12=>{const _0x19c113=_0x1f3404;if(!_0x247c12||!_0x247c12[_0x19c113(0xa3)]())return _0x19c113(0x7e);if(!/^[a-z0-9-]+$/[_0x19c113(0xa0)](_0x247c12[_0x19c113(0xa3)]()))return _0x19c113(0x9f);return!![];}});if(!_0xc0a390[_0x1f3404(0x9d)])return console[_0x1f3404(0x6f)](_0x1f3404(0x96)),0x1;_0x1b80ac=_0xc0a390[_0x1f3404(0x9d)];}else _0x1b80ac=_0x36cdc0[_0x1f3404(0x92)];const _0x20f196=resolveSite(_0x1b80ac);console['log']('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x20f196),console[_0x1f3404(0x6f)](_0x1f3404(0x97)),console[_0x1f3404(0x6f)]('\x20\x20'+getConsoleUrl(_0x20f196,'/app/mp/ak'));const _0x3c1483=await a7_0x18e794({'type':'password','name':_0x1f3404(0x83),'message':_0x1f3404(0xaf),'validate':_0x5886ad=>{const _0x2f3598=_0x1f3404;if(!_0x5886ad||!_0x5886ad[_0x2f3598(0xa3)]())return _0x2f3598(0xa1);return!![];}});if(!_0x3c1483[_0x1f3404(0x83)])return console[_0x1f3404(0x6f)](_0x1f3404(0x96)),0x1;const _0x41abd5=_0x3c1483['apiKey'];console[_0x1f3404(0x6f)]('Validating\x20API\x20key...');try{const _0x33ba12=TDX[_0x1f3404(0xae)]({'site':_0x20f196,'apiKey':_0x41abd5[_0x1f3404(0xa3)](),'logLevel':_0x19e546[_0x1f3404(0x76)]??LogLevel[_0x1f3404(0x93)]}),_0x1a23ec=await _0x33ba12[_0x1f3404(0x7d)][_0x1f3404(0xaa)]();console[_0x1f3404(0x6f)](_0x1f3404(0x85)+_0x1a23ec[_0x1f3404(0x6a)]+')');const _0x1a8676=await isKeychainAvailable();_0x1a8676?(await saveAPIKeyAsync(_0x41abd5[_0x1f3404(0xa3)](),_0x20f196,_0x2602e),console[_0x1f3404(0x6f)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x2602e?_0x1f3404(0x9e)+_0x2602e+')':''))):(console[_0x1f3404(0x95)](a7_0x5e3ec3[_0x1f3404(0x90)](_0x1f3404(0x80))),console[_0x1f3404(0x95)](a7_0x5e3ec3[_0x1f3404(0x90)](_0x1f3404(0xa8))));if(_0x2602e){const _0x3c8771={'site':_0x20f196};saveProfileToUserConfig(_0x2602e,_0x3c8771),console[_0x1f3404(0x6f)]('✓\x20Profile\x20\x27'+_0x2602e+_0x1f3404(0x67));}else saveDefaultSiteToUserConfig(_0x20f196),console[_0x1f3404(0x6f)](_0x1f3404(0x98)+_0x20f196);const _0x3194d4=_0x2602e?_0x1f3404(0x8d)+_0x2602e:'';return console[_0x1f3404(0x6f)](),console[_0x1f3404(0x6f)](_0x1f3404(0x72)),console[_0x1f3404(0x6f)]('\x20\x20tdx'+_0x3194d4+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console['log'](_0x1f3404(0xa2)+_0x3194d4+_0x1f3404(0x75)),0x0;}catch(_0x270ceb){if(_0x270ceb instanceof HTTPClientError&&_0x270ceb['status']===0x191)return printAuthError(_0x270ceb),0x1;return console[_0x1f3404(0x70)](a7_0x5e3ec3[_0x1f3404(0x9a)]('✗\x20Validation\x20failed:\x20'+(_0x270ceb instanceof Error?_0x270ceb['message']:String(_0x270ceb)))),console['error'](_0x1f3404(0x9b)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x3de70e(0x6c);[a7_0x3de70e(0x8f)]=a7_0x3de70e(0x78);async['execute'](_0x371c48){const _0x2972ff=a7_0x3de70e,{options:_0xd02b4f,tdx:_0x393abe}=_0x371c48,_0x4bc856=_0xd02b4f[_0x2972ff(0x92)],_0x1c7ba1=_0xd02b4f[_0x2972ff(0x91)],_0x173248=_0x1c7ba1?_0x1c7ba1:'N/A';console[_0x2972ff(0x6f)](_0x2972ff(0x73)+_0x173248+_0x2972ff(0x7f)+_0x4bc856+')');const _0x4127fc=await resolveAPIKeyAsync(_0x4bc856,_0x1c7ba1);if(_0x4127fc){const {source:_0x2d95cd,isDeprecated:_0x1a133f}=_0x4127fc,_0x56aebd=_0x2972ff(0xa7)+_0x2d95cd;console[_0x2972ff(0x6f)](_0x1a133f?a7_0x5e3ec3[_0x2972ff(0x90)](_0x56aebd):_0x56aebd);}else console[_0x2972ff(0x6f)](a7_0x5e3ec3[_0x2972ff(0x90)](_0x2972ff(0x7b)));try{const _0x721764=await _0x393abe['jobs'][_0x2972ff(0xaa)]();return console['log'](a7_0x5e3ec3[_0x2972ff(0x77)](_0x2972ff(0x6b))),console[_0x2972ff(0x6f)](_0x2972ff(0xa5)+_0x721764[_0x2972ff(0x6a)]),(_0x721764[_0x2972ff(0x81)]||_0x721764['last_name'])&&console[_0x2972ff(0x6f)](_0x2972ff(0x69)+[_0x721764['first_name'],_0x721764['last_name']][_0x2972ff(0x84)](Boolean)['join']('\x20')),0x0;}catch(_0x10a009){return _0x10a009 instanceof HTTPClientError&&_0x10a009[_0x2972ff(0x8a)]===0x191?printAuthError(_0x10a009,!![],_0x1c7ba1):console[_0x2972ff(0x70)](a7_0x5e3ec3[_0x2972ff(0x9a)]('✗\x20Validation\x20failed:\x20'+(_0x10a009 instanceof Error?_0x10a009['message']:String(_0x10a009)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x3de70e(0xa4)]=a7_0x3de70e(0x6e);[a7_0x3de70e(0x8f)]=a7_0x3de70e(0xac);async['execute'](_0x152494){const _0x1b5b48=a7_0x3de70e,{options:_0xefc814}=_0x152494,_0x546b31=_0xefc814['profile'];console[_0x1b5b48(0x6f)](a7_0x5e3ec3[_0x1b5b48(0x8b)](_0x1b5b48(0x7a)));const _0x6e394c=await isKeychainAvailable();if(!_0x6e394c)return console['error'](a7_0x5e3ec3[_0x1b5b48(0x9a)]('System\x20keychain\x20is\x20not\x20available')),0x1;const _0x39c529=await deleteKeychainAPIKey(_0x546b31);return _0x39c529?(clearCredentialCache(),console[_0x1b5b48(0x6f)](_0x1b5b48(0xa9)+(_0x546b31?_0x1b5b48(0x9e)+_0x546b31+')':'')),0x0):(console['log']('No\x20API\x20key\x20found\x20in\x20keychain'+(_0x546b31?'\x20for\x20profile:\x20'+_0x546b31:'')),0x1);}}
@@ -1 +1 @@
1
- const a8_0x30ddb5=a8_0x31ba;function a8_0x31ba(_0x1915de,_0x493415){_0x1915de=_0x1915de-0x11e;const _0x4dab37=a8_0x4dab();let _0x31baee=_0x4dab37[_0x1915de];return _0x31baee;}(function(_0x39e32e,_0x5cbe0a){const _0x3709c5=a8_0x31ba,_0x5f3d5e=_0x39e32e();while(!![]){try{const _0x11e6a6=-parseInt(_0x3709c5(0x148))/0x1+-parseInt(_0x3709c5(0x12d))/0x2+parseInt(_0x3709c5(0x123))/0x3+-parseInt(_0x3709c5(0x150))/0x4*(parseInt(_0x3709c5(0x120))/0x5)+-parseInt(_0x3709c5(0x13b))/0x6*(-parseInt(_0x3709c5(0x130))/0x7)+-parseInt(_0x3709c5(0x151))/0x8+-parseInt(_0x3709c5(0x133))/0x9*(-parseInt(_0x3709c5(0x122))/0xa);if(_0x11e6a6===_0x5cbe0a)break;else _0x5f3d5e['push'](_0x5f3d5e['shift']());}catch(_0x4ba900){_0x5f3d5e['push'](_0x5f3d5e['shift']());}}}(a8_0x4dab,0x99a7e));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';function a8_0x4dab(){const _0x4a7060=['llm','agent','error','resolveAgentId','1062318BNBnkC','write','streamChat','args','session\x20context','Using\x20agent\x20from\x20','metadata','getDefaultAgent','16328LgoZxU','3539472lGREqo','data','includes','10cZjnVK','chatId','58490ShiOcg','2235864xrRHOI','new','\x0aStack\x20trace:','handleChatEvent','getAgentId','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','stack','type','llmProject','27210KgEiSH','execute','\x27...','4097793yvuxsx','Resolving\x20agent\x20\x27','Error:\x20','369QMlPpc','404','content','verbose','llmAgent','stdout','chat','validate','12IhCpGQ','code','cause','\x20\x20Cause:\x20','Continuing\x20chat:\x20','log','getOrCreateDefaultAgent','join','claude-4.5-haiku'];a8_0x4dab=function(){return _0x4a7060;};return a8_0x4dab();}import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function handleSDKError(_0x4f296e,_0x270505){const _0x56c9c0=a8_0x31ba;if(_0x4f296e instanceof SDKError)console[_0x56c9c0(0x146)](_0x56c9c0(0x132)+_0x4f296e['message']),_0x270505[_0x56c9c0(0x136)]&&(_0x4f296e[_0x56c9c0(0x13d)]&&console[_0x56c9c0(0x146)](_0x56c9c0(0x13e)+_0x4f296e[_0x56c9c0(0x13d)]),_0x4f296e[_0x56c9c0(0x12a)]&&(console['error'](_0x56c9c0(0x125)),console[_0x56c9c0(0x146)](_0x4f296e[_0x56c9c0(0x12a)])));else throw _0x4f296e;}export class ChatCommand extends BaseCommand{['name']=a8_0x30ddb5(0x139);['description']=a8_0x30ddb5(0x129);[a8_0x30ddb5(0x13a)](_0x397973){const _0x37d8b8=a8_0x30ddb5,_0xd0d4fe=_0x397973[_0x37d8b8(0x14b)]['join']('\x20');if(!_0xd0d4fe)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async[a8_0x30ddb5(0x14a)](_0x2ca5b4,_0x45b5be,_0x196522,_0x917291,_0x105a71){const _0xfafb1b=a8_0x30ddb5;for await(const _0x5dea25 of _0x2ca5b4['llm'][_0xfafb1b(0x139)](_0x45b5be,{'agentId':_0x196522,'chatId':_0x917291})){if(_0x5dea25[_0xfafb1b(0x12b)]===_0xfafb1b(0x14e)){const _0x501ea6=_0x5dea25[_0xfafb1b(0x11e)][_0xfafb1b(0x121)];saveLastChatId(_0x501ea6),_0x105a71&&console[_0xfafb1b(0x146)]('Chat\x20session:\x20'+_0x501ea6);}else _0x5dea25[_0xfafb1b(0x12b)]==='event'&&this[_0xfafb1b(0x126)](_0x5dea25[_0xfafb1b(0x11e)]);}}async[a8_0x30ddb5(0x127)](_0x27b61a,_0xff7804,_0x5c5302,_0x4b9c6b,_0x18860c){const _0x23a6e8=a8_0x30ddb5,_0x4bc0e4=_0xff7804||_0x5c5302;if(_0x4bc0e4){const {projectName:_0x265696,agentName:_0x346341}=parseAgentRef(_0x4bc0e4),_0x2ac8d0=_0x346341||_0x4bc0e4,_0x2ca5a1=_0x346341?_0x265696:_0x4b9c6b;if(!_0x2ca5a1)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x18860c){const _0x401b3c=_0xff7804?'--agent\x20flag':_0x23a6e8(0x14c);console[_0x23a6e8(0x146)](_0x23a6e8(0x14d)+_0x401b3c+':\x20'+_0x2ca5a1+'/'+_0x2ac8d0);}const _0x2618ae=await withSpinner('Resolving\x20project\x20\x27'+_0x2ca5a1+_0x23a6e8(0x12f),()=>_0x27b61a[_0x23a6e8(0x144)]['resolveProjectId'](_0x2ca5a1),{'verbose':_0x18860c}),_0xee21b1=await withSpinner(_0x23a6e8(0x131)+_0x2ac8d0+_0x23a6e8(0x12f),()=>_0x27b61a[_0x23a6e8(0x144)][_0x23a6e8(0x147)](_0x2ac8d0,_0x2618ae[_0x23a6e8(0x11e)]),{'verbose':_0x18860c});return _0xee21b1[_0x23a6e8(0x11e)];}else{const _0x381950=_0x27b61a[_0x23a6e8(0x144)][_0x23a6e8(0x14f)]();if(_0x381950)return _0x18860c&&console[_0x23a6e8(0x146)]('Using\x20cached\x20default\x20agent:\x20'+_0x381950['name']),_0x381950['id'];const _0x1bb1b0=await withSpinner('Getting\x20default\x20agent...',()=>_0x27b61a[_0x23a6e8(0x144)][_0x23a6e8(0x141)](_0x23a6e8(0x143),0x0),{'verbose':_0x18860c});return _0x1bb1b0[_0x23a6e8(0x11e)]['id'];}}async[a8_0x30ddb5(0x12e)](_0x327058){const _0x12270f=a8_0x30ddb5,{options:_0x14f0a4,args:_0x4d211f,tdx:_0x5aaeb1}=_0x327058,_0x59a7ee=_0x4d211f[_0x12270f(0x142)]('\x20'),_0x542ac0=_0x14f0a4,_0x48a10b=_0x542ac0[_0x12270f(0x145)],_0x4c070a=_0x542ac0[_0x12270f(0x137)],_0x13da3f=_0x542ac0[_0x12270f(0x12c)],_0x44bf3c=_0x542ac0[_0x12270f(0x124)];try{let _0x3a783c,_0x476386;!_0x44bf3c&&(_0x476386=loadLastChatId(),_0x476386&&_0x14f0a4[_0x12270f(0x136)]&&console[_0x12270f(0x146)](_0x12270f(0x13f)+_0x476386));(_0x44bf3c||!_0x476386)&&(_0x3a783c=await this['getAgentId'](_0x5aaeb1,_0x48a10b,_0x4c070a,_0x13da3f,_0x14f0a4[_0x12270f(0x136)]));try{await this[_0x12270f(0x14a)](_0x5aaeb1,_0x59a7ee,_0x3a783c,_0x476386,_0x14f0a4[_0x12270f(0x136)]);}catch(_0x3fe93c){const _0x5f5b92=_0x3fe93c instanceof SDKError&&_0x3fe93c[_0x12270f(0x13c)]===ErrorCode['CHAT_NOT_FOUND']||_0x3fe93c instanceof Error&&_0x3fe93c['message'][_0x12270f(0x11f)](_0x12270f(0x134));if(_0x5f5b92)_0x14f0a4[_0x12270f(0x136)]&&console[_0x12270f(0x146)](_0x12270f(0x128)),!_0x3a783c&&(_0x3a783c=await this['getAgentId'](_0x5aaeb1,_0x48a10b,_0x4c070a,_0x13da3f,_0x14f0a4[_0x12270f(0x136)])),await this[_0x12270f(0x14a)](_0x5aaeb1,_0x59a7ee,_0x3a783c,undefined,_0x14f0a4[_0x12270f(0x136)]);else throw _0x3fe93c;}return console[_0x12270f(0x140)](),0x0;}catch(_0x762a39){return console[_0x12270f(0x146)](),handleSDKError(_0x762a39,_0x14f0a4),0x1;}}['handleChatEvent'](_0x2afb70){const _0x122850=a8_0x30ddb5;if('content'in _0x2afb70)process[_0x122850(0x138)][_0x122850(0x149)](_0x2afb70[_0x122850(0x135)]);else'error'in _0x2afb70&&console['error']('\x0aError:\x20'+_0x2afb70['error']);}}
1
+ const a8_0x566a33=a8_0xd620;(function(_0x182e57,_0xa0cc8d){const _0x13f47b=a8_0xd620,_0x46ae8e=_0x182e57();while(!![]){try{const _0x3e4009=-parseInt(_0x13f47b(0xda))/0x1*(parseInt(_0x13f47b(0xef))/0x2)+parseInt(_0x13f47b(0xe6))/0x3+parseInt(_0x13f47b(0x10b))/0x4+-parseInt(_0x13f47b(0xf7))/0x5+-parseInt(_0x13f47b(0xf5))/0x6+parseInt(_0x13f47b(0x109))/0x7*(parseInt(_0x13f47b(0x102))/0x8)+parseInt(_0x13f47b(0xe2))/0x9;if(_0x3e4009===_0xa0cc8d)break;else _0x46ae8e['push'](_0x46ae8e['shift']());}catch(_0x34e68b){_0x46ae8e['push'](_0x46ae8e['shift']());}}}(a8_0x3f0a,0x54a72));import{BaseCommand}from'./command.js';function a8_0xd620(_0x97361d,_0x3e4452){_0x97361d=_0x97361d-0xd7;const _0x3f0ae8=a8_0x3f0a();let _0xd6207b=_0x3f0ae8[_0x97361d];return _0xd6207b;}import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function handleSDKError(_0x8b41f2,_0x53976d){const _0x444359=a8_0xd620;if(_0x8b41f2 instanceof SDKError)console[_0x444359(0xeb)](_0x444359(0x101)+_0x8b41f2[_0x444359(0xf2)]),_0x53976d['verbose']&&(_0x8b41f2[_0x444359(0xee)]&&console[_0x444359(0xeb)](_0x444359(0xe8)+_0x8b41f2[_0x444359(0xee)]),_0x8b41f2[_0x444359(0xf4)]&&(console['error']('\x0aStack\x20trace:'),console[_0x444359(0xeb)](_0x8b41f2['stack'])));else throw _0x8b41f2;}function a8_0x3f0a(){const _0x140716=['Chat\x20session:\x20','404','code','35rFSeIv','agent','2659620BSuOVH','name','getAgentId','\x0aError:\x20','Continuing\x20chat:\x20','args','659409vpInWw','--agent\x20flag','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','llm','stdout','getOrCreateDefaultAgent','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','validate','1594053zOFabx','execute','Using\x20cached\x20default\x20agent:\x20','Using\x20agent\x20from\x20','2076012hdaYTc','\x27...','\x20\x20Cause:\x20','resolveAgentId','getDefaultAgent','error','metadata','handleChatEvent','cause','2sykjvg','log','chatId','message','session\x20context','stack','2694696MbmbVg','write','2561040JSueBJ','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','claude-4.5-haiku','data','verbose','content','includes','llmProject','chat','event','Error:\x20','693512ChpNlg','description','join','streamChat'];a8_0x3f0a=function(){return _0x140716;};return a8_0x3f0a();}export class ChatCommand extends BaseCommand{['name']=a8_0x566a33(0xff);[a8_0x566a33(0x103)]=a8_0x566a33(0xf8);[a8_0x566a33(0xe1)](_0x186f27){const _0x52d550=a8_0x566a33,_0x53d507=_0x186f27[_0x52d550(0xd9)]['join']('\x20');if(!_0x53d507)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async['streamChat'](_0x448a48,_0x2a76fa,_0x821c69,_0x438822,_0x572d83){const _0x47beaf=a8_0x566a33;for await(const _0x4def7b of _0x448a48[_0x47beaf(0xdd)]['chat'](_0x2a76fa,{'agentId':_0x821c69,'chatId':_0x438822})){if(_0x4def7b['type']===_0x47beaf(0xec)){const _0x5b3c0a=_0x4def7b[_0x47beaf(0xfa)][_0x47beaf(0xf1)];saveLastChatId(_0x5b3c0a),_0x572d83&&console['error'](_0x47beaf(0x106)+_0x5b3c0a);}else _0x4def7b['type']===_0x47beaf(0x100)&&this[_0x47beaf(0xed)](_0x4def7b[_0x47beaf(0xfa)]);}}async[a8_0x566a33(0x10d)](_0x840fbd,_0x1694fd,_0x5d5b89,_0x17f6dc,_0x5df2f6){const _0x4fc5bf=a8_0x566a33,_0x109694=_0x1694fd||_0x5d5b89;if(_0x109694){const {projectName:_0x5ddfc4,agentName:_0x3601df}=parseAgentRef(_0x109694),_0x2f558d=_0x3601df||_0x109694,_0x3b11d9=_0x3601df?_0x5ddfc4:_0x17f6dc;if(!_0x3b11d9)throw new Error(_0x4fc5bf(0xdc));if(_0x5df2f6){const _0x480ae8=_0x1694fd?_0x4fc5bf(0xdb):_0x4fc5bf(0xf3);console[_0x4fc5bf(0xeb)](_0x4fc5bf(0xe5)+_0x480ae8+':\x20'+_0x3b11d9+'/'+_0x2f558d);}const _0x355ee3=await withSpinner('Resolving\x20project\x20\x27'+_0x3b11d9+_0x4fc5bf(0xe7),()=>_0x840fbd[_0x4fc5bf(0xdd)]['resolveProjectId'](_0x3b11d9),{'verbose':_0x5df2f6}),_0x4317ae=await withSpinner('Resolving\x20agent\x20\x27'+_0x2f558d+_0x4fc5bf(0xe7),()=>_0x840fbd[_0x4fc5bf(0xdd)][_0x4fc5bf(0xe9)](_0x2f558d,_0x355ee3[_0x4fc5bf(0xfa)]),{'verbose':_0x5df2f6});return _0x4317ae[_0x4fc5bf(0xfa)];}else{const _0x5bff11=_0x840fbd[_0x4fc5bf(0xdd)][_0x4fc5bf(0xea)]();if(_0x5bff11)return _0x5df2f6&&console[_0x4fc5bf(0xeb)](_0x4fc5bf(0xe4)+_0x5bff11[_0x4fc5bf(0x10c)]),_0x5bff11['id'];const _0x378ade=await withSpinner('Getting\x20default\x20agent...',()=>_0x840fbd[_0x4fc5bf(0xdd)][_0x4fc5bf(0xdf)](_0x4fc5bf(0xf9),0x0),{'verbose':_0x5df2f6});return _0x378ade[_0x4fc5bf(0xfa)]['id'];}}async[a8_0x566a33(0xe3)](_0x10a38c){const _0x323135=a8_0x566a33,{options:_0xcad746,args:_0x1b0b5d,tdx:_0x4db90e}=_0x10a38c,_0x86512d=_0x1b0b5d[_0x323135(0x104)]('\x20'),_0x3dbca9=_0xcad746,_0x1afea1=_0x3dbca9[_0x323135(0x10a)],_0x5975f2=_0x3dbca9['llmAgent'],_0x1c96b0=_0x3dbca9[_0x323135(0xfe)],_0x3c4b4c=_0x3dbca9['new'];try{let _0x175f94,_0x4552c6;!_0x3c4b4c&&(_0x4552c6=loadLastChatId(),_0x4552c6&&_0xcad746['verbose']&&console[_0x323135(0xeb)](_0x323135(0xd8)+_0x4552c6));(_0x3c4b4c||!_0x4552c6)&&(_0x175f94=await this[_0x323135(0x10d)](_0x4db90e,_0x1afea1,_0x5975f2,_0x1c96b0,_0xcad746['verbose']));try{await this[_0x323135(0x105)](_0x4db90e,_0x86512d,_0x175f94,_0x4552c6,_0xcad746[_0x323135(0xfb)]);}catch(_0x51b8cf){const _0x301932=_0x51b8cf instanceof SDKError&&_0x51b8cf[_0x323135(0x108)]===ErrorCode['CHAT_NOT_FOUND']||_0x51b8cf instanceof Error&&_0x51b8cf[_0x323135(0xf2)][_0x323135(0xfd)](_0x323135(0x107));if(_0x301932)_0xcad746[_0x323135(0xfb)]&&console[_0x323135(0xeb)](_0x323135(0xe0)),!_0x175f94&&(_0x175f94=await this[_0x323135(0x10d)](_0x4db90e,_0x1afea1,_0x5975f2,_0x1c96b0,_0xcad746[_0x323135(0xfb)])),await this[_0x323135(0x105)](_0x4db90e,_0x86512d,_0x175f94,undefined,_0xcad746[_0x323135(0xfb)]);else throw _0x51b8cf;}return console[_0x323135(0xf0)](),0x0;}catch(_0x5d87a4){return console[_0x323135(0xeb)](),handleSDKError(_0x5d87a4,_0xcad746),0x1;}}[a8_0x566a33(0xed)](_0x4249c7){const _0x593292=a8_0x566a33;if(_0x593292(0xfc)in _0x4249c7)process[_0x593292(0xde)][_0x593292(0xf6)](_0x4249c7['content']);else'error'in _0x4249c7&&console['error'](_0x593292(0xd7)+_0x4249c7[_0x593292(0xeb)]);}}