@treasuredata/tdx 0.16.9 → 0.16.10

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 (198) hide show
  1. package/README.md +3 -2
  2. package/dist/bin.js +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/commands/activations.js +1 -1
  7. package/dist/commands/agent-command.js +1 -1
  8. package/dist/commands/agent-test-command.js +1 -1
  9. package/dist/commands/api-command.js +1 -1
  10. package/dist/commands/auth-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.d.ts.map +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js.map +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-command.js +1 -1
  22. package/dist/commands/job-command.js +1 -1
  23. package/dist/commands/journey-command.js +1 -1
  24. package/dist/commands/journey-validate-command.js +1 -1
  25. package/dist/commands/llm-command.js +1 -1
  26. package/dist/commands/llm-proxy.js +1 -1
  27. package/dist/commands/mcp-command.js +1 -1
  28. package/dist/commands/parent-segment-command.js +1 -1
  29. package/dist/commands/profile-command.js +1 -1
  30. package/dist/commands/profiles-command.js +1 -1
  31. package/dist/commands/query-command.js +1 -1
  32. package/dist/commands/segment-command.js +1 -1
  33. package/dist/commands/segment-create-command.js +1 -1
  34. package/dist/commands/segment-fields-command.js +1 -1
  35. package/dist/commands/segment-pull-command.js +1 -1
  36. package/dist/commands/segment-push-command.js +1 -1
  37. package/dist/commands/segment-update-command.js +1 -1
  38. package/dist/commands/segment-use-command.js +1 -1
  39. package/dist/commands/segment-validate-command.js +1 -1
  40. package/dist/commands/segments.js +1 -1
  41. package/dist/commands/show.js +1 -1
  42. package/dist/commands/status-command.js +1 -1
  43. package/dist/commands/tables.js +1 -1
  44. package/dist/commands/unset-command.js +1 -1
  45. package/dist/commands/use-command.js +1 -1
  46. package/dist/commands/user-command.js +1 -1
  47. package/dist/commands/workflow-command.js +1 -1
  48. package/dist/core/auth.js +1 -1
  49. package/dist/core/command-output.js +1 -1
  50. package/dist/core/config.js +1 -1
  51. package/dist/core/connection-cache.js +1 -1
  52. package/dist/core/constants.js +1 -1
  53. package/dist/core/credential-cache.js +1 -1
  54. package/dist/core/global-context.js +1 -1
  55. package/dist/core/keychain.js +1 -1
  56. package/dist/core/profile.js +1 -1
  57. package/dist/core/project-config.js +1 -1
  58. package/dist/core/session.js +1 -1
  59. package/dist/core/user-cache.js +1 -1
  60. package/dist/core/version.js +1 -1
  61. package/dist/index.js +1 -1
  62. package/dist/mcp/server.js +1 -1
  63. package/dist/mcp/tools/index.js +1 -1
  64. package/dist/mcp/tools/tdx-run.js +1 -1
  65. package/dist/mcp/tools/tdx-search.js +1 -1
  66. package/dist/mcp/utils.js +1 -1
  67. package/dist/proxy/anthropic-adapter.js +1 -1
  68. package/dist/proxy/claude-usage-tracker.d.ts +31 -0
  69. package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
  70. package/dist/proxy/claude-usage-tracker.js +1 -1
  71. package/dist/proxy/claude-usage-tracker.js.map +1 -1
  72. package/dist/proxy/context-signature.js +1 -1
  73. package/dist/proxy/conversation-utils.js +1 -1
  74. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  75. package/dist/proxy/passthrough-server.js +1 -1
  76. package/dist/proxy/passthrough-server.js.map +1 -1
  77. package/dist/proxy/server.js +1 -1
  78. package/dist/proxy/session-cache.js +1 -1
  79. package/dist/proxy/sse-usage-parser.js +1 -1
  80. package/dist/sdk/agent/agent-config.js +1 -1
  81. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  82. package/dist/sdk/agent/agent-yaml.js +1 -1
  83. package/dist/sdk/agent/test/evaluator.js +1 -1
  84. package/dist/sdk/agent/test/executor.js +1 -1
  85. package/dist/sdk/agent/test/index.js +1 -1
  86. package/dist/sdk/agent/test/output.js +1 -1
  87. package/dist/sdk/agent/test/parser.js +1 -1
  88. package/dist/sdk/api.js +1 -1
  89. package/dist/sdk/client/cdp-api-client.js +1 -1
  90. package/dist/sdk/client/endpoints.js +1 -1
  91. package/dist/sdk/client/engage-api-client.js +1 -1
  92. package/dist/sdk/client/http-client.js +1 -1
  93. package/dist/sdk/client/llm-api-client.js +1 -1
  94. package/dist/sdk/client/rate-limiter.js +1 -1
  95. package/dist/sdk/client/td-api-client.js +1 -1
  96. package/dist/sdk/client/trino-api-client.js +1 -1
  97. package/dist/sdk/client/workflow-client.js +1 -1
  98. package/dist/sdk/connection-validator.js +1 -1
  99. package/dist/sdk/connection.js +1 -1
  100. package/dist/sdk/engage.js +1 -1
  101. package/dist/sdk/errors.js +1 -1
  102. package/dist/sdk/index.d.ts +0 -1
  103. package/dist/sdk/index.d.ts.map +1 -1
  104. package/dist/sdk/index.js +1 -1
  105. package/dist/sdk/index.js.map +1 -1
  106. package/dist/sdk/io/index.js +1 -1
  107. package/dist/sdk/io/node-filesystem.js +1 -1
  108. package/dist/sdk/job.js +1 -1
  109. package/dist/sdk/journey.js +1 -1
  110. package/dist/sdk/llm/chat-cache.js +1 -1
  111. package/dist/sdk/llm/index.js +1 -1
  112. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  113. package/dist/sdk/llm/model-aliases.js +1 -1
  114. package/dist/sdk/llm/model-factors.js +1 -1
  115. package/dist/sdk/query/index.js +1 -1
  116. package/dist/sdk/query/sql-parser.js +1 -1
  117. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  118. package/dist/sdk/segment/fields-display.js +1 -1
  119. package/dist/sdk/segment/file-discovery.js +1 -1
  120. package/dist/sdk/segment/journey-utils.js +1 -1
  121. package/dist/sdk/segment/journey-yaml.js +1 -1
  122. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  123. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  124. package/dist/sdk/segment/pull-workflow.js +1 -1
  125. package/dist/sdk/segment/push-workflow.js +1 -1
  126. package/dist/sdk/segment/resolution-context.js +1 -1
  127. package/dist/sdk/segment/segment-path-parser.js +1 -1
  128. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  129. package/dist/sdk/segment/target-resolution.js +1 -1
  130. package/dist/sdk/segment/tdx-config.js +1 -1
  131. package/dist/sdk/segment/validate-files.js +1 -1
  132. package/dist/sdk/segment/yaml-validator.js +1 -1
  133. package/dist/sdk/segment.js +1 -1
  134. package/dist/sdk/types/index.js +1 -1
  135. package/dist/sdk/types/progress.js +1 -1
  136. package/dist/sdk/user.js +1 -1
  137. package/dist/sdk/util/format-detector.js +1 -1
  138. package/dist/sdk/util/formatters.js +1 -1
  139. package/dist/sdk/util/index.js +1 -1
  140. package/dist/sdk/util/tree-formatter.js +1 -1
  141. package/dist/sdk/workflow/clone-workflow.js +1 -1
  142. package/dist/sdk/workflow/index.js +1 -1
  143. package/dist/sdk/workflow/pull-workflow.js +1 -1
  144. package/dist/sdk/workflow/push-workflow.js +1 -1
  145. package/dist/sdk/workflow/tdx-config.js +1 -1
  146. package/dist/sdk/workflow/workflow-utils.js +1 -1
  147. package/dist/test-utils/command-runner.js +1 -1
  148. package/dist/test-utils/factories.js +1 -1
  149. package/dist/test-utils/fixtures.js +1 -1
  150. package/dist/test-utils/http-mock.js +1 -1
  151. package/dist/test-utils/index.js +1 -1
  152. package/dist/utils/async.js +1 -1
  153. package/dist/utils/colors.js +1 -1
  154. package/dist/utils/diff.js +1 -1
  155. package/dist/utils/file-permissions.js +1 -1
  156. package/dist/utils/global-cache.js +1 -1
  157. package/dist/utils/json-loader.js +1 -1
  158. package/dist/utils/local-cache.js +1 -1
  159. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  160. package/dist/utils/logger/formatters/index.js +1 -1
  161. package/dist/utils/logger/handlers/console-handler.js +1 -1
  162. package/dist/utils/logger/handlers/file-handler.js +1 -1
  163. package/dist/utils/logger/handlers/index.js +1 -1
  164. package/dist/utils/logger/handlers/null-handler.js +1 -1
  165. package/dist/utils/logger/index.js +1 -1
  166. package/dist/utils/logger/logger.js +1 -1
  167. package/dist/utils/logger/types.js +1 -1
  168. package/dist/utils/option-validation.js +1 -1
  169. package/dist/utils/port.js +1 -1
  170. package/dist/utils/process.js +1 -1
  171. package/dist/utils/prompt.js +1 -1
  172. package/dist/utils/spinner.js +1 -1
  173. package/dist/utils/sse-parser.js +1 -1
  174. package/dist/utils/string-utils.js +1 -1
  175. package/dist/utils/table-ref-parser.js +1 -1
  176. package/dist/utils/tdx-logger.js +1 -1
  177. package/dist/utils/version-check.js +1 -1
  178. package/package.json +1 -1
  179. package/dist/sdk/claude-agent/claude-agent-client.d.ts +0 -73
  180. package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +0 -1
  181. package/dist/sdk/claude-agent/claude-agent-client.js +0 -1
  182. package/dist/sdk/claude-agent/claude-agent-client.js.map +0 -1
  183. package/dist/sdk/claude-agent/environment.d.ts +0 -59
  184. package/dist/sdk/claude-agent/environment.d.ts.map +0 -1
  185. package/dist/sdk/claude-agent/environment.js +0 -1
  186. package/dist/sdk/claude-agent/environment.js.map +0 -1
  187. package/dist/sdk/claude-agent/index.d.ts +0 -15
  188. package/dist/sdk/claude-agent/index.d.ts.map +0 -1
  189. package/dist/sdk/claude-agent/index.js +0 -1
  190. package/dist/sdk/claude-agent/index.js.map +0 -1
  191. package/dist/sdk/claude-agent/system-prompts.d.ts +0 -22
  192. package/dist/sdk/claude-agent/system-prompts.d.ts.map +0 -1
  193. package/dist/sdk/claude-agent/system-prompts.js +0 -1
  194. package/dist/sdk/claude-agent/system-prompts.js.map +0 -1
  195. package/dist/sdk/claude-agent/types.d.ts +0 -107
  196. package/dist/sdk/claude-agent/types.d.ts.map +0 -1
  197. package/dist/sdk/claude-agent/types.js +0 -1
  198. package/dist/sdk/claude-agent/types.js.map +0 -1
