@treasuredata/tdx 2026.3.37 → 2026.3.39

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 (245) 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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/auth-login-command.js +1 -1
  13. package/dist/commands/cas-command.js +1 -1
  14. package/dist/commands/cas-segment-command.js +1 -1
  15. package/dist/commands/chat-command.js +1 -1
  16. package/dist/commands/claude-command.js +1 -1
  17. package/dist/commands/claude-statusline-command.js +1 -1
  18. package/dist/commands/claude-usage-command.js +1 -1
  19. package/dist/commands/command.js +1 -1
  20. package/dist/commands/connection-command.js +1 -1
  21. package/dist/commands/databases.js +1 -1
  22. package/dist/commands/delivery-command.js +1 -1
  23. package/dist/commands/describe.js +1 -1
  24. package/dist/commands/engage-campaign-pull-command.js +1 -1
  25. package/dist/commands/engage-campaign-push-command.js +1 -1
  26. package/dist/commands/engage-campaign-validate-command.js +1 -1
  27. package/dist/commands/engage-command.js +1 -1
  28. package/dist/commands/engage-template-pull-command.js +1 -1
  29. package/dist/commands/engage-template-push-command.js +1 -1
  30. package/dist/commands/engage-template-validate-command.js +1 -1
  31. package/dist/commands/job-command.js +1 -1
  32. package/dist/commands/journey-command.js +1 -1
  33. package/dist/commands/journey-validate-command.js +1 -1
  34. package/dist/commands/llm-command.js +1 -1
  35. package/dist/commands/mcp-command.js +1 -1
  36. package/dist/commands/parent-segment-command.js +1 -1
  37. package/dist/commands/policy-command.js +1 -1
  38. package/dist/commands/profile-command.js +1 -1
  39. package/dist/commands/profiles-command.js +1 -1
  40. package/dist/commands/query-command.js +1 -1
  41. package/dist/commands/schedule-command.js +1 -1
  42. package/dist/commands/segment-command.js +1 -1
  43. package/dist/commands/segment-create-command.js +1 -1
  44. package/dist/commands/segment-fields-command.js +1 -1
  45. package/dist/commands/segment-pull-command.js +1 -1
  46. package/dist/commands/segment-push-command.js +1 -1
  47. package/dist/commands/segment-update-command.js +1 -1
  48. package/dist/commands/segment-use-command.js +1 -1
  49. package/dist/commands/segment-validate-command.js +1 -1
  50. package/dist/commands/segments.js +1 -1
  51. package/dist/commands/show.js +1 -1
  52. package/dist/commands/status-command.js +1 -1
  53. package/dist/commands/tables.js +1 -1
  54. package/dist/commands/unset-command.js +1 -1
  55. package/dist/commands/upgrade-command.js +1 -1
  56. package/dist/commands/use-command.js +1 -1
  57. package/dist/commands/user-command.js +1 -1
  58. package/dist/commands/work-command.d.ts +8 -2
  59. package/dist/commands/work-command.d.ts.map +1 -1
  60. package/dist/commands/work-command.js +1 -1
  61. package/dist/commands/work-command.js.map +1 -1
  62. package/dist/commands/workflow-command.js +1 -1
  63. package/dist/core/auth.js +1 -1
  64. package/dist/core/command-output.js +1 -1
  65. package/dist/core/config.js +1 -1
  66. package/dist/core/connection-cache.js +1 -1
  67. package/dist/core/constants.js +1 -1
  68. package/dist/core/credential-cache.js +1 -1
  69. package/dist/core/global-context.js +1 -1
  70. package/dist/core/keychain.js +1 -1
  71. package/dist/core/oauth-keychain.js +1 -1
  72. package/dist/core/oauth.js +1 -1
  73. package/dist/core/profile.js +1 -1
  74. package/dist/core/project-config.js +1 -1
  75. package/dist/core/session.js +1 -1
  76. package/dist/core/user-cache.js +1 -1
  77. package/dist/core/version.js +1 -1
  78. package/dist/index.js +1 -1
  79. package/dist/mcp/server.js +1 -1
  80. package/dist/mcp/tools/index.js +1 -1
  81. package/dist/mcp/tools/tdx-run.js +1 -1
  82. package/dist/mcp/tools/tdx-search.js +1 -1
  83. package/dist/mcp/utils.js +1 -1
  84. package/dist/proxy/claude-usage-tracker.js +1 -1
  85. package/dist/proxy/passthrough-server.js +1 -1
  86. package/dist/proxy/sse-usage-parser.js +1 -1
  87. package/dist/sdk/agent/agent-config.js +1 -1
  88. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  89. package/dist/sdk/agent/agent-yaml.js +1 -1
  90. package/dist/sdk/agent/test/evaluator.js +1 -1
  91. package/dist/sdk/agent/test/executor.js +1 -1
  92. package/dist/sdk/agent/test/index.js +1 -1
  93. package/dist/sdk/agent/test/output.js +1 -1
  94. package/dist/sdk/agent/test/parser.js +1 -1
  95. package/dist/sdk/agent/tool-target-registry.js +1 -1
  96. package/dist/sdk/api.js +1 -1
  97. package/dist/sdk/cas/cas-api-client.js +1 -1
  98. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  99. package/dist/sdk/cas/cas-segment-yaml.d.ts.map +1 -1
  100. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  101. package/dist/sdk/cas/cas-segment-yaml.js.map +1 -1
  102. package/dist/sdk/cas/index.js +1 -1
  103. package/dist/sdk/cas/pull-workflow.js +1 -1
  104. package/dist/sdk/cas/push-workflow.js +1 -1
  105. package/dist/sdk/client/cdp-api-client.js +1 -1
  106. package/dist/sdk/client/delivery-api-client.js +1 -1
  107. package/dist/sdk/client/endpoints.js +1 -1
  108. package/dist/sdk/client/engage-api-client.js +1 -1
  109. package/dist/sdk/client/http-client.js +1 -1
  110. package/dist/sdk/client/llm-api-client.js +1 -1
  111. package/dist/sdk/client/oauth-refresh.js +1 -1
  112. package/dist/sdk/client/rate-limiter.js +1 -1
  113. package/dist/sdk/client/td-api-client.js +1 -1
  114. package/dist/sdk/client/trino-api-client.js +1 -1
  115. package/dist/sdk/client/workflow-client.js +1 -1
  116. package/dist/sdk/connection-validator.js +1 -1
  117. package/dist/sdk/connection.js +1 -1
  118. package/dist/sdk/delivery.js +1 -1
  119. package/dist/sdk/engage/campaign-pull.js +1 -1
  120. package/dist/sdk/engage/campaign-push.js +1 -1
  121. package/dist/sdk/engage/campaign-validator.js +1 -1
  122. package/dist/sdk/engage/campaign-yaml.js +1 -1
  123. package/dist/sdk/engage/template-pull.js +1 -1
  124. package/dist/sdk/engage/template-push.js +1 -1
  125. package/dist/sdk/engage/template-validator.js +1 -1
  126. package/dist/sdk/engage/template-yaml.js +1 -1
  127. package/dist/sdk/engage/types/campaign-def.js +1 -1
  128. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  129. package/dist/sdk/engage/types/template-schema.js +1 -1
  130. package/dist/sdk/engage.js +1 -1
  131. package/dist/sdk/errors.js +1 -1
  132. package/dist/sdk/index.js +1 -1
  133. package/dist/sdk/io/index.js +1 -1
  134. package/dist/sdk/io/node-filesystem.js +1 -1
  135. package/dist/sdk/job.js +1 -1
  136. package/dist/sdk/journey.js +1 -1
  137. package/dist/sdk/llm/chat-cache.js +1 -1
  138. package/dist/sdk/llm/index.js +1 -1
  139. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  140. package/dist/sdk/llm/model-factors.js +1 -1
  141. package/dist/sdk/personalization.js +1 -1
  142. package/dist/sdk/policy.js +1 -1
  143. package/dist/sdk/query/index.js +1 -1
  144. package/dist/sdk/query/sql-parser.js +1 -1
  145. package/dist/sdk/realtime.js +1 -1
  146. package/dist/sdk/schedule.js +1 -1
  147. package/dist/sdk/segment/child-segment-yaml.d.ts +9 -7
  148. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  149. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  150. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  151. package/dist/sdk/segment/fields-display.js +1 -1
  152. package/dist/sdk/segment/file-discovery.js +1 -1
  153. package/dist/sdk/segment/journey-utils.js +1 -1
  154. package/dist/sdk/segment/journey-validator.js +1 -1
  155. package/dist/sdk/segment/journey-yaml.js +1 -1
  156. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  157. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  158. package/dist/sdk/segment/pull-workflow.js +1 -1
  159. package/dist/sdk/segment/push-recovery.js +1 -1
  160. package/dist/sdk/segment/push-workflow.js +1 -1
  161. package/dist/sdk/segment/push-workflow.js.map +1 -1
  162. package/dist/sdk/segment/resolution-context.js +1 -1
  163. package/dist/sdk/segment/segment-path-parser.js +1 -1
  164. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  165. package/dist/sdk/segment/segment-validator.js +1 -1
  166. package/dist/sdk/segment/target-resolution.js +1 -1
  167. package/dist/sdk/segment/tdx-config.js +1 -1
  168. package/dist/sdk/segment/types/activation-schema.d.ts +3 -0
  169. package/dist/sdk/segment/types/activation-schema.d.ts.map +1 -1
  170. package/dist/sdk/segment/types/activation-schema.js +1 -1
  171. package/dist/sdk/segment/types/activation-schema.js.map +1 -1
  172. package/dist/sdk/segment/types/journey-def.js +1 -1
  173. package/dist/sdk/segment/types/journey-schema.js +1 -1
  174. package/dist/sdk/segment/types/segment-def.js +1 -1
  175. package/dist/sdk/segment/types/segment-schema.js +1 -1
  176. package/dist/sdk/segment/validate-files.js +1 -1
  177. package/dist/sdk/segment/yaml-validator.js +1 -1
  178. package/dist/sdk/segment.js +1 -1
  179. package/dist/sdk/types/cas.d.ts +2 -1
  180. package/dist/sdk/types/cas.d.ts.map +1 -1
  181. package/dist/sdk/types/cdp.d.ts +16 -1
  182. package/dist/sdk/types/cdp.d.ts.map +1 -1
  183. package/dist/sdk/types/index.js +1 -1
  184. package/dist/sdk/types/progress.js +1 -1
  185. package/dist/sdk/types/workspace.d.ts +19 -0
  186. package/dist/sdk/types/workspace.d.ts.map +1 -1
  187. package/dist/sdk/types/workspace.js +1 -1
  188. package/dist/sdk/types/workspace.js.map +1 -1
  189. package/dist/sdk/user.js +1 -1
  190. package/dist/sdk/util/format-detector.js +1 -1
  191. package/dist/sdk/util/formatters.js +1 -1
  192. package/dist/sdk/util/index.js +1 -1
  193. package/dist/sdk/util/paginate.js +1 -1
  194. package/dist/sdk/util/tree-formatter.js +1 -1
  195. package/dist/sdk/workflow/archive-validation.js +1 -1
  196. package/dist/sdk/workflow/clone-workflow.js +1 -1
  197. package/dist/sdk/workflow/index.js +1 -1
  198. package/dist/sdk/workflow/pull-workflow.js +1 -1
  199. package/dist/sdk/workflow/push-workflow.js +1 -1
  200. package/dist/sdk/workflow/tdx-config.js +1 -1
  201. package/dist/sdk/workflow/workflow-utils.js +1 -1
  202. package/dist/sdk/workspace/frontmatter.js +1 -1
  203. package/dist/sdk/workspace/git.js +1 -1
  204. package/dist/sdk/workspace/index.d.ts +12 -4
  205. package/dist/sdk/workspace/index.d.ts.map +1 -1
  206. package/dist/sdk/workspace/index.js +1 -1
  207. package/dist/sdk/workspace/index.js.map +1 -1
  208. package/dist/sdk/workspace/templates.js +1 -1
  209. package/dist/sdk/workspace/weekly.js +1 -1
  210. package/dist/sdk/workspace/wikilinks.js +1 -1
  211. package/dist/test-utils/command-runner.js +1 -1
  212. package/dist/test-utils/factories.js +1 -1
  213. package/dist/test-utils/fixtures.js +1 -1
  214. package/dist/test-utils/http-mock.js +1 -1
  215. package/dist/test-utils/index.js +1 -1
  216. package/dist/utils/async.js +1 -1
  217. package/dist/utils/colors.js +1 -1
  218. package/dist/utils/diff.js +1 -1
  219. package/dist/utils/file-permissions.js +1 -1
  220. package/dist/utils/file-reader.js +1 -1
  221. package/dist/utils/github-releases.d.ts +1 -1
  222. package/dist/utils/github-releases.js +1 -1
  223. package/dist/utils/github-releases.js.map +1 -1
  224. package/dist/utils/global-cache.js +1 -1
  225. package/dist/utils/json-loader.js +1 -1
  226. package/dist/utils/local-cache.js +1 -1
  227. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  228. package/dist/utils/logger/formatters/index.js +1 -1
  229. package/dist/utils/logger/handlers/console-handler.js +1 -1
  230. package/dist/utils/logger/handlers/file-handler.js +1 -1
  231. package/dist/utils/logger/handlers/index.js +1 -1
  232. package/dist/utils/logger/handlers/null-handler.js +1 -1
  233. package/dist/utils/logger/index.js +1 -1
  234. package/dist/utils/logger/logger.js +1 -1
  235. package/dist/utils/logger/types.js +1 -1
  236. package/dist/utils/option-validation.js +1 -1
  237. package/dist/utils/process.js +1 -1
  238. package/dist/utils/prompt.js +1 -1
  239. package/dist/utils/spinner.js +1 -1
  240. package/dist/utils/sse-parser.js +1 -1
  241. package/dist/utils/string-utils.js +1 -1
  242. package/dist/utils/table-ref-parser.js +1 -1
  243. package/dist/utils/tdx-logger.js +1 -1
  244. package/dist/utils/version-check.js +1 -1
  245. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x409031=a3_0xf6c1;(function(_0x1c8f8c,_0x320cf6){const _0x31eacd=a3_0xf6c1,_0x5b7e51=_0x1c8f8c();while(!![]){try{const _0x160657=parseInt(_0x31eacd(0xc1))/0x1*(-parseInt(_0x31eacd(0xc4))/0x2)+parseInt(_0x31eacd(0xc2))/0x3+-parseInt(_0x31eacd(0xb9))/0x4*(-parseInt(_0x31eacd(0xb0))/0x5)+parseInt(_0x31eacd(0xac))/0x6*(-parseInt(_0x31eacd(0xc7))/0x7)+-parseInt(_0x31eacd(0xa9))/0x8+parseInt(_0x31eacd(0xbd))/0x9*(parseInt(_0x31eacd(0xa7))/0xa)+parseInt(_0x31eacd(0xc6))/0xb*(-parseInt(_0x31eacd(0xba))/0xc);if(_0x160657===_0x320cf6)break;else _0x5b7e51['push'](_0x5b7e51['shift']());}catch(_0x2d6bb2){_0x5b7e51['push'](_0x5b7e51['shift']());}}}(a3_0x3515,0xc0596));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a3_0xf6c1(_0x4a463d,_0x513d22){_0x4a463d=_0x4a463d-0xa5;const _0x3515ec=a3_0x3515();let _0xf6c189=_0x3515ec[_0x4a463d];return _0xf6c189;}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_0x409031(0xb7)]=a3_0x409031(0xbc);[a3_0x409031(0xca)]='List\x20activations\x20for\x20a\x20segment';async[a3_0x409031(0xbf)](_0x134f22){const _0x3fb2bd=a3_0x409031,{options:_0x40a564,args:_0x5a63b8,tdx:_0x186b29}=_0x134f22;if(_0x5a63b8[_0x3fb2bd(0xae)]===0x0)return console['error'](_0x3fb2bd(0xbe)),console['error']('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x26c96b,childId:_0x32510e}=parseSegmentRef(_0x5a63b8[0x0]);if(!_0x32510e)return console[_0x3fb2bd(0xaf)](_0x3fb2bd(0xb1)),console['error'](_0x3fb2bd(0xc9)),0x1;_0x40a564[_0x3fb2bd(0xab)]&&(console[_0x3fb2bd(0xaf)](_0x3fb2bd(0xc5)+_0x40a564[_0x3fb2bd(0xaa)]),console[_0x3fb2bd(0xaf)]('Parent\x20name:\x20'+_0x26c96b),console[_0x3fb2bd(0xaf)](_0x3fb2bd(0xb6)+_0x32510e));const _0x4b6946=await withSpinner(_0x3fb2bd(0xb4)+_0x26c96b+_0x3fb2bd(0xb8),()=>_0x186b29[_0x3fb2bd(0xbb)][_0x3fb2bd(0xc3)](_0x26c96b),{'verbose':_0x40a564['verbose']}),_0x5509e4=_0x4b6946[_0x3fb2bd(0xc0)];_0x40a564[_0x3fb2bd(0xab)]&&console[_0x3fb2bd(0xaf)](_0x3fb2bd(0xa5)+_0x5509e4);const _0x22232c=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x32510e+'\x27...',()=>_0x186b29['segment']['resolveSegmentId'](_0x5509e4,_0x32510e),{'verbose':_0x40a564['verbose']}),_0x5ab60f=_0x22232c[_0x3fb2bd(0xc0)];_0x40a564[_0x3fb2bd(0xab)]&&console[_0x3fb2bd(0xaf)](_0x3fb2bd(0xa6)+_0x5ab60f);const _0x7735a2=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x32510e+_0x3fb2bd(0xb8),()=>_0x186b29[_0x3fb2bd(0xbb)][_0x3fb2bd(0xb3)](_0x5509e4,_0x5ab60f),{'verbose':_0x40a564['verbose']}),_0x4848fe=_0x7735a2[_0x3fb2bd(0xc0)];return console[_0x3fb2bd(0xaf)](_0x3fb2bd(0xb5)+_0x4848fe[_0x3fb2bd(0xae)]+_0x3fb2bd(0xa8)+(_0x4848fe[_0x3fb2bd(0xae)]!==0x1?'s':'')),await handleSDKOutput(_0x4848fe,_0x40a564),0x0;}catch(_0x50b982){if(_0x50b982 instanceof SDKError)return console['error'](_0x3fb2bd(0xad)+_0x50b982['message']),_0x50b982[_0x3fb2bd(0xc8)]&&console[_0x3fb2bd(0xaf)](_0x3fb2bd(0xb2)+_0x50b982['cause']),0x1;throw _0x50b982;}}}function a3_0x3515(){const _0x3120ea=['92ZMumWR','Site:\x20','116633uygMJE','7DKPXIW','cause','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','description','Resolved\x20parent\x20ID:\x20','Resolved\x20child\x20ID:\x20','90tzWcZf','\x20activation','1207280NDnjDp','site','verbose','6111594zfzwzV','Error:\x20','length','error','5586165HLlUuz','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','\x20\x20Cause:\x20','listActivations','Resolving\x20parent\x20segment\x20\x27','✔\x20Found\x20','Child\x20name:\x20','name','\x27...','4EsLquW','924zmZFQt','segment','activations','872631QPNkZN','Error:\x20Segment\x20name\x20is\x20required','execute','data','15998OcqmAu','4559538xCJATR','resolveParentId'];a3_0x3515=function(){return _0x3120ea;};return a3_0x3515();}
1
+ function a3_0x2c5d(_0x2728f7,_0x404efe){_0x2728f7=_0x2728f7-0x1e1;const _0x3193ea=a3_0x3193();let _0x2c5d2e=_0x3193ea[_0x2728f7];return _0x2c5d2e;}function a3_0x3193(){const _0x11509d=['cause','length','Resolving\x20child\x20segment\x20\x27','Parent\x20name:\x20','message','resolveParentId','5581961KPVOqb','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','execute','name','error','15305CQIRFF','data','\x20\x20Cause:\x20','1422QaNBrI','Resolving\x20parent\x20segment\x20\x27','segment','1698TAKxla','listActivations','description','14744720rnamtX','\x27...','List\x20activations\x20for\x20a\x20segment','Error:\x20','site','1370272YGEIRS','Resolved\x20child\x20ID:\x20','verbose','1493132QTdBZi','Listing\x20activations\x20for\x20segment\x20\x27','Child\x20name:\x20','16uoGtYS','3756hNkStu','Error:\x20Segment\x20name\x20is\x20required','3087243LsZiFG','\x20activation','11GqvRiU','✔\x20Found\x20','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'];a3_0x3193=function(){return _0x11509d;};return a3_0x3193();}const a3_0x396d42=a3_0x2c5d;(function(_0x2f2f22,_0x2fa004){const _0x151536=a3_0x2c5d,_0x34241b=_0x2f2f22();while(!![]){try{const _0x3b392f=parseInt(_0x151536(0x1f4))/0x1+parseInt(_0x151536(0x1f7))/0x2+parseInt(_0x151536(0x1e9))/0x3*(-parseInt(_0x151536(0x1fb))/0x4)+-parseInt(_0x151536(0x1e6))/0x5*(parseInt(_0x151536(0x1ec))/0x6)+-parseInt(_0x151536(0x1e1))/0x7+-parseInt(_0x151536(0x1fa))/0x8*(parseInt(_0x151536(0x1fd))/0x9)+parseInt(_0x151536(0x1ef))/0xa*(parseInt(_0x151536(0x1ff))/0xb);if(_0x3b392f===_0x2fa004)break;else _0x34241b['push'](_0x34241b['shift']());}catch(_0x2b794a){_0x34241b['push'](_0x34241b['shift']());}}}(a3_0x3193,0xc2744));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';export class ActivationsCommand extends BaseCommand{[a3_0x396d42(0x1e4)]='activations';[a3_0x396d42(0x1ee)]=a3_0x396d42(0x1f1);async[a3_0x396d42(0x1e3)](_0x37285d){const _0x308ecd=a3_0x396d42,{options:_0x507bb9,args:_0x329465,tdx:_0xa4aca7}=_0x37285d;if(_0x329465['length']===0x0)return console['error'](_0x308ecd(0x1fc)),console[_0x308ecd(0x1e5)](_0x308ecd(0x1e2)),0x1;try{const {parentId:_0x2dc50f,childId:_0x219292}=parseSegmentRef(_0x329465[0x0]);if(!_0x219292)return console['error'](_0x308ecd(0x201)),console[_0x308ecd(0x1e5)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x507bb9['verbose']&&(console['error']('Site:\x20'+_0x507bb9[_0x308ecd(0x1f3)]),console[_0x308ecd(0x1e5)](_0x308ecd(0x205)+_0x2dc50f),console[_0x308ecd(0x1e5)](_0x308ecd(0x1f9)+_0x219292));const _0x2ed83a=await withSpinner(_0x308ecd(0x1ea)+_0x2dc50f+_0x308ecd(0x1f0),()=>_0xa4aca7['segment'][_0x308ecd(0x207)](_0x2dc50f),{'verbose':_0x507bb9[_0x308ecd(0x1f6)]}),_0x400bf8=_0x2ed83a[_0x308ecd(0x1e7)];_0x507bb9[_0x308ecd(0x1f6)]&&console[_0x308ecd(0x1e5)]('Resolved\x20parent\x20ID:\x20'+_0x400bf8);const _0x257115=await withSpinner(_0x308ecd(0x204)+_0x219292+'\x27...',()=>_0xa4aca7[_0x308ecd(0x1eb)]['resolveSegmentId'](_0x400bf8,_0x219292),{'verbose':_0x507bb9[_0x308ecd(0x1f6)]}),_0x33582f=_0x257115['data'];_0x507bb9[_0x308ecd(0x1f6)]&&console[_0x308ecd(0x1e5)](_0x308ecd(0x1f5)+_0x33582f);const _0x618137=await withSpinner(_0x308ecd(0x1f8)+_0x219292+_0x308ecd(0x1f0),()=>_0xa4aca7[_0x308ecd(0x1eb)][_0x308ecd(0x1ed)](_0x400bf8,_0x33582f),{'verbose':_0x507bb9[_0x308ecd(0x1f6)]}),_0xcb0c5a=_0x618137['data'];return console[_0x308ecd(0x1e5)](_0x308ecd(0x200)+_0xcb0c5a[_0x308ecd(0x203)]+_0x308ecd(0x1fe)+(_0xcb0c5a[_0x308ecd(0x203)]!==0x1?'s':'')),await handleSDKOutput(_0xcb0c5a,_0x507bb9),0x0;}catch(_0xcc084d){if(_0xcc084d instanceof SDKError)return console['error'](_0x308ecd(0x1f2)+_0xcc084d[_0x308ecd(0x206)]),_0xcc084d[_0x308ecd(0x202)]&&console[_0x308ecd(0x1e5)](_0x308ecd(0x1e8)+_0xcc084d['cause']),0x1;throw _0xcc084d;}}}
@@ -1 +1 @@
1
- const a4_0x1b5248=a4_0x164f;(function(_0x4002bc,_0x1768b8){const _0x4cd8ea=a4_0x164f,_0x443e52=_0x4002bc();while(!![]){try{const _0x28e4b1=parseInt(_0x4cd8ea(0x20c))/0x1*(-parseInt(_0x4cd8ea(0x1f1))/0x2)+parseInt(_0x4cd8ea(0x1f8))/0x3+-parseInt(_0x4cd8ea(0x239))/0x4+-parseInt(_0x4cd8ea(0x212))/0x5+-parseInt(_0x4cd8ea(0x1cb))/0x6+parseInt(_0x4cd8ea(0x201))/0x7*(-parseInt(_0x4cd8ea(0x1fa))/0x8)+parseInt(_0x4cd8ea(0x1f2))/0x9*(parseInt(_0x4cd8ea(0x234))/0xa);if(_0x28e4b1===_0x1768b8)break;else _0x443e52['push'](_0x443e52['shift']());}catch(_0x2e1e3c){_0x443e52['push'](_0x443e52['shift']());}}}(a4_0x1088,0x7c99a));function a4_0x1088(){const _0x3e53f8=['\x20\x20Knowledge\x20Bases:\x20','output','\x20\x20Prompt\x20\x22','New\x20project:\x20','Pushing\x20agent\x20from\x20\x22','\x0aWrite\x20','textKnowledgeBases','experimentalKnowledgeBases','total','\x20resources?','\x0aPush\x20summary\x20for\x20\x27','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20resources\x20to\x20\x27','Cannot\x20clone\x20from\x20context\x20project\x20\x22','prompts','isNew','force','\x0aChanges\x20to\x20agent\x20\x27','message','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20tdx\x20agent\x20pull\x20','\x0a✔\x20Pulled\x20','errors','profile','agentId','\x22\x20to\x20a\x20different\x20profile','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Writing\x20files...','New\x20project\x20name\x20is\x20required','\x20\x20Prompts:\x20','cloneProject','Chat:\x20','Analyzing\x20changes\x20to\x20push...','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','tdx.json','reason','-\x20nothing\x20pushed','llm_project','\x0aChanges\x20to\x20integration\x20\x27','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','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)','-\x20no\x20files\x20written','\x0aError:','unchanged','no_local_folder','\x0aProject\x20pushed\x20with\x20errors','Would\x20pull\x20agent:\x20','action','\x20\x20Agents:\x20','Project:\x20','outputDir','join','knowledgeBases','diff','2724084JzYgCW','\x20\x20Agent\x20\x22','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x20files?','\x20changed','pushAgent','experimentalArtifacts','Project\x20cloned\x20with\x20errors','\x20\x20Source:\x20','error','Agent\x20pulled\x20successfully','\x20unchanged','\x20\x20Experimental\x20Artifacts:\x20','\x20new','✔\x20Context\x20set:\x20','Errors:','pushProject','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Using\x20context\x20project:\x20','gray','Dry\x20run\x20-\x20no\x20files\x20written','\x22:\x20','push','llmProject','MISSING_ARGUMENT','\x20\x20Knowledge\x20Base\x20\x22','\x22...','Failed\x20to\x20push\x20agent:\x20','llm','agent:clone','site','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Cloning\x20\x22','Pulling\x20agent\x20\x22','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Output\x20path:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','127114XtjvSq','81tThykQ','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','created','Using\x20project\x20from\x20','No\x20tdx.json\x20found\x20in\x20','Cancelled','1568901LCeITW','red','22272PGyMVC','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20--name\x20','dryRun','Status:\x20','\x20=\x20','\x20total','2485aUhaCJ','pullAgent','context','\x20successfully','New\x20project\x20ID:\x20','projectName','agentName','agents','execute','newProjectId','INVALID_ARGUMENT','12yLADDW','\x20updated','arg-dir','Pushing\x20to\x20project...','Output:\x20','newProjectName','4227210RruIzC','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20--profile\x20','Agent\x20','name','dim','updated','\x20\x20Target:\x20','projectId','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Clone\x20\x22','projectDir','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x22\x20to\x20new\x20project\x20\x22','counts','cwd','sourceProjectName','Using\x20current\x20project:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20Integration\x20\x22','\x20\x20Integrations:\x20','Using\x20project\x20from\x20context:\x20','no_context','agent:push','\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','repeat','cyan','integrations','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Using\x20project:\x20','outputPath','description','\x0aChanges:','\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)','3402450dibqYT','Source:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','session','pullProject','97400OFUFaw','\x20\x20Experimental\x20Artifact\x20\x22','agent.yml','Using\x20local\x20project:\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x22\x20to\x20\x22','\x20created','yellow','Would\x20clone:','utf-8','\x0aErrors\x20found:','Would\x20push\x20agent:\x20','\x20|\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x0aPush\x20','log','new','yes','\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','green','\x20errors','\x0aPull\x20summary\x20for\x20\x27'];a4_0x1088=function(){return _0x3e53f8;};return a4_0x1088();}import a4_0x30a017 from'chalk';import a4_0x27fc33 from'path';import{existsSync,readFileSync}from'fs';function a4_0x164f(_0x5c1609,_0x29de97){_0x5c1609=_0x5c1609-0x195;const _0x1088d0=a4_0x1088();let _0x164f1e=_0x1088d0[_0x5c1609];return _0x164f1e;}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(_0x46eca8){const _0x51d16e=a4_0x164f,_0x540463=[];if(_0x46eca8[_0x51d16e(0x19d)]!==undefined)_0x540463['push'](_0x46eca8[_0x51d16e(0x19d)]+_0x51d16e(0x200));if(_0x46eca8[_0x51d16e(0x249)]!==undefined&&_0x46eca8[_0x51d16e(0x249)]>0x0)_0x540463[_0x51d16e(0x1e1)](a4_0x30a017['green'](_0x46eca8[_0x51d16e(0x249)]+_0x51d16e(0x1d8)));if(_0x46eca8['created']!==undefined&&_0x46eca8[_0x51d16e(0x1f4)]>0x0)_0x540463[_0x51d16e(0x1e1)](a4_0x30a017['green'](_0x46eca8[_0x51d16e(0x1f4)]+_0x51d16e(0x23f)));if(_0x46eca8[_0x51d16e(0x218)]!==undefined&&_0x46eca8['updated']>0x0)_0x540463[_0x51d16e(0x1e1)](a4_0x30a017[_0x51d16e(0x240)](_0x46eca8['updated']+_0x51d16e(0x20d)));if(_0x46eca8['unchanged']!==undefined&&_0x46eca8[_0x51d16e(0x1c0)]>0x0)_0x540463[_0x51d16e(0x1e1)](a4_0x30a017[_0x51d16e(0x1de)](_0x46eca8[_0x51d16e(0x1c0)]+_0x51d16e(0x1d6)));if(_0x46eca8[_0x51d16e(0x1ab)]!==undefined&&_0x46eca8['errors']>0x0)_0x540463[_0x51d16e(0x1e1)](a4_0x30a017['red'](_0x46eca8[_0x51d16e(0x1ab)]+_0x51d16e(0x24d)));return _0x540463[_0x51d16e(0x1c8)](',\x20');}function displayDiffs(_0x149ef5,_0x5b1390,_0x1e593c,_0x2cab6a,_0x38dba3,_0x221c9e,_0x509457){const _0x31ca4c=a4_0x164f;for(const _0xc78617 of _0x149ef5){if(_0xc78617[_0x31ca4c(0x1ca)]){const _0x292ade=_0xc78617[_0x31ca4c(0x207)]||_0xc78617[_0x31ca4c(0x216)];console[_0x31ca4c(0x248)](_0x31ca4c(0x1a6)+_0x292ade+'\x27:'),console[_0x31ca4c(0x248)]('─'[_0x31ca4c(0x22b)](0x3c)),console[_0x31ca4c(0x248)](_0xc78617['diff']),console[_0x31ca4c(0x248)]('─'[_0x31ca4c(0x22b)](0x3c));}}for(const _0x37ba43 of _0x5b1390){_0x37ba43[_0x31ca4c(0x1ca)]&&(console['log'](_0x31ca4c(0x246)+_0x37ba43[_0x31ca4c(0x216)]+'\x27:'),console['log']('─'[_0x31ca4c(0x22b)](0x3c)),console[_0x31ca4c(0x248)](_0x37ba43['diff']),console['log']('─'['repeat'](0x3c)));}for(const _0x25ef95 of _0x1e593c){_0x25ef95['diff']&&(console[_0x31ca4c(0x248)](_0x31ca4c(0x1f0)+_0x25ef95[_0x31ca4c(0x216)]+'\x27:'),console[_0x31ca4c(0x248)]('─'[_0x31ca4c(0x22b)](0x3c)),console['log'](_0x25ef95[_0x31ca4c(0x1ca)]),console[_0x31ca4c(0x248)]('─'['repeat'](0x3c)));}for(const _0x4b170b of _0x2cab6a){_0x4b170b[_0x31ca4c(0x1ca)]&&(console[_0x31ca4c(0x248)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x4b170b[_0x31ca4c(0x216)]+'\x27:'),console[_0x31ca4c(0x248)]('─'[_0x31ca4c(0x22b)](0x3c)),console['log'](_0x4b170b['diff']),console[_0x31ca4c(0x248)]('─'['repeat'](0x3c)));}for(const _0x64e41b of _0x38dba3){_0x64e41b[_0x31ca4c(0x1ca)]&&(console[_0x31ca4c(0x248)](_0x31ca4c(0x1bb)+_0x64e41b[_0x31ca4c(0x216)]+'\x27:'),console[_0x31ca4c(0x248)]('─'[_0x31ca4c(0x22b)](0x3c)),console[_0x31ca4c(0x248)](_0x64e41b[_0x31ca4c(0x1ca)]),console[_0x31ca4c(0x248)]('─'[_0x31ca4c(0x22b)](0x3c)));}for(const _0x325fdc of _0x221c9e){_0x325fdc['diff']&&(console[_0x31ca4c(0x248)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x325fdc[_0x31ca4c(0x216)]+'\x27:'),console[_0x31ca4c(0x248)]('─'['repeat'](0x3c)),console[_0x31ca4c(0x248)](_0x325fdc[_0x31ca4c(0x1ca)]),console[_0x31ca4c(0x248)]('─'[_0x31ca4c(0x22b)](0x3c)));}for(const _0x45602f of _0x509457){_0x45602f[_0x31ca4c(0x1ca)]&&(console[_0x31ca4c(0x248)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x45602f['name']+'\x27:'),console[_0x31ca4c(0x248)]('─'['repeat'](0x3c)),console[_0x31ca4c(0x248)](_0x45602f[_0x31ca4c(0x1ca)]),console['log']('─'[_0x31ca4c(0x22b)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';['description']='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x1b5248(0x209)](_0x502ef8){const _0x1263b1=a4_0x1b5248,{options:_0x450f02,args:_0x32e4e7,tdx:_0x45efba}=_0x502ef8,_0xb2586=_0x32e4e7[0x0],_0x5afa32=_0x32e4e7[0x1],_0x4e6f81=_0x450f02[_0x1263b1(0x196)],_0x21b230=_0x450f02[_0x1263b1(0x1fd)],_0x534842=_0x450f02[_0x1263b1(0x1a5)],_0x3aec86=_0x450f02[_0x1263b1(0x24a)],_0x47914d=_0x450f02[_0x1263b1(0x1e2)],_0x49c96b=_0x450f02['agent'];let _0x3fd22b;if(_0xb2586){const _0x250d5e=a4_0x27fc33[_0x1263b1(0x1c8)](_0xb2586,_0x1263b1(0x1b7));if(existsSync(_0x250d5e))try{const _0x3da4cc=JSON['parse'](readFileSync(_0x250d5e,'utf-8'));_0x3da4cc['llm_project']&&(_0x3fd22b={'llm_project':_0x3da4cc[_0x1263b1(0x1ba)]});}catch{}}const _0x16a2eb=findAgentConfigPath(process['cwd']());let _0x1a76cc;if(_0x16a2eb)try{const _0x422b8d=JSON['parse'](readFileSync(_0x16a2eb,_0x1263b1(0x242)));_0x422b8d[_0x1263b1(0x1ba)]&&(_0x1a76cc={'llm_project':_0x422b8d[_0x1263b1(0x1ba)]});}catch{}const _0x34db2f=resolveAgentPullArgs({'arg':_0xb2586,'agentNameArg':_0x5afa32,'agentFlag':_0x49c96b,'contextProject':_0x47914d,'argDirConfig':_0x3fd22b,'cwdConfigPath':_0x16a2eb||undefined,'cwdConfig':_0x1a76cc}),{projectNameOrId:_0x2227eb,targetAgentName:_0x3884f3,existingOutputDir:_0x415d47,source:_0x3ae08e}=_0x34db2f;if(_0x3ae08e===_0x1263b1(0x20e))console[_0x1263b1(0x248)](a4_0x30a017['dim'](_0x1263b1(0x1f5)+a4_0x27fc33[_0x1263b1(0x1c8)](_0xb2586,_0x1263b1(0x1b7))+':\x20'+_0x2227eb));else{if(_0x3ae08e==='cwd-config')console['log'](a4_0x30a017['dim'](_0x1263b1(0x22f)+_0x2227eb));else _0x3ae08e===_0x1263b1(0x203)&&console[_0x1263b1(0x248)](a4_0x30a017[_0x1263b1(0x217)](_0x1263b1(0x227)+_0x2227eb));}if(!_0x2227eb)return _0x49c96b?(console[_0x1263b1(0x248)](a4_0x30a017[_0x1263b1(0x240)](_0x1263b1(0x236))),console[_0x1263b1(0x248)](_0x1263b1(0x1cd)),console[_0x1263b1(0x248)](_0x1263b1(0x1ed))):(console[_0x1263b1(0x248)](a4_0x30a017[_0x1263b1(0x240)](_0x1263b1(0x1bc))),console[_0x1263b1(0x248)](_0x1263b1(0x1bd)),console[_0x1263b1(0x248)](_0x1263b1(0x24b)),console[_0x1263b1(0x248)](_0x1263b1(0x22a)),console[_0x1263b1(0x248)]('\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[_0x1263b1(0x248)]('\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')),0x1;if(_0x3884f3){const {data:_0xc02a1}=await withSpinner(_0x1263b1(0x1ec)+_0x3884f3+'\x22\x20from\x20project\x20\x22'+_0x2227eb+_0x1263b1(0x1e5),()=>_0x45efba[_0x1263b1(0x1e7)][_0x1263b1(0x202)](_0x2227eb,_0x3884f3,_0x4e6f81,{'dryRun':_0x21b230,'force':_0x534842}));if(_0x21b230)return console[_0x1263b1(0x248)](a4_0x30a017['yellow'](_0x1263b1(0x1df))),console['log'](_0x1263b1(0x1c3)+_0xc02a1[_0x1263b1(0x207)]),console['log'](_0x1263b1(0x1ef)+_0xc02a1[_0x1263b1(0x230)]),_0xc02a1[_0x1263b1(0x1ca)]&&(console[_0x1263b1(0x248)](_0x1263b1(0x232)),console[_0x1263b1(0x248)]('─'[_0x1263b1(0x22b)](0x3c)),console['log'](_0xc02a1['diff']),console[_0x1263b1(0x248)]('─'['repeat'](0x3c))),0x0;return console['log'](a4_0x30a017['green'](_0x1263b1(0x1d5))),console['log']('Agent:\x20'+_0xc02a1[_0x1263b1(0x207)]),console[_0x1263b1(0x248)](_0x1263b1(0x210)+_0xc02a1['outputPath']),console[_0x1263b1(0x248)](_0x1263b1(0x1fe)+(_0xc02a1[_0x1263b1(0x1a4)]?a4_0x30a017['green'](_0x1263b1(0x249)):_0xc02a1['hasChanges']?a4_0x30a017[_0x1263b1(0x240)](_0x1263b1(0x218)):a4_0x30a017['gray'](_0x1263b1(0x1c0)))),0x0;}const _0x45d87c=_0x415d47||_0x4e6f81,{data:_0x4d73b6}=await withSpinner('Analyzing\x20project\x20\x22'+_0x2227eb+_0x1263b1(0x1e5),()=>_0x45efba[_0x1263b1(0x1e7)][_0x1263b1(0x238)](_0x2227eb,_0x45d87c,{'dryRun':!![]})),_0x2e32fd=_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x208)][_0x1263b1(0x249)]+_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x1c9)][_0x1263b1(0x249)]+_0x4d73b6['counts']['textKnowledgeBases']['new']+_0x4d73b6[_0x1263b1(0x220)]['prompts'][_0x1263b1(0x249)]+_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x22d)][_0x1263b1(0x249)]+_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x19c)]['new']+_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x1d1)][_0x1263b1(0x249)],_0x2da48d=_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x208)]['updated']+_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x1c9)]['updated']+_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x19b)][_0x1263b1(0x218)]+_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x1a3)][_0x1263b1(0x218)]+_0x4d73b6['counts'][_0x1263b1(0x22d)][_0x1263b1(0x218)]+_0x4d73b6[_0x1263b1(0x220)]['experimentalKnowledgeBases'][_0x1263b1(0x218)]+_0x4d73b6[_0x1263b1(0x220)]['experimentalArtifacts']['updated'],_0x5bdcc1=_0x4d73b6['counts'][_0x1263b1(0x208)]['unchanged']+_0x4d73b6['counts'][_0x1263b1(0x1c9)]['unchanged']+_0x4d73b6['counts'][_0x1263b1(0x19b)]['unchanged']+_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x1a3)][_0x1263b1(0x1c0)]+_0x4d73b6['counts'][_0x1263b1(0x22d)][_0x1263b1(0x1c0)]+_0x4d73b6[_0x1263b1(0x220)]['experimentalKnowledgeBases'][_0x1263b1(0x1c0)]+_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x1d1)][_0x1263b1(0x1c0)];console['log'](_0x1263b1(0x24e)+_0x4d73b6[_0x1263b1(0x206)]+'\x27:'),console[_0x1263b1(0x248)]('\x20\x20'+a4_0x30a017[_0x1263b1(0x24c)]('+\x20'+_0x2e32fd+_0x1263b1(0x1d8))+_0x1263b1(0x245)+a4_0x30a017['yellow']('~\x20'+_0x2da48d+'\x20changed')+'\x20|\x20'+a4_0x30a017['dim']('=\x20'+_0x5bdcc1+'\x20unchanged')),console['log'](_0x1263b1(0x1c5)+formatCountSummary(_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x208)])),console[_0x1263b1(0x248)](_0x1263b1(0x195)+formatCountSummary(_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x1c9)])),console[_0x1263b1(0x248)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x19b)])),console['log'](_0x1263b1(0x1b2)+formatCountSummary(_0x4d73b6['counts'][_0x1263b1(0x1a3)])),console['log'](_0x1263b1(0x226)+formatCountSummary(_0x4d73b6[_0x1263b1(0x220)]['integrations']));const _0x29a438=_0x4d73b6['counts'][_0x1263b1(0x19c)]['total']>0x0||_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x1d1)]['total']>0x0;_0x29a438&&(console[_0x1263b1(0x248)](_0x1263b1(0x213)+formatCountSummary(_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x19c)])),console[_0x1263b1(0x248)](_0x1263b1(0x1d7)+formatCountSummary(_0x4d73b6[_0x1263b1(0x220)][_0x1263b1(0x1d1)])));console['log'](_0x1263b1(0x219)+a4_0x30a017[_0x1263b1(0x22c)](_0x4d73b6[_0x1263b1(0x1c7)])),displayDiffs(_0x4d73b6[_0x1263b1(0x208)],_0x4d73b6[_0x1263b1(0x1c9)],_0x4d73b6['textKnowledgeBases'],_0x4d73b6[_0x1263b1(0x1a3)],_0x4d73b6[_0x1263b1(0x22d)],_0x4d73b6[_0x1263b1(0x19c)],_0x4d73b6[_0x1263b1(0x1d1)]);if(_0x21b230)return console[_0x1263b1(0x248)](a4_0x30a017[_0x1263b1(0x240)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x2e32fd===0x0&&_0x2da48d===0x0)return console['log'](a4_0x30a017[_0x1263b1(0x24c)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x4d73b6[_0x1263b1(0x206)]},_0x450f02[_0x1263b1(0x237)]),console[_0x1263b1(0x248)](a4_0x30a017[_0x1263b1(0x24c)](_0x1263b1(0x1d9)+a4_0x30a017['dim'](_0x1263b1(0x1ba))+'\x20=\x20'+a4_0x30a017[_0x1263b1(0x22c)](_0x4d73b6[_0x1263b1(0x206)]))),0x0;if(!_0x3aec86&&!_0x534842){if(!isInteractive())return console['error'](a4_0x30a017['red'](_0x1263b1(0x1bf)),_0x1263b1(0x21b)),console[_0x1263b1(0x1d4)](a4_0x30a017[_0x1263b1(0x217)](_0x1263b1(0x1a8))),0x1;const _0x129003=await confirmKey(_0x1263b1(0x19a)+(_0x2e32fd+_0x2da48d)+_0x1263b1(0x1ce));if(!_0x129003)return console[_0x1263b1(0x248)](a4_0x30a017[_0x1263b1(0x240)](_0x1263b1(0x1f7)),_0x1263b1(0x1be)),0x1;}const {data:_0xb5a8f0}=await withSpinner(_0x1263b1(0x1b0),()=>_0x45efba[_0x1263b1(0x1e7)][_0x1263b1(0x238)](_0x2227eb,_0x45d87c,{'force':_0x534842}));return console['log'](a4_0x30a017['green'](_0x1263b1(0x1aa)+(_0x2e32fd+_0x2da48d)+'\x20files\x20to\x20'+_0xb5a8f0[_0x1263b1(0x1c7)])),saveSessionContext({'llm_project':_0xb5a8f0[_0x1263b1(0x206)]},_0x450f02[_0x1263b1(0x237)]),console[_0x1263b1(0x248)](a4_0x30a017[_0x1263b1(0x24c)](_0x1263b1(0x1d9)+a4_0x30a017[_0x1263b1(0x217)](_0x1263b1(0x1ba))+_0x1263b1(0x1ff)+a4_0x30a017[_0x1263b1(0x22c)](_0xb5a8f0['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x1b5248(0x216)]=a4_0x1b5248(0x1e8);[a4_0x1b5248(0x231)]=a4_0x1b5248(0x22e);async['execute'](_0xcb2227){const _0x4c4061=a4_0x1b5248,{options:_0x3424c8,args:_0x374159,tdx:_0x4a222c}=_0xcb2227,_0x287dcf=_0x374159[0x0],_0xb94cbf=_0x3424c8[_0x4c4061(0x216)],_0x1b0e0e=_0x3424c8['dryRun'],_0x2b56c8=_0x3424c8[_0x4c4061(0x24a)],_0x49ef3a=_0x3424c8[_0x4c4061(0x1e9)],_0x13dc95=_0x3424c8['llmProject'];let _0x250fdf;const _0x123eff=findAgentConfigPath(process[_0x4c4061(0x221)]());if(_0x287dcf){const _0x56865d=a4_0x27fc33[_0x4c4061(0x1c8)](_0x287dcf,_0x4c4061(0x1b7));existsSync(_0x56865d)?(_0x250fdf=_0x287dcf,console[_0x4c4061(0x248)](a4_0x30a017['dim'](_0x4c4061(0x23c)+_0x287dcf))):_0x250fdf=_0x287dcf;}else{if(_0x123eff)_0x250fdf=a4_0x27fc33['dirname'](_0x123eff),console[_0x4c4061(0x248)](a4_0x30a017[_0x4c4061(0x217)](_0x4c4061(0x223)+_0x250fdf));else{if(_0x13dc95){const _0xf371b3=sanitizeForFilesystem(_0x13dc95);let _0x184738=_0xf371b3,_0x34c7d0=a4_0x27fc33[_0x4c4061(0x1c8)](process['cwd'](),_0x4c4061(0x208),_0xf371b3,_0x4c4061(0x1b7));if(!existsSync(_0x34c7d0)){const _0x23ad7f=normalizeName(_0x13dc95),_0x49834c=a4_0x27fc33[_0x4c4061(0x1c8)](process[_0x4c4061(0x221)](),_0x4c4061(0x208),_0x23ad7f,_0x4c4061(0x1b7));existsSync(_0x49834c)&&(_0x184738=_0x23ad7f,_0x34c7d0=_0x49834c);}if(existsSync(_0x34c7d0))_0x250fdf=a4_0x27fc33['dirname'](_0x34c7d0),console[_0x4c4061(0x248)](a4_0x30a017[_0x4c4061(0x217)]('Using\x20local\x20project:\x20'+_0x250fdf));else{const _0x115c2c=_0x3424c8[_0x4c4061(0x1ac)];if(_0x115c2c)throw new SDKError(ErrorCode[_0x4c4061(0x20b)],_0x4c4061(0x1a2)+_0x13dc95+_0x4c4061(0x1ae),undefined,{'helpText':_0x4c4061(0x1dc)+_0x4c4061(0x1f3)+(_0x4c4061(0x1a9)+_0x13dc95+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x184738+_0x4c4061(0x1fc)+(_0xb94cbf||'<new-name>')+_0x4c4061(0x214)+_0x115c2c)});_0x250fdf=_0x13dc95,console[_0x4c4061(0x248)](a4_0x30a017[_0x4c4061(0x217)](_0x4c4061(0x1dd)+_0x13dc95));}}}}if(!_0x250fdf)return console[_0x4c4061(0x248)](a4_0x30a017[_0x4c4061(0x240)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x4c4061(0x248)](_0x4c4061(0x224)),console[_0x4c4061(0x248)](_0x4c4061(0x1af)),console['log'](_0x4c4061(0x233)),console[_0x4c4061(0x248)](_0x4c4061(0x1fb)),0x1;if(!_0xb94cbf)throw new SDKError(ErrorCode[_0x4c4061(0x1e3)],_0x4c4061(0x1b1),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x2b56c8&&!_0x1b0e0e){if(!isInteractive())return console[_0x4c4061(0x1d4)](a4_0x30a017[_0x4c4061(0x1f9)](_0x4c4061(0x1bf)),_0x4c4061(0x21b)),console['error'](a4_0x30a017[_0x4c4061(0x217)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x15a910=await confirmKey(_0x4c4061(0x21c)+_0x250fdf+_0x4c4061(0x21f)+_0xb94cbf+'\x22?');if(!_0x15a910)return console['log'](a4_0x30a017[_0x4c4061(0x240)](_0x4c4061(0x1f7))),0x1;}const {data:_0x5436f8}=await withSpinner(_0x4c4061(0x1eb)+_0x250fdf+_0x4c4061(0x23e)+_0xb94cbf+'\x22...',()=>_0x4a222c[_0x4c4061(0x1e7)][_0x4c4061(0x1b3)](_0x250fdf,_0xb94cbf,{'dryRun':_0x1b0e0e}));if(_0x1b0e0e){console['log'](a4_0x30a017[_0x4c4061(0x240)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x4c4061(0x248)](_0x4c4061(0x235)+_0x5436f8[_0x4c4061(0x222)]),console['log'](_0x4c4061(0x198)+_0xb94cbf),console[_0x4c4061(0x248)](_0x4c4061(0x241)),console[_0x4c4061(0x248)](_0x4c4061(0x1c5)+_0x5436f8['counts'][_0x4c4061(0x208)][_0x4c4061(0x1f4)]),console[_0x4c4061(0x248)](_0x4c4061(0x195)+_0x5436f8['counts'][_0x4c4061(0x1c9)][_0x4c4061(0x1f4)]),console['log'](_0x4c4061(0x1b2)+_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x1a3)][_0x4c4061(0x1f4)]);const _0x1b24a4=_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x19c)][_0x4c4061(0x1f4)]>0x0||_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x1d1)][_0x4c4061(0x1f4)]>0x0;return _0x1b24a4&&(console['log'](_0x4c4061(0x213)+_0x5436f8[_0x4c4061(0x220)]['experimentalKnowledgeBases']['created']),console['log'](_0x4c4061(0x1d7)+_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x1d1)]['created'])),0x0;}const _0x2697a2=_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x208)][_0x4c4061(0x1ab)]>0x0||_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x1c9)][_0x4c4061(0x1ab)]>0x0||_0x5436f8['counts'][_0x4c4061(0x1a3)][_0x4c4061(0x1ab)]>0x0||_0x5436f8['counts'][_0x4c4061(0x19c)]['errors']>0x0||_0x5436f8[_0x4c4061(0x220)]['experimentalArtifacts'][_0x4c4061(0x1ab)]>0x0;_0x2697a2?console[_0x4c4061(0x248)](a4_0x30a017[_0x4c4061(0x240)](_0x4c4061(0x1d2))):console[_0x4c4061(0x248)](a4_0x30a017['green']('Project\x20cloned\x20successfully'));console['log'](_0x4c4061(0x235)+_0x5436f8[_0x4c4061(0x222)]),console[_0x4c4061(0x248)](_0x4c4061(0x198)+_0x5436f8[_0x4c4061(0x211)]),console[_0x4c4061(0x248)](_0x4c4061(0x205)+_0x5436f8[_0x4c4061(0x20a)]),console[_0x4c4061(0x248)](),console[_0x4c4061(0x248)]('Summary:'),console[_0x4c4061(0x248)](_0x4c4061(0x1c5)+formatCountSummary(_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x208)])),console[_0x4c4061(0x248)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x1c9)])),console[_0x4c4061(0x248)](_0x4c4061(0x1b2)+formatCountSummary(_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x1a3)])),console[_0x4c4061(0x248)](_0x4c4061(0x226)+formatCountSummary(_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x22d)]));const _0x23de76=_0x5436f8[_0x4c4061(0x220)]['experimentalKnowledgeBases'][_0x4c4061(0x1f4)]>0x0||_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x19c)]['updated']>0x0||_0x5436f8[_0x4c4061(0x220)]['experimentalKnowledgeBases'][_0x4c4061(0x1c0)]>0x0||_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x1d1)][_0x4c4061(0x1f4)]>0x0||_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x1d1)][_0x4c4061(0x218)]>0x0||_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x1d1)][_0x4c4061(0x1c0)]>0x0;_0x23de76&&(console[_0x4c4061(0x248)](_0x4c4061(0x213)+formatCountSummary(_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x19c)])),console[_0x4c4061(0x248)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x5436f8[_0x4c4061(0x220)][_0x4c4061(0x1d1)])));if(_0x2697a2){console[_0x4c4061(0x248)](),console['log'](a4_0x30a017['red'](_0x4c4061(0x1da)));for(const _0x16aba0 of _0x5436f8[_0x4c4061(0x208)]){_0x16aba0[_0x4c4061(0x1c4)]==='error'&&console[_0x4c4061(0x248)](a4_0x30a017['red'](_0x4c4061(0x1cc)+_0x16aba0['agentName']+_0x4c4061(0x1e0)+_0x16aba0[_0x4c4061(0x1d4)]));}for(const _0x5d2c56 of _0x5436f8[_0x4c4061(0x1c9)]){_0x5d2c56[_0x4c4061(0x1c4)]==='error'&&console[_0x4c4061(0x248)](a4_0x30a017[_0x4c4061(0x1f9)](_0x4c4061(0x1e4)+_0x5d2c56[_0x4c4061(0x216)]+_0x4c4061(0x1e0)+_0x5d2c56[_0x4c4061(0x1d4)]));}for(const _0x5ba6a2 of _0x5436f8[_0x4c4061(0x1a3)]){_0x5ba6a2[_0x4c4061(0x1c4)]==='error'&&console[_0x4c4061(0x248)](a4_0x30a017[_0x4c4061(0x1f9)](_0x4c4061(0x197)+_0x5ba6a2[_0x4c4061(0x216)]+_0x4c4061(0x1e0)+_0x5ba6a2[_0x4c4061(0x1d4)]));}for(const _0x285554 of _0x5436f8['integrations']){_0x285554['action']===_0x4c4061(0x1d4)&&console[_0x4c4061(0x248)](a4_0x30a017[_0x4c4061(0x1f9)](_0x4c4061(0x225)+_0x285554[_0x4c4061(0x216)]+'\x22:\x20'+_0x285554[_0x4c4061(0x1d4)]));}for(const _0x25d7e0 of _0x5436f8[_0x4c4061(0x19c)]){_0x25d7e0['action']===_0x4c4061(0x1d4)&&console[_0x4c4061(0x248)](a4_0x30a017[_0x4c4061(0x1f9)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x25d7e0[_0x4c4061(0x216)]+_0x4c4061(0x1e0)+_0x25d7e0[_0x4c4061(0x1d4)]));}for(const _0x2e0cfc of _0x5436f8['experimentalArtifacts']){_0x2e0cfc[_0x4c4061(0x1c4)]===_0x4c4061(0x1d4)&&console[_0x4c4061(0x248)](a4_0x30a017['red'](_0x4c4061(0x23a)+_0x2e0cfc['name']+'\x22:\x20'+_0x2e0cfc[_0x4c4061(0x1d4)]));}return 0x1;}console[_0x4c4061(0x248)]();const _0x566a30=getLLMProjectUrl(_0x49ef3a,_0x5436f8[_0x4c4061(0x20a)]);return console[_0x4c4061(0x248)](_0x4c4061(0x1c6)+a4_0x30a017['cyan'](_0x566a30)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x1b5248(0x229);[a4_0x1b5248(0x231)]=a4_0x1b5248(0x21e);async[a4_0x1b5248(0x209)](_0x2860f9){const _0x50f4c3=a4_0x1b5248,{options:_0x552aa9,args:_0x26bd35,tdx:_0xf07f7d}=_0x2860f9;let _0x5a4da8=_0x26bd35[0x0]||process[_0x50f4c3(0x221)]();const _0x343690=_0x552aa9['dryRun'],_0x1e7df1=_0x552aa9[_0x50f4c3(0x1a5)],_0x2b9344=_0x552aa9[_0x50f4c3(0x24a)],_0x5f1650=_0x552aa9[_0x50f4c3(0x1e9)],_0x6e07f7=a4_0x27fc33['join'](_0x5a4da8,_0x50f4c3(0x23b)),_0x20c48b=existsSync(_0x6e07f7);if(_0x20c48b){const {data:_0x3f8d77}=await withSpinner(_0x50f4c3(0x199)+_0x5a4da8+_0x50f4c3(0x1e5),()=>_0xf07f7d[_0x50f4c3(0x1e7)][_0x50f4c3(0x1d0)](_0x5a4da8,{'dryRun':_0x343690,'force':_0x1e7df1}));if(_0x343690)return console['log'](a4_0x30a017[_0x50f4c3(0x240)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x50f4c3(0x248)](_0x50f4c3(0x244)+_0x3f8d77[_0x50f4c3(0x207)]),0x0;if(_0x3f8d77[_0x50f4c3(0x1c4)]===_0x50f4c3(0x1d4))return console[_0x50f4c3(0x248)](a4_0x30a017[_0x50f4c3(0x1f9)](_0x50f4c3(0x1e6)+_0x3f8d77[_0x50f4c3(0x1d4)])),0x1;console[_0x50f4c3(0x248)](a4_0x30a017[_0x50f4c3(0x24c)](_0x50f4c3(0x215)+_0x3f8d77[_0x50f4c3(0x1c4)]+_0x50f4c3(0x204))),console[_0x50f4c3(0x248)]('Agent:\x20'+_0x3f8d77['agentName']);if(_0x3f8d77[_0x50f4c3(0x1ad)]&&_0x3f8d77[_0x50f4c3(0x21a)]){const _0x338190=getLLMAgentChatUrl(_0x5f1650,_0x3f8d77[_0x50f4c3(0x21a)],_0x3f8d77[_0x50f4c3(0x1ad)]);console[_0x50f4c3(0x248)](_0x50f4c3(0x1b4)+a4_0x30a017[_0x50f4c3(0x22c)](_0x338190));}return 0x0;}const _0x406619=_0x552aa9[_0x50f4c3(0x1e2)],_0x8bdd51=resolveProjectFromContext(_0x5a4da8,_0x406619);if(_0x8bdd51['found'])_0x5a4da8=_0x8bdd51[_0x50f4c3(0x21d)],_0x8bdd51['source']==='context'&&console[_0x50f4c3(0x248)](a4_0x30a017[_0x50f4c3(0x217)](_0x50f4c3(0x22f)+_0x5a4da8));else{let _0x265d2d=_0x50f4c3(0x23d);_0x8bdd51[_0x50f4c3(0x1b8)]===_0x50f4c3(0x1c1)&&(_0x265d2d=_0x8bdd51[_0x50f4c3(0x1a7)]+_0x50f4c3(0x1b6)+_0x8bdd51[_0x50f4c3(0x1e2)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x50f4c3(0x20b)],_0x8bdd51[_0x50f4c3(0x1b8)]===_0x50f4c3(0x228)?_0x8bdd51['message']:_0x50f4c3(0x1f6)+_0x5a4da8,undefined,{'helpText':_0x265d2d});}const {data:_0x113d40}=await withSpinner(_0x50f4c3(0x1b5),()=>_0xf07f7d[_0x50f4c3(0x1e7)]['pushProject'](_0x5a4da8,{'dryRun':!![]})),_0x45f9f8=_0x113d40[_0x50f4c3(0x220)]['agents']['errors']>0x0;if(_0x45f9f8){console['log'](a4_0x30a017['red'](_0x50f4c3(0x243)));for(const _0x5f47d8 of _0x113d40['agents']){_0x5f47d8['action']===_0x50f4c3(0x1d4)&&console[_0x50f4c3(0x248)](a4_0x30a017[_0x50f4c3(0x1f9)](_0x50f4c3(0x1cc)+_0x5f47d8[_0x50f4c3(0x207)]+_0x50f4c3(0x1e0)+_0x5f47d8['error']));}return 0x1;}const _0x4610aa=_0x113d40['counts'][_0x50f4c3(0x208)]['created']+_0x113d40['counts']['knowledgeBases']['created']+_0x113d40[_0x50f4c3(0x220)]['textKnowledgeBases'][_0x50f4c3(0x1f4)]+_0x113d40[_0x50f4c3(0x220)]['prompts']['created']+_0x113d40[_0x50f4c3(0x220)]['integrations'][_0x50f4c3(0x1f4)]+_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x19c)][_0x50f4c3(0x1f4)]+_0x113d40[_0x50f4c3(0x220)]['experimentalArtifacts'][_0x50f4c3(0x1f4)],_0x2d5d8a=_0x113d40[_0x50f4c3(0x220)]['agents'][_0x50f4c3(0x218)]+_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x1c9)][_0x50f4c3(0x218)]+_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x19b)][_0x50f4c3(0x218)]+_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x1a3)][_0x50f4c3(0x218)]+_0x113d40['counts']['integrations'][_0x50f4c3(0x218)]+_0x113d40[_0x50f4c3(0x220)]['experimentalKnowledgeBases'][_0x50f4c3(0x218)]+_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x1d1)]['updated'],_0x20eda6=_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x208)][_0x50f4c3(0x1c0)]+_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x1c9)]['unchanged']+_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x19b)][_0x50f4c3(0x1c0)]+_0x113d40['counts'][_0x50f4c3(0x1a3)][_0x50f4c3(0x1c0)]+_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x22d)]['unchanged']+_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x19c)][_0x50f4c3(0x1c0)]+_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x1d1)][_0x50f4c3(0x1c0)];console[_0x50f4c3(0x248)](_0x50f4c3(0x19f)+_0x113d40[_0x50f4c3(0x206)]+'\x27:'),console['log']('\x20\x20'+a4_0x30a017[_0x50f4c3(0x24c)]('+\x20'+_0x4610aa+_0x50f4c3(0x1d8))+'\x20|\x20'+a4_0x30a017[_0x50f4c3(0x240)]('~\x20'+_0x2d5d8a+_0x50f4c3(0x1cf))+_0x50f4c3(0x245)+a4_0x30a017[_0x50f4c3(0x217)]('=\x20'+_0x20eda6+_0x50f4c3(0x1d6))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x208)])),console[_0x50f4c3(0x248)](_0x50f4c3(0x195)+formatCountSummary(_0x113d40[_0x50f4c3(0x220)]['knowledgeBases'])),console['log'](_0x50f4c3(0x1a0)+formatCountSummary(_0x113d40[_0x50f4c3(0x220)]['textKnowledgeBases'])),console['log'](_0x50f4c3(0x1b2)+formatCountSummary(_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x1a3)])),console[_0x50f4c3(0x248)](_0x50f4c3(0x226)+formatCountSummary(_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x22d)]));const _0x4deff8=_0x113d40['counts']['experimentalKnowledgeBases'][_0x50f4c3(0x1f4)]>0x0||_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x19c)][_0x50f4c3(0x218)]>0x0||_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x19c)]['unchanged']>0x0||_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x1d1)][_0x50f4c3(0x1f4)]>0x0||_0x113d40['counts'][_0x50f4c3(0x1d1)][_0x50f4c3(0x218)]>0x0||_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x1d1)]['unchanged']>0x0;_0x4deff8&&(console['log'](_0x50f4c3(0x213)+formatCountSummary(_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x19c)])),console[_0x50f4c3(0x248)](_0x50f4c3(0x1d7)+formatCountSummary(_0x113d40[_0x50f4c3(0x220)][_0x50f4c3(0x1d1)])));console[_0x50f4c3(0x248)](_0x50f4c3(0x1d3)+a4_0x30a017['cyan'](_0x5a4da8)),displayDiffs(_0x113d40[_0x50f4c3(0x208)],_0x113d40[_0x50f4c3(0x1c9)],_0x113d40[_0x50f4c3(0x19b)],_0x113d40[_0x50f4c3(0x1a3)],_0x113d40[_0x50f4c3(0x22d)],_0x113d40['experimentalKnowledgeBases'],_0x113d40['experimentalArtifacts']);if(_0x343690)return console[_0x50f4c3(0x248)](a4_0x30a017[_0x50f4c3(0x240)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x4610aa===0x0&&_0x2d5d8a===0x0){console[_0x50f4c3(0x248)](a4_0x30a017[_0x50f4c3(0x24c)](_0x50f4c3(0x1ee)));const _0x1c088b=getLLMProjectUrl(_0x5f1650,_0x113d40[_0x50f4c3(0x21a)]);return console[_0x50f4c3(0x248)](_0x50f4c3(0x1c6)+a4_0x30a017['cyan'](_0x1c088b)),0x0;}if(!_0x2b9344&&!_0x1e7df1){if(!isInteractive())return console[_0x50f4c3(0x1d4)](a4_0x30a017['red'](_0x50f4c3(0x1bf)),_0x50f4c3(0x21b)),console[_0x50f4c3(0x1d4)](a4_0x30a017[_0x50f4c3(0x217)](_0x50f4c3(0x1a8))),0x1;const _0x389f22=await confirmKey(_0x50f4c3(0x247)+(_0x4610aa+_0x2d5d8a)+_0x50f4c3(0x19e));if(!_0x389f22)return console[_0x50f4c3(0x248)](a4_0x30a017['yellow']('Cancelled'),_0x50f4c3(0x1b9)),0x1;}const {data:_0x45aeee}=await withSpinner(_0x50f4c3(0x20f),()=>_0xf07f7d['llm'][_0x50f4c3(0x1db)](_0x5a4da8,{'force':_0x1e7df1})),_0x899f9e=_0x45aeee[_0x50f4c3(0x220)][_0x50f4c3(0x208)][_0x50f4c3(0x1ab)]>0x0||_0x45aeee['counts'][_0x50f4c3(0x1c9)][_0x50f4c3(0x1ab)]>0x0||_0x45aeee[_0x50f4c3(0x220)][_0x50f4c3(0x19b)]['errors']>0x0||_0x45aeee[_0x50f4c3(0x220)][_0x50f4c3(0x1a3)][_0x50f4c3(0x1ab)]>0x0;if(_0x899f9e){console[_0x50f4c3(0x248)](a4_0x30a017['yellow'](_0x50f4c3(0x1c2))),console['log'](),console[_0x50f4c3(0x248)](a4_0x30a017[_0x50f4c3(0x1f9)](_0x50f4c3(0x1da)));for(const _0x3a8b39 of _0x45aeee[_0x50f4c3(0x208)]){_0x3a8b39[_0x50f4c3(0x1c4)]===_0x50f4c3(0x1d4)&&console['log'](a4_0x30a017[_0x50f4c3(0x1f9)](_0x50f4c3(0x1cc)+_0x3a8b39['agentName']+'\x22:\x20'+_0x3a8b39[_0x50f4c3(0x1d4)]));}for(const _0x5d4102 of _0x45aeee[_0x50f4c3(0x1c9)]){_0x5d4102['action']==='error'&&console[_0x50f4c3(0x248)](a4_0x30a017[_0x50f4c3(0x1f9)](_0x50f4c3(0x1e4)+_0x5d4102[_0x50f4c3(0x216)]+_0x50f4c3(0x1e0)+_0x5d4102['error']));}for(const _0x263940 of _0x45aeee[_0x50f4c3(0x19b)]){_0x263940[_0x50f4c3(0x1c4)]===_0x50f4c3(0x1d4)&&console['log'](a4_0x30a017[_0x50f4c3(0x1f9)](_0x50f4c3(0x1ea)+_0x263940[_0x50f4c3(0x216)]+_0x50f4c3(0x1e0)+_0x263940[_0x50f4c3(0x1d4)]));}for(const _0x558b71 of _0x45aeee[_0x50f4c3(0x1a3)]){_0x558b71[_0x50f4c3(0x1c4)]==='error'&&console[_0x50f4c3(0x248)](a4_0x30a017['red'](_0x50f4c3(0x197)+_0x558b71[_0x50f4c3(0x216)]+'\x22:\x20'+_0x558b71['error']));}for(const _0xf35aa2 of _0x45aeee['integrations']){_0xf35aa2[_0x50f4c3(0x1c4)]===_0x50f4c3(0x1d4)&&console[_0x50f4c3(0x248)](a4_0x30a017[_0x50f4c3(0x1f9)]('\x20\x20Integration\x20\x22'+_0xf35aa2[_0x50f4c3(0x216)]+_0x50f4c3(0x1e0)+_0xf35aa2[_0x50f4c3(0x1d4)]));}return 0x1;}console[_0x50f4c3(0x248)](a4_0x30a017[_0x50f4c3(0x24c)]('\x0a✔\x20Pushed\x20'+(_0x4610aa+_0x2d5d8a)+_0x50f4c3(0x1a1)+_0x45aeee['projectName']+'\x27'));const _0x4e475f=getLLMProjectUrl(_0x5f1650,_0x45aeee[_0x50f4c3(0x21a)]);return console[_0x50f4c3(0x248)](_0x50f4c3(0x1c6)+a4_0x30a017[_0x50f4c3(0x22c)](_0x4e475f)),0x0;}}
1
+ const a4_0x5ef285=a4_0x3072;(function(_0x2a4e38,_0xf6c6b0){const _0x2e3728=a4_0x3072,_0x4c71c7=_0x2a4e38();while(!![]){try{const _0x897a03=parseInt(_0x2e3728(0x195))/0x1*(parseInt(_0x2e3728(0x19a))/0x2)+-parseInt(_0x2e3728(0x198))/0x3+parseInt(_0x2e3728(0x1d4))/0x4+-parseInt(_0x2e3728(0x19f))/0x5*(-parseInt(_0x2e3728(0x1e1))/0x6)+-parseInt(_0x2e3728(0x1ec))/0x7*(-parseInt(_0x2e3728(0x1f4))/0x8)+parseInt(_0x2e3728(0x14d))/0x9+-parseInt(_0x2e3728(0x1a7))/0xa;if(_0x897a03===_0xf6c6b0)break;else _0x4c71c7['push'](_0x4c71c7['shift']());}catch(_0x11190d){_0x4c71c7['push'](_0x4c71c7['shift']());}}}(a4_0x521a,0xa6f62));import a4_0x29ffea from'chalk';import a4_0x3f29c1 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a4_0x521a(){const _0x19f3e3=['\x20updated','newProjectId','cloneProject','\x0aError:','unchanged','llmProject','created','pushAgent','Status:\x20','Agent:\x20','\x22...','\x0a✔\x20Pulled\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20\x20Target:\x20','Pushing\x20to\x20project...','Dry\x20run\x20-\x20no\x20files\x20written','Agent\x20pulled\x20successfully','Project:\x20','\x20\x20Knowledge\x20Bases:\x20','yellow','\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','no_local_folder','\x20errors','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Using\x20project:\x20','\x20=\x20','name','dirname','\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','\x20changed','\x0aProject\x20pushed\x20with\x20errors','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','red','\x20\x20Text\x20Knowledge\x20Bases:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20unchanged','found','new','\x20\x20Knowledge\x20Base\x20\x22','pullProject','session','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x0aChanges\x20to\x20agent\x20\x27','projectName','\x20\x20Prompts:\x20','\x20\x20Integrations:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20\x20Agents:\x20','experimentalKnowledgeBases','Project\x20cloned\x20with\x20errors','dim','agent.yml','Clone\x20\x22','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x0aChanges\x20to\x20prompt\x20\x27','\x20|\x20','\x20--name\x20','isNew','\x0aErrors\x20found:','<new-name>','agentName','\x20files?','INVALID_ARGUMENT','newProjectName','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','2iIeeLb','Output:\x20','action','1138833AwPVnX','errors','797992hKKOCy','llm_project','force','New\x20project\x20ID:\x20','outputDir','5pJtHmV','Using\x20current\x20project:\x20','agent','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','prompts','projectDir','site','Would\x20pull\x20agent:\x20','19951650uvAbyJ','error','profile','integrations','agents','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)','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','execute','yes','\x22\x20to\x20a\x20different\x20profile','cyan','log','sourceProjectName','Pulling\x20agent\x20\x22','projectId','\x0aPush\x20summary\x20for\x20\x27','\x20\x20Integration\x20\x22','Summary:','\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','\x20\x20Experimental\x20Artifact\x20\x22','source','Cancelled','knowledgeBases','New\x20project:\x20','cwd','counts','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','repeat','agentId','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','gray','Pushing\x20agent\x20from\x20\x22','MISSING_ARGUMENT','\x22\x20from\x20project\x20\x22','Using\x20context\x20project:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','agent:pull','\x20\x20Prompt\x20\x22','parse','Errors:','agent:push','Using\x20local\x20project:\x20','\x20created','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','3637804FUwbNU','\x22\x20to\x20\x22','Failed\x20to\x20push\x20agent:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','utf-8','diff','\x22:\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','textKnowledgeBases','\x20\x20Agent\x20\x22','✔\x20Context\x20set:\x20','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','experimentalArtifacts','5493252qRmUSN','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\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)','Chat:\x20','Project\x20cloned\x20successfully','\x20total','\x22\x20to\x20new\x20project\x20\x22','\x0a✔\x20Pushed\x20','tdx.json','dryRun','llm','91168qRptzN','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','outputPath','Analyzing\x20project\x20\x22','updated','Using\x20project\x20from\x20','\x20files\x20to\x20','\x0aChanges\x20to\x20integration\x20\x27','80kPsAqH','Cloning\x20\x22','green','\x20new','join','Analyzing\x20changes\x20to\x20push...','description','\x20\x20tdx\x20agent\x20pull\x20','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','total','Source:\x20','2748825hXIkDD','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','hasChanges','push','-\x20no\x20files\x20written','No\x20tdx.json\x20found\x20in\x20','message'];a4_0x521a=function(){return _0x19f3e3;};return a4_0x521a();}function a4_0x3072(_0x429b9b,_0x390f57){_0x429b9b=_0x429b9b-0x146;const _0x521af0=a4_0x521a();let _0x30727e=_0x521af0[_0x429b9b];return _0x30727e;}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(_0x295f6a){const _0x16fd5f=a4_0x3072,_0x5dcba4=[];if(_0x295f6a[_0x16fd5f(0x14b)]!==undefined)_0x5dcba4[_0x16fd5f(0x150)](_0x295f6a[_0x16fd5f(0x14b)]+_0x16fd5f(0x1e6));if(_0x295f6a[_0x16fd5f(0x179)]!==undefined&&_0x295f6a[_0x16fd5f(0x179)]>0x0)_0x5dcba4[_0x16fd5f(0x150)](a4_0x29ffea[_0x16fd5f(0x1f6)](_0x295f6a[_0x16fd5f(0x179)]+_0x16fd5f(0x1f7)));if(_0x295f6a[_0x16fd5f(0x15a)]!==undefined&&_0x295f6a['created']>0x0)_0x5dcba4[_0x16fd5f(0x150)](a4_0x29ffea['green'](_0x295f6a['created']+_0x16fd5f(0x1d2)));if(_0x295f6a[_0x16fd5f(0x1f0)]!==undefined&&_0x295f6a[_0x16fd5f(0x1f0)]>0x0)_0x5dcba4['push'](a4_0x29ffea[_0x16fd5f(0x167)](_0x295f6a[_0x16fd5f(0x1f0)]+_0x16fd5f(0x154)));if(_0x295f6a[_0x16fd5f(0x158)]!==undefined&&_0x295f6a['unchanged']>0x0)_0x5dcba4[_0x16fd5f(0x150)](a4_0x29ffea[_0x16fd5f(0x1c6)](_0x295f6a[_0x16fd5f(0x158)]+_0x16fd5f(0x177)));if(_0x295f6a[_0x16fd5f(0x199)]!==undefined&&_0x295f6a['errors']>0x0)_0x5dcba4[_0x16fd5f(0x150)](a4_0x29ffea['red'](_0x295f6a['errors']+_0x16fd5f(0x16a)));return _0x5dcba4['join'](',\x20');}function displayDiffs(_0x5f4b1a,_0x50bc1b,_0x8186db,_0x412bad,_0x49ab9e,_0x507d4e,_0x108d82){const _0x5700f9=a4_0x3072;for(const _0x3fe34a of _0x5f4b1a){if(_0x3fe34a[_0x5700f9(0x1d9)]){const _0x4a1655=_0x3fe34a[_0x5700f9(0x190)]||_0x3fe34a[_0x5700f9(0x16e)];console[_0x5700f9(0x1b2)](_0x5700f9(0x17e)+_0x4a1655+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x5700f9(0x1b2)](_0x3fe34a[_0x5700f9(0x1d9)]),console[_0x5700f9(0x1b2)]('─'[_0x5700f9(0x1c2)](0x3c));}}for(const _0x2960ff of _0x50bc1b){_0x2960ff[_0x5700f9(0x1d9)]&&(console[_0x5700f9(0x1b2)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x2960ff[_0x5700f9(0x16e)]+'\x27:'),console[_0x5700f9(0x1b2)]('─'[_0x5700f9(0x1c2)](0x3c)),console[_0x5700f9(0x1b2)](_0x2960ff[_0x5700f9(0x1d9)]),console[_0x5700f9(0x1b2)]('─'[_0x5700f9(0x1c2)](0x3c)));}for(const _0x5d60f3 of _0x8186db){_0x5d60f3[_0x5700f9(0x1d9)]&&(console[_0x5700f9(0x1b2)](_0x5700f9(0x1d3)+_0x5d60f3[_0x5700f9(0x16e)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x5700f9(0x1b2)](_0x5d60f3[_0x5700f9(0x1d9)]),console[_0x5700f9(0x1b2)]('─'['repeat'](0x3c)));}for(const _0xb1ca4f of _0x412bad){_0xb1ca4f[_0x5700f9(0x1d9)]&&(console[_0x5700f9(0x1b2)](_0x5700f9(0x18a)+_0xb1ca4f[_0x5700f9(0x16e)]+'\x27:'),console[_0x5700f9(0x1b2)]('─'[_0x5700f9(0x1c2)](0x3c)),console[_0x5700f9(0x1b2)](_0xb1ca4f['diff']),console[_0x5700f9(0x1b2)]('─'[_0x5700f9(0x1c2)](0x3c)));}for(const _0x93c0da of _0x49ab9e){_0x93c0da['diff']&&(console[_0x5700f9(0x1b2)](_0x5700f9(0x1f3)+_0x93c0da[_0x5700f9(0x16e)]+'\x27:'),console[_0x5700f9(0x1b2)]('─'[_0x5700f9(0x1c2)](0x3c)),console[_0x5700f9(0x1b2)](_0x93c0da[_0x5700f9(0x1d9)]),console['log']('─'[_0x5700f9(0x1c2)](0x3c)));}for(const _0x1cd3bc of _0x507d4e){_0x1cd3bc['diff']&&(console[_0x5700f9(0x1b2)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x1cd3bc[_0x5700f9(0x16e)]+'\x27:'),console[_0x5700f9(0x1b2)]('─'[_0x5700f9(0x1c2)](0x3c)),console[_0x5700f9(0x1b2)](_0x1cd3bc[_0x5700f9(0x1d9)]),console[_0x5700f9(0x1b2)]('─'['repeat'](0x3c)));}for(const _0x2cf665 of _0x108d82){_0x2cf665[_0x5700f9(0x1d9)]&&(console[_0x5700f9(0x1b2)](_0x5700f9(0x14a)+_0x2cf665[_0x5700f9(0x16e)]+'\x27:'),console[_0x5700f9(0x1b2)]('─'[_0x5700f9(0x1c2)](0x3c)),console[_0x5700f9(0x1b2)](_0x2cf665[_0x5700f9(0x1d9)]),console[_0x5700f9(0x1b2)]('─'[_0x5700f9(0x1c2)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x5ef285(0x16e)]=a4_0x5ef285(0x1cc);[a4_0x5ef285(0x148)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x5ef285(0x1ae)](_0x24bffb){const _0x453e96=a4_0x5ef285,{options:_0x584f4b,args:_0x36ce94,tdx:_0x1a7345}=_0x24bffb,_0x858d10=_0x36ce94[0x0],_0x1b2518=_0x36ce94[0x1],_0x76bbfc=_0x584f4b['output'],_0x31ede5=_0x584f4b[_0x453e96(0x1ea)],_0x985549=_0x584f4b['force'],_0x29911f=_0x584f4b['yes'],_0x12e83f=_0x584f4b['llmProject'],_0x30a00f=_0x584f4b[_0x453e96(0x1a1)];let _0xe75adb;if(_0x858d10){const _0x591cff=a4_0x3f29c1[_0x453e96(0x146)](_0x858d10,'tdx.json');if(existsSync(_0x591cff))try{const _0x1ed810=JSON[_0x453e96(0x1ce)](readFileSync(_0x591cff,_0x453e96(0x1d8)));_0x1ed810[_0x453e96(0x19b)]&&(_0xe75adb={'llm_project':_0x1ed810[_0x453e96(0x19b)]});}catch{}}const _0x5e4106=findAgentConfigPath(process[_0x453e96(0x1bf)]());let _0x2a19ee;if(_0x5e4106)try{const _0x556374=JSON[_0x453e96(0x1ce)](readFileSync(_0x5e4106,'utf-8'));_0x556374['llm_project']&&(_0x2a19ee={'llm_project':_0x556374[_0x453e96(0x19b)]});}catch{}const _0x53c91e=resolveAgentPullArgs({'arg':_0x858d10,'agentNameArg':_0x1b2518,'agentFlag':_0x30a00f,'contextProject':_0x12e83f,'argDirConfig':_0xe75adb,'cwdConfigPath':_0x5e4106||undefined,'cwdConfig':_0x2a19ee}),{projectNameOrId:_0x415642,targetAgentName:_0xca346b,existingOutputDir:_0x2399f1,source:_0x3d739c}=_0x53c91e;if(_0x3d739c==='arg-dir')console['log'](a4_0x29ffea['dim'](_0x453e96(0x1f1)+a4_0x3f29c1[_0x453e96(0x146)](_0x858d10,_0x453e96(0x1e9))+':\x20'+_0x415642));else{if(_0x3d739c==='cwd-config')console['log'](a4_0x29ffea[_0x453e96(0x186)](_0x453e96(0x16c)+_0x415642));else _0x3d739c==='context'&&console['log'](a4_0x29ffea['dim']('Using\x20project\x20from\x20context:\x20'+_0x415642));}if(!_0x415642)return _0x30a00f?(console[_0x453e96(0x1b2)](a4_0x29ffea[_0x453e96(0x167)](_0x453e96(0x189))),console[_0x453e96(0x1b2)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0x453e96(0x1b2)](_0x453e96(0x1e2))):(console[_0x453e96(0x1b2)](a4_0x29ffea[_0x453e96(0x167)](_0x453e96(0x173))),console[_0x453e96(0x1b2)](_0x453e96(0x1ac)),console[_0x453e96(0x1b2)](_0x453e96(0x168)),console['log'](_0x453e96(0x170)),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[_0x453e96(0x1b2)](_0x453e96(0x1b9))),0x1;if(_0xca346b){const {data:_0x5a813a}=await withSpinner(_0x453e96(0x1b4)+_0xca346b+_0x453e96(0x1c9)+_0x415642+_0x453e96(0x15e),()=>_0x1a7345['llm']['pullAgent'](_0x415642,_0xca346b,_0x76bbfc,{'dryRun':_0x31ede5,'force':_0x985549}));if(_0x31ede5)return console['log'](a4_0x29ffea[_0x453e96(0x167)](_0x453e96(0x163))),console['log'](_0x453e96(0x1a6)+_0x5a813a[_0x453e96(0x190)]),console[_0x453e96(0x1b2)]('Output\x20path:\x20'+_0x5a813a[_0x453e96(0x1ee)]),_0x5a813a['diff']&&(console['log']('\x0aChanges:'),console[_0x453e96(0x1b2)]('─'[_0x453e96(0x1c2)](0x3c)),console[_0x453e96(0x1b2)](_0x5a813a[_0x453e96(0x1d9)]),console[_0x453e96(0x1b2)]('─'[_0x453e96(0x1c2)](0x3c))),0x0;return console[_0x453e96(0x1b2)](a4_0x29ffea[_0x453e96(0x1f6)](_0x453e96(0x164))),console[_0x453e96(0x1b2)](_0x453e96(0x15d)+_0x5a813a[_0x453e96(0x190)]),console['log'](_0x453e96(0x196)+_0x5a813a['outputPath']),console[_0x453e96(0x1b2)](_0x453e96(0x15c)+(_0x5a813a[_0x453e96(0x18d)]?a4_0x29ffea[_0x453e96(0x1f6)](_0x453e96(0x179)):_0x5a813a[_0x453e96(0x14f)]?a4_0x29ffea[_0x453e96(0x167)]('updated'):a4_0x29ffea[_0x453e96(0x1c6)]('unchanged'))),0x0;}const _0x5cba88=_0x2399f1||_0x76bbfc,{data:_0x417639}=await withSpinner(_0x453e96(0x1ef)+_0x415642+_0x453e96(0x15e),()=>_0x1a7345['llm']['pullProject'](_0x415642,_0x5cba88,{'dryRun':!![]})),_0x3fbf21=_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1ab)]['new']+_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1bd)][_0x453e96(0x179)]+_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1dc)][_0x453e96(0x179)]+_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1a3)]['new']+_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1aa)]['new']+_0x417639[_0x453e96(0x1c0)][_0x453e96(0x184)][_0x453e96(0x179)]+_0x417639[_0x453e96(0x1c0)]['experimentalArtifacts'][_0x453e96(0x179)],_0x4fbbc1=_0x417639[_0x453e96(0x1c0)]['agents'][_0x453e96(0x1f0)]+_0x417639[_0x453e96(0x1c0)]['knowledgeBases'][_0x453e96(0x1f0)]+_0x417639[_0x453e96(0x1c0)]['textKnowledgeBases'][_0x453e96(0x1f0)]+_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1a3)]['updated']+_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1aa)][_0x453e96(0x1f0)]+_0x417639['counts']['experimentalKnowledgeBases'][_0x453e96(0x1f0)]+_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1e0)][_0x453e96(0x1f0)],_0x40dcfd=_0x417639['counts'][_0x453e96(0x1ab)][_0x453e96(0x158)]+_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1bd)][_0x453e96(0x158)]+_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1dc)][_0x453e96(0x158)]+_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1a3)][_0x453e96(0x158)]+_0x417639['counts'][_0x453e96(0x1aa)][_0x453e96(0x158)]+_0x417639[_0x453e96(0x1c0)]['experimentalKnowledgeBases'][_0x453e96(0x158)]+_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1e0)][_0x453e96(0x158)];console[_0x453e96(0x1b2)]('\x0aPull\x20summary\x20for\x20\x27'+_0x417639['projectName']+'\x27:'),console[_0x453e96(0x1b2)]('\x20\x20'+a4_0x29ffea[_0x453e96(0x1f6)]('+\x20'+_0x3fbf21+_0x453e96(0x1f7))+'\x20|\x20'+a4_0x29ffea[_0x453e96(0x167)]('~\x20'+_0x4fbbc1+_0x453e96(0x171))+_0x453e96(0x18b)+a4_0x29ffea[_0x453e96(0x186)]('=\x20'+_0x40dcfd+_0x453e96(0x177))),console[_0x453e96(0x1b2)](_0x453e96(0x183)+formatCountSummary(_0x417639['counts'][_0x453e96(0x1ab)])),console[_0x453e96(0x1b2)](_0x453e96(0x166)+formatCountSummary(_0x417639[_0x453e96(0x1c0)]['knowledgeBases'])),console[_0x453e96(0x1b2)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x417639['counts'][_0x453e96(0x1dc)])),console[_0x453e96(0x1b2)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x417639[_0x453e96(0x1c0)]['prompts'])),console[_0x453e96(0x1b2)](_0x453e96(0x181)+formatCountSummary(_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1aa)]));const _0xe97bd7=_0x417639[_0x453e96(0x1c0)][_0x453e96(0x184)][_0x453e96(0x14b)]>0x0||_0x417639['counts'][_0x453e96(0x1e0)]['total']>0x0;_0xe97bd7&&(console[_0x453e96(0x1b2)](_0x453e96(0x1c1)+formatCountSummary(_0x417639[_0x453e96(0x1c0)][_0x453e96(0x184)])),console[_0x453e96(0x1b2)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x417639['counts']['experimentalArtifacts'])));console[_0x453e96(0x1b2)](_0x453e96(0x161)+a4_0x29ffea['cyan'](_0x417639[_0x453e96(0x19e)])),displayDiffs(_0x417639[_0x453e96(0x1ab)],_0x417639[_0x453e96(0x1bd)],_0x417639[_0x453e96(0x1dc)],_0x417639[_0x453e96(0x1a3)],_0x417639[_0x453e96(0x1aa)],_0x417639[_0x453e96(0x184)],_0x417639[_0x453e96(0x1e0)]);if(_0x31ede5)return console['log'](a4_0x29ffea[_0x453e96(0x167)](_0x453e96(0x1c4))),0x0;if(_0x3fbf21===0x0&&_0x4fbbc1===0x0)return console[_0x453e96(0x1b2)](a4_0x29ffea[_0x453e96(0x1f6)](_0x453e96(0x1a2))),saveSessionContext({'llm_project':_0x417639[_0x453e96(0x17f)]},_0x584f4b[_0x453e96(0x17c)]),console[_0x453e96(0x1b2)](a4_0x29ffea[_0x453e96(0x1f6)](_0x453e96(0x1de)+a4_0x29ffea[_0x453e96(0x186)](_0x453e96(0x19b))+_0x453e96(0x16d)+a4_0x29ffea['cyan'](_0x417639[_0x453e96(0x17f)]))),0x0;if(!_0x29911f&&!_0x985549){if(!isInteractive())return console['error'](a4_0x29ffea['red']('\x0aError:'),_0x453e96(0x176)),console[_0x453e96(0x1a8)](a4_0x29ffea[_0x453e96(0x186)](_0x453e96(0x1c5))),0x1;const _0x35da6a=await confirmKey('\x0aWrite\x20'+(_0x3fbf21+_0x4fbbc1)+_0x453e96(0x191));if(!_0x35da6a)return console[_0x453e96(0x1b2)](a4_0x29ffea[_0x453e96(0x167)](_0x453e96(0x1bc)),_0x453e96(0x151)),0x1;}const {data:_0x4e653c}=await withSpinner('Writing\x20files...',()=>_0x1a7345[_0x453e96(0x1eb)][_0x453e96(0x17b)](_0x415642,_0x5cba88,{'force':_0x985549}));return console[_0x453e96(0x1b2)](a4_0x29ffea[_0x453e96(0x1f6)](_0x453e96(0x15f)+(_0x3fbf21+_0x4fbbc1)+_0x453e96(0x1f2)+_0x4e653c[_0x453e96(0x19e)])),saveSessionContext({'llm_project':_0x4e653c[_0x453e96(0x17f)]},_0x584f4b[_0x453e96(0x17c)]),console['log'](a4_0x29ffea[_0x453e96(0x1f6)](_0x453e96(0x1de)+a4_0x29ffea[_0x453e96(0x186)](_0x453e96(0x19b))+_0x453e96(0x16d)+a4_0x29ffea['cyan'](_0x4e653c['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']='agent:clone';[a4_0x5ef285(0x148)]=a4_0x5ef285(0x14e);async[a4_0x5ef285(0x1ae)](_0x36139f){const _0x275b76=a4_0x5ef285,{options:_0x590e59,args:_0x1039aa,tdx:_0x4d12e8}=_0x36139f,_0x2ac4e3=_0x1039aa[0x0],_0x126323=_0x590e59[_0x275b76(0x16e)],_0xf28f71=_0x590e59['dryRun'],_0x35ebf9=_0x590e59[_0x275b76(0x1af)],_0x714342=_0x590e59[_0x275b76(0x1a5)],_0xb6281=_0x590e59[_0x275b76(0x159)];let _0x229e14;const _0x3b48e2=findAgentConfigPath(process[_0x275b76(0x1bf)]());if(_0x2ac4e3){const _0x346dff=a4_0x3f29c1[_0x275b76(0x146)](_0x2ac4e3,_0x275b76(0x1e9));existsSync(_0x346dff)?(_0x229e14=_0x2ac4e3,console['log'](a4_0x29ffea[_0x275b76(0x186)](_0x275b76(0x1d1)+_0x2ac4e3))):_0x229e14=_0x2ac4e3;}else{if(_0x3b48e2)_0x229e14=a4_0x3f29c1[_0x275b76(0x16f)](_0x3b48e2),console[_0x275b76(0x1b2)](a4_0x29ffea[_0x275b76(0x186)](_0x275b76(0x1a0)+_0x229e14));else{if(_0xb6281){const _0x1709fc=sanitizeForFilesystem(_0xb6281);let _0x1c03df=_0x1709fc,_0x4fee1b=a4_0x3f29c1[_0x275b76(0x146)](process[_0x275b76(0x1bf)](),_0x275b76(0x1ab),_0x1709fc,_0x275b76(0x1e9));if(!existsSync(_0x4fee1b)){const _0x33d4e0=normalizeName(_0xb6281),_0x3fb35f=a4_0x3f29c1['join'](process['cwd'](),_0x275b76(0x1ab),_0x33d4e0,_0x275b76(0x1e9));existsSync(_0x3fb35f)&&(_0x1c03df=_0x33d4e0,_0x4fee1b=_0x3fb35f);}if(existsSync(_0x4fee1b))_0x229e14=a4_0x3f29c1[_0x275b76(0x16f)](_0x4fee1b),console[_0x275b76(0x1b2)](a4_0x29ffea[_0x275b76(0x186)](_0x275b76(0x1d1)+_0x229e14));else{const _0x28166d=_0x590e59[_0x275b76(0x1a9)];if(_0x28166d)throw new SDKError(ErrorCode[_0x275b76(0x192)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0xb6281+_0x275b76(0x1b0),undefined,{'helpText':_0x275b76(0x16b)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x275b76(0x149)+_0xb6281+'\x0a')+(_0x275b76(0x1d7)+_0x1c03df+_0x275b76(0x18c)+(_0x126323||_0x275b76(0x18f))+'\x20--profile\x20'+_0x28166d)});_0x229e14=_0xb6281,console[_0x275b76(0x1b2)](a4_0x29ffea[_0x275b76(0x186)](_0x275b76(0x1ca)+_0xb6281));}}}}if(!_0x229e14)return console[_0x275b76(0x1b2)](a4_0x29ffea[_0x275b76(0x167)](_0x275b76(0x1df))),console['log'](_0x275b76(0x1ad)),console[_0x275b76(0x1b2)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console['log'](_0x275b76(0x1e3)),console[_0x275b76(0x1b2)](_0x275b76(0x194)),0x1;if(!_0x126323)throw new SDKError(ErrorCode[_0x275b76(0x1c8)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x35ebf9&&!_0xf28f71){if(!isInteractive())return console[_0x275b76(0x1a8)](a4_0x29ffea[_0x275b76(0x174)](_0x275b76(0x157)),_0x275b76(0x176)),console[_0x275b76(0x1a8)](a4_0x29ffea['dim'](_0x275b76(0x1c5))),0x1;const _0xcb0689=await confirmKey(_0x275b76(0x188)+_0x229e14+_0x275b76(0x1e7)+_0x126323+'\x22?');if(!_0xcb0689)return console[_0x275b76(0x1b2)](a4_0x29ffea['yellow'](_0x275b76(0x1bc))),0x1;}const {data:_0x3d95a1}=await withSpinner(_0x275b76(0x1f5)+_0x229e14+_0x275b76(0x1d5)+_0x126323+_0x275b76(0x15e),()=>_0x4d12e8[_0x275b76(0x1eb)][_0x275b76(0x156)](_0x229e14,_0x126323,{'dryRun':_0xf28f71}));if(_0xf28f71){console['log'](a4_0x29ffea[_0x275b76(0x167)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x275b76(0x1b2)](_0x275b76(0x14c)+_0x3d95a1[_0x275b76(0x1b3)]),console[_0x275b76(0x1b2)](_0x275b76(0x1be)+_0x126323),console[_0x275b76(0x1b2)]('Would\x20clone:'),console['log'](_0x275b76(0x183)+_0x3d95a1['counts'][_0x275b76(0x1ab)][_0x275b76(0x15a)]),console['log']('\x20\x20Knowledge\x20Bases:\x20'+_0x3d95a1[_0x275b76(0x1c0)][_0x275b76(0x1bd)]['created']),console[_0x275b76(0x1b2)](_0x275b76(0x180)+_0x3d95a1[_0x275b76(0x1c0)][_0x275b76(0x1a3)][_0x275b76(0x15a)]);const _0x1b0da2=_0x3d95a1['counts']['experimentalKnowledgeBases'][_0x275b76(0x15a)]>0x0||_0x3d95a1[_0x275b76(0x1c0)][_0x275b76(0x1e0)][_0x275b76(0x15a)]>0x0;return _0x1b0da2&&(console[_0x275b76(0x1b2)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x3d95a1[_0x275b76(0x1c0)]['experimentalKnowledgeBases']['created']),console[_0x275b76(0x1b2)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x3d95a1['counts'][_0x275b76(0x1e0)][_0x275b76(0x15a)])),0x0;}const _0x1a6e79=_0x3d95a1[_0x275b76(0x1c0)][_0x275b76(0x1ab)][_0x275b76(0x199)]>0x0||_0x3d95a1[_0x275b76(0x1c0)][_0x275b76(0x1bd)][_0x275b76(0x199)]>0x0||_0x3d95a1['counts']['prompts'][_0x275b76(0x199)]>0x0||_0x3d95a1[_0x275b76(0x1c0)]['experimentalKnowledgeBases'][_0x275b76(0x199)]>0x0||_0x3d95a1[_0x275b76(0x1c0)]['experimentalArtifacts'][_0x275b76(0x199)]>0x0;_0x1a6e79?console[_0x275b76(0x1b2)](a4_0x29ffea[_0x275b76(0x167)](_0x275b76(0x185))):console[_0x275b76(0x1b2)](a4_0x29ffea[_0x275b76(0x1f6)](_0x275b76(0x1e5)));console[_0x275b76(0x1b2)](_0x275b76(0x14c)+_0x3d95a1[_0x275b76(0x1b3)]),console[_0x275b76(0x1b2)](_0x275b76(0x1be)+_0x3d95a1[_0x275b76(0x193)]),console[_0x275b76(0x1b2)](_0x275b76(0x19d)+_0x3d95a1['newProjectId']),console[_0x275b76(0x1b2)](),console[_0x275b76(0x1b2)](_0x275b76(0x1b8)),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x3d95a1[_0x275b76(0x1c0)][_0x275b76(0x1ab)])),console[_0x275b76(0x1b2)](_0x275b76(0x166)+formatCountSummary(_0x3d95a1['counts'][_0x275b76(0x1bd)])),console[_0x275b76(0x1b2)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x3d95a1[_0x275b76(0x1c0)]['prompts'])),console[_0x275b76(0x1b2)](_0x275b76(0x181)+formatCountSummary(_0x3d95a1['counts'][_0x275b76(0x1aa)]));const _0x306369=_0x3d95a1[_0x275b76(0x1c0)]['experimentalKnowledgeBases']['created']>0x0||_0x3d95a1[_0x275b76(0x1c0)][_0x275b76(0x184)][_0x275b76(0x1f0)]>0x0||_0x3d95a1['counts'][_0x275b76(0x184)][_0x275b76(0x158)]>0x0||_0x3d95a1[_0x275b76(0x1c0)][_0x275b76(0x1e0)][_0x275b76(0x15a)]>0x0||_0x3d95a1[_0x275b76(0x1c0)]['experimentalArtifacts']['updated']>0x0||_0x3d95a1[_0x275b76(0x1c0)][_0x275b76(0x1e0)]['unchanged']>0x0;_0x306369&&(console['log'](_0x275b76(0x1c1)+formatCountSummary(_0x3d95a1[_0x275b76(0x1c0)][_0x275b76(0x184)])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x3d95a1[_0x275b76(0x1c0)][_0x275b76(0x1e0)])));if(_0x1a6e79){console[_0x275b76(0x1b2)](),console['log'](a4_0x29ffea['red'](_0x275b76(0x1cf)));for(const _0x4a6d3f of _0x3d95a1[_0x275b76(0x1ab)]){_0x4a6d3f[_0x275b76(0x197)]===_0x275b76(0x1a8)&&console['log'](a4_0x29ffea['red'](_0x275b76(0x1dd)+_0x4a6d3f[_0x275b76(0x190)]+_0x275b76(0x1da)+_0x4a6d3f['error']));}for(const _0x498946 of _0x3d95a1[_0x275b76(0x1bd)]){_0x498946[_0x275b76(0x197)]===_0x275b76(0x1a8)&&console[_0x275b76(0x1b2)](a4_0x29ffea[_0x275b76(0x174)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x498946[_0x275b76(0x16e)]+_0x275b76(0x1da)+_0x498946['error']));}for(const _0x340c18 of _0x3d95a1['prompts']){_0x340c18[_0x275b76(0x197)]===_0x275b76(0x1a8)&&console['log'](a4_0x29ffea[_0x275b76(0x174)](_0x275b76(0x1cd)+_0x340c18[_0x275b76(0x16e)]+_0x275b76(0x1da)+_0x340c18[_0x275b76(0x1a8)]));}for(const _0x434865 of _0x3d95a1[_0x275b76(0x1aa)]){_0x434865[_0x275b76(0x197)]==='error'&&console[_0x275b76(0x1b2)](a4_0x29ffea['red'](_0x275b76(0x1b7)+_0x434865[_0x275b76(0x16e)]+_0x275b76(0x1da)+_0x434865['error']));}for(const _0x181221 of _0x3d95a1[_0x275b76(0x184)]){_0x181221[_0x275b76(0x197)]===_0x275b76(0x1a8)&&console[_0x275b76(0x1b2)](a4_0x29ffea[_0x275b76(0x174)](_0x275b76(0x1ed)+_0x181221[_0x275b76(0x16e)]+_0x275b76(0x1da)+_0x181221[_0x275b76(0x1a8)]));}for(const _0x38d8c1 of _0x3d95a1[_0x275b76(0x1e0)]){_0x38d8c1[_0x275b76(0x197)]===_0x275b76(0x1a8)&&console[_0x275b76(0x1b2)](a4_0x29ffea[_0x275b76(0x174)](_0x275b76(0x1ba)+_0x38d8c1['name']+_0x275b76(0x1da)+_0x38d8c1[_0x275b76(0x1a8)]));}return 0x1;}console[_0x275b76(0x1b2)]();const _0x142172=getLLMProjectUrl(_0x714342,_0x3d95a1[_0x275b76(0x155)]);return console[_0x275b76(0x1b2)](_0x275b76(0x165)+a4_0x29ffea['cyan'](_0x142172)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x5ef285(0x16e)]=a4_0x5ef285(0x1d0);[a4_0x5ef285(0x148)]=a4_0x5ef285(0x1db);async[a4_0x5ef285(0x1ae)](_0x451b78){const _0x50e751=a4_0x5ef285,{options:_0x3c4a5d,args:_0x37b0a3,tdx:_0xeee452}=_0x451b78;let _0x2a3c26=_0x37b0a3[0x0]||process[_0x50e751(0x1bf)]();const _0x2e288a=_0x3c4a5d[_0x50e751(0x1ea)],_0x5250fe=_0x3c4a5d[_0x50e751(0x19c)],_0x52c4f3=_0x3c4a5d[_0x50e751(0x1af)],_0x23fef5=_0x3c4a5d[_0x50e751(0x1a5)],_0x1b1a68=a4_0x3f29c1[_0x50e751(0x146)](_0x2a3c26,_0x50e751(0x187)),_0x559a8e=existsSync(_0x1b1a68);if(_0x559a8e){const {data:_0x1746ad}=await withSpinner(_0x50e751(0x1c7)+_0x2a3c26+_0x50e751(0x15e),()=>_0xeee452[_0x50e751(0x1eb)][_0x50e751(0x15b)](_0x2a3c26,{'dryRun':_0x2e288a,'force':_0x5250fe}));if(_0x2e288a)return console[_0x50e751(0x1b2)](a4_0x29ffea['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console['log']('Would\x20push\x20agent:\x20'+_0x1746ad[_0x50e751(0x190)]),0x0;if(_0x1746ad['action']===_0x50e751(0x1a8))return console[_0x50e751(0x1b2)](a4_0x29ffea[_0x50e751(0x174)](_0x50e751(0x1d6)+_0x1746ad[_0x50e751(0x1a8)])),0x1;console['log'](a4_0x29ffea[_0x50e751(0x1f6)]('Agent\x20'+_0x1746ad['action']+'\x20successfully')),console[_0x50e751(0x1b2)](_0x50e751(0x15d)+_0x1746ad['agentName']);if(_0x1746ad[_0x50e751(0x1c3)]&&_0x1746ad['projectId']){const _0x2582d3=getLLMAgentChatUrl(_0x23fef5,_0x1746ad[_0x50e751(0x1b5)],_0x1746ad[_0x50e751(0x1c3)]);console[_0x50e751(0x1b2)](_0x50e751(0x1e4)+a4_0x29ffea[_0x50e751(0x1b1)](_0x2582d3));}return 0x0;}const _0x199ad9=_0x3c4a5d[_0x50e751(0x159)],_0x3ce43f=resolveProjectFromContext(_0x2a3c26,_0x199ad9);if(_0x3ce43f[_0x50e751(0x178)])_0x2a3c26=_0x3ce43f[_0x50e751(0x1a4)],_0x3ce43f[_0x50e751(0x1bb)]==='context'&&console[_0x50e751(0x1b2)](a4_0x29ffea[_0x50e751(0x186)]('Using\x20project:\x20'+_0x2a3c26));else{let _0x535bc1='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x3ce43f['reason']===_0x50e751(0x169)&&(_0x535bc1=_0x3ce43f[_0x50e751(0x153)]+_0x50e751(0x17d)+_0x3ce43f['llmProject']+_0x50e751(0x1cb));throw new SDKError(ErrorCode[_0x50e751(0x192)],_0x3ce43f['reason']==='no_context'?_0x3ce43f[_0x50e751(0x153)]:_0x50e751(0x152)+_0x2a3c26,undefined,{'helpText':_0x535bc1});}const {data:_0xfbc01c}=await withSpinner(_0x50e751(0x147),()=>_0xeee452['llm']['pushProject'](_0x2a3c26,{'dryRun':!![]})),_0x34c703=_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1ab)][_0x50e751(0x199)]>0x0;if(_0x34c703){console[_0x50e751(0x1b2)](a4_0x29ffea[_0x50e751(0x174)](_0x50e751(0x18e)));for(const _0x2b1409 of _0xfbc01c[_0x50e751(0x1ab)]){_0x2b1409[_0x50e751(0x197)]===_0x50e751(0x1a8)&&console[_0x50e751(0x1b2)](a4_0x29ffea['red'](_0x50e751(0x1dd)+_0x2b1409[_0x50e751(0x190)]+_0x50e751(0x1da)+_0x2b1409[_0x50e751(0x1a8)]));}return 0x1;}const _0x4e0b17=_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1ab)][_0x50e751(0x15a)]+_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1bd)][_0x50e751(0x15a)]+_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1dc)][_0x50e751(0x15a)]+_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1a3)][_0x50e751(0x15a)]+_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1aa)][_0x50e751(0x15a)]+_0xfbc01c['counts'][_0x50e751(0x184)][_0x50e751(0x15a)]+_0xfbc01c['counts'][_0x50e751(0x1e0)][_0x50e751(0x15a)],_0x2f36ca=_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1ab)][_0x50e751(0x1f0)]+_0xfbc01c[_0x50e751(0x1c0)]['knowledgeBases']['updated']+_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1dc)][_0x50e751(0x1f0)]+_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1a3)]['updated']+_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1aa)][_0x50e751(0x1f0)]+_0xfbc01c[_0x50e751(0x1c0)]['experimentalKnowledgeBases']['updated']+_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1e0)][_0x50e751(0x1f0)],_0xc232e8=_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1ab)][_0x50e751(0x158)]+_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1bd)][_0x50e751(0x158)]+_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1dc)][_0x50e751(0x158)]+_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1a3)][_0x50e751(0x158)]+_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1aa)][_0x50e751(0x158)]+_0xfbc01c[_0x50e751(0x1c0)]['experimentalKnowledgeBases'][_0x50e751(0x158)]+_0xfbc01c[_0x50e751(0x1c0)]['experimentalArtifacts'][_0x50e751(0x158)];console[_0x50e751(0x1b2)](_0x50e751(0x1b6)+_0xfbc01c[_0x50e751(0x17f)]+'\x27:'),console['log']('\x20\x20'+a4_0x29ffea[_0x50e751(0x1f6)]('+\x20'+_0x4e0b17+_0x50e751(0x1f7))+_0x50e751(0x18b)+a4_0x29ffea['yellow']('~\x20'+_0x2f36ca+_0x50e751(0x171))+'\x20|\x20'+a4_0x29ffea[_0x50e751(0x186)]('=\x20'+_0xc232e8+_0x50e751(0x177))),console['log'](_0x50e751(0x183)+formatCountSummary(_0xfbc01c['counts'][_0x50e751(0x1ab)])),console[_0x50e751(0x1b2)](_0x50e751(0x166)+formatCountSummary(_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1bd)])),console['log'](_0x50e751(0x175)+formatCountSummary(_0xfbc01c['counts'][_0x50e751(0x1dc)])),console[_0x50e751(0x1b2)](_0x50e751(0x180)+formatCountSummary(_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1a3)])),console[_0x50e751(0x1b2)](_0x50e751(0x181)+formatCountSummary(_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1aa)]));const _0x61801c=_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x184)][_0x50e751(0x15a)]>0x0||_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x184)][_0x50e751(0x1f0)]>0x0||_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x184)][_0x50e751(0x158)]>0x0||_0xfbc01c[_0x50e751(0x1c0)]['experimentalArtifacts']['created']>0x0||_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1e0)][_0x50e751(0x1f0)]>0x0||_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1e0)][_0x50e751(0x158)]>0x0;_0x61801c&&(console[_0x50e751(0x1b2)](_0x50e751(0x1c1)+formatCountSummary(_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x184)])),console[_0x50e751(0x1b2)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0xfbc01c['counts']['experimentalArtifacts'])));console[_0x50e751(0x1b2)]('\x20\x20Source:\x20'+a4_0x29ffea[_0x50e751(0x1b1)](_0x2a3c26)),displayDiffs(_0xfbc01c[_0x50e751(0x1ab)],_0xfbc01c[_0x50e751(0x1bd)],_0xfbc01c[_0x50e751(0x1dc)],_0xfbc01c[_0x50e751(0x1a3)],_0xfbc01c['integrations'],_0xfbc01c[_0x50e751(0x184)],_0xfbc01c[_0x50e751(0x1e0)]);if(_0x2e288a)return console['log'](a4_0x29ffea[_0x50e751(0x167)](_0x50e751(0x182))),0x0;if(_0x4e0b17===0x0&&_0x2f36ca===0x0){console[_0x50e751(0x1b2)](a4_0x29ffea[_0x50e751(0x1f6)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x93f5f=getLLMProjectUrl(_0x23fef5,_0xfbc01c[_0x50e751(0x1b5)]);return console[_0x50e751(0x1b2)](_0x50e751(0x165)+a4_0x29ffea[_0x50e751(0x1b1)](_0x93f5f)),0x0;}if(!_0x52c4f3&&!_0x5250fe){if(!isInteractive())return console[_0x50e751(0x1a8)](a4_0x29ffea['red']('\x0aError:'),_0x50e751(0x176)),console[_0x50e751(0x1a8)](a4_0x29ffea[_0x50e751(0x186)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3ba34d=await confirmKey('\x0aPush\x20'+(_0x4e0b17+_0x2f36ca)+'\x20resources?');if(!_0x3ba34d)return console[_0x50e751(0x1b2)](a4_0x29ffea[_0x50e751(0x167)](_0x50e751(0x1bc)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x50c2c3}=await withSpinner(_0x50e751(0x162),()=>_0xeee452['llm']['pushProject'](_0x2a3c26,{'force':_0x5250fe})),_0x1107d3=_0x50c2c3['counts']['agents'][_0x50e751(0x199)]>0x0||_0x50c2c3[_0x50e751(0x1c0)][_0x50e751(0x1bd)][_0x50e751(0x199)]>0x0||_0x50c2c3[_0x50e751(0x1c0)][_0x50e751(0x1dc)][_0x50e751(0x199)]>0x0||_0x50c2c3[_0x50e751(0x1c0)][_0x50e751(0x1a3)][_0x50e751(0x199)]>0x0;if(_0x1107d3){console[_0x50e751(0x1b2)](a4_0x29ffea[_0x50e751(0x167)](_0x50e751(0x172))),console['log'](),console[_0x50e751(0x1b2)](a4_0x29ffea['red'](_0x50e751(0x1cf)));for(const _0x140ec5 of _0x50c2c3[_0x50e751(0x1ab)]){_0x140ec5[_0x50e751(0x197)]===_0x50e751(0x1a8)&&console[_0x50e751(0x1b2)](a4_0x29ffea[_0x50e751(0x174)](_0x50e751(0x1dd)+_0x140ec5[_0x50e751(0x190)]+_0x50e751(0x1da)+_0x140ec5[_0x50e751(0x1a8)]));}for(const _0xed01ca of _0x50c2c3[_0x50e751(0x1bd)]){_0xed01ca[_0x50e751(0x197)]===_0x50e751(0x1a8)&&console[_0x50e751(0x1b2)](a4_0x29ffea[_0x50e751(0x174)](_0x50e751(0x17a)+_0xed01ca[_0x50e751(0x16e)]+'\x22:\x20'+_0xed01ca['error']));}for(const _0x61dfa7 of _0x50c2c3[_0x50e751(0x1dc)]){_0x61dfa7[_0x50e751(0x197)]===_0x50e751(0x1a8)&&console[_0x50e751(0x1b2)](a4_0x29ffea[_0x50e751(0x174)](_0x50e751(0x160)+_0x61dfa7[_0x50e751(0x16e)]+_0x50e751(0x1da)+_0x61dfa7[_0x50e751(0x1a8)]));}for(const _0x62e3a4 of _0x50c2c3[_0x50e751(0x1a3)]){_0x62e3a4['action']===_0x50e751(0x1a8)&&console[_0x50e751(0x1b2)](a4_0x29ffea['red']('\x20\x20Prompt\x20\x22'+_0x62e3a4[_0x50e751(0x16e)]+_0x50e751(0x1da)+_0x62e3a4[_0x50e751(0x1a8)]));}for(const _0x6552fd of _0x50c2c3[_0x50e751(0x1aa)]){_0x6552fd[_0x50e751(0x197)]===_0x50e751(0x1a8)&&console['log'](a4_0x29ffea['red'](_0x50e751(0x1b7)+_0x6552fd[_0x50e751(0x16e)]+_0x50e751(0x1da)+_0x6552fd[_0x50e751(0x1a8)]));}return 0x1;}console[_0x50e751(0x1b2)](a4_0x29ffea[_0x50e751(0x1f6)](_0x50e751(0x1e8)+(_0x4e0b17+_0x2f36ca)+'\x20resources\x20to\x20\x27'+_0x50c2c3[_0x50e751(0x17f)]+'\x27'));const _0x3ac8a8=getLLMProjectUrl(_0x23fef5,_0x50c2c3[_0x50e751(0x1b5)]);return console[_0x50e751(0x1b2)]('Project:\x20'+a4_0x29ffea[_0x50e751(0x1b1)](_0x3ac8a8)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x3e5468=a5_0xa540;(function(_0x2c07f6,_0x52a4b7){const _0xc6924=a5_0xa540,_0x41ff59=_0x2c07f6();while(!![]){try{const _0x5abad9=parseInt(_0xc6924(0x211))/0x1+-parseInt(_0xc6924(0x22f))/0x2*(-parseInt(_0xc6924(0x1f9))/0x3)+-parseInt(_0xc6924(0x203))/0x4+parseInt(_0xc6924(0x1cc))/0x5+-parseInt(_0xc6924(0x234))/0x6+-parseInt(_0xc6924(0x225))/0x7+parseInt(_0xc6924(0x202))/0x8;if(_0x5abad9===_0x52a4b7)break;else _0x41ff59['push'](_0x41ff59['shift']());}catch(_0x344cc8){_0x41ff59['push'](_0x41ff59['shift']());}}}(a5_0xdde3,0xb1fe3));import*as a5_0x61f3f8 from'node:fs';import*as a5_0x2ddc07 from'node:path';function a5_0xa540(_0x4e0a7f,_0x503f16){_0x4e0a7f=_0x4e0a7f-0x1a9;const _0xdde3c3=a5_0xdde3();let _0xa54003=_0xdde3c3[_0x4e0a7f];return _0xa54003;}import a5_0x1ae528 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0xdde3(){const _0xe8db2e=['Re-evaluating...','green','404','9785132hrYRIF','multiple_agents','tsv','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','\x20(new)','rounds','tags','Usage:','Passed:\x20\x20\x20','51478qvycwK','message','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','No\x20tests\x20found\x20with\x20tags:\x20','white','348066NJFwWs','llmProject','...','log','includes','Run\x20tests\x20for\x20an\x20LLM\x20agent','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','stop','✗\x20ERROR:\x20Project\x20not\x20found:\x20','✗\x20FAIL:\x20','start','not\x20found','\x20(cached)','Running:\x20','join','round','executeReeval','ERROR','no_context','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','⚠\x20SKIPPED:\x20','Running\x20agent\x20tests...','Cached\x20run\x20from:\x20','toISOString','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','toLowerCase','substring','Re-evaluating\x20cached\x20test\x20run...',':\x20Sending\x20user\x20input...','New\x20tests\x20to\x20execute:\x20','Tests\x20found:\x20','\x22:\x20','reason','timestamp','jsonl','\x20\x20Project:\x20','Duration:\x20','Evaluating\x20response...','testYmlPath','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Output\x20written\x20to:\x20','FAIL','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','writeFileSync','✗\x20ERROR:\x20','text','852325AFLykt','length','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','status','testName','red','Failed:\x20\x20\x20','push','Agent:\x20','✓\x20PASS:\x20','dryRun','\x20\x20Evaluating...\x20','Executing\x20new\x20tests...','Available\x20tests:\x20','projectDir','/<agent-name>','execute','Round\x20','Round\x201/','No\x20tests\x20have\x20tags\x20defined.','projectName','Available\x20tags:\x20','context','\x22,\x20but\x20current\x20site\x20is\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','table','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','some','name','output','filter','llm','\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)','cyan','test.yml','PASS','resolveProjectId','source','\x20\x20Round\x20','\x20\x20Site:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','\x20\x20Conversation:\x20','conversations','now','102wuGjqX','\x20\x20-\x20','Re-evaluation\x20Summary','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','yellow','Site:\x20','forEach','dim','trim','8644928aWiDhH','565036PiIgFr','...\x20','repeat','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Total:\x20\x20\x20\x20','eval','Test\x20Summary','found','Error\x20writing\x20output\x20file:\x20','isSpinning','reeval','Test\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','map','199998tiKyuo','agent','no_tests','has','\x20-\x20','site','Either\x20switch\x20to\x20the\x20\x22','\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','agentDirs','split','\x20\x20Agent:\x20','conversation_url','verbose','utf-8','tests','Conversation\x20URL:\x20','agentName'];a5_0xdde3=function(){return _0xe8db2e;};return a5_0xdde3();}export class AgentTestCommand extends BaseCommand{[a5_0x3e5468(0x1e9)]='agent:test';['description']=a5_0x3e5468(0x239);async[a5_0x3e5468(0x1dd)](_0x81b9b5){const _0x9f3741=a5_0x3e5468,{options:_0x8c886f,args:_0x4b8353,tdx:_0x14169c}=_0x81b9b5,_0x53fc85=_0x4b8353[0x0]||'.',_0x2f8aad=_0x8c886f[_0x9f3741(0x1d7)],_0x362e1c=_0x8c886f,_0x397ed0=_0x362e1c[_0x9f3741(0x208)]===![],_0x2bdeb3=_0x362e1c[_0x9f3741(0x20d)],_0x7107e2=_0x362e1c['name'],_0x3efbd4=_0x362e1c[_0x9f3741(0x22c)],_0x1940df=_0x8c886f['site'],_0x5df971=_0x362e1c[_0x9f3741(0x1ea)];if(_0x2bdeb3&&_0x397ed0)return console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x1d2)](_0x9f3741(0x1e7))),0x1;let _0x47efa2=_0x9f3741(0x1e6);if(_0x362e1c['json'])_0x47efa2='json';else{if(_0x362e1c['jsonl'])_0x47efa2=_0x9f3741(0x1c0);else{if(_0x362e1c[_0x9f3741(0x227)])_0x47efa2=_0x9f3741(0x227);else{if(_0x362e1c[_0x9f3741(0x1e6)])_0x47efa2=_0x9f3741(0x1e6);}}}const _0x27da61=_0x362e1c[_0x9f3741(0x235)];let _0x585284=_0x53fc85;const _0x5da5f6=a5_0x61f3f8['existsSync'](_0x53fc85),_0x111615=_0x53fc85==='.';if(!_0x5da5f6||_0x111615){const _0x3446ba=resolveProjectFromContext(_0x53fc85,_0x27da61,{'requireFile':_0x9f3741(0x1ef)});if(_0x3446ba[_0x9f3741(0x20a)])_0x585284=_0x3446ba['projectDir'],_0x3446ba[_0x9f3741(0x1f2)]===_0x9f3741(0x1e3)&&console['log'](a5_0x1ae528[_0x9f3741(0x200)]('Using\x20agent:\x20'+_0x585284));else switch(_0x3446ba[_0x9f3741(0x1be)]){case _0x9f3741(0x1b0):console['log'](a5_0x1ae528[_0x9f3741(0x1fd)](_0x3446ba[_0x9f3741(0x230)])),console[_0x9f3741(0x237)](),console[_0x9f3741(0x237)](_0x9f3741(0x22d)),console[_0x9f3741(0x237)](_0x9f3741(0x218)),console[_0x9f3741(0x237)](_0x9f3741(0x1ed)),console[_0x9f3741(0x237)](),console[_0x9f3741(0x237)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case'no_local_folder':console['log'](a5_0x1ae528[_0x9f3741(0x1fd)](_0x3446ba[_0x9f3741(0x230)])),console[_0x9f3741(0x237)](),console[_0x9f3741(0x237)](_0x9f3741(0x1f5)+_0x3446ba[_0x9f3741(0x235)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x9f3741(0x226):{const _0x3aa2d6=a5_0x2ddc07['basename'](_0x3446ba['projectDir']);console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x1fd)](_0x9f3741(0x206)+_0x3446ba[_0x9f3741(0x235)]+'\x22:'));for(const _0x54ef64 of _0x3446ba[_0x9f3741(0x219)]){console[_0x9f3741(0x237)](_0x9f3741(0x1fa)+_0x54ef64);}return console[_0x9f3741(0x237)](),console['log'](_0x9f3741(0x228)+_0x3aa2d6+_0x9f3741(0x1dc)),0x1;}case _0x9f3741(0x213):console[_0x9f3741(0x237)](a5_0x1ae528['yellow'](_0x9f3741(0x23a)+_0x3446ba['llmProject']+'\x22.')),console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x200)]('Project\x20path:\x20'+_0x3446ba[_0x9f3741(0x1db)])),console[_0x9f3741(0x237)](),console[_0x9f3741(0x237)](_0x9f3741(0x1c5));return 0x1;}}const {definition:_0x340eef,agentInfo:_0x4b916c}=parseTestFile(_0x585284);let _0x33f218=_0x340eef[_0x9f3741(0x21f)];if(_0x7107e2){const _0x3263b0=_0x7107e2['split'](',')['map'](_0x5f2d48=>_0x5f2d48[_0x9f3741(0x201)]());_0x33f218=_0x340eef['tests'][_0x9f3741(0x1eb)](_0x3840d3=>_0x3263b0[_0x9f3741(0x238)](_0x3840d3[_0x9f3741(0x1e9)]));if(_0x33f218[_0x9f3741(0x1cd)]===0x0)return console['log'](a5_0x1ae528['yellow']('No\x20tests\x20found\x20matching:\x20'+_0x7107e2)),console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x200)](_0x9f3741(0x1da)+_0x340eef[_0x9f3741(0x21f)][_0x9f3741(0x210)](_0x40d5d2=>_0x40d5d2[_0x9f3741(0x1e9)])[_0x9f3741(0x1ac)](',\x20'))),0x1;}if(_0x3efbd4){const _0x254ce0=_0x3efbd4[_0x9f3741(0x21a)](',')[_0x9f3741(0x210)](_0x5aee6a=>_0x5aee6a[_0x9f3741(0x201)]()[_0x9f3741(0x1b7)]());_0x33f218=_0x33f218[_0x9f3741(0x1eb)](_0x165285=>_0x165285[_0x9f3741(0x22c)]?.[_0x9f3741(0x1e8)](_0x1d0461=>_0x254ce0['includes'](_0x1d0461[_0x9f3741(0x1b7)]())));if(_0x33f218[_0x9f3741(0x1cd)]===0x0){console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x1fd)](_0x9f3741(0x232)+_0x3efbd4));const _0x12ed79=new Set();return _0x340eef['tests']['forEach'](_0x3dec32=>_0x3dec32[_0x9f3741(0x22c)]?.[_0x9f3741(0x1ff)](_0x34b370=>_0x12ed79['add'](_0x34b370))),_0x12ed79['size']>0x0?console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x200)](_0x9f3741(0x1e2)+[..._0x12ed79][_0x9f3741(0x1ac)](',\x20'))):console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x200)](_0x9f3741(0x1e0))),0x1;}}if(_0x2bdeb3)return this[_0x9f3741(0x1ae)](_0x81b9b5,{'definition':{'tests':_0x33f218},'agentInfo':_0x4b916c,'outputFormat':_0x47efa2,'outputFile':_0x5df971,'testNames':_0x7107e2});if(_0x2f8aad){console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x1ee)]('Test\x20Configuration:')),console[_0x9f3741(0x237)](_0x9f3741(0x1f4)+a5_0x1ae528[_0x9f3741(0x233)](_0x1940df)),console[_0x9f3741(0x237)](_0x9f3741(0x1c1)+a5_0x1ae528[_0x9f3741(0x233)](_0x4b916c['projectName'])),console['log'](_0x9f3741(0x21b)+a5_0x1ae528['white'](_0x4b916c[_0x9f3741(0x221)])),console[_0x9f3741(0x237)](),console[_0x9f3741(0x237)](_0x9f3741(0x1bc)+a5_0x1ae528[_0x9f3741(0x233)](_0x33f218[_0x9f3741(0x1cd)]));for(let _0x53d678=0x0;_0x53d678<_0x33f218['length'];_0x53d678++){const _0x51d9c5=_0x33f218[_0x53d678],_0x3e4249=_0x51d9c5[_0x9f3741(0x22b)][_0x9f3741(0x1cd)]===0x1?_0x9f3741(0x1ad):'rounds',_0x369f6e=_0x51d9c5[_0x9f3741(0x22c)]?.[_0x9f3741(0x1cd)]?'\x20['+_0x51d9c5[_0x9f3741(0x22c)][_0x9f3741(0x1ac)](',\x20')+']':'';console[_0x9f3741(0x237)]('\x20\x20'+(_0x53d678+0x1)+'.\x20'+a5_0x1ae528['white'](_0x51d9c5[_0x9f3741(0x1e9)])+'\x20('+_0x51d9c5[_0x9f3741(0x22b)][_0x9f3741(0x1cd)]+'\x20'+_0x3e4249+')'+a5_0x1ae528[_0x9f3741(0x200)](_0x369f6e));}return 0x0;}let _0x4afc7d,_0xbdd9ed;try{_0x4afc7d=await _0x14169c[_0x9f3741(0x1ec)][_0x9f3741(0x1f1)](_0x4b916c[_0x9f3741(0x1e1)]);}catch(_0x43b889){const _0xd0b3a4=_0x43b889 instanceof Error?_0x43b889[_0x9f3741(0x230)]:String(_0x43b889);return _0xd0b3a4[_0x9f3741(0x238)](_0x9f3741(0x224))||_0xd0b3a4['toLowerCase']()[_0x9f3741(0x238)](_0x9f3741(0x1a9))?console['log'](a5_0x1ae528['red'](_0x9f3741(0x23c)+_0x4b916c[_0x9f3741(0x1e1)])):console['log'](a5_0x1ae528[_0x9f3741(0x1d2)](_0x9f3741(0x1e5)+_0x4b916c['projectName']+'\x22:\x20'+_0xd0b3a4)),0x1;}try{_0xbdd9ed=await _0x14169c[_0x9f3741(0x1ec)]['resolveAgentId'](_0x4b916c[_0x9f3741(0x221)],_0x4afc7d);}catch(_0x3f3841){const _0x165863=_0x3f3841 instanceof Error?_0x3f3841[_0x9f3741(0x230)]:String(_0x3f3841);return _0x165863['includes'](_0x9f3741(0x224))||_0x165863[_0x9f3741(0x1b7)]()[_0x9f3741(0x238)]('not\x20found')?console['log'](a5_0x1ae528['red'](_0x9f3741(0x229)+_0x4b916c[_0x9f3741(0x221)])):console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x1d2)](_0x9f3741(0x1fc)+_0x4b916c['agentName']+_0x9f3741(0x1bd)+_0x165863)),0x1;}let _0x1d0e61;if(!_0x397ed0)try{_0x1d0e61=await setupEvaluatorAgent(_0x14169c[_0x9f3741(0x1ec)],_0x8c886f[_0x9f3741(0x21d)]);}catch(_0xda45d2){const _0x54c40a=_0xda45d2 instanceof Error?_0xda45d2[_0x9f3741(0x230)]:String(_0xda45d2);return console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x1d2)](_0x9f3741(0x1ce)+_0x54c40a)),0x1;}console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x1ee)](_0x9f3741(0x1b3))),console[_0x9f3741(0x237)](_0x9f3741(0x1fe)+a5_0x1ae528[_0x9f3741(0x233)](_0x1940df)),console[_0x9f3741(0x237)](_0x9f3741(0x1d5)+a5_0x1ae528['white'](_0x4b916c[_0x9f3741(0x1e1)]+'/'+_0x4b916c[_0x9f3741(0x221)])),console[_0x9f3741(0x237)]();const _0xeeb2b2=[],_0x471ef1=[],_0x1c8b6e=Date['now']();for(let _0x111cf0=0x0;_0x111cf0<_0x33f218['length'];_0x111cf0++){const _0x147791=_0x33f218[_0x111cf0];_0x33f218['length']>0x1?console[_0x9f3741(0x237)](_0x9f3741(0x20e)+(_0x111cf0+0x1)+'/'+_0x33f218['length']+':\x20'+a5_0x1ae528['white'](_0x147791[_0x9f3741(0x1e9)])):console[_0x9f3741(0x237)]('Running\x20test:\x20'+a5_0x1ae528[_0x9f3741(0x233)](_0x147791[_0x9f3741(0x1e9)]));const _0x1e15e3=createCommandSpinner(_0x9f3741(0x1df)+_0x147791[_0x9f3741(0x22b)]['length']+_0x9f3741(0x1ba));_0x1e15e3[_0x9f3741(0x23e)]();try{const {result:_0xf3ca2f,conversation:_0x75eb96}=await runTest(_0x14169c[_0x9f3741(0x1ec)],_0x147791,{'agentId':_0xbdd9ed,'projectId':_0x4afc7d,'site':_0x1940df,'noEval':_0x397ed0,'evaluatorId':_0x1d0e61,'onRoundStart':(_0x553fa1,_0x1b6ed9)=>{const _0x51a8e2=_0x9f3741;_0x1e15e3[_0x51a8e2(0x1cb)]=_0x51a8e2(0x1de)+(_0x553fa1+0x1)+'/'+_0x1b6ed9+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x42d3a2,_0x566bff,_0x4eda18)=>{const _0x41cabc=_0x9f3741,_0x4df814=formatElapsed(_0x566bff);_0x4eda18?console[_0x41cabc(0x237)]('\x20\x20Round\x20'+(_0x42d3a2+0x1)+'/'+_0x147791[_0x41cabc(0x22b)]['length']+_0x41cabc(0x204)+a5_0x1ae528[_0x41cabc(0x223)]('✓')+'\x20('+_0x4df814+')'):console[_0x41cabc(0x237)](_0x41cabc(0x1f3)+(_0x42d3a2+0x1)+'/'+_0x147791[_0x41cabc(0x22b)][_0x41cabc(0x1cd)]+_0x41cabc(0x204)+a5_0x1ae528['red']('✗'));},'onEvaluationStart':()=>{const _0x123d7a=_0x9f3741;_0x1e15e3[_0x123d7a(0x1cb)]=_0x123d7a(0x1c3);},'onEvaluationComplete':_0x2cecdb=>{const _0x382d39=_0x9f3741,_0x52570a=formatElapsed(_0x2cecdb);console[_0x382d39(0x237)](_0x382d39(0x1d8)+a5_0x1ae528[_0x382d39(0x223)]('✓')+'\x20('+_0x52570a+')');}});_0x1e15e3[_0x9f3741(0x23b)](),_0xeeb2b2[_0x9f3741(0x1d4)](_0xf3ca2f),_0x471ef1[_0x9f3741(0x1d4)](_0x75eb96);if(_0xf3ca2f[_0x9f3741(0x1d0)]==='PASS')console['log'](a5_0x1ae528[_0x9f3741(0x223)](_0x9f3741(0x1d6)+_0xf3ca2f[_0x9f3741(0x1be)]));else _0xf3ca2f[_0x9f3741(0x1d0)]==='FAIL'?console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x1d2)]('✗\x20FAIL:\x20'+_0xf3ca2f[_0x9f3741(0x1be)])):console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x1d2)](_0x9f3741(0x1ca)+_0xf3ca2f[_0x9f3741(0x1be)]));_0xf3ca2f[_0x9f3741(0x21c)]&&console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x200)](_0x9f3741(0x220)+_0xf3ca2f[_0x9f3741(0x21c)])),console[_0x9f3741(0x237)]();}catch(_0x2ee059){_0x1e15e3[_0x9f3741(0x23b)]();const _0x8da214=_0x2ee059 instanceof Error?_0x2ee059[_0x9f3741(0x230)]:String(_0x2ee059);console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x1d2)](_0x9f3741(0x1ca)+_0x8da214)),console[_0x9f3741(0x237)](),_0xeeb2b2[_0x9f3741(0x1d4)]({'name':_0x147791[_0x9f3741(0x1e9)],'status':'ERROR','reason':_0x8da214,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x570e2e=Date[_0x9f3741(0x1f8)]()-_0x1c8b6e,_0xd35662=_0xeeb2b2[_0x9f3741(0x1eb)](_0x15d36c=>_0x15d36c[_0x9f3741(0x1d0)]==='PASS')[_0x9f3741(0x1cd)],_0x5b0157=_0xeeb2b2[_0x9f3741(0x1eb)](_0x462ea0=>_0x462ea0[_0x9f3741(0x1d0)]===_0x9f3741(0x1c7))[_0x9f3741(0x1cd)],_0x128245=_0xeeb2b2[_0x9f3741(0x1eb)](_0x58918a=>_0x58918a['status']===_0x9f3741(0x1af))['length'];console[_0x9f3741(0x237)]('━'['repeat'](0x3c)),console[_0x9f3741(0x237)](_0x9f3741(0x209)),console[_0x9f3741(0x237)]('━'[_0x9f3741(0x205)](0x3c)),console['log'](_0x9f3741(0x207)+_0xeeb2b2[_0x9f3741(0x1cd)]),console[_0x9f3741(0x237)](_0x9f3741(0x22e)+a5_0x1ae528[_0x9f3741(0x223)](_0xd35662)),console[_0x9f3741(0x237)](_0x9f3741(0x1d3)+a5_0x1ae528[_0x9f3741(0x1d2)](_0x5b0157));_0x128245>0x0&&console[_0x9f3741(0x237)]('Errors:\x20\x20\x20'+a5_0x1ae528[_0x9f3741(0x1d2)](_0x128245));console[_0x9f3741(0x237)](_0x9f3741(0x1c2)+formatElapsed(_0x570e2e)),console[_0x9f3741(0x237)]('━'[_0x9f3741(0x205)](0x3c));const _0x32c3af=_0xeeb2b2[_0x9f3741(0x1eb)](_0x124410=>_0x124410[_0x9f3741(0x1d0)]!=='PASS');if(_0x32c3af[_0x9f3741(0x1cd)]>0x0){console[_0x9f3741(0x237)](),console[_0x9f3741(0x237)]('Failed\x20Tests:');for(const _0x1c2bbb of _0x32c3af){const _0x327213=a5_0x1ae528[_0x9f3741(0x1d2)]('✗'),_0x22325e=_0x1c2bbb[_0x9f3741(0x1be)][_0x9f3741(0x1cd)]>0x32?_0x1c2bbb['reason'][_0x9f3741(0x1b8)](0x0,0x32)+_0x9f3741(0x236):_0x1c2bbb['reason'];console[_0x9f3741(0x237)]('\x20\x20'+_0x327213+'\x20'+_0x1c2bbb[_0x9f3741(0x1e9)]+':\x20'+_0x22325e);}}const _0x41f192={'summary':{'total':_0xeeb2b2[_0x9f3741(0x1cd)],'passed':_0xd35662,'failed':_0x5b0157,'errors':_0x128245>0x0?_0x128245:undefined,'duration_ms':_0x570e2e},'tests':_0xeeb2b2,'agent':{'project':_0x4b916c[_0x9f3741(0x1e1)],'name':_0x4b916c[_0x9f3741(0x221)],'site':_0x1940df},'timestamp':new Date(_0x1c8b6e)[_0x9f3741(0x1b5)]()};try{const _0x3d2ffc=buildCachedTestRun(_0x471ef1,{'site':_0x1940df,'projectId':_0x4afc7d,'projectName':_0x4b916c[_0x9f3741(0x1e1)],'agentId':_0xbdd9ed,'agentName':_0x4b916c[_0x9f3741(0x221)],'testYmlPath':a5_0x2ddc07['resolve'](_0x4b916c[_0x9f3741(0x1c4)])});saveLastTestRun(_0x3d2ffc);}catch{}if(_0x47efa2!==_0x9f3741(0x1e6)||_0x5df971){const _0x2bee0f=formatResults(_0x41f192,_0x47efa2);if(_0x5df971)try{a5_0x61f3f8['writeFileSync'](_0x5df971,_0x2bee0f,_0x9f3741(0x21e)),console[_0x9f3741(0x237)](),console[_0x9f3741(0x237)](a5_0x1ae528[_0x9f3741(0x200)](_0x9f3741(0x1c6)+_0x5df971));}catch(_0x1b101b){return console[_0x9f3741(0x237)](),console['log'](a5_0x1ae528[_0x9f3741(0x1d2)](_0x9f3741(0x20b)+_0x1b101b)),0x1;}else console['log'](),console['log'](_0x2bee0f);}return _0x32c3af['length']>0x0?0x1:0x0;}async[a5_0x3e5468(0x1ae)](_0x11ce46,_0x2412d2){const _0x4addd4=a5_0x3e5468,{options:_0x56b639,tdx:_0x4ceafa}=_0x11ce46,{definition:_0x2ce365,agentInfo:_0x4fa2ba,outputFormat:_0x1b4b11,outputFile:_0x328f13}=_0x2412d2,_0x2a726f=_0x56b639[_0x4addd4(0x216)],_0x5a990e=loadLastTestRun();if(!_0x5a990e)return console[_0x4addd4(0x237)](a5_0x1ae528[_0x4addd4(0x1d2)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console['log'](a5_0x1ae528[_0x4addd4(0x200)](_0x4addd4(0x1c8))),0x1;if(_0x5a990e['agent']['agentName']!==_0x4fa2ba[_0x4addd4(0x221)])return console[_0x4addd4(0x237)](a5_0x1ae528[_0x4addd4(0x1d2)](_0x4addd4(0x231)+_0x5a990e[_0x4addd4(0x212)]['agentName']+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x4fa2ba['agentName']+'\x22.')),console[_0x4addd4(0x237)](a5_0x1ae528[_0x4addd4(0x200)](_0x4addd4(0x20f))),0x1;const _0x5879d4=new Set(_0x5a990e[_0x4addd4(0x1f7)]['map'](_0x33b6c5=>_0x33b6c5[_0x4addd4(0x1d1)])),_0x493fcf=_0x2ce365[_0x4addd4(0x21f)][_0x4addd4(0x1eb)](_0x2b6476=>!_0x5879d4[_0x4addd4(0x214)](_0x2b6476['name']));if(_0x493fcf['length']>0x0&&_0x5a990e['site']!==_0x2a726f)return console['log'](a5_0x1ae528[_0x4addd4(0x1d2)](_0x4addd4(0x1b1))),console['log'](a5_0x1ae528[_0x4addd4(0x200)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x5a990e['site']+_0x4addd4(0x1e4)+_0x2a726f+'\x22.')),console[_0x4addd4(0x237)](a5_0x1ae528[_0x4addd4(0x200)](_0x4addd4(0x217)+_0x5a990e[_0x4addd4(0x216)]+_0x4addd4(0x1cf))),0x1;const _0x4c649f=_0x2ce365[_0x4addd4(0x21f)][_0x4addd4(0x1eb)](_0x58c2ce=>_0x5879d4[_0x4addd4(0x214)](_0x58c2ce[_0x4addd4(0x1e9)])),_0x5189ce=_0x493fcf;let _0x2ba1f4;try{_0x2ba1f4=await setupEvaluatorAgent(_0x4ceafa[_0x4addd4(0x1ec)],_0x56b639[_0x4addd4(0x21d)]);}catch(_0x3ec9e7){const _0x45dd53=_0x3ec9e7 instanceof Error?_0x3ec9e7[_0x4addd4(0x230)]:String(_0x3ec9e7);return console['log'](a5_0x1ae528[_0x4addd4(0x1d2)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x45dd53)),0x1;}console['log'](a5_0x1ae528[_0x4addd4(0x1ee)](_0x4addd4(0x1b9))),console[_0x4addd4(0x237)](_0x4addd4(0x1b4)+a5_0x1ae528[_0x4addd4(0x233)](_0x5a990e[_0x4addd4(0x1bf)])),console[_0x4addd4(0x237)](_0x4addd4(0x1d5)+a5_0x1ae528[_0x4addd4(0x233)](_0x5a990e[_0x4addd4(0x212)][_0x4addd4(0x1e1)]+'/'+_0x5a990e[_0x4addd4(0x212)][_0x4addd4(0x221)]));_0x5189ce['length']>0x0&&console[_0x4addd4(0x237)](_0x4addd4(0x1bb)+a5_0x1ae528['yellow'](_0x5189ce['length']));console[_0x4addd4(0x237)]();const _0x2bf330=[],_0x3db3a0=Date[_0x4addd4(0x1f8)](),_0x54750f=createCommandSpinner(_0x4addd4(0x222));if(_0x4c649f[_0x4addd4(0x1cd)]>0x0)try{const _0x44f860=await reevaluateFromCache(_0x4ceafa[_0x4addd4(0x1ec)],_0x5a990e,{'tests':_0x4c649f},{'evaluatorId':_0x2ba1f4,'onTestStart':(_0x2452fa,_0x2e5f81,_0x1a75b1)=>{const _0x4a44e8=_0x4addd4;_0x54750f['text']='Re-evaluating\x20'+(_0x2e5f81+0x1)+'/'+_0x1a75b1+':\x20'+_0x2452fa+_0x4a44e8(0x236);if(!_0x54750f[_0x4a44e8(0x20c)])_0x54750f[_0x4a44e8(0x23e)]();},'onTestComplete':(_0x37226a,_0x4dbce9)=>{const _0x476cee=_0x4addd4;_0x54750f['stop']();if(_0x4dbce9[_0x476cee(0x1d0)]===_0x476cee(0x1f0))console[_0x476cee(0x237)](a5_0x1ae528[_0x476cee(0x223)]('✓\x20PASS:\x20'+_0x37226a)+a5_0x1ae528['dim'](_0x476cee(0x1aa)));else _0x4dbce9['status']===_0x476cee(0x1c7)?console[_0x476cee(0x237)](a5_0x1ae528['red']('✗\x20FAIL:\x20'+_0x37226a+'\x20-\x20'+_0x4dbce9[_0x476cee(0x1be)])+a5_0x1ae528[_0x476cee(0x200)]('\x20(cached)')):console['log'](a5_0x1ae528[_0x476cee(0x1d2)]('✗\x20ERROR:\x20'+_0x37226a+_0x476cee(0x215)+_0x4dbce9[_0x476cee(0x1be)]));_0x4dbce9[_0x476cee(0x21c)]&&console[_0x476cee(0x237)](a5_0x1ae528[_0x476cee(0x200)](_0x476cee(0x1f6)+_0x4dbce9[_0x476cee(0x21c)])),_0x2bf330['push'](_0x4dbce9);},'onTestSkipped':(_0x2bb90b,_0x2a3920)=>{const _0xe4ad2=_0x4addd4;_0x54750f['stop'](),console[_0xe4ad2(0x237)](a5_0x1ae528[_0xe4ad2(0x1fd)](_0xe4ad2(0x1b2)+_0x2bb90b+_0xe4ad2(0x215)+_0x2a3920));}});for(const _0x5447ab of _0x44f860){!_0x2bf330['find'](_0x2a5edb=>_0x2a5edb['name']===_0x5447ab['name'])&&_0x2bf330[_0x4addd4(0x1d4)](_0x5447ab);}}catch(_0x512843){_0x54750f[_0x4addd4(0x23b)]();const _0x3af8a5=_0x512843 instanceof Error?_0x512843[_0x4addd4(0x230)]:String(_0x512843);return console[_0x4addd4(0x237)](a5_0x1ae528[_0x4addd4(0x1d2)](_0x4addd4(0x1b6)+_0x3af8a5)),0x1;}_0x54750f[_0x4addd4(0x23b)]();if(_0x5189ce['length']>0x0){console[_0x4addd4(0x237)](),console[_0x4addd4(0x237)](a5_0x1ae528[_0x4addd4(0x1ee)](_0x4addd4(0x1d9)));const {projectId:_0x49e6c8,agentId:_0xbe886e}=_0x5a990e['agent'];for(const _0x39a168 of _0x5189ce){console['log'](_0x4addd4(0x1ab)+a5_0x1ae528[_0x4addd4(0x233)](_0x39a168[_0x4addd4(0x1e9)]));const _0x4b0417=createCommandSpinner(_0x4addd4(0x1df)+_0x39a168[_0x4addd4(0x22b)][_0x4addd4(0x1cd)]+_0x4addd4(0x1ba));_0x4b0417['start']();try{const {result:_0x18c700}=await runTest(_0x4ceafa[_0x4addd4(0x1ec)],_0x39a168,{'agentId':_0xbe886e,'projectId':_0x49e6c8,'site':_0x5a990e['site'],'noEval':![],'evaluatorId':_0x2ba1f4,'onRoundStart':(_0x447e61,_0x211ac4)=>{const _0xd9c00c=_0x4addd4;_0x4b0417[_0xd9c00c(0x1cb)]=_0xd9c00c(0x1de)+(_0x447e61+0x1)+'/'+_0x211ac4+_0xd9c00c(0x1ba);},'onRoundComplete':(_0x361349,_0x5cbfeb,_0x1f2445)=>{const _0x21097c=_0x4addd4,_0x583b83=formatElapsed(_0x5cbfeb);_0x1f2445?console[_0x21097c(0x237)](_0x21097c(0x1f3)+(_0x361349+0x1)+'/'+_0x39a168['rounds'][_0x21097c(0x1cd)]+'...\x20'+a5_0x1ae528[_0x21097c(0x223)]('✓')+'\x20('+_0x583b83+')'):console['log'](_0x21097c(0x1f3)+(_0x361349+0x1)+'/'+_0x39a168['rounds'][_0x21097c(0x1cd)]+_0x21097c(0x204)+a5_0x1ae528[_0x21097c(0x1d2)]('✗'));},'onEvaluationStart':()=>{const _0x3343ae=_0x4addd4;_0x4b0417[_0x3343ae(0x1cb)]=_0x3343ae(0x1c3);},'onEvaluationComplete':_0x412b45=>{const _0x3a9933=_0x4addd4,_0x40f575=formatElapsed(_0x412b45);console[_0x3a9933(0x237)](_0x3a9933(0x1d8)+a5_0x1ae528[_0x3a9933(0x223)]('✓')+'\x20('+_0x40f575+')');}});_0x4b0417[_0x4addd4(0x23b)](),_0x2bf330['push'](_0x18c700);if(_0x18c700['status']==='PASS')console[_0x4addd4(0x237)](a5_0x1ae528[_0x4addd4(0x223)]('✓\x20PASS:\x20'+_0x18c700[_0x4addd4(0x1be)])+a5_0x1ae528[_0x4addd4(0x200)](_0x4addd4(0x22a)));else _0x18c700[_0x4addd4(0x1d0)]==='FAIL'?console['log'](a5_0x1ae528['red'](_0x4addd4(0x23d)+_0x18c700['reason'])+a5_0x1ae528[_0x4addd4(0x200)](_0x4addd4(0x22a))):console[_0x4addd4(0x237)](a5_0x1ae528[_0x4addd4(0x1d2)](_0x4addd4(0x1ca)+_0x18c700[_0x4addd4(0x1be)]));_0x18c700[_0x4addd4(0x21c)]&&console[_0x4addd4(0x237)](a5_0x1ae528[_0x4addd4(0x200)](_0x4addd4(0x1f6)+_0x18c700['conversation_url']));}catch(_0x569d8c){_0x4b0417[_0x4addd4(0x23b)]();const _0x592a6c=_0x569d8c instanceof Error?_0x569d8c[_0x4addd4(0x230)]:String(_0x569d8c);console[_0x4addd4(0x237)](a5_0x1ae528[_0x4addd4(0x1d2)](_0x4addd4(0x1ca)+_0x592a6c)),_0x2bf330[_0x4addd4(0x1d4)]({'name':_0x39a168['name'],'status':_0x4addd4(0x1af),'reason':_0x592a6c,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console['log']();const _0x27552f=Date[_0x4addd4(0x1f8)]()-_0x3db3a0,_0x3f1d6b=_0x2bf330[_0x4addd4(0x1eb)](_0x833f1d=>_0x833f1d[_0x4addd4(0x1d0)]===_0x4addd4(0x1f0))['length'],_0x5f23ce=_0x2bf330['filter'](_0xf08baf=>_0xf08baf[_0x4addd4(0x1d0)]==='FAIL')['length'],_0x408985=_0x2bf330['filter'](_0x1ac553=>_0x1ac553[_0x4addd4(0x1d0)]==='ERROR')[_0x4addd4(0x1cd)];console[_0x4addd4(0x237)]('━'['repeat'](0x3c)),console[_0x4addd4(0x237)](_0x4addd4(0x1fb)),console[_0x4addd4(0x237)]('━'[_0x4addd4(0x205)](0x3c)),console['log'](_0x4addd4(0x207)+_0x2bf330['length']),console[_0x4addd4(0x237)]('Passed:\x20\x20\x20'+a5_0x1ae528[_0x4addd4(0x223)](_0x3f1d6b)),console[_0x4addd4(0x237)](_0x4addd4(0x1d3)+a5_0x1ae528[_0x4addd4(0x1d2)](_0x5f23ce));_0x408985>0x0&&console[_0x4addd4(0x237)]('Errors:\x20\x20\x20'+a5_0x1ae528[_0x4addd4(0x1d2)](_0x408985));console[_0x4addd4(0x237)](_0x4addd4(0x1c2)+formatElapsed(_0x27552f)),console['log']('━'[_0x4addd4(0x205)](0x3c));const _0x3489f3={'summary':{'total':_0x2bf330['length'],'passed':_0x3f1d6b,'failed':_0x5f23ce,'errors':_0x408985>0x0?_0x408985:undefined,'duration_ms':_0x27552f},'tests':_0x2bf330,'agent':{'project':_0x4fa2ba[_0x4addd4(0x1e1)],'name':_0x4fa2ba['agentName'],'site':_0x2a726f},'timestamp':new Date(_0x3db3a0)[_0x4addd4(0x1b5)]()};if(_0x1b4b11!==_0x4addd4(0x1e6)||_0x328f13){const _0x5bcc53=formatResults(_0x3489f3,_0x1b4b11);if(_0x328f13)try{a5_0x61f3f8[_0x4addd4(0x1c9)](_0x328f13,_0x5bcc53,'utf-8'),console[_0x4addd4(0x237)](),console[_0x4addd4(0x237)](a5_0x1ae528[_0x4addd4(0x200)](_0x4addd4(0x1c6)+_0x328f13));}catch(_0x47e77a){return console[_0x4addd4(0x237)](),console[_0x4addd4(0x237)](a5_0x1ae528[_0x4addd4(0x1d2)](_0x4addd4(0x20b)+_0x47e77a)),0x1;}else console[_0x4addd4(0x237)](),console[_0x4addd4(0x237)](_0x5bcc53);}const _0x39a666=_0x2bf330['filter'](_0x55b0f6=>_0x55b0f6[_0x4addd4(0x1d0)]!==_0x4addd4(0x1f0));return _0x39a666[_0x4addd4(0x1cd)]>0x0?0x1:0x0;}}
1
+ const a5_0x4c4efc=a5_0x2d9a;(function(_0x13cb94,_0x291cf8){const _0x1a583b=a5_0x2d9a,_0x4e1c0d=_0x13cb94();while(!![]){try{const _0x3e6083=parseInt(_0x1a583b(0x155))/0x1+parseInt(_0x1a583b(0x139))/0x2*(-parseInt(_0x1a583b(0x148))/0x3)+-parseInt(_0x1a583b(0x16f))/0x4+parseInt(_0x1a583b(0x156))/0x5+parseInt(_0x1a583b(0x166))/0x6+parseInt(_0x1a583b(0x123))/0x7+-parseInt(_0x1a583b(0x12f))/0x8*(-parseInt(_0x1a583b(0x163))/0x9);if(_0x3e6083===_0x291cf8)break;else _0x4e1c0d['push'](_0x4e1c0d['shift']());}catch(_0x2c01f4){_0x4e1c0d['push'](_0x4e1c0d['shift']());}}}(a5_0x21bd,0x57e3e));function a5_0x2d9a(_0x30a00c,_0x5a6e32){_0x30a00c=_0x30a00c-0x102;const _0x21bd57=a5_0x21bd();let _0x2d9a31=_0x21bd57[_0x30a00c];return _0x2d9a31;}import*as a5_0x176059 from'node:fs';import*as a5_0x2ff967 from'node:path';import a5_0x5797fc from'chalk';function a5_0x21bd(){const _0x164d5a=['cyan','map','agent','projectDir','green','split','resolveAgentId','Evaluating\x20response...','Duration:\x20','now','llm','filter','Site:\x20','rounds','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','start','includes','timestamp','add','text','Failed\x20Tests:','✗\x20FAIL:\x20','Usage:','found','projectName','Re-evaluating\x20cached\x20test\x20run...','Executing\x20new\x20tests...','table','⚠\x20SKIPPED:\x20','has','404','trim','toLowerCase','size','\x20\x20Project:\x20','existsSync','/<agent-name>','log','Test\x20Summary','\x20\x20-\x20','Test\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','testYmlPath','Project\x20path:\x20','Re-evaluation\x20Summary','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22',':\x20Sending\x20user\x20input...','\x20\x20Conversation:\x20','tests','join','message','Available\x20tags:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\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)','tsv','\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','Using\x20agent:\x20','ERROR','Total:\x20\x20\x20\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','4775512jxHiZo','length','site','\x20\x20Round\x20','Conversation\x20URL:\x20','\x20(cached)','output','execute','no_context','name','yellow','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','42416urlQKQ','reason','agentDirs','white','json','description','no_local_folder','llmProject','utf-8','New\x20tests\x20to\x20execute:\x20','2wsRyom','Test\x20Configuration:','\x27\x20to\x20create\x20the\x20folder\x20structure.','Round\x201/','\x20\x20Agent:\x20','dim','Running\x20agent\x20tests...','Re-evaluating...','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','No\x20tests\x20found\x20with\x20tags:\x20','Tests\x20found:\x20','...','agent:test','✗\x20ERROR:\x20','\x22:\x20','1046217GesFRm','stop','Error\x20writing\x20output\x20file:\x20','no_tests','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','✓\x20PASS:\x20','Re-evaluating\x20','conversation_url','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','resolveProjectId','Run\x20\x27tdx\x20agent\x20pull\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Available\x20tests:\x20','23362PMBkPW','1652995SFeqQC','toISOString','forEach','testName','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Agent:\x20','Passed:\x20\x20\x20','not\x20found','PASS','find','\x20-\x20','isSpinning','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','423GlfPdY','executeReeval','FAIL','429048WgYpii','repeat','No\x20tests\x20found\x20matching:\x20','\x20(new)','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','...\x20','source','eval','Running\x20test:\x20','2592568sARPzn','tags','status','Failed:\x20\x20\x20','push','Errors:\x20\x20\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','some','jsonl','agentName','Round\x20','red','Output\x20written\x20to:\x20'];a5_0x21bd=function(){return _0x164d5a;};return a5_0x21bd();}import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x4c4efc(0x12c)]=a5_0x4c4efc(0x145);[a5_0x4c4efc(0x134)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x4c4efc(0x12a)](_0xe160a8){const _0x4b7a7c=a5_0x4c4efc,{options:_0x1f5b3b,args:_0x289dba,tdx:_0x567fc4}=_0xe160a8,_0x4e5599=_0x289dba[0x0]||'.',_0x4c9c71=_0x1f5b3b['dryRun'],_0x22fda8=_0x1f5b3b,_0x1284e3=_0x22fda8[_0x4b7a7c(0x16d)]===![],_0x320524=_0x22fda8['reeval'],_0xb02d89=_0x22fda8[_0x4b7a7c(0x12c)],_0x373db7=_0x22fda8['tags'],_0x191779=_0x1f5b3b[_0x4b7a7c(0x125)],_0x2b8988=_0x22fda8[_0x4b7a7c(0x129)];if(_0x320524&&_0x1284e3)return console['log'](a5_0x5797fc[_0x4b7a7c(0x17a)](_0x4b7a7c(0x153))),0x1;let _0x22d8e4='table';if(_0x22fda8[_0x4b7a7c(0x133)])_0x22d8e4=_0x4b7a7c(0x133);else{if(_0x22fda8[_0x4b7a7c(0x177)])_0x22d8e4=_0x4b7a7c(0x177);else{if(_0x22fda8[_0x4b7a7c(0x11d)])_0x22d8e4='tsv';else{if(_0x22fda8[_0x4b7a7c(0x102)])_0x22d8e4=_0x4b7a7c(0x102);}}}const _0x16785d=_0x22fda8[_0x4b7a7c(0x136)];let _0x5c3335=_0x4e5599;const _0x2f3faf=a5_0x176059[_0x4b7a7c(0x10a)](_0x4e5599),_0x35097f=_0x4e5599==='.';if(!_0x2f3faf||_0x35097f){const _0x19f818=resolveProjectFromContext(_0x4e5599,_0x16785d,{'requireFile':'test.yml'});if(_0x19f818[_0x4b7a7c(0x193)])_0x5c3335=_0x19f818[_0x4b7a7c(0x17f)],_0x19f818[_0x4b7a7c(0x16c)]==='context'&&console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x13e)](_0x4b7a7c(0x11f)+_0x5c3335));else switch(_0x19f818[_0x4b7a7c(0x130)]){case _0x4b7a7c(0x12b):console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x12d)](_0x19f818['message'])),console[_0x4b7a7c(0x10c)](),console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x192)),console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x11e)),console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x11c)),console[_0x4b7a7c(0x10c)](),console['log'](_0x4b7a7c(0x122));return 0x1;case _0x4b7a7c(0x135):console[_0x4b7a7c(0x10c)](a5_0x5797fc['yellow'](_0x19f818[_0x4b7a7c(0x119)])),console[_0x4b7a7c(0x10c)](),console['log'](_0x4b7a7c(0x152)+_0x19f818['llmProject']+_0x4b7a7c(0x13b));return 0x1;case'multiple_agents':{const _0x5cf7f2=a5_0x2ff967['basename'](_0x19f818[_0x4b7a7c(0x17f)]);console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x12d)](_0x4b7a7c(0x110)+_0x19f818[_0x4b7a7c(0x136)]+'\x22:'));for(const _0x34868d of _0x19f818[_0x4b7a7c(0x131)]){console['log'](_0x4b7a7c(0x10e)+_0x34868d);}return console[_0x4b7a7c(0x10c)](),console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x14c)+_0x5cf7f2+_0x4b7a7c(0x10b)),0x1;}case _0x4b7a7c(0x14b):console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x12d)](_0x4b7a7c(0x18a)+_0x19f818['llmProject']+'\x22.')),console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x13e)](_0x4b7a7c(0x112)+_0x19f818[_0x4b7a7c(0x17f)])),console[_0x4b7a7c(0x10c)](),console['log'](_0x4b7a7c(0x141));return 0x1;}}const {definition:_0x2f6791,agentInfo:_0x5f535b}=parseTestFile(_0x5c3335);let _0xe2b823=_0x2f6791[_0x4b7a7c(0x117)];if(_0xb02d89){const _0x56bc36=_0xb02d89[_0x4b7a7c(0x181)](',')[_0x4b7a7c(0x17d)](_0x4792b3=>_0x4792b3[_0x4b7a7c(0x106)]());_0xe2b823=_0x2f6791['tests'][_0x4b7a7c(0x187)](_0x2b9d96=>_0x56bc36['includes'](_0x2b9d96[_0x4b7a7c(0x12c)]));if(_0xe2b823[_0x4b7a7c(0x124)]===0x0)return console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x12d)](_0x4b7a7c(0x168)+_0xb02d89)),console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x13e)](_0x4b7a7c(0x154)+_0x2f6791['tests']['map'](_0x2654f8=>_0x2654f8[_0x4b7a7c(0x12c)])[_0x4b7a7c(0x118)](',\x20'))),0x1;}if(_0x373db7){const _0x1fdccb=_0x373db7['split'](',')[_0x4b7a7c(0x17d)](_0x4c223c=>_0x4c223c['trim']()['toLowerCase']());_0xe2b823=_0xe2b823[_0x4b7a7c(0x187)](_0x75b5fd=>_0x75b5fd[_0x4b7a7c(0x170)]?.[_0x4b7a7c(0x176)](_0x45b314=>_0x1fdccb[_0x4b7a7c(0x18c)](_0x45b314[_0x4b7a7c(0x107)]())));if(_0xe2b823[_0x4b7a7c(0x124)]===0x0){console[_0x4b7a7c(0x10c)](a5_0x5797fc['yellow'](_0x4b7a7c(0x142)+_0x373db7));const _0x303f0b=new Set();return _0x2f6791[_0x4b7a7c(0x117)][_0x4b7a7c(0x158)](_0x27864d=>_0x27864d['tags']?.[_0x4b7a7c(0x158)](_0x24eea9=>_0x303f0b[_0x4b7a7c(0x18e)](_0x24eea9))),_0x303f0b[_0x4b7a7c(0x108)]>0x0?console['log'](a5_0x5797fc[_0x4b7a7c(0x13e)](_0x4b7a7c(0x11a)+[..._0x303f0b][_0x4b7a7c(0x118)](',\x20'))):console[_0x4b7a7c(0x10c)](a5_0x5797fc['dim']('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x320524)return this['executeReeval'](_0xe160a8,{'definition':{'tests':_0xe2b823},'agentInfo':_0x5f535b,'outputFormat':_0x22d8e4,'outputFile':_0x2b8988,'testNames':_0xb02d89});if(_0x4c9c71){console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x17c)](_0x4b7a7c(0x13a))),console[_0x4b7a7c(0x10c)]('\x20\x20Site:\x20'+a5_0x5797fc['white'](_0x191779)),console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x109)+a5_0x5797fc[_0x4b7a7c(0x132)](_0x5f535b[_0x4b7a7c(0x194)])),console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x13d)+a5_0x5797fc[_0x4b7a7c(0x132)](_0x5f535b[_0x4b7a7c(0x178)])),console[_0x4b7a7c(0x10c)](),console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x143)+a5_0x5797fc[_0x4b7a7c(0x132)](_0xe2b823[_0x4b7a7c(0x124)]));for(let _0x5458c1=0x0;_0x5458c1<_0xe2b823['length'];_0x5458c1++){const _0x21b489=_0xe2b823[_0x5458c1],_0x185e1b=_0x21b489['rounds'][_0x4b7a7c(0x124)]===0x1?'round':_0x4b7a7c(0x189),_0x3440b9=_0x21b489[_0x4b7a7c(0x170)]?.[_0x4b7a7c(0x124)]?'\x20['+_0x21b489['tags'][_0x4b7a7c(0x118)](',\x20')+']':'';console[_0x4b7a7c(0x10c)]('\x20\x20'+(_0x5458c1+0x1)+'.\x20'+a5_0x5797fc[_0x4b7a7c(0x132)](_0x21b489[_0x4b7a7c(0x12c)])+'\x20('+_0x21b489[_0x4b7a7c(0x189)][_0x4b7a7c(0x124)]+'\x20'+_0x185e1b+')'+a5_0x5797fc[_0x4b7a7c(0x13e)](_0x3440b9));}return 0x0;}let _0x405cc6,_0x5ed978;try{_0x405cc6=await _0x567fc4[_0x4b7a7c(0x186)][_0x4b7a7c(0x151)](_0x5f535b[_0x4b7a7c(0x194)]);}catch(_0x414e01){const _0x5288bc=_0x414e01 instanceof Error?_0x414e01[_0x4b7a7c(0x119)]:String(_0x414e01);return _0x5288bc[_0x4b7a7c(0x18c)](_0x4b7a7c(0x105))||_0x5288bc[_0x4b7a7c(0x107)]()['includes'](_0x4b7a7c(0x15d))?console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x17a)](_0x4b7a7c(0x175)+_0x5f535b['projectName'])):console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x17a)](_0x4b7a7c(0x11b)+_0x5f535b[_0x4b7a7c(0x194)]+_0x4b7a7c(0x147)+_0x5288bc)),0x1;}try{_0x5ed978=await _0x567fc4[_0x4b7a7c(0x186)][_0x4b7a7c(0x182)](_0x5f535b[_0x4b7a7c(0x178)],_0x405cc6);}catch(_0x5c55e7){const _0x265691=_0x5c55e7 instanceof Error?_0x5c55e7[_0x4b7a7c(0x119)]:String(_0x5c55e7);return _0x265691[_0x4b7a7c(0x18c)](_0x4b7a7c(0x105))||_0x265691[_0x4b7a7c(0x107)]()[_0x4b7a7c(0x18c)]('not\x20found')?console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x17a)](_0x4b7a7c(0x16a)+_0x5f535b['agentName'])):console['log'](a5_0x5797fc[_0x4b7a7c(0x17a)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x5f535b['agentName']+_0x4b7a7c(0x147)+_0x265691)),0x1;}let _0x252183;if(!_0x1284e3)try{_0x252183=await setupEvaluatorAgent(_0x567fc4[_0x4b7a7c(0x186)],_0x1f5b3b['verbose']);}catch(_0x505d5b){const _0x100afb=_0x505d5b instanceof Error?_0x505d5b[_0x4b7a7c(0x119)]:String(_0x505d5b);return console['log'](a5_0x5797fc[_0x4b7a7c(0x17a)](_0x4b7a7c(0x15a)+_0x100afb)),0x1;}console['log'](a5_0x5797fc[_0x4b7a7c(0x17c)](_0x4b7a7c(0x13f))),console['log'](_0x4b7a7c(0x188)+a5_0x5797fc[_0x4b7a7c(0x132)](_0x191779)),console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x15b)+a5_0x5797fc[_0x4b7a7c(0x132)](_0x5f535b[_0x4b7a7c(0x194)]+'/'+_0x5f535b['agentName'])),console['log']();const _0x5bf82e=[],_0x5e7615=[],_0x5e1cb2=Date[_0x4b7a7c(0x185)]();for(let _0x27ffb0=0x0;_0x27ffb0<_0xe2b823[_0x4b7a7c(0x124)];_0x27ffb0++){const _0x1ae1ca=_0xe2b823[_0x27ffb0];_0xe2b823['length']>0x1?console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x10f)+(_0x27ffb0+0x1)+'/'+_0xe2b823['length']+':\x20'+a5_0x5797fc[_0x4b7a7c(0x132)](_0x1ae1ca[_0x4b7a7c(0x12c)])):console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x16e)+a5_0x5797fc[_0x4b7a7c(0x132)](_0x1ae1ca[_0x4b7a7c(0x12c)]));const _0x24633c=createCommandSpinner(_0x4b7a7c(0x13c)+_0x1ae1ca[_0x4b7a7c(0x189)][_0x4b7a7c(0x124)]+_0x4b7a7c(0x115));_0x24633c['start']();try{const {result:_0xe03126,conversation:_0x3a73b4}=await runTest(_0x567fc4[_0x4b7a7c(0x186)],_0x1ae1ca,{'agentId':_0x5ed978,'projectId':_0x405cc6,'site':_0x191779,'noEval':_0x1284e3,'evaluatorId':_0x252183,'onRoundStart':(_0x1f7564,_0x4e9fdd)=>{const _0x40ae87=_0x4b7a7c;_0x24633c[_0x40ae87(0x18f)]=_0x40ae87(0x179)+(_0x1f7564+0x1)+'/'+_0x4e9fdd+_0x40ae87(0x115);},'onRoundComplete':(_0x5e346d,_0x2f6da2,_0x4c5bc6)=>{const _0x48df64=_0x4b7a7c,_0x179d66=formatElapsed(_0x2f6da2);_0x4c5bc6?console[_0x48df64(0x10c)](_0x48df64(0x126)+(_0x5e346d+0x1)+'/'+_0x1ae1ca[_0x48df64(0x189)][_0x48df64(0x124)]+_0x48df64(0x16b)+a5_0x5797fc['green']('✓')+'\x20('+_0x179d66+')'):console[_0x48df64(0x10c)](_0x48df64(0x126)+(_0x5e346d+0x1)+'/'+_0x1ae1ca[_0x48df64(0x189)]['length']+'...\x20'+a5_0x5797fc[_0x48df64(0x17a)]('✗'));},'onEvaluationStart':()=>{const _0x495fdc=_0x4b7a7c;_0x24633c['text']=_0x495fdc(0x183);},'onEvaluationComplete':_0x3950ce=>{const _0x2878a1=_0x4b7a7c,_0x2851bd=formatElapsed(_0x3950ce);console['log']('\x20\x20Evaluating...\x20'+a5_0x5797fc[_0x2878a1(0x180)]('✓')+'\x20('+_0x2851bd+')');}});_0x24633c['stop'](),_0x5bf82e[_0x4b7a7c(0x173)](_0xe03126),_0x5e7615[_0x4b7a7c(0x173)](_0x3a73b4);if(_0xe03126[_0x4b7a7c(0x171)]===_0x4b7a7c(0x15e))console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x180)](_0x4b7a7c(0x14d)+_0xe03126['reason']));else _0xe03126['status']===_0x4b7a7c(0x165)?console['log'](a5_0x5797fc['red'](_0x4b7a7c(0x191)+_0xe03126[_0x4b7a7c(0x130)])):console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x17a)](_0x4b7a7c(0x146)+_0xe03126[_0x4b7a7c(0x130)]));_0xe03126[_0x4b7a7c(0x14f)]&&console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x13e)](_0x4b7a7c(0x127)+_0xe03126[_0x4b7a7c(0x14f)])),console['log']();}catch(_0x55c0cc){_0x24633c[_0x4b7a7c(0x149)]();const _0x24a767=_0x55c0cc instanceof Error?_0x55c0cc[_0x4b7a7c(0x119)]:String(_0x55c0cc);console['log'](a5_0x5797fc[_0x4b7a7c(0x17a)](_0x4b7a7c(0x146)+_0x24a767)),console['log'](),_0x5bf82e[_0x4b7a7c(0x173)]({'name':_0x1ae1ca[_0x4b7a7c(0x12c)],'status':_0x4b7a7c(0x120),'reason':_0x24a767,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x55fbfc=Date[_0x4b7a7c(0x185)]()-_0x5e1cb2,_0x40e83a=_0x5bf82e[_0x4b7a7c(0x187)](_0x3d83d9=>_0x3d83d9[_0x4b7a7c(0x171)]==='PASS')[_0x4b7a7c(0x124)],_0x9f0f37=_0x5bf82e[_0x4b7a7c(0x187)](_0x1c28d7=>_0x1c28d7[_0x4b7a7c(0x171)]==='FAIL')[_0x4b7a7c(0x124)],_0x477799=_0x5bf82e[_0x4b7a7c(0x187)](_0x1c2c3d=>_0x1c2c3d['status']===_0x4b7a7c(0x120))['length'];console['log']('━'[_0x4b7a7c(0x167)](0x3c)),console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x10d)),console['log']('━'[_0x4b7a7c(0x167)](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x5bf82e['length']),console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x15c)+a5_0x5797fc[_0x4b7a7c(0x180)](_0x40e83a)),console['log']('Failed:\x20\x20\x20'+a5_0x5797fc['red'](_0x9f0f37));_0x477799>0x0&&console['log'](_0x4b7a7c(0x174)+a5_0x5797fc['red'](_0x477799));console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x184)+formatElapsed(_0x55fbfc)),console[_0x4b7a7c(0x10c)]('━'[_0x4b7a7c(0x167)](0x3c));const _0x1fbe4e=_0x5bf82e[_0x4b7a7c(0x187)](_0x59fd91=>_0x59fd91[_0x4b7a7c(0x171)]!==_0x4b7a7c(0x15e));if(_0x1fbe4e['length']>0x0){console[_0x4b7a7c(0x10c)](),console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x190));for(const _0x1fb9c3 of _0x1fbe4e){const _0x504e7f=a5_0x5797fc[_0x4b7a7c(0x17a)]('✗'),_0x2d79bf=_0x1fb9c3['reason']['length']>0x32?_0x1fb9c3['reason']['substring'](0x0,0x32)+'...':_0x1fb9c3[_0x4b7a7c(0x130)];console['log']('\x20\x20'+_0x504e7f+'\x20'+_0x1fb9c3[_0x4b7a7c(0x12c)]+':\x20'+_0x2d79bf);}}const _0x5b1ca8={'summary':{'total':_0x5bf82e[_0x4b7a7c(0x124)],'passed':_0x40e83a,'failed':_0x9f0f37,'errors':_0x477799>0x0?_0x477799:undefined,'duration_ms':_0x55fbfc},'tests':_0x5bf82e,'agent':{'project':_0x5f535b[_0x4b7a7c(0x194)],'name':_0x5f535b[_0x4b7a7c(0x178)],'site':_0x191779},'timestamp':new Date(_0x5e1cb2)[_0x4b7a7c(0x157)]()};try{const _0x183484=buildCachedTestRun(_0x5e7615,{'site':_0x191779,'projectId':_0x405cc6,'projectName':_0x5f535b[_0x4b7a7c(0x194)],'agentId':_0x5ed978,'agentName':_0x5f535b[_0x4b7a7c(0x178)],'testYmlPath':a5_0x2ff967['resolve'](_0x5f535b[_0x4b7a7c(0x111)])});saveLastTestRun(_0x183484);}catch{}if(_0x22d8e4!==_0x4b7a7c(0x102)||_0x2b8988){const _0x3f8e13=formatResults(_0x5b1ca8,_0x22d8e4);if(_0x2b8988)try{a5_0x176059['writeFileSync'](_0x2b8988,_0x3f8e13,'utf-8'),console[_0x4b7a7c(0x10c)](),console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x13e)](_0x4b7a7c(0x17b)+_0x2b8988));}catch(_0xd6d1){return console[_0x4b7a7c(0x10c)](),console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x17a)](_0x4b7a7c(0x14a)+_0xd6d1)),0x1;}else console[_0x4b7a7c(0x10c)](),console['log'](_0x3f8e13);}return _0x1fbe4e[_0x4b7a7c(0x124)]>0x0?0x1:0x0;}async[a5_0x4c4efc(0x164)](_0x651d1b,_0x10dbc0){const _0x29ba69=a5_0x4c4efc,{options:_0x53732b,tdx:_0x297201}=_0x651d1b,{definition:_0x53a03e,agentInfo:_0x1f3dc9,outputFormat:_0x4ed67c,outputFile:_0x9e4a35}=_0x10dbc0,_0x52de63=_0x53732b[_0x29ba69(0x125)],_0x4d07aa=loadLastTestRun();if(!_0x4d07aa)return console['log'](a5_0x5797fc[_0x29ba69(0x17a)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console['log'](a5_0x5797fc['dim'](_0x29ba69(0x150))),0x1;if(_0x4d07aa['agent'][_0x29ba69(0x178)]!==_0x1f3dc9[_0x29ba69(0x178)])return console[_0x29ba69(0x10c)](a5_0x5797fc[_0x29ba69(0x17a)](_0x29ba69(0x114)+_0x4d07aa['agent'][_0x29ba69(0x178)]+_0x29ba69(0x162)+_0x1f3dc9['agentName']+'\x22.')),console[_0x29ba69(0x10c)](a5_0x5797fc[_0x29ba69(0x13e)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x200cab=new Set(_0x4d07aa['conversations'][_0x29ba69(0x17d)](_0x110b52=>_0x110b52[_0x29ba69(0x159)])),_0x370a6d=_0x53a03e[_0x29ba69(0x117)][_0x29ba69(0x187)](_0x7a946d=>!_0x200cab['has'](_0x7a946d[_0x29ba69(0x12c)]));if(_0x370a6d['length']>0x0&&_0x4d07aa[_0x29ba69(0x125)]!==_0x52de63)return console[_0x29ba69(0x10c)](a5_0x5797fc[_0x29ba69(0x17a)](_0x29ba69(0x12e))),console[_0x29ba69(0x10c)](a5_0x5797fc[_0x29ba69(0x13e)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x4d07aa[_0x29ba69(0x125)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x52de63+'\x22.')),console[_0x29ba69(0x10c)](a5_0x5797fc[_0x29ba69(0x13e)]('Either\x20switch\x20to\x20the\x20\x22'+_0x4d07aa[_0x29ba69(0x125)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x1d5dd9=_0x53a03e[_0x29ba69(0x117)]['filter'](_0x2f52bc=>_0x200cab[_0x29ba69(0x104)](_0x2f52bc['name'])),_0x3cdb6e=_0x370a6d;let _0x331028;try{_0x331028=await setupEvaluatorAgent(_0x297201['llm'],_0x53732b['verbose']);}catch(_0x32e1f1){const _0x11de09=_0x32e1f1 instanceof Error?_0x32e1f1[_0x29ba69(0x119)]:String(_0x32e1f1);return console[_0x29ba69(0x10c)](a5_0x5797fc['red'](_0x29ba69(0x15a)+_0x11de09)),0x1;}console[_0x29ba69(0x10c)](a5_0x5797fc[_0x29ba69(0x17c)](_0x29ba69(0x195))),console[_0x29ba69(0x10c)]('Cached\x20run\x20from:\x20'+a5_0x5797fc[_0x29ba69(0x132)](_0x4d07aa[_0x29ba69(0x18d)])),console[_0x29ba69(0x10c)](_0x29ba69(0x15b)+a5_0x5797fc[_0x29ba69(0x132)](_0x4d07aa[_0x29ba69(0x17e)][_0x29ba69(0x194)]+'/'+_0x4d07aa['agent']['agentName']));_0x3cdb6e[_0x29ba69(0x124)]>0x0&&console[_0x29ba69(0x10c)](_0x29ba69(0x138)+a5_0x5797fc[_0x29ba69(0x12d)](_0x3cdb6e[_0x29ba69(0x124)]));console['log']();const _0x35cf40=[],_0x3f64e5=Date[_0x29ba69(0x185)](),_0x27cf5c=createCommandSpinner(_0x29ba69(0x140));if(_0x1d5dd9[_0x29ba69(0x124)]>0x0)try{const _0x7f286a=await reevaluateFromCache(_0x297201[_0x29ba69(0x186)],_0x4d07aa,{'tests':_0x1d5dd9},{'evaluatorId':_0x331028,'onTestStart':(_0x991306,_0x37d23b,_0x1d6b25)=>{const _0x18274a=_0x29ba69;_0x27cf5c['text']=_0x18274a(0x14e)+(_0x37d23b+0x1)+'/'+_0x1d6b25+':\x20'+_0x991306+_0x18274a(0x144);if(!_0x27cf5c[_0x18274a(0x161)])_0x27cf5c['start']();},'onTestComplete':(_0x968c8b,_0x274f76)=>{const _0x1e2825=_0x29ba69;_0x27cf5c[_0x1e2825(0x149)]();if(_0x274f76[_0x1e2825(0x171)]==='PASS')console[_0x1e2825(0x10c)](a5_0x5797fc[_0x1e2825(0x180)](_0x1e2825(0x14d)+_0x968c8b)+a5_0x5797fc[_0x1e2825(0x13e)]('\x20(cached)'));else _0x274f76[_0x1e2825(0x171)]==='FAIL'?console[_0x1e2825(0x10c)](a5_0x5797fc[_0x1e2825(0x17a)](_0x1e2825(0x191)+_0x968c8b+'\x20-\x20'+_0x274f76['reason'])+a5_0x5797fc[_0x1e2825(0x13e)](_0x1e2825(0x128))):console[_0x1e2825(0x10c)](a5_0x5797fc[_0x1e2825(0x17a)]('✗\x20ERROR:\x20'+_0x968c8b+'\x20-\x20'+_0x274f76[_0x1e2825(0x130)]));_0x274f76['conversation_url']&&console['log'](a5_0x5797fc[_0x1e2825(0x13e)]('\x20\x20Conversation:\x20'+_0x274f76[_0x1e2825(0x14f)])),_0x35cf40[_0x1e2825(0x173)](_0x274f76);},'onTestSkipped':(_0xf8320d,_0xfc7534)=>{const _0x1a526c=_0x29ba69;_0x27cf5c[_0x1a526c(0x149)](),console[_0x1a526c(0x10c)](a5_0x5797fc[_0x1a526c(0x12d)](_0x1a526c(0x103)+_0xf8320d+_0x1a526c(0x160)+_0xfc7534));}});for(const _0x391dc4 of _0x7f286a){!_0x35cf40[_0x29ba69(0x15f)](_0x1682d6=>_0x1682d6[_0x29ba69(0x12c)]===_0x391dc4[_0x29ba69(0x12c)])&&_0x35cf40[_0x29ba69(0x173)](_0x391dc4);}}catch(_0x2f442f){_0x27cf5c[_0x29ba69(0x149)]();const _0x566fb0=_0x2f442f instanceof Error?_0x2f442f[_0x29ba69(0x119)]:String(_0x2f442f);return console[_0x29ba69(0x10c)](a5_0x5797fc['red']('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x566fb0)),0x1;}_0x27cf5c[_0x29ba69(0x149)]();if(_0x3cdb6e[_0x29ba69(0x124)]>0x0){console[_0x29ba69(0x10c)](),console['log'](a5_0x5797fc[_0x29ba69(0x17c)](_0x29ba69(0x196)));const {projectId:_0x1fb21d,agentId:_0x26f0c0}=_0x4d07aa['agent'];for(const _0x562a00 of _0x3cdb6e){console[_0x29ba69(0x10c)]('Running:\x20'+a5_0x5797fc[_0x29ba69(0x132)](_0x562a00[_0x29ba69(0x12c)]));const _0x565807=createCommandSpinner(_0x29ba69(0x13c)+_0x562a00[_0x29ba69(0x189)]['length']+_0x29ba69(0x115));_0x565807[_0x29ba69(0x18b)]();try{const {result:_0x3b98a4}=await runTest(_0x297201[_0x29ba69(0x186)],_0x562a00,{'agentId':_0x26f0c0,'projectId':_0x1fb21d,'site':_0x4d07aa['site'],'noEval':![],'evaluatorId':_0x331028,'onRoundStart':(_0x44254b,_0x50857b)=>{const _0x5bb4ac=_0x29ba69;_0x565807[_0x5bb4ac(0x18f)]=_0x5bb4ac(0x179)+(_0x44254b+0x1)+'/'+_0x50857b+_0x5bb4ac(0x115);},'onRoundComplete':(_0x69e3d8,_0x54b8c3,_0x4ae29c)=>{const _0xdcea9a=_0x29ba69,_0x17d888=formatElapsed(_0x54b8c3);_0x4ae29c?console['log']('\x20\x20Round\x20'+(_0x69e3d8+0x1)+'/'+_0x562a00[_0xdcea9a(0x189)][_0xdcea9a(0x124)]+_0xdcea9a(0x16b)+a5_0x5797fc['green']('✓')+'\x20('+_0x17d888+')'):console['log'](_0xdcea9a(0x126)+(_0x69e3d8+0x1)+'/'+_0x562a00[_0xdcea9a(0x189)]['length']+'...\x20'+a5_0x5797fc[_0xdcea9a(0x17a)]('✗'));},'onEvaluationStart':()=>{const _0x454265=_0x29ba69;_0x565807[_0x454265(0x18f)]=_0x454265(0x183);},'onEvaluationComplete':_0x403aa1=>{const _0x518441=_0x29ba69,_0x103d6e=formatElapsed(_0x403aa1);console[_0x518441(0x10c)]('\x20\x20Evaluating...\x20'+a5_0x5797fc['green']('✓')+'\x20('+_0x103d6e+')');}});_0x565807['stop'](),_0x35cf40['push'](_0x3b98a4);if(_0x3b98a4[_0x29ba69(0x171)]===_0x29ba69(0x15e))console[_0x29ba69(0x10c)](a5_0x5797fc[_0x29ba69(0x180)](_0x29ba69(0x14d)+_0x3b98a4[_0x29ba69(0x130)])+a5_0x5797fc[_0x29ba69(0x13e)](_0x29ba69(0x169)));else _0x3b98a4[_0x29ba69(0x171)]===_0x29ba69(0x165)?console[_0x29ba69(0x10c)](a5_0x5797fc[_0x29ba69(0x17a)](_0x29ba69(0x191)+_0x3b98a4[_0x29ba69(0x130)])+a5_0x5797fc[_0x29ba69(0x13e)]('\x20(new)')):console['log'](a5_0x5797fc[_0x29ba69(0x17a)](_0x29ba69(0x146)+_0x3b98a4['reason']));_0x3b98a4[_0x29ba69(0x14f)]&&console[_0x29ba69(0x10c)](a5_0x5797fc[_0x29ba69(0x13e)](_0x29ba69(0x116)+_0x3b98a4[_0x29ba69(0x14f)]));}catch(_0x55b05e){_0x565807['stop']();const _0xc761e2=_0x55b05e instanceof Error?_0x55b05e[_0x29ba69(0x119)]:String(_0x55b05e);console[_0x29ba69(0x10c)](a5_0x5797fc['red'](_0x29ba69(0x146)+_0xc761e2)),_0x35cf40[_0x29ba69(0x173)]({'name':_0x562a00[_0x29ba69(0x12c)],'status':'ERROR','reason':_0xc761e2,'timestamp':new Date()[_0x29ba69(0x157)](),'duration_ms':0x0});}}}console[_0x29ba69(0x10c)]();const _0x35a5b4=Date[_0x29ba69(0x185)]()-_0x3f64e5,_0xacf699=_0x35cf40['filter'](_0x2e4f66=>_0x2e4f66[_0x29ba69(0x171)]===_0x29ba69(0x15e))['length'],_0x5de57b=_0x35cf40[_0x29ba69(0x187)](_0x53d18b=>_0x53d18b[_0x29ba69(0x171)]==='FAIL')[_0x29ba69(0x124)],_0x4e20a9=_0x35cf40[_0x29ba69(0x187)](_0x5e7970=>_0x5e7970[_0x29ba69(0x171)]===_0x29ba69(0x120))[_0x29ba69(0x124)];console['log']('━'[_0x29ba69(0x167)](0x3c)),console['log'](_0x29ba69(0x113)),console[_0x29ba69(0x10c)]('━'[_0x29ba69(0x167)](0x3c)),console['log'](_0x29ba69(0x121)+_0x35cf40[_0x29ba69(0x124)]),console['log'](_0x29ba69(0x15c)+a5_0x5797fc[_0x29ba69(0x180)](_0xacf699)),console[_0x29ba69(0x10c)](_0x29ba69(0x172)+a5_0x5797fc[_0x29ba69(0x17a)](_0x5de57b));_0x4e20a9>0x0&&console['log'](_0x29ba69(0x174)+a5_0x5797fc[_0x29ba69(0x17a)](_0x4e20a9));console[_0x29ba69(0x10c)](_0x29ba69(0x184)+formatElapsed(_0x35a5b4)),console[_0x29ba69(0x10c)]('━'[_0x29ba69(0x167)](0x3c));const _0x437dd6={'summary':{'total':_0x35cf40[_0x29ba69(0x124)],'passed':_0xacf699,'failed':_0x5de57b,'errors':_0x4e20a9>0x0?_0x4e20a9:undefined,'duration_ms':_0x35a5b4},'tests':_0x35cf40,'agent':{'project':_0x1f3dc9[_0x29ba69(0x194)],'name':_0x1f3dc9['agentName'],'site':_0x52de63},'timestamp':new Date(_0x3f64e5)[_0x29ba69(0x157)]()};if(_0x4ed67c!==_0x29ba69(0x102)||_0x9e4a35){const _0x16ab9f=formatResults(_0x437dd6,_0x4ed67c);if(_0x9e4a35)try{a5_0x176059['writeFileSync'](_0x9e4a35,_0x16ab9f,_0x29ba69(0x137)),console[_0x29ba69(0x10c)](),console[_0x29ba69(0x10c)](a5_0x5797fc[_0x29ba69(0x13e)](_0x29ba69(0x17b)+_0x9e4a35));}catch(_0x83f303){return console[_0x29ba69(0x10c)](),console['log'](a5_0x5797fc[_0x29ba69(0x17a)]('Error\x20writing\x20output\x20file:\x20'+_0x83f303)),0x1;}else console[_0x29ba69(0x10c)](),console[_0x29ba69(0x10c)](_0x16ab9f);}const _0x320a35=_0x35cf40[_0x29ba69(0x187)](_0x2535b2=>_0x2535b2[_0x29ba69(0x171)]!==_0x29ba69(0x15e));return _0x320a35[_0x29ba69(0x124)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x1c179f=a6_0x2abc;(function(_0x1b0fa3,_0x333f71){const _0x414cc7=a6_0x2abc,_0x33d8d7=_0x1b0fa3();while(!![]){try{const _0x5a1473=parseInt(_0x414cc7(0x1c9))/0x1*(-parseInt(_0x414cc7(0x1cc))/0x2)+parseInt(_0x414cc7(0x1d2))/0x3+parseInt(_0x414cc7(0x1e8))/0x4*(parseInt(_0x414cc7(0x1ed))/0x5)+-parseInt(_0x414cc7(0x1ee))/0x6*(-parseInt(_0x414cc7(0x1dd))/0x7)+-parseInt(_0x414cc7(0x1f2))/0x8*(parseInt(_0x414cc7(0x1d7))/0x9)+-parseInt(_0x414cc7(0x1c4))/0xa*(parseInt(_0x414cc7(0x1cb))/0xb)+parseInt(_0x414cc7(0x1d0))/0xc;if(_0x5a1473===_0x333f71)break;else _0x33d8d7['push'](_0x33d8d7['shift']());}catch(_0x3ca774){_0x33d8d7['push'](_0x33d8d7['shift']());}}}(a6_0xace0,0xa0951));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x1c179f(0x1ea),a6_0x1c179f(0x1f0),a6_0x1c179f(0x1af),a6_0x1c179f(0x1f3),'set-cookie2','x-xsrf-token','x-auth-token','x-trino-user']);function a6_0xace0(){const _0x14ae16=['6426dphPzx','data','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','startsWith','.\x20Valid\x20methods:\x20','keys','7rHINti','log','trino','validate','readBodyFromFile','workflow','DELETE','cdp','POST','body','api','4AaovUX','\x0aStack\x20trace:\x0a','authorization','isArray','Results\x20saved\x20to\x20','1663565CLsKHw','1943454uOBier','includes','proxy-authorization','llm','13544SKTpPe','set-cookie','toUpperCase','noColor','Invalid\x20header\x20format:\x20\x22','cookie','Invalid\x20API\x20type:\x20','error','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','has','output','name','Invalid\x20HTTP\x20method:\x20','status','GET','entries','trim','execute','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','indexOf','method','request','description','length','llm-proxy','cas','10KgxoBv','PATCH','substring','join','headers','176zdXXOW','.\x20Valid\x20types:\x20','3660437mxQBGl','3314bgjuGU','site','toLowerCase','verbose','21346260sQAnbG','file','166407cPQKUp','<\x20HTTP/1.1\x20','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','type','Endpoint\x20must\x20start\x20with\x20/:\x20'];a6_0xace0=function(){return _0x14ae16;};return a6_0xace0();}function isSensitiveHeader(_0x434f44){const _0x3b67e8=a6_0x1c179f;return SENSITIVE_HEADERS[_0x3b67e8(0x1b3)](_0x434f44[_0x3b67e8(0x1ce)]());}function a6_0x2abc(_0xb2ab5,_0x133def){_0xb2ab5=_0xb2ab5-0x1ac;const _0xace093=a6_0xace0();let _0x2abc3e=_0xace093[_0xb2ab5];return _0x2abc3e;}function parseHeader(_0x1e63d7){const _0x25eb30=a6_0x1c179f,_0x2dfd4c=_0x1e63d7[_0x25eb30(0x1bd)](':');if(_0x2dfd4c===-0x1)throw new Error(_0x25eb30(0x1ae)+_0x1e63d7+'\x22.\x20'+_0x25eb30(0x1bc));const _0x2888df=_0x1e63d7[_0x25eb30(0x1c6)](0x0,_0x2dfd4c)[_0x25eb30(0x1ba)](),_0x50d092=_0x1e63d7[_0x25eb30(0x1c6)](_0x2dfd4c+0x1)[_0x25eb30(0x1ba)]();if(!_0x2888df)throw new Error(_0x25eb30(0x1b2)+_0x1e63d7+'\x22');return[_0x2888df,_0x50d092];}export class ApiCommand extends BaseCommand{[a6_0x1c179f(0x1b5)]=a6_0x1c179f(0x1e7);[a6_0x1c179f(0x1c0)]=a6_0x1c179f(0x1d4);[a6_0x1c179f(0x1e0)](_0x553768){const _0x240216=a6_0x1c179f,{args:_0x44332f,options:_0x39e59a}=_0x553768,_0x55ac88=_0x39e59a;if(_0x44332f[_0x240216(0x1c1)]===0x0)return _0x240216(0x1d9);const _0x5a47a7=_0x44332f[0x0];if(!_0x5a47a7[_0x240216(0x1da)]('/'))return _0x240216(0x1d6)+_0x5a47a7;const _0x44ea7e=_0x55ac88['data'],_0x430a97=_0x55ac88[_0x240216(0x1d1)];if(_0x44ea7e&&_0x430a97)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x31ddfb=_0x55ac88[_0x240216(0x1be)]||_0x240216(0x1b8),_0x55bf26=[_0x240216(0x1b8),_0x240216(0x1e5),'PUT',_0x240216(0x1e3),_0x240216(0x1c5)];if(!_0x55bf26[_0x240216(0x1ef)](_0x31ddfb[_0x240216(0x1ac)]()))return _0x240216(0x1b6)+_0x31ddfb+_0x240216(0x1db)+_0x55bf26[_0x240216(0x1c7)](',\x20');const _0x14e6ce=_0x55ac88['type']||'td',_0x462861=['td',_0x240216(0x1e4),_0x240216(0x1e2),_0x240216(0x1df),_0x240216(0x1f1),_0x240216(0x1c2),_0x240216(0x1c3)];if(!_0x462861[_0x240216(0x1ef)](_0x14e6ce))return _0x240216(0x1b0)+_0x14e6ce+_0x240216(0x1ca)+_0x462861['join'](',\x20');return undefined;}async[a6_0x1c179f(0x1bb)](_0x4ab56d){const _0x4051ea=a6_0x1c179f,{options:_0x2be5e5,args:_0x1b826a,tdx:_0x4c5d83}=_0x4ab56d,_0x1fa3d7=_0x2be5e5,_0x1192bb=_0x1b826a[0x0],_0x2b8c16=(_0x1fa3d7['method']||_0x4051ea(0x1b8))[_0x4051ea(0x1ac)](),_0x2f25b3=_0x1fa3d7[_0x4051ea(0x1d8)],_0x1a0699=_0x1fa3d7['file'],_0x4a4b01=_0x1fa3d7['header'],_0xe59e2d=_0x1fa3d7[_0x4051ea(0x1d5)]||'td';try{const _0x3462e2={};if(_0x4a4b01){const _0x13c1d2=Array[_0x4051ea(0x1eb)](_0x4a4b01)?_0x4a4b01:[_0x4a4b01];for(const _0x385f15 of _0x13c1d2){const [_0x1b9bb,_0x5d819c]=parseHeader(_0x385f15);_0x3462e2[_0x1b9bb]=_0x5d819c;}}let _0x56a5f6;if(_0x2f25b3)_0x56a5f6=_0x2f25b3;else{if(_0x1a0699)try{_0x56a5f6=RawAPI[_0x4051ea(0x1e1)](_0x1a0699);}catch(_0x4de23b){return console[_0x4051ea(0x1b1)]('Error:\x20'+(_0x4de23b instanceof Error?_0x4de23b['message']:String(_0x4de23b))),0x1;}}const _0x1d7bf0={'method':_0x2b8c16,'apiType':_0xe59e2d,'includeHeaders':_0x2be5e5[_0x4051ea(0x1cf)]};_0x56a5f6&&(_0x1d7bf0[_0x4051ea(0x1e6)]=_0x56a5f6);Object[_0x4051ea(0x1dc)](_0x3462e2)[_0x4051ea(0x1c1)]>0x0&&(_0x1d7bf0[_0x4051ea(0x1c8)]=_0x3462e2);if(_0x2be5e5['verbose']){const _0x5e1741=resolveSite(_0x2be5e5[_0x4051ea(0x1cd)]),_0x40f91c=getEndpoint(_0x5e1741,_0xe59e2d),_0x37b7a0=''+_0x40f91c+_0x1192bb;console[_0x4051ea(0x1b1)]('>\x20'+_0x2b8c16+'\x20'+_0x37b7a0);const _0x1845fd=getAuthHeaders(_0x5e1741),_0x496886={..._0x1845fd,..._0x3462e2};for(const [_0x10ab59,_0x4dbbbb]of Object[_0x4051ea(0x1b9)](_0x496886)){!isSensitiveHeader(_0x10ab59)&&console[_0x4051ea(0x1b1)]('>\x20'+_0x10ab59+':\x20'+_0x4dbbbb);}_0x56a5f6&&console['error']('>'),console[_0x4051ea(0x1b1)]('');}const _0x254b83=await _0x4c5d83['api'][_0x4051ea(0x1bf)](_0x1192bb,_0x1d7bf0);if(_0x2be5e5['verbose']&&_0x254b83['headers']){console[_0x4051ea(0x1b1)](_0x4051ea(0x1d3)+_0x254b83[_0x4051ea(0x1b7)]);for(const [_0x3b17a2,_0x7d425e]of Object[_0x4051ea(0x1b9)](_0x254b83['headers'])){!isSensitiveHeader(_0x3b17a2)&&console[_0x4051ea(0x1b1)]('<\x20'+_0x3b17a2+':\x20'+_0x7d425e);}console[_0x4051ea(0x1b1)]('');}const _0x1885d2=Boolean(_0x2be5e5[_0x4051ea(0x1b4)]),_0x3a76f4={'color':_0x2be5e5['color'],'noColor':_0x2be5e5[_0x4051ea(0x1ad)]||_0x1885d2&&!_0x2be5e5['color']},_0x3e3324=colorizeJSON(_0x254b83[_0x4051ea(0x1d8)],_0x3a76f4);return _0x2be5e5['output']?(writeFileSync(_0x2be5e5[_0x4051ea(0x1b4)],_0x3e3324),console['error'](_0x4051ea(0x1ec)+_0x2be5e5[_0x4051ea(0x1b4)])):console[_0x4051ea(0x1de)](_0x3e3324),0x0;}catch(_0x4258cc){return _0x4258cc instanceof Error?(console[_0x4051ea(0x1b1)]('Error:\x20'+_0x4258cc['message']),_0x2be5e5['verbose']&&_0x4258cc['stack']&&console[_0x4051ea(0x1b1)](_0x4051ea(0x1e9)+_0x4258cc['stack'])):console[_0x4051ea(0x1b1)]('Error:\x20'+String(_0x4258cc)),0x1;}}}
1
+ const a6_0x4a89c0=a6_0x52eb;(function(_0x4e51c8,_0x52f881){const _0x56920f=a6_0x52eb,_0x424262=_0x4e51c8();while(!![]){try{const _0x5bddd5=-parseInt(_0x56920f(0x1a3))/0x1*(-parseInt(_0x56920f(0x1a7))/0x2)+-parseInt(_0x56920f(0x195))/0x3+-parseInt(_0x56920f(0x17d))/0x4+parseInt(_0x56920f(0x1a6))/0x5+-parseInt(_0x56920f(0x19f))/0x6*(parseInt(_0x56920f(0x184))/0x7)+parseInt(_0x56920f(0x1b2))/0x8+-parseInt(_0x56920f(0x1aa))/0x9;if(_0x5bddd5===_0x52f881)break;else _0x424262['push'](_0x424262['shift']());}catch(_0x1d0be0){_0x424262['push'](_0x424262['shift']());}}}(a6_0x3564,0xf2f0e));function a6_0x3564(){const _0x57b1da=['proxy-authorization','authorization','join','PATCH','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','cas','cookie','set-cookie','Endpoint\x20must\x20start\x20with\x20/:\x20','llm','execute','PUT','.\x20Valid\x20methods:\x20','message','3365055yELtOw','entries','<\x20HTTP/1.1\x20','type','workflow','x-auth-token','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','keys','substring','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','1410606IUHWXK','log','error','data','358RYUbHZ','toUpperCase','cdp','7042190POgvNM','8194REnLnY','description','file','3587040HFezSm','validate','color','x-trino-user','has','headers','.\x20Valid\x20types:\x20','Invalid\x20HTTP\x20method:\x20','11690480UAoJIj','method','readBodyFromFile','toLowerCase','noColor','Error:\x20','POST','stack','output','verbose','includes','api','name','header','\x0aStack\x20trace:\x0a','6344168CFUgtA','trim','Invalid\x20header\x20format:\x20\x22','site','x-xsrf-token','GET','DELETE','7qxrgfk','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','length'];a6_0x3564=function(){return _0x57b1da;};return a6_0x3564();}import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x4a89c0(0x188),a6_0x4a89c0(0x187),a6_0x4a89c0(0x18d),a6_0x4a89c0(0x18e),'set-cookie2',a6_0x4a89c0(0x181),a6_0x4a89c0(0x19a),a6_0x4a89c0(0x1ad)]);function a6_0x52eb(_0x2fd41b,_0x4c0eba){_0x2fd41b=_0x2fd41b-0x17d;const _0x356459=a6_0x3564();let _0x52ebe3=_0x356459[_0x2fd41b];return _0x52ebe3;}function isSensitiveHeader(_0x24a307){const _0x4ff836=a6_0x4a89c0;return SENSITIVE_HEADERS[_0x4ff836(0x1ae)](_0x24a307[_0x4ff836(0x1b5)]());}function parseHeader(_0x2b89fa){const _0x1fcccc=a6_0x4a89c0,_0x5a9f76=_0x2b89fa['indexOf'](':');if(_0x5a9f76===-0x1)throw new Error(_0x1fcccc(0x17f)+_0x2b89fa+'\x22.\x20'+_0x1fcccc(0x18b));const _0x1d2d4e=_0x2b89fa[_0x1fcccc(0x19d)](0x0,_0x5a9f76)[_0x1fcccc(0x17e)](),_0x40cd74=_0x2b89fa[_0x1fcccc(0x19d)](_0x5a9f76+0x1)[_0x1fcccc(0x17e)]();if(!_0x1d2d4e)throw new Error(_0x1fcccc(0x185)+_0x2b89fa+'\x22');return[_0x1d2d4e,_0x40cd74];}export class ApiCommand extends BaseCommand{[a6_0x4a89c0(0x1be)]=a6_0x4a89c0(0x1bd);[a6_0x4a89c0(0x1a8)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x4a89c0(0x1ab)](_0x466312){const _0x1531de=a6_0x4a89c0,{args:_0x551fd2,options:_0x316cac}=_0x466312,_0x28494e=_0x316cac;if(_0x551fd2[_0x1531de(0x186)]===0x0)return _0x1531de(0x19b);const _0x5e67aa=_0x551fd2[0x0];if(!_0x5e67aa['startsWith']('/'))return _0x1531de(0x18f)+_0x5e67aa;const _0x159a21=_0x28494e[_0x1531de(0x1a2)],_0x28d5e9=_0x28494e[_0x1531de(0x1a9)];if(_0x159a21&&_0x28d5e9)return _0x1531de(0x19e);const _0x508039=_0x28494e[_0x1531de(0x1b3)]||_0x1531de(0x182),_0x1dbf06=[_0x1531de(0x182),_0x1531de(0x1b8),_0x1531de(0x192),_0x1531de(0x183),_0x1531de(0x18a)];if(!_0x1dbf06[_0x1531de(0x1bc)](_0x508039[_0x1531de(0x1a4)]()))return _0x1531de(0x1b1)+_0x508039+_0x1531de(0x193)+_0x1dbf06['join'](',\x20');const _0x13925e=_0x28494e[_0x1531de(0x198)]||'td',_0x435c72=['td',_0x1531de(0x1a5),_0x1531de(0x199),'trino',_0x1531de(0x190),'llm-proxy',_0x1531de(0x18c)];if(!_0x435c72[_0x1531de(0x1bc)](_0x13925e))return'Invalid\x20API\x20type:\x20'+_0x13925e+_0x1531de(0x1b0)+_0x435c72[_0x1531de(0x189)](',\x20');return undefined;}async[a6_0x4a89c0(0x191)](_0x2406a9){const _0x50c10a=a6_0x4a89c0,{options:_0x53fd1e,args:_0x10aab6,tdx:_0x1b4bef}=_0x2406a9,_0x2b1b6f=_0x53fd1e,_0x3c1e54=_0x10aab6[0x0],_0x4444de=(_0x2b1b6f[_0x50c10a(0x1b3)]||_0x50c10a(0x182))[_0x50c10a(0x1a4)](),_0x37924a=_0x2b1b6f[_0x50c10a(0x1a2)],_0x24f708=_0x2b1b6f[_0x50c10a(0x1a9)],_0xe64822=_0x2b1b6f[_0x50c10a(0x1bf)],_0x1ccd01=_0x2b1b6f['type']||'td';try{const _0x5ab60e={};if(_0xe64822){const _0x5f2edc=Array['isArray'](_0xe64822)?_0xe64822:[_0xe64822];for(const _0x358bd0 of _0x5f2edc){const [_0x247fcc,_0x37de39]=parseHeader(_0x358bd0);_0x5ab60e[_0x247fcc]=_0x37de39;}}let _0x467d4d;if(_0x37924a)_0x467d4d=_0x37924a;else{if(_0x24f708)try{_0x467d4d=RawAPI[_0x50c10a(0x1b4)](_0x24f708);}catch(_0x1cb179){return console[_0x50c10a(0x1a1)](_0x50c10a(0x1b7)+(_0x1cb179 instanceof Error?_0x1cb179[_0x50c10a(0x194)]:String(_0x1cb179))),0x1;}}const _0x24f4d1={'method':_0x4444de,'apiType':_0x1ccd01,'includeHeaders':_0x53fd1e['verbose']};_0x467d4d&&(_0x24f4d1['body']=_0x467d4d);Object[_0x50c10a(0x19c)](_0x5ab60e)[_0x50c10a(0x186)]>0x0&&(_0x24f4d1[_0x50c10a(0x1af)]=_0x5ab60e);if(_0x53fd1e[_0x50c10a(0x1bb)]){const _0xd62cdb=resolveSite(_0x53fd1e[_0x50c10a(0x180)]),_0x30d725=getEndpoint(_0xd62cdb,_0x1ccd01),_0x157c31=''+_0x30d725+_0x3c1e54;console[_0x50c10a(0x1a1)]('>\x20'+_0x4444de+'\x20'+_0x157c31);const _0x329254=getAuthHeaders(_0xd62cdb),_0x8a5880={..._0x329254,..._0x5ab60e};for(const [_0x1ad098,_0x38feed]of Object[_0x50c10a(0x196)](_0x8a5880)){!isSensitiveHeader(_0x1ad098)&&console[_0x50c10a(0x1a1)]('>\x20'+_0x1ad098+':\x20'+_0x38feed);}_0x467d4d&&console[_0x50c10a(0x1a1)]('>'),console[_0x50c10a(0x1a1)]('');}const _0x40ba7d=await _0x1b4bef[_0x50c10a(0x1bd)]['request'](_0x3c1e54,_0x24f4d1);if(_0x53fd1e[_0x50c10a(0x1bb)]&&_0x40ba7d[_0x50c10a(0x1af)]){console[_0x50c10a(0x1a1)](_0x50c10a(0x197)+_0x40ba7d['status']);for(const [_0x1e1ab3,_0x4e501f]of Object[_0x50c10a(0x196)](_0x40ba7d[_0x50c10a(0x1af)])){!isSensitiveHeader(_0x1e1ab3)&&console[_0x50c10a(0x1a1)]('<\x20'+_0x1e1ab3+':\x20'+_0x4e501f);}console[_0x50c10a(0x1a1)]('');}const _0x4f5bc9=Boolean(_0x53fd1e['output']),_0x1f2245={'color':_0x53fd1e['color'],'noColor':_0x53fd1e[_0x50c10a(0x1b6)]||_0x4f5bc9&&!_0x53fd1e[_0x50c10a(0x1ac)]},_0x11a62a=colorizeJSON(_0x40ba7d[_0x50c10a(0x1a2)],_0x1f2245);return _0x53fd1e['output']?(writeFileSync(_0x53fd1e[_0x50c10a(0x1ba)],_0x11a62a),console[_0x50c10a(0x1a1)]('Results\x20saved\x20to\x20'+_0x53fd1e[_0x50c10a(0x1ba)])):console[_0x50c10a(0x1a0)](_0x11a62a),0x0;}catch(_0x1721cb){return _0x1721cb instanceof Error?(console['error']('Error:\x20'+_0x1721cb[_0x50c10a(0x194)]),_0x53fd1e[_0x50c10a(0x1bb)]&&_0x1721cb[_0x50c10a(0x1b9)]&&console[_0x50c10a(0x1a1)](_0x50c10a(0x1c0)+_0x1721cb[_0x50c10a(0x1b9)])):console[_0x50c10a(0x1a1)](_0x50c10a(0x1b7)+String(_0x1721cb)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x4e9ffb=a7_0x5cc8;(function(_0x5a3db8,_0x53c917){const _0x307b53=a7_0x5cc8,_0x3ebae8=_0x5a3db8();while(!![]){try{const _0x387ee4=parseInt(_0x307b53(0x153))/0x1+-parseInt(_0x307b53(0x144))/0x2+-parseInt(_0x307b53(0x12f))/0x3+-parseInt(_0x307b53(0x134))/0x4*(-parseInt(_0x307b53(0x11e))/0x5)+-parseInt(_0x307b53(0x11b))/0x6+-parseInt(_0x307b53(0x12a))/0x7*(parseInt(_0x307b53(0x151))/0x8)+-parseInt(_0x307b53(0x125))/0x9*(-parseInt(_0x307b53(0x141))/0xa);if(_0x387ee4===_0x53c917)break;else _0x3ebae8['push'](_0x3ebae8['shift']());}catch(_0x566665){_0x3ebae8['push'](_0x3ebae8['shift']());}}}(a7_0xf15a,0xf2bec));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a7_0x5cc8(_0x3a6ea9,_0x485a2f){_0x3a6ea9=_0x3a6ea9-0x10b;const _0xf15a18=a7_0xf15a();let _0x5cc88e=_0xf15a18[_0x3a6ea9];return _0x5cc88e;}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x4232ab 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_0x53de96 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x4e9ffb(0x119)]=a7_0x4e9ffb(0x127);[a7_0x4e9ffb(0x11c)]=a7_0x4e9ffb(0x148);async['execute'](_0x57b09e){const _0x4a8cf1=a7_0x4e9ffb,{options:_0x52b467}=_0x57b09e,_0x319ffc=_0x52b467[_0x4a8cf1(0x137)];console[_0x4a8cf1(0x10e)](a7_0x53de96['bold'](_0x4a8cf1(0x120)));const _0x275a14=_0x52b467[_0x4a8cf1(0x154)]||'us01',_0x39996a=await promptSiteSelection(_0x275a14,_0x319ffc,'Setup\x20cancelled');if(!_0x39996a)return 0x1;const _0x259579=resolveSite(_0x39996a);if(isOAuthSupported(_0x259579)){const _0x55838c=await a7_0x4232ab({'type':_0x4a8cf1(0x138),'name':_0x4a8cf1(0x124),'message':'Choose\x20authentication\x20method:','choices':[{'title':_0x4a8cf1(0x131),'value':_0x4a8cf1(0x115)},{'title':_0x4a8cf1(0x156),'value':_0x4a8cf1(0x112)}]});if(!_0x55838c['method'])return console[_0x4a8cf1(0x10e)](_0x4a8cf1(0x12c)),0x1;if(_0x55838c[_0x4a8cf1(0x124)]==='oauth')return await runOAuthLoginFlow(_0x259579,_0x319ffc,_0x52b467[_0x4a8cf1(0x143)]??LogLevel[_0x4a8cf1(0x133)]),0x0;}console[_0x4a8cf1(0x10e)](_0x4a8cf1(0x12d)+_0x259579),console[_0x4a8cf1(0x10e)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console['log']('\x20\x20'+getConsoleUrl(_0x259579,_0x4a8cf1(0x136)));const _0x554fc5=await a7_0x4232ab({'type':_0x4a8cf1(0x114),'name':_0x4a8cf1(0x12b),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x46b1a2=>{const _0x106abf=_0x4a8cf1;if(!_0x46b1a2||!_0x46b1a2[_0x106abf(0x10c)]())return _0x106abf(0x146);return!![];}});if(!_0x554fc5[_0x4a8cf1(0x12b)])return console[_0x4a8cf1(0x10e)](_0x4a8cf1(0x12c)),0x1;const _0x43be0b=_0x554fc5[_0x4a8cf1(0x12b)];console[_0x4a8cf1(0x10e)](_0x4a8cf1(0x142));try{const _0x43f2a9=TDX[_0x4a8cf1(0x116)]({'site':_0x259579,'apiKey':_0x43be0b[_0x4a8cf1(0x10c)](),'logLevel':_0x52b467[_0x4a8cf1(0x143)]??LogLevel[_0x4a8cf1(0x133)]}),_0x440a34=await _0x43f2a9['jobs'][_0x4a8cf1(0x145)]();console[_0x4a8cf1(0x10e)](_0x4a8cf1(0x129)+_0x440a34['email']+')');const _0x4fc848=await isKeychainAvailable();_0x4fc848?(await saveAPIKeyAsync(_0x43be0b['trim'](),_0x259579,_0x319ffc),console[_0x4a8cf1(0x10e)](_0x4a8cf1(0x10b)+(_0x319ffc?_0x4a8cf1(0x147)+_0x319ffc+')':''))):(console[_0x4a8cf1(0x126)](a7_0x53de96[_0x4a8cf1(0x111)](_0x4a8cf1(0x13b))),console[_0x4a8cf1(0x126)](a7_0x53de96['yellow']('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x319ffc){const _0x1aa422={'site':_0x259579};saveProfileToUserConfig(_0x319ffc,_0x1aa422),console[_0x4a8cf1(0x10e)]('✓\x20Profile\x20\x27'+_0x319ffc+_0x4a8cf1(0x121));}else saveDefaultSiteToUserConfig(_0x259579),console[_0x4a8cf1(0x10e)](_0x4a8cf1(0x10d)+_0x259579);const _0xb992f=_0x319ffc?_0x4a8cf1(0x14f)+_0x319ffc:'';return console['log'](),console[_0x4a8cf1(0x10e)](_0x4a8cf1(0x110)),console['log'](_0x4a8cf1(0x150)+_0xb992f+_0x4a8cf1(0x14b)),console[_0x4a8cf1(0x10e)](_0x4a8cf1(0x150)+_0xb992f+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x517287){if(_0x517287 instanceof HTTPClientError&&_0x517287[_0x4a8cf1(0x14c)]===0x191)return printAuthError(_0x517287),0x1;return console[_0x4a8cf1(0x158)](a7_0x53de96[_0x4a8cf1(0x122)](_0x4a8cf1(0x140)+(_0x517287 instanceof Error?_0x517287[_0x4a8cf1(0x117)]:String(_0x517287)))),console[_0x4a8cf1(0x158)](_0x4a8cf1(0x12e)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x4e9ffb(0x11a);['description']=a7_0x4e9ffb(0x159);async['execute'](_0x5ac0b2){const _0x23d59d=a7_0x4e9ffb,{options:_0x29aea8,tdx:_0x20abe0}=_0x5ac0b2,_0x2e4b73=_0x29aea8[_0x23d59d(0x154)],_0x11dc13=_0x29aea8[_0x23d59d(0x137)],_0x3945d2=_0x11dc13?_0x11dc13:_0x23d59d(0x14a);console[_0x23d59d(0x10e)](_0x23d59d(0x11d)+_0x3945d2+_0x23d59d(0x135)+_0x2e4b73+')');const _0x5acbdd=await getOAuthTokens(_0x11dc13);if(_0x5acbdd)console[_0x23d59d(0x10e)]('Credential\x20type:\x20OAuth'),console[_0x23d59d(0x10e)]('Read\x20credential\x20from\x20keychain'+(_0x11dc13?_0x23d59d(0x147)+_0x11dc13+')':''));else{const _0x2a872a=await resolveAPIKeyAsync(_0x2e4b73,_0x11dc13);if(_0x2a872a){const {source:_0x2ed289,isDeprecated:_0xca7415}=_0x2a872a,_0x27a901='Read\x20credential\x20from\x20'+_0x2ed289;console[_0x23d59d(0x10e)](_0xca7415?a7_0x53de96[_0x23d59d(0x111)](_0x27a901):_0x27a901);}else console[_0x23d59d(0x10e)](a7_0x53de96[_0x23d59d(0x111)](_0x23d59d(0x14d)));}try{const _0x5ceafc=await _0x20abe0[_0x23d59d(0x128)][_0x23d59d(0x145)]();return console[_0x23d59d(0x10e)](a7_0x53de96[_0x23d59d(0x139)](_0x23d59d(0x123))),console[_0x23d59d(0x10e)](_0x23d59d(0x157)+_0x5ceafc[_0x23d59d(0x130)]),(_0x5ceafc[_0x23d59d(0x11f)]||_0x5ceafc['last_name'])&&console[_0x23d59d(0x10e)](_0x23d59d(0x113)+[_0x5ceafc['first_name'],_0x5ceafc[_0x23d59d(0x13f)]][_0x23d59d(0x13c)](Boolean)[_0x23d59d(0x132)]('\x20')),0x0;}catch(_0x50afa4){return _0x50afa4 instanceof HTTPClientError&&_0x50afa4[_0x23d59d(0x14c)]===0x191?printAuthError(_0x50afa4,!![],_0x11dc13):console[_0x23d59d(0x158)](a7_0x53de96[_0x23d59d(0x122)]('✗\x20Validation\x20failed:\x20'+(_0x50afa4 instanceof Error?_0x50afa4[_0x23d59d(0x117)]:String(_0x50afa4)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x4e9ffb(0x119)]=a7_0x4e9ffb(0x155);[a7_0x4e9ffb(0x11c)]=a7_0x4e9ffb(0x14e);async[a7_0x4e9ffb(0x10f)](_0x216583){const _0xb0d5ae=a7_0x4e9ffb,{options:_0x310248}=_0x216583,_0x3adff6=_0x310248['profile'];console[_0xb0d5ae(0x10e)](a7_0x53de96['bold']('tdx:\x20auth\x20clear'));const _0x424d37=await isKeychainAvailable();if(!_0x424d37)return console[_0xb0d5ae(0x158)](a7_0x53de96[_0xb0d5ae(0x122)](_0xb0d5ae(0x13a))),0x1;const [_0x17f548,_0x4aad1e]=await Promise[_0xb0d5ae(0x149)]([deleteKeychainAPIKey(_0x3adff6),deleteOAuthTokens(_0x3adff6)]);if(_0x17f548||_0x4aad1e){clearCredentialCache();const _0x30105c=[_0x17f548&&_0xb0d5ae(0x13e),_0x4aad1e&&'OAuth\x20tokens']['filter'](Boolean)['join'](_0xb0d5ae(0x118));return console[_0xb0d5ae(0x10e)]('✓\x20'+_0x30105c+_0xb0d5ae(0x13d)+(_0x3adff6?_0xb0d5ae(0x147)+_0x3adff6+')':'')),0x0;}else return console[_0xb0d5ae(0x10e)]('No\x20credentials\x20found\x20in\x20keychain'+(_0x3adff6?_0xb0d5ae(0x152)+_0x3adff6:'')),0x1;}}function a7_0xf15a(){const _0x43e034=['✗\x20Validation\x20failed:\x20','2860710sZBrel','Validating\x20API\x20key...','logLevel','1988758vltlmY','getUserInfo','API\x20key\x20cannot\x20be\x20empty','\x20(profile:\x20','Setup\x20API\x20key\x20authentication\x20interactively','all','N/A','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','status','No\x20credential\x20found','Remove\x20API\x20key\x20from\x20system\x20keychain','\x20--profile\x20','\x20\x20tdx','1192656OWPsEn','\x20for\x20profile:\x20','153647zXionj','site','auth:clear','API\x20Key','User:\x20','error','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','trim','✓\x20Default\x20site\x20set\x20to\x20','log','execute','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','yellow','apikey','Name:\x20','password','oauth','create','message','\x20and\x20','name','auth','1056966nvKdpM','description','tdx\x20profile:\x20','85IyWqZY','first_name','tdx:\x20auth\x20setup','\x27\x20registered','red','✓\x20Authentication\x20successful\x0a','method','81QhoJKC','warn','auth:setup','jobs','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','63srccXb','apiKey','\x0aSetup\x20cancelled','Setting\x20up\x20authentication\x20for\x20site:\x20','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','3049803GUAYJi','email','OAuth\x20(browser\x20login)','join','ERROR','422324zpLZry','\x20(site:\x20','/app/mp/ak','profile','select','green','System\x20keychain\x20is\x20not\x20available','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','filter','\x20removed\x20from\x20keychain','API\x20key','last_name'];a7_0xf15a=function(){return _0x43e034;};return a7_0xf15a();}
1
+ const a7_0x525eee=a7_0x5542;(function(_0x14cc3c,_0x2b906c){const _0x37568e=a7_0x5542,_0x5e365b=_0x14cc3c();while(!![]){try{const _0x2d3cdd=-parseInt(_0x37568e(0x1bf))/0x1*(parseInt(_0x37568e(0x1ee))/0x2)+-parseInt(_0x37568e(0x1ec))/0x3+parseInt(_0x37568e(0x1e8))/0x4+-parseInt(_0x37568e(0x1ef))/0x5+parseInt(_0x37568e(0x1eb))/0x6+-parseInt(_0x37568e(0x202))/0x7+parseInt(_0x37568e(0x1fc))/0x8;if(_0x2d3cdd===_0x2b906c)break;else _0x5e365b['push'](_0x5e365b['shift']());}catch(_0x42a515){_0x5e365b['push'](_0x5e365b['shift']());}}}(a7_0x3e32,0x5be05));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{isOAuthSupported}from'../core/oauth.js';function a7_0x3e32(){const _0x24ff24=['\x20removed\x20from\x20keychain','Validating\x20API\x20key...','N/A','filter','profile','\x20\x20tdx','1Tglotf','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','✓\x20Default\x20site\x20set\x20to\x20','description','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','API\x20key\x20cannot\x20be\x20empty','Choose\x20authentication\x20method:','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','all','No\x20credentials\x20found\x20in\x20keychain','apiKey','User:\x20','site','\x20(site:\x20','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','API\x20key','execute','last_name','yellow','Read\x20credential\x20from\x20keychain','oauth','first_name','method','✗\x20Validation\x20failed:\x20','\x0aSetup\x20cancelled','auth:setup','status','API\x20Key','\x20--profile\x20','log','Read\x20credential\x20from\x20','Remove\x20API\x20key\x20from\x20system\x20keychain','green','message','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','logLevel','Name:\x20','getUserInfo','select','name','auth:clear','1917184AELoEK','tdx:\x20auth\x20clear','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','3014796szVoPq','446361xaLCaM','auth','37286ObXzEF','3476675EQFVEa','red','✓\x20Profile\x20\x27','warn','trim','ERROR','password','error','tdx:\x20auth\x20setup','bold','\x20(profile:\x20','OAuth\x20(browser\x20login)','/app/mp/ak','2905248cZsNVO','create','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','apikey','Setting\x20up\x20authentication\x20for\x20site:\x20','tdx\x20profile:\x20','740796gKWZig','email','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','You\x20can\x20find\x20your\x20API\x20key\x20at:'];a7_0x3e32=function(){return _0x24ff24;};return a7_0x3e32();}import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x39dcd3 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_0x297832 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x525eee(0x1e6)]=a7_0x525eee(0x1d8);['description']='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x525eee(0x1cf)](_0xc74aac){const _0x42714d=a7_0x525eee,{options:_0x228fb}=_0xc74aac,_0xa7a35f=_0x228fb[_0x42714d(0x20a)];console['log'](a7_0x297832[_0x42714d(0x1f8)](_0x42714d(0x1f7)));const _0x392923=_0x228fb[_0x42714d(0x1cb)]||'us01',_0x44c42d=await promptSiteSelection(_0x392923,_0xa7a35f,'Setup\x20cancelled');if(!_0x44c42d)return 0x1;const _0x15a4d9=resolveSite(_0x44c42d);if(isOAuthSupported(_0x15a4d9)){const _0x2d55ba=await a7_0x39dcd3({'type':_0x42714d(0x1e5),'name':_0x42714d(0x1d5),'message':_0x42714d(0x1c5),'choices':[{'title':_0x42714d(0x1fa),'value':_0x42714d(0x1d3)},{'title':_0x42714d(0x1da),'value':_0x42714d(0x1ff)}]});if(!_0x2d55ba[_0x42714d(0x1d5)])return console[_0x42714d(0x1dc)](_0x42714d(0x1d7)),0x1;if(_0x2d55ba[_0x42714d(0x1d5)]===_0x42714d(0x1d3))return await runOAuthLoginFlow(_0x15a4d9,_0xa7a35f,_0x228fb[_0x42714d(0x1e2)]??LogLevel[_0x42714d(0x1f4)]),0x0;}console['log'](_0x42714d(0x200)+_0x15a4d9),console[_0x42714d(0x1dc)](_0x42714d(0x205)),console[_0x42714d(0x1dc)]('\x20\x20'+getConsoleUrl(_0x15a4d9,_0x42714d(0x1fb)));const _0x24d758=await a7_0x39dcd3({'type':_0x42714d(0x1f5),'name':_0x42714d(0x1c9),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0xb244cd=>{const _0x493970=_0x42714d;if(!_0xb244cd||!_0xb244cd[_0x493970(0x1f3)]())return _0x493970(0x1c4);return!![];}});if(!_0x24d758[_0x42714d(0x1c9)])return console[_0x42714d(0x1dc)](_0x42714d(0x1d7)),0x1;const _0x13a3b4=_0x24d758[_0x42714d(0x1c9)];console[_0x42714d(0x1dc)](_0x42714d(0x207));try{const _0x1f5d34=TDX[_0x42714d(0x1fd)]({'site':_0x15a4d9,'apiKey':_0x13a3b4[_0x42714d(0x1f3)](),'logLevel':_0x228fb[_0x42714d(0x1e2)]??LogLevel[_0x42714d(0x1f4)]}),_0x22d631=await _0x1f5d34['jobs'][_0x42714d(0x1e4)]();console[_0x42714d(0x1dc)](_0x42714d(0x1c6)+_0x22d631[_0x42714d(0x203)]+')');const _0x483c64=await isKeychainAvailable();_0x483c64?(await saveAPIKeyAsync(_0x13a3b4[_0x42714d(0x1f3)](),_0x15a4d9,_0xa7a35f),console[_0x42714d(0x1dc)](_0x42714d(0x1e1)+(_0xa7a35f?'\x20(profile:\x20'+_0xa7a35f+')':''))):(console[_0x42714d(0x1f2)](a7_0x297832[_0x42714d(0x1d1)](_0x42714d(0x1fe))),console['warn'](a7_0x297832[_0x42714d(0x1d1)](_0x42714d(0x1cd))));if(_0xa7a35f){const _0xc89262={'site':_0x15a4d9};saveProfileToUserConfig(_0xa7a35f,_0xc89262),console[_0x42714d(0x1dc)](_0x42714d(0x1f1)+_0xa7a35f+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x15a4d9),console[_0x42714d(0x1dc)](_0x42714d(0x1c1)+_0x15a4d9);const _0x5ea12=_0xa7a35f?_0x42714d(0x1db)+_0xa7a35f:'';return console['log'](),console[_0x42714d(0x1dc)](_0x42714d(0x204)),console[_0x42714d(0x1dc)](_0x42714d(0x1be)+_0x5ea12+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x42714d(0x1dc)](_0x42714d(0x1be)+_0x5ea12+_0x42714d(0x1ea)),0x0;}catch(_0x1f165a){if(_0x1f165a instanceof HTTPClientError&&_0x1f165a[_0x42714d(0x1d9)]===0x191)return printAuthError(_0x1f165a),0x1;return console[_0x42714d(0x1f6)](a7_0x297832[_0x42714d(0x1f0)](_0x42714d(0x1d6)+(_0x1f165a instanceof Error?_0x1f165a[_0x42714d(0x1e0)]:String(_0x1f165a)))),console[_0x42714d(0x1f6)](_0x42714d(0x1c3)),0x1;}}}function a7_0x5542(_0x54e35d,_0x39ba61){_0x54e35d=_0x54e35d-0x1be;const _0x3e3205=a7_0x3e32();let _0x554262=_0x3e3205[_0x54e35d];return _0x554262;}export class AuthStatusCommand extends BaseCommand{[a7_0x525eee(0x1e6)]=a7_0x525eee(0x1ed);[a7_0x525eee(0x1c2)]=a7_0x525eee(0x1c0);async[a7_0x525eee(0x1cf)](_0x124060){const _0x54ae9b=a7_0x525eee,{options:_0x4f9d2e,tdx:_0x46f95e}=_0x124060,_0x4aaf7d=_0x4f9d2e[_0x54ae9b(0x1cb)],_0x2a390b=_0x4f9d2e[_0x54ae9b(0x20a)],_0x3fbfae=_0x2a390b?_0x2a390b:_0x54ae9b(0x208);console[_0x54ae9b(0x1dc)](_0x54ae9b(0x201)+_0x3fbfae+_0x54ae9b(0x1cc)+_0x4aaf7d+')');const _0x1060d=await getOAuthTokens(_0x2a390b);if(_0x1060d)console[_0x54ae9b(0x1dc)]('Credential\x20type:\x20OAuth'),console[_0x54ae9b(0x1dc)](_0x54ae9b(0x1d2)+(_0x2a390b?_0x54ae9b(0x1f9)+_0x2a390b+')':''));else{const _0x30c3f5=await resolveAPIKeyAsync(_0x4aaf7d,_0x2a390b);if(_0x30c3f5){const {source:_0x3bc651,isDeprecated:_0x26eca2}=_0x30c3f5,_0x248197=_0x54ae9b(0x1dd)+_0x3bc651;console[_0x54ae9b(0x1dc)](_0x26eca2?a7_0x297832[_0x54ae9b(0x1d1)](_0x248197):_0x248197);}else console[_0x54ae9b(0x1dc)](a7_0x297832[_0x54ae9b(0x1d1)]('No\x20credential\x20found'));}try{const _0x730d28=await _0x46f95e['jobs']['getUserInfo']();return console[_0x54ae9b(0x1dc)](a7_0x297832[_0x54ae9b(0x1df)]('✓\x20Authentication\x20successful\x0a')),console[_0x54ae9b(0x1dc)](_0x54ae9b(0x1ca)+_0x730d28[_0x54ae9b(0x203)]),(_0x730d28[_0x54ae9b(0x1d4)]||_0x730d28[_0x54ae9b(0x1d0)])&&console[_0x54ae9b(0x1dc)](_0x54ae9b(0x1e3)+[_0x730d28[_0x54ae9b(0x1d4)],_0x730d28[_0x54ae9b(0x1d0)]]['filter'](Boolean)['join']('\x20')),0x0;}catch(_0x2609bb){return _0x2609bb instanceof HTTPClientError&&_0x2609bb[_0x54ae9b(0x1d9)]===0x191?printAuthError(_0x2609bb,!![],_0x2a390b):console[_0x54ae9b(0x1f6)](a7_0x297832[_0x54ae9b(0x1f0)](_0x54ae9b(0x1d6)+(_0x2609bb instanceof Error?_0x2609bb[_0x54ae9b(0x1e0)]:String(_0x2609bb)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x525eee(0x1e6)]=a7_0x525eee(0x1e7);[a7_0x525eee(0x1c2)]=a7_0x525eee(0x1de);async[a7_0x525eee(0x1cf)](_0x37459b){const _0x46af68=a7_0x525eee,{options:_0xee8a8a}=_0x37459b,_0x5a19a6=_0xee8a8a[_0x46af68(0x20a)];console['log'](a7_0x297832[_0x46af68(0x1f8)](_0x46af68(0x1e9)));const _0x9906af=await isKeychainAvailable();if(!_0x9906af)return console[_0x46af68(0x1f6)](a7_0x297832[_0x46af68(0x1f0)]('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x338974,_0x3249b6]=await Promise[_0x46af68(0x1c7)]([deleteKeychainAPIKey(_0x5a19a6),deleteOAuthTokens(_0x5a19a6)]);if(_0x338974||_0x3249b6){clearCredentialCache();const _0x4234ce=[_0x338974&&_0x46af68(0x1ce),_0x3249b6&&'OAuth\x20tokens'][_0x46af68(0x209)](Boolean)['join']('\x20and\x20');return console[_0x46af68(0x1dc)]('✓\x20'+_0x4234ce+_0x46af68(0x206)+(_0x5a19a6?_0x46af68(0x1f9)+_0x5a19a6+')':'')),0x0;}else return console[_0x46af68(0x1dc)](_0x46af68(0x1c8)+(_0x5a19a6?'\x20for\x20profile:\x20'+_0x5a19a6:'')),0x1;}}
@@ -1 +1 @@
1
- const a8_0x56d19c=a8_0x246d;(function(_0x1d9584,_0x1448a4){const _0x3b5b8a=a8_0x246d,_0x1f1c33=_0x1d9584();while(!![]){try{const _0x3a4c1e=parseInt(_0x3b5b8a(0x1f6))/0x1*(parseInt(_0x3b5b8a(0x1fc))/0x2)+parseInt(_0x3b5b8a(0x1f5))/0x3*(-parseInt(_0x3b5b8a(0x21a))/0x4)+parseInt(_0x3b5b8a(0x208))/0x5*(-parseInt(_0x3b5b8a(0x217))/0x6)+-parseInt(_0x3b5b8a(0x1ff))/0x7+-parseInt(_0x3b5b8a(0x212))/0x8+parseInt(_0x3b5b8a(0x209))/0x9+parseInt(_0x3b5b8a(0x20f))/0xa*(parseInt(_0x3b5b8a(0x219))/0xb);if(_0x3a4c1e===_0x1448a4)break;else _0x1f1c33['push'](_0x1f1c33['shift']());}catch(_0x2d414c){_0x1f1c33['push'](_0x1f1c33['shift']());}}}(a8_0x5616,0x55754));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';function a8_0x5616(){const _0x4b6a0d=['logLevel','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','green','Login\x20via\x20OAuth\x20(opens\x20browser)','execute','10MOETNC','1470915hVbIMG','✓\x20Profile\x20\x27','auth:login','✓\x20Authentication\x20successful\x20(User:\x20','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','site','10607880dWGlGT','tdx:\x20auth\x20login','\x27\x20registered','1533368GlOumS','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','us01','access_token','\x20\x20tdx','2016348oauuSE','log','11ROCPoB','8852FjRjFD','email','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','258IbiDDe','16mKRnQs','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','\x20(profile:\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','create','description','72626uRzMPn','\x20--profile\x20','/oauth/authorize','2807630JdkmCN','Opening\x20browser\x20for\x20authentication...','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','ERROR'];a8_0x5616=function(){return _0x4b6a0d;};return a8_0x5616();}import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{isKeychainAvailable}from'../core/keychain.js';import{saveOAuthTokens}from'../core/oauth-keychain.js';import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import{TDX}from'../sdk/index.js';function a8_0x246d(_0xea2b4d,_0x3edda7){_0xea2b4d=_0xea2b4d-0x1f2;const _0x5616fd=a8_0x5616();let _0x246d72=_0x5616fd[_0xea2b4d];return _0x246d72;}import{LogLevel}from'../utils/tdx-logger.js';import a8_0x3bef8d from'chalk';export async function runOAuthLoginFlow(_0x52fdad,_0x412a97,_0x2e32ae){const _0x12bf87=a8_0x246d;if(!isOAuthSupported(_0x52fdad))throw new Error(_0x12bf87(0x213)+_0x52fdad+'.\x20'+'OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20'+_0x12bf87(0x204));const _0x29474e=await isKeychainAvailable();if(!_0x29474e)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+_0x12bf87(0x204));const _0x7fdee9=getConsoleUrl(_0x52fdad);console[_0x12bf87(0x218)](_0x12bf87(0x200)),console[_0x12bf87(0x218)]('\x20\x20'+_0x7fdee9+_0x12bf87(0x1fe)),console[_0x12bf87(0x218)](_0x12bf87(0x1f7));const _0x368948=await startOAuthFlow(_0x52fdad);console[_0x12bf87(0x218)]('Validating\x20OAuth\x20tokens...');const _0xb4009e=TDX[_0x12bf87(0x1fa)]({'site':_0x52fdad,'accessToken':_0x368948[_0x12bf87(0x215)],'logLevel':_0x2e32ae??LogLevel[_0x12bf87(0x202)]}),_0x4e4300=await _0xb4009e['jobs']['getUserInfo']();console[_0x12bf87(0x218)](a8_0x3bef8d[_0x12bf87(0x205)](_0x12bf87(0x20c)+_0x4e4300[_0x12bf87(0x1f2)]+')')),await saveOAuthTokens(_0x368948,_0x412a97),console['log'](_0x12bf87(0x20d)+(_0x412a97?_0x12bf87(0x1f8)+_0x412a97+')':''));if(_0x412a97){const _0x35fd5b={'site':_0x52fdad};saveProfileToUserConfig(_0x412a97,_0x35fd5b),console[_0x12bf87(0x218)](_0x12bf87(0x20a)+_0x412a97+_0x12bf87(0x211));}const _0x1142ee=_0x412a97?_0x12bf87(0x1fd)+_0x412a97:'';console[_0x12bf87(0x218)](),console['log'](_0x12bf87(0x201)),console['log']('\x20\x20tdx'+_0x1142ee+_0x12bf87(0x1f9)),console[_0x12bf87(0x218)](_0x12bf87(0x216)+_0x1142ee+_0x12bf87(0x1f4));}export class AuthLoginCommand extends BaseCommand{['name']=a8_0x56d19c(0x20b);[a8_0x56d19c(0x1fb)]=a8_0x56d19c(0x206);async[a8_0x56d19c(0x207)](_0x57137a){const _0x17bec5=a8_0x56d19c,{options:_0x357f37}=_0x57137a,_0x4ed82f=_0x357f37['profile'];console[_0x17bec5(0x218)](a8_0x3bef8d['bold'](_0x17bec5(0x210)));const _0x41567d=_0x357f37[_0x17bec5(0x20e)]||_0x17bec5(0x214),_0x2bc543=await promptSiteSelection(_0x41567d,_0x4ed82f,'Login\x20cancelled');if(!_0x2bc543)return 0x1;const _0x577bea=resolveSite(_0x2bc543);return console[_0x17bec5(0x218)](_0x17bec5(0x1f3)+_0x577bea),await runOAuthLoginFlow(_0x577bea,_0x4ed82f,_0x357f37[_0x17bec5(0x203)]??LogLevel['ERROR']),0x0;}}
1
+ const a8_0x53ff35=a8_0x3978;(function(_0x965bd1,_0x4644c5){const _0x262d90=a8_0x3978,_0x2d76d3=_0x965bd1();while(!![]){try{const _0x4eb1c6=parseInt(_0x262d90(0x18d))/0x1*(parseInt(_0x262d90(0x172))/0x2)+-parseInt(_0x262d90(0x181))/0x3+parseInt(_0x262d90(0x18b))/0x4+parseInt(_0x262d90(0x187))/0x5+parseInt(_0x262d90(0x16f))/0x6*(-parseInt(_0x262d90(0x17b))/0x7)+parseInt(_0x262d90(0x16d))/0x8*(-parseInt(_0x262d90(0x186))/0x9)+-parseInt(_0x262d90(0x182))/0xa*(-parseInt(_0x262d90(0x174))/0xb);if(_0x4eb1c6===_0x4644c5)break;else _0x2d76d3['push'](_0x2d76d3['shift']());}catch(_0x5d04ff){_0x2d76d3['push'](_0x2d76d3['shift']());}}}(a8_0x341a,0xa9631));import{BaseCommand}from'./command.js';function a8_0x3978(_0x439b83,_0x2202d7){_0x439b83=_0x439b83-0x168;const _0x341a73=a8_0x341a();let _0x39782f=_0x341a73[_0x439b83];return _0x39782f;}import{resolveSite}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a8_0x341a(){const _0x5b0858=['Authenticating\x20via\x20OAuth\x20for\x20site:\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','\x27\x20registered','logLevel','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','bold','getUserInfo','961936PxXzwo','execute','96IDDoFR','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','auth:login','71650AwvzAi','us01','1694OBVzcU','✓\x20Profile\x20\x27','profile','description','ERROR','Opening\x20browser\x20for\x20authentication...','✓\x20Authentication\x20successful\x20(User:\x20','44695kOEirY','\x20\x20tdx','jobs','access_token','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','create','2384769OIrDxv','3730gWrdzl','\x20(profile:\x20','Validating\x20OAuth\x20tokens...','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','18LnPcTM','847175Evnyvh','log','\x20--profile\x20','site','1545796kHOkWV','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','34JXTpYs','tdx:\x20auth\x20login','/oauth/authorize'];a8_0x341a=function(){return _0x5b0858;};return a8_0x341a();}import{isKeychainAvailable}from'../core/keychain.js';import{saveOAuthTokens}from'../core/oauth-keychain.js';import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x79c138 from'chalk';export async function runOAuthLoginFlow(_0x2171a5,_0x5885b2,_0x13fb98){const _0x3822b9=a8_0x3978;if(!isOAuthSupported(_0x2171a5))throw new Error(_0x3822b9(0x192)+_0x2171a5+'.\x20'+_0x3822b9(0x18c)+_0x3822b9(0x185));const _0x25efaf=await isKeychainAvailable();if(!_0x25efaf)throw new Error(_0x3822b9(0x16a)+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');const _0x2f7d54=getConsoleUrl(_0x2171a5);console[_0x3822b9(0x188)](_0x3822b9(0x179)),console[_0x3822b9(0x188)]('\x20\x20'+_0x2f7d54+_0x3822b9(0x18f)),console[_0x3822b9(0x188)]('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0x5298ca=await startOAuthFlow(_0x2171a5);console[_0x3822b9(0x188)](_0x3822b9(0x184));const _0x476e0a=TDX[_0x3822b9(0x180)]({'site':_0x2171a5,'accessToken':_0x5298ca[_0x3822b9(0x17e)],'logLevel':_0x13fb98??LogLevel['ERROR']}),_0x774c42=await _0x476e0a[_0x3822b9(0x17d)][_0x3822b9(0x16c)]();console['log'](a8_0x79c138['green'](_0x3822b9(0x17a)+_0x774c42['email']+')')),await saveOAuthTokens(_0x5298ca,_0x5885b2),console['log'](_0x3822b9(0x17f)+(_0x5885b2?_0x3822b9(0x183)+_0x5885b2+')':''));if(_0x5885b2){const _0x1b63e3={'site':_0x2171a5};saveProfileToUserConfig(_0x5885b2,_0x1b63e3),console['log'](_0x3822b9(0x175)+_0x5885b2+_0x3822b9(0x193));}const _0x365aef=_0x5885b2?_0x3822b9(0x189)+_0x5885b2:'';console['log'](),console['log'](_0x3822b9(0x170)),console[_0x3822b9(0x188)](_0x3822b9(0x17c)+_0x365aef+_0x3822b9(0x191)),console['log'](_0x3822b9(0x17c)+_0x365aef+_0x3822b9(0x169));}export class AuthLoginCommand extends BaseCommand{['name']=a8_0x53ff35(0x171);[a8_0x53ff35(0x177)]='Login\x20via\x20OAuth\x20(opens\x20browser)';async[a8_0x53ff35(0x16e)](_0x47a442){const _0x454fbc=a8_0x53ff35,{options:_0x32fab5}=_0x47a442,_0x4502e3=_0x32fab5[_0x454fbc(0x176)];console[_0x454fbc(0x188)](a8_0x79c138[_0x454fbc(0x16b)](_0x454fbc(0x18e)));const _0x52fa55=_0x32fab5[_0x454fbc(0x18a)]||_0x454fbc(0x173),_0x52e2f7=await promptSiteSelection(_0x52fa55,_0x4502e3,'Login\x20cancelled');if(!_0x52e2f7)return 0x1;const _0x500a0c=resolveSite(_0x52e2f7);return console[_0x454fbc(0x188)](_0x454fbc(0x190)+_0x500a0c),await runOAuthLoginFlow(_0x500a0c,_0x4502e3,_0x32fab5[_0x454fbc(0x168)]??LogLevel[_0x454fbc(0x178)]),0x0;}}