@treasuredata/tdx 2026.7.5 → 2026.7.6

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 (250) 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/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-move-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/table-deleted.js +1 -1
  52. package/dist/commands/tables.js +1 -1
  53. package/dist/commands/unset-command.js +1 -1
  54. package/dist/commands/upgrade-command.js +1 -1
  55. package/dist/commands/use-command.js +1 -1
  56. package/dist/commands/user-command.js +1 -1
  57. package/dist/commands/work-command.js +1 -1
  58. package/dist/commands/workflow-command.js +1 -1
  59. package/dist/core/auth.js +1 -1
  60. package/dist/core/command-output.js +1 -1
  61. package/dist/core/config.js +1 -1
  62. package/dist/core/connection-cache.js +1 -1
  63. package/dist/core/constants.js +1 -1
  64. package/dist/core/credential-cache.js +1 -1
  65. package/dist/core/global-context.js +1 -1
  66. package/dist/core/keychain.js +1 -1
  67. package/dist/core/oauth-keychain.js +1 -1
  68. package/dist/core/oauth.js +1 -1
  69. package/dist/core/profile.js +1 -1
  70. package/dist/core/project-config.js +1 -1
  71. package/dist/core/session.js +1 -1
  72. package/dist/core/user-cache.js +1 -1
  73. package/dist/core/version.js +1 -1
  74. package/dist/index.js +1 -1
  75. package/dist/mcp/server.js +1 -1
  76. package/dist/mcp/tools/index.js +1 -1
  77. package/dist/mcp/tools/tdx-run.js +1 -1
  78. package/dist/mcp/tools/tdx-search.js +1 -1
  79. package/dist/mcp/tools/work-create-item.js +1 -1
  80. package/dist/mcp/utils.js +1 -1
  81. package/dist/proxy/claude-usage-tracker.js +1 -1
  82. package/dist/proxy/passthrough-server.js +1 -1
  83. package/dist/proxy/sse-usage-parser.js +1 -1
  84. package/dist/sdk/agent/agent-config.js +1 -1
  85. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  86. package/dist/sdk/agent/agent-yaml.js +1 -1
  87. package/dist/sdk/agent/test/evaluator.js +1 -1
  88. package/dist/sdk/agent/test/executor.js +1 -1
  89. package/dist/sdk/agent/test/index.js +1 -1
  90. package/dist/sdk/agent/test/output.js +1 -1
  91. package/dist/sdk/agent/test/parser.js +1 -1
  92. package/dist/sdk/agent/tool-target-registry.js +1 -1
  93. package/dist/sdk/api.js +1 -1
  94. package/dist/sdk/cas/cas-api-client.js +1 -1
  95. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  96. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  97. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  98. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  99. package/dist/sdk/cas/index.js +1 -1
  100. package/dist/sdk/cas/pull-workflow.js +1 -1
  101. package/dist/sdk/cas/push-workflow.js +1 -1
  102. package/dist/sdk/cas/validate-files.js +1 -1
  103. package/dist/sdk/client/cdp-api-client.d.ts +6 -6
  104. package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
  105. package/dist/sdk/client/cdp-api-client.js +1 -1
  106. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  107. package/dist/sdk/client/delivery-api-client.js +1 -1
  108. package/dist/sdk/client/endpoints.js +1 -1
  109. package/dist/sdk/client/engage-api-client.js +1 -1
  110. package/dist/sdk/client/http-client.js +1 -1
  111. package/dist/sdk/client/llm-api-client.js +1 -1
  112. package/dist/sdk/client/oauth-refresh.js +1 -1
  113. package/dist/sdk/client/rate-limiter.js +1 -1
  114. package/dist/sdk/client/td-api-client.js +1 -1
  115. package/dist/sdk/client/trino-api-client.js +1 -1
  116. package/dist/sdk/client/workflow-client.js +1 -1
  117. package/dist/sdk/connection-validator.js +1 -1
  118. package/dist/sdk/connection.js +1 -1
  119. package/dist/sdk/delivery.js +1 -1
  120. package/dist/sdk/engage/campaign-pull.js +1 -1
  121. package/dist/sdk/engage/campaign-push.js +1 -1
  122. package/dist/sdk/engage/campaign-validator.js +1 -1
  123. package/dist/sdk/engage/campaign-yaml.js +1 -1
  124. package/dist/sdk/engage/template-pull.js +1 -1
  125. package/dist/sdk/engage/template-push.js +1 -1
  126. package/dist/sdk/engage/template-validator.js +1 -1
  127. package/dist/sdk/engage/template-yaml.js +1 -1
  128. package/dist/sdk/engage/types/campaign-def.js +1 -1
  129. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  130. package/dist/sdk/engage/types/template-schema.js +1 -1
  131. package/dist/sdk/engage.js +1 -1
  132. package/dist/sdk/errors.js +1 -1
  133. package/dist/sdk/index.js +1 -1
  134. package/dist/sdk/io/index.js +1 -1
  135. package/dist/sdk/io/node-filesystem.js +1 -1
  136. package/dist/sdk/job.js +1 -1
  137. package/dist/sdk/journey.js +1 -1
  138. package/dist/sdk/llm/chat-cache.js +1 -1
  139. package/dist/sdk/llm/index.js +1 -1
  140. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  141. package/dist/sdk/llm/model-factors.js +1 -1
  142. package/dist/sdk/llm/user-settings.js +1 -1
  143. package/dist/sdk/personalization.js +1 -1
  144. package/dist/sdk/policy.js +1 -1
  145. package/dist/sdk/query/deleted-table-validation.js +1 -1
  146. package/dist/sdk/query/index.js +1 -1
  147. package/dist/sdk/query/sql-parser.js +1 -1
  148. package/dist/sdk/realtime.js +1 -1
  149. package/dist/sdk/schedule.js +1 -1
  150. package/dist/sdk/segment/child-segment-yaml.d.ts +0 -8
  151. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  152. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  153. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  154. package/dist/sdk/segment/fields-display.js +1 -1
  155. package/dist/sdk/segment/file-discovery.js +1 -1
  156. package/dist/sdk/segment/journey-utils.js +1 -1
  157. package/dist/sdk/segment/journey-validator.js +1 -1
  158. package/dist/sdk/segment/journey-yaml.js +1 -1
  159. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  160. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  161. package/dist/sdk/segment/pull-workflow.js +1 -1
  162. package/dist/sdk/segment/push-recovery.js +1 -1
  163. package/dist/sdk/segment/push-workflow.d.ts.map +1 -1
  164. package/dist/sdk/segment/push-workflow.js +1 -1
  165. package/dist/sdk/segment/push-workflow.js.map +1 -1
  166. package/dist/sdk/segment/resolution-context.js +1 -1
  167. package/dist/sdk/segment/segment-path-parser.js +1 -1
  168. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  169. package/dist/sdk/segment/segment-validator.js +1 -1
  170. package/dist/sdk/segment/target-resolution.js +1 -1
  171. package/dist/sdk/segment/tdx-config.js +1 -1
  172. package/dist/sdk/segment/types/activation-schema.d.ts +66 -7
  173. package/dist/sdk/segment/types/activation-schema.d.ts.map +1 -1
  174. package/dist/sdk/segment/types/activation-schema.js +1 -1
  175. package/dist/sdk/segment/types/activation-schema.js.map +1 -1
  176. package/dist/sdk/segment/types/journey-def.js +1 -1
  177. package/dist/sdk/segment/types/journey-schema.js +1 -1
  178. package/dist/sdk/segment/types/segment-def.d.ts +1 -1
  179. package/dist/sdk/segment/types/segment-def.d.ts.map +1 -1
  180. package/dist/sdk/segment/types/segment-def.js +1 -1
  181. package/dist/sdk/segment/types/segment-def.js.map +1 -1
  182. package/dist/sdk/segment/types/segment-schema.d.ts +110 -1
  183. package/dist/sdk/segment/types/segment-schema.d.ts.map +1 -1
  184. package/dist/sdk/segment/types/segment-schema.js +1 -1
  185. package/dist/sdk/segment/types/segment-schema.js.map +1 -1
  186. package/dist/sdk/segment/validate-files.js +1 -1
  187. package/dist/sdk/segment/yaml-validator.js +1 -1
  188. package/dist/sdk/segment.js +1 -1
  189. package/dist/sdk/types/cdp.d.ts +7 -3
  190. package/dist/sdk/types/cdp.d.ts.map +1 -1
  191. package/dist/sdk/types/index.js +1 -1
  192. package/dist/sdk/types/progress.js +1 -1
  193. package/dist/sdk/types/workspace.js +1 -1
  194. package/dist/sdk/user.js +1 -1
  195. package/dist/sdk/util/format-detector.js +1 -1
  196. package/dist/sdk/util/formatters.js +1 -1
  197. package/dist/sdk/util/index.js +1 -1
  198. package/dist/sdk/util/paginate.js +1 -1
  199. package/dist/sdk/util/tree-formatter.js +1 -1
  200. package/dist/sdk/util/tree-search.js +1 -1
  201. package/dist/sdk/workflow/archive-validation.js +1 -1
  202. package/dist/sdk/workflow/clone-workflow.js +1 -1
  203. package/dist/sdk/workflow/index.js +1 -1
  204. package/dist/sdk/workflow/pull-workflow.js +1 -1
  205. package/dist/sdk/workflow/push-workflow.js +1 -1
  206. package/dist/sdk/workflow/task-graph.js +1 -1
  207. package/dist/sdk/workflow/tdx-config.js +1 -1
  208. package/dist/sdk/workflow/workflow-utils.js +1 -1
  209. package/dist/sdk/workspace/access-tracker.js +1 -1
  210. package/dist/sdk/workspace/frontmatter.js +1 -1
  211. package/dist/sdk/workspace/git.js +1 -1
  212. package/dist/sdk/workspace/index.js +1 -1
  213. package/dist/sdk/workspace/templates.js +1 -1
  214. package/dist/sdk/workspace/weekly.js +1 -1
  215. package/dist/sdk/workspace/wikilinks.js +1 -1
  216. package/dist/test-utils/command-runner.js +1 -1
  217. package/dist/test-utils/factories.js +1 -1
  218. package/dist/test-utils/fixtures.js +1 -1
  219. package/dist/test-utils/http-mock.js +1 -1
  220. package/dist/test-utils/index.js +1 -1
  221. package/dist/utils/async.js +1 -1
  222. package/dist/utils/claude-code-state.js +1 -1
  223. package/dist/utils/colors.js +1 -1
  224. package/dist/utils/diff.js +1 -1
  225. package/dist/utils/file-permissions.js +1 -1
  226. package/dist/utils/file-reader.js +1 -1
  227. package/dist/utils/github-releases.js +1 -1
  228. package/dist/utils/global-cache.js +1 -1
  229. package/dist/utils/json-loader.js +1 -1
  230. package/dist/utils/local-cache.js +1 -1
  231. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  232. package/dist/utils/logger/formatters/index.js +1 -1
  233. package/dist/utils/logger/handlers/console-handler.js +1 -1
  234. package/dist/utils/logger/handlers/file-handler.js +1 -1
  235. package/dist/utils/logger/handlers/index.js +1 -1
  236. package/dist/utils/logger/handlers/null-handler.js +1 -1
  237. package/dist/utils/logger/index.js +1 -1
  238. package/dist/utils/logger/logger.js +1 -1
  239. package/dist/utils/logger/types.js +1 -1
  240. package/dist/utils/option-validation.js +1 -1
  241. package/dist/utils/process.js +1 -1
  242. package/dist/utils/prompt.js +1 -1
  243. package/dist/utils/proxy-fetch.js +1 -1
  244. package/dist/utils/spinner.js +1 -1
  245. package/dist/utils/sse-parser.js +1 -1
  246. package/dist/utils/string-utils.js +1 -1
  247. package/dist/utils/table-ref-parser.js +1 -1
  248. package/dist/utils/tdx-logger.js +1 -1
  249. package/dist/utils/version-check.js +1 -1
  250. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x379236=a3_0x5c95;(function(_0x5c986f,_0x291550){const _0x59da71=a3_0x5c95,_0x2f28e7=_0x5c986f();while(!![]){try{const _0x1a5e26=parseInt(_0x59da71(0x1f3))/0x1+parseInt(_0x59da71(0x1eb))/0x2*(parseInt(_0x59da71(0x1fc))/0x3)+-parseInt(_0x59da71(0x1f8))/0x4*(parseInt(_0x59da71(0x1f5))/0x5)+parseInt(_0x59da71(0x1f9))/0x6+-parseInt(_0x59da71(0x1ee))/0x7+parseInt(_0x59da71(0x1fa))/0x8+-parseInt(_0x59da71(0x1f1))/0x9*(-parseInt(_0x59da71(0x1e9))/0xa);if(_0x1a5e26===_0x291550)break;else _0x2f28e7['push'](_0x2f28e7['shift']());}catch(_0x1ec82d){_0x2f28e7['push'](_0x2f28e7['shift']());}}}(a3_0x6055,0x435ab));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a3_0x5c95(_0x466356,_0x142365){_0x466356=_0x466356-0x1e5;const _0x60557b=a3_0x6055();let _0x5c9591=_0x60557b[_0x466356];return _0x5c9591;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0x6055(){const _0x3bb532=['Resolved\x20parent\x20ID:\x20','cause','description','\x27...','Resolving\x20parent\x20segment\x20\x27','message','listActivations','Parent\x20name:\x20','20WrgLHJ','Listing\x20activations\x20for\x20segment\x20\x27','620rKGmDw','execute','verbose','3610005sYeomv','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','Child\x20name:\x20','587079cysZlq','Resolving\x20child\x20segment\x20\x27','217220vRaFCW','name','15sbEose','length','resolveSegmentId','334132shKwqX','930942sNtWui','2439984zsFywM','Error:\x20','2268kIksEb','data','segment','resolveParentId','error','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','\x20\x20Cause:\x20','Resolved\x20child\x20ID:\x20','List\x20activations\x20for\x20a\x20segment'];a3_0x6055=function(){return _0x3bb532;};return a3_0x6055();}export class ActivationsCommand extends BaseCommand{[a3_0x379236(0x1f4)]='activations';[a3_0x379236(0x207)]=a3_0x379236(0x204);async[a3_0x379236(0x1ec)](_0x2cb99c){const _0x1500b2=a3_0x379236,{options:_0x20047e,args:_0x2ec8cb,tdx:_0x37276b}=_0x2cb99c;if(_0x2ec8cb[_0x1500b2(0x1f6)]===0x0)return console['error']('Error:\x20Segment\x20name\x20is\x20required'),console[_0x1500b2(0x200)](_0x1500b2(0x201)),0x1;try{const {parentId:_0x21ea84,childId:_0x81859}=parseSegmentRef(_0x2ec8cb[0x0]);if(!_0x81859)return console[_0x1500b2(0x200)](_0x1500b2(0x1ef)),console['error'](_0x1500b2(0x201)),0x1;_0x20047e[_0x1500b2(0x1ed)]&&(console[_0x1500b2(0x200)]('Site:\x20'+_0x20047e['site']),console[_0x1500b2(0x200)](_0x1500b2(0x1e8)+_0x21ea84),console['error'](_0x1500b2(0x1f0)+_0x81859));const _0x4a1a0c=await withSpinner(_0x1500b2(0x1e5)+_0x21ea84+_0x1500b2(0x208),()=>_0x37276b[_0x1500b2(0x1fe)][_0x1500b2(0x1ff)](_0x21ea84),{'verbose':_0x20047e[_0x1500b2(0x1ed)]}),_0x596e4=_0x4a1a0c[_0x1500b2(0x1fd)];_0x20047e['verbose']&&console[_0x1500b2(0x200)](_0x1500b2(0x205)+_0x596e4);const _0x300399=await withSpinner(_0x1500b2(0x1f2)+_0x81859+_0x1500b2(0x208),()=>_0x37276b[_0x1500b2(0x1fe)][_0x1500b2(0x1f7)](_0x596e4,_0x81859),{'verbose':_0x20047e[_0x1500b2(0x1ed)]}),_0x17e08d=_0x300399[_0x1500b2(0x1fd)];_0x20047e[_0x1500b2(0x1ed)]&&console[_0x1500b2(0x200)](_0x1500b2(0x203)+_0x17e08d);const _0x22c4cf=await withSpinner(_0x1500b2(0x1ea)+_0x81859+'\x27...',()=>_0x37276b[_0x1500b2(0x1fe)][_0x1500b2(0x1e7)](_0x596e4,_0x17e08d),{'verbose':_0x20047e['verbose']}),_0x5948ba=_0x22c4cf[_0x1500b2(0x1fd)];return console[_0x1500b2(0x200)]('✔\x20Found\x20'+_0x5948ba[_0x1500b2(0x1f6)]+'\x20activation'+(_0x5948ba[_0x1500b2(0x1f6)]!==0x1?'s':'')),await handleSDKOutput(_0x5948ba,_0x20047e),0x0;}catch(_0x2944ed){if(_0x2944ed instanceof SDKError)return console[_0x1500b2(0x200)](_0x1500b2(0x1fb)+_0x2944ed[_0x1500b2(0x1e6)]),_0x2944ed[_0x1500b2(0x206)]&&console[_0x1500b2(0x200)](_0x1500b2(0x202)+_0x2944ed[_0x1500b2(0x206)]),0x1;throw _0x2944ed;}}}
1
+ const a3_0x2aeff6=a3_0xa349;function a3_0xa349(_0x11c4ed,_0x57875b){_0x11c4ed=_0x11c4ed-0xad;const _0x2957a5=a3_0x2957();let _0xa3495e=_0x2957a5[_0x11c4ed];return _0xa3495e;}(function(_0x39a935,_0x1c2f89){const _0x40e937=a3_0xa349,_0x24867a=_0x39a935();while(!![]){try{const _0x4b6cc6=-parseInt(_0x40e937(0xc5))/0x1+-parseInt(_0x40e937(0xcd))/0x2+parseInt(_0x40e937(0xcf))/0x3*(parseInt(_0x40e937(0xbb))/0x4)+parseInt(_0x40e937(0xc9))/0x5+parseInt(_0x40e937(0xbf))/0x6*(-parseInt(_0x40e937(0xbe))/0x7)+parseInt(_0x40e937(0xbd))/0x8+parseInt(_0x40e937(0xba))/0x9;if(_0x4b6cc6===_0x1c2f89)break;else _0x24867a['push'](_0x24867a['shift']());}catch(_0x5c7f68){_0x24867a['push'](_0x24867a['shift']());}}}(a3_0x2957,0x9baa9));import{BaseCommand}from'./command.js';function a3_0x2957(){const _0x48e6ef=['Resolving\x20child\x20segment\x20\x27','site','Resolved\x20parent\x20ID:\x20','data','3326292vnVXKA','44ArjqTp','activations','6167360eoJPMW','6937QSaeyT','4662bxjNIW','Resolved\x20child\x20ID:\x20','Site:\x20','execute','segment','Error:\x20','34707lgtpQB','length','Resolving\x20parent\x20segment\x20\x27','cause','1217620uLDKbd','Error:\x20Segment\x20name\x20is\x20required','description','\x20\x20Cause:\x20','1015252pzzslL','error','154341WDdXRo','✔\x20Found\x20','Child\x20name:\x20','resolveParentId','name','List\x20activations\x20for\x20a\x20segment','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','resolveSegmentId','verbose','\x27...'];a3_0x2957=function(){return _0x48e6ef;};return a3_0x2957();}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_0x2aeff6(0xb0)]=a3_0x2aeff6(0xbc);[a3_0x2aeff6(0xcb)]=a3_0x2aeff6(0xb1);async[a3_0x2aeff6(0xc2)](_0xce6cb9){const _0x1f36b9=a3_0x2aeff6,{options:_0x4969fa,args:_0x27a85e,tdx:_0x44945d}=_0xce6cb9;if(_0x27a85e[_0x1f36b9(0xc6)]===0x0)return console[_0x1f36b9(0xce)](_0x1f36b9(0xca)),console[_0x1f36b9(0xce)](_0x1f36b9(0xb2)),0x1;try{const {parentId:_0x37a2bb,childId:_0x4c4e7c}=parseSegmentRef(_0x27a85e[0x0]);if(!_0x4c4e7c)return console['error']('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x1f36b9(0xce)](_0x1f36b9(0xb2)),0x1;_0x4969fa[_0x1f36b9(0xb4)]&&(console[_0x1f36b9(0xce)](_0x1f36b9(0xc1)+_0x4969fa[_0x1f36b9(0xb7)]),console['error']('Parent\x20name:\x20'+_0x37a2bb),console[_0x1f36b9(0xce)](_0x1f36b9(0xae)+_0x4c4e7c));const _0x5d97c5=await withSpinner(_0x1f36b9(0xc7)+_0x37a2bb+_0x1f36b9(0xb5),()=>_0x44945d['segment'][_0x1f36b9(0xaf)](_0x37a2bb),{'verbose':_0x4969fa[_0x1f36b9(0xb4)]}),_0x59144a=_0x5d97c5['data'];_0x4969fa['verbose']&&console[_0x1f36b9(0xce)](_0x1f36b9(0xb8)+_0x59144a);const _0x45ba92=await withSpinner(_0x1f36b9(0xb6)+_0x4c4e7c+_0x1f36b9(0xb5),()=>_0x44945d[_0x1f36b9(0xc3)][_0x1f36b9(0xb3)](_0x59144a,_0x4c4e7c),{'verbose':_0x4969fa[_0x1f36b9(0xb4)]}),_0x53942c=_0x45ba92[_0x1f36b9(0xb9)];_0x4969fa[_0x1f36b9(0xb4)]&&console[_0x1f36b9(0xce)](_0x1f36b9(0xc0)+_0x53942c);const _0x39ab2b=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x4c4e7c+_0x1f36b9(0xb5),()=>_0x44945d[_0x1f36b9(0xc3)]['listActivations'](_0x59144a,_0x53942c),{'verbose':_0x4969fa['verbose']}),_0x1a573c=_0x39ab2b[_0x1f36b9(0xb9)];return console[_0x1f36b9(0xce)](_0x1f36b9(0xad)+_0x1a573c[_0x1f36b9(0xc6)]+'\x20activation'+(_0x1a573c[_0x1f36b9(0xc6)]!==0x1?'s':'')),await handleSDKOutput(_0x1a573c,_0x4969fa),0x0;}catch(_0x260873){if(_0x260873 instanceof SDKError)return console['error'](_0x1f36b9(0xc4)+_0x260873['message']),_0x260873[_0x1f36b9(0xc8)]&&console['error'](_0x1f36b9(0xcc)+_0x260873[_0x1f36b9(0xc8)]),0x1;throw _0x260873;}}}
@@ -1 +1 @@
1
- const a4_0x2af299=a4_0x1cf3;(function(_0x529435,_0x2bc563){const _0x1b4ad4=a4_0x1cf3,_0x34e6dd=_0x529435();while(!![]){try{const _0x39f632=parseInt(_0x1b4ad4(0x116))/0x1+parseInt(_0x1b4ad4(0xdd))/0x2+parseInt(_0x1b4ad4(0xef))/0x3*(-parseInt(_0x1b4ad4(0x113))/0x4)+parseInt(_0x1b4ad4(0xfb))/0x5*(parseInt(_0x1b4ad4(0x11a))/0x6)+parseInt(_0x1b4ad4(0xbf))/0x7*(parseInt(_0x1b4ad4(0x127))/0x8)+-parseInt(_0x1b4ad4(0x9e))/0x9*(parseInt(_0x1b4ad4(0xd3))/0xa)+parseInt(_0x1b4ad4(0xe1))/0xb*(parseInt(_0x1b4ad4(0x12b))/0xc);if(_0x39f632===_0x2bc563)break;else _0x34e6dd['push'](_0x34e6dd['shift']());}catch(_0xc7974b){_0x34e6dd['push'](_0x34e6dd['shift']());}}}(a4_0x234c,0x9841f));import a4_0x30f3fc from'chalk';import a4_0x1e8bb5 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(_0xfdaf16){const _0x191c82=a4_0x1cf3,_0xa1b5c=[];if(_0xfdaf16['total']!==undefined)_0xa1b5c[_0x191c82(0x12e)](_0xfdaf16['total']+'\x20total');if(_0xfdaf16[_0x191c82(0x81)]!==undefined&&_0xfdaf16[_0x191c82(0x81)]>0x0)_0xa1b5c[_0x191c82(0x12e)](a4_0x30f3fc[_0x191c82(0xea)](_0xfdaf16['new']+'\x20new'));if(_0xfdaf16[_0x191c82(0xc7)]!==undefined&&_0xfdaf16[_0x191c82(0xc7)]>0x0)_0xa1b5c['push'](a4_0x30f3fc[_0x191c82(0xea)](_0xfdaf16[_0x191c82(0xc7)]+_0x191c82(0xa2)));if(_0xfdaf16['updated']!==undefined&&_0xfdaf16[_0x191c82(0x8f)]>0x0)_0xa1b5c['push'](a4_0x30f3fc['yellow'](_0xfdaf16[_0x191c82(0x8f)]+_0x191c82(0xc1)));if(_0xfdaf16[_0x191c82(0x100)]!==undefined&&_0xfdaf16[_0x191c82(0x100)]>0x0)_0xa1b5c[_0x191c82(0x12e)](a4_0x30f3fc['gray'](_0xfdaf16['unchanged']+_0x191c82(0xc5)));if(_0xfdaf16[_0x191c82(0xe5)]!==undefined&&_0xfdaf16[_0x191c82(0xe5)]>0x0)_0xa1b5c[_0x191c82(0x12e)](a4_0x30f3fc[_0x191c82(0xf9)](_0xfdaf16[_0x191c82(0xe5)]+_0x191c82(0xfe)));return _0xa1b5c[_0x191c82(0xb7)](',\x20');}function a4_0x1cf3(_0x21189c,_0x1dfbea){_0x21189c=_0x21189c-0x7b;const _0x234c19=a4_0x234c();let _0x1cf3fd=_0x234c19[_0x21189c];return _0x1cf3fd;}function displayDiffs(_0x16c78a,_0x29d813,_0x3f97e2,_0x57c017,_0x15e4a3,_0x34bd2b,_0x32b99a,_0x24528b,_0x9c74c0){const _0x1b0e55=a4_0x1cf3;for(const _0x5510c4 of _0x16c78a){if(_0x5510c4[_0x1b0e55(0x9d)]){const _0x1c731b=_0x5510c4[_0x1b0e55(0xaa)]||_0x5510c4[_0x1b0e55(0xdc)];console[_0x1b0e55(0x118)](_0x1b0e55(0xc2)+_0x1c731b+'\x27:'),console['log']('─'[_0x1b0e55(0x11e)](0x3c)),console['log'](_0x5510c4[_0x1b0e55(0x9d)]),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c));}}for(const _0x2275a6 of _0x29d813){_0x2275a6['diff']&&(console[_0x1b0e55(0x118)](_0x1b0e55(0xc0)+_0x2275a6[_0x1b0e55(0xdc)]+'\x27:'),console['log']('─'[_0x1b0e55(0x11e)](0x3c)),console[_0x1b0e55(0x118)](_0x2275a6[_0x1b0e55(0x9d)]),console[_0x1b0e55(0x118)]('─'['repeat'](0x3c)));}for(const _0xca72ff of _0x3f97e2){_0xca72ff[_0x1b0e55(0x9d)]&&(console[_0x1b0e55(0x118)](_0x1b0e55(0x10c)+_0xca72ff[_0x1b0e55(0xdc)]+'\x27:'),console[_0x1b0e55(0x118)]('─'['repeat'](0x3c)),console['log'](_0xca72ff[_0x1b0e55(0x9d)]),console['log']('─'[_0x1b0e55(0x11e)](0x3c)));}for(const _0x1b3447 of _0x57c017){_0x1b3447['diff']&&(console[_0x1b0e55(0x118)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x1b3447[_0x1b0e55(0xdc)]+'\x27:'),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c)),console['log'](_0x1b3447[_0x1b0e55(0x9d)]),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c)));}for(const _0x487bfc of _0x15e4a3){_0x487bfc[_0x1b0e55(0x9d)]&&(console['log']('\x0aChanges\x20to\x20integration\x20\x27'+_0x487bfc[_0x1b0e55(0xdc)]+'\x27:'),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c)),console[_0x1b0e55(0x118)](_0x487bfc[_0x1b0e55(0x9d)]),console['log']('─'[_0x1b0e55(0x11e)](0x3c)));}for(const _0x445ba9 of _0x34bd2b){_0x445ba9['diff']&&(console[_0x1b0e55(0x118)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x445ba9[_0x1b0e55(0xdc)]+'\x27:'),console[_0x1b0e55(0x118)]('─'['repeat'](0x3c)),console[_0x1b0e55(0x118)](_0x445ba9[_0x1b0e55(0x9d)]),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c)));}for(const _0x13f62d of _0x32b99a){_0x13f62d['diff']&&(console['log'](_0x1b0e55(0x115)+_0x13f62d['name']+'\x27:'),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c)),console[_0x1b0e55(0x118)](_0x13f62d[_0x1b0e55(0x9d)]),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c)));}for(const _0x5a9c39 of _0x24528b){_0x5a9c39[_0x1b0e55(0x9d)]&&(console['log'](_0x1b0e55(0x134)+_0x5a9c39[_0x1b0e55(0xdc)]+'\x27:'),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c)),console[_0x1b0e55(0x118)](_0x5a9c39['diff']),console[_0x1b0e55(0x118)]('─'['repeat'](0x3c)));}for(const _0x37bb2d of _0x9c74c0){_0x37bb2d[_0x1b0e55(0x9d)]&&(console[_0x1b0e55(0x118)](_0x1b0e55(0x119)+_0x37bb2d[_0x1b0e55(0xdc)]+'\x27:'),console['log']('─'[_0x1b0e55(0x11e)](0x3c)),console[_0x1b0e55(0x118)](_0x37bb2d[_0x1b0e55(0x9d)]),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';['description']=a4_0x2af299(0x7e);async[a4_0x2af299(0xfd)](_0x52ade0){const _0x6c1221=a4_0x2af299,{options:_0x33ccf4,args:_0x32795a,tdx:_0x19bd71}=_0x52ade0,_0x53f23d=_0x32795a[0x0],_0x1df724=_0x32795a[0x1],_0x38a963=_0x33ccf4['output'],_0x47b70f=_0x33ccf4[_0x6c1221(0xa7)],_0x45d7b8=_0x33ccf4['force'],_0x5b14b4=_0x33ccf4[_0x6c1221(0xec)],_0x1a212f=_0x33ccf4[_0x6c1221(0x12a)],_0x564102=_0x33ccf4[_0x6c1221(0x10d)];let _0x2d5fa8;if(_0x53f23d){const _0x4e20f7=a4_0x1e8bb5[_0x6c1221(0xb7)](_0x53f23d,'tdx.json');if(existsSync(_0x4e20f7))try{const _0x3edd22=JSON[_0x6c1221(0xb9)](readFileSync(_0x4e20f7,'utf-8'));_0x3edd22[_0x6c1221(0x92)]&&(_0x2d5fa8={'llm_project':_0x3edd22[_0x6c1221(0x92)]});}catch{}}const _0x487dab=findAgentConfigPath(process['cwd']());let _0xacf9ff;if(_0x487dab)try{const _0x1f2702=JSON['parse'](readFileSync(_0x487dab,_0x6c1221(0xc8)));_0x1f2702[_0x6c1221(0x92)]&&(_0xacf9ff={'llm_project':_0x1f2702[_0x6c1221(0x92)]});}catch{}const _0x88f71e=resolveAgentPullArgs({'arg':_0x53f23d,'agentNameArg':_0x1df724,'agentFlag':_0x564102,'contextProject':_0x1a212f,'argDirConfig':_0x2d5fa8,'cwdConfigPath':_0x487dab||undefined,'cwdConfig':_0xacf9ff}),{projectNameOrId:_0x1fb462,targetAgentName:_0x2da227,existingOutputDir:_0xb6bed2,source:_0x24d072}=_0x88f71e;if(_0x24d072==='arg-dir')console['log'](a4_0x30f3fc['dim'](_0x6c1221(0xf4)+a4_0x1e8bb5[_0x6c1221(0xb7)](_0x53f23d,_0x6c1221(0xb5))+':\x20'+_0x1fb462));else{if(_0x24d072===_0x6c1221(0x125))console['log'](a4_0x30f3fc[_0x6c1221(0x88)](_0x6c1221(0xcf)+_0x1fb462));else _0x24d072===_0x6c1221(0x85)&&console[_0x6c1221(0x118)](a4_0x30f3fc[_0x6c1221(0x88)](_0x6c1221(0x89)+_0x1fb462));}if(!_0x1fb462)return _0x564102?(console[_0x6c1221(0x118)](a4_0x30f3fc['yellow'](_0x6c1221(0xb2))),console[_0x6c1221(0x118)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console['log'](_0x6c1221(0x137))):(console[_0x6c1221(0x118)](a4_0x30f3fc[_0x6c1221(0xe4)](_0x6c1221(0x135))),console[_0x6c1221(0x118)](_0x6c1221(0xb0)),console[_0x6c1221(0x118)](_0x6c1221(0x123)),console[_0x6c1221(0x118)](_0x6c1221(0x103)),console[_0x6c1221(0x118)]('\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[_0x6c1221(0x118)](_0x6c1221(0x9f))),0x1;if(_0x2da227){const {data:_0x21332c}=await withSpinner(_0x6c1221(0xf0)+_0x2da227+_0x6c1221(0x10e)+_0x1fb462+'\x22...',()=>_0x19bd71[_0x6c1221(0x129)]['pullAgent'](_0x1fb462,_0x2da227,_0x38a963,{'dryRun':_0x47b70f,'force':_0x45d7b8}));if(_0x47b70f)return console['log'](a4_0x30f3fc['yellow'](_0x6c1221(0x12d))),console[_0x6c1221(0x118)](_0x6c1221(0x86)+_0x21332c[_0x6c1221(0xaa)]),console[_0x6c1221(0x118)]('Output\x20path:\x20'+_0x21332c[_0x6c1221(0x11f)]),_0x21332c[_0x6c1221(0x9d)]&&(console[_0x6c1221(0x118)](_0x6c1221(0xe3)),console[_0x6c1221(0x118)]('─'[_0x6c1221(0x11e)](0x3c)),console[_0x6c1221(0x118)](_0x21332c[_0x6c1221(0x9d)]),console[_0x6c1221(0x118)]('─'[_0x6c1221(0x11e)](0x3c))),0x0;return console[_0x6c1221(0x118)](a4_0x30f3fc[_0x6c1221(0xea)]('Agent\x20pulled\x20successfully')),console[_0x6c1221(0x118)]('Agent:\x20'+_0x21332c[_0x6c1221(0xaa)]),console['log'](_0x6c1221(0x98)+_0x21332c[_0x6c1221(0x11f)]),console['log'](_0x6c1221(0x8c)+(_0x21332c[_0x6c1221(0xca)]?a4_0x30f3fc[_0x6c1221(0xea)](_0x6c1221(0x81)):_0x21332c[_0x6c1221(0x122)]?a4_0x30f3fc[_0x6c1221(0xe4)]('updated'):a4_0x30f3fc['gray']('unchanged'))),0x0;}const _0x107b35=_0xb6bed2||_0x38a963,{data:_0x2da2bf}=await withSpinner(_0x6c1221(0xce)+_0x1fb462+_0x6c1221(0xb8),()=>_0x19bd71[_0x6c1221(0x129)][_0x6c1221(0x7b)](_0x1fb462,_0x107b35,{'dryRun':!![]})),_0x49cef5=_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x82)][_0x6c1221(0x81)]+_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x112)]['new']+_0x2da2bf['counts'][_0x6c1221(0xf2)][_0x6c1221(0x81)]+_0x2da2bf['counts'][_0x6c1221(0xe0)][_0x6c1221(0x81)]+_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x8b)][_0x6c1221(0x81)]+_0x2da2bf[_0x6c1221(0x108)]['experimentalKnowledgeBases'][_0x6c1221(0x81)]+_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x10a)]['new']+_0x2da2bf[_0x6c1221(0x108)]['formInterfaces'][_0x6c1221(0x81)]+_0x2da2bf['counts'][_0x6c1221(0x8d)][_0x6c1221(0x81)],_0x8b3201=_0x2da2bf['counts'][_0x6c1221(0x82)]['updated']+_0x2da2bf['counts']['knowledgeBases'][_0x6c1221(0x8f)]+_0x2da2bf['counts']['textKnowledgeBases'][_0x6c1221(0x8f)]+_0x2da2bf[_0x6c1221(0x108)]['prompts']['updated']+_0x2da2bf['counts']['integrations'][_0x6c1221(0x8f)]+_0x2da2bf['counts'][_0x6c1221(0x11b)][_0x6c1221(0x8f)]+_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x10a)][_0x6c1221(0x8f)]+_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x83)][_0x6c1221(0x8f)]+_0x2da2bf['counts'][_0x6c1221(0x8d)][_0x6c1221(0x8f)],_0x16dea0=_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x82)]['unchanged']+_0x2da2bf[_0x6c1221(0x108)]['knowledgeBases']['unchanged']+_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0xf2)][_0x6c1221(0x100)]+_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0xe0)][_0x6c1221(0x100)]+_0x2da2bf[_0x6c1221(0x108)]['integrations']['unchanged']+_0x2da2bf[_0x6c1221(0x108)]['experimentalKnowledgeBases'][_0x6c1221(0x100)]+_0x2da2bf[_0x6c1221(0x108)]['experimentalArtifacts'][_0x6c1221(0x100)]+_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x83)][_0x6c1221(0x100)]+_0x2da2bf['counts']['chatInterfaces'][_0x6c1221(0x100)];console[_0x6c1221(0x118)](_0x6c1221(0x130)+_0x2da2bf[_0x6c1221(0x91)]+'\x27:'),console[_0x6c1221(0x118)]('\x20\x20'+a4_0x30f3fc['green']('+\x20'+_0x49cef5+_0x6c1221(0xd8))+_0x6c1221(0xf7)+a4_0x30f3fc[_0x6c1221(0xe4)]('~\x20'+_0x8b3201+'\x20changed')+_0x6c1221(0xf7)+a4_0x30f3fc[_0x6c1221(0x88)]('=\x20'+_0x16dea0+_0x6c1221(0xc5))),console[_0x6c1221(0x118)](_0x6c1221(0xe6)+formatCountSummary(_0x2da2bf['counts'][_0x6c1221(0x82)])),console[_0x6c1221(0x118)](_0x6c1221(0xa1)+formatCountSummary(_0x2da2bf['counts'][_0x6c1221(0x112)])),console[_0x6c1221(0x118)](_0x6c1221(0xa9)+formatCountSummary(_0x2da2bf['counts'][_0x6c1221(0xf2)])),console[_0x6c1221(0x118)](_0x6c1221(0x7f)+formatCountSummary(_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0xe0)])),console[_0x6c1221(0x118)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x8b)])),console[_0x6c1221(0x118)](_0x6c1221(0xc9)+formatCountSummary(_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x83)])),console['log'](_0x6c1221(0x7c)+formatCountSummary(_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x8d)]));const _0x3b003b=_0x2da2bf[_0x6c1221(0x108)]['experimentalKnowledgeBases'][_0x6c1221(0xf8)]>0x0||_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x10a)]['total']>0x0;_0x3b003b&&(console[_0x6c1221(0x118)](_0x6c1221(0x99)+formatCountSummary(_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x11b)])),console[_0x6c1221(0x118)](_0x6c1221(0x102)+formatCountSummary(_0x2da2bf[_0x6c1221(0x108)]['experimentalArtifacts'])));console[_0x6c1221(0x118)](_0x6c1221(0xb6)+a4_0x30f3fc[_0x6c1221(0x120)](_0x2da2bf['outputDir'])),displayDiffs(_0x2da2bf[_0x6c1221(0x82)],_0x2da2bf[_0x6c1221(0x112)],_0x2da2bf[_0x6c1221(0xf2)],_0x2da2bf[_0x6c1221(0xe0)],_0x2da2bf[_0x6c1221(0x8b)],_0x2da2bf[_0x6c1221(0x11b)],_0x2da2bf[_0x6c1221(0x10a)],_0x2da2bf[_0x6c1221(0x83)],_0x2da2bf[_0x6c1221(0x8d)]);if(_0x47b70f)return console[_0x6c1221(0x118)](a4_0x30f3fc[_0x6c1221(0xe4)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x49cef5===0x0&&_0x8b3201===0x0)return console['log'](a4_0x30f3fc[_0x6c1221(0xea)](_0x6c1221(0x126))),saveSessionContext({'llm_project':_0x2da2bf[_0x6c1221(0x91)]},_0x33ccf4[_0x6c1221(0xd5)]),console[_0x6c1221(0x118)](a4_0x30f3fc[_0x6c1221(0xea)](_0x6c1221(0xde)+a4_0x30f3fc[_0x6c1221(0x88)](_0x6c1221(0x92))+_0x6c1221(0xd7)+a4_0x30f3fc[_0x6c1221(0x120)](_0x2da2bf[_0x6c1221(0x91)]))),0x0;if(!_0x5b14b4&&!_0x45d7b8){if(!isInteractive())return console[_0x6c1221(0x94)](a4_0x30f3fc[_0x6c1221(0xf9)](_0x6c1221(0xb4)),_0x6c1221(0xdb)),console[_0x6c1221(0x94)](a4_0x30f3fc[_0x6c1221(0x88)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3f82a7=await confirmKey(_0x6c1221(0x101)+(_0x49cef5+_0x8b3201)+'\x20files?');if(!_0x3f82a7)return console[_0x6c1221(0x118)](a4_0x30f3fc['yellow'](_0x6c1221(0x87)),_0x6c1221(0xed)),0x1;}const {data:_0x3c185e}=await withSpinner(_0x6c1221(0x104),()=>_0x19bd71[_0x6c1221(0x129)][_0x6c1221(0x7b)](_0x1fb462,_0x107b35,{'force':_0x45d7b8}));return console['log'](a4_0x30f3fc['green'](_0x6c1221(0x111)+(_0x49cef5+_0x8b3201)+_0x6c1221(0xf6)+_0x3c185e[_0x6c1221(0xa6)])),saveSessionContext({'llm_project':_0x3c185e[_0x6c1221(0x91)]},_0x33ccf4[_0x6c1221(0xd5)]),console[_0x6c1221(0x118)](a4_0x30f3fc[_0x6c1221(0xea)]('✔\x20Context\x20set:\x20'+a4_0x30f3fc[_0x6c1221(0x88)]('llm_project')+_0x6c1221(0xd7)+a4_0x30f3fc['cyan'](_0x3c185e[_0x6c1221(0x91)]))),0x0;}}function a4_0x234c(){const _0x31fd51=['MISSING_ARGUMENT','\x20\x20Knowledge\x20Bases:\x20','\x20created','INVALID_ARGUMENT','New\x20project\x20name\x20is\x20required','cwd','outputDir','dryRun','\x20\x20Agent\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','agentName','\x0a✔\x20Pushed\x20','Analyzing\x20changes\x20to\x20push...','agent:push','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20resources\x20to\x20\x27','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)','\x0aPush\x20summary\x20for\x20\x27','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','newProjectName','\x0aError:','tdx.json','\x20\x20Target:\x20','join','\x22...','parse','\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)','site','no_local_folder','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x0aErrors\x20found:','7kaKJFj','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20updated','\x0aChanges\x20to\x20agent\x20\x27','Failed\x20to\x20push\x20agent:\x20','\x22\x20to\x20a\x20different\x20profile','\x20unchanged','\x20\x20tdx\x20agent\x20clone\x20agents/','created','utf-8','\x20\x20Form\x20Interfaces:\x20','isNew','Summary:','Agent\x20','\x22:\x20','Analyzing\x20project\x20\x22','Using\x20project:\x20','sourceProjectName','\x22\x20to\x20\x22','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','541490PXujok','Using\x20local\x20project:\x20','session','Errors:','\x20=\x20','\x20new','Pushing\x20to\x20project...','profile','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','name','1863190fXxVus','✔\x20Context\x20set:\x20','\x20changed','prompts','1911657QlrcQG','description','\x0aChanges:','yellow','errors','\x20\x20Agents:\x20','Cloning\x20\x22','\x20\x20Chat\x20Interface\x20\x22','force','green','Project\x20cloned\x20with\x20errors','yes','-\x20no\x20files\x20written','Project\x20cloned\x20successfully','1470981IMilHf','Pulling\x20agent\x20\x22','\x20\x20Text\x20Knowledge\x20Base\x20\x22','textKnowledgeBases','\x20\x20Integrations:\x20','Using\x20project\x20from\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20files\x20to\x20','\x20|\x20','total','red','pushProject','5XcwVHr','\x22\x20to\x20new\x20project\x20\x22','execute','\x20errors','projectDir','unchanged','\x0aWrite\x20','\x20\x20Experimental\x20Artifacts:\x20','\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','Writing\x20files...','Using\x20context\x20project:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','counts','agentId','experimentalArtifacts','reason','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','agent','\x22\x20from\x20project\x20\x22','Source:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x0a✔\x20Pulled\x20','knowledgeBases','4ugAnxH','found','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','57598qBJWjl','source','log','\x0aChanges\x20to\x20chat\x20interface\x20\x27','1660380IQHpUf','experimentalKnowledgeBases','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Using\x20current\x20project:\x20','repeat','outputPath','cyan','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','hasChanges','\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','\x20\x20Prompt\x20\x22','cwd-config','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','2159224ySPVOA','pushAgent','llm','llmProject','12NHIXSI','dirname','Dry\x20run\x20-\x20no\x20files\x20written','push','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x0aPull\x20summary\x20for\x20\x27','newProjectId','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','New\x20project\x20ID:\x20','\x0aChanges\x20to\x20form\x20interface\x20\x27','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Dry\x20run\x20-\x20no\x20changes\x20made','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','pullProject','\x20\x20Chat\x20Interfaces:\x20','projectId','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20\x20Prompts:\x20','\x0aPush\x20','new','agents','formInterfaces','\x0aProject\x20pushed\x20with\x20errors','context','Would\x20pull\x20agent:\x20','Cancelled','dim','Using\x20project\x20from\x20context:\x20','Project:\x20','integrations','Status:\x20','chatInterfaces','\x20\x20Form\x20Interface\x20\x22','updated','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','projectName','llm_project','Would\x20push\x20agent:\x20','error','\x20\x20Knowledge\x20Base\x20\x22','action','\x20--profile\x20','Output:\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','agent.yml','No\x20tdx.json\x20found\x20in\x20','message','diff','99QpMBlq','\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'];a4_0x234c=function(){return _0x31fd51;};return a4_0x234c();}export class AgentCloneCommand extends BaseCommand{['name']='agent:clone';[a4_0x2af299(0xe2)]=a4_0x2af299(0xd2);async[a4_0x2af299(0xfd)](_0x276078){const _0x139afb=a4_0x2af299,{options:_0x5d9229,args:_0x24231b,tdx:_0x5a15a4}=_0x276078,_0x3bf156=_0x24231b[0x0],_0x17109e=_0x5d9229['name'],_0x3a4cbf=_0x5d9229['dryRun'],_0x554405=_0x5d9229[_0x139afb(0xec)],_0x163098=_0x5d9229[_0x139afb(0xbb)],_0x25eeca=_0x5d9229['llmProject'];let _0x2f352b;const _0x532b02=findAgentConfigPath(process[_0x139afb(0xa5)]());if(_0x3bf156){const _0x540b4a=a4_0x1e8bb5[_0x139afb(0xb7)](_0x3bf156,_0x139afb(0xb5));existsSync(_0x540b4a)?(_0x2f352b=_0x3bf156,console[_0x139afb(0x118)](a4_0x30f3fc[_0x139afb(0x88)](_0x139afb(0xd4)+_0x3bf156))):_0x2f352b=_0x3bf156;}else{if(_0x532b02)_0x2f352b=a4_0x1e8bb5[_0x139afb(0x12c)](_0x532b02),console[_0x139afb(0x118)](a4_0x30f3fc[_0x139afb(0x88)](_0x139afb(0x11d)+_0x2f352b));else{if(_0x25eeca){const _0x223ceb=sanitizeForFilesystem(_0x25eeca);let _0x29367e=_0x223ceb,_0x3528a1=a4_0x1e8bb5[_0x139afb(0xb7)](process['cwd'](),_0x139afb(0x82),_0x223ceb,_0x139afb(0xb5));if(!existsSync(_0x3528a1)){const _0x391ea5=normalizeName(_0x25eeca),_0x5a4095=a4_0x1e8bb5[_0x139afb(0xb7)](process[_0x139afb(0xa5)](),_0x139afb(0x82),_0x391ea5,_0x139afb(0xb5));existsSync(_0x5a4095)&&(_0x29367e=_0x391ea5,_0x3528a1=_0x5a4095);}if(existsSync(_0x3528a1))_0x2f352b=a4_0x1e8bb5['dirname'](_0x3528a1),console[_0x139afb(0x118)](a4_0x30f3fc['dim'](_0x139afb(0xd4)+_0x2f352b));else{const _0x3fce93=_0x5d9229[_0x139afb(0xda)];if(_0x3fce93)throw new SDKError(ErrorCode[_0x139afb(0xa3)],_0x139afb(0xf5)+_0x25eeca+_0x139afb(0xc4),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x139afb(0x110)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x25eeca+'\x0a')+(_0x139afb(0xc6)+_0x29367e+'\x20--name\x20'+(_0x17109e||'<new-name>')+_0x139afb(0x97)+_0x3fce93)});_0x2f352b=_0x25eeca,console['log'](a4_0x30f3fc[_0x139afb(0x88)](_0x139afb(0x105)+_0x25eeca));}}}}if(!_0x2f352b)return console[_0x139afb(0x118)](a4_0x30f3fc[_0x139afb(0xe4)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x139afb(0x118)](_0x139afb(0x90)),console[_0x139afb(0x118)](_0x139afb(0x132)),console[_0x139afb(0x118)](_0x139afb(0xba)),console[_0x139afb(0x118)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x17109e)throw new SDKError(ErrorCode[_0x139afb(0xa0)],_0x139afb(0xa4),undefined,{'helpText':_0x139afb(0xae)});if(!_0x554405&&!_0x3a4cbf){if(!isInteractive())return console['error'](a4_0x30f3fc[_0x139afb(0xf9)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x139afb(0x94)](a4_0x30f3fc[_0x139afb(0x88)](_0x139afb(0x121))),0x1;const _0x93efd3=await confirmKey('Clone\x20\x22'+_0x2f352b+_0x139afb(0xfc)+_0x17109e+'\x22?');if(!_0x93efd3)return console[_0x139afb(0x118)](a4_0x30f3fc['yellow'](_0x139afb(0x87))),0x1;}const {data:_0x59a3a9}=await withSpinner(_0x139afb(0xe7)+_0x2f352b+_0x139afb(0xd1)+_0x17109e+'\x22...',()=>_0x5a15a4[_0x139afb(0x129)]['cloneProject'](_0x2f352b,_0x17109e,{'dryRun':_0x3a4cbf}));if(_0x3a4cbf){console['log'](a4_0x30f3fc['yellow'](_0x139afb(0x136))),console[_0x139afb(0x118)](_0x139afb(0x10f)+_0x59a3a9['sourceProjectName']),console[_0x139afb(0x118)]('New\x20project:\x20'+_0x17109e),console[_0x139afb(0x118)]('Would\x20clone:'),console['log'](_0x139afb(0xe6)+_0x59a3a9[_0x139afb(0x108)]['agents']['created']),console[_0x139afb(0x118)](_0x139afb(0xa1)+_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x112)][_0x139afb(0xc7)]),console[_0x139afb(0x118)](_0x139afb(0x7f)+_0x59a3a9[_0x139afb(0x108)][_0x139afb(0xe0)][_0x139afb(0xc7)]),console[_0x139afb(0x118)]('\x20\x20Form\x20Interfaces:\x20'+_0x59a3a9['counts'][_0x139afb(0x83)][_0x139afb(0xc7)]),console[_0x139afb(0x118)](_0x139afb(0x7c)+_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x8d)][_0x139afb(0xc7)]);const _0x597b5c=_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x11b)]['created']>0x0||_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x10a)]['created']>0x0;return _0x597b5c&&(console[_0x139afb(0x118)](_0x139afb(0x99)+_0x59a3a9['counts']['experimentalKnowledgeBases']['created']),console[_0x139afb(0x118)](_0x139afb(0x102)+_0x59a3a9['counts'][_0x139afb(0x10a)][_0x139afb(0xc7)])),0x0;}const _0x23d456=_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x82)][_0x139afb(0xe5)]>0x0||_0x59a3a9['counts'][_0x139afb(0x112)][_0x139afb(0xe5)]>0x0||_0x59a3a9['counts'][_0x139afb(0xe0)][_0x139afb(0xe5)]>0x0||_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x83)]['errors']>0x0||_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x8d)][_0x139afb(0xe5)]>0x0||_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x11b)][_0x139afb(0xe5)]>0x0||_0x59a3a9['counts']['experimentalArtifacts'][_0x139afb(0xe5)]>0x0;_0x23d456?console[_0x139afb(0x118)](a4_0x30f3fc[_0x139afb(0xe4)](_0x139afb(0xeb))):console[_0x139afb(0x118)](a4_0x30f3fc[_0x139afb(0xea)](_0x139afb(0xee)));console[_0x139afb(0x118)](_0x139afb(0x10f)+_0x59a3a9[_0x139afb(0xd0)]),console[_0x139afb(0x118)]('New\x20project:\x20'+_0x59a3a9[_0x139afb(0xb3)]),console['log'](_0x139afb(0x133)+_0x59a3a9[_0x139afb(0x131)]),console[_0x139afb(0x118)](),console[_0x139afb(0x118)](_0x139afb(0xcb)),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x82)])),console[_0x139afb(0x118)](_0x139afb(0xa1)+formatCountSummary(_0x59a3a9['counts'][_0x139afb(0x112)])),console[_0x139afb(0x118)](_0x139afb(0x7f)+formatCountSummary(_0x59a3a9[_0x139afb(0x108)][_0x139afb(0xe0)])),console[_0x139afb(0x118)](_0x139afb(0xf3)+formatCountSummary(_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x8b)])),console[_0x139afb(0x118)](_0x139afb(0xc9)+formatCountSummary(_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x83)])),console[_0x139afb(0x118)](_0x139afb(0x7c)+formatCountSummary(_0x59a3a9['counts'][_0x139afb(0x8d)]));const _0x2195fd=_0x59a3a9[_0x139afb(0x108)]['experimentalKnowledgeBases']['created']>0x0||_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x11b)][_0x139afb(0x8f)]>0x0||_0x59a3a9[_0x139afb(0x108)]['experimentalKnowledgeBases'][_0x139afb(0x100)]>0x0||_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x10a)][_0x139afb(0xc7)]>0x0||_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x10a)]['updated']>0x0||_0x59a3a9['counts']['experimentalArtifacts'][_0x139afb(0x100)]>0x0;_0x2195fd&&(console[_0x139afb(0x118)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x59a3a9[_0x139afb(0x108)]['experimentalKnowledgeBases'])),console['log'](_0x139afb(0x102)+formatCountSummary(_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x10a)])));if(_0x23d456){console[_0x139afb(0x118)](),console[_0x139afb(0x118)](a4_0x30f3fc[_0x139afb(0xf9)](_0x139afb(0xd6)));for(const _0xc70b82 of _0x59a3a9['agents']){_0xc70b82['action']===_0x139afb(0x94)&&console[_0x139afb(0x118)](a4_0x30f3fc['red'](_0x139afb(0xa8)+_0xc70b82['agentName']+_0x139afb(0xcd)+_0xc70b82[_0x139afb(0x94)]));}for(const _0x566e1c of _0x59a3a9[_0x139afb(0x112)]){_0x566e1c[_0x139afb(0x96)]===_0x139afb(0x94)&&console[_0x139afb(0x118)](a4_0x30f3fc[_0x139afb(0xf9)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x566e1c[_0x139afb(0xdc)]+_0x139afb(0xcd)+_0x566e1c[_0x139afb(0x94)]));}for(const _0x10005b of _0x59a3a9['prompts']){_0x10005b[_0x139afb(0x96)]===_0x139afb(0x94)&&console[_0x139afb(0x118)](a4_0x30f3fc['red'](_0x139afb(0x124)+_0x10005b['name']+_0x139afb(0xcd)+_0x10005b['error']));}for(const _0x3063c1 of _0x59a3a9[_0x139afb(0x8b)]){_0x3063c1[_0x139afb(0x96)]===_0x139afb(0x94)&&console['log'](a4_0x30f3fc[_0x139afb(0xf9)]('\x20\x20Integration\x20\x22'+_0x3063c1[_0x139afb(0xdc)]+_0x139afb(0xcd)+_0x3063c1[_0x139afb(0x94)]));}for(const _0x302560 of _0x59a3a9[_0x139afb(0x83)]){_0x302560[_0x139afb(0x96)]===_0x139afb(0x94)&&console['log'](a4_0x30f3fc[_0x139afb(0xf9)](_0x139afb(0x8e)+_0x302560[_0x139afb(0xdc)]+_0x139afb(0xcd)+_0x302560['error']));}for(const _0x3582db of _0x59a3a9['chatInterfaces']){_0x3582db[_0x139afb(0x96)]===_0x139afb(0x94)&&console['log'](a4_0x30f3fc[_0x139afb(0xf9)](_0x139afb(0xe8)+_0x3582db[_0x139afb(0xdc)]+'\x22:\x20'+_0x3582db['error']));}for(const _0x171e84 of _0x59a3a9[_0x139afb(0x11b)]){_0x171e84[_0x139afb(0x96)]===_0x139afb(0x94)&&console['log'](a4_0x30f3fc[_0x139afb(0xf9)](_0x139afb(0x12f)+_0x171e84[_0x139afb(0xdc)]+_0x139afb(0xcd)+_0x171e84[_0x139afb(0x94)]));}for(const _0x4a4f65 of _0x59a3a9[_0x139afb(0x10a)]){_0x4a4f65[_0x139afb(0x96)]===_0x139afb(0x94)&&console[_0x139afb(0x118)](a4_0x30f3fc[_0x139afb(0xf9)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x4a4f65[_0x139afb(0xdc)]+'\x22:\x20'+_0x4a4f65['error']));}return 0x1;}console[_0x139afb(0x118)]();const _0x2f1583=getLLMProjectUrl(_0x163098,_0x59a3a9[_0x139afb(0x131)]);return console[_0x139afb(0x118)](_0x139afb(0x8a)+a4_0x30f3fc[_0x139afb(0x120)](_0x2f1583)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x2af299(0xdc)]=a4_0x2af299(0xad);[a4_0x2af299(0xe2)]=a4_0x2af299(0x107);async[a4_0x2af299(0xfd)](_0x4aa342){const _0x1f9f93=a4_0x2af299,{options:_0x399294,args:_0x15e89f,tdx:_0x422fa3}=_0x4aa342;let _0x2fbd19=_0x15e89f[0x0]||process['cwd']();const _0x4fcec0=_0x399294[_0x1f9f93(0xa7)],_0x5ad3d6=_0x399294[_0x1f9f93(0xe9)],_0x289760=_0x399294['yes'],_0x37e301=_0x399294['site'],_0x1406fe=a4_0x1e8bb5[_0x1f9f93(0xb7)](_0x2fbd19,_0x1f9f93(0x9a)),_0x3f6317=existsSync(_0x1406fe);if(_0x3f6317){const {data:_0x16edac}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x2fbd19+'\x22...',()=>_0x422fa3[_0x1f9f93(0x129)][_0x1f9f93(0x128)](_0x2fbd19,{'dryRun':_0x4fcec0,'force':_0x5ad3d6}));if(_0x4fcec0)return console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xe4)](_0x1f9f93(0x136))),console[_0x1f9f93(0x118)](_0x1f9f93(0x93)+_0x16edac['agentName']),0x0;if(_0x16edac[_0x1f9f93(0x96)]===_0x1f9f93(0x94))return console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0xc3)+_0x16edac['error'])),0x1;console[_0x1f9f93(0x118)](a4_0x30f3fc['green'](_0x1f9f93(0xcc)+_0x16edac[_0x1f9f93(0x96)]+'\x20successfully')),console[_0x1f9f93(0x118)]('Agent:\x20'+_0x16edac[_0x1f9f93(0xaa)]);if(_0x16edac[_0x1f9f93(0x109)]&&_0x16edac[_0x1f9f93(0x7d)]){const _0x136d14=getLLMAgentChatUrl(_0x37e301,_0x16edac[_0x1f9f93(0x7d)],_0x16edac['agentId']);console[_0x1f9f93(0x118)]('Chat:\x20'+a4_0x30f3fc[_0x1f9f93(0x120)](_0x136d14));}return 0x0;}const _0x3daf1f=_0x399294[_0x1f9f93(0x12a)],_0x5a1839=resolveProjectFromContext(_0x2fbd19,_0x3daf1f);if(_0x5a1839[_0x1f9f93(0x114)])_0x2fbd19=_0x5a1839[_0x1f9f93(0xff)],_0x5a1839[_0x1f9f93(0x117)]===_0x1f9f93(0x85)&&console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0x88)](_0x1f9f93(0xcf)+_0x2fbd19));else{let _0x4b07d6='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x5a1839[_0x1f9f93(0x10b)]===_0x1f9f93(0xbc)&&(_0x4b07d6=_0x5a1839[_0x1f9f93(0x9c)]+_0x1f9f93(0x106)+_0x5a1839[_0x1f9f93(0x12a)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x1f9f93(0xa3)],_0x5a1839[_0x1f9f93(0x10b)]==='no_context'?_0x5a1839[_0x1f9f93(0x9c)]:_0x1f9f93(0x9b)+_0x2fbd19,undefined,{'helpText':_0x4b07d6});}const {data:_0x1ecf82}=await withSpinner(_0x1f9f93(0xac),()=>_0x422fa3[_0x1f9f93(0x129)][_0x1f9f93(0xfa)](_0x2fbd19,{'dryRun':!![]})),_0x265bf6=_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x82)]['errors']>0x0;if(_0x265bf6){console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0xbe)));for(const _0x39e21a of _0x1ecf82[_0x1f9f93(0x82)]){_0x39e21a[_0x1f9f93(0x96)]===_0x1f9f93(0x94)&&console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0xa8)+_0x39e21a['agentName']+'\x22:\x20'+_0x39e21a[_0x1f9f93(0x94)]));}return 0x1;}const _0x586465=_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x82)]['created']+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x112)][_0x1f9f93(0xc7)]+_0x1ecf82[_0x1f9f93(0x108)]['textKnowledgeBases'][_0x1f9f93(0xc7)]+_0x1ecf82[_0x1f9f93(0x108)]['prompts']['created']+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x8b)]['created']+_0x1ecf82['counts'][_0x1f9f93(0x11b)][_0x1f9f93(0xc7)]+_0x1ecf82['counts'][_0x1f9f93(0x10a)]['created']+_0x1ecf82['counts'][_0x1f9f93(0x83)][_0x1f9f93(0xc7)]+_0x1ecf82['counts'][_0x1f9f93(0x8d)]['created'],_0x53372f=_0x1ecf82['counts'][_0x1f9f93(0x82)]['updated']+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x112)]['updated']+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0xf2)][_0x1f9f93(0x8f)]+_0x1ecf82['counts'][_0x1f9f93(0xe0)][_0x1f9f93(0x8f)]+_0x1ecf82['counts'][_0x1f9f93(0x8b)][_0x1f9f93(0x8f)]+_0x1ecf82['counts'][_0x1f9f93(0x11b)][_0x1f9f93(0x8f)]+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x10a)]['updated']+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x83)]['updated']+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x8d)][_0x1f9f93(0x8f)],_0x47650c=_0x1ecf82['counts'][_0x1f9f93(0x82)]['unchanged']+_0x1ecf82['counts'][_0x1f9f93(0x112)][_0x1f9f93(0x100)]+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0xf2)][_0x1f9f93(0x100)]+_0x1ecf82['counts']['prompts'][_0x1f9f93(0x100)]+_0x1ecf82['counts'][_0x1f9f93(0x8b)]['unchanged']+_0x1ecf82[_0x1f9f93(0x108)]['experimentalKnowledgeBases'][_0x1f9f93(0x100)]+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x10a)][_0x1f9f93(0x100)]+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x83)]['unchanged']+_0x1ecf82[_0x1f9f93(0x108)]['chatInterfaces'][_0x1f9f93(0x100)];console[_0x1f9f93(0x118)](_0x1f9f93(0xb1)+_0x1ecf82[_0x1f9f93(0x91)]+'\x27:'),console[_0x1f9f93(0x118)]('\x20\x20'+a4_0x30f3fc[_0x1f9f93(0xea)]('+\x20'+_0x586465+'\x20new')+'\x20|\x20'+a4_0x30f3fc[_0x1f9f93(0xe4)]('~\x20'+_0x53372f+_0x1f9f93(0xdf))+'\x20|\x20'+a4_0x30f3fc[_0x1f9f93(0x88)]('=\x20'+_0x47650c+'\x20unchanged')),console[_0x1f9f93(0x118)](_0x1f9f93(0xe6)+formatCountSummary(_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x82)])),console['log'](_0x1f9f93(0xa1)+formatCountSummary(_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x112)])),console[_0x1f9f93(0x118)](_0x1f9f93(0xa9)+formatCountSummary(_0x1ecf82['counts'][_0x1f9f93(0xf2)])),console[_0x1f9f93(0x118)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x1ecf82['counts'][_0x1f9f93(0xe0)])),console[_0x1f9f93(0x118)](_0x1f9f93(0xf3)+formatCountSummary(_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x8b)])),console[_0x1f9f93(0x118)](_0x1f9f93(0xc9)+formatCountSummary(_0x1ecf82['counts']['formInterfaces'])),console[_0x1f9f93(0x118)](_0x1f9f93(0x7c)+formatCountSummary(_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x8d)]));const _0x1c4b20=_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x11b)][_0x1f9f93(0xc7)]>0x0||_0x1ecf82[_0x1f9f93(0x108)]['experimentalKnowledgeBases']['updated']>0x0||_0x1ecf82[_0x1f9f93(0x108)]['experimentalKnowledgeBases'][_0x1f9f93(0x100)]>0x0||_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x10a)][_0x1f9f93(0xc7)]>0x0||_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x10a)][_0x1f9f93(0x8f)]>0x0||_0x1ecf82['counts'][_0x1f9f93(0x10a)][_0x1f9f93(0x100)]>0x0;_0x1c4b20&&(console[_0x1f9f93(0x118)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1ecf82[_0x1f9f93(0x108)]['experimentalKnowledgeBases'])),console[_0x1f9f93(0x118)](_0x1f9f93(0x102)+formatCountSummary(_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x10a)])));console[_0x1f9f93(0x118)]('\x20\x20Source:\x20'+a4_0x30f3fc[_0x1f9f93(0x120)](_0x2fbd19)),displayDiffs(_0x1ecf82[_0x1f9f93(0x82)],_0x1ecf82['knowledgeBases'],_0x1ecf82[_0x1f9f93(0xf2)],_0x1ecf82[_0x1f9f93(0xe0)],_0x1ecf82[_0x1f9f93(0x8b)],_0x1ecf82[_0x1f9f93(0x11b)],_0x1ecf82[_0x1f9f93(0x10a)],_0x1ecf82[_0x1f9f93(0x83)],_0x1ecf82['chatInterfaces']);if(_0x4fcec0)return console['log'](a4_0x30f3fc[_0x1f9f93(0xe4)](_0x1f9f93(0xbd))),0x0;if(_0x586465===0x0&&_0x53372f===0x0){console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xea)](_0x1f9f93(0x11c)));const _0x5559c6=getLLMProjectUrl(_0x37e301,_0x1ecf82['projectId']);return console[_0x1f9f93(0x118)](_0x1f9f93(0x8a)+a4_0x30f3fc[_0x1f9f93(0x120)](_0x5559c6)),0x0;}if(!_0x289760&&!_0x5ad3d6){if(!isInteractive())return console[_0x1f9f93(0x94)](a4_0x30f3fc['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1f9f93(0x94)](a4_0x30f3fc[_0x1f9f93(0x88)](_0x1f9f93(0x121))),0x1;const _0x8a14d9=await confirmKey(_0x1f9f93(0x80)+(_0x586465+_0x53372f)+'\x20resources?');if(!_0x8a14d9)return console['log'](a4_0x30f3fc[_0x1f9f93(0xe4)](_0x1f9f93(0x87)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x3618fb}=await withSpinner(_0x1f9f93(0xd9),()=>_0x422fa3['llm']['pushProject'](_0x2fbd19,{'force':_0x5ad3d6})),_0x304928=_0x3618fb[_0x1f9f93(0x108)][_0x1f9f93(0x82)][_0x1f9f93(0xe5)]>0x0||_0x3618fb[_0x1f9f93(0x108)]['knowledgeBases']['errors']>0x0||_0x3618fb['counts']['textKnowledgeBases'][_0x1f9f93(0xe5)]>0x0||_0x3618fb[_0x1f9f93(0x108)][_0x1f9f93(0xe0)][_0x1f9f93(0xe5)]>0x0||_0x3618fb[_0x1f9f93(0x108)][_0x1f9f93(0x83)][_0x1f9f93(0xe5)]>0x0||_0x3618fb['counts'][_0x1f9f93(0x8d)]['errors']>0x0;if(_0x304928){console[_0x1f9f93(0x118)](a4_0x30f3fc['yellow'](_0x1f9f93(0x84))),console[_0x1f9f93(0x118)](),console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0xd6)));for(const _0x3cba6d of _0x3618fb[_0x1f9f93(0x82)]){_0x3cba6d['action']==='error'&&console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0xa8)+_0x3cba6d[_0x1f9f93(0xaa)]+_0x1f9f93(0xcd)+_0x3cba6d['error']));}for(const _0x3dd7b2 of _0x3618fb[_0x1f9f93(0x112)]){_0x3dd7b2[_0x1f9f93(0x96)]===_0x1f9f93(0x94)&&console['log'](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0x95)+_0x3dd7b2[_0x1f9f93(0xdc)]+'\x22:\x20'+_0x3dd7b2['error']));}for(const _0x4de6d9 of _0x3618fb[_0x1f9f93(0xf2)]){_0x4de6d9[_0x1f9f93(0x96)]===_0x1f9f93(0x94)&&console['log'](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0xf1)+_0x4de6d9[_0x1f9f93(0xdc)]+_0x1f9f93(0xcd)+_0x4de6d9[_0x1f9f93(0x94)]));}for(const _0x4548b7 of _0x3618fb[_0x1f9f93(0xe0)]){_0x4548b7[_0x1f9f93(0x96)]==='error'&&console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0x124)+_0x4548b7[_0x1f9f93(0xdc)]+_0x1f9f93(0xcd)+_0x4548b7[_0x1f9f93(0x94)]));}for(const _0x41762e of _0x3618fb['integrations']){_0x41762e[_0x1f9f93(0x96)]==='error'&&console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)]('\x20\x20Integration\x20\x22'+_0x41762e[_0x1f9f93(0xdc)]+_0x1f9f93(0xcd)+_0x41762e[_0x1f9f93(0x94)]));}for(const _0x17ffcb of _0x3618fb[_0x1f9f93(0x83)]){_0x17ffcb[_0x1f9f93(0x96)]===_0x1f9f93(0x94)&&console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0x8e)+_0x17ffcb[_0x1f9f93(0xdc)]+_0x1f9f93(0xcd)+_0x17ffcb[_0x1f9f93(0x94)]));}for(const _0x5ac351 of _0x3618fb[_0x1f9f93(0x8d)]){_0x5ac351[_0x1f9f93(0x96)]===_0x1f9f93(0x94)&&console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0xe8)+_0x5ac351['name']+_0x1f9f93(0xcd)+_0x5ac351[_0x1f9f93(0x94)]));}return 0x1;}console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xea)](_0x1f9f93(0xab)+(_0x586465+_0x53372f)+_0x1f9f93(0xaf)+_0x3618fb[_0x1f9f93(0x91)]+'\x27'));const _0x560038=getLLMProjectUrl(_0x37e301,_0x3618fb[_0x1f9f93(0x7d)]);return console['log'](_0x1f9f93(0x8a)+a4_0x30f3fc[_0x1f9f93(0x120)](_0x560038)),0x0;}}
1
+ function a4_0x1b2b(_0x77fc8,_0x250269){_0x77fc8=_0x77fc8-0xfc;const _0x15597c=a4_0x1559();let _0x1b2bfc=_0x15597c[_0x77fc8];return _0x1b2bfc;}function a4_0x1559(){const _0x1371dc=['force','utf-8','New\x20project\x20ID:\x20','Output\x20path:\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','description','\x20=\x20','60DcsBDF','red','tdx.json','Cloning\x20\x22','isNew','\x22\x20to\x20\x22','39TLlDCX','Source:\x20','\x20\x20Integration\x20\x22','Agent:\x20','Pulling\x20agent\x20\x22','execute','\x20\x20Text\x20Knowledge\x20Bases:\x20','log','experimentalArtifacts','\x20files?','chatInterfaces','\x20--name\x20','16764790hdrWOE','\x20\x20tdx\x20agent\x20pull\x20','reason','\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','\x20updated','pullAgent','Using\x20context\x20project:\x20','newProjectId','\x0aError:','pullProject','output','\x20\x20Knowledge\x20Bases:\x20','Chat:\x20','\x0aWrite\x20','created','join','llm_project','agents','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20\x20Form\x20Interfaces:\x20','dirname','New\x20project:\x20','agentName','unchanged','source','\x0aChanges\x20to\x20chat\x20interface\x20\x27','agent.yml','total','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','llmProject','projectName','\x20\x20Experimental\x20Artifacts:\x20','updated','Cancelled','\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)','projectId','Status:\x20','INVALID_ARGUMENT','\x20\x20Agent\x20\x22','\x22...','Errors:','\x20\x20Prompts:\x20','Using\x20project\x20from\x20','\x22\x20to\x20new\x20project\x20\x22','225835HxOvTK','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','✔\x20Context\x20set:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','agent:push','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Project:\x20','diff','\x22:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Summary:','repeat','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','green','\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','\x0aPull\x20summary\x20for\x20\x27','New\x20project\x20name\x20is\x20required','6458607TVdlbH','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x0aChanges\x20to\x20integration\x20\x27','\x20\x20Chat\x20Interfaces:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','\x27\x20to\x20create\x20the\x20folder\x20structure.','outputPath','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Dry\x20run\x20-\x20no\x20changes\x20made','451493pvDIdu','-\x20nothing\x20pushed','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','found','\x0a✔\x20Pushed\x20','MISSING_ARGUMENT','agentId','\x20\x20Source:\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Using\x20local\x20project:\x20','3539336bkCVlh','agent:clone','outputDir','2iNdjNT','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Using\x20project:\x20','parse','sourceProjectName','cyan','error','\x20unchanged','\x22\x20to\x20a\x20different\x20profile','cwd','profile','integrations','prompts','\x20resources\x20to\x20\x27','Pushing\x20to\x20project...','\x20changed','\x20|\x20','Analyzing\x20project\x20\x22','\x20\x20Form\x20Interface\x20\x22','new','no_local_folder','\x20\x20Agents:\x20','\x20errors','arg-dir','pushProject','1279795zAksvw','formInterfaces','agent:pull','\x20\x20Chat\x20Interface\x20\x22','errors','Project\x20cloned\x20successfully','gray','112632NEnsAW','\x20new','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','knowledgeBases','textKnowledgeBases','\x0aProject\x20pushed\x20with\x20errors','Clone\x20\x22','cloneProject','Agent\x20pulled\x20successfully','pushAgent','site','Writing\x20files...','context','\x20--profile\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Using\x20current\x20project:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','newProjectName','\x20\x20Prompt\x20\x22','\x20successfully','Project\x20cloned\x20with\x20errors','\x0aChanges\x20to\x20prompt\x20\x27','session','yes','dim','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','push','Analyzing\x20changes\x20to\x20push...','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','<new-name>','\x20\x20Integrations:\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Would\x20pull\x20agent:\x20','\x20\x20Knowledge\x20Base\x20\x22','message','\x20resources?','\x22\x20from\x20project\x20\x22','dryRun','yellow','Failed\x20to\x20push\x20agent:\x20','action','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','llm','experimentalKnowledgeBases','Would\x20clone:','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','counts','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','no_context','-\x20no\x20files\x20written','Using\x20project\x20from\x20context:\x20','cwd-config'];a4_0x1559=function(){return _0x1371dc;};return a4_0x1559();}const a4_0x586001=a4_0x1b2b;(function(_0x101ac4,_0x44749c){const _0x2710d8=a4_0x1b2b,_0x3dbe72=_0x101ac4();while(!![]){try{const _0x12a629=-parseInt(_0x2710d8(0x127))/0x1*(-parseInt(_0x2710d8(0x14e))/0x2)+parseInt(_0x2710d8(0x1b1))/0x3*(-parseInt(_0x2710d8(0x16e))/0x4)+-parseInt(_0x2710d8(0x167))/0x5+parseInt(_0x2710d8(0x1ab))/0x6*(-parseInt(_0x2710d8(0x141))/0x7)+parseInt(_0x2710d8(0x14b))/0x8+-parseInt(_0x2710d8(0x138))/0x9+parseInt(_0x2710d8(0x1bd))/0xa;if(_0x12a629===_0x44749c)break;else _0x3dbe72['push'](_0x3dbe72['shift']());}catch(_0x14ca92){_0x3dbe72['push'](_0x3dbe72['shift']());}}}(a4_0x1559,0x57ea9));import a4_0x1c7c1e from'chalk';import a4_0x3d9f65 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(_0x15632b){const _0x36f2e8=a4_0x1b2b,_0x56dd4e=[];if(_0x15632b[_0x36f2e8(0x116)]!==undefined)_0x56dd4e[_0x36f2e8(0x189)](_0x15632b[_0x36f2e8(0x116)]+'\x20total');if(_0x15632b[_0x36f2e8(0x161)]!==undefined&&_0x15632b[_0x36f2e8(0x161)]>0x0)_0x56dd4e[_0x36f2e8(0x189)](a4_0x1c7c1e['green'](_0x15632b['new']+_0x36f2e8(0x16f)));if(_0x15632b[_0x36f2e8(0x109)]!==undefined&&_0x15632b[_0x36f2e8(0x109)]>0x0)_0x56dd4e[_0x36f2e8(0x189)](a4_0x1c7c1e['green'](_0x15632b[_0x36f2e8(0x109)]+'\x20created'));if(_0x15632b[_0x36f2e8(0x11b)]!==undefined&&_0x15632b['updated']>0x0)_0x56dd4e[_0x36f2e8(0x189)](a4_0x1c7c1e[_0x36f2e8(0x195)](_0x15632b[_0x36f2e8(0x11b)]+_0x36f2e8(0xff)));if(_0x15632b[_0x36f2e8(0x112)]!==undefined&&_0x15632b['unchanged']>0x0)_0x56dd4e[_0x36f2e8(0x189)](a4_0x1c7c1e[_0x36f2e8(0x16d)](_0x15632b[_0x36f2e8(0x112)]+_0x36f2e8(0x155)));if(_0x15632b[_0x36f2e8(0x16b)]!==undefined&&_0x15632b[_0x36f2e8(0x16b)]>0x0)_0x56dd4e[_0x36f2e8(0x189)](a4_0x1c7c1e[_0x36f2e8(0x1ac)](_0x15632b['errors']+_0x36f2e8(0x164)));return _0x56dd4e[_0x36f2e8(0x10a)](',\x20');}function displayDiffs(_0x1569be,_0x405a65,_0x50f142,_0x3872b5,_0x26c43d,_0x566734,_0x3f8ef3,_0x2d373e,_0x42e72b){const _0x11ec0f=a4_0x1b2b;for(const _0x37ab43 of _0x1569be){if(_0x37ab43['diff']){const _0x194ed2=_0x37ab43[_0x11ec0f(0x111)]||_0x37ab43['name'];console['log']('\x0aChanges\x20to\x20agent\x20\x27'+_0x194ed2+'\x27:'),console[_0x11ec0f(0x1b8)]('─'['repeat'](0x3c)),console[_0x11ec0f(0x1b8)](_0x37ab43['diff']),console[_0x11ec0f(0x1b8)]('─'['repeat'](0x3c));}}for(const _0x190d05 of _0x405a65){_0x190d05[_0x11ec0f(0x12e)]&&(console['log'](_0x11ec0f(0x17d)+_0x190d05[_0x11ec0f(0x19c)]+'\x27:'),console[_0x11ec0f(0x1b8)]('─'[_0x11ec0f(0x132)](0x3c)),console['log'](_0x190d05[_0x11ec0f(0x12e)]),console['log']('─'['repeat'](0x3c)));}for(const _0x501286 of _0x50f142){_0x501286['diff']&&(console[_0x11ec0f(0x1b8)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x501286['name']+'\x27:'),console[_0x11ec0f(0x1b8)]('─'['repeat'](0x3c)),console[_0x11ec0f(0x1b8)](_0x501286['diff']),console[_0x11ec0f(0x1b8)]('─'[_0x11ec0f(0x132)](0x3c)));}for(const _0x255bf9 of _0x3872b5){_0x255bf9[_0x11ec0f(0x12e)]&&(console['log'](_0x11ec0f(0x184)+_0x255bf9[_0x11ec0f(0x19c)]+'\x27:'),console[_0x11ec0f(0x1b8)]('─'[_0x11ec0f(0x132)](0x3c)),console[_0x11ec0f(0x1b8)](_0x255bf9['diff']),console[_0x11ec0f(0x1b8)]('─'['repeat'](0x3c)));}for(const _0x2ffbf8 of _0x26c43d){_0x2ffbf8[_0x11ec0f(0x12e)]&&(console[_0x11ec0f(0x1b8)](_0x11ec0f(0x13a)+_0x2ffbf8[_0x11ec0f(0x19c)]+'\x27:'),console[_0x11ec0f(0x1b8)]('─'[_0x11ec0f(0x132)](0x3c)),console['log'](_0x2ffbf8[_0x11ec0f(0x12e)]),console[_0x11ec0f(0x1b8)]('─'[_0x11ec0f(0x132)](0x3c)));}for(const _0xebd549 of _0x566734){_0xebd549[_0x11ec0f(0x12e)]&&(console[_0x11ec0f(0x1b8)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0xebd549[_0x11ec0f(0x19c)]+'\x27:'),console[_0x11ec0f(0x1b8)]('─'[_0x11ec0f(0x132)](0x3c)),console['log'](_0xebd549['diff']),console[_0x11ec0f(0x1b8)]('─'[_0x11ec0f(0x132)](0x3c)));}for(const _0x254512 of _0x3f8ef3){_0x254512[_0x11ec0f(0x12e)]&&(console['log'](_0x11ec0f(0x143)+_0x254512[_0x11ec0f(0x19c)]+'\x27:'),console[_0x11ec0f(0x1b8)]('─'[_0x11ec0f(0x132)](0x3c)),console['log'](_0x254512[_0x11ec0f(0x12e)]),console[_0x11ec0f(0x1b8)]('─'[_0x11ec0f(0x132)](0x3c)));}for(const _0x4e3418 of _0x2d373e){_0x4e3418[_0x11ec0f(0x12e)]&&(console[_0x11ec0f(0x1b8)]('\x0aChanges\x20to\x20form\x20interface\x20\x27'+_0x4e3418[_0x11ec0f(0x19c)]+'\x27:'),console[_0x11ec0f(0x1b8)]('─'[_0x11ec0f(0x132)](0x3c)),console['log'](_0x4e3418[_0x11ec0f(0x12e)]),console[_0x11ec0f(0x1b8)]('─'[_0x11ec0f(0x132)](0x3c)));}for(const _0x58c629 of _0x42e72b){_0x58c629['diff']&&(console[_0x11ec0f(0x1b8)](_0x11ec0f(0x114)+_0x58c629['name']+'\x27:'),console[_0x11ec0f(0x1b8)]('─'['repeat'](0x3c)),console['log'](_0x58c629[_0x11ec0f(0x12e)]),console[_0x11ec0f(0x1b8)]('─'[_0x11ec0f(0x132)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x586001(0x19c)]=a4_0x586001(0x169);[a4_0x586001(0x1a9)]=a4_0x586001(0x18b);async[a4_0x586001(0x1b6)](_0x356a53){const _0x4a3da9=a4_0x586001,{options:_0x308b72,args:_0x5c267a,tdx:_0x121896}=_0x356a53,_0x39013c=_0x5c267a[0x0],_0x44591d=_0x5c267a[0x1],_0x13473c=_0x308b72[_0x4a3da9(0x105)],_0x2c042f=_0x308b72[_0x4a3da9(0x194)],_0x2d8e6a=_0x308b72['force'],_0x5f3f56=_0x308b72[_0x4a3da9(0x186)],_0x455af3=_0x308b72['llmProject'],_0xe20339=_0x308b72['agent'];let _0x3ab151;if(_0x39013c){const _0x342f30=a4_0x3d9f65[_0x4a3da9(0x10a)](_0x39013c,_0x4a3da9(0x1ad));if(existsSync(_0x342f30))try{const _0x8056a0=JSON[_0x4a3da9(0x151)](readFileSync(_0x342f30,_0x4a3da9(0x1a5)));_0x8056a0[_0x4a3da9(0x10b)]&&(_0x3ab151={'llm_project':_0x8056a0[_0x4a3da9(0x10b)]});}catch{}}const _0xf0410b=findAgentConfigPath(process[_0x4a3da9(0x157)]());let _0x136c6e;if(_0xf0410b)try{const _0x55bf4b=JSON[_0x4a3da9(0x151)](readFileSync(_0xf0410b,_0x4a3da9(0x1a5)));_0x55bf4b[_0x4a3da9(0x10b)]&&(_0x136c6e={'llm_project':_0x55bf4b[_0x4a3da9(0x10b)]});}catch{}const _0x3a6bc6=resolveAgentPullArgs({'arg':_0x39013c,'agentNameArg':_0x44591d,'agentFlag':_0xe20339,'contextProject':_0x455af3,'argDirConfig':_0x3ab151,'cwdConfigPath':_0xf0410b||undefined,'cwdConfig':_0x136c6e}),{projectNameOrId:_0x3e4236,targetAgentName:_0x46eaaa,existingOutputDir:_0x25b9a3,source:_0x3a30a8}=_0x3a6bc6;if(_0x3a30a8===_0x4a3da9(0x165))console[_0x4a3da9(0x1b8)](a4_0x1c7c1e[_0x4a3da9(0x187)](_0x4a3da9(0x125)+a4_0x3d9f65[_0x4a3da9(0x10a)](_0x39013c,_0x4a3da9(0x1ad))+':\x20'+_0x3e4236));else{if(_0x3a30a8===_0x4a3da9(0x1a3))console[_0x4a3da9(0x1b8)](a4_0x1c7c1e[_0x4a3da9(0x187)]('Using\x20project:\x20'+_0x3e4236));else _0x3a30a8==='context'&&console['log'](a4_0x1c7c1e[_0x4a3da9(0x187)](_0x4a3da9(0x1a2)+_0x3e4236));}if(!_0x3e4236)return _0xe20339?(console[_0x4a3da9(0x1b8)](a4_0x1c7c1e['yellow'](_0x4a3da9(0x139))),console['log'](_0x4a3da9(0x117)),console[_0x4a3da9(0x1b8)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0x4a3da9(0x1b8)](a4_0x1c7c1e[_0x4a3da9(0x195)](_0x4a3da9(0x12c))),console[_0x4a3da9(0x1b8)]('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[_0x4a3da9(0x1b8)](_0x4a3da9(0xfe)),console[_0x4a3da9(0x1b8)](_0x4a3da9(0x135)),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[_0x4a3da9(0x1b8)](_0x4a3da9(0x19d))),0x1;if(_0x46eaaa){const {data:_0x24c598}=await withSpinner(_0x4a3da9(0x1b5)+_0x46eaaa+_0x4a3da9(0x193)+_0x3e4236+_0x4a3da9(0x122),()=>_0x121896['llm'][_0x4a3da9(0x100)](_0x3e4236,_0x46eaaa,_0x13473c,{'dryRun':_0x2c042f,'force':_0x2d8e6a}));if(_0x2c042f)return console[_0x4a3da9(0x1b8)](a4_0x1c7c1e['yellow']('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x4a3da9(0x1b8)](_0x4a3da9(0x18f)+_0x24c598['agentName']),console[_0x4a3da9(0x1b8)](_0x4a3da9(0x1a7)+_0x24c598[_0x4a3da9(0x13e)]),_0x24c598[_0x4a3da9(0x12e)]&&(console[_0x4a3da9(0x1b8)]('\x0aChanges:'),console['log']('─'[_0x4a3da9(0x132)](0x3c)),console[_0x4a3da9(0x1b8)](_0x24c598['diff']),console[_0x4a3da9(0x1b8)]('─'['repeat'](0x3c))),0x0;return console[_0x4a3da9(0x1b8)](a4_0x1c7c1e[_0x4a3da9(0x134)](_0x4a3da9(0x177))),console[_0x4a3da9(0x1b8)](_0x4a3da9(0x1b4)+_0x24c598[_0x4a3da9(0x111)]),console[_0x4a3da9(0x1b8)]('Output:\x20'+_0x24c598[_0x4a3da9(0x13e)]),console[_0x4a3da9(0x1b8)](_0x4a3da9(0x11f)+(_0x24c598[_0x4a3da9(0x1af)]?a4_0x1c7c1e[_0x4a3da9(0x134)](_0x4a3da9(0x161)):_0x24c598['hasChanges']?a4_0x1c7c1e[_0x4a3da9(0x195)](_0x4a3da9(0x11b)):a4_0x1c7c1e[_0x4a3da9(0x16d)](_0x4a3da9(0x112)))),0x0;}const _0x23b0fa=_0x25b9a3||_0x13473c,{data:_0x376971}=await withSpinner(_0x4a3da9(0x15f)+_0x3e4236+'\x22...',()=>_0x121896[_0x4a3da9(0x199)]['pullProject'](_0x3e4236,_0x23b0fa,{'dryRun':!![]})),_0x1af6e5=_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x10c)][_0x4a3da9(0x161)]+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x172)]['new']+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x173)][_0x4a3da9(0x161)]+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x15a)][_0x4a3da9(0x161)]+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x159)]['new']+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x19a)]['new']+_0x376971[_0x4a3da9(0x19e)]['experimentalArtifacts']['new']+_0x376971[_0x4a3da9(0x19e)]['formInterfaces'][_0x4a3da9(0x161)]+_0x376971[_0x4a3da9(0x19e)]['chatInterfaces'][_0x4a3da9(0x161)],_0x1ce596=_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x10c)][_0x4a3da9(0x11b)]+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x172)]['updated']+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x173)]['updated']+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x15a)][_0x4a3da9(0x11b)]+_0x376971['counts']['integrations']['updated']+_0x376971[_0x4a3da9(0x19e)]['experimentalKnowledgeBases'][_0x4a3da9(0x11b)]+_0x376971['counts'][_0x4a3da9(0x1b9)][_0x4a3da9(0x11b)]+_0x376971[_0x4a3da9(0x19e)]['formInterfaces'][_0x4a3da9(0x11b)]+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x1bb)][_0x4a3da9(0x11b)],_0x595be6=_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x10c)][_0x4a3da9(0x112)]+_0x376971[_0x4a3da9(0x19e)]['knowledgeBases'][_0x4a3da9(0x112)]+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x173)][_0x4a3da9(0x112)]+_0x376971[_0x4a3da9(0x19e)]['prompts'][_0x4a3da9(0x112)]+_0x376971[_0x4a3da9(0x19e)]['integrations']['unchanged']+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x19a)][_0x4a3da9(0x112)]+_0x376971['counts'][_0x4a3da9(0x1b9)][_0x4a3da9(0x112)]+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x168)]['unchanged']+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x1bb)][_0x4a3da9(0x112)];console[_0x4a3da9(0x1b8)](_0x4a3da9(0x136)+_0x376971[_0x4a3da9(0x119)]+'\x27:'),console[_0x4a3da9(0x1b8)]('\x20\x20'+a4_0x1c7c1e['green']('+\x20'+_0x1af6e5+'\x20new')+_0x4a3da9(0x15e)+a4_0x1c7c1e[_0x4a3da9(0x195)]('~\x20'+_0x1ce596+_0x4a3da9(0x15d))+_0x4a3da9(0x15e)+a4_0x1c7c1e[_0x4a3da9(0x187)]('=\x20'+_0x595be6+_0x4a3da9(0x155))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x10c)])),console[_0x4a3da9(0x1b8)](_0x4a3da9(0x106)+formatCountSummary(_0x376971[_0x4a3da9(0x19e)]['knowledgeBases'])),console[_0x4a3da9(0x1b8)](_0x4a3da9(0x1b7)+formatCountSummary(_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x173)])),console[_0x4a3da9(0x1b8)](_0x4a3da9(0x124)+formatCountSummary(_0x376971['counts'][_0x4a3da9(0x15a)])),console[_0x4a3da9(0x1b8)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x159)])),console[_0x4a3da9(0x1b8)](_0x4a3da9(0x10e)+formatCountSummary(_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x168)])),console[_0x4a3da9(0x1b8)](_0x4a3da9(0x13b)+formatCountSummary(_0x376971[_0x4a3da9(0x19e)]['chatInterfaces']));const _0x16a6d1=_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x19a)][_0x4a3da9(0x116)]>0x0||_0x376971[_0x4a3da9(0x19e)]['experimentalArtifacts'][_0x4a3da9(0x116)]>0x0;_0x16a6d1&&(console['log'](_0x4a3da9(0x10d)+formatCountSummary(_0x376971[_0x4a3da9(0x19e)]['experimentalKnowledgeBases'])),console[_0x4a3da9(0x1b8)](_0x4a3da9(0x11a)+formatCountSummary(_0x376971['counts'][_0x4a3da9(0x1b9)])));console[_0x4a3da9(0x1b8)]('\x20\x20Target:\x20'+a4_0x1c7c1e['cyan'](_0x376971[_0x4a3da9(0x14d)])),displayDiffs(_0x376971[_0x4a3da9(0x10c)],_0x376971[_0x4a3da9(0x172)],_0x376971['textKnowledgeBases'],_0x376971['prompts'],_0x376971[_0x4a3da9(0x159)],_0x376971['experimentalKnowledgeBases'],_0x376971[_0x4a3da9(0x1b9)],_0x376971[_0x4a3da9(0x168)],_0x376971[_0x4a3da9(0x1bb)]);if(_0x2c042f)return console[_0x4a3da9(0x1b8)](a4_0x1c7c1e['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x1af6e5===0x0&&_0x1ce596===0x0)return console[_0x4a3da9(0x1b8)](a4_0x1c7c1e[_0x4a3da9(0x134)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x376971['projectName']},_0x308b72[_0x4a3da9(0x185)]),console[_0x4a3da9(0x1b8)](a4_0x1c7c1e[_0x4a3da9(0x134)](_0x4a3da9(0x129)+a4_0x1c7c1e[_0x4a3da9(0x187)]('llm_project')+'\x20=\x20'+a4_0x1c7c1e['cyan'](_0x376971[_0x4a3da9(0x119)]))),0x0;if(!_0x5f3f56&&!_0x2d8e6a){if(!isInteractive())return console[_0x4a3da9(0x154)](a4_0x1c7c1e[_0x4a3da9(0x1ac)](_0x4a3da9(0x103)),_0x4a3da9(0x128)),console[_0x4a3da9(0x154)](a4_0x1c7c1e[_0x4a3da9(0x187)](_0x4a3da9(0x19f))),0x1;const _0x125d0c=await confirmKey(_0x4a3da9(0x108)+(_0x1af6e5+_0x1ce596)+_0x4a3da9(0x1ba));if(!_0x125d0c)return console[_0x4a3da9(0x1b8)](a4_0x1c7c1e[_0x4a3da9(0x195)](_0x4a3da9(0x11c)),_0x4a3da9(0x1a1)),0x1;}const {data:_0x2e474f}=await withSpinner(_0x4a3da9(0x17a),()=>_0x121896[_0x4a3da9(0x199)][_0x4a3da9(0x104)](_0x3e4236,_0x23b0fa,{'force':_0x2d8e6a}));return console[_0x4a3da9(0x1b8)](a4_0x1c7c1e[_0x4a3da9(0x134)]('\x0a✔\x20Pulled\x20'+(_0x1af6e5+_0x1ce596)+'\x20files\x20to\x20'+_0x2e474f[_0x4a3da9(0x14d)])),saveSessionContext({'llm_project':_0x2e474f[_0x4a3da9(0x119)]},_0x308b72[_0x4a3da9(0x185)]),console[_0x4a3da9(0x1b8)](a4_0x1c7c1e[_0x4a3da9(0x134)](_0x4a3da9(0x129)+a4_0x1c7c1e[_0x4a3da9(0x187)]('llm_project')+_0x4a3da9(0x1aa)+a4_0x1c7c1e[_0x4a3da9(0x153)](_0x2e474f['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x586001(0x19c)]=a4_0x586001(0x14c);[a4_0x586001(0x1a9)]=a4_0x586001(0x18e);async['execute'](_0x56fc1f){const _0x434a87=a4_0x586001,{options:_0x5d2a31,args:_0x1f570c,tdx:_0x6ebaab}=_0x56fc1f,_0x27f9df=_0x1f570c[0x0],_0x3e2c89=_0x5d2a31['name'],_0x48f52d=_0x5d2a31['dryRun'],_0x4e2405=_0x5d2a31[_0x434a87(0x186)],_0x12e057=_0x5d2a31[_0x434a87(0x179)],_0x3474b9=_0x5d2a31[_0x434a87(0x118)];let _0x5889f1;const _0x4f5b5c=findAgentConfigPath(process[_0x434a87(0x157)]());if(_0x27f9df){const _0xae32c5=a4_0x3d9f65[_0x434a87(0x10a)](_0x27f9df,'tdx.json');existsSync(_0xae32c5)?(_0x5889f1=_0x27f9df,console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x187)](_0x434a87(0x14a)+_0x27f9df))):_0x5889f1=_0x27f9df;}else{if(_0x4f5b5c)_0x5889f1=a4_0x3d9f65[_0x434a87(0x10f)](_0x4f5b5c),console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x187)](_0x434a87(0x17e)+_0x5889f1));else{if(_0x3474b9){const _0x4c4e70=sanitizeForFilesystem(_0x3474b9);let _0x486c00=_0x4c4e70,_0x3fca72=a4_0x3d9f65[_0x434a87(0x10a)](process[_0x434a87(0x157)](),_0x434a87(0x10c),_0x4c4e70,'tdx.json');if(!existsSync(_0x3fca72)){const _0x13bdb9=normalizeName(_0x3474b9),_0x814fa3=a4_0x3d9f65['join'](process['cwd'](),_0x434a87(0x10c),_0x13bdb9,_0x434a87(0x1ad));existsSync(_0x814fa3)&&(_0x486c00=_0x13bdb9,_0x3fca72=_0x814fa3);}if(existsSync(_0x3fca72))_0x5889f1=a4_0x3d9f65[_0x434a87(0x10f)](_0x3fca72),console['log'](a4_0x1c7c1e[_0x434a87(0x187)](_0x434a87(0x14a)+_0x5889f1));else{const _0x59cec1=_0x5d2a31[_0x434a87(0x158)];if(_0x59cec1)throw new SDKError(ErrorCode[_0x434a87(0x120)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x3474b9+_0x434a87(0x156),undefined,{'helpText':_0x434a87(0x188)+_0x434a87(0x198)+(_0x434a87(0xfc)+_0x3474b9+'\x0a')+(_0x434a87(0x13c)+_0x486c00+_0x434a87(0x1bc)+(_0x3e2c89||_0x434a87(0x18c))+_0x434a87(0x17c)+_0x59cec1)});_0x5889f1=_0x3474b9,console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x187)](_0x434a87(0x101)+_0x3474b9));}}}}if(!_0x5889f1)return console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x195)](_0x434a87(0x13f))),console[_0x434a87(0x1b8)](_0x434a87(0x12a)),console['log'](_0x434a87(0x149)),console[_0x434a87(0x1b8)](_0x434a87(0x11d)),console[_0x434a87(0x1b8)](_0x434a87(0x133)),0x1;if(!_0x3e2c89)throw new SDKError(ErrorCode[_0x434a87(0x146)],_0x434a87(0x137),undefined,{'helpText':_0x434a87(0x130)});if(!_0x4e2405&&!_0x48f52d){if(!isInteractive())return console[_0x434a87(0x154)](a4_0x1c7c1e['red'](_0x434a87(0x103)),_0x434a87(0x128)),console['error'](a4_0x1c7c1e['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x425d1d=await confirmKey(_0x434a87(0x175)+_0x5889f1+_0x434a87(0x126)+_0x3e2c89+'\x22?');if(!_0x425d1d)return console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x195)](_0x434a87(0x11c))),0x1;}const {data:_0x18e35d}=await withSpinner(_0x434a87(0x1ae)+_0x5889f1+_0x434a87(0x1b0)+_0x3e2c89+'\x22...',()=>_0x6ebaab[_0x434a87(0x199)][_0x434a87(0x176)](_0x5889f1,_0x3e2c89,{'dryRun':_0x48f52d}));if(_0x48f52d){console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x195)](_0x434a87(0x140))),console[_0x434a87(0x1b8)](_0x434a87(0x1b2)+_0x18e35d[_0x434a87(0x152)]),console['log'](_0x434a87(0x110)+_0x3e2c89),console[_0x434a87(0x1b8)](_0x434a87(0x19b)),console[_0x434a87(0x1b8)](_0x434a87(0x163)+_0x18e35d[_0x434a87(0x19e)]['agents'][_0x434a87(0x109)]),console[_0x434a87(0x1b8)](_0x434a87(0x106)+_0x18e35d[_0x434a87(0x19e)]['knowledgeBases']['created']),console[_0x434a87(0x1b8)](_0x434a87(0x124)+_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x15a)]['created']),console[_0x434a87(0x1b8)](_0x434a87(0x10e)+_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x168)][_0x434a87(0x109)]),console[_0x434a87(0x1b8)]('\x20\x20Chat\x20Interfaces:\x20'+_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x1bb)]['created']);const _0x44fcd0=_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x19a)]['created']>0x0||_0x18e35d[_0x434a87(0x19e)]['experimentalArtifacts'][_0x434a87(0x109)]>0x0;return _0x44fcd0&&(console['log'](_0x434a87(0x10d)+_0x18e35d[_0x434a87(0x19e)]['experimentalKnowledgeBases'][_0x434a87(0x109)]),console['log'](_0x434a87(0x11a)+_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x1b9)][_0x434a87(0x109)])),0x0;}const _0x3921a9=_0x18e35d[_0x434a87(0x19e)]['agents'][_0x434a87(0x16b)]>0x0||_0x18e35d['counts'][_0x434a87(0x172)][_0x434a87(0x16b)]>0x0||_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x15a)][_0x434a87(0x16b)]>0x0||_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x168)][_0x434a87(0x16b)]>0x0||_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x1bb)][_0x434a87(0x16b)]>0x0||_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x19a)][_0x434a87(0x16b)]>0x0||_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x1b9)][_0x434a87(0x16b)]>0x0;_0x3921a9?console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x195)](_0x434a87(0x183))):console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x134)](_0x434a87(0x16c)));console[_0x434a87(0x1b8)](_0x434a87(0x1b2)+_0x18e35d[_0x434a87(0x152)]),console[_0x434a87(0x1b8)](_0x434a87(0x110)+_0x18e35d[_0x434a87(0x180)]),console[_0x434a87(0x1b8)](_0x434a87(0x1a6)+_0x18e35d[_0x434a87(0x102)]),console[_0x434a87(0x1b8)](),console[_0x434a87(0x1b8)](_0x434a87(0x131)),console['log'](_0x434a87(0x163)+formatCountSummary(_0x18e35d['counts'][_0x434a87(0x10c)])),console[_0x434a87(0x1b8)](_0x434a87(0x106)+formatCountSummary(_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x172)])),console['log'](_0x434a87(0x124)+formatCountSummary(_0x18e35d['counts'][_0x434a87(0x15a)])),console[_0x434a87(0x1b8)](_0x434a87(0x18d)+formatCountSummary(_0x18e35d['counts'][_0x434a87(0x159)])),console[_0x434a87(0x1b8)](_0x434a87(0x10e)+formatCountSummary(_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x168)])),console[_0x434a87(0x1b8)](_0x434a87(0x13b)+formatCountSummary(_0x18e35d['counts'][_0x434a87(0x1bb)]));const _0x1c57f2=_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x19a)][_0x434a87(0x109)]>0x0||_0x18e35d['counts'][_0x434a87(0x19a)][_0x434a87(0x11b)]>0x0||_0x18e35d[_0x434a87(0x19e)]['experimentalKnowledgeBases']['unchanged']>0x0||_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x1b9)][_0x434a87(0x109)]>0x0||_0x18e35d['counts'][_0x434a87(0x1b9)][_0x434a87(0x11b)]>0x0||_0x18e35d[_0x434a87(0x19e)]['experimentalArtifacts'][_0x434a87(0x112)]>0x0;_0x1c57f2&&(console['log'](_0x434a87(0x10d)+formatCountSummary(_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x19a)])),console[_0x434a87(0x1b8)](_0x434a87(0x11a)+formatCountSummary(_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x1b9)])));if(_0x3921a9){console[_0x434a87(0x1b8)](),console['log'](a4_0x1c7c1e[_0x434a87(0x1ac)](_0x434a87(0x123)));for(const _0x58c7a0 of _0x18e35d[_0x434a87(0x10c)]){_0x58c7a0[_0x434a87(0x197)]===_0x434a87(0x154)&&console['log'](a4_0x1c7c1e[_0x434a87(0x1ac)](_0x434a87(0x121)+_0x58c7a0[_0x434a87(0x111)]+_0x434a87(0x12f)+_0x58c7a0[_0x434a87(0x154)]));}for(const _0x484d61 of _0x18e35d['knowledgeBases']){_0x484d61[_0x434a87(0x197)]===_0x434a87(0x154)&&console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x1ac)](_0x434a87(0x190)+_0x484d61['name']+_0x434a87(0x12f)+_0x484d61[_0x434a87(0x154)]));}for(const _0x51092a of _0x18e35d[_0x434a87(0x15a)]){_0x51092a[_0x434a87(0x197)]===_0x434a87(0x154)&&console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x1ac)](_0x434a87(0x181)+_0x51092a['name']+_0x434a87(0x12f)+_0x51092a[_0x434a87(0x154)]));}for(const _0xb8f772 of _0x18e35d[_0x434a87(0x159)]){_0xb8f772[_0x434a87(0x197)]==='error'&&console[_0x434a87(0x1b8)](a4_0x1c7c1e['red'](_0x434a87(0x1b3)+_0xb8f772[_0x434a87(0x19c)]+'\x22:\x20'+_0xb8f772[_0x434a87(0x154)]));}for(const _0x1af2ae of _0x18e35d['formInterfaces']){_0x1af2ae[_0x434a87(0x197)]===_0x434a87(0x154)&&console['log'](a4_0x1c7c1e['red'](_0x434a87(0x160)+_0x1af2ae[_0x434a87(0x19c)]+_0x434a87(0x12f)+_0x1af2ae[_0x434a87(0x154)]));}for(const _0x28ada7 of _0x18e35d[_0x434a87(0x1bb)]){_0x28ada7['action']===_0x434a87(0x154)&&console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x1ac)](_0x434a87(0x16a)+_0x28ada7[_0x434a87(0x19c)]+'\x22:\x20'+_0x28ada7[_0x434a87(0x154)]));}for(const _0x37c0b6 of _0x18e35d['experimentalKnowledgeBases']){_0x37c0b6[_0x434a87(0x197)]===_0x434a87(0x154)&&console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x1ac)](_0x434a87(0x17f)+_0x37c0b6[_0x434a87(0x19c)]+_0x434a87(0x12f)+_0x37c0b6[_0x434a87(0x154)]));}for(const _0x3b87af of _0x18e35d['experimentalArtifacts']){_0x3b87af['action']===_0x434a87(0x154)&&console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x1ac)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x3b87af[_0x434a87(0x19c)]+'\x22:\x20'+_0x3b87af[_0x434a87(0x154)]));}return 0x1;}console[_0x434a87(0x1b8)]();const _0x8f415c=getLLMProjectUrl(_0x12e057,_0x18e35d[_0x434a87(0x102)]);return console[_0x434a87(0x1b8)](_0x434a87(0x12d)+a4_0x1c7c1e[_0x434a87(0x153)](_0x8f415c)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x586001(0x12b);[a4_0x586001(0x1a9)]=a4_0x586001(0x14f);async[a4_0x586001(0x1b6)](_0x378111){const _0x45126e=a4_0x586001,{options:_0x7857ec,args:_0x3c4d92,tdx:_0x4e3b9f}=_0x378111;let _0x548e9f=_0x3c4d92[0x0]||process[_0x45126e(0x157)]();const _0x325657=_0x7857ec[_0x45126e(0x194)],_0x4ccb5f=_0x7857ec[_0x45126e(0x1a4)],_0x37cace=_0x7857ec[_0x45126e(0x186)],_0x5f3d44=_0x7857ec[_0x45126e(0x179)],_0x143be3=a4_0x3d9f65['join'](_0x548e9f,_0x45126e(0x115)),_0x52d1b8=existsSync(_0x143be3);if(_0x52d1b8){const {data:_0x358f73}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x548e9f+'\x22...',()=>_0x4e3b9f[_0x45126e(0x199)][_0x45126e(0x178)](_0x548e9f,{'dryRun':_0x325657,'force':_0x4ccb5f}));if(_0x325657)return console[_0x45126e(0x1b8)](a4_0x1c7c1e[_0x45126e(0x195)](_0x45126e(0x140))),console['log']('Would\x20push\x20agent:\x20'+_0x358f73[_0x45126e(0x111)]),0x0;if(_0x358f73[_0x45126e(0x197)]==='error')return console[_0x45126e(0x1b8)](a4_0x1c7c1e[_0x45126e(0x1ac)](_0x45126e(0x196)+_0x358f73[_0x45126e(0x154)])),0x1;console['log'](a4_0x1c7c1e[_0x45126e(0x134)]('Agent\x20'+_0x358f73['action']+_0x45126e(0x182))),console['log'](_0x45126e(0x1b4)+_0x358f73[_0x45126e(0x111)]);if(_0x358f73[_0x45126e(0x147)]&&_0x358f73[_0x45126e(0x11e)]){const _0x30af00=getLLMAgentChatUrl(_0x5f3d44,_0x358f73[_0x45126e(0x11e)],_0x358f73[_0x45126e(0x147)]);console['log'](_0x45126e(0x107)+a4_0x1c7c1e[_0x45126e(0x153)](_0x30af00));}return 0x0;}const _0x2cde61=_0x7857ec[_0x45126e(0x118)],_0xe0c93c=resolveProjectFromContext(_0x548e9f,_0x2cde61);if(_0xe0c93c[_0x45126e(0x144)])_0x548e9f=_0xe0c93c['projectDir'],_0xe0c93c[_0x45126e(0x113)]===_0x45126e(0x17b)&&console[_0x45126e(0x1b8)](a4_0x1c7c1e['dim'](_0x45126e(0x150)+_0x548e9f));else{let _0x4c42b4=_0x45126e(0x170);_0xe0c93c[_0x45126e(0xfd)]===_0x45126e(0x162)&&(_0x4c42b4=_0xe0c93c[_0x45126e(0x191)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0xe0c93c[_0x45126e(0x118)]+_0x45126e(0x13d));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xe0c93c[_0x45126e(0xfd)]===_0x45126e(0x1a0)?_0xe0c93c[_0x45126e(0x191)]:'No\x20tdx.json\x20found\x20in\x20'+_0x548e9f,undefined,{'helpText':_0x4c42b4});}const {data:_0x3e7ef3}=await withSpinner(_0x45126e(0x18a),()=>_0x4e3b9f['llm'][_0x45126e(0x166)](_0x548e9f,{'dryRun':!![]})),_0x3005b5=_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x10c)][_0x45126e(0x16b)]>0x0;if(_0x3005b5){console[_0x45126e(0x1b8)](a4_0x1c7c1e[_0x45126e(0x1ac)]('\x0aErrors\x20found:'));for(const _0x319749 of _0x3e7ef3['agents']){_0x319749[_0x45126e(0x197)]===_0x45126e(0x154)&&console['log'](a4_0x1c7c1e[_0x45126e(0x1ac)](_0x45126e(0x121)+_0x319749['agentName']+_0x45126e(0x12f)+_0x319749['error']));}return 0x1;}const _0x4f369e=_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x10c)][_0x45126e(0x109)]+_0x3e7ef3[_0x45126e(0x19e)]['knowledgeBases'][_0x45126e(0x109)]+_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x173)][_0x45126e(0x109)]+_0x3e7ef3[_0x45126e(0x19e)]['prompts'][_0x45126e(0x109)]+_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x159)][_0x45126e(0x109)]+_0x3e7ef3[_0x45126e(0x19e)]['experimentalKnowledgeBases'][_0x45126e(0x109)]+_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x1b9)][_0x45126e(0x109)]+_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x168)][_0x45126e(0x109)]+_0x3e7ef3['counts'][_0x45126e(0x1bb)][_0x45126e(0x109)],_0x2b19de=_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x10c)]['updated']+_0x3e7ef3['counts'][_0x45126e(0x172)]['updated']+_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x173)][_0x45126e(0x11b)]+_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x15a)][_0x45126e(0x11b)]+_0x3e7ef3[_0x45126e(0x19e)]['integrations'][_0x45126e(0x11b)]+_0x3e7ef3['counts']['experimentalKnowledgeBases']['updated']+_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x1b9)]['updated']+_0x3e7ef3[_0x45126e(0x19e)]['formInterfaces']['updated']+_0x3e7ef3[_0x45126e(0x19e)]['chatInterfaces'][_0x45126e(0x11b)],_0x1bed72=_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x10c)][_0x45126e(0x112)]+_0x3e7ef3['counts'][_0x45126e(0x172)]['unchanged']+_0x3e7ef3['counts']['textKnowledgeBases']['unchanged']+_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x15a)]['unchanged']+_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x159)][_0x45126e(0x112)]+_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x19a)][_0x45126e(0x112)]+_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x1b9)]['unchanged']+_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x168)][_0x45126e(0x112)]+_0x3e7ef3[_0x45126e(0x19e)]['chatInterfaces'][_0x45126e(0x112)];console['log']('\x0aPush\x20summary\x20for\x20\x27'+_0x3e7ef3[_0x45126e(0x119)]+'\x27:'),console[_0x45126e(0x1b8)]('\x20\x20'+a4_0x1c7c1e[_0x45126e(0x134)]('+\x20'+_0x4f369e+_0x45126e(0x16f))+'\x20|\x20'+a4_0x1c7c1e[_0x45126e(0x195)]('~\x20'+_0x2b19de+_0x45126e(0x15d))+'\x20|\x20'+a4_0x1c7c1e['dim']('=\x20'+_0x1bed72+'\x20unchanged')),console[_0x45126e(0x1b8)](_0x45126e(0x163)+formatCountSummary(_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x10c)])),console['log'](_0x45126e(0x106)+formatCountSummary(_0x3e7ef3[_0x45126e(0x19e)]['knowledgeBases'])),console[_0x45126e(0x1b8)](_0x45126e(0x1b7)+formatCountSummary(_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x173)])),console[_0x45126e(0x1b8)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x3e7ef3[_0x45126e(0x19e)]['prompts'])),console[_0x45126e(0x1b8)](_0x45126e(0x18d)+formatCountSummary(_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x159)])),console[_0x45126e(0x1b8)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x168)])),console['log'](_0x45126e(0x13b)+formatCountSummary(_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x1bb)]));const _0x3145a3=_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x19a)][_0x45126e(0x109)]>0x0||_0x3e7ef3['counts'][_0x45126e(0x19a)][_0x45126e(0x11b)]>0x0||_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x19a)][_0x45126e(0x112)]>0x0||_0x3e7ef3[_0x45126e(0x19e)]['experimentalArtifacts']['created']>0x0||_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x1b9)][_0x45126e(0x11b)]>0x0||_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x1b9)][_0x45126e(0x112)]>0x0;_0x3145a3&&(console[_0x45126e(0x1b8)](_0x45126e(0x10d)+formatCountSummary(_0x3e7ef3['counts'][_0x45126e(0x19a)])),console[_0x45126e(0x1b8)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x1b9)])));console[_0x45126e(0x1b8)](_0x45126e(0x148)+a4_0x1c7c1e[_0x45126e(0x153)](_0x548e9f)),displayDiffs(_0x3e7ef3['agents'],_0x3e7ef3[_0x45126e(0x172)],_0x3e7ef3[_0x45126e(0x173)],_0x3e7ef3[_0x45126e(0x15a)],_0x3e7ef3[_0x45126e(0x159)],_0x3e7ef3[_0x45126e(0x19a)],_0x3e7ef3['experimentalArtifacts'],_0x3e7ef3[_0x45126e(0x168)],_0x3e7ef3[_0x45126e(0x1bb)]);if(_0x325657)return console['log'](a4_0x1c7c1e[_0x45126e(0x195)](_0x45126e(0x171))),0x0;if(_0x4f369e===0x0&&_0x2b19de===0x0){console[_0x45126e(0x1b8)](a4_0x1c7c1e[_0x45126e(0x134)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x5e28fe=getLLMProjectUrl(_0x5f3d44,_0x3e7ef3[_0x45126e(0x11e)]);return console[_0x45126e(0x1b8)](_0x45126e(0x12d)+a4_0x1c7c1e[_0x45126e(0x153)](_0x5e28fe)),0x0;}if(!_0x37cace&&!_0x4ccb5f){if(!isInteractive())return console[_0x45126e(0x154)](a4_0x1c7c1e[_0x45126e(0x1ac)]('\x0aError:'),_0x45126e(0x128)),console[_0x45126e(0x154)](a4_0x1c7c1e['dim'](_0x45126e(0x19f))),0x1;const _0x51fae2=await confirmKey('\x0aPush\x20'+(_0x4f369e+_0x2b19de)+_0x45126e(0x192));if(!_0x51fae2)return console[_0x45126e(0x1b8)](a4_0x1c7c1e[_0x45126e(0x195)](_0x45126e(0x11c)),_0x45126e(0x142)),0x1;}const {data:_0x27f7eb}=await withSpinner(_0x45126e(0x15c),()=>_0x4e3b9f['llm'][_0x45126e(0x166)](_0x548e9f,{'force':_0x4ccb5f})),_0x5a6689=_0x27f7eb[_0x45126e(0x19e)][_0x45126e(0x10c)][_0x45126e(0x16b)]>0x0||_0x27f7eb[_0x45126e(0x19e)][_0x45126e(0x172)][_0x45126e(0x16b)]>0x0||_0x27f7eb[_0x45126e(0x19e)][_0x45126e(0x173)][_0x45126e(0x16b)]>0x0||_0x27f7eb[_0x45126e(0x19e)]['prompts'][_0x45126e(0x16b)]>0x0||_0x27f7eb[_0x45126e(0x19e)]['formInterfaces'][_0x45126e(0x16b)]>0x0||_0x27f7eb[_0x45126e(0x19e)][_0x45126e(0x1bb)][_0x45126e(0x16b)]>0x0;if(_0x5a6689){console[_0x45126e(0x1b8)](a4_0x1c7c1e['yellow'](_0x45126e(0x174))),console['log'](),console[_0x45126e(0x1b8)](a4_0x1c7c1e['red'](_0x45126e(0x123)));for(const _0x24a621 of _0x27f7eb[_0x45126e(0x10c)]){_0x24a621[_0x45126e(0x197)]==='error'&&console[_0x45126e(0x1b8)](a4_0x1c7c1e['red'](_0x45126e(0x121)+_0x24a621[_0x45126e(0x111)]+_0x45126e(0x12f)+_0x24a621['error']));}for(const _0x34a9f5 of _0x27f7eb[_0x45126e(0x172)]){_0x34a9f5[_0x45126e(0x197)]===_0x45126e(0x154)&&console[_0x45126e(0x1b8)](a4_0x1c7c1e[_0x45126e(0x1ac)](_0x45126e(0x190)+_0x34a9f5[_0x45126e(0x19c)]+_0x45126e(0x12f)+_0x34a9f5[_0x45126e(0x154)]));}for(const _0x312d84 of _0x27f7eb['textKnowledgeBases']){_0x312d84[_0x45126e(0x197)]===_0x45126e(0x154)&&console[_0x45126e(0x1b8)](a4_0x1c7c1e[_0x45126e(0x1ac)](_0x45126e(0x1a8)+_0x312d84[_0x45126e(0x19c)]+_0x45126e(0x12f)+_0x312d84['error']));}for(const _0x2dde8b of _0x27f7eb['prompts']){_0x2dde8b[_0x45126e(0x197)]===_0x45126e(0x154)&&console[_0x45126e(0x1b8)](a4_0x1c7c1e[_0x45126e(0x1ac)](_0x45126e(0x181)+_0x2dde8b[_0x45126e(0x19c)]+_0x45126e(0x12f)+_0x2dde8b[_0x45126e(0x154)]));}for(const _0x1f0535 of _0x27f7eb[_0x45126e(0x159)]){_0x1f0535[_0x45126e(0x197)]===_0x45126e(0x154)&&console['log'](a4_0x1c7c1e['red'](_0x45126e(0x1b3)+_0x1f0535['name']+_0x45126e(0x12f)+_0x1f0535[_0x45126e(0x154)]));}for(const _0x38fae0 of _0x27f7eb[_0x45126e(0x168)]){_0x38fae0[_0x45126e(0x197)]===_0x45126e(0x154)&&console['log'](a4_0x1c7c1e[_0x45126e(0x1ac)]('\x20\x20Form\x20Interface\x20\x22'+_0x38fae0[_0x45126e(0x19c)]+_0x45126e(0x12f)+_0x38fae0[_0x45126e(0x154)]));}for(const _0x5ccd8b of _0x27f7eb['chatInterfaces']){_0x5ccd8b['action']===_0x45126e(0x154)&&console[_0x45126e(0x1b8)](a4_0x1c7c1e[_0x45126e(0x1ac)](_0x45126e(0x16a)+_0x5ccd8b[_0x45126e(0x19c)]+_0x45126e(0x12f)+_0x5ccd8b['error']));}return 0x1;}console[_0x45126e(0x1b8)](a4_0x1c7c1e[_0x45126e(0x134)](_0x45126e(0x145)+(_0x4f369e+_0x2b19de)+_0x45126e(0x15b)+_0x27f7eb[_0x45126e(0x119)]+'\x27'));const _0x1c8149=getLLMProjectUrl(_0x5f3d44,_0x27f7eb['projectId']);return console[_0x45126e(0x1b8)]('Project:\x20'+a4_0x1c7c1e[_0x45126e(0x153)](_0x1c8149)),0x0;}}
@@ -1 +1 @@
1
- function a5_0x130f(){const _0x31e687=['...\x20','Available\x20tests:\x20','✓\x20PASS:\x20','Running:\x20','Project\x20path:\x20','tsv','text','404','testName','\x20\x20Site:\x20','now','\x22:\x20','projectName','\x20\x20Round\x20','some','stop','includes','Cached\x20run\x20is\x20from\x20site\x20\x22','Evaluating\x20response...','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','cyan','Available\x20tags:\x20','add','test.yml','start','\x20\x20Conversation:\x20','No\x20tests\x20found\x20with\x20tags:\x20','Output\x20written\x20to:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Failed:\x20\x20\x20','Duration:\x20','Re-evaluating\x20','36738GCDGYK','json','no_context','Test\x20','Executing\x20new\x20tests...','\x20(cached)','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','verbose','ERROR','Run\x20tests\x20for\x20an\x20LLM\x20agent','multiple_agents','Run\x20\x27tdx\x20agent\x20pull\x20','Either\x20switch\x20to\x20the\x20\x22','378HZpAhW','Conversation\x20URL:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Re-evaluating...','FAIL','dim','\x20\x20-\x20','Passed:\x20\x20\x20','description','reason','\x22,\x20but\x20current\x20site\x20is\x20\x22','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','agentName','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Tests\x20found:\x20','green','agent:test','Round\x201/','repeat','utf-8','Running\x20agent\x20tests...','\x20-\x20','basename','3FrvBiT','792508hfDFTe','white','PASS','Error:\x20No\x20previous\x20test\x20run\x20found.','No\x20tests\x20found\x20matching:\x20','testYmlPath','tests','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','conversations','Errors:\x20\x20\x20','join','conversation_url','llmProject','Error\x20writing\x20output\x20file:\x20','Round\x20','substring','✗\x20ERROR:\x20','table','yellow','push','find','status','23768nYXgZB','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','rounds','Total:\x20\x20\x20\x20','✗\x20FAIL:\x20','length','has','projectDir','size','Using\x20agent:\x20','2007985QTUnmi','\x27\x20to\x20create\x20the\x20folder\x20structure.','176326FIoPpY','tags','toLowerCase','agent','message','round','site','isSpinning',':\x20Sending\x20user\x20input...','no_tests','dryRun','resolve','/<agent-name>','\x20\x20Evaluating...\x20','resolveProjectId','executeReeval','\x20\x20Project:\x20','log','Failed\x20Tests:','Site:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','toISOString','New\x20tests\x20to\x20execute:\x20','\x20(new)','Usage:','jsonl','311170NTdUpM','output','filter','split','map','writeFileSync','reeval','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','existsSync','resolveAgentId','...','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','execute','Running\x20test:\x20','name','red','trim','llm','75320iUGGyN','Cached\x20run\x20from:\x20','Agent:\x20'];a5_0x130f=function(){return _0x31e687;};return a5_0x130f();}function a5_0x404f(_0x74378c,_0x690966){_0x74378c=_0x74378c-0x146;const _0x130f6a=a5_0x130f();let _0x404f3f=_0x130f6a[_0x74378c];return _0x404f3f;}const a5_0x4054c3=a5_0x404f;(function(_0x282fa6,_0x18686c){const _0x2a6031=a5_0x404f,_0x506991=_0x282fa6();while(!![]){try{const _0x53f547=parseInt(_0x2a6031(0x167))/0x1+-parseInt(_0x2a6031(0x1d2))/0x2+-parseInt(_0x2a6031(0x1ae))/0x3*(parseInt(_0x2a6031(0x1af))/0x4)+-parseInt(_0x2a6031(0x155))/0x5+parseInt(_0x2a6031(0x18a))/0x6+parseInt(_0x2a6031(0x1d0))/0x7+parseInt(_0x2a6031(0x1c6))/0x8*(parseInt(_0x2a6031(0x197))/0x9);if(_0x53f547===_0x18686c)break;else _0x506991['push'](_0x506991['shift']());}catch(_0x303558){_0x506991['push'](_0x506991['shift']());}}}(a5_0x130f,0x234ac));import*as a5_0x454be6 from'node:fs';import*as a5_0x209112 from'node:path';import a5_0x30cc29 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0x4054c3(0x1a7);[a5_0x4054c3(0x19f)]=a5_0x4054c3(0x193);async[a5_0x4054c3(0x161)](_0x27efe8){const _0x4d4e0=a5_0x4054c3,{options:_0x5ae384,args:_0x501306,tdx:_0x480780}=_0x27efe8,_0x3415cd=_0x501306[0x0]||'.',_0x3b49df=_0x5ae384[_0x4d4e0(0x1dc)],_0x4e4942=_0x5ae384,_0x5aca8a=_0x4e4942['eval']===![],_0xaeddd4=_0x4e4942[_0x4d4e0(0x15b)],_0x20bf50=_0x4e4942[_0x4d4e0(0x163)],_0x5e7997=_0x4e4942[_0x4d4e0(0x1d3)],_0x2337eb=_0x5ae384['site'],_0x53eb0e=_0x4e4942[_0x4d4e0(0x156)];if(_0xaeddd4&&_0x5aca8a)return console['log'](a5_0x30cc29[_0x4d4e0(0x164)](_0x4d4e0(0x15c))),0x1;let _0x50923f=_0x4d4e0(0x1c1);if(_0x4e4942[_0x4d4e0(0x18b)])_0x50923f=_0x4d4e0(0x18b);else{if(_0x4e4942['jsonl'])_0x50923f=_0x4d4e0(0x154);else{if(_0x4e4942[_0x4d4e0(0x16f)])_0x50923f=_0x4d4e0(0x16f);else{if(_0x4e4942[_0x4d4e0(0x1c1)])_0x50923f='table';}}}const _0x3a4d97=_0x4e4942[_0x4d4e0(0x1bc)];let _0x40c9f2=_0x3415cd;const _0x1eeed4=a5_0x454be6[_0x4d4e0(0x15d)](_0x3415cd),_0x5cb21e=_0x3415cd==='.';if(!_0x1eeed4||_0x5cb21e){const _0x1eba19=resolveProjectFromContext(_0x3415cd,_0x3a4d97,{'requireFile':_0x4d4e0(0x181)});if(_0x1eba19['found'])_0x40c9f2=_0x1eba19[_0x4d4e0(0x1cd)],_0x1eba19['source']==='context'&&console[_0x4d4e0(0x14b)](a5_0x30cc29['dim'](_0x4d4e0(0x1cf)+_0x40c9f2));else switch(_0x1eba19[_0x4d4e0(0x1a0)]){case _0x4d4e0(0x18c):console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x1c2)](_0x1eba19[_0x4d4e0(0x1d6)])),console[_0x4d4e0(0x14b)](),console['log'](_0x4d4e0(0x153)),console[_0x4d4e0(0x14b)]('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console['log'](_0x4d4e0(0x17d)),console['log'](),console[_0x4d4e0(0x14b)](_0x4d4e0(0x14e));return 0x1;case'no_local_folder':console['log'](a5_0x30cc29[_0x4d4e0(0x1c2)](_0x1eba19['message'])),console[_0x4d4e0(0x14b)](),console['log'](_0x4d4e0(0x195)+_0x1eba19['llmProject']+_0x4d4e0(0x1d1));return 0x1;case _0x4d4e0(0x194):{const _0x50404b=a5_0x209112[_0x4d4e0(0x1ad)](_0x1eba19[_0x4d4e0(0x1cd)]);console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x1c2)](_0x4d4e0(0x1b6)+_0x1eba19[_0x4d4e0(0x1bc)]+'\x22:'));for(const _0x2f579c of _0x1eba19['agentDirs']){console['log'](_0x4d4e0(0x19d)+_0x2f579c);}return console['log'](),console[_0x4d4e0(0x14b)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x50404b+_0x4d4e0(0x146)),0x1;}case _0x4d4e0(0x1db):console['log'](a5_0x30cc29['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x1eba19[_0x4d4e0(0x1bc)]+'\x22.')),console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x19c)](_0x4d4e0(0x16e)+_0x1eba19['projectDir'])),console[_0x4d4e0(0x14b)](),console[_0x4d4e0(0x14b)](_0x4d4e0(0x14f));return 0x1;}}const {definition:_0x2f7839,agentInfo:_0x1b3616}=parseTestFile(_0x40c9f2);let _0x4ca613=_0x2f7839[_0x4d4e0(0x1b5)];if(_0x20bf50){const _0x20af1d=_0x20bf50[_0x4d4e0(0x158)](',')[_0x4d4e0(0x159)](_0x204f21=>_0x204f21['trim']());_0x4ca613=_0x2f7839['tests']['filter'](_0x5c6e0c=>_0x20af1d[_0x4d4e0(0x17a)](_0x5c6e0c['name']));if(_0x4ca613[_0x4d4e0(0x1cb)]===0x0)return console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x1c2)](_0x4d4e0(0x1b3)+_0x20bf50)),console[_0x4d4e0(0x14b)](a5_0x30cc29['dim'](_0x4d4e0(0x16b)+_0x2f7839[_0x4d4e0(0x1b5)]['map'](_0x29ef4d=>_0x29ef4d[_0x4d4e0(0x163)])[_0x4d4e0(0x1ba)](',\x20'))),0x1;}if(_0x5e7997){const _0x445095=_0x5e7997[_0x4d4e0(0x158)](',')[_0x4d4e0(0x159)](_0x50fb57=>_0x50fb57[_0x4d4e0(0x165)]()[_0x4d4e0(0x1d4)]());_0x4ca613=_0x4ca613['filter'](_0x400438=>_0x400438[_0x4d4e0(0x1d3)]?.[_0x4d4e0(0x178)](_0x24444c=>_0x445095['includes'](_0x24444c[_0x4d4e0(0x1d4)]())));if(_0x4ca613['length']===0x0){console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x1c2)](_0x4d4e0(0x184)+_0x5e7997));const _0x1aefa9=new Set();return _0x2f7839[_0x4d4e0(0x1b5)]['forEach'](_0x564927=>_0x564927['tags']?.['forEach'](_0x779181=>_0x1aefa9[_0x4d4e0(0x180)](_0x779181))),_0x1aefa9[_0x4d4e0(0x1ce)]>0x0?console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x19c)](_0x4d4e0(0x17f)+[..._0x1aefa9]['join'](',\x20'))):console[_0x4d4e0(0x14b)](a5_0x30cc29['dim']('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0xaeddd4)return this['executeReeval'](_0x27efe8,{'definition':{'tests':_0x4ca613},'agentInfo':_0x1b3616,'outputFormat':_0x50923f,'outputFile':_0x53eb0e,'testNames':_0x20bf50});if(_0x3b49df){console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x17e)]('Test\x20Configuration:')),console[_0x4d4e0(0x14b)](_0x4d4e0(0x173)+a5_0x30cc29[_0x4d4e0(0x1b0)](_0x2337eb)),console[_0x4d4e0(0x14b)](_0x4d4e0(0x14a)+a5_0x30cc29[_0x4d4e0(0x1b0)](_0x1b3616[_0x4d4e0(0x176)])),console[_0x4d4e0(0x14b)]('\x20\x20Agent:\x20'+a5_0x30cc29['white'](_0x1b3616['agentName'])),console['log'](),console[_0x4d4e0(0x14b)](_0x4d4e0(0x1a5)+a5_0x30cc29[_0x4d4e0(0x1b0)](_0x4ca613[_0x4d4e0(0x1cb)]));for(let _0x4e986d=0x0;_0x4e986d<_0x4ca613[_0x4d4e0(0x1cb)];_0x4e986d++){const _0x534006=_0x4ca613[_0x4e986d],_0x301af5=_0x534006[_0x4d4e0(0x1c8)]['length']===0x1?_0x4d4e0(0x1d7):_0x4d4e0(0x1c8),_0x4556fa=_0x534006[_0x4d4e0(0x1d3)]?.['length']?'\x20['+_0x534006[_0x4d4e0(0x1d3)][_0x4d4e0(0x1ba)](',\x20')+']':'';console['log']('\x20\x20'+(_0x4e986d+0x1)+'.\x20'+a5_0x30cc29[_0x4d4e0(0x1b0)](_0x534006[_0x4d4e0(0x163)])+'\x20('+_0x534006[_0x4d4e0(0x1c8)][_0x4d4e0(0x1cb)]+'\x20'+_0x301af5+')'+a5_0x30cc29[_0x4d4e0(0x19c)](_0x4556fa));}return 0x0;}let _0x58e9e2,_0x25cf50;try{_0x58e9e2=await _0x480780[_0x4d4e0(0x166)][_0x4d4e0(0x148)](_0x1b3616[_0x4d4e0(0x176)]);}catch(_0x57dc3d){const _0x2bb2e6=_0x57dc3d instanceof Error?_0x57dc3d['message']:String(_0x57dc3d);return _0x2bb2e6[_0x4d4e0(0x17a)](_0x4d4e0(0x171))||_0x2bb2e6[_0x4d4e0(0x1d4)]()[_0x4d4e0(0x17a)]('not\x20found')?console['log'](a5_0x30cc29['red']('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x1b3616[_0x4d4e0(0x176)])):console['log'](a5_0x30cc29[_0x4d4e0(0x164)](_0x4d4e0(0x160)+_0x1b3616[_0x4d4e0(0x176)]+_0x4d4e0(0x175)+_0x2bb2e6)),0x1;}try{_0x25cf50=await _0x480780[_0x4d4e0(0x166)][_0x4d4e0(0x15e)](_0x1b3616[_0x4d4e0(0x1a3)],_0x58e9e2);}catch(_0x2cb56e){const _0x4c138c=_0x2cb56e instanceof Error?_0x2cb56e[_0x4d4e0(0x1d6)]:String(_0x2cb56e);return _0x4c138c[_0x4d4e0(0x17a)]('404')||_0x4c138c[_0x4d4e0(0x1d4)]()[_0x4d4e0(0x17a)]('not\x20found')?console['log'](a5_0x30cc29['red']('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x1b3616[_0x4d4e0(0x1a3)])):console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x164)](_0x4d4e0(0x1b7)+_0x1b3616[_0x4d4e0(0x1a3)]+_0x4d4e0(0x175)+_0x4c138c)),0x1;}let _0x48301d;if(!_0x5aca8a)try{_0x48301d=await setupEvaluatorAgent(_0x480780['llm'],_0x5ae384['verbose']);}catch(_0xc83081){const _0x212c7b=_0xc83081 instanceof Error?_0xc83081[_0x4d4e0(0x1d6)]:String(_0xc83081);return console[_0x4d4e0(0x14b)](a5_0x30cc29['red'](_0x4d4e0(0x199)+_0x212c7b)),0x1;}console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x17e)](_0x4d4e0(0x1ab))),console[_0x4d4e0(0x14b)](_0x4d4e0(0x14d)+a5_0x30cc29['white'](_0x2337eb)),console[_0x4d4e0(0x14b)](_0x4d4e0(0x169)+a5_0x30cc29[_0x4d4e0(0x1b0)](_0x1b3616[_0x4d4e0(0x176)]+'/'+_0x1b3616[_0x4d4e0(0x1a3)])),console['log']();const _0x5218e6=[],_0x77074b=[],_0x20cc30=Date[_0x4d4e0(0x174)]();for(let _0x205c69=0x0;_0x205c69<_0x4ca613[_0x4d4e0(0x1cb)];_0x205c69++){const _0x4281c3=_0x4ca613[_0x205c69];_0x4ca613[_0x4d4e0(0x1cb)]>0x1?console[_0x4d4e0(0x14b)](_0x4d4e0(0x18d)+(_0x205c69+0x1)+'/'+_0x4ca613[_0x4d4e0(0x1cb)]+':\x20'+a5_0x30cc29[_0x4d4e0(0x1b0)](_0x4281c3[_0x4d4e0(0x163)])):console['log'](_0x4d4e0(0x162)+a5_0x30cc29['white'](_0x4281c3[_0x4d4e0(0x163)]));const _0x210b45=createCommandSpinner(_0x4d4e0(0x1a8)+_0x4281c3[_0x4d4e0(0x1c8)][_0x4d4e0(0x1cb)]+_0x4d4e0(0x1da));_0x210b45[_0x4d4e0(0x182)]();try{const {result:_0x1a733c,conversation:_0x5bcc8d}=await runTest(_0x480780[_0x4d4e0(0x166)],_0x4281c3,{'agentId':_0x25cf50,'projectId':_0x58e9e2,'site':_0x2337eb,'noEval':_0x5aca8a,'evaluatorId':_0x48301d,'onRoundStart':(_0x5ec4e0,_0x4dd9c4)=>{const _0x3259c4=_0x4d4e0;_0x210b45[_0x3259c4(0x170)]=_0x3259c4(0x1be)+(_0x5ec4e0+0x1)+'/'+_0x4dd9c4+_0x3259c4(0x1da);},'onRoundComplete':(_0x4d2d83,_0x47701c,_0x57922a)=>{const _0x51c6ae=_0x4d4e0,_0x3786bd=formatElapsed(_0x47701c);_0x57922a?console[_0x51c6ae(0x14b)](_0x51c6ae(0x177)+(_0x4d2d83+0x1)+'/'+_0x4281c3['rounds']['length']+_0x51c6ae(0x16a)+a5_0x30cc29['green']('✓')+'\x20('+_0x3786bd+')'):console[_0x51c6ae(0x14b)](_0x51c6ae(0x177)+(_0x4d2d83+0x1)+'/'+_0x4281c3['rounds']['length']+_0x51c6ae(0x16a)+a5_0x30cc29[_0x51c6ae(0x164)]('✗'));},'onEvaluationStart':()=>{const _0x4789b6=_0x4d4e0;_0x210b45['text']=_0x4789b6(0x17c);},'onEvaluationComplete':_0x41d38c=>{const _0xae8b35=_0x4d4e0,_0x4fe23c=formatElapsed(_0x41d38c);console[_0xae8b35(0x14b)](_0xae8b35(0x147)+a5_0x30cc29[_0xae8b35(0x1a6)]('✓')+'\x20('+_0x4fe23c+')');}});_0x210b45[_0x4d4e0(0x179)](),_0x5218e6[_0x4d4e0(0x1c3)](_0x1a733c),_0x77074b[_0x4d4e0(0x1c3)](_0x5bcc8d);if(_0x1a733c[_0x4d4e0(0x1c5)]===_0x4d4e0(0x1b1))console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x1a6)]('✓\x20PASS:\x20'+_0x1a733c[_0x4d4e0(0x1a0)]));else _0x1a733c['status']===_0x4d4e0(0x19b)?console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x164)](_0x4d4e0(0x1ca)+_0x1a733c[_0x4d4e0(0x1a0)])):console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x164)](_0x4d4e0(0x1c0)+_0x1a733c[_0x4d4e0(0x1a0)]));_0x1a733c[_0x4d4e0(0x1bb)]&&console[_0x4d4e0(0x14b)](a5_0x30cc29['dim'](_0x4d4e0(0x198)+_0x1a733c[_0x4d4e0(0x1bb)])),console[_0x4d4e0(0x14b)]();}catch(_0x264315){_0x210b45['stop']();const _0x4615b0=_0x264315 instanceof Error?_0x264315['message']:String(_0x264315);console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x164)](_0x4d4e0(0x1c0)+_0x4615b0)),console['log'](),_0x5218e6[_0x4d4e0(0x1c3)]({'name':_0x4281c3[_0x4d4e0(0x163)],'status':_0x4d4e0(0x192),'reason':_0x4615b0,'timestamp':new Date()[_0x4d4e0(0x150)](),'duration_ms':0x0});}}const _0xe7743a=Date[_0x4d4e0(0x174)]()-_0x20cc30,_0x1af56d=_0x5218e6[_0x4d4e0(0x157)](_0x5724cb=>_0x5724cb['status']===_0x4d4e0(0x1b1))['length'],_0x9e76c7=_0x5218e6['filter'](_0x202a63=>_0x202a63[_0x4d4e0(0x1c5)]==='FAIL')['length'],_0x1da90c=_0x5218e6['filter'](_0x531a8d=>_0x531a8d[_0x4d4e0(0x1c5)]===_0x4d4e0(0x192))[_0x4d4e0(0x1cb)];console[_0x4d4e0(0x14b)]('━'[_0x4d4e0(0x1a9)](0x3c)),console['log']('Test\x20Summary'),console['log']('━'[_0x4d4e0(0x1a9)](0x3c)),console[_0x4d4e0(0x14b)]('Total:\x20\x20\x20\x20'+_0x5218e6[_0x4d4e0(0x1cb)]),console['log'](_0x4d4e0(0x19e)+a5_0x30cc29['green'](_0x1af56d)),console[_0x4d4e0(0x14b)](_0x4d4e0(0x187)+a5_0x30cc29['red'](_0x9e76c7));_0x1da90c>0x0&&console[_0x4d4e0(0x14b)]('Errors:\x20\x20\x20'+a5_0x30cc29[_0x4d4e0(0x164)](_0x1da90c));console[_0x4d4e0(0x14b)]('Duration:\x20'+formatElapsed(_0xe7743a)),console['log']('━'[_0x4d4e0(0x1a9)](0x3c));const _0x71912=_0x5218e6[_0x4d4e0(0x157)](_0x285a21=>_0x285a21['status']!==_0x4d4e0(0x1b1));if(_0x71912[_0x4d4e0(0x1cb)]>0x0){console[_0x4d4e0(0x14b)](),console['log'](_0x4d4e0(0x14c));for(const _0xf37b16 of _0x71912){const _0x426f3c=a5_0x30cc29[_0x4d4e0(0x164)]('✗'),_0x5db1e8=_0xf37b16[_0x4d4e0(0x1a0)][_0x4d4e0(0x1cb)]>0x32?_0xf37b16[_0x4d4e0(0x1a0)][_0x4d4e0(0x1bf)](0x0,0x32)+_0x4d4e0(0x15f):_0xf37b16[_0x4d4e0(0x1a0)];console[_0x4d4e0(0x14b)]('\x20\x20'+_0x426f3c+'\x20'+_0xf37b16[_0x4d4e0(0x163)]+':\x20'+_0x5db1e8);}}const _0x30f261={'summary':{'total':_0x5218e6[_0x4d4e0(0x1cb)],'passed':_0x1af56d,'failed':_0x9e76c7,'errors':_0x1da90c>0x0?_0x1da90c:undefined,'duration_ms':_0xe7743a},'tests':_0x5218e6,'agent':{'project':_0x1b3616['projectName'],'name':_0x1b3616[_0x4d4e0(0x1a3)],'site':_0x2337eb},'timestamp':new Date(_0x20cc30)[_0x4d4e0(0x150)]()};try{const _0x2affc4=buildCachedTestRun(_0x77074b,{'site':_0x2337eb,'projectId':_0x58e9e2,'projectName':_0x1b3616[_0x4d4e0(0x176)],'agentId':_0x25cf50,'agentName':_0x1b3616[_0x4d4e0(0x1a3)],'testYmlPath':a5_0x209112[_0x4d4e0(0x1dd)](_0x1b3616[_0x4d4e0(0x1b4)])});saveLastTestRun(_0x2affc4);}catch{}if(_0x50923f!=='table'||_0x53eb0e){const _0x37889b=formatResults(_0x30f261,_0x50923f);if(_0x53eb0e)try{a5_0x454be6[_0x4d4e0(0x15a)](_0x53eb0e,_0x37889b,_0x4d4e0(0x1aa)),console[_0x4d4e0(0x14b)](),console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x19c)]('Output\x20written\x20to:\x20'+_0x53eb0e));}catch(_0x8fbf36){return console[_0x4d4e0(0x14b)](),console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x164)](_0x4d4e0(0x1bd)+_0x8fbf36)),0x1;}else console['log'](),console['log'](_0x37889b);}return _0x71912['length']>0x0?0x1:0x0;}async[a5_0x4054c3(0x149)](_0x1838fc,_0x3b886a){const _0x1db64a=a5_0x4054c3,{options:_0x407ef2,tdx:_0x16fdb4}=_0x1838fc,{definition:_0x2362e0,agentInfo:_0x5b9c48,outputFormat:_0xc56503,outputFile:_0x5521b6}=_0x3b886a,_0x461555=_0x407ef2[_0x1db64a(0x1d8)],_0x489b7e=loadLastTestRun();if(!_0x489b7e)return console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x164)](_0x1db64a(0x1b2))),console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x19c)](_0x1db64a(0x1c7))),0x1;if(_0x489b7e['agent'][_0x1db64a(0x1a3)]!==_0x5b9c48['agentName'])return console[_0x1db64a(0x14b)](a5_0x30cc29['red'](_0x1db64a(0x190)+_0x489b7e[_0x1db64a(0x1d5)][_0x1db64a(0x1a3)]+_0x1db64a(0x186)+_0x5b9c48[_0x1db64a(0x1a3)]+'\x22.')),console['log'](a5_0x30cc29[_0x1db64a(0x19c)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x51ef13=new Set(_0x489b7e[_0x1db64a(0x1b8)][_0x1db64a(0x159)](_0x504f29=>_0x504f29[_0x1db64a(0x172)])),_0x3ef9d2=_0x2362e0[_0x1db64a(0x1b5)][_0x1db64a(0x157)](_0x3495d4=>!_0x51ef13[_0x1db64a(0x1cc)](_0x3495d4[_0x1db64a(0x163)]));if(_0x3ef9d2[_0x1db64a(0x1cb)]>0x0&&_0x489b7e[_0x1db64a(0x1d8)]!==_0x461555)return console[_0x1db64a(0x14b)](a5_0x30cc29['red'](_0x1db64a(0x1a2))),console[_0x1db64a(0x14b)](a5_0x30cc29['dim'](_0x1db64a(0x17b)+_0x489b7e['site']+_0x1db64a(0x1a1)+_0x461555+'\x22.')),console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x19c)](_0x1db64a(0x196)+_0x489b7e[_0x1db64a(0x1d8)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0xc5615e=_0x2362e0[_0x1db64a(0x1b5)][_0x1db64a(0x157)](_0x36c7b1=>_0x51ef13[_0x1db64a(0x1cc)](_0x36c7b1[_0x1db64a(0x163)])),_0x562266=_0x3ef9d2;let _0x5a9db6;try{_0x5a9db6=await setupEvaluatorAgent(_0x16fdb4[_0x1db64a(0x166)],_0x407ef2[_0x1db64a(0x191)]);}catch(_0x187447){const _0x3405d9=_0x187447 instanceof Error?_0x187447['message']:String(_0x187447);return console[_0x1db64a(0x14b)](a5_0x30cc29['red'](_0x1db64a(0x199)+_0x3405d9)),0x1;}console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x17e)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x1db64a(0x14b)](_0x1db64a(0x168)+a5_0x30cc29[_0x1db64a(0x1b0)](_0x489b7e['timestamp'])),console[_0x1db64a(0x14b)](_0x1db64a(0x169)+a5_0x30cc29[_0x1db64a(0x1b0)](_0x489b7e['agent']['projectName']+'/'+_0x489b7e[_0x1db64a(0x1d5)]['agentName']));_0x562266[_0x1db64a(0x1cb)]>0x0&&console[_0x1db64a(0x14b)](_0x1db64a(0x151)+a5_0x30cc29[_0x1db64a(0x1c2)](_0x562266[_0x1db64a(0x1cb)]));console[_0x1db64a(0x14b)]();const _0x14d05e=[],_0x58fe52=Date['now'](),_0x4d9cda=createCommandSpinner(_0x1db64a(0x19a));if(_0xc5615e[_0x1db64a(0x1cb)]>0x0)try{const _0x424d8f=await reevaluateFromCache(_0x16fdb4['llm'],_0x489b7e,{'tests':_0xc5615e},{'evaluatorId':_0x5a9db6,'onTestStart':(_0x55badd,_0x293d4a,_0x53227e)=>{const _0x16d8d3=_0x1db64a;_0x4d9cda['text']=_0x16d8d3(0x189)+(_0x293d4a+0x1)+'/'+_0x53227e+':\x20'+_0x55badd+_0x16d8d3(0x15f);if(!_0x4d9cda[_0x16d8d3(0x1d9)])_0x4d9cda['start']();},'onTestComplete':(_0x1aba78,_0x5cb5ec)=>{const _0x74cce1=_0x1db64a;_0x4d9cda[_0x74cce1(0x179)]();if(_0x5cb5ec[_0x74cce1(0x1c5)]===_0x74cce1(0x1b1))console[_0x74cce1(0x14b)](a5_0x30cc29[_0x74cce1(0x1a6)](_0x74cce1(0x16c)+_0x1aba78)+a5_0x30cc29[_0x74cce1(0x19c)](_0x74cce1(0x18f)));else _0x5cb5ec[_0x74cce1(0x1c5)]==='FAIL'?console[_0x74cce1(0x14b)](a5_0x30cc29['red'](_0x74cce1(0x1ca)+_0x1aba78+'\x20-\x20'+_0x5cb5ec[_0x74cce1(0x1a0)])+a5_0x30cc29[_0x74cce1(0x19c)](_0x74cce1(0x18f))):console[_0x74cce1(0x14b)](a5_0x30cc29['red'](_0x74cce1(0x1c0)+_0x1aba78+_0x74cce1(0x1ac)+_0x5cb5ec[_0x74cce1(0x1a0)]));_0x5cb5ec[_0x74cce1(0x1bb)]&&console[_0x74cce1(0x14b)](a5_0x30cc29['dim'](_0x74cce1(0x183)+_0x5cb5ec['conversation_url'])),_0x14d05e[_0x74cce1(0x1c3)](_0x5cb5ec);},'onTestSkipped':(_0x21b680,_0x54d799)=>{const _0x26697f=_0x1db64a;_0x4d9cda['stop'](),console['log'](a5_0x30cc29[_0x26697f(0x1c2)]('⚠\x20SKIPPED:\x20'+_0x21b680+'\x20-\x20'+_0x54d799));}});for(const _0x44a5ec of _0x424d8f){!_0x14d05e[_0x1db64a(0x1c4)](_0x4a393b=>_0x4a393b[_0x1db64a(0x163)]===_0x44a5ec[_0x1db64a(0x163)])&&_0x14d05e[_0x1db64a(0x1c3)](_0x44a5ec);}}catch(_0x131e5b){_0x4d9cda[_0x1db64a(0x179)]();const _0x21729f=_0x131e5b instanceof Error?_0x131e5b[_0x1db64a(0x1d6)]:String(_0x131e5b);return console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x164)](_0x1db64a(0x1a4)+_0x21729f)),0x1;}_0x4d9cda['stop']();if(_0x562266[_0x1db64a(0x1cb)]>0x0){console[_0x1db64a(0x14b)](),console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x17e)](_0x1db64a(0x18e)));const {projectId:_0x36e555,agentId:_0x18ff33}=_0x489b7e[_0x1db64a(0x1d5)];for(const _0x58b879 of _0x562266){console[_0x1db64a(0x14b)](_0x1db64a(0x16d)+a5_0x30cc29['white'](_0x58b879[_0x1db64a(0x163)]));const _0x59c796=createCommandSpinner('Round\x201/'+_0x58b879[_0x1db64a(0x1c8)][_0x1db64a(0x1cb)]+_0x1db64a(0x1da));_0x59c796['start']();try{const {result:_0x522886}=await runTest(_0x16fdb4[_0x1db64a(0x166)],_0x58b879,{'agentId':_0x18ff33,'projectId':_0x36e555,'site':_0x489b7e['site'],'noEval':![],'evaluatorId':_0x5a9db6,'onRoundStart':(_0xeb7ca2,_0x487cdf)=>{const _0x20b876=_0x1db64a;_0x59c796[_0x20b876(0x170)]=_0x20b876(0x1be)+(_0xeb7ca2+0x1)+'/'+_0x487cdf+_0x20b876(0x1da);},'onRoundComplete':(_0x2ac300,_0x308e39,_0x14effe)=>{const _0x54622f=_0x1db64a,_0x4fd4a3=formatElapsed(_0x308e39);_0x14effe?console[_0x54622f(0x14b)](_0x54622f(0x177)+(_0x2ac300+0x1)+'/'+_0x58b879[_0x54622f(0x1c8)][_0x54622f(0x1cb)]+'...\x20'+a5_0x30cc29[_0x54622f(0x1a6)]('✓')+'\x20('+_0x4fd4a3+')'):console['log'](_0x54622f(0x177)+(_0x2ac300+0x1)+'/'+_0x58b879[_0x54622f(0x1c8)][_0x54622f(0x1cb)]+'...\x20'+a5_0x30cc29['red']('✗'));},'onEvaluationStart':()=>{const _0x26a18c=_0x1db64a;_0x59c796[_0x26a18c(0x170)]=_0x26a18c(0x17c);},'onEvaluationComplete':_0x117bc4=>{const _0x3a4aee=_0x1db64a,_0x15807f=formatElapsed(_0x117bc4);console[_0x3a4aee(0x14b)]('\x20\x20Evaluating...\x20'+a5_0x30cc29[_0x3a4aee(0x1a6)]('✓')+'\x20('+_0x15807f+')');}});_0x59c796['stop'](),_0x14d05e['push'](_0x522886);if(_0x522886[_0x1db64a(0x1c5)]==='PASS')console['log'](a5_0x30cc29[_0x1db64a(0x1a6)](_0x1db64a(0x16c)+_0x522886[_0x1db64a(0x1a0)])+a5_0x30cc29['dim'](_0x1db64a(0x152)));else _0x522886[_0x1db64a(0x1c5)]===_0x1db64a(0x19b)?console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x164)]('✗\x20FAIL:\x20'+_0x522886[_0x1db64a(0x1a0)])+a5_0x30cc29[_0x1db64a(0x19c)](_0x1db64a(0x152))):console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x164)]('✗\x20ERROR:\x20'+_0x522886[_0x1db64a(0x1a0)]));_0x522886[_0x1db64a(0x1bb)]&&console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x19c)]('\x20\x20Conversation:\x20'+_0x522886[_0x1db64a(0x1bb)]));}catch(_0x1314f5){_0x59c796[_0x1db64a(0x179)]();const _0x3f1d22=_0x1314f5 instanceof Error?_0x1314f5[_0x1db64a(0x1d6)]:String(_0x1314f5);console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x164)](_0x1db64a(0x1c0)+_0x3f1d22)),_0x14d05e[_0x1db64a(0x1c3)]({'name':_0x58b879[_0x1db64a(0x163)],'status':_0x1db64a(0x192),'reason':_0x3f1d22,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console['log']();const _0x4bf85b=Date[_0x1db64a(0x174)]()-_0x58fe52,_0x25611d=_0x14d05e['filter'](_0x1d1204=>_0x1d1204['status']===_0x1db64a(0x1b1))['length'],_0x266f72=_0x14d05e[_0x1db64a(0x157)](_0x4217c7=>_0x4217c7[_0x1db64a(0x1c5)]==='FAIL')[_0x1db64a(0x1cb)],_0x1493ec=_0x14d05e[_0x1db64a(0x157)](_0x49a1c6=>_0x49a1c6[_0x1db64a(0x1c5)]===_0x1db64a(0x192))[_0x1db64a(0x1cb)];console[_0x1db64a(0x14b)]('━'[_0x1db64a(0x1a9)](0x3c)),console[_0x1db64a(0x14b)]('Re-evaluation\x20Summary'),console[_0x1db64a(0x14b)]('━'[_0x1db64a(0x1a9)](0x3c)),console[_0x1db64a(0x14b)](_0x1db64a(0x1c9)+_0x14d05e[_0x1db64a(0x1cb)]),console[_0x1db64a(0x14b)](_0x1db64a(0x19e)+a5_0x30cc29['green'](_0x25611d)),console[_0x1db64a(0x14b)](_0x1db64a(0x187)+a5_0x30cc29[_0x1db64a(0x164)](_0x266f72));_0x1493ec>0x0&&console[_0x1db64a(0x14b)](_0x1db64a(0x1b9)+a5_0x30cc29[_0x1db64a(0x164)](_0x1493ec));console[_0x1db64a(0x14b)](_0x1db64a(0x188)+formatElapsed(_0x4bf85b)),console[_0x1db64a(0x14b)]('━'['repeat'](0x3c));const _0x27eb86={'summary':{'total':_0x14d05e[_0x1db64a(0x1cb)],'passed':_0x25611d,'failed':_0x266f72,'errors':_0x1493ec>0x0?_0x1493ec:undefined,'duration_ms':_0x4bf85b},'tests':_0x14d05e,'agent':{'project':_0x5b9c48['projectName'],'name':_0x5b9c48[_0x1db64a(0x1a3)],'site':_0x461555},'timestamp':new Date(_0x58fe52)['toISOString']()};if(_0xc56503!==_0x1db64a(0x1c1)||_0x5521b6){const _0x23add4=formatResults(_0x27eb86,_0xc56503);if(_0x5521b6)try{a5_0x454be6[_0x1db64a(0x15a)](_0x5521b6,_0x23add4,'utf-8'),console[_0x1db64a(0x14b)](),console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x19c)](_0x1db64a(0x185)+_0x5521b6));}catch(_0x211888){return console[_0x1db64a(0x14b)](),console['log'](a5_0x30cc29[_0x1db64a(0x164)](_0x1db64a(0x1bd)+_0x211888)),0x1;}else console[_0x1db64a(0x14b)](),console['log'](_0x23add4);}const _0xb74677=_0x14d05e[_0x1db64a(0x157)](_0x19ac6a=>_0x19ac6a[_0x1db64a(0x1c5)]!=='PASS');return _0xb74677[_0x1db64a(0x1cb)]>0x0?0x1:0x0;}}
1
+ const a5_0x3eb29a=a5_0x28e7;(function(_0x43bc07,_0x23fb95){const _0x1d012d=a5_0x28e7,_0x379a60=_0x43bc07();while(!![]){try{const _0x1f6098=parseInt(_0x1d012d(0x210))/0x1*(parseInt(_0x1d012d(0x23e))/0x2)+parseInt(_0x1d012d(0x1c6))/0x3*(parseInt(_0x1d012d(0x1ce))/0x4)+-parseInt(_0x1d012d(0x21b))/0x5+-parseInt(_0x1d012d(0x1c5))/0x6+-parseInt(_0x1d012d(0x240))/0x7*(-parseInt(_0x1d012d(0x252))/0x8)+-parseInt(_0x1d012d(0x1ec))/0x9*(parseInt(_0x1d012d(0x25c))/0xa)+-parseInt(_0x1d012d(0x21a))/0xb*(-parseInt(_0x1d012d(0x220))/0xc);if(_0x1f6098===_0x23fb95)break;else _0x379a60['push'](_0x379a60['shift']());}catch(_0x142dcf){_0x379a60['push'](_0x379a60['shift']());}}}(a5_0x3d27,0xf0f74));function a5_0x28e7(_0x1f807f,_0x289e77){_0x1f807f=_0x1f807f-0x1c5;const _0x3d274e=a5_0x3d27();let _0x28e704=_0x3d274e[_0x1f807f];return _0x28e704;}import*as a5_0x23eb5e from'node:fs';import*as a5_0x4c8f4e from'node:path';import a5_0x3010a6 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x3eb29a(0x24c)]='agent:test';[a5_0x3eb29a(0x228)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x3eb29a(0x1da)](_0x48c123){const _0x35052d=a5_0x3eb29a,{options:_0x1aa8a5,args:_0x181b42,tdx:_0xd62020}=_0x48c123,_0x1ef7a2=_0x181b42[0x0]||'.',_0x274646=_0x1aa8a5[_0x35052d(0x201)],_0xa0e6c8=_0x1aa8a5,_0x5afae7=_0xa0e6c8[_0x35052d(0x239)]===![],_0x48324c=_0xa0e6c8[_0x35052d(0x1ee)],_0xc98336=_0xa0e6c8[_0x35052d(0x24c)],_0x2eeaa2=_0xa0e6c8[_0x35052d(0x1f9)],_0xeffa9f=_0x1aa8a5[_0x35052d(0x221)],_0x3789e3=_0xa0e6c8['output'];if(_0x48324c&&_0x5afae7)return console['log'](a5_0x3010a6['red'](_0x35052d(0x1d0))),0x1;let _0x4e9864=_0x35052d(0x1e5);if(_0xa0e6c8[_0x35052d(0x1c7)])_0x4e9864=_0x35052d(0x1c7);else{if(_0xa0e6c8[_0x35052d(0x20a)])_0x4e9864='jsonl';else{if(_0xa0e6c8['tsv'])_0x4e9864=_0x35052d(0x225);else{if(_0xa0e6c8[_0x35052d(0x1e5)])_0x4e9864='table';}}}const _0x2ccdd3=_0xa0e6c8[_0x35052d(0x1df)];let _0x43ca49=_0x1ef7a2;const _0x51f670=a5_0x23eb5e[_0x35052d(0x1d6)](_0x1ef7a2),_0x3031fc=_0x1ef7a2==='.';if(!_0x51f670||_0x3031fc){const _0x2eea03=resolveProjectFromContext(_0x1ef7a2,_0x2ccdd3,{'requireFile':'test.yml'});if(_0x2eea03[_0x35052d(0x212)])_0x43ca49=_0x2eea03[_0x35052d(0x206)],_0x2eea03[_0x35052d(0x243)]===_0x35052d(0x233)&&console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x1fe)](_0x35052d(0x20d)+_0x43ca49));else switch(_0x2eea03[_0x35052d(0x1fd)]){case _0x35052d(0x23d):console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x22b)](_0x2eea03['message'])),console['log'](),console[_0x35052d(0x1c9)]('Usage:'),console['log'](_0x35052d(0x205)),console['log'](_0x35052d(0x204)),console['log'](),console[_0x35052d(0x1c9)](_0x35052d(0x253));return 0x1;case'no_local_folder':console['log'](a5_0x3010a6[_0x35052d(0x22b)](_0x2eea03[_0x35052d(0x1d8)])),console[_0x35052d(0x1c9)](),console[_0x35052d(0x1c9)](_0x35052d(0x22e)+_0x2eea03[_0x35052d(0x1df)]+_0x35052d(0x1f4));return 0x1;case'multiple_agents':{const _0x260e2b=a5_0x4c8f4e[_0x35052d(0x217)](_0x2eea03[_0x35052d(0x206)]);console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x22b)](_0x35052d(0x251)+_0x2eea03[_0x35052d(0x1df)]+'\x22:'));for(const _0x576691 of _0x2eea03[_0x35052d(0x244)]){console[_0x35052d(0x1c9)](_0x35052d(0x255)+_0x576691);}return console[_0x35052d(0x1c9)](),console[_0x35052d(0x1c9)](_0x35052d(0x250)+_0x260e2b+_0x35052d(0x1f3)),0x1;}case _0x35052d(0x1f1):console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x22b)](_0x35052d(0x1ca)+_0x2eea03['llmProject']+'\x22.')),console[_0x35052d(0x1c9)](a5_0x3010a6['dim'](_0x35052d(0x203)+_0x2eea03['projectDir'])),console['log'](),console[_0x35052d(0x1c9)](_0x35052d(0x248));return 0x1;}}const {definition:_0x26c30a,agentInfo:_0x30c9e1}=parseTestFile(_0x43ca49);let _0x26d4d7=_0x26c30a['tests'];if(_0xc98336){const _0x310fa5=_0xc98336[_0x35052d(0x1e6)](',')[_0x35052d(0x20c)](_0x18259d=>_0x18259d['trim']());_0x26d4d7=_0x26c30a['tests'][_0x35052d(0x1fb)](_0x362cb8=>_0x310fa5[_0x35052d(0x245)](_0x362cb8[_0x35052d(0x24c)]));if(_0x26d4d7['length']===0x0)return console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x22b)](_0x35052d(0x249)+_0xc98336)),console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x1fe)](_0x35052d(0x223)+_0x26c30a['tests'][_0x35052d(0x20c)](_0x3f8278=>_0x3f8278['name'])['join'](',\x20'))),0x1;}if(_0x2eeaa2){const _0x3217dd=_0x2eeaa2[_0x35052d(0x1e6)](',')[_0x35052d(0x20c)](_0x5745cc=>_0x5745cc[_0x35052d(0x1fc)]()['toLowerCase']());_0x26d4d7=_0x26d4d7[_0x35052d(0x1fb)](_0x34f6ef=>_0x34f6ef[_0x35052d(0x1f9)]?.[_0x35052d(0x1f6)](_0x2a35a1=>_0x3217dd[_0x35052d(0x245)](_0x2a35a1[_0x35052d(0x230)]())));if(_0x26d4d7[_0x35052d(0x1f8)]===0x0){console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x22b)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x2eeaa2));const _0x99a8c3=new Set();return _0x26c30a[_0x35052d(0x234)][_0x35052d(0x256)](_0x51a165=>_0x51a165[_0x35052d(0x1f9)]?.[_0x35052d(0x256)](_0x1fcf04=>_0x99a8c3['add'](_0x1fcf04))),_0x99a8c3['size']>0x0?console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x1fe)](_0x35052d(0x235)+[..._0x99a8c3]['join'](',\x20'))):console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x1fe)](_0x35052d(0x1f2))),0x1;}}if(_0x48324c)return this['executeReeval'](_0x48c123,{'definition':{'tests':_0x26d4d7},'agentInfo':_0x30c9e1,'outputFormat':_0x4e9864,'outputFile':_0x3789e3,'testNames':_0xc98336});if(_0x274646){console['log'](a5_0x3010a6[_0x35052d(0x232)]('Test\x20Configuration:')),console[_0x35052d(0x1c9)](_0x35052d(0x23f)+a5_0x3010a6[_0x35052d(0x1d1)](_0xeffa9f)),console['log'](_0x35052d(0x211)+a5_0x3010a6[_0x35052d(0x1d1)](_0x30c9e1[_0x35052d(0x241)])),console['log'](_0x35052d(0x1d7)+a5_0x3010a6[_0x35052d(0x1d1)](_0x30c9e1[_0x35052d(0x258)])),console['log'](),console['log'](_0x35052d(0x247)+a5_0x3010a6['white'](_0x26d4d7['length']));for(let _0x22984b=0x0;_0x22984b<_0x26d4d7['length'];_0x22984b++){const _0x487474=_0x26d4d7[_0x22984b],_0x26a76e=_0x487474[_0x35052d(0x226)][_0x35052d(0x1f8)]===0x1?_0x35052d(0x1dc):_0x35052d(0x226),_0x46e484=_0x487474[_0x35052d(0x1f9)]?.[_0x35052d(0x1f8)]?'\x20['+_0x487474[_0x35052d(0x1f9)]['join'](',\x20')+']':'';console[_0x35052d(0x1c9)]('\x20\x20'+(_0x22984b+0x1)+'.\x20'+a5_0x3010a6[_0x35052d(0x1d1)](_0x487474[_0x35052d(0x24c)])+'\x20('+_0x487474['rounds']['length']+'\x20'+_0x26a76e+')'+a5_0x3010a6[_0x35052d(0x1fe)](_0x46e484));}return 0x0;}let _0x3d6428,_0xf81cab;try{_0x3d6428=await _0xd62020[_0x35052d(0x24b)]['resolveProjectId'](_0x30c9e1[_0x35052d(0x241)]);}catch(_0x22c0b5){const _0x2d1954=_0x22c0b5 instanceof Error?_0x22c0b5[_0x35052d(0x1d8)]:String(_0x22c0b5);return _0x2d1954[_0x35052d(0x245)](_0x35052d(0x229))||_0x2d1954[_0x35052d(0x230)]()[_0x35052d(0x245)](_0x35052d(0x1d4))?console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x20e)](_0x35052d(0x236)+_0x30c9e1[_0x35052d(0x241)])):console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x20e)](_0x35052d(0x1d5)+_0x30c9e1[_0x35052d(0x241)]+_0x35052d(0x1e9)+_0x2d1954)),0x1;}try{_0xf81cab=await _0xd62020[_0x35052d(0x24b)][_0x35052d(0x1e2)](_0x30c9e1[_0x35052d(0x258)],_0x3d6428);}catch(_0x5bd303){const _0x596c92=_0x5bd303 instanceof Error?_0x5bd303[_0x35052d(0x1d8)]:String(_0x5bd303);return _0x596c92['includes'](_0x35052d(0x229))||_0x596c92[_0x35052d(0x230)]()[_0x35052d(0x245)](_0x35052d(0x1d4))?console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x20e)](_0x35052d(0x1cb)+_0x30c9e1[_0x35052d(0x258)])):console[_0x35052d(0x1c9)](a5_0x3010a6['red'](_0x35052d(0x1d9)+_0x30c9e1[_0x35052d(0x258)]+'\x22:\x20'+_0x596c92)),0x1;}let _0x5d71b7;if(!_0x5afae7)try{_0x5d71b7=await setupEvaluatorAgent(_0xd62020['llm'],_0x1aa8a5['verbose']);}catch(_0x50b9e4){const _0x3def6b=_0x50b9e4 instanceof Error?_0x50b9e4['message']:String(_0x50b9e4);return console[_0x35052d(0x1c9)](a5_0x3010a6['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x3def6b)),0x1;}console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x232)](_0x35052d(0x218))),console[_0x35052d(0x1c9)]('Site:\x20'+a5_0x3010a6['white'](_0xeffa9f)),console[_0x35052d(0x1c9)](_0x35052d(0x254)+a5_0x3010a6[_0x35052d(0x1d1)](_0x30c9e1[_0x35052d(0x241)]+'/'+_0x30c9e1[_0x35052d(0x258)])),console[_0x35052d(0x1c9)]();const _0xf7f55c=[],_0xb7500a=[],_0x2eb031=Date[_0x35052d(0x1f0)]();for(let _0x545d90=0x0;_0x545d90<_0x26d4d7['length'];_0x545d90++){const _0xd74fb9=_0x26d4d7[_0x545d90];_0x26d4d7['length']>0x1?console[_0x35052d(0x1c9)](_0x35052d(0x1ef)+(_0x545d90+0x1)+'/'+_0x26d4d7[_0x35052d(0x1f8)]+':\x20'+a5_0x3010a6['white'](_0xd74fb9[_0x35052d(0x24c)])):console[_0x35052d(0x1c9)]('Running\x20test:\x20'+a5_0x3010a6[_0x35052d(0x1d1)](_0xd74fb9[_0x35052d(0x24c)]));const _0x373c8d=createCommandSpinner('Round\x201/'+_0xd74fb9['rounds'][_0x35052d(0x1f8)]+':\x20Sending\x20user\x20input...');_0x373c8d['start']();try{const {result:_0x2880a1,conversation:_0x1b90c7}=await runTest(_0xd62020[_0x35052d(0x24b)],_0xd74fb9,{'agentId':_0xf81cab,'projectId':_0x3d6428,'site':_0xeffa9f,'noEval':_0x5afae7,'evaluatorId':_0x5d71b7,'onRoundStart':(_0x11054f,_0x4f220c)=>{const _0x213192=_0x35052d;_0x373c8d[_0x213192(0x257)]=_0x213192(0x1ea)+(_0x11054f+0x1)+'/'+_0x4f220c+_0x213192(0x1f5);},'onRoundComplete':(_0x44d29e,_0x32c544,_0x458541)=>{const _0x4ef218=_0x35052d,_0x502ed2=formatElapsed(_0x32c544);_0x458541?console[_0x4ef218(0x1c9)](_0x4ef218(0x1cd)+(_0x44d29e+0x1)+'/'+_0xd74fb9[_0x4ef218(0x226)]['length']+_0x4ef218(0x238)+a5_0x3010a6['green']('✓')+'\x20('+_0x502ed2+')'):console['log'](_0x4ef218(0x1cd)+(_0x44d29e+0x1)+'/'+_0xd74fb9[_0x4ef218(0x226)]['length']+_0x4ef218(0x238)+a5_0x3010a6[_0x4ef218(0x20e)]('✗'));},'onEvaluationStart':()=>{const _0x17b4f3=_0x35052d;_0x373c8d[_0x17b4f3(0x257)]=_0x17b4f3(0x1e8);},'onEvaluationComplete':_0xbf6a1a=>{const _0x51eee2=_0x35052d,_0x2d41fb=formatElapsed(_0xbf6a1a);console[_0x51eee2(0x1c9)](_0x51eee2(0x1e0)+a5_0x3010a6['green']('✓')+'\x20('+_0x2d41fb+')');}});_0x373c8d[_0x35052d(0x23b)](),_0xf7f55c[_0x35052d(0x237)](_0x2880a1),_0xb7500a[_0x35052d(0x237)](_0x1b90c7);if(_0x2880a1['status']===_0x35052d(0x222))console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x1f7)](_0x35052d(0x209)+_0x2880a1[_0x35052d(0x1fd)]));else _0x2880a1[_0x35052d(0x1e1)]===_0x35052d(0x24e)?console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x20e)](_0x35052d(0x246)+_0x2880a1[_0x35052d(0x1fd)])):console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x20e)](_0x35052d(0x216)+_0x2880a1[_0x35052d(0x1fd)]));_0x2880a1[_0x35052d(0x227)]&&console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x1fe)](_0x35052d(0x242)+_0x2880a1[_0x35052d(0x227)])),console[_0x35052d(0x1c9)]();}catch(_0x518c31){_0x373c8d[_0x35052d(0x23b)]();const _0x8b70cc=_0x518c31 instanceof Error?_0x518c31[_0x35052d(0x1d8)]:String(_0x518c31);console['log'](a5_0x3010a6[_0x35052d(0x20e)]('✗\x20ERROR:\x20'+_0x8b70cc)),console['log'](),_0xf7f55c[_0x35052d(0x237)]({'name':_0xd74fb9['name'],'status':_0x35052d(0x20f),'reason':_0x8b70cc,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x3919c8=Date[_0x35052d(0x1f0)]()-_0x2eb031,_0x2db5dd=_0xf7f55c['filter'](_0x533936=>_0x533936[_0x35052d(0x1e1)]==='PASS')[_0x35052d(0x1f8)],_0x938f52=_0xf7f55c[_0x35052d(0x1fb)](_0x472e28=>_0x472e28['status']===_0x35052d(0x24e))['length'],_0x53f37a=_0xf7f55c[_0x35052d(0x1fb)](_0x4f8ff9=>_0x4f8ff9[_0x35052d(0x1e1)]===_0x35052d(0x20f))[_0x35052d(0x1f8)];console[_0x35052d(0x1c9)]('━'[_0x35052d(0x22f)](0x3c)),console[_0x35052d(0x1c9)](_0x35052d(0x1d2)),console[_0x35052d(0x1c9)]('━'[_0x35052d(0x22f)](0x3c)),console[_0x35052d(0x1c9)](_0x35052d(0x25a)+_0xf7f55c[_0x35052d(0x1f8)]),console[_0x35052d(0x1c9)](_0x35052d(0x224)+a5_0x3010a6[_0x35052d(0x1f7)](_0x2db5dd)),console[_0x35052d(0x1c9)]('Failed:\x20\x20\x20'+a5_0x3010a6[_0x35052d(0x20e)](_0x938f52));_0x53f37a>0x0&&console[_0x35052d(0x1c9)]('Errors:\x20\x20\x20'+a5_0x3010a6[_0x35052d(0x20e)](_0x53f37a));console['log'](_0x35052d(0x1db)+formatElapsed(_0x3919c8)),console['log']('━'['repeat'](0x3c));const _0x1eaffd=_0xf7f55c[_0x35052d(0x1fb)](_0x3a9c39=>_0x3a9c39[_0x35052d(0x1e1)]!==_0x35052d(0x222));if(_0x1eaffd[_0x35052d(0x1f8)]>0x0){console[_0x35052d(0x1c9)](),console['log'](_0x35052d(0x24d));for(const _0x316642 of _0x1eaffd){const _0x5c26af=a5_0x3010a6[_0x35052d(0x20e)]('✗'),_0x2e36c8=_0x316642['reason'][_0x35052d(0x1f8)]>0x32?_0x316642[_0x35052d(0x1fd)]['substring'](0x0,0x32)+_0x35052d(0x1de):_0x316642[_0x35052d(0x1fd)];console['log']('\x20\x20'+_0x5c26af+'\x20'+_0x316642[_0x35052d(0x24c)]+':\x20'+_0x2e36c8);}}const _0x202829={'summary':{'total':_0xf7f55c[_0x35052d(0x1f8)],'passed':_0x2db5dd,'failed':_0x938f52,'errors':_0x53f37a>0x0?_0x53f37a:undefined,'duration_ms':_0x3919c8},'tests':_0xf7f55c,'agent':{'project':_0x30c9e1[_0x35052d(0x241)],'name':_0x30c9e1[_0x35052d(0x258)],'site':_0xeffa9f},'timestamp':new Date(_0x2eb031)[_0x35052d(0x20b)]()};try{const _0x348fba=buildCachedTestRun(_0xb7500a,{'site':_0xeffa9f,'projectId':_0x3d6428,'projectName':_0x30c9e1[_0x35052d(0x241)],'agentId':_0xf81cab,'agentName':_0x30c9e1[_0x35052d(0x258)],'testYmlPath':a5_0x4c8f4e[_0x35052d(0x1d3)](_0x30c9e1[_0x35052d(0x1e7)])});saveLastTestRun(_0x348fba);}catch{}if(_0x4e9864!==_0x35052d(0x1e5)||_0x3789e3){const _0x3262db=formatResults(_0x202829,_0x4e9864);if(_0x3789e3)try{a5_0x23eb5e[_0x35052d(0x259)](_0x3789e3,_0x3262db,'utf-8'),console['log'](),console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x1fe)]('Output\x20written\x20to:\x20'+_0x3789e3));}catch(_0x2dc438){return console[_0x35052d(0x1c9)](),console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x20e)](_0x35052d(0x1c8)+_0x2dc438)),0x1;}else console[_0x35052d(0x1c9)](),console[_0x35052d(0x1c9)](_0x3262db);}return _0x1eaffd[_0x35052d(0x1f8)]>0x0?0x1:0x0;}async[a5_0x3eb29a(0x25d)](_0x438a42,_0x1301bf){const _0x2e9425=a5_0x3eb29a,{options:_0x22ae34,tdx:_0x59fcd0}=_0x438a42,{definition:_0x2341a1,agentInfo:_0x123180,outputFormat:_0x51a806,outputFile:_0x3005a8}=_0x1301bf,_0x9d4603=_0x22ae34[_0x2e9425(0x221)],_0x151c6b=loadLastTestRun();if(!_0x151c6b)return console['log'](a5_0x3010a6[_0x2e9425(0x20e)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x2e9425(0x1c9)](a5_0x3010a6[_0x2e9425(0x1fe)](_0x2e9425(0x208))),0x1;if(_0x151c6b['agent'][_0x2e9425(0x258)]!==_0x123180[_0x2e9425(0x258)])return console[_0x2e9425(0x1c9)](a5_0x3010a6[_0x2e9425(0x20e)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x151c6b[_0x2e9425(0x1cc)][_0x2e9425(0x258)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x123180[_0x2e9425(0x258)]+'\x22.')),console[_0x2e9425(0x1c9)](a5_0x3010a6[_0x2e9425(0x1fe)](_0x2e9425(0x1dd))),0x1;const _0x1b423f=new Set(_0x151c6b['conversations'][_0x2e9425(0x20c)](_0x448230=>_0x448230[_0x2e9425(0x24a)])),_0x524d6d=_0x2341a1[_0x2e9425(0x234)][_0x2e9425(0x1fb)](_0x485948=>!_0x1b423f[_0x2e9425(0x1ed)](_0x485948[_0x2e9425(0x24c)]));if(_0x524d6d['length']>0x0&&_0x151c6b[_0x2e9425(0x221)]!==_0x9d4603)return console[_0x2e9425(0x1c9)](a5_0x3010a6['red'](_0x2e9425(0x21e))),console[_0x2e9425(0x1c9)](a5_0x3010a6[_0x2e9425(0x1fe)](_0x2e9425(0x22a)+_0x151c6b['site']+_0x2e9425(0x202)+_0x9d4603+'\x22.')),console['log'](a5_0x3010a6[_0x2e9425(0x1fe)]('Either\x20switch\x20to\x20the\x20\x22'+_0x151c6b[_0x2e9425(0x221)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x510339=_0x2341a1[_0x2e9425(0x234)][_0x2e9425(0x1fb)](_0x596ed3=>_0x1b423f[_0x2e9425(0x1ed)](_0x596ed3[_0x2e9425(0x24c)])),_0x31780d=_0x524d6d;let _0x4e5fcd;try{_0x4e5fcd=await setupEvaluatorAgent(_0x59fcd0[_0x2e9425(0x24b)],_0x22ae34[_0x2e9425(0x1e3)]);}catch(_0x29a40b){const _0x4c250c=_0x29a40b instanceof Error?_0x29a40b[_0x2e9425(0x1d8)]:String(_0x29a40b);return console[_0x2e9425(0x1c9)](a5_0x3010a6[_0x2e9425(0x20e)](_0x2e9425(0x219)+_0x4c250c)),0x1;}console[_0x2e9425(0x1c9)](a5_0x3010a6[_0x2e9425(0x232)](_0x2e9425(0x214))),console[_0x2e9425(0x1c9)](_0x2e9425(0x1cf)+a5_0x3010a6[_0x2e9425(0x1d1)](_0x151c6b[_0x2e9425(0x25b)])),console[_0x2e9425(0x1c9)](_0x2e9425(0x254)+a5_0x3010a6[_0x2e9425(0x1d1)](_0x151c6b[_0x2e9425(0x1cc)][_0x2e9425(0x241)]+'/'+_0x151c6b[_0x2e9425(0x1cc)][_0x2e9425(0x258)]));_0x31780d[_0x2e9425(0x1f8)]>0x0&&console[_0x2e9425(0x1c9)](_0x2e9425(0x22d)+a5_0x3010a6[_0x2e9425(0x22b)](_0x31780d[_0x2e9425(0x1f8)]));console[_0x2e9425(0x1c9)]();const _0x4c9ead=[],_0x3d5efd=Date[_0x2e9425(0x1f0)](),_0x21c341=createCommandSpinner(_0x2e9425(0x24f));if(_0x510339[_0x2e9425(0x1f8)]>0x0)try{const _0x1839ab=await reevaluateFromCache(_0x59fcd0[_0x2e9425(0x24b)],_0x151c6b,{'tests':_0x510339},{'evaluatorId':_0x4e5fcd,'onTestStart':(_0x337c2f,_0x52cf3f,_0x397b59)=>{const _0x1fcb6f=_0x2e9425;_0x21c341[_0x1fcb6f(0x257)]='Re-evaluating\x20'+(_0x52cf3f+0x1)+'/'+_0x397b59+':\x20'+_0x337c2f+'...';if(!_0x21c341['isSpinning'])_0x21c341[_0x1fcb6f(0x21f)]();},'onTestComplete':(_0x956710,_0x192e0e)=>{const _0x51c76f=_0x2e9425;_0x21c341[_0x51c76f(0x23b)]();if(_0x192e0e['status']==='PASS')console[_0x51c76f(0x1c9)](a5_0x3010a6[_0x51c76f(0x1f7)](_0x51c76f(0x209)+_0x956710)+a5_0x3010a6[_0x51c76f(0x1fe)]('\x20(cached)'));else _0x192e0e[_0x51c76f(0x1e1)]==='FAIL'?console['log'](a5_0x3010a6[_0x51c76f(0x20e)]('✗\x20FAIL:\x20'+_0x956710+_0x51c76f(0x23a)+_0x192e0e[_0x51c76f(0x1fd)])+a5_0x3010a6[_0x51c76f(0x1fe)](_0x51c76f(0x215))):console[_0x51c76f(0x1c9)](a5_0x3010a6[_0x51c76f(0x20e)](_0x51c76f(0x216)+_0x956710+_0x51c76f(0x23a)+_0x192e0e[_0x51c76f(0x1fd)]));_0x192e0e[_0x51c76f(0x227)]&&console[_0x51c76f(0x1c9)](a5_0x3010a6[_0x51c76f(0x1fe)](_0x51c76f(0x21c)+_0x192e0e[_0x51c76f(0x227)])),_0x4c9ead[_0x51c76f(0x237)](_0x192e0e);},'onTestSkipped':(_0x370a9f,_0x19c0a3)=>{const _0x50aec5=_0x2e9425;_0x21c341[_0x50aec5(0x23b)](),console[_0x50aec5(0x1c9)](a5_0x3010a6[_0x50aec5(0x22b)](_0x50aec5(0x200)+_0x370a9f+_0x50aec5(0x23a)+_0x19c0a3));}});for(const _0x51d167 of _0x1839ab){!_0x4c9ead[_0x2e9425(0x1fa)](_0x2338a4=>_0x2338a4[_0x2e9425(0x24c)]===_0x51d167[_0x2e9425(0x24c)])&&_0x4c9ead[_0x2e9425(0x237)](_0x51d167);}}catch(_0x8a52e2){_0x21c341['stop']();const _0x2f715c=_0x8a52e2 instanceof Error?_0x8a52e2['message']:String(_0x8a52e2);return console['log'](a5_0x3010a6[_0x2e9425(0x20e)](_0x2e9425(0x21d)+_0x2f715c)),0x1;}_0x21c341[_0x2e9425(0x23b)]();if(_0x31780d['length']>0x0){console[_0x2e9425(0x1c9)](),console[_0x2e9425(0x1c9)](a5_0x3010a6['cyan'](_0x2e9425(0x1ff)));const {projectId:_0x51bb30,agentId:_0x452291}=_0x151c6b[_0x2e9425(0x1cc)];for(const _0x2df987 of _0x31780d){console[_0x2e9425(0x1c9)](_0x2e9425(0x207)+a5_0x3010a6['white'](_0x2df987[_0x2e9425(0x24c)]));const _0x3b6e80=createCommandSpinner(_0x2e9425(0x1e4)+_0x2df987[_0x2e9425(0x226)][_0x2e9425(0x1f8)]+_0x2e9425(0x1f5));_0x3b6e80[_0x2e9425(0x21f)]();try{const {result:_0x3bc13f}=await runTest(_0x59fcd0[_0x2e9425(0x24b)],_0x2df987,{'agentId':_0x452291,'projectId':_0x51bb30,'site':_0x151c6b[_0x2e9425(0x221)],'noEval':![],'evaluatorId':_0x4e5fcd,'onRoundStart':(_0x4dae5e,_0x4f9fd2)=>{const _0x452ec1=_0x2e9425;_0x3b6e80[_0x452ec1(0x257)]=_0x452ec1(0x1ea)+(_0x4dae5e+0x1)+'/'+_0x4f9fd2+_0x452ec1(0x1f5);},'onRoundComplete':(_0x27bb4c,_0x4223df,_0x4dc040)=>{const _0x39ee3e=_0x2e9425,_0x56edae=formatElapsed(_0x4223df);_0x4dc040?console[_0x39ee3e(0x1c9)]('\x20\x20Round\x20'+(_0x27bb4c+0x1)+'/'+_0x2df987[_0x39ee3e(0x226)]['length']+_0x39ee3e(0x238)+a5_0x3010a6[_0x39ee3e(0x1f7)]('✓')+'\x20('+_0x56edae+')'):console[_0x39ee3e(0x1c9)](_0x39ee3e(0x1cd)+(_0x27bb4c+0x1)+'/'+_0x2df987['rounds']['length']+_0x39ee3e(0x238)+a5_0x3010a6[_0x39ee3e(0x20e)]('✗'));},'onEvaluationStart':()=>{const _0x52d2d5=_0x2e9425;_0x3b6e80[_0x52d2d5(0x257)]=_0x52d2d5(0x1e8);},'onEvaluationComplete':_0x945574=>{const _0x4243e2=_0x2e9425,_0xc9b372=formatElapsed(_0x945574);console[_0x4243e2(0x1c9)](_0x4243e2(0x1e0)+a5_0x3010a6['green']('✓')+'\x20('+_0xc9b372+')');}});_0x3b6e80[_0x2e9425(0x23b)](),_0x4c9ead['push'](_0x3bc13f);if(_0x3bc13f[_0x2e9425(0x1e1)]===_0x2e9425(0x222))console['log'](a5_0x3010a6[_0x2e9425(0x1f7)](_0x2e9425(0x209)+_0x3bc13f[_0x2e9425(0x1fd)])+a5_0x3010a6[_0x2e9425(0x1fe)](_0x2e9425(0x231)));else _0x3bc13f[_0x2e9425(0x1e1)]===_0x2e9425(0x24e)?console[_0x2e9425(0x1c9)](a5_0x3010a6[_0x2e9425(0x20e)](_0x2e9425(0x246)+_0x3bc13f['reason'])+a5_0x3010a6[_0x2e9425(0x1fe)](_0x2e9425(0x231))):console[_0x2e9425(0x1c9)](a5_0x3010a6[_0x2e9425(0x20e)](_0x2e9425(0x216)+_0x3bc13f['reason']));_0x3bc13f['conversation_url']&&console[_0x2e9425(0x1c9)](a5_0x3010a6['dim'](_0x2e9425(0x21c)+_0x3bc13f['conversation_url']));}catch(_0x4def42){_0x3b6e80[_0x2e9425(0x23b)]();const _0x48c5b3=_0x4def42 instanceof Error?_0x4def42['message']:String(_0x4def42);console[_0x2e9425(0x1c9)](a5_0x3010a6[_0x2e9425(0x20e)](_0x2e9425(0x216)+_0x48c5b3)),_0x4c9ead['push']({'name':_0x2df987[_0x2e9425(0x24c)],'status':'ERROR','reason':_0x48c5b3,'timestamp':new Date()[_0x2e9425(0x20b)](),'duration_ms':0x0});}}}console[_0x2e9425(0x1c9)]();const _0x46d323=Date['now']()-_0x3d5efd,_0x27a00c=_0x4c9ead[_0x2e9425(0x1fb)](_0x3e93f9=>_0x3e93f9[_0x2e9425(0x1e1)]===_0x2e9425(0x222))[_0x2e9425(0x1f8)],_0x3bc75e=_0x4c9ead[_0x2e9425(0x1fb)](_0x4a8073=>_0x4a8073[_0x2e9425(0x1e1)]===_0x2e9425(0x24e))['length'],_0x4d7aca=_0x4c9ead['filter'](_0x40cf51=>_0x40cf51[_0x2e9425(0x1e1)]===_0x2e9425(0x20f))['length'];console['log']('━'[_0x2e9425(0x22f)](0x3c)),console[_0x2e9425(0x1c9)](_0x2e9425(0x1eb)),console[_0x2e9425(0x1c9)]('━'[_0x2e9425(0x22f)](0x3c)),console[_0x2e9425(0x1c9)]('Total:\x20\x20\x20\x20'+_0x4c9ead[_0x2e9425(0x1f8)]),console[_0x2e9425(0x1c9)](_0x2e9425(0x224)+a5_0x3010a6[_0x2e9425(0x1f7)](_0x27a00c)),console['log'](_0x2e9425(0x22c)+a5_0x3010a6[_0x2e9425(0x20e)](_0x3bc75e));_0x4d7aca>0x0&&console[_0x2e9425(0x1c9)]('Errors:\x20\x20\x20'+a5_0x3010a6[_0x2e9425(0x20e)](_0x4d7aca));console['log']('Duration:\x20'+formatElapsed(_0x46d323)),console[_0x2e9425(0x1c9)]('━'['repeat'](0x3c));const _0x56612a={'summary':{'total':_0x4c9ead[_0x2e9425(0x1f8)],'passed':_0x27a00c,'failed':_0x3bc75e,'errors':_0x4d7aca>0x0?_0x4d7aca:undefined,'duration_ms':_0x46d323},'tests':_0x4c9ead,'agent':{'project':_0x123180[_0x2e9425(0x241)],'name':_0x123180[_0x2e9425(0x258)],'site':_0x9d4603},'timestamp':new Date(_0x3d5efd)[_0x2e9425(0x20b)]()};if(_0x51a806!=='table'||_0x3005a8){const _0x2d7a36=formatResults(_0x56612a,_0x51a806);if(_0x3005a8)try{a5_0x23eb5e[_0x2e9425(0x259)](_0x3005a8,_0x2d7a36,_0x2e9425(0x23c)),console[_0x2e9425(0x1c9)](),console[_0x2e9425(0x1c9)](a5_0x3010a6['dim'](_0x2e9425(0x213)+_0x3005a8));}catch(_0x256e23){return console['log'](),console[_0x2e9425(0x1c9)](a5_0x3010a6[_0x2e9425(0x20e)]('Error\x20writing\x20output\x20file:\x20'+_0x256e23)),0x1;}else console[_0x2e9425(0x1c9)](),console[_0x2e9425(0x1c9)](_0x2d7a36);}const _0x5929d5=_0x4c9ead[_0x2e9425(0x1fb)](_0x24c1f1=>_0x24c1f1['status']!==_0x2e9425(0x222));return _0x5929d5[_0x2e9425(0x1f8)]>0x0?0x1:0x0;}}function a5_0x3d27(){const _0x54456c=['Output\x20written\x20to:\x20','Re-evaluating\x20cached\x20test\x20run...','\x20(cached)','✗\x20ERROR:\x20','basename','Running\x20agent\x20tests...','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','7116758WNJYBD','9606975LrlaUZ','\x20\x20Conversation:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','start','24dDMSVY','site','PASS','Available\x20tests:\x20','Passed:\x20\x20\x20','tsv','rounds','conversation_url','description','404','Cached\x20run\x20is\x20from\x20site\x20\x22','yellow','Failed:\x20\x20\x20','New\x20tests\x20to\x20execute:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','repeat','toLowerCase','\x20(new)','cyan','context','tests','Available\x20tags:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','push','...\x20','eval','\x20-\x20','stop','utf-8','no_context','4042diINfx','\x20\x20Site:\x20','14wDGtpd','projectName','Conversation\x20URL:\x20','source','agentDirs','includes','✗\x20FAIL:\x20','Tests\x20found:\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','No\x20tests\x20found\x20matching:\x20','testName','llm','name','Failed\x20Tests:','FAIL','Re-evaluating...','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','6665432YpxhGs','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Agent:\x20','\x20\x20-\x20','forEach','text','agentName','writeFileSync','Total:\x20\x20\x20\x20','timestamp','11383470rPELfG','executeReeval','2008770frLpWT','3558DqHtlK','json','Error\x20writing\x20output\x20file:\x20','log','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','agent','\x20\x20Round\x20','3396xRcBUY','Cached\x20run\x20from:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','white','Test\x20Summary','resolve','not\x20found','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','existsSync','\x20\x20Agent:\x20','message','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','execute','Duration:\x20','round','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','...','llmProject','\x20\x20Evaluating...\x20','status','resolveAgentId','verbose','Round\x201/','table','split','testYmlPath','Evaluating\x20response...','\x22:\x20','Round\x20','Re-evaluation\x20Summary','9SCSdVQ','has','reeval','Test\x20','now','no_tests','No\x20tests\x20have\x20tags\x20defined.','/<agent-name>','\x27\x20to\x20create\x20the\x20folder\x20structure.',':\x20Sending\x20user\x20input...','some','green','length','tags','find','filter','trim','reason','dim','Executing\x20new\x20tests...','⚠\x20SKIPPED:\x20','dryRun','\x22,\x20but\x20current\x20site\x20is\x20\x22','Project\x20path:\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','\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','projectDir','Running:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','✓\x20PASS:\x20','jsonl','toISOString','map','Using\x20agent:\x20','red','ERROR','205tnbAWd','\x20\x20Project:\x20','found'];a5_0x3d27=function(){return _0x54456c;};return a5_0x3d27();}
@@ -1 +1 @@
1
- const a6_0x3ab92d=a6_0x4436;function a6_0x4436(_0x1887bd,_0x108869){_0x1887bd=_0x1887bd-0x14a;const _0x22ab8a=a6_0x22ab();let _0x4436b6=_0x22ab8a[_0x1887bd];return _0x4436b6;}(function(_0x35efab,_0x240d87){const _0x396c17=a6_0x4436,_0x279a41=_0x35efab();while(!![]){try{const _0x199e0a=parseInt(_0x396c17(0x181))/0x1*(parseInt(_0x396c17(0x16a))/0x2)+-parseInt(_0x396c17(0x186))/0x3+-parseInt(_0x396c17(0x168))/0x4+-parseInt(_0x396c17(0x173))/0x5*(-parseInt(_0x396c17(0x182))/0x6)+parseInt(_0x396c17(0x169))/0x7+-parseInt(_0x396c17(0x165))/0x8*(-parseInt(_0x396c17(0x177))/0x9)+parseInt(_0x396c17(0x174))/0xa*(-parseInt(_0x396c17(0x172))/0xb);if(_0x199e0a===_0x240d87)break;else _0x279a41['push'](_0x279a41['shift']());}catch(_0x3a1b0c){_0x279a41['push'](_0x279a41['shift']());}}}(a6_0x22ab,0xf158b));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';function a6_0x22ab(){const _0x109450=['file','stack','proxy-authorization','toUpperCase','authorization','headers','GET','Invalid\x20header\x20format:\x20\x22','output','trim','data','request','set-cookie2','body','workflow','has','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','\x22.\x20','cookie','noColor','56EVRsOH','entries','status','7559328eMDTEc','11336661qylqiQ','2jLspnh','startsWith','llm','color','llm-proxy','length','validate','isArray','1109383vNARNp','779365SqXPXx','40gPDeKW','readBodyFromFile','header','7101GgFKhD','DELETE','execute','keys','Results\x20saved\x20to\x20','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','x-auth-token','type','cas','method','525109kZNuAe','60nesdnI','error','substring','cdp','1281258vcArem','POST','api','message','includes','\x0aStack\x20trace:\x0a','Endpoint\x20must\x20start\x20with\x20/:\x20','verbose','log','x-trino-user','.\x20Valid\x20types:\x20','set-cookie','Error:\x20'];a6_0x22ab=function(){return _0x109450;};return a6_0x22ab();}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_0x3ab92d(0x155),a6_0x3ab92d(0x153),a6_0x3ab92d(0x163),a6_0x3ab92d(0x14f),a6_0x3ab92d(0x15d),'x-xsrf-token',a6_0x3ab92d(0x17d),a6_0x3ab92d(0x14d)]);function isSensitiveHeader(_0xc0bff7){const _0x4e8897=a6_0x3ab92d;return SENSITIVE_HEADERS[_0x4e8897(0x160)](_0xc0bff7['toLowerCase']());}function parseHeader(_0x2fc97e){const _0x3e7dc1=a6_0x3ab92d,_0x1b42e5=_0x2fc97e['indexOf'](':');if(_0x1b42e5===-0x1)throw new Error(_0x3e7dc1(0x158)+_0x2fc97e+_0x3e7dc1(0x162)+_0x3e7dc1(0x17c));const _0x5cfae0=_0x2fc97e[_0x3e7dc1(0x184)](0x0,_0x1b42e5)['trim'](),_0x11c220=_0x2fc97e[_0x3e7dc1(0x184)](_0x1b42e5+0x1)[_0x3e7dc1(0x15a)]();if(!_0x5cfae0)throw new Error(_0x3e7dc1(0x161)+_0x2fc97e+'\x22');return[_0x5cfae0,_0x11c220];}export class ApiCommand extends BaseCommand{['name']=a6_0x3ab92d(0x188);['description']='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x3ab92d(0x170)](_0x2548df){const _0x91bb86=a6_0x3ab92d,{args:_0x315753,options:_0x51953b}=_0x2548df,_0x5c699b=_0x51953b;if(_0x315753[_0x91bb86(0x16f)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x2df350=_0x315753[0x0];if(!_0x2df350[_0x91bb86(0x16b)]('/'))return _0x91bb86(0x14a)+_0x2df350;const _0x3f04ca=_0x5c699b[_0x91bb86(0x15b)],_0x1b76c0=_0x5c699b[_0x91bb86(0x151)];if(_0x3f04ca&&_0x1b76c0)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x960fa5=_0x5c699b[_0x91bb86(0x180)]||_0x91bb86(0x157),_0x4e7783=[_0x91bb86(0x157),_0x91bb86(0x187),'PUT',_0x91bb86(0x178),'PATCH'];if(!_0x4e7783[_0x91bb86(0x18a)](_0x960fa5[_0x91bb86(0x154)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x960fa5+'.\x20Valid\x20methods:\x20'+_0x4e7783['join'](',\x20');const _0x3af774=_0x5c699b[_0x91bb86(0x17e)]||'td',_0x4a7e04=['td',_0x91bb86(0x185),_0x91bb86(0x15f),'trino',_0x91bb86(0x16c),_0x91bb86(0x16e),_0x91bb86(0x17f)];if(!_0x4a7e04['includes'](_0x3af774))return'Invalid\x20API\x20type:\x20'+_0x3af774+_0x91bb86(0x14e)+_0x4a7e04['join'](',\x20');return undefined;}async[a6_0x3ab92d(0x179)](_0x2113f5){const _0x1360b8=a6_0x3ab92d,{options:_0x517680,args:_0x3cd8dc,tdx:_0x1469ab}=_0x2113f5,_0x55aa25=_0x517680,_0x1c6f9d=_0x3cd8dc[0x0],_0x518ff6=(_0x55aa25[_0x1360b8(0x180)]||_0x1360b8(0x157))[_0x1360b8(0x154)](),_0x16c3b9=_0x55aa25[_0x1360b8(0x15b)],_0x1310e7=_0x55aa25[_0x1360b8(0x151)],_0x26e02b=_0x55aa25[_0x1360b8(0x176)],_0x10d4bc=_0x55aa25[_0x1360b8(0x17e)]||'td';try{const _0x44791e={};if(_0x26e02b){const _0x11cc49=Array[_0x1360b8(0x171)](_0x26e02b)?_0x26e02b:[_0x26e02b];for(const _0x2996a4 of _0x11cc49){const [_0x3e088b,_0x5eff6b]=parseHeader(_0x2996a4);_0x44791e[_0x3e088b]=_0x5eff6b;}}let _0x57bae4;if(_0x16c3b9)_0x57bae4=_0x16c3b9;else{if(_0x1310e7)try{_0x57bae4=RawAPI[_0x1360b8(0x175)](_0x1310e7);}catch(_0x477341){return console[_0x1360b8(0x183)](_0x1360b8(0x150)+(_0x477341 instanceof Error?_0x477341[_0x1360b8(0x189)]:String(_0x477341))),0x1;}}const _0x2b24d5={'method':_0x518ff6,'apiType':_0x10d4bc,'includeHeaders':_0x517680[_0x1360b8(0x14b)]};_0x57bae4&&(_0x2b24d5[_0x1360b8(0x15e)]=_0x57bae4);Object[_0x1360b8(0x17a)](_0x44791e)[_0x1360b8(0x16f)]>0x0&&(_0x2b24d5[_0x1360b8(0x156)]=_0x44791e);if(_0x517680['verbose']){const _0x128a89=resolveSite(_0x517680['site']),_0x5a5885=getEndpoint(_0x128a89,_0x10d4bc),_0x2b9418=''+_0x5a5885+_0x1c6f9d;console[_0x1360b8(0x183)]('>\x20'+_0x518ff6+'\x20'+_0x2b9418);const _0xc5b1ea=getAuthHeaders(_0x128a89),_0x3d4e76={..._0xc5b1ea,..._0x44791e};for(const [_0x3718ad,_0xa50dfc]of Object[_0x1360b8(0x166)](_0x3d4e76)){!isSensitiveHeader(_0x3718ad)&&console[_0x1360b8(0x183)]('>\x20'+_0x3718ad+':\x20'+_0xa50dfc);}_0x57bae4&&console[_0x1360b8(0x183)]('>'),console[_0x1360b8(0x183)]('');}const _0x3e7854=await _0x1469ab[_0x1360b8(0x188)][_0x1360b8(0x15c)](_0x1c6f9d,_0x2b24d5);if(_0x517680[_0x1360b8(0x14b)]&&_0x3e7854[_0x1360b8(0x156)]){console[_0x1360b8(0x183)]('<\x20HTTP/1.1\x20'+_0x3e7854[_0x1360b8(0x167)]);for(const [_0x4e212a,_0x14c11a]of Object['entries'](_0x3e7854[_0x1360b8(0x156)])){!isSensitiveHeader(_0x4e212a)&&console[_0x1360b8(0x183)]('<\x20'+_0x4e212a+':\x20'+_0x14c11a);}console[_0x1360b8(0x183)]('');}const _0x1820e9=Boolean(_0x517680[_0x1360b8(0x159)]),_0x3d683d={'color':_0x517680['color'],'noColor':_0x517680[_0x1360b8(0x164)]||_0x1820e9&&!_0x517680[_0x1360b8(0x16d)]},_0x405549=colorizeJSON(_0x3e7854['data'],_0x3d683d);return _0x517680['output']?(writeFileSync(_0x517680[_0x1360b8(0x159)],_0x405549),console[_0x1360b8(0x183)](_0x1360b8(0x17b)+_0x517680[_0x1360b8(0x159)])):console[_0x1360b8(0x14c)](_0x405549),0x0;}catch(_0x402ee6){return _0x402ee6 instanceof Error?(console[_0x1360b8(0x183)](_0x1360b8(0x150)+_0x402ee6[_0x1360b8(0x189)]),_0x517680[_0x1360b8(0x14b)]&&_0x402ee6[_0x1360b8(0x152)]&&console[_0x1360b8(0x183)](_0x1360b8(0x18b)+_0x402ee6[_0x1360b8(0x152)])):console['error'](_0x1360b8(0x150)+String(_0x402ee6)),0x1;}}}
1
+ function a6_0xfd58(_0x277489,_0x352237){_0x277489=_0x277489-0xf4;const _0x37c627=a6_0x37c6();let _0xfd5816=_0x37c627[_0x277489];return _0xfd5816;}const a6_0x21168b=a6_0xfd58;(function(_0x25951c,_0x1a48ae){const _0x683435=a6_0xfd58,_0x1e75b2=_0x25951c();while(!![]){try{const _0x3cf576=-parseInt(_0x683435(0x12a))/0x1*(parseInt(_0x683435(0x107))/0x2)+-parseInt(_0x683435(0x117))/0x3*(parseInt(_0x683435(0x134))/0x4)+parseInt(_0x683435(0x108))/0x5+parseInt(_0x683435(0x10f))/0x6+parseInt(_0x683435(0xfe))/0x7+-parseInt(_0x683435(0x11a))/0x8*(parseInt(_0x683435(0x124))/0x9)+-parseInt(_0x683435(0x130))/0xa*(parseInt(_0x683435(0x112))/0xb);if(_0x3cf576===_0x1a48ae)break;else _0x1e75b2['push'](_0x1e75b2['shift']());}catch(_0x1bc70e){_0x1e75b2['push'](_0x1e75b2['shift']());}}}(a6_0x37c6,0xdf742));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_0x21168b(0x100),'proxy-authorization',a6_0x21168b(0xfc),a6_0x21168b(0x123),a6_0x21168b(0x135),a6_0x21168b(0x11b),a6_0x21168b(0x118),a6_0x21168b(0x133)]);function a6_0x37c6(){const _0x2876c3=['x-trino-user','3926356BqszyF','set-cookie2','verbose','indexOf','description','entries','join','<\x20HTTP/1.1\x20','request','cdp','cookie','Endpoint\x20must\x20start\x20with\x20/:\x20','9248862XtCCta','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','authorization','keys','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','error','log','message','name','30658IoPQTo','4982485wpwmpi','toUpperCase','substring','api','status','llm','body','3261492iEEsUd','Invalid\x20API\x20type:\x20','has','3256ImWNEF','noColor','Results\x20saved\x20to\x20','isArray','\x22.\x20','3FIfZHd','x-auth-token','workflow','24ZZbbwl','x-xsrf-token','method','data','site','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','GET','includes','type','set-cookie','2177667HPYqbv','output','headers','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','color','file','9PMGaxk','validate','execute','PUT','Error:\x20','cas','3400QvhCLV','length','Invalid\x20header\x20format:\x20\x22'];a6_0x37c6=function(){return _0x2876c3;};return a6_0x37c6();}function isSensitiveHeader(_0x5350df){const _0x3e7ce3=a6_0x21168b;return SENSITIVE_HEADERS[_0x3e7ce3(0x111)](_0x5350df['toLowerCase']());}function parseHeader(_0x388f60){const _0x59d8c7=a6_0x21168b,_0x4a1195=_0x388f60[_0x59d8c7(0xf5)](':');if(_0x4a1195===-0x1)throw new Error(_0x59d8c7(0x132)+_0x388f60+_0x59d8c7(0x116)+_0x59d8c7(0x102));const _0x7a319c=_0x388f60[_0x59d8c7(0x10a)](0x0,_0x4a1195)['trim'](),_0x458048=_0x388f60[_0x59d8c7(0x10a)](_0x4a1195+0x1)['trim']();if(!_0x7a319c)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x388f60+'\x22');return[_0x7a319c,_0x458048];}export class ApiCommand extends BaseCommand{[a6_0x21168b(0x106)]='api';[a6_0x21168b(0xf6)]=a6_0x21168b(0x11f);[a6_0x21168b(0x12b)](_0x348c44){const _0x5c990d=a6_0x21168b,{args:_0x3b8cd7,options:_0x1946d8}=_0x348c44,_0x24f863=_0x1946d8;if(_0x3b8cd7[_0x5c990d(0x131)]===0x0)return _0x5c990d(0xff);const _0x21e534=_0x3b8cd7[0x0];if(!_0x21e534['startsWith']('/'))return _0x5c990d(0xfd)+_0x21e534;const _0x1c0cd9=_0x24f863[_0x5c990d(0x11d)],_0x272bd9=_0x24f863[_0x5c990d(0x129)];if(_0x1c0cd9&&_0x272bd9)return _0x5c990d(0x127);const _0x4f1c27=_0x24f863[_0x5c990d(0x11c)]||_0x5c990d(0x120),_0x158c73=[_0x5c990d(0x120),'POST',_0x5c990d(0x12d),'DELETE','PATCH'];if(!_0x158c73[_0x5c990d(0x121)](_0x4f1c27[_0x5c990d(0x109)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x4f1c27+'.\x20Valid\x20methods:\x20'+_0x158c73[_0x5c990d(0xf8)](',\x20');const _0x11ae53=_0x24f863[_0x5c990d(0x122)]||'td',_0x4ff19f=['td',_0x5c990d(0xfb),_0x5c990d(0x119),'trino',_0x5c990d(0x10d),'llm-proxy',_0x5c990d(0x12f)];if(!_0x4ff19f[_0x5c990d(0x121)](_0x11ae53))return _0x5c990d(0x110)+_0x11ae53+'.\x20Valid\x20types:\x20'+_0x4ff19f['join'](',\x20');return undefined;}async[a6_0x21168b(0x12c)](_0x58f667){const _0x3934d9=a6_0x21168b,{options:_0x17d5b5,args:_0xe1f722,tdx:_0xd7ac72}=_0x58f667,_0x476c1a=_0x17d5b5,_0x387dd9=_0xe1f722[0x0],_0x27bbfb=(_0x476c1a['method']||_0x3934d9(0x120))[_0x3934d9(0x109)](),_0x1320a7=_0x476c1a[_0x3934d9(0x11d)],_0x3d1479=_0x476c1a[_0x3934d9(0x129)],_0xe9a7c5=_0x476c1a['header'],_0x215e3a=_0x476c1a[_0x3934d9(0x122)]||'td';try{const _0x5ce46e={};if(_0xe9a7c5){const _0xa0dfd8=Array[_0x3934d9(0x115)](_0xe9a7c5)?_0xe9a7c5:[_0xe9a7c5];for(const _0x3c7511 of _0xa0dfd8){const [_0x30256d,_0xf381a9]=parseHeader(_0x3c7511);_0x5ce46e[_0x30256d]=_0xf381a9;}}let _0x3a5126;if(_0x1320a7)_0x3a5126=_0x1320a7;else{if(_0x3d1479)try{_0x3a5126=RawAPI['readBodyFromFile'](_0x3d1479);}catch(_0x738865){return console[_0x3934d9(0x103)](_0x3934d9(0x12e)+(_0x738865 instanceof Error?_0x738865[_0x3934d9(0x105)]:String(_0x738865))),0x1;}}const _0x3d64df={'method':_0x27bbfb,'apiType':_0x215e3a,'includeHeaders':_0x17d5b5[_0x3934d9(0xf4)]};_0x3a5126&&(_0x3d64df[_0x3934d9(0x10e)]=_0x3a5126);Object[_0x3934d9(0x101)](_0x5ce46e)[_0x3934d9(0x131)]>0x0&&(_0x3d64df[_0x3934d9(0x126)]=_0x5ce46e);if(_0x17d5b5[_0x3934d9(0xf4)]){const _0x22887c=resolveSite(_0x17d5b5[_0x3934d9(0x11e)]),_0x4b7b15=getEndpoint(_0x22887c,_0x215e3a),_0x394c5f=''+_0x4b7b15+_0x387dd9;console[_0x3934d9(0x103)]('>\x20'+_0x27bbfb+'\x20'+_0x394c5f);const _0x3bde2c=getAuthHeaders(_0x22887c),_0x1bed8e={..._0x3bde2c,..._0x5ce46e};for(const [_0x159695,_0x1ce830]of Object[_0x3934d9(0xf7)](_0x1bed8e)){!isSensitiveHeader(_0x159695)&&console[_0x3934d9(0x103)]('>\x20'+_0x159695+':\x20'+_0x1ce830);}_0x3a5126&&console['error']('>'),console[_0x3934d9(0x103)]('');}const _0xd66621=await _0xd7ac72[_0x3934d9(0x10b)][_0x3934d9(0xfa)](_0x387dd9,_0x3d64df);if(_0x17d5b5[_0x3934d9(0xf4)]&&_0xd66621[_0x3934d9(0x126)]){console['error'](_0x3934d9(0xf9)+_0xd66621[_0x3934d9(0x10c)]);for(const [_0x354d42,_0x3d1b16]of Object['entries'](_0xd66621[_0x3934d9(0x126)])){!isSensitiveHeader(_0x354d42)&&console['error']('<\x20'+_0x354d42+':\x20'+_0x3d1b16);}console[_0x3934d9(0x103)]('');}const _0x3f0589=Boolean(_0x17d5b5[_0x3934d9(0x125)]),_0x539d89={'color':_0x17d5b5[_0x3934d9(0x128)],'noColor':_0x17d5b5[_0x3934d9(0x113)]||_0x3f0589&&!_0x17d5b5['color']},_0x20eec=colorizeJSON(_0xd66621['data'],_0x539d89);return _0x17d5b5['output']?(writeFileSync(_0x17d5b5[_0x3934d9(0x125)],_0x20eec),console[_0x3934d9(0x103)](_0x3934d9(0x114)+_0x17d5b5[_0x3934d9(0x125)])):console[_0x3934d9(0x104)](_0x20eec),0x0;}catch(_0x473fa4){return _0x473fa4 instanceof Error?(console[_0x3934d9(0x103)](_0x3934d9(0x12e)+_0x473fa4[_0x3934d9(0x105)]),_0x17d5b5[_0x3934d9(0xf4)]&&_0x473fa4['stack']&&console['error']('\x0aStack\x20trace:\x0a'+_0x473fa4['stack'])):console[_0x3934d9(0x103)]('Error:\x20'+String(_0x473fa4)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x3aba64=a7_0x2581;(function(_0x5721b5,_0x1aa985){const _0x19877b=a7_0x2581,_0x423cd5=_0x5721b5();while(!![]){try{const _0x5f4e85=-parseInt(_0x19877b(0x1d2))/0x1+-parseInt(_0x19877b(0x18f))/0x2+-parseInt(_0x19877b(0x1e4))/0x3+parseInt(_0x19877b(0x1eb))/0x4*(parseInt(_0x19877b(0x1d4))/0x5)+-parseInt(_0x19877b(0x1cd))/0x6*(-parseInt(_0x19877b(0x1a4))/0x7)+parseInt(_0x19877b(0x1d6))/0x8*(parseInt(_0x19877b(0x1c9))/0x9)+-parseInt(_0x19877b(0x1e0))/0xa*(parseInt(_0x19877b(0x1d3))/0xb);if(_0x5f4e85===_0x1aa985)break;else _0x423cd5['push'](_0x423cd5['shift']());}catch(_0x44bace){_0x423cd5['push'](_0x423cd5['shift']());}}}(a7_0x5d5a,0x67c91));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync,loadGlobalProxy}from'../core/config.js';function a7_0x5d5a(){const _0x3754e5=['jobs','\x20removed\x20from\x20keychain','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','10DbDHqZ','execute','auth:clear','User:\x20','1071651HShJqt','error','warn','site','getUserInfo','✗\x20Validation\x20failed:\x20','Read\x20credential\x20from\x20keychain','8mroDIz','cyan','method','Enter\x20your\x20TD\x20API\x20key:','N/A','ERROR','create','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20--profile\x20','Validating\x20API\x20key...','accountName','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','778568hBhDNS','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','No\x20credential\x20found','log','tdx:\x20auth\x20clear','You\x20can\x20find\x20your\x20API\x20key\x20at:','first_name','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','\x27\x20registered','select','Sign\x20in\x20with\x20browser\x20(recommended)','\x20(profile:\x20','Read\x20credential\x20from\x20','oauth','Setup\x20cancelled','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','No\x20credentials\x20found\x20in\x20keychain','Setup\x20API\x20key\x20authentication\x20interactively','access_token','status','\x20(site:\x20','7lUMnHO','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Remove\x20API\x20key\x20from\x20system\x20keychain','filter','yellow','Opening\x20browser\x20for\x20authentication...','Choose\x20how\x20to\x20sign\x20in:','✓\x20Authentication\x20successful\x0a','✓\x20Profile\x20\x27','logLevel','/users/initiate_sso\x20(account:\x20','\x20\x20tdx','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','API\x20key','auth','name','✓\x20Default\x20site\x20set\x20to\x20','password','tdx\x20profile:\x20','profile','\x20\x20(','apiKey','join','red','\x0aSetup\x20cancelled','/app/mp/ak','/oauth/authorize','\x20for\x20profile:\x20','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','✓\x20Signed\x20in\x20successfully','us01','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','auth:setup','\x20and\x20','trim','18ihEijL','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','description','dim','4830198kzMWmG','bold','API\x20key\x20cannot\x20be\x20empty','all','email','307658oeTNIS','2449843BEwLYY','1879295LDNjtP','Use\x20an\x20API\x20key','580904EOawbb','For\x20scripts\x20or\x20headless\x20servers','Setting\x20up\x20authentication\x20for\x20site:\x20','account_id','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>'];a7_0x5d5a=function(){return _0x3754e5;};return a7_0x5d5a();}import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';function a7_0x2581(_0x3203b3,_0x275f52){_0x3203b3=_0x3203b3-0x186;const _0x5d5a19=a7_0x5d5a();let _0x2581b3=_0x5d5a19[_0x3203b3];return _0x2581b3;}import{promptSiteSelection}from'../core/constants.js';import a7_0x358af6 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_0x178e47 from'chalk';export async function runOAuthLoginFlow(_0x254ab8,_0x1df469,_0x522f7c,_0x24e50c){const _0x2f220b=a7_0x2581,_0x2ba5a7=await isKeychainAvailable();if(!_0x2ba5a7)throw new Error(_0x2f220b(0x1c1)+_0x2f220b(0x1b1));let _0x1a530c=_0x24e50c?.[_0x2f220b(0x18d)];if(!_0x1a530c){const _0x463826=await a7_0x358af6({'type':'text','name':_0x2f220b(0x18d),'message':_0x2f220b(0x1c2)});if(_0x463826[_0x2f220b(0x18d)]===undefined)throw new Error(_0x2f220b(0x19d));_0x1a530c=_0x463826[_0x2f220b(0x18d)][_0x2f220b(0x1c8)]()||undefined;}const _0x17ac24=getConsoleUrl(_0x254ab8);console[_0x2f220b(0x192)](_0x2f220b(0x1aa));_0x1a530c?console['log']('\x20\x20'+_0x17ac24+_0x2f220b(0x1af)+_0x1a530c+')'):console[_0x2f220b(0x192)]('\x20\x20'+_0x17ac24+_0x2f220b(0x1bf));console[_0x2f220b(0x192)]('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0xa7763d=loadGlobalProxy()||process.env.HTTPS_PROXY||process.env.HTTP_PROXY,_0x45814a=await startOAuthFlow(_0x254ab8,{'accountName':_0x1a530c,'proxy':_0xa7763d});console[_0x2f220b(0x192)]('Validating\x20OAuth\x20tokens...');const _0x596bba=TDX[_0x2f220b(0x188)]({'site':_0x254ab8,'accessToken':_0x45814a[_0x2f220b(0x1a1)],'logLevel':_0x522f7c??LogLevel[_0x2f220b(0x187)]}),_0x333ac7=await _0x596bba[_0x2f220b(0x1db)][_0x2f220b(0x1e8)]();console[_0x2f220b(0x192)](a7_0x178e47['green'](_0x2f220b(0x1c3))),console[_0x2f220b(0x192)]('\x20\x20'+a7_0x178e47[_0x2f220b(0x1ec)](_0x254ab8+':'+_0x333ac7[_0x2f220b(0x1d9)])+'\x20\x20user_id:'+_0x333ac7['id']+_0x2f220b(0x1b9)+_0x333ac7[_0x2f220b(0x1d1)]+')');!_0x1a530c&&(console['log'](a7_0x178e47[_0x2f220b(0x1cc)](_0x2f220b(0x1c5))),console[_0x2f220b(0x192)](a7_0x178e47['dim'](_0x2f220b(0x1da))),console[_0x2f220b(0x192)](a7_0x178e47[_0x2f220b(0x1cc)](_0x2f220b(0x190))));await saveOAuthTokens(_0x45814a,_0x1df469),console[_0x2f220b(0x192)](_0x2f220b(0x1a5)+(_0x1df469?_0x2f220b(0x19a)+_0x1df469+')':''));if(_0x1df469){const _0x37cbc4={'site':_0x254ab8};saveProfileToUserConfig(_0x1df469,_0x37cbc4),console[_0x2f220b(0x192)](_0x2f220b(0x1ad)+_0x1df469+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x254ab8),console['log']('✓\x20Default\x20site\x20set\x20to\x20'+_0x254ab8);const _0x270ad1=_0x1df469?_0x2f220b(0x18b)+_0x1df469:'';console[_0x2f220b(0x192)](),console[_0x2f220b(0x192)](_0x2f220b(0x1de)),console['log']('\x20\x20tdx'+_0x270ad1+_0x2f220b(0x18a)),console[_0x2f220b(0x192)](_0x2f220b(0x1b0)+_0x270ad1+_0x2f220b(0x1a6));}export async function promptAuthMethod(){const _0x4bdca0=a7_0x2581,_0x15f12e=await a7_0x358af6({'type':_0x4bdca0(0x198),'name':_0x4bdca0(0x1ed),'message':_0x4bdca0(0x1ab),'choices':[{'title':_0x4bdca0(0x199),'description':_0x4bdca0(0x196),'value':'oauth'},{'title':_0x4bdca0(0x1d5),'description':_0x4bdca0(0x1d7),'value':'apikey'}]});return _0x15f12e['method']||null;}export class AuthSetupCommand extends BaseCommand{['name']=a7_0x3aba64(0x1c6);[a7_0x3aba64(0x1cb)]=a7_0x3aba64(0x1a0);async[a7_0x3aba64(0x1e1)](_0x2c4f70){const _0x1de965=a7_0x3aba64,{options:_0x383b06}=_0x2c4f70,_0x95f1de=_0x383b06[_0x1de965(0x1b8)];console[_0x1de965(0x192)](a7_0x178e47[_0x1de965(0x1ce)]('tdx:\x20auth\x20setup'));const _0x3bd5aa=_0x383b06[_0x1de965(0x1e7)]||_0x1de965(0x1c4),_0xb0d331=await promptSiteSelection(_0x3bd5aa,_0x95f1de,_0x1de965(0x19d));if(!_0xb0d331)return 0x1;const _0x3ffa86=resolveSite(_0xb0d331),_0x59f526=await promptAuthMethod();if(!_0x59f526)return console[_0x1de965(0x192)](_0x1de965(0x1bd)),0x1;if(_0x59f526===_0x1de965(0x19c)){const {accountName:_0x4b6775}=_0x383b06;return await runOAuthLoginFlow(_0x3ffa86,_0x95f1de,_0x383b06[_0x1de965(0x1ae)]??LogLevel[_0x1de965(0x187)],{'accountName':_0x4b6775}),0x0;}console[_0x1de965(0x192)](_0x1de965(0x1d8)+_0x3ffa86),console[_0x1de965(0x192)](_0x1de965(0x194)),console[_0x1de965(0x192)]('\x20\x20'+getConsoleUrl(_0x3ffa86,_0x1de965(0x1be)));const _0x8083b2=await a7_0x358af6({'type':_0x1de965(0x1b6),'name':_0x1de965(0x1ba),'message':_0x1de965(0x1ee),'validate':_0x56a100=>{const _0x4333a3=_0x1de965;if(!_0x56a100||!_0x56a100['trim']())return _0x4333a3(0x1cf);return!![];}});if(!_0x8083b2[_0x1de965(0x1ba)])return console['log']('\x0aSetup\x20cancelled'),0x1;const _0x3096bc=_0x8083b2['apiKey'];console['log'](_0x1de965(0x18c));try{const _0xc4aaa7=TDX[_0x1de965(0x188)]({'site':_0x3ffa86,'apiKey':_0x3096bc[_0x1de965(0x1c8)](),'logLevel':_0x383b06[_0x1de965(0x1ae)]??LogLevel['ERROR']}),_0x5e3014=await _0xc4aaa7[_0x1de965(0x1db)][_0x1de965(0x1e8)]();console['log'](_0x1de965(0x1df)+_0x5e3014[_0x1de965(0x1d1)]+')');const _0x7d8c63=await isKeychainAvailable();_0x7d8c63?(await saveAPIKeyAsync(_0x3096bc['trim'](),_0x3ffa86,_0x95f1de),console[_0x1de965(0x192)](_0x1de965(0x1dd)+(_0x95f1de?_0x1de965(0x19a)+_0x95f1de+')':''))):(console[_0x1de965(0x1e6)](a7_0x178e47[_0x1de965(0x1a9)](_0x1de965(0x18e))),console[_0x1de965(0x1e6)](a7_0x178e47[_0x1de965(0x1a9)](_0x1de965(0x189))));if(_0x95f1de){const _0x38c9a3={'site':_0x3ffa86};saveProfileToUserConfig(_0x95f1de,_0x38c9a3),console['log'](_0x1de965(0x1ad)+_0x95f1de+_0x1de965(0x197));}else saveDefaultSiteToUserConfig(_0x3ffa86),console[_0x1de965(0x192)](_0x1de965(0x1b5)+_0x3ffa86);const _0x110c9f=_0x95f1de?_0x1de965(0x18b)+_0x95f1de:'';return console[_0x1de965(0x192)](),console[_0x1de965(0x192)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log'](_0x1de965(0x1b0)+_0x110c9f+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x1de965(0x192)]('\x20\x20tdx'+_0x110c9f+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x2a202c){if(_0x2a202c instanceof HTTPClientError&&_0x2a202c[_0x1de965(0x1a2)]===0x191)return printAuthError(_0x2a202c),0x1;return console['error'](a7_0x178e47[_0x1de965(0x1bc)](_0x1de965(0x1e9)+(_0x2a202c instanceof Error?_0x2a202c['message']:String(_0x2a202c)))),console[_0x1de965(0x1e5)](_0x1de965(0x19e)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x3aba64(0x1b4)]=a7_0x3aba64(0x1b3);[a7_0x3aba64(0x1cb)]=a7_0x3aba64(0x1ca);async[a7_0x3aba64(0x1e1)](_0x4f9625){const _0x236fae=a7_0x3aba64,{options:_0x323623,tdx:_0x432a3f}=_0x4f9625,_0x2f4c87=_0x323623['site'],_0x4092e5=_0x323623[_0x236fae(0x1b8)],_0x137833=_0x4092e5?_0x4092e5:_0x236fae(0x186);console[_0x236fae(0x192)](_0x236fae(0x1b7)+_0x137833+_0x236fae(0x1a3)+_0x2f4c87+')');const _0x1f9ed6=await getOAuthTokens(_0x4092e5);if(_0x1f9ed6)console[_0x236fae(0x192)]('Credential\x20type:\x20OAuth'),console[_0x236fae(0x192)](_0x236fae(0x1ea)+(_0x4092e5?_0x236fae(0x19a)+_0x4092e5+')':''));else{const _0x2c5731=await resolveAPIKeyAsync(_0x2f4c87,_0x4092e5);if(_0x2c5731){const {source:_0x21c98f,isDeprecated:_0x389589}=_0x2c5731,_0x2d3110=_0x236fae(0x19b)+_0x21c98f;console['log'](_0x389589?a7_0x178e47[_0x236fae(0x1a9)](_0x2d3110):_0x2d3110);}else console['log'](a7_0x178e47[_0x236fae(0x1a9)](_0x236fae(0x191)));}try{const _0x3bf799=await _0x432a3f['jobs']['getUserInfo']();return console[_0x236fae(0x192)](a7_0x178e47['green'](_0x236fae(0x1ac))),console['log'](_0x236fae(0x1e3)+_0x3bf799[_0x236fae(0x1d1)]),(_0x3bf799[_0x236fae(0x195)]||_0x3bf799['last_name'])&&console[_0x236fae(0x192)]('Name:\x20'+[_0x3bf799[_0x236fae(0x195)],_0x3bf799['last_name']][_0x236fae(0x1a8)](Boolean)['join']('\x20')),0x0;}catch(_0x544de8){return _0x544de8 instanceof HTTPClientError&&_0x544de8[_0x236fae(0x1a2)]===0x191?printAuthError(_0x544de8,!![],_0x4092e5):console[_0x236fae(0x1e5)](a7_0x178e47[_0x236fae(0x1bc)]('✗\x20Validation\x20failed:\x20'+(_0x544de8 instanceof Error?_0x544de8['message']:String(_0x544de8)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x3aba64(0x1b4)]=a7_0x3aba64(0x1e2);[a7_0x3aba64(0x1cb)]=a7_0x3aba64(0x1a7);async[a7_0x3aba64(0x1e1)](_0x4a08bc){const _0x4994b1=a7_0x3aba64,{options:_0x5dc371}=_0x4a08bc,_0x39dc21=_0x5dc371[_0x4994b1(0x1b8)];console['log'](a7_0x178e47[_0x4994b1(0x1ce)](_0x4994b1(0x193)));const _0x31efb8=await isKeychainAvailable();if(!_0x31efb8)return console['error'](a7_0x178e47[_0x4994b1(0x1bc)]('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x1ce3fb,_0x6f8cea]=await Promise[_0x4994b1(0x1d0)]([deleteKeychainAPIKey(_0x39dc21),deleteOAuthTokens(_0x39dc21)]);if(_0x1ce3fb||_0x6f8cea){clearCredentialCache();const _0x31e396=[_0x1ce3fb&&_0x4994b1(0x1b2),_0x6f8cea&&'OAuth\x20tokens']['filter'](Boolean)[_0x4994b1(0x1bb)](_0x4994b1(0x1c7));return console[_0x4994b1(0x192)]('✓\x20'+_0x31e396+_0x4994b1(0x1dc)+(_0x39dc21?_0x4994b1(0x19a)+_0x39dc21+')':'')),0x0;}else return console[_0x4994b1(0x192)](_0x4994b1(0x19f)+(_0x39dc21?_0x4994b1(0x1c0)+_0x39dc21:'')),0x1;}}
1
+ const a7_0x4ca683=a7_0x1ce4;(function(_0x5d3b5e,_0x2fa7c8){const _0x53f1bc=a7_0x1ce4,_0x500aa1=_0x5d3b5e();while(!![]){try{const _0xddd279=parseInt(_0x53f1bc(0x214))/0x1*(parseInt(_0x53f1bc(0x223))/0x2)+parseInt(_0x53f1bc(0x1f6))/0x3*(-parseInt(_0x53f1bc(0x21f))/0x4)+-parseInt(_0x53f1bc(0x1d1))/0x5+parseInt(_0x53f1bc(0x200))/0x6*(-parseInt(_0x53f1bc(0x1cc))/0x7)+parseInt(_0x53f1bc(0x1d2))/0x8*(parseInt(_0x53f1bc(0x1d5))/0x9)+parseInt(_0x53f1bc(0x1d9))/0xa+-parseInt(_0x53f1bc(0x1f3))/0xb*(-parseInt(_0x53f1bc(0x1cf))/0xc);if(_0xddd279===_0x2fa7c8)break;else _0x500aa1['push'](_0x500aa1['shift']());}catch(_0x555a7a){_0x500aa1['push'](_0x500aa1['shift']());}}}(a7_0x44b5,0x512fd));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync,loadGlobalProxy}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x2601f6 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_0x1f8795 from'chalk';function a7_0x44b5(){const _0x582426=['first_name','message','Use\x20an\x20API\x20key','oauth','User:\x20','us01','profile','\x20\x20tdx','\x20removed\x20from\x20keychain','✓\x20Profile\x20\x27','\x20--profile\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Name:\x20','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','apiKey','API\x20key\x20cannot\x20be\x20empty','Setting\x20up\x20authentication\x20for\x20site:\x20','tdx\x20profile:\x20','No\x20credentials\x20found\x20in\x20keychain','last_name','auth:clear','method','accountName','getUserInfo','11ujinoY','ERROR','auth:setup','1062ywAZRn','/users/initiate_sso\x20(account:\x20','dim','Enter\x20your\x20TD\x20API\x20key:','Credential\x20type:\x20OAuth','select','\x0aSetup\x20cancelled','/app/mp/ak','yellow','\x20\x20(','211746UfYDED','execute','cyan','text','For\x20scripts\x20or\x20headless\x20servers','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','\x20(site:\x20','Setup\x20cancelled','✗\x20Validation\x20failed:\x20','error','Opening\x20browser\x20for\x20authentication...','red','\x20(profile:\x20','Choose\x20how\x20to\x20sign\x20in:','warn','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','create','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','\x20and\x20','47525SXzZsN','join','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','/oauth/authorize','access_token','email','auth','green','Validating\x20OAuth\x20tokens...','No\x20credential\x20found','all','5316GZZtSv','API\x20key','name','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','22aukyFw','trim','site','status','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','✓\x20Signed\x20in\x20successfully','tdx:\x20auth\x20setup','tdx:\x20auth\x20clear','apikey','description','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','N/A','log','Read\x20credential\x20from\x20keychain','91OzNlRT','password','✓\x20Default\x20site\x20set\x20to\x20','314532DGmZTB','\x20\x20user_id:','1794185ZMTtNa','19768PwWlob','Setup\x20API\x20key\x20authentication\x20interactively','Sign\x20in\x20with\x20browser\x20(recommended)','2079YDfBPZ','\x20for\x20profile:\x20','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','5008400BmHzHS','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'];a7_0x44b5=function(){return _0x582426;};return a7_0x44b5();}export async function runOAuthLoginFlow(_0x59b844,_0x287f2c,_0x2c1194,_0x5a8102){const _0x3b200e=a7_0x1ce4,_0x4be97f=await isKeychainAvailable();if(!_0x4be97f)throw new Error(_0x3b200e(0x206)+_0x3b200e(0x205));let _0x52da58=_0x5a8102?.[_0x3b200e(0x1f1)];if(!_0x52da58){const _0x284549=await a7_0x2601f6({'type':_0x3b200e(0x203),'name':_0x3b200e(0x1f1),'message':_0x3b200e(0x1d7)});if(_0x284549[_0x3b200e(0x1f1)]===undefined)throw new Error(_0x3b200e(0x208));_0x52da58=_0x284549[_0x3b200e(0x1f1)]['trim']()||undefined;}const _0x105412=getConsoleUrl(_0x59b844);console[_0x3b200e(0x1ca)](_0x3b200e(0x20b));_0x52da58?console[_0x3b200e(0x1ca)]('\x20\x20'+_0x105412+_0x3b200e(0x1f7)+_0x52da58+')'):console[_0x3b200e(0x1ca)]('\x20\x20'+_0x105412+_0x3b200e(0x217));console[_0x3b200e(0x1ca)]('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0x2919c9=loadGlobalProxy()||process.env.HTTPS_PROXY||process.env.HTTP_PROXY,_0x3e9a45=await startOAuthFlow(_0x59b844,{'accountName':_0x52da58,'proxy':_0x2919c9});console[_0x3b200e(0x1ca)](_0x3b200e(0x21c));const _0x58d84d=TDX[_0x3b200e(0x211)]({'site':_0x59b844,'accessToken':_0x3e9a45[_0x3b200e(0x218)],'logLevel':_0x2c1194??LogLevel[_0x3b200e(0x1f4)]}),_0x488e21=await _0x58d84d['jobs'][_0x3b200e(0x1f2)]();console['log'](a7_0x1f8795[_0x3b200e(0x21b)](_0x3b200e(0x1c3))),console[_0x3b200e(0x1ca)]('\x20\x20'+a7_0x1f8795[_0x3b200e(0x202)](_0x59b844+':'+_0x488e21['account_id'])+_0x3b200e(0x1d0)+_0x488e21['id']+_0x3b200e(0x1ff)+_0x488e21['email']+')');!_0x52da58&&(console[_0x3b200e(0x1ca)](a7_0x1f8795[_0x3b200e(0x1f8)](_0x3b200e(0x1c2))),console[_0x3b200e(0x1ca)](a7_0x1f8795['dim']('\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>')),console[_0x3b200e(0x1ca)](a7_0x1f8795['dim'](_0x3b200e(0x1c8))));await saveOAuthTokens(_0x3e9a45,_0x287f2c),console[_0x3b200e(0x1ca)](_0x3b200e(0x212)+(_0x287f2c?_0x3b200e(0x20d)+_0x287f2c+')':''));if(_0x287f2c){const _0x2c4fda={'site':_0x59b844};saveProfileToUserConfig(_0x287f2c,_0x2c4fda),console['log'](_0x3b200e(0x1e4)+_0x287f2c+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x59b844),console[_0x3b200e(0x1ca)](_0x3b200e(0x1ce)+_0x59b844);const _0x31bdf8=_0x287f2c?_0x3b200e(0x1e5)+_0x287f2c:'';console[_0x3b200e(0x1ca)](),console[_0x3b200e(0x1ca)](_0x3b200e(0x1da)),console['log'](_0x3b200e(0x1e2)+_0x31bdf8+_0x3b200e(0x216)),console[_0x3b200e(0x1ca)](_0x3b200e(0x1e2)+_0x31bdf8+_0x3b200e(0x1e6));}function a7_0x1ce4(_0x21c749,_0x298908){_0x21c749=_0x21c749-0x1bf;const _0x44b52a=a7_0x44b5();let _0x1ce4fc=_0x44b52a[_0x21c749];return _0x1ce4fc;}export async function promptAuthMethod(){const _0x5ea7c7=a7_0x1ce4,_0x51aa40=await a7_0x2601f6({'type':_0x5ea7c7(0x1fb),'name':_0x5ea7c7(0x1f0),'message':_0x5ea7c7(0x20e),'choices':[{'title':_0x5ea7c7(0x1d4),'description':_0x5ea7c7(0x1e8),'value':_0x5ea7c7(0x1de)},{'title':_0x5ea7c7(0x1dd),'description':_0x5ea7c7(0x204),'value':_0x5ea7c7(0x1c6)}]});return _0x51aa40['method']||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x4ca683(0x221)]=a7_0x4ca683(0x1f5);['description']=a7_0x4ca683(0x1d3);async[a7_0x4ca683(0x201)](_0x3d1c40){const _0xbcc19a=a7_0x4ca683,{options:_0x5c9e89}=_0x3d1c40,_0x270957=_0x5c9e89[_0xbcc19a(0x1e1)];console[_0xbcc19a(0x1ca)](a7_0x1f8795['bold'](_0xbcc19a(0x1c4)));const _0x273edb=_0x5c9e89[_0xbcc19a(0x1c0)]||_0xbcc19a(0x1e0),_0xbd303b=await promptSiteSelection(_0x273edb,_0x270957,'Setup\x20cancelled');if(!_0xbd303b)return 0x1;const _0x3f9501=resolveSite(_0xbd303b),_0x3ba2ad=await promptAuthMethod();if(!_0x3ba2ad)return console[_0xbcc19a(0x1ca)](_0xbcc19a(0x1fc)),0x1;if(_0x3ba2ad===_0xbcc19a(0x1de)){const {accountName:_0x373a1a}=_0x5c9e89;return await runOAuthLoginFlow(_0x3f9501,_0x270957,_0x5c9e89['logLevel']??LogLevel[_0xbcc19a(0x1f4)],{'accountName':_0x373a1a}),0x0;}console['log'](_0xbcc19a(0x1eb)+_0x3f9501),console[_0xbcc19a(0x1ca)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0xbcc19a(0x1ca)]('\x20\x20'+getConsoleUrl(_0x3f9501,_0xbcc19a(0x1fd)));const _0x5c13dc=await a7_0x2601f6({'type':_0xbcc19a(0x1cd),'name':_0xbcc19a(0x1e9),'message':_0xbcc19a(0x1f9),'validate':_0xf0f908=>{const _0x20c9b8=_0xbcc19a;if(!_0xf0f908||!_0xf0f908[_0x20c9b8(0x1bf)]())return _0x20c9b8(0x1ea);return!![];}});if(!_0x5c13dc['apiKey'])return console[_0xbcc19a(0x1ca)](_0xbcc19a(0x1fc)),0x1;const _0x302241=_0x5c13dc[_0xbcc19a(0x1e9)];console[_0xbcc19a(0x1ca)]('Validating\x20API\x20key...');try{const _0x24f471=TDX['create']({'site':_0x3f9501,'apiKey':_0x302241['trim'](),'logLevel':_0x5c9e89['logLevel']??LogLevel[_0xbcc19a(0x1f4)]}),_0x3642cf=await _0x24f471['jobs'][_0xbcc19a(0x1f2)]();console['log']('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x3642cf[_0xbcc19a(0x219)]+')');const _0x2c79ca=await isKeychainAvailable();_0x2c79ca?(await saveAPIKeyAsync(_0x302241[_0xbcc19a(0x1bf)](),_0x3f9501,_0x270957),console[_0xbcc19a(0x1ca)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x270957?_0xbcc19a(0x20d)+_0x270957+')':''))):(console[_0xbcc19a(0x20f)](a7_0x1f8795['yellow'](_0xbcc19a(0x222))),console[_0xbcc19a(0x20f)](a7_0x1f8795['yellow'](_0xbcc19a(0x1d8))));if(_0x270957){const _0x17e8fd={'site':_0x3f9501};saveProfileToUserConfig(_0x270957,_0x17e8fd),console[_0xbcc19a(0x1ca)]('✓\x20Profile\x20\x27'+_0x270957+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x3f9501),console[_0xbcc19a(0x1ca)](_0xbcc19a(0x1ce)+_0x3f9501);const _0x3d6537=_0x270957?_0xbcc19a(0x1e5)+_0x270957:'';return console[_0xbcc19a(0x1ca)](),console[_0xbcc19a(0x1ca)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0xbcc19a(0x1ca)](_0xbcc19a(0x1e2)+_0x3d6537+_0xbcc19a(0x216)),console['log'](_0xbcc19a(0x1e2)+_0x3d6537+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x2fa89b){if(_0x2fa89b instanceof HTTPClientError&&_0x2fa89b['status']===0x191)return printAuthError(_0x2fa89b),0x1;return console['error'](a7_0x1f8795['red'](_0xbcc19a(0x209)+(_0x2fa89b instanceof Error?_0x2fa89b[_0xbcc19a(0x1dc)]:String(_0x2fa89b)))),console['error'](_0xbcc19a(0x210)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x4ca683(0x21a);[a7_0x4ca683(0x1c7)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async['execute'](_0x3f5351){const _0x58bb97=a7_0x4ca683,{options:_0x20d6c2,tdx:_0x402ed5}=_0x3f5351,_0x23a5a7=_0x20d6c2['site'],_0xb08098=_0x20d6c2[_0x58bb97(0x1e1)],_0x3237b9=_0xb08098?_0xb08098:_0x58bb97(0x1c9);console[_0x58bb97(0x1ca)](_0x58bb97(0x1ec)+_0x3237b9+_0x58bb97(0x207)+_0x23a5a7+')');const _0x4fb616=await getOAuthTokens(_0xb08098);if(_0x4fb616)console['log'](_0x58bb97(0x1fa)),console[_0x58bb97(0x1ca)](_0x58bb97(0x1cb)+(_0xb08098?'\x20(profile:\x20'+_0xb08098+')':''));else{const _0x2d5c95=await resolveAPIKeyAsync(_0x23a5a7,_0xb08098);if(_0x2d5c95){const {source:_0x1e5ceb,isDeprecated:_0x32a7a4}=_0x2d5c95,_0x3b261a='Read\x20credential\x20from\x20'+_0x1e5ceb;console['log'](_0x32a7a4?a7_0x1f8795['yellow'](_0x3b261a):_0x3b261a);}else console['log'](a7_0x1f8795[_0x58bb97(0x1fe)](_0x58bb97(0x21d)));}try{const _0x42d3cf=await _0x402ed5['jobs'][_0x58bb97(0x1f2)]();return console[_0x58bb97(0x1ca)](a7_0x1f8795[_0x58bb97(0x21b)]('✓\x20Authentication\x20successful\x0a')),console[_0x58bb97(0x1ca)](_0x58bb97(0x1df)+_0x42d3cf[_0x58bb97(0x219)]),(_0x42d3cf[_0x58bb97(0x1db)]||_0x42d3cf[_0x58bb97(0x1ee)])&&console['log'](_0x58bb97(0x1e7)+[_0x42d3cf[_0x58bb97(0x1db)],_0x42d3cf[_0x58bb97(0x1ee)]]['filter'](Boolean)[_0x58bb97(0x215)]('\x20')),0x0;}catch(_0x4822ab){return _0x4822ab instanceof HTTPClientError&&_0x4822ab[_0x58bb97(0x1c1)]===0x191?printAuthError(_0x4822ab,!![],_0xb08098):console['error'](a7_0x1f8795[_0x58bb97(0x20c)]('✗\x20Validation\x20failed:\x20'+(_0x4822ab instanceof Error?_0x4822ab[_0x58bb97(0x1dc)]:String(_0x4822ab)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x4ca683(0x1ef);[a7_0x4ca683(0x1c7)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x4ca683(0x201)](_0x459203){const _0x4fd0ef=a7_0x4ca683,{options:_0x5f103d}=_0x459203,_0xfa13e7=_0x5f103d['profile'];console[_0x4fd0ef(0x1ca)](a7_0x1f8795['bold'](_0x4fd0ef(0x1c5)));const _0x2e4732=await isKeychainAvailable();if(!_0x2e4732)return console[_0x4fd0ef(0x20a)](a7_0x1f8795[_0x4fd0ef(0x20c)]('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x24d08f,_0xd58168]=await Promise[_0x4fd0ef(0x21e)]([deleteKeychainAPIKey(_0xfa13e7),deleteOAuthTokens(_0xfa13e7)]);if(_0x24d08f||_0xd58168){clearCredentialCache();const _0x3a20f2=[_0x24d08f&&_0x4fd0ef(0x220),_0xd58168&&'OAuth\x20tokens']['filter'](Boolean)[_0x4fd0ef(0x215)](_0x4fd0ef(0x213));return console[_0x4fd0ef(0x1ca)]('✓\x20'+_0x3a20f2+_0x4fd0ef(0x1e3)+(_0xfa13e7?_0x4fd0ef(0x20d)+_0xfa13e7+')':'')),0x0;}else return console[_0x4fd0ef(0x1ca)](_0x4fd0ef(0x1ed)+(_0xfa13e7?_0x4fd0ef(0x1d6)+_0xfa13e7:'')),0x1;}}