@treasuredata/tdx 0.28.7 → 0.28.8

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 (181) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/delivery-command.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-campaign-pull-command.js +1 -1
  20. package/dist/commands/engage-campaign-push-command.js +1 -1
  21. package/dist/commands/engage-campaign-validate-command.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/journey-command.js +1 -1
  25. package/dist/commands/journey-validate-command.js +1 -1
  26. package/dist/commands/llm-command.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/schedule-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pull-command.js +1 -1
  37. package/dist/commands/segment-push-command.js +1 -1
  38. package/dist/commands/segment-update-command.js +1 -1
  39. package/dist/commands/segment-use-command.js +1 -1
  40. package/dist/commands/segment-validate-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/status-command.js +1 -1
  44. package/dist/commands/tables.js +1 -1
  45. package/dist/commands/unset-command.js +1 -1
  46. package/dist/commands/upgrade-command.js +1 -1
  47. package/dist/commands/use-command.js +1 -1
  48. package/dist/commands/user-command.js +1 -1
  49. package/dist/commands/workflow-command.js +1 -1
  50. package/dist/core/auth.js +1 -1
  51. package/dist/core/command-output.js +1 -1
  52. package/dist/core/config.js +1 -1
  53. package/dist/core/connection-cache.js +1 -1
  54. package/dist/core/constants.js +1 -1
  55. package/dist/core/credential-cache.js +1 -1
  56. package/dist/core/global-context.js +1 -1
  57. package/dist/core/keychain.js +1 -1
  58. package/dist/core/profile.js +1 -1
  59. package/dist/core/project-config.js +1 -1
  60. package/dist/core/session.js +1 -1
  61. package/dist/core/user-cache.js +1 -1
  62. package/dist/core/version.js +1 -1
  63. package/dist/index.js +1 -1
  64. package/dist/mcp/server.js +1 -1
  65. package/dist/mcp/tools/index.js +1 -1
  66. package/dist/mcp/tools/tdx-run.js +1 -1
  67. package/dist/mcp/tools/tdx-search.js +1 -1
  68. package/dist/mcp/utils.js +1 -1
  69. package/dist/proxy/claude-usage-tracker.js +1 -1
  70. package/dist/proxy/passthrough-server.js +1 -1
  71. package/dist/proxy/sse-usage-parser.js +1 -1
  72. package/dist/sdk/agent/agent-config.js +1 -1
  73. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  74. package/dist/sdk/agent/agent-yaml.js +1 -1
  75. package/dist/sdk/agent/test/evaluator.js +1 -1
  76. package/dist/sdk/agent/test/executor.js +1 -1
  77. package/dist/sdk/agent/test/index.js +1 -1
  78. package/dist/sdk/agent/test/output.js +1 -1
  79. package/dist/sdk/agent/test/parser.js +1 -1
  80. package/dist/sdk/agent/tool-target-registry.js +1 -1
  81. package/dist/sdk/api.js +1 -1
  82. package/dist/sdk/client/cdp-api-client.js +1 -1
  83. package/dist/sdk/client/delivery-api-client.js +1 -1
  84. package/dist/sdk/client/endpoints.js +1 -1
  85. package/dist/sdk/client/engage-api-client.js +1 -1
  86. package/dist/sdk/client/http-client.js +1 -1
  87. package/dist/sdk/client/llm-api-client.js +1 -1
  88. package/dist/sdk/client/rate-limiter.js +1 -1
  89. package/dist/sdk/client/td-api-client.js +1 -1
  90. package/dist/sdk/client/trino-api-client.js +1 -1
  91. package/dist/sdk/client/workflow-client.js +1 -1
  92. package/dist/sdk/connection-validator.js +1 -1
  93. package/dist/sdk/connection.js +1 -1
  94. package/dist/sdk/delivery.js +1 -1
  95. package/dist/sdk/engage/campaign-pull.js +1 -1
  96. package/dist/sdk/engage/campaign-push.js +1 -1
  97. package/dist/sdk/engage/campaign-validator.js +1 -1
  98. package/dist/sdk/engage/campaign-yaml.js +1 -1
  99. package/dist/sdk/engage/types/campaign-def.js +1 -1
  100. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  101. package/dist/sdk/engage.js +1 -1
  102. package/dist/sdk/errors.js +1 -1
  103. package/dist/sdk/index.js +1 -1
  104. package/dist/sdk/io/index.js +1 -1
  105. package/dist/sdk/io/node-filesystem.js +1 -1
  106. package/dist/sdk/job.js +1 -1
  107. package/dist/sdk/journey.js +1 -1
  108. package/dist/sdk/llm/chat-cache.js +1 -1
  109. package/dist/sdk/llm/index.js +1 -1
  110. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  111. package/dist/sdk/llm/model-factors.js +1 -1
  112. package/dist/sdk/personalization.js +1 -1
  113. package/dist/sdk/query/index.js +1 -1
  114. package/dist/sdk/query/sql-parser.js +1 -1
  115. package/dist/sdk/realtime.js +1 -1
  116. package/dist/sdk/schedule.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-validator.js +1 -1
  122. package/dist/sdk/segment/journey-yaml.js +1 -1
  123. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  124. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  125. package/dist/sdk/segment/pull-workflow.js +1 -1
  126. package/dist/sdk/segment/push-recovery.js +1 -1
  127. package/dist/sdk/segment/push-workflow.js +1 -1
  128. package/dist/sdk/segment/resolution-context.js +1 -1
  129. package/dist/sdk/segment/segment-path-parser.js +1 -1
  130. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  131. package/dist/sdk/segment/target-resolution.js +1 -1
  132. package/dist/sdk/segment/tdx-config.js +1 -1
  133. package/dist/sdk/segment/validate-files.js +1 -1
  134. package/dist/sdk/segment/yaml-validator.js +1 -1
  135. package/dist/sdk/segment.js +1 -1
  136. package/dist/sdk/types/index.js +1 -1
  137. package/dist/sdk/types/progress.js +1 -1
  138. package/dist/sdk/user.js +1 -1
  139. package/dist/sdk/util/format-detector.js +1 -1
  140. package/dist/sdk/util/formatters.js +1 -1
  141. package/dist/sdk/util/index.js +1 -1
  142. package/dist/sdk/util/tree-formatter.js +1 -1
  143. package/dist/sdk/workflow/archive-validation.js +1 -1
  144. package/dist/sdk/workflow/clone-workflow.js +1 -1
  145. package/dist/sdk/workflow/index.js +1 -1
  146. package/dist/sdk/workflow/pull-workflow.js +1 -1
  147. package/dist/sdk/workflow/push-workflow.js +1 -1
  148. package/dist/sdk/workflow/tdx-config.js +1 -1
  149. package/dist/sdk/workflow/workflow-utils.js +1 -1
  150. package/dist/test-utils/command-runner.js +1 -1
  151. package/dist/test-utils/factories.js +1 -1
  152. package/dist/test-utils/fixtures.js +1 -1
  153. package/dist/test-utils/http-mock.js +1 -1
  154. package/dist/test-utils/index.js +1 -1
  155. package/dist/utils/async.js +1 -1
  156. package/dist/utils/colors.js +1 -1
  157. package/dist/utils/diff.js +1 -1
  158. package/dist/utils/file-permissions.js +1 -1
  159. package/dist/utils/file-reader.js +1 -1
  160. package/dist/utils/global-cache.js +1 -1
  161. package/dist/utils/json-loader.js +1 -1
  162. package/dist/utils/local-cache.js +1 -1
  163. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  164. package/dist/utils/logger/formatters/index.js +1 -1
  165. package/dist/utils/logger/handlers/console-handler.js +1 -1
  166. package/dist/utils/logger/handlers/file-handler.js +1 -1
  167. package/dist/utils/logger/handlers/index.js +1 -1
  168. package/dist/utils/logger/handlers/null-handler.js +1 -1
  169. package/dist/utils/logger/index.js +1 -1
  170. package/dist/utils/logger/logger.js +1 -1
  171. package/dist/utils/logger/types.js +1 -1
  172. package/dist/utils/option-validation.js +1 -1
  173. package/dist/utils/process.js +1 -1
  174. package/dist/utils/prompt.js +1 -1
  175. package/dist/utils/spinner.js +1 -1
  176. package/dist/utils/sse-parser.js +1 -1
  177. package/dist/utils/string-utils.js +1 -1
  178. package/dist/utils/table-ref-parser.js +1 -1
  179. package/dist/utils/tdx-logger.js +1 -1
  180. package/dist/utils/version-check.js +1 -1
  181. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x5898f0=a3_0x1f20;function a3_0x502b(){const _0x146c54=['cause','155358kLDgsT','751877znaYDJ','Resolving\x20parent\x20segment\x20\x27','activations','error','Child\x20name:\x20','Listing\x20activations\x20for\x20segment\x20\x27','description','name','\x27...','Resolving\x20child\x20segment\x20\x27','resolveParentId','segment','Resolved\x20child\x20ID:\x20','resolveSegmentId','80piuXBL','Error:\x20','29364VMqevQ','Parent\x20name:\x20','105695wnuGsX','site','Error:\x20Segment\x20name\x20is\x20required','\x20activation','verbose','✔\x20Found\x20','3820839AJILvg','76cFxcKU','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','25983neBqDt','List\x20activations\x20for\x20a\x20segment','12jDXavz','listActivations','Resolved\x20parent\x20ID:\x20','1000ECrBlo','1562840GyUHaL','message','18nfevZf','data','length'];a3_0x502b=function(){return _0x146c54;};return a3_0x502b();}(function(_0x4380eb,_0x24d920){const _0x5c12ea=a3_0x1f20,_0x7ca03d=_0x4380eb();while(!![]){try{const _0x48b662=-parseInt(_0x5c12ea(0x1ca))/0x1+-parseInt(_0x5c12ea(0x1d9))/0x2*(parseInt(_0x5c12ea(0x1db))/0x3)+-parseInt(_0x5c12ea(0x1bc))/0x4*(-parseInt(_0x5c12ea(0x1dd))/0x5)+-parseInt(_0x5c12ea(0x1c6))/0x6*(-parseInt(_0x5c12ea(0x1cb))/0x7)+-parseInt(_0x5c12ea(0x1c3))/0x8*(-parseInt(_0x5c12ea(0x1be))/0x9)+parseInt(_0x5c12ea(0x1c4))/0xa+parseInt(_0x5c12ea(0x1bb))/0xb*(-parseInt(_0x5c12ea(0x1c0))/0xc);if(_0x48b662===_0x24d920)break;else _0x7ca03d['push'](_0x7ca03d['shift']());}catch(_0x248d4f){_0x7ca03d['push'](_0x7ca03d['shift']());}}}(a3_0x502b,0x54ab6));import{BaseCommand}from'./command.js';function a3_0x1f20(_0x6eeb93,_0x5937b7){_0x6eeb93=_0x6eeb93-0x1b7;const _0x502b0b=a3_0x502b();let _0x1f2016=_0x502b0b[_0x6eeb93];return _0x1f2016;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x5898f0(0x1d2)]=a3_0x5898f0(0x1cd);[a3_0x5898f0(0x1d1)]=a3_0x5898f0(0x1bf);async['execute'](_0x56daf8){const _0x58f908=a3_0x5898f0,{options:_0x313d62,args:_0x3c31b3,tdx:_0x5e8648}=_0x56daf8;if(_0x3c31b3[_0x58f908(0x1c8)]===0x0)return console[_0x58f908(0x1ce)](_0x58f908(0x1b7)),console['error'](_0x58f908(0x1bd)),0x1;try{const {parentId:_0x1d8402,childId:_0x393551}=parseSegmentRef(_0x3c31b3[0x0]);if(!_0x393551)return console[_0x58f908(0x1ce)]('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console['error'](_0x58f908(0x1bd)),0x1;_0x313d62[_0x58f908(0x1b9)]&&(console[_0x58f908(0x1ce)]('Site:\x20'+_0x313d62[_0x58f908(0x1de)]),console[_0x58f908(0x1ce)](_0x58f908(0x1dc)+_0x1d8402),console[_0x58f908(0x1ce)](_0x58f908(0x1cf)+_0x393551));const _0x4871de=await withSpinner(_0x58f908(0x1cc)+_0x1d8402+_0x58f908(0x1d3),()=>_0x5e8648[_0x58f908(0x1d6)][_0x58f908(0x1d5)](_0x1d8402),{'verbose':_0x313d62['verbose']}),_0x3bef6b=_0x4871de[_0x58f908(0x1c7)];_0x313d62[_0x58f908(0x1b9)]&&console[_0x58f908(0x1ce)](_0x58f908(0x1c2)+_0x3bef6b);const _0x1dabc2=await withSpinner(_0x58f908(0x1d4)+_0x393551+'\x27...',()=>_0x5e8648['segment'][_0x58f908(0x1d8)](_0x3bef6b,_0x393551),{'verbose':_0x313d62[_0x58f908(0x1b9)]}),_0x2d5459=_0x1dabc2[_0x58f908(0x1c7)];_0x313d62[_0x58f908(0x1b9)]&&console[_0x58f908(0x1ce)](_0x58f908(0x1d7)+_0x2d5459);const _0x549a84=await withSpinner(_0x58f908(0x1d0)+_0x393551+_0x58f908(0x1d3),()=>_0x5e8648[_0x58f908(0x1d6)][_0x58f908(0x1c1)](_0x3bef6b,_0x2d5459),{'verbose':_0x313d62[_0x58f908(0x1b9)]}),_0x300993=_0x549a84[_0x58f908(0x1c7)];return console[_0x58f908(0x1ce)](_0x58f908(0x1ba)+_0x300993[_0x58f908(0x1c8)]+_0x58f908(0x1b8)+(_0x300993[_0x58f908(0x1c8)]!==0x1?'s':'')),await handleSDKOutput(_0x300993,_0x313d62),0x0;}catch(_0x4dbb8d){if(_0x4dbb8d instanceof SDKError)return console['error'](_0x58f908(0x1da)+_0x4dbb8d[_0x58f908(0x1c5)]),_0x4dbb8d[_0x58f908(0x1c9)]&&console['error']('\x20\x20Cause:\x20'+_0x4dbb8d[_0x58f908(0x1c9)]),0x1;throw _0x4dbb8d;}}}
1
+ const a3_0x3e9411=a3_0x25b2;(function(_0x13f812,_0x3df6d2){const _0x2190b3=a3_0x25b2,_0x306333=_0x13f812();while(!![]){try{const _0x329217=parseInt(_0x2190b3(0x173))/0x1+parseInt(_0x2190b3(0x15e))/0x2+parseInt(_0x2190b3(0x15f))/0x3+parseInt(_0x2190b3(0x17c))/0x4*(-parseInt(_0x2190b3(0x15c))/0x5)+parseInt(_0x2190b3(0x174))/0x6*(parseInt(_0x2190b3(0x16f))/0x7)+-parseInt(_0x2190b3(0x163))/0x8*(-parseInt(_0x2190b3(0x170))/0x9)+-parseInt(_0x2190b3(0x169))/0xa*(parseInt(_0x2190b3(0x165))/0xb);if(_0x329217===_0x3df6d2)break;else _0x306333['push'](_0x306333['shift']());}catch(_0x5070dc){_0x306333['push'](_0x306333['shift']());}}}(a3_0xfd25,0x3535f));function a3_0x25b2(_0x1daae6,_0x40735c){_0x1daae6=_0x1daae6-0x15c;const _0xfd2591=a3_0xfd25();let _0x25b21e=_0xfd2591[_0x1daae6];return _0x25b21e;}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_0xfd25(){const _0x5916b3=['cause','8452CiXYEI','execute','error','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','activations','330YnvHqE','Listing\x20activations\x20for\x20segment\x20\x27','623992kIjiov','80898QnLAAI','resolveParentId','verbose','Child\x20name:\x20','342296LrjgOf','segment','33ktvoKz','name','\x20activation','Resolving\x20child\x20segment\x20\x27','709760dwjVsS','length','Resolved\x20child\x20ID:\x20','Resolved\x20parent\x20ID:\x20','List\x20activations\x20for\x20a\x20segment','Error:\x20Segment\x20name\x20is\x20required','66591EzdAdd','9KmhNWl','✔\x20Found\x20','\x20\x20Cause:\x20','26867qokUcd','102CAwRmZ','description','data','Parent\x20name:\x20','\x27...','Error:\x20','Resolving\x20parent\x20segment\x20\x27'];a3_0xfd25=function(){return _0x5916b3;};return a3_0xfd25();}export class ActivationsCommand extends BaseCommand{[a3_0x3e9411(0x166)]=a3_0x3e9411(0x180);[a3_0x3e9411(0x175)]=a3_0x3e9411(0x16d);async[a3_0x3e9411(0x17d)](_0xfb46d3){const _0x5906cf=a3_0x3e9411,{options:_0x155891,args:_0x89ecf4,tdx:_0x4c3c54}=_0xfb46d3;if(_0x89ecf4[_0x5906cf(0x16a)]===0x0)return console[_0x5906cf(0x17e)](_0x5906cf(0x16e)),console['error'](_0x5906cf(0x17f)),0x1;try{const {parentId:_0x568b75,childId:_0x1a09da}=parseSegmentRef(_0x89ecf4[0x0]);if(!_0x1a09da)return console['error']('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x5906cf(0x17e)](_0x5906cf(0x17f)),0x1;_0x155891[_0x5906cf(0x161)]&&(console['error']('Site:\x20'+_0x155891['site']),console[_0x5906cf(0x17e)](_0x5906cf(0x177)+_0x568b75),console[_0x5906cf(0x17e)](_0x5906cf(0x162)+_0x1a09da));const _0x31e765=await withSpinner(_0x5906cf(0x17a)+_0x568b75+_0x5906cf(0x178),()=>_0x4c3c54['segment'][_0x5906cf(0x160)](_0x568b75),{'verbose':_0x155891[_0x5906cf(0x161)]}),_0x3c86a4=_0x31e765[_0x5906cf(0x176)];_0x155891[_0x5906cf(0x161)]&&console[_0x5906cf(0x17e)](_0x5906cf(0x16c)+_0x3c86a4);const _0x114022=await withSpinner(_0x5906cf(0x168)+_0x1a09da+_0x5906cf(0x178),()=>_0x4c3c54[_0x5906cf(0x164)]['resolveSegmentId'](_0x3c86a4,_0x1a09da),{'verbose':_0x155891[_0x5906cf(0x161)]}),_0x4ec838=_0x114022['data'];_0x155891[_0x5906cf(0x161)]&&console[_0x5906cf(0x17e)](_0x5906cf(0x16b)+_0x4ec838);const _0x457c45=await withSpinner(_0x5906cf(0x15d)+_0x1a09da+'\x27...',()=>_0x4c3c54[_0x5906cf(0x164)]['listActivations'](_0x3c86a4,_0x4ec838),{'verbose':_0x155891[_0x5906cf(0x161)]}),_0x2eed1=_0x457c45['data'];return console['error'](_0x5906cf(0x171)+_0x2eed1['length']+_0x5906cf(0x167)+(_0x2eed1[_0x5906cf(0x16a)]!==0x1?'s':'')),await handleSDKOutput(_0x2eed1,_0x155891),0x0;}catch(_0x3b31a3){if(_0x3b31a3 instanceof SDKError)return console[_0x5906cf(0x17e)](_0x5906cf(0x179)+_0x3b31a3['message']),_0x3b31a3[_0x5906cf(0x17b)]&&console['error'](_0x5906cf(0x172)+_0x3b31a3['cause']),0x1;throw _0x3b31a3;}}}
@@ -1 +1 @@
1
- const a4_0x6e1237=a4_0x5925;function a4_0x2cd7(){const _0x5a5d3a=['-\x20nothing\x20pushed','experimentalKnowledgeBases','newProjectId','<new-name>','2ecyYdH','experimentalArtifacts','projectName','New\x20project\x20ID:\x20','2236115CvVtly','total','MISSING_ARGUMENT','Using\x20context\x20project:\x20','no_local_folder','agent:clone','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20|\x20','agent','Using\x20project:\x20','session','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','red','output','\x0aError:','agentName','arg-dir','projectId','52884dBNEAU','\x22...','outputPath','knowledgeBases','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','message','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Would\x20push\x20agent:\x20','680527GhwoqJ','integrations','5YmxPJw','Failed\x20to\x20push\x20agent:\x20','\x0aChanges\x20to\x20integration\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','1384185inUkYI','\x20\x20Knowledge\x20Base\x20\x22','description','unchanged','Agent\x20pulled\x20successfully','outputDir','\x20\x20Source:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','force','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20unchanged','cwd-config','\x0aPush\x20','dirname','join','agent.yml','\x20--profile\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','New\x20project:\x20','llm_project','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','8rtKuLt','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\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','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','updated','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x20errors','\x20resources\x20to\x20\x27','projectDir','tdx.json','Writing\x20files...','source','cyan','\x20\x20Experimental\x20Artifacts:\x20','Cloning\x20\x22','Errors:','newProjectName','Dry\x20run\x20-\x20no\x20changes\x20made','yes','\x20new','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20\x20Prompt\x20\x22','Using\x20local\x20project:\x20','\x20=\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','pullAgent','log','new','\x0aProject\x20pushed\x20with\x20errors','yellow','textKnowledgeBases','No\x20tdx.json\x20found\x20in\x20','dim','6104760GCfeQQ','isNew','\x0aErrors\x20found:','no_context','\x20\x20tdx\x20agent\x20clone\x20agents/','cwd','agents','diff','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20Text\x20Knowledge\x20Bases:\x20','Chat:\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','error','INVALID_ARGUMENT','agentId','site','execute','\x20\x20Text\x20Knowledge\x20Base\x20\x22','sourceProjectName','Using\x20project\x20from\x20context:\x20','\x20created','errors','\x20\x20Prompts:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','✔\x20Context\x20set:\x20','\x20\x20Agents:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','context','action','Pulling\x20agent\x20\x22','gray','\x22\x20to\x20a\x20different\x20profile','agent:pull','utf-8','\x20\x20tdx\x20agent\x20pull\x20','35676dNcByg','parse','Summary:','1430FETYYA','green','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','reason','Clone\x20\x22','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Analyzing\x20changes\x20to\x20push...','New\x20project\x20name\x20is\x20required','\x20files?','Agent:\x20','prompts','Project:\x20','llm','name','counts','\x0aPush\x20summary\x20for\x20\x27','\x20\x20Experimental\x20Artifact\x20\x22','-\x20no\x20files\x20written','agent:push','Pushing\x20agent\x20from\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','push','\x20changed','Dry\x20run\x20-\x20no\x20files\x20written','Would\x20pull\x20agent:\x20','1166964VztBMg','profile','pullProject','\x20\x20Knowledge\x20Bases:\x20','\x0a✔\x20Pushed\x20','\x22:\x20','\x22\x20to\x20\x22','\x20\x20Integrations:\x20','dryRun','\x20updated','\x20resources?','Project\x20cloned\x20with\x20errors','created','hasChanges','Status:\x20','Using\x20project\x20from\x20','\x0aChanges:','Usage:\x20tdx\x20agent\x20pull\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#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','\x0aPull\x20summary\x20for\x20\x27','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20total','Cancelled','4136bXkBfV','Source:\x20','\x20\x20Agent\x20\x22','pushProject','Agent\x20','repeat'];a4_0x2cd7=function(){return _0x5a5d3a;};return a4_0x2cd7();}(function(_0x559f56,_0x2eed65){const _0x1792a2=a4_0x5925,_0x4d743a=_0x559f56();while(!![]){try{const _0x24de5b=parseInt(_0x1792a2(0x111))/0x1*(parseInt(_0x1792a2(0xf3))/0x2)+parseInt(_0x1792a2(0x117))/0x3*(-parseInt(_0x1792a2(0x12c))/0x4)+-parseInt(_0x1792a2(0x113))/0x5*(-parseInt(_0x1792a2(0x191))/0x6)+-parseInt(_0x1792a2(0xf7))/0x7+parseInt(_0x1792a2(0x152))/0x8+parseInt(_0x1792a2(0x109))/0x9*(-parseInt(_0x1792a2(0x178))/0xa)+-parseInt(_0x1792a2(0x1a7))/0xb*(-parseInt(_0x1792a2(0x175))/0xc);if(_0x24de5b===_0x2eed65)break;else _0x4d743a['push'](_0x4d743a['shift']());}catch(_0x20bd22){_0x4d743a['push'](_0x4d743a['shift']());}}}(a4_0x2cd7,0xa46b5));import a4_0x252438 from'chalk';import a4_0x44cbc4 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a4_0x5925(_0x20f4e2,_0x873433){_0x20f4e2=_0x20f4e2-0xed;const _0x2cd79b=a4_0x2cd7();let _0x59253a=_0x2cd79b[_0x20f4e2];return _0x59253a;}import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}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(_0x4c9a9d){const _0x5b6478=a4_0x5925,_0x285036=[];if(_0x4c9a9d['total']!==undefined)_0x285036[_0x5b6478(0x18d)](_0x4c9a9d[_0x5b6478(0xf8)]+_0x5b6478(0x1a5));if(_0x4c9a9d[_0x5b6478(0x14c)]!==undefined&&_0x4c9a9d[_0x5b6478(0x14c)]>0x0)_0x285036[_0x5b6478(0x18d)](a4_0x252438['green'](_0x4c9a9d[_0x5b6478(0x14c)]+_0x5b6478(0x140)));if(_0x4c9a9d['created']!==undefined&&_0x4c9a9d['created']>0x0)_0x285036[_0x5b6478(0x18d)](a4_0x252438[_0x5b6478(0x179)](_0x4c9a9d['created']+_0x5b6478(0x166)));if(_0x4c9a9d[_0x5b6478(0x131)]!==undefined&&_0x4c9a9d[_0x5b6478(0x131)]>0x0)_0x285036['push'](a4_0x252438[_0x5b6478(0x14e)](_0x4c9a9d[_0x5b6478(0x131)]+_0x5b6478(0x19a)));if(_0x4c9a9d['unchanged']!==undefined&&_0x4c9a9d[_0x5b6478(0x11a)]>0x0)_0x285036[_0x5b6478(0x18d)](a4_0x252438[_0x5b6478(0x170)](_0x4c9a9d[_0x5b6478(0x11a)]+_0x5b6478(0x121)));if(_0x4c9a9d['errors']!==undefined&&_0x4c9a9d[_0x5b6478(0x167)]>0x0)_0x285036[_0x5b6478(0x18d)](a4_0x252438['red'](_0x4c9a9d[_0x5b6478(0x167)]+_0x5b6478(0x133)));return _0x285036[_0x5b6478(0x125)](',\x20');}function displayDiffs(_0x504f22,_0x5e2328,_0x2fd899,_0x3bc038,_0x257c9a,_0x39e946,_0x61f3ab){const _0x486cb7=a4_0x5925;for(const _0x3cf381 of _0x504f22){if(_0x3cf381[_0x486cb7(0x159)]){const _0x1af8ca=_0x3cf381['agentName']||_0x3cf381['name'];console[_0x486cb7(0x14b)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x1af8ca+'\x27:'),console[_0x486cb7(0x14b)]('─'[_0x486cb7(0xee)](0x3c)),console['log'](_0x3cf381[_0x486cb7(0x159)]),console['log']('─'[_0x486cb7(0xee)](0x3c));}}for(const _0x104519 of _0x5e2328){_0x104519[_0x486cb7(0x159)]&&(console[_0x486cb7(0x14b)](_0x486cb7(0x10f)+_0x104519[_0x486cb7(0x185)]+'\x27:'),console[_0x486cb7(0x14b)]('─'[_0x486cb7(0xee)](0x3c)),console[_0x486cb7(0x14b)](_0x104519[_0x486cb7(0x159)]),console[_0x486cb7(0x14b)]('─'[_0x486cb7(0xee)](0x3c)));}for(const _0x313453 of _0x2fd899){_0x313453[_0x486cb7(0x159)]&&(console[_0x486cb7(0x14b)](_0x486cb7(0x11e)+_0x313453[_0x486cb7(0x185)]+'\x27:'),console[_0x486cb7(0x14b)]('─'[_0x486cb7(0xee)](0x3c)),console[_0x486cb7(0x14b)](_0x313453[_0x486cb7(0x159)]),console['log']('─'[_0x486cb7(0xee)](0x3c)));}for(const _0x446914 of _0x3bc038){_0x446914[_0x486cb7(0x159)]&&(console['log']('\x0aChanges\x20to\x20prompt\x20\x27'+_0x446914[_0x486cb7(0x185)]+'\x27:'),console[_0x486cb7(0x14b)]('─'[_0x486cb7(0xee)](0x3c)),console[_0x486cb7(0x14b)](_0x446914[_0x486cb7(0x159)]),console[_0x486cb7(0x14b)]('─'[_0x486cb7(0xee)](0x3c)));}for(const _0xc26be1 of _0x257c9a){_0xc26be1['diff']&&(console[_0x486cb7(0x14b)](_0x486cb7(0x115)+_0xc26be1[_0x486cb7(0x185)]+'\x27:'),console[_0x486cb7(0x14b)]('─'[_0x486cb7(0xee)](0x3c)),console['log'](_0xc26be1[_0x486cb7(0x159)]),console[_0x486cb7(0x14b)]('─'[_0x486cb7(0xee)](0x3c)));}for(const _0x76569e of _0x39e946){_0x76569e[_0x486cb7(0x159)]&&(console[_0x486cb7(0x14b)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x76569e[_0x486cb7(0x185)]+'\x27:'),console[_0x486cb7(0x14b)]('─'[_0x486cb7(0xee)](0x3c)),console[_0x486cb7(0x14b)](_0x76569e[_0x486cb7(0x159)]),console[_0x486cb7(0x14b)]('─'[_0x486cb7(0xee)](0x3c)));}for(const _0x1e9023 of _0x61f3ab){_0x1e9023[_0x486cb7(0x159)]&&(console[_0x486cb7(0x14b)](_0x486cb7(0xfd)+_0x1e9023['name']+'\x27:'),console[_0x486cb7(0x14b)]('─'[_0x486cb7(0xee)](0x3c)),console[_0x486cb7(0x14b)](_0x1e9023[_0x486cb7(0x159)]),console['log']('─'[_0x486cb7(0xee)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x6e1237(0x172);[a4_0x6e1237(0x119)]=a4_0x6e1237(0x1a4);async['execute'](_0x17d92d){const _0x1d1c27=a4_0x6e1237,{options:_0xb1de24,args:_0x19aa52,tdx:_0x110c8c}=_0x17d92d,_0x5f04dc=_0x19aa52[0x0],_0x597c63=_0x19aa52[0x1],_0x179010=_0xb1de24[_0x1d1c27(0x104)],_0xa517b5=_0xb1de24[_0x1d1c27(0x199)],_0xc32a58=_0xb1de24[_0x1d1c27(0x11f)],_0x4838f6=_0xb1de24[_0x1d1c27(0x13f)],_0x5882e2=_0xb1de24['llmProject'],_0x5f151b=_0xb1de24[_0x1d1c27(0xff)];let _0x5609ac;if(_0x5f04dc){const _0x48accd=a4_0x44cbc4['join'](_0x5f04dc,_0x1d1c27(0x136));if(existsSync(_0x48accd))try{const _0x4a9f6f=JSON[_0x1d1c27(0x176)](readFileSync(_0x48accd,_0x1d1c27(0x173)));_0x4a9f6f[_0x1d1c27(0x12a)]&&(_0x5609ac={'llm_project':_0x4a9f6f[_0x1d1c27(0x12a)]});}catch{}}const _0x3a105b=findAgentConfigPath(process['cwd']());let _0x3fe9b8;if(_0x3a105b)try{const _0x13fd4d=JSON[_0x1d1c27(0x176)](readFileSync(_0x3a105b,_0x1d1c27(0x173)));_0x13fd4d['llm_project']&&(_0x3fe9b8={'llm_project':_0x13fd4d[_0x1d1c27(0x12a)]});}catch{}const _0x580898=resolveAgentPullArgs({'arg':_0x5f04dc,'agentNameArg':_0x597c63,'agentFlag':_0x5f151b,'contextProject':_0x5882e2,'argDirConfig':_0x5609ac,'cwdConfigPath':_0x3a105b||undefined,'cwdConfig':_0x3fe9b8}),{projectNameOrId:_0x5cf4e1,targetAgentName:_0x35fbdf,existingOutputDir:_0x4acc27,source:_0x6069e0}=_0x580898;if(_0x6069e0===_0x1d1c27(0x107))console[_0x1d1c27(0x14b)](a4_0x252438[_0x1d1c27(0x151)](_0x1d1c27(0x1a0)+a4_0x44cbc4[_0x1d1c27(0x125)](_0x5f04dc,_0x1d1c27(0x136))+':\x20'+_0x5cf4e1));else{if(_0x6069e0===_0x1d1c27(0x122))console[_0x1d1c27(0x14b)](a4_0x252438['dim'](_0x1d1c27(0x100)+_0x5cf4e1));else _0x6069e0==='context'&&console[_0x1d1c27(0x14b)](a4_0x252438[_0x1d1c27(0x151)](_0x1d1c27(0x165)+_0x5cf4e1));}if(!_0x5cf4e1)return _0x5f151b?(console[_0x1d1c27(0x14b)](a4_0x252438[_0x1d1c27(0x14e)]('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x1d1c27(0x14b)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console['log'](_0x1d1c27(0x132))):(console['log'](a4_0x252438[_0x1d1c27(0x14e)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x1d1c27(0x14b)](_0x1d1c27(0x1a2)),console['log'](_0x1d1c27(0x141)),console[_0x1d1c27(0x14b)](_0x1d1c27(0x116)),console[_0x1d1c27(0x14b)](_0x1d1c27(0x169)),console[_0x1d1c27(0x14b)](_0x1d1c27(0x18c))),0x1;if(_0x35fbdf){const {data:_0x1cd9dd}=await withSpinner(_0x1d1c27(0x16f)+_0x35fbdf+'\x22\x20from\x20project\x20\x22'+_0x5cf4e1+'\x22...',()=>_0x110c8c[_0x1d1c27(0x184)][_0x1d1c27(0x14a)](_0x5cf4e1,_0x35fbdf,_0x179010,{'dryRun':_0xa517b5,'force':_0xc32a58}));if(_0xa517b5)return console[_0x1d1c27(0x14b)](a4_0x252438[_0x1d1c27(0x14e)](_0x1d1c27(0x18f))),console[_0x1d1c27(0x14b)](_0x1d1c27(0x190)+_0x1cd9dd[_0x1d1c27(0x106)]),console['log']('Output\x20path:\x20'+_0x1cd9dd[_0x1d1c27(0x10b)]),_0x1cd9dd[_0x1d1c27(0x159)]&&(console[_0x1d1c27(0x14b)](_0x1d1c27(0x1a1)),console[_0x1d1c27(0x14b)]('─'[_0x1d1c27(0xee)](0x3c)),console[_0x1d1c27(0x14b)](_0x1cd9dd['diff']),console[_0x1d1c27(0x14b)]('─'['repeat'](0x3c))),0x0;return console['log'](a4_0x252438['green'](_0x1d1c27(0x11b))),console[_0x1d1c27(0x14b)](_0x1d1c27(0x181)+_0x1cd9dd[_0x1d1c27(0x106)]),console[_0x1d1c27(0x14b)]('Output:\x20'+_0x1cd9dd[_0x1d1c27(0x10b)]),console['log'](_0x1d1c27(0x19f)+(_0x1cd9dd[_0x1d1c27(0x153)]?a4_0x252438[_0x1d1c27(0x179)]('new'):_0x1cd9dd[_0x1d1c27(0x19e)]?a4_0x252438[_0x1d1c27(0x14e)](_0x1d1c27(0x131)):a4_0x252438[_0x1d1c27(0x170)](_0x1d1c27(0x11a)))),0x0;}const _0x1c0686=_0x4acc27||_0x179010,{data:_0x36794d}=await withSpinner('Analyzing\x20project\x20\x22'+_0x5cf4e1+_0x1d1c27(0x10a),()=>_0x110c8c[_0x1d1c27(0x184)][_0x1d1c27(0x193)](_0x5cf4e1,_0x1c0686,{'dryRun':!![]})),_0x4f2995=_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x158)]['new']+_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x10c)][_0x1d1c27(0x14c)]+_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x14f)]['new']+_0x36794d[_0x1d1c27(0x186)]['prompts'][_0x1d1c27(0x14c)]+_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x112)][_0x1d1c27(0x14c)]+_0x36794d[_0x1d1c27(0x186)]['experimentalKnowledgeBases'][_0x1d1c27(0x14c)]+_0x36794d[_0x1d1c27(0x186)]['experimentalArtifacts'][_0x1d1c27(0x14c)],_0x20e7a4=_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x158)][_0x1d1c27(0x131)]+_0x36794d['counts'][_0x1d1c27(0x10c)]['updated']+_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x14f)]['updated']+_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x182)][_0x1d1c27(0x131)]+_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x112)][_0x1d1c27(0x131)]+_0x36794d['counts'][_0x1d1c27(0xf0)][_0x1d1c27(0x131)]+_0x36794d['counts'][_0x1d1c27(0xf4)][_0x1d1c27(0x131)],_0x6fb25d=_0x36794d['counts'][_0x1d1c27(0x158)]['unchanged']+_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x10c)][_0x1d1c27(0x11a)]+_0x36794d[_0x1d1c27(0x186)]['textKnowledgeBases'][_0x1d1c27(0x11a)]+_0x36794d['counts'][_0x1d1c27(0x182)][_0x1d1c27(0x11a)]+_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x112)][_0x1d1c27(0x11a)]+_0x36794d['counts']['experimentalKnowledgeBases'][_0x1d1c27(0x11a)]+_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0xf4)][_0x1d1c27(0x11a)];console[_0x1d1c27(0x14b)](_0x1d1c27(0x1a3)+_0x36794d[_0x1d1c27(0xf5)]+'\x27:'),console['log']('\x20\x20'+a4_0x252438[_0x1d1c27(0x179)]('+\x20'+_0x4f2995+_0x1d1c27(0x140))+_0x1d1c27(0xfe)+a4_0x252438[_0x1d1c27(0x14e)]('~\x20'+_0x20e7a4+_0x1d1c27(0x18e))+_0x1d1c27(0xfe)+a4_0x252438[_0x1d1c27(0x151)]('=\x20'+_0x6fb25d+_0x1d1c27(0x121))),console[_0x1d1c27(0x14b)](_0x1d1c27(0x16b)+formatCountSummary(_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x158)])),console[_0x1d1c27(0x14b)](_0x1d1c27(0x194)+formatCountSummary(_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x10c)])),console[_0x1d1c27(0x14b)](_0x1d1c27(0x15b)+formatCountSummary(_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x14f)])),console[_0x1d1c27(0x14b)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x36794d['counts']['prompts'])),console[_0x1d1c27(0x14b)](_0x1d1c27(0x198)+formatCountSummary(_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0x112)]));const _0x41c52a=_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0xf0)][_0x1d1c27(0xf8)]>0x0||_0x36794d['counts'][_0x1d1c27(0xf4)]['total']>0x0;_0x41c52a&&(console[_0x1d1c27(0x14b)](_0x1d1c27(0x17a)+formatCountSummary(_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0xf0)])),console[_0x1d1c27(0x14b)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x36794d[_0x1d1c27(0x186)][_0x1d1c27(0xf4)])));console[_0x1d1c27(0x14b)]('\x20\x20Target:\x20'+a4_0x252438[_0x1d1c27(0x139)](_0x36794d[_0x1d1c27(0x11c)])),displayDiffs(_0x36794d[_0x1d1c27(0x158)],_0x36794d['knowledgeBases'],_0x36794d[_0x1d1c27(0x14f)],_0x36794d[_0x1d1c27(0x182)],_0x36794d[_0x1d1c27(0x112)],_0x36794d[_0x1d1c27(0xf0)],_0x36794d[_0x1d1c27(0xf4)]);if(_0xa517b5)return console[_0x1d1c27(0x14b)](a4_0x252438[_0x1d1c27(0x14e)](_0x1d1c27(0x12b))),0x0;if(_0x4f2995===0x0&&_0x20e7a4===0x0)return console[_0x1d1c27(0x14b)](a4_0x252438['green'](_0x1d1c27(0x148))),saveSessionContext({'llm_project':_0x36794d[_0x1d1c27(0xf5)]},_0xb1de24[_0x1d1c27(0x101)]),console['log'](a4_0x252438[_0x1d1c27(0x179)](_0x1d1c27(0x16a)+a4_0x252438[_0x1d1c27(0x151)]('llm_project')+_0x1d1c27(0x146)+a4_0x252438[_0x1d1c27(0x139)](_0x36794d[_0x1d1c27(0xf5)]))),0x0;if(!_0x4838f6&&!_0xc32a58){if(!isInteractive())return console['error'](a4_0x252438[_0x1d1c27(0x103)](_0x1d1c27(0x105)),_0x1d1c27(0x130)),console['error'](a4_0x252438[_0x1d1c27(0x151)](_0x1d1c27(0x12d))),0x1;const _0xaeedf9=await confirmKey('\x0aWrite\x20'+(_0x4f2995+_0x20e7a4)+_0x1d1c27(0x180));if(!_0xaeedf9)return console[_0x1d1c27(0x14b)](a4_0x252438[_0x1d1c27(0x14e)](_0x1d1c27(0x1a6)),_0x1d1c27(0x189)),0x1;}const {data:_0x1e134a}=await withSpinner(_0x1d1c27(0x137),()=>_0x110c8c[_0x1d1c27(0x184)][_0x1d1c27(0x193)](_0x5cf4e1,_0x1c0686,{'force':_0xc32a58}));return console[_0x1d1c27(0x14b)](a4_0x252438['green']('\x0a✔\x20Pulled\x20'+(_0x4f2995+_0x20e7a4)+'\x20files\x20to\x20'+_0x1e134a[_0x1d1c27(0x11c)])),saveSessionContext({'llm_project':_0x1e134a[_0x1d1c27(0xf5)]},_0xb1de24[_0x1d1c27(0x101)]),console[_0x1d1c27(0x14b)](a4_0x252438[_0x1d1c27(0x179)](_0x1d1c27(0x16a)+a4_0x252438[_0x1d1c27(0x151)](_0x1d1c27(0x12a))+_0x1d1c27(0x146)+a4_0x252438['cyan'](_0x1e134a[_0x1d1c27(0xf5)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x6e1237(0x185)]=a4_0x6e1237(0xfc);[a4_0x6e1237(0x119)]=a4_0x6e1237(0x15d);async[a4_0x6e1237(0x162)](_0x16b4f1){const _0x41b9fb=a4_0x6e1237,{options:_0x3c6bef,args:_0xf46bb0,tdx:_0x5d7e30}=_0x16b4f1,_0x40fdbf=_0xf46bb0[0x0],_0x6f954b=_0x3c6bef[_0x41b9fb(0x185)],_0x4c91b7=_0x3c6bef[_0x41b9fb(0x199)],_0x3a7be7=_0x3c6bef['yes'],_0x5cbdfe=_0x3c6bef['site'],_0xbb6c14=_0x3c6bef[_0x41b9fb(0x12f)];let _0x24776b;const _0x410c97=findAgentConfigPath(process[_0x41b9fb(0x157)]());if(_0x40fdbf){const _0x4d88c1=a4_0x44cbc4['join'](_0x40fdbf,_0x41b9fb(0x136));existsSync(_0x4d88c1)?(_0x24776b=_0x40fdbf,console[_0x41b9fb(0x14b)](a4_0x252438['dim'](_0x41b9fb(0x145)+_0x40fdbf))):_0x24776b=_0x40fdbf;}else{if(_0x410c97)_0x24776b=a4_0x44cbc4['dirname'](_0x410c97),console['log'](a4_0x252438[_0x41b9fb(0x151)]('Using\x20current\x20project:\x20'+_0x24776b));else{if(_0xbb6c14){const _0x1ec6db=sanitizeForFilesystem(_0xbb6c14);let _0x530d10=_0x1ec6db,_0x46ba64=a4_0x44cbc4[_0x41b9fb(0x125)](process[_0x41b9fb(0x157)](),_0x41b9fb(0x158),_0x1ec6db,_0x41b9fb(0x136));if(!existsSync(_0x46ba64)){const _0x186079=normalizeName(_0xbb6c14),_0x3e8b5b=a4_0x44cbc4['join'](process['cwd'](),_0x41b9fb(0x158),_0x186079,_0x41b9fb(0x136));existsSync(_0x3e8b5b)&&(_0x530d10=_0x186079,_0x46ba64=_0x3e8b5b);}if(existsSync(_0x46ba64))_0x24776b=a4_0x44cbc4[_0x41b9fb(0x124)](_0x46ba64),console[_0x41b9fb(0x14b)](a4_0x252438[_0x41b9fb(0x151)](_0x41b9fb(0x145)+_0x24776b));else{const _0x472eaa=_0x3c6bef[_0x41b9fb(0x192)];if(_0x472eaa)throw new SDKError(ErrorCode[_0x41b9fb(0x15f)],_0x41b9fb(0x142)+_0xbb6c14+_0x41b9fb(0x171),undefined,{'helpText':_0x41b9fb(0x147)+_0x41b9fb(0x102)+(_0x41b9fb(0x174)+_0xbb6c14+'\x0a')+(_0x41b9fb(0x156)+_0x530d10+'\x20--name\x20'+(_0x6f954b||_0x41b9fb(0xf2))+_0x41b9fb(0x127)+_0x472eaa)});_0x24776b=_0xbb6c14,console[_0x41b9fb(0x14b)](a4_0x252438['dim'](_0x41b9fb(0xfa)+_0xbb6c14));}}}}if(!_0x24776b)return console[_0x41b9fb(0x14b)](a4_0x252438['yellow']('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console['log'](_0x41b9fb(0x15a)),console[_0x41b9fb(0x14b)](_0x41b9fb(0x143)),console[_0x41b9fb(0x14b)](_0x41b9fb(0x12e)),console['log'](_0x41b9fb(0x17d)),0x1;if(!_0x6f954b)throw new SDKError(ErrorCode[_0x41b9fb(0xf9)],_0x41b9fb(0x17f),undefined,{'helpText':_0x41b9fb(0x128)});if(!_0x3a7be7&&!_0x4c91b7){if(!isInteractive())return console[_0x41b9fb(0x15e)](a4_0x252438['red'](_0x41b9fb(0x105)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x41b9fb(0x15e)](a4_0x252438[_0x41b9fb(0x151)](_0x41b9fb(0x12d))),0x1;const _0xc17c97=await confirmKey(_0x41b9fb(0x17c)+_0x24776b+'\x22\x20to\x20new\x20project\x20\x22'+_0x6f954b+'\x22?');if(!_0xc17c97)return console['log'](a4_0x252438[_0x41b9fb(0x14e)](_0x41b9fb(0x1a6))),0x1;}const {data:_0x12950d}=await withSpinner(_0x41b9fb(0x13b)+_0x24776b+_0x41b9fb(0x197)+_0x6f954b+_0x41b9fb(0x10a),()=>_0x5d7e30[_0x41b9fb(0x184)]['cloneProject'](_0x24776b,_0x6f954b,{'dryRun':_0x4c91b7}));if(_0x4c91b7){console['log'](a4_0x252438[_0x41b9fb(0x14e)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x41b9fb(0x14b)](_0x41b9fb(0x1a8)+_0x12950d[_0x41b9fb(0x164)]),console[_0x41b9fb(0x14b)](_0x41b9fb(0x129)+_0x6f954b),console[_0x41b9fb(0x14b)]('Would\x20clone:'),console[_0x41b9fb(0x14b)](_0x41b9fb(0x16b)+_0x12950d['counts'][_0x41b9fb(0x158)]['created']),console['log'](_0x41b9fb(0x194)+_0x12950d['counts'][_0x41b9fb(0x10c)]['created']),console[_0x41b9fb(0x14b)](_0x41b9fb(0x168)+_0x12950d[_0x41b9fb(0x186)]['prompts'][_0x41b9fb(0x19d)]);const _0x3a7848=_0x12950d[_0x41b9fb(0x186)]['experimentalKnowledgeBases'][_0x41b9fb(0x19d)]>0x0||_0x12950d['counts']['experimentalArtifacts'][_0x41b9fb(0x19d)]>0x0;return _0x3a7848&&(console[_0x41b9fb(0x14b)](_0x41b9fb(0x17a)+_0x12950d[_0x41b9fb(0x186)]['experimentalKnowledgeBases'][_0x41b9fb(0x19d)]),console[_0x41b9fb(0x14b)](_0x41b9fb(0x13a)+_0x12950d['counts'][_0x41b9fb(0xf4)][_0x41b9fb(0x19d)])),0x0;}const _0x13c802=_0x12950d[_0x41b9fb(0x186)][_0x41b9fb(0x158)]['errors']>0x0||_0x12950d[_0x41b9fb(0x186)]['knowledgeBases'][_0x41b9fb(0x167)]>0x0||_0x12950d['counts']['prompts'][_0x41b9fb(0x167)]>0x0||_0x12950d['counts'][_0x41b9fb(0xf0)][_0x41b9fb(0x167)]>0x0||_0x12950d[_0x41b9fb(0x186)][_0x41b9fb(0xf4)][_0x41b9fb(0x167)]>0x0;_0x13c802?console['log'](a4_0x252438[_0x41b9fb(0x14e)](_0x41b9fb(0x19c))):console[_0x41b9fb(0x14b)](a4_0x252438[_0x41b9fb(0x179)]('Project\x20cloned\x20successfully'));console[_0x41b9fb(0x14b)](_0x41b9fb(0x1a8)+_0x12950d[_0x41b9fb(0x164)]),console[_0x41b9fb(0x14b)](_0x41b9fb(0x129)+_0x12950d[_0x41b9fb(0x13d)]),console[_0x41b9fb(0x14b)](_0x41b9fb(0xf6)+_0x12950d[_0x41b9fb(0xf1)]),console[_0x41b9fb(0x14b)](),console[_0x41b9fb(0x14b)](_0x41b9fb(0x177)),console[_0x41b9fb(0x14b)](_0x41b9fb(0x16b)+formatCountSummary(_0x12950d[_0x41b9fb(0x186)][_0x41b9fb(0x158)])),console[_0x41b9fb(0x14b)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x12950d['counts'][_0x41b9fb(0x10c)])),console[_0x41b9fb(0x14b)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x12950d['counts'][_0x41b9fb(0x182)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x12950d[_0x41b9fb(0x186)][_0x41b9fb(0x112)]));const _0x1cf43e=_0x12950d['counts'][_0x41b9fb(0xf0)][_0x41b9fb(0x19d)]>0x0||_0x12950d[_0x41b9fb(0x186)][_0x41b9fb(0xf0)]['updated']>0x0||_0x12950d[_0x41b9fb(0x186)]['experimentalKnowledgeBases']['unchanged']>0x0||_0x12950d['counts']['experimentalArtifacts'][_0x41b9fb(0x19d)]>0x0||_0x12950d[_0x41b9fb(0x186)][_0x41b9fb(0xf4)][_0x41b9fb(0x131)]>0x0||_0x12950d['counts']['experimentalArtifacts'][_0x41b9fb(0x11a)]>0x0;_0x1cf43e&&(console[_0x41b9fb(0x14b)](_0x41b9fb(0x17a)+formatCountSummary(_0x12950d[_0x41b9fb(0x186)][_0x41b9fb(0xf0)])),console[_0x41b9fb(0x14b)](_0x41b9fb(0x13a)+formatCountSummary(_0x12950d[_0x41b9fb(0x186)][_0x41b9fb(0xf4)])));if(_0x13c802){console['log'](),console['log'](a4_0x252438['red'](_0x41b9fb(0x13c)));for(const _0x269e68 of _0x12950d['agents']){_0x269e68[_0x41b9fb(0x16e)]===_0x41b9fb(0x15e)&&console[_0x41b9fb(0x14b)](a4_0x252438['red'](_0x41b9fb(0x1a9)+_0x269e68['agentName']+_0x41b9fb(0x196)+_0x269e68[_0x41b9fb(0x15e)]));}for(const _0x1f38dd of _0x12950d[_0x41b9fb(0x10c)]){_0x1f38dd[_0x41b9fb(0x16e)]===_0x41b9fb(0x15e)&&console[_0x41b9fb(0x14b)](a4_0x252438[_0x41b9fb(0x103)](_0x41b9fb(0x118)+_0x1f38dd[_0x41b9fb(0x185)]+_0x41b9fb(0x196)+_0x1f38dd[_0x41b9fb(0x15e)]));}for(const _0x2c7be0 of _0x12950d[_0x41b9fb(0x182)]){_0x2c7be0[_0x41b9fb(0x16e)]===_0x41b9fb(0x15e)&&console[_0x41b9fb(0x14b)](a4_0x252438[_0x41b9fb(0x103)](_0x41b9fb(0x144)+_0x2c7be0[_0x41b9fb(0x185)]+_0x41b9fb(0x196)+_0x2c7be0[_0x41b9fb(0x15e)]));}for(const _0x50c7e5 of _0x12950d[_0x41b9fb(0x112)]){_0x50c7e5[_0x41b9fb(0x16e)]===_0x41b9fb(0x15e)&&console['log'](a4_0x252438['red']('\x20\x20Integration\x20\x22'+_0x50c7e5[_0x41b9fb(0x185)]+_0x41b9fb(0x196)+_0x50c7e5[_0x41b9fb(0x15e)]));}for(const _0x4d7a5d of _0x12950d[_0x41b9fb(0xf0)]){_0x4d7a5d[_0x41b9fb(0x16e)]===_0x41b9fb(0x15e)&&console[_0x41b9fb(0x14b)](a4_0x252438[_0x41b9fb(0x103)](_0x41b9fb(0x16c)+_0x4d7a5d['name']+_0x41b9fb(0x196)+_0x4d7a5d[_0x41b9fb(0x15e)]));}for(const _0x4b02f1 of _0x12950d[_0x41b9fb(0xf4)]){_0x4b02f1[_0x41b9fb(0x16e)]===_0x41b9fb(0x15e)&&console[_0x41b9fb(0x14b)](a4_0x252438[_0x41b9fb(0x103)](_0x41b9fb(0x188)+_0x4b02f1[_0x41b9fb(0x185)]+'\x22:\x20'+_0x4b02f1[_0x41b9fb(0x15e)]));}return 0x1;}console['log']();const _0x347213=getLLMProjectUrl(_0x5cbdfe,_0x12950d[_0x41b9fb(0xf1)]);return console[_0x41b9fb(0x14b)](_0x41b9fb(0x183)+a4_0x252438['cyan'](_0x347213)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x6e1237(0x18a);['description']=a4_0x6e1237(0x149);async[a4_0x6e1237(0x162)](_0xaf849e){const _0xfee648=a4_0x6e1237,{options:_0x3c78cc,args:_0x573fb0,tdx:_0x4f5d8a}=_0xaf849e;let _0x1cc336=_0x573fb0[0x0]||process[_0xfee648(0x157)]();const _0x5e1f3e=_0x3c78cc[_0xfee648(0x199)],_0xa94ad0=_0x3c78cc[_0xfee648(0x11f)],_0xec2838=_0x3c78cc[_0xfee648(0x13f)],_0x54074e=_0x3c78cc[_0xfee648(0x161)],_0x1c2916=a4_0x44cbc4[_0xfee648(0x125)](_0x1cc336,_0xfee648(0x126)),_0x45d078=existsSync(_0x1c2916);if(_0x45d078){const {data:_0x357f67}=await withSpinner(_0xfee648(0x18b)+_0x1cc336+_0xfee648(0x10a),()=>_0x4f5d8a[_0xfee648(0x184)]['pushAgent'](_0x1cc336,{'dryRun':_0x5e1f3e,'force':_0xa94ad0}));if(_0x5e1f3e)return console[_0xfee648(0x14b)](a4_0x252438[_0xfee648(0x14e)](_0xfee648(0x13e))),console[_0xfee648(0x14b)](_0xfee648(0x110)+_0x357f67[_0xfee648(0x106)]),0x0;if(_0x357f67[_0xfee648(0x16e)]===_0xfee648(0x15e))return console['log'](a4_0x252438[_0xfee648(0x103)](_0xfee648(0x114)+_0x357f67[_0xfee648(0x15e)])),0x1;console[_0xfee648(0x14b)](a4_0x252438[_0xfee648(0x179)](_0xfee648(0xed)+_0x357f67[_0xfee648(0x16e)]+'\x20successfully')),console[_0xfee648(0x14b)]('Agent:\x20'+_0x357f67[_0xfee648(0x106)]);if(_0x357f67[_0xfee648(0x160)]&&_0x357f67[_0xfee648(0x108)]){const _0x3577af=getLLMAgentChatUrl(_0x54074e,_0x357f67[_0xfee648(0x108)],_0x357f67[_0xfee648(0x160)]);console[_0xfee648(0x14b)](_0xfee648(0x15c)+a4_0x252438[_0xfee648(0x139)](_0x3577af));}return 0x0;}const _0x3bd729=_0x3c78cc[_0xfee648(0x12f)],_0x562a5c=resolveProjectFromContext(_0x1cc336,_0x3bd729);if(_0x562a5c['found'])_0x1cc336=_0x562a5c[_0xfee648(0x135)],_0x562a5c[_0xfee648(0x138)]===_0xfee648(0x16d)&&console['log'](a4_0x252438[_0xfee648(0x151)](_0xfee648(0x100)+_0x1cc336));else{let _0x1880e5='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x562a5c[_0xfee648(0x17b)]===_0xfee648(0xfb)&&(_0x1880e5=_0x562a5c['message']+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x562a5c[_0xfee648(0x12f)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0xfee648(0x15f)],_0x562a5c[_0xfee648(0x17b)]===_0xfee648(0x155)?_0x562a5c[_0xfee648(0x10e)]:_0xfee648(0x150)+_0x1cc336,undefined,{'helpText':_0x1880e5});}const {data:_0x150aa3}=await withSpinner(_0xfee648(0x17e),()=>_0x4f5d8a[_0xfee648(0x184)][_0xfee648(0x1aa)](_0x1cc336,{'dryRun':!![]})),_0x79de5c=_0x150aa3[_0xfee648(0x186)][_0xfee648(0x158)][_0xfee648(0x167)]>0x0;if(_0x79de5c){console[_0xfee648(0x14b)](a4_0x252438['red'](_0xfee648(0x154)));for(const _0x295614 of _0x150aa3[_0xfee648(0x158)]){_0x295614[_0xfee648(0x16e)]===_0xfee648(0x15e)&&console[_0xfee648(0x14b)](a4_0x252438['red'](_0xfee648(0x1a9)+_0x295614[_0xfee648(0x106)]+'\x22:\x20'+_0x295614['error']));}return 0x1;}const _0x22d3c7=_0x150aa3['counts'][_0xfee648(0x158)][_0xfee648(0x19d)]+_0x150aa3[_0xfee648(0x186)][_0xfee648(0x10c)][_0xfee648(0x19d)]+_0x150aa3[_0xfee648(0x186)][_0xfee648(0x14f)]['created']+_0x150aa3[_0xfee648(0x186)][_0xfee648(0x182)][_0xfee648(0x19d)]+_0x150aa3['counts'][_0xfee648(0x112)][_0xfee648(0x19d)]+_0x150aa3['counts'][_0xfee648(0xf0)][_0xfee648(0x19d)]+_0x150aa3[_0xfee648(0x186)][_0xfee648(0xf4)][_0xfee648(0x19d)],_0x3b1843=_0x150aa3[_0xfee648(0x186)][_0xfee648(0x158)]['updated']+_0x150aa3['counts'][_0xfee648(0x10c)][_0xfee648(0x131)]+_0x150aa3[_0xfee648(0x186)][_0xfee648(0x14f)][_0xfee648(0x131)]+_0x150aa3['counts'][_0xfee648(0x182)][_0xfee648(0x131)]+_0x150aa3[_0xfee648(0x186)]['integrations'][_0xfee648(0x131)]+_0x150aa3[_0xfee648(0x186)]['experimentalKnowledgeBases'][_0xfee648(0x131)]+_0x150aa3[_0xfee648(0x186)][_0xfee648(0xf4)]['updated'],_0x12279e=_0x150aa3[_0xfee648(0x186)]['agents'][_0xfee648(0x11a)]+_0x150aa3['counts'][_0xfee648(0x10c)][_0xfee648(0x11a)]+_0x150aa3[_0xfee648(0x186)][_0xfee648(0x14f)]['unchanged']+_0x150aa3['counts']['prompts'][_0xfee648(0x11a)]+_0x150aa3['counts'][_0xfee648(0x112)][_0xfee648(0x11a)]+_0x150aa3[_0xfee648(0x186)][_0xfee648(0xf0)][_0xfee648(0x11a)]+_0x150aa3[_0xfee648(0x186)][_0xfee648(0xf4)][_0xfee648(0x11a)];console[_0xfee648(0x14b)](_0xfee648(0x187)+_0x150aa3['projectName']+'\x27:'),console[_0xfee648(0x14b)]('\x20\x20'+a4_0x252438[_0xfee648(0x179)]('+\x20'+_0x22d3c7+_0xfee648(0x140))+_0xfee648(0xfe)+a4_0x252438[_0xfee648(0x14e)]('~\x20'+_0x3b1843+_0xfee648(0x18e))+'\x20|\x20'+a4_0x252438['dim']('=\x20'+_0x12279e+'\x20unchanged')),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x150aa3[_0xfee648(0x186)]['agents'])),console['log'](_0xfee648(0x194)+formatCountSummary(_0x150aa3[_0xfee648(0x186)][_0xfee648(0x10c)])),console[_0xfee648(0x14b)](_0xfee648(0x15b)+formatCountSummary(_0x150aa3['counts'][_0xfee648(0x14f)])),console[_0xfee648(0x14b)](_0xfee648(0x168)+formatCountSummary(_0x150aa3['counts'][_0xfee648(0x182)])),console['log'](_0xfee648(0x198)+formatCountSummary(_0x150aa3[_0xfee648(0x186)][_0xfee648(0x112)]));const _0x2adec7=_0x150aa3[_0xfee648(0x186)][_0xfee648(0xf0)][_0xfee648(0x19d)]>0x0||_0x150aa3[_0xfee648(0x186)][_0xfee648(0xf0)][_0xfee648(0x131)]>0x0||_0x150aa3[_0xfee648(0x186)][_0xfee648(0xf0)][_0xfee648(0x11a)]>0x0||_0x150aa3['counts'][_0xfee648(0xf4)][_0xfee648(0x19d)]>0x0||_0x150aa3[_0xfee648(0x186)][_0xfee648(0xf4)][_0xfee648(0x131)]>0x0||_0x150aa3[_0xfee648(0x186)][_0xfee648(0xf4)][_0xfee648(0x11a)]>0x0;_0x2adec7&&(console[_0xfee648(0x14b)](_0xfee648(0x17a)+formatCountSummary(_0x150aa3['counts']['experimentalKnowledgeBases'])),console[_0xfee648(0x14b)](_0xfee648(0x13a)+formatCountSummary(_0x150aa3[_0xfee648(0x186)]['experimentalArtifacts'])));console[_0xfee648(0x14b)](_0xfee648(0x11d)+a4_0x252438[_0xfee648(0x139)](_0x1cc336)),displayDiffs(_0x150aa3[_0xfee648(0x158)],_0x150aa3[_0xfee648(0x10c)],_0x150aa3[_0xfee648(0x14f)],_0x150aa3[_0xfee648(0x182)],_0x150aa3['integrations'],_0x150aa3[_0xfee648(0xf0)],_0x150aa3[_0xfee648(0xf4)]);if(_0x5e1f3e)return console['log'](a4_0x252438['yellow'](_0xfee648(0x10d))),0x0;if(_0x22d3c7===0x0&&_0x3b1843===0x0){console[_0xfee648(0x14b)](a4_0x252438[_0xfee648(0x179)](_0xfee648(0x120)));const _0x4fe623=getLLMProjectUrl(_0x54074e,_0x150aa3[_0xfee648(0x108)]);return console[_0xfee648(0x14b)](_0xfee648(0x183)+a4_0x252438[_0xfee648(0x139)](_0x4fe623)),0x0;}if(!_0xec2838&&!_0xa94ad0){if(!isInteractive())return console[_0xfee648(0x15e)](a4_0x252438[_0xfee648(0x103)](_0xfee648(0x105)),_0xfee648(0x130)),console['error'](a4_0x252438[_0xfee648(0x151)](_0xfee648(0x12d))),0x1;const _0x388184=await confirmKey(_0xfee648(0x123)+(_0x22d3c7+_0x3b1843)+_0xfee648(0x19b));if(!_0x388184)return console['log'](a4_0x252438[_0xfee648(0x14e)](_0xfee648(0x1a6)),_0xfee648(0xef)),0x1;}const {data:_0x314103}=await withSpinner('Pushing\x20to\x20project...',()=>_0x4f5d8a[_0xfee648(0x184)][_0xfee648(0x1aa)](_0x1cc336,{'force':_0xa94ad0})),_0x372e7c=_0x314103['counts']['agents'][_0xfee648(0x167)]>0x0||_0x314103[_0xfee648(0x186)][_0xfee648(0x10c)][_0xfee648(0x167)]>0x0||_0x314103[_0xfee648(0x186)]['textKnowledgeBases']['errors']>0x0||_0x314103[_0xfee648(0x186)][_0xfee648(0x182)][_0xfee648(0x167)]>0x0;if(_0x372e7c){console['log'](a4_0x252438[_0xfee648(0x14e)](_0xfee648(0x14d))),console[_0xfee648(0x14b)](),console['log'](a4_0x252438[_0xfee648(0x103)](_0xfee648(0x13c)));for(const _0x5c5a1b of _0x314103[_0xfee648(0x158)]){_0x5c5a1b['action']===_0xfee648(0x15e)&&console['log'](a4_0x252438[_0xfee648(0x103)](_0xfee648(0x1a9)+_0x5c5a1b[_0xfee648(0x106)]+_0xfee648(0x196)+_0x5c5a1b['error']));}for(const _0x2e05cc of _0x314103[_0xfee648(0x10c)]){_0x2e05cc[_0xfee648(0x16e)]===_0xfee648(0x15e)&&console['log'](a4_0x252438[_0xfee648(0x103)](_0xfee648(0x118)+_0x2e05cc[_0xfee648(0x185)]+_0xfee648(0x196)+_0x2e05cc[_0xfee648(0x15e)]));}for(const _0x12b322 of _0x314103[_0xfee648(0x14f)]){_0x12b322[_0xfee648(0x16e)]===_0xfee648(0x15e)&&console[_0xfee648(0x14b)](a4_0x252438['red'](_0xfee648(0x163)+_0x12b322['name']+'\x22:\x20'+_0x12b322['error']));}for(const _0x5e502d of _0x314103['prompts']){_0x5e502d[_0xfee648(0x16e)]===_0xfee648(0x15e)&&console[_0xfee648(0x14b)](a4_0x252438[_0xfee648(0x103)](_0xfee648(0x144)+_0x5e502d[_0xfee648(0x185)]+'\x22:\x20'+_0x5e502d['error']));}for(const _0x99791a of _0x314103['integrations']){_0x99791a['action']==='error'&&console[_0xfee648(0x14b)](a4_0x252438[_0xfee648(0x103)]('\x20\x20Integration\x20\x22'+_0x99791a['name']+_0xfee648(0x196)+_0x99791a[_0xfee648(0x15e)]));}return 0x1;}console[_0xfee648(0x14b)](a4_0x252438[_0xfee648(0x179)](_0xfee648(0x195)+(_0x22d3c7+_0x3b1843)+_0xfee648(0x134)+_0x314103[_0xfee648(0xf5)]+'\x27'));const _0x27ee60=getLLMProjectUrl(_0x54074e,_0x314103[_0xfee648(0x108)]);return console[_0xfee648(0x14b)](_0xfee648(0x183)+a4_0x252438[_0xfee648(0x139)](_0x27ee60)),0x0;}}
1
+ const a4_0x3c89bd=a4_0xedae;function a4_0x209a(){const _0x52a439=['join','Using\x20current\x20project:\x20','dim','\x20\x20Agents:\x20','experimentalKnowledgeBases','\x20\x20Prompt\x20\x22','execute','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','gray','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Writing\x20files...','error','\x0aProject\x20pushed\x20with\x20errors','red','context','\x20|\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','Would\x20push\x20agent:\x20','\x0aChanges\x20to\x20agent\x20\x27','\x22:\x20','no_local_folder','Pushing\x20to\x20project...','message','session','prompts','\x20\x20Agent\x20\x22','\x20successfully','\x20--profile\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','1055304cngdev','\x22\x20to\x20new\x20project\x20\x22','\x20\x20tdx\x20agent\x20pull\x20','Status:\x20','cloneProject','cyan','Chat:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','newProjectName','\x0aPull\x20summary\x20for\x20\x27','Project\x20cloned\x20with\x20errors','\x20errors','log','\x0aError:','agentName','arg-dir','pushProject','\x20\x20Text\x20Knowledge\x20Bases:\x20','50687qHZVoC','utf-8','Using\x20local\x20project:\x20','repeat','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','llm_project','88vAQMyK','new','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','42170iHmyTy','New\x20project\x20ID:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x22\x20to\x20a\x20different\x20profile','outputDir','force','sourceProjectName','Agent:\x20','Summary:','diff','\x20\x20Experimental\x20Artifacts:\x20','yes','\x20\x20Source:\x20','Errors:','profile','\x0aErrors\x20found:','\x20\x20Integration\x20\x22','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','created','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Using\x20project:\x20','tdx.json','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20Prompts:\x20','dryRun','newProjectId','agent.yml','\x20\x20Knowledge\x20Bases:\x20','New\x20project:\x20','llmProject','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','cwd-config','Cancelled','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20Integrations:\x20','Project\x20cloned\x20successfully','found','push','total','cwd','\x20--name\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','Clone\x20\x22','counts','\x27\x20to\x20create\x20the\x20folder\x20structure.','green','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Cloning\x20\x22','INVALID_ARGUMENT','\x20new','dirname','Analyzing\x20project\x20\x22','\x20\x20Text\x20Knowledge\x20Base\x20\x22','294sjAxyL','textKnowledgeBases','883470auTgYu','parse','Using\x20project\x20from\x20context:\x20','\x20\x20Knowledge\x20Base\x20\x22','Agent\x20','projectName','Source:\x20','\x20resources\x20to\x20\x27','name','\x20files\x20to\x20','\x0aPush\x20','action','projectId','yellow','\x0a✔\x20Pushed\x20','Dry\x20run\x20-\x20no\x20changes\x20made','\x20unchanged','99356AVdsLY','source','No\x20tdx.json\x20found\x20in\x20','experimentalArtifacts','outputPath','\x20resources?','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','integrations','updated','New\x20project\x20name\x20is\x20required','agent:push','knowledgeBases','agentId','llm','agents','\x0aPush\x20summary\x20for\x20\x27','agent:clone','Project:\x20','no_context','unchanged','Pushing\x20agent\x20from\x20\x22','Using\x20context\x20project:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x0aChanges:','\x0aChanges\x20to\x20prompt\x20\x27','\x22\x20to\x20\x22','5041540gzgCch','pullAgent','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','1785vYuQhq','hasChanges','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','48ZGeBVX','\x20changed','Would\x20clone:','Failed\x20to\x20push\x20agent:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','errors','\x22...','\x20updated','pullProject','description','\x20=\x20','\x20total','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Usage:\x20tdx\x20agent\x20pull\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#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','MISSING_ARGUMENT','✔\x20Context\x20set:\x20','reason','\x20\x20Experimental\x20Artifact\x20\x22'];a4_0x209a=function(){return _0x52a439;};return a4_0x209a();}(function(_0x131120,_0x550e26){const _0x511519=a4_0xedae,_0x164b86=_0x131120();while(!![]){try{const _0x4e3869=parseInt(_0x511519(0x21a))/0x1*(-parseInt(_0x511519(0x1ea))/0x2)+-parseInt(_0x511519(0x1ec))/0x3+parseInt(_0x511519(0x1fd))/0x4+-parseInt(_0x511519(0x26a))/0x5*(-parseInt(_0x511519(0x21e))/0x6)+-parseInt(_0x511519(0x261))/0x7*(-parseInt(_0x511519(0x267))/0x8)+parseInt(_0x511519(0x24f))/0x9+parseInt(_0x511519(0x217))/0xa;if(_0x4e3869===_0x550e26)break;else _0x164b86['push'](_0x164b86['shift']());}catch(_0x6d3247){_0x164b86['push'](_0x164b86['shift']());}}}(a4_0x209a,0x39bc7));import a4_0x282c7e from'chalk';import a4_0x24c893 from'path';function a4_0xedae(_0x2e79a2,_0x359332){_0x2e79a2=_0x2e79a2-0x1e6;const _0x209aae=a4_0x209a();let _0xedae48=_0x209aae[_0x2e79a2];return _0xedae48;}import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}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(_0x5336cd){const _0xd0c5c9=a4_0xedae,_0x35d977=[];if(_0x5336cd['total']!==undefined)_0x35d977['push'](_0x5336cd['total']+_0xd0c5c9(0x229));if(_0x5336cd[_0xd0c5c9(0x268)]!==undefined&&_0x5336cd['new']>0x0)_0x35d977[_0xd0c5c9(0x292)](a4_0x282c7e[_0xd0c5c9(0x29a)](_0x5336cd['new']+'\x20new'));if(_0x5336cd[_0xd0c5c9(0x27d)]!==undefined&&_0x5336cd[_0xd0c5c9(0x27d)]>0x0)_0x35d977['push'](a4_0x282c7e[_0xd0c5c9(0x29a)](_0x5336cd[_0xd0c5c9(0x27d)]+'\x20created'));if(_0x5336cd['updated']!==undefined&&_0x5336cd['updated']>0x0)_0x35d977['push'](a4_0x282c7e['yellow'](_0x5336cd['updated']+_0xd0c5c9(0x225)));if(_0x5336cd[_0xd0c5c9(0x210)]!==undefined&&_0x5336cd[_0xd0c5c9(0x210)]>0x0)_0x35d977[_0xd0c5c9(0x292)](a4_0x282c7e[_0xd0c5c9(0x239)](_0x5336cd['unchanged']+_0xd0c5c9(0x1fc)));if(_0x5336cd[_0xd0c5c9(0x223)]!==undefined&&_0x5336cd[_0xd0c5c9(0x223)]>0x0)_0x35d977['push'](a4_0x282c7e[_0xd0c5c9(0x23f)](_0x5336cd[_0xd0c5c9(0x223)]+_0xd0c5c9(0x25a)));return _0x35d977['join'](',\x20');}function displayDiffs(_0x1a39ae,_0x24169b,_0x2723b2,_0x4cf2b9,_0x4c6f36,_0x2749cd,_0x5942e0){const _0x3b8876=a4_0xedae;for(const _0xcb9655 of _0x1a39ae){if(_0xcb9655[_0x3b8876(0x274)]){const _0xe02c6b=_0xcb9655[_0x3b8876(0x25d)]||_0xcb9655['name'];console[_0x3b8876(0x25b)](_0x3b8876(0x244)+_0xe02c6b+'\x27:'),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)),console[_0x3b8876(0x25b)](_0xcb9655['diff']),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c));}}for(const _0x2d742b of _0x24169b){_0x2d742b['diff']&&(console[_0x3b8876(0x25b)](_0x3b8876(0x256)+_0x2d742b[_0x3b8876(0x1f4)]+'\x27:'),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)),console[_0x3b8876(0x25b)](_0x2d742b['diff']),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)));}for(const _0x3d8f03 of _0x2723b2){_0x3d8f03[_0x3b8876(0x274)]&&(console['log'](_0x3b8876(0x281)+_0x3d8f03[_0x3b8876(0x1f4)]+'\x27:'),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)),console[_0x3b8876(0x25b)](_0x3d8f03[_0x3b8876(0x274)]),console['log']('─'[_0x3b8876(0x264)](0x3c)));}for(const _0x31332b of _0x4cf2b9){_0x31332b['diff']&&(console[_0x3b8876(0x25b)](_0x3b8876(0x215)+_0x31332b[_0x3b8876(0x1f4)]+'\x27:'),console[_0x3b8876(0x25b)]('─'['repeat'](0x3c)),console[_0x3b8876(0x25b)](_0x31332b[_0x3b8876(0x274)]),console['log']('─'[_0x3b8876(0x264)](0x3c)));}for(const _0x276eb2 of _0x4c6f36){_0x276eb2[_0x3b8876(0x274)]&&(console[_0x3b8876(0x25b)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x276eb2['name']+'\x27:'),console['log']('─'[_0x3b8876(0x264)](0x3c)),console['log'](_0x276eb2[_0x3b8876(0x274)]),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)));}for(const _0x48a327 of _0x2749cd){_0x48a327[_0x3b8876(0x274)]&&(console[_0x3b8876(0x25b)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x48a327['name']+'\x27:'),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)),console[_0x3b8876(0x25b)](_0x48a327[_0x3b8876(0x274)]),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)));}for(const _0x5827a2 of _0x5942e0){_0x5827a2[_0x3b8876(0x274)]&&(console['log'](_0x3b8876(0x238)+_0x5827a2[_0x3b8876(0x1f4)]+'\x27:'),console[_0x3b8876(0x25b)]('─'['repeat'](0x3c)),console['log'](_0x5827a2['diff']),console['log']('─'[_0x3b8876(0x264)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x3c89bd(0x1f4)]='agent:pull';[a4_0x3c89bd(0x227)]=a4_0x3c89bd(0x269);async[a4_0x3c89bd(0x237)](_0x4b682c){const _0x4b631d=a4_0x3c89bd,{options:_0x470222,args:_0x5d370d,tdx:_0x3e47d7}=_0x4b682c,_0x1eea3a=_0x5d370d[0x0],_0x3bca87=_0x5d370d[0x1],_0x3c5c1e=_0x470222['output'],_0x4fea08=_0x470222[_0x4b631d(0x284)],_0x3e3c76=_0x470222['force'],_0x55301c=_0x470222[_0x4b631d(0x276)],_0x4de693=_0x470222[_0x4b631d(0x289)],_0x349cbc=_0x470222['agent'];let _0x251d6d;if(_0x1eea3a){const _0x4fb99a=a4_0x24c893[_0x4b631d(0x231)](_0x1eea3a,_0x4b631d(0x280));if(existsSync(_0x4fb99a))try{const _0x25af65=JSON[_0x4b631d(0x1ed)](readFileSync(_0x4fb99a,_0x4b631d(0x262)));_0x25af65[_0x4b631d(0x266)]&&(_0x251d6d={'llm_project':_0x25af65[_0x4b631d(0x266)]});}catch{}}const _0xbfe48=findAgentConfigPath(process['cwd']());let _0xbae5b8;if(_0xbfe48)try{const _0x4643db=JSON['parse'](readFileSync(_0xbfe48,_0x4b631d(0x262)));_0x4643db['llm_project']&&(_0xbae5b8={'llm_project':_0x4643db[_0x4b631d(0x266)]});}catch{}const _0x4db4e3=resolveAgentPullArgs({'arg':_0x1eea3a,'agentNameArg':_0x3bca87,'agentFlag':_0x349cbc,'contextProject':_0x4de693,'argDirConfig':_0x251d6d,'cwdConfigPath':_0xbfe48||undefined,'cwdConfig':_0xbae5b8}),{projectNameOrId:_0x1a1d88,targetAgentName:_0x4f5ba8,existingOutputDir:_0x5bbd00,source:_0x4afc7f}=_0x4db4e3;if(_0x4afc7f===_0x4b631d(0x25e))console['log'](a4_0x282c7e[_0x4b631d(0x233)]('Using\x20project\x20from\x20'+a4_0x24c893[_0x4b631d(0x231)](_0x1eea3a,_0x4b631d(0x280))+':\x20'+_0x1a1d88));else{if(_0x4afc7f===_0x4b631d(0x28c))console['log'](a4_0x282c7e[_0x4b631d(0x233)](_0x4b631d(0x27f)+_0x1a1d88));else _0x4afc7f==='context'&&console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x233)](_0x4b631d(0x1ee)+_0x1a1d88));}if(!_0x1a1d88)return _0x349cbc?(console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x1f9)]('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x4b631d(0x25b)](_0x4b631d(0x22b)),console[_0x4b631d(0x25b)](_0x4b631d(0x213))):(console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x1f9)](_0x4b631d(0x265))),console[_0x4b631d(0x25b)](_0x4b631d(0x22c)),console['log'](_0x4b631d(0x296)),console[_0x4b631d(0x25b)](_0x4b631d(0x21d)),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project'),console['log'](_0x4b631d(0x203))),0x1;if(_0x4f5ba8){const {data:_0x3f815c}=await withSpinner('Pulling\x20agent\x20\x22'+_0x4f5ba8+'\x22\x20from\x20project\x20\x22'+_0x1a1d88+_0x4b631d(0x224),()=>_0x3e47d7[_0x4b631d(0x20a)][_0x4b631d(0x218)](_0x1a1d88,_0x4f5ba8,_0x3c5c1e,{'dryRun':_0x4fea08,'force':_0x3e3c76}));if(_0x4fea08)return console['log'](a4_0x282c7e[_0x4b631d(0x1f9)](_0x4b631d(0x28a))),console[_0x4b631d(0x25b)]('Would\x20pull\x20agent:\x20'+_0x3f815c[_0x4b631d(0x25d)]),console[_0x4b631d(0x25b)]('Output\x20path:\x20'+_0x3f815c[_0x4b631d(0x201)]),_0x3f815c[_0x4b631d(0x274)]&&(console[_0x4b631d(0x25b)](_0x4b631d(0x214)),console['log']('─'[_0x4b631d(0x264)](0x3c)),console[_0x4b631d(0x25b)](_0x3f815c[_0x4b631d(0x274)]),console[_0x4b631d(0x25b)]('─'['repeat'](0x3c))),0x0;return console['log'](a4_0x282c7e[_0x4b631d(0x29a)]('Agent\x20pulled\x20successfully')),console[_0x4b631d(0x25b)]('Agent:\x20'+_0x3f815c['agentName']),console[_0x4b631d(0x25b)]('Output:\x20'+_0x3f815c[_0x4b631d(0x201)]),console['log'](_0x4b631d(0x252)+(_0x3f815c['isNew']?a4_0x282c7e[_0x4b631d(0x29a)](_0x4b631d(0x268)):_0x3f815c[_0x4b631d(0x21b)]?a4_0x282c7e[_0x4b631d(0x1f9)]('updated'):a4_0x282c7e[_0x4b631d(0x239)](_0x4b631d(0x210)))),0x0;}const _0x574ed9=_0x5bbd00||_0x3c5c1e,{data:_0x120938}=await withSpinner(_0x4b631d(0x1e8)+_0x1a1d88+_0x4b631d(0x224),()=>_0x3e47d7[_0x4b631d(0x20a)]['pullProject'](_0x1a1d88,_0x574ed9,{'dryRun':!![]})),_0x266ea6=_0x120938['counts'][_0x4b631d(0x20b)][_0x4b631d(0x268)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x208)]['new']+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x1eb)][_0x4b631d(0x268)]+_0x120938['counts'][_0x4b631d(0x24a)][_0x4b631d(0x268)]+_0x120938['counts'][_0x4b631d(0x204)]['new']+_0x120938[_0x4b631d(0x298)]['experimentalKnowledgeBases'][_0x4b631d(0x268)]+_0x120938['counts'][_0x4b631d(0x200)][_0x4b631d(0x268)],_0xc31fdb=_0x120938[_0x4b631d(0x298)][_0x4b631d(0x20b)][_0x4b631d(0x205)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x208)][_0x4b631d(0x205)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x1eb)]['updated']+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x24a)][_0x4b631d(0x205)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x204)]['updated']+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x235)][_0x4b631d(0x205)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x200)][_0x4b631d(0x205)],_0x2ab2a7=_0x120938[_0x4b631d(0x298)]['agents'][_0x4b631d(0x210)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x208)][_0x4b631d(0x210)]+_0x120938['counts']['textKnowledgeBases'][_0x4b631d(0x210)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x24a)]['unchanged']+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x204)][_0x4b631d(0x210)]+_0x120938['counts'][_0x4b631d(0x235)]['unchanged']+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x200)][_0x4b631d(0x210)];console[_0x4b631d(0x25b)](_0x4b631d(0x258)+_0x120938[_0x4b631d(0x1f1)]+'\x27:'),console[_0x4b631d(0x25b)]('\x20\x20'+a4_0x282c7e[_0x4b631d(0x29a)]('+\x20'+_0x266ea6+'\x20new')+_0x4b631d(0x241)+a4_0x282c7e['yellow']('~\x20'+_0xc31fdb+_0x4b631d(0x21f))+_0x4b631d(0x241)+a4_0x282c7e[_0x4b631d(0x233)]('=\x20'+_0x2ab2a7+_0x4b631d(0x1fc))),console[_0x4b631d(0x25b)](_0x4b631d(0x234)+formatCountSummary(_0x120938[_0x4b631d(0x298)][_0x4b631d(0x20b)])),console[_0x4b631d(0x25b)](_0x4b631d(0x287)+formatCountSummary(_0x120938[_0x4b631d(0x298)][_0x4b631d(0x208)])),console[_0x4b631d(0x25b)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x120938[_0x4b631d(0x298)]['textKnowledgeBases'])),console[_0x4b631d(0x25b)](_0x4b631d(0x283)+formatCountSummary(_0x120938[_0x4b631d(0x298)][_0x4b631d(0x24a)])),console[_0x4b631d(0x25b)](_0x4b631d(0x28f)+formatCountSummary(_0x120938[_0x4b631d(0x298)][_0x4b631d(0x204)]));const _0x4d2228=_0x120938[_0x4b631d(0x298)][_0x4b631d(0x235)][_0x4b631d(0x293)]>0x0||_0x120938[_0x4b631d(0x298)][_0x4b631d(0x200)][_0x4b631d(0x293)]>0x0;_0x4d2228&&(console[_0x4b631d(0x25b)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x120938[_0x4b631d(0x298)]['experimentalKnowledgeBases'])),console['log'](_0x4b631d(0x275)+formatCountSummary(_0x120938[_0x4b631d(0x298)]['experimentalArtifacts'])));console[_0x4b631d(0x25b)]('\x20\x20Target:\x20'+a4_0x282c7e['cyan'](_0x120938[_0x4b631d(0x26f)])),displayDiffs(_0x120938[_0x4b631d(0x20b)],_0x120938['knowledgeBases'],_0x120938[_0x4b631d(0x1eb)],_0x120938[_0x4b631d(0x24a)],_0x120938['integrations'],_0x120938['experimentalKnowledgeBases'],_0x120938['experimentalArtifacts']);if(_0x4fea08)return console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x1f9)](_0x4b631d(0x27e))),0x0;if(_0x266ea6===0x0&&_0xc31fdb===0x0)return console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x29a)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x120938[_0x4b631d(0x1f1)]},_0x470222['session']),console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x29a)](_0x4b631d(0x22e)+a4_0x282c7e[_0x4b631d(0x233)](_0x4b631d(0x266))+_0x4b631d(0x228)+a4_0x282c7e['cyan'](_0x120938['projectName']))),0x0;if(!_0x55301c&&!_0x3e3c76){if(!isInteractive())return console['error'](a4_0x282c7e[_0x4b631d(0x23f)]('\x0aError:'),_0x4b631d(0x29b)),console['error'](a4_0x282c7e[_0x4b631d(0x233)](_0x4b631d(0x219))),0x1;const _0x38fab2=await confirmKey('\x0aWrite\x20'+(_0x266ea6+_0xc31fdb)+'\x20files?');if(!_0x38fab2)return console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x1f9)](_0x4b631d(0x28d)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x1d3fd0}=await withSpinner(_0x4b631d(0x23c),()=>_0x3e47d7[_0x4b631d(0x20a)][_0x4b631d(0x226)](_0x1a1d88,_0x574ed9,{'force':_0x3e3c76}));return console['log'](a4_0x282c7e[_0x4b631d(0x29a)]('\x0a✔\x20Pulled\x20'+(_0x266ea6+_0xc31fdb)+_0x4b631d(0x1f5)+_0x1d3fd0[_0x4b631d(0x26f)])),saveSessionContext({'llm_project':_0x1d3fd0[_0x4b631d(0x1f1)]},_0x470222[_0x4b631d(0x249)]),console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x29a)](_0x4b631d(0x22e)+a4_0x282c7e[_0x4b631d(0x233)]('llm_project')+'\x20=\x20'+a4_0x282c7e[_0x4b631d(0x254)](_0x1d3fd0[_0x4b631d(0x1f1)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x3c89bd(0x1f4)]=a4_0x3c89bd(0x20d);[a4_0x3c89bd(0x227)]=a4_0x3c89bd(0x28e);async[a4_0x3c89bd(0x237)](_0xa26d4e){const _0x11cfe2=a4_0x3c89bd,{options:_0x50b595,args:_0x55c446,tdx:_0x193cf7}=_0xa26d4e,_0x59e4b6=_0x55c446[0x0],_0x3f7b80=_0x50b595[_0x11cfe2(0x1f4)],_0x3235bb=_0x50b595[_0x11cfe2(0x284)],_0x4764f7=_0x50b595[_0x11cfe2(0x276)],_0xb26468=_0x50b595['site'],_0x19905d=_0x50b595['llmProject'];let _0x36def7;const _0x18cce5=findAgentConfigPath(process[_0x11cfe2(0x294)]());if(_0x59e4b6){const _0x4f9423=a4_0x24c893['join'](_0x59e4b6,_0x11cfe2(0x280));existsSync(_0x4f9423)?(_0x36def7=_0x59e4b6,console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x233)](_0x11cfe2(0x263)+_0x59e4b6))):_0x36def7=_0x59e4b6;}else{if(_0x18cce5)_0x36def7=a4_0x24c893['dirname'](_0x18cce5),console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x233)](_0x11cfe2(0x232)+_0x36def7));else{if(_0x19905d){const _0x2f8172=sanitizeForFilesystem(_0x19905d);let _0x2d1a19=_0x2f8172,_0x4af032=a4_0x24c893[_0x11cfe2(0x231)](process[_0x11cfe2(0x294)](),_0x11cfe2(0x20b),_0x2f8172,_0x11cfe2(0x280));if(!existsSync(_0x4af032)){const _0x3dd32e=normalizeName(_0x19905d),_0x5cb0b5=a4_0x24c893[_0x11cfe2(0x231)](process['cwd'](),_0x11cfe2(0x20b),_0x3dd32e,_0x11cfe2(0x280));existsSync(_0x5cb0b5)&&(_0x2d1a19=_0x3dd32e,_0x4af032=_0x5cb0b5);}if(existsSync(_0x4af032))_0x36def7=a4_0x24c893[_0x11cfe2(0x1e7)](_0x4af032),console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x233)]('Using\x20local\x20project:\x20'+_0x36def7));else{const _0x5ade47=_0x50b595[_0x11cfe2(0x279)];if(_0x5ade47)throw new SDKError(ErrorCode[_0x11cfe2(0x29d)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x19905d+_0x11cfe2(0x26e),undefined,{'helpText':_0x11cfe2(0x27c)+_0x11cfe2(0x23b)+(_0x11cfe2(0x251)+_0x19905d+'\x0a')+(_0x11cfe2(0x242)+_0x2d1a19+_0x11cfe2(0x295)+(_0x3f7b80||'<new-name>')+_0x11cfe2(0x24d)+_0x5ade47)});_0x36def7=_0x19905d,console['log'](a4_0x282c7e[_0x11cfe2(0x233)](_0x11cfe2(0x212)+_0x19905d));}}}}if(!_0x36def7)return console['log'](a4_0x282c7e[_0x11cfe2(0x1f9)](_0x11cfe2(0x22a))),console['log'](_0x11cfe2(0x282)),console[_0x11cfe2(0x25b)](_0x11cfe2(0x28b)),console[_0x11cfe2(0x25b)]('\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[_0x11cfe2(0x25b)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x3f7b80)throw new SDKError(ErrorCode[_0x11cfe2(0x22d)],_0x11cfe2(0x206),undefined,{'helpText':_0x11cfe2(0x222)});if(!_0x4764f7&&!_0x3235bb){if(!isInteractive())return console[_0x11cfe2(0x23d)](a4_0x282c7e['red'](_0x11cfe2(0x25c)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a4_0x282c7e[_0x11cfe2(0x233)](_0x11cfe2(0x219))),0x1;const _0x536fb3=await confirmKey(_0x11cfe2(0x297)+_0x36def7+_0x11cfe2(0x250)+_0x3f7b80+'\x22?');if(!_0x536fb3)return console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x1f9)](_0x11cfe2(0x28d))),0x1;}const {data:_0x2b7247}=await withSpinner(_0x11cfe2(0x29c)+_0x36def7+_0x11cfe2(0x216)+_0x3f7b80+_0x11cfe2(0x224),()=>_0x193cf7['llm'][_0x11cfe2(0x253)](_0x36def7,_0x3f7b80,{'dryRun':_0x3235bb}));if(_0x3235bb){console[_0x11cfe2(0x25b)](a4_0x282c7e['yellow'](_0x11cfe2(0x1fb))),console[_0x11cfe2(0x25b)](_0x11cfe2(0x1f2)+_0x2b7247[_0x11cfe2(0x271)]),console['log'](_0x11cfe2(0x288)+_0x3f7b80),console[_0x11cfe2(0x25b)](_0x11cfe2(0x220)),console[_0x11cfe2(0x25b)](_0x11cfe2(0x234)+_0x2b7247[_0x11cfe2(0x298)]['agents'][_0x11cfe2(0x27d)]),console[_0x11cfe2(0x25b)](_0x11cfe2(0x287)+_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x208)][_0x11cfe2(0x27d)]),console[_0x11cfe2(0x25b)](_0x11cfe2(0x283)+_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x24a)][_0x11cfe2(0x27d)]);const _0x4be03a=_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x235)][_0x11cfe2(0x27d)]>0x0||_0x2b7247[_0x11cfe2(0x298)]['experimentalArtifacts']['created']>0x0;return _0x4be03a&&(console[_0x11cfe2(0x25b)](_0x11cfe2(0x24e)+_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x235)][_0x11cfe2(0x27d)]),console['log'](_0x11cfe2(0x275)+_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x200)][_0x11cfe2(0x27d)])),0x0;}const _0x358328=_0x2b7247[_0x11cfe2(0x298)]['agents'][_0x11cfe2(0x223)]>0x0||_0x2b7247['counts']['knowledgeBases'][_0x11cfe2(0x223)]>0x0||_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x24a)]['errors']>0x0||_0x2b7247['counts'][_0x11cfe2(0x235)]['errors']>0x0||_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x200)][_0x11cfe2(0x223)]>0x0;_0x358328?console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x1f9)](_0x11cfe2(0x259))):console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x29a)](_0x11cfe2(0x290)));console[_0x11cfe2(0x25b)](_0x11cfe2(0x1f2)+_0x2b7247[_0x11cfe2(0x271)]),console[_0x11cfe2(0x25b)](_0x11cfe2(0x288)+_0x2b7247[_0x11cfe2(0x257)]),console[_0x11cfe2(0x25b)](_0x11cfe2(0x26b)+_0x2b7247[_0x11cfe2(0x285)]),console[_0x11cfe2(0x25b)](),console['log'](_0x11cfe2(0x273)),console[_0x11cfe2(0x25b)](_0x11cfe2(0x234)+formatCountSummary(_0x2b7247[_0x11cfe2(0x298)]['agents'])),console[_0x11cfe2(0x25b)](_0x11cfe2(0x287)+formatCountSummary(_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x208)])),console[_0x11cfe2(0x25b)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x24a)])),console[_0x11cfe2(0x25b)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x204)]));const _0x5a1037=_0x2b7247[_0x11cfe2(0x298)]['experimentalKnowledgeBases'][_0x11cfe2(0x27d)]>0x0||_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x235)]['updated']>0x0||_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x235)][_0x11cfe2(0x210)]>0x0||_0x2b7247[_0x11cfe2(0x298)]['experimentalArtifacts'][_0x11cfe2(0x27d)]>0x0||_0x2b7247[_0x11cfe2(0x298)]['experimentalArtifacts'][_0x11cfe2(0x205)]>0x0||_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x200)][_0x11cfe2(0x210)]>0x0;_0x5a1037&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x235)])),console[_0x11cfe2(0x25b)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x2b7247[_0x11cfe2(0x298)]['experimentalArtifacts'])));if(_0x358328){console[_0x11cfe2(0x25b)](),console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x23f)]('Errors:'));for(const _0x2a8714 of _0x2b7247[_0x11cfe2(0x20b)]){_0x2a8714[_0x11cfe2(0x1f7)]===_0x11cfe2(0x23d)&&console[_0x11cfe2(0x25b)](a4_0x282c7e['red'](_0x11cfe2(0x24b)+_0x2a8714[_0x11cfe2(0x25d)]+_0x11cfe2(0x245)+_0x2a8714['error']));}for(const _0x27f0ca of _0x2b7247[_0x11cfe2(0x208)]){_0x27f0ca[_0x11cfe2(0x1f7)]===_0x11cfe2(0x23d)&&console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x23f)](_0x11cfe2(0x1ef)+_0x27f0ca[_0x11cfe2(0x1f4)]+_0x11cfe2(0x245)+_0x27f0ca['error']));}for(const _0x447b10 of _0x2b7247['prompts']){_0x447b10['action']===_0x11cfe2(0x23d)&&console['log'](a4_0x282c7e[_0x11cfe2(0x23f)](_0x11cfe2(0x236)+_0x447b10['name']+'\x22:\x20'+_0x447b10['error']));}for(const _0x227053 of _0x2b7247[_0x11cfe2(0x204)]){_0x227053['action']===_0x11cfe2(0x23d)&&console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x23f)](_0x11cfe2(0x27b)+_0x227053[_0x11cfe2(0x1f4)]+_0x11cfe2(0x245)+_0x227053[_0x11cfe2(0x23d)]));}for(const _0x451034 of _0x2b7247[_0x11cfe2(0x235)]){_0x451034[_0x11cfe2(0x1f7)]===_0x11cfe2(0x23d)&&console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x23f)](_0x11cfe2(0x26c)+_0x451034[_0x11cfe2(0x1f4)]+_0x11cfe2(0x245)+_0x451034[_0x11cfe2(0x23d)]));}for(const _0x465f08 of _0x2b7247[_0x11cfe2(0x200)]){_0x465f08[_0x11cfe2(0x1f7)]==='error'&&console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x23f)](_0x11cfe2(0x230)+_0x465f08['name']+'\x22:\x20'+_0x465f08['error']));}return 0x1;}console['log']();const _0x299eb1=getLLMProjectUrl(_0xb26468,_0x2b7247[_0x11cfe2(0x285)]);return console[_0x11cfe2(0x25b)](_0x11cfe2(0x20e)+a4_0x282c7e[_0x11cfe2(0x254)](_0x299eb1)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x3c89bd(0x1f4)]=a4_0x3c89bd(0x207);['description']=a4_0x3c89bd(0x21c);async[a4_0x3c89bd(0x237)](_0x457879){const _0x4408d5=a4_0x3c89bd,{options:_0x389e77,args:_0x17f8ee,tdx:_0x13cab8}=_0x457879;let _0x568ba4=_0x17f8ee[0x0]||process[_0x4408d5(0x294)]();const _0x2c62a2=_0x389e77['dryRun'],_0x52c6f5=_0x389e77[_0x4408d5(0x270)],_0x58bb01=_0x389e77[_0x4408d5(0x276)],_0x3e1d0e=_0x389e77['site'],_0x490728=a4_0x24c893[_0x4408d5(0x231)](_0x568ba4,_0x4408d5(0x286)),_0x32d4d8=existsSync(_0x490728);if(_0x32d4d8){const {data:_0x154e65}=await withSpinner(_0x4408d5(0x211)+_0x568ba4+_0x4408d5(0x224),()=>_0x13cab8[_0x4408d5(0x20a)]['pushAgent'](_0x568ba4,{'dryRun':_0x2c62a2,'force':_0x52c6f5}));if(_0x2c62a2)return console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x1f9)](_0x4408d5(0x1fb))),console[_0x4408d5(0x25b)](_0x4408d5(0x243)+_0x154e65[_0x4408d5(0x25d)]),0x0;if(_0x154e65['action']===_0x4408d5(0x23d))return console['log'](a4_0x282c7e['red'](_0x4408d5(0x221)+_0x154e65[_0x4408d5(0x23d)])),0x1;console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x29a)](_0x4408d5(0x1f0)+_0x154e65['action']+_0x4408d5(0x24c))),console[_0x4408d5(0x25b)](_0x4408d5(0x272)+_0x154e65['agentName']);if(_0x154e65['agentId']&&_0x154e65['projectId']){const _0x5965c0=getLLMAgentChatUrl(_0x3e1d0e,_0x154e65[_0x4408d5(0x1f8)],_0x154e65[_0x4408d5(0x209)]);console[_0x4408d5(0x25b)](_0x4408d5(0x255)+a4_0x282c7e[_0x4408d5(0x254)](_0x5965c0));}return 0x0;}const _0x3f6b26=_0x389e77[_0x4408d5(0x289)],_0x2f65bb=resolveProjectFromContext(_0x568ba4,_0x3f6b26);if(_0x2f65bb[_0x4408d5(0x291)])_0x568ba4=_0x2f65bb['projectDir'],_0x2f65bb[_0x4408d5(0x1fe)]===_0x4408d5(0x240)&&console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x233)]('Using\x20project:\x20'+_0x568ba4));else{let _0x55f16d='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x2f65bb[_0x4408d5(0x22f)]===_0x4408d5(0x246)&&(_0x55f16d=_0x2f65bb[_0x4408d5(0x248)]+_0x4408d5(0x23a)+_0x2f65bb[_0x4408d5(0x289)]+_0x4408d5(0x299));throw new SDKError(ErrorCode[_0x4408d5(0x29d)],_0x2f65bb['reason']===_0x4408d5(0x20f)?_0x2f65bb['message']:_0x4408d5(0x1ff)+_0x568ba4,undefined,{'helpText':_0x55f16d});}const {data:_0x33f7ee}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x13cab8['llm']['pushProject'](_0x568ba4,{'dryRun':!![]})),_0x4b52de=_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x20b)][_0x4408d5(0x223)]>0x0;if(_0x4b52de){console['log'](a4_0x282c7e['red'](_0x4408d5(0x27a)));for(const _0xaca2b7 of _0x33f7ee[_0x4408d5(0x20b)]){_0xaca2b7[_0x4408d5(0x1f7)]===_0x4408d5(0x23d)&&console[_0x4408d5(0x25b)](a4_0x282c7e['red'](_0x4408d5(0x24b)+_0xaca2b7[_0x4408d5(0x25d)]+'\x22:\x20'+_0xaca2b7[_0x4408d5(0x23d)]));}return 0x1;}const _0x49b8ba=_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x20b)][_0x4408d5(0x27d)]+_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x208)][_0x4408d5(0x27d)]+_0x33f7ee['counts']['textKnowledgeBases'][_0x4408d5(0x27d)]+_0x33f7ee['counts'][_0x4408d5(0x24a)][_0x4408d5(0x27d)]+_0x33f7ee[_0x4408d5(0x298)]['integrations'][_0x4408d5(0x27d)]+_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x235)][_0x4408d5(0x27d)]+_0x33f7ee[_0x4408d5(0x298)]['experimentalArtifacts']['created'],_0x97d6af=_0x33f7ee[_0x4408d5(0x298)]['agents'][_0x4408d5(0x205)]+_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x208)][_0x4408d5(0x205)]+_0x33f7ee['counts'][_0x4408d5(0x1eb)][_0x4408d5(0x205)]+_0x33f7ee['counts'][_0x4408d5(0x24a)][_0x4408d5(0x205)]+_0x33f7ee['counts'][_0x4408d5(0x204)]['updated']+_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x235)][_0x4408d5(0x205)]+_0x33f7ee['counts']['experimentalArtifacts'][_0x4408d5(0x205)],_0x5973e3=_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x20b)]['unchanged']+_0x33f7ee[_0x4408d5(0x298)]['knowledgeBases'][_0x4408d5(0x210)]+_0x33f7ee[_0x4408d5(0x298)]['textKnowledgeBases'][_0x4408d5(0x210)]+_0x33f7ee[_0x4408d5(0x298)]['prompts'][_0x4408d5(0x210)]+_0x33f7ee['counts']['integrations'][_0x4408d5(0x210)]+_0x33f7ee['counts'][_0x4408d5(0x235)]['unchanged']+_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x200)][_0x4408d5(0x210)];console[_0x4408d5(0x25b)](_0x4408d5(0x20c)+_0x33f7ee[_0x4408d5(0x1f1)]+'\x27:'),console[_0x4408d5(0x25b)]('\x20\x20'+a4_0x282c7e[_0x4408d5(0x29a)]('+\x20'+_0x49b8ba+_0x4408d5(0x1e6))+_0x4408d5(0x241)+a4_0x282c7e['yellow']('~\x20'+_0x97d6af+_0x4408d5(0x21f))+_0x4408d5(0x241)+a4_0x282c7e[_0x4408d5(0x233)]('=\x20'+_0x5973e3+_0x4408d5(0x1fc))),console[_0x4408d5(0x25b)]('\x20\x20Agents:\x20'+formatCountSummary(_0x33f7ee[_0x4408d5(0x298)]['agents'])),console[_0x4408d5(0x25b)](_0x4408d5(0x287)+formatCountSummary(_0x33f7ee[_0x4408d5(0x298)]['knowledgeBases'])),console[_0x4408d5(0x25b)](_0x4408d5(0x260)+formatCountSummary(_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x1eb)])),console[_0x4408d5(0x25b)](_0x4408d5(0x283)+formatCountSummary(_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x24a)])),console[_0x4408d5(0x25b)](_0x4408d5(0x28f)+formatCountSummary(_0x33f7ee['counts']['integrations']));const _0xad94bd=_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x235)][_0x4408d5(0x27d)]>0x0||_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x235)][_0x4408d5(0x205)]>0x0||_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x235)][_0x4408d5(0x210)]>0x0||_0x33f7ee[_0x4408d5(0x298)]['experimentalArtifacts'][_0x4408d5(0x27d)]>0x0||_0x33f7ee[_0x4408d5(0x298)]['experimentalArtifacts'][_0x4408d5(0x205)]>0x0||_0x33f7ee[_0x4408d5(0x298)]['experimentalArtifacts']['unchanged']>0x0;_0xad94bd&&(console['log'](_0x4408d5(0x24e)+formatCountSummary(_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x235)])),console['log'](_0x4408d5(0x275)+formatCountSummary(_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x200)])));console[_0x4408d5(0x25b)](_0x4408d5(0x277)+a4_0x282c7e[_0x4408d5(0x254)](_0x568ba4)),displayDiffs(_0x33f7ee[_0x4408d5(0x20b)],_0x33f7ee[_0x4408d5(0x208)],_0x33f7ee['textKnowledgeBases'],_0x33f7ee['prompts'],_0x33f7ee[_0x4408d5(0x204)],_0x33f7ee[_0x4408d5(0x235)],_0x33f7ee[_0x4408d5(0x200)]);if(_0x2c62a2)return console['log'](a4_0x282c7e[_0x4408d5(0x1f9)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x49b8ba===0x0&&_0x97d6af===0x0){console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x29a)](_0x4408d5(0x26d)));const _0xe9231b=getLLMProjectUrl(_0x3e1d0e,_0x33f7ee['projectId']);return console[_0x4408d5(0x25b)](_0x4408d5(0x20e)+a4_0x282c7e[_0x4408d5(0x254)](_0xe9231b)),0x0;}if(!_0x58bb01&&!_0x52c6f5){if(!isInteractive())return console['error'](a4_0x282c7e[_0x4408d5(0x23f)](_0x4408d5(0x25c)),_0x4408d5(0x29b)),console[_0x4408d5(0x23d)](a4_0x282c7e['dim'](_0x4408d5(0x219))),0x1;const _0x10d164=await confirmKey(_0x4408d5(0x1f6)+(_0x49b8ba+_0x97d6af)+_0x4408d5(0x202));if(!_0x10d164)return console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x1f9)]('Cancelled'),'-\x20nothing\x20pushed'),0x1;}const {data:_0x2d6a24}=await withSpinner(_0x4408d5(0x247),()=>_0x13cab8[_0x4408d5(0x20a)][_0x4408d5(0x25f)](_0x568ba4,{'force':_0x52c6f5})),_0x36b344=_0x2d6a24['counts']['agents']['errors']>0x0||_0x2d6a24['counts'][_0x4408d5(0x208)]['errors']>0x0||_0x2d6a24[_0x4408d5(0x298)][_0x4408d5(0x1eb)][_0x4408d5(0x223)]>0x0||_0x2d6a24[_0x4408d5(0x298)][_0x4408d5(0x24a)][_0x4408d5(0x223)]>0x0;if(_0x36b344){console[_0x4408d5(0x25b)](a4_0x282c7e['yellow'](_0x4408d5(0x23e))),console['log'](),console['log'](a4_0x282c7e[_0x4408d5(0x23f)](_0x4408d5(0x278)));for(const _0x1c9e42 of _0x2d6a24[_0x4408d5(0x20b)]){_0x1c9e42[_0x4408d5(0x1f7)]===_0x4408d5(0x23d)&&console['log'](a4_0x282c7e[_0x4408d5(0x23f)](_0x4408d5(0x24b)+_0x1c9e42[_0x4408d5(0x25d)]+_0x4408d5(0x245)+_0x1c9e42[_0x4408d5(0x23d)]));}for(const _0x23e3cd of _0x2d6a24[_0x4408d5(0x208)]){_0x23e3cd[_0x4408d5(0x1f7)]===_0x4408d5(0x23d)&&console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x23f)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x23e3cd[_0x4408d5(0x1f4)]+_0x4408d5(0x245)+_0x23e3cd[_0x4408d5(0x23d)]));}for(const _0x3cac9f of _0x2d6a24[_0x4408d5(0x1eb)]){_0x3cac9f[_0x4408d5(0x1f7)]===_0x4408d5(0x23d)&&console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x23f)](_0x4408d5(0x1e9)+_0x3cac9f[_0x4408d5(0x1f4)]+_0x4408d5(0x245)+_0x3cac9f[_0x4408d5(0x23d)]));}for(const _0x3c957b of _0x2d6a24[_0x4408d5(0x24a)]){_0x3c957b[_0x4408d5(0x1f7)]==='error'&&console['log'](a4_0x282c7e[_0x4408d5(0x23f)](_0x4408d5(0x236)+_0x3c957b[_0x4408d5(0x1f4)]+'\x22:\x20'+_0x3c957b[_0x4408d5(0x23d)]));}for(const _0x4e6c0a of _0x2d6a24['integrations']){_0x4e6c0a['action']===_0x4408d5(0x23d)&&console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x23f)](_0x4408d5(0x27b)+_0x4e6c0a[_0x4408d5(0x1f4)]+_0x4408d5(0x245)+_0x4e6c0a['error']));}return 0x1;}console['log'](a4_0x282c7e[_0x4408d5(0x29a)](_0x4408d5(0x1fa)+(_0x49b8ba+_0x97d6af)+_0x4408d5(0x1f3)+_0x2d6a24[_0x4408d5(0x1f1)]+'\x27'));const _0x351dd8=getLLMProjectUrl(_0x3e1d0e,_0x2d6a24[_0x4408d5(0x1f8)]);return console[_0x4408d5(0x25b)](_0x4408d5(0x20e)+a4_0x282c7e['cyan'](_0x351dd8)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x48f77d=a5_0x5b3b;(function(_0x7236a0,_0x172093){const _0x2692a2=a5_0x5b3b,_0x195a0f=_0x7236a0();while(!![]){try{const _0x385c26=-parseInt(_0x2692a2(0x227))/0x1*(-parseInt(_0x2692a2(0x19b))/0x2)+parseInt(_0x2692a2(0x1a1))/0x3+-parseInt(_0x2692a2(0x1b1))/0x4+parseInt(_0x2692a2(0x220))/0x5+parseInt(_0x2692a2(0x21a))/0x6*(-parseInt(_0x2692a2(0x1e4))/0x7)+parseInt(_0x2692a2(0x1cc))/0x8*(parseInt(_0x2692a2(0x216))/0x9)+-parseInt(_0x2692a2(0x21f))/0xa*(parseInt(_0x2692a2(0x1bb))/0xb);if(_0x385c26===_0x172093)break;else _0x195a0f['push'](_0x195a0f['shift']());}catch(_0x4992c3){_0x195a0f['push'](_0x195a0f['shift']());}}}(a5_0x5c25,0x56f0c));import*as a5_0x450a1f from'node:fs';import*as a5_0x1973a9 from'node:path';import a5_0x5dc5a7 from'chalk';import{BaseCommand}from'./command.js';function a5_0x5c25(){const _0x4e58ba=['11shqZQU','testYmlPath','\x20\x20Project:\x20','writeFileSync','existsSync','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','\x20\x20Agent:\x20','substring','Running\x20test:\x20','PASS','split','cyan','No\x20tests\x20found\x20matching:\x20','Executing\x20new\x20tests...','Available\x20tests:\x20','Test\x20Configuration:','\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','672vfYAUY','/<agent-name>','reason','Test\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.',':\x20Sending\x20user\x20input...','projectName','✗\x20ERROR:\x20','Failed:\x20\x20\x20','execute','No\x20tests\x20found\x20with\x20tags:\x20','No\x20tests\x20have\x20tags\x20defined.','Re-evaluating...','Duration:\x20','\x20\x20Evaluating...\x20','executeReeval','site','404','includes','\x20\x20-\x20','\x20\x20Conversation:\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','llmProject','round','7mDnTGg','Re-evaluation\x20Summary','filter','description','utf-8','table','Error:\x20No\x20previous\x20test\x20run\x20found.','✗\x20FAIL:\x20','Errors:\x20\x20\x20','green','testName','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','projectDir','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','⚠\x20SKIPPED:\x20','map','size','some','Evaluating\x20response...','json','dryRun','jsonl','yellow','Re-evaluating\x20','reeval','Run\x20tests\x20for\x20an\x20LLM\x20agent','ERROR','isSpinning','\x20(new)','Failed\x20Tests:','\x22,\x20but\x20current\x20site\x20is\x20\x22','agentName','Total:\x20\x20\x20\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','now','\x27\x20to\x20create\x20the\x20folder\x20structure.','trim','log','\x20(cached)','message','agentDirs','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Available\x20tags:\x20','llm','✓\x20PASS:\x20','start','conversation_url','conversations','Usage:','44748KeBqwR','Error\x20writing\x20output\x20file:\x20','...\x20','name','3700068GmTwIa','toLowerCase','resolveProjectId','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Agent:\x20','1278130RtdtVR','1180555MjFXKp','rounds','source','push','tags','tsv','output','180029zszPPx','FAIL','...','dim','no_context','agent','Using\x20agent:\x20','forEach','Run\x20\x27tdx\x20agent\x20pull\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','has','\x22:\x20','red','Passed:\x20\x20\x20','text','6ZUtgKx','repeat','toISOString','Test\x20Summary','Cached\x20run\x20from:\x20','agent:test','1520523HMxIER','resolve','\x20-\x20','\x20\x20Round\x20','basename','multiple_agents','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Round\x201/','Tests\x20found:\x20','stop','found','Either\x20switch\x20to\x20the\x20\x22','Running:\x20','join','white','2400352DTcVfU','eval','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','status','timestamp','Site:\x20','tests','Round\x20','Running\x20agent\x20tests...','length'];a5_0x5c25=function(){return _0x4e58ba;};return a5_0x5c25();}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_0x5b3b(_0x4e803d,_0x4d0cfc){_0x4e803d=_0x4e803d-0x196;const _0x5c25b7=a5_0x5c25();let _0x5b3ba1=_0x5c25b7[_0x4e803d];return _0x5b3ba1;}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0x48f77d(0x1a0);[a5_0x48f77d(0x1e7)]=a5_0x48f77d(0x1fd);async[a5_0x48f77d(0x1d5)](_0x393b37){const _0x3ac21d=a5_0x48f77d,{options:_0x113a53,args:_0x125aaa,tdx:_0x2a76d3}=_0x393b37,_0x2e3c09=_0x125aaa[0x0]||'.',_0x29600d=_0x113a53[_0x3ac21d(0x1f8)],_0x27a9e0=_0x113a53,_0x320587=_0x27a9e0[_0x3ac21d(0x1b2)]===![],_0x162c12=_0x27a9e0[_0x3ac21d(0x1fc)],_0x2fb139=_0x27a9e0[_0x3ac21d(0x219)],_0x217d8c=_0x27a9e0[_0x3ac21d(0x224)],_0x19ee5d=_0x113a53['site'],_0x204ea8=_0x27a9e0[_0x3ac21d(0x226)];if(_0x162c12&&_0x320587)return console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x198)](_0x3ac21d(0x1ef))),0x1;let _0x10c961=_0x3ac21d(0x1e9);if(_0x27a9e0['json'])_0x10c961=_0x3ac21d(0x1f7);else{if(_0x27a9e0[_0x3ac21d(0x1f9)])_0x10c961=_0x3ac21d(0x1f9);else{if(_0x27a9e0[_0x3ac21d(0x225)])_0x10c961=_0x3ac21d(0x225);else{if(_0x27a9e0[_0x3ac21d(0x1e9)])_0x10c961=_0x3ac21d(0x1e9);}}}const _0x17a8e3=_0x27a9e0[_0x3ac21d(0x1e2)];let _0x5ec89b=_0x2e3c09;const _0x45b810=a5_0x450a1f[_0x3ac21d(0x1bf)](_0x2e3c09),_0x1bc7fb=_0x2e3c09==='.';if(!_0x45b810||_0x1bc7fb){const _0x125495=resolveProjectFromContext(_0x2e3c09,_0x17a8e3,{'requireFile':'test.yml'});if(_0x125495[_0x3ac21d(0x1ac)])_0x5ec89b=_0x125495[_0x3ac21d(0x1f0)],_0x125495[_0x3ac21d(0x222)]==='context'&&console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x22a)](_0x3ac21d(0x22d)+_0x5ec89b));else switch(_0x125495[_0x3ac21d(0x1ce)]){case _0x3ac21d(0x22b):console['log'](a5_0x5dc5a7[_0x3ac21d(0x1fa)](_0x125495['message'])),console[_0x3ac21d(0x20a)](),console['log'](_0x3ac21d(0x215)),console[_0x3ac21d(0x20a)](_0x3ac21d(0x1cb)),console[_0x3ac21d(0x20a)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x3ac21d(0x20a)](),console[_0x3ac21d(0x20a)](_0x3ac21d(0x20e));return 0x1;case'no_local_folder':console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x1fa)](_0x125495['message'])),console['log'](),console[_0x3ac21d(0x20a)](_0x3ac21d(0x22f)+_0x125495['llmProject']+_0x3ac21d(0x208));return 0x1;case _0x3ac21d(0x1a6):{const _0x57764e=a5_0x1973a9[_0x3ac21d(0x1a5)](_0x125495[_0x3ac21d(0x1f0)]);console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x1fa)](_0x3ac21d(0x1a7)+_0x125495['llmProject']+'\x22:'));for(const _0x451a7b of _0x125495[_0x3ac21d(0x20d)]){console[_0x3ac21d(0x20a)](_0x3ac21d(0x1df)+_0x451a7b);}return console[_0x3ac21d(0x20a)](),console[_0x3ac21d(0x20a)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x57764e+_0x3ac21d(0x1cd)),0x1;}case'no_tests':console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x1fa)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x125495[_0x3ac21d(0x1e2)]+'\x22.')),console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x22a)]('Project\x20path:\x20'+_0x125495['projectDir'])),console['log'](),console[_0x3ac21d(0x20a)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x23c9c4,agentInfo:_0x3ea0e0}=parseTestFile(_0x5ec89b);let _0x1bd531=_0x23c9c4[_0x3ac21d(0x1b7)];if(_0x2fb139){const _0x48676d=_0x2fb139['split'](',')['map'](_0x4126a5=>_0x4126a5['trim']());_0x1bd531=_0x23c9c4[_0x3ac21d(0x1b7)][_0x3ac21d(0x1e6)](_0x10ffb1=>_0x48676d[_0x3ac21d(0x1de)](_0x10ffb1[_0x3ac21d(0x219)]));if(_0x1bd531['length']===0x0)return console[_0x3ac21d(0x20a)](a5_0x5dc5a7['yellow'](_0x3ac21d(0x1c7)+_0x2fb139)),console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x22a)](_0x3ac21d(0x1c9)+_0x23c9c4[_0x3ac21d(0x1b7)][_0x3ac21d(0x1f3)](_0x1333a9=>_0x1333a9[_0x3ac21d(0x219)])[_0x3ac21d(0x1af)](',\x20'))),0x1;}if(_0x217d8c){const _0x418cd2=_0x217d8c[_0x3ac21d(0x1c5)](',')[_0x3ac21d(0x1f3)](_0x2ad220=>_0x2ad220[_0x3ac21d(0x209)]()[_0x3ac21d(0x21b)]());_0x1bd531=_0x1bd531[_0x3ac21d(0x1e6)](_0x3353ed=>_0x3353ed[_0x3ac21d(0x224)]?.[_0x3ac21d(0x1f5)](_0x17a1e4=>_0x418cd2[_0x3ac21d(0x1de)](_0x17a1e4[_0x3ac21d(0x21b)]())));if(_0x1bd531[_0x3ac21d(0x1ba)]===0x0){console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x1fa)](_0x3ac21d(0x1d6)+_0x217d8c));const _0xf4ec9f=new Set();return _0x23c9c4[_0x3ac21d(0x1b7)]['forEach'](_0x3c2361=>_0x3c2361['tags']?.[_0x3ac21d(0x22e)](_0x277ada=>_0xf4ec9f['add'](_0x277ada))),_0xf4ec9f[_0x3ac21d(0x1f4)]>0x0?console[_0x3ac21d(0x20a)](a5_0x5dc5a7['dim'](_0x3ac21d(0x20f)+[..._0xf4ec9f][_0x3ac21d(0x1af)](',\x20'))):console['log'](a5_0x5dc5a7[_0x3ac21d(0x22a)](_0x3ac21d(0x1d7))),0x1;}}if(_0x162c12)return this['executeReeval'](_0x393b37,{'definition':{'tests':_0x1bd531},'agentInfo':_0x3ea0e0,'outputFormat':_0x10c961,'outputFile':_0x204ea8,'testNames':_0x2fb139});if(_0x29600d){console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x1c6)](_0x3ac21d(0x1ca))),console[_0x3ac21d(0x20a)]('\x20\x20Site:\x20'+a5_0x5dc5a7[_0x3ac21d(0x1b0)](_0x19ee5d)),console[_0x3ac21d(0x20a)](_0x3ac21d(0x1bd)+a5_0x5dc5a7[_0x3ac21d(0x1b0)](_0x3ea0e0['projectName'])),console[_0x3ac21d(0x20a)](_0x3ac21d(0x1c1)+a5_0x5dc5a7['white'](_0x3ea0e0[_0x3ac21d(0x203)])),console['log'](),console[_0x3ac21d(0x20a)](_0x3ac21d(0x1aa)+a5_0x5dc5a7[_0x3ac21d(0x1b0)](_0x1bd531['length']));for(let _0x53f112=0x0;_0x53f112<_0x1bd531[_0x3ac21d(0x1ba)];_0x53f112++){const _0xddeb7b=_0x1bd531[_0x53f112],_0x225eef=_0xddeb7b[_0x3ac21d(0x221)][_0x3ac21d(0x1ba)]===0x1?_0x3ac21d(0x1e3):_0x3ac21d(0x221),_0x4254c7=_0xddeb7b[_0x3ac21d(0x224)]?.[_0x3ac21d(0x1ba)]?'\x20['+_0xddeb7b[_0x3ac21d(0x224)][_0x3ac21d(0x1af)](',\x20')+']':'';console[_0x3ac21d(0x20a)]('\x20\x20'+(_0x53f112+0x1)+'.\x20'+a5_0x5dc5a7[_0x3ac21d(0x1b0)](_0xddeb7b['name'])+'\x20('+_0xddeb7b[_0x3ac21d(0x221)][_0x3ac21d(0x1ba)]+'\x20'+_0x225eef+')'+a5_0x5dc5a7[_0x3ac21d(0x22a)](_0x4254c7));}return 0x0;}let _0x32c942,_0x21a8ca;try{_0x32c942=await _0x2a76d3[_0x3ac21d(0x210)][_0x3ac21d(0x21c)](_0x3ea0e0['projectName']);}catch(_0x5300e){const _0x4e844a=_0x5300e instanceof Error?_0x5300e[_0x3ac21d(0x20c)]:String(_0x5300e);return _0x4e844a[_0x3ac21d(0x1de)](_0x3ac21d(0x1dd))||_0x4e844a[_0x3ac21d(0x21b)]()['includes']('not\x20found')?console[_0x3ac21d(0x20a)](a5_0x5dc5a7['red'](_0x3ac21d(0x205)+_0x3ea0e0['projectName'])):console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x198)](_0x3ac21d(0x1a8)+_0x3ea0e0[_0x3ac21d(0x1d2)]+'\x22:\x20'+_0x4e844a)),0x1;}try{_0x21a8ca=await _0x2a76d3['llm']['resolveAgentId'](_0x3ea0e0[_0x3ac21d(0x203)],_0x32c942);}catch(_0x2cbd2c){const _0x4c11ae=_0x2cbd2c instanceof Error?_0x2cbd2c[_0x3ac21d(0x20c)]:String(_0x2cbd2c);return _0x4c11ae[_0x3ac21d(0x1de)](_0x3ac21d(0x1dd))||_0x4c11ae[_0x3ac21d(0x21b)]()[_0x3ac21d(0x1de)]('not\x20found')?console['log'](a5_0x5dc5a7['red']('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x3ea0e0[_0x3ac21d(0x203)])):console['log'](a5_0x5dc5a7['red'](_0x3ac21d(0x21d)+_0x3ea0e0[_0x3ac21d(0x203)]+_0x3ac21d(0x197)+_0x4c11ae)),0x1;}let _0x2a6e3c;if(!_0x320587)try{_0x2a6e3c=await setupEvaluatorAgent(_0x2a76d3[_0x3ac21d(0x210)],_0x113a53['verbose']);}catch(_0x14ed54){const _0x3710d0=_0x14ed54 instanceof Error?_0x14ed54[_0x3ac21d(0x20c)]:String(_0x14ed54);return console[_0x3ac21d(0x20a)](a5_0x5dc5a7['red'](_0x3ac21d(0x230)+_0x3710d0)),0x1;}console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x1c6)](_0x3ac21d(0x1b9))),console[_0x3ac21d(0x20a)](_0x3ac21d(0x1b6)+a5_0x5dc5a7['white'](_0x19ee5d)),console[_0x3ac21d(0x20a)](_0x3ac21d(0x21e)+a5_0x5dc5a7['white'](_0x3ea0e0[_0x3ac21d(0x1d2)]+'/'+_0x3ea0e0[_0x3ac21d(0x203)])),console[_0x3ac21d(0x20a)]();const _0x437cb6=[],_0x1cf54f=[],_0x58b364=Date[_0x3ac21d(0x207)]();for(let _0x5cd427=0x0;_0x5cd427<_0x1bd531[_0x3ac21d(0x1ba)];_0x5cd427++){const _0x1b0295=_0x1bd531[_0x5cd427];_0x1bd531[_0x3ac21d(0x1ba)]>0x1?console['log'](_0x3ac21d(0x1cf)+(_0x5cd427+0x1)+'/'+_0x1bd531['length']+':\x20'+a5_0x5dc5a7[_0x3ac21d(0x1b0)](_0x1b0295[_0x3ac21d(0x219)])):console[_0x3ac21d(0x20a)](_0x3ac21d(0x1c3)+a5_0x5dc5a7[_0x3ac21d(0x1b0)](_0x1b0295[_0x3ac21d(0x219)]));const _0x2d5914=createCommandSpinner(_0x3ac21d(0x1a9)+_0x1b0295[_0x3ac21d(0x221)][_0x3ac21d(0x1ba)]+_0x3ac21d(0x1d1));_0x2d5914[_0x3ac21d(0x212)]();try{const {result:_0x30f95d,conversation:_0x5d478d}=await runTest(_0x2a76d3[_0x3ac21d(0x210)],_0x1b0295,{'agentId':_0x21a8ca,'projectId':_0x32c942,'site':_0x19ee5d,'noEval':_0x320587,'evaluatorId':_0x2a6e3c,'onRoundStart':(_0x481c9a,_0x13946a)=>{const _0x5515fd=_0x3ac21d;_0x2d5914[_0x5515fd(0x19a)]=_0x5515fd(0x1b8)+(_0x481c9a+0x1)+'/'+_0x13946a+_0x5515fd(0x1d1);},'onRoundComplete':(_0x4b7e6f,_0x3a5a2e,_0xf73f1c)=>{const _0x1e0a40=_0x3ac21d,_0x3d9ef4=formatElapsed(_0x3a5a2e);_0xf73f1c?console[_0x1e0a40(0x20a)](_0x1e0a40(0x1a4)+(_0x4b7e6f+0x1)+'/'+_0x1b0295['rounds'][_0x1e0a40(0x1ba)]+_0x1e0a40(0x218)+a5_0x5dc5a7[_0x1e0a40(0x1ed)]('✓')+'\x20('+_0x3d9ef4+')'):console[_0x1e0a40(0x20a)](_0x1e0a40(0x1a4)+(_0x4b7e6f+0x1)+'/'+_0x1b0295[_0x1e0a40(0x221)][_0x1e0a40(0x1ba)]+'...\x20'+a5_0x5dc5a7['red']('✗'));},'onEvaluationStart':()=>{const _0x1ef914=_0x3ac21d;_0x2d5914['text']=_0x1ef914(0x1f6);},'onEvaluationComplete':_0x391c84=>{const _0x920e11=_0x3ac21d,_0x56b0a5=formatElapsed(_0x391c84);console[_0x920e11(0x20a)](_0x920e11(0x1da)+a5_0x5dc5a7['green']('✓')+'\x20('+_0x56b0a5+')');}});_0x2d5914[_0x3ac21d(0x1ab)](),_0x437cb6[_0x3ac21d(0x223)](_0x30f95d),_0x1cf54f[_0x3ac21d(0x223)](_0x5d478d);if(_0x30f95d['status']===_0x3ac21d(0x1c4))console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x1ed)](_0x3ac21d(0x211)+_0x30f95d['reason']));else _0x30f95d['status']==='FAIL'?console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x198)](_0x3ac21d(0x1eb)+_0x30f95d[_0x3ac21d(0x1ce)])):console[_0x3ac21d(0x20a)](a5_0x5dc5a7['red'](_0x3ac21d(0x1d3)+_0x30f95d[_0x3ac21d(0x1ce)]));_0x30f95d[_0x3ac21d(0x213)]&&console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x22a)]('Conversation\x20URL:\x20'+_0x30f95d[_0x3ac21d(0x213)])),console[_0x3ac21d(0x20a)]();}catch(_0x2551f3){_0x2d5914[_0x3ac21d(0x1ab)]();const _0x15ceba=_0x2551f3 instanceof Error?_0x2551f3[_0x3ac21d(0x20c)]:String(_0x2551f3);console['log'](a5_0x5dc5a7[_0x3ac21d(0x198)](_0x3ac21d(0x1d3)+_0x15ceba)),console[_0x3ac21d(0x20a)](),_0x437cb6[_0x3ac21d(0x223)]({'name':_0x1b0295['name'],'status':'ERROR','reason':_0x15ceba,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x42e7f5=Date[_0x3ac21d(0x207)]()-_0x58b364,_0x45a3d7=_0x437cb6[_0x3ac21d(0x1e6)](_0x57fb4d=>_0x57fb4d[_0x3ac21d(0x1b4)]===_0x3ac21d(0x1c4))[_0x3ac21d(0x1ba)],_0x8cea23=_0x437cb6[_0x3ac21d(0x1e6)](_0x5c54af=>_0x5c54af[_0x3ac21d(0x1b4)]==='FAIL')[_0x3ac21d(0x1ba)],_0x30be24=_0x437cb6[_0x3ac21d(0x1e6)](_0x193e6b=>_0x193e6b['status']===_0x3ac21d(0x1fe))[_0x3ac21d(0x1ba)];console[_0x3ac21d(0x20a)]('━'[_0x3ac21d(0x19c)](0x3c)),console[_0x3ac21d(0x20a)](_0x3ac21d(0x19e)),console[_0x3ac21d(0x20a)]('━'[_0x3ac21d(0x19c)](0x3c)),console['log'](_0x3ac21d(0x204)+_0x437cb6['length']),console['log'](_0x3ac21d(0x199)+a5_0x5dc5a7[_0x3ac21d(0x1ed)](_0x45a3d7)),console[_0x3ac21d(0x20a)](_0x3ac21d(0x1d4)+a5_0x5dc5a7[_0x3ac21d(0x198)](_0x8cea23));_0x30be24>0x0&&console['log'](_0x3ac21d(0x1ec)+a5_0x5dc5a7[_0x3ac21d(0x198)](_0x30be24));console[_0x3ac21d(0x20a)]('Duration:\x20'+formatElapsed(_0x42e7f5)),console['log']('━'['repeat'](0x3c));const _0x38ffe0=_0x437cb6['filter'](_0xbb6a78=>_0xbb6a78[_0x3ac21d(0x1b4)]!==_0x3ac21d(0x1c4));if(_0x38ffe0[_0x3ac21d(0x1ba)]>0x0){console[_0x3ac21d(0x20a)](),console[_0x3ac21d(0x20a)](_0x3ac21d(0x201));for(const _0x1096da of _0x38ffe0){const _0x5e370b=a5_0x5dc5a7[_0x3ac21d(0x198)]('✗'),_0xb13e63=_0x1096da[_0x3ac21d(0x1ce)][_0x3ac21d(0x1ba)]>0x32?_0x1096da[_0x3ac21d(0x1ce)][_0x3ac21d(0x1c2)](0x0,0x32)+_0x3ac21d(0x229):_0x1096da['reason'];console[_0x3ac21d(0x20a)]('\x20\x20'+_0x5e370b+'\x20'+_0x1096da[_0x3ac21d(0x219)]+':\x20'+_0xb13e63);}}const _0x16e0e2={'summary':{'total':_0x437cb6[_0x3ac21d(0x1ba)],'passed':_0x45a3d7,'failed':_0x8cea23,'errors':_0x30be24>0x0?_0x30be24:undefined,'duration_ms':_0x42e7f5},'tests':_0x437cb6,'agent':{'project':_0x3ea0e0[_0x3ac21d(0x1d2)],'name':_0x3ea0e0['agentName'],'site':_0x19ee5d},'timestamp':new Date(_0x58b364)['toISOString']()};try{const _0xb591b3=buildCachedTestRun(_0x1cf54f,{'site':_0x19ee5d,'projectId':_0x32c942,'projectName':_0x3ea0e0[_0x3ac21d(0x1d2)],'agentId':_0x21a8ca,'agentName':_0x3ea0e0[_0x3ac21d(0x203)],'testYmlPath':a5_0x1973a9[_0x3ac21d(0x1a2)](_0x3ea0e0[_0x3ac21d(0x1bc)])});saveLastTestRun(_0xb591b3);}catch{}if(_0x10c961!==_0x3ac21d(0x1e9)||_0x204ea8){const _0x4dfe6f=formatResults(_0x16e0e2,_0x10c961);if(_0x204ea8)try{a5_0x450a1f[_0x3ac21d(0x1be)](_0x204ea8,_0x4dfe6f,'utf-8'),console[_0x3ac21d(0x20a)](),console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x22a)]('Output\x20written\x20to:\x20'+_0x204ea8));}catch(_0x2e179a){return console[_0x3ac21d(0x20a)](),console[_0x3ac21d(0x20a)](a5_0x5dc5a7[_0x3ac21d(0x198)](_0x3ac21d(0x217)+_0x2e179a)),0x1;}else console[_0x3ac21d(0x20a)](),console[_0x3ac21d(0x20a)](_0x4dfe6f);}return _0x38ffe0[_0x3ac21d(0x1ba)]>0x0?0x1:0x0;}async[a5_0x48f77d(0x1db)](_0x4ab9a8,_0x38b50b){const _0x5ed24a=a5_0x48f77d,{options:_0x3283fe,tdx:_0xe66f34}=_0x4ab9a8,{definition:_0x1e1928,agentInfo:_0x4b48c7,outputFormat:_0x2fc1e6,outputFile:_0x3766dc}=_0x38b50b,_0x4269da=_0x3283fe[_0x5ed24a(0x1dc)],_0x55eaf1=loadLastTestRun();if(!_0x55eaf1)return console[_0x5ed24a(0x20a)](a5_0x5dc5a7[_0x5ed24a(0x198)](_0x5ed24a(0x1ea))),console[_0x5ed24a(0x20a)](a5_0x5dc5a7[_0x5ed24a(0x22a)](_0x5ed24a(0x1d0))),0x1;if(_0x55eaf1[_0x5ed24a(0x22c)][_0x5ed24a(0x203)]!==_0x4b48c7['agentName'])return console[_0x5ed24a(0x20a)](a5_0x5dc5a7[_0x5ed24a(0x198)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x55eaf1[_0x5ed24a(0x22c)][_0x5ed24a(0x203)]+_0x5ed24a(0x1b3)+_0x4b48c7[_0x5ed24a(0x203)]+'\x22.')),console[_0x5ed24a(0x20a)](a5_0x5dc5a7['dim'](_0x5ed24a(0x1f1))),0x1;const _0x2f4c9e=new Set(_0x55eaf1[_0x5ed24a(0x214)][_0x5ed24a(0x1f3)](_0x1083e4=>_0x1083e4[_0x5ed24a(0x1ee)])),_0x19240d=_0x1e1928[_0x5ed24a(0x1b7)][_0x5ed24a(0x1e6)](_0x5e5c0e=>!_0x2f4c9e[_0x5ed24a(0x196)](_0x5e5c0e[_0x5ed24a(0x219)]));if(_0x19240d[_0x5ed24a(0x1ba)]>0x0&&_0x55eaf1['site']!==_0x4269da)return console[_0x5ed24a(0x20a)](a5_0x5dc5a7[_0x5ed24a(0x198)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x5ed24a(0x20a)](a5_0x5dc5a7[_0x5ed24a(0x22a)](_0x5ed24a(0x1e1)+_0x55eaf1[_0x5ed24a(0x1dc)]+_0x5ed24a(0x202)+_0x4269da+'\x22.')),console[_0x5ed24a(0x20a)](a5_0x5dc5a7[_0x5ed24a(0x22a)](_0x5ed24a(0x1ad)+_0x55eaf1['site']+_0x5ed24a(0x1c0))),0x1;const _0x3dad88=_0x1e1928[_0x5ed24a(0x1b7)][_0x5ed24a(0x1e6)](_0x19ca01=>_0x2f4c9e[_0x5ed24a(0x196)](_0x19ca01[_0x5ed24a(0x219)])),_0x163ab2=_0x19240d;let _0x55af4f;try{_0x55af4f=await setupEvaluatorAgent(_0xe66f34[_0x5ed24a(0x210)],_0x3283fe['verbose']);}catch(_0x415825){const _0x5420ca=_0x415825 instanceof Error?_0x415825[_0x5ed24a(0x20c)]:String(_0x415825);return console[_0x5ed24a(0x20a)](a5_0x5dc5a7[_0x5ed24a(0x198)](_0x5ed24a(0x230)+_0x5420ca)),0x1;}console[_0x5ed24a(0x20a)](a5_0x5dc5a7[_0x5ed24a(0x1c6)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x5ed24a(0x20a)](_0x5ed24a(0x19f)+a5_0x5dc5a7[_0x5ed24a(0x1b0)](_0x55eaf1[_0x5ed24a(0x1b5)])),console[_0x5ed24a(0x20a)](_0x5ed24a(0x21e)+a5_0x5dc5a7[_0x5ed24a(0x1b0)](_0x55eaf1[_0x5ed24a(0x22c)]['projectName']+'/'+_0x55eaf1['agent'][_0x5ed24a(0x203)]));_0x163ab2[_0x5ed24a(0x1ba)]>0x0&&console[_0x5ed24a(0x20a)]('New\x20tests\x20to\x20execute:\x20'+a5_0x5dc5a7[_0x5ed24a(0x1fa)](_0x163ab2[_0x5ed24a(0x1ba)]));console[_0x5ed24a(0x20a)]();const _0x1c98ff=[],_0x304c1c=Date[_0x5ed24a(0x207)](),_0x383109=createCommandSpinner(_0x5ed24a(0x1d8));if(_0x3dad88[_0x5ed24a(0x1ba)]>0x0)try{const _0x4a0919=await reevaluateFromCache(_0xe66f34[_0x5ed24a(0x210)],_0x55eaf1,{'tests':_0x3dad88},{'evaluatorId':_0x55af4f,'onTestStart':(_0x339a5d,_0x57a802,_0x2583e6)=>{const _0x428eed=_0x5ed24a;_0x383109[_0x428eed(0x19a)]=_0x428eed(0x1fb)+(_0x57a802+0x1)+'/'+_0x2583e6+':\x20'+_0x339a5d+_0x428eed(0x229);if(!_0x383109[_0x428eed(0x1ff)])_0x383109[_0x428eed(0x212)]();},'onTestComplete':(_0x437b21,_0x5f0061)=>{const _0x1d5442=_0x5ed24a;_0x383109['stop']();if(_0x5f0061['status']===_0x1d5442(0x1c4))console[_0x1d5442(0x20a)](a5_0x5dc5a7['green']('✓\x20PASS:\x20'+_0x437b21)+a5_0x5dc5a7['dim']('\x20(cached)'));else _0x5f0061[_0x1d5442(0x1b4)]===_0x1d5442(0x228)?console[_0x1d5442(0x20a)](a5_0x5dc5a7[_0x1d5442(0x198)](_0x1d5442(0x1eb)+_0x437b21+'\x20-\x20'+_0x5f0061[_0x1d5442(0x1ce)])+a5_0x5dc5a7[_0x1d5442(0x22a)](_0x1d5442(0x20b))):console['log'](a5_0x5dc5a7[_0x1d5442(0x198)](_0x1d5442(0x1d3)+_0x437b21+_0x1d5442(0x1a3)+_0x5f0061['reason']));_0x5f0061[_0x1d5442(0x213)]&&console[_0x1d5442(0x20a)](a5_0x5dc5a7[_0x1d5442(0x22a)](_0x1d5442(0x1e0)+_0x5f0061['conversation_url'])),_0x1c98ff[_0x1d5442(0x223)](_0x5f0061);},'onTestSkipped':(_0x5c29ca,_0x22f008)=>{const _0x514051=_0x5ed24a;_0x383109['stop'](),console[_0x514051(0x20a)](a5_0x5dc5a7[_0x514051(0x1fa)](_0x514051(0x1f2)+_0x5c29ca+_0x514051(0x1a3)+_0x22f008));}});for(const _0x49b732 of _0x4a0919){!_0x1c98ff['find'](_0x9d69cd=>_0x9d69cd['name']===_0x49b732[_0x5ed24a(0x219)])&&_0x1c98ff[_0x5ed24a(0x223)](_0x49b732);}}catch(_0xd8f8d6){_0x383109[_0x5ed24a(0x1ab)]();const _0x3c6d4d=_0xd8f8d6 instanceof Error?_0xd8f8d6[_0x5ed24a(0x20c)]:String(_0xd8f8d6);return console[_0x5ed24a(0x20a)](a5_0x5dc5a7[_0x5ed24a(0x198)](_0x5ed24a(0x206)+_0x3c6d4d)),0x1;}_0x383109['stop']();if(_0x163ab2[_0x5ed24a(0x1ba)]>0x0){console[_0x5ed24a(0x20a)](),console[_0x5ed24a(0x20a)](a5_0x5dc5a7[_0x5ed24a(0x1c6)](_0x5ed24a(0x1c8)));const {projectId:_0x1999f5,agentId:_0x54da8d}=_0x55eaf1[_0x5ed24a(0x22c)];for(const _0x1fd4e1 of _0x163ab2){console[_0x5ed24a(0x20a)](_0x5ed24a(0x1ae)+a5_0x5dc5a7[_0x5ed24a(0x1b0)](_0x1fd4e1[_0x5ed24a(0x219)]));const _0x4c74fa=createCommandSpinner('Round\x201/'+_0x1fd4e1[_0x5ed24a(0x221)][_0x5ed24a(0x1ba)]+_0x5ed24a(0x1d1));_0x4c74fa[_0x5ed24a(0x212)]();try{const {result:_0x50464c}=await runTest(_0xe66f34[_0x5ed24a(0x210)],_0x1fd4e1,{'agentId':_0x54da8d,'projectId':_0x1999f5,'site':_0x55eaf1[_0x5ed24a(0x1dc)],'noEval':![],'evaluatorId':_0x55af4f,'onRoundStart':(_0x3d07a1,_0x515b4d)=>{const _0xd55905=_0x5ed24a;_0x4c74fa[_0xd55905(0x19a)]=_0xd55905(0x1b8)+(_0x3d07a1+0x1)+'/'+_0x515b4d+_0xd55905(0x1d1);},'onRoundComplete':(_0x35faec,_0x13fdb0,_0x3c9142)=>{const _0x32ab6e=_0x5ed24a,_0x3ab0f5=formatElapsed(_0x13fdb0);_0x3c9142?console[_0x32ab6e(0x20a)](_0x32ab6e(0x1a4)+(_0x35faec+0x1)+'/'+_0x1fd4e1[_0x32ab6e(0x221)][_0x32ab6e(0x1ba)]+_0x32ab6e(0x218)+a5_0x5dc5a7['green']('✓')+'\x20('+_0x3ab0f5+')'):console[_0x32ab6e(0x20a)](_0x32ab6e(0x1a4)+(_0x35faec+0x1)+'/'+_0x1fd4e1[_0x32ab6e(0x221)][_0x32ab6e(0x1ba)]+_0x32ab6e(0x218)+a5_0x5dc5a7[_0x32ab6e(0x198)]('✗'));},'onEvaluationStart':()=>{const _0x4946bc=_0x5ed24a;_0x4c74fa[_0x4946bc(0x19a)]=_0x4946bc(0x1f6);},'onEvaluationComplete':_0x4d02ee=>{const _0x5d7398=_0x5ed24a,_0x3b4ad6=formatElapsed(_0x4d02ee);console[_0x5d7398(0x20a)](_0x5d7398(0x1da)+a5_0x5dc5a7['green']('✓')+'\x20('+_0x3b4ad6+')');}});_0x4c74fa[_0x5ed24a(0x1ab)](),_0x1c98ff['push'](_0x50464c);if(_0x50464c[_0x5ed24a(0x1b4)]===_0x5ed24a(0x1c4))console['log'](a5_0x5dc5a7[_0x5ed24a(0x1ed)](_0x5ed24a(0x211)+_0x50464c[_0x5ed24a(0x1ce)])+a5_0x5dc5a7[_0x5ed24a(0x22a)](_0x5ed24a(0x200)));else _0x50464c[_0x5ed24a(0x1b4)]===_0x5ed24a(0x228)?console[_0x5ed24a(0x20a)](a5_0x5dc5a7[_0x5ed24a(0x198)](_0x5ed24a(0x1eb)+_0x50464c[_0x5ed24a(0x1ce)])+a5_0x5dc5a7['dim'](_0x5ed24a(0x200))):console['log'](a5_0x5dc5a7['red'](_0x5ed24a(0x1d3)+_0x50464c['reason']));_0x50464c[_0x5ed24a(0x213)]&&console[_0x5ed24a(0x20a)](a5_0x5dc5a7['dim'](_0x5ed24a(0x1e0)+_0x50464c['conversation_url']));}catch(_0x46cb63){_0x4c74fa[_0x5ed24a(0x1ab)]();const _0x5cced1=_0x46cb63 instanceof Error?_0x46cb63[_0x5ed24a(0x20c)]:String(_0x46cb63);console[_0x5ed24a(0x20a)](a5_0x5dc5a7['red'](_0x5ed24a(0x1d3)+_0x5cced1)),_0x1c98ff[_0x5ed24a(0x223)]({'name':_0x1fd4e1[_0x5ed24a(0x219)],'status':_0x5ed24a(0x1fe),'reason':_0x5cced1,'timestamp':new Date()[_0x5ed24a(0x19d)](),'duration_ms':0x0});}}}console[_0x5ed24a(0x20a)]();const _0x4a6095=Date[_0x5ed24a(0x207)]()-_0x304c1c,_0x4371f3=_0x1c98ff[_0x5ed24a(0x1e6)](_0x3d974c=>_0x3d974c[_0x5ed24a(0x1b4)]===_0x5ed24a(0x1c4))[_0x5ed24a(0x1ba)],_0x3c9653=_0x1c98ff[_0x5ed24a(0x1e6)](_0x2de905=>_0x2de905[_0x5ed24a(0x1b4)]==='FAIL')['length'],_0x14d57f=_0x1c98ff['filter'](_0x353f91=>_0x353f91[_0x5ed24a(0x1b4)]===_0x5ed24a(0x1fe))[_0x5ed24a(0x1ba)];console['log']('━'[_0x5ed24a(0x19c)](0x3c)),console[_0x5ed24a(0x20a)](_0x5ed24a(0x1e5)),console[_0x5ed24a(0x20a)]('━'[_0x5ed24a(0x19c)](0x3c)),console[_0x5ed24a(0x20a)]('Total:\x20\x20\x20\x20'+_0x1c98ff[_0x5ed24a(0x1ba)]),console['log'](_0x5ed24a(0x199)+a5_0x5dc5a7['green'](_0x4371f3)),console['log'](_0x5ed24a(0x1d4)+a5_0x5dc5a7[_0x5ed24a(0x198)](_0x3c9653));_0x14d57f>0x0&&console['log'](_0x5ed24a(0x1ec)+a5_0x5dc5a7[_0x5ed24a(0x198)](_0x14d57f));console[_0x5ed24a(0x20a)](_0x5ed24a(0x1d9)+formatElapsed(_0x4a6095)),console[_0x5ed24a(0x20a)]('━'['repeat'](0x3c));const _0x3b3c0d={'summary':{'total':_0x1c98ff[_0x5ed24a(0x1ba)],'passed':_0x4371f3,'failed':_0x3c9653,'errors':_0x14d57f>0x0?_0x14d57f:undefined,'duration_ms':_0x4a6095},'tests':_0x1c98ff,'agent':{'project':_0x4b48c7[_0x5ed24a(0x1d2)],'name':_0x4b48c7['agentName'],'site':_0x4269da},'timestamp':new Date(_0x304c1c)[_0x5ed24a(0x19d)]()};if(_0x2fc1e6!==_0x5ed24a(0x1e9)||_0x3766dc){const _0xcfc306=formatResults(_0x3b3c0d,_0x2fc1e6);if(_0x3766dc)try{a5_0x450a1f['writeFileSync'](_0x3766dc,_0xcfc306,_0x5ed24a(0x1e8)),console['log'](),console['log'](a5_0x5dc5a7[_0x5ed24a(0x22a)]('Output\x20written\x20to:\x20'+_0x3766dc));}catch(_0x1443fd){return console[_0x5ed24a(0x20a)](),console[_0x5ed24a(0x20a)](a5_0x5dc5a7[_0x5ed24a(0x198)](_0x5ed24a(0x217)+_0x1443fd)),0x1;}else console[_0x5ed24a(0x20a)](),console[_0x5ed24a(0x20a)](_0xcfc306);}const _0x421ebe=_0x1c98ff[_0x5ed24a(0x1e6)](_0x12c7a9=>_0x12c7a9[_0x5ed24a(0x1b4)]!==_0x5ed24a(0x1c4));return _0x421ebe['length']>0x0?0x1:0x0;}}
1
+ const a5_0x348df7=a5_0x422d;(function(_0x23d3bd,_0x45bdf9){const _0xf6772a=a5_0x422d,_0x2f7d4a=_0x23d3bd();while(!![]){try{const _0x5cc2d3=parseInt(_0xf6772a(0x168))/0x1+-parseInt(_0xf6772a(0x117))/0x2*(-parseInt(_0xf6772a(0x106))/0x3)+parseInt(_0xf6772a(0x103))/0x4+parseInt(_0xf6772a(0x17b))/0x5*(parseInt(_0xf6772a(0x170))/0x6)+-parseInt(_0xf6772a(0x119))/0x7*(parseInt(_0xf6772a(0x133))/0x8)+-parseInt(_0xf6772a(0x167))/0x9*(parseInt(_0xf6772a(0x13e))/0xa)+-parseInt(_0xf6772a(0x146))/0xb*(parseInt(_0xf6772a(0x134))/0xc);if(_0x5cc2d3===_0x45bdf9)break;else _0x2f7d4a['push'](_0x2f7d4a['shift']());}catch(_0xf32e71){_0x2f7d4a['push'](_0x2f7d4a['shift']());}}}(a5_0x829b,0x68952));import*as a5_0x1fa2e3 from'node:fs';import*as a5_0x496d65 from'node:path';import a5_0x312754 from'chalk';import{BaseCommand}from'./command.js';function a5_0x422d(_0x16be6e,_0x2dc89f){_0x16be6e=_0x16be6e-0xea;const _0x829bb9=a5_0x829b();let _0x422d77=_0x829bb9[_0x16be6e];return _0x422d77;}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x829b(){const _0x4823b1=['agent','Re-evaluating\x20cached\x20test\x20run...','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','resolve','find','agentName','execute','stop','red','Executing\x20new\x20tests...','Round\x20','459212tRmhfN','conversation_url','Failed:\x20\x20\x20','16929bXjEMr','Error\x20writing\x20output\x20file:\x20','ERROR','\x20\x20Round\x20','json','Agent:\x20','Running\x20agent\x20tests...','tsv','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Test\x20Configuration:','white','cyan','site','llm','PASS','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Site:\x20','262Mtvkqt','no_context','14eJhTSd','\x20(cached)','now','executeReeval','resolveProjectId','length','Tests\x20found:\x20','green','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','FAIL','✗\x20ERROR:\x20','Total:\x20\x20\x20\x20','context','yellow','Evaluating\x20response...','Re-evaluation\x20Summary','no_local_folder','tags','Run\x20\x27tdx\x20agent\x20pull\x20','testYmlPath','\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','✓\x20PASS:\x20','toISOString','includes','/<agent-name>','reason','373064tQVqxs','12iYXKFP','resolveAgentId','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','source','projectDir','Conversation\x20URL:\x20','\x20\x20Project:\x20','message','Usage:','start','1430OiYFFy','\x20\x20Site:\x20','Re-evaluating\x20','Either\x20switch\x20to\x20the\x20\x22','tests','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','\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)','repeat','15985717TOlNuu','basename','Output\x20written\x20to:\x20','text','No\x20tests\x20have\x20tags\x20defined.','dim','filter','split','Using\x20agent:\x20','Running\x20test:\x20','has','Cached\x20run\x20is\x20from\x20site\x20\x22','join','Round\x201/','size','Passed:\x20\x20\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Errors:\x20\x20\x20','verbose','push','jsonl','Failed\x20Tests:','404','reeval','✗\x20ERROR:\x20Project\x20not\x20found:\x20','projectName','✗\x20FAIL:\x20','log','rounds','Available\x20tests:\x20','\x20-\x20','existsSync','New\x20tests\x20to\x20execute:\x20','6759nCUQlI','447110rfghdp','trim','utf-8','name','status','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','420GIcWmd','table','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Error:\x20No\x20previous\x20test\x20run\x20found.','agentDirs','...\x20','multiple_agents','toLowerCase',':\x20Sending\x20user\x20input...','some','...','55795BuGWea','Test\x20','\x20(new)','\x27\x20to\x20create\x20the\x20folder\x20structure.','forEach','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x22:\x20','\x20\x20-\x20','\x20\x20Evaluating...\x20','llmProject','writeFileSync','Test\x20Summary','Cached\x20run\x20from:\x20','Running:\x20','\x20\x20Conversation:\x20','add','\x20\x20Agent:\x20'];a5_0x829b=function(){return _0x4823b1;};return a5_0x829b();}export class AgentTestCommand extends BaseCommand{[a5_0x348df7(0x16b)]='agent:test';['description']='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x348df7(0xfe)](_0x161c02){const _0x4cfe3f=a5_0x348df7,{options:_0x2c20fc,args:_0x227f93,tdx:_0x4f4ecb}=_0x161c02,_0x160634=_0x227f93[0x0]||'.',_0x48f8f4=_0x2c20fc['dryRun'],_0x27523d=_0x2c20fc,_0x3e0617=_0x27523d['eval']===![],_0x3f8618=_0x27523d[_0x4cfe3f(0x15d)],_0x4b0c48=_0x27523d[_0x4cfe3f(0x16b)],_0x5bd9c8=_0x27523d[_0x4cfe3f(0x12a)],_0x451c73=_0x2c20fc['site'],_0x4a8abf=_0x27523d['output'];if(_0x3f8618&&_0x3e0617)return console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x156))),0x1;let _0x11b36b=_0x4cfe3f(0x171);if(_0x27523d[_0x4cfe3f(0x10a)])_0x11b36b='json';else{if(_0x27523d[_0x4cfe3f(0x15a)])_0x11b36b=_0x4cfe3f(0x15a);else{if(_0x27523d[_0x4cfe3f(0x10d)])_0x11b36b=_0x4cfe3f(0x10d);else{if(_0x27523d[_0x4cfe3f(0x171)])_0x11b36b='table';}}}const _0x34db8f=_0x27523d[_0x4cfe3f(0xf0)];let _0x4a301a=_0x160634;const _0x3a2a1e=a5_0x1fa2e3[_0x4cfe3f(0x165)](_0x160634),_0x5c01b9=_0x160634==='.';if(!_0x3a2a1e||_0x5c01b9){const _0xd004b0=resolveProjectFromContext(_0x160634,_0x34db8f,{'requireFile':'test.yml'});if(_0xd004b0['found'])_0x4a301a=_0xd004b0['projectDir'],_0xd004b0[_0x4cfe3f(0x137)]===_0x4cfe3f(0x125)&&console['log'](a5_0x312754[_0x4cfe3f(0x14b)](_0x4cfe3f(0x14e)+_0x4a301a));else switch(_0xd004b0['reason']){case _0x4cfe3f(0x118):console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x126)](_0xd004b0['message'])),console[_0x4cfe3f(0x161)](),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x13c)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x12d)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x144)),console[_0x4cfe3f(0x161)](),console['log'](_0x4cfe3f(0xec));return 0x1;case _0x4cfe3f(0x129):console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x126)](_0xd004b0[_0x4cfe3f(0x13b)])),console['log'](),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x12b)+_0xd004b0['llmProject']+_0x4cfe3f(0xea));return 0x1;case _0x4cfe3f(0x176):{const _0x213ef9=a5_0x496d65[_0x4cfe3f(0x147)](_0xd004b0[_0x4cfe3f(0x138)]);console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x126)](_0x4cfe3f(0x16d)+_0xd004b0['llmProject']+'\x22:'));for(const _0x1d43ff of _0xd004b0[_0x4cfe3f(0x174)]){console[_0x4cfe3f(0x161)](_0x4cfe3f(0xee)+_0x1d43ff);}return console['log'](),console[_0x4cfe3f(0x161)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x213ef9+_0x4cfe3f(0x131)),0x1;}case'no_tests':console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x126)](_0x4cfe3f(0x16e)+_0xd004b0[_0x4cfe3f(0xf0)]+'\x22.')),console[_0x4cfe3f(0x161)](a5_0x312754['dim']('Project\x20path:\x20'+_0xd004b0['projectDir'])),console[_0x4cfe3f(0x161)](),console[_0x4cfe3f(0x161)](_0x4cfe3f(0xfa));return 0x1;}}const {definition:_0xb5e38a,agentInfo:_0x18072c}=parseTestFile(_0x4a301a);let _0x363b6a=_0xb5e38a[_0x4cfe3f(0x142)];if(_0x4b0c48){const _0x5b9561=_0x4b0c48[_0x4cfe3f(0x14d)](',')['map'](_0x2db06b=>_0x2db06b[_0x4cfe3f(0x169)]());_0x363b6a=_0xb5e38a[_0x4cfe3f(0x142)]['filter'](_0x2ed19c=>_0x5b9561['includes'](_0x2ed19c['name']));if(_0x363b6a[_0x4cfe3f(0x11e)]===0x0)return console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x126)]('No\x20tests\x20found\x20matching:\x20'+_0x4b0c48)),console['log'](a5_0x312754[_0x4cfe3f(0x14b)](_0x4cfe3f(0x163)+_0xb5e38a[_0x4cfe3f(0x142)]['map'](_0x1b15bc=>_0x1b15bc[_0x4cfe3f(0x16b)])[_0x4cfe3f(0x152)](',\x20'))),0x1;}if(_0x5bd9c8){const _0x4af7e2=_0x5bd9c8[_0x4cfe3f(0x14d)](',')['map'](_0x5ce645=>_0x5ce645['trim']()[_0x4cfe3f(0x177)]());_0x363b6a=_0x363b6a[_0x4cfe3f(0x14c)](_0x1819d6=>_0x1819d6['tags']?.[_0x4cfe3f(0x179)](_0x25bede=>_0x4af7e2[_0x4cfe3f(0x130)](_0x25bede[_0x4cfe3f(0x177)]())));if(_0x363b6a[_0x4cfe3f(0x11e)]===0x0){console['log'](a5_0x312754[_0x4cfe3f(0x126)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x5bd9c8));const _0x1cef2a=new Set();return _0xb5e38a[_0x4cfe3f(0x142)]['forEach'](_0x20933c=>_0x20933c[_0x4cfe3f(0x12a)]?.[_0x4cfe3f(0xeb)](_0x706f04=>_0x1cef2a[_0x4cfe3f(0xf6)](_0x706f04))),_0x1cef2a[_0x4cfe3f(0x154)]>0x0?console['log'](a5_0x312754[_0x4cfe3f(0x14b)]('Available\x20tags:\x20'+[..._0x1cef2a][_0x4cfe3f(0x152)](',\x20'))):console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x14b)](_0x4cfe3f(0x14a))),0x1;}}if(_0x3f8618)return this[_0x4cfe3f(0x11c)](_0x161c02,{'definition':{'tests':_0x363b6a},'agentInfo':_0x18072c,'outputFormat':_0x11b36b,'outputFile':_0x4a8abf,'testNames':_0x4b0c48});if(_0x48f8f4){console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x111)](_0x4cfe3f(0x10f))),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x13f)+a5_0x312754[_0x4cfe3f(0x110)](_0x451c73)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x13a)+a5_0x312754[_0x4cfe3f(0x110)](_0x18072c['projectName'])),console[_0x4cfe3f(0x161)](_0x4cfe3f(0xf7)+a5_0x312754[_0x4cfe3f(0x110)](_0x18072c[_0x4cfe3f(0xfd)])),console[_0x4cfe3f(0x161)](),console['log'](_0x4cfe3f(0x11f)+a5_0x312754['white'](_0x363b6a['length']));for(let _0x289caa=0x0;_0x289caa<_0x363b6a[_0x4cfe3f(0x11e)];_0x289caa++){const _0x53e376=_0x363b6a[_0x289caa],_0xfb927e=_0x53e376['rounds']['length']===0x1?'round':_0x4cfe3f(0x162),_0x239906=_0x53e376[_0x4cfe3f(0x12a)]?.[_0x4cfe3f(0x11e)]?'\x20['+_0x53e376[_0x4cfe3f(0x12a)][_0x4cfe3f(0x152)](',\x20')+']':'';console['log']('\x20\x20'+(_0x289caa+0x1)+'.\x20'+a5_0x312754[_0x4cfe3f(0x110)](_0x53e376['name'])+'\x20('+_0x53e376['rounds'][_0x4cfe3f(0x11e)]+'\x20'+_0xfb927e+')'+a5_0x312754['dim'](_0x239906));}return 0x0;}let _0x5c09ed,_0xeb5bf0;try{_0x5c09ed=await _0x4f4ecb[_0x4cfe3f(0x113)][_0x4cfe3f(0x11d)](_0x18072c['projectName']);}catch(_0x1cfcc4){const _0xb2dd55=_0x1cfcc4 instanceof Error?_0x1cfcc4[_0x4cfe3f(0x13b)]:String(_0x1cfcc4);return _0xb2dd55[_0x4cfe3f(0x130)]('404')||_0xb2dd55[_0x4cfe3f(0x177)]()[_0x4cfe3f(0x130)]('not\x20found')?console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x15e)+_0x18072c[_0x4cfe3f(0x15f)])):console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x18072c[_0x4cfe3f(0x15f)]+_0x4cfe3f(0xed)+_0xb2dd55)),0x1;}try{_0xeb5bf0=await _0x4f4ecb[_0x4cfe3f(0x113)][_0x4cfe3f(0x135)](_0x18072c[_0x4cfe3f(0xfd)],_0x5c09ed);}catch(_0x399a24){const _0xde00ff=_0x399a24 instanceof Error?_0x399a24[_0x4cfe3f(0x13b)]:String(_0x399a24);return _0xde00ff[_0x4cfe3f(0x130)](_0x4cfe3f(0x15c))||_0xde00ff[_0x4cfe3f(0x177)]()[_0x4cfe3f(0x130)]('not\x20found')?console['log'](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x10e)+_0x18072c['agentName'])):console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x16f)+_0x18072c[_0x4cfe3f(0xfd)]+'\x22:\x20'+_0xde00ff)),0x1;}let _0x25f3b2;if(!_0x3e0617)try{_0x25f3b2=await setupEvaluatorAgent(_0x4f4ecb['llm'],_0x2c20fc[_0x4cfe3f(0x158)]);}catch(_0x22efea){const _0x460bab=_0x22efea instanceof Error?_0x22efea['message']:String(_0x22efea);return console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x115)+_0x460bab)),0x1;}console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x111)](_0x4cfe3f(0x10c))),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x116)+a5_0x312754[_0x4cfe3f(0x110)](_0x451c73)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x10b)+a5_0x312754['white'](_0x18072c[_0x4cfe3f(0x15f)]+'/'+_0x18072c[_0x4cfe3f(0xfd)])),console[_0x4cfe3f(0x161)]();const _0x17c0a5=[],_0x2cd05d=[],_0xc6d242=Date[_0x4cfe3f(0x11b)]();for(let _0x317740=0x0;_0x317740<_0x363b6a['length'];_0x317740++){const _0x9c2e7c=_0x363b6a[_0x317740];_0x363b6a[_0x4cfe3f(0x11e)]>0x1?console['log'](_0x4cfe3f(0x17c)+(_0x317740+0x1)+'/'+_0x363b6a[_0x4cfe3f(0x11e)]+':\x20'+a5_0x312754[_0x4cfe3f(0x110)](_0x9c2e7c[_0x4cfe3f(0x16b)])):console[_0x4cfe3f(0x161)](_0x4cfe3f(0x14f)+a5_0x312754['white'](_0x9c2e7c[_0x4cfe3f(0x16b)]));const _0x4b8d3d=createCommandSpinner(_0x4cfe3f(0x153)+_0x9c2e7c[_0x4cfe3f(0x162)][_0x4cfe3f(0x11e)]+_0x4cfe3f(0x178));_0x4b8d3d['start']();try{const {result:_0x57a4f0,conversation:_0x156b7a}=await runTest(_0x4f4ecb['llm'],_0x9c2e7c,{'agentId':_0xeb5bf0,'projectId':_0x5c09ed,'site':_0x451c73,'noEval':_0x3e0617,'evaluatorId':_0x25f3b2,'onRoundStart':(_0x51c624,_0x42db25)=>{const _0x1ffc1a=_0x4cfe3f;_0x4b8d3d[_0x1ffc1a(0x149)]='Round\x20'+(_0x51c624+0x1)+'/'+_0x42db25+_0x1ffc1a(0x178);},'onRoundComplete':(_0x383afd,_0x560e1a,_0x1e52c3)=>{const _0x4908c2=_0x4cfe3f,_0x2f9226=formatElapsed(_0x560e1a);_0x1e52c3?console['log'](_0x4908c2(0x109)+(_0x383afd+0x1)+'/'+_0x9c2e7c[_0x4908c2(0x162)]['length']+'...\x20'+a5_0x312754[_0x4908c2(0x120)]('✓')+'\x20('+_0x2f9226+')'):console[_0x4908c2(0x161)](_0x4908c2(0x109)+(_0x383afd+0x1)+'/'+_0x9c2e7c[_0x4908c2(0x162)][_0x4908c2(0x11e)]+_0x4908c2(0x175)+a5_0x312754['red']('✗'));},'onEvaluationStart':()=>{const _0x4eee76=_0x4cfe3f;_0x4b8d3d[_0x4eee76(0x149)]=_0x4eee76(0x127);},'onEvaluationComplete':_0x5eeba4=>{const _0x40d7f8=_0x4cfe3f,_0xcfbf2=formatElapsed(_0x5eeba4);console[_0x40d7f8(0x161)]('\x20\x20Evaluating...\x20'+a5_0x312754[_0x40d7f8(0x120)]('✓')+'\x20('+_0xcfbf2+')');}});_0x4b8d3d[_0x4cfe3f(0xff)](),_0x17c0a5['push'](_0x57a4f0),_0x2cd05d[_0x4cfe3f(0x159)](_0x156b7a);if(_0x57a4f0[_0x4cfe3f(0x16c)]===_0x4cfe3f(0x114))console[_0x4cfe3f(0x161)](a5_0x312754['green'](_0x4cfe3f(0x12e)+_0x57a4f0[_0x4cfe3f(0x132)]));else _0x57a4f0[_0x4cfe3f(0x16c)]===_0x4cfe3f(0x122)?console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x160)+_0x57a4f0[_0x4cfe3f(0x132)])):console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)]('✗\x20ERROR:\x20'+_0x57a4f0[_0x4cfe3f(0x132)]));_0x57a4f0[_0x4cfe3f(0x104)]&&console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x14b)](_0x4cfe3f(0x139)+_0x57a4f0[_0x4cfe3f(0x104)])),console[_0x4cfe3f(0x161)]();}catch(_0x26afc6){_0x4b8d3d[_0x4cfe3f(0xff)]();const _0x24a63f=_0x26afc6 instanceof Error?_0x26afc6[_0x4cfe3f(0x13b)]:String(_0x26afc6);console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x123)+_0x24a63f)),console[_0x4cfe3f(0x161)](),_0x17c0a5[_0x4cfe3f(0x159)]({'name':_0x9c2e7c[_0x4cfe3f(0x16b)],'status':_0x4cfe3f(0x108),'reason':_0x24a63f,'timestamp':new Date()[_0x4cfe3f(0x12f)](),'duration_ms':0x0});}}const _0x4a000c=Date[_0x4cfe3f(0x11b)]()-_0xc6d242,_0x2245be=_0x17c0a5['filter'](_0x3dedd5=>_0x3dedd5[_0x4cfe3f(0x16c)]===_0x4cfe3f(0x114))[_0x4cfe3f(0x11e)],_0x3a827b=_0x17c0a5['filter'](_0x1ab91a=>_0x1ab91a[_0x4cfe3f(0x16c)]===_0x4cfe3f(0x122))[_0x4cfe3f(0x11e)],_0x5aa4a7=_0x17c0a5['filter'](_0x38f685=>_0x38f685['status']===_0x4cfe3f(0x108))[_0x4cfe3f(0x11e)];console['log']('━'['repeat'](0x3c)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0xf2)),console[_0x4cfe3f(0x161)]('━'[_0x4cfe3f(0x145)](0x3c)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x124)+_0x17c0a5[_0x4cfe3f(0x11e)]),console['log'](_0x4cfe3f(0x155)+a5_0x312754[_0x4cfe3f(0x120)](_0x2245be)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x105)+a5_0x312754['red'](_0x3a827b));_0x5aa4a7>0x0&&console['log'](_0x4cfe3f(0x157)+a5_0x312754['red'](_0x5aa4a7));console[_0x4cfe3f(0x161)]('Duration:\x20'+formatElapsed(_0x4a000c)),console[_0x4cfe3f(0x161)]('━'[_0x4cfe3f(0x145)](0x3c));const _0x4f3ce8=_0x17c0a5['filter'](_0x481040=>_0x481040[_0x4cfe3f(0x16c)]!=='PASS');if(_0x4f3ce8[_0x4cfe3f(0x11e)]>0x0){console['log'](),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x15b));for(const _0x118786 of _0x4f3ce8){const _0x2fa525=a5_0x312754['red']('✗'),_0x205567=_0x118786[_0x4cfe3f(0x132)][_0x4cfe3f(0x11e)]>0x32?_0x118786[_0x4cfe3f(0x132)]['substring'](0x0,0x32)+_0x4cfe3f(0x17a):_0x118786[_0x4cfe3f(0x132)];console[_0x4cfe3f(0x161)]('\x20\x20'+_0x2fa525+'\x20'+_0x118786[_0x4cfe3f(0x16b)]+':\x20'+_0x205567);}}const _0x36b878={'summary':{'total':_0x17c0a5['length'],'passed':_0x2245be,'failed':_0x3a827b,'errors':_0x5aa4a7>0x0?_0x5aa4a7:undefined,'duration_ms':_0x4a000c},'tests':_0x17c0a5,'agent':{'project':_0x18072c[_0x4cfe3f(0x15f)],'name':_0x18072c[_0x4cfe3f(0xfd)],'site':_0x451c73},'timestamp':new Date(_0xc6d242)[_0x4cfe3f(0x12f)]()};try{const _0x4105a2=buildCachedTestRun(_0x2cd05d,{'site':_0x451c73,'projectId':_0x5c09ed,'projectName':_0x18072c['projectName'],'agentId':_0xeb5bf0,'agentName':_0x18072c[_0x4cfe3f(0xfd)],'testYmlPath':a5_0x496d65[_0x4cfe3f(0xfb)](_0x18072c[_0x4cfe3f(0x12c)])});saveLastTestRun(_0x4105a2);}catch{}if(_0x11b36b!=='table'||_0x4a8abf){const _0x5a0c8d=formatResults(_0x36b878,_0x11b36b);if(_0x4a8abf)try{a5_0x1fa2e3[_0x4cfe3f(0xf1)](_0x4a8abf,_0x5a0c8d,_0x4cfe3f(0x16a)),console[_0x4cfe3f(0x161)](),console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x14b)](_0x4cfe3f(0x148)+_0x4a8abf));}catch(_0x215e1e){return console[_0x4cfe3f(0x161)](),console[_0x4cfe3f(0x161)](a5_0x312754['red'](_0x4cfe3f(0x107)+_0x215e1e)),0x1;}else console[_0x4cfe3f(0x161)](),console['log'](_0x5a0c8d);}return _0x4f3ce8['length']>0x0?0x1:0x0;}async['executeReeval'](_0x3c49a7,_0x3ab7f0){const _0x5023e6=a5_0x348df7,{options:_0x40fe57,tdx:_0x313e42}=_0x3c49a7,{definition:_0x40cdda,agentInfo:_0x2e9a88,outputFormat:_0x1c6bba,outputFile:_0x989c7a}=_0x3ab7f0,_0x41299c=_0x40fe57[_0x5023e6(0x112)],_0x509907=loadLastTestRun();if(!_0x509907)return console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x100)](_0x5023e6(0x173))),console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x14b)](_0x5023e6(0x121))),0x1;if(_0x509907[_0x5023e6(0xf8)][_0x5023e6(0xfd)]!==_0x2e9a88[_0x5023e6(0xfd)])return console['log'](a5_0x312754[_0x5023e6(0x100)](_0x5023e6(0x136)+_0x509907[_0x5023e6(0xf8)][_0x5023e6(0xfd)]+_0x5023e6(0x143)+_0x2e9a88['agentName']+'\x22.')),console[_0x5023e6(0x161)](a5_0x312754['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x223523=new Set(_0x509907['conversations']['map'](_0x4c624c=>_0x4c624c['testName'])),_0x4b4da9=_0x40cdda['tests']['filter'](_0x3facc5=>!_0x223523[_0x5023e6(0x150)](_0x3facc5[_0x5023e6(0x16b)]));if(_0x4b4da9['length']>0x0&&_0x509907[_0x5023e6(0x112)]!==_0x41299c)return console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x100)](_0x5023e6(0x172))),console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x14b)](_0x5023e6(0x151)+_0x509907[_0x5023e6(0x112)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x41299c+'\x22.')),console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x14b)](_0x5023e6(0x141)+_0x509907[_0x5023e6(0x112)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x4c6e56=_0x40cdda[_0x5023e6(0x142)][_0x5023e6(0x14c)](_0x1e634d=>_0x223523[_0x5023e6(0x150)](_0x1e634d[_0x5023e6(0x16b)])),_0x4e9804=_0x4b4da9;let _0x196bd4;try{_0x196bd4=await setupEvaluatorAgent(_0x313e42[_0x5023e6(0x113)],_0x40fe57[_0x5023e6(0x158)]);}catch(_0xe228c3){const _0x2944ca=_0xe228c3 instanceof Error?_0xe228c3[_0x5023e6(0x13b)]:String(_0xe228c3);return console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x100)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x2944ca)),0x1;}console[_0x5023e6(0x161)](a5_0x312754['cyan'](_0x5023e6(0xf9))),console[_0x5023e6(0x161)](_0x5023e6(0xf3)+a5_0x312754[_0x5023e6(0x110)](_0x509907['timestamp'])),console['log'](_0x5023e6(0x10b)+a5_0x312754[_0x5023e6(0x110)](_0x509907['agent'][_0x5023e6(0x15f)]+'/'+_0x509907[_0x5023e6(0xf8)][_0x5023e6(0xfd)]));_0x4e9804[_0x5023e6(0x11e)]>0x0&&console[_0x5023e6(0x161)](_0x5023e6(0x166)+a5_0x312754['yellow'](_0x4e9804[_0x5023e6(0x11e)]));console[_0x5023e6(0x161)]();const _0x2a13c0=[],_0x51b17a=Date[_0x5023e6(0x11b)](),_0x1df9a4=createCommandSpinner('Re-evaluating...');if(_0x4c6e56[_0x5023e6(0x11e)]>0x0)try{const _0x52c754=await reevaluateFromCache(_0x313e42[_0x5023e6(0x113)],_0x509907,{'tests':_0x4c6e56},{'evaluatorId':_0x196bd4,'onTestStart':(_0x450e30,_0x4feb88,_0xef6ef2)=>{const _0x18c15c=_0x5023e6;_0x1df9a4[_0x18c15c(0x149)]=_0x18c15c(0x140)+(_0x4feb88+0x1)+'/'+_0xef6ef2+':\x20'+_0x450e30+_0x18c15c(0x17a);if(!_0x1df9a4['isSpinning'])_0x1df9a4[_0x18c15c(0x13d)]();},'onTestComplete':(_0x266293,_0x177f36)=>{const _0x53fedf=_0x5023e6;_0x1df9a4['stop']();if(_0x177f36[_0x53fedf(0x16c)]==='PASS')console[_0x53fedf(0x161)](a5_0x312754['green'](_0x53fedf(0x12e)+_0x266293)+a5_0x312754['dim'](_0x53fedf(0x11a)));else _0x177f36['status']===_0x53fedf(0x122)?console[_0x53fedf(0x161)](a5_0x312754[_0x53fedf(0x100)](_0x53fedf(0x160)+_0x266293+'\x20-\x20'+_0x177f36['reason'])+a5_0x312754[_0x53fedf(0x14b)]('\x20(cached)')):console['log'](a5_0x312754[_0x53fedf(0x100)](_0x53fedf(0x123)+_0x266293+_0x53fedf(0x164)+_0x177f36[_0x53fedf(0x132)]));_0x177f36[_0x53fedf(0x104)]&&console['log'](a5_0x312754[_0x53fedf(0x14b)]('\x20\x20Conversation:\x20'+_0x177f36[_0x53fedf(0x104)])),_0x2a13c0[_0x53fedf(0x159)](_0x177f36);},'onTestSkipped':(_0x14d5cd,_0x580f0d)=>{const _0x10c9c3=_0x5023e6;_0x1df9a4[_0x10c9c3(0xff)](),console[_0x10c9c3(0x161)](a5_0x312754['yellow']('⚠\x20SKIPPED:\x20'+_0x14d5cd+_0x10c9c3(0x164)+_0x580f0d));}});for(const _0x512605 of _0x52c754){!_0x2a13c0[_0x5023e6(0xfc)](_0x5b3fa2=>_0x5b3fa2['name']===_0x512605['name'])&&_0x2a13c0[_0x5023e6(0x159)](_0x512605);}}catch(_0x195137){_0x1df9a4[_0x5023e6(0xff)]();const _0x1ffc18=_0x195137 instanceof Error?_0x195137[_0x5023e6(0x13b)]:String(_0x195137);return console['log'](a5_0x312754['red']('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x1ffc18)),0x1;}_0x1df9a4[_0x5023e6(0xff)]();if(_0x4e9804[_0x5023e6(0x11e)]>0x0){console[_0x5023e6(0x161)](),console[_0x5023e6(0x161)](a5_0x312754['cyan'](_0x5023e6(0x101)));const {projectId:_0x260357,agentId:_0x1abb7b}=_0x509907['agent'];for(const _0x58cdec of _0x4e9804){console[_0x5023e6(0x161)](_0x5023e6(0xf4)+a5_0x312754['white'](_0x58cdec['name']));const _0x20cdef=createCommandSpinner(_0x5023e6(0x153)+_0x58cdec[_0x5023e6(0x162)][_0x5023e6(0x11e)]+_0x5023e6(0x178));_0x20cdef['start']();try{const {result:_0x922893}=await runTest(_0x313e42['llm'],_0x58cdec,{'agentId':_0x1abb7b,'projectId':_0x260357,'site':_0x509907[_0x5023e6(0x112)],'noEval':![],'evaluatorId':_0x196bd4,'onRoundStart':(_0x48a27c,_0x3b2840)=>{const _0x12abf6=_0x5023e6;_0x20cdef[_0x12abf6(0x149)]=_0x12abf6(0x102)+(_0x48a27c+0x1)+'/'+_0x3b2840+_0x12abf6(0x178);},'onRoundComplete':(_0xbe312e,_0x4fb5a2,_0x3e8979)=>{const _0x334580=_0x5023e6,_0x4d5982=formatElapsed(_0x4fb5a2);_0x3e8979?console[_0x334580(0x161)](_0x334580(0x109)+(_0xbe312e+0x1)+'/'+_0x58cdec['rounds']['length']+'...\x20'+a5_0x312754[_0x334580(0x120)]('✓')+'\x20('+_0x4d5982+')'):console[_0x334580(0x161)](_0x334580(0x109)+(_0xbe312e+0x1)+'/'+_0x58cdec[_0x334580(0x162)][_0x334580(0x11e)]+_0x334580(0x175)+a5_0x312754['red']('✗'));},'onEvaluationStart':()=>{const _0x2443c4=_0x5023e6;_0x20cdef[_0x2443c4(0x149)]='Evaluating\x20response...';},'onEvaluationComplete':_0x31d042=>{const _0x3cb182=_0x5023e6,_0x67605c=formatElapsed(_0x31d042);console[_0x3cb182(0x161)](_0x3cb182(0xef)+a5_0x312754[_0x3cb182(0x120)]('✓')+'\x20('+_0x67605c+')');}});_0x20cdef['stop'](),_0x2a13c0[_0x5023e6(0x159)](_0x922893);if(_0x922893[_0x5023e6(0x16c)]===_0x5023e6(0x114))console[_0x5023e6(0x161)](a5_0x312754['green']('✓\x20PASS:\x20'+_0x922893[_0x5023e6(0x132)])+a5_0x312754['dim'](_0x5023e6(0x17d)));else _0x922893[_0x5023e6(0x16c)]===_0x5023e6(0x122)?console[_0x5023e6(0x161)](a5_0x312754['red'](_0x5023e6(0x160)+_0x922893[_0x5023e6(0x132)])+a5_0x312754['dim'](_0x5023e6(0x17d))):console['log'](a5_0x312754[_0x5023e6(0x100)](_0x5023e6(0x123)+_0x922893[_0x5023e6(0x132)]));_0x922893[_0x5023e6(0x104)]&&console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x14b)](_0x5023e6(0xf5)+_0x922893[_0x5023e6(0x104)]));}catch(_0x3843e1){_0x20cdef[_0x5023e6(0xff)]();const _0x33cc33=_0x3843e1 instanceof Error?_0x3843e1[_0x5023e6(0x13b)]:String(_0x3843e1);console[_0x5023e6(0x161)](a5_0x312754['red'](_0x5023e6(0x123)+_0x33cc33)),_0x2a13c0[_0x5023e6(0x159)]({'name':_0x58cdec['name'],'status':_0x5023e6(0x108),'reason':_0x33cc33,'timestamp':new Date()[_0x5023e6(0x12f)](),'duration_ms':0x0});}}}console[_0x5023e6(0x161)]();const _0x2b61f5=Date[_0x5023e6(0x11b)]()-_0x51b17a,_0x1e4f02=_0x2a13c0[_0x5023e6(0x14c)](_0x5b1d81=>_0x5b1d81[_0x5023e6(0x16c)]===_0x5023e6(0x114))[_0x5023e6(0x11e)],_0x1f3c1e=_0x2a13c0[_0x5023e6(0x14c)](_0x3c1e6d=>_0x3c1e6d[_0x5023e6(0x16c)]===_0x5023e6(0x122))[_0x5023e6(0x11e)],_0x15650c=_0x2a13c0[_0x5023e6(0x14c)](_0x319faa=>_0x319faa[_0x5023e6(0x16c)]===_0x5023e6(0x108))['length'];console['log']('━'[_0x5023e6(0x145)](0x3c)),console[_0x5023e6(0x161)](_0x5023e6(0x128)),console['log']('━'[_0x5023e6(0x145)](0x3c)),console[_0x5023e6(0x161)](_0x5023e6(0x124)+_0x2a13c0['length']),console[_0x5023e6(0x161)](_0x5023e6(0x155)+a5_0x312754[_0x5023e6(0x120)](_0x1e4f02)),console['log'](_0x5023e6(0x105)+a5_0x312754['red'](_0x1f3c1e));_0x15650c>0x0&&console[_0x5023e6(0x161)](_0x5023e6(0x157)+a5_0x312754[_0x5023e6(0x100)](_0x15650c));console[_0x5023e6(0x161)]('Duration:\x20'+formatElapsed(_0x2b61f5)),console['log']('━'[_0x5023e6(0x145)](0x3c));const _0x4fef93={'summary':{'total':_0x2a13c0[_0x5023e6(0x11e)],'passed':_0x1e4f02,'failed':_0x1f3c1e,'errors':_0x15650c>0x0?_0x15650c:undefined,'duration_ms':_0x2b61f5},'tests':_0x2a13c0,'agent':{'project':_0x2e9a88['projectName'],'name':_0x2e9a88['agentName'],'site':_0x41299c},'timestamp':new Date(_0x51b17a)['toISOString']()};if(_0x1c6bba!==_0x5023e6(0x171)||_0x989c7a){const _0x55d43b=formatResults(_0x4fef93,_0x1c6bba);if(_0x989c7a)try{a5_0x1fa2e3[_0x5023e6(0xf1)](_0x989c7a,_0x55d43b,'utf-8'),console['log'](),console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x14b)](_0x5023e6(0x148)+_0x989c7a));}catch(_0x39c480){return console[_0x5023e6(0x161)](),console['log'](a5_0x312754['red'](_0x5023e6(0x107)+_0x39c480)),0x1;}else console['log'](),console[_0x5023e6(0x161)](_0x55d43b);}const _0x54d3fd=_0x2a13c0[_0x5023e6(0x14c)](_0x5c508f=>_0x5c508f['status']!==_0x5023e6(0x114));return _0x54d3fd['length']>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x232b42=a6_0x3881;(function(_0x412b77,_0x4969d9){const _0x1548b5=a6_0x3881,_0x3c68e2=_0x412b77();while(!![]){try{const _0x915ea7=parseInt(_0x1548b5(0x157))/0x1*(parseInt(_0x1548b5(0x13c))/0x2)+parseInt(_0x1548b5(0x15b))/0x3+parseInt(_0x1548b5(0x145))/0x4*(-parseInt(_0x1548b5(0x165))/0x5)+parseInt(_0x1548b5(0x151))/0x6*(-parseInt(_0x1548b5(0x16d))/0x7)+parseInt(_0x1548b5(0x153))/0x8*(-parseInt(_0x1548b5(0x139))/0x9)+-parseInt(_0x1548b5(0x137))/0xa+-parseInt(_0x1548b5(0x16a))/0xb*(-parseInt(_0x1548b5(0x152))/0xc);if(_0x915ea7===_0x4969d9)break;else _0x3c68e2['push'](_0x3c68e2['shift']());}catch(_0x4384ec){_0x3c68e2['push'](_0x3c68e2['shift']());}}}(a6_0x3fb9,0x49d32));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';function a6_0x3fb9(){const _0x4b85ef=['toLowerCase','stack','verbose','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','output','proxy-authorization','execute','log','40pNZHdx','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','cookie','entries','PUT','data','name','DELETE','set-cookie','noColor','authorization','indexOf','8988elFbDR','1442652rvmPCo','3503704YGPeWI','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','x-trino-user','color','13FNacdW','substring','has','\x22.\x20','1501323CqxeXP','Invalid\x20header\x20format:\x20\x22','length','site','\x0aStack\x20trace:\x0a','status','message','file','x-auth-token','join','231155yHOEtI','error','Error:\x20','body','method','88KnWQLD','set-cookie2','.\x20Valid\x20types:\x20','805ALctLw','.\x20Valid\x20methods:\x20','cdp','request','readBodyFromFile','trino','trim','GET','toUpperCase','Endpoint\x20must\x20start\x20with\x20/:\x20','3152090pdGFRS','headers','9YbyYoL','includes','llm','35066HNwQgz'];a6_0x3fb9=function(){return _0x4b85ef;};return a6_0x3fb9();}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x232b42(0x14f),a6_0x232b42(0x142),a6_0x232b42(0x147),a6_0x232b42(0x14d),a6_0x232b42(0x16b),'x-xsrf-token',a6_0x232b42(0x163),a6_0x232b42(0x155)]);function isSensitiveHeader(_0x1ce6ad){const _0x3fa447=a6_0x232b42;return SENSITIVE_HEADERS[_0x3fa447(0x159)](_0x1ce6ad[_0x3fa447(0x13d)]());}function parseHeader(_0x2f19a3){const _0x4235be=a6_0x232b42,_0x212089=_0x2f19a3[_0x4235be(0x150)](':');if(_0x212089===-0x1)throw new Error(_0x4235be(0x15c)+_0x2f19a3+_0x4235be(0x15a)+_0x4235be(0x140));const _0x5572a2=_0x2f19a3[_0x4235be(0x158)](0x0,_0x212089)[_0x4235be(0x133)](),_0x325a5d=_0x2f19a3[_0x4235be(0x158)](_0x212089+0x1)[_0x4235be(0x133)]();if(!_0x5572a2)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x2f19a3+'\x22');return[_0x5572a2,_0x325a5d];}function a6_0x3881(_0x1ae4d5,_0x12d0ae){_0x1ae4d5=_0x1ae4d5-0x130;const _0x3fb9c0=a6_0x3fb9();let _0x388144=_0x3fb9c0[_0x1ae4d5];return _0x388144;}export class ApiCommand extends BaseCommand{[a6_0x232b42(0x14b)]='api';['description']=a6_0x232b42(0x146);['validate'](_0x17d9c4){const _0xd263d3=a6_0x232b42,{args:_0x1db388,options:_0x442ea8}=_0x17d9c4,_0x14abfa=_0x442ea8;if(_0x1db388[_0xd263d3(0x15d)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x27290d=_0x1db388[0x0];if(!_0x27290d['startsWith']('/'))return _0xd263d3(0x136)+_0x27290d;const _0x2183cd=_0x14abfa['data'],_0xc6e1d4=_0x14abfa[_0xd263d3(0x162)];if(_0x2183cd&&_0xc6e1d4)return _0xd263d3(0x154);const _0x3e5084=_0x14abfa[_0xd263d3(0x169)]||_0xd263d3(0x134),_0x54e02a=['GET','POST',_0xd263d3(0x149),_0xd263d3(0x14c),'PATCH'];if(!_0x54e02a[_0xd263d3(0x13a)](_0x3e5084[_0xd263d3(0x135)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x3e5084+_0xd263d3(0x16e)+_0x54e02a[_0xd263d3(0x164)](',\x20');const _0x2bd5a5=_0x14abfa['type']||'td',_0x2d362d=['td',_0xd263d3(0x16f),'workflow',_0xd263d3(0x132),_0xd263d3(0x13b),'llm-proxy'];if(!_0x2d362d[_0xd263d3(0x13a)](_0x2bd5a5))return'Invalid\x20API\x20type:\x20'+_0x2bd5a5+_0xd263d3(0x16c)+_0x2d362d[_0xd263d3(0x164)](',\x20');return undefined;}async[a6_0x232b42(0x143)](_0x478bd6){const _0x23df8f=a6_0x232b42,{options:_0x54b618,args:_0x3a231c,tdx:_0x1b923f}=_0x478bd6,_0x31b697=_0x54b618,_0x4faa42=_0x3a231c[0x0],_0x57cf55=(_0x31b697[_0x23df8f(0x169)]||_0x23df8f(0x134))[_0x23df8f(0x135)](),_0x12813f=_0x31b697['data'],_0x12a9ae=_0x31b697['file'],_0xc5314b=_0x31b697['header'],_0x2d953a=_0x31b697['type']||'td';try{const _0x2ff99e={};if(_0xc5314b){const _0x48df20=Array['isArray'](_0xc5314b)?_0xc5314b:[_0xc5314b];for(const _0x8893dd of _0x48df20){const [_0x4bd399,_0x196df3]=parseHeader(_0x8893dd);_0x2ff99e[_0x4bd399]=_0x196df3;}}let _0x5b23a5;if(_0x12813f)_0x5b23a5=_0x12813f;else{if(_0x12a9ae)try{_0x5b23a5=RawAPI[_0x23df8f(0x131)](_0x12a9ae);}catch(_0x26bb27){return console[_0x23df8f(0x166)](_0x23df8f(0x167)+(_0x26bb27 instanceof Error?_0x26bb27['message']:String(_0x26bb27))),0x1;}}const _0x1c9c48={'method':_0x57cf55,'apiType':_0x2d953a,'includeHeaders':_0x54b618[_0x23df8f(0x13f)]};_0x5b23a5&&(_0x1c9c48[_0x23df8f(0x168)]=_0x5b23a5);Object['keys'](_0x2ff99e)[_0x23df8f(0x15d)]>0x0&&(_0x1c9c48[_0x23df8f(0x138)]=_0x2ff99e);if(_0x54b618[_0x23df8f(0x13f)]){const _0x5d9c01=resolveSite(_0x54b618[_0x23df8f(0x15e)]),_0x26c728=getEndpoint(_0x5d9c01,_0x2d953a),_0xea7ae3=''+_0x26c728+_0x4faa42;console[_0x23df8f(0x166)]('>\x20'+_0x57cf55+'\x20'+_0xea7ae3);const _0x1f3dae=getAuthHeaders(_0x5d9c01),_0xf3387={..._0x1f3dae,..._0x2ff99e};for(const [_0x1887b8,_0x4e7774]of Object['entries'](_0xf3387)){!isSensitiveHeader(_0x1887b8)&&console['error']('>\x20'+_0x1887b8+':\x20'+_0x4e7774);}_0x5b23a5&&console[_0x23df8f(0x166)]('>'),console[_0x23df8f(0x166)]('');}const _0x3158e2=await _0x1b923f['api'][_0x23df8f(0x130)](_0x4faa42,_0x1c9c48);if(_0x54b618['verbose']&&_0x3158e2[_0x23df8f(0x138)]){console[_0x23df8f(0x166)]('<\x20HTTP/1.1\x20'+_0x3158e2[_0x23df8f(0x160)]);for(const [_0x1845b5,_0x4bee97]of Object[_0x23df8f(0x148)](_0x3158e2[_0x23df8f(0x138)])){!isSensitiveHeader(_0x1845b5)&&console[_0x23df8f(0x166)]('<\x20'+_0x1845b5+':\x20'+_0x4bee97);}console[_0x23df8f(0x166)]('');}const _0x1a7a3a=Boolean(_0x54b618[_0x23df8f(0x141)]),_0x1d2612={'color':_0x54b618[_0x23df8f(0x156)],'noColor':_0x54b618[_0x23df8f(0x14e)]||_0x1a7a3a&&!_0x54b618['color']},_0x3645c6=colorizeJSON(_0x3158e2[_0x23df8f(0x14a)],_0x1d2612);return _0x54b618['output']?(writeFileSync(_0x54b618['output'],_0x3645c6),console[_0x23df8f(0x166)]('Results\x20saved\x20to\x20'+_0x54b618[_0x23df8f(0x141)])):console[_0x23df8f(0x144)](_0x3645c6),0x0;}catch(_0x1e3cbd){return _0x1e3cbd instanceof Error?(console[_0x23df8f(0x166)](_0x23df8f(0x167)+_0x1e3cbd[_0x23df8f(0x161)]),_0x54b618[_0x23df8f(0x13f)]&&_0x1e3cbd[_0x23df8f(0x13e)]&&console[_0x23df8f(0x166)](_0x23df8f(0x15f)+_0x1e3cbd['stack'])):console[_0x23df8f(0x166)]('Error:\x20'+String(_0x1e3cbd)),0x1;}}}
1
+ const a6_0x59f68b=a6_0x1849;(function(_0x3a635d,_0x8d2347){const _0x828eb7=a6_0x1849,_0x27151b=_0x3a635d();while(!![]){try{const _0x586856=parseInt(_0x828eb7(0x158))/0x1*(-parseInt(_0x828eb7(0x167))/0x2)+parseInt(_0x828eb7(0x163))/0x3+parseInt(_0x828eb7(0x16f))/0x4*(parseInt(_0x828eb7(0x15a))/0x5)+-parseInt(_0x828eb7(0x153))/0x6+parseInt(_0x828eb7(0x178))/0x7*(-parseInt(_0x828eb7(0x149))/0x8)+parseInt(_0x828eb7(0x17c))/0x9*(-parseInt(_0x828eb7(0x139))/0xa)+parseInt(_0x828eb7(0x16a))/0xb;if(_0x586856===_0x8d2347)break;else _0x27151b['push'](_0x27151b['shift']());}catch(_0x479468){_0x27151b['push'](_0x27151b['shift']());}}}(a6_0x240d,0x579c1));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';function a6_0x1849(_0x13f782,_0xee0204){_0x13f782=_0x13f782-0x138;const _0x240d32=a6_0x240d();let _0x184938=_0x240d32[_0x13f782];return _0x184938;}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x59f68b(0x159),a6_0x59f68b(0x152),'cookie',a6_0x59f68b(0x161),'set-cookie2','x-xsrf-token',a6_0x59f68b(0x13f),a6_0x59f68b(0x145)]);function isSensitiveHeader(_0xa3686b){const _0x56a2d2=a6_0x59f68b;return SENSITIVE_HEADERS[_0x56a2d2(0x172)](_0xa3686b[_0x56a2d2(0x160)]());}function parseHeader(_0x5b7fda){const _0x2333fb=a6_0x59f68b,_0x60013c=_0x5b7fda[_0x2333fb(0x174)](':');if(_0x60013c===-0x1)throw new Error(_0x2333fb(0x148)+_0x5b7fda+_0x2333fb(0x141)+_0x2333fb(0x14d));const _0x22c2ad=_0x5b7fda['substring'](0x0,_0x60013c)[_0x2333fb(0x165)](),_0x49dcc7=_0x5b7fda[_0x2333fb(0x164)](_0x60013c+0x1)['trim']();if(!_0x22c2ad)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x5b7fda+'\x22');return[_0x22c2ad,_0x49dcc7];}export class ApiCommand extends BaseCommand{[a6_0x59f68b(0x16d)]=a6_0x59f68b(0x142);[a6_0x59f68b(0x13c)]=a6_0x59f68b(0x169);['validate'](_0x4c8853){const _0x58f5fc=a6_0x59f68b,{args:_0xff4814,options:_0x53a523}=_0x4c8853,_0xce1590=_0x53a523;if(_0xff4814[_0x58f5fc(0x173)]===0x0)return _0x58f5fc(0x14b);const _0x2bb83e=_0xff4814[0x0];if(!_0x2bb83e[_0x58f5fc(0x140)]('/'))return _0x58f5fc(0x13e)+_0x2bb83e;const _0x30e98f=_0xce1590[_0x58f5fc(0x13b)],_0x466261=_0xce1590['file'];if(_0x30e98f&&_0x466261)return _0x58f5fc(0x177);const _0x4d478c=_0xce1590[_0x58f5fc(0x13d)]||_0x58f5fc(0x15f),_0x3a1270=['GET',_0x58f5fc(0x171),_0x58f5fc(0x14e),'DELETE',_0x58f5fc(0x17a)];if(!_0x3a1270[_0x58f5fc(0x154)](_0x4d478c[_0x58f5fc(0x14a)]()))return _0x58f5fc(0x151)+_0x4d478c+'.\x20Valid\x20methods:\x20'+_0x3a1270[_0x58f5fc(0x156)](',\x20');const _0x4f5118=_0xce1590[_0x58f5fc(0x15e)]||'td',_0x202ce0=['td',_0x58f5fc(0x162),_0x58f5fc(0x17b),_0x58f5fc(0x14c),_0x58f5fc(0x155),'llm-proxy'];if(!_0x202ce0[_0x58f5fc(0x154)](_0x4f5118))return _0x58f5fc(0x157)+_0x4f5118+_0x58f5fc(0x179)+_0x202ce0['join'](',\x20');return undefined;}async[a6_0x59f68b(0x170)](_0x5db8eb){const _0x112cd5=a6_0x59f68b,{options:_0x222644,args:_0x22d7a5,tdx:_0x56a97b}=_0x5db8eb,_0x49c5cd=_0x222644,_0x588981=_0x22d7a5[0x0],_0x48f21a=(_0x49c5cd[_0x112cd5(0x13d)]||_0x112cd5(0x15f))[_0x112cd5(0x14a)](),_0x176e80=_0x49c5cd[_0x112cd5(0x13b)],_0x334103=_0x49c5cd[_0x112cd5(0x146)],_0x518204=_0x49c5cd[_0x112cd5(0x168)],_0xbcbfb4=_0x49c5cd['type']||'td';try{const _0x434694={};if(_0x518204){const _0x26c16b=Array[_0x112cd5(0x150)](_0x518204)?_0x518204:[_0x518204];for(const _0x3c4358 of _0x26c16b){const [_0x12d0e1,_0x369257]=parseHeader(_0x3c4358);_0x434694[_0x12d0e1]=_0x369257;}}let _0x379c7b;if(_0x176e80)_0x379c7b=_0x176e80;else{if(_0x334103)try{_0x379c7b=RawAPI[_0x112cd5(0x15c)](_0x334103);}catch(_0x439d5b){return console[_0x112cd5(0x138)](_0x112cd5(0x15d)+(_0x439d5b instanceof Error?_0x439d5b[_0x112cd5(0x176)]:String(_0x439d5b))),0x1;}}const _0x738fda={'method':_0x48f21a,'apiType':_0xbcbfb4,'includeHeaders':_0x222644[_0x112cd5(0x16c)]};_0x379c7b&&(_0x738fda['body']=_0x379c7b);Object[_0x112cd5(0x143)](_0x434694)[_0x112cd5(0x173)]>0x0&&(_0x738fda[_0x112cd5(0x16b)]=_0x434694);if(_0x222644[_0x112cd5(0x16c)]){const _0x2f2c2c=resolveSite(_0x222644['site']),_0x32ac13=getEndpoint(_0x2f2c2c,_0xbcbfb4),_0x2293db=''+_0x32ac13+_0x588981;console[_0x112cd5(0x138)]('>\x20'+_0x48f21a+'\x20'+_0x2293db);const _0x4aa2d6=getAuthHeaders(_0x2f2c2c),_0x4b0c46={..._0x4aa2d6,..._0x434694};for(const [_0x20ac8a,_0x3fc4af]of Object[_0x112cd5(0x15b)](_0x4b0c46)){!isSensitiveHeader(_0x20ac8a)&&console[_0x112cd5(0x138)]('>\x20'+_0x20ac8a+':\x20'+_0x3fc4af);}_0x379c7b&&console[_0x112cd5(0x138)]('>'),console[_0x112cd5(0x138)]('');}const _0x11ca54=await _0x56a97b[_0x112cd5(0x142)]['request'](_0x588981,_0x738fda);if(_0x222644[_0x112cd5(0x16c)]&&_0x11ca54[_0x112cd5(0x16b)]){console[_0x112cd5(0x138)](_0x112cd5(0x13a)+_0x11ca54[_0x112cd5(0x166)]);for(const [_0x39e105,_0x38be5f]of Object[_0x112cd5(0x15b)](_0x11ca54[_0x112cd5(0x16b)])){!isSensitiveHeader(_0x39e105)&&console[_0x112cd5(0x138)]('<\x20'+_0x39e105+':\x20'+_0x38be5f);}console[_0x112cd5(0x138)]('');}const _0x13f4f7=Boolean(_0x222644['output']),_0x4de27c={'color':_0x222644[_0x112cd5(0x14f)],'noColor':_0x222644['noColor']||_0x13f4f7&&!_0x222644[_0x112cd5(0x14f)]},_0x2417b7=colorizeJSON(_0x11ca54[_0x112cd5(0x13b)],_0x4de27c);return _0x222644[_0x112cd5(0x144)]?(writeFileSync(_0x222644[_0x112cd5(0x144)],_0x2417b7),console[_0x112cd5(0x138)](_0x112cd5(0x16e)+_0x222644[_0x112cd5(0x144)])):console['log'](_0x2417b7),0x0;}catch(_0x553138){return _0x553138 instanceof Error?(console[_0x112cd5(0x138)]('Error:\x20'+_0x553138['message']),_0x222644['verbose']&&_0x553138[_0x112cd5(0x147)]&&console[_0x112cd5(0x138)](_0x112cd5(0x175)+_0x553138[_0x112cd5(0x147)])):console[_0x112cd5(0x138)](_0x112cd5(0x15d)+String(_0x553138)),0x1;}}}function a6_0x240d(){const _0x122cbd=['stack','Invalid\x20header\x20format:\x20\x22','8eHgDMX','toUpperCase','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','trino','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','PUT','color','isArray','Invalid\x20HTTP\x20method:\x20','proxy-authorization','843774JvqgEY','includes','llm','join','Invalid\x20API\x20type:\x20','2Cglzvm','authorization','76465dQhcKa','entries','readBodyFromFile','Error:\x20','type','GET','toLowerCase','set-cookie','cdp','1224291tEwtar','substring','trim','status','109488mzDflN','header','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','10957936pMSoaP','headers','verbose','name','Results\x20saved\x20to\x20','4ObbRdi','execute','POST','has','length','indexOf','\x0aStack\x20trace:\x0a','message','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','3953999SDXvaZ','.\x20Valid\x20types:\x20','PATCH','workflow','9flasUj','error','2457430vQqFqD','<\x20HTTP/1.1\x20','data','description','method','Endpoint\x20must\x20start\x20with\x20/:\x20','x-auth-token','startsWith','\x22.\x20','api','keys','output','x-trino-user','file'];a6_0x240d=function(){return _0x122cbd;};return a6_0x240d();}
@@ -1 +1 @@
1
- const a7_0x6490e0=a7_0x1964;(function(_0x232b24,_0x196a60){const _0x25fcb2=a7_0x1964,_0x4efd2b=_0x232b24();while(!![]){try{const _0x4581a2=parseInt(_0x25fcb2(0x20b))/0x1*(-parseInt(_0x25fcb2(0x1e4))/0x2)+parseInt(_0x25fcb2(0x1d9))/0x3*(parseInt(_0x25fcb2(0x1de))/0x4)+-parseInt(_0x25fcb2(0x1ed))/0x5+parseInt(_0x25fcb2(0x1d4))/0x6+parseInt(_0x25fcb2(0x209))/0x7+parseInt(_0x25fcb2(0x1f6))/0x8+-parseInt(_0x25fcb2(0x1e5))/0x9;if(_0x4581a2===_0x196a60)break;else _0x4efd2b['push'](_0x4efd2b['shift']());}catch(_0x57d2dc){_0x4efd2b['push'](_0x4efd2b['shift']());}}}(a7_0x2227,0xd9e5e));import{BaseCommand,printAuthError}from'./command.js';function a7_0x1964(_0x5b0c9c,_0x1bbd6c){_0x5b0c9c=_0x5b0c9c-0x1c8;const _0x2227bb=a7_0x2227();let _0x196454=_0x2227bb[_0x5b0c9c];return _0x196454;}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';function a7_0x2227(){const _0xb6896c=['ERROR','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','No\x20API\x20key\x20found\x20in\x20keychain','log','9014082MqXSJW','logLevel','12IwdrqQ','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','Enter\x20your\x20TD\x20API\x20key:','yellow','tdx:\x20auth\x20clear','/app/mp/ak','✓\x20Authentication\x20successful\x0a','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','green','auth:setup','tdx:\x20auth\x20setup','customSite','status','✓\x20Default\x20site\x20set\x20to\x20','profile','create','join','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','Site\x20name\x20cannot\x20be\x20empty','getUserInfo','No\x20credential\x20found','Validating\x20API\x20key...','5508960LChYBo','jobs','Setting\x20up\x20authentication\x20for\x20site:\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','Read\x20credential\x20from\x20','5943LeZgfx','name','tdx\x20profile:\x20','API\x20key\x20cannot\x20be\x20empty','You\x20can\x20find\x20your\x20API\x20key\x20at:','2276fTIQOi','trim','warn','apiKey','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','text','13214EZphuQ','27040104ncuLZg','System\x20keychain\x20is\x20not\x20available','red','us01','\x0aSetup\x20cancelled','\x20\x20tdx','message','first_name','4844445BoLeHI','\x20for\x20profile:\x20','description','auth:clear','password','\x20(site:\x20','✗\x20Validation\x20failed:\x20','bold','N/A','12896512kTimNO','test','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','\x20(profile:\x20','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','email','filter','auth','User:\x20','last_name','execute','select','Enter\x20site\x20name:','error','site'];a7_0x2227=function(){return _0xb6896c;};return a7_0x2227();}import{buildSiteChoices}from'../core/constants.js';import a7_0x519218 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_0x2c8f5c from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x6490e0(0x1da)]=a7_0x6490e0(0x214);[a7_0x6490e0(0x1ef)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x6490e0(0x200)](_0x45b062){const _0x58695f=a7_0x6490e0,{options:_0x59268d}=_0x45b062,_0x31465c=_0x59268d['profile'];console[_0x58695f(0x208)](a7_0x2c8f5c['bold'](_0x58695f(0x215)));const _0x4b9801=_0x59268d[_0x58695f(0x204)]||_0x58695f(0x1e8),{choices:_0x16f856,initialIndex:_0x563fe9}=buildSiteChoices(_0x4b9801),_0x30608e=_0x31465c?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x31465c+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x12e5ec=await a7_0x519218({'type':_0x58695f(0x201),'name':_0x58695f(0x204),'message':_0x30608e,'choices':_0x16f856,'initial':_0x563fe9});if(!_0x12e5ec[_0x58695f(0x204)])return console[_0x58695f(0x208)](_0x58695f(0x1e9)),0x1;let _0x4e8856;if(_0x12e5ec[_0x58695f(0x204)]==='other'){const _0x2c919a=await a7_0x519218({'type':_0x58695f(0x1e3),'name':_0x58695f(0x1c8),'message':_0x58695f(0x202),'initial':'us01','validate':_0x4a1703=>{const _0x103437=_0x58695f;if(!_0x4a1703||!_0x4a1703['trim']())return _0x103437(0x1d0);if(!/^[a-z0-9-]+$/[_0x103437(0x1f7)](_0x4a1703['trim']()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x2c919a[_0x58695f(0x1c8)])return console['log'](_0x58695f(0x1e9)),0x1;_0x4e8856=_0x2c919a[_0x58695f(0x1c8)];}else _0x4e8856=_0x12e5ec[_0x58695f(0x204)];const _0x1fa013=resolveSite(_0x4e8856);console['log'](_0x58695f(0x1d6)+_0x1fa013),console[_0x58695f(0x208)](_0x58695f(0x1dd)),console[_0x58695f(0x208)]('\x20\x20'+getConsoleUrl(_0x1fa013,_0x58695f(0x210)));const _0x46f747=await a7_0x519218({'type':_0x58695f(0x1f1),'name':_0x58695f(0x1e1),'message':_0x58695f(0x20d),'validate':_0x3176f4=>{const _0x27b495=_0x58695f;if(!_0x3176f4||!_0x3176f4['trim']())return _0x27b495(0x1dc);return!![];}});if(!_0x46f747[_0x58695f(0x1e1)])return console[_0x58695f(0x208)](_0x58695f(0x1e9)),0x1;const _0x4f8caa=_0x46f747[_0x58695f(0x1e1)];console[_0x58695f(0x208)](_0x58695f(0x1d3));try{const _0x52c910=TDX[_0x58695f(0x1cc)]({'site':_0x1fa013,'apiKey':_0x4f8caa['trim'](),'logLevel':_0x59268d[_0x58695f(0x20a)]??LogLevel[_0x58695f(0x205)]}),_0xe2196f=await _0x52c910['jobs'][_0x58695f(0x1d1)]();console[_0x58695f(0x208)](_0x58695f(0x1cf)+_0xe2196f[_0x58695f(0x1fb)]+')');const _0x3326f8=await isKeychainAvailable();_0x3326f8?(await saveAPIKeyAsync(_0x4f8caa[_0x58695f(0x1df)](),_0x1fa013,_0x31465c),console[_0x58695f(0x208)](_0x58695f(0x20c)+(_0x31465c?'\x20(profile:\x20'+_0x31465c+')':''))):(console[_0x58695f(0x1e0)](a7_0x2c8f5c[_0x58695f(0x20e)](_0x58695f(0x1fa))),console[_0x58695f(0x1e0)](a7_0x2c8f5c[_0x58695f(0x20e)](_0x58695f(0x1f8))));if(_0x31465c){const _0x214a13={'site':_0x1fa013};saveProfileToUserConfig(_0x31465c,_0x214a13),console[_0x58695f(0x208)]('✓\x20Profile\x20\x27'+_0x31465c+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x1fa013),console[_0x58695f(0x208)](_0x58695f(0x1ca)+_0x1fa013);const _0x154748=_0x31465c?'\x20--profile\x20'+_0x31465c:'';return console[_0x58695f(0x208)](),console[_0x58695f(0x208)](_0x58695f(0x206)),console[_0x58695f(0x208)](_0x58695f(0x1ea)+_0x154748+_0x58695f(0x1d7)),console[_0x58695f(0x208)](_0x58695f(0x1ea)+_0x154748+_0x58695f(0x1ce)),0x0;}catch(_0xd7abea){if(_0xd7abea instanceof HTTPClientError&&_0xd7abea[_0x58695f(0x1c9)]===0x191)return printAuthError(_0xd7abea),0x1;return console[_0x58695f(0x203)](a7_0x2c8f5c['red'](_0x58695f(0x1f3)+(_0xd7abea instanceof Error?_0xd7abea[_0x58695f(0x1eb)]:String(_0xd7abea)))),console[_0x58695f(0x203)](_0x58695f(0x1e2)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x6490e0(0x1fd);['description']=a7_0x6490e0(0x212);async[a7_0x6490e0(0x200)](_0x115ee1){const _0x60268d=a7_0x6490e0,{options:_0x43a489,tdx:_0x37464c}=_0x115ee1,_0x351b2e=_0x43a489[_0x60268d(0x204)],_0x3c0ff8=_0x43a489[_0x60268d(0x1cb)],_0x16757d=_0x3c0ff8?_0x3c0ff8:_0x60268d(0x1f5);console[_0x60268d(0x208)](_0x60268d(0x1db)+_0x16757d+_0x60268d(0x1f2)+_0x351b2e+')');const _0x54915d=await resolveAPIKeyAsync(_0x351b2e,_0x3c0ff8);if(_0x54915d){const {source:_0x13c162,isDeprecated:_0x1c5e98}=_0x54915d,_0x45b959=_0x60268d(0x1d8)+_0x13c162;console[_0x60268d(0x208)](_0x1c5e98?a7_0x2c8f5c['yellow'](_0x45b959):_0x45b959);}else console[_0x60268d(0x208)](a7_0x2c8f5c[_0x60268d(0x20e)](_0x60268d(0x1d2)));try{const _0x30683c=await _0x37464c[_0x60268d(0x1d5)][_0x60268d(0x1d1)]();return console['log'](a7_0x2c8f5c[_0x60268d(0x213)](_0x60268d(0x211))),console[_0x60268d(0x208)](_0x60268d(0x1fe)+_0x30683c[_0x60268d(0x1fb)]),(_0x30683c[_0x60268d(0x1ec)]||_0x30683c[_0x60268d(0x1ff)])&&console[_0x60268d(0x208)]('Name:\x20'+[_0x30683c[_0x60268d(0x1ec)],_0x30683c['last_name']][_0x60268d(0x1fc)](Boolean)[_0x60268d(0x1cd)]('\x20')),0x0;}catch(_0x4548aa){return _0x4548aa instanceof HTTPClientError&&_0x4548aa[_0x60268d(0x1c9)]===0x191?printAuthError(_0x4548aa,!![],_0x3c0ff8):console[_0x60268d(0x203)](a7_0x2c8f5c['red']('✗\x20Validation\x20failed:\x20'+(_0x4548aa instanceof Error?_0x4548aa['message']:String(_0x4548aa)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x6490e0(0x1da)]=a7_0x6490e0(0x1f0);[a7_0x6490e0(0x1ef)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x6490e0(0x200)](_0x54af9e){const _0x2ed18f=a7_0x6490e0,{options:_0x57fff5}=_0x54af9e,_0x172ea0=_0x57fff5['profile'];console['log'](a7_0x2c8f5c[_0x2ed18f(0x1f4)](_0x2ed18f(0x20f)));const _0x4fc34e=await isKeychainAvailable();if(!_0x4fc34e)return console[_0x2ed18f(0x203)](a7_0x2c8f5c[_0x2ed18f(0x1e7)](_0x2ed18f(0x1e6))),0x1;const _0x422740=await deleteKeychainAPIKey(_0x172ea0);return _0x422740?(clearCredentialCache(),console[_0x2ed18f(0x208)]('✓\x20API\x20key\x20removed\x20from\x20keychain'+(_0x172ea0?_0x2ed18f(0x1f9)+_0x172ea0+')':'')),0x0):(console['log'](_0x2ed18f(0x207)+(_0x172ea0?_0x2ed18f(0x1ee)+_0x172ea0:'')),0x1);}}
1
+ const a7_0x6925ab=a7_0x489a;(function(_0xbd2cc6,_0x578046){const _0x26ed14=a7_0x489a,_0x2041ff=_0xbd2cc6();while(!![]){try{const _0x33a69b=-parseInt(_0x26ed14(0x183))/0x1*(parseInt(_0x26ed14(0x159))/0x2)+-parseInt(_0x26ed14(0x185))/0x3+parseInt(_0x26ed14(0x167))/0x4+parseInt(_0x26ed14(0x19b))/0x5+parseInt(_0x26ed14(0x15f))/0x6+parseInt(_0x26ed14(0x16d))/0x7*(parseInt(_0x26ed14(0x19c))/0x8)+parseInt(_0x26ed14(0x160))/0x9*(-parseInt(_0x26ed14(0x18b))/0xa);if(_0x33a69b===_0x578046)break;else _0x2041ff['push'](_0x2041ff['shift']());}catch(_0x3bec43){_0x2041ff['push'](_0x2041ff['shift']());}}}(a7_0x5664,0xd48fd));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_0x5664(){const _0x283acb=['email','description','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x0aSetup\x20cancelled','Setup\x20API\x20key\x20authentication\x20interactively','green','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','\x20(profile:\x20','1155460hKPTqy','1672ybSVld','Site\x20name\x20cannot\x20be\x20empty','auth:setup','other','auth:clear','message','N/A','logLevel','test','10ETxseJ','red','text','✓\x20Default\x20site\x20set\x20to\x20','✓\x20Profile\x20\x27','Enter\x20site\x20name:','4787934hrGWNS','291996qMUwXo','auth','Remove\x20API\x20key\x20from\x20system\x20keychain','/app/mp/ak','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','yellow','6136900gAXsXe','warn','last_name','profile','No\x20API\x20key\x20found\x20in\x20keychain','status','28889ROlTFS','\x20\x20tdx','\x27\x20registered','trim','join','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','✓\x20Authentication\x20successful\x0a','Read\x20credential\x20from\x20','first_name','filter','User:\x20','log','\x20for\x20profile:\x20','getUserInfo','System\x20keychain\x20is\x20not\x20available','Select\x20your\x20Treasure\x20Data\x20site:','API\x20key\x20cannot\x20be\x20empty','Setting\x20up\x20authentication\x20for\x20site:\x20','Name:\x20','jobs','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','22001mxiZMd','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','5096937ePUNsz','✓\x20API\x20key\x20removed\x20from\x20keychain','create','name','Validating\x20API\x20key...','customSite','230CxxHDf','site','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','ERROR','✗\x20Validation\x20failed:\x20','tdx\x20profile:\x20','execute','error'];a7_0x5664=function(){return _0x283acb;};return a7_0x5664();}import{clearCredentialCache}from'../core/credential-cache.js';function a7_0x489a(_0x53fe6c,_0x382a9a){_0x53fe6c=_0x53fe6c-0x156;const _0x56645d=a7_0x5664();let _0x489a22=_0x56645d[_0x53fe6c];return _0x489a22;}import{buildSiteChoices}from'../core/constants.js';import a7_0x142149 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_0xcdccf4 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x6925ab(0x188)]=a7_0x6925ab(0x19e);[a7_0x6925ab(0x194)]=a7_0x6925ab(0x197);async[a7_0x6925ab(0x191)](_0x1e8311){const _0x4a16cb=a7_0x6925ab,{options:_0x139157}=_0x1e8311,_0x576f7=_0x139157['profile'];console[_0x4a16cb(0x178)](a7_0xcdccf4['bold']('tdx:\x20auth\x20setup'));const _0x26712c=_0x139157['site']||'us01',{choices:_0xe3a0b5,initialIndex:_0x3be95b}=buildSiteChoices(_0x26712c),_0x37e252=_0x576f7?_0x4a16cb(0x199)+_0x576f7+'):':_0x4a16cb(0x17c),_0xa27a46=await a7_0x142149({'type':'select','name':_0x4a16cb(0x18c),'message':_0x37e252,'choices':_0xe3a0b5,'initial':_0x3be95b});if(!_0xa27a46['site'])return console[_0x4a16cb(0x178)](_0x4a16cb(0x196)),0x1;let _0x3f5187;if(_0xa27a46[_0x4a16cb(0x18c)]===_0x4a16cb(0x19f)){const _0x44c054=await a7_0x142149({'type':_0x4a16cb(0x15b),'name':_0x4a16cb(0x18a),'message':_0x4a16cb(0x15e),'initial':'us01','validate':_0x26b6da=>{const _0x223f90=_0x4a16cb;if(!_0x26b6da||!_0x26b6da[_0x223f90(0x170)]())return _0x223f90(0x19d);if(!/^[a-z0-9-]+$/[_0x223f90(0x158)](_0x26b6da[_0x223f90(0x170)]()))return _0x223f90(0x181);return!![];}});if(!_0x44c054[_0x4a16cb(0x18a)])return console[_0x4a16cb(0x178)](_0x4a16cb(0x196)),0x1;_0x3f5187=_0x44c054[_0x4a16cb(0x18a)];}else _0x3f5187=_0xa27a46[_0x4a16cb(0x18c)];const _0x935060=resolveSite(_0x3f5187);console[_0x4a16cb(0x178)](_0x4a16cb(0x17e)+_0x935060),console['log'](_0x4a16cb(0x164)),console[_0x4a16cb(0x178)]('\x20\x20'+getConsoleUrl(_0x935060,_0x4a16cb(0x163)));const _0x9022b7=await a7_0x142149({'type':'password','name':'apiKey','message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x2ead2a=>{const _0x16a71f=_0x4a16cb;if(!_0x2ead2a||!_0x2ead2a[_0x16a71f(0x170)]())return _0x16a71f(0x17d);return!![];}});if(!_0x9022b7['apiKey'])return console[_0x4a16cb(0x178)]('\x0aSetup\x20cancelled'),0x1;const _0x3aac55=_0x9022b7['apiKey'];console[_0x4a16cb(0x178)](_0x4a16cb(0x189));try{const _0x115275=TDX[_0x4a16cb(0x187)]({'site':_0x935060,'apiKey':_0x3aac55[_0x4a16cb(0x170)](),'logLevel':_0x139157[_0x4a16cb(0x157)]??LogLevel[_0x4a16cb(0x18e)]}),_0x1c22d9=await _0x115275[_0x4a16cb(0x180)][_0x4a16cb(0x17a)]();console[_0x4a16cb(0x178)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x1c22d9[_0x4a16cb(0x193)]+')');const _0x3b85ae=await isKeychainAvailable();_0x3b85ae?(await saveAPIKeyAsync(_0x3aac55[_0x4a16cb(0x170)](),_0x935060,_0x576f7),console[_0x4a16cb(0x178)](_0x4a16cb(0x182)+(_0x576f7?_0x4a16cb(0x19a)+_0x576f7+')':''))):(console[_0x4a16cb(0x168)](a7_0xcdccf4[_0x4a16cb(0x166)](_0x4a16cb(0x184))),console[_0x4a16cb(0x168)](a7_0xcdccf4[_0x4a16cb(0x166)](_0x4a16cb(0x172))));if(_0x576f7){const _0x5569b8={'site':_0x935060};saveProfileToUserConfig(_0x576f7,_0x5569b8),console[_0x4a16cb(0x178)](_0x4a16cb(0x15d)+_0x576f7+_0x4a16cb(0x16f));}else saveDefaultSiteToUserConfig(_0x935060),console['log'](_0x4a16cb(0x15c)+_0x935060);const _0x4c1a83=_0x576f7?'\x20--profile\x20'+_0x576f7:'';return console[_0x4a16cb(0x178)](),console[_0x4a16cb(0x178)](_0x4a16cb(0x18d)),console[_0x4a16cb(0x178)](_0x4a16cb(0x16e)+_0x4c1a83+_0x4a16cb(0x195)),console[_0x4a16cb(0x178)](_0x4a16cb(0x16e)+_0x4c1a83+_0x4a16cb(0x165)),0x0;}catch(_0x2da1ad){if(_0x2da1ad instanceof HTTPClientError&&_0x2da1ad['status']===0x191)return printAuthError(_0x2da1ad),0x1;return console[_0x4a16cb(0x192)](a7_0xcdccf4[_0x4a16cb(0x15a)](_0x4a16cb(0x18f)+(_0x2da1ad instanceof Error?_0x2da1ad[_0x4a16cb(0x1a1)]:String(_0x2da1ad)))),console['error']('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x6925ab(0x188)]=a7_0x6925ab(0x161);[a7_0x6925ab(0x194)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async['execute'](_0x2caa75){const _0x34e267=a7_0x6925ab,{options:_0x537aaa,tdx:_0x1991d6}=_0x2caa75,_0x48f9f7=_0x537aaa[_0x34e267(0x18c)],_0x4e05b7=_0x537aaa[_0x34e267(0x16a)],_0x3cc458=_0x4e05b7?_0x4e05b7:_0x34e267(0x156);console[_0x34e267(0x178)](_0x34e267(0x190)+_0x3cc458+'\x20(site:\x20'+_0x48f9f7+')');const _0x4992a6=await resolveAPIKeyAsync(_0x48f9f7,_0x4e05b7);if(_0x4992a6){const {source:_0x1ffafb,isDeprecated:_0x531511}=_0x4992a6,_0x6d4adf=_0x34e267(0x174)+_0x1ffafb;console[_0x34e267(0x178)](_0x531511?a7_0xcdccf4[_0x34e267(0x166)](_0x6d4adf):_0x6d4adf);}else console[_0x34e267(0x178)](a7_0xcdccf4['yellow']('No\x20credential\x20found'));try{const _0x49593d=await _0x1991d6[_0x34e267(0x180)][_0x34e267(0x17a)]();return console[_0x34e267(0x178)](a7_0xcdccf4[_0x34e267(0x198)](_0x34e267(0x173))),console[_0x34e267(0x178)](_0x34e267(0x177)+_0x49593d[_0x34e267(0x193)]),(_0x49593d[_0x34e267(0x175)]||_0x49593d[_0x34e267(0x169)])&&console[_0x34e267(0x178)](_0x34e267(0x17f)+[_0x49593d[_0x34e267(0x175)],_0x49593d[_0x34e267(0x169)]][_0x34e267(0x176)](Boolean)[_0x34e267(0x171)]('\x20')),0x0;}catch(_0x5d1d70){return _0x5d1d70 instanceof HTTPClientError&&_0x5d1d70[_0x34e267(0x16c)]===0x191?printAuthError(_0x5d1d70,!![],_0x4e05b7):console[_0x34e267(0x192)](a7_0xcdccf4[_0x34e267(0x15a)](_0x34e267(0x18f)+(_0x5d1d70 instanceof Error?_0x5d1d70[_0x34e267(0x1a1)]:String(_0x5d1d70)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x6925ab(0x188)]=a7_0x6925ab(0x1a0);[a7_0x6925ab(0x194)]=a7_0x6925ab(0x162);async[a7_0x6925ab(0x191)](_0x129360){const _0x541ffe=a7_0x6925ab,{options:_0x59f9bf}=_0x129360,_0x2aea80=_0x59f9bf['profile'];console[_0x541ffe(0x178)](a7_0xcdccf4['bold']('tdx:\x20auth\x20clear'));const _0x1c048b=await isKeychainAvailable();if(!_0x1c048b)return console[_0x541ffe(0x192)](a7_0xcdccf4[_0x541ffe(0x15a)](_0x541ffe(0x17b))),0x1;const _0x4187ec=await deleteKeychainAPIKey(_0x2aea80);return _0x4187ec?(clearCredentialCache(),console[_0x541ffe(0x178)](_0x541ffe(0x186)+(_0x2aea80?_0x541ffe(0x19a)+_0x2aea80+')':'')),0x0):(console['log'](_0x541ffe(0x16b)+(_0x2aea80?_0x541ffe(0x179)+_0x2aea80:'')),0x1);}}
@@ -1 +1 @@
1
- const a8_0x4b577a=a8_0x3aa3;function a8_0x38ab(){const _0x482491=['type','options','claude-4.5-haiku','chatId','targetKnowledgeBase','15327TbJbfl','stream','write','\x27\x20not\x20found','includes','Resolving\x20project\x20\x27','agent','tool_call','Using\x20agent\x20from\x20','Getting\x20default\x20agent...','metadata','site','llmProject','Resolving\x20agent\x20\x27','\x27...','session\x20context','cause','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','verbose','llm','functionName','tool','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','getDefaultAgent','execute','args','2014592TKIeQY','streamChat','chat-create','content','handleChatEvent','4324416ItsIcT','stringify','chat','targetAgent','\x0aStack\x20trace:','712WpWLtT','name','validate','resolveProjectId','error','getOrCreateDefaultAgent','message','tool_result','event','description','streamChatJsonl','stack','startChat','stdout','3135774baIoSU','5186235kPNTSK','slice','404','join','code','agentId','1LrZueu','4183683YKdJNj','new','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','log','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','CHAT_NOT_FOUND','Continuing\x20chat:\x20','--agent\x20flag','Using\x20cached\x20default\x20agent:\x20','241426BbLzOs','context','targetWebSearchTool','data'];a8_0x38ab=function(){return _0x482491;};return a8_0x38ab();}(function(_0xca8a0d,_0x203661){const _0x4ebef1=a8_0x3aa3,_0x1fdda7=_0xca8a0d();while(!![]){try{const _0x290862=parseInt(_0x4ebef1(0xfc))/0x1*(parseInt(_0x4ebef1(0x106))/0x2)+-parseInt(_0x4ebef1(0xf5))/0x3+parseInt(_0x4ebef1(0x129))/0x4+parseInt(_0x4ebef1(0xf6))/0x5+-parseInt(_0x4ebef1(0x12e))/0x6+parseInt(_0x4ebef1(0xfd))/0x7+-parseInt(_0x4ebef1(0x133))/0x8*(-parseInt(_0x4ebef1(0x10f))/0x9);if(_0x290862===_0x203661)break;else _0x1fdda7['push'](_0x1fdda7['shift']());}catch(_0x29b567){_0x1fdda7['push'](_0x1fdda7['shift']());}}}(a8_0x38ab,0x9d6f2));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x456b96,_0x475816){const _0x424fe2=a8_0x3aa3;if(_0x456b96 instanceof SDKError)console[_0x424fe2(0x137)]('Error:\x20'+_0x456b96['message']),_0x475816[_0x424fe2(0x121)]&&(_0x456b96[_0x424fe2(0x11f)]&&console[_0x424fe2(0x137)]('\x20\x20Cause:\x20'+_0x456b96[_0x424fe2(0x11f)]),_0x456b96[_0x424fe2(0x13e)]&&(console['error'](_0x424fe2(0x132)),console['error'](_0x456b96[_0x424fe2(0x13e)])));else throw _0x456b96;}async function resolveAgentId(_0x2b9bb1,_0x79d054,_0x3036a6,_0x788e97,_0x2bf201){const _0x5901e4=a8_0x3aa3,_0x3c8460=_0x79d054||_0x3036a6;if(_0x3c8460){const {projectName:_0x1179aa,agentName:_0x1ac67b}=parseAgentRef(_0x3c8460),_0x464c14=_0x1ac67b||_0x3c8460,_0x4e15bd=_0x1ac67b?_0x1179aa:_0x788e97;if(!_0x4e15bd)throw new Error(_0x5901e4(0x125));if(_0x2bf201){const _0x521067=_0x79d054?_0x5901e4(0x104):_0x5901e4(0x11e);console[_0x5901e4(0x137)](_0x5901e4(0x117)+_0x521067+':\x20'+_0x4e15bd+'/'+_0x464c14);}const _0x1b9e68=await withSpinner(_0x5901e4(0x114)+_0x4e15bd+'\x27...',()=>_0x2b9bb1['llm'][_0x5901e4(0x136)](_0x4e15bd),{'verbose':_0x2bf201}),_0x22bd3f=await withSpinner(_0x5901e4(0x11c)+_0x464c14+_0x5901e4(0x11d),()=>_0x2b9bb1[_0x5901e4(0x122)]['resolveAgentId'](_0x464c14,_0x1b9e68[_0x5901e4(0x109)]),{'verbose':_0x2bf201});return _0x22bd3f[_0x5901e4(0x109)];}else{const _0x276d45=_0x2b9bb1[_0x5901e4(0x122)][_0x5901e4(0x126)]();if(_0x276d45)return _0x2bf201&&console['error'](_0x5901e4(0x105)+_0x276d45[_0x5901e4(0x134)]),_0x276d45['id'];const _0x1648d4=await withSpinner(_0x5901e4(0x118),()=>_0x2b9bb1[_0x5901e4(0x122)][_0x5901e4(0x138)](_0x5901e4(0x10c),0x0),{'verbose':_0x2bf201});return _0x1648d4[_0x5901e4(0x109)]['id'];}}export class ChatCommand extends BaseCommand{['name']=a8_0x4b577a(0x130);[a8_0x4b577a(0x13c)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a8_0x4b577a(0x135)](_0x4ad91){const _0x3b043a=a8_0x4b577a,_0x5e648e=_0x4ad91[_0x3b043a(0x128)][_0x3b043a(0xf9)]('\x20');if(!_0x5e648e)return _0x3b043a(0x120);return undefined;}async['streamChat'](_0x30d8fe,_0xcd60e5,_0x5a5d93,_0x467d43,_0x380ccb){const _0x322f72=a8_0x4b577a;for await(const _0x374adf of _0x30d8fe[_0x322f72(0x122)][_0x322f72(0x130)](_0xcd60e5,{'agentId':_0x5a5d93,'chatId':_0x467d43})){if(_0x374adf[_0x322f72(0x10a)]===_0x322f72(0x119)){const _0x151659=_0x374adf['data'][_0x322f72(0x10d)];saveLastChatId(_0x151659),_0x380ccb&&console['error']('Chat\x20session:\x20'+_0x151659);}else _0x374adf[_0x322f72(0x10a)]===_0x322f72(0x13b)&&this[_0x322f72(0x12d)](_0x374adf[_0x322f72(0x109)]);}}async[a8_0x4b577a(0x13d)](_0x44d02f,_0xb5d70f,_0x574cc9,_0x2c50d7){const _0x1ffd44=a8_0x4b577a,_0x1a7bb8=_0x44d02f[_0x1ffd44(0x107)][_0x1ffd44(0x11a)];let _0x124d00=![];for await(const _0x329c18 of _0x44d02f[_0x1ffd44(0x122)][_0x1ffd44(0x130)](_0xb5d70f,{'agentId':_0x574cc9,'chatId':_0x2c50d7})){if(_0x329c18[_0x1ffd44(0x10a)]==='metadata'){const _0x54f670=_0x329c18[_0x1ffd44(0x109)];saveLastChatId(_0x54f670[_0x1ffd44(0x10d)]);const _0x195bff=_0x54f670['projectId']&&_0x54f670[_0x1ffd44(0xfb)]?getLLMConversationUrl(_0x1a7bb8,_0x54f670['projectId'],_0x54f670[_0x1ffd44(0xfb)],_0x54f670[_0x1ffd44(0x10d)]):undefined;console[_0x1ffd44(0x100)](JSON[_0x1ffd44(0x12f)]({'type':_0x1ffd44(0x119),'data':{'chatId':_0x54f670[_0x1ffd44(0x10d)],'agentId':_0x54f670[_0x1ffd44(0xfb)],'consoleUrl':_0x195bff}})),_0x124d00=!![];}else{if(_0x329c18[_0x1ffd44(0x10a)]===_0x1ffd44(0x13b)){!_0x124d00&&_0x2c50d7&&(console['log'](JSON[_0x1ffd44(0x12f)]({'type':_0x1ffd44(0x119),'data':{'chatId':_0x2c50d7}})),_0x124d00=!![]);const _0x5aaf2b=_0x329c18[_0x1ffd44(0x109)];if('content'in _0x5aaf2b)console[_0x1ffd44(0x100)](JSON[_0x1ffd44(0x12f)]({'type':_0x1ffd44(0x12c),'data':{'content':_0x5aaf2b['content']}}));else{if('tool_call'in _0x5aaf2b){const _0x524549=_0x5aaf2b['tool_call'];console['log'](JSON[_0x1ffd44(0x12f)]({'type':_0x1ffd44(0x116),'data':{'id':_0x524549['id'],'name':_0x524549['functionName'],'target':_0x524549[_0x1ffd44(0x10e)]?.[_0x1ffd44(0x134)]||_0x524549[_0x1ffd44(0x131)]?.[_0x1ffd44(0x134)]||_0x524549[_0x1ffd44(0x108)]?.[_0x1ffd44(0x134)]||_0x524549['targetFunction']}}));}else{if(_0x1ffd44(0x124)in _0x5aaf2b)console[_0x1ffd44(0x100)](JSON['stringify']({'type':_0x1ffd44(0x13a),'data':{'id':_0x5aaf2b[_0x1ffd44(0x124)]['id'],'name':_0x5aaf2b['tool'][_0x1ffd44(0x123)],'result':typeof _0x5aaf2b[_0x1ffd44(0x124)][_0x1ffd44(0x12c)]==='string'?_0x5aaf2b[_0x1ffd44(0x124)]['content'][_0x1ffd44(0xf7)](0x0,0x1f4):''}}));else _0x1ffd44(0x137)in _0x5aaf2b&&console[_0x1ffd44(0x100)](JSON[_0x1ffd44(0x12f)]({'type':_0x1ffd44(0x137),'data':{'error':_0x5aaf2b[_0x1ffd44(0x137)]}}));}}}}}console[_0x1ffd44(0x100)](JSON[_0x1ffd44(0x12f)]({'type':'done'}));}async[a8_0x4b577a(0x127)](_0x44334d){const _0xcb5722=a8_0x4b577a,{options:_0x4ec68c,args:_0x211e1e,tdx:_0x18cda0}=_0x44334d,_0x3b6cab=_0x211e1e[_0xcb5722(0xf9)]('\x20'),_0x44d502=_0x4ec68c,_0x4869f2=_0x44d502[_0xcb5722(0x115)],_0x434e11=_0x44d502['llmAgent'],_0x10c425=_0x44d502['llmProject'],_0x376302=_0x44d502[_0xcb5722(0xfe)],_0x410267=_0x44d502['chatId'],_0xf3b19c=_0x44d502[_0xcb5722(0x110)];if(_0x376302&&_0x410267)return console[_0xcb5722(0x137)](_0xcb5722(0x101)),0x1;try{let _0x4d15cb,_0x174459;if(_0x410267)_0x174459=_0x410267;else!_0x376302&&(_0x174459=loadLastChatId(),_0x174459&&_0x4ec68c[_0xcb5722(0x121)]&&console[_0xcb5722(0x137)](_0xcb5722(0x103)+_0x174459));!_0x410267&&(_0x376302||!_0x174459)&&(_0x4d15cb=await resolveAgentId(_0x18cda0,_0x4869f2,_0x434e11,_0x10c425,_0x4ec68c['verbose']));const _0x1a91bd=_0xf3b19c?(_0x4a7d39,_0x4f77b8,_0x1a536c)=>this[_0xcb5722(0x13d)](_0x18cda0,_0x4a7d39,_0x4f77b8,_0x1a536c):(_0x5c3818,_0x4321a6,_0x5d2244)=>this[_0xcb5722(0x12a)](_0x18cda0,_0x5c3818,_0x4321a6,_0x5d2244,_0x4ec68c[_0xcb5722(0x121)]);try{await _0x1a91bd(_0x3b6cab,_0x4d15cb,_0x174459);}catch(_0x139101){const _0x5841c0=_0x139101 instanceof SDKError&&_0x139101[_0xcb5722(0xfa)]===ErrorCode[_0xcb5722(0x102)]||_0x139101 instanceof Error&&_0x139101[_0xcb5722(0x139)][_0xcb5722(0x113)](_0xcb5722(0xf8));if(_0x5841c0&&_0x410267)return console[_0xcb5722(0x137)]('Error:\x20Chat\x20session\x20\x27'+_0x410267+_0xcb5722(0x112)),0x1;if(_0x5841c0)_0x4ec68c[_0xcb5722(0x121)]&&console['error'](_0xcb5722(0xff)),!_0x4d15cb&&(_0x4d15cb=await resolveAgentId(_0x18cda0,_0x4869f2,_0x434e11,_0x10c425,_0x4ec68c['verbose'])),await _0x1a91bd(_0x3b6cab,_0x4d15cb,undefined);else throw _0x139101;}return!_0xf3b19c&&console[_0xcb5722(0x100)](),0x0;}catch(_0x2609ea){return console[_0xcb5722(0x137)](),handleSDKError(_0x2609ea,_0x4ec68c),0x1;}}[a8_0x4b577a(0x12d)](_0x49d07f){const _0x36cde4=a8_0x4b577a;if('content'in _0x49d07f)process[_0x36cde4(0xf4)][_0x36cde4(0x111)](_0x49d07f[_0x36cde4(0x12c)]);else _0x36cde4(0x137)in _0x49d07f&&console[_0x36cde4(0x137)]('\x0aError:\x20'+_0x49d07f[_0x36cde4(0x137)]);}}function a8_0x3aa3(_0xa2d555,_0x14306f){_0xa2d555=_0xa2d555-0xf3;const _0x38ab12=a8_0x38ab();let _0x3aa319=_0x38ab12[_0xa2d555];return _0x3aa319;}export class ChatCreateCommand extends BaseCommand{['name']=a8_0x4b577a(0x12b);['description']='Create\x20a\x20new\x20chat\x20session';['validate'](_0x1f20ed){const _0xd271b3=a8_0x4b577a,_0x5bfd8a=_0x1f20ed[_0xd271b3(0x10b)],_0x3495e7=_0x5bfd8a[_0xd271b3(0x115)],_0x4ac7a0=_0x5bfd8a['llmAgent'];if(!_0x3495e7&&!_0x4ac7a0)return'Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22';return undefined;}async[a8_0x4b577a(0x127)](_0x292ea8){const _0x439910=a8_0x4b577a,{options:_0xdf1d1d,tdx:_0x38edbd}=_0x292ea8,_0x120261=_0xdf1d1d,_0x11d472=_0x120261[_0x439910(0x115)],_0xfb74b9=_0x120261['llmAgent'],_0x1c497f=_0x120261[_0x439910(0x11b)];try{const _0x29fd04=await resolveAgentId(_0x38edbd,_0x11d472,_0xfb74b9,_0x1c497f,_0xdf1d1d['verbose']),_0x2b7fa6=await _0x38edbd[_0x439910(0x122)][_0x439910(0xf3)](_0x29fd04);return saveLastChatId(_0x2b7fa6['id']),console[_0x439910(0x100)](JSON[_0x439910(0x12f)]({'chatId':_0x2b7fa6['id'],'agentId':_0x29fd04})),0x0;}catch(_0x162d6a){return handleSDKError(_0x162d6a,_0xdf1d1d),0x1;}}}
1
+ const a8_0x5a85ea=a8_0x3abd;(function(_0x3872b5,_0x28d547){const _0x2c07ce=a8_0x3abd,_0x22e275=_0x3872b5();while(!![]){try{const _0x5bb4d9=parseInt(_0x2c07ce(0x1cb))/0x1*(-parseInt(_0x2c07ce(0x1bf))/0x2)+-parseInt(_0x2c07ce(0x1b1))/0x3+parseInt(_0x2c07ce(0x1ad))/0x4+parseInt(_0x2c07ce(0x1cf))/0x5*(-parseInt(_0x2c07ce(0x1c7))/0x6)+-parseInt(_0x2c07ce(0x1c9))/0x7*(parseInt(_0x2c07ce(0x1a3))/0x8)+-parseInt(_0x2c07ce(0x1b2))/0x9*(-parseInt(_0x2c07ce(0x1a2))/0xa)+-parseInt(_0x2c07ce(0x1d1))/0xb*(-parseInt(_0x2c07ce(0x1c3))/0xc);if(_0x5bb4d9===_0x28d547)break;else _0x22e275['push'](_0x22e275['shift']());}catch(_0x5ef677){_0x22e275['push'](_0x22e275['shift']());}}}(a8_0x27f8,0x86fb7));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function a8_0x3abd(_0x55fc40,_0x587816){_0x55fc40=_0x55fc40-0x190;const _0x27f868=a8_0x27f8();let _0x3abd74=_0x27f868[_0x55fc40];return _0x3abd74;}function a8_0x27f8(){const _0x381d1b=['targetWebSearchTool','1108368MFwXrV','1071153wkJjFm','done','write','description','string','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','chat-create','code','options','Using\x20cached\x20default\x20agent:\x20','name','Resolving\x20project\x20\x27','cause','9314jeAwCU','stdout','chat','data','12VTQmPM','includes','join','verbose','486xXxSDq','--agent\x20flag','49FWFbEL','Error:\x20Chat\x20session\x20\x27','111MBVcJZ','event','startChat','Error:\x20','44095tTExeb','chatId','19162594kDMiJy','streamChat','targetFunction','validate','Create\x20a\x20new\x20chat\x20session','execute','Chat\x20session:\x20','\x0aStack\x20trace:','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','site','projectId','metadata','CHAT_NOT_FOUND','message','getOrCreateDefaultAgent','slice','\x27\x20not\x20found','log','agentId','llmProject','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','tool_result','llmAgent','\x0aError:\x20','agent','tool_call','Using\x20agent\x20from\x20','streamChatJsonl','handleChatEvent','error','type','20UUtlUs','501848yduLmI','content','claude-4.5-haiku','stack','stringify','Resolving\x20agent\x20\x27','\x27...','resolveProjectId','tool','targetKnowledgeBase','2450552DSgjjr','llm','functionName'];a8_0x27f8=function(){return _0x381d1b;};return a8_0x27f8();}function handleSDKError(_0x54f4c7,_0xbc6792){const _0x443755=a8_0x3abd;if(_0x54f4c7 instanceof SDKError)console[_0x443755(0x1a0)](_0x443755(0x1ce)+_0x54f4c7['message']),_0xbc6792[_0x443755(0x1c6)]&&(_0x54f4c7[_0x443755(0x1be)]&&console[_0x443755(0x1a0)]('\x20\x20Cause:\x20'+_0x54f4c7[_0x443755(0x1be)]),_0x54f4c7[_0x443755(0x1a6)]&&(console[_0x443755(0x1a0)](_0x443755(0x1d8)),console['error'](_0x54f4c7['stack'])));else throw _0x54f4c7;}async function resolveAgentId(_0x2ab248,_0xf64e0c,_0x14f6df,_0x4d2952,_0x5b54fd){const _0x50934a=a8_0x3abd,_0x4525d0=_0xf64e0c||_0x14f6df;if(_0x4525d0){const {projectName:_0x44766a,agentName:_0x2c0733}=parseAgentRef(_0x4525d0),_0x2b8daa=_0x2c0733||_0x4525d0,_0x41a2fa=_0x2c0733?_0x44766a:_0x4d2952;if(!_0x41a2fa)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x5b54fd){const _0x24328f=_0xf64e0c?_0x50934a(0x1c8):'session\x20context';console['error'](_0x50934a(0x19d)+_0x24328f+':\x20'+_0x41a2fa+'/'+_0x2b8daa);}const _0x943462=await withSpinner(_0x50934a(0x1bd)+_0x41a2fa+_0x50934a(0x1a9),()=>_0x2ab248[_0x50934a(0x1ae)][_0x50934a(0x1aa)](_0x41a2fa),{'verbose':_0x5b54fd}),_0x434e87=await withSpinner(_0x50934a(0x1a8)+_0x2b8daa+_0x50934a(0x1a9),()=>_0x2ab248[_0x50934a(0x1ae)]['resolveAgentId'](_0x2b8daa,_0x943462['data']),{'verbose':_0x5b54fd});return _0x434e87[_0x50934a(0x1c2)];}else{const _0x350489=_0x2ab248['llm']['getDefaultAgent']();if(_0x350489)return _0x5b54fd&&console['error'](_0x50934a(0x1bb)+_0x350489[_0x50934a(0x1bc)]),_0x350489['id'];const _0x1dfc18=await withSpinner('Getting\x20default\x20agent...',()=>_0x2ab248[_0x50934a(0x1ae)][_0x50934a(0x191)](_0x50934a(0x1a5),0x0),{'verbose':_0x5b54fd});return _0x1dfc18['data']['id'];}}export class ChatCommand extends BaseCommand{['name']=a8_0x5a85ea(0x1c1);[a8_0x5a85ea(0x1b5)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';['validate'](_0x4f83b7){const _0x137eaa=a8_0x5a85ea,_0x37cf0a=_0x4f83b7['args'][_0x137eaa(0x1c5)]('\x20');if(!_0x37cf0a)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async[a8_0x5a85ea(0x1d2)](_0x2e7edc,_0x2443a7,_0x53eca7,_0x58a158,_0x4dd312){const _0x3d35bc=a8_0x5a85ea;for await(const _0x5f03c of _0x2e7edc[_0x3d35bc(0x1ae)][_0x3d35bc(0x1c1)](_0x2443a7,{'agentId':_0x53eca7,'chatId':_0x58a158})){if(_0x5f03c[_0x3d35bc(0x1a1)]===_0x3d35bc(0x1dc)){const _0x3284a3=_0x5f03c[_0x3d35bc(0x1c2)][_0x3d35bc(0x1d0)];saveLastChatId(_0x3284a3),_0x4dd312&&console[_0x3d35bc(0x1a0)](_0x3d35bc(0x1d7)+_0x3284a3);}else _0x5f03c[_0x3d35bc(0x1a1)]===_0x3d35bc(0x1cc)&&this[_0x3d35bc(0x19f)](_0x5f03c['data']);}}async[a8_0x5a85ea(0x19e)](_0x5079f0,_0x24380e,_0x4d0abc,_0x11d1ac){const _0x29ff13=a8_0x5a85ea,_0x5005f7=_0x5079f0['context'][_0x29ff13(0x1da)];let _0x1183c6=![];for await(const _0x65897 of _0x5079f0['llm'][_0x29ff13(0x1c1)](_0x24380e,{'agentId':_0x4d0abc,'chatId':_0x11d1ac})){if(_0x65897['type']===_0x29ff13(0x1dc)){const _0x52b8ec=_0x65897[_0x29ff13(0x1c2)];saveLastChatId(_0x52b8ec[_0x29ff13(0x1d0)]);const _0x30f470=_0x52b8ec[_0x29ff13(0x1db)]&&_0x52b8ec[_0x29ff13(0x195)]?getLLMConversationUrl(_0x5005f7,_0x52b8ec[_0x29ff13(0x1db)],_0x52b8ec['agentId'],_0x52b8ec[_0x29ff13(0x1d0)]):undefined;console[_0x29ff13(0x194)](JSON['stringify']({'type':'metadata','data':{'chatId':_0x52b8ec['chatId'],'agentId':_0x52b8ec[_0x29ff13(0x195)],'consoleUrl':_0x30f470}})),_0x1183c6=!![];}else{if(_0x65897['type']===_0x29ff13(0x1cc)){!_0x1183c6&&_0x11d1ac&&(console[_0x29ff13(0x194)](JSON['stringify']({'type':'metadata','data':{'chatId':_0x11d1ac}})),_0x1183c6=!![]);const _0x31fa0f=_0x65897[_0x29ff13(0x1c2)];if(_0x29ff13(0x1a4)in _0x31fa0f)console['log'](JSON[_0x29ff13(0x1a7)]({'type':'content','data':{'content':_0x31fa0f['content']}}));else{if(_0x29ff13(0x19c)in _0x31fa0f){const _0x2ca549=_0x31fa0f[_0x29ff13(0x19c)];console[_0x29ff13(0x194)](JSON[_0x29ff13(0x1a7)]({'type':'tool_call','data':{'id':_0x2ca549['id'],'name':_0x2ca549[_0x29ff13(0x1af)],'target':_0x2ca549[_0x29ff13(0x1ac)]?.['name']||_0x2ca549['targetAgent']?.[_0x29ff13(0x1bc)]||_0x2ca549[_0x29ff13(0x1b0)]?.[_0x29ff13(0x1bc)]||_0x2ca549[_0x29ff13(0x1d3)]}}));}else{if(_0x29ff13(0x1ab)in _0x31fa0f)console[_0x29ff13(0x194)](JSON[_0x29ff13(0x1a7)]({'type':_0x29ff13(0x198),'data':{'id':_0x31fa0f[_0x29ff13(0x1ab)]['id'],'name':_0x31fa0f['tool']['functionName'],'result':typeof _0x31fa0f[_0x29ff13(0x1ab)][_0x29ff13(0x1a4)]===_0x29ff13(0x1b6)?_0x31fa0f['tool'][_0x29ff13(0x1a4)][_0x29ff13(0x192)](0x0,0x1f4):''}}));else'error'in _0x31fa0f&&console['log'](JSON[_0x29ff13(0x1a7)]({'type':_0x29ff13(0x1a0),'data':{'error':_0x31fa0f[_0x29ff13(0x1a0)]}}));}}}}}console[_0x29ff13(0x194)](JSON[_0x29ff13(0x1a7)]({'type':_0x29ff13(0x1b3)}));}async['execute'](_0x4884d5){const _0x397d42=a8_0x5a85ea,{options:_0x574155,args:_0x267264,tdx:_0x468368}=_0x4884d5,_0x467cf1=_0x267264['join']('\x20'),_0x51f6a7=_0x574155,_0x21c0e3=_0x51f6a7[_0x397d42(0x19b)],_0x1fc411=_0x51f6a7[_0x397d42(0x199)],_0x50217=_0x51f6a7[_0x397d42(0x196)],_0x4341b0=_0x51f6a7['new'],_0x805c7a=_0x51f6a7[_0x397d42(0x1d0)],_0x56a5c1=_0x51f6a7['stream'];if(_0x4341b0&&_0x805c7a)return console['error'](_0x397d42(0x1d9)),0x1;try{let _0x8c371,_0x2979c0;if(_0x805c7a)_0x2979c0=_0x805c7a;else!_0x4341b0&&(_0x2979c0=loadLastChatId(),_0x2979c0&&_0x574155[_0x397d42(0x1c6)]&&console['error']('Continuing\x20chat:\x20'+_0x2979c0));!_0x805c7a&&(_0x4341b0||!_0x2979c0)&&(_0x8c371=await resolveAgentId(_0x468368,_0x21c0e3,_0x1fc411,_0x50217,_0x574155['verbose']));const _0x1e1543=_0x56a5c1?(_0x228391,_0x276272,_0x1dae6c)=>this[_0x397d42(0x19e)](_0x468368,_0x228391,_0x276272,_0x1dae6c):(_0x13f02f,_0x11bdbc,_0x4a6864)=>this[_0x397d42(0x1d2)](_0x468368,_0x13f02f,_0x11bdbc,_0x4a6864,_0x574155[_0x397d42(0x1c6)]);try{await _0x1e1543(_0x467cf1,_0x8c371,_0x2979c0);}catch(_0x1ad55d){const _0x273a2a=_0x1ad55d instanceof SDKError&&_0x1ad55d[_0x397d42(0x1b9)]===ErrorCode[_0x397d42(0x1dd)]||_0x1ad55d instanceof Error&&_0x1ad55d[_0x397d42(0x190)][_0x397d42(0x1c4)]('404');if(_0x273a2a&&_0x805c7a)return console[_0x397d42(0x1a0)](_0x397d42(0x1ca)+_0x805c7a+_0x397d42(0x193)),0x1;if(_0x273a2a)_0x574155['verbose']&&console[_0x397d42(0x1a0)](_0x397d42(0x197)),!_0x8c371&&(_0x8c371=await resolveAgentId(_0x468368,_0x21c0e3,_0x1fc411,_0x50217,_0x574155['verbose'])),await _0x1e1543(_0x467cf1,_0x8c371,undefined);else throw _0x1ad55d;}return!_0x56a5c1&&console[_0x397d42(0x194)](),0x0;}catch(_0x55aa1f){return console[_0x397d42(0x1a0)](),handleSDKError(_0x55aa1f,_0x574155),0x1;}}[a8_0x5a85ea(0x19f)](_0x774db1){const _0x243e13=a8_0x5a85ea;if(_0x243e13(0x1a4)in _0x774db1)process[_0x243e13(0x1c0)][_0x243e13(0x1b4)](_0x774db1[_0x243e13(0x1a4)]);else _0x243e13(0x1a0)in _0x774db1&&console['error'](_0x243e13(0x19a)+_0x774db1[_0x243e13(0x1a0)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x5a85ea(0x1bc)]=a8_0x5a85ea(0x1b8);[a8_0x5a85ea(0x1b5)]=a8_0x5a85ea(0x1d5);[a8_0x5a85ea(0x1d4)](_0xf6bf34){const _0x43fb0d=a8_0x5a85ea,_0x1cbdcb=_0xf6bf34[_0x43fb0d(0x1ba)],_0x5ae3b3=_0x1cbdcb[_0x43fb0d(0x19b)],_0x5c8c23=_0x1cbdcb[_0x43fb0d(0x199)];if(!_0x5ae3b3&&!_0x5c8c23)return _0x43fb0d(0x1b7);return undefined;}async[a8_0x5a85ea(0x1d6)](_0x4b33a2){const _0xfe5b72=a8_0x5a85ea,{options:_0x13113b,tdx:_0x853f8c}=_0x4b33a2,_0x59cc04=_0x13113b,_0x4fc9d9=_0x59cc04['agent'],_0x5461dd=_0x59cc04['llmAgent'],_0x17697d=_0x59cc04[_0xfe5b72(0x196)];try{const _0x543d0e=await resolveAgentId(_0x853f8c,_0x4fc9d9,_0x5461dd,_0x17697d,_0x13113b[_0xfe5b72(0x1c6)]),_0x56d29a=await _0x853f8c['llm'][_0xfe5b72(0x1cd)](_0x543d0e);return saveLastChatId(_0x56d29a['id']),console[_0xfe5b72(0x194)](JSON[_0xfe5b72(0x1a7)]({'chatId':_0x56d29a['id'],'agentId':_0x543d0e})),0x0;}catch(_0xd5152e){return handleSDKError(_0xd5152e,_0x13113b),0x1;}}}