@@ -1 +1 @@
1
- function a3_0x40b6(_0x4b21b6,_0x3ed94b){_0x4b21b6=_0x4b21b6-0x15e;const _0x3c67f0=a3_0x3c67();let _0x40b65b=_0x3c67f0[_0x4b21b6];return _0x40b65b;}const a3_0x48240a=a3_0x40b6;(function(_0xa059f2,_0x33c601){const _0x47de00=a3_0x40b6,_0x43d69e=_0xa059f2();while(!![]){try{const _0x414f82=parseInt(_0x47de00(0x16f))/0x1*(parseInt(_0x47de00(0x16a))/0x2)+-parseInt(_0x47de00(0x174))/0x3*(parseInt(_0x47de00(0x175))/0x4)+-parseInt(_0x47de00(0x163))/0x5*(-parseInt(_0x47de00(0x181))/0x6)+-parseInt(_0x47de00(0x17c))/0x7*(-parseInt(_0x47de00(0x164))/0x8)+-parseInt(_0x47de00(0x171))/0x9+parseInt(_0x47de00(0x16e))/0xa*(parseInt(_0x47de00(0x160))/0xb)+-parseInt(_0x47de00(0x17a))/0xc*(parseInt(_0x47de00(0x17e))/0xd);if(_0x414f82===_0x33c601)break;else _0x43d69e['push'](_0x43d69e['shift']());}catch(_0x4ae913){_0x43d69e['push'](_0x43d69e['shift']());}}}(a3_0x3c67,0x755c1));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_0x3c67(){const _0x13d34f=['data','\x20activation','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','96910vpZcRB','1DDrptk','execute','1500957PgotcH','Parent\x20name:\x20','cause','1423743FzPjrL','4mGNdaX','\x27...','Resolving\x20parent\x20segment\x20\x27','resolveSegmentId','✔\x20Found\x20','84fuKIGu','Resolving\x20child\x20segment\x20\x27','301zjImId','resolveParentId','1743508kXNUKT','Error:\x20Segment\x20name\x20is\x20required','Child\x20name:\x20','42ALvfVJ','segment','\x20\x20Cause:\x20','error','listActivations','site','message','616mZTkym','verbose','description','307590KZgRLu','123688pEDzOq','Error:\x20','Resolved\x20child\x20ID:\x20','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','List\x20activations\x20for\x20a\x20segment','length','845452QKmIre'];a3_0x3c67=function(){return _0x13d34f;};return a3_0x3c67();}export class ActivationsCommand extends BaseCommand{['name']='activations';[a3_0x48240a(0x162)]=a3_0x48240a(0x168);async[a3_0x48240a(0x170)](_0xa0ad15){const _0x4db105=a3_0x48240a,{options:_0x3edcba,args:_0x169d19,tdx:_0x35bf82}=_0xa0ad15;if(_0x169d19[_0x4db105(0x169)]===0x0)return console[_0x4db105(0x184)](_0x4db105(0x17f)),console[_0x4db105(0x184)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x4db41b,childId:_0x1b1fb2}=parseSegmentRef(_0x169d19[0x0]);if(!_0x1b1fb2)return console[_0x4db105(0x184)](_0x4db105(0x167)),console[_0x4db105(0x184)](_0x4db105(0x16d)),0x1;_0x3edcba[_0x4db105(0x161)]&&(console[_0x4db105(0x184)]('Site:\x20'+_0x3edcba[_0x4db105(0x15e)]),console['error'](_0x4db105(0x172)+_0x4db41b),console[_0x4db105(0x184)](_0x4db105(0x180)+_0x1b1fb2));const _0x2470ab=await withSpinner(_0x4db105(0x177)+_0x4db41b+_0x4db105(0x176),()=>_0x35bf82[_0x4db105(0x182)][_0x4db105(0x17d)](_0x4db41b),{'verbose':_0x3edcba['verbose']}),_0x3cac7b=_0x2470ab[_0x4db105(0x16b)];_0x3edcba['verbose']&&console[_0x4db105(0x184)]('Resolved\x20parent\x20ID:\x20'+_0x3cac7b);const _0x3e9a4a=await withSpinner(_0x4db105(0x17b)+_0x1b1fb2+'\x27...',()=>_0x35bf82[_0x4db105(0x182)][_0x4db105(0x178)](_0x3cac7b,_0x1b1fb2),{'verbose':_0x3edcba[_0x4db105(0x161)]}),_0x1a6c53=_0x3e9a4a[_0x4db105(0x16b)];_0x3edcba[_0x4db105(0x161)]&&console[_0x4db105(0x184)](_0x4db105(0x166)+_0x1a6c53);const _0x996511=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x1b1fb2+'\x27...',()=>_0x35bf82[_0x4db105(0x182)][_0x4db105(0x185)](_0x3cac7b,_0x1a6c53),{'verbose':_0x3edcba[_0x4db105(0x161)]}),_0x3bf3fb=_0x996511[_0x4db105(0x16b)];return console[_0x4db105(0x184)](_0x4db105(0x179)+_0x3bf3fb[_0x4db105(0x169)]+_0x4db105(0x16c)+(_0x3bf3fb[_0x4db105(0x169)]!==0x1?'s':'')),await handleSDKOutput(_0x3bf3fb,_0x3edcba),0x0;}catch(_0x370e0e){if(_0x370e0e instanceof SDKError)return console[_0x4db105(0x184)](_0x4db105(0x165)+_0x370e0e[_0x4db105(0x15f)]),_0x370e0e[_0x4db105(0x173)]&&console[_0x4db105(0x184)](_0x4db105(0x183)+_0x370e0e[_0x4db105(0x173)]),0x1;throw _0x370e0e;}}}
1
+ const a3_0x49d936=a3_0x1098;(function(_0x287830,_0x3e60ca){const _0x45be63=a3_0x1098,_0x2e4429=_0x287830();while(!![]){try{const _0x3dbf4f=parseInt(_0x45be63(0x11b))/0x1*(parseInt(_0x45be63(0x108))/0x2)+-parseInt(_0x45be63(0x109))/0x3+-parseInt(_0x45be63(0x101))/0x4*(parseInt(_0x45be63(0x106))/0x5)+parseInt(_0x45be63(0x113))/0x6+-parseInt(_0x45be63(0x11d))/0x7*(parseInt(_0x45be63(0x105))/0x8)+-parseInt(_0x45be63(0x103))/0x9*(-parseInt(_0x45be63(0x10b))/0xa)+-parseInt(_0x45be63(0x111))/0xb;if(_0x3dbf4f===_0x3e60ca)break;else _0x2e4429['push'](_0x2e4429['shift']());}catch(_0x34ce60){_0x2e4429['push'](_0x2e4429['shift']());}}}(a3_0x5c61,0x7d9fd));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a3_0x5c61(){const _0x49989e=['error','3122262WrPCPS','activations','2963466DSaJQw','Resolving\x20child\x20segment\x20\x27','length','Listing\x20activations\x20for\x20segment\x20\x27','Parent\x20name:\x20','Error:\x20Segment\x20name\x20is\x20required','Site:\x20','List\x20activations\x20for\x20a\x20segment','11iCfGHk','name','350uYDzUf','listActivations','cause','\x20\x20Cause:\x20','Resolved\x20parent\x20ID:\x20','resolveSegmentId','verbose','165028UsTFeA','Child\x20name:\x20','4312593QReLHW','data','34096euhOQT','70EMvogN','Resolved\x20child\x20ID:\x20','140218KxrnKG','465570DdBKHL','Resolving\x20parent\x20segment\x20\x27','10BbPWUE','Error:\x20','\x27...','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','segment'];a3_0x5c61=function(){return _0x49989e;};return a3_0x5c61();}import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0x1098(_0x572e76,_0x5e427b){_0x572e76=_0x572e76-0xfe;const _0x5c61b4=a3_0x5c61();let _0x1098fa=_0x5c61b4[_0x572e76];return _0x1098fa;}export class ActivationsCommand extends BaseCommand{[a3_0x49d936(0x11c)]=a3_0x49d936(0x112);['description']=a3_0x49d936(0x11a);async['execute'](_0x4122d4){const _0x3b6743=a3_0x49d936,{options:_0x4cb655,args:_0x185730,tdx:_0x21452e}=_0x4122d4;if(_0x185730[_0x3b6743(0x115)]===0x0)return console[_0x3b6743(0x110)](_0x3b6743(0x118)),console[_0x3b6743(0x110)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x1b2390,childId:_0x9472a9}=parseSegmentRef(_0x185730[0x0]);if(!_0x9472a9)return console['error']('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x3b6743(0x110)](_0x3b6743(0x10e)),0x1;_0x4cb655['verbose']&&(console[_0x3b6743(0x110)](_0x3b6743(0x119)+_0x4cb655['site']),console[_0x3b6743(0x110)](_0x3b6743(0x117)+_0x1b2390),console[_0x3b6743(0x110)](_0x3b6743(0x102)+_0x9472a9));const _0x34190c=await withSpinner(_0x3b6743(0x10a)+_0x1b2390+_0x3b6743(0x10d),()=>_0x21452e[_0x3b6743(0x10f)]['resolveParentId'](_0x1b2390),{'verbose':_0x4cb655[_0x3b6743(0x100)]}),_0x59d248=_0x34190c[_0x3b6743(0x104)];_0x4cb655[_0x3b6743(0x100)]&&console['error'](_0x3b6743(0xfe)+_0x59d248);const _0x4f4891=await withSpinner(_0x3b6743(0x114)+_0x9472a9+_0x3b6743(0x10d),()=>_0x21452e[_0x3b6743(0x10f)][_0x3b6743(0xff)](_0x59d248,_0x9472a9),{'verbose':_0x4cb655[_0x3b6743(0x100)]}),_0x44f289=_0x4f4891[_0x3b6743(0x104)];_0x4cb655[_0x3b6743(0x100)]&&console[_0x3b6743(0x110)](_0x3b6743(0x107)+_0x44f289);const _0x2e6265=await withSpinner(_0x3b6743(0x116)+_0x9472a9+'\x27...',()=>_0x21452e[_0x3b6743(0x10f)][_0x3b6743(0x11e)](_0x59d248,_0x44f289),{'verbose':_0x4cb655[_0x3b6743(0x100)]}),_0x5a631e=_0x2e6265['data'];return console['error']('✔\x20Found\x20'+_0x5a631e[_0x3b6743(0x115)]+'\x20activation'+(_0x5a631e['length']!==0x1?'s':'')),await handleSDKOutput(_0x5a631e,_0x4cb655),0x0;}catch(_0x77d948){if(_0x77d948 instanceof SDKError)return console['error'](_0x3b6743(0x10c)+_0x77d948['message']),_0x77d948[_0x3b6743(0x11f)]&&console[_0x3b6743(0x110)](_0x3b6743(0x120)+_0x77d948['cause']),0x1;throw _0x77d948;}}}
@@ -1 +1 @@
1
- const a4_0x29ee8f=a4_0x1a68;(function(_0x5871b8,_0x294a09){const _0x5689c3=a4_0x1a68,_0x1ca796=_0x5871b8();while(!![]){try{const _0x3160df=-parseInt(_0x5689c3(0x226))/0x1*(parseInt(_0x5689c3(0x21a))/0x2)+parseInt(_0x5689c3(0x1f4))/0x3*(-parseInt(_0x5689c3(0x247))/0x4)+-parseInt(_0x5689c3(0x1bd))/0x5+-parseInt(_0x5689c3(0x213))/0x6*(-parseInt(_0x5689c3(0x1c8))/0x7)+parseInt(_0x5689c3(0x22d))/0x8*(-parseInt(_0x5689c3(0x252))/0x9)+-parseInt(_0x5689c3(0x1b6))/0xa*(-parseInt(_0x5689c3(0x219))/0xb)+parseInt(_0x5689c3(0x22a))/0xc*(parseInt(_0x5689c3(0x235))/0xd);if(_0x3160df===_0x294a09)break;else _0x1ca796['push'](_0x1ca796['shift']());}catch(_0x3dda64){_0x1ca796['push'](_0x1ca796['shift']());}}}(a4_0x54a3,0x58a23));import a4_0x4024b3 from'chalk';import a4_0x136472 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a4_0x1a68(_0x3ba45b,_0x14e1e0){_0x3ba45b=_0x3ba45b-0x1ae;const _0x54a3a9=a4_0x54a3();let _0x1a6824=_0x54a3a9[_0x3ba45b];return _0x1a6824;}import{withSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x4dd26f){const _0x4bca66=a4_0x1a68,_0xe01403=[];if(_0x4dd26f[_0x4bca66(0x1f2)]!==undefined)_0xe01403[_0x4bca66(0x20b)](_0x4dd26f[_0x4bca66(0x1f2)]+_0x4bca66(0x1b0));if(_0x4dd26f[_0x4bca66(0x206)]!==undefined&&_0x4dd26f[_0x4bca66(0x206)]>0x0)_0xe01403[_0x4bca66(0x20b)](a4_0x4024b3['green'](_0x4dd26f['new']+_0x4bca66(0x1ed)));if(_0x4dd26f[_0x4bca66(0x1b4)]!==undefined&&_0x4dd26f[_0x4bca66(0x1b4)]>0x0)_0xe01403[_0x4bca66(0x20b)](a4_0x4024b3[_0x4bca66(0x222)](_0x4dd26f[_0x4bca66(0x1b4)]+_0x4bca66(0x1e9)));if(_0x4dd26f[_0x4bca66(0x249)]!==undefined&&_0x4dd26f[_0x4bca66(0x249)]>0x0)_0xe01403['push'](a4_0x4024b3[_0x4bca66(0x218)](_0x4dd26f['updated']+_0x4bca66(0x1ce)));if(_0x4dd26f[_0x4bca66(0x205)]!==undefined&&_0x4dd26f[_0x4bca66(0x205)]>0x0)_0xe01403[_0x4bca66(0x20b)](a4_0x4024b3['gray'](_0x4dd26f['unchanged']+_0x4bca66(0x246)));if(_0x4dd26f[_0x4bca66(0x1bc)]!==undefined&&_0x4dd26f[_0x4bca66(0x1bc)]>0x0)_0xe01403[_0x4bca66(0x20b)](a4_0x4024b3[_0x4bca66(0x1f9)](_0x4dd26f[_0x4bca66(0x1bc)]+_0x4bca66(0x1f5)));return _0xe01403[_0x4bca66(0x240)](',\x20');}function displayDiffs(_0x5dec1b,_0x4400a5,_0x13169d,_0x3d4cea,_0x51c9f1=[]){const _0x44bec0=a4_0x1a68;for(const _0x26e2c4 of _0x5dec1b){if(_0x26e2c4[_0x44bec0(0x245)]){const _0x4a1e9b=_0x26e2c4[_0x44bec0(0x225)]||_0x26e2c4[_0x44bec0(0x1f0)];console[_0x44bec0(0x1c1)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x4a1e9b+'\x27:'),console[_0x44bec0(0x1c1)]('─'[_0x44bec0(0x1cd)](0x3c)),console['log'](_0x26e2c4['diff']),console['log']('─'[_0x44bec0(0x1cd)](0x3c));}}for(const _0x2c9b40 of _0x4400a5){_0x2c9b40[_0x44bec0(0x245)]&&(console[_0x44bec0(0x1c1)](_0x44bec0(0x1d5)+_0x2c9b40[_0x44bec0(0x1f0)]+'\x27:'),console[_0x44bec0(0x1c1)]('─'['repeat'](0x3c)),console[_0x44bec0(0x1c1)](_0x2c9b40[_0x44bec0(0x245)]),console[_0x44bec0(0x1c1)]('─'[_0x44bec0(0x1cd)](0x3c)));}for(const _0x3c0941 of _0x13169d){_0x3c0941[_0x44bec0(0x245)]&&(console['log']('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x3c0941[_0x44bec0(0x1f0)]+'\x27:'),console[_0x44bec0(0x1c1)]('─'[_0x44bec0(0x1cd)](0x3c)),console['log'](_0x3c0941[_0x44bec0(0x245)]),console['log']('─'[_0x44bec0(0x1cd)](0x3c)));}for(const _0x52fb1b of _0x3d4cea){_0x52fb1b['diff']&&(console[_0x44bec0(0x1c1)](_0x44bec0(0x1af)+_0x52fb1b[_0x44bec0(0x1f0)]+'\x27:'),console[_0x44bec0(0x1c1)]('─'[_0x44bec0(0x1cd)](0x3c)),console[_0x44bec0(0x1c1)](_0x52fb1b[_0x44bec0(0x245)]),console[_0x44bec0(0x1c1)]('─'[_0x44bec0(0x1cd)](0x3c)));}for(const _0x3e8d07 of _0x51c9f1){_0x3e8d07[_0x44bec0(0x245)]&&(console[_0x44bec0(0x1c1)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x3e8d07[_0x44bec0(0x1f0)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x44bec0(0x1c1)](_0x3e8d07['diff']),console[_0x44bec0(0x1c1)]('─'[_0x44bec0(0x1cd)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x29ee8f(0x1f0)]=a4_0x29ee8f(0x1e4);[a4_0x29ee8f(0x1c0)]=a4_0x29ee8f(0x1fe);async[a4_0x29ee8f(0x1f3)](_0x172b30){const _0x1ede79=a4_0x29ee8f,{options:_0x38d1da,args:_0x23a917,tdx:_0x51686c}=_0x172b30,_0x3854aa=_0x23a917[0x0],_0x7f3556=_0x23a917[0x1],_0x3d9182=_0x38d1da[_0x1ede79(0x1e5)],_0x68e919=_0x38d1da['dryRun'],_0x161fbf=_0x38d1da[_0x1ede79(0x23f)],_0x29d0d5=_0x38d1da['yes'],_0x5e9b59=_0x38d1da[_0x1ede79(0x1e2)];let _0x2e342d,_0x4ec271;const _0x2e2d45=findAgentConfigPath(process[_0x1ede79(0x250)]());if(_0x3854aa){const _0x1c5fc4=a4_0x136472[_0x1ede79(0x240)](_0x3854aa,_0x1ede79(0x1d3));if(existsSync(_0x1c5fc4))try{const _0x2a46f7=JSON['parse'](readFileSync(_0x1c5fc4,_0x1ede79(0x215)));_0x2e342d=_0x2a46f7[_0x1ede79(0x1be)],_0x4ec271=_0x3854aa,console[_0x1ede79(0x1c1)](a4_0x4024b3[_0x1ede79(0x1df)](_0x1ede79(0x1cc)+_0x1c5fc4+':\x20'+_0x2e342d));}catch{_0x2e342d=_0x3854aa;}else _0x2e342d=_0x3854aa;}else{if(_0x2e2d45)try{const _0x4c2f87=JSON[_0x1ede79(0x1c4)](readFileSync(_0x2e2d45,_0x1ede79(0x215)));_0x2e342d=_0x4c2f87[_0x1ede79(0x1be)],_0x4ec271=a4_0x136472[_0x1ede79(0x232)](_0x2e2d45),console[_0x1ede79(0x1c1)](a4_0x4024b3[_0x1ede79(0x1df)](_0x1ede79(0x1dc)+_0x2e342d));}catch{_0x2e342d=_0x5e9b59;}else _0x2e342d=_0x5e9b59;}if(!_0x2e342d)return console[_0x1ede79(0x1c1)](a4_0x4024b3[_0x1ede79(0x218)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x1ede79(0x1c1)]('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[_0x1ede79(0x1c1)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x1ede79(0x1c1)](_0x1ede79(0x1de)),console[_0x1ede79(0x1c1)](_0x1ede79(0x22c)),0x1;if(_0x7f3556){const {data:_0x442b85}=await withSpinner(_0x1ede79(0x20d)+_0x7f3556+_0x1ede79(0x209)+_0x2e342d+_0x1ede79(0x23b),()=>_0x51686c[_0x1ede79(0x251)]['pullAgent'](_0x2e342d,_0x7f3556,_0x3d9182,{'dryRun':_0x68e919,'force':_0x161fbf}));if(_0x68e919)return console['log'](a4_0x4024b3[_0x1ede79(0x218)]('Dry\x20run\x20-\x20no\x20files\x20written')),console['log'](_0x1ede79(0x228)+_0x442b85['agentName']),console['log'](_0x1ede79(0x242)+_0x442b85[_0x1ede79(0x23c)]),_0x442b85['diff']&&(console['log'](_0x1ede79(0x237)),console['log']('─'[_0x1ede79(0x1cd)](0x3c)),console[_0x1ede79(0x1c1)](_0x442b85[_0x1ede79(0x245)]),console['log']('─'[_0x1ede79(0x1cd)](0x3c))),0x0;return console[_0x1ede79(0x1c1)](a4_0x4024b3[_0x1ede79(0x222)](_0x1ede79(0x22f))),console[_0x1ede79(0x1c1)](_0x1ede79(0x224)+_0x442b85[_0x1ede79(0x225)]),console[_0x1ede79(0x1c1)](_0x1ede79(0x1c9)+_0x442b85['outputPath']),console['log']('Status:\x20'+(_0x442b85[_0x1ede79(0x227)]?a4_0x4024b3[_0x1ede79(0x222)](_0x1ede79(0x206)):_0x442b85[_0x1ede79(0x22b)]?a4_0x4024b3[_0x1ede79(0x218)](_0x1ede79(0x249)):a4_0x4024b3[_0x1ede79(0x1b9)](_0x1ede79(0x205)))),0x0;}const _0x22ca32=_0x4ec271||_0x3d9182,{data:_0x478309}=await withSpinner(_0x1ede79(0x1b7)+_0x2e342d+_0x1ede79(0x23b),()=>_0x51686c[_0x1ede79(0x251)][_0x1ede79(0x1ff)](_0x2e342d,_0x22ca32,{'dryRun':!![]})),_0x24eb72=_0x478309['counts'][_0x1ede79(0x21b)]['new']+_0x478309[_0x1ede79(0x200)][_0x1ede79(0x1e6)]['new']+_0x478309[_0x1ede79(0x200)]['textKnowledgeBases'][_0x1ede79(0x206)]+_0x478309[_0x1ede79(0x200)]['prompts'][_0x1ede79(0x206)]+_0x478309[_0x1ede79(0x200)][_0x1ede79(0x1e8)][_0x1ede79(0x206)],_0x57534c=_0x478309[_0x1ede79(0x200)]['agents'][_0x1ede79(0x249)]+_0x478309['counts']['knowledgeBases'][_0x1ede79(0x249)]+_0x478309[_0x1ede79(0x200)][_0x1ede79(0x1ae)][_0x1ede79(0x249)]+_0x478309['counts']['prompts'][_0x1ede79(0x249)]+_0x478309['counts'][_0x1ede79(0x1e8)]['updated'],_0x13512a=_0x478309[_0x1ede79(0x200)][_0x1ede79(0x21b)][_0x1ede79(0x205)]+_0x478309['counts'][_0x1ede79(0x1e6)][_0x1ede79(0x205)]+_0x478309['counts'][_0x1ede79(0x1ae)][_0x1ede79(0x205)]+_0x478309[_0x1ede79(0x200)]['prompts']['unchanged']+_0x478309['counts']['integrations'][_0x1ede79(0x205)];console[_0x1ede79(0x1c1)](_0x1ede79(0x243)+_0x478309[_0x1ede79(0x236)]+'\x27:'),console[_0x1ede79(0x1c1)]('\x20\x20'+a4_0x4024b3[_0x1ede79(0x222)]('+\x20'+_0x24eb72+'\x20new')+_0x1ede79(0x1dd)+a4_0x4024b3[_0x1ede79(0x218)]('~\x20'+_0x57534c+'\x20changed')+'\x20|\x20'+a4_0x4024b3['dim']('=\x20'+_0x13512a+_0x1ede79(0x246))),console[_0x1ede79(0x1c1)](_0x1ede79(0x1fd)+formatCountSummary(_0x478309['counts'][_0x1ede79(0x21b)])),console[_0x1ede79(0x1c1)](_0x1ede79(0x21e)+formatCountSummary(_0x478309[_0x1ede79(0x200)][_0x1ede79(0x1e6)])),console[_0x1ede79(0x1c1)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x478309['counts']['textKnowledgeBases'])),console[_0x1ede79(0x1c1)](_0x1ede79(0x1ef)+formatCountSummary(_0x478309[_0x1ede79(0x200)][_0x1ede79(0x24c)])),console[_0x1ede79(0x1c1)](_0x1ede79(0x1ea)+formatCountSummary(_0x478309[_0x1ede79(0x200)][_0x1ede79(0x1e8)])),console[_0x1ede79(0x1c1)]('\x20\x20Target:\x20'+a4_0x4024b3['cyan'](_0x478309['outputDir'])),displayDiffs(_0x478309[_0x1ede79(0x21b)],_0x478309[_0x1ede79(0x1e6)],_0x478309['textKnowledgeBases'],_0x478309[_0x1ede79(0x24c)],_0x478309[_0x1ede79(0x1e8)]);if(_0x68e919)return console[_0x1ede79(0x1c1)](a4_0x4024b3['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x24eb72===0x0&&_0x57534c===0x0)return console[_0x1ede79(0x1c1)](a4_0x4024b3['green'](_0x1ede79(0x231))),saveSessionContext({'llm_project':_0x478309[_0x1ede79(0x236)]},_0x38d1da[_0x1ede79(0x24e)]),console[_0x1ede79(0x1c1)](a4_0x4024b3['green'](_0x1ede79(0x1e7)+a4_0x4024b3[_0x1ede79(0x1df)](_0x1ede79(0x1be))+'\x20=\x20'+a4_0x4024b3[_0x1ede79(0x23d)](_0x478309[_0x1ede79(0x236)]))),0x0;if(!_0x29d0d5&&!_0x161fbf){const _0x29839a=await confirmKey(_0x1ede79(0x203)+(_0x24eb72+_0x57534c)+_0x1ede79(0x24a));if(!_0x29839a)return console[_0x1ede79(0x1c1)](_0x1ede79(0x21f)),0x0;}const {data:_0x480e38}=await withSpinner(_0x1ede79(0x1c3),()=>_0x51686c[_0x1ede79(0x251)][_0x1ede79(0x1ff)](_0x2e342d,_0x22ca32,{'force':_0x161fbf}));return console[_0x1ede79(0x1c1)](a4_0x4024b3[_0x1ede79(0x222)](_0x1ede79(0x212)+(_0x24eb72+_0x57534c)+_0x1ede79(0x1cb)+_0x480e38['outputDir'])),saveSessionContext({'llm_project':_0x480e38[_0x1ede79(0x236)]},_0x38d1da['session']),console[_0x1ede79(0x1c1)](a4_0x4024b3[_0x1ede79(0x222)](_0x1ede79(0x1e7)+a4_0x4024b3['dim'](_0x1ede79(0x1be))+_0x1ede79(0x207)+a4_0x4024b3[_0x1ede79(0x23d)](_0x480e38[_0x1ede79(0x236)]))),0x0;}}function a4_0x54a3(){const _0x55f584=['\x20--name\x20','Source:\x20','\x20new','projectDir','\x20\x20Prompts:\x20','name','source','total','execute','27hcXziC','\x20errors','Using\x20context\x20project:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','newProjectName','red','Using\x20current\x20project:\x20','Pushing\x20agent\x20from\x20\x22','\x20--profile\x20','\x20\x20Agents:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','pullProject','counts','\x20\x20Integration\x20\x22','agentId','\x0aWrite\x20','\x20\x20Knowledge\x20Base\x20\x22','unchanged','new','\x20=\x20','Would\x20clone:','\x22\x20from\x20project\x20\x22','Dry\x20run\x20-\x20no\x20changes\x20made','push','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Pulling\x20agent\x20\x22','Pushing\x20to\x20project...','No\x20tdx.json\x20found\x20in\x20','\x22:\x20','Clone\x20cancelled','\x0a✔\x20Pulled\x20','601212JVZxLi','agent.yml','utf-8','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Summary:','yellow','17413cznEgl','2OeEGxA','agents','Cannot\x20clone\x20from\x20context\x20project\x20\x22','found','\x20\x20Knowledge\x20Bases:\x20','Pull\x20cancelled','<new-name>','\x0aPush\x20summary\x20for\x20\x27','green','profile','Agent:\x20','agentName','172307pQitqs','isNew','Would\x20pull\x20agent:\x20','\x0aErrors\x20found:','24bFSQNF','hasChanges','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','580256UlvEye','\x20\x20tdx\x20agent\x20pull\x20','Agent\x20pulled\x20successfully','Project\x20cloned\x20with\x20errors','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','dirname','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20Text\x20Knowledge\x20Base\x20\x22','1096615CucVjC','projectName','\x0aChanges:','\x22\x20to\x20\x22','\x0aPush\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x22...','outputPath','cyan','no_local_folder','force','join','New\x20project\x20ID:\x20','Output\x20path:\x20','\x0aPull\x20summary\x20for\x20\x27','Failed\x20to\x20push\x20agent:\x20','diff','\x20unchanged','114084YMGiYg','INVALID_ARGUMENT','updated','\x20files?','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','prompts','Chat:\x20','session','New\x20project:\x20','cwd','llm','9xCyPoY','textKnowledgeBases','\x0aChanges\x20to\x20prompt\x20\x27','\x20total','newProjectId','\x20resources\x20to\x20\x27','action','created','\x0aProject\x20pushed\x20with\x20errors','2510oyMvxY','Analyzing\x20project\x20\x22','\x20\x20Agent\x20\x22','gray','\x0a✔\x20Pushed\x20','error','errors','1012410WHvnpq','llm_project','dryRun','description','log','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Writing\x20files...','parse','Cloning\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','Agent\x20','35omxAfz','Output:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20files\x20to\x20','Using\x20project\x20from\x20','repeat','\x20updated','Project:\x20','projectId','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','tdx.json','context','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','MISSING_ARGUMENT','message','site','Using\x20local\x20project:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','Analyzing\x20changes\x20to\x20push...','Using\x20project:\x20','\x20|\x20','\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','dim','sourceProjectName','Errors:','llmProject','Would\x20push\x20agent:\x20','agent:pull','output','knowledgeBases','✔\x20Context\x20set:\x20','integrations','\x20created','\x20\x20Integrations:\x20'];a4_0x54a3=function(){return _0x55f584;};return a4_0x54a3();}export class AgentCloneCommand extends BaseCommand{[a4_0x29ee8f(0x1f0)]='agent:clone';[a4_0x29ee8f(0x1c0)]=a4_0x29ee8f(0x233);async[a4_0x29ee8f(0x1f3)](_0x593327){const _0x33a40a=a4_0x29ee8f,{options:_0x3a66e3,args:_0x264050,tdx:_0x3fe438}=_0x593327,_0x4d3d95=_0x264050[0x0],_0x5f22b2=_0x3a66e3[_0x33a40a(0x1f0)],_0x366614=_0x3a66e3['dryRun'],_0x29e857=_0x3a66e3['yes'],_0x4462d4=_0x3a66e3[_0x33a40a(0x1d8)],_0x149b98=_0x3a66e3[_0x33a40a(0x1e2)];let _0x19adeb;const _0x573b44=findAgentConfigPath(process[_0x33a40a(0x250)]());if(_0x4d3d95){const _0x196bab=a4_0x136472['join'](_0x4d3d95,'tdx.json');existsSync(_0x196bab)?(_0x19adeb=_0x4d3d95,console[_0x33a40a(0x1c1)](a4_0x4024b3[_0x33a40a(0x1df)](_0x33a40a(0x1d9)+_0x4d3d95))):_0x19adeb=_0x4d3d95;}else{if(_0x573b44)_0x19adeb=a4_0x136472[_0x33a40a(0x232)](_0x573b44),console['log'](a4_0x4024b3[_0x33a40a(0x1df)](_0x33a40a(0x1fa)+_0x19adeb));else{if(_0x149b98){const _0x24a836=sanitizeForFilesystem(_0x149b98);let _0x148810=_0x24a836,_0x2fc229=a4_0x136472[_0x33a40a(0x240)](process[_0x33a40a(0x250)](),_0x33a40a(0x21b),_0x24a836,'tdx.json');if(!existsSync(_0x2fc229)){const _0x32eb56=normalizeName(_0x149b98),_0x8cbcbc=a4_0x136472[_0x33a40a(0x240)](process['cwd'](),_0x33a40a(0x21b),_0x32eb56,_0x33a40a(0x1d3));existsSync(_0x8cbcbc)&&(_0x148810=_0x32eb56,_0x2fc229=_0x8cbcbc);}if(existsSync(_0x2fc229))_0x19adeb=a4_0x136472[_0x33a40a(0x232)](_0x2fc229),console['log'](a4_0x4024b3[_0x33a40a(0x1df)](_0x33a40a(0x1d9)+_0x19adeb));else{const _0x4aa511=_0x3a66e3[_0x33a40a(0x223)];if(_0x4aa511)throw new SDKError(ErrorCode[_0x33a40a(0x248)],_0x33a40a(0x21c)+_0x149b98+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x33a40a(0x1ca)+_0x33a40a(0x23a)+(_0x33a40a(0x22e)+_0x149b98+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x148810+_0x33a40a(0x1eb)+(_0x5f22b2||_0x33a40a(0x220))+_0x33a40a(0x1fc)+_0x4aa511)});_0x19adeb=_0x149b98,console[_0x33a40a(0x1c1)](a4_0x4024b3[_0x33a40a(0x1df)](_0x33a40a(0x1f6)+_0x149b98));}}}}if(!_0x19adeb)return console['log'](a4_0x4024b3[_0x33a40a(0x218)](_0x33a40a(0x216))),console[_0x33a40a(0x1c1)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console['log'](_0x33a40a(0x1d2)),console[_0x33a40a(0x1c1)]('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console['log'](_0x33a40a(0x1d1)),0x1;if(!_0x5f22b2)throw new SDKError(ErrorCode[_0x33a40a(0x1d6)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x33a40a(0x1c2)});if(!_0x29e857&&!_0x366614){const _0x2904bc=await confirmKey('Clone\x20\x22'+_0x19adeb+'\x22\x20to\x20new\x20project\x20\x22'+_0x5f22b2+'\x22?');if(!_0x2904bc)return console['log'](_0x33a40a(0x211)),0x0;}const {data:_0x3f85b2}=await withSpinner(_0x33a40a(0x1c5)+_0x19adeb+_0x33a40a(0x238)+_0x5f22b2+_0x33a40a(0x23b),()=>_0x3fe438[_0x33a40a(0x251)]['cloneProject'](_0x19adeb,_0x5f22b2,{'dryRun':_0x366614}));if(_0x366614)return console[_0x33a40a(0x1c1)](a4_0x4024b3[_0x33a40a(0x218)](_0x33a40a(0x20a))),console[_0x33a40a(0x1c1)]('Source:\x20'+_0x3f85b2[_0x33a40a(0x1e0)]),console['log'](_0x33a40a(0x24f)+_0x5f22b2),console[_0x33a40a(0x1c1)](_0x33a40a(0x208)),console[_0x33a40a(0x1c1)](_0x33a40a(0x1fd)+_0x3f85b2[_0x33a40a(0x200)][_0x33a40a(0x21b)]['created']),console['log'](_0x33a40a(0x21e)+_0x3f85b2[_0x33a40a(0x200)][_0x33a40a(0x1e6)][_0x33a40a(0x1b4)]),console[_0x33a40a(0x1c1)]('\x20\x20Prompts:\x20'+_0x3f85b2[_0x33a40a(0x200)][_0x33a40a(0x24c)][_0x33a40a(0x1b4)]),0x0;const _0x44e621=_0x3f85b2[_0x33a40a(0x200)][_0x33a40a(0x21b)]['errors']>0x0||_0x3f85b2['counts'][_0x33a40a(0x1e6)][_0x33a40a(0x1bc)]>0x0||_0x3f85b2['counts'][_0x33a40a(0x24c)][_0x33a40a(0x1bc)]>0x0;_0x44e621?console[_0x33a40a(0x1c1)](a4_0x4024b3[_0x33a40a(0x218)](_0x33a40a(0x230))):console[_0x33a40a(0x1c1)](a4_0x4024b3[_0x33a40a(0x222)]('Project\x20cloned\x20successfully'));console['log'](_0x33a40a(0x1ec)+_0x3f85b2[_0x33a40a(0x1e0)]),console['log'](_0x33a40a(0x24f)+_0x3f85b2[_0x33a40a(0x1f8)]),console[_0x33a40a(0x1c1)](_0x33a40a(0x241)+_0x3f85b2[_0x33a40a(0x1b1)]),console['log'](),console[_0x33a40a(0x1c1)](_0x33a40a(0x217)),console[_0x33a40a(0x1c1)](_0x33a40a(0x1fd)+formatCountSummary(_0x3f85b2[_0x33a40a(0x200)][_0x33a40a(0x21b)])),console[_0x33a40a(0x1c1)](_0x33a40a(0x21e)+formatCountSummary(_0x3f85b2['counts']['knowledgeBases'])),console[_0x33a40a(0x1c1)](_0x33a40a(0x1ef)+formatCountSummary(_0x3f85b2['counts'][_0x33a40a(0x24c)])),console['log'](_0x33a40a(0x1ea)+formatCountSummary(_0x3f85b2[_0x33a40a(0x200)][_0x33a40a(0x1e8)]));if(_0x44e621){console[_0x33a40a(0x1c1)](),console[_0x33a40a(0x1c1)](a4_0x4024b3[_0x33a40a(0x1f9)]('Errors:'));for(const _0x465c61 of _0x3f85b2[_0x33a40a(0x21b)]){_0x465c61[_0x33a40a(0x1b3)]===_0x33a40a(0x1bb)&&console[_0x33a40a(0x1c1)](a4_0x4024b3[_0x33a40a(0x1f9)](_0x33a40a(0x1b8)+_0x465c61[_0x33a40a(0x225)]+'\x22:\x20'+_0x465c61[_0x33a40a(0x1bb)]));}for(const _0x25191e of _0x3f85b2[_0x33a40a(0x1e6)]){_0x25191e['action']===_0x33a40a(0x1bb)&&console['log'](a4_0x4024b3['red'](_0x33a40a(0x204)+_0x25191e[_0x33a40a(0x1f0)]+_0x33a40a(0x210)+_0x25191e[_0x33a40a(0x1bb)]));}for(const _0x521442 of _0x3f85b2[_0x33a40a(0x24c)]){_0x521442[_0x33a40a(0x1b3)]===_0x33a40a(0x1bb)&&console[_0x33a40a(0x1c1)](a4_0x4024b3['red']('\x20\x20Prompt\x20\x22'+_0x521442['name']+_0x33a40a(0x210)+_0x521442[_0x33a40a(0x1bb)]));}for(const _0xe6c08c of _0x3f85b2[_0x33a40a(0x1e8)]){_0xe6c08c['action']==='error'&&console[_0x33a40a(0x1c1)](a4_0x4024b3[_0x33a40a(0x1f9)]('\x20\x20Integration\x20\x22'+_0xe6c08c[_0x33a40a(0x1f0)]+_0x33a40a(0x210)+_0xe6c08c[_0x33a40a(0x1bb)]));}return 0x1;}console[_0x33a40a(0x1c1)]();const _0x142fa1=getLLMProjectUrl(_0x4462d4,_0x3f85b2['newProjectId']);return console[_0x33a40a(0x1c1)](_0x33a40a(0x1cf)+a4_0x4024b3[_0x33a40a(0x23d)](_0x142fa1)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x29ee8f(0x1f0)]='agent:push';[a4_0x29ee8f(0x1c0)]=a4_0x29ee8f(0x20c);async[a4_0x29ee8f(0x1f3)](_0x115793){const _0x1c6c75=a4_0x29ee8f,{options:_0x2117e6,args:_0x45f740,tdx:_0x287c40}=_0x115793;let _0x6a51c=_0x45f740[0x0]||process[_0x1c6c75(0x250)]();const _0x1e9154=_0x2117e6[_0x1c6c75(0x1bf)],_0x195715=_0x2117e6[_0x1c6c75(0x23f)],_0x2f7c73=_0x2117e6['yes'],_0x26f209=_0x2117e6[_0x1c6c75(0x1d8)],_0x1584d2=a4_0x136472[_0x1c6c75(0x240)](_0x6a51c,_0x1c6c75(0x214)),_0x57fc4c=existsSync(_0x1584d2);if(_0x57fc4c){const {data:_0x3d8d69}=await withSpinner(_0x1c6c75(0x1fb)+_0x6a51c+_0x1c6c75(0x23b),()=>_0x287c40[_0x1c6c75(0x251)]['pushAgent'](_0x6a51c,{'dryRun':_0x1e9154,'force':_0x195715}));if(_0x1e9154)return console[_0x1c6c75(0x1c1)](a4_0x4024b3[_0x1c6c75(0x218)](_0x1c6c75(0x20a))),console[_0x1c6c75(0x1c1)](_0x1c6c75(0x1e3)+_0x3d8d69[_0x1c6c75(0x225)]),0x0;if(_0x3d8d69[_0x1c6c75(0x1b3)]==='error')return console['log'](a4_0x4024b3[_0x1c6c75(0x1f9)](_0x1c6c75(0x244)+_0x3d8d69[_0x1c6c75(0x1bb)])),0x1;console['log'](a4_0x4024b3[_0x1c6c75(0x222)](_0x1c6c75(0x1c7)+_0x3d8d69[_0x1c6c75(0x1b3)]+'\x20successfully')),console[_0x1c6c75(0x1c1)]('Agent:\x20'+_0x3d8d69['agentName']);if(_0x3d8d69[_0x1c6c75(0x202)]&&_0x3d8d69[_0x1c6c75(0x1d0)]){const _0x4ce98b=getLLMAgentChatUrl(_0x26f209,_0x3d8d69[_0x1c6c75(0x1d0)],_0x3d8d69[_0x1c6c75(0x202)]);console[_0x1c6c75(0x1c1)](_0x1c6c75(0x24d)+a4_0x4024b3['cyan'](_0x4ce98b));}return 0x0;}const _0x459555=_0x2117e6[_0x1c6c75(0x1e2)],_0x25356d=resolveProjectFromContext(_0x6a51c,_0x459555);if(_0x25356d[_0x1c6c75(0x21d)])_0x6a51c=_0x25356d[_0x1c6c75(0x1ee)],_0x25356d[_0x1c6c75(0x1f1)]===_0x1c6c75(0x1d4)&&console[_0x1c6c75(0x1c1)](a4_0x4024b3[_0x1c6c75(0x1df)]('Using\x20project:\x20'+_0x6a51c));else{let _0x253be0='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x25356d['reason']===_0x1c6c75(0x23e)&&(_0x253be0=_0x25356d[_0x1c6c75(0x1d7)]+_0x1c6c75(0x24b)+_0x25356d[_0x1c6c75(0x1e2)]+_0x1c6c75(0x1da));throw new SDKError(ErrorCode[_0x1c6c75(0x248)],_0x25356d['reason']==='no_context'?_0x25356d[_0x1c6c75(0x1d7)]:_0x1c6c75(0x20f)+_0x6a51c,undefined,{'helpText':_0x253be0});}const {data:_0x182c5a}=await withSpinner(_0x1c6c75(0x1db),()=>_0x287c40[_0x1c6c75(0x251)]['pushProject'](_0x6a51c,{'dryRun':!![]})),_0x37789d=_0x182c5a[_0x1c6c75(0x200)][_0x1c6c75(0x21b)][_0x1c6c75(0x1bc)]>0x0;if(_0x37789d){console[_0x1c6c75(0x1c1)](a4_0x4024b3['red'](_0x1c6c75(0x229)));for(const _0x2ac22f of _0x182c5a[_0x1c6c75(0x21b)]){_0x2ac22f[_0x1c6c75(0x1b3)]===_0x1c6c75(0x1bb)&&console['log'](a4_0x4024b3[_0x1c6c75(0x1f9)](_0x1c6c75(0x1b8)+_0x2ac22f[_0x1c6c75(0x225)]+'\x22:\x20'+_0x2ac22f[_0x1c6c75(0x1bb)]));}return 0x1;}const _0x58d4c8=_0x182c5a[_0x1c6c75(0x200)][_0x1c6c75(0x21b)][_0x1c6c75(0x1b4)]+_0x182c5a['counts'][_0x1c6c75(0x1e6)][_0x1c6c75(0x1b4)]+_0x182c5a[_0x1c6c75(0x200)]['textKnowledgeBases']['created']+_0x182c5a[_0x1c6c75(0x200)][_0x1c6c75(0x24c)][_0x1c6c75(0x1b4)]+_0x182c5a['counts'][_0x1c6c75(0x1e8)][_0x1c6c75(0x1b4)],_0x1551df=_0x182c5a[_0x1c6c75(0x200)][_0x1c6c75(0x21b)]['updated']+_0x182c5a['counts'][_0x1c6c75(0x1e6)][_0x1c6c75(0x249)]+_0x182c5a[_0x1c6c75(0x200)][_0x1c6c75(0x1ae)][_0x1c6c75(0x249)]+_0x182c5a['counts'][_0x1c6c75(0x24c)][_0x1c6c75(0x249)]+_0x182c5a[_0x1c6c75(0x200)][_0x1c6c75(0x1e8)][_0x1c6c75(0x249)],_0x3d3d16=_0x182c5a[_0x1c6c75(0x200)]['agents'][_0x1c6c75(0x205)]+_0x182c5a[_0x1c6c75(0x200)]['knowledgeBases'][_0x1c6c75(0x205)]+_0x182c5a['counts'][_0x1c6c75(0x1ae)][_0x1c6c75(0x205)]+_0x182c5a[_0x1c6c75(0x200)][_0x1c6c75(0x24c)]['unchanged']+_0x182c5a[_0x1c6c75(0x200)][_0x1c6c75(0x1e8)][_0x1c6c75(0x205)];console['log'](_0x1c6c75(0x221)+_0x182c5a['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x4024b3['green']('+\x20'+_0x58d4c8+'\x20new')+'\x20|\x20'+a4_0x4024b3[_0x1c6c75(0x218)]('~\x20'+_0x1551df+'\x20changed')+_0x1c6c75(0x1dd)+a4_0x4024b3[_0x1c6c75(0x1df)]('=\x20'+_0x3d3d16+_0x1c6c75(0x246))),console[_0x1c6c75(0x1c1)](_0x1c6c75(0x1fd)+formatCountSummary(_0x182c5a[_0x1c6c75(0x200)][_0x1c6c75(0x21b)])),console['log'](_0x1c6c75(0x21e)+formatCountSummary(_0x182c5a[_0x1c6c75(0x200)][_0x1c6c75(0x1e6)])),console[_0x1c6c75(0x1c1)](_0x1c6c75(0x1c6)+formatCountSummary(_0x182c5a[_0x1c6c75(0x200)][_0x1c6c75(0x1ae)])),console[_0x1c6c75(0x1c1)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x182c5a[_0x1c6c75(0x200)][_0x1c6c75(0x24c)])),console[_0x1c6c75(0x1c1)](_0x1c6c75(0x1ea)+formatCountSummary(_0x182c5a['counts'][_0x1c6c75(0x1e8)])),console[_0x1c6c75(0x1c1)]('\x20\x20Source:\x20'+a4_0x4024b3['cyan'](_0x6a51c)),displayDiffs(_0x182c5a['agents'],_0x182c5a[_0x1c6c75(0x1e6)],_0x182c5a['textKnowledgeBases'],_0x182c5a[_0x1c6c75(0x24c)],_0x182c5a[_0x1c6c75(0x1e8)]);if(_0x1e9154)return console[_0x1c6c75(0x1c1)](a4_0x4024b3[_0x1c6c75(0x218)](_0x1c6c75(0x1f7))),0x0;if(_0x58d4c8===0x0&&_0x1551df===0x0){console['log'](a4_0x4024b3[_0x1c6c75(0x222)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x3d371f=getLLMProjectUrl(_0x26f209,_0x182c5a['projectId']);return console[_0x1c6c75(0x1c1)](_0x1c6c75(0x1cf)+a4_0x4024b3['cyan'](_0x3d371f)),0x0;}if(!_0x2f7c73&&!_0x195715){const _0x51af91=await confirmKey(_0x1c6c75(0x239)+(_0x58d4c8+_0x1551df)+'\x20resources?');if(!_0x51af91)return console[_0x1c6c75(0x1c1)]('Push\x20cancelled'),0x0;}const {data:_0x523448}=await withSpinner(_0x1c6c75(0x20e),()=>_0x287c40[_0x1c6c75(0x251)]['pushProject'](_0x6a51c,{'force':_0x195715})),_0x5dea50=_0x523448[_0x1c6c75(0x200)][_0x1c6c75(0x21b)][_0x1c6c75(0x1bc)]>0x0||_0x523448['counts']['knowledgeBases']['errors']>0x0||_0x523448[_0x1c6c75(0x200)][_0x1c6c75(0x1ae)][_0x1c6c75(0x1bc)]>0x0||_0x523448['counts'][_0x1c6c75(0x24c)]['errors']>0x0;if(_0x5dea50){console['log'](a4_0x4024b3['yellow'](_0x1c6c75(0x1b5))),console['log'](),console[_0x1c6c75(0x1c1)](a4_0x4024b3[_0x1c6c75(0x1f9)](_0x1c6c75(0x1e1)));for(const _0xed3497 of _0x523448[_0x1c6c75(0x21b)]){_0xed3497[_0x1c6c75(0x1b3)]===_0x1c6c75(0x1bb)&&console[_0x1c6c75(0x1c1)](a4_0x4024b3[_0x1c6c75(0x1f9)](_0x1c6c75(0x1b8)+_0xed3497[_0x1c6c75(0x225)]+_0x1c6c75(0x210)+_0xed3497[_0x1c6c75(0x1bb)]));}for(const _0x4390fd of _0x523448[_0x1c6c75(0x1e6)]){_0x4390fd[_0x1c6c75(0x1b3)]==='error'&&console[_0x1c6c75(0x1c1)](a4_0x4024b3['red'](_0x1c6c75(0x204)+_0x4390fd[_0x1c6c75(0x1f0)]+_0x1c6c75(0x210)+_0x4390fd[_0x1c6c75(0x1bb)]));}for(const _0x1c00d5 of _0x523448['textKnowledgeBases']){_0x1c00d5[_0x1c6c75(0x1b3)]===_0x1c6c75(0x1bb)&&console[_0x1c6c75(0x1c1)](a4_0x4024b3['red'](_0x1c6c75(0x234)+_0x1c00d5[_0x1c6c75(0x1f0)]+_0x1c6c75(0x210)+_0x1c00d5[_0x1c6c75(0x1bb)]));}for(const _0x58f6b4 of _0x523448[_0x1c6c75(0x24c)]){_0x58f6b4['action']===_0x1c6c75(0x1bb)&&console[_0x1c6c75(0x1c1)](a4_0x4024b3['red']('\x20\x20Prompt\x20\x22'+_0x58f6b4[_0x1c6c75(0x1f0)]+_0x1c6c75(0x210)+_0x58f6b4['error']));}for(const _0x574626 of _0x523448[_0x1c6c75(0x1e8)]){_0x574626[_0x1c6c75(0x1b3)]==='error'&&console['log'](a4_0x4024b3[_0x1c6c75(0x1f9)](_0x1c6c75(0x201)+_0x574626['name']+'\x22:\x20'+_0x574626[_0x1c6c75(0x1bb)]));}return 0x1;}console[_0x1c6c75(0x1c1)](a4_0x4024b3['green'](_0x1c6c75(0x1ba)+(_0x58d4c8+_0x1551df)+_0x1c6c75(0x1b2)+_0x523448[_0x1c6c75(0x236)]+'\x27'));const _0xc5d53a=getLLMProjectUrl(_0x26f209,_0x523448[_0x1c6c75(0x1d0)]);return console[_0x1c6c75(0x1c1)](_0x1c6c75(0x1cf)+a4_0x4024b3[_0x1c6c75(0x23d)](_0xc5d53a)),0x0;}}
1
+ const a4_0x174a45=a4_0x30cc;(function(_0x5a7728,_0x3609f6){const _0x3666ce=a4_0x30cc,_0x163142=_0x5a7728();while(!![]){try{const _0x540db6=parseInt(_0x3666ce(0x1fb))/0x1*(-parseInt(_0x3666ce(0x1f7))/0x2)+parseInt(_0x3666ce(0x257))/0x3+parseInt(_0x3666ce(0x231))/0x4*(parseInt(_0x3666ce(0x239))/0x5)+-parseInt(_0x3666ce(0x248))/0x6+parseInt(_0x3666ce(0x22f))/0x7+parseInt(_0x3666ce(0x267))/0x8*(parseInt(_0x3666ce(0x23d))/0x9)+-parseInt(_0x3666ce(0x206))/0xa;if(_0x540db6===_0x3609f6)break;else _0x163142['push'](_0x163142['shift']());}catch(_0x5b9dcd){_0x163142['push'](_0x163142['shift']());}}}(a4_0x2c6c,0x69a74));function a4_0x2c6c(){const _0x38e6d8=['MISSING_ARGUMENT','description','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','diff','\x0aChanges\x20to\x20prompt\x20\x27','\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\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','errors','\x22\x20from\x20project\x20\x22','log','INVALID_ARGUMENT','integrations','llm','\x22\x20to\x20a\x20different\x20profile','New\x20project\x20name\x20is\x20required','Summary:','name','\x20files?','\x0a✔\x20Pushed\x20','Using\x20current\x20project:\x20','Project:\x20','\x20\x20Integration\x20\x22','updated','Using\x20project\x20from\x20','Output:\x20','site','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x0aErrors\x20found:','5439826qHirhn','green','96GjArMM','Push\x20cancelled','join','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','found','new','Failed\x20to\x20push\x20agent:\x20','\x20errors','176340IUwAiW','unchanged','\x20changed','\x22:\x20','9pzqZyX','Agent\x20pulled\x20successfully','agent:clone','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x20\x20Agent\x20\x22','repeat','reason','execute','yellow','\x20\x20Integrations:\x20','Source:\x20','3223710shpjuz','Cannot\x20clone\x20from\x20context\x20project\x20\x22','created','agent.yml','Pushing\x20agent\x20from\x20\x22','newProjectId','\x20\x20Prompt\x20\x22','Cloning\x20\x22','\x20\x20Agents:\x20','isNew','action','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x22\x20to\x20\x22','\x20\x20tdx\x20agent\x20pull\x20','agents','1797063NzyfKt','projectName','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x0a✔\x20Pulled\x20','<new-name>','Writing\x20files...','\x20\x20Knowledge\x20Base\x20\x22','Analyzing\x20project\x20\x22','\x20resources\x20to\x20\x27','Pull\x20cancelled','\x0aChanges:','cwd','Would\x20push\x20agent:\x20','\x0aChanges\x20to\x20agent\x20\x27','projectId','Agent:\x20','5731472KiMcLW','textKnowledgeBases','error','\x20|\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','llmProject','no_context','\x20\x20Source:\x20','\x20updated','\x0aPush\x20summary\x20for\x20\x27','\x20--profile\x20','output','outputDir','\x22...','Errors:','Using\x20local\x20project:\x20','counts','force','\x20=\x20','agentId','message','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20resources?','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','agent:push','\x20total','push','cyan','red','Dry\x20run\x20-\x20no\x20files\x20written','pullProject','yes','\x0aPush\x20','gray','\x20\x20Prompts:\x20','✔\x20Context\x20set:\x20','total','parse','dim','New\x20project:\x20','\x20\x20Target:\x20','\x20successfully','agent:pull','source','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','agentName','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','no_local_folder','prompts','dirname','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20unchanged','outputPath','28IMfilI','pushAgent','Using\x20context\x20project:\x20','\x0aProject\x20pushed\x20with\x20errors','27545sWxtRz','session','\x22\x20to\x20new\x20project\x20\x22','sourceProjectName','New\x20project\x20ID:\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20\x20Knowledge\x20Bases:\x20','knowledgeBases','newProjectName','utf-8','15833340ldpIKr','cloneProject','pushProject','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Dry\x20run\x20-\x20no\x20changes\x20made','pullAgent','\x20\x20Text\x20Knowledge\x20Base\x20\x22','tdx.json','dryRun','llm_project','profile','\x20new','\x0aChanges\x20to\x20integration\x20\x27'];a4_0x2c6c=function(){return _0x38e6d8;};return a4_0x2c6c();}import a4_0x2f31ca from'chalk';import a4_0x31f4d8 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a4_0x30cc(_0x397641,_0xa81538){_0x397641=_0x397641-0x1d8;const _0x2c6c64=a4_0x2c6c();let _0x30ccf2=_0x2c6c64[_0x397641];return _0x30ccf2;}import{withSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x10131e){const _0x3af30b=a4_0x30cc,_0x1279f6=[];if(_0x10131e['total']!==undefined)_0x1279f6[_0x3af30b(0x1dc)](_0x10131e[_0x3af30b(0x1e6)]+_0x3af30b(0x1db));if(_0x10131e[_0x3af30b(0x236)]!==undefined&&_0x10131e[_0x3af30b(0x236)]>0x0)_0x1279f6[_0x3af30b(0x1dc)](a4_0x2f31ca[_0x3af30b(0x230)](_0x10131e[_0x3af30b(0x236)]+'\x20new'));if(_0x10131e[_0x3af30b(0x24a)]!==undefined&&_0x10131e[_0x3af30b(0x24a)]>0x0)_0x1279f6[_0x3af30b(0x1dc)](a4_0x2f31ca[_0x3af30b(0x230)](_0x10131e[_0x3af30b(0x24a)]+'\x20created'));if(_0x10131e[_0x3af30b(0x229)]!==undefined&&_0x10131e['updated']>0x0)_0x1279f6['push'](a4_0x2f31ca[_0x3af30b(0x245)](_0x10131e['updated']+_0x3af30b(0x270)));if(_0x10131e[_0x3af30b(0x23a)]!==undefined&&_0x10131e[_0x3af30b(0x23a)]>0x0)_0x1279f6[_0x3af30b(0x1dc)](a4_0x2f31ca[_0x3af30b(0x1e3)](_0x10131e[_0x3af30b(0x23a)]+_0x3af30b(0x1f5)));if(_0x10131e[_0x3af30b(0x21a)]!==undefined&&_0x10131e[_0x3af30b(0x21a)]>0x0)_0x1279f6[_0x3af30b(0x1dc)](a4_0x2f31ca[_0x3af30b(0x1de)](_0x10131e[_0x3af30b(0x21a)]+_0x3af30b(0x238)));return _0x1279f6[_0x3af30b(0x233)](',\x20');}function displayDiffs(_0x31cb5e,_0x419fcf,_0x2d58b8,_0x3c4864,_0x3cb122=[]){const _0x47278c=a4_0x30cc;for(const _0x12f1dd of _0x31cb5e){if(_0x12f1dd[_0x47278c(0x216)]){const _0x5e6e79=_0x12f1dd[_0x47278c(0x1ef)]||_0x12f1dd[_0x47278c(0x223)];console[_0x47278c(0x21c)](_0x47278c(0x264)+_0x5e6e79+'\x27:'),console[_0x47278c(0x21c)]('─'[_0x47278c(0x242)](0x3c)),console['log'](_0x12f1dd[_0x47278c(0x216)]),console[_0x47278c(0x21c)]('─'['repeat'](0x3c));}}for(const _0x490479 of _0x419fcf){_0x490479[_0x47278c(0x216)]&&(console[_0x47278c(0x21c)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x490479[_0x47278c(0x223)]+'\x27:'),console[_0x47278c(0x21c)]('─'[_0x47278c(0x242)](0x3c)),console[_0x47278c(0x21c)](_0x490479[_0x47278c(0x216)]),console[_0x47278c(0x21c)]('─'[_0x47278c(0x242)](0x3c)));}for(const _0x31a76f of _0x2d58b8){_0x31a76f[_0x47278c(0x216)]&&(console[_0x47278c(0x21c)](_0x47278c(0x26b)+_0x31a76f['name']+'\x27:'),console[_0x47278c(0x21c)]('─'['repeat'](0x3c)),console[_0x47278c(0x21c)](_0x31a76f['diff']),console[_0x47278c(0x21c)]('─'[_0x47278c(0x242)](0x3c)));}for(const _0x33e543 of _0x3c4864){_0x33e543[_0x47278c(0x216)]&&(console['log'](_0x47278c(0x217)+_0x33e543[_0x47278c(0x223)]+'\x27:'),console[_0x47278c(0x21c)]('─'['repeat'](0x3c)),console[_0x47278c(0x21c)](_0x33e543['diff']),console[_0x47278c(0x21c)]('─'[_0x47278c(0x242)](0x3c)));}for(const _0x3775be of _0x3cb122){_0x3775be[_0x47278c(0x216)]&&(console[_0x47278c(0x21c)](_0x47278c(0x212)+_0x3775be[_0x47278c(0x223)]+'\x27:'),console[_0x47278c(0x21c)]('─'['repeat'](0x3c)),console[_0x47278c(0x21c)](_0x3775be[_0x47278c(0x216)]),console[_0x47278c(0x21c)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x174a45(0x1ec);[a4_0x174a45(0x214)]=a4_0x174a45(0x259);async[a4_0x174a45(0x244)](_0x1ccc45){const _0x569141=a4_0x174a45,{options:_0xb1fcca,args:_0x2b871b,tdx:_0x18ee53}=_0x1ccc45,_0x413a97=_0x2b871b[0x0],_0x465a34=_0x2b871b[0x1],_0x3104e8=_0xb1fcca[_0x569141(0x273)],_0x5d6ab1=_0xb1fcca[_0x569141(0x20e)],_0x5ae357=_0xb1fcca[_0x569141(0x279)],_0x55976c=_0xb1fcca[_0x569141(0x1e1)],_0x3d21fc=_0xb1fcca[_0x569141(0x26d)];let _0x1fe93c,_0xadbb87;const _0xee75c7=findAgentConfigPath(process[_0x569141(0x262)]());if(_0x413a97){const _0x534d43=a4_0x31f4d8['join'](_0x413a97,_0x569141(0x20d));if(existsSync(_0x534d43))try{const _0xa895df=JSON[_0x569141(0x1e7)](readFileSync(_0x534d43,_0x569141(0x205)));_0x1fe93c=_0xa895df[_0x569141(0x20f)],_0xadbb87=_0x413a97,console[_0x569141(0x21c)](a4_0x2f31ca['dim'](_0x569141(0x22a)+_0x534d43+':\x20'+_0x1fe93c));}catch{_0x1fe93c=_0x413a97;}else _0x1fe93c=_0x413a97;}else{if(_0xee75c7)try{const _0x477771=JSON[_0x569141(0x1e7)](readFileSync(_0xee75c7,_0x569141(0x205)));_0x1fe93c=_0x477771[_0x569141(0x20f)],_0xadbb87=a4_0x31f4d8[_0x569141(0x1f3)](_0xee75c7),console[_0x569141(0x21c)](a4_0x2f31ca[_0x569141(0x1e8)]('Using\x20project:\x20'+_0x1fe93c));}catch{_0x1fe93c=_0x3d21fc;}else _0x1fe93c=_0x3d21fc;}if(!_0x1fe93c)return console[_0x569141(0x21c)](a4_0x2f31ca['yellow'](_0x569141(0x240))),console[_0x569141(0x21c)]('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[_0x569141(0x21c)](_0x569141(0x218)),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console['log'](_0x569141(0x219)),0x1;if(_0x465a34){const {data:_0x14edca}=await withSpinner('Pulling\x20agent\x20\x22'+_0x465a34+_0x569141(0x21b)+_0x1fe93c+'\x22...',()=>_0x18ee53['llm'][_0x569141(0x20b)](_0x1fe93c,_0x465a34,_0x3104e8,{'dryRun':_0x5d6ab1,'force':_0x5ae357}));if(_0x5d6ab1)return console[_0x569141(0x21c)](a4_0x2f31ca[_0x569141(0x245)](_0x569141(0x1df))),console['log']('Would\x20pull\x20agent:\x20'+_0x14edca[_0x569141(0x1ef)]),console[_0x569141(0x21c)]('Output\x20path:\x20'+_0x14edca[_0x569141(0x1f6)]),_0x14edca[_0x569141(0x216)]&&(console[_0x569141(0x21c)](_0x569141(0x261)),console[_0x569141(0x21c)]('─'[_0x569141(0x242)](0x3c)),console[_0x569141(0x21c)](_0x14edca[_0x569141(0x216)]),console['log']('─'[_0x569141(0x242)](0x3c))),0x0;return console[_0x569141(0x21c)](a4_0x2f31ca['green'](_0x569141(0x23e))),console['log'](_0x569141(0x266)+_0x14edca['agentName']),console[_0x569141(0x21c)](_0x569141(0x22b)+_0x14edca[_0x569141(0x1f6)]),console['log']('Status:\x20'+(_0x14edca[_0x569141(0x251)]?a4_0x2f31ca[_0x569141(0x230)](_0x569141(0x236)):_0x14edca['hasChanges']?a4_0x2f31ca[_0x569141(0x245)](_0x569141(0x229)):a4_0x2f31ca['gray']('unchanged'))),0x0;}const _0x2c5a9e=_0xadbb87||_0x3104e8,{data:_0x56028a}=await withSpinner(_0x569141(0x25e)+_0x1fe93c+_0x569141(0x275),()=>_0x18ee53[_0x569141(0x21f)][_0x569141(0x1e0)](_0x1fe93c,_0x2c5a9e,{'dryRun':!![]})),_0x2f047f=_0x56028a['counts'][_0x569141(0x256)][_0x569141(0x236)]+_0x56028a[_0x569141(0x278)][_0x569141(0x203)][_0x569141(0x236)]+_0x56028a[_0x569141(0x278)][_0x569141(0x268)][_0x569141(0x236)]+_0x56028a[_0x569141(0x278)][_0x569141(0x1f2)][_0x569141(0x236)]+_0x56028a[_0x569141(0x278)][_0x569141(0x21e)][_0x569141(0x236)],_0x45ab8b=_0x56028a[_0x569141(0x278)]['agents'][_0x569141(0x229)]+_0x56028a['counts'][_0x569141(0x203)][_0x569141(0x229)]+_0x56028a['counts'][_0x569141(0x268)][_0x569141(0x229)]+_0x56028a['counts'][_0x569141(0x1f2)][_0x569141(0x229)]+_0x56028a[_0x569141(0x278)][_0x569141(0x21e)][_0x569141(0x229)],_0x41b155=_0x56028a['counts'][_0x569141(0x256)][_0x569141(0x23a)]+_0x56028a[_0x569141(0x278)]['knowledgeBases'][_0x569141(0x23a)]+_0x56028a[_0x569141(0x278)][_0x569141(0x268)][_0x569141(0x23a)]+_0x56028a['counts'][_0x569141(0x1f2)]['unchanged']+_0x56028a[_0x569141(0x278)][_0x569141(0x21e)][_0x569141(0x23a)];console['log']('\x0aPull\x20summary\x20for\x20\x27'+_0x56028a[_0x569141(0x258)]+'\x27:'),console[_0x569141(0x21c)]('\x20\x20'+a4_0x2f31ca[_0x569141(0x230)]('+\x20'+_0x2f047f+_0x569141(0x211))+_0x569141(0x26a)+a4_0x2f31ca[_0x569141(0x245)]('~\x20'+_0x45ab8b+_0x569141(0x23b))+_0x569141(0x26a)+a4_0x2f31ca['dim']('=\x20'+_0x41b155+_0x569141(0x1f5))),console[_0x569141(0x21c)](_0x569141(0x250)+formatCountSummary(_0x56028a[_0x569141(0x278)][_0x569141(0x256)])),console[_0x569141(0x21c)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x56028a[_0x569141(0x278)]['knowledgeBases'])),console[_0x569141(0x21c)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x56028a['counts']['textKnowledgeBases'])),console['log'](_0x569141(0x1e4)+formatCountSummary(_0x56028a[_0x569141(0x278)][_0x569141(0x1f2)])),console[_0x569141(0x21c)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x56028a[_0x569141(0x278)]['integrations'])),console[_0x569141(0x21c)](_0x569141(0x1ea)+a4_0x2f31ca[_0x569141(0x1dd)](_0x56028a['outputDir'])),displayDiffs(_0x56028a[_0x569141(0x256)],_0x56028a[_0x569141(0x203)],_0x56028a[_0x569141(0x268)],_0x56028a[_0x569141(0x1f2)],_0x56028a['integrations']);if(_0x5d6ab1)return console['log'](a4_0x2f31ca[_0x569141(0x245)](_0x569141(0x1ee))),0x0;if(_0x2f047f===0x0&&_0x45ab8b===0x0)return console[_0x569141(0x21c)](a4_0x2f31ca[_0x569141(0x230)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x56028a[_0x569141(0x258)]},_0xb1fcca[_0x569141(0x1fc)]),console[_0x569141(0x21c)](a4_0x2f31ca[_0x569141(0x230)](_0x569141(0x1e5)+a4_0x2f31ca[_0x569141(0x1e8)]('llm_project')+_0x569141(0x27a)+a4_0x2f31ca[_0x569141(0x1dd)](_0x56028a[_0x569141(0x258)]))),0x0;if(!_0x55976c&&!_0x5ae357){const _0x3e5e2b=await confirmKey('\x0aWrite\x20'+(_0x2f047f+_0x45ab8b)+_0x569141(0x224));if(!_0x3e5e2b)return console[_0x569141(0x21c)](_0x569141(0x260)),0x0;}const {data:_0x4b5164}=await withSpinner(_0x569141(0x25c),()=>_0x18ee53[_0x569141(0x21f)][_0x569141(0x1e0)](_0x1fe93c,_0x2c5a9e,{'force':_0x5ae357}));return console['log'](a4_0x2f31ca[_0x569141(0x230)](_0x569141(0x25a)+(_0x2f047f+_0x45ab8b)+'\x20files\x20to\x20'+_0x4b5164[_0x569141(0x274)])),saveSessionContext({'llm_project':_0x4b5164[_0x569141(0x258)]},_0xb1fcca['session']),console[_0x569141(0x21c)](a4_0x2f31ca[_0x569141(0x230)](_0x569141(0x1e5)+a4_0x2f31ca[_0x569141(0x1e8)]('llm_project')+_0x569141(0x27a)+a4_0x2f31ca[_0x569141(0x1dd)](_0x4b5164[_0x569141(0x258)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x174a45(0x223)]=a4_0x174a45(0x23f);[a4_0x174a45(0x214)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x174a45(0x244)](_0x1673c6){const _0x3afec6=a4_0x174a45,{options:_0x50262e,args:_0xbd97c1,tdx:_0x1d005e}=_0x1673c6,_0x5b0c5b=_0xbd97c1[0x0],_0x1cb053=_0x50262e[_0x3afec6(0x223)],_0x5ce525=_0x50262e[_0x3afec6(0x20e)],_0x13b349=_0x50262e[_0x3afec6(0x1e1)],_0x26fca5=_0x50262e[_0x3afec6(0x22c)],_0x33e32d=_0x50262e[_0x3afec6(0x26d)];let _0x363201;const _0x2bbd27=findAgentConfigPath(process[_0x3afec6(0x262)]());if(_0x5b0c5b){const _0x1a2505=a4_0x31f4d8[_0x3afec6(0x233)](_0x5b0c5b,_0x3afec6(0x20d));existsSync(_0x1a2505)?(_0x363201=_0x5b0c5b,console[_0x3afec6(0x21c)](a4_0x2f31ca[_0x3afec6(0x1e8)](_0x3afec6(0x277)+_0x5b0c5b))):_0x363201=_0x5b0c5b;}else{if(_0x2bbd27)_0x363201=a4_0x31f4d8['dirname'](_0x2bbd27),console[_0x3afec6(0x21c)](a4_0x2f31ca[_0x3afec6(0x1e8)](_0x3afec6(0x226)+_0x363201));else{if(_0x33e32d){const _0x402df7=sanitizeForFilesystem(_0x33e32d);let _0x13fd6c=_0x402df7,_0x40663c=a4_0x31f4d8[_0x3afec6(0x233)](process[_0x3afec6(0x262)](),'agents',_0x402df7,_0x3afec6(0x20d));if(!existsSync(_0x40663c)){const _0x235f2f=normalizeName(_0x33e32d),_0x50b95d=a4_0x31f4d8[_0x3afec6(0x233)](process[_0x3afec6(0x262)](),_0x3afec6(0x256),_0x235f2f,_0x3afec6(0x20d));existsSync(_0x50b95d)&&(_0x13fd6c=_0x235f2f,_0x40663c=_0x50b95d);}if(existsSync(_0x40663c))_0x363201=a4_0x31f4d8[_0x3afec6(0x1f3)](_0x40663c),console[_0x3afec6(0x21c)](a4_0x2f31ca[_0x3afec6(0x1e8)](_0x3afec6(0x277)+_0x363201));else{const _0x216c3d=_0x50262e[_0x3afec6(0x210)];if(_0x216c3d)throw new SDKError(ErrorCode[_0x3afec6(0x21d)],_0x3afec6(0x249)+_0x33e32d+_0x3afec6(0x220),undefined,{'helpText':_0x3afec6(0x209)+_0x3afec6(0x253)+(_0x3afec6(0x255)+_0x33e32d+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x13fd6c+'\x20--name\x20'+(_0x1cb053||_0x3afec6(0x25b))+_0x3afec6(0x272)+_0x216c3d)});_0x363201=_0x33e32d,console[_0x3afec6(0x21c)](a4_0x2f31ca[_0x3afec6(0x1e8)](_0x3afec6(0x1f9)+_0x33e32d));}}}}if(!_0x363201)return console[_0x3afec6(0x21c)](a4_0x2f31ca[_0x3afec6(0x245)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x3afec6(0x21c)](_0x3afec6(0x27d)),console[_0x3afec6(0x21c)](_0x3afec6(0x1f4)),console[_0x3afec6(0x21c)](_0x3afec6(0x26c)),console[_0x3afec6(0x21c)](_0x3afec6(0x1d9)),0x1;if(!_0x1cb053)throw new SDKError(ErrorCode[_0x3afec6(0x213)],_0x3afec6(0x221),undefined,{'helpText':_0x3afec6(0x215)});if(!_0x13b349&&!_0x5ce525){const _0x3bc34b=await confirmKey('Clone\x20\x22'+_0x363201+_0x3afec6(0x1fd)+_0x1cb053+'\x22?');if(!_0x3bc34b)return console[_0x3afec6(0x21c)]('Clone\x20cancelled'),0x0;}const {data:_0x5c60a4}=await withSpinner(_0x3afec6(0x24f)+_0x363201+_0x3afec6(0x254)+_0x1cb053+_0x3afec6(0x275),()=>_0x1d005e['llm'][_0x3afec6(0x207)](_0x363201,_0x1cb053,{'dryRun':_0x5ce525}));if(_0x5ce525)return console[_0x3afec6(0x21c)](a4_0x2f31ca[_0x3afec6(0x245)](_0x3afec6(0x20a))),console[_0x3afec6(0x21c)]('Source:\x20'+_0x5c60a4[_0x3afec6(0x1fe)]),console[_0x3afec6(0x21c)]('New\x20project:\x20'+_0x1cb053),console[_0x3afec6(0x21c)]('Would\x20clone:'),console[_0x3afec6(0x21c)](_0x3afec6(0x250)+_0x5c60a4[_0x3afec6(0x278)]['agents'][_0x3afec6(0x24a)]),console[_0x3afec6(0x21c)](_0x3afec6(0x202)+_0x5c60a4[_0x3afec6(0x278)][_0x3afec6(0x203)][_0x3afec6(0x24a)]),console[_0x3afec6(0x21c)]('\x20\x20Prompts:\x20'+_0x5c60a4[_0x3afec6(0x278)][_0x3afec6(0x1f2)][_0x3afec6(0x24a)]),0x0;const _0x51cd5c=_0x5c60a4[_0x3afec6(0x278)][_0x3afec6(0x256)]['errors']>0x0||_0x5c60a4[_0x3afec6(0x278)][_0x3afec6(0x203)][_0x3afec6(0x21a)]>0x0||_0x5c60a4['counts'][_0x3afec6(0x1f2)]['errors']>0x0;_0x51cd5c?console[_0x3afec6(0x21c)](a4_0x2f31ca[_0x3afec6(0x245)]('Project\x20cloned\x20with\x20errors')):console[_0x3afec6(0x21c)](a4_0x2f31ca[_0x3afec6(0x230)]('Project\x20cloned\x20successfully'));console[_0x3afec6(0x21c)](_0x3afec6(0x247)+_0x5c60a4[_0x3afec6(0x1fe)]),console[_0x3afec6(0x21c)](_0x3afec6(0x1e9)+_0x5c60a4[_0x3afec6(0x204)]),console[_0x3afec6(0x21c)](_0x3afec6(0x1ff)+_0x5c60a4['newProjectId']),console['log'](),console[_0x3afec6(0x21c)](_0x3afec6(0x222)),console[_0x3afec6(0x21c)]('\x20\x20Agents:\x20'+formatCountSummary(_0x5c60a4[_0x3afec6(0x278)]['agents'])),console[_0x3afec6(0x21c)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5c60a4[_0x3afec6(0x278)]['knowledgeBases'])),console['log'](_0x3afec6(0x1e4)+formatCountSummary(_0x5c60a4[_0x3afec6(0x278)][_0x3afec6(0x1f2)])),console[_0x3afec6(0x21c)](_0x3afec6(0x246)+formatCountSummary(_0x5c60a4[_0x3afec6(0x278)][_0x3afec6(0x21e)]));if(_0x51cd5c){console[_0x3afec6(0x21c)](),console[_0x3afec6(0x21c)](a4_0x2f31ca['red'](_0x3afec6(0x276)));for(const _0x4691b8 of _0x5c60a4['agents']){_0x4691b8['action']==='error'&&console[_0x3afec6(0x21c)](a4_0x2f31ca[_0x3afec6(0x1de)](_0x3afec6(0x241)+_0x4691b8[_0x3afec6(0x1ef)]+_0x3afec6(0x23c)+_0x4691b8[_0x3afec6(0x269)]));}for(const _0x49ae15 of _0x5c60a4[_0x3afec6(0x203)]){_0x49ae15[_0x3afec6(0x252)]==='error'&&console[_0x3afec6(0x21c)](a4_0x2f31ca[_0x3afec6(0x1de)](_0x3afec6(0x25d)+_0x49ae15[_0x3afec6(0x223)]+_0x3afec6(0x23c)+_0x49ae15[_0x3afec6(0x269)]));}for(const _0x4294a9 of _0x5c60a4[_0x3afec6(0x1f2)]){_0x4294a9['action']===_0x3afec6(0x269)&&console[_0x3afec6(0x21c)](a4_0x2f31ca[_0x3afec6(0x1de)]('\x20\x20Prompt\x20\x22'+_0x4294a9[_0x3afec6(0x223)]+'\x22:\x20'+_0x4294a9[_0x3afec6(0x269)]));}for(const _0x47c372 of _0x5c60a4[_0x3afec6(0x21e)]){_0x47c372['action']===_0x3afec6(0x269)&&console[_0x3afec6(0x21c)](a4_0x2f31ca[_0x3afec6(0x1de)]('\x20\x20Integration\x20\x22'+_0x47c372[_0x3afec6(0x223)]+_0x3afec6(0x23c)+_0x47c372[_0x3afec6(0x269)]));}return 0x1;}console[_0x3afec6(0x21c)]();const _0x35e8d0=getLLMProjectUrl(_0x26fca5,_0x5c60a4[_0x3afec6(0x24d)]);return console[_0x3afec6(0x21c)](_0x3afec6(0x227)+a4_0x2f31ca[_0x3afec6(0x1dd)](_0x35e8d0)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x174a45(0x223)]=a4_0x174a45(0x1da);[a4_0x174a45(0x214)]=a4_0x174a45(0x201);async['execute'](_0x1335b5){const _0xa27c90=a4_0x174a45,{options:_0x4e31cd,args:_0x2d6e65,tdx:_0x4361af}=_0x1335b5;let _0x247c7e=_0x2d6e65[0x0]||process[_0xa27c90(0x262)]();const _0x33da32=_0x4e31cd[_0xa27c90(0x20e)],_0x5c5cbf=_0x4e31cd[_0xa27c90(0x279)],_0x387e96=_0x4e31cd[_0xa27c90(0x1e1)],_0x23236c=_0x4e31cd[_0xa27c90(0x22c)],_0x37826a=a4_0x31f4d8['join'](_0x247c7e,_0xa27c90(0x24b)),_0x3fbd8a=existsSync(_0x37826a);if(_0x3fbd8a){const {data:_0xb91716}=await withSpinner(_0xa27c90(0x24c)+_0x247c7e+_0xa27c90(0x275),()=>_0x4361af[_0xa27c90(0x21f)][_0xa27c90(0x1f8)](_0x247c7e,{'dryRun':_0x33da32,'force':_0x5c5cbf}));if(_0x33da32)return console[_0xa27c90(0x21c)](a4_0x2f31ca[_0xa27c90(0x245)](_0xa27c90(0x20a))),console[_0xa27c90(0x21c)](_0xa27c90(0x263)+_0xb91716[_0xa27c90(0x1ef)]),0x0;if(_0xb91716[_0xa27c90(0x252)]===_0xa27c90(0x269))return console[_0xa27c90(0x21c)](a4_0x2f31ca[_0xa27c90(0x1de)](_0xa27c90(0x237)+_0xb91716['error'])),0x1;console[_0xa27c90(0x21c)](a4_0x2f31ca[_0xa27c90(0x230)]('Agent\x20'+_0xb91716['action']+_0xa27c90(0x1eb))),console[_0xa27c90(0x21c)](_0xa27c90(0x266)+_0xb91716[_0xa27c90(0x1ef)]);if(_0xb91716[_0xa27c90(0x27b)]&&_0xb91716[_0xa27c90(0x265)]){const _0x4f4965=getLLMAgentChatUrl(_0x23236c,_0xb91716['projectId'],_0xb91716[_0xa27c90(0x27b)]);console['log']('Chat:\x20'+a4_0x2f31ca['cyan'](_0x4f4965));}return 0x0;}const _0x3a0308=_0x4e31cd['llmProject'],_0x2c10ff=resolveProjectFromContext(_0x247c7e,_0x3a0308);if(_0x2c10ff[_0xa27c90(0x235)])_0x247c7e=_0x2c10ff['projectDir'],_0x2c10ff[_0xa27c90(0x1ed)]==='context'&&console['log'](a4_0x2f31ca[_0xa27c90(0x1e8)]('Using\x20project:\x20'+_0x247c7e));else{let _0x3eaa2a=_0xa27c90(0x1f0);_0x2c10ff[_0xa27c90(0x243)]===_0xa27c90(0x1f1)&&(_0x3eaa2a=_0x2c10ff['message']+_0xa27c90(0x234)+_0x2c10ff[_0xa27c90(0x26d)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0xa27c90(0x21d)],_0x2c10ff[_0xa27c90(0x243)]===_0xa27c90(0x26e)?_0x2c10ff[_0xa27c90(0x27c)]:'No\x20tdx.json\x20found\x20in\x20'+_0x247c7e,undefined,{'helpText':_0x3eaa2a});}const {data:_0x2b82b3}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x4361af[_0xa27c90(0x21f)][_0xa27c90(0x208)](_0x247c7e,{'dryRun':!![]})),_0x43d54d=_0x2b82b3[_0xa27c90(0x278)]['agents'][_0xa27c90(0x21a)]>0x0;if(_0x43d54d){console['log'](a4_0x2f31ca['red'](_0xa27c90(0x22e)));for(const _0x25800d of _0x2b82b3[_0xa27c90(0x256)]){_0x25800d['action']==='error'&&console[_0xa27c90(0x21c)](a4_0x2f31ca[_0xa27c90(0x1de)](_0xa27c90(0x241)+_0x25800d[_0xa27c90(0x1ef)]+_0xa27c90(0x23c)+_0x25800d[_0xa27c90(0x269)]));}return 0x1;}const _0x49bdb7=_0x2b82b3['counts']['agents'][_0xa27c90(0x24a)]+_0x2b82b3[_0xa27c90(0x278)]['knowledgeBases'][_0xa27c90(0x24a)]+_0x2b82b3[_0xa27c90(0x278)][_0xa27c90(0x268)][_0xa27c90(0x24a)]+_0x2b82b3[_0xa27c90(0x278)][_0xa27c90(0x1f2)][_0xa27c90(0x24a)]+_0x2b82b3[_0xa27c90(0x278)][_0xa27c90(0x21e)][_0xa27c90(0x24a)],_0x2a2971=_0x2b82b3[_0xa27c90(0x278)][_0xa27c90(0x256)]['updated']+_0x2b82b3[_0xa27c90(0x278)][_0xa27c90(0x203)][_0xa27c90(0x229)]+_0x2b82b3['counts']['textKnowledgeBases'][_0xa27c90(0x229)]+_0x2b82b3['counts']['prompts']['updated']+_0x2b82b3[_0xa27c90(0x278)][_0xa27c90(0x21e)][_0xa27c90(0x229)],_0xbe0c2d=_0x2b82b3[_0xa27c90(0x278)][_0xa27c90(0x256)][_0xa27c90(0x23a)]+_0x2b82b3[_0xa27c90(0x278)]['knowledgeBases'][_0xa27c90(0x23a)]+_0x2b82b3[_0xa27c90(0x278)][_0xa27c90(0x268)][_0xa27c90(0x23a)]+_0x2b82b3[_0xa27c90(0x278)][_0xa27c90(0x1f2)][_0xa27c90(0x23a)]+_0x2b82b3['counts']['integrations']['unchanged'];console[_0xa27c90(0x21c)](_0xa27c90(0x271)+_0x2b82b3[_0xa27c90(0x258)]+'\x27:'),console[_0xa27c90(0x21c)]('\x20\x20'+a4_0x2f31ca[_0xa27c90(0x230)]('+\x20'+_0x49bdb7+_0xa27c90(0x211))+'\x20|\x20'+a4_0x2f31ca[_0xa27c90(0x245)]('~\x20'+_0x2a2971+_0xa27c90(0x23b))+_0xa27c90(0x26a)+a4_0x2f31ca[_0xa27c90(0x1e8)]('=\x20'+_0xbe0c2d+'\x20unchanged')),console[_0xa27c90(0x21c)]('\x20\x20Agents:\x20'+formatCountSummary(_0x2b82b3[_0xa27c90(0x278)][_0xa27c90(0x256)])),console[_0xa27c90(0x21c)](_0xa27c90(0x202)+formatCountSummary(_0x2b82b3[_0xa27c90(0x278)][_0xa27c90(0x203)])),console['log'](_0xa27c90(0x22d)+formatCountSummary(_0x2b82b3['counts'][_0xa27c90(0x268)])),console['log'](_0xa27c90(0x1e4)+formatCountSummary(_0x2b82b3['counts'][_0xa27c90(0x1f2)])),console['log'](_0xa27c90(0x246)+formatCountSummary(_0x2b82b3[_0xa27c90(0x278)][_0xa27c90(0x21e)])),console[_0xa27c90(0x21c)](_0xa27c90(0x26f)+a4_0x2f31ca[_0xa27c90(0x1dd)](_0x247c7e)),displayDiffs(_0x2b82b3[_0xa27c90(0x256)],_0x2b82b3['knowledgeBases'],_0x2b82b3[_0xa27c90(0x268)],_0x2b82b3[_0xa27c90(0x1f2)],_0x2b82b3[_0xa27c90(0x21e)]);if(_0x33da32)return console[_0xa27c90(0x21c)](a4_0x2f31ca['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x49bdb7===0x0&&_0x2a2971===0x0){console[_0xa27c90(0x21c)](a4_0x2f31ca['green'](_0xa27c90(0x200)));const _0x2fcb73=getLLMProjectUrl(_0x23236c,_0x2b82b3[_0xa27c90(0x265)]);return console['log'](_0xa27c90(0x227)+a4_0x2f31ca['cyan'](_0x2fcb73)),0x0;}if(!_0x387e96&&!_0x5c5cbf){const _0x5b1d72=await confirmKey(_0xa27c90(0x1e2)+(_0x49bdb7+_0x2a2971)+_0xa27c90(0x1d8));if(!_0x5b1d72)return console[_0xa27c90(0x21c)](_0xa27c90(0x232)),0x0;}const {data:_0x142d39}=await withSpinner('Pushing\x20to\x20project...',()=>_0x4361af['llm'][_0xa27c90(0x208)](_0x247c7e,{'force':_0x5c5cbf})),_0x12233e=_0x142d39['counts'][_0xa27c90(0x256)][_0xa27c90(0x21a)]>0x0||_0x142d39['counts'][_0xa27c90(0x203)][_0xa27c90(0x21a)]>0x0||_0x142d39['counts'][_0xa27c90(0x268)][_0xa27c90(0x21a)]>0x0||_0x142d39[_0xa27c90(0x278)][_0xa27c90(0x1f2)][_0xa27c90(0x21a)]>0x0;if(_0x12233e){console[_0xa27c90(0x21c)](a4_0x2f31ca['yellow'](_0xa27c90(0x1fa))),console[_0xa27c90(0x21c)](),console[_0xa27c90(0x21c)](a4_0x2f31ca[_0xa27c90(0x1de)](_0xa27c90(0x276)));for(const _0x40e586 of _0x142d39[_0xa27c90(0x256)]){_0x40e586[_0xa27c90(0x252)]===_0xa27c90(0x269)&&console[_0xa27c90(0x21c)](a4_0x2f31ca[_0xa27c90(0x1de)](_0xa27c90(0x241)+_0x40e586['agentName']+_0xa27c90(0x23c)+_0x40e586['error']));}for(const _0x3a66fc of _0x142d39[_0xa27c90(0x203)]){_0x3a66fc[_0xa27c90(0x252)]==='error'&&console['log'](a4_0x2f31ca[_0xa27c90(0x1de)](_0xa27c90(0x25d)+_0x3a66fc[_0xa27c90(0x223)]+'\x22:\x20'+_0x3a66fc['error']));}for(const _0x4f57a5 of _0x142d39[_0xa27c90(0x268)]){_0x4f57a5[_0xa27c90(0x252)]===_0xa27c90(0x269)&&console[_0xa27c90(0x21c)](a4_0x2f31ca[_0xa27c90(0x1de)](_0xa27c90(0x20c)+_0x4f57a5['name']+_0xa27c90(0x23c)+_0x4f57a5[_0xa27c90(0x269)]));}for(const _0x37cab4 of _0x142d39[_0xa27c90(0x1f2)]){_0x37cab4[_0xa27c90(0x252)]===_0xa27c90(0x269)&&console[_0xa27c90(0x21c)](a4_0x2f31ca[_0xa27c90(0x1de)](_0xa27c90(0x24e)+_0x37cab4[_0xa27c90(0x223)]+_0xa27c90(0x23c)+_0x37cab4[_0xa27c90(0x269)]));}for(const _0x96dc24 of _0x142d39[_0xa27c90(0x21e)]){_0x96dc24[_0xa27c90(0x252)]===_0xa27c90(0x269)&&console['log'](a4_0x2f31ca['red'](_0xa27c90(0x228)+_0x96dc24[_0xa27c90(0x223)]+_0xa27c90(0x23c)+_0x96dc24['error']));}return 0x1;}console[_0xa27c90(0x21c)](a4_0x2f31ca[_0xa27c90(0x230)](_0xa27c90(0x225)+(_0x49bdb7+_0x2a2971)+_0xa27c90(0x25f)+_0x142d39['projectName']+'\x27'));const _0x4b053a=getLLMProjectUrl(_0x23236c,_0x142d39['projectId']);return console[_0xa27c90(0x21c)](_0xa27c90(0x227)+a4_0x2f31ca['cyan'](_0x4b053a)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x27db88=a5_0x3ed8;(function(_0x488d3a,_0x2852e6){const _0x44a3a4=a5_0x3ed8,_0x29dba7=_0x488d3a();while(!![]){try{const _0x3e00d9=-parseInt(_0x44a3a4(0x108))/0x1+parseInt(_0x44a3a4(0xfa))/0x2+-parseInt(_0x44a3a4(0xdd))/0x3+-parseInt(_0x44a3a4(0xd7))/0x4*(-parseInt(_0x44a3a4(0x7c))/0x5)+parseInt(_0x44a3a4(0x88))/0x6*(-parseInt(_0x44a3a4(0x8c))/0x7)+-parseInt(_0x44a3a4(0x75))/0x8+parseInt(_0x44a3a4(0xe4))/0x9;if(_0x3e00d9===_0x2852e6)break;else _0x29dba7['push'](_0x29dba7['shift']());}catch(_0x639572){_0x29dba7['push'](_0x29dba7['shift']());}}}(a5_0x5ae8,0x1b403));import*as a5_0x1e08d7 from'node:fs';import*as a5_0x564877 from'node:path';import a5_0x17bfe6 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x5ae8(){const _0x372f43=['New\x20tests\x20to\x20execute:\x20','PASS','Round\x20','white','testYmlPath','\x20\x20Conversation:\x20','find','projectName','227644QbGfDj','llmProject','yellow','\x22,\x20but\x20current\x20site\x20is\x20\x22','Cached\x20run\x20is\x20from\x20site\x20\x22','/<agent-name>','561471MHyDoC','Errors:\x20\x20\x20','Re-evaluation\x20Summary','split','add','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','4870755vQojDZ','Site:\x20','jsonl','table','No\x20tests\x20have\x20tags\x20defined.','⚠\x20SKIPPED:\x20','Duration:\x20','reeval','✗\x20FAIL:\x20','round','eval','Test\x20Configuration:','tsv','Re-evaluating...','rounds','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','status','...\x20','No\x20tests\x20found\x20matching:\x20','some','Running\x20test:\x20','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','286260dswCcb','reason','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Failed\x20Tests:','\x20\x20Round\x20','message','Re-evaluating\x20cached\x20test\x20run...','cyan','resolveAgentId','\x22:\x20','log','execute','executeReeval','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','210798teFPcR','conversation_url','FAIL','Running:\x20','name','output','✗\x20ERROR:\x20','now','\x20(cached)','Conversation\x20URL:\x20','156424bgCUND','resolveProjectId','push','\x20\x20Evaluating...\x20','agent:test','forEach','tags','5tVLPjm','resolve','agentDirs','\x20\x20Agent:\x20','text','Executing\x20new\x20tests...','agent','site','\x20\x20Project:\x20','no_tests','llm','dim','74862WHCela','green','\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)','verbose','119wXeWxf','test.yml','no_local_folder','Run\x20tests\x20for\x20an\x20LLM\x20agent','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','tests','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','✓\x20PASS:\x20','found','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','trim','utf-8','\x20\x20Site:\x20','Error\x20writing\x20output\x20file:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','basename','Cached\x20run\x20from:\x20','Re-evaluating\x20',':\x20Sending\x20user\x20input...','Agent:\x20','join','json','No\x20tests\x20found\x20with\x20tags:\x20','context','Tests\x20found:\x20','length','Run\x20\x27tdx\x20agent\x20pull\x20','includes','isSpinning','...','404','\x27\x20to\x20create\x20the\x20folder\x20structure.','stop','ERROR','Test\x20','conversations','red','projectDir','\x20(new)','toLowerCase','Round\x201/','\x20\x20-\x20','repeat','agentName','Error:\x20No\x20previous\x20test\x20run\x20found.','size','has','Failed:\x20\x20\x20','Running\x20agent\x20tests...','start','Available\x20tags:\x20','\x20-\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Passed:\x20\x20\x20','map','timestamp','no_context','writeFileSync','dryRun','not\x20found','Available\x20tests:\x20','Total:\x20\x20\x20\x20','filter','Evaluating\x20response...','Project\x20path:\x20','toISOString'];a5_0x5ae8=function(){return _0x372f43;};return a5_0x5ae8();}function a5_0x3ed8(_0xbc9871,_0x2241cf){_0xbc9871=_0xbc9871-0x73;const _0x5ae8b=a5_0x5ae8();let _0x3ed8c3=_0x5ae8b[_0xbc9871];return _0x3ed8c3;}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x27db88(0x10c)]=a5_0x27db88(0x79);['description']=a5_0x27db88(0x8f);async[a5_0x27db88(0x105)](_0x497862){const _0x2f74ab=a5_0x27db88,{options:_0x2e8ac8,args:_0x4d4bb5,tdx:_0x54821a}=_0x497862,_0x4d78aa=_0x4d4bb5[0x0]||'.',_0x22a850=_0x2e8ac8[_0x2f74ab(0xc7)],_0x4b7aaa=_0x2e8ac8,_0x4a1fca=_0x4b7aaa[_0x2f74ab(0xee)]===![],_0x2daa63=_0x4b7aaa[_0x2f74ab(0xeb)],_0x387677=_0x4b7aaa[_0x2f74ab(0x10c)],_0x39bbbe=_0x4b7aaa[_0x2f74ab(0x7b)],_0x5f314f=_0x2e8ac8[_0x2f74ab(0x83)],_0x1ec630=_0x4b7aaa[_0x2f74ab(0x10d)];if(_0x2daa63&&_0x4a1fca)return console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0xb1)](_0x2f74ab(0x95))),0x1;let _0x26fe31=_0x2f74ab(0xe7);if(_0x4b7aaa[_0x2f74ab(0xa2)])_0x26fe31=_0x2f74ab(0xa2);else{if(_0x4b7aaa[_0x2f74ab(0xe6)])_0x26fe31='jsonl';else{if(_0x4b7aaa[_0x2f74ab(0xf0)])_0x26fe31=_0x2f74ab(0xf0);else{if(_0x4b7aaa[_0x2f74ab(0xe7)])_0x26fe31=_0x2f74ab(0xe7);}}}const _0x13b106=_0x4b7aaa[_0x2f74ab(0xd8)];let _0xc2adee=_0x4d78aa;const _0x45249b=a5_0x1e08d7['existsSync'](_0x4d78aa),_0xa0727e=_0x4d78aa==='.';if(!_0x45249b||_0xa0727e){const _0x65031=resolveProjectFromContext(_0x4d78aa,_0x13b106,{'requireFile':_0x2f74ab(0x8d)});if(_0x65031[_0x2f74ab(0x94)])_0xc2adee=_0x65031[_0x2f74ab(0xb2)],_0x65031['source']===_0x2f74ab(0xa4)&&console[_0x2f74ab(0x104)](a5_0x17bfe6['dim']('Using\x20agent:\x20'+_0xc2adee));else switch(_0x65031[_0x2f74ab(0xfb)]){case _0x2f74ab(0xc5):console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0xd9)](_0x65031['message'])),console[_0x2f74ab(0x104)](),console[_0x2f74ab(0x104)]('Usage:'),console['log'](_0x2f74ab(0xf9)),console[_0x2f74ab(0x104)](_0x2f74ab(0x8a)),console[_0x2f74ab(0x104)](),console[_0x2f74ab(0x104)](_0x2f74ab(0xc1));return 0x1;case _0x2f74ab(0x8e):console['log'](a5_0x17bfe6['yellow'](_0x65031[_0x2f74ab(0xff)])),console[_0x2f74ab(0x104)](),console[_0x2f74ab(0x104)](_0x2f74ab(0xa7)+_0x65031[_0x2f74ab(0xd8)]+_0x2f74ab(0xac));return 0x1;case'multiple_agents':{const _0x1c3465=a5_0x564877[_0x2f74ab(0x9c)](_0x65031['projectDir']);console['log'](a5_0x17bfe6['yellow']('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x65031[_0x2f74ab(0xd8)]+'\x22:'));for(const _0x956e10 of _0x65031[_0x2f74ab(0x7e)]){console[_0x2f74ab(0x104)](_0x2f74ab(0xb6)+_0x956e10);}return console[_0x2f74ab(0x104)](),console[_0x2f74ab(0x104)](_0x2f74ab(0xe3)+_0x1c3465+_0x2f74ab(0xdc)),0x1;}case _0x2f74ab(0x85):console['log'](a5_0x17bfe6['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x65031[_0x2f74ab(0xd8)]+'\x22.')),console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0x87)](_0x2f74ab(0xcd)+_0x65031['projectDir'])),console['log'](),console[_0x2f74ab(0x104)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x135bc4,agentInfo:_0x5ab469}=parseTestFile(_0xc2adee);let _0x426387=_0x135bc4['tests'];if(_0x387677){const _0x5f17f8=_0x387677[_0x2f74ab(0xe0)](',')[_0x2f74ab(0xc3)](_0x520176=>_0x520176[_0x2f74ab(0x96)]());_0x426387=_0x135bc4[_0x2f74ab(0x91)][_0x2f74ab(0xcb)](_0x1500a3=>_0x5f17f8['includes'](_0x1500a3['name']));if(_0x426387[_0x2f74ab(0xa6)]===0x0)return console[_0x2f74ab(0x104)](a5_0x17bfe6['yellow'](_0x2f74ab(0xf6)+_0x387677)),console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0x87)](_0x2f74ab(0xc9)+_0x135bc4[_0x2f74ab(0x91)][_0x2f74ab(0xc3)](_0x4bafa9=>_0x4bafa9['name'])[_0x2f74ab(0xa1)](',\x20'))),0x1;}if(_0x39bbbe){const _0xfff65a=_0x39bbbe[_0x2f74ab(0xe0)](',')[_0x2f74ab(0xc3)](_0x483508=>_0x483508[_0x2f74ab(0x96)]()[_0x2f74ab(0xb4)]());_0x426387=_0x426387[_0x2f74ab(0xcb)](_0x5552ed=>_0x5552ed[_0x2f74ab(0x7b)]?.[_0x2f74ab(0xf7)](_0x5de8a4=>_0xfff65a[_0x2f74ab(0xa8)](_0x5de8a4['toLowerCase']())));if(_0x426387[_0x2f74ab(0xa6)]===0x0){console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0xd9)](_0x2f74ab(0xa3)+_0x39bbbe));const _0x58e5bc=new Set();return _0x135bc4['tests'][_0x2f74ab(0x7a)](_0x474a5a=>_0x474a5a[_0x2f74ab(0x7b)]?.[_0x2f74ab(0x7a)](_0xcb3d15=>_0x58e5bc[_0x2f74ab(0xe1)](_0xcb3d15))),_0x58e5bc[_0x2f74ab(0xba)]>0x0?console['log'](a5_0x17bfe6[_0x2f74ab(0x87)](_0x2f74ab(0xbf)+[..._0x58e5bc]['join'](',\x20'))):console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0x87)](_0x2f74ab(0xe8))),0x1;}}if(_0x2daa63)return this['executeReeval'](_0x497862,{'definition':{'tests':_0x426387},'agentInfo':_0x5ab469,'outputFormat':_0x26fe31,'outputFile':_0x1ec630,'testNames':_0x387677});if(_0x22a850){console['log'](a5_0x17bfe6['cyan'](_0x2f74ab(0xef))),console[_0x2f74ab(0x104)](_0x2f74ab(0x98)+a5_0x17bfe6[_0x2f74ab(0xd2)](_0x5f314f)),console[_0x2f74ab(0x104)](_0x2f74ab(0x84)+a5_0x17bfe6[_0x2f74ab(0xd2)](_0x5ab469[_0x2f74ab(0xd6)])),console[_0x2f74ab(0x104)](_0x2f74ab(0x7f)+a5_0x17bfe6[_0x2f74ab(0xd2)](_0x5ab469[_0x2f74ab(0xb8)])),console['log'](),console['log'](_0x2f74ab(0xa5)+a5_0x17bfe6[_0x2f74ab(0xd2)](_0x426387[_0x2f74ab(0xa6)]));for(let _0x1ee3a4=0x0;_0x1ee3a4<_0x426387[_0x2f74ab(0xa6)];_0x1ee3a4++){const _0x477593=_0x426387[_0x1ee3a4],_0x2add77=_0x477593[_0x2f74ab(0xf2)]['length']===0x1?_0x2f74ab(0xed):_0x2f74ab(0xf2),_0x396fcc=_0x477593[_0x2f74ab(0x7b)]?.['length']?'\x20['+_0x477593[_0x2f74ab(0x7b)][_0x2f74ab(0xa1)](',\x20')+']':'';console['log']('\x20\x20'+(_0x1ee3a4+0x1)+'.\x20'+a5_0x17bfe6['white'](_0x477593['name'])+'\x20('+_0x477593['rounds'][_0x2f74ab(0xa6)]+'\x20'+_0x2add77+')'+a5_0x17bfe6[_0x2f74ab(0x87)](_0x396fcc));}return 0x0;}let _0x248269,_0x25821a;try{_0x248269=await _0x54821a[_0x2f74ab(0x86)][_0x2f74ab(0x76)](_0x5ab469[_0x2f74ab(0xd6)]);}catch(_0x49afd0){const _0x608d47=_0x49afd0 instanceof Error?_0x49afd0[_0x2f74ab(0xff)]:String(_0x49afd0);return _0x608d47[_0x2f74ab(0xa8)](_0x2f74ab(0xab))||_0x608d47[_0x2f74ab(0xb4)]()[_0x2f74ab(0xa8)](_0x2f74ab(0xc8))?console['log'](a5_0x17bfe6[_0x2f74ab(0xb1)](_0x2f74ab(0x9a)+_0x5ab469[_0x2f74ab(0xd6)])):console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0xb1)](_0x2f74ab(0x107)+_0x5ab469['projectName']+'\x22:\x20'+_0x608d47)),0x1;}try{_0x25821a=await _0x54821a['llm'][_0x2f74ab(0x102)](_0x5ab469[_0x2f74ab(0xb8)],_0x248269);}catch(_0x1bd9a4){const _0x453cc8=_0x1bd9a4 instanceof Error?_0x1bd9a4[_0x2f74ab(0xff)]:String(_0x1bd9a4);return _0x453cc8[_0x2f74ab(0xa8)](_0x2f74ab(0xab))||_0x453cc8[_0x2f74ab(0xb4)]()[_0x2f74ab(0xa8)](_0x2f74ab(0xc8))?console['log'](a5_0x17bfe6[_0x2f74ab(0xb1)](_0x2f74ab(0x9b)+_0x5ab469[_0x2f74ab(0xb8)])):console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0xb1)](_0x2f74ab(0xfc)+_0x5ab469[_0x2f74ab(0xb8)]+_0x2f74ab(0x103)+_0x453cc8)),0x1;}let _0x17d9fb;if(!_0x4a1fca)try{_0x17d9fb=await setupEvaluatorAgent(_0x54821a[_0x2f74ab(0x86)],_0x2e8ac8[_0x2f74ab(0x8b)]);}catch(_0x3b8248){const _0x6e7971=_0x3b8248 instanceof Error?_0x3b8248[_0x2f74ab(0xff)]:String(_0x3b8248);return console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0xb1)](_0x2f74ab(0x92)+_0x6e7971)),0x1;}console['log'](a5_0x17bfe6[_0x2f74ab(0x101)](_0x2f74ab(0xbd))),console[_0x2f74ab(0x104)](_0x2f74ab(0xe5)+a5_0x17bfe6[_0x2f74ab(0xd2)](_0x5f314f)),console['log'](_0x2f74ab(0xa0)+a5_0x17bfe6['white'](_0x5ab469['projectName']+'/'+_0x5ab469['agentName'])),console['log']();const _0x4e48d2=[],_0x5ae1fa=[],_0x3156e3=Date[_0x2f74ab(0x10f)]();for(let _0x3372b0=0x0;_0x3372b0<_0x426387['length'];_0x3372b0++){const _0x48db31=_0x426387[_0x3372b0];_0x426387[_0x2f74ab(0xa6)]>0x1?console[_0x2f74ab(0x104)](_0x2f74ab(0xaf)+(_0x3372b0+0x1)+'/'+_0x426387[_0x2f74ab(0xa6)]+':\x20'+a5_0x17bfe6['white'](_0x48db31[_0x2f74ab(0x10c)])):console[_0x2f74ab(0x104)](_0x2f74ab(0xf8)+a5_0x17bfe6[_0x2f74ab(0xd2)](_0x48db31[_0x2f74ab(0x10c)]));const _0x2967ff=createCommandSpinner(_0x2f74ab(0xb5)+_0x48db31[_0x2f74ab(0xf2)][_0x2f74ab(0xa6)]+_0x2f74ab(0x9f));_0x2967ff[_0x2f74ab(0xbe)]();try{const {result:_0x444cd2,conversation:_0x444478}=await runTest(_0x54821a[_0x2f74ab(0x86)],_0x48db31,{'agentId':_0x25821a,'projectId':_0x248269,'site':_0x5f314f,'noEval':_0x4a1fca,'evaluatorId':_0x17d9fb,'onRoundStart':(_0x2fbc8b,_0x3d806f)=>{const _0x5dfeb0=_0x2f74ab;_0x2967ff[_0x5dfeb0(0x80)]=_0x5dfeb0(0xd1)+(_0x2fbc8b+0x1)+'/'+_0x3d806f+_0x5dfeb0(0x9f);},'onRoundComplete':(_0x4a7cc9,_0x60756c,_0x4737be)=>{const _0x4ec03e=_0x2f74ab,_0x101c3f=formatElapsed(_0x60756c);_0x4737be?console[_0x4ec03e(0x104)](_0x4ec03e(0xfe)+(_0x4a7cc9+0x1)+'/'+_0x48db31['rounds'][_0x4ec03e(0xa6)]+_0x4ec03e(0xf5)+a5_0x17bfe6[_0x4ec03e(0x89)]('✓')+'\x20('+_0x101c3f+')'):console[_0x4ec03e(0x104)](_0x4ec03e(0xfe)+(_0x4a7cc9+0x1)+'/'+_0x48db31[_0x4ec03e(0xf2)][_0x4ec03e(0xa6)]+_0x4ec03e(0xf5)+a5_0x17bfe6[_0x4ec03e(0xb1)]('✗'));},'onEvaluationStart':()=>{const _0x41c5cd=_0x2f74ab;_0x2967ff[_0x41c5cd(0x80)]=_0x41c5cd(0xcc);},'onEvaluationComplete':_0x3bc96d=>{const _0x1cf5d7=_0x2f74ab,_0x213ae6=formatElapsed(_0x3bc96d);console[_0x1cf5d7(0x104)](_0x1cf5d7(0x78)+a5_0x17bfe6['green']('✓')+'\x20('+_0x213ae6+')');}});_0x2967ff[_0x2f74ab(0xad)](),_0x4e48d2[_0x2f74ab(0x77)](_0x444cd2),_0x5ae1fa[_0x2f74ab(0x77)](_0x444478);if(_0x444cd2[_0x2f74ab(0xf4)]===_0x2f74ab(0xd0))console[_0x2f74ab(0x104)](a5_0x17bfe6['green'](_0x2f74ab(0x93)+_0x444cd2[_0x2f74ab(0xfb)]));else _0x444cd2['status']===_0x2f74ab(0x10a)?console[_0x2f74ab(0x104)](a5_0x17bfe6['red']('✗\x20FAIL:\x20'+_0x444cd2[_0x2f74ab(0xfb)])):console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0xb1)]('✗\x20ERROR:\x20'+_0x444cd2[_0x2f74ab(0xfb)]));_0x444cd2[_0x2f74ab(0x109)]&&console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0x87)](_0x2f74ab(0x74)+_0x444cd2[_0x2f74ab(0x109)])),console[_0x2f74ab(0x104)]();}catch(_0xa9999a){_0x2967ff['stop']();const _0x2adc09=_0xa9999a instanceof Error?_0xa9999a[_0x2f74ab(0xff)]:String(_0xa9999a);console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0xb1)](_0x2f74ab(0x10e)+_0x2adc09)),console['log'](),_0x4e48d2[_0x2f74ab(0x77)]({'name':_0x48db31['name'],'status':'ERROR','reason':_0x2adc09,'timestamp':new Date()[_0x2f74ab(0xce)](),'duration_ms':0x0});}}const _0x4375bb=Date['now']()-_0x3156e3,_0x480106=_0x4e48d2['filter'](_0x2d9cb4=>_0x2d9cb4[_0x2f74ab(0xf4)]===_0x2f74ab(0xd0))['length'],_0x18e041=_0x4e48d2[_0x2f74ab(0xcb)](_0x154991=>_0x154991[_0x2f74ab(0xf4)]===_0x2f74ab(0x10a))[_0x2f74ab(0xa6)],_0x1f679a=_0x4e48d2[_0x2f74ab(0xcb)](_0x2c42b2=>_0x2c42b2[_0x2f74ab(0xf4)]===_0x2f74ab(0xae))[_0x2f74ab(0xa6)];console[_0x2f74ab(0x104)]('━'['repeat'](0x3c)),console[_0x2f74ab(0x104)]('Test\x20Summary'),console[_0x2f74ab(0x104)]('━'[_0x2f74ab(0xb7)](0x3c)),console[_0x2f74ab(0x104)](_0x2f74ab(0xca)+_0x4e48d2[_0x2f74ab(0xa6)]),console[_0x2f74ab(0x104)](_0x2f74ab(0xc2)+a5_0x17bfe6['green'](_0x480106)),console[_0x2f74ab(0x104)](_0x2f74ab(0xbc)+a5_0x17bfe6[_0x2f74ab(0xb1)](_0x18e041));_0x1f679a>0x0&&console[_0x2f74ab(0x104)]('Errors:\x20\x20\x20'+a5_0x17bfe6[_0x2f74ab(0xb1)](_0x1f679a));console[_0x2f74ab(0x104)](_0x2f74ab(0xea)+formatElapsed(_0x4375bb)),console[_0x2f74ab(0x104)]('━'[_0x2f74ab(0xb7)](0x3c));const _0x459100=_0x4e48d2[_0x2f74ab(0xcb)](_0x11d1b0=>_0x11d1b0[_0x2f74ab(0xf4)]!==_0x2f74ab(0xd0));if(_0x459100[_0x2f74ab(0xa6)]>0x0){console[_0x2f74ab(0x104)](),console[_0x2f74ab(0x104)](_0x2f74ab(0xfd));for(const _0x48cfb0 of _0x459100){const _0x19f818=a5_0x17bfe6[_0x2f74ab(0xb1)]('✗'),_0x4f8084=_0x48cfb0['reason'][_0x2f74ab(0xa6)]>0x32?_0x48cfb0['reason']['substring'](0x0,0x32)+_0x2f74ab(0xaa):_0x48cfb0[_0x2f74ab(0xfb)];console['log']('\x20\x20'+_0x19f818+'\x20'+_0x48cfb0['name']+':\x20'+_0x4f8084);}}const _0x221026={'summary':{'total':_0x4e48d2['length'],'passed':_0x480106,'failed':_0x18e041,'errors':_0x1f679a>0x0?_0x1f679a:undefined,'duration_ms':_0x4375bb},'tests':_0x4e48d2,'agent':{'project':_0x5ab469[_0x2f74ab(0xd6)],'name':_0x5ab469[_0x2f74ab(0xb8)],'site':_0x5f314f},'timestamp':new Date(_0x3156e3)[_0x2f74ab(0xce)]()};try{const _0x206927=buildCachedTestRun(_0x5ae1fa,{'site':_0x5f314f,'projectId':_0x248269,'projectName':_0x5ab469[_0x2f74ab(0xd6)],'agentId':_0x25821a,'agentName':_0x5ab469[_0x2f74ab(0xb8)],'testYmlPath':a5_0x564877[_0x2f74ab(0x7d)](_0x5ab469[_0x2f74ab(0xd3)])});saveLastTestRun(_0x206927);}catch{}if(_0x26fe31!==_0x2f74ab(0xe7)||_0x1ec630){const _0x377863=formatResults(_0x221026,_0x26fe31);if(_0x1ec630)try{a5_0x1e08d7[_0x2f74ab(0xc6)](_0x1ec630,_0x377863,_0x2f74ab(0x97)),console[_0x2f74ab(0x104)](),console['log'](a5_0x17bfe6[_0x2f74ab(0x87)]('Output\x20written\x20to:\x20'+_0x1ec630));}catch(_0xf8ee6d){return console['log'](),console[_0x2f74ab(0x104)](a5_0x17bfe6[_0x2f74ab(0xb1)](_0x2f74ab(0x99)+_0xf8ee6d)),0x1;}else console[_0x2f74ab(0x104)](),console['log'](_0x377863);}return _0x459100['length']>0x0?0x1:0x0;}async[a5_0x27db88(0x106)](_0x4ad881,_0x249042){const _0x1fbb70=a5_0x27db88,{options:_0x32f7c5,tdx:_0x3c4ed6}=_0x4ad881,{definition:_0x57f201,agentInfo:_0xa9cccd,outputFormat:_0x3709bf,outputFile:_0x45098a}=_0x249042,_0x2110d6=_0x32f7c5['site'],_0x42d27b=loadLastTestRun();if(!_0x42d27b)return console[_0x1fbb70(0x104)](a5_0x17bfe6['red'](_0x1fbb70(0xb9))),console[_0x1fbb70(0x104)](a5_0x17bfe6['dim'](_0x1fbb70(0xe2))),0x1;if(_0x42d27b[_0x1fbb70(0x82)][_0x1fbb70(0xb8)]!==_0xa9cccd[_0x1fbb70(0xb8)])return console['log'](a5_0x17bfe6[_0x1fbb70(0xb1)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x42d27b[_0x1fbb70(0x82)][_0x1fbb70(0xb8)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0xa9cccd[_0x1fbb70(0xb8)]+'\x22.')),console[_0x1fbb70(0x104)](a5_0x17bfe6[_0x1fbb70(0x87)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x1e7bc2=new Set(_0x42d27b[_0x1fbb70(0xb0)]['map'](_0x590c7e=>_0x590c7e['testName'])),_0x1e1d59=_0x57f201['tests']['filter'](_0x352ada=>!_0x1e7bc2[_0x1fbb70(0xbb)](_0x352ada[_0x1fbb70(0x10c)]));if(_0x1e1d59['length']>0x0&&_0x42d27b[_0x1fbb70(0x83)]!==_0x2110d6)return console[_0x1fbb70(0x104)](a5_0x17bfe6[_0x1fbb70(0xb1)](_0x1fbb70(0xf3))),console[_0x1fbb70(0x104)](a5_0x17bfe6[_0x1fbb70(0x87)](_0x1fbb70(0xdb)+_0x42d27b[_0x1fbb70(0x83)]+_0x1fbb70(0xda)+_0x2110d6+'\x22.')),console['log'](a5_0x17bfe6[_0x1fbb70(0x87)]('Either\x20switch\x20to\x20the\x20\x22'+_0x42d27b['site']+_0x1fbb70(0x90))),0x1;const _0x165ec5=_0x57f201[_0x1fbb70(0x91)][_0x1fbb70(0xcb)](_0x71f9b5=>_0x1e7bc2[_0x1fbb70(0xbb)](_0x71f9b5[_0x1fbb70(0x10c)])),_0x1254a1=_0x1e1d59;let _0xa6163;try{_0xa6163=await setupEvaluatorAgent(_0x3c4ed6['llm'],_0x32f7c5[_0x1fbb70(0x8b)]);}catch(_0x4b7093){const _0x29a270=_0x4b7093 instanceof Error?_0x4b7093[_0x1fbb70(0xff)]:String(_0x4b7093);return console[_0x1fbb70(0x104)](a5_0x17bfe6[_0x1fbb70(0xb1)](_0x1fbb70(0x92)+_0x29a270)),0x1;}console['log'](a5_0x17bfe6[_0x1fbb70(0x101)](_0x1fbb70(0x100))),console[_0x1fbb70(0x104)](_0x1fbb70(0x9d)+a5_0x17bfe6[_0x1fbb70(0xd2)](_0x42d27b[_0x1fbb70(0xc4)])),console[_0x1fbb70(0x104)](_0x1fbb70(0xa0)+a5_0x17bfe6[_0x1fbb70(0xd2)](_0x42d27b[_0x1fbb70(0x82)]['projectName']+'/'+_0x42d27b[_0x1fbb70(0x82)]['agentName']));_0x1254a1[_0x1fbb70(0xa6)]>0x0&&console['log'](_0x1fbb70(0xcf)+a5_0x17bfe6[_0x1fbb70(0xd9)](_0x1254a1[_0x1fbb70(0xa6)]));console['log']();const _0x160f2b=[],_0x343ba3=Date[_0x1fbb70(0x10f)](),_0x2a8abf=createCommandSpinner(_0x1fbb70(0xf1));if(_0x165ec5[_0x1fbb70(0xa6)]>0x0)try{const _0x21ae3c=await reevaluateFromCache(_0x3c4ed6[_0x1fbb70(0x86)],_0x42d27b,{'tests':_0x165ec5},{'evaluatorId':_0xa6163,'onTestStart':(_0xdfc55f,_0x467b36,_0x2b470e)=>{const _0x14d275=_0x1fbb70;_0x2a8abf['text']=_0x14d275(0x9e)+(_0x467b36+0x1)+'/'+_0x2b470e+':\x20'+_0xdfc55f+_0x14d275(0xaa);if(!_0x2a8abf[_0x14d275(0xa9)])_0x2a8abf[_0x14d275(0xbe)]();},'onTestComplete':(_0x50dfcc,_0x52071e)=>{const _0x599a28=_0x1fbb70;_0x2a8abf['stop']();if(_0x52071e[_0x599a28(0xf4)]===_0x599a28(0xd0))console[_0x599a28(0x104)](a5_0x17bfe6[_0x599a28(0x89)](_0x599a28(0x93)+_0x50dfcc)+a5_0x17bfe6['dim'](_0x599a28(0x73)));else _0x52071e[_0x599a28(0xf4)]===_0x599a28(0x10a)?console[_0x599a28(0x104)](a5_0x17bfe6[_0x599a28(0xb1)]('✗\x20FAIL:\x20'+_0x50dfcc+'\x20-\x20'+_0x52071e[_0x599a28(0xfb)])+a5_0x17bfe6[_0x599a28(0x87)](_0x599a28(0x73))):console[_0x599a28(0x104)](a5_0x17bfe6['red'](_0x599a28(0x10e)+_0x50dfcc+_0x599a28(0xc0)+_0x52071e[_0x599a28(0xfb)]));_0x52071e[_0x599a28(0x109)]&&console[_0x599a28(0x104)](a5_0x17bfe6[_0x599a28(0x87)](_0x599a28(0xd4)+_0x52071e[_0x599a28(0x109)])),_0x160f2b[_0x599a28(0x77)](_0x52071e);},'onTestSkipped':(_0x130084,_0x349c04)=>{const _0x18f765=_0x1fbb70;_0x2a8abf[_0x18f765(0xad)](),console['log'](a5_0x17bfe6[_0x18f765(0xd9)](_0x18f765(0xe9)+_0x130084+_0x18f765(0xc0)+_0x349c04));}});for(const _0x235183 of _0x21ae3c){!_0x160f2b[_0x1fbb70(0xd5)](_0x5f1787=>_0x5f1787[_0x1fbb70(0x10c)]===_0x235183[_0x1fbb70(0x10c)])&&_0x160f2b[_0x1fbb70(0x77)](_0x235183);}}catch(_0x2c93a6){_0x2a8abf['stop']();const _0x243fc4=_0x2c93a6 instanceof Error?_0x2c93a6[_0x1fbb70(0xff)]:String(_0x2c93a6);return console[_0x1fbb70(0x104)](a5_0x17bfe6[_0x1fbb70(0xb1)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x243fc4)),0x1;}_0x2a8abf[_0x1fbb70(0xad)]();if(_0x1254a1[_0x1fbb70(0xa6)]>0x0){console[_0x1fbb70(0x104)](),console[_0x1fbb70(0x104)](a5_0x17bfe6['cyan'](_0x1fbb70(0x81)));const {projectId:_0x369bbc,agentId:_0x4629b6}=_0x42d27b[_0x1fbb70(0x82)];for(const _0x1ff0df of _0x1254a1){console['log'](_0x1fbb70(0x10b)+a5_0x17bfe6[_0x1fbb70(0xd2)](_0x1ff0df['name']));const _0x667140=createCommandSpinner(_0x1fbb70(0xb5)+_0x1ff0df['rounds'][_0x1fbb70(0xa6)]+':\x20Sending\x20user\x20input...');_0x667140['start']();try{const {result:_0x1daf9e}=await runTest(_0x3c4ed6[_0x1fbb70(0x86)],_0x1ff0df,{'agentId':_0x4629b6,'projectId':_0x369bbc,'site':_0x42d27b[_0x1fbb70(0x83)],'noEval':![],'evaluatorId':_0xa6163,'onRoundStart':(_0x6d70ba,_0x43cf5f)=>{const _0x20975d=_0x1fbb70;_0x667140[_0x20975d(0x80)]='Round\x20'+(_0x6d70ba+0x1)+'/'+_0x43cf5f+_0x20975d(0x9f);},'onRoundComplete':(_0x174d67,_0x3eedef,_0x53b542)=>{const _0x44944a=_0x1fbb70,_0x485eca=formatElapsed(_0x3eedef);_0x53b542?console[_0x44944a(0x104)](_0x44944a(0xfe)+(_0x174d67+0x1)+'/'+_0x1ff0df[_0x44944a(0xf2)][_0x44944a(0xa6)]+_0x44944a(0xf5)+a5_0x17bfe6[_0x44944a(0x89)]('✓')+'\x20('+_0x485eca+')'):console['log'](_0x44944a(0xfe)+(_0x174d67+0x1)+'/'+_0x1ff0df[_0x44944a(0xf2)]['length']+_0x44944a(0xf5)+a5_0x17bfe6[_0x44944a(0xb1)]('✗'));},'onEvaluationStart':()=>{_0x667140['text']='Evaluating\x20response...';},'onEvaluationComplete':_0xd609c3=>{const _0x504d15=_0x1fbb70,_0x1b7dbc=formatElapsed(_0xd609c3);console['log'](_0x504d15(0x78)+a5_0x17bfe6['green']('✓')+'\x20('+_0x1b7dbc+')');}});_0x667140['stop'](),_0x160f2b[_0x1fbb70(0x77)](_0x1daf9e);if(_0x1daf9e['status']===_0x1fbb70(0xd0))console[_0x1fbb70(0x104)](a5_0x17bfe6['green'](_0x1fbb70(0x93)+_0x1daf9e['reason'])+a5_0x17bfe6[_0x1fbb70(0x87)](_0x1fbb70(0xb3)));else _0x1daf9e[_0x1fbb70(0xf4)]===_0x1fbb70(0x10a)?console['log'](a5_0x17bfe6[_0x1fbb70(0xb1)](_0x1fbb70(0xec)+_0x1daf9e[_0x1fbb70(0xfb)])+a5_0x17bfe6[_0x1fbb70(0x87)](_0x1fbb70(0xb3))):console['log'](a5_0x17bfe6[_0x1fbb70(0xb1)](_0x1fbb70(0x10e)+_0x1daf9e[_0x1fbb70(0xfb)]));_0x1daf9e[_0x1fbb70(0x109)]&&console[_0x1fbb70(0x104)](a5_0x17bfe6[_0x1fbb70(0x87)](_0x1fbb70(0xd4)+_0x1daf9e[_0x1fbb70(0x109)]));}catch(_0x129da9){_0x667140[_0x1fbb70(0xad)]();const _0x56ccb0=_0x129da9 instanceof Error?_0x129da9[_0x1fbb70(0xff)]:String(_0x129da9);console[_0x1fbb70(0x104)](a5_0x17bfe6[_0x1fbb70(0xb1)]('✗\x20ERROR:\x20'+_0x56ccb0)),_0x160f2b['push']({'name':_0x1ff0df[_0x1fbb70(0x10c)],'status':_0x1fbb70(0xae),'reason':_0x56ccb0,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x1fbb70(0x104)]();const _0x24fd09=Date[_0x1fbb70(0x10f)]()-_0x343ba3,_0x4f6c7a=_0x160f2b[_0x1fbb70(0xcb)](_0x131cf9=>_0x131cf9[_0x1fbb70(0xf4)]===_0x1fbb70(0xd0))[_0x1fbb70(0xa6)],_0x11295a=_0x160f2b[_0x1fbb70(0xcb)](_0x196211=>_0x196211[_0x1fbb70(0xf4)]===_0x1fbb70(0x10a))[_0x1fbb70(0xa6)],_0x1d1257=_0x160f2b[_0x1fbb70(0xcb)](_0x28104b=>_0x28104b[_0x1fbb70(0xf4)]===_0x1fbb70(0xae))[_0x1fbb70(0xa6)];console[_0x1fbb70(0x104)]('━'['repeat'](0x3c)),console[_0x1fbb70(0x104)](_0x1fbb70(0xdf)),console[_0x1fbb70(0x104)]('━'[_0x1fbb70(0xb7)](0x3c)),console[_0x1fbb70(0x104)](_0x1fbb70(0xca)+_0x160f2b[_0x1fbb70(0xa6)]),console[_0x1fbb70(0x104)](_0x1fbb70(0xc2)+a5_0x17bfe6['green'](_0x4f6c7a)),console[_0x1fbb70(0x104)](_0x1fbb70(0xbc)+a5_0x17bfe6[_0x1fbb70(0xb1)](_0x11295a));_0x1d1257>0x0&&console[_0x1fbb70(0x104)](_0x1fbb70(0xde)+a5_0x17bfe6[_0x1fbb70(0xb1)](_0x1d1257));console['log'](_0x1fbb70(0xea)+formatElapsed(_0x24fd09)),console[_0x1fbb70(0x104)]('━'[_0x1fbb70(0xb7)](0x3c));const _0x189bac={'summary':{'total':_0x160f2b[_0x1fbb70(0xa6)],'passed':_0x4f6c7a,'failed':_0x11295a,'errors':_0x1d1257>0x0?_0x1d1257:undefined,'duration_ms':_0x24fd09},'tests':_0x160f2b,'agent':{'project':_0xa9cccd[_0x1fbb70(0xd6)],'name':_0xa9cccd['agentName'],'site':_0x2110d6},'timestamp':new Date(_0x343ba3)[_0x1fbb70(0xce)]()};if(_0x3709bf!==_0x1fbb70(0xe7)||_0x45098a){const _0x3b2585=formatResults(_0x189bac,_0x3709bf);if(_0x45098a)try{a5_0x1e08d7['writeFileSync'](_0x45098a,_0x3b2585,_0x1fbb70(0x97)),console[_0x1fbb70(0x104)](),console[_0x1fbb70(0x104)](a5_0x17bfe6[_0x1fbb70(0x87)]('Output\x20written\x20to:\x20'+_0x45098a));}catch(_0x4611eb){return console[_0x1fbb70(0x104)](),console[_0x1fbb70(0x104)](a5_0x17bfe6['red'](_0x1fbb70(0x99)+_0x4611eb)),0x1;}else console[_0x1fbb70(0x104)](),console[_0x1fbb70(0x104)](_0x3b2585);}const _0x43e887=_0x160f2b[_0x1fbb70(0xcb)](_0xdb71=>_0xdb71[_0x1fbb70(0xf4)]!==_0x1fbb70(0xd0));return _0x43e887[_0x1fbb70(0xa6)]>0x0?0x1:0x0;}}
1
+ const a5_0x261051=a5_0x563a;(function(_0xcd88e7,_0x9dff04){const _0x3e4ded=a5_0x563a,_0xf3cc13=_0xcd88e7();while(!![]){try{const _0x1502c7=parseInt(_0x3e4ded(0x135))/0x1+parseInt(_0x3e4ded(0x111))/0x2+-parseInt(_0x3e4ded(0xfd))/0x3+parseInt(_0x3e4ded(0x10d))/0x4*(parseInt(_0x3e4ded(0x17d))/0x5)+parseInt(_0x3e4ded(0x138))/0x6+-parseInt(_0x3e4ded(0x107))/0x7+-parseInt(_0x3e4ded(0x169))/0x8;if(_0x1502c7===_0x9dff04)break;else _0xf3cc13['push'](_0xf3cc13['shift']());}catch(_0x196f15){_0xf3cc13['push'](_0xf3cc13['shift']());}}}(a5_0x4634,0x947f2));import*as a5_0x11b1ef from'node:fs';function a5_0x4634(){const _0x49200d=['6570080QvGTav','...','reason','Tests\x20found:\x20','Evaluating\x20response...','join','dryRun','Errors:\x20\x20\x20','stop','Round\x201/','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','resolve','no_tests','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','white','Available\x20tests:\x20','found','eval','toISOString','250715rJLDVJ','trim','✗\x20ERROR:\x20','/<agent-name>','includes','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','dim','tsv','Total:\x20\x20\x20\x20','name','timestamp','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','start','llmProject','Executing\x20new\x20tests...','not\x20found','\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','2352711CzoTfJ','writeFileSync','\x22:\x20','execute','Output\x20written\x20to:\x20','agentName','some','\x20\x20Round\x20','PASS','testName','5481105rCNfUF','Duration:\x20','split','\x20\x20Project:\x20','ERROR','text','28WiCBan','resolveProjectId','push','agent','2107936KjeqkU','red','\x20(new)','length','llm','Agent:\x20','round','table','Test\x20','forEach','isSpinning','Run\x20\x27tdx\x20agent\x20pull\x20','No\x20tests\x20have\x20tags\x20defined.','Test\x20Summary','conversations','executeReeval','repeat','map','toLowerCase','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','\x20\x20Conversation:\x20','verbose','404','\x20(cached)','description','now','Running:\x20','rounds','has','⚠\x20SKIPPED:\x20','jsonl','log','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Site:\x20','json','1121633mplKoW','✗\x20FAIL:\x20','Project\x20path:\x20','2820912DqQlNG','\x27\x20to\x20create\x20the\x20folder\x20structure.','test.yml','utf-8','substring','agent:test','status','size','projectDir','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','\x20\x20Site:\x20','message','Failed\x20Tests:','testYmlPath','conversation_url','tags','✗\x20ERROR:\x20Project\x20not\x20found:\x20','filter','yellow','Cached\x20run\x20is\x20from\x20site\x20\x22','Running\x20agent\x20tests...','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','\x22,\x20but\x20current\x20site\x20is\x20\x22','\x20\x20Evaluating...\x20','green','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','no_context','...\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)','✓\x20PASS:\x20','Error\x20writing\x20output\x20file:\x20','existsSync','No\x20tests\x20found\x20matching:\x20','FAIL','Re-evaluating\x20cached\x20test\x20run...','Re-evaluating...','site','Round\x20','reeval','source','output','Conversation\x20URL:\x20','cyan','Failed:\x20\x20\x20','projectName','\x20\x20-\x20','tests','\x20-\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'];a5_0x4634=function(){return _0x49200d;};return a5_0x4634();}import*as a5_0x266e8f from'node:path';import a5_0x100137 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x563a(_0x2e2d58,_0x39ac4c){_0x2e2d58=_0x2e2d58-0xee;const _0x463471=a5_0x4634();let _0x563a5e=_0x463471[_0x2e2d58];return _0x563a5e;}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x261051(0xf5)]=a5_0x261051(0x13d);[a5_0x261051(0x129)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x261051(0x100)](_0x3c9150){const _0x56d6eb=a5_0x261051,{options:_0x325abe,args:_0xb5ced,tdx:_0x5b80da}=_0x3c9150,_0x5cbcbe=_0xb5ced[0x0]||'.',_0x119f9c=_0x325abe[_0x56d6eb(0x16f)],_0x1657d3=_0x325abe,_0x3ea55e=_0x1657d3[_0x56d6eb(0x17b)]===![],_0x1bf989=_0x1657d3[_0x56d6eb(0x15e)],_0x23b236=_0x1657d3[_0x56d6eb(0xf5)],_0x1f820f=_0x1657d3['tags'],_0x45eca5=_0x325abe[_0x56d6eb(0x15c)],_0x5ab7e6=_0x1657d3[_0x56d6eb(0x160)];if(_0x1bf989&&_0x3ea55e)return console['log'](a5_0x100137[_0x56d6eb(0x112)](_0x56d6eb(0x124))),0x1;let _0x86d103=_0x56d6eb(0x118);if(_0x1657d3[_0x56d6eb(0x134)])_0x86d103=_0x56d6eb(0x134);else{if(_0x1657d3[_0x56d6eb(0x12f)])_0x86d103='jsonl';else{if(_0x1657d3[_0x56d6eb(0xf3)])_0x86d103=_0x56d6eb(0xf3);else{if(_0x1657d3[_0x56d6eb(0x118)])_0x86d103=_0x56d6eb(0x118);}}}const _0x198b02=_0x1657d3[_0x56d6eb(0xf9)];let _0x139913=_0x5cbcbe;const _0x346a19=a5_0x11b1ef[_0x56d6eb(0x157)](_0x5cbcbe),_0x2e383f=_0x5cbcbe==='.';if(!_0x346a19||_0x2e383f){const _0x1bdf84=resolveProjectFromContext(_0x5cbcbe,_0x198b02,{'requireFile':_0x56d6eb(0x13a)});if(_0x1bdf84[_0x56d6eb(0x17a)])_0x139913=_0x1bdf84[_0x56d6eb(0x140)],_0x1bdf84[_0x56d6eb(0x15f)]==='context'&&console['log'](a5_0x100137[_0x56d6eb(0xf2)]('Using\x20agent:\x20'+_0x139913));else switch(_0x1bdf84['reason']){case _0x56d6eb(0x152):console[_0x56d6eb(0x130)](a5_0x100137[_0x56d6eb(0x14a)](_0x1bdf84['message'])),console[_0x56d6eb(0x130)](),console[_0x56d6eb(0x130)]('Usage:'),console[_0x56d6eb(0x130)](_0x56d6eb(0xfc)),console[_0x56d6eb(0x130)](_0x56d6eb(0x154)),console[_0x56d6eb(0x130)](),console['log'](_0x56d6eb(0xf1));return 0x1;case'no_local_folder':console[_0x56d6eb(0x130)](a5_0x100137[_0x56d6eb(0x14a)](_0x1bdf84['message'])),console[_0x56d6eb(0x130)](),console[_0x56d6eb(0x130)](_0x56d6eb(0x11c)+_0x1bdf84[_0x56d6eb(0xf9)]+_0x56d6eb(0x139));return 0x1;case'multiple_agents':{const _0x21f873=a5_0x266e8f['basename'](_0x1bdf84[_0x56d6eb(0x140)]);console[_0x56d6eb(0x130)](a5_0x100137['yellow'](_0x56d6eb(0x168)+_0x1bdf84['llmProject']+'\x22:'));for(const _0x4bd6bb of _0x1bdf84['agentDirs']){console[_0x56d6eb(0x130)](_0x56d6eb(0x165)+_0x4bd6bb);}return console[_0x56d6eb(0x130)](),console[_0x56d6eb(0x130)](_0x56d6eb(0x176)+_0x21f873+_0x56d6eb(0xef)),0x1;}case _0x56d6eb(0x175):console[_0x56d6eb(0x130)](a5_0x100137[_0x56d6eb(0x14a)](_0x56d6eb(0xf7)+_0x1bdf84[_0x56d6eb(0xf9)]+'\x22.')),console[_0x56d6eb(0x130)](a5_0x100137['dim'](_0x56d6eb(0x137)+_0x1bdf84[_0x56d6eb(0x140)])),console[_0x56d6eb(0x130)](),console[_0x56d6eb(0x130)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0xcabc90,agentInfo:_0x5c394f}=parseTestFile(_0x139913);let _0x23940d=_0xcabc90['tests'];if(_0x23b236){const _0x3227d0=_0x23b236[_0x56d6eb(0x109)](',')['map'](_0x1f54d9=>_0x1f54d9[_0x56d6eb(0x17e)]());_0x23940d=_0xcabc90[_0x56d6eb(0x166)]['filter'](_0x293e59=>_0x3227d0[_0x56d6eb(0xf0)](_0x293e59[_0x56d6eb(0xf5)]));if(_0x23940d[_0x56d6eb(0x114)]===0x0)return console['log'](a5_0x100137[_0x56d6eb(0x14a)](_0x56d6eb(0x158)+_0x23b236)),console[_0x56d6eb(0x130)](a5_0x100137[_0x56d6eb(0xf2)](_0x56d6eb(0x179)+_0xcabc90[_0x56d6eb(0x166)][_0x56d6eb(0x122)](_0x55be65=>_0x55be65[_0x56d6eb(0xf5)])['join'](',\x20'))),0x1;}if(_0x1f820f){const _0x4fea7f=_0x1f820f[_0x56d6eb(0x109)](',')['map'](_0x40af71=>_0x40af71['trim']()[_0x56d6eb(0x123)]());_0x23940d=_0x23940d[_0x56d6eb(0x149)](_0x5d7699=>_0x5d7699[_0x56d6eb(0x147)]?.[_0x56d6eb(0x103)](_0x104bd3=>_0x4fea7f[_0x56d6eb(0xf0)](_0x104bd3[_0x56d6eb(0x123)]())));if(_0x23940d['length']===0x0){console[_0x56d6eb(0x130)](a5_0x100137[_0x56d6eb(0x14a)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x1f820f));const _0x4e8349=new Set();return _0xcabc90[_0x56d6eb(0x166)][_0x56d6eb(0x11a)](_0x154dc8=>_0x154dc8[_0x56d6eb(0x147)]?.['forEach'](_0xc6d3f9=>_0x4e8349['add'](_0xc6d3f9))),_0x4e8349[_0x56d6eb(0x13f)]>0x0?console[_0x56d6eb(0x130)](a5_0x100137[_0x56d6eb(0xf2)]('Available\x20tags:\x20'+[..._0x4e8349][_0x56d6eb(0x16e)](',\x20'))):console[_0x56d6eb(0x130)](a5_0x100137[_0x56d6eb(0xf2)](_0x56d6eb(0x11d))),0x1;}}if(_0x1bf989)return this[_0x56d6eb(0x120)](_0x3c9150,{'definition':{'tests':_0x23940d},'agentInfo':_0x5c394f,'outputFormat':_0x86d103,'outputFile':_0x5ab7e6,'testNames':_0x23b236});if(_0x119f9c){console['log'](a5_0x100137[_0x56d6eb(0x162)]('Test\x20Configuration:')),console[_0x56d6eb(0x130)](_0x56d6eb(0x142)+a5_0x100137['white'](_0x45eca5)),console[_0x56d6eb(0x130)](_0x56d6eb(0x10a)+a5_0x100137['white'](_0x5c394f[_0x56d6eb(0x164)])),console[_0x56d6eb(0x130)]('\x20\x20Agent:\x20'+a5_0x100137['white'](_0x5c394f[_0x56d6eb(0x102)])),console[_0x56d6eb(0x130)](),console[_0x56d6eb(0x130)](_0x56d6eb(0x16c)+a5_0x100137[_0x56d6eb(0x178)](_0x23940d['length']));for(let _0x462b04=0x0;_0x462b04<_0x23940d[_0x56d6eb(0x114)];_0x462b04++){const _0x14d166=_0x23940d[_0x462b04],_0x6e1fe0=_0x14d166['rounds']['length']===0x1?_0x56d6eb(0x117):_0x56d6eb(0x12c),_0x25fd6b=_0x14d166[_0x56d6eb(0x147)]?.[_0x56d6eb(0x114)]?'\x20['+_0x14d166['tags']['join'](',\x20')+']':'';console['log']('\x20\x20'+(_0x462b04+0x1)+'.\x20'+a5_0x100137['white'](_0x14d166[_0x56d6eb(0xf5)])+'\x20('+_0x14d166[_0x56d6eb(0x12c)][_0x56d6eb(0x114)]+'\x20'+_0x6e1fe0+')'+a5_0x100137['dim'](_0x25fd6b));}return 0x0;}let _0x2f62ce,_0x33997d;try{_0x2f62ce=await _0x5b80da[_0x56d6eb(0x115)][_0x56d6eb(0x10e)](_0x5c394f['projectName']);}catch(_0x4e165a){const _0x35b3dc=_0x4e165a instanceof Error?_0x4e165a[_0x56d6eb(0x143)]:String(_0x4e165a);return _0x35b3dc[_0x56d6eb(0xf0)](_0x56d6eb(0x127))||_0x35b3dc[_0x56d6eb(0x123)]()['includes'](_0x56d6eb(0xfb))?console['log'](a5_0x100137[_0x56d6eb(0x112)](_0x56d6eb(0x148)+_0x5c394f[_0x56d6eb(0x164)])):console[_0x56d6eb(0x130)](a5_0x100137[_0x56d6eb(0x112)](_0x56d6eb(0x141)+_0x5c394f['projectName']+_0x56d6eb(0xff)+_0x35b3dc)),0x1;}try{_0x33997d=await _0x5b80da['llm']['resolveAgentId'](_0x5c394f['agentName'],_0x2f62ce);}catch(_0x3e7b28){const _0x227269=_0x3e7b28 instanceof Error?_0x3e7b28[_0x56d6eb(0x143)]:String(_0x3e7b28);return _0x227269['includes'](_0x56d6eb(0x127))||_0x227269[_0x56d6eb(0x123)]()[_0x56d6eb(0xf0)](_0x56d6eb(0xfb))?console['log'](a5_0x100137[_0x56d6eb(0x112)](_0x56d6eb(0x131)+_0x5c394f[_0x56d6eb(0x102)])):console[_0x56d6eb(0x130)](a5_0x100137[_0x56d6eb(0x112)](_0x56d6eb(0x151)+_0x5c394f[_0x56d6eb(0x102)]+_0x56d6eb(0xff)+_0x227269)),0x1;}let _0x2cc5a8;if(!_0x3ea55e)try{_0x2cc5a8=await setupEvaluatorAgent(_0x5b80da[_0x56d6eb(0x115)],_0x325abe['verbose']);}catch(_0x1d66dd){const _0x2e3896=_0x1d66dd instanceof Error?_0x1d66dd['message']:String(_0x1d66dd);return console[_0x56d6eb(0x130)](a5_0x100137[_0x56d6eb(0x112)](_0x56d6eb(0x132)+_0x2e3896)),0x1;}console[_0x56d6eb(0x130)](a5_0x100137[_0x56d6eb(0x162)](_0x56d6eb(0x14c))),console[_0x56d6eb(0x130)](_0x56d6eb(0x133)+a5_0x100137[_0x56d6eb(0x178)](_0x45eca5)),console[_0x56d6eb(0x130)]('Agent:\x20'+a5_0x100137['white'](_0x5c394f[_0x56d6eb(0x164)]+'/'+_0x5c394f['agentName'])),console[_0x56d6eb(0x130)]();const _0x14d7ea=[],_0x18348a=[],_0x119c1e=Date[_0x56d6eb(0x12a)]();for(let _0x42f977=0x0;_0x42f977<_0x23940d[_0x56d6eb(0x114)];_0x42f977++){const _0x3dd070=_0x23940d[_0x42f977];_0x23940d[_0x56d6eb(0x114)]>0x1?console['log'](_0x56d6eb(0x119)+(_0x42f977+0x1)+'/'+_0x23940d[_0x56d6eb(0x114)]+':\x20'+a5_0x100137[_0x56d6eb(0x178)](_0x3dd070['name'])):console[_0x56d6eb(0x130)]('Running\x20test:\x20'+a5_0x100137[_0x56d6eb(0x178)](_0x3dd070[_0x56d6eb(0xf5)]));const _0xf2efb7=createCommandSpinner(_0x56d6eb(0x172)+_0x3dd070[_0x56d6eb(0x12c)][_0x56d6eb(0x114)]+':\x20Sending\x20user\x20input...');_0xf2efb7[_0x56d6eb(0xf8)]();try{const {result:_0x4129ca,conversation:_0x52f380}=await runTest(_0x5b80da[_0x56d6eb(0x115)],_0x3dd070,{'agentId':_0x33997d,'projectId':_0x2f62ce,'site':_0x45eca5,'noEval':_0x3ea55e,'evaluatorId':_0x2cc5a8,'onRoundStart':(_0x3833d7,_0x5b8f2f)=>{const _0xb1550a=_0x56d6eb;_0xf2efb7[_0xb1550a(0x10c)]=_0xb1550a(0x15d)+(_0x3833d7+0x1)+'/'+_0x5b8f2f+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x17db59,_0x17ac3a,_0x354eab)=>{const _0x299be8=_0x56d6eb,_0x143711=formatElapsed(_0x17ac3a);_0x354eab?console[_0x299be8(0x130)]('\x20\x20Round\x20'+(_0x17db59+0x1)+'/'+_0x3dd070['rounds'][_0x299be8(0x114)]+_0x299be8(0x153)+a5_0x100137['green']('✓')+'\x20('+_0x143711+')'):console[_0x299be8(0x130)](_0x299be8(0x104)+(_0x17db59+0x1)+'/'+_0x3dd070[_0x299be8(0x12c)][_0x299be8(0x114)]+_0x299be8(0x153)+a5_0x100137['red']('✗'));},'onEvaluationStart':()=>{const _0x22bb85=_0x56d6eb;_0xf2efb7['text']=_0x22bb85(0x16d);},'onEvaluationComplete':_0x5b6c3d=>{const _0xee65fc=_0x56d6eb,_0x2b0d11=formatElapsed(_0x5b6c3d);console['log']('\x20\x20Evaluating...\x20'+a5_0x100137[_0xee65fc(0x150)]('✓')+'\x20('+_0x2b0d11+')');}});_0xf2efb7[_0x56d6eb(0x171)](),_0x14d7ea[_0x56d6eb(0x10f)](_0x4129ca),_0x18348a['push'](_0x52f380);if(_0x4129ca['status']===_0x56d6eb(0x105))console[_0x56d6eb(0x130)](a5_0x100137[_0x56d6eb(0x150)](_0x56d6eb(0x155)+_0x4129ca['reason']));else _0x4129ca[_0x56d6eb(0x13e)]==='FAIL'?console[_0x56d6eb(0x130)](a5_0x100137['red'](_0x56d6eb(0x136)+_0x4129ca['reason'])):console['log'](a5_0x100137['red']('✗\x20ERROR:\x20'+_0x4129ca[_0x56d6eb(0x16b)]));_0x4129ca[_0x56d6eb(0x146)]&&console[_0x56d6eb(0x130)](a5_0x100137[_0x56d6eb(0xf2)](_0x56d6eb(0x161)+_0x4129ca[_0x56d6eb(0x146)])),console[_0x56d6eb(0x130)]();}catch(_0x17ecde){_0xf2efb7[_0x56d6eb(0x171)]();const _0x2b23b5=_0x17ecde instanceof Error?_0x17ecde[_0x56d6eb(0x143)]:String(_0x17ecde);console[_0x56d6eb(0x130)](a5_0x100137[_0x56d6eb(0x112)](_0x56d6eb(0xee)+_0x2b23b5)),console[_0x56d6eb(0x130)](),_0x14d7ea[_0x56d6eb(0x10f)]({'name':_0x3dd070[_0x56d6eb(0xf5)],'status':_0x56d6eb(0x10b),'reason':_0x2b23b5,'timestamp':new Date()[_0x56d6eb(0x17c)](),'duration_ms':0x0});}}const _0x2f0550=Date[_0x56d6eb(0x12a)]()-_0x119c1e,_0x410546=_0x14d7ea[_0x56d6eb(0x149)](_0x45bbba=>_0x45bbba[_0x56d6eb(0x13e)]===_0x56d6eb(0x105))[_0x56d6eb(0x114)],_0x25326b=_0x14d7ea[_0x56d6eb(0x149)](_0x154636=>_0x154636['status']===_0x56d6eb(0x159))[_0x56d6eb(0x114)],_0x5ef6e8=_0x14d7ea['filter'](_0x53f963=>_0x53f963[_0x56d6eb(0x13e)]===_0x56d6eb(0x10b))['length'];console[_0x56d6eb(0x130)]('━'[_0x56d6eb(0x121)](0x3c)),console['log'](_0x56d6eb(0x11e)),console['log']('━'[_0x56d6eb(0x121)](0x3c)),console[_0x56d6eb(0x130)](_0x56d6eb(0xf4)+_0x14d7ea[_0x56d6eb(0x114)]),console[_0x56d6eb(0x130)]('Passed:\x20\x20\x20'+a5_0x100137[_0x56d6eb(0x150)](_0x410546)),console['log'](_0x56d6eb(0x163)+a5_0x100137[_0x56d6eb(0x112)](_0x25326b));_0x5ef6e8>0x0&&console[_0x56d6eb(0x130)](_0x56d6eb(0x170)+a5_0x100137['red'](_0x5ef6e8));console['log'](_0x56d6eb(0x108)+formatElapsed(_0x2f0550)),console[_0x56d6eb(0x130)]('━'['repeat'](0x3c));const _0x1fcb81=_0x14d7ea[_0x56d6eb(0x149)](_0x1b0f1a=>_0x1b0f1a[_0x56d6eb(0x13e)]!==_0x56d6eb(0x105));if(_0x1fcb81[_0x56d6eb(0x114)]>0x0){console['log'](),console[_0x56d6eb(0x130)](_0x56d6eb(0x144));for(const _0x52a74a of _0x1fcb81){const _0x3b0851=a5_0x100137[_0x56d6eb(0x112)]('✗'),_0x59fa31=_0x52a74a[_0x56d6eb(0x16b)]['length']>0x32?_0x52a74a[_0x56d6eb(0x16b)][_0x56d6eb(0x13c)](0x0,0x32)+_0x56d6eb(0x16a):_0x52a74a['reason'];console[_0x56d6eb(0x130)]('\x20\x20'+_0x3b0851+'\x20'+_0x52a74a[_0x56d6eb(0xf5)]+':\x20'+_0x59fa31);}}const _0x30001c={'summary':{'total':_0x14d7ea['length'],'passed':_0x410546,'failed':_0x25326b,'errors':_0x5ef6e8>0x0?_0x5ef6e8:undefined,'duration_ms':_0x2f0550},'tests':_0x14d7ea,'agent':{'project':_0x5c394f['projectName'],'name':_0x5c394f[_0x56d6eb(0x102)],'site':_0x45eca5},'timestamp':new Date(_0x119c1e)[_0x56d6eb(0x17c)]()};try{const _0x3f7815=buildCachedTestRun(_0x18348a,{'site':_0x45eca5,'projectId':_0x2f62ce,'projectName':_0x5c394f['projectName'],'agentId':_0x33997d,'agentName':_0x5c394f['agentName'],'testYmlPath':a5_0x266e8f[_0x56d6eb(0x174)](_0x5c394f[_0x56d6eb(0x145)])});saveLastTestRun(_0x3f7815);}catch{}if(_0x86d103!==_0x56d6eb(0x118)||_0x5ab7e6){const _0x44f3f0=formatResults(_0x30001c,_0x86d103);if(_0x5ab7e6)try{a5_0x11b1ef[_0x56d6eb(0xfe)](_0x5ab7e6,_0x44f3f0,_0x56d6eb(0x13b)),console[_0x56d6eb(0x130)](),console[_0x56d6eb(0x130)](a5_0x100137['dim'](_0x56d6eb(0x101)+_0x5ab7e6));}catch(_0x167297){return console[_0x56d6eb(0x130)](),console[_0x56d6eb(0x130)](a5_0x100137[_0x56d6eb(0x112)](_0x56d6eb(0x156)+_0x167297)),0x1;}else console[_0x56d6eb(0x130)](),console[_0x56d6eb(0x130)](_0x44f3f0);}return _0x1fcb81[_0x56d6eb(0x114)]>0x0?0x1:0x0;}async[a5_0x261051(0x120)](_0x35e7c0,_0x6dbb5c){const _0x5ba136=a5_0x261051,{options:_0x4556df,tdx:_0x20020b}=_0x35e7c0,{definition:_0x87c397,agentInfo:_0x31c402,outputFormat:_0x285805,outputFile:_0x262f17}=_0x6dbb5c,_0x449a19=_0x4556df['site'],_0x5f2209=loadLastTestRun();if(!_0x5f2209)return console[_0x5ba136(0x130)](a5_0x100137[_0x5ba136(0x112)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x5ba136(0x130)](a5_0x100137['dim']('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x5f2209[_0x5ba136(0x110)]['agentName']!==_0x31c402[_0x5ba136(0x102)])return console[_0x5ba136(0x130)](a5_0x100137[_0x5ba136(0x112)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x5f2209[_0x5ba136(0x110)][_0x5ba136(0x102)]+_0x5ba136(0x14d)+_0x31c402[_0x5ba136(0x102)]+'\x22.')),console[_0x5ba136(0x130)](a5_0x100137[_0x5ba136(0xf2)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x185f71=new Set(_0x5f2209[_0x5ba136(0x11f)][_0x5ba136(0x122)](_0x4c7fe4=>_0x4c7fe4[_0x5ba136(0x106)])),_0x44473e=_0x87c397[_0x5ba136(0x166)]['filter'](_0x5790ef=>!_0x185f71[_0x5ba136(0x12d)](_0x5790ef[_0x5ba136(0xf5)]));if(_0x44473e[_0x5ba136(0x114)]>0x0&&_0x5f2209[_0x5ba136(0x15c)]!==_0x449a19)return console[_0x5ba136(0x130)](a5_0x100137[_0x5ba136(0x112)](_0x5ba136(0x177))),console[_0x5ba136(0x130)](a5_0x100137[_0x5ba136(0xf2)](_0x5ba136(0x14b)+_0x5f2209[_0x5ba136(0x15c)]+_0x5ba136(0x14e)+_0x449a19+'\x22.')),console[_0x5ba136(0x130)](a5_0x100137['dim']('Either\x20switch\x20to\x20the\x20\x22'+_0x5f2209[_0x5ba136(0x15c)]+_0x5ba136(0x173))),0x1;const _0xb35f54=_0x87c397['tests'][_0x5ba136(0x149)](_0x389be1=>_0x185f71[_0x5ba136(0x12d)](_0x389be1[_0x5ba136(0xf5)])),_0x2936fe=_0x44473e;let _0x2d7e79;try{_0x2d7e79=await setupEvaluatorAgent(_0x20020b[_0x5ba136(0x115)],_0x4556df[_0x5ba136(0x126)]);}catch(_0xcb4dee){const _0x4a8548=_0xcb4dee instanceof Error?_0xcb4dee[_0x5ba136(0x143)]:String(_0xcb4dee);return console[_0x5ba136(0x130)](a5_0x100137[_0x5ba136(0x112)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x4a8548)),0x1;}console[_0x5ba136(0x130)](a5_0x100137['cyan'](_0x5ba136(0x15a))),console[_0x5ba136(0x130)]('Cached\x20run\x20from:\x20'+a5_0x100137[_0x5ba136(0x178)](_0x5f2209[_0x5ba136(0xf6)])),console['log'](_0x5ba136(0x116)+a5_0x100137[_0x5ba136(0x178)](_0x5f2209['agent'][_0x5ba136(0x164)]+'/'+_0x5f2209[_0x5ba136(0x110)][_0x5ba136(0x102)]));_0x2936fe['length']>0x0&&console[_0x5ba136(0x130)]('New\x20tests\x20to\x20execute:\x20'+a5_0x100137['yellow'](_0x2936fe[_0x5ba136(0x114)]));console['log']();const _0x1eb9d3=[],_0x4abe25=Date['now'](),_0x1a6aee=createCommandSpinner(_0x5ba136(0x15b));if(_0xb35f54['length']>0x0)try{const _0x217d96=await reevaluateFromCache(_0x20020b[_0x5ba136(0x115)],_0x5f2209,{'tests':_0xb35f54},{'evaluatorId':_0x2d7e79,'onTestStart':(_0x2e253a,_0x2eb2ce,_0x2b930b)=>{const _0x18f13a=_0x5ba136;_0x1a6aee['text']='Re-evaluating\x20'+(_0x2eb2ce+0x1)+'/'+_0x2b930b+':\x20'+_0x2e253a+_0x18f13a(0x16a);if(!_0x1a6aee[_0x18f13a(0x11b)])_0x1a6aee[_0x18f13a(0xf8)]();},'onTestComplete':(_0x2a4e8b,_0x346455)=>{const _0x315377=_0x5ba136;_0x1a6aee[_0x315377(0x171)]();if(_0x346455[_0x315377(0x13e)]==='PASS')console['log'](a5_0x100137[_0x315377(0x150)](_0x315377(0x155)+_0x2a4e8b)+a5_0x100137['dim'](_0x315377(0x128)));else _0x346455[_0x315377(0x13e)]==='FAIL'?console['log'](a5_0x100137[_0x315377(0x112)]('✗\x20FAIL:\x20'+_0x2a4e8b+_0x315377(0x167)+_0x346455[_0x315377(0x16b)])+a5_0x100137[_0x315377(0xf2)](_0x315377(0x128))):console[_0x315377(0x130)](a5_0x100137[_0x315377(0x112)](_0x315377(0xee)+_0x2a4e8b+_0x315377(0x167)+_0x346455['reason']));_0x346455[_0x315377(0x146)]&&console[_0x315377(0x130)](a5_0x100137[_0x315377(0xf2)]('\x20\x20Conversation:\x20'+_0x346455['conversation_url'])),_0x1eb9d3[_0x315377(0x10f)](_0x346455);},'onTestSkipped':(_0x30f288,_0x377949)=>{const _0x2dd38c=_0x5ba136;_0x1a6aee[_0x2dd38c(0x171)](),console[_0x2dd38c(0x130)](a5_0x100137[_0x2dd38c(0x14a)](_0x2dd38c(0x12e)+_0x30f288+_0x2dd38c(0x167)+_0x377949));}});for(const _0x433c02 of _0x217d96){!_0x1eb9d3['find'](_0x11c832=>_0x11c832[_0x5ba136(0xf5)]===_0x433c02[_0x5ba136(0xf5)])&&_0x1eb9d3[_0x5ba136(0x10f)](_0x433c02);}}catch(_0x7dd62c){_0x1a6aee[_0x5ba136(0x171)]();const _0x319573=_0x7dd62c instanceof Error?_0x7dd62c['message']:String(_0x7dd62c);return console[_0x5ba136(0x130)](a5_0x100137['red']('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x319573)),0x1;}_0x1a6aee[_0x5ba136(0x171)]();if(_0x2936fe['length']>0x0){console[_0x5ba136(0x130)](),console[_0x5ba136(0x130)](a5_0x100137[_0x5ba136(0x162)](_0x5ba136(0xfa)));const {projectId:_0x59f3d8,agentId:_0x2ecd6b}=_0x5f2209[_0x5ba136(0x110)];for(const _0x17975f of _0x2936fe){console[_0x5ba136(0x130)](_0x5ba136(0x12b)+a5_0x100137['white'](_0x17975f[_0x5ba136(0xf5)]));const _0x285c98=createCommandSpinner(_0x5ba136(0x172)+_0x17975f[_0x5ba136(0x12c)][_0x5ba136(0x114)]+':\x20Sending\x20user\x20input...');_0x285c98[_0x5ba136(0xf8)]();try{const {result:_0xe7e451}=await runTest(_0x20020b[_0x5ba136(0x115)],_0x17975f,{'agentId':_0x2ecd6b,'projectId':_0x59f3d8,'site':_0x5f2209[_0x5ba136(0x15c)],'noEval':![],'evaluatorId':_0x2d7e79,'onRoundStart':(_0x529e8b,_0x1db86c)=>{const _0x56e2a0=_0x5ba136;_0x285c98[_0x56e2a0(0x10c)]='Round\x20'+(_0x529e8b+0x1)+'/'+_0x1db86c+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x541fb4,_0x4e2019,_0x4d0ef2)=>{const _0xb9b937=_0x5ba136,_0x4b1f6e=formatElapsed(_0x4e2019);_0x4d0ef2?console[_0xb9b937(0x130)](_0xb9b937(0x104)+(_0x541fb4+0x1)+'/'+_0x17975f[_0xb9b937(0x12c)][_0xb9b937(0x114)]+_0xb9b937(0x153)+a5_0x100137[_0xb9b937(0x150)]('✓')+'\x20('+_0x4b1f6e+')'):console[_0xb9b937(0x130)]('\x20\x20Round\x20'+(_0x541fb4+0x1)+'/'+_0x17975f['rounds'][_0xb9b937(0x114)]+_0xb9b937(0x153)+a5_0x100137['red']('✗'));},'onEvaluationStart':()=>{const _0x59f57b=_0x5ba136;_0x285c98['text']=_0x59f57b(0x16d);},'onEvaluationComplete':_0x2c8e72=>{const _0x3e7a9d=_0x5ba136,_0xd67f1a=formatElapsed(_0x2c8e72);console[_0x3e7a9d(0x130)](_0x3e7a9d(0x14f)+a5_0x100137[_0x3e7a9d(0x150)]('✓')+'\x20('+_0xd67f1a+')');}});_0x285c98[_0x5ba136(0x171)](),_0x1eb9d3['push'](_0xe7e451);if(_0xe7e451[_0x5ba136(0x13e)]===_0x5ba136(0x105))console[_0x5ba136(0x130)](a5_0x100137[_0x5ba136(0x150)](_0x5ba136(0x155)+_0xe7e451[_0x5ba136(0x16b)])+a5_0x100137[_0x5ba136(0xf2)](_0x5ba136(0x113)));else _0xe7e451[_0x5ba136(0x13e)]===_0x5ba136(0x159)?console[_0x5ba136(0x130)](a5_0x100137['red'](_0x5ba136(0x136)+_0xe7e451[_0x5ba136(0x16b)])+a5_0x100137['dim'](_0x5ba136(0x113))):console[_0x5ba136(0x130)](a5_0x100137['red']('✗\x20ERROR:\x20'+_0xe7e451[_0x5ba136(0x16b)]));_0xe7e451[_0x5ba136(0x146)]&&console['log'](a5_0x100137[_0x5ba136(0xf2)](_0x5ba136(0x125)+_0xe7e451[_0x5ba136(0x146)]));}catch(_0x455485){_0x285c98[_0x5ba136(0x171)]();const _0x5c8669=_0x455485 instanceof Error?_0x455485[_0x5ba136(0x143)]:String(_0x455485);console['log'](a5_0x100137[_0x5ba136(0x112)](_0x5ba136(0xee)+_0x5c8669)),_0x1eb9d3[_0x5ba136(0x10f)]({'name':_0x17975f[_0x5ba136(0xf5)],'status':_0x5ba136(0x10b),'reason':_0x5c8669,'timestamp':new Date()[_0x5ba136(0x17c)](),'duration_ms':0x0});}}}console['log']();const _0x1854b5=Date['now']()-_0x4abe25,_0x5a60ba=_0x1eb9d3[_0x5ba136(0x149)](_0x537062=>_0x537062[_0x5ba136(0x13e)]==='PASS')['length'],_0x10d938=_0x1eb9d3[_0x5ba136(0x149)](_0x3e45f0=>_0x3e45f0[_0x5ba136(0x13e)]===_0x5ba136(0x159))[_0x5ba136(0x114)],_0x24204d=_0x1eb9d3[_0x5ba136(0x149)](_0x130149=>_0x130149[_0x5ba136(0x13e)]===_0x5ba136(0x10b))[_0x5ba136(0x114)];console[_0x5ba136(0x130)]('━'['repeat'](0x3c)),console['log']('Re-evaluation\x20Summary'),console[_0x5ba136(0x130)]('━'[_0x5ba136(0x121)](0x3c)),console[_0x5ba136(0x130)](_0x5ba136(0xf4)+_0x1eb9d3[_0x5ba136(0x114)]),console[_0x5ba136(0x130)]('Passed:\x20\x20\x20'+a5_0x100137[_0x5ba136(0x150)](_0x5a60ba)),console[_0x5ba136(0x130)](_0x5ba136(0x163)+a5_0x100137[_0x5ba136(0x112)](_0x10d938));_0x24204d>0x0&&console[_0x5ba136(0x130)](_0x5ba136(0x170)+a5_0x100137[_0x5ba136(0x112)](_0x24204d));console[_0x5ba136(0x130)]('Duration:\x20'+formatElapsed(_0x1854b5)),console['log']('━'[_0x5ba136(0x121)](0x3c));const _0x471b99={'summary':{'total':_0x1eb9d3[_0x5ba136(0x114)],'passed':_0x5a60ba,'failed':_0x10d938,'errors':_0x24204d>0x0?_0x24204d:undefined,'duration_ms':_0x1854b5},'tests':_0x1eb9d3,'agent':{'project':_0x31c402[_0x5ba136(0x164)],'name':_0x31c402['agentName'],'site':_0x449a19},'timestamp':new Date(_0x4abe25)['toISOString']()};if(_0x285805!==_0x5ba136(0x118)||_0x262f17){const _0x1be368=formatResults(_0x471b99,_0x285805);if(_0x262f17)try{a5_0x11b1ef['writeFileSync'](_0x262f17,_0x1be368,'utf-8'),console[_0x5ba136(0x130)](),console[_0x5ba136(0x130)](a5_0x100137[_0x5ba136(0xf2)](_0x5ba136(0x101)+_0x262f17));}catch(_0x4320c){return console[_0x5ba136(0x130)](),console[_0x5ba136(0x130)](a5_0x100137[_0x5ba136(0x112)](_0x5ba136(0x156)+_0x4320c)),0x1;}else console[_0x5ba136(0x130)](),console[_0x5ba136(0x130)](_0x1be368);}const _0x43f903=_0x1eb9d3[_0x5ba136(0x149)](_0x111c3e=>_0x111c3e[_0x5ba136(0x13e)]!==_0x5ba136(0x105));return _0x43f903[_0x5ba136(0x114)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- function a6_0x2e1c(){const _0x5026aa=['name','error','.\x20Valid\x20types:\x20','set-cookie','api','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','toLowerCase','readBodyFromFile','substring','1247752dsrAVZ','workflow','length','.\x20Valid\x20methods:\x20','message','\x0aStack\x20trace:\x0a','27RfGdHi','indexOf','x-auth-token','792064UdkXAt','572610vabWSB','includes','verbose','toUpperCase','method','request','2256350rGQYfT','keys','color','12ETKzzr','trino','Invalid\x20API\x20type:\x20','file','join','1654488BOsvuF','Endpoint\x20must\x20start\x20with\x20/:\x20','status','82oQfgxJ','PUT','llm','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','Invalid\x20HTTP\x20method:\x20','proxy-authorization','912470fKIFIL','startsWith','40725aUlGXx','output','stack','type','cdp','Invalid\x20header\x20format:\x20\x22','execute','Error:\x20','site','authorization','7CMPhWf','set-cookie2','headers','isArray','data','GET','trim','x-trino-user'];a6_0x2e1c=function(){return _0x5026aa;};return a6_0x2e1c();}const a6_0xbd09ed=a6_0x2a8f;(function(_0x36b10f,_0x314c15){const _0x940ed=a6_0x2a8f,_0x3c277b=_0x36b10f();while(!![]){try{const _0x3c9af2=parseInt(_0x940ed(0xea))/0x1+-parseInt(_0x940ed(0xe4))/0x2*(-parseInt(_0x940ed(0xec))/0x3)+-parseInt(_0x940ed(0x110))/0x4+-parseInt(_0x940ed(0x117))/0x5*(parseInt(_0x940ed(0x11a))/0x6)+-parseInt(_0x940ed(0xf6))/0x7*(-parseInt(_0x940ed(0x107))/0x8)+parseInt(_0x940ed(0x10d))/0x9*(parseInt(_0x940ed(0x111))/0xa)+-parseInt(_0x940ed(0x11f))/0xb;if(_0x3c9af2===_0x314c15)break;else _0x3c277b['push'](_0x3c277b['shift']());}catch(_0xeb37c3){_0x3c277b['push'](_0x3c277b['shift']());}}}(a6_0x2e1c,0x85429));function a6_0x2a8f(_0x56b741,_0x500ef5){_0x56b741=_0x56b741-0xe4;const _0x2e1c39=a6_0x2e1c();let _0x2a8fb1=_0x2e1c39[_0x56b741];return _0x2a8fb1;}import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0xbd09ed(0xf5),a6_0xbd09ed(0xe9),'cookie',a6_0xbd09ed(0x101),a6_0xbd09ed(0xf7),'x-xsrf-token',a6_0xbd09ed(0x10f),a6_0xbd09ed(0xfd)]);function isSensitiveHeader(_0xe5e411){const _0x567cc7=a6_0xbd09ed;return SENSITIVE_HEADERS['has'](_0xe5e411[_0x567cc7(0x104)]());}function parseHeader(_0x2285c6){const _0x10a75f=a6_0xbd09ed,_0x395c8b=_0x2285c6[_0x10a75f(0x10e)](':');if(_0x395c8b===-0x1)throw new Error(_0x10a75f(0xf1)+_0x2285c6+'\x22.\x20'+_0x10a75f(0xe7));const _0x2f0186=_0x2285c6[_0x10a75f(0x106)](0x0,_0x395c8b)[_0x10a75f(0xfc)](),_0x1b72e6=_0x2285c6[_0x10a75f(0x106)](_0x395c8b+0x1)[_0x10a75f(0xfc)]();if(!_0x2f0186)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x2285c6+'\x22');return[_0x2f0186,_0x1b72e6];}export class ApiCommand extends BaseCommand{[a6_0xbd09ed(0xfe)]=a6_0xbd09ed(0x102);['description']=a6_0xbd09ed(0x103);['validate'](_0x4828f8){const _0xaf0cfe=a6_0xbd09ed,{args:_0x19008c,options:_0x3dbfeb}=_0x4828f8,_0x479a23=_0x3dbfeb;if(_0x19008c[_0xaf0cfe(0x109)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x11f61f=_0x19008c[0x0];if(!_0x11f61f[_0xaf0cfe(0xeb)]('/'))return _0xaf0cfe(0x120)+_0x11f61f;const _0x1cf73a=_0x479a23[_0xaf0cfe(0xfa)],_0x517f93=_0x479a23[_0xaf0cfe(0x11d)];if(_0x1cf73a&&_0x517f93)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x645c93=_0x479a23[_0xaf0cfe(0x115)]||_0xaf0cfe(0xfb),_0x24ea84=[_0xaf0cfe(0xfb),'POST',_0xaf0cfe(0xe5),'DELETE','PATCH'];if(!_0x24ea84[_0xaf0cfe(0x112)](_0x645c93[_0xaf0cfe(0x114)]()))return _0xaf0cfe(0xe8)+_0x645c93+_0xaf0cfe(0x10a)+_0x24ea84[_0xaf0cfe(0x11e)](',\x20');const _0x12f8b8=_0x479a23['type']||'td',_0x245093=['td',_0xaf0cfe(0xf0),_0xaf0cfe(0x108),_0xaf0cfe(0x11b),_0xaf0cfe(0xe6),'llm-proxy'];if(!_0x245093[_0xaf0cfe(0x112)](_0x12f8b8))return _0xaf0cfe(0x11c)+_0x12f8b8+_0xaf0cfe(0x100)+_0x245093['join'](',\x20');return undefined;}async[a6_0xbd09ed(0xf2)](_0x63304c){const _0x5cd7da=a6_0xbd09ed,{options:_0x3d4b5b,args:_0x56ceb2,tdx:_0x36dccb}=_0x63304c,_0x2863c6=_0x3d4b5b,_0x57c49c=_0x56ceb2[0x0],_0x53cd0f=(_0x2863c6[_0x5cd7da(0x115)]||_0x5cd7da(0xfb))[_0x5cd7da(0x114)](),_0xeae570=_0x2863c6[_0x5cd7da(0xfa)],_0xe9da8a=_0x2863c6[_0x5cd7da(0x11d)],_0x408eb0=_0x2863c6['header'],_0x3082b9=_0x2863c6[_0x5cd7da(0xef)]||'td';try{const _0x40f214={};if(_0x408eb0){const _0xea8cb3=Array[_0x5cd7da(0xf9)](_0x408eb0)?_0x408eb0:[_0x408eb0];for(const _0x495323 of _0xea8cb3){const [_0x422175,_0x28b55a]=parseHeader(_0x495323);_0x40f214[_0x422175]=_0x28b55a;}}let _0x408f44;if(_0xeae570)_0x408f44=_0xeae570;else{if(_0xe9da8a)try{_0x408f44=RawAPI[_0x5cd7da(0x105)](_0xe9da8a);}catch(_0x58d3c1){return console[_0x5cd7da(0xff)](_0x5cd7da(0xf3)+(_0x58d3c1 instanceof Error?_0x58d3c1[_0x5cd7da(0x10b)]:String(_0x58d3c1))),0x1;}}const _0x474f37={'method':_0x53cd0f,'apiType':_0x3082b9,'includeHeaders':_0x3d4b5b[_0x5cd7da(0x113)]};_0x408f44&&(_0x474f37['body']=_0x408f44);Object[_0x5cd7da(0x118)](_0x40f214)[_0x5cd7da(0x109)]>0x0&&(_0x474f37[_0x5cd7da(0xf8)]=_0x40f214);if(_0x3d4b5b[_0x5cd7da(0x113)]){const _0xcb6728=resolveSite(_0x3d4b5b[_0x5cd7da(0xf4)]),_0x4736a7=getEndpoint(_0xcb6728,_0x3082b9),_0xa7c4b9=''+_0x4736a7+_0x57c49c;console[_0x5cd7da(0xff)]('>\x20'+_0x53cd0f+'\x20'+_0xa7c4b9);const _0x184102=getAuthHeaders(_0xcb6728),_0x117fce={..._0x184102,..._0x40f214};for(const [_0x276cb1,_0x3d3456]of Object['entries'](_0x117fce)){!isSensitiveHeader(_0x276cb1)&&console['error']('>\x20'+_0x276cb1+':\x20'+_0x3d3456);}_0x408f44&&console[_0x5cd7da(0xff)]('>'),console[_0x5cd7da(0xff)]('');}const _0x1f32ad=await _0x36dccb[_0x5cd7da(0x102)][_0x5cd7da(0x116)](_0x57c49c,_0x474f37);if(_0x3d4b5b[_0x5cd7da(0x113)]&&_0x1f32ad[_0x5cd7da(0xf8)]){console['error']('<\x20HTTP/1.1\x20'+_0x1f32ad[_0x5cd7da(0x121)]);for(const [_0x527a52,_0x27b036]of Object['entries'](_0x1f32ad[_0x5cd7da(0xf8)])){!isSensitiveHeader(_0x527a52)&&console[_0x5cd7da(0xff)]('<\x20'+_0x527a52+':\x20'+_0x27b036);}console[_0x5cd7da(0xff)]('');}const _0x524402=Boolean(_0x3d4b5b['output']),_0xc780d0={'color':_0x3d4b5b[_0x5cd7da(0x119)],'noColor':_0x3d4b5b['noColor']||_0x524402&&!_0x3d4b5b[_0x5cd7da(0x119)]},_0x2fd5d8=colorizeJSON(_0x1f32ad[_0x5cd7da(0xfa)],_0xc780d0);return _0x3d4b5b[_0x5cd7da(0xed)]?(writeFileSync(_0x3d4b5b['output'],_0x2fd5d8),console[_0x5cd7da(0xff)]('Results\x20saved\x20to\x20'+_0x3d4b5b[_0x5cd7da(0xed)])):console['log'](_0x2fd5d8),0x0;}catch(_0xd2dc7e){return _0xd2dc7e instanceof Error?(console[_0x5cd7da(0xff)]('Error:\x20'+_0xd2dc7e['message']),_0x3d4b5b[_0x5cd7da(0x113)]&&_0xd2dc7e['stack']&&console[_0x5cd7da(0xff)](_0x5cd7da(0x10c)+_0xd2dc7e[_0x5cd7da(0xee)])):console['error']('Error:\x20'+String(_0xd2dc7e)),0x1;}}}
1
+ const a6_0x7518c0=a6_0x4092;(function(_0x6b307,_0x4430d1){const _0x1bc6df=a6_0x4092,_0x3de789=_0x6b307();while(!![]){try{const _0x113e56=parseInt(_0x1bc6df(0x213))/0x1*(-parseInt(_0x1bc6df(0x233))/0x2)+-parseInt(_0x1bc6df(0x211))/0x3+-parseInt(_0x1bc6df(0x21d))/0x4+-parseInt(_0x1bc6df(0x1f4))/0x5*(parseInt(_0x1bc6df(0x209))/0x6)+-parseInt(_0x1bc6df(0x22e))/0x7+-parseInt(_0x1bc6df(0x21e))/0x8+parseInt(_0x1bc6df(0x220))/0x9;if(_0x113e56===_0x4430d1)break;else _0x3de789['push'](_0x3de789['shift']());}catch(_0x4d7ad3){_0x3de789['push'](_0x3de789['shift']());}}}(a6_0x177e,0xbb7ce));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';function a6_0x177e(){const _0x21642e=['Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','\x22.\x20','llm-proxy','description','Invalid\x20header\x20format:\x20\x22','5036913rgiFdT','PUT','has','.\x20Valid\x20types:\x20','substring','142IzutqQ','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','proxy-authorization','Invalid\x20HTTP\x20method:\x20','headers','59705kTJFmh','isArray','color','toUpperCase','status','keys','POST','error','request','api','Invalid\x20API\x20type:\x20','workflow','\x0aStack\x20trace:\x0a','length','name','<\x20HTTP/1.1\x20','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','file','set-cookie2','startsWith','data','24Jqwnex','join','body','x-xsrf-token','stack','llm','entries','trino','2575620BnEEJX','readBodyFromFile','21401IGGxCm','includes','x-auth-token','log','verbose','x-trino-user','Endpoint\x20must\x20start\x20with\x20/:\x20','validate','trim','Error:\x20','4254268BSCLsi','3135328PLvmzV','GET','48318903wpViWL','site','method','cookie','execute','authorization','output','set-cookie','message'];a6_0x177e=function(){return _0x21642e;};return a6_0x177e();}import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x7518c0(0x225),a6_0x7518c0(0x1f1),a6_0x7518c0(0x223),a6_0x7518c0(0x227),a6_0x7518c0(0x206),a6_0x7518c0(0x20c),a6_0x7518c0(0x215),a6_0x7518c0(0x218)]);function a6_0x4092(_0x48be5c,_0xb7222e){_0x48be5c=_0x48be5c-0x1f0;const _0x177ec5=a6_0x177e();let _0x4092ae=_0x177ec5[_0x48be5c];return _0x4092ae;}function isSensitiveHeader(_0x1d1ef4){const _0x43d0cc=a6_0x7518c0;return SENSITIVE_HEADERS[_0x43d0cc(0x230)](_0x1d1ef4['toLowerCase']());}function parseHeader(_0x149464){const _0x20790f=a6_0x7518c0,_0x55a48d=_0x149464['indexOf'](':');if(_0x55a48d===-0x1)throw new Error(_0x20790f(0x22d)+_0x149464+_0x20790f(0x22a)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x21f452=_0x149464[_0x20790f(0x232)](0x0,_0x55a48d)[_0x20790f(0x21b)](),_0x321a8e=_0x149464[_0x20790f(0x232)](_0x55a48d+0x1)[_0x20790f(0x21b)]();if(!_0x21f452)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x149464+'\x22');return[_0x21f452,_0x321a8e];}export class ApiCommand extends BaseCommand{[a6_0x7518c0(0x202)]=a6_0x7518c0(0x1fd);[a6_0x7518c0(0x22c)]=a6_0x7518c0(0x229);[a6_0x7518c0(0x21a)](_0x56cd4e){const _0x134ea8=a6_0x7518c0,{args:_0x3a0354,options:_0x3b227e}=_0x56cd4e,_0x16df43=_0x3b227e;if(_0x3a0354[_0x134ea8(0x201)]===0x0)return _0x134ea8(0x1f0);const _0x46c101=_0x3a0354[0x0];if(!_0x46c101[_0x134ea8(0x207)]('/'))return _0x134ea8(0x219)+_0x46c101;const _0x5613d0=_0x16df43[_0x134ea8(0x208)],_0x47abae=_0x16df43[_0x134ea8(0x205)];if(_0x5613d0&&_0x47abae)return _0x134ea8(0x204);const _0x561e7b=_0x16df43[_0x134ea8(0x222)]||_0x134ea8(0x21f),_0x1a9fd4=[_0x134ea8(0x21f),_0x134ea8(0x1fa),_0x134ea8(0x22f),'DELETE','PATCH'];if(!_0x1a9fd4['includes'](_0x561e7b['toUpperCase']()))return _0x134ea8(0x1f2)+_0x561e7b+'.\x20Valid\x20methods:\x20'+_0x1a9fd4[_0x134ea8(0x20a)](',\x20');const _0x519f8a=_0x16df43['type']||'td',_0x11d632=['td','cdp',_0x134ea8(0x1ff),_0x134ea8(0x210),_0x134ea8(0x20e),_0x134ea8(0x22b)];if(!_0x11d632[_0x134ea8(0x214)](_0x519f8a))return _0x134ea8(0x1fe)+_0x519f8a+_0x134ea8(0x231)+_0x11d632[_0x134ea8(0x20a)](',\x20');return undefined;}async[a6_0x7518c0(0x224)](_0x24a1b4){const _0x4b95ec=a6_0x7518c0,{options:_0x1b6dbf,args:_0x5274fd,tdx:_0x879bb4}=_0x24a1b4,_0x372d5d=_0x1b6dbf,_0x54ed2f=_0x5274fd[0x0],_0x576d9c=(_0x372d5d[_0x4b95ec(0x222)]||_0x4b95ec(0x21f))[_0x4b95ec(0x1f7)](),_0x4c1a4e=_0x372d5d['data'],_0x3dff86=_0x372d5d['file'],_0x1c8bdc=_0x372d5d['header'],_0x4d4266=_0x372d5d['type']||'td';try{const _0x30300a={};if(_0x1c8bdc){const _0x4906c0=Array[_0x4b95ec(0x1f5)](_0x1c8bdc)?_0x1c8bdc:[_0x1c8bdc];for(const _0x365987 of _0x4906c0){const [_0x54c176,_0x14e11b]=parseHeader(_0x365987);_0x30300a[_0x54c176]=_0x14e11b;}}let _0x50c70b;if(_0x4c1a4e)_0x50c70b=_0x4c1a4e;else{if(_0x3dff86)try{_0x50c70b=RawAPI[_0x4b95ec(0x212)](_0x3dff86);}catch(_0x15f242){return console[_0x4b95ec(0x1fb)](_0x4b95ec(0x21c)+(_0x15f242 instanceof Error?_0x15f242[_0x4b95ec(0x228)]:String(_0x15f242))),0x1;}}const _0x4b7bc0={'method':_0x576d9c,'apiType':_0x4d4266,'includeHeaders':_0x1b6dbf[_0x4b95ec(0x217)]};_0x50c70b&&(_0x4b7bc0[_0x4b95ec(0x20b)]=_0x50c70b);Object[_0x4b95ec(0x1f9)](_0x30300a)[_0x4b95ec(0x201)]>0x0&&(_0x4b7bc0[_0x4b95ec(0x1f3)]=_0x30300a);if(_0x1b6dbf[_0x4b95ec(0x217)]){const _0x58c681=resolveSite(_0x1b6dbf[_0x4b95ec(0x221)]),_0x29f334=getEndpoint(_0x58c681,_0x4d4266),_0x42e496=''+_0x29f334+_0x54ed2f;console[_0x4b95ec(0x1fb)]('>\x20'+_0x576d9c+'\x20'+_0x42e496);const _0x1bca32=getAuthHeaders(_0x58c681),_0x5b24eb={..._0x1bca32,..._0x30300a};for(const [_0x42fc84,_0xae5ce4]of Object[_0x4b95ec(0x20f)](_0x5b24eb)){!isSensitiveHeader(_0x42fc84)&&console[_0x4b95ec(0x1fb)]('>\x20'+_0x42fc84+':\x20'+_0xae5ce4);}_0x50c70b&&console[_0x4b95ec(0x1fb)]('>'),console[_0x4b95ec(0x1fb)]('');}const _0x43baf7=await _0x879bb4[_0x4b95ec(0x1fd)][_0x4b95ec(0x1fc)](_0x54ed2f,_0x4b7bc0);if(_0x1b6dbf['verbose']&&_0x43baf7['headers']){console[_0x4b95ec(0x1fb)](_0x4b95ec(0x203)+_0x43baf7[_0x4b95ec(0x1f8)]);for(const [_0xbfb344,_0x54fd93]of Object[_0x4b95ec(0x20f)](_0x43baf7[_0x4b95ec(0x1f3)])){!isSensitiveHeader(_0xbfb344)&&console[_0x4b95ec(0x1fb)]('<\x20'+_0xbfb344+':\x20'+_0x54fd93);}console['error']('');}const _0x5ed237=Boolean(_0x1b6dbf[_0x4b95ec(0x226)]),_0x4d01c5={'color':_0x1b6dbf[_0x4b95ec(0x1f6)],'noColor':_0x1b6dbf['noColor']||_0x5ed237&&!_0x1b6dbf[_0x4b95ec(0x1f6)]},_0x4297ff=colorizeJSON(_0x43baf7[_0x4b95ec(0x208)],_0x4d01c5);return _0x1b6dbf[_0x4b95ec(0x226)]?(writeFileSync(_0x1b6dbf[_0x4b95ec(0x226)],_0x4297ff),console[_0x4b95ec(0x1fb)]('Results\x20saved\x20to\x20'+_0x1b6dbf['output'])):console[_0x4b95ec(0x216)](_0x4297ff),0x0;}catch(_0x423744){return _0x423744 instanceof Error?(console['error'](_0x4b95ec(0x21c)+_0x423744[_0x4b95ec(0x228)]),_0x1b6dbf[_0x4b95ec(0x217)]&&_0x423744[_0x4b95ec(0x20d)]&&console[_0x4b95ec(0x1fb)](_0x4b95ec(0x200)+_0x423744['stack'])):console[_0x4b95ec(0x1fb)](_0x4b95ec(0x21c)+String(_0x423744)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x4bc431=a7_0x413b;(function(_0x5e5bf6,_0x4fda56){const _0x552b99=a7_0x413b,_0x46a6b5=_0x5e5bf6();while(!![]){try{const _0x5bed21=-parseInt(_0x552b99(0xbc))/0x1+-parseInt(_0x552b99(0xc4))/0x2+-parseInt(_0x552b99(0xc8))/0x3*(parseInt(_0x552b99(0xdd))/0x4)+parseInt(_0x552b99(0xef))/0x5+-parseInt(_0x552b99(0xda))/0x6*(parseInt(_0x552b99(0xc7))/0x7)+-parseInt(_0x552b99(0xd9))/0x8*(parseInt(_0x552b99(0xaf))/0x9)+parseInt(_0x552b99(0xd8))/0xa;if(_0x5bed21===_0x4fda56)break;else _0x46a6b5['push'](_0x46a6b5['shift']());}catch(_0x215bdb){_0x46a6b5['push'](_0x46a6b5['shift']());}}}(a7_0x34c8,0x2df88));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';function a7_0x413b(_0x5c897f,_0x355700){_0x5c897f=_0x5c897f-0xaf;const _0x34c8ff=a7_0x34c8();let _0x413bc4=_0x34c8ff[_0x5c897f];return _0x413bc4;}import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x1e1d7f from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x51eec7 from'chalk';function a7_0x34c8(){const _0x3d65dd=['Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','45713LfgfkF','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','Site\x20name\x20cannot\x20be\x20empty','tdx:\x20auth\x20setup','\x0aSetup\x20cancelled','password','select','Validating\x20API\x20key...','219032YEvnOq','green','message','7UciFsa','3ghelPF','✓\x20API\x20key\x20removed\x20from\x20keychain','tdx\x20profile:\x20','ERROR','test','auth:clear','us01','email','bold','text','✓\x20Default\x20site\x20set\x20to\x20','\x20--profile\x20','User:\x20','last_name','Enter\x20your\x20TD\x20API\x20key:','filter','6578010XbAOuc','71392GPHRcH','619002qYCgpF','logLevel','red','1123376YAbFYi','\x20(profile:\x20','✓\x20Profile\x20\x27','auth:setup','log','System\x20keychain\x20is\x20not\x20available','description','\x20(site:\x20','profile','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20\x20tdx','jobs','Read\x20credential\x20from\x20','API\x20key\x20cannot\x20be\x20empty','tdx:\x20auth\x20clear','Setting\x20up\x20authentication\x20for\x20site:\x20','status','customSite','1017975zBLGXn','Select\x20your\x20Treasure\x20Data\x20site:','✗\x20Validation\x20failed:\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','N/A','No\x20API\x20key\x20found\x20in\x20keychain','site','join','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','create','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','execute','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','name','Name:\x20','/app/mp/ak','135evMUzs','trim','yellow','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','getUserInfo','warn','first_name','apiKey','Setup\x20API\x20key\x20authentication\x20interactively','\x27\x20registered','error','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.'];a7_0x34c8=function(){return _0x3d65dd;};return a7_0x34c8();}export class AuthSetupCommand extends BaseCommand{[a7_0x4bc431(0xfd)]=a7_0x4bc431(0xe0);[a7_0x4bc431(0xe3)]=a7_0x4bc431(0xb7);async['execute'](_0x5884ab){const _0x2bccc3=a7_0x4bc431,{options:_0xf7dd7f}=_0x5884ab,_0x58b705=_0xf7dd7f['profile'];console[_0x2bccc3(0xe1)](a7_0x51eec7[_0x2bccc3(0xd0)](_0x2bccc3(0xbf)));const _0x408840=_0xf7dd7f[_0x2bccc3(0xf5)]||'us01',{choices:_0xef8d0c,initialIndex:_0x2bda46}=buildSiteChoices(_0x408840),_0x3d3e7b=_0x58b705?_0x2bccc3(0xfa)+_0x58b705+'):':_0x2bccc3(0xf0),_0x33745e=await a7_0x1e1d7f({'type':_0x2bccc3(0xc2),'name':'site','message':_0x3d3e7b,'choices':_0xef8d0c,'initial':_0x2bda46});if(!_0x33745e[_0x2bccc3(0xf5)])return console[_0x2bccc3(0xe1)](_0x2bccc3(0xc0)),0x1;let _0x42d8d1;if(_0x33745e['site']==='other'){const _0x2f6e8f=await a7_0x1e1d7f({'type':_0x2bccc3(0xd1),'name':'customSite','message':'Enter\x20site\x20name:','initial':_0x2bccc3(0xce),'validate':_0x60671=>{const _0x2bc05a=_0x2bccc3;if(!_0x60671||!_0x60671[_0x2bc05a(0xb0)]())return _0x2bc05a(0xbe);if(!/^[a-z0-9-]+$/[_0x2bc05a(0xcc)](_0x60671[_0x2bc05a(0xb0)]()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x2f6e8f[_0x2bccc3(0xee)])return console[_0x2bccc3(0xe1)](_0x2bccc3(0xc0)),0x1;_0x42d8d1=_0x2f6e8f['customSite'];}else _0x42d8d1=_0x33745e['site'];const _0x3ef008=resolveSite(_0x42d8d1);console[_0x2bccc3(0xe1)](_0x2bccc3(0xec)+_0x3ef008),console[_0x2bccc3(0xe1)](_0x2bccc3(0xe6)),console[_0x2bccc3(0xe1)]('\x20\x20'+getConsoleUrl(_0x3ef008,_0x2bccc3(0xff)));const _0x517e9f=await a7_0x1e1d7f({'type':_0x2bccc3(0xc1),'name':_0x2bccc3(0xb6),'message':_0x2bccc3(0xd6),'validate':_0x52ea8a=>{const _0x3ff3aa=_0x2bccc3;if(!_0x52ea8a||!_0x52ea8a[_0x3ff3aa(0xb0)]())return _0x3ff3aa(0xea);return!![];}});if(!_0x517e9f['apiKey'])return console[_0x2bccc3(0xe1)](_0x2bccc3(0xc0)),0x1;const _0x49412e=_0x517e9f[_0x2bccc3(0xb6)];console['log'](_0x2bccc3(0xc3));try{const _0x5c9655=TDX[_0x2bccc3(0xf9)]({'site':_0x3ef008,'apiKey':_0x49412e[_0x2bccc3(0xb0)](),'logLevel':_0xf7dd7f[_0x2bccc3(0xdb)]??LogLevel[_0x2bccc3(0xcb)]}),_0x37d1c0=await _0x5c9655[_0x2bccc3(0xe8)]['getUserInfo']();console['log'](_0x2bccc3(0xf8)+_0x37d1c0[_0x2bccc3(0xcf)]+')');const _0x4200ac=await isKeychainAvailable();_0x4200ac?(await saveAPIKeyAsync(_0x49412e[_0x2bccc3(0xb0)](),_0x3ef008,_0x58b705),console['log']('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x58b705?'\x20(profile:\x20'+_0x58b705+')':''))):(console[_0x2bccc3(0xb4)](a7_0x51eec7['yellow'](_0x2bccc3(0xba))),console['warn'](a7_0x51eec7['yellow'](_0x2bccc3(0xf7))));if(_0x58b705){const _0x5b67c2={'site':_0x3ef008};saveProfileToUserConfig(_0x58b705,_0x5b67c2),console[_0x2bccc3(0xe1)](_0x2bccc3(0xdf)+_0x58b705+_0x2bccc3(0xb8));}else saveDefaultSiteToUserConfig(_0x3ef008),console['log'](_0x2bccc3(0xd2)+_0x3ef008);const _0x314685=_0x58b705?_0x2bccc3(0xd3)+_0x58b705:'';return console['log'](),console[_0x2bccc3(0xe1)](_0x2bccc3(0xbd)),console[_0x2bccc3(0xe1)](_0x2bccc3(0xe7)+_0x314685+_0x2bccc3(0xb2)),console[_0x2bccc3(0xe1)]('\x20\x20tdx'+_0x314685+_0x2bccc3(0xf2)),0x0;}catch(_0x24eaea){if(_0x24eaea instanceof HTTPClientError&&_0x24eaea[_0x2bccc3(0xed)]===0x191)return printAuthError(_0x24eaea),0x1;return console[_0x2bccc3(0xb9)](a7_0x51eec7[_0x2bccc3(0xdc)](_0x2bccc3(0xf1)+(_0x24eaea instanceof Error?_0x24eaea[_0x2bccc3(0xc6)]:String(_0x24eaea)))),console[_0x2bccc3(0xb9)](_0x2bccc3(0xfc)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x4bc431(0xfd)]='auth';[a7_0x4bc431(0xe3)]=a7_0x4bc431(0xbb);async[a7_0x4bc431(0xfb)](_0x4cb8be){const _0x28e34b=a7_0x4bc431,{options:_0x4d13a3,tdx:_0x2b6d6a}=_0x4cb8be,_0x211440=_0x4d13a3[_0x28e34b(0xf5)],_0x92e441=_0x4d13a3[_0x28e34b(0xe5)],_0x1ad969=_0x92e441?_0x92e441:_0x28e34b(0xf3);console['log'](_0x28e34b(0xca)+_0x1ad969+_0x28e34b(0xe4)+_0x211440+')');const _0x3544f1=await resolveAPIKeyAsync(_0x211440,_0x92e441);if(_0x3544f1){const {source:_0x332e86,isDeprecated:_0x518075}=_0x3544f1,_0x56fad6=_0x28e34b(0xe9)+_0x332e86;console['log'](_0x518075?a7_0x51eec7[_0x28e34b(0xb1)](_0x56fad6):_0x56fad6);}else console[_0x28e34b(0xe1)](a7_0x51eec7['yellow']('No\x20credential\x20found'));try{const _0x4d370a=await _0x2b6d6a[_0x28e34b(0xe8)][_0x28e34b(0xb3)]();return console['log'](a7_0x51eec7[_0x28e34b(0xc5)]('✓\x20Authentication\x20successful\x0a')),console[_0x28e34b(0xe1)](_0x28e34b(0xd4)+_0x4d370a['email']),(_0x4d370a[_0x28e34b(0xb5)]||_0x4d370a[_0x28e34b(0xd5)])&&console['log'](_0x28e34b(0xfe)+[_0x4d370a[_0x28e34b(0xb5)],_0x4d370a[_0x28e34b(0xd5)]][_0x28e34b(0xd7)](Boolean)[_0x28e34b(0xf6)]('\x20')),0x0;}catch(_0x391385){return _0x391385 instanceof HTTPClientError&&_0x391385[_0x28e34b(0xed)]===0x191?printAuthError(_0x391385,!![],_0x92e441):console[_0x28e34b(0xb9)](a7_0x51eec7[_0x28e34b(0xdc)]('✗\x20Validation\x20failed:\x20'+(_0x391385 instanceof Error?_0x391385[_0x28e34b(0xc6)]:String(_0x391385)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x4bc431(0xfd)]=a7_0x4bc431(0xcd);[a7_0x4bc431(0xe3)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x4bc431(0xfb)](_0x234151){const _0x249be0=a7_0x4bc431,{options:_0x29731c}=_0x234151,_0x12e30b=_0x29731c[_0x249be0(0xe5)];console['log'](a7_0x51eec7['bold'](_0x249be0(0xeb)));const _0x4a4b8d=await isKeychainAvailable();if(!_0x4a4b8d)return console[_0x249be0(0xb9)](a7_0x51eec7[_0x249be0(0xdc)](_0x249be0(0xe2))),0x1;const _0x416679=await deleteKeychainAPIKey(_0x12e30b);return _0x416679?(clearCredentialCache(),console[_0x249be0(0xe1)](_0x249be0(0xc9)+(_0x12e30b?_0x249be0(0xde)+_0x12e30b+')':'')),0x0):(console[_0x249be0(0xe1)](_0x249be0(0xf4)+(_0x12e30b?'\x20for\x20profile:\x20'+_0x12e30b:'')),0x1);}}
1
+ const a7_0x59374b=a7_0x1d00;(function(_0x5e1d4b,_0x5eb927){const _0xcab6e8=a7_0x1d00,_0x329933=_0x5e1d4b();while(!![]){try{const _0x14d5ea=parseInt(_0xcab6e8(0x1c9))/0x1*(parseInt(_0xcab6e8(0x1d2))/0x2)+parseInt(_0xcab6e8(0x1fa))/0x3+-parseInt(_0xcab6e8(0x1e5))/0x4*(parseInt(_0xcab6e8(0x1d7))/0x5)+parseInt(_0xcab6e8(0x1eb))/0x6*(-parseInt(_0xcab6e8(0x1e4))/0x7)+parseInt(_0xcab6e8(0x20f))/0x8*(-parseInt(_0xcab6e8(0x21a))/0x9)+-parseInt(_0xcab6e8(0x1e3))/0xa+parseInt(_0xcab6e8(0x207))/0xb*(parseInt(_0xcab6e8(0x200))/0xc);if(_0x14d5ea===_0x5eb927)break;else _0x329933['push'](_0x329933['shift']());}catch(_0x3f5765){_0x329933['push'](_0x329933['shift']());}}}(a7_0x4a85,0x52d5c));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';function a7_0x4a85(){const _0x42d335=['You\x20can\x20find\x20your\x20API\x20key\x20at:','Read\x20credential\x20from\x20','✓\x20Profile\x20\x27','Select\x20your\x20Treasure\x20Data\x20site:','name','getUserInfo','us01','2rLvvON','trim','ERROR','\x20--profile\x20','red','1745mqBSZA','✓\x20API\x20key\x20removed\x20from\x20keychain','email','tdx:\x20auth\x20setup','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','error','password','yellow','Enter\x20your\x20TD\x20API\x20key:','\x20(profile:\x20','\x20for\x20profile:\x20','site','2139930rMdrNW','7zUMjbC','7576tNqbrp','tdx:\x20auth\x20clear','last_name','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','other','description','2642958iVitqe','text','No\x20credential\x20found','jobs','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','Name:\x20','execute','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','Enter\x20site\x20name:','message','customSite','warn','No\x20API\x20key\x20found\x20in\x20keychain','test','200259koUtQh','bold','Remove\x20API\x20key\x20from\x20system\x20keychain','auth:clear','Site\x20name\x20cannot\x20be\x20empty','apiKey','1201848PolUEQ','logLevel','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20\x20tdx','\x27\x20registered','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','tdx\x20profile:\x20','143VtoIPw','log','auth','select','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','auth:setup','create','profile','587072DdjiZL','API\x20key\x20cannot\x20be\x20empty','status','\x20(site:\x20','User:\x20','join','green','Validating\x20API\x20key...','✓\x20Default\x20site\x20set\x20to\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','\x0aSetup\x20cancelled','9Ankyrk','System\x20keychain\x20is\x20not\x20available','359413MSGmZZ','Setup\x20API\x20key\x20authentication\x20interactively'];a7_0x4a85=function(){return _0x42d335;};return a7_0x4a85();}import a7_0x3666a5 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x1ce196 from'chalk';function a7_0x1d00(_0x2655e9,_0xea4817){_0x2655e9=_0x2655e9-0x1c8;const _0x4a85d3=a7_0x4a85();let _0x1d0082=_0x4a85d3[_0x2655e9];return _0x1d0082;}export class AuthSetupCommand extends BaseCommand{[a7_0x59374b(0x1cf)]=a7_0x59374b(0x20c);['description']=a7_0x59374b(0x1ca);async[a7_0x59374b(0x1f2)](_0x1b91db){const _0x4d9166=a7_0x59374b,{options:_0x35af3d}=_0x1b91db,_0x172d7a=_0x35af3d['profile'];console[_0x4d9166(0x208)](a7_0x1ce196[_0x4d9166(0x1fb)](_0x4d9166(0x1da)));const _0x1a3816=_0x35af3d[_0x4d9166(0x1e2)]||'us01',{choices:_0x2befea,initialIndex:_0x424975}=buildSiteChoices(_0x1a3816),_0x2fcd19=_0x172d7a?_0x4d9166(0x1db)+_0x172d7a+'):':_0x4d9166(0x1ce),_0x3f228e=await a7_0x3666a5({'type':_0x4d9166(0x20a),'name':'site','message':_0x2fcd19,'choices':_0x2befea,'initial':_0x424975});if(!_0x3f228e[_0x4d9166(0x1e2)])return console['log'](_0x4d9166(0x219)),0x1;let _0x1969f5;if(_0x3f228e['site']===_0x4d9166(0x1e9)){const _0x2e179d=await a7_0x3666a5({'type':_0x4d9166(0x1ec),'name':_0x4d9166(0x1f6),'message':_0x4d9166(0x1f4),'initial':_0x4d9166(0x1d1),'validate':_0x39d8bf=>{const _0x5c5828=_0x4d9166;if(!_0x39d8bf||!_0x39d8bf['trim']())return _0x5c5828(0x1fe);if(!/^[a-z0-9-]+$/[_0x5c5828(0x1f9)](_0x39d8bf[_0x5c5828(0x1d3)]()))return _0x5c5828(0x1f3);return!![];}});if(!_0x2e179d[_0x4d9166(0x1f6)])return console[_0x4d9166(0x208)]('\x0aSetup\x20cancelled'),0x1;_0x1969f5=_0x2e179d['customSite'];}else _0x1969f5=_0x3f228e['site'];const _0x132a97=resolveSite(_0x1969f5);console[_0x4d9166(0x208)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x132a97),console[_0x4d9166(0x208)](_0x4d9166(0x1cb)),console['log']('\x20\x20'+getConsoleUrl(_0x132a97,'/app/mp/ak'));const _0x15736c=await a7_0x3666a5({'type':_0x4d9166(0x1dd),'name':'apiKey','message':_0x4d9166(0x1df),'validate':_0x2269fc=>{const _0x4a99c9=_0x4d9166;if(!_0x2269fc||!_0x2269fc['trim']())return _0x4a99c9(0x210);return!![];}});if(!_0x15736c[_0x4d9166(0x1ff)])return console[_0x4d9166(0x208)](_0x4d9166(0x219)),0x1;const _0x166a8a=_0x15736c[_0x4d9166(0x1ff)];console[_0x4d9166(0x208)](_0x4d9166(0x216));try{const _0x58a596=TDX[_0x4d9166(0x20d)]({'site':_0x132a97,'apiKey':_0x166a8a[_0x4d9166(0x1d3)](),'logLevel':_0x35af3d[_0x4d9166(0x201)]??LogLevel[_0x4d9166(0x1d4)]}),_0x18b784=await _0x58a596[_0x4d9166(0x1ee)][_0x4d9166(0x1d0)]();console['log'](_0x4d9166(0x1ef)+_0x18b784[_0x4d9166(0x1d9)]+')');const _0x3f83eb=await isKeychainAvailable();_0x3f83eb?(await saveAPIKeyAsync(_0x166a8a['trim'](),_0x132a97,_0x172d7a),console[_0x4d9166(0x208)](_0x4d9166(0x205)+(_0x172d7a?_0x4d9166(0x1e0)+_0x172d7a+')':''))):(console[_0x4d9166(0x1f7)](a7_0x1ce196[_0x4d9166(0x1de)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x4d9166(0x1f7)](a7_0x1ce196['yellow'](_0x4d9166(0x1e8))));if(_0x172d7a){const _0x106448={'site':_0x132a97};saveProfileToUserConfig(_0x172d7a,_0x106448),console['log'](_0x4d9166(0x1cd)+_0x172d7a+_0x4d9166(0x204));}else saveDefaultSiteToUserConfig(_0x132a97),console[_0x4d9166(0x208)](_0x4d9166(0x217)+_0x132a97);const _0x2a38f7=_0x172d7a?_0x4d9166(0x1d5)+_0x172d7a:'';return console['log'](),console[_0x4d9166(0x208)](_0x4d9166(0x20b)),console[_0x4d9166(0x208)](_0x4d9166(0x203)+_0x2a38f7+_0x4d9166(0x202)),console[_0x4d9166(0x208)]('\x20\x20tdx'+_0x2a38f7+_0x4d9166(0x218)),0x0;}catch(_0x3b1aaa){if(_0x3b1aaa instanceof HTTPClientError&&_0x3b1aaa[_0x4d9166(0x211)]===0x191)return printAuthError(_0x3b1aaa),0x1;return console[_0x4d9166(0x1dc)](a7_0x1ce196['red']('✗\x20Validation\x20failed:\x20'+(_0x3b1aaa instanceof Error?_0x3b1aaa[_0x4d9166(0x1f5)]:String(_0x3b1aaa)))),console['error']('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x59374b(0x1cf)]=a7_0x59374b(0x209);['description']=a7_0x59374b(0x1f0);async[a7_0x59374b(0x1f2)](_0x5f0a26){const _0x416707=a7_0x59374b,{options:_0x135482,tdx:_0x1dd4fe}=_0x5f0a26,_0xe5f4a2=_0x135482[_0x416707(0x1e2)],_0xe410b0=_0x135482[_0x416707(0x20e)],_0x43f4bd=_0xe410b0?_0xe410b0:'N/A';console[_0x416707(0x208)](_0x416707(0x206)+_0x43f4bd+_0x416707(0x212)+_0xe5f4a2+')');const _0xbe747=await resolveAPIKeyAsync(_0xe5f4a2,_0xe410b0);if(_0xbe747){const {source:_0x336fec,isDeprecated:_0x47d7fb}=_0xbe747,_0x5be963=_0x416707(0x1cc)+_0x336fec;console[_0x416707(0x208)](_0x47d7fb?a7_0x1ce196['yellow'](_0x5be963):_0x5be963);}else console[_0x416707(0x208)](a7_0x1ce196[_0x416707(0x1de)](_0x416707(0x1ed)));try{const _0x4c8797=await _0x1dd4fe[_0x416707(0x1ee)]['getUserInfo']();return console['log'](a7_0x1ce196[_0x416707(0x215)]('✓\x20Authentication\x20successful\x0a')),console['log'](_0x416707(0x213)+_0x4c8797[_0x416707(0x1d9)]),(_0x4c8797['first_name']||_0x4c8797[_0x416707(0x1e7)])&&console[_0x416707(0x208)](_0x416707(0x1f1)+[_0x4c8797['first_name'],_0x4c8797[_0x416707(0x1e7)]]['filter'](Boolean)[_0x416707(0x214)]('\x20')),0x0;}catch(_0x17d152){return _0x17d152 instanceof HTTPClientError&&_0x17d152[_0x416707(0x211)]===0x191?printAuthError(_0x17d152,!![],_0xe410b0):console[_0x416707(0x1dc)](a7_0x1ce196[_0x416707(0x1d6)]('✗\x20Validation\x20failed:\x20'+(_0x17d152 instanceof Error?_0x17d152[_0x416707(0x1f5)]:String(_0x17d152)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x59374b(0x1cf)]=a7_0x59374b(0x1fd);[a7_0x59374b(0x1ea)]=a7_0x59374b(0x1fc);async['execute'](_0xc89fa4){const _0x5c3bd8=a7_0x59374b,{options:_0x26371c}=_0xc89fa4,_0x17c77d=_0x26371c[_0x5c3bd8(0x20e)];console['log'](a7_0x1ce196[_0x5c3bd8(0x1fb)](_0x5c3bd8(0x1e6)));const _0x53de67=await isKeychainAvailable();if(!_0x53de67)return console['error'](a7_0x1ce196['red'](_0x5c3bd8(0x1c8))),0x1;const _0x33477a=await deleteKeychainAPIKey(_0x17c77d);return _0x33477a?(clearCredentialCache(),console[_0x5c3bd8(0x208)](_0x5c3bd8(0x1d8)+(_0x17c77d?_0x5c3bd8(0x1e0)+_0x17c77d+')':'')),0x0):(console[_0x5c3bd8(0x208)](_0x5c3bd8(0x1f8)+(_0x17c77d?_0x5c3bd8(0x1e1)+_0x17c77d:'')),0x1);}}
@@ -1 +1 @@
1
- const a8_0x3ff7d3=a8_0x3fd9;(function(_0x4fe6b3,_0x2c0ff7){const _0x543250=a8_0x3fd9,_0xdac150=_0x4fe6b3();while(!![]){try{const _0x2d983c=parseInt(_0x543250(0x85))/0x1+-parseInt(_0x543250(0x98))/0x2*(parseInt(_0x543250(0x7b))/0x3)+-parseInt(_0x543250(0x77))/0x4+parseInt(_0x543250(0x80))/0x5+parseInt(_0x543250(0x9e))/0x6*(-parseInt(_0x543250(0x93))/0x7)+parseInt(_0x543250(0x84))/0x8*(-parseInt(_0x543250(0x9a))/0x9)+-parseInt(_0x543250(0x8b))/0xa;if(_0x2d983c===_0x2c0ff7)break;else _0xdac150['push'](_0xdac150['shift']());}catch(_0x339d79){_0xdac150['push'](_0xdac150['shift']());}}}(a8_0x3d1f,0x70f48));function a8_0x3fd9(_0x3a7630,_0x473758){_0x3a7630=_0x3a7630-0x70;const _0x3d1f81=a8_0x3d1f();let _0x3fd967=_0x3d1f81[_0x3a7630];return _0x3fd967;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';function a8_0x3d1f(){const _0x5c5b55=['404','stdout','session\x20context','3253338kYNUSD','chatId','handleChatEvent','Continuing\x20chat:\x20','Resolving\x20agent\x20\x27','stack','new','content','agent','chat','Using\x20agent\x20from\x20','getDefaultAgent','llmProject','args','join','103452scxNoQ','\x27...','includes','metadata','46167ErEKCV','Using\x20cached\x20default\x20agent:\x20','data','llm','error','3863035bmJbLc','streamChat','getOrCreateDefaultAgent','resolveAgentId','12088FpGerp','896280QEmXkE','type','\x0aStack\x20trace:','\x20\x20Cause:\x20','cause','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','5113290GdsxRq','verbose','description','write','CHAT_NOT_FOUND','name','message','validate','7eLBKPl','claude-4.5-haiku','getAgentId','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','Resolving\x20project\x20\x27','10VjHHrT','log','297NcdZTU'];a8_0x3d1f=function(){return _0x5c5b55;};return a8_0x3d1f();}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(_0x101cb9,_0x1ee313){const _0x43a477=a8_0x3fd9;if(_0x101cb9 instanceof SDKError)console['error']('Error:\x20'+_0x101cb9[_0x43a477(0x91)]),_0x1ee313['verbose']&&(_0x101cb9[_0x43a477(0x89)]&&console['error'](_0x43a477(0x88)+_0x101cb9[_0x43a477(0x89)]),_0x101cb9['stack']&&(console[_0x43a477(0x7f)](_0x43a477(0x87)),console[_0x43a477(0x7f)](_0x101cb9[_0x43a477(0xa3)])));else throw _0x101cb9;}export class ChatCommand extends BaseCommand{[a8_0x3ff7d3(0x90)]=a8_0x3ff7d3(0x71);[a8_0x3ff7d3(0x8d)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a8_0x3ff7d3(0x92)](_0x46a15c){const _0x379ea9=a8_0x3ff7d3,_0x3c26b0=_0x46a15c[_0x379ea9(0x75)][_0x379ea9(0x76)]('\x20');if(!_0x3c26b0)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async[a8_0x3ff7d3(0x81)](_0x167558,_0x5274bb,_0x199e7e,_0x59977e,_0xf9520b){const _0x56a779=a8_0x3ff7d3;for await(const _0x10bc88 of _0x167558[_0x56a779(0x7e)]['chat'](_0x5274bb,{'agentId':_0x199e7e,'chatId':_0x59977e})){if(_0x10bc88['type']===_0x56a779(0x7a)){const _0x3ce5c6=_0x10bc88[_0x56a779(0x7d)][_0x56a779(0x9f)];saveLastChatId(_0x3ce5c6),_0xf9520b&&console['error']('Chat\x20session:\x20'+_0x3ce5c6);}else _0x10bc88[_0x56a779(0x86)]==='event'&&this[_0x56a779(0xa0)](_0x10bc88[_0x56a779(0x7d)]);}}async[a8_0x3ff7d3(0x95)](_0x552d03,_0x2dd923,_0x13f3e9,_0x3fbfd0,_0x2f849d){const _0x1c66ee=a8_0x3ff7d3,_0x4405af=_0x2dd923||_0x13f3e9;if(_0x4405af){const {projectName:_0x1c2670,agentName:_0x27c78e}=parseAgentRef(_0x4405af),_0x1fee7d=_0x27c78e||_0x4405af,_0x4c3596=_0x27c78e?_0x1c2670:_0x3fbfd0;if(!_0x4c3596)throw new Error(_0x1c66ee(0x96));if(_0x2f849d){const _0x4dd170=_0x2dd923?'--agent\x20flag':_0x1c66ee(0x9d);console['error'](_0x1c66ee(0x72)+_0x4dd170+':\x20'+_0x4c3596+'/'+_0x1fee7d);}const _0x3d2c78=await withSpinner(_0x1c66ee(0x97)+_0x4c3596+_0x1c66ee(0x78),()=>_0x552d03['llm']['resolveProjectId'](_0x4c3596),{'verbose':_0x2f849d}),_0x46e1ce=await withSpinner(_0x1c66ee(0xa2)+_0x1fee7d+_0x1c66ee(0x78),()=>_0x552d03[_0x1c66ee(0x7e)][_0x1c66ee(0x83)](_0x1fee7d,_0x3d2c78['data']),{'verbose':_0x2f849d});return _0x46e1ce[_0x1c66ee(0x7d)];}else{const _0x251117=_0x552d03[_0x1c66ee(0x7e)][_0x1c66ee(0x73)]();if(_0x251117)return _0x2f849d&&console[_0x1c66ee(0x7f)](_0x1c66ee(0x7c)+_0x251117[_0x1c66ee(0x90)]),_0x251117['id'];const _0x5a5de0=await withSpinner('Getting\x20default\x20agent...',()=>_0x552d03['llm'][_0x1c66ee(0x82)](_0x1c66ee(0x94),0x0),{'verbose':_0x2f849d});return _0x5a5de0[_0x1c66ee(0x7d)]['id'];}}async['execute'](_0x1855a8){const _0x4d4fe5=a8_0x3ff7d3,{options:_0x79d957,args:_0x5583d8,tdx:_0x2e7b65}=_0x1855a8,_0x85f42b=_0x5583d8[_0x4d4fe5(0x76)]('\x20'),_0x39b97c=_0x79d957,_0x158de8=_0x39b97c[_0x4d4fe5(0x70)],_0x3e1799=_0x39b97c['llmAgent'],_0xe1e77b=_0x39b97c[_0x4d4fe5(0x74)],_0x31939c=_0x39b97c[_0x4d4fe5(0xa4)];try{let _0x31a294,_0x70d3c1;!_0x31939c&&(_0x70d3c1=loadLastChatId(),_0x70d3c1&&_0x79d957[_0x4d4fe5(0x8c)]&&console[_0x4d4fe5(0x7f)](_0x4d4fe5(0xa1)+_0x70d3c1));(_0x31939c||!_0x70d3c1)&&(_0x31a294=await this['getAgentId'](_0x2e7b65,_0x158de8,_0x3e1799,_0xe1e77b,_0x79d957[_0x4d4fe5(0x8c)]));try{await this[_0x4d4fe5(0x81)](_0x2e7b65,_0x85f42b,_0x31a294,_0x70d3c1,_0x79d957[_0x4d4fe5(0x8c)]);}catch(_0x34f329){const _0x2608a5=_0x34f329 instanceof SDKError&&_0x34f329['code']===ErrorCode[_0x4d4fe5(0x8f)]||_0x34f329 instanceof Error&&_0x34f329[_0x4d4fe5(0x91)][_0x4d4fe5(0x79)](_0x4d4fe5(0x9b));if(_0x2608a5)_0x79d957[_0x4d4fe5(0x8c)]&&console[_0x4d4fe5(0x7f)](_0x4d4fe5(0x8a)),!_0x31a294&&(_0x31a294=await this['getAgentId'](_0x2e7b65,_0x158de8,_0x3e1799,_0xe1e77b,_0x79d957[_0x4d4fe5(0x8c)])),await this['streamChat'](_0x2e7b65,_0x85f42b,_0x31a294,undefined,_0x79d957[_0x4d4fe5(0x8c)]);else throw _0x34f329;}return console[_0x4d4fe5(0x99)](),0x0;}catch(_0x5acbb6){return console[_0x4d4fe5(0x7f)](),handleSDKError(_0x5acbb6,_0x79d957),0x1;}}[a8_0x3ff7d3(0xa0)](_0x4b40fc){const _0x5d4cf8=a8_0x3ff7d3;if(_0x5d4cf8(0xa5)in _0x4b40fc)process[_0x5d4cf8(0x9c)][_0x5d4cf8(0x8e)](_0x4b40fc[_0x5d4cf8(0xa5)]);else'error'in _0x4b40fc&&console[_0x5d4cf8(0x7f)]('\x0aError:\x20'+_0x4b40fc[_0x5d4cf8(0x7f)]);}}
1
+ const a8_0x2d2a03=a8_0x281f;(function(_0x38052a,_0x132b5f){const _0x42bf5d=a8_0x281f,_0x254325=_0x38052a();while(!![]){try{const _0x3e0ad6=-parseInt(_0x42bf5d(0x1a2))/0x1+-parseInt(_0x42bf5d(0x179))/0x2*(parseInt(_0x42bf5d(0x170))/0x3)+-parseInt(_0x42bf5d(0x1a9))/0x4*(-parseInt(_0x42bf5d(0x174))/0x5)+-parseInt(_0x42bf5d(0x171))/0x6*(-parseInt(_0x42bf5d(0x188))/0x7)+parseInt(_0x42bf5d(0x193))/0x8*(parseInt(_0x42bf5d(0x19f))/0x9)+-parseInt(_0x42bf5d(0x183))/0xa*(-parseInt(_0x42bf5d(0x19e))/0xb)+parseInt(_0x42bf5d(0x186))/0xc;if(_0x3e0ad6===_0x132b5f)break;else _0x254325['push'](_0x254325['shift']());}catch(_0x2095f3){_0x254325['push'](_0x254325['shift']());}}}(a8_0x1d96,0x38f35));import{BaseCommand}from'./command.js';function a8_0x281f(_0x1f04c2,_0x30ea11){_0x1f04c2=_0x1f04c2-0x16f;const _0x1d96c4=a8_0x1d96();let _0x281fb4=_0x1d96c4[_0x1f04c2];return _0x281fb4;}function a8_0x1d96(){const _0xab20ce=['error','chatId','3zshxaG','6OUroHT','code','agent','12790ZnCCOY','Resolving\x20project\x20\x27','Using\x20cached\x20default\x20agent:\x20','\x0aStack\x20trace:','Getting\x20default\x20agent...','471198CJGJZk','join','verbose','getAgentId','llmAgent','streamChat','type','log','resolveAgentId','new','70qjmEqv','CHAT_NOT_FOUND','metadata','467940CpIuYy','stack','1690577MiMAvq','404','Using\x20agent\x20from\x20','llm','validate','getOrCreateDefaultAgent','content','Chat\x20session:\x20','stdout','write','handleChatEvent','612112gQDrhV','claude-4.5-haiku','description','\x20\x20Cause:\x20','session\x20context','--agent\x20flag','resolveProjectId','Continuing\x20chat:\x20','cause','includes','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','449427XPfkUV','9Pqrkhv','data','chat','268797OIkBgZ','message','\x27...','event','name','llmProject','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','148IeaIBW'];a8_0x1d96=function(){return _0xab20ce;};return a8_0x1d96();}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(_0x164a2a,_0x1e1124){const _0x5a3c02=a8_0x281f;if(_0x164a2a instanceof SDKError)console[_0x5a3c02(0x1aa)]('Error:\x20'+_0x164a2a['message']),_0x1e1124[_0x5a3c02(0x17b)]&&(_0x164a2a[_0x5a3c02(0x19b)]&&console[_0x5a3c02(0x1aa)](_0x5a3c02(0x196)+_0x164a2a[_0x5a3c02(0x19b)]),_0x164a2a[_0x5a3c02(0x187)]&&(console[_0x5a3c02(0x1aa)](_0x5a3c02(0x177)),console[_0x5a3c02(0x1aa)](_0x164a2a[_0x5a3c02(0x187)])));else throw _0x164a2a;}export class ChatCommand extends BaseCommand{[a8_0x2d2a03(0x1a6)]=a8_0x2d2a03(0x1a1);[a8_0x2d2a03(0x195)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a8_0x2d2a03(0x18c)](_0x28be3f){const _0x2b444d=a8_0x2d2a03,_0x5d3d63=_0x28be3f['args'][_0x2b444d(0x17a)]('\x20');if(!_0x5d3d63)return _0x2b444d(0x1a8);return undefined;}async[a8_0x2d2a03(0x17e)](_0x328a46,_0x2a903e,_0xf84375,_0x4d776d,_0x9747b7){const _0x28e834=a8_0x2d2a03;for await(const _0x5079e7 of _0x328a46[_0x28e834(0x18b)]['chat'](_0x2a903e,{'agentId':_0xf84375,'chatId':_0x4d776d})){if(_0x5079e7[_0x28e834(0x17f)]===_0x28e834(0x185)){const _0x26811d=_0x5079e7[_0x28e834(0x1a0)][_0x28e834(0x16f)];saveLastChatId(_0x26811d),_0x9747b7&&console[_0x28e834(0x1aa)](_0x28e834(0x18f)+_0x26811d);}else _0x5079e7['type']===_0x28e834(0x1a5)&&this['handleChatEvent'](_0x5079e7[_0x28e834(0x1a0)]);}}async[a8_0x2d2a03(0x17c)](_0x3bc4d6,_0x5a0620,_0x1dded4,_0x114713,_0x2617c5){const _0xa98a08=a8_0x2d2a03,_0x42611a=_0x5a0620||_0x1dded4;if(_0x42611a){const {projectName:_0x4e5e8c,agentName:_0x471b51}=parseAgentRef(_0x42611a),_0x92bb10=_0x471b51||_0x42611a,_0x1cb6a4=_0x471b51?_0x4e5e8c:_0x114713;if(!_0x1cb6a4)throw new Error(_0xa98a08(0x19d));if(_0x2617c5){const _0x1ae758=_0x5a0620?_0xa98a08(0x198):_0xa98a08(0x197);console[_0xa98a08(0x1aa)](_0xa98a08(0x18a)+_0x1ae758+':\x20'+_0x1cb6a4+'/'+_0x92bb10);}const _0x4c9280=await withSpinner(_0xa98a08(0x175)+_0x1cb6a4+_0xa98a08(0x1a4),()=>_0x3bc4d6[_0xa98a08(0x18b)][_0xa98a08(0x199)](_0x1cb6a4),{'verbose':_0x2617c5}),_0x13cbdf=await withSpinner('Resolving\x20agent\x20\x27'+_0x92bb10+'\x27...',()=>_0x3bc4d6[_0xa98a08(0x18b)][_0xa98a08(0x181)](_0x92bb10,_0x4c9280['data']),{'verbose':_0x2617c5});return _0x13cbdf['data'];}else{const _0x56d3aa=_0x3bc4d6[_0xa98a08(0x18b)]['getDefaultAgent']();if(_0x56d3aa)return _0x2617c5&&console[_0xa98a08(0x1aa)](_0xa98a08(0x176)+_0x56d3aa[_0xa98a08(0x1a6)]),_0x56d3aa['id'];const _0x172bf1=await withSpinner(_0xa98a08(0x178),()=>_0x3bc4d6['llm'][_0xa98a08(0x18d)](_0xa98a08(0x194),0x0),{'verbose':_0x2617c5});return _0x172bf1[_0xa98a08(0x1a0)]['id'];}}async['execute'](_0x42896b){const _0x537a55=a8_0x2d2a03,{options:_0x272a72,args:_0x49fc0b,tdx:_0x366ac2}=_0x42896b,_0x5f497a=_0x49fc0b[_0x537a55(0x17a)]('\x20'),_0x18a3fc=_0x272a72,_0x314483=_0x18a3fc[_0x537a55(0x173)],_0x27edb0=_0x18a3fc[_0x537a55(0x17d)],_0x248c02=_0x18a3fc[_0x537a55(0x1a7)],_0x25f74f=_0x18a3fc[_0x537a55(0x182)];try{let _0x40d1c2,_0x2f4bdb;!_0x25f74f&&(_0x2f4bdb=loadLastChatId(),_0x2f4bdb&&_0x272a72['verbose']&&console[_0x537a55(0x1aa)](_0x537a55(0x19a)+_0x2f4bdb));(_0x25f74f||!_0x2f4bdb)&&(_0x40d1c2=await this['getAgentId'](_0x366ac2,_0x314483,_0x27edb0,_0x248c02,_0x272a72[_0x537a55(0x17b)]));try{await this[_0x537a55(0x17e)](_0x366ac2,_0x5f497a,_0x40d1c2,_0x2f4bdb,_0x272a72['verbose']);}catch(_0x3141bb){const _0x4cf5f5=_0x3141bb instanceof SDKError&&_0x3141bb[_0x537a55(0x172)]===ErrorCode[_0x537a55(0x184)]||_0x3141bb instanceof Error&&_0x3141bb[_0x537a55(0x1a3)][_0x537a55(0x19c)](_0x537a55(0x189));if(_0x4cf5f5)_0x272a72[_0x537a55(0x17b)]&&console[_0x537a55(0x1aa)]('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0x40d1c2&&(_0x40d1c2=await this[_0x537a55(0x17c)](_0x366ac2,_0x314483,_0x27edb0,_0x248c02,_0x272a72[_0x537a55(0x17b)])),await this[_0x537a55(0x17e)](_0x366ac2,_0x5f497a,_0x40d1c2,undefined,_0x272a72[_0x537a55(0x17b)]);else throw _0x3141bb;}return console[_0x537a55(0x180)](),0x0;}catch(_0x25a3e3){return console[_0x537a55(0x1aa)](),handleSDKError(_0x25a3e3,_0x272a72),0x1;}}[a8_0x2d2a03(0x192)](_0x41ca4d){const _0x132cbc=a8_0x2d2a03;if('content'in _0x41ca4d)process[_0x132cbc(0x190)][_0x132cbc(0x191)](_0x41ca4d[_0x132cbc(0x18e)]);else _0x132cbc(0x1aa)in _0x41ca4d&&console[_0x132cbc(0x1aa)]('\x0aError:\x20'+_0x41ca4d[_0x132cbc(0x1aa)]);}}