@treasuredata/tdx 2026.3.43 → 2026.3.45

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 (222) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/cas-command.js +1 -1
  12. package/dist/commands/cas-segment-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/delivery-command.js +1 -1
  21. package/dist/commands/describe.js +1 -1
  22. package/dist/commands/engage-campaign-pull-command.js +1 -1
  23. package/dist/commands/engage-campaign-push-command.js +1 -1
  24. package/dist/commands/engage-campaign-validate-command.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/engage-template-pull-command.js +1 -1
  27. package/dist/commands/engage-template-push-command.js +1 -1
  28. package/dist/commands/engage-template-validate-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.js +1 -1
  31. package/dist/commands/journey-validate-command.js +1 -1
  32. package/dist/commands/llm-command.js +1 -1
  33. package/dist/commands/mcp-command.js +1 -1
  34. package/dist/commands/parent-segment-command.js +1 -1
  35. package/dist/commands/policy-command.js +1 -1
  36. package/dist/commands/profile-command.js +1 -1
  37. package/dist/commands/profiles-command.js +1 -1
  38. package/dist/commands/query-command.js +1 -1
  39. package/dist/commands/schedule-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/status-command.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/work-command.js +1 -1
  57. package/dist/commands/workflow-command.js +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/command-output.js +1 -1
  60. package/dist/core/config.js +1 -1
  61. package/dist/core/connection-cache.js +1 -1
  62. package/dist/core/constants.js +1 -1
  63. package/dist/core/credential-cache.js +1 -1
  64. package/dist/core/global-context.js +1 -1
  65. package/dist/core/keychain.js +1 -1
  66. package/dist/core/oauth-keychain.js +1 -1
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/tools/index.js +1 -1
  76. package/dist/mcp/tools/tdx-run.js +1 -1
  77. package/dist/mcp/tools/tdx-search.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.d.ts +4 -1
  141. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  142. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  143. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  144. package/dist/sdk/segment/fields-display.js +1 -1
  145. package/dist/sdk/segment/file-discovery.js +1 -1
  146. package/dist/sdk/segment/journey-utils.js +1 -1
  147. package/dist/sdk/segment/journey-validator.js +1 -1
  148. package/dist/sdk/segment/journey-yaml.js +1 -1
  149. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  150. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  151. package/dist/sdk/segment/pull-workflow.js +1 -1
  152. package/dist/sdk/segment/push-recovery.js +1 -1
  153. package/dist/sdk/segment/push-workflow.js +1 -1
  154. package/dist/sdk/segment/resolution-context.js +1 -1
  155. package/dist/sdk/segment/segment-path-parser.js +1 -1
  156. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  157. package/dist/sdk/segment/segment-validator.js +1 -1
  158. package/dist/sdk/segment/target-resolution.js +1 -1
  159. package/dist/sdk/segment/tdx-config.js +1 -1
  160. package/dist/sdk/segment/types/activation-schema.js +1 -1
  161. package/dist/sdk/segment/types/journey-def.js +1 -1
  162. package/dist/sdk/segment/types/journey-schema.js +1 -1
  163. package/dist/sdk/segment/types/segment-def.js +1 -1
  164. package/dist/sdk/segment/types/segment-schema.js +1 -1
  165. package/dist/sdk/segment/validate-files.js +1 -1
  166. package/dist/sdk/segment/yaml-validator.js +1 -1
  167. package/dist/sdk/segment.js +1 -1
  168. package/dist/sdk/types/index.js +1 -1
  169. package/dist/sdk/types/progress.js +1 -1
  170. package/dist/sdk/types/workspace.js +1 -1
  171. package/dist/sdk/user.js +1 -1
  172. package/dist/sdk/util/format-detector.js +1 -1
  173. package/dist/sdk/util/formatters.js +1 -1
  174. package/dist/sdk/util/index.js +1 -1
  175. package/dist/sdk/util/paginate.js +1 -1
  176. package/dist/sdk/util/tree-formatter.js +1 -1
  177. package/dist/sdk/workflow/archive-validation.js +1 -1
  178. package/dist/sdk/workflow/clone-workflow.js +1 -1
  179. package/dist/sdk/workflow/index.js +1 -1
  180. package/dist/sdk/workflow/pull-workflow.js +1 -1
  181. package/dist/sdk/workflow/push-workflow.js +1 -1
  182. package/dist/sdk/workflow/tdx-config.js +1 -1
  183. package/dist/sdk/workflow/workflow-utils.js +1 -1
  184. package/dist/sdk/workspace/frontmatter.js +1 -1
  185. package/dist/sdk/workspace/git.js +1 -1
  186. package/dist/sdk/workspace/index.js +1 -1
  187. package/dist/sdk/workspace/templates.js +1 -1
  188. package/dist/sdk/workspace/weekly.js +1 -1
  189. package/dist/sdk/workspace/wikilinks.js +1 -1
  190. package/dist/test-utils/command-runner.js +1 -1
  191. package/dist/test-utils/factories.js +1 -1
  192. package/dist/test-utils/fixtures.js +1 -1
  193. package/dist/test-utils/http-mock.js +1 -1
  194. package/dist/test-utils/index.js +1 -1
  195. package/dist/utils/async.js +1 -1
  196. package/dist/utils/colors.js +1 -1
  197. package/dist/utils/diff.js +1 -1
  198. package/dist/utils/file-permissions.js +1 -1
  199. package/dist/utils/file-reader.js +1 -1
  200. package/dist/utils/github-releases.js +1 -1
  201. package/dist/utils/global-cache.js +1 -1
  202. package/dist/utils/json-loader.js +1 -1
  203. package/dist/utils/local-cache.js +1 -1
  204. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  205. package/dist/utils/logger/formatters/index.js +1 -1
  206. package/dist/utils/logger/handlers/console-handler.js +1 -1
  207. package/dist/utils/logger/handlers/file-handler.js +1 -1
  208. package/dist/utils/logger/handlers/index.js +1 -1
  209. package/dist/utils/logger/handlers/null-handler.js +1 -1
  210. package/dist/utils/logger/index.js +1 -1
  211. package/dist/utils/logger/logger.js +1 -1
  212. package/dist/utils/logger/types.js +1 -1
  213. package/dist/utils/option-validation.js +1 -1
  214. package/dist/utils/process.js +1 -1
  215. package/dist/utils/prompt.js +1 -1
  216. package/dist/utils/spinner.js +1 -1
  217. package/dist/utils/sse-parser.js +1 -1
  218. package/dist/utils/string-utils.js +1 -1
  219. package/dist/utils/table-ref-parser.js +1 -1
  220. package/dist/utils/tdx-logger.js +1 -1
  221. package/dist/utils/version-check.js +1 -1
  222. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x51540e=a3_0x5077;(function(_0x699b1,_0x7e284){const _0x38a2fe=a3_0x5077,_0x3bbcf5=_0x699b1();while(!![]){try{const _0x294311=-parseInt(_0x38a2fe(0x1da))/0x1*(parseInt(_0x38a2fe(0x1d7))/0x2)+-parseInt(_0x38a2fe(0x1d8))/0x3*(-parseInt(_0x38a2fe(0x1d2))/0x4)+-parseInt(_0x38a2fe(0x1de))/0x5*(-parseInt(_0x38a2fe(0x1d0))/0x6)+-parseInt(_0x38a2fe(0x1c2))/0x7*(-parseInt(_0x38a2fe(0x1d4))/0x8)+-parseInt(_0x38a2fe(0x1d5))/0x9*(parseInt(_0x38a2fe(0x1dd))/0xa)+parseInt(_0x38a2fe(0x1c0))/0xb*(-parseInt(_0x38a2fe(0x1be))/0xc)+-parseInt(_0x38a2fe(0x1cf))/0xd*(parseInt(_0x38a2fe(0x1df))/0xe);if(_0x294311===_0x7e284)break;else _0x3bbcf5['push'](_0x3bbcf5['shift']());}catch(_0xbf72ab){_0x3bbcf5['push'](_0x3bbcf5['shift']());}}}(a3_0x405d,0xd3a6f));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_0x51540e(0x1dc)]=a3_0x51540e(0x1c4);[a3_0x51540e(0x1d1)]=a3_0x51540e(0x1e0);async[a3_0x51540e(0x1c1)](_0x4e72d1){const _0x512c1d=a3_0x51540e,{options:_0x5f4ab8,args:_0x2aeba9,tdx:_0xfd9c60}=_0x4e72d1;if(_0x2aeba9[_0x512c1d(0x1c8)]===0x0)return console['error'](_0x512c1d(0x1c3)),console['error']('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x5830f6,childId:_0x282765}=parseSegmentRef(_0x2aeba9[0x0]);if(!_0x282765)return console[_0x512c1d(0x1cd)](_0x512c1d(0x1c6)),console[_0x512c1d(0x1cd)](_0x512c1d(0x1db)),0x1;_0x5f4ab8[_0x512c1d(0x1ca)]&&(console['error'](_0x512c1d(0x1c9)+_0x5f4ab8[_0x512c1d(0x1d3)]),console[_0x512c1d(0x1cd)](_0x512c1d(0x1cb)+_0x5830f6),console[_0x512c1d(0x1cd)](_0x512c1d(0x1c7)+_0x282765));const _0x3988e3=await withSpinner(_0x512c1d(0x1ba)+_0x5830f6+_0x512c1d(0x1cc),()=>_0xfd9c60[_0x512c1d(0x1c5)][_0x512c1d(0x1bd)](_0x5830f6),{'verbose':_0x5f4ab8['verbose']}),_0x38ea7a=_0x3988e3[_0x512c1d(0x1ce)];_0x5f4ab8['verbose']&&console[_0x512c1d(0x1cd)]('Resolved\x20parent\x20ID:\x20'+_0x38ea7a);const _0xbeabfd=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x282765+'\x27...',()=>_0xfd9c60[_0x512c1d(0x1c5)][_0x512c1d(0x1e3)](_0x38ea7a,_0x282765),{'verbose':_0x5f4ab8[_0x512c1d(0x1ca)]}),_0x38c4c9=_0xbeabfd[_0x512c1d(0x1ce)];_0x5f4ab8[_0x512c1d(0x1ca)]&&console[_0x512c1d(0x1cd)](_0x512c1d(0x1e2)+_0x38c4c9);const _0x3a12c3=await withSpinner(_0x512c1d(0x1d9)+_0x282765+'\x27...',()=>_0xfd9c60[_0x512c1d(0x1c5)][_0x512c1d(0x1bf)](_0x38ea7a,_0x38c4c9),{'verbose':_0x5f4ab8[_0x512c1d(0x1ca)]}),_0x57a6c4=_0x3a12c3[_0x512c1d(0x1ce)];return console[_0x512c1d(0x1cd)](_0x512c1d(0x1bc)+_0x57a6c4['length']+'\x20activation'+(_0x57a6c4[_0x512c1d(0x1c8)]!==0x1?'s':'')),await handleSDKOutput(_0x57a6c4,_0x5f4ab8),0x0;}catch(_0x45be0e){if(_0x45be0e instanceof SDKError)return console[_0x512c1d(0x1cd)](_0x512c1d(0x1bb)+_0x45be0e['message']),_0x45be0e['cause']&&console[_0x512c1d(0x1cd)](_0x512c1d(0x1d6)+_0x45be0e[_0x512c1d(0x1e1)]),0x1;throw _0x45be0e;}}}function a3_0x5077(_0x1951cd,_0x22feb4){_0x1951cd=_0x1951cd-0x1ba;const _0x405dcb=a3_0x405d();let _0x5077e1=_0x405dcb[_0x1951cd];return _0x5077e1;}function a3_0x405d(){const _0x19b918=['resolveParentId','916908KuFYxj','listActivations','187nGEjEH','execute','4919474VNZVOM','Error:\x20Segment\x20name\x20is\x20required','activations','segment','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','Child\x20name:\x20','length','Site:\x20','verbose','Parent\x20name:\x20','\x27...','error','data','19162cqQPmI','7922586hgedZO','description','16oreVPQ','site','8Urnlaj','288ylhDXQ','\x20\x20Cause:\x20','2WZWGGg','815448ImVAms','Listing\x20activations\x20for\x20segment\x20\x27','155049bzNtQZ','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','name','760vVKQUq','5MmLyqo','7476qLemqH','List\x20activations\x20for\x20a\x20segment','cause','Resolved\x20child\x20ID:\x20','resolveSegmentId','Resolving\x20parent\x20segment\x20\x27','Error:\x20','✔\x20Found\x20'];a3_0x405d=function(){return _0x19b918;};return a3_0x405d();}
1
+ function a3_0x4f93(){const _0x29d13b=['length','message','\x27...','Error:\x20Segment\x20name\x20is\x20required','22eZKCCT','Error:\x20','segment','Listing\x20activations\x20for\x20segment\x20\x27','name','767383sjzPbG','error','14764gfRqna','resolveSegmentId','630sPfoaI','31412ZPHOAP','execute','3478830CZNHOb','221fSTuJL','List\x20activations\x20for\x20a\x20segment','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','Parent\x20name:\x20','description','419004BFmUgD','verbose','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','✔\x20Found\x20','cause','1304KAcEIV','resolveParentId','123UZmfTx','Resolved\x20parent\x20ID:\x20','listActivations','data','Resolved\x20child\x20ID:\x20','Resolving\x20child\x20segment\x20\x27','25632gOeBFG','6615728hLEnPd','Site:\x20','6QyhKRB','site'];a3_0x4f93=function(){return _0x29d13b;};return a3_0x4f93();}const a3_0x388842=a3_0x57ac;function a3_0x57ac(_0xccca6,_0x5d7730){_0xccca6=_0xccca6-0x18e;const _0x4f939a=a3_0x4f93();let _0x57accc=_0x4f939a[_0xccca6];return _0x57accc;}(function(_0x51723f,_0x35c7c2){const _0x325ed1=a3_0x57ac,_0x5054a6=_0x51723f();while(!![]){try{const _0x45c95d=-parseInt(_0x325ed1(0x1ac))/0x1+parseInt(_0x325ed1(0x1ae))/0x2*(-parseInt(_0x325ed1(0x198))/0x3)+parseInt(_0x325ed1(0x1b1))/0x4*(parseInt(_0x325ed1(0x1b0))/0x5)+parseInt(_0x325ed1(0x1a1))/0x6*(parseInt(_0x325ed1(0x19f))/0x7)+parseInt(_0x325ed1(0x196))/0x8*(-parseInt(_0x325ed1(0x19e))/0x9)+parseInt(_0x325ed1(0x1b3))/0xa*(parseInt(_0x325ed1(0x1a7))/0xb)+parseInt(_0x325ed1(0x191))/0xc*(-parseInt(_0x325ed1(0x1b4))/0xd);if(_0x45c95d===_0x35c7c2)break;else _0x5054a6['push'](_0x5054a6['shift']());}catch(_0xb473b2){_0x5054a6['push'](_0x5054a6['shift']());}}}(a3_0x4f93,0x7aada));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_0x388842(0x1ab)]='activations';[a3_0x388842(0x190)]=a3_0x388842(0x1b5);async[a3_0x388842(0x1b2)](_0x2d31ed){const _0x469298=a3_0x388842,{options:_0x143c44,args:_0x4b31fc,tdx:_0x5c4efd}=_0x2d31ed;if(_0x4b31fc['length']===0x0)return console[_0x469298(0x1ad)](_0x469298(0x1a6)),console[_0x469298(0x1ad)](_0x469298(0x193)),0x1;try{const {parentId:_0x3d3792,childId:_0x31bb29}=parseSegmentRef(_0x4b31fc[0x0]);if(!_0x31bb29)return console[_0x469298(0x1ad)](_0x469298(0x18e)),console[_0x469298(0x1ad)](_0x469298(0x193)),0x1;_0x143c44[_0x469298(0x192)]&&(console[_0x469298(0x1ad)](_0x469298(0x1a0)+_0x143c44[_0x469298(0x1a2)]),console[_0x469298(0x1ad)](_0x469298(0x18f)+_0x3d3792),console[_0x469298(0x1ad)]('Child\x20name:\x20'+_0x31bb29));const _0x117c98=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3d3792+_0x469298(0x1a5),()=>_0x5c4efd[_0x469298(0x1a9)][_0x469298(0x197)](_0x3d3792),{'verbose':_0x143c44[_0x469298(0x192)]}),_0x39ef19=_0x117c98[_0x469298(0x19b)];_0x143c44['verbose']&&console[_0x469298(0x1ad)](_0x469298(0x199)+_0x39ef19);const _0x59a058=await withSpinner(_0x469298(0x19d)+_0x31bb29+_0x469298(0x1a5),()=>_0x5c4efd[_0x469298(0x1a9)][_0x469298(0x1af)](_0x39ef19,_0x31bb29),{'verbose':_0x143c44[_0x469298(0x192)]}),_0x319e36=_0x59a058[_0x469298(0x19b)];_0x143c44[_0x469298(0x192)]&&console[_0x469298(0x1ad)](_0x469298(0x19c)+_0x319e36);const _0x56d85a=await withSpinner(_0x469298(0x1aa)+_0x31bb29+_0x469298(0x1a5),()=>_0x5c4efd[_0x469298(0x1a9)][_0x469298(0x19a)](_0x39ef19,_0x319e36),{'verbose':_0x143c44[_0x469298(0x192)]}),_0x5c635b=_0x56d85a[_0x469298(0x19b)];return console[_0x469298(0x1ad)](_0x469298(0x194)+_0x5c635b[_0x469298(0x1a3)]+'\x20activation'+(_0x5c635b[_0x469298(0x1a3)]!==0x1?'s':'')),await handleSDKOutput(_0x5c635b,_0x143c44),0x0;}catch(_0x253a7f){if(_0x253a7f instanceof SDKError)return console['error'](_0x469298(0x1a8)+_0x253a7f[_0x469298(0x1a4)]),_0x253a7f[_0x469298(0x195)]&&console['error']('\x20\x20Cause:\x20'+_0x253a7f[_0x469298(0x195)]),0x1;throw _0x253a7f;}}}
@@ -1 +1 @@
1
- const a4_0x205e29=a4_0x95a3;(function(_0x3499c5,_0x10ab9d){const _0x22c687=a4_0x95a3,_0x566000=_0x3499c5();while(!![]){try{const _0x7a322f=-parseInt(_0x22c687(0x1b6))/0x1+-parseInt(_0x22c687(0x19a))/0x2+parseInt(_0x22c687(0x1a9))/0x3*(-parseInt(_0x22c687(0x1fb))/0x4)+-parseInt(_0x22c687(0x1a7))/0x5*(parseInt(_0x22c687(0x1f4))/0x6)+-parseInt(_0x22c687(0x1a8))/0x7*(parseInt(_0x22c687(0x1e9))/0x8)+parseInt(_0x22c687(0x1f9))/0x9*(parseInt(_0x22c687(0x170))/0xa)+parseInt(_0x22c687(0x1ba))/0xb;if(_0x7a322f===_0x10ab9d)break;else _0x566000['push'](_0x566000['shift']());}catch(_0x1c3acd){_0x566000['push'](_0x566000['shift']());}}}(a4_0x4907,0xc4abc));import a4_0x59a68b from'chalk';function a4_0x4907(){const _0x2c89f5=['\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x0aChanges\x20to\x20agent\x20\x27','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','agents','New\x20project\x20name\x20is\x20required','2729812pWrPzO','\x20\x20Text\x20Knowledge\x20Base\x20\x22','llmProject','\x0a✔\x20Pulled\x20','\x20resources?','\x20\x20Prompt\x20\x22','newProjectName','Agent:\x20','Cloning\x20\x22','Analyzing\x20changes\x20to\x20push...','\x20\x20Prompts:\x20','context','parse','2280825BRwjPP','5517967KriQAY','6gYJZDN','\x20\x20Source:\x20','name','arg-dir','Output:\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20files?','knowledgeBases','Cancelled','\x0aProject\x20pushed\x20with\x20errors','execute','\x0aPush\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','841960zzVPUW','\x0aError:','\x0aWrite\x20','MISSING_ARGUMENT','33635833bxvJqf','outputPath','projectId','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)','sourceProjectName','red','\x20\x20Experimental\x20Artifact\x20\x22','gray','no_local_folder','\x0aPush\x20summary\x20for\x20\x27','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20\x20Agent\x20\x22','yes','\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)','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','pullAgent','dryRun','llm_project','\x20|\x20','utf-8','Would\x20clone:','agent:push','newProjectId','force','no_context','projectDir','counts','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','hasChanges','\x20\x20Integration\x20\x22','Agent\x20','-\x20no\x20files\x20written','diff','\x20resources\x20to\x20\x27','agentId','dirname','agentName','tdx.json','\x20=\x20','log','\x20\x20Experimental\x20Artifacts:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x0aErrors\x20found:','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','site','dim','\x22\x20to\x20new\x20project\x20\x22','8VYOjlW','INVALID_ARGUMENT','profile','action','Pushing\x20to\x20project...','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','✔\x20Context\x20set:\x20','\x20\x20Target:\x20','Would\x20push\x20agent:\x20','Using\x20local\x20project:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','6cGXFUs','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Using\x20project:\x20','push','\x20--profile\x20','20187UzJViW','Dry\x20run\x20-\x20no\x20changes\x20made','82612XLGabK','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Project:\x20','integrations','\x20changed','Clone\x20\x22','\x20\x20Agents:\x20','\x0aChanges:','error','errors','pushProject','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','agent:pull','Writing\x20files...','llm','No\x20tdx.json\x20found\x20in\x20','new','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x22\x20from\x20project\x20\x22','\x22...','\x20new','\x20\x20Integrations:\x20','Source:\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','found','New\x20project\x20ID:\x20','Pulling\x20agent\x20\x22','\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','created','textKnowledgeBases','\x22\x20to\x20a\x20different\x20profile','\x20\x20Knowledge\x20Bases:\x20','Chat:\x20','cyan','\x20\x20Text\x20Knowledge\x20Bases:\x20','pullProject','\x0a✔\x20Pushed\x20','prompts','\x22:\x20','cwd','New\x20project:\x20','reason','unchanged','join','5530mNbrNx','green','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\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','\x22\x20to\x20\x22','Errors:','experimentalArtifacts','Using\x20context\x20project:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','agent.yml','message','Analyzing\x20project\x20\x22','projectName','\x20successfully','repeat','isNew','\x0aChanges\x20to\x20prompt\x20\x27','source','experimentalKnowledgeBases','total','\x0aPull\x20summary\x20for\x20\x27','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20unchanged','cloneProject','\x20errors','description','\x20\x20Knowledge\x20Base\x20\x22','\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','updated','outputDir','Using\x20current\x20project:\x20','yellow','Status:\x20'];a4_0x4907=function(){return _0x2c89f5;};return a4_0x4907();}import a4_0x5b4eed from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,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(_0x17591f){const _0x4df5d4=a4_0x95a3,_0x4a2c19=[];if(_0x17591f['total']!==undefined)_0x4a2c19[_0x4df5d4(0x1f7)](_0x17591f['total']+'\x20total');if(_0x17591f[_0x4df5d4(0x20c)]!==undefined&&_0x17591f[_0x4df5d4(0x20c)]>0x0)_0x4a2c19[_0x4df5d4(0x1f7)](a4_0x59a68b[_0x4df5d4(0x171)](_0x17591f[_0x4df5d4(0x20c)]+'\x20new'));if(_0x17591f[_0x4df5d4(0x160)]!==undefined&&_0x17591f[_0x4df5d4(0x160)]>0x0)_0x4a2c19[_0x4df5d4(0x1f7)](a4_0x59a68b[_0x4df5d4(0x171)](_0x17591f['created']+'\x20created'));if(_0x17591f[_0x4df5d4(0x18f)]!==undefined&&_0x17591f[_0x4df5d4(0x18f)]>0x0)_0x4a2c19[_0x4df5d4(0x1f7)](a4_0x59a68b[_0x4df5d4(0x192)](_0x17591f['updated']+'\x20updated'));if(_0x17591f['unchanged']!==undefined&&_0x17591f[_0x4df5d4(0x16e)]>0x0)_0x4a2c19[_0x4df5d4(0x1f7)](a4_0x59a68b[_0x4df5d4(0x1c1)](_0x17591f[_0x4df5d4(0x16e)]+_0x4df5d4(0x189)));if(_0x17591f[_0x4df5d4(0x204)]!==undefined&&_0x17591f['errors']>0x0)_0x4a2c19['push'](a4_0x59a68b[_0x4df5d4(0x1bf)](_0x17591f[_0x4df5d4(0x204)]+_0x4df5d4(0x18b)));return _0x4a2c19[_0x4df5d4(0x16f)](',\x20');}function displayDiffs(_0x496eec,_0x45dd0a,_0x47450f,_0x186b38,_0x30c9e6,_0x4ce9ef,_0x1ab5de){const _0x17ecbd=a4_0x95a3;for(const _0x38f1f1 of _0x496eec){if(_0x38f1f1[_0x17ecbd(0x1da)]){const _0x541573=_0x38f1f1[_0x17ecbd(0x1de)]||_0x38f1f1[_0x17ecbd(0x1ab)];console['log'](_0x17ecbd(0x196)+_0x541573+'\x27:'),console[_0x17ecbd(0x1e1)]('─'[_0x17ecbd(0x180)](0x3c)),console['log'](_0x38f1f1[_0x17ecbd(0x1da)]),console['log']('─'[_0x17ecbd(0x180)](0x3c));}}for(const _0x503ea2 of _0x45dd0a){_0x503ea2[_0x17ecbd(0x1da)]&&(console[_0x17ecbd(0x1e1)](_0x17ecbd(0x1c8)+_0x503ea2['name']+'\x27:'),console[_0x17ecbd(0x1e1)]('─'[_0x17ecbd(0x180)](0x3c)),console['log'](_0x503ea2['diff']),console[_0x17ecbd(0x1e1)]('─'[_0x17ecbd(0x180)](0x3c)));}for(const _0x407ffa of _0x47450f){_0x407ffa[_0x17ecbd(0x1da)]&&(console[_0x17ecbd(0x1e1)](_0x17ecbd(0x17a)+_0x407ffa[_0x17ecbd(0x1ab)]+'\x27:'),console[_0x17ecbd(0x1e1)]('─'[_0x17ecbd(0x180)](0x3c)),console[_0x17ecbd(0x1e1)](_0x407ffa[_0x17ecbd(0x1da)]),console['log']('─'[_0x17ecbd(0x180)](0x3c)));}for(const _0x53703a of _0x186b38){_0x53703a[_0x17ecbd(0x1da)]&&(console['log'](_0x17ecbd(0x182)+_0x53703a[_0x17ecbd(0x1ab)]+'\x27:'),console[_0x17ecbd(0x1e1)]('─'['repeat'](0x3c)),console['log'](_0x53703a[_0x17ecbd(0x1da)]),console[_0x17ecbd(0x1e1)]('─'[_0x17ecbd(0x180)](0x3c)));}for(const _0x278ac2 of _0x30c9e6){_0x278ac2[_0x17ecbd(0x1da)]&&(console[_0x17ecbd(0x1e1)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x278ac2[_0x17ecbd(0x1ab)]+'\x27:'),console[_0x17ecbd(0x1e1)]('─'[_0x17ecbd(0x180)](0x3c)),console[_0x17ecbd(0x1e1)](_0x278ac2['diff']),console[_0x17ecbd(0x1e1)]('─'['repeat'](0x3c)));}for(const _0x306856 of _0x4ce9ef){_0x306856[_0x17ecbd(0x1da)]&&(console['log'](_0x17ecbd(0x1ee)+_0x306856[_0x17ecbd(0x1ab)]+'\x27:'),console['log']('─'[_0x17ecbd(0x180)](0x3c)),console[_0x17ecbd(0x1e1)](_0x306856[_0x17ecbd(0x1da)]),console[_0x17ecbd(0x1e1)]('─'[_0x17ecbd(0x180)](0x3c)));}for(const _0x38d560 of _0x1ab5de){_0x38d560[_0x17ecbd(0x1da)]&&(console[_0x17ecbd(0x1e1)](_0x17ecbd(0x173)+_0x38d560[_0x17ecbd(0x1ab)]+'\x27:'),console[_0x17ecbd(0x1e1)]('─'[_0x17ecbd(0x180)](0x3c)),console[_0x17ecbd(0x1e1)](_0x38d560[_0x17ecbd(0x1da)]),console[_0x17ecbd(0x1e1)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x205e29(0x1ab)]=a4_0x205e29(0x208);['description']=a4_0x205e29(0x1e3);async[a4_0x205e29(0x1b3)](_0x52ed06){const _0x185864=a4_0x205e29,{options:_0x464d07,args:_0x2a0e5c,tdx:_0x2e2ad8}=_0x52ed06,_0x259657=_0x2a0e5c[0x0],_0x50cfb4=_0x2a0e5c[0x1],_0x2d75c6=_0x464d07['output'],_0x25c646=_0x464d07[_0x185864(0x1ca)],_0x21b8bf=_0x464d07['force'],_0xe6c6b=_0x464d07[_0x185864(0x1c6)],_0x2e00ef=_0x464d07[_0x185864(0x19c)],_0x319cb7=_0x464d07['agent'];let _0x13b203;if(_0x259657){const _0x5e0104=a4_0x5b4eed[_0x185864(0x16f)](_0x259657,_0x185864(0x1df));if(existsSync(_0x5e0104))try{const _0x810ca9=JSON['parse'](readFileSync(_0x5e0104,'utf-8'));_0x810ca9['llm_project']&&(_0x13b203={'llm_project':_0x810ca9[_0x185864(0x1cb)]});}catch{}}const _0x5e9bfc=findAgentConfigPath(process[_0x185864(0x16b)]());let _0x394ecf;if(_0x5e9bfc)try{const _0x43d23f=JSON[_0x185864(0x1a6)](readFileSync(_0x5e9bfc,_0x185864(0x1cd)));_0x43d23f[_0x185864(0x1cb)]&&(_0x394ecf={'llm_project':_0x43d23f[_0x185864(0x1cb)]});}catch{}const _0x1c0d2a=resolveAgentPullArgs({'arg':_0x259657,'agentNameArg':_0x50cfb4,'agentFlag':_0x319cb7,'contextProject':_0x2e00ef,'argDirConfig':_0x13b203,'cwdConfigPath':_0x5e9bfc||undefined,'cwdConfig':_0x394ecf}),{projectNameOrId:_0x43f43b,targetAgentName:_0x4448ec,existingOutputDir:_0x109d6d,source:_0x232162}=_0x1c0d2a;if(_0x232162===_0x185864(0x1ac))console[_0x185864(0x1e1)](a4_0x59a68b[_0x185864(0x1e7)]('Using\x20project\x20from\x20'+a4_0x5b4eed[_0x185864(0x16f)](_0x259657,_0x185864(0x1df))+':\x20'+_0x43f43b));else{if(_0x232162==='cwd-config')console['log'](a4_0x59a68b[_0x185864(0x1e7)](_0x185864(0x1f6)+_0x43f43b));else _0x232162===_0x185864(0x1a5)&&console[_0x185864(0x1e1)](a4_0x59a68b[_0x185864(0x1e7)]('Using\x20project\x20from\x20context:\x20'+_0x43f43b));}if(!_0x43f43b)return _0x319cb7?(console['log'](a4_0x59a68b[_0x185864(0x192)]('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console['log'](_0x185864(0x187)),console[_0x185864(0x1e1)](_0x185864(0x197))):(console[_0x185864(0x1e1)](a4_0x59a68b[_0x185864(0x192)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x185864(0x1e1)](_0x185864(0x1bd)),console[_0x185864(0x1e1)]('\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'),console[_0x185864(0x1e1)](_0x185864(0x15f)),console[_0x185864(0x1e1)](_0x185864(0x18e)),console[_0x185864(0x1e1)](_0x185864(0x175))),0x1;if(_0x4448ec){const {data:_0x37f6b8}=await withSpinner(_0x185864(0x15e)+_0x4448ec+_0x185864(0x20e)+_0x43f43b+_0x185864(0x157),()=>_0x2e2ad8[_0x185864(0x20a)][_0x185864(0x1c9)](_0x43f43b,_0x4448ec,_0x2d75c6,{'dryRun':_0x25c646,'force':_0x21b8bf}));if(_0x25c646)return console[_0x185864(0x1e1)](a4_0x59a68b[_0x185864(0x192)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x185864(0x1e1)]('Would\x20pull\x20agent:\x20'+_0x37f6b8[_0x185864(0x1de)]),console[_0x185864(0x1e1)]('Output\x20path:\x20'+_0x37f6b8[_0x185864(0x1bb)]),_0x37f6b8[_0x185864(0x1da)]&&(console[_0x185864(0x1e1)](_0x185864(0x202)),console[_0x185864(0x1e1)]('─'[_0x185864(0x180)](0x3c)),console[_0x185864(0x1e1)](_0x37f6b8['diff']),console[_0x185864(0x1e1)]('─'['repeat'](0x3c))),0x0;return console[_0x185864(0x1e1)](a4_0x59a68b[_0x185864(0x171)]('Agent\x20pulled\x20successfully')),console['log'](_0x185864(0x1a1)+_0x37f6b8[_0x185864(0x1de)]),console[_0x185864(0x1e1)](_0x185864(0x1ad)+_0x37f6b8['outputPath']),console[_0x185864(0x1e1)](_0x185864(0x193)+(_0x37f6b8[_0x185864(0x181)]?a4_0x59a68b[_0x185864(0x171)]('new'):_0x37f6b8[_0x185864(0x1d6)]?a4_0x59a68b[_0x185864(0x192)](_0x185864(0x18f)):a4_0x59a68b['gray'](_0x185864(0x16e)))),0x0;}const _0x102568=_0x109d6d||_0x2d75c6,{data:_0x3a4b6f}=await withSpinner(_0x185864(0x17d)+_0x43f43b+_0x185864(0x157),()=>_0x2e2ad8[_0x185864(0x20a)][_0x185864(0x167)](_0x43f43b,_0x102568,{'dryRun':!![]})),_0x429576=_0x3a4b6f[_0x185864(0x1d4)][_0x185864(0x198)][_0x185864(0x20c)]+_0x3a4b6f[_0x185864(0x1d4)][_0x185864(0x1b0)][_0x185864(0x20c)]+_0x3a4b6f['counts'][_0x185864(0x161)]['new']+_0x3a4b6f['counts'][_0x185864(0x169)][_0x185864(0x20c)]+_0x3a4b6f[_0x185864(0x1d4)]['integrations'][_0x185864(0x20c)]+_0x3a4b6f[_0x185864(0x1d4)][_0x185864(0x184)][_0x185864(0x20c)]+_0x3a4b6f[_0x185864(0x1d4)][_0x185864(0x178)]['new'],_0x323d2e=_0x3a4b6f[_0x185864(0x1d4)][_0x185864(0x198)][_0x185864(0x18f)]+_0x3a4b6f[_0x185864(0x1d4)][_0x185864(0x1b0)][_0x185864(0x18f)]+_0x3a4b6f['counts'][_0x185864(0x161)][_0x185864(0x18f)]+_0x3a4b6f[_0x185864(0x1d4)][_0x185864(0x169)]['updated']+_0x3a4b6f[_0x185864(0x1d4)]['integrations'][_0x185864(0x18f)]+_0x3a4b6f[_0x185864(0x1d4)][_0x185864(0x184)][_0x185864(0x18f)]+_0x3a4b6f[_0x185864(0x1d4)][_0x185864(0x178)][_0x185864(0x18f)],_0x3afd0a=_0x3a4b6f[_0x185864(0x1d4)][_0x185864(0x198)][_0x185864(0x16e)]+_0x3a4b6f['counts']['knowledgeBases'][_0x185864(0x16e)]+_0x3a4b6f[_0x185864(0x1d4)][_0x185864(0x161)][_0x185864(0x16e)]+_0x3a4b6f[_0x185864(0x1d4)][_0x185864(0x169)][_0x185864(0x16e)]+_0x3a4b6f['counts'][_0x185864(0x1fe)]['unchanged']+_0x3a4b6f[_0x185864(0x1d4)][_0x185864(0x184)][_0x185864(0x16e)]+_0x3a4b6f[_0x185864(0x1d4)][_0x185864(0x178)]['unchanged'];console[_0x185864(0x1e1)](_0x185864(0x186)+_0x3a4b6f[_0x185864(0x17e)]+'\x27:'),console[_0x185864(0x1e1)]('\x20\x20'+a4_0x59a68b[_0x185864(0x171)]('+\x20'+_0x429576+_0x185864(0x158))+'\x20|\x20'+a4_0x59a68b[_0x185864(0x192)]('~\x20'+_0x323d2e+_0x185864(0x1ff))+_0x185864(0x1cc)+a4_0x59a68b['dim']('=\x20'+_0x3afd0a+_0x185864(0x189))),console[_0x185864(0x1e1)](_0x185864(0x201)+formatCountSummary(_0x3a4b6f[_0x185864(0x1d4)][_0x185864(0x198)])),console['log'](_0x185864(0x163)+formatCountSummary(_0x3a4b6f['counts'][_0x185864(0x1b0)])),console[_0x185864(0x1e1)](_0x185864(0x166)+formatCountSummary(_0x3a4b6f[_0x185864(0x1d4)][_0x185864(0x161)])),console[_0x185864(0x1e1)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x3a4b6f[_0x185864(0x1d4)][_0x185864(0x169)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x3a4b6f[_0x185864(0x1d4)]['integrations']));const _0x2d653b=_0x3a4b6f['counts'][_0x185864(0x184)][_0x185864(0x185)]>0x0||_0x3a4b6f[_0x185864(0x1d4)][_0x185864(0x178)][_0x185864(0x185)]>0x0;_0x2d653b&&(console[_0x185864(0x1e1)](_0x185864(0x1f5)+formatCountSummary(_0x3a4b6f[_0x185864(0x1d4)][_0x185864(0x184)])),console[_0x185864(0x1e1)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x3a4b6f[_0x185864(0x1d4)]['experimentalArtifacts'])));console['log'](_0x185864(0x1f0)+a4_0x59a68b[_0x185864(0x165)](_0x3a4b6f[_0x185864(0x190)])),displayDiffs(_0x3a4b6f[_0x185864(0x198)],_0x3a4b6f['knowledgeBases'],_0x3a4b6f[_0x185864(0x161)],_0x3a4b6f[_0x185864(0x169)],_0x3a4b6f[_0x185864(0x1fe)],_0x3a4b6f[_0x185864(0x184)],_0x3a4b6f[_0x185864(0x178)]);if(_0x25c646)return console[_0x185864(0x1e1)](a4_0x59a68b[_0x185864(0x192)](_0x185864(0x206))),0x0;if(_0x429576===0x0&&_0x323d2e===0x0)return console[_0x185864(0x1e1)](a4_0x59a68b['green'](_0x185864(0x1d5))),saveSessionContext({'llm_project':_0x3a4b6f['projectName']},_0x464d07['session']),console[_0x185864(0x1e1)](a4_0x59a68b['green'](_0x185864(0x1ef)+a4_0x59a68b[_0x185864(0x1e7)](_0x185864(0x1cb))+_0x185864(0x1e0)+a4_0x59a68b[_0x185864(0x165)](_0x3a4b6f[_0x185864(0x17e)]))),0x0;if(!_0xe6c6b&&!_0x21b8bf){if(!isInteractive())return console['error'](a4_0x59a68b[_0x185864(0x1bf)](_0x185864(0x1b7)),_0x185864(0x172)),console['error'](a4_0x59a68b['dim'](_0x185864(0x207))),0x1;const _0x3ad718=await confirmKey(_0x185864(0x1b8)+(_0x429576+_0x323d2e)+_0x185864(0x1af));if(!_0x3ad718)return console[_0x185864(0x1e1)](a4_0x59a68b['yellow'](_0x185864(0x1b1)),_0x185864(0x1d9)),0x1;}const {data:_0x14fa92}=await withSpinner(_0x185864(0x209),()=>_0x2e2ad8[_0x185864(0x20a)][_0x185864(0x167)](_0x43f43b,_0x102568,{'force':_0x21b8bf}));return console[_0x185864(0x1e1)](a4_0x59a68b[_0x185864(0x171)](_0x185864(0x19d)+(_0x429576+_0x323d2e)+'\x20files\x20to\x20'+_0x14fa92[_0x185864(0x190)])),saveSessionContext({'llm_project':_0x14fa92['projectName']},_0x464d07['session']),console['log'](a4_0x59a68b[_0x185864(0x171)](_0x185864(0x1ef)+a4_0x59a68b[_0x185864(0x1e7)](_0x185864(0x1cb))+_0x185864(0x1e0)+a4_0x59a68b[_0x185864(0x165)](_0x14fa92[_0x185864(0x17e)]))),0x0;}}function a4_0x95a3(_0x33039c,_0x5142b4){_0x33039c=_0x33039c-0x157;const _0x490703=a4_0x4907();let _0x95a3e2=_0x490703[_0x33039c];return _0x95a3e2;}export class AgentCloneCommand extends BaseCommand{[a4_0x205e29(0x1ab)]='agent:clone';[a4_0x205e29(0x18c)]=a4_0x205e29(0x195);async['execute'](_0x65d459){const _0x2a5b1c=a4_0x205e29,{options:_0x22b22c,args:_0x234046,tdx:_0x35c3e8}=_0x65d459,_0x3bcc84=_0x234046[0x0],_0x116a80=_0x22b22c[_0x2a5b1c(0x1ab)],_0x8c87b5=_0x22b22c[_0x2a5b1c(0x1ca)],_0x3e7ed7=_0x22b22c['yes'],_0x11a58c=_0x22b22c[_0x2a5b1c(0x1e6)],_0x47e6d2=_0x22b22c[_0x2a5b1c(0x19c)];let _0x3cbebb;const _0x20442e=findAgentConfigPath(process[_0x2a5b1c(0x16b)]());if(_0x3bcc84){const _0x491d9d=a4_0x5b4eed[_0x2a5b1c(0x16f)](_0x3bcc84,_0x2a5b1c(0x1df));existsSync(_0x491d9d)?(_0x3cbebb=_0x3bcc84,console['log'](a4_0x59a68b[_0x2a5b1c(0x1e7)](_0x2a5b1c(0x1f2)+_0x3bcc84))):_0x3cbebb=_0x3bcc84;}else{if(_0x20442e)_0x3cbebb=a4_0x5b4eed['dirname'](_0x20442e),console['log'](a4_0x59a68b[_0x2a5b1c(0x1e7)](_0x2a5b1c(0x191)+_0x3cbebb));else{if(_0x47e6d2){const _0x1c6846=sanitizeForFilesystem(_0x47e6d2);let _0x905457=_0x1c6846,_0x225357=a4_0x5b4eed[_0x2a5b1c(0x16f)](process[_0x2a5b1c(0x16b)](),'agents',_0x1c6846,'tdx.json');if(!existsSync(_0x225357)){const _0x45c2a8=normalizeName(_0x47e6d2),_0x120772=a4_0x5b4eed[_0x2a5b1c(0x16f)](process[_0x2a5b1c(0x16b)](),_0x2a5b1c(0x198),_0x45c2a8,_0x2a5b1c(0x1df));existsSync(_0x120772)&&(_0x905457=_0x45c2a8,_0x225357=_0x120772);}if(existsSync(_0x225357))_0x3cbebb=a4_0x5b4eed[_0x2a5b1c(0x1dd)](_0x225357),console[_0x2a5b1c(0x1e1)](a4_0x59a68b[_0x2a5b1c(0x1e7)](_0x2a5b1c(0x1f2)+_0x3cbebb));else{const _0x181586=_0x22b22c[_0x2a5b1c(0x1eb)];if(_0x181586)throw new SDKError(ErrorCode[_0x2a5b1c(0x1ea)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x47e6d2+_0x2a5b1c(0x162),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x2a5b1c(0x1f3)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x47e6d2+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x905457+'\x20--name\x20'+(_0x116a80||'<new-name>')+_0x2a5b1c(0x1f8)+_0x181586)});_0x3cbebb=_0x47e6d2,console[_0x2a5b1c(0x1e1)](a4_0x59a68b[_0x2a5b1c(0x1e7)](_0x2a5b1c(0x179)+_0x47e6d2));}}}}if(!_0x3cbebb)return console['log'](a4_0x59a68b[_0x2a5b1c(0x192)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x2a5b1c(0x1e1)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x2a5b1c(0x1e1)](_0x2a5b1c(0x194)),console[_0x2a5b1c(0x1e1)](_0x2a5b1c(0x1c7)),console['log'](_0x2a5b1c(0x174)),0x1;if(!_0x116a80)throw new SDKError(ErrorCode[_0x2a5b1c(0x1b9)],_0x2a5b1c(0x199),undefined,{'helpText':_0x2a5b1c(0x188)});if(!_0x3e7ed7&&!_0x8c87b5){if(!isInteractive())return console[_0x2a5b1c(0x203)](a4_0x59a68b[_0x2a5b1c(0x1bf)](_0x2a5b1c(0x1b7)),_0x2a5b1c(0x172)),console[_0x2a5b1c(0x203)](a4_0x59a68b[_0x2a5b1c(0x1e7)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2ba8c4=await confirmKey(_0x2a5b1c(0x200)+_0x3cbebb+_0x2a5b1c(0x1e8)+_0x116a80+'\x22?');if(!_0x2ba8c4)return console['log'](a4_0x59a68b[_0x2a5b1c(0x192)]('Cancelled')),0x1;}const {data:_0x4204d7}=await withSpinner(_0x2a5b1c(0x1a2)+_0x3cbebb+_0x2a5b1c(0x176)+_0x116a80+_0x2a5b1c(0x157),()=>_0x35c3e8[_0x2a5b1c(0x20a)][_0x2a5b1c(0x18a)](_0x3cbebb,_0x116a80,{'dryRun':_0x8c87b5}));if(_0x8c87b5){console['log'](a4_0x59a68b[_0x2a5b1c(0x192)](_0x2a5b1c(0x1fa))),console[_0x2a5b1c(0x1e1)](_0x2a5b1c(0x15a)+_0x4204d7['sourceProjectName']),console[_0x2a5b1c(0x1e1)](_0x2a5b1c(0x16c)+_0x116a80),console['log'](_0x2a5b1c(0x1ce)),console[_0x2a5b1c(0x1e1)](_0x2a5b1c(0x201)+_0x4204d7[_0x2a5b1c(0x1d4)][_0x2a5b1c(0x198)][_0x2a5b1c(0x160)]),console[_0x2a5b1c(0x1e1)](_0x2a5b1c(0x163)+_0x4204d7[_0x2a5b1c(0x1d4)][_0x2a5b1c(0x1b0)][_0x2a5b1c(0x160)]),console[_0x2a5b1c(0x1e1)]('\x20\x20Prompts:\x20'+_0x4204d7[_0x2a5b1c(0x1d4)]['prompts']['created']);const _0x2a448a=_0x4204d7[_0x2a5b1c(0x1d4)]['experimentalKnowledgeBases'][_0x2a5b1c(0x160)]>0x0||_0x4204d7['counts'][_0x2a5b1c(0x178)][_0x2a5b1c(0x160)]>0x0;return _0x2a448a&&(console[_0x2a5b1c(0x1e1)](_0x2a5b1c(0x1f5)+_0x4204d7['counts'][_0x2a5b1c(0x184)][_0x2a5b1c(0x160)]),console[_0x2a5b1c(0x1e1)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x4204d7['counts'][_0x2a5b1c(0x178)]['created'])),0x0;}const _0x52678f=_0x4204d7['counts']['agents'][_0x2a5b1c(0x204)]>0x0||_0x4204d7['counts']['knowledgeBases']['errors']>0x0||_0x4204d7[_0x2a5b1c(0x1d4)][_0x2a5b1c(0x169)]['errors']>0x0||_0x4204d7[_0x2a5b1c(0x1d4)]['experimentalKnowledgeBases']['errors']>0x0||_0x4204d7['counts'][_0x2a5b1c(0x178)]['errors']>0x0;_0x52678f?console[_0x2a5b1c(0x1e1)](a4_0x59a68b[_0x2a5b1c(0x192)]('Project\x20cloned\x20with\x20errors')):console[_0x2a5b1c(0x1e1)](a4_0x59a68b[_0x2a5b1c(0x171)]('Project\x20cloned\x20successfully'));console[_0x2a5b1c(0x1e1)](_0x2a5b1c(0x15a)+_0x4204d7[_0x2a5b1c(0x1be)]),console['log'](_0x2a5b1c(0x16c)+_0x4204d7[_0x2a5b1c(0x1a0)]),console[_0x2a5b1c(0x1e1)](_0x2a5b1c(0x15d)+_0x4204d7[_0x2a5b1c(0x1d0)]),console['log'](),console[_0x2a5b1c(0x1e1)]('Summary:'),console[_0x2a5b1c(0x1e1)]('\x20\x20Agents:\x20'+formatCountSummary(_0x4204d7[_0x2a5b1c(0x1d4)][_0x2a5b1c(0x198)])),console[_0x2a5b1c(0x1e1)](_0x2a5b1c(0x163)+formatCountSummary(_0x4204d7[_0x2a5b1c(0x1d4)]['knowledgeBases'])),console[_0x2a5b1c(0x1e1)](_0x2a5b1c(0x1a4)+formatCountSummary(_0x4204d7[_0x2a5b1c(0x1d4)][_0x2a5b1c(0x169)])),console[_0x2a5b1c(0x1e1)](_0x2a5b1c(0x159)+formatCountSummary(_0x4204d7[_0x2a5b1c(0x1d4)][_0x2a5b1c(0x1fe)]));const _0x615285=_0x4204d7[_0x2a5b1c(0x1d4)][_0x2a5b1c(0x184)][_0x2a5b1c(0x160)]>0x0||_0x4204d7[_0x2a5b1c(0x1d4)][_0x2a5b1c(0x184)]['updated']>0x0||_0x4204d7['counts'][_0x2a5b1c(0x184)][_0x2a5b1c(0x16e)]>0x0||_0x4204d7[_0x2a5b1c(0x1d4)][_0x2a5b1c(0x178)][_0x2a5b1c(0x160)]>0x0||_0x4204d7['counts']['experimentalArtifacts'][_0x2a5b1c(0x18f)]>0x0||_0x4204d7['counts']['experimentalArtifacts'][_0x2a5b1c(0x16e)]>0x0;_0x615285&&(console['log'](_0x2a5b1c(0x1f5)+formatCountSummary(_0x4204d7[_0x2a5b1c(0x1d4)][_0x2a5b1c(0x184)])),console['log'](_0x2a5b1c(0x1e2)+formatCountSummary(_0x4204d7['counts']['experimentalArtifacts'])));if(_0x52678f){console[_0x2a5b1c(0x1e1)](),console[_0x2a5b1c(0x1e1)](a4_0x59a68b[_0x2a5b1c(0x1bf)](_0x2a5b1c(0x177)));for(const _0x369398 of _0x4204d7['agents']){_0x369398['action']===_0x2a5b1c(0x203)&&console[_0x2a5b1c(0x1e1)](a4_0x59a68b['red'](_0x2a5b1c(0x1c5)+_0x369398['agentName']+_0x2a5b1c(0x16a)+_0x369398[_0x2a5b1c(0x203)]));}for(const _0x833e4a of _0x4204d7[_0x2a5b1c(0x1b0)]){_0x833e4a[_0x2a5b1c(0x1ec)]==='error'&&console['log'](a4_0x59a68b[_0x2a5b1c(0x1bf)](_0x2a5b1c(0x18d)+_0x833e4a['name']+_0x2a5b1c(0x16a)+_0x833e4a[_0x2a5b1c(0x203)]));}for(const _0x14bb04 of _0x4204d7[_0x2a5b1c(0x169)]){_0x14bb04[_0x2a5b1c(0x1ec)]===_0x2a5b1c(0x203)&&console[_0x2a5b1c(0x1e1)](a4_0x59a68b[_0x2a5b1c(0x1bf)](_0x2a5b1c(0x19f)+_0x14bb04[_0x2a5b1c(0x1ab)]+'\x22:\x20'+_0x14bb04[_0x2a5b1c(0x203)]));}for(const _0x27b82e of _0x4204d7['integrations']){_0x27b82e[_0x2a5b1c(0x1ec)]==='error'&&console['log'](a4_0x59a68b['red'](_0x2a5b1c(0x1d7)+_0x27b82e['name']+'\x22:\x20'+_0x27b82e[_0x2a5b1c(0x203)]));}for(const _0x564f9a of _0x4204d7[_0x2a5b1c(0x184)]){_0x564f9a['action']===_0x2a5b1c(0x203)&&console['log'](a4_0x59a68b[_0x2a5b1c(0x1bf)](_0x2a5b1c(0x1e5)+_0x564f9a[_0x2a5b1c(0x1ab)]+_0x2a5b1c(0x16a)+_0x564f9a[_0x2a5b1c(0x203)]));}for(const _0x1efbf4 of _0x4204d7[_0x2a5b1c(0x178)]){_0x1efbf4[_0x2a5b1c(0x1ec)]===_0x2a5b1c(0x203)&&console[_0x2a5b1c(0x1e1)](a4_0x59a68b[_0x2a5b1c(0x1bf)](_0x2a5b1c(0x1c0)+_0x1efbf4[_0x2a5b1c(0x1ab)]+'\x22:\x20'+_0x1efbf4[_0x2a5b1c(0x203)]));}return 0x1;}console[_0x2a5b1c(0x1e1)]();const _0x22ffe5=getLLMProjectUrl(_0x11a58c,_0x4204d7[_0x2a5b1c(0x1d0)]);return console[_0x2a5b1c(0x1e1)](_0x2a5b1c(0x1fd)+a4_0x59a68b[_0x2a5b1c(0x165)](_0x22ffe5)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x205e29(0x1ab)]=a4_0x205e29(0x1cf);[a4_0x205e29(0x18c)]=a4_0x205e29(0x15b);async[a4_0x205e29(0x1b3)](_0x4936f5){const _0xa33f87=a4_0x205e29,{options:_0x2dbb18,args:_0x2a7c09,tdx:_0x52acbd}=_0x4936f5;let _0x1610f9=_0x2a7c09[0x0]||process[_0xa33f87(0x16b)]();const _0x3ef2f8=_0x2dbb18['dryRun'],_0x31a91a=_0x2dbb18[_0xa33f87(0x1d1)],_0x481b4c=_0x2dbb18['yes'],_0x8c1d77=_0x2dbb18[_0xa33f87(0x1e6)],_0x4b0569=a4_0x5b4eed[_0xa33f87(0x16f)](_0x1610f9,_0xa33f87(0x17b)),_0x43d748=existsSync(_0x4b0569);if(_0x43d748){const {data:_0x318b8c}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x1610f9+_0xa33f87(0x157),()=>_0x52acbd[_0xa33f87(0x20a)]['pushAgent'](_0x1610f9,{'dryRun':_0x3ef2f8,'force':_0x31a91a}));if(_0x3ef2f8)return console[_0xa33f87(0x1e1)](a4_0x59a68b[_0xa33f87(0x192)](_0xa33f87(0x1fa))),console[_0xa33f87(0x1e1)](_0xa33f87(0x1f1)+_0x318b8c['agentName']),0x0;if(_0x318b8c[_0xa33f87(0x1ec)]===_0xa33f87(0x203))return console['log'](a4_0x59a68b[_0xa33f87(0x1bf)]('Failed\x20to\x20push\x20agent:\x20'+_0x318b8c[_0xa33f87(0x203)])),0x1;console[_0xa33f87(0x1e1)](a4_0x59a68b[_0xa33f87(0x171)](_0xa33f87(0x1d8)+_0x318b8c[_0xa33f87(0x1ec)]+_0xa33f87(0x17f))),console[_0xa33f87(0x1e1)]('Agent:\x20'+_0x318b8c[_0xa33f87(0x1de)]);if(_0x318b8c[_0xa33f87(0x1dc)]&&_0x318b8c[_0xa33f87(0x1bc)]){const _0x5ae808=getLLMAgentChatUrl(_0x8c1d77,_0x318b8c[_0xa33f87(0x1bc)],_0x318b8c['agentId']);console[_0xa33f87(0x1e1)](_0xa33f87(0x164)+a4_0x59a68b[_0xa33f87(0x165)](_0x5ae808));}return 0x0;}const _0xcfa90f=_0x2dbb18['llmProject'],_0x1a24e3=resolveProjectFromContext(_0x1610f9,_0xcfa90f);if(_0x1a24e3[_0xa33f87(0x15c)])_0x1610f9=_0x1a24e3[_0xa33f87(0x1d3)],_0x1a24e3[_0xa33f87(0x183)]===_0xa33f87(0x1a5)&&console[_0xa33f87(0x1e1)](a4_0x59a68b[_0xa33f87(0x1e7)](_0xa33f87(0x1f6)+_0x1610f9));else{let _0x5d906a=_0xa33f87(0x1b5);_0x1a24e3[_0xa33f87(0x16d)]===_0xa33f87(0x1c2)&&(_0x5d906a=_0x1a24e3['message']+_0xa33f87(0x1fc)+_0x1a24e3['llmProject']+_0xa33f87(0x20d));throw new SDKError(ErrorCode[_0xa33f87(0x1ea)],_0x1a24e3[_0xa33f87(0x16d)]===_0xa33f87(0x1d2)?_0x1a24e3[_0xa33f87(0x17c)]:_0xa33f87(0x20b)+_0x1610f9,undefined,{'helpText':_0x5d906a});}const {data:_0x9642a9}=await withSpinner(_0xa33f87(0x1a3),()=>_0x52acbd[_0xa33f87(0x20a)][_0xa33f87(0x205)](_0x1610f9,{'dryRun':!![]})),_0x4bd7a7=_0x9642a9[_0xa33f87(0x1d4)]['agents'][_0xa33f87(0x204)]>0x0;if(_0x4bd7a7){console[_0xa33f87(0x1e1)](a4_0x59a68b[_0xa33f87(0x1bf)](_0xa33f87(0x1e4)));for(const _0x316dca of _0x9642a9[_0xa33f87(0x198)]){_0x316dca[_0xa33f87(0x1ec)]==='error'&&console['log'](a4_0x59a68b[_0xa33f87(0x1bf)]('\x20\x20Agent\x20\x22'+_0x316dca[_0xa33f87(0x1de)]+_0xa33f87(0x16a)+_0x316dca[_0xa33f87(0x203)]));}return 0x1;}const _0x5b48e5=_0x9642a9[_0xa33f87(0x1d4)][_0xa33f87(0x198)][_0xa33f87(0x160)]+_0x9642a9[_0xa33f87(0x1d4)][_0xa33f87(0x1b0)][_0xa33f87(0x160)]+_0x9642a9[_0xa33f87(0x1d4)][_0xa33f87(0x161)][_0xa33f87(0x160)]+_0x9642a9[_0xa33f87(0x1d4)][_0xa33f87(0x169)]['created']+_0x9642a9[_0xa33f87(0x1d4)][_0xa33f87(0x1fe)][_0xa33f87(0x160)]+_0x9642a9['counts'][_0xa33f87(0x184)][_0xa33f87(0x160)]+_0x9642a9['counts']['experimentalArtifacts'][_0xa33f87(0x160)],_0x3339bf=_0x9642a9['counts']['agents'][_0xa33f87(0x18f)]+_0x9642a9[_0xa33f87(0x1d4)]['knowledgeBases']['updated']+_0x9642a9[_0xa33f87(0x1d4)][_0xa33f87(0x161)][_0xa33f87(0x18f)]+_0x9642a9[_0xa33f87(0x1d4)][_0xa33f87(0x169)][_0xa33f87(0x18f)]+_0x9642a9[_0xa33f87(0x1d4)][_0xa33f87(0x1fe)][_0xa33f87(0x18f)]+_0x9642a9['counts'][_0xa33f87(0x184)]['updated']+_0x9642a9[_0xa33f87(0x1d4)][_0xa33f87(0x178)][_0xa33f87(0x18f)],_0x3b5ccc=_0x9642a9[_0xa33f87(0x1d4)]['agents'][_0xa33f87(0x16e)]+_0x9642a9['counts']['knowledgeBases'][_0xa33f87(0x16e)]+_0x9642a9[_0xa33f87(0x1d4)][_0xa33f87(0x161)][_0xa33f87(0x16e)]+_0x9642a9['counts'][_0xa33f87(0x169)][_0xa33f87(0x16e)]+_0x9642a9['counts'][_0xa33f87(0x1fe)]['unchanged']+_0x9642a9['counts'][_0xa33f87(0x184)]['unchanged']+_0x9642a9[_0xa33f87(0x1d4)][_0xa33f87(0x178)][_0xa33f87(0x16e)];console['log'](_0xa33f87(0x1c3)+_0x9642a9[_0xa33f87(0x17e)]+'\x27:'),console[_0xa33f87(0x1e1)]('\x20\x20'+a4_0x59a68b['green']('+\x20'+_0x5b48e5+_0xa33f87(0x158))+_0xa33f87(0x1cc)+a4_0x59a68b[_0xa33f87(0x192)]('~\x20'+_0x3339bf+_0xa33f87(0x1ff))+_0xa33f87(0x1cc)+a4_0x59a68b[_0xa33f87(0x1e7)]('=\x20'+_0x3b5ccc+_0xa33f87(0x189))),console[_0xa33f87(0x1e1)](_0xa33f87(0x201)+formatCountSummary(_0x9642a9[_0xa33f87(0x1d4)]['agents'])),console[_0xa33f87(0x1e1)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x9642a9[_0xa33f87(0x1d4)][_0xa33f87(0x1b0)])),console['log'](_0xa33f87(0x166)+formatCountSummary(_0x9642a9[_0xa33f87(0x1d4)][_0xa33f87(0x161)])),console['log'](_0xa33f87(0x1a4)+formatCountSummary(_0x9642a9[_0xa33f87(0x1d4)][_0xa33f87(0x169)])),console[_0xa33f87(0x1e1)](_0xa33f87(0x159)+formatCountSummary(_0x9642a9['counts'][_0xa33f87(0x1fe)]));const _0x1127bf=_0x9642a9[_0xa33f87(0x1d4)][_0xa33f87(0x184)][_0xa33f87(0x160)]>0x0||_0x9642a9[_0xa33f87(0x1d4)]['experimentalKnowledgeBases'][_0xa33f87(0x18f)]>0x0||_0x9642a9[_0xa33f87(0x1d4)]['experimentalKnowledgeBases'][_0xa33f87(0x16e)]>0x0||_0x9642a9[_0xa33f87(0x1d4)][_0xa33f87(0x178)][_0xa33f87(0x160)]>0x0||_0x9642a9[_0xa33f87(0x1d4)][_0xa33f87(0x178)]['updated']>0x0||_0x9642a9[_0xa33f87(0x1d4)][_0xa33f87(0x178)][_0xa33f87(0x16e)]>0x0;_0x1127bf&&(console[_0xa33f87(0x1e1)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x9642a9['counts'][_0xa33f87(0x184)])),console['log'](_0xa33f87(0x1e2)+formatCountSummary(_0x9642a9[_0xa33f87(0x1d4)][_0xa33f87(0x178)])));console[_0xa33f87(0x1e1)](_0xa33f87(0x1aa)+a4_0x59a68b[_0xa33f87(0x165)](_0x1610f9)),displayDiffs(_0x9642a9['agents'],_0x9642a9[_0xa33f87(0x1b0)],_0x9642a9['textKnowledgeBases'],_0x9642a9[_0xa33f87(0x169)],_0x9642a9[_0xa33f87(0x1fe)],_0x9642a9['experimentalKnowledgeBases'],_0x9642a9[_0xa33f87(0x178)]);if(_0x3ef2f8)return console[_0xa33f87(0x1e1)](a4_0x59a68b[_0xa33f87(0x192)](_0xa33f87(0x1c4))),0x0;if(_0x5b48e5===0x0&&_0x3339bf===0x0){console[_0xa33f87(0x1e1)](a4_0x59a68b['green'](_0xa33f87(0x1ae)));const _0x90fb=getLLMProjectUrl(_0x8c1d77,_0x9642a9[_0xa33f87(0x1bc)]);return console['log'](_0xa33f87(0x1fd)+a4_0x59a68b[_0xa33f87(0x165)](_0x90fb)),0x0;}if(!_0x481b4c&&!_0x31a91a){if(!isInteractive())return console['error'](a4_0x59a68b[_0xa33f87(0x1bf)](_0xa33f87(0x1b7)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xa33f87(0x203)](a4_0x59a68b[_0xa33f87(0x1e7)](_0xa33f87(0x207))),0x1;const _0x3178a9=await confirmKey(_0xa33f87(0x1b4)+(_0x5b48e5+_0x3339bf)+_0xa33f87(0x19e));if(!_0x3178a9)return console['log'](a4_0x59a68b[_0xa33f87(0x192)](_0xa33f87(0x1b1)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x4ee4d1}=await withSpinner(_0xa33f87(0x1ed),()=>_0x52acbd[_0xa33f87(0x20a)][_0xa33f87(0x205)](_0x1610f9,{'force':_0x31a91a})),_0x529372=_0x4ee4d1[_0xa33f87(0x1d4)][_0xa33f87(0x198)][_0xa33f87(0x204)]>0x0||_0x4ee4d1[_0xa33f87(0x1d4)][_0xa33f87(0x1b0)]['errors']>0x0||_0x4ee4d1[_0xa33f87(0x1d4)][_0xa33f87(0x161)][_0xa33f87(0x204)]>0x0||_0x4ee4d1[_0xa33f87(0x1d4)][_0xa33f87(0x169)][_0xa33f87(0x204)]>0x0;if(_0x529372){console[_0xa33f87(0x1e1)](a4_0x59a68b['yellow'](_0xa33f87(0x1b2))),console[_0xa33f87(0x1e1)](),console[_0xa33f87(0x1e1)](a4_0x59a68b['red'](_0xa33f87(0x177)));for(const _0x15a4b8 of _0x4ee4d1['agents']){_0x15a4b8[_0xa33f87(0x1ec)]===_0xa33f87(0x203)&&console[_0xa33f87(0x1e1)](a4_0x59a68b[_0xa33f87(0x1bf)](_0xa33f87(0x1c5)+_0x15a4b8[_0xa33f87(0x1de)]+_0xa33f87(0x16a)+_0x15a4b8[_0xa33f87(0x203)]));}for(const _0x30df13 of _0x4ee4d1['knowledgeBases']){_0x30df13[_0xa33f87(0x1ec)]===_0xa33f87(0x203)&&console[_0xa33f87(0x1e1)](a4_0x59a68b[_0xa33f87(0x1bf)](_0xa33f87(0x18d)+_0x30df13[_0xa33f87(0x1ab)]+_0xa33f87(0x16a)+_0x30df13[_0xa33f87(0x203)]));}for(const _0x424d89 of _0x4ee4d1[_0xa33f87(0x161)]){_0x424d89[_0xa33f87(0x1ec)]==='error'&&console[_0xa33f87(0x1e1)](a4_0x59a68b['red'](_0xa33f87(0x19b)+_0x424d89['name']+'\x22:\x20'+_0x424d89[_0xa33f87(0x203)]));}for(const _0x5e350e of _0x4ee4d1['prompts']){_0x5e350e['action']==='error'&&console[_0xa33f87(0x1e1)](a4_0x59a68b['red'](_0xa33f87(0x19f)+_0x5e350e['name']+_0xa33f87(0x16a)+_0x5e350e[_0xa33f87(0x203)]));}for(const _0x2226e2 of _0x4ee4d1[_0xa33f87(0x1fe)]){_0x2226e2['action']===_0xa33f87(0x203)&&console[_0xa33f87(0x1e1)](a4_0x59a68b[_0xa33f87(0x1bf)](_0xa33f87(0x1d7)+_0x2226e2[_0xa33f87(0x1ab)]+_0xa33f87(0x16a)+_0x2226e2[_0xa33f87(0x203)]));}return 0x1;}console[_0xa33f87(0x1e1)](a4_0x59a68b[_0xa33f87(0x171)](_0xa33f87(0x168)+(_0x5b48e5+_0x3339bf)+_0xa33f87(0x1db)+_0x4ee4d1[_0xa33f87(0x17e)]+'\x27'));const _0xed8b2=getLLMProjectUrl(_0x8c1d77,_0x4ee4d1[_0xa33f87(0x1bc)]);return console[_0xa33f87(0x1e1)](_0xa33f87(0x1fd)+a4_0x59a68b['cyan'](_0xed8b2)),0x0;}}
1
+ const a4_0x5c0de6=a4_0x7104;(function(_0x4e4d72,_0x3156d1){const _0x3e9100=a4_0x7104,_0x3c6fdc=_0x4e4d72();while(!![]){try{const _0x58126d=parseInt(_0x3e9100(0x206))/0x1*(-parseInt(_0x3e9100(0x218))/0x2)+parseInt(_0x3e9100(0x1ff))/0x3*(parseInt(_0x3e9100(0x207))/0x4)+-parseInt(_0x3e9100(0x199))/0x5*(-parseInt(_0x3e9100(0x19e))/0x6)+parseInt(_0x3e9100(0x188))/0x7*(parseInt(_0x3e9100(0x208))/0x8)+-parseInt(_0x3e9100(0x202))/0x9+-parseInt(_0x3e9100(0x1d9))/0xa+parseInt(_0x3e9100(0x18a))/0xb;if(_0x58126d===_0x3156d1)break;else _0x3c6fdc['push'](_0x3c6fdc['shift']());}catch(_0x48d6be){_0x3c6fdc['push'](_0x3c6fdc['shift']());}}}(a4_0x2713,0xb67b0));import a4_0x5cb09d from'chalk';import a4_0x1bd668 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';function a4_0x7104(_0x38404c,_0x3bd315){_0x38404c=_0x38404c-0x160;const _0x2713c3=a4_0x2713();let _0x7104a7=_0x2713c3[_0x38404c];return _0x7104a7;}import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';function a4_0x2713(){const _0x2891a3=['New\x20project:\x20','gray','\x0aPush\x20summary\x20for\x20\x27','\x20changed','llm','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','cloneProject','source','Failed\x20to\x20push\x20agent:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','✔\x20Context\x20set:\x20','\x22\x20to\x20new\x20project\x20\x22','log','outputPath','agentName','Would\x20push\x20agent:\x20','dirname','cwd-config','Cloning\x20\x22','\x20\x20Agent\x20\x22','unchanged','Pushing\x20to\x20project...','\x0aChanges\x20to\x20agent\x20\x27','experimentalArtifacts','\x20\x20Source:\x20','\x22\x20from\x20project\x20\x22','\x0aChanges\x20to\x20integration\x20\x27','Errors:','\x0aError:','pullAgent','\x20total','llm_project','\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','\x22\x20to\x20a\x20different\x20profile','counts','519UNdnmc','\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','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','12314772jmxqgR','Analyzing\x20changes\x20to\x20push...','\x0aPull\x20summary\x20for\x20\x27','session','39032xEjKEY','13564UXqQuR','8gYLJtY','Output:\x20','description','\x0aErrors\x20found:','\x0aProject\x20pushed\x20with\x20errors','Dry\x20run\x20-\x20no\x20changes\x20made','error','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x0aPush\x20','output','\x20\x20Text\x20Knowledge\x20Bases:\x20','Clone\x20\x22','\x0aWrite\x20','no_local_folder','Would\x20pull\x20agent:\x20','Writing\x20files...','26aLGbSe','new','INVALID_ARGUMENT','execute','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','outputDir','\x20files?','Project:\x20','total','site','-\x20no\x20files\x20written','newProjectId','Source:\x20','agentId','<new-name>','\x20errors','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','diff','push','errors','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','green','yellow','name','Using\x20local\x20project:\x20','\x20\x20Knowledge\x20Bases:\x20','Summary:','\x22...','projectDir','join','\x0aChanges\x20to\x20prompt\x20\x27','\x20\x20Experimental\x20Artifacts:\x20','integrations','Dry\x20run\x20-\x20no\x20files\x20written','\x22:\x20','reason','arg-dir','\x20updated','\x20\x20Integration\x20\x22','\x20\x20Knowledge\x20Base\x20\x22','7405867Biexff','\x20unchanged','3153260GPNWuU','\x0aChanges:','yes','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','no_context','dryRun','projectName','force','\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)','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','agent:pull','textKnowledgeBases','Cannot\x20clone\x20from\x20context\x20project\x20\x22','pushProject','cwd','5SNcBwY','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Pushing\x20agent\x20from\x20\x22','red','\x20\x20Prompt\x20\x22','4259652iWLHNB','\x20\x20Target:\x20','\x20--profile\x20','agents','\x20files\x20to\x20','pushAgent','Project\x20cloned\x20with\x20errors','New\x20project\x20name\x20is\x20required','utf-8','action','knowledgeBases','Project\x20cloned\x20successfully','\x20resources?','\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','tdx.json','\x20created','Using\x20project\x20from\x20context:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Using\x20context\x20project:\x20','\x20successfully','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','agent:clone','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','created','Pulling\x20agent\x20\x22','\x20\x20Prompts:\x20','dim','llmProject','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x0a✔\x20Pushed\x20','agent.yml','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','parse','MISSING_ARGUMENT','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','context','Output\x20path:\x20','No\x20tdx.json\x20found\x20in\x20','prompts','Cancelled','sourceProjectName','\x20\x20Agents:\x20','updated','\x20new','message','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Using\x20project\x20from\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x20resources\x20to\x20\x27','experimentalKnowledgeBases','\x20=\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Agent:\x20','repeat','cyan','projectId','Using\x20current\x20project:\x20','\x0a✔\x20Pulled\x20','180620aGIinX','hasChanges','Status:\x20'];a4_0x2713=function(){return _0x2891a3;};return a4_0x2713();}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x24e90b){const _0x2de4a6=a4_0x7104,_0x14d4fd=[];if(_0x24e90b[_0x2de4a6(0x165)]!==undefined)_0x14d4fd['push'](_0x24e90b[_0x2de4a6(0x165)]+_0x2de4a6(0x1fa));if(_0x24e90b[_0x2de4a6(0x219)]!==undefined&&_0x24e90b[_0x2de4a6(0x219)]>0x0)_0x14d4fd[_0x2de4a6(0x172)](a4_0x5cb09d[_0x2de4a6(0x175)](_0x24e90b[_0x2de4a6(0x219)]+_0x2de4a6(0x1c9)));if(_0x24e90b[_0x2de4a6(0x1b5)]!==undefined&&_0x24e90b['created']>0x0)_0x14d4fd[_0x2de4a6(0x172)](a4_0x5cb09d[_0x2de4a6(0x175)](_0x24e90b[_0x2de4a6(0x1b5)]+_0x2de4a6(0x1ad)));if(_0x24e90b[_0x2de4a6(0x1c8)]!==undefined&&_0x24e90b[_0x2de4a6(0x1c8)]>0x0)_0x14d4fd[_0x2de4a6(0x172)](a4_0x5cb09d[_0x2de4a6(0x176)](_0x24e90b[_0x2de4a6(0x1c8)]+_0x2de4a6(0x185)));if(_0x24e90b[_0x2de4a6(0x1f0)]!==undefined&&_0x24e90b[_0x2de4a6(0x1f0)]>0x0)_0x14d4fd[_0x2de4a6(0x172)](a4_0x5cb09d[_0x2de4a6(0x1dd)](_0x24e90b[_0x2de4a6(0x1f0)]+'\x20unchanged'));if(_0x24e90b['errors']!==undefined&&_0x24e90b[_0x2de4a6(0x173)]>0x0)_0x14d4fd[_0x2de4a6(0x172)](a4_0x5cb09d[_0x2de4a6(0x19c)](_0x24e90b['errors']+_0x2de4a6(0x16c)));return _0x14d4fd['join'](',\x20');}function displayDiffs(_0x411f59,_0x56faab,_0x187c77,_0x4343de,_0x265ea5,_0x5edf7e,_0x24577c){const _0x5dc865=a4_0x7104;for(const _0x480884 of _0x411f59){if(_0x480884[_0x5dc865(0x171)]){const _0x5b866c=_0x480884[_0x5dc865(0x1ea)]||_0x480884[_0x5dc865(0x177)];console[_0x5dc865(0x1e8)](_0x5dc865(0x1f2)+_0x5b866c+'\x27:'),console[_0x5dc865(0x1e8)]('─'[_0x5dc865(0x1d4)](0x3c)),console[_0x5dc865(0x1e8)](_0x480884[_0x5dc865(0x171)]),console[_0x5dc865(0x1e8)]('─'[_0x5dc865(0x1d4)](0x3c));}}for(const _0x3e5f93 of _0x56faab){_0x3e5f93['diff']&&(console[_0x5dc865(0x1e8)](_0x5dc865(0x1af)+_0x3e5f93[_0x5dc865(0x177)]+'\x27:'),console['log']('─'[_0x5dc865(0x1d4)](0x3c)),console[_0x5dc865(0x1e8)](_0x3e5f93[_0x5dc865(0x171)]),console['log']('─'['repeat'](0x3c)));}for(const _0x748148 of _0x187c77){_0x748148['diff']&&(console[_0x5dc865(0x1e8)](_0x5dc865(0x1cd)+_0x748148[_0x5dc865(0x177)]+'\x27:'),console[_0x5dc865(0x1e8)]('─'[_0x5dc865(0x1d4)](0x3c)),console[_0x5dc865(0x1e8)](_0x748148[_0x5dc865(0x171)]),console['log']('─'[_0x5dc865(0x1d4)](0x3c)));}for(const _0x4c20bd of _0x4343de){_0x4c20bd[_0x5dc865(0x171)]&&(console['log'](_0x5dc865(0x17e)+_0x4c20bd[_0x5dc865(0x177)]+'\x27:'),console[_0x5dc865(0x1e8)]('─'[_0x5dc865(0x1d4)](0x3c)),console[_0x5dc865(0x1e8)](_0x4c20bd[_0x5dc865(0x171)]),console[_0x5dc865(0x1e8)]('─'['repeat'](0x3c)));}for(const _0x2f4543 of _0x265ea5){_0x2f4543[_0x5dc865(0x171)]&&(console['log'](_0x5dc865(0x1f6)+_0x2f4543[_0x5dc865(0x177)]+'\x27:'),console['log']('─'[_0x5dc865(0x1d4)](0x3c)),console[_0x5dc865(0x1e8)](_0x2f4543[_0x5dc865(0x171)]),console['log']('─'['repeat'](0x3c)));}for(const _0x49448d of _0x5edf7e){_0x49448d[_0x5dc865(0x171)]&&(console[_0x5dc865(0x1e8)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x49448d['name']+'\x27:'),console['log']('─'[_0x5dc865(0x1d4)](0x3c)),console[_0x5dc865(0x1e8)](_0x49448d['diff']),console[_0x5dc865(0x1e8)]('─'[_0x5dc865(0x1d4)](0x3c)));}for(const _0x11b8e4 of _0x24577c){_0x11b8e4[_0x5dc865(0x171)]&&(console[_0x5dc865(0x1e8)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x11b8e4['name']+'\x27:'),console[_0x5dc865(0x1e8)]('─'[_0x5dc865(0x1d4)](0x3c)),console[_0x5dc865(0x1e8)](_0x11b8e4[_0x5dc865(0x171)]),console[_0x5dc865(0x1e8)]('─'[_0x5dc865(0x1d4)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x5c0de6(0x177)]=a4_0x5c0de6(0x194);[a4_0x5c0de6(0x20a)]=a4_0x5c0de6(0x1e5);async['execute'](_0x4952fc){const _0x525347=a4_0x5c0de6,{options:_0x2ed5f9,args:_0x4d1d17,tdx:_0x4903b4}=_0x4952fc,_0x21130b=_0x4d1d17[0x0],_0x36425a=_0x4d1d17[0x1],_0x5c7913=_0x2ed5f9[_0x525347(0x211)],_0x469f76=_0x2ed5f9[_0x525347(0x18f)],_0x1fb482=_0x2ed5f9[_0x525347(0x191)],_0x44262e=_0x2ed5f9[_0x525347(0x18c)],_0x2cf32d=_0x2ed5f9[_0x525347(0x1b9)],_0x361931=_0x2ed5f9['agent'];let _0x59c3c5;if(_0x21130b){const _0x3f96ca=a4_0x1bd668['join'](_0x21130b,'tdx.json');if(existsSync(_0x3f96ca))try{const _0x2217e7=JSON[_0x525347(0x1be)](readFileSync(_0x3f96ca,_0x525347(0x1a6)));_0x2217e7[_0x525347(0x1fb)]&&(_0x59c3c5={'llm_project':_0x2217e7[_0x525347(0x1fb)]});}catch{}}const _0x3bc28e=findAgentConfigPath(process['cwd']());let _0x37bf5f;if(_0x3bc28e)try{const _0xa6244d=JSON['parse'](readFileSync(_0x3bc28e,_0x525347(0x1a6)));_0xa6244d[_0x525347(0x1fb)]&&(_0x37bf5f={'llm_project':_0xa6244d['llm_project']});}catch{}const _0x2dfd7c=resolveAgentPullArgs({'arg':_0x21130b,'agentNameArg':_0x36425a,'agentFlag':_0x361931,'contextProject':_0x2cf32d,'argDirConfig':_0x59c3c5,'cwdConfigPath':_0x3bc28e||undefined,'cwdConfig':_0x37bf5f}),{projectNameOrId:_0xe8cd6f,targetAgentName:_0x4b0563,existingOutputDir:_0x25ce68,source:_0x2ccfb0}=_0x2dfd7c;if(_0x2ccfb0===_0x525347(0x184))console['log'](a4_0x5cb09d['dim'](_0x525347(0x1cc)+a4_0x1bd668[_0x525347(0x17d)](_0x21130b,'tdx.json')+':\x20'+_0xe8cd6f));else{if(_0x2ccfb0===_0x525347(0x1ed))console[_0x525347(0x1e8)](a4_0x5cb09d[_0x525347(0x1b8)]('Using\x20project:\x20'+_0xe8cd6f));else _0x2ccfb0===_0x525347(0x1c1)&&console[_0x525347(0x1e8)](a4_0x5cb09d['dim'](_0x525347(0x1ae)+_0xe8cd6f));}if(!_0xe8cd6f)return _0x361931?(console[_0x525347(0x1e8)](a4_0x5cb09d[_0x525347(0x176)](_0x525347(0x19a))),console[_0x525347(0x1e8)](_0x525347(0x16f)),console[_0x525347(0x1e8)](_0x525347(0x1ce))):(console[_0x525347(0x1e8)](a4_0x5cb09d[_0x525347(0x176)](_0x525347(0x174))),console['log']('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)'),console[_0x525347(0x1e8)](_0x525347(0x1fc)),console[_0x525347(0x1e8)](_0x525347(0x1ab)),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project'),console['log'](_0x525347(0x200))),0x1;if(_0x4b0563){const {data:_0x463599}=await withSpinner(_0x525347(0x1b6)+_0x4b0563+_0x525347(0x1f5)+_0xe8cd6f+_0x525347(0x17b),()=>_0x4903b4['llm'][_0x525347(0x1f9)](_0xe8cd6f,_0x4b0563,_0x5c7913,{'dryRun':_0x469f76,'force':_0x1fb482}));if(_0x469f76)return console['log'](a4_0x5cb09d[_0x525347(0x176)](_0x525347(0x181))),console['log'](_0x525347(0x216)+_0x463599[_0x525347(0x1ea)]),console[_0x525347(0x1e8)](_0x525347(0x1c2)+_0x463599[_0x525347(0x1e9)]),_0x463599['diff']&&(console[_0x525347(0x1e8)](_0x525347(0x18b)),console[_0x525347(0x1e8)]('─'['repeat'](0x3c)),console[_0x525347(0x1e8)](_0x463599['diff']),console['log']('─'[_0x525347(0x1d4)](0x3c))),0x0;return console[_0x525347(0x1e8)](a4_0x5cb09d[_0x525347(0x175)]('Agent\x20pulled\x20successfully')),console['log'](_0x525347(0x1d3)+_0x463599[_0x525347(0x1ea)]),console[_0x525347(0x1e8)](_0x525347(0x209)+_0x463599['outputPath']),console['log'](_0x525347(0x1db)+(_0x463599['isNew']?a4_0x5cb09d[_0x525347(0x175)](_0x525347(0x219)):_0x463599[_0x525347(0x1da)]?a4_0x5cb09d['yellow'](_0x525347(0x1c8)):a4_0x5cb09d[_0x525347(0x1dd)](_0x525347(0x1f0)))),0x0;}const _0x5dddcd=_0x25ce68||_0x5c7913,{data:_0xcdd232}=await withSpinner('Analyzing\x20project\x20\x22'+_0xe8cd6f+_0x525347(0x17b),()=>_0x4903b4[_0x525347(0x1e0)]['pullProject'](_0xe8cd6f,_0x5dddcd,{'dryRun':!![]})),_0x3c5fee=_0xcdd232[_0x525347(0x1fe)]['agents'][_0x525347(0x219)]+_0xcdd232[_0x525347(0x1fe)]['knowledgeBases'][_0x525347(0x219)]+_0xcdd232[_0x525347(0x1fe)][_0x525347(0x195)]['new']+_0xcdd232[_0x525347(0x1fe)][_0x525347(0x1c4)][_0x525347(0x219)]+_0xcdd232[_0x525347(0x1fe)][_0x525347(0x180)][_0x525347(0x219)]+_0xcdd232['counts'][_0x525347(0x1d0)]['new']+_0xcdd232[_0x525347(0x1fe)][_0x525347(0x1f3)][_0x525347(0x219)],_0x22fa8c=_0xcdd232['counts'][_0x525347(0x1a1)][_0x525347(0x1c8)]+_0xcdd232[_0x525347(0x1fe)][_0x525347(0x1a8)][_0x525347(0x1c8)]+_0xcdd232[_0x525347(0x1fe)][_0x525347(0x195)]['updated']+_0xcdd232[_0x525347(0x1fe)][_0x525347(0x1c4)]['updated']+_0xcdd232[_0x525347(0x1fe)][_0x525347(0x180)][_0x525347(0x1c8)]+_0xcdd232['counts'][_0x525347(0x1d0)][_0x525347(0x1c8)]+_0xcdd232['counts']['experimentalArtifacts'][_0x525347(0x1c8)],_0x297627=_0xcdd232[_0x525347(0x1fe)][_0x525347(0x1a1)][_0x525347(0x1f0)]+_0xcdd232[_0x525347(0x1fe)][_0x525347(0x1a8)][_0x525347(0x1f0)]+_0xcdd232[_0x525347(0x1fe)][_0x525347(0x195)][_0x525347(0x1f0)]+_0xcdd232[_0x525347(0x1fe)][_0x525347(0x1c4)][_0x525347(0x1f0)]+_0xcdd232[_0x525347(0x1fe)][_0x525347(0x180)][_0x525347(0x1f0)]+_0xcdd232[_0x525347(0x1fe)][_0x525347(0x1d0)]['unchanged']+_0xcdd232['counts'][_0x525347(0x1f3)][_0x525347(0x1f0)];console[_0x525347(0x1e8)](_0x525347(0x204)+_0xcdd232['projectName']+'\x27:'),console[_0x525347(0x1e8)]('\x20\x20'+a4_0x5cb09d[_0x525347(0x175)]('+\x20'+_0x3c5fee+_0x525347(0x1c9))+'\x20|\x20'+a4_0x5cb09d[_0x525347(0x176)]('~\x20'+_0x22fa8c+_0x525347(0x1df))+'\x20|\x20'+a4_0x5cb09d[_0x525347(0x1b8)]('=\x20'+_0x297627+_0x525347(0x189))),console[_0x525347(0x1e8)](_0x525347(0x1c7)+formatCountSummary(_0xcdd232[_0x525347(0x1fe)][_0x525347(0x1a1)])),console[_0x525347(0x1e8)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0xcdd232[_0x525347(0x1fe)]['knowledgeBases'])),console[_0x525347(0x1e8)](_0x525347(0x212)+formatCountSummary(_0xcdd232[_0x525347(0x1fe)][_0x525347(0x195)])),console[_0x525347(0x1e8)]('\x20\x20Prompts:\x20'+formatCountSummary(_0xcdd232[_0x525347(0x1fe)][_0x525347(0x1c4)])),console[_0x525347(0x1e8)]('\x20\x20Integrations:\x20'+formatCountSummary(_0xcdd232[_0x525347(0x1fe)][_0x525347(0x180)]));const _0x8bf5a=_0xcdd232[_0x525347(0x1fe)]['experimentalKnowledgeBases'][_0x525347(0x165)]>0x0||_0xcdd232[_0x525347(0x1fe)]['experimentalArtifacts'][_0x525347(0x165)]>0x0;_0x8bf5a&&(console[_0x525347(0x1e8)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0xcdd232[_0x525347(0x1fe)][_0x525347(0x1d0)])),console[_0x525347(0x1e8)](_0x525347(0x17f)+formatCountSummary(_0xcdd232[_0x525347(0x1fe)][_0x525347(0x1f3)])));console[_0x525347(0x1e8)](_0x525347(0x19f)+a4_0x5cb09d[_0x525347(0x1d5)](_0xcdd232[_0x525347(0x162)])),displayDiffs(_0xcdd232[_0x525347(0x1a1)],_0xcdd232[_0x525347(0x1a8)],_0xcdd232[_0x525347(0x195)],_0xcdd232[_0x525347(0x1c4)],_0xcdd232[_0x525347(0x180)],_0xcdd232['experimentalKnowledgeBases'],_0xcdd232['experimentalArtifacts']);if(_0x469f76)return console[_0x525347(0x1e8)](a4_0x5cb09d[_0x525347(0x176)](_0x525347(0x170))),0x0;if(_0x3c5fee===0x0&&_0x22fa8c===0x0)return console[_0x525347(0x1e8)](a4_0x5cb09d['green'](_0x525347(0x1d2))),saveSessionContext({'llm_project':_0xcdd232[_0x525347(0x190)]},_0x2ed5f9[_0x525347(0x205)]),console[_0x525347(0x1e8)](a4_0x5cb09d[_0x525347(0x175)]('✔\x20Context\x20set:\x20'+a4_0x5cb09d[_0x525347(0x1b8)](_0x525347(0x1fb))+_0x525347(0x1d1)+a4_0x5cb09d['cyan'](_0xcdd232[_0x525347(0x190)]))),0x0;if(!_0x44262e&&!_0x1fb482){if(!isInteractive())return console[_0x525347(0x20e)](a4_0x5cb09d[_0x525347(0x19c)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x525347(0x20e)](a4_0x5cb09d['dim'](_0x525347(0x16e))),0x1;const _0x3b38db=await confirmKey(_0x525347(0x214)+(_0x3c5fee+_0x22fa8c)+_0x525347(0x163));if(!_0x3b38db)return console[_0x525347(0x1e8)](a4_0x5cb09d['yellow'](_0x525347(0x1c5)),_0x525347(0x167)),0x1;}const {data:_0x3317bb}=await withSpinner(_0x525347(0x217),()=>_0x4903b4[_0x525347(0x1e0)]['pullProject'](_0xe8cd6f,_0x5dddcd,{'force':_0x1fb482}));return console[_0x525347(0x1e8)](a4_0x5cb09d[_0x525347(0x175)](_0x525347(0x1d8)+(_0x3c5fee+_0x22fa8c)+_0x525347(0x1a2)+_0x3317bb['outputDir'])),saveSessionContext({'llm_project':_0x3317bb['projectName']},_0x2ed5f9[_0x525347(0x205)]),console[_0x525347(0x1e8)](a4_0x5cb09d[_0x525347(0x175)](_0x525347(0x1e6)+a4_0x5cb09d[_0x525347(0x1b8)]('llm_project')+'\x20=\x20'+a4_0x5cb09d['cyan'](_0x3317bb[_0x525347(0x190)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x5c0de6(0x1b3);[a4_0x5c0de6(0x20a)]=a4_0x5c0de6(0x193);async[a4_0x5c0de6(0x160)](_0x390063){const _0x56ec80=a4_0x5c0de6,{options:_0xe7ee6f,args:_0x2b76a5,tdx:_0x4cad03}=_0x390063,_0x4ea65f=_0x2b76a5[0x0],_0x2ada85=_0xe7ee6f[_0x56ec80(0x177)],_0x32b915=_0xe7ee6f[_0x56ec80(0x18f)],_0x29b835=_0xe7ee6f['yes'],_0x38d791=_0xe7ee6f[_0x56ec80(0x166)],_0x21b050=_0xe7ee6f[_0x56ec80(0x1b9)];let _0x4498ab;const _0x5c631d=findAgentConfigPath(process[_0x56ec80(0x198)]());if(_0x4ea65f){const _0x58379e=a4_0x1bd668[_0x56ec80(0x17d)](_0x4ea65f,_0x56ec80(0x1ac));existsSync(_0x58379e)?(_0x4498ab=_0x4ea65f,console['log'](a4_0x5cb09d[_0x56ec80(0x1b8)]('Using\x20local\x20project:\x20'+_0x4ea65f))):_0x4498ab=_0x4ea65f;}else{if(_0x5c631d)_0x4498ab=a4_0x1bd668[_0x56ec80(0x1ec)](_0x5c631d),console[_0x56ec80(0x1e8)](a4_0x5cb09d[_0x56ec80(0x1b8)](_0x56ec80(0x1d7)+_0x4498ab));else{if(_0x21b050){const _0xa33053=sanitizeForFilesystem(_0x21b050);let _0x5ce2b3=_0xa33053,_0x1c321c=a4_0x1bd668[_0x56ec80(0x17d)](process[_0x56ec80(0x198)](),_0x56ec80(0x1a1),_0xa33053,_0x56ec80(0x1ac));if(!existsSync(_0x1c321c)){const _0x2a6ff2=normalizeName(_0x21b050),_0x2e2df1=a4_0x1bd668['join'](process[_0x56ec80(0x198)](),_0x56ec80(0x1a1),_0x2a6ff2,_0x56ec80(0x1ac));existsSync(_0x2e2df1)&&(_0x5ce2b3=_0x2a6ff2,_0x1c321c=_0x2e2df1);}if(existsSync(_0x1c321c))_0x4498ab=a4_0x1bd668[_0x56ec80(0x1ec)](_0x1c321c),console['log'](a4_0x5cb09d['dim'](_0x56ec80(0x178)+_0x4498ab));else{const _0x5af481=_0xe7ee6f['profile'];if(_0x5af481)throw new SDKError(ErrorCode[_0x56ec80(0x21a)],_0x56ec80(0x196)+_0x21b050+_0x56ec80(0x1fd),undefined,{'helpText':_0x56ec80(0x1bd)+_0x56ec80(0x201)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x21b050+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x5ce2b3+'\x20--name\x20'+(_0x2ada85||_0x56ec80(0x16b))+_0x56ec80(0x1a0)+_0x5af481)});_0x4498ab=_0x21b050,console[_0x56ec80(0x1e8)](a4_0x5cb09d[_0x56ec80(0x1b8)](_0x56ec80(0x1b0)+_0x21b050));}}}}if(!_0x4498ab)return console['log'](a4_0x5cb09d[_0x56ec80(0x176)](_0x56ec80(0x20f))),console[_0x56ec80(0x1e8)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x56ec80(0x1e8)](_0x56ec80(0x1e1)),console['log'](_0x56ec80(0x192)),console[_0x56ec80(0x1e8)](_0x56ec80(0x16d)),0x1;if(!_0x2ada85)throw new SDKError(ErrorCode[_0x56ec80(0x1bf)],_0x56ec80(0x1a5),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x29b835&&!_0x32b915){if(!isInteractive())return console[_0x56ec80(0x20e)](a4_0x5cb09d['red'](_0x56ec80(0x1f8)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x56ec80(0x20e)](a4_0x5cb09d[_0x56ec80(0x1b8)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3bacbc=await confirmKey(_0x56ec80(0x213)+_0x4498ab+_0x56ec80(0x1e7)+_0x2ada85+'\x22?');if(!_0x3bacbc)return console[_0x56ec80(0x1e8)](a4_0x5cb09d[_0x56ec80(0x176)](_0x56ec80(0x1c5))),0x1;}const {data:_0x8ad1}=await withSpinner(_0x56ec80(0x1ee)+_0x4498ab+'\x22\x20to\x20\x22'+_0x2ada85+'\x22...',()=>_0x4cad03[_0x56ec80(0x1e0)][_0x56ec80(0x1e2)](_0x4498ab,_0x2ada85,{'dryRun':_0x32b915}));if(_0x32b915){console[_0x56ec80(0x1e8)](a4_0x5cb09d[_0x56ec80(0x176)](_0x56ec80(0x20d))),console[_0x56ec80(0x1e8)](_0x56ec80(0x169)+_0x8ad1[_0x56ec80(0x1c6)]),console['log'](_0x56ec80(0x1dc)+_0x2ada85),console[_0x56ec80(0x1e8)]('Would\x20clone:'),console[_0x56ec80(0x1e8)]('\x20\x20Agents:\x20'+_0x8ad1[_0x56ec80(0x1fe)][_0x56ec80(0x1a1)][_0x56ec80(0x1b5)]),console[_0x56ec80(0x1e8)](_0x56ec80(0x179)+_0x8ad1[_0x56ec80(0x1fe)][_0x56ec80(0x1a8)][_0x56ec80(0x1b5)]),console[_0x56ec80(0x1e8)]('\x20\x20Prompts:\x20'+_0x8ad1[_0x56ec80(0x1fe)][_0x56ec80(0x1c4)][_0x56ec80(0x1b5)]);const _0x2078ab=_0x8ad1[_0x56ec80(0x1fe)][_0x56ec80(0x1d0)][_0x56ec80(0x1b5)]>0x0||_0x8ad1[_0x56ec80(0x1fe)]['experimentalArtifacts'][_0x56ec80(0x1b5)]>0x0;return _0x2078ab&&(console[_0x56ec80(0x1e8)](_0x56ec80(0x1b2)+_0x8ad1['counts']['experimentalKnowledgeBases']['created']),console[_0x56ec80(0x1e8)](_0x56ec80(0x17f)+_0x8ad1[_0x56ec80(0x1fe)]['experimentalArtifacts'][_0x56ec80(0x1b5)])),0x0;}const _0x190152=_0x8ad1[_0x56ec80(0x1fe)]['agents'][_0x56ec80(0x173)]>0x0||_0x8ad1[_0x56ec80(0x1fe)][_0x56ec80(0x1a8)][_0x56ec80(0x173)]>0x0||_0x8ad1[_0x56ec80(0x1fe)][_0x56ec80(0x1c4)]['errors']>0x0||_0x8ad1[_0x56ec80(0x1fe)][_0x56ec80(0x1d0)]['errors']>0x0||_0x8ad1[_0x56ec80(0x1fe)][_0x56ec80(0x1f3)][_0x56ec80(0x173)]>0x0;_0x190152?console[_0x56ec80(0x1e8)](a4_0x5cb09d[_0x56ec80(0x176)](_0x56ec80(0x1a4))):console[_0x56ec80(0x1e8)](a4_0x5cb09d[_0x56ec80(0x175)](_0x56ec80(0x1a9)));console['log'](_0x56ec80(0x169)+_0x8ad1[_0x56ec80(0x1c6)]),console[_0x56ec80(0x1e8)](_0x56ec80(0x1dc)+_0x8ad1['newProjectName']),console['log']('New\x20project\x20ID:\x20'+_0x8ad1[_0x56ec80(0x168)]),console[_0x56ec80(0x1e8)](),console[_0x56ec80(0x1e8)](_0x56ec80(0x17a)),console['log'](_0x56ec80(0x1c7)+formatCountSummary(_0x8ad1['counts'][_0x56ec80(0x1a1)])),console[_0x56ec80(0x1e8)](_0x56ec80(0x179)+formatCountSummary(_0x8ad1[_0x56ec80(0x1fe)][_0x56ec80(0x1a8)])),console[_0x56ec80(0x1e8)](_0x56ec80(0x1b7)+formatCountSummary(_0x8ad1[_0x56ec80(0x1fe)][_0x56ec80(0x1c4)])),console[_0x56ec80(0x1e8)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x8ad1[_0x56ec80(0x1fe)][_0x56ec80(0x180)]));const _0x458635=_0x8ad1[_0x56ec80(0x1fe)][_0x56ec80(0x1d0)][_0x56ec80(0x1b5)]>0x0||_0x8ad1[_0x56ec80(0x1fe)]['experimentalKnowledgeBases']['updated']>0x0||_0x8ad1[_0x56ec80(0x1fe)][_0x56ec80(0x1d0)][_0x56ec80(0x1f0)]>0x0||_0x8ad1[_0x56ec80(0x1fe)][_0x56ec80(0x1f3)][_0x56ec80(0x1b5)]>0x0||_0x8ad1['counts'][_0x56ec80(0x1f3)][_0x56ec80(0x1c8)]>0x0||_0x8ad1['counts'][_0x56ec80(0x1f3)][_0x56ec80(0x1f0)]>0x0;_0x458635&&(console[_0x56ec80(0x1e8)](_0x56ec80(0x1b2)+formatCountSummary(_0x8ad1[_0x56ec80(0x1fe)]['experimentalKnowledgeBases'])),console['log'](_0x56ec80(0x17f)+formatCountSummary(_0x8ad1['counts']['experimentalArtifacts'])));if(_0x190152){console[_0x56ec80(0x1e8)](),console[_0x56ec80(0x1e8)](a4_0x5cb09d[_0x56ec80(0x19c)](_0x56ec80(0x1f7)));for(const _0x1dc61e of _0x8ad1[_0x56ec80(0x1a1)]){_0x1dc61e[_0x56ec80(0x1a7)]===_0x56ec80(0x20e)&&console[_0x56ec80(0x1e8)](a4_0x5cb09d[_0x56ec80(0x19c)](_0x56ec80(0x1ef)+_0x1dc61e['agentName']+_0x56ec80(0x182)+_0x1dc61e[_0x56ec80(0x20e)]));}for(const _0x181d18 of _0x8ad1['knowledgeBases']){_0x181d18[_0x56ec80(0x1a7)]===_0x56ec80(0x20e)&&console['log'](a4_0x5cb09d[_0x56ec80(0x19c)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x181d18['name']+'\x22:\x20'+_0x181d18[_0x56ec80(0x20e)]));}for(const _0x6633f of _0x8ad1[_0x56ec80(0x1c4)]){_0x6633f[_0x56ec80(0x1a7)]===_0x56ec80(0x20e)&&console[_0x56ec80(0x1e8)](a4_0x5cb09d[_0x56ec80(0x19c)](_0x56ec80(0x19d)+_0x6633f[_0x56ec80(0x177)]+_0x56ec80(0x182)+_0x6633f[_0x56ec80(0x20e)]));}for(const _0x6d1a7b of _0x8ad1[_0x56ec80(0x180)]){_0x6d1a7b[_0x56ec80(0x1a7)]===_0x56ec80(0x20e)&&console[_0x56ec80(0x1e8)](a4_0x5cb09d[_0x56ec80(0x19c)](_0x56ec80(0x186)+_0x6d1a7b['name']+_0x56ec80(0x182)+_0x6d1a7b[_0x56ec80(0x20e)]));}for(const _0x26d2a8 of _0x8ad1[_0x56ec80(0x1d0)]){_0x26d2a8['action']===_0x56ec80(0x20e)&&console[_0x56ec80(0x1e8)](a4_0x5cb09d[_0x56ec80(0x19c)](_0x56ec80(0x161)+_0x26d2a8[_0x56ec80(0x177)]+_0x56ec80(0x182)+_0x26d2a8[_0x56ec80(0x20e)]));}for(const _0x478753 of _0x8ad1[_0x56ec80(0x1f3)]){_0x478753[_0x56ec80(0x1a7)]==='error'&&console['log'](a4_0x5cb09d[_0x56ec80(0x19c)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x478753[_0x56ec80(0x177)]+_0x56ec80(0x182)+_0x478753[_0x56ec80(0x20e)]));}return 0x1;}console[_0x56ec80(0x1e8)]();const _0x1355ef=getLLMProjectUrl(_0x38d791,_0x8ad1[_0x56ec80(0x168)]);return console[_0x56ec80(0x1e8)](_0x56ec80(0x164)+a4_0x5cb09d['cyan'](_0x1355ef)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x5c0de6(0x177)]='agent:push';[a4_0x5c0de6(0x20a)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x5c0de6(0x160)](_0x5e1a28){const _0x446afd=a4_0x5c0de6,{options:_0x4be8c9,args:_0x5a20d1,tdx:_0x2ecf38}=_0x5e1a28;let _0x347004=_0x5a20d1[0x0]||process['cwd']();const _0x152c50=_0x4be8c9['dryRun'],_0x4d9d3d=_0x4be8c9['force'],_0x5e7756=_0x4be8c9[_0x446afd(0x18c)],_0x3bdb5b=_0x4be8c9['site'],_0x406b84=a4_0x1bd668['join'](_0x347004,_0x446afd(0x1bc)),_0x270e25=existsSync(_0x406b84);if(_0x270e25){const {data:_0x504e69}=await withSpinner(_0x446afd(0x19b)+_0x347004+_0x446afd(0x17b),()=>_0x2ecf38['llm'][_0x446afd(0x1a3)](_0x347004,{'dryRun':_0x152c50,'force':_0x4d9d3d}));if(_0x152c50)return console['log'](a4_0x5cb09d['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x446afd(0x1e8)](_0x446afd(0x1eb)+_0x504e69[_0x446afd(0x1ea)]),0x0;if(_0x504e69[_0x446afd(0x1a7)]===_0x446afd(0x20e))return console['log'](a4_0x5cb09d[_0x446afd(0x19c)](_0x446afd(0x1e4)+_0x504e69[_0x446afd(0x20e)])),0x1;console[_0x446afd(0x1e8)](a4_0x5cb09d[_0x446afd(0x175)]('Agent\x20'+_0x504e69['action']+_0x446afd(0x1b1))),console[_0x446afd(0x1e8)](_0x446afd(0x1d3)+_0x504e69[_0x446afd(0x1ea)]);if(_0x504e69[_0x446afd(0x16a)]&&_0x504e69[_0x446afd(0x1d6)]){const _0x1c969c=getLLMAgentChatUrl(_0x3bdb5b,_0x504e69[_0x446afd(0x1d6)],_0x504e69[_0x446afd(0x16a)]);console[_0x446afd(0x1e8)]('Chat:\x20'+a4_0x5cb09d[_0x446afd(0x1d5)](_0x1c969c));}return 0x0;}const _0x37ffd8=_0x4be8c9['llmProject'],_0x4541d5=resolveProjectFromContext(_0x347004,_0x37ffd8);if(_0x4541d5['found'])_0x347004=_0x4541d5[_0x446afd(0x17c)],_0x4541d5[_0x446afd(0x1e3)]===_0x446afd(0x1c1)&&console[_0x446afd(0x1e8)](a4_0x5cb09d[_0x446afd(0x1b8)]('Using\x20project:\x20'+_0x347004));else{let _0x1d2412=_0x446afd(0x18d);_0x4541d5[_0x446afd(0x183)]===_0x446afd(0x215)&&(_0x1d2412=_0x4541d5[_0x446afd(0x1ca)]+_0x446afd(0x1c0)+_0x4541d5[_0x446afd(0x1b9)]+_0x446afd(0x1ba));throw new SDKError(ErrorCode[_0x446afd(0x21a)],_0x4541d5[_0x446afd(0x183)]===_0x446afd(0x18e)?_0x4541d5[_0x446afd(0x1ca)]:_0x446afd(0x1c3)+_0x347004,undefined,{'helpText':_0x1d2412});}const {data:_0x173ea2}=await withSpinner(_0x446afd(0x203),()=>_0x2ecf38[_0x446afd(0x1e0)][_0x446afd(0x197)](_0x347004,{'dryRun':!![]})),_0x266ed5=_0x173ea2['counts'][_0x446afd(0x1a1)][_0x446afd(0x173)]>0x0;if(_0x266ed5){console[_0x446afd(0x1e8)](a4_0x5cb09d[_0x446afd(0x19c)](_0x446afd(0x20b)));for(const _0x5d8fb8 of _0x173ea2[_0x446afd(0x1a1)]){_0x5d8fb8[_0x446afd(0x1a7)]===_0x446afd(0x20e)&&console[_0x446afd(0x1e8)](a4_0x5cb09d['red'](_0x446afd(0x1ef)+_0x5d8fb8['agentName']+_0x446afd(0x182)+_0x5d8fb8[_0x446afd(0x20e)]));}return 0x1;}const _0x13faac=_0x173ea2[_0x446afd(0x1fe)]['agents'][_0x446afd(0x1b5)]+_0x173ea2[_0x446afd(0x1fe)]['knowledgeBases'][_0x446afd(0x1b5)]+_0x173ea2['counts'][_0x446afd(0x195)][_0x446afd(0x1b5)]+_0x173ea2[_0x446afd(0x1fe)]['prompts'][_0x446afd(0x1b5)]+_0x173ea2[_0x446afd(0x1fe)]['integrations']['created']+_0x173ea2[_0x446afd(0x1fe)]['experimentalKnowledgeBases'][_0x446afd(0x1b5)]+_0x173ea2[_0x446afd(0x1fe)][_0x446afd(0x1f3)][_0x446afd(0x1b5)],_0x24bc54=_0x173ea2['counts'][_0x446afd(0x1a1)][_0x446afd(0x1c8)]+_0x173ea2['counts']['knowledgeBases'][_0x446afd(0x1c8)]+_0x173ea2[_0x446afd(0x1fe)]['textKnowledgeBases']['updated']+_0x173ea2[_0x446afd(0x1fe)][_0x446afd(0x1c4)]['updated']+_0x173ea2['counts'][_0x446afd(0x180)][_0x446afd(0x1c8)]+_0x173ea2['counts'][_0x446afd(0x1d0)][_0x446afd(0x1c8)]+_0x173ea2[_0x446afd(0x1fe)]['experimentalArtifacts']['updated'],_0x27c25c=_0x173ea2[_0x446afd(0x1fe)][_0x446afd(0x1a1)]['unchanged']+_0x173ea2[_0x446afd(0x1fe)][_0x446afd(0x1a8)]['unchanged']+_0x173ea2['counts'][_0x446afd(0x195)]['unchanged']+_0x173ea2[_0x446afd(0x1fe)][_0x446afd(0x1c4)][_0x446afd(0x1f0)]+_0x173ea2['counts'][_0x446afd(0x180)]['unchanged']+_0x173ea2[_0x446afd(0x1fe)][_0x446afd(0x1d0)][_0x446afd(0x1f0)]+_0x173ea2[_0x446afd(0x1fe)][_0x446afd(0x1f3)]['unchanged'];console[_0x446afd(0x1e8)](_0x446afd(0x1de)+_0x173ea2['projectName']+'\x27:'),console[_0x446afd(0x1e8)]('\x20\x20'+a4_0x5cb09d[_0x446afd(0x175)]('+\x20'+_0x13faac+_0x446afd(0x1c9))+'\x20|\x20'+a4_0x5cb09d[_0x446afd(0x176)]('~\x20'+_0x24bc54+_0x446afd(0x1df))+'\x20|\x20'+a4_0x5cb09d[_0x446afd(0x1b8)]('=\x20'+_0x27c25c+_0x446afd(0x189))),console[_0x446afd(0x1e8)](_0x446afd(0x1c7)+formatCountSummary(_0x173ea2[_0x446afd(0x1fe)][_0x446afd(0x1a1)])),console['log'](_0x446afd(0x179)+formatCountSummary(_0x173ea2[_0x446afd(0x1fe)]['knowledgeBases'])),console[_0x446afd(0x1e8)](_0x446afd(0x212)+formatCountSummary(_0x173ea2[_0x446afd(0x1fe)][_0x446afd(0x195)])),console[_0x446afd(0x1e8)](_0x446afd(0x1b7)+formatCountSummary(_0x173ea2['counts']['prompts'])),console[_0x446afd(0x1e8)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x173ea2[_0x446afd(0x1fe)][_0x446afd(0x180)]));const _0x4bfead=_0x173ea2[_0x446afd(0x1fe)][_0x446afd(0x1d0)][_0x446afd(0x1b5)]>0x0||_0x173ea2[_0x446afd(0x1fe)][_0x446afd(0x1d0)][_0x446afd(0x1c8)]>0x0||_0x173ea2[_0x446afd(0x1fe)][_0x446afd(0x1d0)][_0x446afd(0x1f0)]>0x0||_0x173ea2[_0x446afd(0x1fe)][_0x446afd(0x1f3)]['created']>0x0||_0x173ea2['counts'][_0x446afd(0x1f3)][_0x446afd(0x1c8)]>0x0||_0x173ea2[_0x446afd(0x1fe)][_0x446afd(0x1f3)]['unchanged']>0x0;_0x4bfead&&(console[_0x446afd(0x1e8)](_0x446afd(0x1b2)+formatCountSummary(_0x173ea2[_0x446afd(0x1fe)][_0x446afd(0x1d0)])),console['log'](_0x446afd(0x17f)+formatCountSummary(_0x173ea2[_0x446afd(0x1fe)]['experimentalArtifacts'])));console[_0x446afd(0x1e8)](_0x446afd(0x1f4)+a4_0x5cb09d[_0x446afd(0x1d5)](_0x347004)),displayDiffs(_0x173ea2['agents'],_0x173ea2[_0x446afd(0x1a8)],_0x173ea2['textKnowledgeBases'],_0x173ea2[_0x446afd(0x1c4)],_0x173ea2[_0x446afd(0x180)],_0x173ea2[_0x446afd(0x1d0)],_0x173ea2[_0x446afd(0x1f3)]);if(_0x152c50)return console[_0x446afd(0x1e8)](a4_0x5cb09d[_0x446afd(0x176)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x13faac===0x0&&_0x24bc54===0x0){console[_0x446afd(0x1e8)](a4_0x5cb09d['green']('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x55ed9f=getLLMProjectUrl(_0x3bdb5b,_0x173ea2[_0x446afd(0x1d6)]);return console[_0x446afd(0x1e8)](_0x446afd(0x164)+a4_0x5cb09d[_0x446afd(0x1d5)](_0x55ed9f)),0x0;}if(!_0x5e7756&&!_0x4d9d3d){if(!isInteractive())return console[_0x446afd(0x20e)](a4_0x5cb09d[_0x446afd(0x19c)](_0x446afd(0x1f8)),_0x446afd(0x1b4)),console['error'](a4_0x5cb09d[_0x446afd(0x1b8)](_0x446afd(0x16e))),0x1;const _0x43ce0e=await confirmKey(_0x446afd(0x210)+(_0x13faac+_0x24bc54)+_0x446afd(0x1aa));if(!_0x43ce0e)return console[_0x446afd(0x1e8)](a4_0x5cb09d['yellow']('Cancelled'),'-\x20nothing\x20pushed'),0x1;}const {data:_0x142574}=await withSpinner(_0x446afd(0x1f1),()=>_0x2ecf38['llm'][_0x446afd(0x197)](_0x347004,{'force':_0x4d9d3d})),_0x624bfc=_0x142574['counts'][_0x446afd(0x1a1)][_0x446afd(0x173)]>0x0||_0x142574[_0x446afd(0x1fe)][_0x446afd(0x1a8)][_0x446afd(0x173)]>0x0||_0x142574[_0x446afd(0x1fe)][_0x446afd(0x195)][_0x446afd(0x173)]>0x0||_0x142574['counts']['prompts']['errors']>0x0;if(_0x624bfc){console['log'](a4_0x5cb09d[_0x446afd(0x176)](_0x446afd(0x20c))),console[_0x446afd(0x1e8)](),console[_0x446afd(0x1e8)](a4_0x5cb09d[_0x446afd(0x19c)]('Errors:'));for(const _0x2fbefe of _0x142574[_0x446afd(0x1a1)]){_0x2fbefe[_0x446afd(0x1a7)]===_0x446afd(0x20e)&&console[_0x446afd(0x1e8)](a4_0x5cb09d['red'](_0x446afd(0x1ef)+_0x2fbefe[_0x446afd(0x1ea)]+_0x446afd(0x182)+_0x2fbefe['error']));}for(const _0x1d8e93 of _0x142574[_0x446afd(0x1a8)]){_0x1d8e93['action']===_0x446afd(0x20e)&&console[_0x446afd(0x1e8)](a4_0x5cb09d[_0x446afd(0x19c)](_0x446afd(0x187)+_0x1d8e93[_0x446afd(0x177)]+_0x446afd(0x182)+_0x1d8e93['error']));}for(const _0x119742 of _0x142574[_0x446afd(0x195)]){_0x119742[_0x446afd(0x1a7)]==='error'&&console[_0x446afd(0x1e8)](a4_0x5cb09d[_0x446afd(0x19c)](_0x446afd(0x1cb)+_0x119742[_0x446afd(0x177)]+_0x446afd(0x182)+_0x119742[_0x446afd(0x20e)]));}for(const _0x5dfa46 of _0x142574['prompts']){_0x5dfa46[_0x446afd(0x1a7)]===_0x446afd(0x20e)&&console[_0x446afd(0x1e8)](a4_0x5cb09d[_0x446afd(0x19c)](_0x446afd(0x19d)+_0x5dfa46['name']+_0x446afd(0x182)+_0x5dfa46[_0x446afd(0x20e)]));}for(const _0x13be78 of _0x142574[_0x446afd(0x180)]){_0x13be78[_0x446afd(0x1a7)]===_0x446afd(0x20e)&&console[_0x446afd(0x1e8)](a4_0x5cb09d[_0x446afd(0x19c)]('\x20\x20Integration\x20\x22'+_0x13be78[_0x446afd(0x177)]+_0x446afd(0x182)+_0x13be78[_0x446afd(0x20e)]));}return 0x1;}console[_0x446afd(0x1e8)](a4_0x5cb09d[_0x446afd(0x175)](_0x446afd(0x1bb)+(_0x13faac+_0x24bc54)+_0x446afd(0x1cf)+_0x142574['projectName']+'\x27'));const _0x498e92=getLLMProjectUrl(_0x3bdb5b,_0x142574['projectId']);return console[_0x446afd(0x1e8)](_0x446afd(0x164)+a4_0x5cb09d[_0x446afd(0x1d5)](_0x498e92)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x2958f6=a5_0x8ca9;(function(_0x1b9f33,_0x577250){const _0x593d16=a5_0x8ca9,_0x90de35=_0x1b9f33();while(!![]){try{const _0xf45779=-parseInt(_0x593d16(0x191))/0x1+-parseInt(_0x593d16(0x124))/0x2+parseInt(_0x593d16(0x14f))/0x3*(parseInt(_0x593d16(0x17e))/0x4)+-parseInt(_0x593d16(0x118))/0x5*(parseInt(_0x593d16(0x17d))/0x6)+-parseInt(_0x593d16(0x136))/0x7*(parseInt(_0x593d16(0x171))/0x8)+-parseInt(_0x593d16(0x1a1))/0x9+parseInt(_0x593d16(0x156))/0xa;if(_0xf45779===_0x577250)break;else _0x90de35['push'](_0x90de35['shift']());}catch(_0x2da4a4){_0x90de35['push'](_0x90de35['shift']());}}}(a5_0x2f42,0xae5bd));import*as a5_0x1a6314 from'node:fs';import*as a5_0x752b31 from'node:path';import a5_0x321ca3 from'chalk';function a5_0x8ca9(_0x388665,_0x49f0d8){_0x388665=_0x388665-0x118;const _0x2f421a=a5_0x2f42();let _0x8ca9b6=_0x2f421a[_0x388665];return _0x8ca9b6;}import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x2f42(){const _0xcbbfbd=['map','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Errors:\x20\x20\x20','resolve','Test\x20','No\x20tests\x20have\x20tags\x20defined.','Run\x20\x27tdx\x20agent\x20pull\x20','join','\x20-\x20','\x20\x20Round\x20','Project\x20path:\x20','log','no_local_folder','Test\x20Configuration:','message','yellow',':\x20Sending\x20user\x20input...','status','2840256LthOcg','no_context','Cached\x20run\x20from:\x20','add','conversation_url','site','cyan','16648680IHxYqF','✗\x20ERROR:\x20','Agent:\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Failed\x20Tests:','No\x20tests\x20found\x20with\x20tags:\x20','writeFileSync','\x27\x20to\x20create\x20the\x20folder\x20structure.','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','verbose','projectDir','Site:\x20','push','\x20\x20Conversation:\x20','no_tests','table','...','description','404','Total:\x20\x20\x20\x20','Test\x20Summary','utf-8','Error\x20writing\x20output\x20file:\x20','llmProject','basename','toISOString','resolveAgentId','8FSYTav','forEach','resolveProjectId','reason','toLowerCase','rounds','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Output\x20written\x20to:\x20','existsSync','Using\x20agent:\x20','Failed:\x20\x20\x20','Available\x20tests:\x20','9348EIybBK','4hknkiN','red','projectName','stop','text','Re-evaluating\x20','Round\x201/','No\x20tests\x20found\x20matching:\x20','round','start','\x20(new)','Passed:\x20\x20\x20','filter','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','tests','has','testYmlPath','Running\x20test:\x20','now','544214vgiVan','timestamp','FAIL','\x20\x20Project:\x20','Executing\x20new\x20tests...','ERROR','name','trim','find','Error:\x20No\x20previous\x20test\x20run\x20found.','Re-evaluating\x20cached\x20test\x20run...','repeat','agentName','Duration:\x20','Either\x20switch\x20to\x20the\x20\x22','found','2970054dvSuuO','Evaluating\x20response...','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','split','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','substring','agent','Available\x20tags:\x20','context','includes','llm','Re-evaluating...','840aRHVyP','Re-evaluation\x20Summary','json','Tests\x20found:\x20','PASS','multiple_agents','\x20\x20Agent:\x20','dim','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','...\x20','reeval','✓\x20PASS:\x20','522892UFHQih','executeReeval','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','dryRun','\x20(cached)','Usage:','\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','some','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','eval','Round\x20','white','execute','✗\x20FAIL:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Cached\x20run\x20is\x20from\x20site\x20\x22','green','tsv','3500259RGsmtF','New\x20tests\x20to\x20execute:\x20','length','\x20\x20Evaluating...\x20','not\x20found','tags','\x22,\x20but\x20current\x20site\x20is\x20\x22'];a5_0x2f42=function(){return _0xcbbfbd;};return a5_0x2f42();}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x2958f6(0x197)]='agent:test';[a5_0x2958f6(0x167)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x2958f6(0x130)](_0x1cfa23){const _0x221459=a5_0x2958f6,{options:_0x462362,args:_0x23ea38,tdx:_0x1ec023}=_0x1cfa23,_0x3b2f7d=_0x23ea38[0x0]||'.',_0x3f8bff=_0x462362[_0x221459(0x127)],_0x2632fc=_0x462362,_0x4de521=_0x2632fc[_0x221459(0x12d)]===![],_0xa62354=_0x2632fc[_0x221459(0x122)],_0x504054=_0x2632fc[_0x221459(0x197)],_0x4d27d7=_0x2632fc[_0x221459(0x13b)],_0x4a71b8=_0x462362[_0x221459(0x154)],_0x29b058=_0x2632fc['output'];if(_0xa62354&&_0x4de521)return console[_0x221459(0x148)](a5_0x321ca3['red'](_0x221459(0x15e))),0x1;let _0x41988e=_0x221459(0x165);if(_0x2632fc[_0x221459(0x11a)])_0x41988e=_0x221459(0x11a);else{if(_0x2632fc['jsonl'])_0x41988e='jsonl';else{if(_0x2632fc[_0x221459(0x135)])_0x41988e='tsv';else{if(_0x2632fc['table'])_0x41988e=_0x221459(0x165);}}}const _0x4d5a60=_0x2632fc[_0x221459(0x16d)];let _0x167aeb=_0x3b2f7d;const _0x2480bf=a5_0x1a6314[_0x221459(0x179)](_0x3b2f7d),_0x1d39ce=_0x3b2f7d==='.';if(!_0x2480bf||_0x1d39ce){const _0x4c2adc=resolveProjectFromContext(_0x3b2f7d,_0x4d5a60,{'requireFile':'test.yml'});if(_0x4c2adc[_0x221459(0x1a0)])_0x167aeb=_0x4c2adc['projectDir'],_0x4c2adc['source']===_0x221459(0x1a9)&&console['log'](a5_0x321ca3[_0x221459(0x11f)](_0x221459(0x17a)+_0x167aeb));else switch(_0x4c2adc['reason']){case _0x221459(0x150):console[_0x221459(0x148)](a5_0x321ca3[_0x221459(0x14c)](_0x4c2adc[_0x221459(0x14b)])),console[_0x221459(0x148)](),console[_0x221459(0x148)](_0x221459(0x129)),console[_0x221459(0x148)](_0x221459(0x12a)),console[_0x221459(0x148)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x221459(0x148)](),console[_0x221459(0x148)](_0x221459(0x1a5));return 0x1;case _0x221459(0x149):console[_0x221459(0x148)](a5_0x321ca3[_0x221459(0x14c)](_0x4c2adc[_0x221459(0x14b)])),console[_0x221459(0x148)](),console[_0x221459(0x148)](_0x221459(0x143)+_0x4c2adc[_0x221459(0x16d)]+_0x221459(0x15d));return 0x1;case _0x221459(0x11d):{const _0x268117=a5_0x752b31[_0x221459(0x16e)](_0x4c2adc[_0x221459(0x160)]);console[_0x221459(0x148)](a5_0x321ca3[_0x221459(0x14c)](_0x221459(0x12c)+_0x4c2adc[_0x221459(0x16d)]+'\x22:'));for(const _0x4d095d of _0x4c2adc['agentDirs']){console['log']('\x20\x20-\x20'+_0x4d095d);}return console[_0x221459(0x148)](),console[_0x221459(0x148)](_0x221459(0x18b)+_0x268117+'/<agent-name>'),0x1;}case _0x221459(0x164):console['log'](a5_0x321ca3['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x4c2adc['llmProject']+'\x22.')),console[_0x221459(0x148)](a5_0x321ca3[_0x221459(0x11f)](_0x221459(0x147)+_0x4c2adc[_0x221459(0x160)])),console[_0x221459(0x148)](),console[_0x221459(0x148)](_0x221459(0x126));return 0x1;}}const {definition:_0x1f144d,agentInfo:_0x206dfd}=parseTestFile(_0x167aeb);let _0x526b7f=_0x1f144d['tests'];if(_0x504054){const _0x36b839=_0x504054[_0x221459(0x1a4)](',')['map'](_0x220819=>_0x220819[_0x221459(0x198)]());_0x526b7f=_0x1f144d[_0x221459(0x18c)][_0x221459(0x18a)](_0x23121e=>_0x36b839[_0x221459(0x1aa)](_0x23121e[_0x221459(0x197)]));if(_0x526b7f[_0x221459(0x138)]===0x0)return console[_0x221459(0x148)](a5_0x321ca3['yellow'](_0x221459(0x185)+_0x504054)),console[_0x221459(0x148)](a5_0x321ca3[_0x221459(0x11f)](_0x221459(0x17c)+_0x1f144d[_0x221459(0x18c)][_0x221459(0x13d)](_0x2040ac=>_0x2040ac['name'])['join'](',\x20'))),0x1;}if(_0x4d27d7){const _0x3bd883=_0x4d27d7['split'](',')['map'](_0x202f0f=>_0x202f0f[_0x221459(0x198)]()[_0x221459(0x175)]());_0x526b7f=_0x526b7f[_0x221459(0x18a)](_0x367d03=>_0x367d03[_0x221459(0x13b)]?.[_0x221459(0x12b)](_0x607219=>_0x3bd883[_0x221459(0x1aa)](_0x607219[_0x221459(0x175)]())));if(_0x526b7f['length']===0x0){console[_0x221459(0x148)](a5_0x321ca3[_0x221459(0x14c)](_0x221459(0x15b)+_0x4d27d7));const _0x3e253c=new Set();return _0x1f144d['tests'][_0x221459(0x172)](_0x4ec23d=>_0x4ec23d[_0x221459(0x13b)]?.[_0x221459(0x172)](_0x526bc6=>_0x3e253c[_0x221459(0x152)](_0x526bc6))),_0x3e253c['size']>0x0?console[_0x221459(0x148)](a5_0x321ca3[_0x221459(0x11f)](_0x221459(0x1a8)+[..._0x3e253c][_0x221459(0x144)](',\x20'))):console[_0x221459(0x148)](a5_0x321ca3[_0x221459(0x11f)](_0x221459(0x142))),0x1;}}if(_0xa62354)return this['executeReeval'](_0x1cfa23,{'definition':{'tests':_0x526b7f},'agentInfo':_0x206dfd,'outputFormat':_0x41988e,'outputFile':_0x29b058,'testNames':_0x504054});if(_0x3f8bff){console[_0x221459(0x148)](a5_0x321ca3[_0x221459(0x155)](_0x221459(0x14a))),console[_0x221459(0x148)]('\x20\x20Site:\x20'+a5_0x321ca3[_0x221459(0x12f)](_0x4a71b8)),console[_0x221459(0x148)](_0x221459(0x194)+a5_0x321ca3[_0x221459(0x12f)](_0x206dfd[_0x221459(0x180)])),console[_0x221459(0x148)](_0x221459(0x11e)+a5_0x321ca3[_0x221459(0x12f)](_0x206dfd[_0x221459(0x19d)])),console[_0x221459(0x148)](),console[_0x221459(0x148)](_0x221459(0x11b)+a5_0x321ca3['white'](_0x526b7f[_0x221459(0x138)]));for(let _0x4217d0=0x0;_0x4217d0<_0x526b7f[_0x221459(0x138)];_0x4217d0++){const _0x4030ac=_0x526b7f[_0x4217d0],_0x43ac66=_0x4030ac[_0x221459(0x176)]['length']===0x1?_0x221459(0x186):'rounds',_0x4a4bb6=_0x4030ac[_0x221459(0x13b)]?.[_0x221459(0x138)]?'\x20['+_0x4030ac[_0x221459(0x13b)][_0x221459(0x144)](',\x20')+']':'';console[_0x221459(0x148)]('\x20\x20'+(_0x4217d0+0x1)+'.\x20'+a5_0x321ca3[_0x221459(0x12f)](_0x4030ac['name'])+'\x20('+_0x4030ac[_0x221459(0x176)]['length']+'\x20'+_0x43ac66+')'+a5_0x321ca3[_0x221459(0x11f)](_0x4a4bb6));}return 0x0;}let _0x4b2b79,_0x945196;try{_0x4b2b79=await _0x1ec023[_0x221459(0x1ab)][_0x221459(0x173)](_0x206dfd[_0x221459(0x180)]);}catch(_0xf4c60c){const _0x33415c=_0xf4c60c instanceof Error?_0xf4c60c[_0x221459(0x14b)]:String(_0xf4c60c);return _0x33415c[_0x221459(0x1aa)]('404')||_0x33415c[_0x221459(0x175)]()['includes'](_0x221459(0x13a))?console['log'](a5_0x321ca3['red']('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x206dfd[_0x221459(0x180)])):console[_0x221459(0x148)](a5_0x321ca3['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x206dfd[_0x221459(0x180)]+'\x22:\x20'+_0x33415c)),0x1;}try{_0x945196=await _0x1ec023[_0x221459(0x1ab)][_0x221459(0x170)](_0x206dfd['agentName'],_0x4b2b79);}catch(_0x1c46d0){const _0x301258=_0x1c46d0 instanceof Error?_0x1c46d0[_0x221459(0x14b)]:String(_0x1c46d0);return _0x301258[_0x221459(0x1aa)](_0x221459(0x168))||_0x301258[_0x221459(0x175)]()[_0x221459(0x1aa)](_0x221459(0x13a))?console[_0x221459(0x148)](a5_0x321ca3['red'](_0x221459(0x1a3)+_0x206dfd[_0x221459(0x19d)])):console[_0x221459(0x148)](a5_0x321ca3[_0x221459(0x17f)](_0x221459(0x13e)+_0x206dfd[_0x221459(0x19d)]+'\x22:\x20'+_0x301258)),0x1;}let _0x14a02f;if(!_0x4de521)try{_0x14a02f=await setupEvaluatorAgent(_0x1ec023['llm'],_0x462362['verbose']);}catch(_0x3f2f90){const _0x42e00e=_0x3f2f90 instanceof Error?_0x3f2f90['message']:String(_0x3f2f90);return console[_0x221459(0x148)](a5_0x321ca3[_0x221459(0x17f)](_0x221459(0x177)+_0x42e00e)),0x1;}console[_0x221459(0x148)](a5_0x321ca3[_0x221459(0x155)]('Running\x20agent\x20tests...')),console[_0x221459(0x148)](_0x221459(0x161)+a5_0x321ca3[_0x221459(0x12f)](_0x4a71b8)),console[_0x221459(0x148)](_0x221459(0x158)+a5_0x321ca3['white'](_0x206dfd['projectName']+'/'+_0x206dfd[_0x221459(0x19d)])),console[_0x221459(0x148)]();const _0x4bbaa9=[],_0x3127c6=[],_0x1b7ef3=Date[_0x221459(0x190)]();for(let _0x22191e=0x0;_0x22191e<_0x526b7f[_0x221459(0x138)];_0x22191e++){const _0x2da579=_0x526b7f[_0x22191e];_0x526b7f['length']>0x1?console[_0x221459(0x148)](_0x221459(0x141)+(_0x22191e+0x1)+'/'+_0x526b7f[_0x221459(0x138)]+':\x20'+a5_0x321ca3[_0x221459(0x12f)](_0x2da579[_0x221459(0x197)])):console[_0x221459(0x148)](_0x221459(0x18f)+a5_0x321ca3[_0x221459(0x12f)](_0x2da579[_0x221459(0x197)]));const _0x15ae7e=createCommandSpinner(_0x221459(0x184)+_0x2da579[_0x221459(0x176)][_0x221459(0x138)]+':\x20Sending\x20user\x20input...');_0x15ae7e[_0x221459(0x187)]();try{const {result:_0x4f5ea5,conversation:_0x2d7331}=await runTest(_0x1ec023['llm'],_0x2da579,{'agentId':_0x945196,'projectId':_0x4b2b79,'site':_0x4a71b8,'noEval':_0x4de521,'evaluatorId':_0x14a02f,'onRoundStart':(_0xbbc83,_0x4a00a7)=>{const _0x3f633b=_0x221459;_0x15ae7e[_0x3f633b(0x182)]=_0x3f633b(0x12e)+(_0xbbc83+0x1)+'/'+_0x4a00a7+_0x3f633b(0x14d);},'onRoundComplete':(_0x20afa7,_0x1adda3,_0x5a307a)=>{const _0x1fd033=_0x221459,_0x3bab20=formatElapsed(_0x1adda3);_0x5a307a?console[_0x1fd033(0x148)](_0x1fd033(0x146)+(_0x20afa7+0x1)+'/'+_0x2da579[_0x1fd033(0x176)][_0x1fd033(0x138)]+_0x1fd033(0x121)+a5_0x321ca3[_0x1fd033(0x134)]('✓')+'\x20('+_0x3bab20+')'):console['log'](_0x1fd033(0x146)+(_0x20afa7+0x1)+'/'+_0x2da579[_0x1fd033(0x176)][_0x1fd033(0x138)]+'...\x20'+a5_0x321ca3[_0x1fd033(0x17f)]('✗'));},'onEvaluationStart':()=>{_0x15ae7e['text']='Evaluating\x20response...';},'onEvaluationComplete':_0x2bfaca=>{const _0x1062a0=_0x221459,_0x1723d2=formatElapsed(_0x2bfaca);console['log'](_0x1062a0(0x139)+a5_0x321ca3[_0x1062a0(0x134)]('✓')+'\x20('+_0x1723d2+')');}});_0x15ae7e[_0x221459(0x181)](),_0x4bbaa9['push'](_0x4f5ea5),_0x3127c6[_0x221459(0x162)](_0x2d7331);if(_0x4f5ea5[_0x221459(0x14e)]===_0x221459(0x11c))console['log'](a5_0x321ca3[_0x221459(0x134)]('✓\x20PASS:\x20'+_0x4f5ea5[_0x221459(0x174)]));else _0x4f5ea5[_0x221459(0x14e)]===_0x221459(0x193)?console[_0x221459(0x148)](a5_0x321ca3[_0x221459(0x17f)](_0x221459(0x131)+_0x4f5ea5[_0x221459(0x174)])):console['log'](a5_0x321ca3[_0x221459(0x17f)](_0x221459(0x157)+_0x4f5ea5[_0x221459(0x174)]));_0x4f5ea5['conversation_url']&&console[_0x221459(0x148)](a5_0x321ca3[_0x221459(0x11f)]('Conversation\x20URL:\x20'+_0x4f5ea5[_0x221459(0x153)])),console[_0x221459(0x148)]();}catch(_0x3a29ea){_0x15ae7e[_0x221459(0x181)]();const _0xcaa7fb=_0x3a29ea instanceof Error?_0x3a29ea[_0x221459(0x14b)]:String(_0x3a29ea);console[_0x221459(0x148)](a5_0x321ca3[_0x221459(0x17f)]('✗\x20ERROR:\x20'+_0xcaa7fb)),console[_0x221459(0x148)](),_0x4bbaa9[_0x221459(0x162)]({'name':_0x2da579['name'],'status':_0x221459(0x196),'reason':_0xcaa7fb,'timestamp':new Date()[_0x221459(0x16f)](),'duration_ms':0x0});}}const _0x4fc4b6=Date[_0x221459(0x190)]()-_0x1b7ef3,_0x2a1dda=_0x4bbaa9['filter'](_0x3ff007=>_0x3ff007[_0x221459(0x14e)]===_0x221459(0x11c))[_0x221459(0x138)],_0x5929f7=_0x4bbaa9[_0x221459(0x18a)](_0x34b969=>_0x34b969[_0x221459(0x14e)]==='FAIL')[_0x221459(0x138)],_0x2781d5=_0x4bbaa9[_0x221459(0x18a)](_0x4141e6=>_0x4141e6['status']===_0x221459(0x196))[_0x221459(0x138)];console[_0x221459(0x148)]('━'[_0x221459(0x19c)](0x3c)),console[_0x221459(0x148)](_0x221459(0x16a)),console['log']('━'[_0x221459(0x19c)](0x3c)),console[_0x221459(0x148)](_0x221459(0x169)+_0x4bbaa9['length']),console[_0x221459(0x148)](_0x221459(0x189)+a5_0x321ca3[_0x221459(0x134)](_0x2a1dda)),console[_0x221459(0x148)](_0x221459(0x17b)+a5_0x321ca3[_0x221459(0x17f)](_0x5929f7));_0x2781d5>0x0&&console['log'](_0x221459(0x13f)+a5_0x321ca3[_0x221459(0x17f)](_0x2781d5));console[_0x221459(0x148)](_0x221459(0x19e)+formatElapsed(_0x4fc4b6)),console[_0x221459(0x148)]('━'[_0x221459(0x19c)](0x3c));const _0x5e0015=_0x4bbaa9['filter'](_0x5a1eda=>_0x5a1eda[_0x221459(0x14e)]!==_0x221459(0x11c));if(_0x5e0015[_0x221459(0x138)]>0x0){console[_0x221459(0x148)](),console[_0x221459(0x148)](_0x221459(0x15a));for(const _0xfc8098 of _0x5e0015){const _0x2d8a0e=a5_0x321ca3[_0x221459(0x17f)]('✗'),_0x340f90=_0xfc8098[_0x221459(0x174)]['length']>0x32?_0xfc8098[_0x221459(0x174)][_0x221459(0x1a6)](0x0,0x32)+'...':_0xfc8098['reason'];console['log']('\x20\x20'+_0x2d8a0e+'\x20'+_0xfc8098['name']+':\x20'+_0x340f90);}}const _0x542f8c={'summary':{'total':_0x4bbaa9['length'],'passed':_0x2a1dda,'failed':_0x5929f7,'errors':_0x2781d5>0x0?_0x2781d5:undefined,'duration_ms':_0x4fc4b6},'tests':_0x4bbaa9,'agent':{'project':_0x206dfd['projectName'],'name':_0x206dfd['agentName'],'site':_0x4a71b8},'timestamp':new Date(_0x1b7ef3)[_0x221459(0x16f)]()};try{const _0x5ce37c=buildCachedTestRun(_0x3127c6,{'site':_0x4a71b8,'projectId':_0x4b2b79,'projectName':_0x206dfd[_0x221459(0x180)],'agentId':_0x945196,'agentName':_0x206dfd[_0x221459(0x19d)],'testYmlPath':a5_0x752b31[_0x221459(0x140)](_0x206dfd[_0x221459(0x18e)])});saveLastTestRun(_0x5ce37c);}catch{}if(_0x41988e!==_0x221459(0x165)||_0x29b058){const _0x4f17b1=formatResults(_0x542f8c,_0x41988e);if(_0x29b058)try{a5_0x1a6314[_0x221459(0x15c)](_0x29b058,_0x4f17b1,'utf-8'),console[_0x221459(0x148)](),console[_0x221459(0x148)](a5_0x321ca3[_0x221459(0x11f)](_0x221459(0x178)+_0x29b058));}catch(_0x27be6b){return console[_0x221459(0x148)](),console[_0x221459(0x148)](a5_0x321ca3[_0x221459(0x17f)](_0x221459(0x16c)+_0x27be6b)),0x1;}else console['log'](),console[_0x221459(0x148)](_0x4f17b1);}return _0x5e0015[_0x221459(0x138)]>0x0?0x1:0x0;}async[a5_0x2958f6(0x125)](_0x21e438,_0x6d020f){const _0x3b2a22=a5_0x2958f6,{options:_0x45df70,tdx:_0x54030f}=_0x21e438,{definition:_0x3fc6a2,agentInfo:_0x352787,outputFormat:_0x28adca,outputFile:_0x1e25f2}=_0x6d020f,_0x3bf532=_0x45df70['site'],_0x43b1d6=loadLastTestRun();if(!_0x43b1d6)return console['log'](a5_0x321ca3[_0x3b2a22(0x17f)](_0x3b2a22(0x19a))),console[_0x3b2a22(0x148)](a5_0x321ca3[_0x3b2a22(0x11f)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x43b1d6[_0x3b2a22(0x1a7)]['agentName']!==_0x352787['agentName'])return console['log'](a5_0x321ca3['red'](_0x3b2a22(0x159)+_0x43b1d6[_0x3b2a22(0x1a7)][_0x3b2a22(0x19d)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x352787[_0x3b2a22(0x19d)]+'\x22.')),console[_0x3b2a22(0x148)](a5_0x321ca3[_0x3b2a22(0x11f)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x497bf3=new Set(_0x43b1d6['conversations'][_0x3b2a22(0x13d)](_0x189450=>_0x189450['testName'])),_0x23358b=_0x3fc6a2[_0x3b2a22(0x18c)][_0x3b2a22(0x18a)](_0x2633ee=>!_0x497bf3['has'](_0x2633ee['name']));if(_0x23358b['length']>0x0&&_0x43b1d6[_0x3b2a22(0x154)]!==_0x3bf532)return console[_0x3b2a22(0x148)](a5_0x321ca3['red'](_0x3b2a22(0x132))),console[_0x3b2a22(0x148)](a5_0x321ca3[_0x3b2a22(0x11f)](_0x3b2a22(0x133)+_0x43b1d6['site']+_0x3b2a22(0x13c)+_0x3bf532+'\x22.')),console[_0x3b2a22(0x148)](a5_0x321ca3[_0x3b2a22(0x11f)](_0x3b2a22(0x19f)+_0x43b1d6[_0x3b2a22(0x154)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x5ea87a=_0x3fc6a2[_0x3b2a22(0x18c)]['filter'](_0x562b5c=>_0x497bf3[_0x3b2a22(0x18d)](_0x562b5c[_0x3b2a22(0x197)])),_0x14b5e9=_0x23358b;let _0x4e2bca;try{_0x4e2bca=await setupEvaluatorAgent(_0x54030f['llm'],_0x45df70[_0x3b2a22(0x15f)]);}catch(_0x5773be){const _0x2bf446=_0x5773be instanceof Error?_0x5773be[_0x3b2a22(0x14b)]:String(_0x5773be);return console[_0x3b2a22(0x148)](a5_0x321ca3['red'](_0x3b2a22(0x177)+_0x2bf446)),0x1;}console[_0x3b2a22(0x148)](a5_0x321ca3['cyan'](_0x3b2a22(0x19b))),console[_0x3b2a22(0x148)](_0x3b2a22(0x151)+a5_0x321ca3[_0x3b2a22(0x12f)](_0x43b1d6[_0x3b2a22(0x192)])),console[_0x3b2a22(0x148)](_0x3b2a22(0x158)+a5_0x321ca3['white'](_0x43b1d6[_0x3b2a22(0x1a7)]['projectName']+'/'+_0x43b1d6[_0x3b2a22(0x1a7)][_0x3b2a22(0x19d)]));_0x14b5e9['length']>0x0&&console['log'](_0x3b2a22(0x137)+a5_0x321ca3['yellow'](_0x14b5e9[_0x3b2a22(0x138)]));console[_0x3b2a22(0x148)]();const _0x23e63c=[],_0x201127=Date['now'](),_0x344c95=createCommandSpinner(_0x3b2a22(0x1ac));if(_0x5ea87a[_0x3b2a22(0x138)]>0x0)try{const _0x38482c=await reevaluateFromCache(_0x54030f['llm'],_0x43b1d6,{'tests':_0x5ea87a},{'evaluatorId':_0x4e2bca,'onTestStart':(_0x11fac5,_0x1bf6df,_0x3ac801)=>{const _0x54ed12=_0x3b2a22;_0x344c95[_0x54ed12(0x182)]=_0x54ed12(0x183)+(_0x1bf6df+0x1)+'/'+_0x3ac801+':\x20'+_0x11fac5+_0x54ed12(0x166);if(!_0x344c95['isSpinning'])_0x344c95[_0x54ed12(0x187)]();},'onTestComplete':(_0x2a7841,_0x112ae5)=>{const _0x2fb8fc=_0x3b2a22;_0x344c95['stop']();if(_0x112ae5['status']==='PASS')console[_0x2fb8fc(0x148)](a5_0x321ca3[_0x2fb8fc(0x134)](_0x2fb8fc(0x123)+_0x2a7841)+a5_0x321ca3[_0x2fb8fc(0x11f)](_0x2fb8fc(0x128)));else _0x112ae5['status']===_0x2fb8fc(0x193)?console[_0x2fb8fc(0x148)](a5_0x321ca3[_0x2fb8fc(0x17f)](_0x2fb8fc(0x131)+_0x2a7841+_0x2fb8fc(0x145)+_0x112ae5['reason'])+a5_0x321ca3[_0x2fb8fc(0x11f)](_0x2fb8fc(0x128))):console['log'](a5_0x321ca3[_0x2fb8fc(0x17f)](_0x2fb8fc(0x157)+_0x2a7841+'\x20-\x20'+_0x112ae5[_0x2fb8fc(0x174)]));_0x112ae5['conversation_url']&&console[_0x2fb8fc(0x148)](a5_0x321ca3[_0x2fb8fc(0x11f)](_0x2fb8fc(0x163)+_0x112ae5[_0x2fb8fc(0x153)])),_0x23e63c[_0x2fb8fc(0x162)](_0x112ae5);},'onTestSkipped':(_0x2dde6d,_0x127f7a)=>{const _0x325455=_0x3b2a22;_0x344c95[_0x325455(0x181)](),console[_0x325455(0x148)](a5_0x321ca3[_0x325455(0x14c)]('⚠\x20SKIPPED:\x20'+_0x2dde6d+_0x325455(0x145)+_0x127f7a));}});for(const _0x57928a of _0x38482c){!_0x23e63c[_0x3b2a22(0x199)](_0x507b62=>_0x507b62[_0x3b2a22(0x197)]===_0x57928a[_0x3b2a22(0x197)])&&_0x23e63c[_0x3b2a22(0x162)](_0x57928a);}}catch(_0x58a71f){_0x344c95['stop']();const _0x729c22=_0x58a71f instanceof Error?_0x58a71f[_0x3b2a22(0x14b)]:String(_0x58a71f);return console[_0x3b2a22(0x148)](a5_0x321ca3[_0x3b2a22(0x17f)](_0x3b2a22(0x120)+_0x729c22)),0x1;}_0x344c95['stop']();if(_0x14b5e9['length']>0x0){console[_0x3b2a22(0x148)](),console['log'](a5_0x321ca3['cyan'](_0x3b2a22(0x195)));const {projectId:_0x2850f7,agentId:_0x1fa485}=_0x43b1d6[_0x3b2a22(0x1a7)];for(const _0x475b90 of _0x14b5e9){console[_0x3b2a22(0x148)]('Running:\x20'+a5_0x321ca3[_0x3b2a22(0x12f)](_0x475b90['name']));const _0x98da6=createCommandSpinner(_0x3b2a22(0x184)+_0x475b90['rounds']['length']+_0x3b2a22(0x14d));_0x98da6[_0x3b2a22(0x187)]();try{const {result:_0x5d851d}=await runTest(_0x54030f[_0x3b2a22(0x1ab)],_0x475b90,{'agentId':_0x1fa485,'projectId':_0x2850f7,'site':_0x43b1d6[_0x3b2a22(0x154)],'noEval':![],'evaluatorId':_0x4e2bca,'onRoundStart':(_0x3e160a,_0x30851f)=>{_0x98da6['text']='Round\x20'+(_0x3e160a+0x1)+'/'+_0x30851f+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x20eb27,_0x50b45c,_0x40fb32)=>{const _0x14e5d6=_0x3b2a22,_0x5a9ed8=formatElapsed(_0x50b45c);_0x40fb32?console['log'](_0x14e5d6(0x146)+(_0x20eb27+0x1)+'/'+_0x475b90[_0x14e5d6(0x176)][_0x14e5d6(0x138)]+_0x14e5d6(0x121)+a5_0x321ca3[_0x14e5d6(0x134)]('✓')+'\x20('+_0x5a9ed8+')'):console['log'](_0x14e5d6(0x146)+(_0x20eb27+0x1)+'/'+_0x475b90['rounds'][_0x14e5d6(0x138)]+_0x14e5d6(0x121)+a5_0x321ca3['red']('✗'));},'onEvaluationStart':()=>{const _0xf10911=_0x3b2a22;_0x98da6['text']=_0xf10911(0x1a2);},'onEvaluationComplete':_0xaf9b72=>{const _0x176c53=_0x3b2a22,_0x8838f=formatElapsed(_0xaf9b72);console[_0x176c53(0x148)]('\x20\x20Evaluating...\x20'+a5_0x321ca3[_0x176c53(0x134)]('✓')+'\x20('+_0x8838f+')');}});_0x98da6[_0x3b2a22(0x181)](),_0x23e63c[_0x3b2a22(0x162)](_0x5d851d);if(_0x5d851d[_0x3b2a22(0x14e)]===_0x3b2a22(0x11c))console['log'](a5_0x321ca3[_0x3b2a22(0x134)](_0x3b2a22(0x123)+_0x5d851d[_0x3b2a22(0x174)])+a5_0x321ca3[_0x3b2a22(0x11f)](_0x3b2a22(0x188)));else _0x5d851d[_0x3b2a22(0x14e)]===_0x3b2a22(0x193)?console[_0x3b2a22(0x148)](a5_0x321ca3[_0x3b2a22(0x17f)](_0x3b2a22(0x131)+_0x5d851d[_0x3b2a22(0x174)])+a5_0x321ca3['dim']('\x20(new)')):console[_0x3b2a22(0x148)](a5_0x321ca3[_0x3b2a22(0x17f)](_0x3b2a22(0x157)+_0x5d851d[_0x3b2a22(0x174)]));_0x5d851d[_0x3b2a22(0x153)]&&console[_0x3b2a22(0x148)](a5_0x321ca3[_0x3b2a22(0x11f)](_0x3b2a22(0x163)+_0x5d851d[_0x3b2a22(0x153)]));}catch(_0x5e0cb6){_0x98da6[_0x3b2a22(0x181)]();const _0x4e570e=_0x5e0cb6 instanceof Error?_0x5e0cb6[_0x3b2a22(0x14b)]:String(_0x5e0cb6);console['log'](a5_0x321ca3['red']('✗\x20ERROR:\x20'+_0x4e570e)),_0x23e63c[_0x3b2a22(0x162)]({'name':_0x475b90[_0x3b2a22(0x197)],'status':_0x3b2a22(0x196),'reason':_0x4e570e,'timestamp':new Date()[_0x3b2a22(0x16f)](),'duration_ms':0x0});}}}console['log']();const _0xd9208e=Date['now']()-_0x201127,_0x5aa7ee=_0x23e63c[_0x3b2a22(0x18a)](_0x2c96ee=>_0x2c96ee[_0x3b2a22(0x14e)]===_0x3b2a22(0x11c))[_0x3b2a22(0x138)],_0x2de535=_0x23e63c['filter'](_0x43ee10=>_0x43ee10[_0x3b2a22(0x14e)]===_0x3b2a22(0x193))[_0x3b2a22(0x138)],_0x19097c=_0x23e63c[_0x3b2a22(0x18a)](_0x2b34aa=>_0x2b34aa[_0x3b2a22(0x14e)]===_0x3b2a22(0x196))['length'];console[_0x3b2a22(0x148)]('━'[_0x3b2a22(0x19c)](0x3c)),console[_0x3b2a22(0x148)](_0x3b2a22(0x119)),console['log']('━'[_0x3b2a22(0x19c)](0x3c)),console[_0x3b2a22(0x148)](_0x3b2a22(0x169)+_0x23e63c[_0x3b2a22(0x138)]),console[_0x3b2a22(0x148)](_0x3b2a22(0x189)+a5_0x321ca3[_0x3b2a22(0x134)](_0x5aa7ee)),console['log'](_0x3b2a22(0x17b)+a5_0x321ca3[_0x3b2a22(0x17f)](_0x2de535));_0x19097c>0x0&&console[_0x3b2a22(0x148)](_0x3b2a22(0x13f)+a5_0x321ca3[_0x3b2a22(0x17f)](_0x19097c));console[_0x3b2a22(0x148)](_0x3b2a22(0x19e)+formatElapsed(_0xd9208e)),console[_0x3b2a22(0x148)]('━'[_0x3b2a22(0x19c)](0x3c));const _0x345600={'summary':{'total':_0x23e63c[_0x3b2a22(0x138)],'passed':_0x5aa7ee,'failed':_0x2de535,'errors':_0x19097c>0x0?_0x19097c:undefined,'duration_ms':_0xd9208e},'tests':_0x23e63c,'agent':{'project':_0x352787[_0x3b2a22(0x180)],'name':_0x352787[_0x3b2a22(0x19d)],'site':_0x3bf532},'timestamp':new Date(_0x201127)[_0x3b2a22(0x16f)]()};if(_0x28adca!=='table'||_0x1e25f2){const _0x4dd910=formatResults(_0x345600,_0x28adca);if(_0x1e25f2)try{a5_0x1a6314[_0x3b2a22(0x15c)](_0x1e25f2,_0x4dd910,_0x3b2a22(0x16b)),console[_0x3b2a22(0x148)](),console[_0x3b2a22(0x148)](a5_0x321ca3[_0x3b2a22(0x11f)](_0x3b2a22(0x178)+_0x1e25f2));}catch(_0x38d774){return console[_0x3b2a22(0x148)](),console[_0x3b2a22(0x148)](a5_0x321ca3[_0x3b2a22(0x17f)](_0x3b2a22(0x16c)+_0x38d774)),0x1;}else console[_0x3b2a22(0x148)](),console['log'](_0x4dd910);}const _0x1a6576=_0x23e63c[_0x3b2a22(0x18a)](_0x17f17c=>_0x17f17c[_0x3b2a22(0x14e)]!=='PASS');return _0x1a6576[_0x3b2a22(0x138)]>0x0?0x1:0x0;}}
1
+ const a5_0x4e1a0a=a5_0x3aa5;(function(_0xbcf55f,_0x11ef20){const _0x5b1086=a5_0x3aa5,_0x4fd6fc=_0xbcf55f();while(!![]){try{const _0x2f6331=parseInt(_0x5b1086(0xa2))/0x1+-parseInt(_0x5b1086(0xb6))/0x2+parseInt(_0x5b1086(0xd2))/0x3*(-parseInt(_0x5b1086(0xbb))/0x4)+parseInt(_0x5b1086(0xad))/0x5*(-parseInt(_0x5b1086(0x121))/0x6)+-parseInt(_0x5b1086(0x12c))/0x7*(-parseInt(_0x5b1086(0xfa))/0x8)+-parseInt(_0x5b1086(0xc9))/0x9+-parseInt(_0x5b1086(0xa7))/0xa*(-parseInt(_0x5b1086(0xef))/0xb);if(_0x2f6331===_0x11ef20)break;else _0x4fd6fc['push'](_0x4fd6fc['shift']());}catch(_0x192f9f){_0x4fd6fc['push'](_0x4fd6fc['shift']());}}}(a5_0x5005,0x8ad39));import*as a5_0x4bc8b3 from'node:fs';import*as a5_0x50bac5 from'node:path';import a5_0x1ce49f from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x5005(){const _0x3163eb=['\x20-\x20','Available\x20tests:\x20','765JSsjdl','✗\x20FAIL:\x20','dryRun','Site:\x20','conversation_url','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','forEach','Errors:\x20\x20\x20','resolveAgentId','1838312BnSQxl','execute','name','Round\x201/','...','349828eujiOX','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Project\x20path:\x20',':\x20Sending\x20user\x20input...','Total:\x20\x20\x20\x20','\x20\x20Agent:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','filter','Either\x20switch\x20to\x20the\x20\x22','llm','no_local_folder','output','not\x20found','8324649bSLyAr','timestamp','Run\x20tests\x20for\x20an\x20LLM\x20agent','\x20\x20Project:\x20','dim','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','conversations','Running\x20agent\x20tests...','found','33fxQsVe','message','Evaluating\x20response...','\x20\x20Evaluating...\x20','Passed:\x20\x20\x20','\x20\x20Round\x20','/<agent-name>','isSpinning','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','has','\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','toLowerCase','trim','multiple_agents','no_tests','executeReeval','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','split','stop','rounds','red','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','\x20(new)','cyan','white','tests','No\x20tests\x20found\x20with\x20tags:\x20','Available\x20tags:\x20','3014VJCFaF','Error:\x20No\x20previous\x20test\x20run\x20found.','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','json','Agent:\x20','\x20\x20Site:\x20','resolve','\x27\x20to\x20create\x20the\x20folder\x20structure.','status','substring','\x22:\x20','8lOSFRY','\x22,\x20but\x20current\x20site\x20is\x20\x22','toISOString','projectDir','...\x20','projectName','PASS','tags','✓\x20PASS:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','agentDirs','Test\x20Summary','start','No\x20tests\x20have\x20tags\x20defined.','\x20\x20-\x20','utf-8','site','Re-evaluation\x20Summary','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Conversation\x20URL:\x20','Re-evaluating\x20','round','ERROR','source','Run\x20\x27tdx\x20agent\x20pull\x20','agent','includes','push','Running:\x20','Error\x20writing\x20output\x20file:\x20','now','text','join','reason','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','some','green','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','17454LPIOrI','✗\x20ERROR:\x20','Running\x20test:\x20','log','jsonl','agentName','Tests\x20found:\x20','test.yml','writeFileSync','Using\x20agent:\x20','FAIL','6809453jUiNmU','\x20\x20Conversation:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Output\x20written\x20to:\x20','Cached\x20run\x20from:\x20','Test\x20','verbose','No\x20tests\x20found\x20matching:\x20','agent:test','Executing\x20new\x20tests...','resolveProjectId','table','map','llmProject','972093BIJwGx','Failed\x20Tests:','yellow','tsv','\x20(cached)','68430NczEtc','repeat','size','length'];a5_0x5005=function(){return _0x3163eb;};return a5_0x5005();}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x3aa5(_0x5369cc,_0x1f9c5d){_0x5369cc=_0x5369cc-0x9f;const _0x500592=a5_0x5005();let _0x3aa523=_0x500592[_0x5369cc];return _0x3aa523;}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x4e1a0a(0xb8)]=a5_0x4e1a0a(0x134);['description']=a5_0x4e1a0a(0xcb);async[a5_0x4e1a0a(0xb7)](_0x1d91c9){const _0x266eac=a5_0x4e1a0a,{options:_0xa47d3b,args:_0x1f0c39,tdx:_0x3b8b29}=_0x1d91c9,_0x35c93f=_0x1f0c39[0x0]||'.',_0x7d4231=_0xa47d3b[_0x266eac(0xaf)],_0x3b63d7=_0xa47d3b,_0x15c6cd=_0x3b63d7['eval']===![],_0x1fddcb=_0x3b63d7['reeval'],_0x1d7bd4=_0x3b63d7[_0x266eac(0xb8)],_0x392a99=_0x3b63d7[_0x266eac(0x101)],_0x1000f8=_0xa47d3b[_0x266eac(0x10a)],_0xa3e5ec=_0x3b63d7[_0x266eac(0xc7)];if(_0x1fddcb&&_0x15c6cd)return console[_0x266eac(0x124)](a5_0x1ce49f[_0x266eac(0xe7)](_0x266eac(0xe8))),0x1;let _0x24dd84=_0x266eac(0x9f);if(_0x3b63d7[_0x266eac(0xf2)])_0x24dd84=_0x266eac(0xf2);else{if(_0x3b63d7['jsonl'])_0x24dd84=_0x266eac(0x125);else{if(_0x3b63d7[_0x266eac(0xa5)])_0x24dd84=_0x266eac(0xa5);else{if(_0x3b63d7[_0x266eac(0x9f)])_0x24dd84=_0x266eac(0x9f);}}}const _0x199bbb=_0x3b63d7[_0x266eac(0xa1)];let _0x3322d6=_0x35c93f;const _0x5b8987=a5_0x4bc8b3['existsSync'](_0x35c93f),_0x10fd47=_0x35c93f==='.';if(!_0x5b8987||_0x10fd47){const _0x3711f4=resolveProjectFromContext(_0x35c93f,_0x199bbb,{'requireFile':_0x266eac(0x128)});if(_0x3711f4[_0x266eac(0xd1)])_0x3322d6=_0x3711f4[_0x266eac(0xfd)],_0x3711f4[_0x266eac(0x111)]==='context'&&console[_0x266eac(0x124)](a5_0x1ce49f[_0x266eac(0xcd)](_0x266eac(0x12a)+_0x3322d6));else switch(_0x3711f4['reason']){case'no_context':console[_0x266eac(0x124)](a5_0x1ce49f['yellow'](_0x3711f4[_0x266eac(0xd3)])),console['log'](),console[_0x266eac(0x124)]('Usage:'),console['log'](_0x266eac(0xdc)),console[_0x266eac(0x124)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x266eac(0x124)](),console[_0x266eac(0x124)](_0x266eac(0x11f));return 0x1;case _0x266eac(0xc6):console[_0x266eac(0x124)](a5_0x1ce49f['yellow'](_0x3711f4[_0x266eac(0xd3)])),console[_0x266eac(0x124)](),console[_0x266eac(0x124)](_0x266eac(0x112)+_0x3711f4[_0x266eac(0xa1)]+_0x266eac(0xf6));return 0x1;case _0x266eac(0xdf):{const _0x4a14d2=a5_0x50bac5['basename'](_0x3711f4[_0x266eac(0xfd)]);console[_0x266eac(0x124)](a5_0x1ce49f[_0x266eac(0xa4)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x3711f4[_0x266eac(0xa1)]+'\x22:'));for(const _0x4fe398 of _0x3711f4[_0x266eac(0x104)]){console[_0x266eac(0x124)](_0x266eac(0x108)+_0x4fe398);}return console[_0x266eac(0x124)](),console['log'](_0x266eac(0xc2)+_0x4a14d2+_0x266eac(0xd8)),0x1;}case _0x266eac(0xe0):console['log'](a5_0x1ce49f['yellow'](_0x266eac(0xce)+_0x3711f4[_0x266eac(0xa1)]+'\x22.')),console['log'](a5_0x1ce49f[_0x266eac(0xcd)](_0x266eac(0xbd)+_0x3711f4[_0x266eac(0xfd)])),console['log'](),console[_0x266eac(0x124)](_0x266eac(0xbc));return 0x1;}}const {definition:_0x262f72,agentInfo:_0x320f1f}=parseTestFile(_0x3322d6);let _0x5d41fc=_0x262f72['tests'];if(_0x1d7bd4){const _0x5e4860=_0x1d7bd4[_0x266eac(0xe4)](',')[_0x266eac(0xa0)](_0x547ca9=>_0x547ca9[_0x266eac(0xde)]());_0x5d41fc=_0x262f72[_0x266eac(0xec)][_0x266eac(0xc3)](_0x25bfc0=>_0x5e4860[_0x266eac(0x114)](_0x25bfc0[_0x266eac(0xb8)]));if(_0x5d41fc[_0x266eac(0xaa)]===0x0)return console[_0x266eac(0x124)](a5_0x1ce49f[_0x266eac(0xa4)](_0x266eac(0x133)+_0x1d7bd4)),console[_0x266eac(0x124)](a5_0x1ce49f[_0x266eac(0xcd)](_0x266eac(0xac)+_0x262f72[_0x266eac(0xec)][_0x266eac(0xa0)](_0x4226be=>_0x4226be[_0x266eac(0xb8)])[_0x266eac(0x11a)](',\x20'))),0x1;}if(_0x392a99){const _0x22376e=_0x392a99[_0x266eac(0xe4)](',')['map'](_0x5703a7=>_0x5703a7[_0x266eac(0xde)]()[_0x266eac(0xdd)]());_0x5d41fc=_0x5d41fc[_0x266eac(0xc3)](_0x5c5f06=>_0x5c5f06[_0x266eac(0x101)]?.[_0x266eac(0x11d)](_0xbf6736=>_0x22376e['includes'](_0xbf6736[_0x266eac(0xdd)]())));if(_0x5d41fc[_0x266eac(0xaa)]===0x0){console[_0x266eac(0x124)](a5_0x1ce49f[_0x266eac(0xa4)](_0x266eac(0xed)+_0x392a99));const _0x54c0a2=new Set();return _0x262f72['tests'][_0x266eac(0xb3)](_0x60745=>_0x60745[_0x266eac(0x101)]?.[_0x266eac(0xb3)](_0x56d167=>_0x54c0a2['add'](_0x56d167))),_0x54c0a2[_0x266eac(0xa9)]>0x0?console[_0x266eac(0x124)](a5_0x1ce49f[_0x266eac(0xcd)](_0x266eac(0xee)+[..._0x54c0a2]['join'](',\x20'))):console['log'](a5_0x1ce49f[_0x266eac(0xcd)](_0x266eac(0x107))),0x1;}}if(_0x1fddcb)return this['executeReeval'](_0x1d91c9,{'definition':{'tests':_0x5d41fc},'agentInfo':_0x320f1f,'outputFormat':_0x24dd84,'outputFile':_0xa3e5ec,'testNames':_0x1d7bd4});if(_0x7d4231){console[_0x266eac(0x124)](a5_0x1ce49f[_0x266eac(0xea)]('Test\x20Configuration:')),console[_0x266eac(0x124)](_0x266eac(0xf4)+a5_0x1ce49f[_0x266eac(0xeb)](_0x1000f8)),console[_0x266eac(0x124)](_0x266eac(0xcc)+a5_0x1ce49f[_0x266eac(0xeb)](_0x320f1f[_0x266eac(0xff)])),console[_0x266eac(0x124)](_0x266eac(0xc0)+a5_0x1ce49f[_0x266eac(0xeb)](_0x320f1f[_0x266eac(0x126)])),console[_0x266eac(0x124)](),console[_0x266eac(0x124)](_0x266eac(0x127)+a5_0x1ce49f['white'](_0x5d41fc[_0x266eac(0xaa)]));for(let _0x1dd30d=0x0;_0x1dd30d<_0x5d41fc[_0x266eac(0xaa)];_0x1dd30d++){const _0xb9c724=_0x5d41fc[_0x1dd30d],_0x573c2b=_0xb9c724[_0x266eac(0xe6)][_0x266eac(0xaa)]===0x1?_0x266eac(0x10f):_0x266eac(0xe6),_0xd95764=_0xb9c724[_0x266eac(0x101)]?.[_0x266eac(0xaa)]?'\x20['+_0xb9c724['tags'][_0x266eac(0x11a)](',\x20')+']':'';console[_0x266eac(0x124)]('\x20\x20'+(_0x1dd30d+0x1)+'.\x20'+a5_0x1ce49f[_0x266eac(0xeb)](_0xb9c724[_0x266eac(0xb8)])+'\x20('+_0xb9c724['rounds']['length']+'\x20'+_0x573c2b+')'+a5_0x1ce49f[_0x266eac(0xcd)](_0xd95764));}return 0x0;}let _0x5c9a0c,_0x105823;try{_0x5c9a0c=await _0x3b8b29['llm'][_0x266eac(0x136)](_0x320f1f['projectName']);}catch(_0x4ce660){const _0x42cf5d=_0x4ce660 instanceof Error?_0x4ce660['message']:String(_0x4ce660);return _0x42cf5d[_0x266eac(0x114)]('404')||_0x42cf5d[_0x266eac(0xdd)]()['includes'](_0x266eac(0xc8))?console[_0x266eac(0x124)](a5_0x1ce49f[_0x266eac(0xe7)](_0x266eac(0x103)+_0x320f1f[_0x266eac(0xff)])):console[_0x266eac(0x124)](a5_0x1ce49f[_0x266eac(0xe7)](_0x266eac(0xf1)+_0x320f1f[_0x266eac(0xff)]+_0x266eac(0xf9)+_0x42cf5d)),0x1;}try{_0x105823=await _0x3b8b29[_0x266eac(0xc5)][_0x266eac(0xb5)](_0x320f1f[_0x266eac(0x126)],_0x5c9a0c);}catch(_0x50e9f3){const _0x913588=_0x50e9f3 instanceof Error?_0x50e9f3[_0x266eac(0xd3)]:String(_0x50e9f3);return _0x913588[_0x266eac(0x114)]('404')||_0x913588[_0x266eac(0xdd)]()[_0x266eac(0x114)](_0x266eac(0xc8))?console[_0x266eac(0x124)](a5_0x1ce49f[_0x266eac(0xe7)](_0x266eac(0xc1)+_0x320f1f['agentName'])):console['log'](a5_0x1ce49f[_0x266eac(0xe7)](_0x266eac(0xe3)+_0x320f1f[_0x266eac(0x126)]+_0x266eac(0xf9)+_0x913588)),0x1;}let _0x382f39;if(!_0x15c6cd)try{_0x382f39=await setupEvaluatorAgent(_0x3b8b29[_0x266eac(0xc5)],_0xa47d3b[_0x266eac(0x132)]);}catch(_0x19aa34){const _0x2f37a2=_0x19aa34 instanceof Error?_0x19aa34[_0x266eac(0xd3)]:String(_0x19aa34);return console[_0x266eac(0x124)](a5_0x1ce49f[_0x266eac(0xe7)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x2f37a2)),0x1;}console[_0x266eac(0x124)](a5_0x1ce49f['cyan'](_0x266eac(0xd0))),console[_0x266eac(0x124)](_0x266eac(0xb0)+a5_0x1ce49f['white'](_0x1000f8)),console[_0x266eac(0x124)](_0x266eac(0xf3)+a5_0x1ce49f[_0x266eac(0xeb)](_0x320f1f[_0x266eac(0xff)]+'/'+_0x320f1f['agentName'])),console[_0x266eac(0x124)]();const _0xf7eb9d=[],_0x1d8298=[],_0x258146=Date[_0x266eac(0x118)]();for(let _0x2211c2=0x0;_0x2211c2<_0x5d41fc[_0x266eac(0xaa)];_0x2211c2++){const _0x4a1bce=_0x5d41fc[_0x2211c2];_0x5d41fc[_0x266eac(0xaa)]>0x1?console[_0x266eac(0x124)](_0x266eac(0x131)+(_0x2211c2+0x1)+'/'+_0x5d41fc[_0x266eac(0xaa)]+':\x20'+a5_0x1ce49f[_0x266eac(0xeb)](_0x4a1bce['name'])):console[_0x266eac(0x124)](_0x266eac(0x123)+a5_0x1ce49f[_0x266eac(0xeb)](_0x4a1bce[_0x266eac(0xb8)]));const _0x5736a6=createCommandSpinner(_0x266eac(0xb9)+_0x4a1bce['rounds'][_0x266eac(0xaa)]+_0x266eac(0xbe));_0x5736a6[_0x266eac(0x106)]();try{const {result:_0x6f3812,conversation:_0x4472b0}=await runTest(_0x3b8b29['llm'],_0x4a1bce,{'agentId':_0x105823,'projectId':_0x5c9a0c,'site':_0x1000f8,'noEval':_0x15c6cd,'evaluatorId':_0x382f39,'onRoundStart':(_0x3a8a55,_0x1da8f6)=>{_0x5736a6['text']='Round\x20'+(_0x3a8a55+0x1)+'/'+_0x1da8f6+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x51f5bf,_0x1d1925,_0x2cc0ba)=>{const _0x4dbd00=_0x266eac,_0x6d4b27=formatElapsed(_0x1d1925);_0x2cc0ba?console[_0x4dbd00(0x124)](_0x4dbd00(0xd7)+(_0x51f5bf+0x1)+'/'+_0x4a1bce[_0x4dbd00(0xe6)]['length']+_0x4dbd00(0xfe)+a5_0x1ce49f[_0x4dbd00(0x11e)]('✓')+'\x20('+_0x6d4b27+')'):console[_0x4dbd00(0x124)](_0x4dbd00(0xd7)+(_0x51f5bf+0x1)+'/'+_0x4a1bce[_0x4dbd00(0xe6)]['length']+_0x4dbd00(0xfe)+a5_0x1ce49f[_0x4dbd00(0xe7)]('✗'));},'onEvaluationStart':()=>{const _0x1a6f6a=_0x266eac;_0x5736a6[_0x1a6f6a(0x119)]=_0x1a6f6a(0xd4);},'onEvaluationComplete':_0x42db9a=>{const _0x127de2=_0x266eac,_0x33cefa=formatElapsed(_0x42db9a);console[_0x127de2(0x124)](_0x127de2(0xd5)+a5_0x1ce49f['green']('✓')+'\x20('+_0x33cefa+')');}});_0x5736a6[_0x266eac(0xe5)](),_0xf7eb9d['push'](_0x6f3812),_0x1d8298['push'](_0x4472b0);if(_0x6f3812['status']===_0x266eac(0x100))console['log'](a5_0x1ce49f[_0x266eac(0x11e)]('✓\x20PASS:\x20'+_0x6f3812[_0x266eac(0x11b)]));else _0x6f3812[_0x266eac(0xf7)]===_0x266eac(0x12b)?console[_0x266eac(0x124)](a5_0x1ce49f['red'](_0x266eac(0xae)+_0x6f3812[_0x266eac(0x11b)])):console[_0x266eac(0x124)](a5_0x1ce49f[_0x266eac(0xe7)](_0x266eac(0x122)+_0x6f3812[_0x266eac(0x11b)]));_0x6f3812[_0x266eac(0xb1)]&&console['log'](a5_0x1ce49f[_0x266eac(0xcd)](_0x266eac(0x10d)+_0x6f3812[_0x266eac(0xb1)])),console[_0x266eac(0x124)]();}catch(_0x3e661e){_0x5736a6[_0x266eac(0xe5)]();const _0x3e46aa=_0x3e661e instanceof Error?_0x3e661e[_0x266eac(0xd3)]:String(_0x3e661e);console[_0x266eac(0x124)](a5_0x1ce49f['red'](_0x266eac(0x122)+_0x3e46aa)),console[_0x266eac(0x124)](),_0xf7eb9d[_0x266eac(0x115)]({'name':_0x4a1bce[_0x266eac(0xb8)],'status':_0x266eac(0x110),'reason':_0x3e46aa,'timestamp':new Date()[_0x266eac(0xfc)](),'duration_ms':0x0});}}const _0x1da88b=Date[_0x266eac(0x118)]()-_0x258146,_0xb7b9dd=_0xf7eb9d[_0x266eac(0xc3)](_0x5261b6=>_0x5261b6[_0x266eac(0xf7)]===_0x266eac(0x100))[_0x266eac(0xaa)],_0x3f9a31=_0xf7eb9d['filter'](_0x3a4ce3=>_0x3a4ce3['status']===_0x266eac(0x12b))[_0x266eac(0xaa)],_0x3a22d7=_0xf7eb9d['filter'](_0x52b7d0=>_0x52b7d0[_0x266eac(0xf7)]===_0x266eac(0x110))[_0x266eac(0xaa)];console[_0x266eac(0x124)]('━'[_0x266eac(0xa8)](0x3c)),console['log'](_0x266eac(0x105)),console[_0x266eac(0x124)]('━'[_0x266eac(0xa8)](0x3c)),console['log'](_0x266eac(0xbf)+_0xf7eb9d[_0x266eac(0xaa)]),console[_0x266eac(0x124)](_0x266eac(0xd6)+a5_0x1ce49f[_0x266eac(0x11e)](_0xb7b9dd)),console[_0x266eac(0x124)]('Failed:\x20\x20\x20'+a5_0x1ce49f[_0x266eac(0xe7)](_0x3f9a31));_0x3a22d7>0x0&&console[_0x266eac(0x124)](_0x266eac(0xb4)+a5_0x1ce49f['red'](_0x3a22d7));console[_0x266eac(0x124)]('Duration:\x20'+formatElapsed(_0x1da88b)),console[_0x266eac(0x124)]('━'[_0x266eac(0xa8)](0x3c));const _0xfe931=_0xf7eb9d[_0x266eac(0xc3)](_0x49812e=>_0x49812e[_0x266eac(0xf7)]!==_0x266eac(0x100));if(_0xfe931[_0x266eac(0xaa)]>0x0){console['log'](),console[_0x266eac(0x124)](_0x266eac(0xa3));for(const _0x321261 of _0xfe931){const _0x1bd947=a5_0x1ce49f['red']('✗'),_0x487249=_0x321261[_0x266eac(0x11b)][_0x266eac(0xaa)]>0x32?_0x321261[_0x266eac(0x11b)][_0x266eac(0xf8)](0x0,0x32)+_0x266eac(0xba):_0x321261[_0x266eac(0x11b)];console[_0x266eac(0x124)]('\x20\x20'+_0x1bd947+'\x20'+_0x321261['name']+':\x20'+_0x487249);}}const _0x12b57a={'summary':{'total':_0xf7eb9d[_0x266eac(0xaa)],'passed':_0xb7b9dd,'failed':_0x3f9a31,'errors':_0x3a22d7>0x0?_0x3a22d7:undefined,'duration_ms':_0x1da88b},'tests':_0xf7eb9d,'agent':{'project':_0x320f1f[_0x266eac(0xff)],'name':_0x320f1f[_0x266eac(0x126)],'site':_0x1000f8},'timestamp':new Date(_0x258146)[_0x266eac(0xfc)]()};try{const _0x4b7a26=buildCachedTestRun(_0x1d8298,{'site':_0x1000f8,'projectId':_0x5c9a0c,'projectName':_0x320f1f['projectName'],'agentId':_0x105823,'agentName':_0x320f1f[_0x266eac(0x126)],'testYmlPath':a5_0x50bac5[_0x266eac(0xf5)](_0x320f1f['testYmlPath'])});saveLastTestRun(_0x4b7a26);}catch{}if(_0x24dd84!==_0x266eac(0x9f)||_0xa3e5ec){const _0xa6732e=formatResults(_0x12b57a,_0x24dd84);if(_0xa3e5ec)try{a5_0x4bc8b3[_0x266eac(0x129)](_0xa3e5ec,_0xa6732e,_0x266eac(0x109)),console['log'](),console[_0x266eac(0x124)](a5_0x1ce49f[_0x266eac(0xcd)](_0x266eac(0x12f)+_0xa3e5ec));}catch(_0x30a211){return console['log'](),console[_0x266eac(0x124)](a5_0x1ce49f[_0x266eac(0xe7)](_0x266eac(0x117)+_0x30a211)),0x1;}else console[_0x266eac(0x124)](),console[_0x266eac(0x124)](_0xa6732e);}return _0xfe931['length']>0x0?0x1:0x0;}async[a5_0x4e1a0a(0xe1)](_0x5c8cfb,_0x586a0a){const _0xaaaf70=a5_0x4e1a0a,{options:_0x3ee2c1,tdx:_0x4e1db7}=_0x5c8cfb,{definition:_0x2d4706,agentInfo:_0x1f6b0c,outputFormat:_0x2728c1,outputFile:_0xb880bd}=_0x586a0a,_0x171d8d=_0x3ee2c1[_0xaaaf70(0x10a)],_0x1291f1=loadLastTestRun();if(!_0x1291f1)return console[_0xaaaf70(0x124)](a5_0x1ce49f[_0xaaaf70(0xe7)](_0xaaaf70(0xf0))),console[_0xaaaf70(0x124)](a5_0x1ce49f['dim'](_0xaaaf70(0x12e))),0x1;if(_0x1291f1['agent'][_0xaaaf70(0x126)]!==_0x1f6b0c[_0xaaaf70(0x126)])return console[_0xaaaf70(0x124)](a5_0x1ce49f[_0xaaaf70(0xe7)](_0xaaaf70(0x120)+_0x1291f1[_0xaaaf70(0x113)][_0xaaaf70(0x126)]+_0xaaaf70(0xda)+_0x1f6b0c[_0xaaaf70(0x126)]+'\x22.')),console[_0xaaaf70(0x124)](a5_0x1ce49f[_0xaaaf70(0xcd)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x4abaca=new Set(_0x1291f1[_0xaaaf70(0xcf)][_0xaaaf70(0xa0)](_0x1f632e=>_0x1f632e['testName'])),_0x3e391f=_0x2d4706[_0xaaaf70(0xec)]['filter'](_0x389c48=>!_0x4abaca[_0xaaaf70(0xdb)](_0x389c48[_0xaaaf70(0xb8)]));if(_0x3e391f[_0xaaaf70(0xaa)]>0x0&&_0x1291f1['site']!==_0x171d8d)return console[_0xaaaf70(0x124)](a5_0x1ce49f[_0xaaaf70(0xe7)](_0xaaaf70(0x10c))),console['log'](a5_0x1ce49f['dim']('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x1291f1[_0xaaaf70(0x10a)]+_0xaaaf70(0xfb)+_0x171d8d+'\x22.')),console[_0xaaaf70(0x124)](a5_0x1ce49f['dim'](_0xaaaf70(0xc4)+_0x1291f1[_0xaaaf70(0x10a)]+_0xaaaf70(0xe2))),0x1;const _0x1a1071=_0x2d4706['tests'][_0xaaaf70(0xc3)](_0x5ed418=>_0x4abaca[_0xaaaf70(0xdb)](_0x5ed418['name'])),_0x3302a0=_0x3e391f;let _0x471cf8;try{_0x471cf8=await setupEvaluatorAgent(_0x4e1db7['llm'],_0x3ee2c1['verbose']);}catch(_0x501129){const _0x59de5c=_0x501129 instanceof Error?_0x501129[_0xaaaf70(0xd3)]:String(_0x501129);return console[_0xaaaf70(0x124)](a5_0x1ce49f['red'](_0xaaaf70(0x11c)+_0x59de5c)),0x1;}console[_0xaaaf70(0x124)](a5_0x1ce49f[_0xaaaf70(0xea)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0xaaaf70(0x124)](_0xaaaf70(0x130)+a5_0x1ce49f[_0xaaaf70(0xeb)](_0x1291f1[_0xaaaf70(0xca)])),console[_0xaaaf70(0x124)](_0xaaaf70(0xf3)+a5_0x1ce49f[_0xaaaf70(0xeb)](_0x1291f1[_0xaaaf70(0x113)]['projectName']+'/'+_0x1291f1[_0xaaaf70(0x113)][_0xaaaf70(0x126)]));_0x3302a0[_0xaaaf70(0xaa)]>0x0&&console[_0xaaaf70(0x124)]('New\x20tests\x20to\x20execute:\x20'+a5_0x1ce49f['yellow'](_0x3302a0[_0xaaaf70(0xaa)]));console[_0xaaaf70(0x124)]();const _0xf9d3a3=[],_0x4b0c83=Date['now'](),_0x18d2a7=createCommandSpinner('Re-evaluating...');if(_0x1a1071[_0xaaaf70(0xaa)]>0x0)try{const _0x47e0c3=await reevaluateFromCache(_0x4e1db7['llm'],_0x1291f1,{'tests':_0x1a1071},{'evaluatorId':_0x471cf8,'onTestStart':(_0x2fc405,_0x25bc28,_0x3f08df)=>{const _0x8b28ea=_0xaaaf70;_0x18d2a7[_0x8b28ea(0x119)]=_0x8b28ea(0x10e)+(_0x25bc28+0x1)+'/'+_0x3f08df+':\x20'+_0x2fc405+_0x8b28ea(0xba);if(!_0x18d2a7[_0x8b28ea(0xd9)])_0x18d2a7[_0x8b28ea(0x106)]();},'onTestComplete':(_0x38dccd,_0x11a583)=>{const _0x2eab91=_0xaaaf70;_0x18d2a7[_0x2eab91(0xe5)]();if(_0x11a583[_0x2eab91(0xf7)]===_0x2eab91(0x100))console[_0x2eab91(0x124)](a5_0x1ce49f[_0x2eab91(0x11e)](_0x2eab91(0x102)+_0x38dccd)+a5_0x1ce49f[_0x2eab91(0xcd)](_0x2eab91(0xa6)));else _0x11a583[_0x2eab91(0xf7)]===_0x2eab91(0x12b)?console[_0x2eab91(0x124)](a5_0x1ce49f[_0x2eab91(0xe7)](_0x2eab91(0xae)+_0x38dccd+_0x2eab91(0xab)+_0x11a583[_0x2eab91(0x11b)])+a5_0x1ce49f[_0x2eab91(0xcd)](_0x2eab91(0xa6))):console[_0x2eab91(0x124)](a5_0x1ce49f[_0x2eab91(0xe7)](_0x2eab91(0x122)+_0x38dccd+'\x20-\x20'+_0x11a583['reason']));_0x11a583[_0x2eab91(0xb1)]&&console['log'](a5_0x1ce49f[_0x2eab91(0xcd)]('\x20\x20Conversation:\x20'+_0x11a583[_0x2eab91(0xb1)])),_0xf9d3a3[_0x2eab91(0x115)](_0x11a583);},'onTestSkipped':(_0x314727,_0x521288)=>{const _0x3199f1=_0xaaaf70;_0x18d2a7[_0x3199f1(0xe5)](),console[_0x3199f1(0x124)](a5_0x1ce49f[_0x3199f1(0xa4)]('⚠\x20SKIPPED:\x20'+_0x314727+_0x3199f1(0xab)+_0x521288));}});for(const _0x5edb99 of _0x47e0c3){!_0xf9d3a3['find'](_0x4e079a=>_0x4e079a[_0xaaaf70(0xb8)]===_0x5edb99[_0xaaaf70(0xb8)])&&_0xf9d3a3[_0xaaaf70(0x115)](_0x5edb99);}}catch(_0x201289){_0x18d2a7[_0xaaaf70(0xe5)]();const _0x3ed6e1=_0x201289 instanceof Error?_0x201289['message']:String(_0x201289);return console[_0xaaaf70(0x124)](a5_0x1ce49f[_0xaaaf70(0xe7)](_0xaaaf70(0xb2)+_0x3ed6e1)),0x1;}_0x18d2a7['stop']();if(_0x3302a0[_0xaaaf70(0xaa)]>0x0){console[_0xaaaf70(0x124)](),console[_0xaaaf70(0x124)](a5_0x1ce49f[_0xaaaf70(0xea)](_0xaaaf70(0x135)));const {projectId:_0x10b329,agentId:_0x9ede95}=_0x1291f1[_0xaaaf70(0x113)];for(const _0x3aca8d of _0x3302a0){console[_0xaaaf70(0x124)](_0xaaaf70(0x116)+a5_0x1ce49f[_0xaaaf70(0xeb)](_0x3aca8d['name']));const _0x2b2ace=createCommandSpinner(_0xaaaf70(0xb9)+_0x3aca8d[_0xaaaf70(0xe6)][_0xaaaf70(0xaa)]+_0xaaaf70(0xbe));_0x2b2ace['start']();try{const {result:_0x4c4423}=await runTest(_0x4e1db7['llm'],_0x3aca8d,{'agentId':_0x9ede95,'projectId':_0x10b329,'site':_0x1291f1[_0xaaaf70(0x10a)],'noEval':![],'evaluatorId':_0x471cf8,'onRoundStart':(_0xa7f31e,_0x709ac9)=>{const _0xae978e=_0xaaaf70;_0x2b2ace['text']='Round\x20'+(_0xa7f31e+0x1)+'/'+_0x709ac9+_0xae978e(0xbe);},'onRoundComplete':(_0x37c3da,_0x439871,_0x331e3a)=>{const _0x50c387=_0xaaaf70,_0x4233b3=formatElapsed(_0x439871);_0x331e3a?console[_0x50c387(0x124)](_0x50c387(0xd7)+(_0x37c3da+0x1)+'/'+_0x3aca8d[_0x50c387(0xe6)][_0x50c387(0xaa)]+_0x50c387(0xfe)+a5_0x1ce49f['green']('✓')+'\x20('+_0x4233b3+')'):console['log'](_0x50c387(0xd7)+(_0x37c3da+0x1)+'/'+_0x3aca8d[_0x50c387(0xe6)][_0x50c387(0xaa)]+_0x50c387(0xfe)+a5_0x1ce49f[_0x50c387(0xe7)]('✗'));},'onEvaluationStart':()=>{const _0x5be554=_0xaaaf70;_0x2b2ace[_0x5be554(0x119)]=_0x5be554(0xd4);},'onEvaluationComplete':_0x2cffe3=>{const _0x39c10f=_0xaaaf70,_0x4743c2=formatElapsed(_0x2cffe3);console[_0x39c10f(0x124)](_0x39c10f(0xd5)+a5_0x1ce49f[_0x39c10f(0x11e)]('✓')+'\x20('+_0x4743c2+')');}});_0x2b2ace['stop'](),_0xf9d3a3[_0xaaaf70(0x115)](_0x4c4423);if(_0x4c4423[_0xaaaf70(0xf7)]===_0xaaaf70(0x100))console['log'](a5_0x1ce49f['green'](_0xaaaf70(0x102)+_0x4c4423[_0xaaaf70(0x11b)])+a5_0x1ce49f['dim'](_0xaaaf70(0xe9)));else _0x4c4423['status']===_0xaaaf70(0x12b)?console[_0xaaaf70(0x124)](a5_0x1ce49f[_0xaaaf70(0xe7)](_0xaaaf70(0xae)+_0x4c4423[_0xaaaf70(0x11b)])+a5_0x1ce49f['dim'](_0xaaaf70(0xe9))):console[_0xaaaf70(0x124)](a5_0x1ce49f['red']('✗\x20ERROR:\x20'+_0x4c4423[_0xaaaf70(0x11b)]));_0x4c4423[_0xaaaf70(0xb1)]&&console[_0xaaaf70(0x124)](a5_0x1ce49f[_0xaaaf70(0xcd)](_0xaaaf70(0x12d)+_0x4c4423[_0xaaaf70(0xb1)]));}catch(_0x2ced56){_0x2b2ace[_0xaaaf70(0xe5)]();const _0x3fc921=_0x2ced56 instanceof Error?_0x2ced56[_0xaaaf70(0xd3)]:String(_0x2ced56);console['log'](a5_0x1ce49f['red'](_0xaaaf70(0x122)+_0x3fc921)),_0xf9d3a3['push']({'name':_0x3aca8d[_0xaaaf70(0xb8)],'status':_0xaaaf70(0x110),'reason':_0x3fc921,'timestamp':new Date()[_0xaaaf70(0xfc)](),'duration_ms':0x0});}}}console[_0xaaaf70(0x124)]();const _0x2f5466=Date[_0xaaaf70(0x118)]()-_0x4b0c83,_0x96edce=_0xf9d3a3['filter'](_0xbf6cab=>_0xbf6cab['status']==='PASS')[_0xaaaf70(0xaa)],_0x45098a=_0xf9d3a3[_0xaaaf70(0xc3)](_0x13ca2e=>_0x13ca2e[_0xaaaf70(0xf7)]===_0xaaaf70(0x12b))[_0xaaaf70(0xaa)],_0x18664f=_0xf9d3a3[_0xaaaf70(0xc3)](_0x88895f=>_0x88895f[_0xaaaf70(0xf7)]==='ERROR')['length'];console['log']('━'[_0xaaaf70(0xa8)](0x3c)),console[_0xaaaf70(0x124)](_0xaaaf70(0x10b)),console[_0xaaaf70(0x124)]('━'[_0xaaaf70(0xa8)](0x3c)),console['log'](_0xaaaf70(0xbf)+_0xf9d3a3['length']),console[_0xaaaf70(0x124)](_0xaaaf70(0xd6)+a5_0x1ce49f[_0xaaaf70(0x11e)](_0x96edce)),console[_0xaaaf70(0x124)]('Failed:\x20\x20\x20'+a5_0x1ce49f['red'](_0x45098a));_0x18664f>0x0&&console[_0xaaaf70(0x124)](_0xaaaf70(0xb4)+a5_0x1ce49f[_0xaaaf70(0xe7)](_0x18664f));console['log']('Duration:\x20'+formatElapsed(_0x2f5466)),console[_0xaaaf70(0x124)]('━'[_0xaaaf70(0xa8)](0x3c));const _0x2b2191={'summary':{'total':_0xf9d3a3[_0xaaaf70(0xaa)],'passed':_0x96edce,'failed':_0x45098a,'errors':_0x18664f>0x0?_0x18664f:undefined,'duration_ms':_0x2f5466},'tests':_0xf9d3a3,'agent':{'project':_0x1f6b0c[_0xaaaf70(0xff)],'name':_0x1f6b0c[_0xaaaf70(0x126)],'site':_0x171d8d},'timestamp':new Date(_0x4b0c83)['toISOString']()};if(_0x2728c1!==_0xaaaf70(0x9f)||_0xb880bd){const _0x24ed4e=formatResults(_0x2b2191,_0x2728c1);if(_0xb880bd)try{a5_0x4bc8b3[_0xaaaf70(0x129)](_0xb880bd,_0x24ed4e,'utf-8'),console[_0xaaaf70(0x124)](),console['log'](a5_0x1ce49f[_0xaaaf70(0xcd)](_0xaaaf70(0x12f)+_0xb880bd));}catch(_0x21836a){return console[_0xaaaf70(0x124)](),console[_0xaaaf70(0x124)](a5_0x1ce49f['red'](_0xaaaf70(0x117)+_0x21836a)),0x1;}else console['log'](),console[_0xaaaf70(0x124)](_0x24ed4e);}const _0x53619f=_0xf9d3a3[_0xaaaf70(0xc3)](_0x29c655=>_0x29c655[_0xaaaf70(0xf7)]!==_0xaaaf70(0x100));return _0x53619f[_0xaaaf70(0xaa)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x122688=a6_0x3b85;(function(_0xaca65,_0x25f811){const _0x279dfb=a6_0x3b85,_0xdcab0c=_0xaca65();while(!![]){try{const _0xa952e3=parseInt(_0x279dfb(0x17c))/0x1+parseInt(_0x279dfb(0x1ad))/0x2+-parseInt(_0x279dfb(0x175))/0x3+parseInt(_0x279dfb(0x1ac))/0x4*(parseInt(_0x279dfb(0x1ab))/0x5)+parseInt(_0x279dfb(0x17b))/0x6*(-parseInt(_0x279dfb(0x172))/0x7)+parseInt(_0x279dfb(0x1a3))/0x8*(-parseInt(_0x279dfb(0x17e))/0x9)+parseInt(_0x279dfb(0x199))/0xa*(-parseInt(_0x279dfb(0x1ae))/0xb);if(_0xa952e3===_0x25f811)break;else _0xdcab0c['push'](_0xdcab0c['shift']());}catch(_0xe82c6e){_0xdcab0c['push'](_0xdcab0c['shift']());}}}(a6_0x3393,0xa0fb8));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a6_0x3393(){const _0x25da3b=['Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','GET','length','Results\x20saved\x20to\x20','log','message','Invalid\x20HTTP\x20method:\x20','llm-proxy','site','DELETE','Invalid\x20header\x20format:\x20\x22','api','Error:\x20','validate','verbose','10390UeCEFU','type','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','PATCH','description','stack','Endpoint\x20must\x20start\x20with\x20/:\x20','Invalid\x20API\x20type:\x20','entries','error','304LyyvCh','PUT','join','\x22.\x20','proxy-authorization','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','substring','indexOf','19985NxNPur','592wauDZo','2325792BzeOrg','1177ZsBgTj','set-cookie2','\x0aStack\x20trace:\x0a','keys','status','cookie','toLowerCase','color','includes','name','header','497PAWxjr','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','output','1677405qSeicG','.\x20Valid\x20methods:\x20','toUpperCase','isArray','x-xsrf-token','x-trino-user','70980acqAuN','630212HDAeqB','body','50931LlTCav','execute','.\x20Valid\x20types:\x20','workflow','method','set-cookie','data','has','cdp','file','x-auth-token','headers'];a6_0x3393=function(){return _0x25da3b;};return a6_0x3393();}import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';function a6_0x3b85(_0x1678b5,_0x383e2f){_0x1678b5=_0x1678b5-0x172;const _0x3393e6=a6_0x3393();let _0x3b853e=_0x3393e6[_0x1678b5];return _0x3b853e;}const SENSITIVE_HEADERS=new Set(['authorization',a6_0x122688(0x1a7),a6_0x122688(0x1b3),a6_0x122688(0x183),a6_0x122688(0x1af),a6_0x122688(0x179),a6_0x122688(0x188),a6_0x122688(0x17a)]);function isSensitiveHeader(_0x147765){const _0x118dd9=a6_0x122688;return SENSITIVE_HEADERS[_0x118dd9(0x185)](_0x147765[_0x118dd9(0x1b4)]());}function parseHeader(_0x573058){const _0x5d8e2b=a6_0x122688,_0x175410=_0x573058[_0x5d8e2b(0x1aa)](':');if(_0x175410===-0x1)throw new Error(_0x5d8e2b(0x194)+_0x573058+_0x5d8e2b(0x1a6)+_0x5d8e2b(0x18a));const _0x57d58b=_0x573058[_0x5d8e2b(0x1a9)](0x0,_0x175410)['trim'](),_0x4660fd=_0x573058[_0x5d8e2b(0x1a9)](_0x175410+0x1)['trim']();if(!_0x57d58b)throw new Error(_0x5d8e2b(0x1a8)+_0x573058+'\x22');return[_0x57d58b,_0x4660fd];}export class ApiCommand extends BaseCommand{[a6_0x122688(0x1b7)]=a6_0x122688(0x195);[a6_0x122688(0x19d)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x122688(0x197)](_0x450a51){const _0x45312d=a6_0x122688,{args:_0x475bb3,options:_0x5a5d1f}=_0x450a51,_0x2c9df2=_0x5a5d1f;if(_0x475bb3[_0x45312d(0x18c)]===0x0)return _0x45312d(0x173);const _0x2674e3=_0x475bb3[0x0];if(!_0x2674e3['startsWith']('/'))return _0x45312d(0x19f)+_0x2674e3;const _0x34ae24=_0x2c9df2[_0x45312d(0x184)],_0x522c5f=_0x2c9df2[_0x45312d(0x187)];if(_0x34ae24&&_0x522c5f)return _0x45312d(0x19b);const _0x243174=_0x2c9df2[_0x45312d(0x182)]||_0x45312d(0x18b),_0x1439f4=[_0x45312d(0x18b),'POST',_0x45312d(0x1a4),_0x45312d(0x193),_0x45312d(0x19c)];if(!_0x1439f4[_0x45312d(0x1b6)](_0x243174['toUpperCase']()))return _0x45312d(0x190)+_0x243174+_0x45312d(0x176)+_0x1439f4['join'](',\x20');const _0x2cf6de=_0x2c9df2[_0x45312d(0x19a)]||'td',_0x4585ab=['td',_0x45312d(0x186),_0x45312d(0x181),'trino','llm',_0x45312d(0x191),'cas'];if(!_0x4585ab[_0x45312d(0x1b6)](_0x2cf6de))return _0x45312d(0x1a0)+_0x2cf6de+_0x45312d(0x180)+_0x4585ab[_0x45312d(0x1a5)](',\x20');return undefined;}async[a6_0x122688(0x17f)](_0x3d07d7){const _0x170511=a6_0x122688,{options:_0x22c9f9,args:_0x293d75,tdx:_0x49cd6b}=_0x3d07d7,_0x1c8d24=_0x22c9f9,_0x215135=_0x293d75[0x0],_0x5e061c=(_0x1c8d24['method']||_0x170511(0x18b))[_0x170511(0x177)](),_0x35df94=_0x1c8d24[_0x170511(0x184)],_0x43bf1b=_0x1c8d24[_0x170511(0x187)],_0x5a4498=_0x1c8d24[_0x170511(0x1b8)],_0x1590e9=_0x1c8d24[_0x170511(0x19a)]||'td';try{const _0x383648={};if(_0x5a4498){const _0x4f381f=Array[_0x170511(0x178)](_0x5a4498)?_0x5a4498:[_0x5a4498];for(const _0xa87b6b of _0x4f381f){const [_0x2a75c5,_0xcd21c1]=parseHeader(_0xa87b6b);_0x383648[_0x2a75c5]=_0xcd21c1;}}let _0xcea3ac;if(_0x35df94)_0xcea3ac=_0x35df94;else{if(_0x43bf1b)try{_0xcea3ac=RawAPI['readBodyFromFile'](_0x43bf1b);}catch(_0x1f6a08){return console[_0x170511(0x1a2)]('Error:\x20'+(_0x1f6a08 instanceof Error?_0x1f6a08[_0x170511(0x18f)]:String(_0x1f6a08))),0x1;}}const _0x2e2916={'method':_0x5e061c,'apiType':_0x1590e9,'includeHeaders':_0x22c9f9[_0x170511(0x198)]};_0xcea3ac&&(_0x2e2916[_0x170511(0x17d)]=_0xcea3ac);Object[_0x170511(0x1b1)](_0x383648)['length']>0x0&&(_0x2e2916[_0x170511(0x189)]=_0x383648);if(_0x22c9f9[_0x170511(0x198)]){const _0x1fc65e=resolveSite(_0x22c9f9[_0x170511(0x192)]),_0xd64492=getEndpoint(_0x1fc65e,_0x1590e9),_0x27fc9c=''+_0xd64492+_0x215135;console[_0x170511(0x1a2)]('>\x20'+_0x5e061c+'\x20'+_0x27fc9c);const _0x1d8ba1=getAuthHeaders(_0x1fc65e),_0x189244={..._0x1d8ba1,..._0x383648};for(const [_0x29090b,_0x45395c]of Object[_0x170511(0x1a1)](_0x189244)){!isSensitiveHeader(_0x29090b)&&console[_0x170511(0x1a2)]('>\x20'+_0x29090b+':\x20'+_0x45395c);}_0xcea3ac&&console[_0x170511(0x1a2)]('>'),console[_0x170511(0x1a2)]('');}const _0x354ec3=await _0x49cd6b[_0x170511(0x195)]['request'](_0x215135,_0x2e2916);if(_0x22c9f9[_0x170511(0x198)]&&_0x354ec3['headers']){console[_0x170511(0x1a2)]('<\x20HTTP/1.1\x20'+_0x354ec3[_0x170511(0x1b2)]);for(const [_0x18193a,_0xa3d230]of Object[_0x170511(0x1a1)](_0x354ec3[_0x170511(0x189)])){!isSensitiveHeader(_0x18193a)&&console['error']('<\x20'+_0x18193a+':\x20'+_0xa3d230);}console[_0x170511(0x1a2)]('');}const _0x38fb85=Boolean(_0x22c9f9[_0x170511(0x174)]),_0x38c634={'color':_0x22c9f9[_0x170511(0x1b5)],'noColor':_0x22c9f9['noColor']||_0x38fb85&&!_0x22c9f9[_0x170511(0x1b5)]},_0x4f1822=colorizeJSON(_0x354ec3[_0x170511(0x184)],_0x38c634);return _0x22c9f9[_0x170511(0x174)]?(writeFileSync(_0x22c9f9[_0x170511(0x174)],_0x4f1822),console[_0x170511(0x1a2)](_0x170511(0x18d)+_0x22c9f9[_0x170511(0x174)])):console[_0x170511(0x18e)](_0x4f1822),0x0;}catch(_0x2a245b){return _0x2a245b instanceof Error?(console[_0x170511(0x1a2)](_0x170511(0x196)+_0x2a245b['message']),_0x22c9f9[_0x170511(0x198)]&&_0x2a245b[_0x170511(0x19e)]&&console[_0x170511(0x1a2)](_0x170511(0x1b0)+_0x2a245b['stack'])):console[_0x170511(0x1a2)](_0x170511(0x196)+String(_0x2a245b)),0x1;}}}
1
+ const a6_0x2d2280=a6_0x48e6;function a6_0x85b3(){const _0x6a1a60=['authorization','\x0aStack\x20trace:\x0a','length','method','data','header','trim','has','395554EvpFqS','1949941uOWRLP','x-trino-user','stack','color','DELETE','site','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','error','entries','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','llm','Invalid\x20HTTP\x20method:\x20','26036440qDDMPO','validate','file','cookie','join','keys','24vVtYTn','message','PATCH','Results\x20saved\x20to\x20','status','Invalid\x20header\x20format:\x20\x22','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','cas','x-auth-token','llm-proxy','Invalid\x20API\x20type:\x20','GET','<\x20HTTP/1.1\x20','includes','toLowerCase','3423796pyxxeG','name','Error:\x20','Endpoint\x20must\x20start\x20with\x20/:\x20','.\x20Valid\x20types:\x20','execute','noColor','body','toUpperCase','request','30YdxpzM','210111icRZmc','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','13358502ThXwcY','startsWith','\x22.\x20','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','trino','PUT','verbose','workflow','type','304188zJyawy','description','isArray','6OtrLFg','set-cookie','set-cookie2','headers','substring','output','log','proxy-authorization','x-xsrf-token'];a6_0x85b3=function(){return _0x6a1a60;};return a6_0x85b3();}(function(_0x5a89c0,_0x4c40d4){const _0x411671=a6_0x48e6,_0xc72d13=_0x5a89c0();while(!![]){try{const _0x22e47a=-parseInt(_0x411671(0x1c0))/0x1+parseInt(_0x411671(0x1af))/0x2*(-parseInt(_0x411671(0x1ed))/0x3)+-parseInt(_0x411671(0x1e2))/0x4+-parseInt(_0x411671(0x1ec))/0x5*(-parseInt(_0x411671(0x1ac))/0x6)+-parseInt(_0x411671(0x1c1))/0x7*(-parseInt(_0x411671(0x1d3))/0x8)+-parseInt(_0x411671(0x1ef))/0x9+parseInt(_0x411671(0x1cd))/0xa;if(_0x22e47a===_0x4c40d4)break;else _0xc72d13['push'](_0xc72d13['shift']());}catch(_0x59531c){_0xc72d13['push'](_0xc72d13['shift']());}}}(a6_0x85b3,0xc2bbd));function a6_0x48e6(_0x159186,_0x5912b7){_0x159186=_0x159186-0x1aa;const _0x85b3a6=a6_0x85b3();let _0x48e6da=_0x85b3a6[_0x159186];return _0x48e6da;}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_0x2d2280(0x1b8),a6_0x2d2280(0x1b6),a6_0x2d2280(0x1d0),a6_0x2d2280(0x1b0),a6_0x2d2280(0x1b1),a6_0x2d2280(0x1b7),a6_0x2d2280(0x1db),a6_0x2d2280(0x1c2)]);function isSensitiveHeader(_0x5dcb6a){const _0x4b5949=a6_0x2d2280;return SENSITIVE_HEADERS[_0x4b5949(0x1bf)](_0x5dcb6a[_0x4b5949(0x1e1)]());}function parseHeader(_0x259a1d){const _0xd1cf48=a6_0x2d2280,_0x3e5d8f=_0x259a1d['indexOf'](':');if(_0x3e5d8f===-0x1)throw new Error(_0xd1cf48(0x1d8)+_0x259a1d+_0xd1cf48(0x1f1)+_0xd1cf48(0x1ca));const _0x16e877=_0x259a1d[_0xd1cf48(0x1b3)](0x0,_0x3e5d8f)[_0xd1cf48(0x1be)](),_0x328850=_0x259a1d[_0xd1cf48(0x1b3)](_0x3e5d8f+0x1)[_0xd1cf48(0x1be)]();if(!_0x16e877)throw new Error(_0xd1cf48(0x1d9)+_0x259a1d+'\x22');return[_0x16e877,_0x328850];}export class ApiCommand extends BaseCommand{[a6_0x2d2280(0x1e3)]='api';[a6_0x2d2280(0x1ad)]=a6_0x2d2280(0x1ee);[a6_0x2d2280(0x1ce)](_0x17458e){const _0x29bae8=a6_0x2d2280,{args:_0x537ff1,options:_0x4c5c9d}=_0x17458e,_0x4da47b=_0x4c5c9d;if(_0x537ff1[_0x29bae8(0x1ba)]===0x0)return _0x29bae8(0x1c7);const _0x245f95=_0x537ff1[0x0];if(!_0x245f95[_0x29bae8(0x1f0)]('/'))return _0x29bae8(0x1e5)+_0x245f95;const _0x2a7360=_0x4da47b['data'],_0x4cfb79=_0x4da47b[_0x29bae8(0x1cf)];if(_0x2a7360&&_0x4cfb79)return _0x29bae8(0x1f2);const _0x41d745=_0x4da47b[_0x29bae8(0x1bb)]||'GET',_0x50b0d9=[_0x29bae8(0x1de),'POST',_0x29bae8(0x1f4),_0x29bae8(0x1c5),_0x29bae8(0x1d5)];if(!_0x50b0d9['includes'](_0x41d745[_0x29bae8(0x1ea)]()))return _0x29bae8(0x1cc)+_0x41d745+'.\x20Valid\x20methods:\x20'+_0x50b0d9[_0x29bae8(0x1d1)](',\x20');const _0x2217ad=_0x4da47b[_0x29bae8(0x1ab)]||'td',_0xd071d0=['td','cdp',_0x29bae8(0x1aa),_0x29bae8(0x1f3),_0x29bae8(0x1cb),_0x29bae8(0x1dc),_0x29bae8(0x1da)];if(!_0xd071d0[_0x29bae8(0x1e0)](_0x2217ad))return _0x29bae8(0x1dd)+_0x2217ad+_0x29bae8(0x1e6)+_0xd071d0['join'](',\x20');return undefined;}async[a6_0x2d2280(0x1e7)](_0x331538){const _0x35d370=a6_0x2d2280,{options:_0x4de5d7,args:_0xf02519,tdx:_0x62a48a}=_0x331538,_0x1b01c0=_0x4de5d7,_0x34226f=_0xf02519[0x0],_0x7d4ac5=(_0x1b01c0[_0x35d370(0x1bb)]||'GET')[_0x35d370(0x1ea)](),_0x19ef88=_0x1b01c0[_0x35d370(0x1bc)],_0x42728b=_0x1b01c0['file'],_0x30e710=_0x1b01c0[_0x35d370(0x1bd)],_0x5427cd=_0x1b01c0[_0x35d370(0x1ab)]||'td';try{const _0x512cb6={};if(_0x30e710){const _0x25a79d=Array[_0x35d370(0x1ae)](_0x30e710)?_0x30e710:[_0x30e710];for(const _0x93dd19 of _0x25a79d){const [_0x2761bd,_0xd98c24]=parseHeader(_0x93dd19);_0x512cb6[_0x2761bd]=_0xd98c24;}}let _0x5330cf;if(_0x19ef88)_0x5330cf=_0x19ef88;else{if(_0x42728b)try{_0x5330cf=RawAPI['readBodyFromFile'](_0x42728b);}catch(_0x322a3e){return console[_0x35d370(0x1c8)](_0x35d370(0x1e4)+(_0x322a3e instanceof Error?_0x322a3e[_0x35d370(0x1d4)]:String(_0x322a3e))),0x1;}}const _0x218a1e={'method':_0x7d4ac5,'apiType':_0x5427cd,'includeHeaders':_0x4de5d7[_0x35d370(0x1f5)]};_0x5330cf&&(_0x218a1e[_0x35d370(0x1e9)]=_0x5330cf);Object[_0x35d370(0x1d2)](_0x512cb6)['length']>0x0&&(_0x218a1e['headers']=_0x512cb6);if(_0x4de5d7[_0x35d370(0x1f5)]){const _0x2ff134=resolveSite(_0x4de5d7[_0x35d370(0x1c6)]),_0x39e33a=getEndpoint(_0x2ff134,_0x5427cd),_0x3cf7a1=''+_0x39e33a+_0x34226f;console['error']('>\x20'+_0x7d4ac5+'\x20'+_0x3cf7a1);const _0x3dd743=getAuthHeaders(_0x2ff134),_0x4eecf6={..._0x3dd743,..._0x512cb6};for(const [_0x47e901,_0x1d7510]of Object[_0x35d370(0x1c9)](_0x4eecf6)){!isSensitiveHeader(_0x47e901)&&console[_0x35d370(0x1c8)]('>\x20'+_0x47e901+':\x20'+_0x1d7510);}_0x5330cf&&console[_0x35d370(0x1c8)]('>'),console['error']('');}const _0x10e2a3=await _0x62a48a['api'][_0x35d370(0x1eb)](_0x34226f,_0x218a1e);if(_0x4de5d7[_0x35d370(0x1f5)]&&_0x10e2a3[_0x35d370(0x1b2)]){console['error'](_0x35d370(0x1df)+_0x10e2a3[_0x35d370(0x1d7)]);for(const [_0x2b934a,_0x103554]of Object[_0x35d370(0x1c9)](_0x10e2a3[_0x35d370(0x1b2)])){!isSensitiveHeader(_0x2b934a)&&console[_0x35d370(0x1c8)]('<\x20'+_0x2b934a+':\x20'+_0x103554);}console['error']('');}const _0x261b1a=Boolean(_0x4de5d7[_0x35d370(0x1b4)]),_0x19aa52={'color':_0x4de5d7[_0x35d370(0x1c4)],'noColor':_0x4de5d7[_0x35d370(0x1e8)]||_0x261b1a&&!_0x4de5d7[_0x35d370(0x1c4)]},_0x272d56=colorizeJSON(_0x10e2a3[_0x35d370(0x1bc)],_0x19aa52);return _0x4de5d7[_0x35d370(0x1b4)]?(writeFileSync(_0x4de5d7['output'],_0x272d56),console[_0x35d370(0x1c8)](_0x35d370(0x1d6)+_0x4de5d7[_0x35d370(0x1b4)])):console[_0x35d370(0x1b5)](_0x272d56),0x0;}catch(_0x3442c6){return _0x3442c6 instanceof Error?(console[_0x35d370(0x1c8)](_0x35d370(0x1e4)+_0x3442c6[_0x35d370(0x1d4)]),_0x4de5d7[_0x35d370(0x1f5)]&&_0x3442c6['stack']&&console[_0x35d370(0x1c8)](_0x35d370(0x1b9)+_0x3442c6[_0x35d370(0x1c3)])):console[_0x35d370(0x1c8)](_0x35d370(0x1e4)+String(_0x3442c6)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x514e93=a7_0x43c7;(function(_0x5dad5c,_0x139b29){const _0x598a42=a7_0x43c7,_0x4ee9d3=_0x5dad5c();while(!![]){try{const _0x48f82b=-parseInt(_0x598a42(0x197))/0x1*(-parseInt(_0x598a42(0x1c1))/0x2)+parseInt(_0x598a42(0x195))/0x3*(parseInt(_0x598a42(0x185))/0x4)+-parseInt(_0x598a42(0x18e))/0x5*(parseInt(_0x598a42(0x1b0))/0x6)+-parseInt(_0x598a42(0x194))/0x7+parseInt(_0x598a42(0x1d3))/0x8+parseInt(_0x598a42(0x198))/0x9+parseInt(_0x598a42(0x1bf))/0xa*(-parseInt(_0x598a42(0x1a1))/0xb);if(_0x48f82b===_0x139b29)break;else _0x4ee9d3['push'](_0x4ee9d3['shift']());}catch(_0x18e7c1){_0x4ee9d3['push'](_0x4ee9d3['shift']());}}}(a7_0x45e8,0xa0711));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';function a7_0x45e8(){const _0x589ada=['\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','No\x20credentials\x20found\x20in\x20keychain','method','\x20and\x20','oauth','filter','Remove\x20API\x20key\x20from\x20system\x20keychain','Credential\x20type:\x20OAuth','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','30UOEhbt','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','155098HRWluO','last_name','join','API\x20Key','\x20(site:\x20','System\x20keychain\x20is\x20not\x20available','tdx\x20profile:\x20','tdx:\x20auth\x20setup','You\x20can\x20find\x20your\x20API\x20key\x20at:','password','warn','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','✓\x20Authentication\x20successful\x0a','\x20for\x20profile:\x20','green','auth:setup','OAuth\x20tokens','us01','8565848VpFPUd','select','name','User:\x20','site','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','372gDTuVS','\x0aSetup\x20cancelled','all','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','trim','✗\x20Validation\x20failed:\x20','OAuth\x20(browser\x20login)','No\x20credential\x20found','log','65ujUrSB','logLevel','description','\x20removed\x20from\x20keychain','auth:clear','API\x20key\x20cannot\x20be\x20empty','4322892MjARgh','25332Zzaqvr','error','9eEoBBZ','4328865pdueJT','apiKey','ERROR','apikey','✓\x20Default\x20site\x20set\x20to\x20','execute','\x20\x20tdx','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','\x20(profile:\x20','1812899AfXWaX','✓\x20Profile\x20\x27','red','Read\x20credential\x20from\x20keychain','message','email','Setup\x20cancelled','getUserInfo','Enter\x20your\x20TD\x20API\x20key:','profile','jobs','create','bold','/app/mp/ak','API\x20key','584214nNUiTP','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Validating\x20API\x20key...','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Name:\x20','\x20--profile\x20'];a7_0x45e8=function(){return _0x589ada;};return a7_0x45e8();}import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';function a7_0x43c7(_0x25f142,_0x22be63){_0x25f142=_0x25f142-0x180;const _0x45e8ac=a7_0x45e8();let _0x43c76b=_0x45e8ac[_0x25f142];return _0x43c76b;}import{promptSiteSelection}from'../core/constants.js';import a7_0x354763 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_0x18ca47 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x514e93(0x181)]=a7_0x514e93(0x1d0);[a7_0x514e93(0x190)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x514e93(0x19d)](_0x2ca4ba){const _0x17fea5=a7_0x514e93,{options:_0x132d17}=_0x2ca4ba,_0x2b2bf8=_0x132d17[_0x17fea5(0x1aa)];console['log'](a7_0x18ca47[_0x17fea5(0x1ad)](_0x17fea5(0x1c8)));const _0x379bf7=_0x132d17[_0x17fea5(0x183)]||_0x17fea5(0x1d2),_0x3b574c=await promptSiteSelection(_0x379bf7,_0x2b2bf8,_0x17fea5(0x1a7));if(!_0x3b574c)return 0x1;const _0x2a6697=resolveSite(_0x3b574c);if(isOAuthSupported(_0x2a6697)){const _0xb0c3e3=await a7_0x354763({'type':_0x17fea5(0x180),'name':'method','message':'Choose\x20authentication\x20method:','choices':[{'title':_0x17fea5(0x18b),'value':_0x17fea5(0x1ba)},{'title':_0x17fea5(0x1c4),'value':_0x17fea5(0x19b)}]});if(!_0xb0c3e3[_0x17fea5(0x1b8)])return console['log'](_0x17fea5(0x186)),0x1;if(_0xb0c3e3['method']===_0x17fea5(0x1ba))return await runOAuthLoginFlow(_0x2a6697,_0x2b2bf8,_0x132d17[_0x17fea5(0x18f)]??LogLevel[_0x17fea5(0x19a)]),0x0;}console[_0x17fea5(0x18d)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x2a6697),console[_0x17fea5(0x18d)](_0x17fea5(0x1c9)),console[_0x17fea5(0x18d)]('\x20\x20'+getConsoleUrl(_0x2a6697,_0x17fea5(0x1ae)));const _0x5aa0bd=await a7_0x354763({'type':_0x17fea5(0x1ca),'name':'apiKey','message':_0x17fea5(0x1a9),'validate':_0x99ad5b=>{const _0x2288ef=_0x17fea5;if(!_0x99ad5b||!_0x99ad5b[_0x2288ef(0x189)]())return _0x2288ef(0x193);return!![];}});if(!_0x5aa0bd[_0x17fea5(0x199)])return console[_0x17fea5(0x18d)](_0x17fea5(0x186)),0x1;const _0x5b63ee=_0x5aa0bd[_0x17fea5(0x199)];console[_0x17fea5(0x18d)](_0x17fea5(0x1b2));try{const _0x5465b7=TDX[_0x17fea5(0x1ac)]({'site':_0x2a6697,'apiKey':_0x5b63ee['trim'](),'logLevel':_0x132d17[_0x17fea5(0x18f)]??LogLevel['ERROR']}),_0x16f45c=await _0x5465b7[_0x17fea5(0x1ab)][_0x17fea5(0x1a8)]();console[_0x17fea5(0x18d)](_0x17fea5(0x1cc)+_0x16f45c['email']+')');const _0x504032=await isKeychainAvailable();_0x504032?(await saveAPIKeyAsync(_0x5b63ee['trim'](),_0x2a6697,_0x2b2bf8),console[_0x17fea5(0x18d)](_0x17fea5(0x184)+(_0x2b2bf8?_0x17fea5(0x1a0)+_0x2b2bf8+')':''))):(console[_0x17fea5(0x1cb)](a7_0x18ca47['yellow'](_0x17fea5(0x1c0))),console[_0x17fea5(0x1cb)](a7_0x18ca47['yellow'](_0x17fea5(0x19f))));if(_0x2b2bf8){const _0xbac09a={'site':_0x2a6697};saveProfileToUserConfig(_0x2b2bf8,_0xbac09a),console[_0x17fea5(0x18d)](_0x17fea5(0x1a2)+_0x2b2bf8+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x2a6697),console['log'](_0x17fea5(0x19c)+_0x2a6697);const _0x41b7d6=_0x2b2bf8?_0x17fea5(0x1b5)+_0x2b2bf8:'';return console['log'](),console['log'](_0x17fea5(0x1be)),console['log'](_0x17fea5(0x19e)+_0x41b7d6+_0x17fea5(0x1b6)),console[_0x17fea5(0x18d)](_0x17fea5(0x19e)+_0x41b7d6+_0x17fea5(0x1b3)),0x0;}catch(_0x125c49){if(_0x125c49 instanceof HTTPClientError&&_0x125c49['status']===0x191)return printAuthError(_0x125c49),0x1;return console[_0x17fea5(0x196)](a7_0x18ca47['red'](_0x17fea5(0x18a)+(_0x125c49 instanceof Error?_0x125c49[_0x17fea5(0x1a5)]:String(_0x125c49)))),console['error'](_0x17fea5(0x1b1)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']='auth';[a7_0x514e93(0x190)]=a7_0x514e93(0x188);async[a7_0x514e93(0x19d)](_0x1d8ee3){const _0x1aaa3e=a7_0x514e93,{options:_0x1ae781,tdx:_0x20efd1}=_0x1d8ee3,_0x3fd625=_0x1ae781['site'],_0x5ed727=_0x1ae781['profile'],_0x4a9011=_0x5ed727?_0x5ed727:'N/A';console[_0x1aaa3e(0x18d)](_0x1aaa3e(0x1c7)+_0x4a9011+_0x1aaa3e(0x1c5)+_0x3fd625+')');const _0x5837f1=await getOAuthTokens(_0x5ed727);if(_0x5837f1)console[_0x1aaa3e(0x18d)](_0x1aaa3e(0x1bd)),console['log'](_0x1aaa3e(0x1a4)+(_0x5ed727?_0x1aaa3e(0x1a0)+_0x5ed727+')':''));else{const _0x14e14d=await resolveAPIKeyAsync(_0x3fd625,_0x5ed727);if(_0x14e14d){const {source:_0x3995a0,isDeprecated:_0x45801e}=_0x14e14d,_0x8f8203='Read\x20credential\x20from\x20'+_0x3995a0;console[_0x1aaa3e(0x18d)](_0x45801e?a7_0x18ca47['yellow'](_0x8f8203):_0x8f8203);}else console[_0x1aaa3e(0x18d)](a7_0x18ca47['yellow'](_0x1aaa3e(0x18c)));}try{const _0x36717b=await _0x20efd1[_0x1aaa3e(0x1ab)][_0x1aaa3e(0x1a8)]();return console[_0x1aaa3e(0x18d)](a7_0x18ca47[_0x1aaa3e(0x1cf)](_0x1aaa3e(0x1cd))),console[_0x1aaa3e(0x18d)](_0x1aaa3e(0x182)+_0x36717b[_0x1aaa3e(0x1a6)]),(_0x36717b['first_name']||_0x36717b[_0x1aaa3e(0x1c2)])&&console[_0x1aaa3e(0x18d)](_0x1aaa3e(0x1b4)+[_0x36717b['first_name'],_0x36717b['last_name']][_0x1aaa3e(0x1bb)](Boolean)[_0x1aaa3e(0x1c3)]('\x20')),0x0;}catch(_0x4b4d47){return _0x4b4d47 instanceof HTTPClientError&&_0x4b4d47['status']===0x191?printAuthError(_0x4b4d47,!![],_0x5ed727):console[_0x1aaa3e(0x196)](a7_0x18ca47[_0x1aaa3e(0x1a3)]('✗\x20Validation\x20failed:\x20'+(_0x4b4d47 instanceof Error?_0x4b4d47[_0x1aaa3e(0x1a5)]:String(_0x4b4d47)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x514e93(0x181)]=a7_0x514e93(0x192);['description']=a7_0x514e93(0x1bc);async[a7_0x514e93(0x19d)](_0x4dee63){const _0x11215f=a7_0x514e93,{options:_0x430b7f}=_0x4dee63,_0x5f2f1c=_0x430b7f[_0x11215f(0x1aa)];console[_0x11215f(0x18d)](a7_0x18ca47['bold']('tdx:\x20auth\x20clear'));const _0x24c0ec=await isKeychainAvailable();if(!_0x24c0ec)return console[_0x11215f(0x196)](a7_0x18ca47['red'](_0x11215f(0x1c6))),0x1;const [_0x511fb2,_0x1d7c64]=await Promise[_0x11215f(0x187)]([deleteKeychainAPIKey(_0x5f2f1c),deleteOAuthTokens(_0x5f2f1c)]);if(_0x511fb2||_0x1d7c64){clearCredentialCache();const _0x3be438=[_0x511fb2&&_0x11215f(0x1af),_0x1d7c64&&_0x11215f(0x1d1)][_0x11215f(0x1bb)](Boolean)[_0x11215f(0x1c3)](_0x11215f(0x1b9));return console['log']('✓\x20'+_0x3be438+_0x11215f(0x191)+(_0x5f2f1c?'\x20(profile:\x20'+_0x5f2f1c+')':'')),0x0;}else return console[_0x11215f(0x18d)](_0x11215f(0x1b7)+(_0x5f2f1c?_0x11215f(0x1ce)+_0x5f2f1c:'')),0x1;}}
1
+ const a7_0x24eba7=a7_0x4948;(function(_0x527391,_0x301ce0){const _0x45289a=a7_0x4948,_0x3d778c=_0x527391();while(!![]){try{const _0x364a71=parseInt(_0x45289a(0x151))/0x1+parseInt(_0x45289a(0x177))/0x2*(-parseInt(_0x45289a(0x15d))/0x3)+parseInt(_0x45289a(0x156))/0x4+parseInt(_0x45289a(0x136))/0x5*(parseInt(_0x45289a(0x16f))/0x6)+parseInt(_0x45289a(0x15c))/0x7*(parseInt(_0x45289a(0x167))/0x8)+parseInt(_0x45289a(0x175))/0x9*(-parseInt(_0x45289a(0x174))/0xa)+-parseInt(_0x45289a(0x169))/0xb;if(_0x364a71===_0x301ce0)break;else _0x3d778c['push'](_0x3d778c['shift']());}catch(_0x446a6a){_0x3d778c['push'](_0x3d778c['shift']());}}}(a7_0x2f87,0x3bc0d));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_0x2f87(){const _0x57b6eb=['API\x20Key','N/A','us01','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','105584mSSqXw','\x20and\x20','6897220wxneCK','apikey','execute','profile','Enter\x20your\x20TD\x20API\x20key:','\x0aSetup\x20cancelled','114liTDoJ','create','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','select','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','1107550AJLNIb','9KGemqL','No\x20credential\x20found','2uuymrb','getUserInfo','apiKey','yellow','tdx:\x20auth\x20clear','\x20for\x20profile:\x20','Setup\x20API\x20key\x20authentication\x20interactively','first_name','✓\x20Profile\x20\x27','join','email','tdx:\x20auth\x20setup','Read\x20credential\x20from\x20','113385OYJWWB','warn','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','logLevel','last_name','green','jobs','message','Setting\x20up\x20authentication\x20for\x20site:\x20','Read\x20credential\x20from\x20keychain','\x20\x20tdx','filter','log','Credential\x20type:\x20OAuth','✗\x20Validation\x20failed:\x20','Remove\x20API\x20key\x20from\x20system\x20keychain','description','\x20(profile:\x20','trim','bold','error','oauth','OAuth\x20(browser\x20login)','auth:clear','System\x20keychain\x20is\x20not\x20available','✓\x20Default\x20site\x20set\x20to\x20','status','355403EPhISn','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','ERROR','password','Setup\x20cancelled','1568772WGrXko','API\x20key\x20cannot\x20be\x20empty','\x20removed\x20from\x20keychain','\x20--profile\x20','No\x20credentials\x20found\x20in\x20keychain','method','77BpJqcD','1023339KYXHkY','Name:\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','red','name','✓\x20API\x20key\x20is\x20valid\x20(User:\x20'];a7_0x2f87=function(){return _0x57b6eb;};return a7_0x2f87();}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';function a7_0x4948(_0x32a3e0,_0x18659a){_0x32a3e0=_0x32a3e0-0x136;const _0x2f8734=a7_0x2f87();let _0x494842=_0x2f8734[_0x32a3e0];return _0x494842;}import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x458790 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_0x38a2fe from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x24eba7(0x161)]='auth:setup';[a7_0x24eba7(0x146)]=a7_0x24eba7(0x17d);async[a7_0x24eba7(0x16b)](_0x1c0352){const _0x5c67d3=a7_0x24eba7,{options:_0x3bde48}=_0x1c0352,_0x46858a=_0x3bde48['profile'];console[_0x5c67d3(0x142)](a7_0x38a2fe[_0x5c67d3(0x149)](_0x5c67d3(0x182)));const _0xb5fda6=_0x3bde48['site']||_0x5c67d3(0x165),_0x39c6b3=await promptSiteSelection(_0xb5fda6,_0x46858a,_0x5c67d3(0x155));if(!_0x39c6b3)return 0x1;const _0x14d317=resolveSite(_0x39c6b3);if(isOAuthSupported(_0x14d317)){const _0x3299f1=await a7_0x458790({'type':_0x5c67d3(0x172),'name':_0x5c67d3(0x15b),'message':'Choose\x20authentication\x20method:','choices':[{'title':_0x5c67d3(0x14c),'value':_0x5c67d3(0x14b)},{'title':_0x5c67d3(0x163),'value':_0x5c67d3(0x16a)}]});if(!_0x3299f1[_0x5c67d3(0x15b)])return console[_0x5c67d3(0x142)](_0x5c67d3(0x16e)),0x1;if(_0x3299f1[_0x5c67d3(0x15b)]===_0x5c67d3(0x14b))return await runOAuthLoginFlow(_0x14d317,_0x46858a,_0x3bde48[_0x5c67d3(0x139)]??LogLevel[_0x5c67d3(0x153)]),0x0;}console['log'](_0x5c67d3(0x13e)+_0x14d317),console[_0x5c67d3(0x142)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x5c67d3(0x142)]('\x20\x20'+getConsoleUrl(_0x14d317,'/app/mp/ak'));const _0x5c3304=await a7_0x458790({'type':_0x5c67d3(0x154),'name':_0x5c67d3(0x179),'message':_0x5c67d3(0x16d),'validate':_0x3b6687=>{const _0x4efe33=_0x5c67d3;if(!_0x3b6687||!_0x3b6687[_0x4efe33(0x148)]())return _0x4efe33(0x157);return!![];}});if(!_0x5c3304['apiKey'])return console[_0x5c67d3(0x142)](_0x5c67d3(0x16e)),0x1;const _0x1ea5dd=_0x5c3304['apiKey'];console['log']('Validating\x20API\x20key...');try{const _0x57be83=TDX[_0x5c67d3(0x170)]({'site':_0x14d317,'apiKey':_0x1ea5dd[_0x5c67d3(0x148)](),'logLevel':_0x3bde48[_0x5c67d3(0x139)]??LogLevel[_0x5c67d3(0x153)]}),_0x5e6865=await _0x57be83[_0x5c67d3(0x13c)][_0x5c67d3(0x178)]();console['log'](_0x5c67d3(0x162)+_0x5e6865[_0x5c67d3(0x181)]+')');const _0x3fb01f=await isKeychainAvailable();_0x3fb01f?(await saveAPIKeyAsync(_0x1ea5dd[_0x5c67d3(0x148)](),_0x14d317,_0x46858a),console[_0x5c67d3(0x142)](_0x5c67d3(0x166)+(_0x46858a?_0x5c67d3(0x147)+_0x46858a+')':''))):(console[_0x5c67d3(0x137)](a7_0x38a2fe[_0x5c67d3(0x17a)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x5c67d3(0x137)](a7_0x38a2fe[_0x5c67d3(0x17a)](_0x5c67d3(0x173))));if(_0x46858a){const _0x1c9057={'site':_0x14d317};saveProfileToUserConfig(_0x46858a,_0x1c9057),console['log'](_0x5c67d3(0x17f)+_0x46858a+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x14d317),console[_0x5c67d3(0x142)](_0x5c67d3(0x14f)+_0x14d317);const _0x49ece7=_0x46858a?_0x5c67d3(0x159)+_0x46858a:'';return console['log'](),console[_0x5c67d3(0x142)](_0x5c67d3(0x15f)),console[_0x5c67d3(0x142)](_0x5c67d3(0x140)+_0x49ece7+_0x5c67d3(0x171)),console['log'](_0x5c67d3(0x140)+_0x49ece7+_0x5c67d3(0x138)),0x0;}catch(_0x554cae){if(_0x554cae instanceof HTTPClientError&&_0x554cae['status']===0x191)return printAuthError(_0x554cae),0x1;return console[_0x5c67d3(0x14a)](a7_0x38a2fe[_0x5c67d3(0x160)](_0x5c67d3(0x144)+(_0x554cae instanceof Error?_0x554cae[_0x5c67d3(0x13d)]:String(_0x554cae)))),console['error']('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x24eba7(0x161)]='auth';[a7_0x24eba7(0x146)]=a7_0x24eba7(0x152);async[a7_0x24eba7(0x16b)](_0xff5721){const _0x41b71e=a7_0x24eba7,{options:_0xaa11e2,tdx:_0x9ba5d3}=_0xff5721,_0x48db96=_0xaa11e2['site'],_0x32a032=_0xaa11e2[_0x41b71e(0x16c)],_0x2ba581=_0x32a032?_0x32a032:_0x41b71e(0x164);console[_0x41b71e(0x142)]('tdx\x20profile:\x20'+_0x2ba581+'\x20(site:\x20'+_0x48db96+')');const _0x358d39=await getOAuthTokens(_0x32a032);if(_0x358d39)console[_0x41b71e(0x142)](_0x41b71e(0x143)),console[_0x41b71e(0x142)](_0x41b71e(0x13f)+(_0x32a032?'\x20(profile:\x20'+_0x32a032+')':''));else{const _0x39156f=await resolveAPIKeyAsync(_0x48db96,_0x32a032);if(_0x39156f){const {source:_0x3b7c9a,isDeprecated:_0x5b1b5e}=_0x39156f,_0x543366=_0x41b71e(0x183)+_0x3b7c9a;console[_0x41b71e(0x142)](_0x5b1b5e?a7_0x38a2fe[_0x41b71e(0x17a)](_0x543366):_0x543366);}else console['log'](a7_0x38a2fe[_0x41b71e(0x17a)](_0x41b71e(0x176)));}try{const _0x398cc0=await _0x9ba5d3[_0x41b71e(0x13c)][_0x41b71e(0x178)]();return console[_0x41b71e(0x142)](a7_0x38a2fe[_0x41b71e(0x13b)]('✓\x20Authentication\x20successful\x0a')),console[_0x41b71e(0x142)]('User:\x20'+_0x398cc0[_0x41b71e(0x181)]),(_0x398cc0['first_name']||_0x398cc0['last_name'])&&console[_0x41b71e(0x142)](_0x41b71e(0x15e)+[_0x398cc0[_0x41b71e(0x17e)],_0x398cc0[_0x41b71e(0x13a)]][_0x41b71e(0x141)](Boolean)[_0x41b71e(0x180)]('\x20')),0x0;}catch(_0x371def){return _0x371def instanceof HTTPClientError&&_0x371def[_0x41b71e(0x150)]===0x191?printAuthError(_0x371def,!![],_0x32a032):console['error'](a7_0x38a2fe[_0x41b71e(0x160)](_0x41b71e(0x144)+(_0x371def instanceof Error?_0x371def['message']:String(_0x371def)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x24eba7(0x161)]=a7_0x24eba7(0x14d);[a7_0x24eba7(0x146)]=a7_0x24eba7(0x145);async['execute'](_0x27c0fb){const _0x826fbd=a7_0x24eba7,{options:_0x2d4a7f}=_0x27c0fb,_0x232008=_0x2d4a7f['profile'];console['log'](a7_0x38a2fe[_0x826fbd(0x149)](_0x826fbd(0x17b)));const _0x4a3e35=await isKeychainAvailable();if(!_0x4a3e35)return console[_0x826fbd(0x14a)](a7_0x38a2fe[_0x826fbd(0x160)](_0x826fbd(0x14e))),0x1;const [_0x486f3b,_0x53678a]=await Promise['all']([deleteKeychainAPIKey(_0x232008),deleteOAuthTokens(_0x232008)]);if(_0x486f3b||_0x53678a){clearCredentialCache();const _0x1cb39d=[_0x486f3b&&'API\x20key',_0x53678a&&'OAuth\x20tokens'][_0x826fbd(0x141)](Boolean)['join'](_0x826fbd(0x168));return console['log']('✓\x20'+_0x1cb39d+_0x826fbd(0x158)+(_0x232008?_0x826fbd(0x147)+_0x232008+')':'')),0x0;}else return console[_0x826fbd(0x142)](_0x826fbd(0x15a)+(_0x232008?_0x826fbd(0x17c)+_0x232008:'')),0x1;}}
@@ -1 +1 @@
1
- const a8_0x3bd71e=a8_0x59a2;(function(_0x29315e,_0x59b2ab){const _0x2867eb=a8_0x59a2,_0x1daaa7=_0x29315e();while(!![]){try{const _0x3eebf8=parseInt(_0x2867eb(0x104))/0x1*(-parseInt(_0x2867eb(0xf2))/0x2)+-parseInt(_0x2867eb(0x106))/0x3+parseInt(_0x2867eb(0xf5))/0x4*(parseInt(_0x2867eb(0xef))/0x5)+parseInt(_0x2867eb(0xf9))/0x6+-parseInt(_0x2867eb(0xf6))/0x7+-parseInt(_0x2867eb(0xf3))/0x8+-parseInt(_0x2867eb(0xdf))/0x9*(-parseInt(_0x2867eb(0xfe))/0xa);if(_0x3eebf8===_0x59b2ab)break;else _0x1daaa7['push'](_0x1daaa7['shift']());}catch(_0x4a0530){_0x1daaa7['push'](_0x1daaa7['shift']());}}}(a8_0x56ec,0xd5c6d));import{BaseCommand}from'./command.js';function a8_0x56ec(){const _0x1e6d5c=['Login\x20via\x20OAuth\x20(opens\x20browser)','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','logLevel','description','\x20--profile\x20','\x20\x20tdx','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','ERROR','log','execute','Login\x20cancelled','profile','5PKCyZJ','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','969230zqHxFi','3389144ClyJov','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','5028712MtKPtM','7092519qBuSPa','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','\x27\x20registered','6709794sufRdY','getUserInfo','✓\x20Profile\x20\x27','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','tdx:\x20auth\x20login','18785530WIzLxw','Validating\x20OAuth\x20tokens...','\x20(profile:\x20','auth:login','access_token','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','1YHHKeH','name','4370778HAYaJV','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','create','9pzUsmt','✓\x20Authentication\x20successful\x20(User:\x20','/oauth/authorize','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'];a8_0x56ec=function(){return _0x1e6d5c;};return a8_0x56ec();}import{resolveSite}from'../core/config.js';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';function a8_0x59a2(_0x38cb85,_0x945fd0){_0x38cb85=_0x38cb85-0xdf;const _0x56ec9b=a8_0x56ec();let _0x59a271=_0x56ec9b[_0x38cb85];return _0x59a271;}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_0x1b774c from'chalk';export async function runOAuthLoginFlow(_0x262c82,_0x179cfd,_0x4a9305){const _0x2d7316=a8_0x59a2;if(!isOAuthSupported(_0x262c82))throw new Error(_0x2d7316(0xe9)+_0x262c82+'.\x20'+_0x2d7316(0xf1)+_0x2d7316(0x103));const _0x31c5d3=await isKeychainAvailable();if(!_0x31c5d3)throw new Error(_0x2d7316(0xf7)+_0x2d7316(0x103));const _0x144f47=getConsoleUrl(_0x262c82);console['log']('Opening\x20browser\x20for\x20authentication...'),console['log']('\x20\x20'+_0x144f47+_0x2d7316(0xe1)),console[_0x2d7316(0xeb)](_0x2d7316(0xf0));const _0x4b312e=await startOAuthFlow(_0x262c82);console[_0x2d7316(0xeb)](_0x2d7316(0xff));const _0x3ec427=TDX[_0x2d7316(0x108)]({'site':_0x262c82,'accessToken':_0x4b312e[_0x2d7316(0x102)],'logLevel':_0x4a9305??LogLevel[_0x2d7316(0xea)]}),_0x4561e7=await _0x3ec427['jobs'][_0x2d7316(0xfa)]();console['log'](a8_0x1b774c['green'](_0x2d7316(0xe0)+_0x4561e7['email']+')')),await saveOAuthTokens(_0x4b312e,_0x179cfd),console[_0x2d7316(0xeb)](_0x2d7316(0xe2)+(_0x179cfd?_0x2d7316(0x100)+_0x179cfd+')':''));if(_0x179cfd){const _0x4f3e1c={'site':_0x262c82};saveProfileToUserConfig(_0x179cfd,_0x4f3e1c),console[_0x2d7316(0xeb)](_0x2d7316(0xfb)+_0x179cfd+_0x2d7316(0xf8));}const _0x191f5e=_0x179cfd?_0x2d7316(0xe7)+_0x179cfd:'';console[_0x2d7316(0xeb)](),console[_0x2d7316(0xeb)](_0x2d7316(0x107)),console[_0x2d7316(0xeb)](_0x2d7316(0xe8)+_0x191f5e+_0x2d7316(0xf4)),console['log'](_0x2d7316(0xe8)+_0x191f5e+_0x2d7316(0xfc));}export class AuthLoginCommand extends BaseCommand{[a8_0x3bd71e(0x105)]=a8_0x3bd71e(0x101);[a8_0x3bd71e(0xe6)]=a8_0x3bd71e(0xe3);async[a8_0x3bd71e(0xec)](_0xfb854c){const _0x4841f7=a8_0x3bd71e,{options:_0x3dfe54}=_0xfb854c,_0x4ad19c=_0x3dfe54[_0x4841f7(0xee)];console[_0x4841f7(0xeb)](a8_0x1b774c['bold'](_0x4841f7(0xfd)));const _0x42d13b=_0x3dfe54['site']||'us01',_0x46f1e9=await promptSiteSelection(_0x42d13b,_0x4ad19c,_0x4841f7(0xed));if(!_0x46f1e9)return 0x1;const _0x101b13=resolveSite(_0x46f1e9);return console[_0x4841f7(0xeb)](_0x4841f7(0xe4)+_0x101b13),await runOAuthLoginFlow(_0x101b13,_0x4ad19c,_0x3dfe54[_0x4841f7(0xe5)]??LogLevel[_0x4841f7(0xea)]),0x0;}}
1
+ function a8_0x3633(_0x4210c0,_0x4c91d8){_0x4210c0=_0x4210c0-0x169;const _0x5e76bd=a8_0x5e76();let _0x36333a=_0x5e76bd[_0x4210c0];return _0x36333a;}const a8_0x2c8a47=a8_0x3633;function a8_0x5e76(){const _0x195742=['bold','✓\x20Profile\x20\x27','Login\x20cancelled','\x20\x20tdx','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','execute','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','\x20(profile:\x20','6309726xpGUwX','587751rUTBcq','19015696dahmnB','Validating\x20OAuth\x20tokens...','1535852yALeyL','Opening\x20browser\x20for\x20authentication...','log','ERROR','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','4153996UoTfHX','green','auth:login','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','name','✓\x20Authentication\x20successful\x20(User:\x20','jobs','/oauth/authorize','\x27\x20registered','create','Login\x20via\x20OAuth\x20(opens\x20browser)','3wfESzN','932208ibNevz','getUserInfo','logLevel','4042455IdAatN','us01','tdx:\x20auth\x20login','Authenticating\x20via\x20OAuth\x20for\x20site:\x20'];a8_0x5e76=function(){return _0x195742;};return a8_0x5e76();}(function(_0x132a23,_0x53e4fc){const _0x583062=a8_0x3633,_0x178780=_0x132a23();while(!![]){try{const _0x227241=-parseInt(_0x583062(0x16d))/0x1+-parseInt(_0x583062(0x181))/0x2+-parseInt(_0x583062(0x180))/0x3*(parseInt(_0x583062(0x170))/0x4)+-parseInt(_0x583062(0x184))/0x5+parseInt(_0x583062(0x16c))/0x6+-parseInt(_0x583062(0x175))/0x7+parseInt(_0x583062(0x16e))/0x8;if(_0x227241===_0x53e4fc)break;else _0x178780['push'](_0x178780['shift']());}catch(_0x3df6af){_0x178780['push'](_0x178780['shift']());}}}(a8_0x5e76,0x8fc2e));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';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';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x535762 from'chalk';export async function runOAuthLoginFlow(_0x2ddcc0,_0x1ef90d,_0x28e312){const _0x207342=a8_0x3633;if(!isOAuthSupported(_0x2ddcc0))throw new Error(_0x207342(0x174)+_0x2ddcc0+'.\x20'+_0x207342(0x178)+_0x207342(0x18c));const _0x6a6441=await isKeychainAvailable();if(!_0x6a6441)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+_0x207342(0x18c));const _0x1b5067=getConsoleUrl(_0x2ddcc0);console[_0x207342(0x172)](_0x207342(0x171)),console[_0x207342(0x172)]('\x20\x20'+_0x1b5067+_0x207342(0x17c)),console[_0x207342(0x172)]('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0x1199d1=await startOAuthFlow(_0x2ddcc0);console[_0x207342(0x172)](_0x207342(0x16f));const _0x218363=TDX[_0x207342(0x17e)]({'site':_0x2ddcc0,'accessToken':_0x1199d1['access_token'],'logLevel':_0x28e312??LogLevel['ERROR']}),_0x5391a5=await _0x218363[_0x207342(0x17b)][_0x207342(0x182)]();console[_0x207342(0x172)](a8_0x535762[_0x207342(0x176)](_0x207342(0x17a)+_0x5391a5['email']+')')),await saveOAuthTokens(_0x1199d1,_0x1ef90d),console['log']('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x1ef90d?_0x207342(0x16b)+_0x1ef90d+')':''));if(_0x1ef90d){const _0x23ef09={'site':_0x2ddcc0};saveProfileToUserConfig(_0x1ef90d,_0x23ef09),console[_0x207342(0x172)](_0x207342(0x189)+_0x1ef90d+_0x207342(0x17d));}const _0x5f4e5c=_0x1ef90d?'\x20--profile\x20'+_0x1ef90d:'';console['log'](),console['log']('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x207342(0x172)](_0x207342(0x18b)+_0x5f4e5c+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x207342(0x172)](_0x207342(0x18b)+_0x5f4e5c+_0x207342(0x16a));}export class AuthLoginCommand extends BaseCommand{[a8_0x2c8a47(0x179)]=a8_0x2c8a47(0x177);['description']=a8_0x2c8a47(0x17f);async[a8_0x2c8a47(0x169)](_0x4e9d6a){const _0x50301c=a8_0x2c8a47,{options:_0x490caf}=_0x4e9d6a,_0xbf3f4f=_0x490caf['profile'];console['log'](a8_0x535762[_0x50301c(0x188)](_0x50301c(0x186)));const _0x5e7fb8=_0x490caf['site']||_0x50301c(0x185),_0x1d399d=await promptSiteSelection(_0x5e7fb8,_0xbf3f4f,_0x50301c(0x18a));if(!_0x1d399d)return 0x1;const _0x307b3c=resolveSite(_0x1d399d);return console[_0x50301c(0x172)](_0x50301c(0x187)+_0x307b3c),await runOAuthLoginFlow(_0x307b3c,_0xbf3f4f,_0x490caf[_0x50301c(0x183)]??LogLevel[_0x50301c(0x173)]),0x0;}}