@treasuredata/tdx 2026.8.2 → 2026.8.3

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 (247) 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-always-on-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-campaign-pull-command.js +1 -1
  25. package/dist/commands/engage-campaign-push-command.js +1 -1
  26. package/dist/commands/engage-campaign-validate-command.js +1 -1
  27. package/dist/commands/engage-command.js +1 -1
  28. package/dist/commands/engage-template-pull-command.js +1 -1
  29. package/dist/commands/engage-template-push-command.js +1 -1
  30. package/dist/commands/engage-template-validate-command.js +1 -1
  31. package/dist/commands/job-command.js +1 -1
  32. package/dist/commands/journey-command.js +1 -1
  33. package/dist/commands/journey-validate-command.js +1 -1
  34. package/dist/commands/llm-command.js +1 -1
  35. package/dist/commands/mcp-command.js +1 -1
  36. package/dist/commands/parent-segment-command.js +1 -1
  37. package/dist/commands/policy-command.js +1 -1
  38. package/dist/commands/profile-command.js +1 -1
  39. package/dist/commands/profiles-command.js +1 -1
  40. package/dist/commands/query-command.js +1 -1
  41. package/dist/commands/schedule-command.js +1 -1
  42. package/dist/commands/segment-command.js +1 -1
  43. package/dist/commands/segment-create-command.js +1 -1
  44. package/dist/commands/segment-fields-command.js +1 -1
  45. package/dist/commands/segment-move-command.js +1 -1
  46. package/dist/commands/segment-pull-command.js +1 -1
  47. package/dist/commands/segment-push-command.js +1 -1
  48. package/dist/commands/segment-update-command.js +1 -1
  49. package/dist/commands/segment-use-command.js +1 -1
  50. package/dist/commands/segment-validate-command.js +1 -1
  51. package/dist/commands/segments.js +1 -1
  52. package/dist/commands/show.js +1 -1
  53. package/dist/commands/status-command.js +1 -1
  54. package/dist/commands/table-deleted.js +1 -1
  55. package/dist/commands/tables.js +1 -1
  56. package/dist/commands/unset-command.js +1 -1
  57. package/dist/commands/upgrade-command.js +1 -1
  58. package/dist/commands/use-command.js +1 -1
  59. package/dist/commands/user-command.js +1 -1
  60. package/dist/commands/work-command.js +1 -1
  61. package/dist/commands/workflow-command.js +1 -1
  62. package/dist/core/auth.js +1 -1
  63. package/dist/core/command-output.js +1 -1
  64. package/dist/core/config.js +1 -1
  65. package/dist/core/connection-cache.js +1 -1
  66. package/dist/core/constants.js +1 -1
  67. package/dist/core/credential-cache.js +1 -1
  68. package/dist/core/global-context.js +1 -1
  69. package/dist/core/keychain.js +1 -1
  70. package/dist/core/oauth-keychain.js +1 -1
  71. package/dist/core/oauth.js +1 -1
  72. package/dist/core/profile.js +1 -1
  73. package/dist/core/project-config.js +1 -1
  74. package/dist/core/session.js +1 -1
  75. package/dist/core/site-mismatch.js +1 -1
  76. package/dist/core/user-cache.js +1 -1
  77. package/dist/core/version.js +1 -1
  78. package/dist/index.js +1 -1
  79. package/dist/mcp/server.js +1 -1
  80. package/dist/mcp/tools/index.js +1 -1
  81. package/dist/mcp/tools/tdx-run.js +1 -1
  82. package/dist/mcp/tools/tdx-search.js +1 -1
  83. package/dist/mcp/tools/work-create-item.js +1 -1
  84. package/dist/mcp/utils.js +1 -1
  85. package/dist/proxy/claude-usage-tracker.js +1 -1
  86. package/dist/proxy/passthrough-server.js +1 -1
  87. package/dist/proxy/sse-usage-parser.js +1 -1
  88. package/dist/sdk/agent/agent-config.js +1 -1
  89. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  90. package/dist/sdk/agent/agent-yaml.js +1 -1
  91. package/dist/sdk/agent/test/evaluator.js +1 -1
  92. package/dist/sdk/agent/test/executor.js +1 -1
  93. package/dist/sdk/agent/test/index.js +1 -1
  94. package/dist/sdk/agent/test/output.js +1 -1
  95. package/dist/sdk/agent/test/parser.js +1 -1
  96. package/dist/sdk/agent/tool-target-registry.js +1 -1
  97. package/dist/sdk/api.js +1 -1
  98. package/dist/sdk/auth-token.js +1 -1
  99. package/dist/sdk/cas/cas-api-client.d.ts +9 -3
  100. package/dist/sdk/cas/cas-api-client.d.ts.map +1 -1
  101. package/dist/sdk/cas/cas-api-client.js +1 -1
  102. package/dist/sdk/cas/cas-api-client.js.map +1 -1
  103. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  104. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  105. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  106. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  107. package/dist/sdk/cas/index.d.ts +10 -0
  108. package/dist/sdk/cas/index.d.ts.map +1 -1
  109. package/dist/sdk/cas/index.js +1 -1
  110. package/dist/sdk/cas/index.js.map +1 -1
  111. package/dist/sdk/cas/pull-workflow.js +1 -1
  112. package/dist/sdk/cas/push-workflow.js +1 -1
  113. package/dist/sdk/cas/validate-files.js +1 -1
  114. package/dist/sdk/client/cdp-api-client.js +1 -1
  115. package/dist/sdk/client/delivery-api-client.js +1 -1
  116. package/dist/sdk/client/endpoints.js +1 -1
  117. package/dist/sdk/client/engage-api-client.js +1 -1
  118. package/dist/sdk/client/http-client.js +1 -1
  119. package/dist/sdk/client/llm-api-client.js +1 -1
  120. package/dist/sdk/client/oauth-refresh.js +1 -1
  121. package/dist/sdk/client/rate-limiter.js +1 -1
  122. package/dist/sdk/client/td-api-client.js +1 -1
  123. package/dist/sdk/client/trino-api-client.js +1 -1
  124. package/dist/sdk/client/workflow-client.js +1 -1
  125. package/dist/sdk/connection-validator.js +1 -1
  126. package/dist/sdk/connection.js +1 -1
  127. package/dist/sdk/delivery.js +1 -1
  128. package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
  129. package/dist/sdk/engage/always-on-campaign-push.js +1 -1
  130. package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
  131. package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
  132. package/dist/sdk/engage/campaign-pull.js +1 -1
  133. package/dist/sdk/engage/campaign-push.js +1 -1
  134. package/dist/sdk/engage/campaign-validator.js +1 -1
  135. package/dist/sdk/engage/campaign-yaml.js +1 -1
  136. package/dist/sdk/engage/template-pull.js +1 -1
  137. package/dist/sdk/engage/template-push.js +1 -1
  138. package/dist/sdk/engage/template-validator.js +1 -1
  139. package/dist/sdk/engage/template-yaml.js +1 -1
  140. package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
  141. package/dist/sdk/engage/types/campaign-def.js +1 -1
  142. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  143. package/dist/sdk/engage/types/template-schema.js +1 -1
  144. package/dist/sdk/engage.js +1 -1
  145. package/dist/sdk/errors.js +1 -1
  146. package/dist/sdk/index.js +1 -1
  147. package/dist/sdk/io/index.js +1 -1
  148. package/dist/sdk/io/node-filesystem.js +1 -1
  149. package/dist/sdk/job.js +1 -1
  150. package/dist/sdk/journey.js +1 -1
  151. package/dist/sdk/llm/chat-cache.js +1 -1
  152. package/dist/sdk/llm/index.js +1 -1
  153. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  154. package/dist/sdk/llm/model-factors.js +1 -1
  155. package/dist/sdk/llm/user-settings.js +1 -1
  156. package/dist/sdk/personalization.js +1 -1
  157. package/dist/sdk/policy.js +1 -1
  158. package/dist/sdk/query/deleted-table-validation.js +1 -1
  159. package/dist/sdk/query/index.js +1 -1
  160. package/dist/sdk/query/sql-parser.js +1 -1
  161. package/dist/sdk/realtime.js +1 -1
  162. package/dist/sdk/schedule.js +1 -1
  163. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  164. package/dist/sdk/segment/fields-display.js +1 -1
  165. package/dist/sdk/segment/file-discovery.js +1 -1
  166. package/dist/sdk/segment/journey-utils.js +1 -1
  167. package/dist/sdk/segment/journey-validator.js +1 -1
  168. package/dist/sdk/segment/journey-yaml.js +1 -1
  169. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  170. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  171. package/dist/sdk/segment/pull-workflow.js +1 -1
  172. package/dist/sdk/segment/push-recovery.js +1 -1
  173. package/dist/sdk/segment/push-workflow.js +1 -1
  174. package/dist/sdk/segment/resolution-context.js +1 -1
  175. package/dist/sdk/segment/segment-path-parser.js +1 -1
  176. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  177. package/dist/sdk/segment/segment-validator.js +1 -1
  178. package/dist/sdk/segment/target-resolution.js +1 -1
  179. package/dist/sdk/segment/tdx-config.js +1 -1
  180. package/dist/sdk/segment/types/activation-schema.js +1 -1
  181. package/dist/sdk/segment/types/journey-def.js +1 -1
  182. package/dist/sdk/segment/types/journey-schema.js +1 -1
  183. package/dist/sdk/segment/types/segment-def.js +1 -1
  184. package/dist/sdk/segment/types/segment-schema.js +1 -1
  185. package/dist/sdk/segment/validate-files.js +1 -1
  186. package/dist/sdk/segment/yaml-validator.js +1 -1
  187. package/dist/sdk/segment.js +1 -1
  188. package/dist/sdk/types/index.js +1 -1
  189. package/dist/sdk/types/progress.js +1 -1
  190. package/dist/sdk/types/workspace.js +1 -1
  191. package/dist/sdk/user.js +1 -1
  192. package/dist/sdk/util/format-detector.js +1 -1
  193. package/dist/sdk/util/formatters.js +1 -1
  194. package/dist/sdk/util/index.js +1 -1
  195. package/dist/sdk/util/paginate.js +1 -1
  196. package/dist/sdk/util/tree-formatter.js +1 -1
  197. package/dist/sdk/util/tree-search.js +1 -1
  198. package/dist/sdk/workflow/archive-validation.js +1 -1
  199. package/dist/sdk/workflow/clone-workflow.js +1 -1
  200. package/dist/sdk/workflow/index.js +1 -1
  201. package/dist/sdk/workflow/pull-workflow.js +1 -1
  202. package/dist/sdk/workflow/push-workflow.js +1 -1
  203. package/dist/sdk/workflow/task-graph.js +1 -1
  204. package/dist/sdk/workflow/tdx-config.js +1 -1
  205. package/dist/sdk/workflow/workflow-utils.js +1 -1
  206. package/dist/sdk/workspace/access-tracker.js +1 -1
  207. package/dist/sdk/workspace/frontmatter.js +1 -1
  208. package/dist/sdk/workspace/git.js +1 -1
  209. package/dist/sdk/workspace/index.js +1 -1
  210. package/dist/sdk/workspace/templates.js +1 -1
  211. package/dist/sdk/workspace/weekly.js +1 -1
  212. package/dist/sdk/workspace/wikilinks.js +1 -1
  213. package/dist/test-utils/command-runner.js +1 -1
  214. package/dist/test-utils/factories.js +1 -1
  215. package/dist/test-utils/fixtures.js +1 -1
  216. package/dist/test-utils/http-mock.js +1 -1
  217. package/dist/test-utils/index.js +1 -1
  218. package/dist/utils/async.js +1 -1
  219. package/dist/utils/claude-code-state.js +1 -1
  220. package/dist/utils/colors.js +1 -1
  221. package/dist/utils/diff.js +1 -1
  222. package/dist/utils/file-permissions.js +1 -1
  223. package/dist/utils/file-reader.js +1 -1
  224. package/dist/utils/github-releases.js +1 -1
  225. package/dist/utils/global-cache.js +1 -1
  226. package/dist/utils/json-loader.js +1 -1
  227. package/dist/utils/local-cache.js +1 -1
  228. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  229. package/dist/utils/logger/formatters/index.js +1 -1
  230. package/dist/utils/logger/handlers/console-handler.js +1 -1
  231. package/dist/utils/logger/handlers/file-handler.js +1 -1
  232. package/dist/utils/logger/handlers/index.js +1 -1
  233. package/dist/utils/logger/handlers/null-handler.js +1 -1
  234. package/dist/utils/logger/index.js +1 -1
  235. package/dist/utils/logger/logger.js +1 -1
  236. package/dist/utils/logger/types.js +1 -1
  237. package/dist/utils/option-validation.js +1 -1
  238. package/dist/utils/process.js +1 -1
  239. package/dist/utils/prompt.js +1 -1
  240. package/dist/utils/proxy-fetch.js +1 -1
  241. package/dist/utils/spinner.js +1 -1
  242. package/dist/utils/sse-parser.js +1 -1
  243. package/dist/utils/string-utils.js +1 -1
  244. package/dist/utils/table-ref-parser.js +1 -1
  245. package/dist/utils/tdx-logger.js +1 -1
  246. package/dist/utils/version-check.js +1 -1
  247. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x11e068=a3_0x2b69;(function(_0xd16b0d,_0x34f7c2){const _0x47ace5=a3_0x2b69,_0xfbbaae=_0xd16b0d();while(!![]){try{const _0x18012e=parseInt(_0x47ace5(0x71))/0x1+parseInt(_0x47ace5(0x78))/0x2+-parseInt(_0x47ace5(0x72))/0x3+parseInt(_0x47ace5(0x85))/0x4*(parseInt(_0x47ace5(0x6e))/0x5)+-parseInt(_0x47ace5(0x75))/0x6*(parseInt(_0x47ace5(0x7e))/0x7)+-parseInt(_0x47ace5(0x67))/0x8+parseInt(_0x47ace5(0x7a))/0x9;if(_0x18012e===_0x34f7c2)break;else _0xfbbaae['push'](_0xfbbaae['shift']());}catch(_0x15c854){_0xfbbaae['push'](_0xfbbaae['shift']());}}}(a3_0x2810,0x944a2));function a3_0x2b69(_0x4b36b9,_0x134428){_0x4b36b9=_0x4b36b9-0x67;const _0x2810d3=a3_0x2810();let _0x2b69df=_0x2810d3[_0x4b36b9];return _0x2b69df;}import{BaseCommand}from'./command.js';function a3_0x2810(){const _0x42c029=['cause','Error:\x20','error','Resolving\x20child\x20segment\x20\x27','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','length','1630wAKmtF','Resolving\x20parent\x20segment\x20\x27','resolveSegmentId','1061320hufPVR','2319267CCeANw','verbose','activations','21738MCEMwt','List\x20activations\x20for\x20a\x20segment','site','2165860xEwzdp','resolveParentId','5095476dzJCsn','\x27...','description','Child\x20name:\x20','1757RwwoLB','\x20activation','Site:\x20','segment','execute','Parent\x20name:\x20','listActivations','9008XzMXGs','\x20\x20Cause:\x20','Resolved\x20parent\x20ID:\x20','message','data','Error:\x20Segment\x20name\x20is\x20required','9237680yRrNOw'];a3_0x2810=function(){return _0x42c029;};return a3_0x2810();}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{['name']=a3_0x11e068(0x74);[a3_0x11e068(0x7c)]=a3_0x11e068(0x76);async[a3_0x11e068(0x82)](_0x9c1c61){const _0x4603ac=a3_0x11e068,{options:_0x5db56c,args:_0x2e6710,tdx:_0x34c619}=_0x9c1c61;if(_0x2e6710['length']===0x0)return console['error'](_0x4603ac(0x8a)),console[_0x4603ac(0x6a)](_0x4603ac(0x6c)),0x1;try{const {parentId:_0x15783e,childId:_0x415962}=parseSegmentRef(_0x2e6710[0x0]);if(!_0x415962)return console[_0x4603ac(0x6a)]('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x4603ac(0x6a)](_0x4603ac(0x6c)),0x1;_0x5db56c[_0x4603ac(0x73)]&&(console[_0x4603ac(0x6a)](_0x4603ac(0x80)+_0x5db56c[_0x4603ac(0x77)]),console[_0x4603ac(0x6a)](_0x4603ac(0x83)+_0x15783e),console['error'](_0x4603ac(0x7d)+_0x415962));const _0x4db79b=await withSpinner(_0x4603ac(0x6f)+_0x15783e+'\x27...',()=>_0x34c619[_0x4603ac(0x81)][_0x4603ac(0x79)](_0x15783e),{'verbose':_0x5db56c[_0x4603ac(0x73)]}),_0x579b47=_0x4db79b[_0x4603ac(0x89)];_0x5db56c['verbose']&&console['error'](_0x4603ac(0x87)+_0x579b47);const _0xc91125=await withSpinner(_0x4603ac(0x6b)+_0x415962+_0x4603ac(0x7b),()=>_0x34c619['segment'][_0x4603ac(0x70)](_0x579b47,_0x415962),{'verbose':_0x5db56c[_0x4603ac(0x73)]}),_0x345d7b=_0xc91125[_0x4603ac(0x89)];_0x5db56c['verbose']&&console[_0x4603ac(0x6a)]('Resolved\x20child\x20ID:\x20'+_0x345d7b);const _0x4da30c=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x415962+'\x27...',()=>_0x34c619[_0x4603ac(0x81)][_0x4603ac(0x84)](_0x579b47,_0x345d7b),{'verbose':_0x5db56c[_0x4603ac(0x73)]}),_0x22b8c9=_0x4da30c[_0x4603ac(0x89)];return console[_0x4603ac(0x6a)]('✔\x20Found\x20'+_0x22b8c9[_0x4603ac(0x6d)]+_0x4603ac(0x7f)+(_0x22b8c9[_0x4603ac(0x6d)]!==0x1?'s':'')),await handleSDKOutput(_0x22b8c9,_0x5db56c),0x0;}catch(_0x30c70e){if(_0x30c70e instanceof SDKError)return console['error'](_0x4603ac(0x69)+_0x30c70e[_0x4603ac(0x88)]),_0x30c70e[_0x4603ac(0x68)]&&console['error'](_0x4603ac(0x86)+_0x30c70e[_0x4603ac(0x68)]),0x1;throw _0x30c70e;}}}
1
+ const a3_0x1d2fe4=a3_0x210d;(function(_0x523f00,_0x4fa615){const _0x57684d=a3_0x210d,_0x50d4ab=_0x523f00();while(!![]){try{const _0x3121a9=parseInt(_0x57684d(0xde))/0x1*(-parseInt(_0x57684d(0xe6))/0x2)+parseInt(_0x57684d(0xdf))/0x3+-parseInt(_0x57684d(0xf4))/0x4*(-parseInt(_0x57684d(0xe2))/0x5)+parseInt(_0x57684d(0xd8))/0x6+parseInt(_0x57684d(0xf0))/0x7*(parseInt(_0x57684d(0xe5))/0x8)+parseInt(_0x57684d(0xe7))/0x9+-parseInt(_0x57684d(0xd4))/0xa*(parseInt(_0x57684d(0xef))/0xb);if(_0x3121a9===_0x4fa615)break;else _0x50d4ab['push'](_0x50d4ab['shift']());}catch(_0x465308){_0x50d4ab['push'](_0x50d4ab['shift']());}}}(a3_0x45b5,0x8f894));function a3_0x45b5(){const _0xf7a49f=['Site:\x20','listActivations','segment','Error:\x20Segment\x20name\x20is\x20required','216077tjXkjT','3202989yToDtb','verbose','error','779865obEPuO','Resolved\x20parent\x20ID:\x20','name','8YcYUas','2MCxnGi','10343178eOZhPt','Parent\x20name:\x20','Child\x20name:\x20','\x27...','Resolved\x20child\x20ID:\x20','List\x20activations\x20for\x20a\x20segment','message','\x20activation','22nydLED','5073509MsPYmK','activations','Error:\x20','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','12RRUGOq','data','length','resolveParentId','resolveSegmentId','Resolving\x20parent\x20segment\x20\x27','site','17204520puhiWK','\x20\x20Cause:\x20','cause','Listing\x20activations\x20for\x20segment\x20\x27','5011764TMdhGx','Usage:\x20tdx\x20activations\x20<parent_name/child_name>'];a3_0x45b5=function(){return _0xf7a49f;};return a3_0x45b5();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0x210d(_0x2fb7d4,_0x29c3c5){_0x2fb7d4=_0x2fb7d4-0xd4;const _0x45b51=a3_0x45b5();let _0x210d55=_0x45b51[_0x2fb7d4];return _0x210d55;}export class ActivationsCommand extends BaseCommand{[a3_0x1d2fe4(0xe4)]=a3_0x1d2fe4(0xf1);['description']=a3_0x1d2fe4(0xec);async['execute'](_0x444cff){const _0x3d35f8=a3_0x1d2fe4,{options:_0x1d2d12,args:_0x5ea824,tdx:_0xc6c95}=_0x444cff;if(_0x5ea824[_0x3d35f8(0xf6)]===0x0)return console[_0x3d35f8(0xe1)](_0x3d35f8(0xdd)),console[_0x3d35f8(0xe1)](_0x3d35f8(0xd9)),0x1;try{const {parentId:_0x136d08,childId:_0x15052e}=parseSegmentRef(_0x5ea824[0x0]);if(!_0x15052e)return console[_0x3d35f8(0xe1)](_0x3d35f8(0xf3)),console[_0x3d35f8(0xe1)](_0x3d35f8(0xd9)),0x1;_0x1d2d12[_0x3d35f8(0xe0)]&&(console[_0x3d35f8(0xe1)](_0x3d35f8(0xda)+_0x1d2d12[_0x3d35f8(0xfa)]),console[_0x3d35f8(0xe1)](_0x3d35f8(0xe8)+_0x136d08),console[_0x3d35f8(0xe1)](_0x3d35f8(0xe9)+_0x15052e));const _0xd7f06e=await withSpinner(_0x3d35f8(0xf9)+_0x136d08+_0x3d35f8(0xea),()=>_0xc6c95['segment'][_0x3d35f8(0xf7)](_0x136d08),{'verbose':_0x1d2d12['verbose']}),_0x4b3f19=_0xd7f06e[_0x3d35f8(0xf5)];_0x1d2d12[_0x3d35f8(0xe0)]&&console[_0x3d35f8(0xe1)](_0x3d35f8(0xe3)+_0x4b3f19);const _0xb9a82e=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x15052e+_0x3d35f8(0xea),()=>_0xc6c95['segment'][_0x3d35f8(0xf8)](_0x4b3f19,_0x15052e),{'verbose':_0x1d2d12[_0x3d35f8(0xe0)]}),_0x16cc17=_0xb9a82e[_0x3d35f8(0xf5)];_0x1d2d12[_0x3d35f8(0xe0)]&&console[_0x3d35f8(0xe1)](_0x3d35f8(0xeb)+_0x16cc17);const _0x169430=await withSpinner(_0x3d35f8(0xd7)+_0x15052e+_0x3d35f8(0xea),()=>_0xc6c95[_0x3d35f8(0xdc)][_0x3d35f8(0xdb)](_0x4b3f19,_0x16cc17),{'verbose':_0x1d2d12['verbose']}),_0x333657=_0x169430[_0x3d35f8(0xf5)];return console[_0x3d35f8(0xe1)]('✔\x20Found\x20'+_0x333657[_0x3d35f8(0xf6)]+_0x3d35f8(0xee)+(_0x333657['length']!==0x1?'s':'')),await handleSDKOutput(_0x333657,_0x1d2d12),0x0;}catch(_0x236bb2){if(_0x236bb2 instanceof SDKError)return console[_0x3d35f8(0xe1)](_0x3d35f8(0xf2)+_0x236bb2[_0x3d35f8(0xed)]),_0x236bb2[_0x3d35f8(0xd6)]&&console['error'](_0x3d35f8(0xd5)+_0x236bb2['cause']),0x1;throw _0x236bb2;}}}
@@ -1 +1 @@
1
- const a4_0x36eeb0=a4_0x571a;(function(_0x7d4b47,_0x201f95){const _0x58060e=a4_0x571a,_0x123801=_0x7d4b47();while(!![]){try{const _0x481aa0=-parseInt(_0x58060e(0x205))/0x1+parseInt(_0x58060e(0x261))/0x2+-parseInt(_0x58060e(0x21d))/0x3+-parseInt(_0x58060e(0x21b))/0x4+parseInt(_0x58060e(0x1f9))/0x5+parseInt(_0x58060e(0x1cd))/0x6*(-parseInt(_0x58060e(0x255))/0x7)+parseInt(_0x58060e(0x223))/0x8;if(_0x481aa0===_0x201f95)break;else _0x123801['push'](_0x123801['shift']());}catch(_0x376579){_0x123801['push'](_0x123801['shift']());}}}(a4_0x2003,0x518a7));import a4_0x1f75c6 from'chalk';import a4_0x2c93ff from'path';function a4_0x2003(){const _0x24de6f=['\x20errors','\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','force','yes','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','llmProject','dirname','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Agent:\x20','\x20=\x20','\x0aPull\x20summary\x20for\x20\x27','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','agent','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','agent:clone','-\x20no\x20files\x20written','agent:pull','cwd-config','\x20total','Pulling\x20agent\x20\x22','Using\x20project\x20from\x20','Cloning\x20\x22','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','751499aeWBqN','action','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','site','formInterfaces','cloneProject','name','tdx.json','\x20\x20Source:\x20','\x20\x20Chat\x20Interfaces:\x20','push','234818oeskTg','llm','\x20\x20Integration\x20\x22','\x0aChanges:','cyan','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','join','found','llm_project','Using\x20current\x20project:\x20','Summary:','\x20updated','counts','\x0aPush\x20summary\x20for\x20\x27','projectName','session','Using\x20project\x20from\x20context:\x20','log','yellow','Pushing\x20to\x20project...','INVALID_ARGUMENT','dryRun','repeat','\x20\x20Chat\x20Interface\x20\x22','\x20\x20Agents:\x20','Using\x20context\x20project:\x20','agentId','-\x20nothing\x20pushed','\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','total','red','cwd','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20changed','reason','\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)','\x20|\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','agents','textKnowledgeBases','Errors:','prompts','24FiJzPn','Failed\x20to\x20push\x20agent:\x20','Would\x20pull\x20agent:\x20','sourceProjectName','agent:push','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x0aChanges\x20to\x20form\x20interface\x20\x27','pullProject','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20Integrations:\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','New\x20project\x20ID:\x20','chatInterfaces','created','Analyzing\x20changes\x20to\x20push...','Would\x20clone:','error','Agent\x20pulled\x20successfully','projectDir','knowledgeBases','\x20--name\x20','✔\x20Context\x20set:\x20','\x0aWrite\x20','New\x20project\x20name\x20is\x20required','pushProject','Source:\x20','\x20files?','Dry\x20run\x20-\x20no\x20changes\x20made','\x20new','new','\x22\x20from\x20project\x20\x22','\x22:\x20','context','\x20resources?','\x20successfully','gray','newProjectName','Cannot\x20clone\x20from\x20context\x20project\x20\x22','parse','\x0aChanges\x20to\x20agent\x20\x27','Agent\x20','experimentalKnowledgeBases','Cancelled','\x20unchanged','3012950oQIgAP','Pushing\x20agent\x20from\x20\x22','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x22\x20to\x20\x22','\x20\x20Form\x20Interfaces:\x20','\x20\x20Prompts:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0a✔\x20Pushed\x20','Status:\x20','unchanged','New\x20project:\x20','628259OyObzg','execute','Output:\x20','\x20\x20Prompt\x20\x22','diff','dim','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','no_context','Dry\x20run\x20-\x20no\x20files\x20written','Using\x20local\x20project:\x20','\x0aChanges\x20to\x20integration\x20\x27','Using\x20project:\x20','\x0aChanges\x20to\x20prompt\x20\x27','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20Knowledge\x20Bases:\x20','Project:\x20','Analyzing\x20project\x20\x22','No\x20tdx.json\x20found\x20in\x20','updated','utf-8','projectId','\x20\x20Knowledge\x20Base\x20\x22','536772FksCWs','outputPath','1352034gUNSLn','integrations','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x0aChanges\x20to\x20chat\x20interface\x20\x27','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\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','10052400SFabSz','outputDir','message','\x20\x20Agent\x20\x22','Project\x20cloned\x20with\x20errors','MISSING_ARGUMENT','\x20files\x20to\x20','\x20\x20Target:\x20','Clone\x20\x22','\x0aError:','pushAgent','\x0aProject\x20pushed\x20with\x20errors','Output\x20path:\x20','\x22...','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)','description','Writing\x20files...','agentName','agent.yml','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','green','no_local_folder','profile','experimentalArtifacts','errors','Chat:\x20','\x20\x20Form\x20Interface\x20\x22'];a4_0x2003=function(){return _0x24de6f;};return a4_0x2003();}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(_0x3e27b6){const _0x31a8a4=a4_0x571a,_0x442319=[];if(_0x3e27b6[_0x31a8a4(0x1c0)]!==undefined)_0x442319[_0x31a8a4(0x260)](_0x3e27b6['total']+_0x31a8a4(0x250));if(_0x3e27b6['new']!==undefined&&_0x3e27b6[_0x31a8a4(0x1ea)]>0x0)_0x442319[_0x31a8a4(0x260)](a4_0x1f75c6[_0x31a8a4(0x237)](_0x3e27b6[_0x31a8a4(0x1ea)]+_0x31a8a4(0x1e9)));if(_0x3e27b6[_0x31a8a4(0x1da)]!==undefined&&_0x3e27b6[_0x31a8a4(0x1da)]>0x0)_0x442319['push'](a4_0x1f75c6[_0x31a8a4(0x237)](_0x3e27b6['created']+'\x20created'));if(_0x3e27b6[_0x31a8a4(0x217)]!==undefined&&_0x3e27b6[_0x31a8a4(0x217)]>0x0)_0x442319[_0x31a8a4(0x260)](a4_0x1f75c6['yellow'](_0x3e27b6[_0x31a8a4(0x217)]+_0x31a8a4(0x26d)));if(_0x3e27b6[_0x31a8a4(0x203)]!==undefined&&_0x3e27b6[_0x31a8a4(0x203)]>0x0)_0x442319[_0x31a8a4(0x260)](a4_0x1f75c6['gray'](_0x3e27b6['unchanged']+_0x31a8a4(0x1f8)));if(_0x3e27b6[_0x31a8a4(0x23b)]!==undefined&&_0x3e27b6[_0x31a8a4(0x23b)]>0x0)_0x442319[_0x31a8a4(0x260)](a4_0x1f75c6['red'](_0x3e27b6[_0x31a8a4(0x23b)]+_0x31a8a4(0x23e)));return _0x442319[_0x31a8a4(0x268)](',\x20');}function displayDiffs(_0x2ffa4f,_0x9d833f,_0x4f4331,_0x276b1c,_0x5e58de,_0x4b72e1,_0x1d1914,_0x22bd58,_0x2cc75d){const _0x2742ba=a4_0x571a;for(const _0xc17d05 of _0x2ffa4f){if(_0xc17d05[_0x2742ba(0x209)]){const _0x4521fd=_0xc17d05[_0x2742ba(0x234)]||_0xc17d05['name'];console[_0x2742ba(0x1b4)](_0x2742ba(0x1f4)+_0x4521fd+'\x27:'),console[_0x2742ba(0x1b4)]('─'['repeat'](0x3c)),console[_0x2742ba(0x1b4)](_0xc17d05[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c));}}for(const _0x1e899d of _0x9d833f){_0x1e899d[_0x2742ba(0x209)]&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x20b)+_0x1e899d[_0x2742ba(0x25c)]+'\x27:'),console['log']('─'[_0x2742ba(0x1b9)](0x3c)),console[_0x2742ba(0x1b4)](_0x1e899d[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)));}for(const _0x2a50b1 of _0x4f4331){_0x2a50b1['diff']&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x24b)+_0x2a50b1[_0x2742ba(0x25c)]+'\x27:'),console['log']('─'[_0x2742ba(0x1b9)](0x3c)),console[_0x2742ba(0x1b4)](_0x2a50b1[_0x2742ba(0x209)]),console['log']('─'[_0x2742ba(0x1b9)](0x3c)));}for(const _0x31e068 of _0x276b1c){_0x31e068[_0x2742ba(0x209)]&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x211)+_0x31e068['name']+'\x27:'),console[_0x2742ba(0x1b4)]('─'['repeat'](0x3c)),console[_0x2742ba(0x1b4)](_0x31e068[_0x2742ba(0x209)]),console['log']('─'['repeat'](0x3c)));}for(const _0x4362d5 of _0x5e58de){_0x4362d5[_0x2742ba(0x209)]&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x20f)+_0x4362d5[_0x2742ba(0x25c)]+'\x27:'),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)),console[_0x2742ba(0x1b4)](_0x4362d5[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)));}for(const _0x47e612 of _0x4b72e1){_0x47e612['diff']&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x254)+_0x47e612[_0x2742ba(0x25c)]+'\x27:'),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)),console[_0x2742ba(0x1b4)](_0x47e612[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)));}for(const _0x3b9cea of _0x1d1914){_0x3b9cea[_0x2742ba(0x209)]&&(console[_0x2742ba(0x1b4)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x3b9cea[_0x2742ba(0x25c)]+'\x27:'),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)),console[_0x2742ba(0x1b4)](_0x3b9cea[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)));}for(const _0x1f33a4 of _0x22bd58){_0x1f33a4[_0x2742ba(0x209)]&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x1d3)+_0x1f33a4[_0x2742ba(0x25c)]+'\x27:'),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)),console[_0x2742ba(0x1b4)](_0x1f33a4[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)));}for(const _0x4256c6 of _0x2cc75d){_0x4256c6['diff']&&(console[_0x2742ba(0x1b4)](_0x2742ba(0x220)+_0x4256c6[_0x2742ba(0x25c)]+'\x27:'),console['log']('─'[_0x2742ba(0x1b9)](0x3c)),console['log'](_0x4256c6[_0x2742ba(0x209)]),console[_0x2742ba(0x1b4)]('─'[_0x2742ba(0x1b9)](0x3c)));}}function a4_0x571a(_0x1c5970,_0x2394ca){_0x1c5970=_0x1c5970-0x1b3;const _0x200383=a4_0x2003();let _0x571a67=_0x200383[_0x1c5970];return _0x571a67;}export class AgentPullCommand extends BaseCommand{[a4_0x36eeb0(0x25c)]=a4_0x36eeb0(0x24e);[a4_0x36eeb0(0x232)]=a4_0x36eeb0(0x266);async[a4_0x36eeb0(0x206)](_0x1912e5){const _0x4d2025=a4_0x36eeb0,{options:_0x17e537,args:_0x102bde,tdx:_0x241ce6}=_0x1912e5,_0xc525fe=_0x102bde[0x0],_0x2b2200=_0x102bde[0x1],_0x45a4a4=_0x17e537['output'],_0x4b7962=_0x17e537['dryRun'],_0x4f60de=_0x17e537[_0x4d2025(0x240)],_0x42bd8d=_0x17e537[_0x4d2025(0x241)],_0x4adb41=_0x17e537[_0x4d2025(0x243)],_0xb23fe0=_0x17e537[_0x4d2025(0x24a)];let _0x996e9d;if(_0xc525fe){const _0x37deb7=a4_0x2c93ff[_0x4d2025(0x268)](_0xc525fe,_0x4d2025(0x25d));if(existsSync(_0x37deb7))try{const _0x16cf47=JSON[_0x4d2025(0x1f3)](readFileSync(_0x37deb7,'utf-8'));_0x16cf47['llm_project']&&(_0x996e9d={'llm_project':_0x16cf47[_0x4d2025(0x26a)]});}catch{}}const _0x5b0d25=findAgentConfigPath(process['cwd']());let _0x35361b;if(_0x5b0d25)try{const _0x49b6a9=JSON['parse'](readFileSync(_0x5b0d25,_0x4d2025(0x218)));_0x49b6a9[_0x4d2025(0x26a)]&&(_0x35361b={'llm_project':_0x49b6a9['llm_project']});}catch{}const _0x2f0b25=resolveAgentPullArgs({'arg':_0xc525fe,'agentNameArg':_0x2b2200,'agentFlag':_0xb23fe0,'contextProject':_0x4adb41,'argDirConfig':_0x996e9d,'cwdConfigPath':_0x5b0d25||undefined,'cwdConfig':_0x35361b}),{projectNameOrId:_0x3c2128,targetAgentName:_0x35d92d,existingOutputDir:_0x30c015,source:_0x49297c}=_0x2f0b25;if(_0x49297c==='arg-dir')console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x20a)](_0x4d2025(0x252)+a4_0x2c93ff[_0x4d2025(0x268)](_0xc525fe,_0x4d2025(0x25d))+':\x20'+_0x3c2128));else{if(_0x49297c===_0x4d2025(0x24f))console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x20a)](_0x4d2025(0x210)+_0x3c2128));else _0x49297c===_0x4d2025(0x1ed)&&console['log'](a4_0x1f75c6['dim'](_0x4d2025(0x1b3)+_0x3c2128));}if(!_0x3c2128)return _0xb23fe0?(console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x1b5)](_0x4d2025(0x1ff))),console[_0x4d2025(0x1b4)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0x4d2025(0x1b4)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console['log'](a4_0x1f75c6['yellow'](_0x4d2025(0x221))),console['log'](_0x4d2025(0x231)),console[_0x4d2025(0x1b4)](_0x4d2025(0x23f)),console['log'](_0x4d2025(0x1bf)),console[_0x4d2025(0x1b4)](_0x4d2025(0x222)),console[_0x4d2025(0x1b4)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x35d92d){const {data:_0x522451}=await withSpinner(_0x4d2025(0x251)+_0x35d92d+_0x4d2025(0x1eb)+_0x3c2128+'\x22...',()=>_0x241ce6[_0x4d2025(0x262)]['pullAgent'](_0x3c2128,_0x35d92d,_0x45a4a4,{'dryRun':_0x4b7962,'force':_0x4f60de}));if(_0x4b7962)return console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x1b5)](_0x4d2025(0x20d))),console[_0x4d2025(0x1b4)](_0x4d2025(0x1cf)+_0x522451['agentName']),console[_0x4d2025(0x1b4)](_0x4d2025(0x22f)+_0x522451[_0x4d2025(0x21c)]),_0x522451['diff']&&(console[_0x4d2025(0x1b4)](_0x4d2025(0x264)),console[_0x4d2025(0x1b4)]('─'[_0x4d2025(0x1b9)](0x3c)),console[_0x4d2025(0x1b4)](_0x522451[_0x4d2025(0x209)]),console[_0x4d2025(0x1b4)]('─'[_0x4d2025(0x1b9)](0x3c))),0x0;return console['log'](a4_0x1f75c6[_0x4d2025(0x237)](_0x4d2025(0x1de))),console[_0x4d2025(0x1b4)](_0x4d2025(0x246)+_0x522451[_0x4d2025(0x234)]),console[_0x4d2025(0x1b4)](_0x4d2025(0x207)+_0x522451[_0x4d2025(0x21c)]),console[_0x4d2025(0x1b4)](_0x4d2025(0x202)+(_0x522451['isNew']?a4_0x1f75c6[_0x4d2025(0x237)]('new'):_0x522451['hasChanges']?a4_0x1f75c6[_0x4d2025(0x1b5)](_0x4d2025(0x217)):a4_0x1f75c6[_0x4d2025(0x1f0)](_0x4d2025(0x203)))),0x0;}const _0x161b62=_0x30c015||_0x45a4a4,{data:_0x195aee}=await withSpinner(_0x4d2025(0x215)+_0x3c2128+_0x4d2025(0x230),()=>_0x241ce6['llm'][_0x4d2025(0x1d4)](_0x3c2128,_0x161b62,{'dryRun':!![]})),_0x237059=_0x195aee['counts'][_0x4d2025(0x1c9)][_0x4d2025(0x1ea)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1e0)][_0x4d2025(0x1ea)]+_0x195aee['counts'][_0x4d2025(0x1ca)]['new']+_0x195aee['counts'][_0x4d2025(0x1cc)][_0x4d2025(0x1ea)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x21e)]['new']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1f6)][_0x4d2025(0x1ea)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x23a)][_0x4d2025(0x1ea)]+_0x195aee[_0x4d2025(0x26e)]['formInterfaces']['new']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1d9)][_0x4d2025(0x1ea)],_0x3570e2=_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1c9)][_0x4d2025(0x217)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1e0)]['updated']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1ca)][_0x4d2025(0x217)]+_0x195aee['counts']['prompts'][_0x4d2025(0x217)]+_0x195aee[_0x4d2025(0x26e)]['integrations']['updated']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1f6)][_0x4d2025(0x217)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x23a)][_0x4d2025(0x217)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x25a)][_0x4d2025(0x217)]+_0x195aee['counts'][_0x4d2025(0x1d9)][_0x4d2025(0x217)],_0x30bbde=_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1c9)][_0x4d2025(0x203)]+_0x195aee['counts'][_0x4d2025(0x1e0)]['unchanged']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1ca)]['unchanged']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1cc)]['unchanged']+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x21e)][_0x4d2025(0x203)]+_0x195aee[_0x4d2025(0x26e)]['experimentalKnowledgeBases'][_0x4d2025(0x203)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x23a)][_0x4d2025(0x203)]+_0x195aee['counts'][_0x4d2025(0x25a)][_0x4d2025(0x203)]+_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1d9)][_0x4d2025(0x203)];console['log'](_0x4d2025(0x248)+_0x195aee[_0x4d2025(0x270)]+'\x27:'),console[_0x4d2025(0x1b4)]('\x20\x20'+a4_0x1f75c6[_0x4d2025(0x237)]('+\x20'+_0x237059+'\x20new')+_0x4d2025(0x1c7)+a4_0x1f75c6['yellow']('~\x20'+_0x3570e2+'\x20changed')+'\x20|\x20'+a4_0x1f75c6[_0x4d2025(0x20a)]('=\x20'+_0x30bbde+'\x20unchanged')),console['log'](_0x4d2025(0x1bb)+formatCountSummary(_0x195aee['counts'][_0x4d2025(0x1c9)])),console[_0x4d2025(0x1b4)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x195aee[_0x4d2025(0x26e)]['knowledgeBases'])),console[_0x4d2025(0x1b4)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1ca)])),console[_0x4d2025(0x1b4)](_0x4d2025(0x1fe)+formatCountSummary(_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1cc)])),console[_0x4d2025(0x1b4)](_0x4d2025(0x1d6)+formatCountSummary(_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x21e)])),console[_0x4d2025(0x1b4)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x195aee['counts']['formInterfaces'])),console[_0x4d2025(0x1b4)](_0x4d2025(0x25f)+formatCountSummary(_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1d9)]));const _0x2f1eff=_0x195aee[_0x4d2025(0x26e)][_0x4d2025(0x1f6)][_0x4d2025(0x1c0)]>0x0||_0x195aee['counts'][_0x4d2025(0x23a)]['total']>0x0;_0x2f1eff&&(console[_0x4d2025(0x1b4)](_0x4d2025(0x267)+formatCountSummary(_0x195aee['counts'][_0x4d2025(0x1f6)])),console[_0x4d2025(0x1b4)](_0x4d2025(0x1d5)+formatCountSummary(_0x195aee['counts'][_0x4d2025(0x23a)])));console[_0x4d2025(0x1b4)](_0x4d2025(0x22a)+a4_0x1f75c6[_0x4d2025(0x265)](_0x195aee[_0x4d2025(0x224)])),displayDiffs(_0x195aee[_0x4d2025(0x1c9)],_0x195aee[_0x4d2025(0x1e0)],_0x195aee[_0x4d2025(0x1ca)],_0x195aee[_0x4d2025(0x1cc)],_0x195aee[_0x4d2025(0x21e)],_0x195aee[_0x4d2025(0x1f6)],_0x195aee[_0x4d2025(0x23a)],_0x195aee[_0x4d2025(0x25a)],_0x195aee[_0x4d2025(0x1d9)]);if(_0x4b7962)return console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x1b5)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x237059===0x0&&_0x3570e2===0x0)return console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x237)](_0x4d2025(0x1c8))),saveSessionContext({'llm_project':_0x195aee['projectName']},_0x17e537['session']),console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x237)](_0x4d2025(0x1e2)+a4_0x1f75c6[_0x4d2025(0x20a)](_0x4d2025(0x26a))+_0x4d2025(0x247)+a4_0x1f75c6[_0x4d2025(0x265)](_0x195aee[_0x4d2025(0x270)]))),0x0;if(!_0x42bd8d&&!_0x4f60de){if(!isInteractive())return console[_0x4d2025(0x1dd)](a4_0x1f75c6[_0x4d2025(0x1c1)](_0x4d2025(0x22c)),_0x4d2025(0x1fb)),console[_0x4d2025(0x1dd)](a4_0x1f75c6[_0x4d2025(0x20a)](_0x4d2025(0x200))),0x1;const _0x22799e=await confirmKey(_0x4d2025(0x1e3)+(_0x237059+_0x3570e2)+_0x4d2025(0x1e7));if(!_0x22799e)return console[_0x4d2025(0x1b4)](a4_0x1f75c6[_0x4d2025(0x1b5)](_0x4d2025(0x1f7)),_0x4d2025(0x24d)),0x1;}const {data:_0x2c0eba}=await withSpinner(_0x4d2025(0x233),()=>_0x241ce6[_0x4d2025(0x262)][_0x4d2025(0x1d4)](_0x3c2128,_0x161b62,{'force':_0x4f60de}));return console['log'](a4_0x1f75c6[_0x4d2025(0x237)]('\x0a✔\x20Pulled\x20'+(_0x237059+_0x3570e2)+_0x4d2025(0x229)+_0x2c0eba[_0x4d2025(0x224)])),saveSessionContext({'llm_project':_0x2c0eba[_0x4d2025(0x270)]},_0x17e537[_0x4d2025(0x271)]),console['log'](a4_0x1f75c6['green'](_0x4d2025(0x1e2)+a4_0x1f75c6[_0x4d2025(0x20a)](_0x4d2025(0x26a))+'\x20=\x20'+a4_0x1f75c6['cyan'](_0x2c0eba[_0x4d2025(0x270)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x36eeb0(0x25c)]=a4_0x36eeb0(0x24c);[a4_0x36eeb0(0x232)]=a4_0x36eeb0(0x212);async['execute'](_0x13c57e){const _0x30a963=a4_0x36eeb0,{options:_0x2463bf,args:_0x279c0e,tdx:_0x4443aa}=_0x13c57e,_0x4a6d51=_0x279c0e[0x0],_0x386488=_0x2463bf[_0x30a963(0x25c)],_0x27038c=_0x2463bf[_0x30a963(0x1b8)],_0x33f833=_0x2463bf['yes'],_0x21636a=_0x2463bf['site'],_0x43ee3c=_0x2463bf['llmProject'];let _0x28f999;const _0x466f5b=findAgentConfigPath(process['cwd']());if(_0x4a6d51){const _0x35dbe1=a4_0x2c93ff['join'](_0x4a6d51,'tdx.json');existsSync(_0x35dbe1)?(_0x28f999=_0x4a6d51,console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x20a)](_0x30a963(0x20e)+_0x4a6d51))):_0x28f999=_0x4a6d51;}else{if(_0x466f5b)_0x28f999=a4_0x2c93ff[_0x30a963(0x244)](_0x466f5b),console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x20a)](_0x30a963(0x26b)+_0x28f999));else{if(_0x43ee3c){const _0x10c8a4=sanitizeForFilesystem(_0x43ee3c);let _0x3b2ffe=_0x10c8a4,_0x149d78=a4_0x2c93ff['join'](process[_0x30a963(0x1c2)](),_0x30a963(0x1c9),_0x10c8a4,'tdx.json');if(!existsSync(_0x149d78)){const _0xf5f5c8=normalizeName(_0x43ee3c),_0x6b659=a4_0x2c93ff[_0x30a963(0x268)](process[_0x30a963(0x1c2)](),_0x30a963(0x1c9),_0xf5f5c8,'tdx.json');existsSync(_0x6b659)&&(_0x3b2ffe=_0xf5f5c8,_0x149d78=_0x6b659);}if(existsSync(_0x149d78))_0x28f999=a4_0x2c93ff[_0x30a963(0x244)](_0x149d78),console['log'](a4_0x1f75c6[_0x30a963(0x20a)]('Using\x20local\x20project:\x20'+_0x28f999));else{const _0x412223=_0x2463bf[_0x30a963(0x239)];if(_0x412223)throw new SDKError(ErrorCode[_0x30a963(0x1b7)],_0x30a963(0x1f2)+_0x43ee3c+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x30a963(0x236)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+('\x20\x20tdx\x20agent\x20pull\x20'+_0x43ee3c+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x3b2ffe+_0x30a963(0x1e1)+(_0x386488||'<new-name>')+'\x20--profile\x20'+_0x412223)});_0x28f999=_0x43ee3c,console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x20a)](_0x30a963(0x1bc)+_0x43ee3c));}}}}if(!_0x28f999)return console['log'](a4_0x1f75c6[_0x30a963(0x1b5)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x30a963(0x1b4)](_0x30a963(0x1c3)),console[_0x30a963(0x1b4)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x30a963(0x1b4)](_0x30a963(0x1c6)),console[_0x30a963(0x1b4)](_0x30a963(0x258)),0x1;if(!_0x386488)throw new SDKError(ErrorCode[_0x30a963(0x228)],_0x30a963(0x1e4),undefined,{'helpText':_0x30a963(0x242)});if(!_0x33f833&&!_0x27038c){if(!isInteractive())return console[_0x30a963(0x1dd)](a4_0x1f75c6[_0x30a963(0x1c1)](_0x30a963(0x22c)),_0x30a963(0x1fb)),console['error'](a4_0x1f75c6['dim'](_0x30a963(0x200))),0x1;const _0x45d3d1=await confirmKey(_0x30a963(0x22b)+_0x28f999+'\x22\x20to\x20new\x20project\x20\x22'+_0x386488+'\x22?');if(!_0x45d3d1)return console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1b5)](_0x30a963(0x1f7))),0x1;}const {data:_0x1ac9c5}=await withSpinner(_0x30a963(0x253)+_0x28f999+_0x30a963(0x1fc)+_0x386488+_0x30a963(0x230),()=>_0x4443aa[_0x30a963(0x262)][_0x30a963(0x25b)](_0x28f999,_0x386488,{'dryRun':_0x27038c}));if(_0x27038c){console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1b5)](_0x30a963(0x1e8))),console['log']('Source:\x20'+_0x1ac9c5['sourceProjectName']),console['log'](_0x30a963(0x204)+_0x386488),console['log'](_0x30a963(0x1dc)),console[_0x30a963(0x1b4)]('\x20\x20Agents:\x20'+_0x1ac9c5['counts'][_0x30a963(0x1c9)][_0x30a963(0x1da)]),console[_0x30a963(0x1b4)](_0x30a963(0x213)+_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1e0)][_0x30a963(0x1da)]),console['log'](_0x30a963(0x1fe)+_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1cc)][_0x30a963(0x1da)]),console[_0x30a963(0x1b4)](_0x30a963(0x1fd)+_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x25a)][_0x30a963(0x1da)]),console[_0x30a963(0x1b4)](_0x30a963(0x25f)+_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1d9)][_0x30a963(0x1da)]);const _0x28e77f=_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1f6)][_0x30a963(0x1da)]>0x0||_0x1ac9c5[_0x30a963(0x26e)]['experimentalArtifacts'][_0x30a963(0x1da)]>0x0;return _0x28e77f&&(console[_0x30a963(0x1b4)](_0x30a963(0x267)+_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1f6)][_0x30a963(0x1da)]),console[_0x30a963(0x1b4)](_0x30a963(0x1d5)+_0x1ac9c5['counts']['experimentalArtifacts'][_0x30a963(0x1da)])),0x0;}const _0x50063c=_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1c9)][_0x30a963(0x23b)]>0x0||_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1e0)]['errors']>0x0||_0x1ac9c5['counts'][_0x30a963(0x1cc)]['errors']>0x0||_0x1ac9c5['counts']['formInterfaces']['errors']>0x0||_0x1ac9c5[_0x30a963(0x26e)]['chatInterfaces'][_0x30a963(0x23b)]>0x0||_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1f6)]['errors']>0x0||_0x1ac9c5[_0x30a963(0x26e)]['experimentalArtifacts'][_0x30a963(0x23b)]>0x0;_0x50063c?console[_0x30a963(0x1b4)](a4_0x1f75c6['yellow'](_0x30a963(0x227))):console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x237)]('Project\x20cloned\x20successfully'));console[_0x30a963(0x1b4)](_0x30a963(0x1e6)+_0x1ac9c5[_0x30a963(0x1d0)]),console['log'](_0x30a963(0x204)+_0x1ac9c5[_0x30a963(0x1f1)]),console['log'](_0x30a963(0x1d8)+_0x1ac9c5['newProjectId']),console[_0x30a963(0x1b4)](),console[_0x30a963(0x1b4)](_0x30a963(0x26c)),console['log'](_0x30a963(0x1bb)+formatCountSummary(_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1c9)])),console[_0x30a963(0x1b4)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1e0)])),console[_0x30a963(0x1b4)](_0x30a963(0x1fe)+formatCountSummary(_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1cc)])),console[_0x30a963(0x1b4)](_0x30a963(0x1d6)+formatCountSummary(_0x1ac9c5[_0x30a963(0x26e)]['integrations'])),console[_0x30a963(0x1b4)](_0x30a963(0x1fd)+formatCountSummary(_0x1ac9c5['counts'][_0x30a963(0x25a)])),console[_0x30a963(0x1b4)](_0x30a963(0x25f)+formatCountSummary(_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1d9)]));const _0x584ccd=_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1f6)]['created']>0x0||_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x1f6)][_0x30a963(0x217)]>0x0||_0x1ac9c5[_0x30a963(0x26e)]['experimentalKnowledgeBases'][_0x30a963(0x203)]>0x0||_0x1ac9c5['counts'][_0x30a963(0x23a)][_0x30a963(0x1da)]>0x0||_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x23a)][_0x30a963(0x217)]>0x0||_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x23a)][_0x30a963(0x203)]>0x0;_0x584ccd&&(console[_0x30a963(0x1b4)](_0x30a963(0x267)+formatCountSummary(_0x1ac9c5['counts'][_0x30a963(0x1f6)])),console[_0x30a963(0x1b4)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x1ac9c5[_0x30a963(0x26e)][_0x30a963(0x23a)])));if(_0x50063c){console[_0x30a963(0x1b4)](),console[_0x30a963(0x1b4)](a4_0x1f75c6['red'](_0x30a963(0x1cb)));for(const _0x1b0ba2 of _0x1ac9c5[_0x30a963(0x1c9)]){_0x1b0ba2['action']===_0x30a963(0x1dd)&&console[_0x30a963(0x1b4)](a4_0x1f75c6['red']('\x20\x20Agent\x20\x22'+_0x1b0ba2[_0x30a963(0x234)]+_0x30a963(0x1ec)+_0x1b0ba2[_0x30a963(0x1dd)]));}for(const _0x23d550 of _0x1ac9c5[_0x30a963(0x1e0)]){_0x23d550[_0x30a963(0x256)]===_0x30a963(0x1dd)&&console['log'](a4_0x1f75c6[_0x30a963(0x1c1)](_0x30a963(0x21a)+_0x23d550[_0x30a963(0x25c)]+_0x30a963(0x1ec)+_0x23d550['error']));}for(const _0x42834d of _0x1ac9c5[_0x30a963(0x1cc)]){_0x42834d['action']===_0x30a963(0x1dd)&&console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1c1)]('\x20\x20Prompt\x20\x22'+_0x42834d[_0x30a963(0x25c)]+_0x30a963(0x1ec)+_0x42834d[_0x30a963(0x1dd)]));}for(const _0x352944 of _0x1ac9c5[_0x30a963(0x21e)]){_0x352944[_0x30a963(0x256)]===_0x30a963(0x1dd)&&console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1c1)](_0x30a963(0x263)+_0x352944[_0x30a963(0x25c)]+'\x22:\x20'+_0x352944[_0x30a963(0x1dd)]));}for(const _0x168df6 of _0x1ac9c5[_0x30a963(0x25a)]){_0x168df6[_0x30a963(0x256)]==='error'&&console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1c1)](_0x30a963(0x23d)+_0x168df6[_0x30a963(0x25c)]+'\x22:\x20'+_0x168df6[_0x30a963(0x1dd)]));}for(const _0x31afc4 of _0x1ac9c5['chatInterfaces']){_0x31afc4[_0x30a963(0x256)]==='error'&&console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1c1)]('\x20\x20Chat\x20Interface\x20\x22'+_0x31afc4['name']+_0x30a963(0x1ec)+_0x31afc4[_0x30a963(0x1dd)]));}for(const _0x30dae1 of _0x1ac9c5[_0x30a963(0x1f6)]){_0x30dae1[_0x30a963(0x256)]===_0x30a963(0x1dd)&&console[_0x30a963(0x1b4)](a4_0x1f75c6[_0x30a963(0x1c1)](_0x30a963(0x249)+_0x30dae1[_0x30a963(0x25c)]+_0x30a963(0x1ec)+_0x30dae1[_0x30a963(0x1dd)]));}for(const _0x570b50 of _0x1ac9c5[_0x30a963(0x23a)]){_0x570b50[_0x30a963(0x256)]===_0x30a963(0x1dd)&&console['log'](a4_0x1f75c6['red']('\x20\x20Experimental\x20Artifact\x20\x22'+_0x570b50[_0x30a963(0x25c)]+_0x30a963(0x1ec)+_0x570b50['error']));}return 0x1;}console[_0x30a963(0x1b4)]();const _0x4dbb4d=getLLMProjectUrl(_0x21636a,_0x1ac9c5['newProjectId']);return console['log']('Project:\x20'+a4_0x1f75c6[_0x30a963(0x265)](_0x4dbb4d)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x36eeb0(0x25c)]=a4_0x36eeb0(0x1d1);[a4_0x36eeb0(0x232)]=a4_0x36eeb0(0x257);async[a4_0x36eeb0(0x206)](_0x56df93){const _0x31f9fe=a4_0x36eeb0,{options:_0x53655b,args:_0x500f33,tdx:_0x15cf94}=_0x56df93;let _0x1521b8=_0x500f33[0x0]||process[_0x31f9fe(0x1c2)]();const _0x222b1d=_0x53655b[_0x31f9fe(0x1b8)],_0x504701=_0x53655b[_0x31f9fe(0x240)],_0x3514f7=_0x53655b[_0x31f9fe(0x241)],_0x59bd9e=_0x53655b[_0x31f9fe(0x259)],_0x101197=a4_0x2c93ff[_0x31f9fe(0x268)](_0x1521b8,_0x31f9fe(0x235)),_0x52f1e5=existsSync(_0x101197);if(_0x52f1e5){const {data:_0x221a1e}=await withSpinner(_0x31f9fe(0x1fa)+_0x1521b8+_0x31f9fe(0x230),()=>_0x15cf94[_0x31f9fe(0x262)][_0x31f9fe(0x22d)](_0x1521b8,{'dryRun':_0x222b1d,'force':_0x504701}));if(_0x222b1d)return console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1b5)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x31f9fe(0x1b4)]('Would\x20push\x20agent:\x20'+_0x221a1e['agentName']),0x0;if(_0x221a1e[_0x31f9fe(0x256)]==='error')return console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x1ce)+_0x221a1e['error'])),0x1;console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x237)](_0x31f9fe(0x1f5)+_0x221a1e[_0x31f9fe(0x256)]+_0x31f9fe(0x1ef))),console[_0x31f9fe(0x1b4)](_0x31f9fe(0x246)+_0x221a1e['agentName']);if(_0x221a1e['agentId']&&_0x221a1e[_0x31f9fe(0x219)]){const _0x43bd0a=getLLMAgentChatUrl(_0x59bd9e,_0x221a1e[_0x31f9fe(0x219)],_0x221a1e[_0x31f9fe(0x1bd)]);console['log'](_0x31f9fe(0x23c)+a4_0x1f75c6[_0x31f9fe(0x265)](_0x43bd0a));}return 0x0;}const _0x14c8a7=_0x53655b[_0x31f9fe(0x243)],_0x5904f5=resolveProjectFromContext(_0x1521b8,_0x14c8a7);if(_0x5904f5[_0x31f9fe(0x269)])_0x1521b8=_0x5904f5[_0x31f9fe(0x1df)],_0x5904f5['source']===_0x31f9fe(0x1ed)&&console[_0x31f9fe(0x1b4)](a4_0x1f75c6['dim']('Using\x20project:\x20'+_0x1521b8));else{let _0x337af1='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x5904f5[_0x31f9fe(0x1c5)]===_0x31f9fe(0x238)&&(_0x337af1=_0x5904f5[_0x31f9fe(0x225)]+_0x31f9fe(0x245)+_0x5904f5[_0x31f9fe(0x243)]+_0x31f9fe(0x21f));throw new SDKError(ErrorCode[_0x31f9fe(0x1b7)],_0x5904f5[_0x31f9fe(0x1c5)]===_0x31f9fe(0x20c)?_0x5904f5[_0x31f9fe(0x225)]:_0x31f9fe(0x216)+_0x1521b8,undefined,{'helpText':_0x337af1});}const {data:_0x52bb31}=await withSpinner(_0x31f9fe(0x1db),()=>_0x15cf94[_0x31f9fe(0x262)]['pushProject'](_0x1521b8,{'dryRun':!![]})),_0x4d0448=_0x52bb31['counts'][_0x31f9fe(0x1c9)][_0x31f9fe(0x23b)]>0x0;if(_0x4d0448){console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1c1)]('\x0aErrors\x20found:'));for(const _0x53787 of _0x52bb31[_0x31f9fe(0x1c9)]){_0x53787[_0x31f9fe(0x256)]===_0x31f9fe(0x1dd)&&console['log'](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x226)+_0x53787[_0x31f9fe(0x234)]+_0x31f9fe(0x1ec)+_0x53787[_0x31f9fe(0x1dd)]));}return 0x1;}const _0x1c9622=_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1c9)][_0x31f9fe(0x1da)]+_0x52bb31['counts']['knowledgeBases'][_0x31f9fe(0x1da)]+_0x52bb31['counts'][_0x31f9fe(0x1ca)][_0x31f9fe(0x1da)]+_0x52bb31[_0x31f9fe(0x26e)]['prompts'][_0x31f9fe(0x1da)]+_0x52bb31['counts'][_0x31f9fe(0x21e)][_0x31f9fe(0x1da)]+_0x52bb31['counts'][_0x31f9fe(0x1f6)][_0x31f9fe(0x1da)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x23a)][_0x31f9fe(0x1da)]+_0x52bb31['counts'][_0x31f9fe(0x25a)]['created']+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1d9)]['created'],_0x1ae29a=_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1c9)][_0x31f9fe(0x217)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1e0)][_0x31f9fe(0x217)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1ca)][_0x31f9fe(0x217)]+_0x52bb31['counts']['prompts'][_0x31f9fe(0x217)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x21e)]['updated']+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1f6)]['updated']+_0x52bb31['counts']['experimentalArtifacts'][_0x31f9fe(0x217)]+_0x52bb31[_0x31f9fe(0x26e)]['formInterfaces'][_0x31f9fe(0x217)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1d9)][_0x31f9fe(0x217)],_0x522a16=_0x52bb31[_0x31f9fe(0x26e)]['agents'][_0x31f9fe(0x203)]+_0x52bb31['counts'][_0x31f9fe(0x1e0)][_0x31f9fe(0x203)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1ca)][_0x31f9fe(0x203)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1cc)]['unchanged']+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x21e)]['unchanged']+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1f6)][_0x31f9fe(0x203)]+_0x52bb31[_0x31f9fe(0x26e)]['experimentalArtifacts'][_0x31f9fe(0x203)]+_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x25a)]['unchanged']+_0x52bb31[_0x31f9fe(0x26e)]['chatInterfaces']['unchanged'];console[_0x31f9fe(0x1b4)](_0x31f9fe(0x26f)+_0x52bb31[_0x31f9fe(0x270)]+'\x27:'),console[_0x31f9fe(0x1b4)]('\x20\x20'+a4_0x1f75c6[_0x31f9fe(0x237)]('+\x20'+_0x1c9622+_0x31f9fe(0x1e9))+_0x31f9fe(0x1c7)+a4_0x1f75c6[_0x31f9fe(0x1b5)]('~\x20'+_0x1ae29a+_0x31f9fe(0x1c4))+'\x20|\x20'+a4_0x1f75c6[_0x31f9fe(0x20a)]('=\x20'+_0x522a16+_0x31f9fe(0x1f8))),console[_0x31f9fe(0x1b4)]('\x20\x20Agents:\x20'+formatCountSummary(_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1c9)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x52bb31['counts'][_0x31f9fe(0x1e0)])),console[_0x31f9fe(0x1b4)](_0x31f9fe(0x1d2)+formatCountSummary(_0x52bb31[_0x31f9fe(0x26e)]['textKnowledgeBases'])),console[_0x31f9fe(0x1b4)](_0x31f9fe(0x1fe)+formatCountSummary(_0x52bb31['counts'][_0x31f9fe(0x1cc)])),console[_0x31f9fe(0x1b4)](_0x31f9fe(0x1d6)+formatCountSummary(_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x21e)])),console[_0x31f9fe(0x1b4)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x52bb31['counts'][_0x31f9fe(0x25a)])),console['log'](_0x31f9fe(0x25f)+formatCountSummary(_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1d9)]));const _0x562b2c=_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1f6)][_0x31f9fe(0x1da)]>0x0||_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1f6)][_0x31f9fe(0x217)]>0x0||_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x1f6)][_0x31f9fe(0x203)]>0x0||_0x52bb31['counts'][_0x31f9fe(0x23a)][_0x31f9fe(0x1da)]>0x0||_0x52bb31[_0x31f9fe(0x26e)]['experimentalArtifacts'][_0x31f9fe(0x217)]>0x0||_0x52bb31[_0x31f9fe(0x26e)][_0x31f9fe(0x23a)][_0x31f9fe(0x203)]>0x0;_0x562b2c&&(console[_0x31f9fe(0x1b4)](_0x31f9fe(0x267)+formatCountSummary(_0x52bb31['counts'][_0x31f9fe(0x1f6)])),console[_0x31f9fe(0x1b4)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x52bb31[_0x31f9fe(0x26e)]['experimentalArtifacts'])));console[_0x31f9fe(0x1b4)](_0x31f9fe(0x25e)+a4_0x1f75c6[_0x31f9fe(0x265)](_0x1521b8)),displayDiffs(_0x52bb31['agents'],_0x52bb31[_0x31f9fe(0x1e0)],_0x52bb31['textKnowledgeBases'],_0x52bb31[_0x31f9fe(0x1cc)],_0x52bb31[_0x31f9fe(0x21e)],_0x52bb31['experimentalKnowledgeBases'],_0x52bb31[_0x31f9fe(0x23a)],_0x52bb31[_0x31f9fe(0x25a)],_0x52bb31[_0x31f9fe(0x1d9)]);if(_0x222b1d)return console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1b5)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x1c9622===0x0&&_0x1ae29a===0x0){console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x237)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x4384a0=getLLMProjectUrl(_0x59bd9e,_0x52bb31[_0x31f9fe(0x219)]);return console['log']('Project:\x20'+a4_0x1f75c6['cyan'](_0x4384a0)),0x0;}if(!_0x3514f7&&!_0x504701){if(!isInteractive())return console['error'](a4_0x1f75c6[_0x31f9fe(0x1c1)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a4_0x1f75c6['dim'](_0x31f9fe(0x200))),0x1;const _0x41da07=await confirmKey('\x0aPush\x20'+(_0x1c9622+_0x1ae29a)+_0x31f9fe(0x1ee));if(!_0x41da07)return console['log'](a4_0x1f75c6['yellow'](_0x31f9fe(0x1f7)),_0x31f9fe(0x1be)),0x1;}const {data:_0x51a762}=await withSpinner(_0x31f9fe(0x1b6),()=>_0x15cf94[_0x31f9fe(0x262)][_0x31f9fe(0x1e5)](_0x1521b8,{'force':_0x504701})),_0x4910cf=_0x51a762[_0x31f9fe(0x26e)][_0x31f9fe(0x1c9)]['errors']>0x0||_0x51a762['counts'][_0x31f9fe(0x1e0)][_0x31f9fe(0x23b)]>0x0||_0x51a762[_0x31f9fe(0x26e)][_0x31f9fe(0x1ca)][_0x31f9fe(0x23b)]>0x0||_0x51a762[_0x31f9fe(0x26e)][_0x31f9fe(0x1cc)][_0x31f9fe(0x23b)]>0x0||_0x51a762[_0x31f9fe(0x26e)]['formInterfaces']['errors']>0x0||_0x51a762['counts'][_0x31f9fe(0x1d9)][_0x31f9fe(0x23b)]>0x0;if(_0x4910cf){console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1b5)](_0x31f9fe(0x22e))),console[_0x31f9fe(0x1b4)](),console[_0x31f9fe(0x1b4)](a4_0x1f75c6['red'](_0x31f9fe(0x1cb)));for(const _0x58a0c2 of _0x51a762[_0x31f9fe(0x1c9)]){_0x58a0c2[_0x31f9fe(0x256)]===_0x31f9fe(0x1dd)&&console['log'](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x226)+_0x58a0c2[_0x31f9fe(0x234)]+_0x31f9fe(0x1ec)+_0x58a0c2[_0x31f9fe(0x1dd)]));}for(const _0x136b45 of _0x51a762[_0x31f9fe(0x1e0)]){_0x136b45[_0x31f9fe(0x256)]==='error'&&console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1c1)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x136b45['name']+_0x31f9fe(0x1ec)+_0x136b45[_0x31f9fe(0x1dd)]));}for(const _0x256516 of _0x51a762['textKnowledgeBases']){_0x256516[_0x31f9fe(0x256)]===_0x31f9fe(0x1dd)&&console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x1d7)+_0x256516[_0x31f9fe(0x25c)]+_0x31f9fe(0x1ec)+_0x256516[_0x31f9fe(0x1dd)]));}for(const _0x1dda2b of _0x51a762[_0x31f9fe(0x1cc)]){_0x1dda2b[_0x31f9fe(0x256)]===_0x31f9fe(0x1dd)&&console['log'](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x208)+_0x1dda2b[_0x31f9fe(0x25c)]+_0x31f9fe(0x1ec)+_0x1dda2b['error']));}for(const _0x12aa59 of _0x51a762[_0x31f9fe(0x21e)]){_0x12aa59[_0x31f9fe(0x256)]===_0x31f9fe(0x1dd)&&console[_0x31f9fe(0x1b4)](a4_0x1f75c6['red'](_0x31f9fe(0x263)+_0x12aa59[_0x31f9fe(0x25c)]+'\x22:\x20'+_0x12aa59[_0x31f9fe(0x1dd)]));}for(const _0x2c6502 of _0x51a762[_0x31f9fe(0x25a)]){_0x2c6502['action']===_0x31f9fe(0x1dd)&&console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x23d)+_0x2c6502['name']+_0x31f9fe(0x1ec)+_0x2c6502['error']));}for(const _0x2db326 of _0x51a762[_0x31f9fe(0x1d9)]){_0x2db326['action']===_0x31f9fe(0x1dd)&&console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x1c1)](_0x31f9fe(0x1ba)+_0x2db326[_0x31f9fe(0x25c)]+_0x31f9fe(0x1ec)+_0x2db326[_0x31f9fe(0x1dd)]));}return 0x1;}console[_0x31f9fe(0x1b4)](a4_0x1f75c6[_0x31f9fe(0x237)](_0x31f9fe(0x201)+(_0x1c9622+_0x1ae29a)+'\x20resources\x20to\x20\x27'+_0x51a762[_0x31f9fe(0x270)]+'\x27'));const _0x2094a6=getLLMProjectUrl(_0x59bd9e,_0x51a762[_0x31f9fe(0x219)]);return console[_0x31f9fe(0x1b4)](_0x31f9fe(0x214)+a4_0x1f75c6['cyan'](_0x2094a6)),0x0;}}
1
+ const a4_0x47f0cf=a4_0x5298;(function(_0x1c05af,_0x5a1eaf){const _0x4c2b15=a4_0x5298,_0x909c68=_0x1c05af();while(!![]){try{const _0x11cb98=-parseInt(_0x4c2b15(0x169))/0x1+-parseInt(_0x4c2b15(0x124))/0x2*(-parseInt(_0x4c2b15(0xff))/0x3)+-parseInt(_0x4c2b15(0x11b))/0x4*(-parseInt(_0x4c2b15(0x138))/0x5)+-parseInt(_0x4c2b15(0x13e))/0x6+-parseInt(_0x4c2b15(0xc4))/0x7*(-parseInt(_0x4c2b15(0x12d))/0x8)+-parseInt(_0x4c2b15(0x100))/0x9*(parseInt(_0x4c2b15(0xe9))/0xa)+parseInt(_0x4c2b15(0x123))/0xb*(-parseInt(_0x4c2b15(0x168))/0xc);if(_0x11cb98===_0x5a1eaf)break;else _0x909c68['push'](_0x909c68['shift']());}catch(_0x142281){_0x909c68['push'](_0x909c68['shift']());}}}(a4_0x2901,0x88557));import a4_0xc18c19 from'chalk';import a4_0x1ef39c from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a4_0x2901(){const _0x4f7c58=['\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','session','Source:\x20','666105fsgOXO','2149426xaZyvm','MISSING_ARGUMENT','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','-\x20nothing\x20pushed','\x20unchanged','\x0aPush\x20summary\x20for\x20\x27','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20resources?','\x20\x20Integrations:\x20','2917496aIIuIv','Pulling\x20agent\x20\x22','New\x20project:\x20','Would\x20clone:','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','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)','projectId','integrations','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x0aChanges\x20to\x20prompt\x20\x27','\x22\x20to\x20\x22','336125GkEgqK','\x20\x20tdx\x20agent\x20pull\x20','\x20\x20Experimental\x20Artifact\x20\x22','newProjectId','\x0a✔\x20Pushed\x20','\x20errors','5131122qFcJZQ','\x20|\x20','no_context','\x22\x20to\x20a\x20different\x20profile','repeat','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Analyzing\x20changes\x20to\x20push...','\x20\x20Agent\x20\x22','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20files\x20to\x20','green','\x0aError:','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','reason','parse','Status:\x20','New\x20project\x20ID:\x20','Using\x20project:\x20','dryRun','agent','\x20\x20Prompts:\x20','join','\x20\x20Chat\x20Interface\x20\x22','chatInterfaces','force','Agent:\x20','gray','formInterfaces','\x0aPull\x20summary\x20for\x20\x27','llm','prompts','agentName','Cannot\x20clone\x20from\x20context\x20project\x20\x22','newProjectName','red','<new-name>','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x27\x20to\x20create\x20the\x20folder\x20structure.','message','created','\x20changed','cwd-config','36asceet','690020xQpNOJ','\x0aChanges:','agentId','experimentalArtifacts','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','pullProject','\x20\x20Experimental\x20Artifacts:\x20','agent:pull','pushProject','\x22\x20from\x20project\x20\x22','\x20total','Cancelled','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','pushAgent','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','projectDir','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20--profile\x20','log','Errors:','arg-dir','cloneProject','Output\x20path:\x20','Output:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20\x20Knowledge\x20Bases:\x20','errors','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','description','total','21feSytj','\x0a✔\x20Pulled\x20','outputPath','outputDir','output','projectName','\x20successfully','execute','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Dry\x20run\x20-\x20no\x20changes\x20made','\x0aChanges\x20to\x20integration\x20\x27','\x22\x20to\x20new\x20project\x20\x22','\x20\x20Form\x20Interfaces:\x20','unchanged','isNew','textKnowledgeBases','yellow','agents','Pushing\x20to\x20project...','\x20created','\x0aProject\x20pushed\x20with\x20errors','Using\x20local\x20project:\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','site','\x20\x20Knowledge\x20Base\x20\x22','context','llm_project','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Writing\x20files...','\x20resources\x20to\x20\x27','found','sourceProjectName','\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)','\x20\x20Chat\x20Interfaces:\x20','\x20=\x20','20DMqUMf','\x22:\x20','agent:clone','\x20\x20Integration\x20\x22','Chat:\x20','diff','\x20\x20Source:\x20','cwd','action','knowledgeBases','\x22...','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','tdx.json','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','dim','\x20updated','\x20\x20Agents:\x20','experimentalKnowledgeBases','Project\x20cloned\x20successfully','source','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','dirname','3LRGxmF','2198268xVVYHO','error','yes','cyan','Analyzing\x20project\x20\x22','✔\x20Context\x20set:\x20','Project:\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','\x0aErrors\x20found:','updated','Using\x20context\x20project:\x20','New\x20project\x20name\x20is\x20required','no_local_folder','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','utf-8','\x20--name\x20','name','\x0aChanges\x20to\x20chat\x20interface\x20\x27','Agent\x20pulled\x20successfully','\x20\x20Form\x20Interface\x20\x22','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','counts','Using\x20project\x20from\x20context:\x20','llmProject','\x20\x20Prompt\x20\x22','new','\x0aChanges\x20to\x20agent\x20\x27','36yXlIgL','push','INVALID_ARGUMENT','\x20new','\x20\x20Target:\x20'];a4_0x2901=function(){return _0x4f7c58;};return a4_0x2901();}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';function a4_0x5298(_0x26305c,_0x5ca2f8){_0x26305c=_0x26305c-0xb5;const _0x290144=a4_0x2901();let _0x529857=_0x290144[_0x26305c];return _0x529857;}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x310ac2){const _0xcd38bc=a4_0x5298,_0x47cbba=[];if(_0x310ac2['total']!==undefined)_0x47cbba[_0xcd38bc(0x11c)](_0x310ac2['total']+_0xcd38bc(0x173));if(_0x310ac2[_0xcd38bc(0x119)]!==undefined&&_0x310ac2['new']>0x0)_0x47cbba[_0xcd38bc(0x11c)](a4_0xc18c19[_0xcd38bc(0x148)](_0x310ac2['new']+_0xcd38bc(0x11e)));if(_0x310ac2[_0xcd38bc(0x165)]!==undefined&&_0x310ac2[_0xcd38bc(0x165)]>0x0)_0x47cbba[_0xcd38bc(0x11c)](a4_0xc18c19[_0xcd38bc(0x148)](_0x310ac2['created']+_0xcd38bc(0xd7)));if(_0x310ac2[_0xcd38bc(0x109)]!==undefined&&_0x310ac2['updated']>0x0)_0x47cbba[_0xcd38bc(0x11c)](a4_0xc18c19[_0xcd38bc(0xd4)](_0x310ac2[_0xcd38bc(0x109)]+_0xcd38bc(0xf8)));if(_0x310ac2[_0xcd38bc(0xd1)]!==undefined&&_0x310ac2['unchanged']>0x0)_0x47cbba[_0xcd38bc(0x11c)](a4_0xc18c19[_0xcd38bc(0x158)](_0x310ac2[_0xcd38bc(0xd1)]+'\x20unchanged'));if(_0x310ac2[_0xcd38bc(0xc0)]!==undefined&&_0x310ac2[_0xcd38bc(0xc0)]>0x0)_0x47cbba[_0xcd38bc(0x11c)](a4_0xc18c19[_0xcd38bc(0x160)](_0x310ac2[_0xcd38bc(0xc0)]+_0xcd38bc(0x13d)));return _0x47cbba[_0xcd38bc(0x153)](',\x20');}function displayDiffs(_0x38ae7f,_0x407f65,_0xdda2,_0x1d8d98,_0x43e82b,_0x3bdda7,_0x1e1a3f,_0x594f93,_0x3b33a3){const _0xe122b1=a4_0x5298;for(const _0x3e0d5e of _0x38ae7f){if(_0x3e0d5e['diff']){const _0x50f801=_0x3e0d5e[_0xe122b1(0x15d)]||_0x3e0d5e[_0xe122b1(0x110)];console['log'](_0xe122b1(0x11a)+_0x50f801+'\x27:'),console['log']('─'['repeat'](0x3c)),console['log'](_0x3e0d5e[_0xe122b1(0xee)]),console[_0xe122b1(0xb7)]('─'[_0xe122b1(0x142)](0x3c));}}for(const _0x47a605 of _0x407f65){_0x47a605[_0xe122b1(0xee)]&&(console[_0xe122b1(0xb7)](_0xe122b1(0xb5)+_0x47a605[_0xe122b1(0x110)]+'\x27:'),console['log']('─'[_0xe122b1(0x142)](0x3c)),console['log'](_0x47a605[_0xe122b1(0xee)]),console[_0xe122b1(0xb7)]('─'[_0xe122b1(0x142)](0x3c)));}for(const _0x17de35 of _0xdda2){_0x17de35['diff']&&(console[_0xe122b1(0xb7)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x17de35[_0xe122b1(0x110)]+'\x27:'),console['log']('─'[_0xe122b1(0x142)](0x3c)),console[_0xe122b1(0xb7)](_0x17de35['diff']),console[_0xe122b1(0xb7)]('─'[_0xe122b1(0x142)](0x3c)));}for(const _0x422883 of _0x1d8d98){_0x422883[_0xe122b1(0xee)]&&(console[_0xe122b1(0xb7)](_0xe122b1(0x136)+_0x422883[_0xe122b1(0x110)]+'\x27:'),console[_0xe122b1(0xb7)]('─'[_0xe122b1(0x142)](0x3c)),console[_0xe122b1(0xb7)](_0x422883[_0xe122b1(0xee)]),console[_0xe122b1(0xb7)]('─'[_0xe122b1(0x142)](0x3c)));}for(const _0x19596a of _0x43e82b){_0x19596a[_0xe122b1(0xee)]&&(console[_0xe122b1(0xb7)](_0xe122b1(0xce)+_0x19596a['name']+'\x27:'),console[_0xe122b1(0xb7)]('─'['repeat'](0x3c)),console[_0xe122b1(0xb7)](_0x19596a['diff']),console['log']('─'[_0xe122b1(0x142)](0x3c)));}for(const _0x310ddc of _0x3bdda7){_0x310ddc[_0xe122b1(0xee)]&&(console['log'](_0xe122b1(0x175)+_0x310ddc[_0xe122b1(0x110)]+'\x27:'),console['log']('─'[_0xe122b1(0x142)](0x3c)),console[_0xe122b1(0xb7)](_0x310ddc['diff']),console['log']('─'[_0xe122b1(0x142)](0x3c)));}for(const _0x4c2299 of _0x1e1a3f){_0x4c2299[_0xe122b1(0xee)]&&(console['log'](_0xe122b1(0x179)+_0x4c2299[_0xe122b1(0x110)]+'\x27:'),console[_0xe122b1(0xb7)]('─'[_0xe122b1(0x142)](0x3c)),console['log'](_0x4c2299[_0xe122b1(0xee)]),console[_0xe122b1(0xb7)]('─'[_0xe122b1(0x142)](0x3c)));}for(const _0x5851c9 of _0x594f93){_0x5851c9['diff']&&(console[_0xe122b1(0xb7)]('\x0aChanges\x20to\x20form\x20interface\x20\x27'+_0x5851c9[_0xe122b1(0x110)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0xe122b1(0xb7)](_0x5851c9[_0xe122b1(0xee)]),console[_0xe122b1(0xb7)]('─'[_0xe122b1(0x142)](0x3c)));}for(const _0x499f96 of _0x3b33a3){_0x499f96[_0xe122b1(0xee)]&&(console[_0xe122b1(0xb7)](_0xe122b1(0x111)+_0x499f96[_0xe122b1(0x110)]+'\x27:'),console[_0xe122b1(0xb7)]('─'[_0xe122b1(0x142)](0x3c)),console[_0xe122b1(0xb7)](_0x499f96[_0xe122b1(0xee)]),console[_0xe122b1(0xb7)]('─'[_0xe122b1(0x142)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x47f0cf(0x110)]=a4_0x47f0cf(0x170);['description']=a4_0x47f0cf(0x131);async[a4_0x47f0cf(0xcb)](_0x2e55b5){const _0x1c1873=a4_0x47f0cf,{options:_0x18aec7,args:_0x3b479d,tdx:_0x36cced}=_0x2e55b5,_0x48c93f=_0x3b479d[0x0],_0x1fda20=_0x3b479d[0x1],_0x2f1ded=_0x18aec7[_0x1c1873(0xc8)],_0x1c5e79=_0x18aec7['dryRun'],_0x192ff6=_0x18aec7['force'],_0x47ff7c=_0x18aec7['yes'],_0xd451=_0x18aec7[_0x1c1873(0x117)],_0x4cfb57=_0x18aec7[_0x1c1873(0x151)];let _0x5199e4;if(_0x48c93f){const _0x57f090=a4_0x1ef39c[_0x1c1873(0x153)](_0x48c93f,'tdx.json');if(existsSync(_0x57f090))try{const _0x29004b=JSON[_0x1c1873(0x14c)](readFileSync(_0x57f090,_0x1c1873(0x10e)));_0x29004b[_0x1c1873(0xe0)]&&(_0x5199e4={'llm_project':_0x29004b['llm_project']});}catch{}}const _0x36cc9b=findAgentConfigPath(process[_0x1c1873(0xf0)]());let _0x3e6063;if(_0x36cc9b)try{const _0x1dd7a3=JSON[_0x1c1873(0x14c)](readFileSync(_0x36cc9b,_0x1c1873(0x10e)));_0x1dd7a3[_0x1c1873(0xe0)]&&(_0x3e6063={'llm_project':_0x1dd7a3[_0x1c1873(0xe0)]});}catch{}const _0x3250c9=resolveAgentPullArgs({'arg':_0x48c93f,'agentNameArg':_0x1fda20,'agentFlag':_0x4cfb57,'contextProject':_0xd451,'argDirConfig':_0x5199e4,'cwdConfigPath':_0x36cc9b||undefined,'cwdConfig':_0x3e6063}),{projectNameOrId:_0x427ab2,targetAgentName:_0x39dc9d,existingOutputDir:_0x53eb0f,source:_0x4b0af0}=_0x3250c9;if(_0x4b0af0===_0x1c1873(0xb9))console[_0x1c1873(0xb7)](a4_0xc18c19[_0x1c1873(0xf7)]('Using\x20project\x20from\x20'+a4_0x1ef39c[_0x1c1873(0x153)](_0x48c93f,'tdx.json')+':\x20'+_0x427ab2));else{if(_0x4b0af0===_0x1c1873(0x167))console['log'](a4_0xc18c19[_0x1c1873(0xf7)](_0x1c1873(0x14f)+_0x427ab2));else _0x4b0af0===_0x1c1873(0xdf)&&console[_0x1c1873(0xb7)](a4_0xc18c19['dim'](_0x1c1873(0x116)+_0x427ab2));}if(!_0x427ab2)return _0x4cfb57?(console[_0x1c1873(0xb7)](a4_0xc18c19[_0x1c1873(0xd4)](_0x1c1873(0x143))),console['log'](_0x1c1873(0xf4)),console['log']('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console['log'](a4_0xc18c19[_0x1c1873(0xd4)](_0x1c1873(0x14a))),console[_0x1c1873(0xb7)](_0x1c1873(0x132)),console[_0x1c1873(0xb7)](_0x1c1873(0xbd)),console['log'](_0x1c1873(0x107)),console[_0x1c1873(0xb7)](_0x1c1873(0x120)),console[_0x1c1873(0xb7)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x39dc9d){const {data:_0x189275}=await withSpinner(_0x1c1873(0x12e)+_0x39dc9d+_0x1c1873(0x172)+_0x427ab2+_0x1c1873(0xf3),()=>_0x36cced[_0x1c1873(0x15b)]['pullAgent'](_0x427ab2,_0x39dc9d,_0x2f1ded,{'dryRun':_0x1c5e79,'force':_0x192ff6}));if(_0x1c5e79)return console[_0x1c1873(0xb7)](a4_0xc18c19[_0x1c1873(0xd4)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x1c1873(0xb7)]('Would\x20pull\x20agent:\x20'+_0x189275['agentName']),console[_0x1c1873(0xb7)](_0x1c1873(0xbb)+_0x189275[_0x1c1873(0xc6)]),_0x189275[_0x1c1873(0xee)]&&(console['log'](_0x1c1873(0x16a)),console[_0x1c1873(0xb7)]('─'[_0x1c1873(0x142)](0x3c)),console[_0x1c1873(0xb7)](_0x189275[_0x1c1873(0xee)]),console[_0x1c1873(0xb7)]('─'[_0x1c1873(0x142)](0x3c))),0x0;return console[_0x1c1873(0xb7)](a4_0xc18c19[_0x1c1873(0x148)](_0x1c1873(0x112))),console[_0x1c1873(0xb7)](_0x1c1873(0x157)+_0x189275['agentName']),console[_0x1c1873(0xb7)](_0x1c1873(0xbc)+_0x189275['outputPath']),console[_0x1c1873(0xb7)](_0x1c1873(0x14d)+(_0x189275[_0x1c1873(0xd2)]?a4_0xc18c19[_0x1c1873(0x148)](_0x1c1873(0x119)):_0x189275['hasChanges']?a4_0xc18c19[_0x1c1873(0xd4)](_0x1c1873(0x109)):a4_0xc18c19[_0x1c1873(0x158)]('unchanged'))),0x0;}const _0x4915ad=_0x53eb0f||_0x2f1ded,{data:_0x354a58}=await withSpinner(_0x1c1873(0x104)+_0x427ab2+_0x1c1873(0xf3),()=>_0x36cced[_0x1c1873(0x15b)]['pullProject'](_0x427ab2,_0x4915ad,{'dryRun':!![]})),_0x183dfd=_0x354a58[_0x1c1873(0x115)]['agents'][_0x1c1873(0x119)]+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0xf2)]['new']+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0xd3)]['new']+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x15c)]['new']+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x134)][_0x1c1873(0x119)]+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0xfa)][_0x1c1873(0x119)]+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x16c)][_0x1c1873(0x119)]+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x159)][_0x1c1873(0x119)]+_0x354a58[_0x1c1873(0x115)]['chatInterfaces']['new'],_0x44ba11=_0x354a58[_0x1c1873(0x115)][_0x1c1873(0xd5)]['updated']+_0x354a58['counts'][_0x1c1873(0xf2)][_0x1c1873(0x109)]+_0x354a58['counts'][_0x1c1873(0xd3)][_0x1c1873(0x109)]+_0x354a58[_0x1c1873(0x115)]['prompts'][_0x1c1873(0x109)]+_0x354a58['counts']['integrations']['updated']+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0xfa)][_0x1c1873(0x109)]+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x16c)][_0x1c1873(0x109)]+_0x354a58['counts'][_0x1c1873(0x159)][_0x1c1873(0x109)]+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x155)][_0x1c1873(0x109)],_0xeaa755=_0x354a58[_0x1c1873(0x115)]['agents'][_0x1c1873(0xd1)]+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0xf2)][_0x1c1873(0xd1)]+_0x354a58['counts'][_0x1c1873(0xd3)][_0x1c1873(0xd1)]+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x15c)][_0x1c1873(0xd1)]+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x134)]['unchanged']+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0xfa)]['unchanged']+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x16c)][_0x1c1873(0xd1)]+_0x354a58['counts'][_0x1c1873(0x159)][_0x1c1873(0xd1)]+_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x155)][_0x1c1873(0xd1)];console[_0x1c1873(0xb7)](_0x1c1873(0x15a)+_0x354a58[_0x1c1873(0xc9)]+'\x27:'),console[_0x1c1873(0xb7)]('\x20\x20'+a4_0xc18c19['green']('+\x20'+_0x183dfd+'\x20new')+'\x20|\x20'+a4_0xc18c19[_0x1c1873(0xd4)]('~\x20'+_0x44ba11+'\x20changed')+_0x1c1873(0x13f)+a4_0xc18c19[_0x1c1873(0xf7)]('=\x20'+_0xeaa755+_0x1c1873(0x128))),console[_0x1c1873(0xb7)]('\x20\x20Agents:\x20'+formatCountSummary(_0x354a58[_0x1c1873(0x115)][_0x1c1873(0xd5)])),console[_0x1c1873(0xb7)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x354a58[_0x1c1873(0x115)]['knowledgeBases'])),console[_0x1c1873(0xb7)](_0x1c1873(0xdc)+formatCountSummary(_0x354a58[_0x1c1873(0x115)][_0x1c1873(0xd3)])),console['log'](_0x1c1873(0x152)+formatCountSummary(_0x354a58['counts']['prompts'])),console[_0x1c1873(0xb7)](_0x1c1873(0x12c)+formatCountSummary(_0x354a58['counts'][_0x1c1873(0x134)])),console[_0x1c1873(0xb7)](_0x1c1873(0xd0)+formatCountSummary(_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x159)])),console[_0x1c1873(0xb7)](_0x1c1873(0xe7)+formatCountSummary(_0x354a58[_0x1c1873(0x115)]['chatInterfaces']));const _0x583709=_0x354a58[_0x1c1873(0x115)][_0x1c1873(0xfa)][_0x1c1873(0xc3)]>0x0||_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x16c)][_0x1c1873(0xc3)]>0x0;_0x583709&&(console['log'](_0x1c1873(0x126)+formatCountSummary(_0x354a58[_0x1c1873(0x115)][_0x1c1873(0xfa)])),console[_0x1c1873(0xb7)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x354a58[_0x1c1873(0x115)][_0x1c1873(0x16c)])));console[_0x1c1873(0xb7)](_0x1c1873(0x11f)+a4_0xc18c19['cyan'](_0x354a58[_0x1c1873(0xc7)])),displayDiffs(_0x354a58['agents'],_0x354a58['knowledgeBases'],_0x354a58[_0x1c1873(0xd3)],_0x354a58[_0x1c1873(0x15c)],_0x354a58[_0x1c1873(0x134)],_0x354a58[_0x1c1873(0xfa)],_0x354a58[_0x1c1873(0x16c)],_0x354a58['formInterfaces'],_0x354a58[_0x1c1873(0x155)]);if(_0x1c5e79)return console[_0x1c1873(0xb7)](a4_0xc18c19[_0x1c1873(0xd4)](_0x1c1873(0xf6))),0x0;if(_0x183dfd===0x0&&_0x44ba11===0x0)return console[_0x1c1873(0xb7)](a4_0xc18c19[_0x1c1873(0x148)](_0x1c1873(0xfd))),saveSessionContext({'llm_project':_0x354a58[_0x1c1873(0xc9)]},_0x18aec7[_0x1c1873(0x121)]),console[_0x1c1873(0xb7)](a4_0xc18c19['green']('✔\x20Context\x20set:\x20'+a4_0xc18c19[_0x1c1873(0xf7)](_0x1c1873(0xe0))+_0x1c1873(0xe8)+a4_0xc18c19['cyan'](_0x354a58['projectName']))),0x0;if(!_0x47ff7c&&!_0x192ff6){if(!isInteractive())return console[_0x1c1873(0x101)](a4_0xc18c19['red'](_0x1c1873(0x149)),_0x1c1873(0xcc)),console['error'](a4_0xc18c19['dim'](_0x1c1873(0x16d))),0x1;const _0x3457b4=await confirmKey('\x0aWrite\x20'+(_0x183dfd+_0x44ba11)+'\x20files?');if(!_0x3457b4)return console[_0x1c1873(0xb7)](a4_0xc18c19[_0x1c1873(0xd4)](_0x1c1873(0x174)),'-\x20no\x20files\x20written'),0x1;}const {data:_0xf93f96}=await withSpinner(_0x1c1873(0xe2),()=>_0x36cced['llm'][_0x1c1873(0x16e)](_0x427ab2,_0x4915ad,{'force':_0x192ff6}));return console['log'](a4_0xc18c19[_0x1c1873(0x148)](_0x1c1873(0xc5)+(_0x183dfd+_0x44ba11)+_0x1c1873(0x147)+_0xf93f96[_0x1c1873(0xc7)])),saveSessionContext({'llm_project':_0xf93f96[_0x1c1873(0xc9)]},_0x18aec7['session']),console[_0x1c1873(0xb7)](a4_0xc18c19['green'](_0x1c1873(0x105)+a4_0xc18c19[_0x1c1873(0xf7)](_0x1c1873(0xe0))+_0x1c1873(0xe8)+a4_0xc18c19[_0x1c1873(0x103)](_0xf93f96[_0x1c1873(0xc9)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x47f0cf(0x110)]=a4_0x47f0cf(0xeb);[a4_0x47f0cf(0xc2)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async['execute'](_0x5defab){const _0x19a4db=a4_0x47f0cf,{options:_0x3fab14,args:_0x677a37,tdx:_0x1eb98b}=_0x5defab,_0x43f3e2=_0x677a37[0x0],_0x24f2a5=_0x3fab14[_0x19a4db(0x110)],_0x609372=_0x3fab14[_0x19a4db(0x150)],_0x277e6e=_0x3fab14[_0x19a4db(0x102)],_0x50b9b1=_0x3fab14['site'],_0x459724=_0x3fab14[_0x19a4db(0x117)];let _0x4f9269;const _0x186256=findAgentConfigPath(process[_0x19a4db(0xf0)]());if(_0x43f3e2){const _0x2a4638=a4_0x1ef39c[_0x19a4db(0x153)](_0x43f3e2,'tdx.json');existsSync(_0x2a4638)?(_0x4f9269=_0x43f3e2,console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0xf7)](_0x19a4db(0xd9)+_0x43f3e2))):_0x4f9269=_0x43f3e2;}else{if(_0x186256)_0x4f9269=a4_0x1ef39c[_0x19a4db(0xfe)](_0x186256),console['log'](a4_0xc18c19[_0x19a4db(0xf7)]('Using\x20current\x20project:\x20'+_0x4f9269));else{if(_0x459724){const _0x47f37d=sanitizeForFilesystem(_0x459724);let _0x5de936=_0x47f37d,_0x2d2178=a4_0x1ef39c[_0x19a4db(0x153)](process[_0x19a4db(0xf0)](),_0x19a4db(0xd5),_0x47f37d,'tdx.json');if(!existsSync(_0x2d2178)){const _0x22a7d9=normalizeName(_0x459724),_0x7ff336=a4_0x1ef39c['join'](process[_0x19a4db(0xf0)](),_0x19a4db(0xd5),_0x22a7d9,_0x19a4db(0xf5));existsSync(_0x7ff336)&&(_0x5de936=_0x22a7d9,_0x2d2178=_0x7ff336);}if(existsSync(_0x2d2178))_0x4f9269=a4_0x1ef39c[_0x19a4db(0xfe)](_0x2d2178),console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0xf7)](_0x19a4db(0xd9)+_0x4f9269));else{const _0x4d9336=_0x3fab14['profile'];if(_0x4d9336)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x19a4db(0x15e)+_0x459724+_0x19a4db(0x141),undefined,{'helpText':_0x19a4db(0x177)+_0x19a4db(0x146)+(_0x19a4db(0x139)+_0x459724+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x5de936+_0x19a4db(0x10f)+(_0x24f2a5||_0x19a4db(0x161))+_0x19a4db(0xb6)+_0x4d9336)});_0x4f9269=_0x459724,console['log'](a4_0xc18c19[_0x19a4db(0xf7)](_0x19a4db(0x10a)+_0x459724));}}}}if(!_0x4f9269)return console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0xd4)](_0x19a4db(0xc1))),console[_0x19a4db(0xb7)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console['log'](_0x19a4db(0xbe)),console['log'](_0x19a4db(0xe6)),console['log'](_0x19a4db(0x114)),0x1;if(!_0x24f2a5)throw new SDKError(ErrorCode[_0x19a4db(0x125)],_0x19a4db(0x10b),undefined,{'helpText':_0x19a4db(0x135)});if(!_0x277e6e&&!_0x609372){if(!isInteractive())return console[_0x19a4db(0x101)](a4_0xc18c19[_0x19a4db(0x160)](_0x19a4db(0x149)),_0x19a4db(0xcc)),console[_0x19a4db(0x101)](a4_0xc18c19['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4419d3=await confirmKey('Clone\x20\x22'+_0x4f9269+_0x19a4db(0xcf)+_0x24f2a5+'\x22?');if(!_0x4419d3)return console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0xd4)]('Cancelled')),0x1;}const {data:_0xb37af5}=await withSpinner('Cloning\x20\x22'+_0x4f9269+_0x19a4db(0x137)+_0x24f2a5+_0x19a4db(0xf3),()=>_0x1eb98b[_0x19a4db(0x15b)][_0x19a4db(0xba)](_0x4f9269,_0x24f2a5,{'dryRun':_0x609372}));if(_0x609372){console[_0x19a4db(0xb7)](a4_0xc18c19['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x19a4db(0xb7)](_0x19a4db(0x122)+_0xb37af5[_0x19a4db(0xe5)]),console[_0x19a4db(0xb7)](_0x19a4db(0x12f)+_0x24f2a5),console[_0x19a4db(0xb7)](_0x19a4db(0x130)),console[_0x19a4db(0xb7)](_0x19a4db(0xf9)+_0xb37af5[_0x19a4db(0x115)]['agents'][_0x19a4db(0x165)]),console[_0x19a4db(0xb7)](_0x19a4db(0xbf)+_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0xf2)][_0x19a4db(0x165)]),console['log'](_0x19a4db(0x152)+_0xb37af5[_0x19a4db(0x115)]['prompts'][_0x19a4db(0x165)]),console[_0x19a4db(0xb7)](_0x19a4db(0xd0)+_0xb37af5['counts'][_0x19a4db(0x159)]['created']),console[_0x19a4db(0xb7)](_0x19a4db(0xe7)+_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0x155)][_0x19a4db(0x165)]);const _0x5e6b95=_0xb37af5[_0x19a4db(0x115)]['experimentalKnowledgeBases'][_0x19a4db(0x165)]>0x0||_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0x16c)]['created']>0x0;return _0x5e6b95&&(console[_0x19a4db(0xb7)](_0x19a4db(0x126)+_0xb37af5['counts'][_0x19a4db(0xfa)][_0x19a4db(0x165)]),console[_0x19a4db(0xb7)](_0x19a4db(0x16f)+_0xb37af5[_0x19a4db(0x115)]['experimentalArtifacts'][_0x19a4db(0x165)])),0x0;}const _0x40a715=_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0xd5)][_0x19a4db(0xc0)]>0x0||_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0xf2)]['errors']>0x0||_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0x15c)][_0x19a4db(0xc0)]>0x0||_0xb37af5[_0x19a4db(0x115)]['formInterfaces']['errors']>0x0||_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0x155)]['errors']>0x0||_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0xfa)]['errors']>0x0||_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0x16c)]['errors']>0x0;_0x40a715?console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0xd4)]('Project\x20cloned\x20with\x20errors')):console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0x148)](_0x19a4db(0xfb)));console[_0x19a4db(0xb7)]('Source:\x20'+_0xb37af5[_0x19a4db(0xe5)]),console['log']('New\x20project:\x20'+_0xb37af5[_0x19a4db(0x15f)]),console[_0x19a4db(0xb7)](_0x19a4db(0x14e)+_0xb37af5[_0x19a4db(0x13b)]),console[_0x19a4db(0xb7)](),console[_0x19a4db(0xb7)]('Summary:'),console[_0x19a4db(0xb7)](_0x19a4db(0xf9)+formatCountSummary(_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0xd5)])),console[_0x19a4db(0xb7)](_0x19a4db(0xbf)+formatCountSummary(_0xb37af5['counts'][_0x19a4db(0xf2)])),console['log'](_0x19a4db(0x152)+formatCountSummary(_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0x15c)])),console[_0x19a4db(0xb7)](_0x19a4db(0x12c)+formatCountSummary(_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0x134)])),console[_0x19a4db(0xb7)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0x159)])),console[_0x19a4db(0xb7)](_0x19a4db(0xe7)+formatCountSummary(_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0x155)]));const _0x39a2d3=_0xb37af5['counts'][_0x19a4db(0xfa)][_0x19a4db(0x165)]>0x0||_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0xfa)][_0x19a4db(0x109)]>0x0||_0xb37af5['counts'][_0x19a4db(0xfa)]['unchanged']>0x0||_0xb37af5[_0x19a4db(0x115)]['experimentalArtifacts'][_0x19a4db(0x165)]>0x0||_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0x16c)][_0x19a4db(0x109)]>0x0||_0xb37af5[_0x19a4db(0x115)]['experimentalArtifacts']['unchanged']>0x0;_0x39a2d3&&(console['log'](_0x19a4db(0x126)+formatCountSummary(_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0xfa)])),console[_0x19a4db(0xb7)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0xb37af5[_0x19a4db(0x115)][_0x19a4db(0x16c)])));if(_0x40a715){console[_0x19a4db(0xb7)](),console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0x160)](_0x19a4db(0xb8)));for(const _0x48612b of _0xb37af5[_0x19a4db(0xd5)]){_0x48612b['action']==='error'&&console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0x160)](_0x19a4db(0x145)+_0x48612b[_0x19a4db(0x15d)]+'\x22:\x20'+_0x48612b['error']));}for(const _0x41cb23 of _0xb37af5['knowledgeBases']){_0x41cb23[_0x19a4db(0xf1)]===_0x19a4db(0x101)&&console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0x160)](_0x19a4db(0xde)+_0x41cb23['name']+_0x19a4db(0xea)+_0x41cb23[_0x19a4db(0x101)]));}for(const _0x276395 of _0xb37af5[_0x19a4db(0x15c)]){_0x276395[_0x19a4db(0xf1)]===_0x19a4db(0x101)&&console[_0x19a4db(0xb7)](a4_0xc18c19['red']('\x20\x20Prompt\x20\x22'+_0x276395[_0x19a4db(0x110)]+_0x19a4db(0xea)+_0x276395['error']));}for(const _0x218147 of _0xb37af5[_0x19a4db(0x134)]){_0x218147[_0x19a4db(0xf1)]===_0x19a4db(0x101)&&console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0x160)]('\x20\x20Integration\x20\x22'+_0x218147[_0x19a4db(0x110)]+_0x19a4db(0xea)+_0x218147[_0x19a4db(0x101)]));}for(const _0x37441b of _0xb37af5[_0x19a4db(0x159)]){_0x37441b[_0x19a4db(0xf1)]===_0x19a4db(0x101)&&console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0x160)](_0x19a4db(0x113)+_0x37441b[_0x19a4db(0x110)]+_0x19a4db(0xea)+_0x37441b['error']));}for(const _0x462661 of _0xb37af5['chatInterfaces']){_0x462661[_0x19a4db(0xf1)]==='error'&&console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0x160)](_0x19a4db(0x154)+_0x462661['name']+'\x22:\x20'+_0x462661[_0x19a4db(0x101)]));}for(const _0x18ef8f of _0xb37af5[_0x19a4db(0xfa)]){_0x18ef8f[_0x19a4db(0xf1)]===_0x19a4db(0x101)&&console[_0x19a4db(0xb7)](a4_0xc18c19[_0x19a4db(0x160)](_0x19a4db(0xdb)+_0x18ef8f[_0x19a4db(0x110)]+_0x19a4db(0xea)+_0x18ef8f[_0x19a4db(0x101)]));}for(const _0x27c181 of _0xb37af5[_0x19a4db(0x16c)]){_0x27c181[_0x19a4db(0xf1)]===_0x19a4db(0x101)&&console[_0x19a4db(0xb7)](a4_0xc18c19['red'](_0x19a4db(0x13a)+_0x27c181[_0x19a4db(0x110)]+_0x19a4db(0xea)+_0x27c181['error']));}return 0x1;}console[_0x19a4db(0xb7)]();const _0x1854bf=getLLMProjectUrl(_0x50b9b1,_0xb37af5[_0x19a4db(0x13b)]);return console[_0x19a4db(0xb7)](_0x19a4db(0x106)+a4_0xc18c19[_0x19a4db(0x103)](_0x1854bf)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']='agent:push';[a4_0x47f0cf(0xc2)]=a4_0x47f0cf(0x12a);async[a4_0x47f0cf(0xcb)](_0x41fb55){const _0x1a1223=a4_0x47f0cf,{options:_0xa11289,args:_0x255711,tdx:_0x320cdc}=_0x41fb55;let _0x51dce6=_0x255711[0x0]||process[_0x1a1223(0xf0)]();const _0x3fc590=_0xa11289[_0x1a1223(0x150)],_0x5af8de=_0xa11289[_0x1a1223(0x156)],_0x483120=_0xa11289[_0x1a1223(0x102)],_0x32f263=_0xa11289[_0x1a1223(0xdd)],_0x75f04b=a4_0x1ef39c[_0x1a1223(0x153)](_0x51dce6,'agent.yml'),_0x4e39a0=existsSync(_0x75f04b);if(_0x4e39a0){const {data:_0x464174}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x51dce6+'\x22...',()=>_0x320cdc[_0x1a1223(0x15b)][_0x1a1223(0x176)](_0x51dce6,{'dryRun':_0x3fc590,'force':_0x5af8de}));if(_0x3fc590)return console[_0x1a1223(0xb7)](a4_0xc18c19[_0x1a1223(0xd4)](_0x1a1223(0xcd))),console[_0x1a1223(0xb7)]('Would\x20push\x20agent:\x20'+_0x464174['agentName']),0x0;if(_0x464174['action']==='error')return console['log'](a4_0xc18c19[_0x1a1223(0x160)]('Failed\x20to\x20push\x20agent:\x20'+_0x464174[_0x1a1223(0x101)])),0x1;console['log'](a4_0xc18c19[_0x1a1223(0x148)]('Agent\x20'+_0x464174['action']+_0x1a1223(0xca))),console[_0x1a1223(0xb7)]('Agent:\x20'+_0x464174['agentName']);if(_0x464174[_0x1a1223(0x16b)]&&_0x464174[_0x1a1223(0x133)]){const _0x2214b4=getLLMAgentChatUrl(_0x32f263,_0x464174[_0x1a1223(0x133)],_0x464174[_0x1a1223(0x16b)]);console[_0x1a1223(0xb7)](_0x1a1223(0xed)+a4_0xc18c19[_0x1a1223(0x103)](_0x2214b4));}return 0x0;}const _0x2b5171=_0xa11289['llmProject'],_0x475172=resolveProjectFromContext(_0x51dce6,_0x2b5171);if(_0x475172[_0x1a1223(0xe4)])_0x51dce6=_0x475172[_0x1a1223(0x178)],_0x475172[_0x1a1223(0xfc)]==='context'&&console[_0x1a1223(0xb7)](a4_0xc18c19['dim'](_0x1a1223(0x14f)+_0x51dce6));else{let _0x2e906b=_0x1a1223(0xda);_0x475172[_0x1a1223(0x14b)]===_0x1a1223(0x10c)&&(_0x2e906b=_0x475172[_0x1a1223(0x164)]+_0x1a1223(0x10d)+_0x475172['llmProject']+_0x1a1223(0x163));throw new SDKError(ErrorCode[_0x1a1223(0x11d)],_0x475172[_0x1a1223(0x14b)]===_0x1a1223(0x140)?_0x475172[_0x1a1223(0x164)]:'No\x20tdx.json\x20found\x20in\x20'+_0x51dce6,undefined,{'helpText':_0x2e906b});}const {data:_0x1e8198}=await withSpinner(_0x1a1223(0x144),()=>_0x320cdc[_0x1a1223(0x15b)][_0x1a1223(0x171)](_0x51dce6,{'dryRun':!![]})),_0xbf8755=_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0xd5)][_0x1a1223(0xc0)]>0x0;if(_0xbf8755){console[_0x1a1223(0xb7)](a4_0xc18c19[_0x1a1223(0x160)](_0x1a1223(0x108)));for(const _0x5452a4 of _0x1e8198[_0x1a1223(0xd5)]){_0x5452a4['action']==='error'&&console['log'](a4_0xc18c19[_0x1a1223(0x160)](_0x1a1223(0x145)+_0x5452a4[_0x1a1223(0x15d)]+_0x1a1223(0xea)+_0x5452a4[_0x1a1223(0x101)]));}return 0x1;}const _0x2beac7=_0x1e8198['counts'][_0x1a1223(0xd5)][_0x1a1223(0x165)]+_0x1e8198['counts']['knowledgeBases'][_0x1a1223(0x165)]+_0x1e8198['counts']['textKnowledgeBases'][_0x1a1223(0x165)]+_0x1e8198[_0x1a1223(0x115)]['prompts'][_0x1a1223(0x165)]+_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0x134)][_0x1a1223(0x165)]+_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0xfa)][_0x1a1223(0x165)]+_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0x16c)]['created']+_0x1e8198['counts'][_0x1a1223(0x159)][_0x1a1223(0x165)]+_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0x155)][_0x1a1223(0x165)],_0xe2b906=_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0xd5)][_0x1a1223(0x109)]+_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0xf2)][_0x1a1223(0x109)]+_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0xd3)][_0x1a1223(0x109)]+_0x1e8198[_0x1a1223(0x115)]['prompts'][_0x1a1223(0x109)]+_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0x134)]['updated']+_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0xfa)]['updated']+_0x1e8198['counts'][_0x1a1223(0x16c)][_0x1a1223(0x109)]+_0x1e8198[_0x1a1223(0x115)]['formInterfaces'][_0x1a1223(0x109)]+_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0x155)]['updated'],_0x372897=_0x1e8198[_0x1a1223(0x115)]['agents'][_0x1a1223(0xd1)]+_0x1e8198['counts'][_0x1a1223(0xf2)][_0x1a1223(0xd1)]+_0x1e8198[_0x1a1223(0x115)]['textKnowledgeBases'][_0x1a1223(0xd1)]+_0x1e8198['counts'][_0x1a1223(0x15c)][_0x1a1223(0xd1)]+_0x1e8198['counts']['integrations']['unchanged']+_0x1e8198['counts']['experimentalKnowledgeBases']['unchanged']+_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0x16c)]['unchanged']+_0x1e8198['counts'][_0x1a1223(0x159)][_0x1a1223(0xd1)]+_0x1e8198['counts'][_0x1a1223(0x155)]['unchanged'];console[_0x1a1223(0xb7)](_0x1a1223(0x129)+_0x1e8198[_0x1a1223(0xc9)]+'\x27:'),console[_0x1a1223(0xb7)]('\x20\x20'+a4_0xc18c19[_0x1a1223(0x148)]('+\x20'+_0x2beac7+_0x1a1223(0x11e))+_0x1a1223(0x13f)+a4_0xc18c19['yellow']('~\x20'+_0xe2b906+_0x1a1223(0x166))+_0x1a1223(0x13f)+a4_0xc18c19[_0x1a1223(0xf7)]('=\x20'+_0x372897+'\x20unchanged')),console[_0x1a1223(0xb7)](_0x1a1223(0xf9)+formatCountSummary(_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0xd5)])),console[_0x1a1223(0xb7)](_0x1a1223(0xbf)+formatCountSummary(_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0xf2)])),console[_0x1a1223(0xb7)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1e8198[_0x1a1223(0x115)]['textKnowledgeBases'])),console[_0x1a1223(0xb7)](_0x1a1223(0x152)+formatCountSummary(_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0x15c)])),console['log'](_0x1a1223(0x12c)+formatCountSummary(_0x1e8198[_0x1a1223(0x115)]['integrations'])),console[_0x1a1223(0xb7)](_0x1a1223(0xd0)+formatCountSummary(_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0x159)])),console[_0x1a1223(0xb7)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x1e8198[_0x1a1223(0x115)]['chatInterfaces']));const _0x42f95b=_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0xfa)][_0x1a1223(0x165)]>0x0||_0x1e8198['counts'][_0x1a1223(0xfa)]['updated']>0x0||_0x1e8198['counts'][_0x1a1223(0xfa)][_0x1a1223(0xd1)]>0x0||_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0x16c)][_0x1a1223(0x165)]>0x0||_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0x16c)][_0x1a1223(0x109)]>0x0||_0x1e8198['counts'][_0x1a1223(0x16c)][_0x1a1223(0xd1)]>0x0;_0x42f95b&&(console[_0x1a1223(0xb7)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0xfa)])),console[_0x1a1223(0xb7)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x1e8198[_0x1a1223(0x115)][_0x1a1223(0x16c)])));console[_0x1a1223(0xb7)](_0x1a1223(0xef)+a4_0xc18c19[_0x1a1223(0x103)](_0x51dce6)),displayDiffs(_0x1e8198[_0x1a1223(0xd5)],_0x1e8198[_0x1a1223(0xf2)],_0x1e8198[_0x1a1223(0xd3)],_0x1e8198['prompts'],_0x1e8198['integrations'],_0x1e8198[_0x1a1223(0xfa)],_0x1e8198[_0x1a1223(0x16c)],_0x1e8198[_0x1a1223(0x159)],_0x1e8198[_0x1a1223(0x155)]);if(_0x3fc590)return console[_0x1a1223(0xb7)](a4_0xc18c19[_0x1a1223(0xd4)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x2beac7===0x0&&_0xe2b906===0x0){console[_0x1a1223(0xb7)](a4_0xc18c19[_0x1a1223(0x148)](_0x1a1223(0xe1)));const _0x5e27b9=getLLMProjectUrl(_0x32f263,_0x1e8198[_0x1a1223(0x133)]);return console[_0x1a1223(0xb7)](_0x1a1223(0x106)+a4_0xc18c19[_0x1a1223(0x103)](_0x5e27b9)),0x0;}if(!_0x483120&&!_0x5af8de){if(!isInteractive())return console['error'](a4_0xc18c19['red']('\x0aError:'),_0x1a1223(0xcc)),console[_0x1a1223(0x101)](a4_0xc18c19[_0x1a1223(0xf7)](_0x1a1223(0x16d))),0x1;const _0x4183b9=await confirmKey('\x0aPush\x20'+(_0x2beac7+_0xe2b906)+_0x1a1223(0x12b));if(!_0x4183b9)return console[_0x1a1223(0xb7)](a4_0xc18c19[_0x1a1223(0xd4)](_0x1a1223(0x174)),_0x1a1223(0x127)),0x1;}const {data:_0x2b1697}=await withSpinner(_0x1a1223(0xd6),()=>_0x320cdc[_0x1a1223(0x15b)][_0x1a1223(0x171)](_0x51dce6,{'force':_0x5af8de})),_0x84355a=_0x2b1697[_0x1a1223(0x115)][_0x1a1223(0xd5)][_0x1a1223(0xc0)]>0x0||_0x2b1697[_0x1a1223(0x115)]['knowledgeBases'][_0x1a1223(0xc0)]>0x0||_0x2b1697[_0x1a1223(0x115)][_0x1a1223(0xd3)][_0x1a1223(0xc0)]>0x0||_0x2b1697[_0x1a1223(0x115)][_0x1a1223(0x15c)][_0x1a1223(0xc0)]>0x0||_0x2b1697[_0x1a1223(0x115)][_0x1a1223(0x159)][_0x1a1223(0xc0)]>0x0||_0x2b1697[_0x1a1223(0x115)][_0x1a1223(0x155)]['errors']>0x0;if(_0x84355a){console['log'](a4_0xc18c19[_0x1a1223(0xd4)](_0x1a1223(0xd8))),console[_0x1a1223(0xb7)](),console[_0x1a1223(0xb7)](a4_0xc18c19[_0x1a1223(0x160)](_0x1a1223(0xb8)));for(const _0x239157 of _0x2b1697[_0x1a1223(0xd5)]){_0x239157[_0x1a1223(0xf1)]===_0x1a1223(0x101)&&console[_0x1a1223(0xb7)](a4_0xc18c19[_0x1a1223(0x160)](_0x1a1223(0x145)+_0x239157[_0x1a1223(0x15d)]+_0x1a1223(0xea)+_0x239157[_0x1a1223(0x101)]));}for(const _0x3e9ac1 of _0x2b1697[_0x1a1223(0xf2)]){_0x3e9ac1['action']===_0x1a1223(0x101)&&console['log'](a4_0xc18c19[_0x1a1223(0x160)](_0x1a1223(0xde)+_0x3e9ac1[_0x1a1223(0x110)]+'\x22:\x20'+_0x3e9ac1[_0x1a1223(0x101)]));}for(const _0x866678 of _0x2b1697[_0x1a1223(0xd3)]){_0x866678[_0x1a1223(0xf1)]===_0x1a1223(0x101)&&console[_0x1a1223(0xb7)](a4_0xc18c19[_0x1a1223(0x160)](_0x1a1223(0x162)+_0x866678[_0x1a1223(0x110)]+'\x22:\x20'+_0x866678[_0x1a1223(0x101)]));}for(const _0x4c972a of _0x2b1697['prompts']){_0x4c972a[_0x1a1223(0xf1)]===_0x1a1223(0x101)&&console[_0x1a1223(0xb7)](a4_0xc18c19['red'](_0x1a1223(0x118)+_0x4c972a[_0x1a1223(0x110)]+'\x22:\x20'+_0x4c972a[_0x1a1223(0x101)]));}for(const _0x2b5262 of _0x2b1697['integrations']){_0x2b5262['action']===_0x1a1223(0x101)&&console[_0x1a1223(0xb7)](a4_0xc18c19[_0x1a1223(0x160)](_0x1a1223(0xec)+_0x2b5262['name']+'\x22:\x20'+_0x2b5262[_0x1a1223(0x101)]));}for(const _0x29945e of _0x2b1697[_0x1a1223(0x159)]){_0x29945e[_0x1a1223(0xf1)]===_0x1a1223(0x101)&&console[_0x1a1223(0xb7)](a4_0xc18c19[_0x1a1223(0x160)]('\x20\x20Form\x20Interface\x20\x22'+_0x29945e[_0x1a1223(0x110)]+_0x1a1223(0xea)+_0x29945e[_0x1a1223(0x101)]));}for(const _0xeb4ad7 of _0x2b1697[_0x1a1223(0x155)]){_0xeb4ad7[_0x1a1223(0xf1)]===_0x1a1223(0x101)&&console[_0x1a1223(0xb7)](a4_0xc18c19['red']('\x20\x20Chat\x20Interface\x20\x22'+_0xeb4ad7[_0x1a1223(0x110)]+'\x22:\x20'+_0xeb4ad7[_0x1a1223(0x101)]));}return 0x1;}console['log'](a4_0xc18c19['green'](_0x1a1223(0x13c)+(_0x2beac7+_0xe2b906)+_0x1a1223(0xe3)+_0x2b1697[_0x1a1223(0xc9)]+'\x27'));const _0x348320=getLLMProjectUrl(_0x32f263,_0x2b1697[_0x1a1223(0x133)]);return console['log'](_0x1a1223(0x106)+a4_0xc18c19[_0x1a1223(0x103)](_0x348320)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x1eeba6=a5_0x4f3a;(function(_0x19fc27,_0x1983ee){const _0x210449=a5_0x4f3a,_0x5e934f=_0x19fc27();while(!![]){try{const _0x3d5401=-parseInt(_0x210449(0x1de))/0x1+-parseInt(_0x210449(0x22e))/0x2+parseInt(_0x210449(0x218))/0x3+-parseInt(_0x210449(0x1bc))/0x4*(parseInt(_0x210449(0x20b))/0x5)+parseInt(_0x210449(0x20a))/0x6*(parseInt(_0x210449(0x1cb))/0x7)+parseInt(_0x210449(0x1bb))/0x8*(-parseInt(_0x210449(0x219))/0x9)+parseInt(_0x210449(0x24a))/0xa;if(_0x3d5401===_0x1983ee)break;else _0x5e934f['push'](_0x5e934f['shift']());}catch(_0x574884){_0x5e934f['push'](_0x5e934f['shift']());}}}(a5_0x5645,0xad794));import*as a5_0x11b47f from'node:fs';import*as a5_0x28d6f4 from'node:path';import a5_0x7e9951 from'chalk';import{BaseCommand}from'./command.js';function a5_0x5645(){const _0x2be640=['567721NmTekB','Conversation\x20URL:\x20','table','filter','conversation_url','Run\x20tests\x20for\x20an\x20LLM\x20agent','output','round','Output\x20written\x20to:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','jsonl','✗\x20ERROR:\x20','Test\x20Configuration:','agent:test','no_context','Project\x20path:\x20','agentDirs','No\x20tests\x20found\x20matching:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','New\x20tests\x20to\x20execute:\x20','has','\x20\x20-\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','Round\x201/','Executing\x20new\x20tests...','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','\x20(cached)','repeat','FAIL','\x20\x20Project:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','tags','Test\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Using\x20agent:\x20','✗\x20FAIL:\x20','map','Round\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)','timestamp','site','execute','rounds','1485948xlZMJZ','35QfvQHe','not\x20found','No\x20tests\x20found\x20with\x20tags:\x20','message','writeFileSync','\x27\x20to\x20create\x20the\x20folder\x20structure.','Re-evaluating...','multiple_agents','Running:\x20','projectDir','\x22:\x20','found','tests','256869LHgscP','288qjhSgo','forEach','log','join','Total:\x20\x20\x20\x20','Re-evaluating\x20cached\x20test\x20run...','name','toLowerCase','red','Duration:\x20','isSpinning','executeReeval','includes','utf-8','testName','\x20-\x20','✓\x20PASS:\x20','size','\x20\x20Evaluating...\x20','...','404','1329940KPNmko','Either\x20switch\x20to\x20the\x20\x22','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','no_tests','some','Re-evaluation\x20Summary','llm','push','description','Failed\x20Tests:','ERROR','testYmlPath','dim','projectName','Errors:\x20\x20\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','cyan','add',':\x20Sending\x20user\x20input...','text','resolveProjectId','...\x20','Tests\x20found:\x20','Agent:\x20','llmProject','toISOString','reason','green','35814560zRnfGj','agentName','eval','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Usage:','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Site:\x20','status','stop','270376sjRtuV','508568jXVOqt','PASS','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','context','start','source','resolveAgentId','dryRun','resolve','split','Passed:\x20\x20\x20','verbose','agent','Evaluating\x20response...','7GJicSH','length','substring','reeval','Error\x20writing\x20output\x20file:\x20','trim','basename','\x20\x20Conversation:\x20','⚠\x20SKIPPED:\x20','conversations','now','yellow','find','\x20\x20Agent:\x20','\x20\x20Round\x20','json','Available\x20tags:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','white'];a5_0x5645=function(){return _0x2be640;};return a5_0x5645();}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x4f3a(_0x251af2,_0x200b02){_0x251af2=_0x251af2-0x1bb;const _0x56459f=a5_0x5645();let _0x4f3a26=_0x56459f[_0x251af2];return _0x4f3a26;}export class AgentTestCommand extends BaseCommand{[a5_0x1eeba6(0x21f)]=a5_0x1eeba6(0x1eb);[a5_0x1eeba6(0x236)]=a5_0x1eeba6(0x1e3);async[a5_0x1eeba6(0x208)](_0x4c842e){const _0x20b479=a5_0x1eeba6,{options:_0x235eeb,args:_0x4903c1,tdx:_0xfd7234}=_0x4c842e,_0x4a9771=_0x4903c1[0x0]||'.',_0x59078c=_0x235eeb[_0x20b479(0x1c4)],_0x3b1db6=_0x235eeb,_0x4f501b=_0x3b1db6[_0x20b479(0x24c)]===![],_0x1b57c6=_0x3b1db6[_0x20b479(0x1ce)],_0x1f6363=_0x3b1db6[_0x20b479(0x21f)],_0x5c81e3=_0x3b1db6[_0x20b479(0x1fe)],_0x1762d8=_0x235eeb[_0x20b479(0x207)],_0x373669=_0x3b1db6[_0x20b479(0x1e4)];if(_0x1b57c6&&_0x4f501b)return console['log'](a5_0x7e9951[_0x20b479(0x221)](_0x20b479(0x23d))),0x1;let _0x1d5313='table';if(_0x3b1db6['json'])_0x1d5313=_0x20b479(0x1da);else{if(_0x3b1db6[_0x20b479(0x1e8)])_0x1d5313='jsonl';else{if(_0x3b1db6['tsv'])_0x1d5313='tsv';else{if(_0x3b1db6['table'])_0x1d5313=_0x20b479(0x1e0);}}}const _0x1eb7f=_0x3b1db6[_0x20b479(0x246)];let _0x561d8e=_0x4a9771;const _0x49dd35=a5_0x11b47f['existsSync'](_0x4a9771),_0x3347b2=_0x4a9771==='.';if(!_0x49dd35||_0x3347b2){const _0x53bcfe=resolveProjectFromContext(_0x4a9771,_0x1eb7f,{'requireFile':'test.yml'});if(_0x53bcfe[_0x20b479(0x216)])_0x561d8e=_0x53bcfe['projectDir'],_0x53bcfe[_0x20b479(0x1c2)]===_0x20b479(0x1c0)&&console[_0x20b479(0x21b)](a5_0x7e9951['dim'](_0x20b479(0x201)+_0x561d8e));else switch(_0x53bcfe[_0x20b479(0x248)]){case _0x20b479(0x1ec):console[_0x20b479(0x21b)](a5_0x7e9951['yellow'](_0x53bcfe[_0x20b479(0x20e)])),console[_0x20b479(0x21b)](),console['log'](_0x20b479(0x24e)),console['log'](_0x20b479(0x1bf)),console[_0x20b479(0x21b)](_0x20b479(0x205)),console[_0x20b479(0x21b)](),console[_0x20b479(0x21b)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case'no_local_folder':console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x1d6)](_0x53bcfe['message'])),console[_0x20b479(0x21b)](),console['log'](_0x20b479(0x1e7)+_0x53bcfe[_0x20b479(0x246)]+_0x20b479(0x210));return 0x1;case _0x20b479(0x212):{const _0xaf72fa=a5_0x28d6f4[_0x20b479(0x1d1)](_0x53bcfe[_0x20b479(0x214)]);console[_0x20b479(0x21b)](a5_0x7e9951['yellow'](_0x20b479(0x24d)+_0x53bcfe[_0x20b479(0x246)]+'\x22:'));for(const _0x3e4d35 of _0x53bcfe[_0x20b479(0x1ee)]){console[_0x20b479(0x21b)](_0x20b479(0x1f3)+_0x3e4d35);}return console['log'](),console[_0x20b479(0x21b)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0xaf72fa+'/<agent-name>'),0x1;}case _0x20b479(0x231):console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x1d6)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x53bcfe[_0x20b479(0x246)]+'\x22.')),console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x23a)](_0x20b479(0x1ed)+_0x53bcfe['projectDir'])),console[_0x20b479(0x21b)](),console['log'](_0x20b479(0x230));return 0x1;}}const {definition:_0x5b5439,agentInfo:_0x375398}=parseTestFile(_0x561d8e);let _0x6c2cc0=_0x5b5439[_0x20b479(0x217)];if(_0x1f6363){const _0x42a3a9=_0x1f6363[_0x20b479(0x1c6)](',')[_0x20b479(0x203)](_0x16bc93=>_0x16bc93[_0x20b479(0x1d0)]());_0x6c2cc0=_0x5b5439[_0x20b479(0x217)][_0x20b479(0x1e1)](_0x1ad3d2=>_0x42a3a9[_0x20b479(0x225)](_0x1ad3d2[_0x20b479(0x21f)]));if(_0x6c2cc0[_0x20b479(0x1cc)]===0x0)return console['log'](a5_0x7e9951['yellow'](_0x20b479(0x1ef)+_0x1f6363)),console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x23a)]('Available\x20tests:\x20'+_0x5b5439['tests'][_0x20b479(0x203)](_0x367c4b=>_0x367c4b[_0x20b479(0x21f)])[_0x20b479(0x21c)](',\x20'))),0x1;}if(_0x5c81e3){const _0x58dbf2=_0x5c81e3[_0x20b479(0x1c6)](',')['map'](_0x5fe8cc=>_0x5fe8cc['trim']()[_0x20b479(0x220)]());_0x6c2cc0=_0x6c2cc0[_0x20b479(0x1e1)](_0x7dab92=>_0x7dab92[_0x20b479(0x1fe)]?.[_0x20b479(0x232)](_0x501199=>_0x58dbf2[_0x20b479(0x225)](_0x501199[_0x20b479(0x220)]())));if(_0x6c2cc0[_0x20b479(0x1cc)]===0x0){console['log'](a5_0x7e9951[_0x20b479(0x1d6)](_0x20b479(0x20d)+_0x5c81e3));const _0x57fa00=new Set();return _0x5b5439[_0x20b479(0x217)][_0x20b479(0x21a)](_0x165a2a=>_0x165a2a[_0x20b479(0x1fe)]?.[_0x20b479(0x21a)](_0x2c541a=>_0x57fa00[_0x20b479(0x23f)](_0x2c541a))),_0x57fa00[_0x20b479(0x22a)]>0x0?console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x23a)](_0x20b479(0x1db)+[..._0x57fa00][_0x20b479(0x21c)](',\x20'))):console[_0x20b479(0x21b)](a5_0x7e9951['dim']('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x1b57c6)return this[_0x20b479(0x224)](_0x4c842e,{'definition':{'tests':_0x6c2cc0},'agentInfo':_0x375398,'outputFormat':_0x1d5313,'outputFile':_0x373669,'testNames':_0x1f6363});if(_0x59078c){console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x23e)](_0x20b479(0x1ea))),console[_0x20b479(0x21b)]('\x20\x20Site:\x20'+a5_0x7e9951['white'](_0x1762d8)),console['log'](_0x20b479(0x1fb)+a5_0x7e9951['white'](_0x375398[_0x20b479(0x23b)])),console[_0x20b479(0x21b)](_0x20b479(0x1d8)+a5_0x7e9951[_0x20b479(0x1dd)](_0x375398[_0x20b479(0x24b)])),console[_0x20b479(0x21b)](),console[_0x20b479(0x21b)](_0x20b479(0x244)+a5_0x7e9951[_0x20b479(0x1dd)](_0x6c2cc0[_0x20b479(0x1cc)]));for(let _0x3bef6e=0x0;_0x3bef6e<_0x6c2cc0[_0x20b479(0x1cc)];_0x3bef6e++){const _0x1fa817=_0x6c2cc0[_0x3bef6e],_0x3a33cd=_0x1fa817['rounds'][_0x20b479(0x1cc)]===0x1?_0x20b479(0x1e5):_0x20b479(0x209),_0x474802=_0x1fa817['tags']?.[_0x20b479(0x1cc)]?'\x20['+_0x1fa817[_0x20b479(0x1fe)][_0x20b479(0x21c)](',\x20')+']':'';console[_0x20b479(0x21b)]('\x20\x20'+(_0x3bef6e+0x1)+'.\x20'+a5_0x7e9951[_0x20b479(0x1dd)](_0x1fa817[_0x20b479(0x21f)])+'\x20('+_0x1fa817[_0x20b479(0x209)][_0x20b479(0x1cc)]+'\x20'+_0x3a33cd+')'+a5_0x7e9951[_0x20b479(0x23a)](_0x474802));}return 0x0;}let _0x25c749,_0x37c9c8;try{_0x25c749=await _0xfd7234[_0x20b479(0x234)][_0x20b479(0x242)](_0x375398[_0x20b479(0x23b)]);}catch(_0x55de34){const _0x2bdd44=_0x55de34 instanceof Error?_0x55de34[_0x20b479(0x20e)]:String(_0x55de34);return _0x2bdd44[_0x20b479(0x225)](_0x20b479(0x22d))||_0x2bdd44['toLowerCase']()[_0x20b479(0x225)](_0x20b479(0x20c))?console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x375398[_0x20b479(0x23b)])):console[_0x20b479(0x21b)](a5_0x7e9951['red'](_0x20b479(0x1be)+_0x375398['projectName']+_0x20b479(0x215)+_0x2bdd44)),0x1;}try{_0x37c9c8=await _0xfd7234[_0x20b479(0x234)][_0x20b479(0x1c3)](_0x375398[_0x20b479(0x24b)],_0x25c749);}catch(_0x4a9979){const _0x51ceb2=_0x4a9979 instanceof Error?_0x4a9979['message']:String(_0x4a9979);return _0x51ceb2[_0x20b479(0x225)]('404')||_0x51ceb2[_0x20b479(0x220)]()[_0x20b479(0x225)]('not\x20found')?console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)](_0x20b479(0x1fc)+_0x375398[_0x20b479(0x24b)])):console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x375398['agentName']+_0x20b479(0x215)+_0x51ceb2)),0x1;}let _0x12fa7a;if(!_0x4f501b)try{_0x12fa7a=await setupEvaluatorAgent(_0xfd7234[_0x20b479(0x234)],_0x235eeb[_0x20b479(0x1c8)]);}catch(_0x133409){const _0x548037=_0x133409 instanceof Error?_0x133409[_0x20b479(0x20e)]:String(_0x133409);return console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)](_0x20b479(0x1f0)+_0x548037)),0x1;}console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x23e)]('Running\x20agent\x20tests...')),console[_0x20b479(0x21b)](_0x20b479(0x250)+a5_0x7e9951[_0x20b479(0x1dd)](_0x1762d8)),console[_0x20b479(0x21b)](_0x20b479(0x245)+a5_0x7e9951['white'](_0x375398[_0x20b479(0x23b)]+'/'+_0x375398[_0x20b479(0x24b)])),console[_0x20b479(0x21b)]();const _0x4741b8=[],_0x143e71=[],_0x4d23b5=Date[_0x20b479(0x1d5)]();for(let _0xf7eb9c=0x0;_0xf7eb9c<_0x6c2cc0[_0x20b479(0x1cc)];_0xf7eb9c++){const _0x4055c2=_0x6c2cc0[_0xf7eb9c];_0x6c2cc0[_0x20b479(0x1cc)]>0x1?console[_0x20b479(0x21b)](_0x20b479(0x1ff)+(_0xf7eb9c+0x1)+'/'+_0x6c2cc0[_0x20b479(0x1cc)]+':\x20'+a5_0x7e9951[_0x20b479(0x1dd)](_0x4055c2[_0x20b479(0x21f)])):console[_0x20b479(0x21b)]('Running\x20test:\x20'+a5_0x7e9951[_0x20b479(0x1dd)](_0x4055c2[_0x20b479(0x21f)]));const _0x2666cf=createCommandSpinner(_0x20b479(0x1f5)+_0x4055c2[_0x20b479(0x209)][_0x20b479(0x1cc)]+_0x20b479(0x240));_0x2666cf[_0x20b479(0x1c1)]();try{const {result:_0x23d66d,conversation:_0x4dcf09}=await runTest(_0xfd7234[_0x20b479(0x234)],_0x4055c2,{'agentId':_0x37c9c8,'projectId':_0x25c749,'site':_0x1762d8,'noEval':_0x4f501b,'evaluatorId':_0x12fa7a,'onRoundStart':(_0x2141b9,_0x27da12)=>{const _0x4e7e7f=_0x20b479;_0x2666cf[_0x4e7e7f(0x241)]=_0x4e7e7f(0x204)+(_0x2141b9+0x1)+'/'+_0x27da12+_0x4e7e7f(0x240);},'onRoundComplete':(_0xd773e9,_0x4cecd4,_0x228b0f)=>{const _0x1763e9=_0x20b479,_0x1f01ef=formatElapsed(_0x4cecd4);_0x228b0f?console[_0x1763e9(0x21b)]('\x20\x20Round\x20'+(_0xd773e9+0x1)+'/'+_0x4055c2[_0x1763e9(0x209)][_0x1763e9(0x1cc)]+'...\x20'+a5_0x7e9951['green']('✓')+'\x20('+_0x1f01ef+')'):console[_0x1763e9(0x21b)](_0x1763e9(0x1d9)+(_0xd773e9+0x1)+'/'+_0x4055c2[_0x1763e9(0x209)][_0x1763e9(0x1cc)]+_0x1763e9(0x243)+a5_0x7e9951[_0x1763e9(0x221)]('✗'));},'onEvaluationStart':()=>{const _0x11a60d=_0x20b479;_0x2666cf[_0x11a60d(0x241)]='Evaluating\x20response...';},'onEvaluationComplete':_0x530d79=>{const _0x2143ea=_0x20b479,_0x59fb31=formatElapsed(_0x530d79);console[_0x2143ea(0x21b)]('\x20\x20Evaluating...\x20'+a5_0x7e9951[_0x2143ea(0x249)]('✓')+'\x20('+_0x59fb31+')');}});_0x2666cf[_0x20b479(0x252)](),_0x4741b8[_0x20b479(0x235)](_0x23d66d),_0x143e71['push'](_0x4dcf09);if(_0x23d66d[_0x20b479(0x251)]===_0x20b479(0x1bd))console[_0x20b479(0x21b)](a5_0x7e9951['green']('✓\x20PASS:\x20'+_0x23d66d[_0x20b479(0x248)]));else _0x23d66d[_0x20b479(0x251)]===_0x20b479(0x1fa)?console[_0x20b479(0x21b)](a5_0x7e9951['red'](_0x20b479(0x202)+_0x23d66d['reason'])):console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)](_0x20b479(0x1e9)+_0x23d66d['reason']));_0x23d66d[_0x20b479(0x1e2)]&&console[_0x20b479(0x21b)](a5_0x7e9951['dim'](_0x20b479(0x1df)+_0x23d66d[_0x20b479(0x1e2)])),console['log']();}catch(_0x3d09fb){_0x2666cf[_0x20b479(0x252)]();const _0x5cdc30=_0x3d09fb instanceof Error?_0x3d09fb[_0x20b479(0x20e)]:String(_0x3d09fb);console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)]('✗\x20ERROR:\x20'+_0x5cdc30)),console[_0x20b479(0x21b)](),_0x4741b8['push']({'name':_0x4055c2['name'],'status':_0x20b479(0x238),'reason':_0x5cdc30,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x28776c=Date[_0x20b479(0x1d5)]()-_0x4d23b5,_0x379b21=_0x4741b8[_0x20b479(0x1e1)](_0x1fc965=>_0x1fc965[_0x20b479(0x251)]===_0x20b479(0x1bd))['length'],_0x34141b=_0x4741b8[_0x20b479(0x1e1)](_0x5edf62=>_0x5edf62[_0x20b479(0x251)]===_0x20b479(0x1fa))[_0x20b479(0x1cc)],_0x17ae92=_0x4741b8[_0x20b479(0x1e1)](_0x3a868f=>_0x3a868f[_0x20b479(0x251)]==='ERROR')[_0x20b479(0x1cc)];console[_0x20b479(0x21b)]('━'[_0x20b479(0x1f9)](0x3c)),console['log']('Test\x20Summary'),console[_0x20b479(0x21b)]('━'[_0x20b479(0x1f9)](0x3c)),console[_0x20b479(0x21b)](_0x20b479(0x21d)+_0x4741b8[_0x20b479(0x1cc)]),console[_0x20b479(0x21b)](_0x20b479(0x1c7)+a5_0x7e9951[_0x20b479(0x249)](_0x379b21)),console[_0x20b479(0x21b)]('Failed:\x20\x20\x20'+a5_0x7e9951[_0x20b479(0x221)](_0x34141b));_0x17ae92>0x0&&console[_0x20b479(0x21b)]('Errors:\x20\x20\x20'+a5_0x7e9951['red'](_0x17ae92));console[_0x20b479(0x21b)](_0x20b479(0x222)+formatElapsed(_0x28776c)),console[_0x20b479(0x21b)]('━'[_0x20b479(0x1f9)](0x3c));const _0x25dd57=_0x4741b8[_0x20b479(0x1e1)](_0x1cf4ba=>_0x1cf4ba[_0x20b479(0x251)]!==_0x20b479(0x1bd));if(_0x25dd57[_0x20b479(0x1cc)]>0x0){console[_0x20b479(0x21b)](),console[_0x20b479(0x21b)](_0x20b479(0x237));for(const _0xab20ac of _0x25dd57){const _0x4abb02=a5_0x7e9951[_0x20b479(0x221)]('✗'),_0x2cb58d=_0xab20ac[_0x20b479(0x248)]['length']>0x32?_0xab20ac[_0x20b479(0x248)][_0x20b479(0x1cd)](0x0,0x32)+_0x20b479(0x22c):_0xab20ac[_0x20b479(0x248)];console[_0x20b479(0x21b)]('\x20\x20'+_0x4abb02+'\x20'+_0xab20ac['name']+':\x20'+_0x2cb58d);}}const _0x426451={'summary':{'total':_0x4741b8['length'],'passed':_0x379b21,'failed':_0x34141b,'errors':_0x17ae92>0x0?_0x17ae92:undefined,'duration_ms':_0x28776c},'tests':_0x4741b8,'agent':{'project':_0x375398[_0x20b479(0x23b)],'name':_0x375398[_0x20b479(0x24b)],'site':_0x1762d8},'timestamp':new Date(_0x4d23b5)['toISOString']()};try{const _0x14bd9b=buildCachedTestRun(_0x143e71,{'site':_0x1762d8,'projectId':_0x25c749,'projectName':_0x375398['projectName'],'agentId':_0x37c9c8,'agentName':_0x375398[_0x20b479(0x24b)],'testYmlPath':a5_0x28d6f4[_0x20b479(0x1c5)](_0x375398[_0x20b479(0x239)])});saveLastTestRun(_0x14bd9b);}catch{}if(_0x1d5313!==_0x20b479(0x1e0)||_0x373669){const _0x433b11=formatResults(_0x426451,_0x1d5313);if(_0x373669)try{a5_0x11b47f[_0x20b479(0x20f)](_0x373669,_0x433b11,_0x20b479(0x226)),console[_0x20b479(0x21b)](),console[_0x20b479(0x21b)](a5_0x7e9951['dim'](_0x20b479(0x1e6)+_0x373669));}catch(_0x4e6938){return console[_0x20b479(0x21b)](),console[_0x20b479(0x21b)](a5_0x7e9951[_0x20b479(0x221)]('Error\x20writing\x20output\x20file:\x20'+_0x4e6938)),0x1;}else console['log'](),console['log'](_0x433b11);}return _0x25dd57[_0x20b479(0x1cc)]>0x0?0x1:0x0;}async[a5_0x1eeba6(0x224)](_0x5ec8ef,_0x147b40){const _0x4d1328=a5_0x1eeba6,{options:_0xdee4f4,tdx:_0x2634dc}=_0x5ec8ef,{definition:_0x37e42c,agentInfo:_0x2a6598,outputFormat:_0x4e711f,outputFile:_0x325a71}=_0x147b40,_0x1d42eb=_0xdee4f4[_0x4d1328(0x207)],_0x439fcd=loadLastTestRun();if(!_0x439fcd)return console['log'](a5_0x7e9951[_0x4d1328(0x221)](_0x4d1328(0x1dc))),console[_0x4d1328(0x21b)](a5_0x7e9951['dim'](_0x4d1328(0x200))),0x1;if(_0x439fcd[_0x4d1328(0x1c9)][_0x4d1328(0x24b)]!==_0x2a6598['agentName'])return console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x221)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x439fcd[_0x4d1328(0x1c9)][_0x4d1328(0x24b)]+_0x4d1328(0x1fd)+_0x2a6598[_0x4d1328(0x24b)]+'\x22.')),console['log'](a5_0x7e9951['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x1c667d=new Set(_0x439fcd[_0x4d1328(0x1d4)][_0x4d1328(0x203)](_0x350825=>_0x350825[_0x4d1328(0x227)])),_0xd5ed56=_0x37e42c[_0x4d1328(0x217)][_0x4d1328(0x1e1)](_0x4e21b5=>!_0x1c667d[_0x4d1328(0x1f2)](_0x4e21b5[_0x4d1328(0x21f)]));if(_0xd5ed56[_0x4d1328(0x1cc)]>0x0&&_0x439fcd['site']!==_0x1d42eb)return console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x221)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x23a)](_0x4d1328(0x1f4)+_0x439fcd['site']+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x1d42eb+'\x22.')),console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x23a)](_0x4d1328(0x22f)+_0x439fcd['site']+_0x4d1328(0x1f7))),0x1;const _0x2bf14e=_0x37e42c[_0x4d1328(0x217)][_0x4d1328(0x1e1)](_0x1103c5=>_0x1c667d['has'](_0x1103c5[_0x4d1328(0x21f)])),_0x42b5e4=_0xd5ed56;let _0x350d4c;try{_0x350d4c=await setupEvaluatorAgent(_0x2634dc['llm'],_0xdee4f4[_0x4d1328(0x1c8)]);}catch(_0x3385db){const _0x37e3cf=_0x3385db instanceof Error?_0x3385db['message']:String(_0x3385db);return console['log'](a5_0x7e9951[_0x4d1328(0x221)](_0x4d1328(0x1f0)+_0x37e3cf)),0x1;}console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x23e)](_0x4d1328(0x21e))),console['log']('Cached\x20run\x20from:\x20'+a5_0x7e9951[_0x4d1328(0x1dd)](_0x439fcd[_0x4d1328(0x206)])),console[_0x4d1328(0x21b)](_0x4d1328(0x245)+a5_0x7e9951[_0x4d1328(0x1dd)](_0x439fcd[_0x4d1328(0x1c9)][_0x4d1328(0x23b)]+'/'+_0x439fcd[_0x4d1328(0x1c9)][_0x4d1328(0x24b)]));_0x42b5e4[_0x4d1328(0x1cc)]>0x0&&console[_0x4d1328(0x21b)](_0x4d1328(0x1f1)+a5_0x7e9951[_0x4d1328(0x1d6)](_0x42b5e4[_0x4d1328(0x1cc)]));console[_0x4d1328(0x21b)]();const _0x447816=[],_0x2f65b7=Date['now'](),_0x4a552f=createCommandSpinner(_0x4d1328(0x211));if(_0x2bf14e[_0x4d1328(0x1cc)]>0x0)try{const _0x59919f=await reevaluateFromCache(_0x2634dc[_0x4d1328(0x234)],_0x439fcd,{'tests':_0x2bf14e},{'evaluatorId':_0x350d4c,'onTestStart':(_0xec8c22,_0x289cba,_0x327488)=>{const _0x52cb01=_0x4d1328;_0x4a552f['text']='Re-evaluating\x20'+(_0x289cba+0x1)+'/'+_0x327488+':\x20'+_0xec8c22+'...';if(!_0x4a552f[_0x52cb01(0x223)])_0x4a552f['start']();},'onTestComplete':(_0x5e06be,_0x3575e7)=>{const _0x3b228d=_0x4d1328;_0x4a552f[_0x3b228d(0x252)]();if(_0x3575e7[_0x3b228d(0x251)]===_0x3b228d(0x1bd))console[_0x3b228d(0x21b)](a5_0x7e9951['green'](_0x3b228d(0x229)+_0x5e06be)+a5_0x7e9951[_0x3b228d(0x23a)](_0x3b228d(0x1f8)));else _0x3575e7[_0x3b228d(0x251)]==='FAIL'?console[_0x3b228d(0x21b)](a5_0x7e9951['red']('✗\x20FAIL:\x20'+_0x5e06be+_0x3b228d(0x228)+_0x3575e7['reason'])+a5_0x7e9951['dim'](_0x3b228d(0x1f8))):console[_0x3b228d(0x21b)](a5_0x7e9951[_0x3b228d(0x221)](_0x3b228d(0x1e9)+_0x5e06be+_0x3b228d(0x228)+_0x3575e7[_0x3b228d(0x248)]));_0x3575e7[_0x3b228d(0x1e2)]&&console[_0x3b228d(0x21b)](a5_0x7e9951[_0x3b228d(0x23a)](_0x3b228d(0x1d2)+_0x3575e7[_0x3b228d(0x1e2)])),_0x447816['push'](_0x3575e7);},'onTestSkipped':(_0x2c20d8,_0x3c8895)=>{const _0x4f8625=_0x4d1328;_0x4a552f[_0x4f8625(0x252)](),console[_0x4f8625(0x21b)](a5_0x7e9951[_0x4f8625(0x1d6)](_0x4f8625(0x1d3)+_0x2c20d8+_0x4f8625(0x228)+_0x3c8895));}});for(const _0x272e9f of _0x59919f){!_0x447816[_0x4d1328(0x1d7)](_0x385c5c=>_0x385c5c[_0x4d1328(0x21f)]===_0x272e9f[_0x4d1328(0x21f)])&&_0x447816['push'](_0x272e9f);}}catch(_0x4856b1){_0x4a552f[_0x4d1328(0x252)]();const _0x13a177=_0x4856b1 instanceof Error?_0x4856b1[_0x4d1328(0x20e)]:String(_0x4856b1);return console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x221)](_0x4d1328(0x24f)+_0x13a177)),0x1;}_0x4a552f[_0x4d1328(0x252)]();if(_0x42b5e4['length']>0x0){console[_0x4d1328(0x21b)](),console['log'](a5_0x7e9951[_0x4d1328(0x23e)](_0x4d1328(0x1f6)));const {projectId:_0xca95c0,agentId:_0x56be0b}=_0x439fcd[_0x4d1328(0x1c9)];for(const _0x534016 of _0x42b5e4){console[_0x4d1328(0x21b)](_0x4d1328(0x213)+a5_0x7e9951['white'](_0x534016[_0x4d1328(0x21f)]));const _0xaff219=createCommandSpinner(_0x4d1328(0x1f5)+_0x534016[_0x4d1328(0x209)][_0x4d1328(0x1cc)]+_0x4d1328(0x240));_0xaff219[_0x4d1328(0x1c1)]();try{const {result:_0x346122}=await runTest(_0x2634dc['llm'],_0x534016,{'agentId':_0x56be0b,'projectId':_0xca95c0,'site':_0x439fcd[_0x4d1328(0x207)],'noEval':![],'evaluatorId':_0x350d4c,'onRoundStart':(_0xe20d2e,_0x314b5d)=>{const _0x363567=_0x4d1328;_0xaff219['text']=_0x363567(0x204)+(_0xe20d2e+0x1)+'/'+_0x314b5d+_0x363567(0x240);},'onRoundComplete':(_0x529a87,_0x1278c9,_0x4b0a8e)=>{const _0x27eca3=_0x4d1328,_0x3cddcd=formatElapsed(_0x1278c9);_0x4b0a8e?console[_0x27eca3(0x21b)](_0x27eca3(0x1d9)+(_0x529a87+0x1)+'/'+_0x534016[_0x27eca3(0x209)][_0x27eca3(0x1cc)]+_0x27eca3(0x243)+a5_0x7e9951[_0x27eca3(0x249)]('✓')+'\x20('+_0x3cddcd+')'):console[_0x27eca3(0x21b)]('\x20\x20Round\x20'+(_0x529a87+0x1)+'/'+_0x534016['rounds']['length']+_0x27eca3(0x243)+a5_0x7e9951[_0x27eca3(0x221)]('✗'));},'onEvaluationStart':()=>{const _0x5870f8=_0x4d1328;_0xaff219[_0x5870f8(0x241)]=_0x5870f8(0x1ca);},'onEvaluationComplete':_0x3e2585=>{const _0x5f2f34=_0x4d1328,_0x3b3009=formatElapsed(_0x3e2585);console[_0x5f2f34(0x21b)](_0x5f2f34(0x22b)+a5_0x7e9951['green']('✓')+'\x20('+_0x3b3009+')');}});_0xaff219[_0x4d1328(0x252)](),_0x447816[_0x4d1328(0x235)](_0x346122);if(_0x346122[_0x4d1328(0x251)]===_0x4d1328(0x1bd))console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x249)](_0x4d1328(0x229)+_0x346122[_0x4d1328(0x248)])+a5_0x7e9951[_0x4d1328(0x23a)]('\x20(new)'));else _0x346122[_0x4d1328(0x251)]===_0x4d1328(0x1fa)?console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x221)](_0x4d1328(0x202)+_0x346122[_0x4d1328(0x248)])+a5_0x7e9951['dim']('\x20(new)')):console['log'](a5_0x7e9951['red']('✗\x20ERROR:\x20'+_0x346122[_0x4d1328(0x248)]));_0x346122['conversation_url']&&console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x23a)]('\x20\x20Conversation:\x20'+_0x346122[_0x4d1328(0x1e2)]));}catch(_0xcb19a7){_0xaff219[_0x4d1328(0x252)]();const _0x28c10d=_0xcb19a7 instanceof Error?_0xcb19a7[_0x4d1328(0x20e)]:String(_0xcb19a7);console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x221)](_0x4d1328(0x1e9)+_0x28c10d)),_0x447816[_0x4d1328(0x235)]({'name':_0x534016[_0x4d1328(0x21f)],'status':'ERROR','reason':_0x28c10d,'timestamp':new Date()[_0x4d1328(0x247)](),'duration_ms':0x0});}}}console['log']();const _0x89e063=Date[_0x4d1328(0x1d5)]()-_0x2f65b7,_0x55926b=_0x447816[_0x4d1328(0x1e1)](_0x4c6bc9=>_0x4c6bc9[_0x4d1328(0x251)]===_0x4d1328(0x1bd))['length'],_0x4cd68b=_0x447816[_0x4d1328(0x1e1)](_0xb53d3e=>_0xb53d3e[_0x4d1328(0x251)]===_0x4d1328(0x1fa))[_0x4d1328(0x1cc)],_0x557f24=_0x447816['filter'](_0x270645=>_0x270645['status']===_0x4d1328(0x238))[_0x4d1328(0x1cc)];console[_0x4d1328(0x21b)]('━'['repeat'](0x3c)),console[_0x4d1328(0x21b)](_0x4d1328(0x233)),console['log']('━'[_0x4d1328(0x1f9)](0x3c)),console[_0x4d1328(0x21b)]('Total:\x20\x20\x20\x20'+_0x447816[_0x4d1328(0x1cc)]),console['log'](_0x4d1328(0x1c7)+a5_0x7e9951['green'](_0x55926b)),console['log']('Failed:\x20\x20\x20'+a5_0x7e9951['red'](_0x4cd68b));_0x557f24>0x0&&console['log'](_0x4d1328(0x23c)+a5_0x7e9951[_0x4d1328(0x221)](_0x557f24));console['log'](_0x4d1328(0x222)+formatElapsed(_0x89e063)),console['log']('━'[_0x4d1328(0x1f9)](0x3c));const _0x4204c6={'summary':{'total':_0x447816[_0x4d1328(0x1cc)],'passed':_0x55926b,'failed':_0x4cd68b,'errors':_0x557f24>0x0?_0x557f24:undefined,'duration_ms':_0x89e063},'tests':_0x447816,'agent':{'project':_0x2a6598[_0x4d1328(0x23b)],'name':_0x2a6598[_0x4d1328(0x24b)],'site':_0x1d42eb},'timestamp':new Date(_0x2f65b7)[_0x4d1328(0x247)]()};if(_0x4e711f!==_0x4d1328(0x1e0)||_0x325a71){const _0x3facdb=formatResults(_0x4204c6,_0x4e711f);if(_0x325a71)try{a5_0x11b47f[_0x4d1328(0x20f)](_0x325a71,_0x3facdb,_0x4d1328(0x226)),console[_0x4d1328(0x21b)](),console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x23a)]('Output\x20written\x20to:\x20'+_0x325a71));}catch(_0x5841ab){return console[_0x4d1328(0x21b)](),console[_0x4d1328(0x21b)](a5_0x7e9951[_0x4d1328(0x221)](_0x4d1328(0x1cf)+_0x5841ab)),0x1;}else console[_0x4d1328(0x21b)](),console[_0x4d1328(0x21b)](_0x3facdb);}const _0x372df4=_0x447816[_0x4d1328(0x1e1)](_0x9f6cda=>_0x9f6cda[_0x4d1328(0x251)]!==_0x4d1328(0x1bd));return _0x372df4['length']>0x0?0x1:0x0;}}
1
+ function a5_0x7018(){const _0x37791a=['/<agent-name>','FAIL','302320asyVCC','execute','No\x20tests\x20have\x20tags\x20defined.','source','\x20(cached)','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','includes','\x20\x20Evaluating...\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Failed\x20Tests:','size','1226694XacHYg','Re-evaluating...','yellow','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','toLowerCase','Passed:\x20\x20\x20','now','llm','\x20-\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','split','toISOString','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','tags','test.yml','no_context','Output\x20written\x20to:\x20','stop','context','Agent:\x20','Tests\x20found:\x20','\x20\x20Site:\x20','1830227tCAcTD','Available\x20tests:\x20','text','json','Error\x20writing\x20output\x20file:\x20','resolveAgentId','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Cached\x20run\x20is\x20from\x20site\x20\x22','push','\x20\x20Round\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Running:\x20','forEach','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Errors:\x20\x20\x20','Re-evaluating\x20cached\x20test\x20run...','map','Usage:','multiple_agents','executeReeval','Test\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Run\x20\x27tdx\x20agent\x20pull\x20','agent:test','projectName','existsSync','found','\x22:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','No\x20tests\x20found\x20matching:\x20','...\x20','✗\x20ERROR:\x20','green','some','round','llmProject','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','404','reason','eval','Cached\x20run\x20from:\x20','Re-evaluating\x20','join','Running\x20test:\x20','conversation_url','cyan','Conversation\x20URL:\x20','Available\x20tags:\x20','⚠\x20SKIPPED:\x20','red','Executing\x20new\x20tests...','utf-8','Test\x20Configuration:','not\x20found','isSpinning','testYmlPath','34iiHRAt','no_local_folder','Total:\x20\x20\x20\x20','substring','jsonl','Round\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','repeat','output','No\x20tests\x20found\x20with\x20tags:\x20','✗\x20FAIL:\x20','54ppFAds','457890ItPXVO','dim','description','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','agentName','Failed:\x20\x20\x20','testName','name','projectDir','New\x20tests\x20to\x20execute:\x20','trim','✗\x20ERROR:\x20Project\x20not\x20found:\x20','\x20\x20Conversation:\x20','filter','length','...','rounds','\x27\x20to\x20create\x20the\x20folder\x20structure.','message','Round\x201/','tests','\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)',':\x20Sending\x20user\x20input...','timestamp','table','PASS','Evaluating\x20response...','5104UzORyc','log','25eSGcUp','resolveProjectId','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','ERROR','149784IeXXLv','writeFileSync','site','✓\x20PASS:\x20','Re-evaluation\x20Summary','has','start','Duration:\x20','white','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','tsv','status','1157656EzdPLv','Test\x20Summary','agent'];a5_0x7018=function(){return _0x37791a;};return a5_0x7018();}const a5_0x5c9cf7=a5_0x8dbb;(function(_0x35a88c,_0x321ca5){const _0x25e464=a5_0x8dbb,_0x58940e=_0x35a88c();while(!![]){try{const _0x3b47a1=-parseInt(_0x25e464(0x11d))/0x1*(parseInt(_0x25e464(0x144))/0x2)+parseInt(_0x25e464(0x166))/0x3+parseInt(_0x25e464(0x156))/0x4+-parseInt(_0x25e464(0x146))/0x5*(-parseInt(_0x25e464(0x14a))/0x6)+-parseInt(_0x25e464(0x17d))/0x7+parseInt(_0x25e464(0x15b))/0x8+-parseInt(_0x25e464(0x128))/0x9*(parseInt(_0x25e464(0x129))/0xa);if(_0x3b47a1===_0x321ca5)break;else _0x58940e['push'](_0x58940e['shift']());}catch(_0x5be4ee){_0x58940e['push'](_0x58940e['shift']());}}}(a5_0x7018,0x3a187));import*as a5_0x738a1 from'node:fs';function a5_0x8dbb(_0x3e0be5,_0x4371ad){_0x3e0be5=_0x3e0be5-0xec;const _0x70189b=a5_0x7018();let _0x8dbb11=_0x70189b[_0x3e0be5];return _0x8dbb11;}import*as a5_0x47357e from'node:path';import a5_0x500c4d 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_0x5c9cf7(0x130)]=a5_0x5c9cf7(0xfb);[a5_0x5c9cf7(0x12b)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x5c9cf7(0x15c)](_0x11d131){const _0x2c0c3d=a5_0x5c9cf7,{options:_0x5c0b69,args:_0x3d64d1,tdx:_0x106f1e}=_0x11d131,_0x551cb6=_0x3d64d1[0x0]||'.',_0x5af7f6=_0x5c0b69['dryRun'],_0x121f5e=_0x5c0b69,_0xeeb44f=_0x121f5e[_0x2c0c3d(0x10c)]===![],_0x1bda66=_0x121f5e['reeval'],_0x33743c=_0x121f5e['name'],_0x8669fb=_0x121f5e['tags'],_0x4e551d=_0x5c0b69[_0x2c0c3d(0x14c)],_0x531e4c=_0x121f5e[_0x2c0c3d(0x125)];if(_0x1bda66&&_0xeeb44f)return console['log'](a5_0x500c4d[_0x2c0c3d(0x116)](_0x2c0c3d(0x183))),0x1;let _0x2816c3=_0x2c0c3d(0x141);if(_0x121f5e[_0x2c0c3d(0x180)])_0x2816c3=_0x2c0c3d(0x180);else{if(_0x121f5e[_0x2c0c3d(0x121)])_0x2816c3=_0x2c0c3d(0x121);else{if(_0x121f5e[_0x2c0c3d(0x154)])_0x2816c3='tsv';else{if(_0x121f5e[_0x2c0c3d(0x141)])_0x2816c3='table';}}}const _0x138ec0=_0x121f5e[_0x2c0c3d(0x108)];let _0x18bcde=_0x551cb6;const _0x27b669=a5_0x738a1[_0x2c0c3d(0xfd)](_0x551cb6),_0x5280f7=_0x551cb6==='.';if(!_0x27b669||_0x5280f7){const _0x24d36d=resolveProjectFromContext(_0x551cb6,_0x138ec0,{'requireFile':_0x2c0c3d(0x175)});if(_0x24d36d[_0x2c0c3d(0xfe)])_0x18bcde=_0x24d36d[_0x2c0c3d(0x131)],_0x24d36d[_0x2c0c3d(0x15e)]===_0x2c0c3d(0x179)&&console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x12a)]('Using\x20agent:\x20'+_0x18bcde));else switch(_0x24d36d[_0x2c0c3d(0x10b)]){case _0x2c0c3d(0x176):console[_0x2c0c3d(0x145)](a5_0x500c4d['yellow'](_0x24d36d[_0x2c0c3d(0x13b)])),console[_0x2c0c3d(0x145)](),console[_0x2c0c3d(0x145)](_0x2c0c3d(0xf5)),console[_0x2c0c3d(0x145)]('\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'](_0x2c0c3d(0x13e)),console[_0x2c0c3d(0x145)](),console[_0x2c0c3d(0x145)](_0x2c0c3d(0x101));return 0x1;case _0x2c0c3d(0x11e):console['log'](a5_0x500c4d[_0x2c0c3d(0x168)](_0x24d36d[_0x2c0c3d(0x13b)])),console[_0x2c0c3d(0x145)](),console[_0x2c0c3d(0x145)](_0x2c0c3d(0xfa)+_0x24d36d[_0x2c0c3d(0x108)]+_0x2c0c3d(0x13a));return 0x1;case _0x2c0c3d(0xf6):{const _0x3b55f4=a5_0x47357e['basename'](_0x24d36d['projectDir']);console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x168)](_0x2c0c3d(0x170)+_0x24d36d[_0x2c0c3d(0x108)]+'\x22:'));for(const _0x3f9df4 of _0x24d36d['agentDirs']){console[_0x2c0c3d(0x145)]('\x20\x20-\x20'+_0x3f9df4);}return console['log'](),console[_0x2c0c3d(0x145)](_0x2c0c3d(0x153)+_0x3b55f4+_0x2c0c3d(0x159)),0x1;}case'no_tests':console[_0x2c0c3d(0x145)](a5_0x500c4d['yellow'](_0x2c0c3d(0x148)+_0x24d36d[_0x2c0c3d(0x108)]+'\x22.')),console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x12a)]('Project\x20path:\x20'+_0x24d36d[_0x2c0c3d(0x131)])),console[_0x2c0c3d(0x145)](),console[_0x2c0c3d(0x145)](_0x2c0c3d(0x173));return 0x1;}}const {definition:_0x39f91e,agentInfo:_0x55392d}=parseTestFile(_0x18bcde);let _0x4d7481=_0x39f91e[_0x2c0c3d(0x13d)];if(_0x33743c){const _0x4743f9=_0x33743c[_0x2c0c3d(0x171)](',')[_0x2c0c3d(0xf4)](_0x414291=>_0x414291[_0x2c0c3d(0x133)]());_0x4d7481=_0x39f91e['tests']['filter'](_0x85ecc4=>_0x4743f9[_0x2c0c3d(0x161)](_0x85ecc4[_0x2c0c3d(0x130)]));if(_0x4d7481[_0x2c0c3d(0x137)]===0x0)return console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x168)](_0x2c0c3d(0x102)+_0x33743c)),console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x12a)](_0x2c0c3d(0x17e)+_0x39f91e[_0x2c0c3d(0x13d)][_0x2c0c3d(0xf4)](_0x109c74=>_0x109c74['name'])[_0x2c0c3d(0x10f)](',\x20'))),0x1;}if(_0x8669fb){const _0x387719=_0x8669fb[_0x2c0c3d(0x171)](',')[_0x2c0c3d(0xf4)](_0x13f910=>_0x13f910[_0x2c0c3d(0x133)]()[_0x2c0c3d(0x16b)]());_0x4d7481=_0x4d7481[_0x2c0c3d(0x136)](_0x522f68=>_0x522f68[_0x2c0c3d(0x174)]?.[_0x2c0c3d(0x106)](_0x18b4b3=>_0x387719[_0x2c0c3d(0x161)](_0x18b4b3[_0x2c0c3d(0x16b)]())));if(_0x4d7481[_0x2c0c3d(0x137)]===0x0){console[_0x2c0c3d(0x145)](a5_0x500c4d['yellow'](_0x2c0c3d(0x126)+_0x8669fb));const _0x2934bd=new Set();return _0x39f91e[_0x2c0c3d(0x13d)][_0x2c0c3d(0xf0)](_0x49ad84=>_0x49ad84[_0x2c0c3d(0x174)]?.[_0x2c0c3d(0xf0)](_0x874e54=>_0x2934bd['add'](_0x874e54))),_0x2934bd[_0x2c0c3d(0x165)]>0x0?console['log'](a5_0x500c4d[_0x2c0c3d(0x12a)](_0x2c0c3d(0x114)+[..._0x2934bd][_0x2c0c3d(0x10f)](',\x20'))):console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x12a)](_0x2c0c3d(0x15d))),0x1;}}if(_0x1bda66)return this[_0x2c0c3d(0xf7)](_0x11d131,{'definition':{'tests':_0x4d7481},'agentInfo':_0x55392d,'outputFormat':_0x2816c3,'outputFile':_0x531e4c,'testNames':_0x33743c});if(_0x5af7f6){console[_0x2c0c3d(0x145)](a5_0x500c4d['cyan'](_0x2c0c3d(0x119))),console['log'](_0x2c0c3d(0x17c)+a5_0x500c4d[_0x2c0c3d(0x152)](_0x4e551d)),console[_0x2c0c3d(0x145)]('\x20\x20Project:\x20'+a5_0x500c4d[_0x2c0c3d(0x152)](_0x55392d[_0x2c0c3d(0xfc)])),console[_0x2c0c3d(0x145)]('\x20\x20Agent:\x20'+a5_0x500c4d[_0x2c0c3d(0x152)](_0x55392d['agentName'])),console[_0x2c0c3d(0x145)](),console[_0x2c0c3d(0x145)](_0x2c0c3d(0x17b)+a5_0x500c4d[_0x2c0c3d(0x152)](_0x4d7481[_0x2c0c3d(0x137)]));for(let _0x1f6180=0x0;_0x1f6180<_0x4d7481[_0x2c0c3d(0x137)];_0x1f6180++){const _0x571995=_0x4d7481[_0x1f6180],_0x2256b4=_0x571995[_0x2c0c3d(0x139)][_0x2c0c3d(0x137)]===0x1?_0x2c0c3d(0x107):_0x2c0c3d(0x139),_0x3bf0fe=_0x571995['tags']?.[_0x2c0c3d(0x137)]?'\x20['+_0x571995[_0x2c0c3d(0x174)][_0x2c0c3d(0x10f)](',\x20')+']':'';console[_0x2c0c3d(0x145)]('\x20\x20'+(_0x1f6180+0x1)+'.\x20'+a5_0x500c4d['white'](_0x571995['name'])+'\x20('+_0x571995['rounds']['length']+'\x20'+_0x2256b4+')'+a5_0x500c4d[_0x2c0c3d(0x12a)](_0x3bf0fe));}return 0x0;}let _0x2e280e,_0x381d05;try{_0x2e280e=await _0x106f1e['llm'][_0x2c0c3d(0x147)](_0x55392d[_0x2c0c3d(0xfc)]);}catch(_0x46fdeb){const _0x284bae=_0x46fdeb instanceof Error?_0x46fdeb['message']:String(_0x46fdeb);return _0x284bae['includes']('404')||_0x284bae['toLowerCase']()['includes'](_0x2c0c3d(0x11a))?console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x116)](_0x2c0c3d(0x134)+_0x55392d[_0x2c0c3d(0xfc)])):console[_0x2c0c3d(0x145)](a5_0x500c4d['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x55392d[_0x2c0c3d(0xfc)]+_0x2c0c3d(0xff)+_0x284bae)),0x1;}try{_0x381d05=await _0x106f1e[_0x2c0c3d(0x16e)][_0x2c0c3d(0x182)](_0x55392d[_0x2c0c3d(0x12d)],_0x2e280e);}catch(_0x3092d5){const _0x5e6d6c=_0x3092d5 instanceof Error?_0x3092d5[_0x2c0c3d(0x13b)]:String(_0x3092d5);return _0x5e6d6c['includes'](_0x2c0c3d(0x10a))||_0x5e6d6c['toLowerCase']()[_0x2c0c3d(0x161)](_0x2c0c3d(0x11a))?console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x116)](_0x2c0c3d(0x160)+_0x55392d[_0x2c0c3d(0x12d)])):console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x116)](_0x2c0c3d(0xf1)+_0x55392d[_0x2c0c3d(0x12d)]+'\x22:\x20'+_0x5e6d6c)),0x1;}let _0x39297c;if(!_0xeeb44f)try{_0x39297c=await setupEvaluatorAgent(_0x106f1e['llm'],_0x5c0b69['verbose']);}catch(_0x385837){const _0x4b9a5d=_0x385837 instanceof Error?_0x385837[_0x2c0c3d(0x13b)]:String(_0x385837);return console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x116)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x4b9a5d)),0x1;}console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x112)]('Running\x20agent\x20tests...')),console[_0x2c0c3d(0x145)]('Site:\x20'+a5_0x500c4d[_0x2c0c3d(0x152)](_0x4e551d)),console[_0x2c0c3d(0x145)](_0x2c0c3d(0x17a)+a5_0x500c4d[_0x2c0c3d(0x152)](_0x55392d['projectName']+'/'+_0x55392d[_0x2c0c3d(0x12d)])),console[_0x2c0c3d(0x145)]();const _0x404bf1=[],_0xe63552=[],_0x30dcfd=Date['now']();for(let _0x42a113=0x0;_0x42a113<_0x4d7481['length'];_0x42a113++){const _0x452df5=_0x4d7481[_0x42a113];_0x4d7481[_0x2c0c3d(0x137)]>0x1?console[_0x2c0c3d(0x145)](_0x2c0c3d(0xf8)+(_0x42a113+0x1)+'/'+_0x4d7481['length']+':\x20'+a5_0x500c4d[_0x2c0c3d(0x152)](_0x452df5[_0x2c0c3d(0x130)])):console[_0x2c0c3d(0x145)](_0x2c0c3d(0x110)+a5_0x500c4d[_0x2c0c3d(0x152)](_0x452df5[_0x2c0c3d(0x130)]));const _0x50a6d1=createCommandSpinner(_0x2c0c3d(0x13c)+_0x452df5[_0x2c0c3d(0x139)][_0x2c0c3d(0x137)]+_0x2c0c3d(0x13f));_0x50a6d1[_0x2c0c3d(0x150)]();try{const {result:_0x4878f8,conversation:_0x10dacc}=await runTest(_0x106f1e[_0x2c0c3d(0x16e)],_0x452df5,{'agentId':_0x381d05,'projectId':_0x2e280e,'site':_0x4e551d,'noEval':_0xeeb44f,'evaluatorId':_0x39297c,'onRoundStart':(_0x5e5336,_0x8b13de)=>{const _0x515087=_0x2c0c3d;_0x50a6d1[_0x515087(0x17f)]=_0x515087(0x122)+(_0x5e5336+0x1)+'/'+_0x8b13de+_0x515087(0x13f);},'onRoundComplete':(_0x1246ad,_0x356152,_0x4e12aa)=>{const _0x1742d9=_0x2c0c3d,_0x387c39=formatElapsed(_0x356152);_0x4e12aa?console[_0x1742d9(0x145)](_0x1742d9(0xed)+(_0x1246ad+0x1)+'/'+_0x452df5[_0x1742d9(0x139)][_0x1742d9(0x137)]+_0x1742d9(0x103)+a5_0x500c4d['green']('✓')+'\x20('+_0x387c39+')'):console['log'](_0x1742d9(0xed)+(_0x1246ad+0x1)+'/'+_0x452df5[_0x1742d9(0x139)][_0x1742d9(0x137)]+_0x1742d9(0x103)+a5_0x500c4d['red']('✗'));},'onEvaluationStart':()=>{const _0xf852f8=_0x2c0c3d;_0x50a6d1['text']=_0xf852f8(0x143);},'onEvaluationComplete':_0x4704b8=>{const _0x29e7fd=_0x2c0c3d,_0x5590fe=formatElapsed(_0x4704b8);console[_0x29e7fd(0x145)](_0x29e7fd(0x162)+a5_0x500c4d['green']('✓')+'\x20('+_0x5590fe+')');}});_0x50a6d1['stop'](),_0x404bf1[_0x2c0c3d(0xec)](_0x4878f8),_0xe63552[_0x2c0c3d(0xec)](_0x10dacc);if(_0x4878f8['status']==='PASS')console[_0x2c0c3d(0x145)](a5_0x500c4d['green'](_0x2c0c3d(0x14d)+_0x4878f8['reason']));else _0x4878f8[_0x2c0c3d(0x155)]===_0x2c0c3d(0x15a)?console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x116)]('✗\x20FAIL:\x20'+_0x4878f8[_0x2c0c3d(0x10b)])):console['log'](a5_0x500c4d['red']('✗\x20ERROR:\x20'+_0x4878f8[_0x2c0c3d(0x10b)]));_0x4878f8['conversation_url']&&console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x12a)](_0x2c0c3d(0x113)+_0x4878f8[_0x2c0c3d(0x111)])),console['log']();}catch(_0x311829){_0x50a6d1['stop']();const _0x2c548e=_0x311829 instanceof Error?_0x311829[_0x2c0c3d(0x13b)]:String(_0x311829);console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x116)](_0x2c0c3d(0x104)+_0x2c548e)),console['log'](),_0x404bf1[_0x2c0c3d(0xec)]({'name':_0x452df5[_0x2c0c3d(0x130)],'status':'ERROR','reason':_0x2c548e,'timestamp':new Date()[_0x2c0c3d(0x172)](),'duration_ms':0x0});}}const _0x56a60d=Date['now']()-_0x30dcfd,_0x335733=_0x404bf1[_0x2c0c3d(0x136)](_0x4904a1=>_0x4904a1[_0x2c0c3d(0x155)]===_0x2c0c3d(0x142))[_0x2c0c3d(0x137)],_0x3b3b88=_0x404bf1[_0x2c0c3d(0x136)](_0x3e32fa=>_0x3e32fa[_0x2c0c3d(0x155)]===_0x2c0c3d(0x15a))[_0x2c0c3d(0x137)],_0x26082a=_0x404bf1[_0x2c0c3d(0x136)](_0x462e5c=>_0x462e5c['status']===_0x2c0c3d(0x149))[_0x2c0c3d(0x137)];console[_0x2c0c3d(0x145)]('━'[_0x2c0c3d(0x124)](0x3c)),console[_0x2c0c3d(0x145)](_0x2c0c3d(0x157)),console['log']('━'[_0x2c0c3d(0x124)](0x3c)),console['log'](_0x2c0c3d(0x11f)+_0x404bf1[_0x2c0c3d(0x137)]),console['log'](_0x2c0c3d(0x16c)+a5_0x500c4d[_0x2c0c3d(0x105)](_0x335733)),console[_0x2c0c3d(0x145)](_0x2c0c3d(0x12e)+a5_0x500c4d[_0x2c0c3d(0x116)](_0x3b3b88));_0x26082a>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x500c4d['red'](_0x26082a));console[_0x2c0c3d(0x145)](_0x2c0c3d(0x151)+formatElapsed(_0x56a60d)),console['log']('━'[_0x2c0c3d(0x124)](0x3c));const _0x289d2e=_0x404bf1[_0x2c0c3d(0x136)](_0x37ae2a=>_0x37ae2a[_0x2c0c3d(0x155)]!=='PASS');if(_0x289d2e[_0x2c0c3d(0x137)]>0x0){console[_0x2c0c3d(0x145)](),console[_0x2c0c3d(0x145)](_0x2c0c3d(0x164));for(const _0x4c54bc of _0x289d2e){const _0x2c418a=a5_0x500c4d[_0x2c0c3d(0x116)]('✗'),_0x108bd5=_0x4c54bc['reason'][_0x2c0c3d(0x137)]>0x32?_0x4c54bc[_0x2c0c3d(0x10b)][_0x2c0c3d(0x120)](0x0,0x32)+_0x2c0c3d(0x138):_0x4c54bc[_0x2c0c3d(0x10b)];console[_0x2c0c3d(0x145)]('\x20\x20'+_0x2c418a+'\x20'+_0x4c54bc[_0x2c0c3d(0x130)]+':\x20'+_0x108bd5);}}const _0x5059a6={'summary':{'total':_0x404bf1['length'],'passed':_0x335733,'failed':_0x3b3b88,'errors':_0x26082a>0x0?_0x26082a:undefined,'duration_ms':_0x56a60d},'tests':_0x404bf1,'agent':{'project':_0x55392d['projectName'],'name':_0x55392d[_0x2c0c3d(0x12d)],'site':_0x4e551d},'timestamp':new Date(_0x30dcfd)[_0x2c0c3d(0x172)]()};try{const _0x1bc171=buildCachedTestRun(_0xe63552,{'site':_0x4e551d,'projectId':_0x2e280e,'projectName':_0x55392d[_0x2c0c3d(0xfc)],'agentId':_0x381d05,'agentName':_0x55392d[_0x2c0c3d(0x12d)],'testYmlPath':a5_0x47357e['resolve'](_0x55392d[_0x2c0c3d(0x11c)])});saveLastTestRun(_0x1bc171);}catch{}if(_0x2816c3!==_0x2c0c3d(0x141)||_0x531e4c){const _0x468b2d=formatResults(_0x5059a6,_0x2816c3);if(_0x531e4c)try{a5_0x738a1['writeFileSync'](_0x531e4c,_0x468b2d,'utf-8'),console['log'](),console[_0x2c0c3d(0x145)](a5_0x500c4d[_0x2c0c3d(0x12a)](_0x2c0c3d(0x177)+_0x531e4c));}catch(_0x492a76){return console[_0x2c0c3d(0x145)](),console['log'](a5_0x500c4d[_0x2c0c3d(0x116)](_0x2c0c3d(0x181)+_0x492a76)),0x1;}else console[_0x2c0c3d(0x145)](),console[_0x2c0c3d(0x145)](_0x468b2d);}return _0x289d2e['length']>0x0?0x1:0x0;}async[a5_0x5c9cf7(0xf7)](_0x4eb9de,_0x5807df){const _0x295950=a5_0x5c9cf7,{options:_0x426d9b,tdx:_0x2fc7d5}=_0x4eb9de,{definition:_0x1eba13,agentInfo:_0x35f241,outputFormat:_0x2138b8,outputFile:_0x565e9b}=_0x5807df,_0x5aa30f=_0x426d9b[_0x295950(0x14c)],_0x5b806a=loadLastTestRun();if(!_0x5b806a)return console['log'](a5_0x500c4d[_0x295950(0x116)](_0x295950(0x16a))),console[_0x295950(0x145)](a5_0x500c4d['dim'](_0x295950(0x100))),0x1;if(_0x5b806a[_0x295950(0x158)][_0x295950(0x12d)]!==_0x35f241[_0x295950(0x12d)])return console[_0x295950(0x145)](a5_0x500c4d[_0x295950(0x116)](_0x295950(0x12c)+_0x5b806a[_0x295950(0x158)][_0x295950(0x12d)]+_0x295950(0x163)+_0x35f241[_0x295950(0x12d)]+'\x22.')),console['log'](a5_0x500c4d[_0x295950(0x12a)](_0x295950(0xee))),0x1;const _0x17def8=new Set(_0x5b806a['conversations'][_0x295950(0xf4)](_0x351983=>_0x351983[_0x295950(0x12f)])),_0x40bb3b=_0x1eba13[_0x295950(0x13d)][_0x295950(0x136)](_0x5005e5=>!_0x17def8['has'](_0x5005e5[_0x295950(0x130)]));if(_0x40bb3b['length']>0x0&&_0x5b806a[_0x295950(0x14c)]!==_0x5aa30f)return console['log'](a5_0x500c4d[_0x295950(0x116)](_0x295950(0xf9))),console[_0x295950(0x145)](a5_0x500c4d['dim'](_0x295950(0x184)+_0x5b806a[_0x295950(0x14c)]+_0x295950(0x123)+_0x5aa30f+'\x22.')),console[_0x295950(0x145)](a5_0x500c4d[_0x295950(0x12a)]('Either\x20switch\x20to\x20the\x20\x22'+_0x5b806a[_0x295950(0x14c)]+_0x295950(0x109))),0x1;const _0x302321=_0x1eba13[_0x295950(0x13d)][_0x295950(0x136)](_0x5ddb76=>_0x17def8[_0x295950(0x14f)](_0x5ddb76[_0x295950(0x130)])),_0x71070d=_0x40bb3b;let _0x10f166;try{_0x10f166=await setupEvaluatorAgent(_0x2fc7d5['llm'],_0x426d9b['verbose']);}catch(_0x5edee2){const _0x7a2455=_0x5edee2 instanceof Error?_0x5edee2[_0x295950(0x13b)]:String(_0x5edee2);return console[_0x295950(0x145)](a5_0x500c4d[_0x295950(0x116)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x7a2455)),0x1;}console[_0x295950(0x145)](a5_0x500c4d['cyan'](_0x295950(0xf3))),console['log'](_0x295950(0x10d)+a5_0x500c4d[_0x295950(0x152)](_0x5b806a[_0x295950(0x140)])),console[_0x295950(0x145)](_0x295950(0x17a)+a5_0x500c4d[_0x295950(0x152)](_0x5b806a[_0x295950(0x158)][_0x295950(0xfc)]+'/'+_0x5b806a['agent']['agentName']));_0x71070d[_0x295950(0x137)]>0x0&&console['log'](_0x295950(0x132)+a5_0x500c4d[_0x295950(0x168)](_0x71070d[_0x295950(0x137)]));console[_0x295950(0x145)]();const _0x291c58=[],_0x421fdd=Date[_0x295950(0x16d)](),_0x3b5897=createCommandSpinner(_0x295950(0x167));if(_0x302321[_0x295950(0x137)]>0x0)try{const _0xc261f7=await reevaluateFromCache(_0x2fc7d5['llm'],_0x5b806a,{'tests':_0x302321},{'evaluatorId':_0x10f166,'onTestStart':(_0x5bc4af,_0x24dfac,_0x4526fb)=>{const _0x32c129=_0x295950;_0x3b5897['text']=_0x32c129(0x10e)+(_0x24dfac+0x1)+'/'+_0x4526fb+':\x20'+_0x5bc4af+_0x32c129(0x138);if(!_0x3b5897[_0x32c129(0x11b)])_0x3b5897['start']();},'onTestComplete':(_0x35d15e,_0x4b76e1)=>{const _0x17ff7d=_0x295950;_0x3b5897['stop']();if(_0x4b76e1[_0x17ff7d(0x155)]===_0x17ff7d(0x142))console[_0x17ff7d(0x145)](a5_0x500c4d[_0x17ff7d(0x105)](_0x17ff7d(0x14d)+_0x35d15e)+a5_0x500c4d['dim']('\x20(cached)'));else _0x4b76e1[_0x17ff7d(0x155)]==='FAIL'?console[_0x17ff7d(0x145)](a5_0x500c4d[_0x17ff7d(0x116)](_0x17ff7d(0x127)+_0x35d15e+_0x17ff7d(0x16f)+_0x4b76e1[_0x17ff7d(0x10b)])+a5_0x500c4d[_0x17ff7d(0x12a)](_0x17ff7d(0x15f))):console[_0x17ff7d(0x145)](a5_0x500c4d[_0x17ff7d(0x116)]('✗\x20ERROR:\x20'+_0x35d15e+_0x17ff7d(0x16f)+_0x4b76e1['reason']));_0x4b76e1[_0x17ff7d(0x111)]&&console['log'](a5_0x500c4d['dim'](_0x17ff7d(0x135)+_0x4b76e1[_0x17ff7d(0x111)])),_0x291c58['push'](_0x4b76e1);},'onTestSkipped':(_0xecfff1,_0x1365f1)=>{const _0x48a9e8=_0x295950;_0x3b5897[_0x48a9e8(0x178)](),console[_0x48a9e8(0x145)](a5_0x500c4d[_0x48a9e8(0x168)](_0x48a9e8(0x115)+_0xecfff1+_0x48a9e8(0x16f)+_0x1365f1));}});for(const _0x1d2305 of _0xc261f7){!_0x291c58['find'](_0x36df43=>_0x36df43[_0x295950(0x130)]===_0x1d2305[_0x295950(0x130)])&&_0x291c58['push'](_0x1d2305);}}catch(_0x2ebcc4){_0x3b5897[_0x295950(0x178)]();const _0x2009c6=_0x2ebcc4 instanceof Error?_0x2ebcc4[_0x295950(0x13b)]:String(_0x2ebcc4);return console[_0x295950(0x145)](a5_0x500c4d[_0x295950(0x116)](_0x295950(0x169)+_0x2009c6)),0x1;}_0x3b5897['stop']();if(_0x71070d[_0x295950(0x137)]>0x0){console[_0x295950(0x145)](),console[_0x295950(0x145)](a5_0x500c4d[_0x295950(0x112)](_0x295950(0x117)));const {projectId:_0x5a55eb,agentId:_0x3dc85e}=_0x5b806a[_0x295950(0x158)];for(const _0x154d4d of _0x71070d){console['log'](_0x295950(0xef)+a5_0x500c4d[_0x295950(0x152)](_0x154d4d[_0x295950(0x130)]));const _0x2abc0d=createCommandSpinner(_0x295950(0x13c)+_0x154d4d['rounds']['length']+_0x295950(0x13f));_0x2abc0d[_0x295950(0x150)]();try{const {result:_0x43fbd9}=await runTest(_0x2fc7d5[_0x295950(0x16e)],_0x154d4d,{'agentId':_0x3dc85e,'projectId':_0x5a55eb,'site':_0x5b806a[_0x295950(0x14c)],'noEval':![],'evaluatorId':_0x10f166,'onRoundStart':(_0x2254ec,_0x690d0b)=>{const _0x32d25f=_0x295950;_0x2abc0d[_0x32d25f(0x17f)]='Round\x20'+(_0x2254ec+0x1)+'/'+_0x690d0b+_0x32d25f(0x13f);},'onRoundComplete':(_0x2fb791,_0x1c3639,_0x346cdb)=>{const _0x23d893=_0x295950,_0x1950d8=formatElapsed(_0x1c3639);_0x346cdb?console[_0x23d893(0x145)](_0x23d893(0xed)+(_0x2fb791+0x1)+'/'+_0x154d4d[_0x23d893(0x139)][_0x23d893(0x137)]+_0x23d893(0x103)+a5_0x500c4d[_0x23d893(0x105)]('✓')+'\x20('+_0x1950d8+')'):console[_0x23d893(0x145)](_0x23d893(0xed)+(_0x2fb791+0x1)+'/'+_0x154d4d[_0x23d893(0x139)]['length']+_0x23d893(0x103)+a5_0x500c4d['red']('✗'));},'onEvaluationStart':()=>{const _0x406695=_0x295950;_0x2abc0d[_0x406695(0x17f)]='Evaluating\x20response...';},'onEvaluationComplete':_0xb395=>{const _0x26d9a4=_0x295950,_0x59fdcc=formatElapsed(_0xb395);console[_0x26d9a4(0x145)](_0x26d9a4(0x162)+a5_0x500c4d[_0x26d9a4(0x105)]('✓')+'\x20('+_0x59fdcc+')');}});_0x2abc0d[_0x295950(0x178)](),_0x291c58[_0x295950(0xec)](_0x43fbd9);if(_0x43fbd9['status']===_0x295950(0x142))console[_0x295950(0x145)](a5_0x500c4d[_0x295950(0x105)](_0x295950(0x14d)+_0x43fbd9[_0x295950(0x10b)])+a5_0x500c4d[_0x295950(0x12a)]('\x20(new)'));else _0x43fbd9[_0x295950(0x155)]===_0x295950(0x15a)?console[_0x295950(0x145)](a5_0x500c4d[_0x295950(0x116)](_0x295950(0x127)+_0x43fbd9[_0x295950(0x10b)])+a5_0x500c4d[_0x295950(0x12a)]('\x20(new)')):console[_0x295950(0x145)](a5_0x500c4d['red'](_0x295950(0x104)+_0x43fbd9[_0x295950(0x10b)]));_0x43fbd9[_0x295950(0x111)]&&console['log'](a5_0x500c4d[_0x295950(0x12a)]('\x20\x20Conversation:\x20'+_0x43fbd9[_0x295950(0x111)]));}catch(_0x2ad961){_0x2abc0d[_0x295950(0x178)]();const _0x3a168d=_0x2ad961 instanceof Error?_0x2ad961[_0x295950(0x13b)]:String(_0x2ad961);console[_0x295950(0x145)](a5_0x500c4d[_0x295950(0x116)](_0x295950(0x104)+_0x3a168d)),_0x291c58[_0x295950(0xec)]({'name':_0x154d4d[_0x295950(0x130)],'status':_0x295950(0x149),'reason':_0x3a168d,'timestamp':new Date()[_0x295950(0x172)](),'duration_ms':0x0});}}}console['log']();const _0x1ffc89=Date[_0x295950(0x16d)]()-_0x421fdd,_0x402b3f=_0x291c58[_0x295950(0x136)](_0x4ddb6a=>_0x4ddb6a[_0x295950(0x155)]===_0x295950(0x142))[_0x295950(0x137)],_0x492a36=_0x291c58[_0x295950(0x136)](_0x2324c0=>_0x2324c0[_0x295950(0x155)]==='FAIL')['length'],_0x20a927=_0x291c58[_0x295950(0x136)](_0x3ab940=>_0x3ab940[_0x295950(0x155)]===_0x295950(0x149))['length'];console[_0x295950(0x145)]('━'[_0x295950(0x124)](0x3c)),console[_0x295950(0x145)](_0x295950(0x14e)),console[_0x295950(0x145)]('━'[_0x295950(0x124)](0x3c)),console[_0x295950(0x145)](_0x295950(0x11f)+_0x291c58[_0x295950(0x137)]),console[_0x295950(0x145)](_0x295950(0x16c)+a5_0x500c4d[_0x295950(0x105)](_0x402b3f)),console[_0x295950(0x145)](_0x295950(0x12e)+a5_0x500c4d[_0x295950(0x116)](_0x492a36));_0x20a927>0x0&&console[_0x295950(0x145)](_0x295950(0xf2)+a5_0x500c4d[_0x295950(0x116)](_0x20a927));console[_0x295950(0x145)](_0x295950(0x151)+formatElapsed(_0x1ffc89)),console[_0x295950(0x145)]('━'[_0x295950(0x124)](0x3c));const _0x1d2f95={'summary':{'total':_0x291c58[_0x295950(0x137)],'passed':_0x402b3f,'failed':_0x492a36,'errors':_0x20a927>0x0?_0x20a927:undefined,'duration_ms':_0x1ffc89},'tests':_0x291c58,'agent':{'project':_0x35f241['projectName'],'name':_0x35f241[_0x295950(0x12d)],'site':_0x5aa30f},'timestamp':new Date(_0x421fdd)[_0x295950(0x172)]()};if(_0x2138b8!==_0x295950(0x141)||_0x565e9b){const _0x3dfbad=formatResults(_0x1d2f95,_0x2138b8);if(_0x565e9b)try{a5_0x738a1[_0x295950(0x14b)](_0x565e9b,_0x3dfbad,_0x295950(0x118)),console[_0x295950(0x145)](),console[_0x295950(0x145)](a5_0x500c4d[_0x295950(0x12a)](_0x295950(0x177)+_0x565e9b));}catch(_0x5b9bc0){return console[_0x295950(0x145)](),console['log'](a5_0x500c4d[_0x295950(0x116)](_0x295950(0x181)+_0x5b9bc0)),0x1;}else console[_0x295950(0x145)](),console['log'](_0x3dfbad);}const _0x13943f=_0x291c58[_0x295950(0x136)](_0x15ed55=>_0x15ed55[_0x295950(0x155)]!==_0x295950(0x142));return _0x13943f[_0x295950(0x137)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x28267b=a6_0xeb4d;(function(_0x221944,_0x537e5c){const _0x1d9659=a6_0xeb4d,_0x14f78c=_0x221944();while(!![]){try{const _0xc15141=-parseInt(_0x1d9659(0x1d6))/0x1*(parseInt(_0x1d9659(0x200))/0x2)+-parseInt(_0x1d9659(0x1d9))/0x3*(parseInt(_0x1d9659(0x1ca))/0x4)+parseInt(_0x1d9659(0x20a))/0x5*(parseInt(_0x1d9659(0x1cf))/0x6)+-parseInt(_0x1d9659(0x1f4))/0x7+parseInt(_0x1d9659(0x1c3))/0x8*(-parseInt(_0x1d9659(0x1f8))/0x9)+parseInt(_0x1d9659(0x1f0))/0xa*(-parseInt(_0x1d9659(0x1db))/0xb)+parseInt(_0x1d9659(0x1cc))/0xc;if(_0xc15141===_0x537e5c)break;else _0x14f78c['push'](_0x14f78c['shift']());}catch(_0x361981){_0x14f78c['push'](_0x14f78c['shift']());}}}(a6_0x77cc,0x357ba));function a6_0xeb4d(_0xdac4fd,_0x28645d){_0xdac4fd=_0xdac4fd-0x1c3;const _0x77cc5d=a6_0x77cc();let _0xeb4de0=_0x77cc5d[_0xdac4fd];return _0xeb4de0;}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_0x28267b(0x1e0),a6_0x28267b(0x1e4),a6_0x28267b(0x1f5),'set-cookie','set-cookie2',a6_0x28267b(0x1f7),'x-auth-token',a6_0x28267b(0x1d2)]);function isSensitiveHeader(_0x2c5856){const _0x5bdea1=a6_0x28267b;return SENSITIVE_HEADERS['has'](_0x2c5856[_0x5bdea1(0x1e8)]());}function parseHeader(_0x202414){const _0x5d360f=a6_0x28267b,_0x25b43a=_0x202414[_0x5d360f(0x1dc)](':');if(_0x25b43a===-0x1)throw new Error(_0x5d360f(0x1c8)+_0x202414+_0x5d360f(0x1d4)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x494c70=_0x202414[_0x5d360f(0x1f9)](0x0,_0x25b43a)[_0x5d360f(0x1ea)](),_0x5638ad=_0x202414['substring'](_0x25b43a+0x1)[_0x5d360f(0x1ea)]();if(!_0x494c70)throw new Error(_0x5d360f(0x1d3)+_0x202414+'\x22');return[_0x494c70,_0x5638ad];}export class ApiCommand extends BaseCommand{[a6_0x28267b(0x205)]=a6_0x28267b(0x203);[a6_0x28267b(0x1d0)]=a6_0x28267b(0x1e6);[a6_0x28267b(0x1ed)](_0x54c8ed){const _0x506c88=a6_0x28267b,{args:_0x1fe732,options:_0x11d41c}=_0x54c8ed,_0x9be196=_0x11d41c;if(_0x1fe732['length']===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x363d46=_0x1fe732[0x0];if(!_0x363d46['startsWith']('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x363d46;const _0x5d63ff=_0x9be196['data'],_0x29f59c=_0x9be196[_0x506c88(0x1de)];if(_0x5d63ff&&_0x29f59c)return _0x506c88(0x1e3);const _0x4c32bf=_0x9be196[_0x506c88(0x1f1)]||_0x506c88(0x1e1),_0xb94286=[_0x506c88(0x1e1),'POST',_0x506c88(0x1e9),'DELETE',_0x506c88(0x201)];if(!_0xb94286[_0x506c88(0x1e7)](_0x4c32bf['toUpperCase']()))return _0x506c88(0x1e2)+_0x4c32bf+_0x506c88(0x1eb)+_0xb94286[_0x506c88(0x1cb)](',\x20');const _0x3e566b=_0x9be196[_0x506c88(0x206)]||'td',_0x1bc3b7=['td',_0x506c88(0x1ec),_0x506c88(0x1ee),_0x506c88(0x1fc),_0x506c88(0x1fa),_0x506c88(0x1df),'cas'];if(!_0x1bc3b7[_0x506c88(0x1e7)](_0x3e566b))return _0x506c88(0x1c9)+_0x3e566b+_0x506c88(0x1c7)+_0x1bc3b7[_0x506c88(0x1cb)](',\x20');return undefined;}async[a6_0x28267b(0x207)](_0x3d60ec){const _0x378147=a6_0x28267b,{options:_0x1df3f3,args:_0x467100,tdx:_0x35ee08}=_0x3d60ec,_0x27c79a=_0x1df3f3,_0xf51a91=_0x467100[0x0],_0x4a2857=(_0x27c79a[_0x378147(0x1f1)]||_0x378147(0x1e1))[_0x378147(0x1f6)](),_0x31b7a7=_0x27c79a[_0x378147(0x1d7)],_0x50c5b1=_0x27c79a[_0x378147(0x1de)],_0x49bf0c=_0x27c79a[_0x378147(0x204)],_0x580aca=_0x27c79a['type']||'td';try{const _0x3b01ce={};if(_0x49bf0c){const _0x3319b3=Array[_0x378147(0x1ce)](_0x49bf0c)?_0x49bf0c:[_0x49bf0c];for(const _0x9ab822 of _0x3319b3){const [_0x334a55,_0x2a11f0]=parseHeader(_0x9ab822);_0x3b01ce[_0x334a55]=_0x2a11f0;}}let _0xaf8816;if(_0x31b7a7)_0xaf8816=_0x31b7a7;else{if(_0x50c5b1)try{_0xaf8816=RawAPI[_0x378147(0x1fd)](_0x50c5b1);}catch(_0x19c070){return console['error'](_0x378147(0x1da)+(_0x19c070 instanceof Error?_0x19c070[_0x378147(0x1f3)]:String(_0x19c070))),0x1;}}const _0x532942={'method':_0x4a2857,'apiType':_0x580aca,'includeHeaders':_0x1df3f3[_0x378147(0x1f2)]};_0xaf8816&&(_0x532942[_0x378147(0x1d8)]=_0xaf8816);Object[_0x378147(0x1dd)](_0x3b01ce)[_0x378147(0x1d5)]>0x0&&(_0x532942[_0x378147(0x209)]=_0x3b01ce);if(_0x1df3f3['verbose']){const _0x52d312=resolveSite(_0x1df3f3['site']??_0x378147(0x1fb)),_0x9536bc=getEndpoint(_0x52d312,_0x580aca),_0x9d978f=''+_0x9536bc+_0xf51a91;console[_0x378147(0x1c5)]('>\x20'+_0x4a2857+'\x20'+_0x9d978f);const _0x5ea8b2=getAuthHeaders(_0x52d312),_0x314637={..._0x5ea8b2,..._0x3b01ce};for(const [_0x3b430a,_0x3a1050]of Object['entries'](_0x314637)){!isSensitiveHeader(_0x3b430a)&&console[_0x378147(0x1c5)]('>\x20'+_0x3b430a+':\x20'+_0x3a1050);}_0xaf8816&&console[_0x378147(0x1c5)]('>'),console[_0x378147(0x1c5)]('');}const _0xddaa37=await _0x35ee08[_0x378147(0x203)][_0x378147(0x202)](_0xf51a91,_0x532942);if(_0x1df3f3[_0x378147(0x1f2)]&&_0xddaa37[_0x378147(0x209)]){console[_0x378147(0x1c5)]('<\x20HTTP/1.1\x20'+_0xddaa37[_0x378147(0x1ff)]);for(const [_0xbf1d5,_0x5aa252]of Object[_0x378147(0x1d1)](_0xddaa37[_0x378147(0x209)])){!isSensitiveHeader(_0xbf1d5)&&console[_0x378147(0x1c5)]('<\x20'+_0xbf1d5+':\x20'+_0x5aa252);}console['error']('');}const _0x4fbc70=Boolean(_0x1df3f3['output']),_0x627ee6={'color':_0x1df3f3[_0x378147(0x208)],'noColor':_0x1df3f3[_0x378147(0x1c4)]||_0x4fbc70&&!_0x1df3f3['color']},_0x1d5748=colorizeJSON(_0xddaa37[_0x378147(0x1d7)],_0x627ee6);return _0x1df3f3[_0x378147(0x1fe)]?(writeFileSync(_0x1df3f3[_0x378147(0x1fe)],_0x1d5748),console[_0x378147(0x1c5)](_0x378147(0x1ef)+_0x1df3f3[_0x378147(0x1fe)])):console[_0x378147(0x1cd)](_0x1d5748),0x0;}catch(_0x2d5d86){return _0x2d5d86 instanceof Error?(console['error'](_0x378147(0x1da)+_0x2d5d86[_0x378147(0x1f3)]),_0x1df3f3['verbose']&&_0x2d5d86['stack']&&console['error'](_0x378147(0x1c6)+_0x2d5d86[_0x378147(0x1e5)])):console[_0x378147(0x1c5)](_0x378147(0x1da)+String(_0x2d5d86)),0x1;}}}function a6_0x77cc(){const _0x323479=['stack','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','includes','toLowerCase','PUT','trim','.\x20Valid\x20methods:\x20','cdp','validate','workflow','Results\x20saved\x20to\x20','4330bzLAYN','method','verbose','message','485961VJnKrO','cookie','toUpperCase','x-xsrf-token','39843XHofKI','substring','llm','us01','trino','readBodyFromFile','output','status','20666mKAOrR','PATCH','request','api','header','name','type','execute','color','headers','873995ZUrFhF','632AGvCpt','noColor','error','\x0aStack\x20trace:\x0a','.\x20Valid\x20types:\x20','Invalid\x20header\x20format:\x20\x22','Invalid\x20API\x20type:\x20','683772shjkap','join','11819340twoyVW','log','isArray','6BekWAc','description','entries','x-trino-user','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','\x22.\x20','length','1gQqIOf','data','body','6AdFvyB','Error:\x20','4301DArYDq','indexOf','keys','file','llm-proxy','authorization','GET','Invalid\x20HTTP\x20method:\x20','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','proxy-authorization'];a6_0x77cc=function(){return _0x323479;};return a6_0x77cc();}
1
+ const a6_0x18eaad=a6_0x3cda;(function(_0x4dc255,_0x17eabe){const _0x2a71eb=a6_0x3cda,_0x221c14=_0x4dc255();while(!![]){try{const _0x30a671=parseInt(_0x2a71eb(0x1d3))/0x1+-parseInt(_0x2a71eb(0x1d4))/0x2+-parseInt(_0x2a71eb(0x1ca))/0x3*(parseInt(_0x2a71eb(0x1ee))/0x4)+-parseInt(_0x2a71eb(0x1de))/0x5+-parseInt(_0x2a71eb(0x1ef))/0x6*(-parseInt(_0x2a71eb(0x1f2))/0x7)+parseInt(_0x2a71eb(0x1eb))/0x8*(-parseInt(_0x2a71eb(0x1ea))/0x9)+-parseInt(_0x2a71eb(0x1c3))/0xa*(-parseInt(_0x2a71eb(0x1d1))/0xb);if(_0x30a671===_0x17eabe)break;else _0x221c14['push'](_0x221c14['shift']());}catch(_0x277165){_0x221c14['push'](_0x221c14['shift']());}}}(a6_0x42d6,0x7bd2f));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';function a6_0x3cda(_0x99dbfb,_0x287399){_0x99dbfb=_0x99dbfb-0x1c3;const _0x42d6d4=a6_0x42d6();let _0x3cdac2=_0x42d6d4[_0x99dbfb];return _0x3cdac2;}import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';function a6_0x42d6(){const _0x47f26c=['message','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','GET','cas','join','51KkarUv','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','has','x-trino-user','cookie','type','verbose','25487vBnwYX','<\x20HTTP/1.1\x20','115892lTtRqn','602674vQXoEu','\x22.\x20','status','substring','color','headers','PUT','Error:\x20','proxy-authorization','llm-proxy','3226955KKWQVP','body','toLowerCase','data','x-xsrf-token','error','Endpoint\x20must\x20start\x20with\x20/:\x20','.\x20Valid\x20methods:\x20','\x0aStack\x20trace:\x0a','us01','Invalid\x20API\x20type:\x20','isArray','9YfJHdT','6390568jnGnXU','log','DELETE','66964iexvbq','414EMxYzO','file','stack','59017BQQZXi','site','indexOf','length','noColor','name','Invalid\x20HTTP\x20method:\x20','authorization','includes','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','.\x20Valid\x20types:\x20','toUpperCase','api','header','execute','workflow','method','cdp','set-cookie','Results\x20saved\x20to\x20','trino','startsWith','trim','set-cookie2','output','7940jagfow','x-auth-token'];a6_0x42d6=function(){return _0x47f26c;};return a6_0x42d6();}const SENSITIVE_HEADERS=new Set([a6_0x18eaad(0x1f9),a6_0x18eaad(0x1dc),a6_0x18eaad(0x1ce),a6_0x18eaad(0x204),a6_0x18eaad(0x209),a6_0x18eaad(0x1e2),a6_0x18eaad(0x1c4),a6_0x18eaad(0x1cd)]);function isSensitiveHeader(_0x1a9be9){const _0x237ac4=a6_0x18eaad;return SENSITIVE_HEADERS[_0x237ac4(0x1cc)](_0x1a9be9[_0x237ac4(0x1e0)]());}function parseHeader(_0x12129c){const _0x416fb8=a6_0x18eaad,_0x37b457=_0x12129c[_0x416fb8(0x1f4)](':');if(_0x37b457===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x12129c+_0x416fb8(0x1d5)+_0x416fb8(0x1c6));const _0x3996d7=_0x12129c['substring'](0x0,_0x37b457)[_0x416fb8(0x208)](),_0x7c2376=_0x12129c[_0x416fb8(0x1d7)](_0x37b457+0x1)[_0x416fb8(0x208)]();if(!_0x3996d7)throw new Error(_0x416fb8(0x1fb)+_0x12129c+'\x22');return[_0x3996d7,_0x7c2376];}export class ApiCommand extends BaseCommand{[a6_0x18eaad(0x1f7)]=a6_0x18eaad(0x1fe);['description']='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';['validate'](_0x37803b){const _0x239d24=a6_0x18eaad,{args:_0x5ca335,options:_0xcbfb90}=_0x37803b,_0x32ed45=_0xcbfb90;if(_0x5ca335[_0x239d24(0x1f5)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x48d515=_0x5ca335[0x0];if(!_0x48d515[_0x239d24(0x207)]('/'))return _0x239d24(0x1e4)+_0x48d515;const _0x166098=_0x32ed45[_0x239d24(0x1e1)],_0x2e9280=_0x32ed45[_0x239d24(0x1f0)];if(_0x166098&&_0x2e9280)return _0x239d24(0x1cb);const _0x224a32=_0x32ed45[_0x239d24(0x202)]||_0x239d24(0x1c7),_0x56fa1b=['GET','POST',_0x239d24(0x1da),_0x239d24(0x1ed),'PATCH'];if(!_0x56fa1b[_0x239d24(0x1fa)](_0x224a32[_0x239d24(0x1fd)]()))return _0x239d24(0x1f8)+_0x224a32+_0x239d24(0x1e5)+_0x56fa1b['join'](',\x20');const _0x136535=_0x32ed45['type']||'td',_0x2b49a6=['td',_0x239d24(0x203),_0x239d24(0x201),_0x239d24(0x206),'llm',_0x239d24(0x1dd),_0x239d24(0x1c8)];if(!_0x2b49a6[_0x239d24(0x1fa)](_0x136535))return _0x239d24(0x1e8)+_0x136535+_0x239d24(0x1fc)+_0x2b49a6[_0x239d24(0x1c9)](',\x20');return undefined;}async[a6_0x18eaad(0x200)](_0x406a35){const _0x4d7070=a6_0x18eaad,{options:_0x501568,args:_0x3d5aa7,tdx:_0x1ec3c9}=_0x406a35,_0x5dd354=_0x501568,_0x124e30=_0x3d5aa7[0x0],_0x524bc9=(_0x5dd354['method']||_0x4d7070(0x1c7))['toUpperCase'](),_0x309889=_0x5dd354[_0x4d7070(0x1e1)],_0xdb38f2=_0x5dd354[_0x4d7070(0x1f0)],_0x5c23ac=_0x5dd354[_0x4d7070(0x1ff)],_0x20c4c1=_0x5dd354[_0x4d7070(0x1cf)]||'td';try{const _0x32cc7c={};if(_0x5c23ac){const _0x140d43=Array[_0x4d7070(0x1e9)](_0x5c23ac)?_0x5c23ac:[_0x5c23ac];for(const _0x1bf9f5 of _0x140d43){const [_0x597781,_0x20fbdb]=parseHeader(_0x1bf9f5);_0x32cc7c[_0x597781]=_0x20fbdb;}}let _0x57e04a;if(_0x309889)_0x57e04a=_0x309889;else{if(_0xdb38f2)try{_0x57e04a=RawAPI['readBodyFromFile'](_0xdb38f2);}catch(_0x575515){return console['error'](_0x4d7070(0x1db)+(_0x575515 instanceof Error?_0x575515['message']:String(_0x575515))),0x1;}}const _0x2330c1={'method':_0x524bc9,'apiType':_0x20c4c1,'includeHeaders':_0x501568[_0x4d7070(0x1d0)]};_0x57e04a&&(_0x2330c1[_0x4d7070(0x1df)]=_0x57e04a);Object['keys'](_0x32cc7c)[_0x4d7070(0x1f5)]>0x0&&(_0x2330c1[_0x4d7070(0x1d9)]=_0x32cc7c);if(_0x501568[_0x4d7070(0x1d0)]){const _0x416060=resolveSite(_0x501568[_0x4d7070(0x1f3)]??_0x4d7070(0x1e7)),_0xf69d49=getEndpoint(_0x416060,_0x20c4c1),_0x377134=''+_0xf69d49+_0x124e30;console[_0x4d7070(0x1e3)]('>\x20'+_0x524bc9+'\x20'+_0x377134);const _0x487efb=getAuthHeaders(_0x416060),_0x18f8a4={..._0x487efb,..._0x32cc7c};for(const [_0xa037fc,_0x25dd0e]of Object['entries'](_0x18f8a4)){!isSensitiveHeader(_0xa037fc)&&console['error']('>\x20'+_0xa037fc+':\x20'+_0x25dd0e);}_0x57e04a&&console['error']('>'),console[_0x4d7070(0x1e3)]('');}const _0x32cfec=await _0x1ec3c9['api']['request'](_0x124e30,_0x2330c1);if(_0x501568[_0x4d7070(0x1d0)]&&_0x32cfec[_0x4d7070(0x1d9)]){console['error'](_0x4d7070(0x1d2)+_0x32cfec[_0x4d7070(0x1d6)]);for(const [_0x215ba9,_0x127ab1]of Object['entries'](_0x32cfec[_0x4d7070(0x1d9)])){!isSensitiveHeader(_0x215ba9)&&console[_0x4d7070(0x1e3)]('<\x20'+_0x215ba9+':\x20'+_0x127ab1);}console['error']('');}const _0xc1b384=Boolean(_0x501568[_0x4d7070(0x20a)]),_0x5baa26={'color':_0x501568['color'],'noColor':_0x501568[_0x4d7070(0x1f6)]||_0xc1b384&&!_0x501568[_0x4d7070(0x1d8)]},_0x23b73c=colorizeJSON(_0x32cfec['data'],_0x5baa26);return _0x501568[_0x4d7070(0x20a)]?(writeFileSync(_0x501568[_0x4d7070(0x20a)],_0x23b73c),console[_0x4d7070(0x1e3)](_0x4d7070(0x205)+_0x501568[_0x4d7070(0x20a)])):console[_0x4d7070(0x1ec)](_0x23b73c),0x0;}catch(_0x320288){return _0x320288 instanceof Error?(console[_0x4d7070(0x1e3)](_0x4d7070(0x1db)+_0x320288[_0x4d7070(0x1c5)]),_0x501568[_0x4d7070(0x1d0)]&&_0x320288[_0x4d7070(0x1f1)]&&console[_0x4d7070(0x1e3)](_0x4d7070(0x1e6)+_0x320288[_0x4d7070(0x1f1)])):console['error'](_0x4d7070(0x1db)+String(_0x320288)),0x1;}}}
@@ -1 +1 @@
1
- function a7_0x1b6b(){const _0x11edb5=['\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','Sign\x20in\x20with\x20browser\x20(recommended)','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','\x27\x20registered','profile','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','apiKey','message','Setting\x20up\x20authentication\x20for\x20site:\x20','tdx:\x20auth\x20clear','2544230TvAkoP','logLevel','auth:setup','jobs','/app/mp/ak','\x20\x20tdx','us01','all','You\x20can\x20find\x20your\x20API\x20key\x20at:','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','✗\x20Validation\x20failed:\x20','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','getUserInfo','Name:\x20','cyan','yellow','29577eimzGC','red','No\x20credential\x20found','/users/initiate_sso\x20(account:\x20','\x20and\x20','Opening\x20browser\x20for\x20authentication...','\x20(profile:\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','\x20\x20user_id:','auth','✓\x20Profile\x20\x27','select','Use\x20an\x20API\x20key','bold','537345YGCAdj','Choose\x20how\x20to\x20sign\x20in:','auth:clear','error','For\x20scripts\x20or\x20headless\x20servers','Validating\x20API\x20key...','method','2996040Fazytf','Validating\x20OAuth\x20tokens...','User:\x20','Setup\x20cancelled','password','first_name','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','last_name','System\x20keychain\x20is\x20not\x20available','/oauth/authorize','Print\x20the\x20current\x20OAuth\x20access\x20token','No\x20credentials\x20found\x20in\x20keychain','email','Credential\x20type:\x20OAuth','API\x20key\x20cannot\x20be\x20empty','OAuth\x20tokens','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','\x20--profile\x20','oauth','name','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','execute','tdx:\x20auth\x20setup','2556631RAdVsk','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','filter','\x20(site:\x20','✓\x20Authentication\x20successful\x0a','accountName','status','Remove\x20API\x20key\x20from\x20system\x20keychain','join','apikey','1130GgKWdh','green','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','Read\x20credential\x20from\x20','\x0aSetup\x20cancelled','N/A','\x20for\x20profile:\x20','trim','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','ERROR','site','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','✓\x20Default\x20site\x20set\x20to\x20','1384524ETkisK','access_token','create','auth:token','API\x20key','✓\x20Signed\x20in\x20successfully','description','warn','\x20\x20(','log','1968VeRjKg','6cHkVNe'];a7_0x1b6b=function(){return _0x11edb5;};return a7_0x1b6b();}const a7_0x42bd4e=a7_0x4d33;(function(_0x12404f,_0x388b69){const _0x8620db=a7_0x4d33,_0xf8ff1b=_0x12404f();while(!![]){try{const _0x2227f9=-parseInt(_0x8620db(0x89))/0x1+parseInt(_0x8620db(0xc0))/0x2*(parseInt(_0x8620db(0x6c))/0x3)+-parseInt(_0x8620db(0xcd))/0x4+-parseInt(_0x8620db(0x79))/0x5*(parseInt(_0x8620db(0x6d))/0x6)+parseInt(_0x8620db(0xb6))/0x7+parseInt(_0x8620db(0x9e))/0x8+parseInt(_0x8620db(0x97))/0x9;if(_0x2227f9===_0x388b69)break;else _0xf8ff1b['push'](_0xf8ff1b['shift']());}catch(_0x192d96){_0xf8ff1b['push'](_0xf8ff1b['shift']());}}}(a7_0x1b6b,0x45b59));import{BaseCommand,printAuthError}from'./command.js';import{resolveOAuthAccessToken}from'../sdk/auth-token.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_0x3d0940 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_0x9e0d82 from'chalk';export async function runOAuthLoginFlow(_0x41339c,_0x29f0da,_0x109c68,_0x2c9ba4){const _0x10bcfb=a7_0x4d33,_0x2cc274=await isKeychainAvailable();if(!_0x2cc274)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+_0x10bcfb(0x70));let _0xfe6955=_0x2c9ba4?.[_0x10bcfb(0xbb)];if(!_0xfe6955){const _0x18b18e=await a7_0x3d0940({'type':'text','name':'accountName','message':_0x10bcfb(0x71)});if(_0x18b18e['accountName']===undefined)throw new Error(_0x10bcfb(0xa1));_0xfe6955=_0x18b18e[_0x10bcfb(0xbb)][_0x10bcfb(0xc7)]()||undefined;}const _0x5542f2=getConsoleUrl(_0x41339c);console[_0x10bcfb(0x6b)](_0x10bcfb(0x8e));_0xfe6955?console[_0x10bcfb(0x6b)]('\x20\x20'+_0x5542f2+_0x10bcfb(0x8c)+_0xfe6955+')'):console[_0x10bcfb(0x6b)]('\x20\x20'+_0x5542f2+_0x10bcfb(0xa8));console['log'](_0x10bcfb(0xc2));const _0x2f1a67=loadGlobalProxy()||process.env.HTTPS_PROXY||process.env.HTTP_PROXY,_0x30ef48=await startOAuthFlow(_0x41339c,{'accountName':_0xfe6955,'proxy':_0x2f1a67});console[_0x10bcfb(0x6b)](_0x10bcfb(0x9f));const _0x4807bb=TDX[_0x10bcfb(0xcf)]({'site':_0x41339c,'accessToken':_0x30ef48[_0x10bcfb(0xce)],'logLevel':_0x109c68??LogLevel['ERROR']}),_0x6f4b94=await _0x4807bb[_0x10bcfb(0x7c)][_0x10bcfb(0x85)]();console[_0x10bcfb(0x6b)](a7_0x9e0d82[_0x10bcfb(0xc1)](_0x10bcfb(0x67))),console[_0x10bcfb(0x6b)]('\x20\x20'+a7_0x9e0d82[_0x10bcfb(0x87)](_0x41339c+':'+_0x6f4b94['account_id'])+_0x10bcfb(0x91)+_0x6f4b94['id']+_0x10bcfb(0x6a)+_0x6f4b94['email']+')');!_0xfe6955&&(console['log'](a7_0x9e0d82['dim'](_0x10bcfb(0x6e))),console[_0x10bcfb(0x6b)](a7_0x9e0d82['dim'](_0x10bcfb(0x74))),console[_0x10bcfb(0x6b)](a7_0x9e0d82['dim'](_0x10bcfb(0xaf))));await saveOAuthTokens(_0x30ef48,_0x29f0da),console[_0x10bcfb(0x6b)](_0x10bcfb(0xa5)+(_0x29f0da?_0x10bcfb(0x8f)+_0x29f0da+')':''));if(_0x29f0da){const _0x5c7266={'site':_0x41339c};saveProfileToUserConfig(_0x29f0da,_0x5c7266),console[_0x10bcfb(0x6b)](_0x10bcfb(0x93)+_0x29f0da+_0x10bcfb(0x72));}else saveDefaultSiteToUserConfig(_0x41339c),console['log'](_0x10bcfb(0xcc)+_0x41339c);const _0x5de05b=_0x29f0da?'\x20--profile\x20'+_0x29f0da:'';console[_0x10bcfb(0x6b)](),console[_0x10bcfb(0x6b)](_0x10bcfb(0x82)),console['log'](_0x10bcfb(0x7e)+_0x5de05b+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x10bcfb(0x6b)](_0x10bcfb(0x7e)+_0x5de05b+_0x10bcfb(0x90));}function a7_0x4d33(_0xf18cd4,_0x3f9975){_0xf18cd4=_0xf18cd4-0x66;const _0x1b6b09=a7_0x1b6b();let _0x4d334e=_0x1b6b09[_0xf18cd4];return _0x4d334e;}export async function promptAuthMethod(){const _0x391a10=a7_0x4d33,_0xeb5a92=await a7_0x3d0940({'type':_0x391a10(0x94),'name':_0x391a10(0x9d),'message':_0x391a10(0x98),'choices':[{'title':_0x391a10(0x6f),'description':_0x391a10(0xb7),'value':'oauth'},{'title':_0x391a10(0x95),'description':_0x391a10(0x9b),'value':_0x391a10(0xbf)}]});return _0xeb5a92[_0x391a10(0x9d)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x42bd4e(0xb2)]=a7_0x42bd4e(0x7b);[a7_0x42bd4e(0x68)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x42bd4e(0xb4)](_0x494e8d){const _0x48f354=a7_0x42bd4e,{options:_0xbf79ab}=_0x494e8d,_0x119e1d=_0xbf79ab[_0x48f354(0x73)];console[_0x48f354(0x6b)](a7_0x9e0d82['bold'](_0x48f354(0xb5)));const _0xee8aaa=_0xbf79ab[_0x48f354(0xca)]||_0x48f354(0x7f),_0x505a2b=await promptSiteSelection(_0xee8aaa,_0x119e1d,_0x48f354(0xa1));if(!_0x505a2b)return 0x1;const _0x1263ef=resolveSite(_0x505a2b),_0x2b3942=await promptAuthMethod();if(!_0x2b3942)return console['log'](_0x48f354(0xc4)),0x1;if(_0x2b3942===_0x48f354(0xb1)){const {accountName:_0x1aa189}=_0xbf79ab;return await runOAuthLoginFlow(_0x1263ef,_0x119e1d,_0xbf79ab[_0x48f354(0x7a)]??LogLevel[_0x48f354(0xc9)],{'accountName':_0x1aa189}),0x0;}console[_0x48f354(0x6b)](_0x48f354(0x77)+_0x1263ef),console['log'](_0x48f354(0x81)),console[_0x48f354(0x6b)]('\x20\x20'+getConsoleUrl(_0x1263ef,_0x48f354(0x7d)));const _0x52b6e9=await a7_0x3d0940({'type':_0x48f354(0xa2),'name':_0x48f354(0x75),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x5f3f06=>{const _0x152108=_0x48f354;if(!_0x5f3f06||!_0x5f3f06[_0x152108(0xc7)]())return _0x152108(0xad);return!![];}});if(!_0x52b6e9[_0x48f354(0x75)])return console[_0x48f354(0x6b)](_0x48f354(0xc4)),0x1;const _0x2903ba=_0x52b6e9[_0x48f354(0x75)];console['log'](_0x48f354(0x9c));try{const _0x2f8343=TDX[_0x48f354(0xcf)]({'site':_0x1263ef,'apiKey':_0x2903ba[_0x48f354(0xc7)](),'logLevel':_0xbf79ab[_0x48f354(0x7a)]??LogLevel[_0x48f354(0xc9)]}),_0x153fc6=await _0x2f8343['jobs'][_0x48f354(0x85)]();console[_0x48f354(0x6b)](_0x48f354(0xcb)+_0x153fc6[_0x48f354(0xab)]+')');const _0x2c9456=await isKeychainAvailable();_0x2c9456?(await saveAPIKeyAsync(_0x2903ba[_0x48f354(0xc7)](),_0x1263ef,_0x119e1d),console[_0x48f354(0x6b)](_0x48f354(0xc8)+(_0x119e1d?_0x48f354(0x8f)+_0x119e1d+')':''))):(console[_0x48f354(0x69)](a7_0x9e0d82['yellow']('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console['warn'](a7_0x9e0d82['yellow'](_0x48f354(0x84))));if(_0x119e1d){const _0xdd8811={'site':_0x1263ef};saveProfileToUserConfig(_0x119e1d,_0xdd8811),console[_0x48f354(0x6b)](_0x48f354(0x93)+_0x119e1d+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x1263ef),console['log'](_0x48f354(0xcc)+_0x1263ef);const _0x323ba8=_0x119e1d?_0x48f354(0xb0)+_0x119e1d:'';return console['log'](),console[_0x48f354(0x6b)](_0x48f354(0x82)),console[_0x48f354(0x6b)](_0x48f354(0x7e)+_0x323ba8+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x48f354(0x6b)](_0x48f354(0x7e)+_0x323ba8+_0x48f354(0x90)),0x0;}catch(_0x5a5c01){if(_0x5a5c01 instanceof HTTPClientError&&_0x5a5c01[_0x48f354(0xbc)]===0x191)return printAuthError(_0x5a5c01),0x1;return console[_0x48f354(0x9a)](a7_0x9e0d82[_0x48f354(0x8a)](_0x48f354(0x83)+(_0x5a5c01 instanceof Error?_0x5a5c01[_0x48f354(0x76)]:String(_0x5a5c01)))),console[_0x48f354(0x9a)](_0x48f354(0xb3)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x42bd4e(0xb2)]=a7_0x42bd4e(0x92);['description']=a7_0x42bd4e(0xa4);async['execute'](_0x2bbc3f){const _0x887826=a7_0x42bd4e,{options:_0x313548,tdx:_0x1f42a7}=_0x2bbc3f,_0x1b75d0=_0x313548[_0x887826(0xca)],_0x4eb0c4=_0x313548['profile'],_0x3136c5=_0x4eb0c4?_0x4eb0c4:_0x887826(0xc5);console[_0x887826(0x6b)]('tdx\x20profile:\x20'+_0x3136c5+_0x887826(0xb9)+_0x1b75d0+')');const _0x48903c=await getOAuthTokens(_0x4eb0c4);if(_0x48903c)console[_0x887826(0x6b)](_0x887826(0xac)),console[_0x887826(0x6b)]('Read\x20credential\x20from\x20keychain'+(_0x4eb0c4?_0x887826(0x8f)+_0x4eb0c4+')':''));else{const _0x302f74=await resolveAPIKeyAsync(_0x1b75d0,_0x4eb0c4);if(_0x302f74){const {source:_0x64e039,isDeprecated:_0x1047fa}=_0x302f74,_0x4022d9=_0x887826(0xc3)+_0x64e039;console[_0x887826(0x6b)](_0x1047fa?a7_0x9e0d82['yellow'](_0x4022d9):_0x4022d9);}else console[_0x887826(0x6b)](a7_0x9e0d82[_0x887826(0x88)](_0x887826(0x8b)));}try{const _0x3366ae=await _0x1f42a7[_0x887826(0x7c)][_0x887826(0x85)]();return console[_0x887826(0x6b)](a7_0x9e0d82['green'](_0x887826(0xba))),console[_0x887826(0x6b)](_0x887826(0xa0)+_0x3366ae['email']),(_0x3366ae[_0x887826(0xa3)]||_0x3366ae[_0x887826(0xa6)])&&console[_0x887826(0x6b)](_0x887826(0x86)+[_0x3366ae[_0x887826(0xa3)],_0x3366ae[_0x887826(0xa6)]][_0x887826(0xb8)](Boolean)[_0x887826(0xbe)]('\x20')),0x0;}catch(_0x152637){return _0x152637 instanceof HTTPClientError&&_0x152637[_0x887826(0xbc)]===0x191?printAuthError(_0x152637,!![],_0x4eb0c4):console[_0x887826(0x9a)](a7_0x9e0d82[_0x887826(0x8a)](_0x887826(0x83)+(_0x152637 instanceof Error?_0x152637['message']:String(_0x152637)))),0x1;}}}export class AuthTokenCommand extends BaseCommand{[a7_0x42bd4e(0xb2)]=a7_0x42bd4e(0xd0);['description']=a7_0x42bd4e(0xa9);async['execute'](_0x22af48){const _0x5dce7a=a7_0x42bd4e,{options:_0x2bb805}=_0x22af48,_0x3f793f=await resolveOAuthAccessToken({'site':resolveSite(_0x2bb805['site']||_0x5dce7a(0x7f)),'profile':_0x2bb805[_0x5dce7a(0x73)],'proxy':loadGlobalProxy()});return console['log'](_0x3f793f),0x0;}}export class AuthClearCommand extends BaseCommand{[a7_0x42bd4e(0xb2)]=a7_0x42bd4e(0x99);[a7_0x42bd4e(0x68)]=a7_0x42bd4e(0xbd);async[a7_0x42bd4e(0xb4)](_0x3f3900){const _0x36dd51=a7_0x42bd4e,{options:_0x53c158}=_0x3f3900,_0x35895a=_0x53c158[_0x36dd51(0x73)];console[_0x36dd51(0x6b)](a7_0x9e0d82[_0x36dd51(0x96)](_0x36dd51(0x78)));const _0x232d58=await isKeychainAvailable();if(!_0x232d58)return console[_0x36dd51(0x9a)](a7_0x9e0d82[_0x36dd51(0x8a)](_0x36dd51(0xa7))),0x1;const [_0xd4e1fc,_0x40271c]=await Promise[_0x36dd51(0x80)]([deleteKeychainAPIKey(_0x35895a),deleteOAuthTokens(_0x35895a)]);if(_0xd4e1fc||_0x40271c){clearCredentialCache();const _0x4b6b98=[_0xd4e1fc&&_0x36dd51(0x66),_0x40271c&&_0x36dd51(0xae)][_0x36dd51(0xb8)](Boolean)[_0x36dd51(0xbe)](_0x36dd51(0x8d));return console[_0x36dd51(0x6b)]('✓\x20'+_0x4b6b98+'\x20removed\x20from\x20keychain'+(_0x35895a?_0x36dd51(0x8f)+_0x35895a+')':'')),0x0;}else return console[_0x36dd51(0x6b)](_0x36dd51(0xaa)+(_0x35895a?_0x36dd51(0xc6)+_0x35895a:'')),0x1;}}
1
+ const a7_0x1d644f=a7_0x2646;(function(_0x37cf1e,_0x1619e1){const _0xb90657=a7_0x2646,_0x543f36=_0x37cf1e();while(!![]){try{const _0x4cb246=-parseInt(_0xb90657(0x146))/0x1*(-parseInt(_0xb90657(0x14a))/0x2)+parseInt(_0xb90657(0x159))/0x3+parseInt(_0xb90657(0x138))/0x4*(-parseInt(_0xb90657(0x122))/0x5)+parseInt(_0xb90657(0x13a))/0x6*(parseInt(_0xb90657(0x10c))/0x7)+parseInt(_0xb90657(0x14d))/0x8*(-parseInt(_0xb90657(0x131))/0x9)+-parseInt(_0xb90657(0xff))/0xa*(parseInt(_0xb90657(0x154))/0xb)+parseInt(_0xb90657(0x111))/0xc*(parseInt(_0xb90657(0x134))/0xd);if(_0x4cb246===_0x1619e1)break;else _0x543f36['push'](_0x543f36['shift']());}catch(_0x55a7c2){_0x543f36['push'](_0x543f36['shift']());}}}(a7_0x5283,0x558c5));import{BaseCommand,printAuthError}from'./command.js';import{resolveOAuthAccessToken}from'../sdk/auth-token.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync,loadGlobalProxy}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';function a7_0x2646(_0x8462ea,_0x4b8d43){_0x8462ea=_0x8462ea-0xf7;const _0x528397=a7_0x5283();let _0x2646ec=_0x528397[_0x8462ea];return _0x2646ec;}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_0x10216a 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_0x34a050 from'chalk';export async function runOAuthLoginFlow(_0x27dc01,_0x4640ad,_0xbfad41,_0x1931ae){const _0x4faf9b=a7_0x2646,_0x1c1014=await isKeychainAvailable();if(!_0x1c1014)throw new Error(_0x4faf9b(0x130)+_0x4faf9b(0x160));let _0x4aaf11=_0x1931ae?.[_0x4faf9b(0x149)];if(!_0x4aaf11){const _0xb42c5c=await a7_0x10216a({'type':_0x4faf9b(0x151),'name':_0x4faf9b(0x149),'message':_0x4faf9b(0x127)});if(_0xb42c5c[_0x4faf9b(0x149)]===undefined)throw new Error(_0x4faf9b(0x14c));_0x4aaf11=_0xb42c5c[_0x4faf9b(0x149)][_0x4faf9b(0x12e)]()||undefined;}const _0x4ba376=getConsoleUrl(_0x27dc01);console[_0x4faf9b(0x120)](_0x4faf9b(0x11c));_0x4aaf11?console[_0x4faf9b(0x120)]('\x20\x20'+_0x4ba376+_0x4faf9b(0x148)+_0x4aaf11+')'):console['log']('\x20\x20'+_0x4ba376+_0x4faf9b(0x115));console[_0x4faf9b(0x120)](_0x4faf9b(0x150));const _0x28f8b8=loadGlobalProxy()||process.env.HTTPS_PROXY||process.env.HTTP_PROXY,_0x5181eb=await startOAuthFlow(_0x27dc01,{'accountName':_0x4aaf11,'proxy':_0x28f8b8});console[_0x4faf9b(0x120)](_0x4faf9b(0x158));const _0x25eac3=TDX[_0x4faf9b(0x136)]({'site':_0x27dc01,'accessToken':_0x5181eb[_0x4faf9b(0x13f)],'logLevel':_0xbfad41??LogLevel[_0x4faf9b(0x13e)]}),_0x4bc0c2=await _0x25eac3['jobs'][_0x4faf9b(0x106)]();console[_0x4faf9b(0x120)](a7_0x34a050[_0x4faf9b(0x144)](_0x4faf9b(0x107))),console[_0x4faf9b(0x120)]('\x20\x20'+a7_0x34a050['cyan'](_0x27dc01+':'+_0x4bc0c2[_0x4faf9b(0x10b)])+_0x4faf9b(0x114)+_0x4bc0c2['id']+_0x4faf9b(0xfc)+_0x4bc0c2[_0x4faf9b(0x137)]+')');!_0x4aaf11&&(console[_0x4faf9b(0x120)](a7_0x34a050[_0x4faf9b(0x153)](_0x4faf9b(0x141))),console[_0x4faf9b(0x120)](a7_0x34a050[_0x4faf9b(0x153)](_0x4faf9b(0x132))),console[_0x4faf9b(0x120)](a7_0x34a050[_0x4faf9b(0x153)](_0x4faf9b(0x152))));await saveOAuthTokens(_0x5181eb,_0x4640ad),console['log'](_0x4faf9b(0x128)+(_0x4640ad?_0x4faf9b(0x126)+_0x4640ad+')':''));if(_0x4640ad){const _0x27cf69={'site':_0x27dc01};saveProfileToUserConfig(_0x4640ad,_0x27cf69),console[_0x4faf9b(0x120)](_0x4faf9b(0x135)+_0x4640ad+_0x4faf9b(0x125));}else saveDefaultSiteToUserConfig(_0x27dc01),console['log'](_0x4faf9b(0x124)+_0x27dc01);const _0x3e9a0d=_0x4640ad?_0x4faf9b(0x163)+_0x4640ad:'';console[_0x4faf9b(0x120)](),console['log'](_0x4faf9b(0x11e)),console[_0x4faf9b(0x120)]('\x20\x20tdx'+_0x3e9a0d+_0x4faf9b(0x10d)),console[_0x4faf9b(0x120)](_0x4faf9b(0x145)+_0x3e9a0d+_0x4faf9b(0x12a));}export async function promptAuthMethod(){const _0x2d9933=a7_0x2646,_0x355406=await a7_0x10216a({'type':_0x2d9933(0x155),'name':'method','message':_0x2d9933(0x13b),'choices':[{'title':_0x2d9933(0x116),'description':_0x2d9933(0xfe),'value':_0x2d9933(0x156)},{'title':'Use\x20an\x20API\x20key','description':_0x2d9933(0x15a),'value':_0x2d9933(0x108)}]});return _0x355406[_0x2d9933(0x110)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x1d644f(0x15c)]=a7_0x1d644f(0x117);[a7_0x1d644f(0x12d)]=a7_0x1d644f(0x143);async[a7_0x1d644f(0x11f)](_0x40b266){const _0x30fd9f=a7_0x1d644f,{options:_0x296b16}=_0x40b266,_0x313d11=_0x296b16[_0x30fd9f(0x140)];console[_0x30fd9f(0x120)](a7_0x34a050[_0x30fd9f(0x10a)](_0x30fd9f(0x112)));const _0x41a660=_0x296b16['site']||'us01',_0x26fe76=await promptSiteSelection(_0x41a660,_0x313d11,_0x30fd9f(0x14c));if(!_0x26fe76)return 0x1;const _0x6215dc=resolveSite(_0x26fe76),_0x1217ee=await promptAuthMethod();if(!_0x1217ee)return console[_0x30fd9f(0x120)]('\x0aSetup\x20cancelled'),0x1;if(_0x1217ee===_0x30fd9f(0x156)){const {accountName:_0x32af66}=_0x296b16;return await runOAuthLoginFlow(_0x6215dc,_0x313d11,_0x296b16[_0x30fd9f(0x109)]??LogLevel[_0x30fd9f(0x13e)],{'accountName':_0x32af66}),0x0;}console[_0x30fd9f(0x120)](_0x30fd9f(0x104)+_0x6215dc),console[_0x30fd9f(0x120)](_0x30fd9f(0x15b)),console[_0x30fd9f(0x120)]('\x20\x20'+getConsoleUrl(_0x6215dc,_0x30fd9f(0xfb)));const _0x42ddd5=await a7_0x10216a({'type':_0x30fd9f(0x123),'name':_0x30fd9f(0xfa),'message':_0x30fd9f(0xf7),'validate':_0x130bd3=>{if(!_0x130bd3||!_0x130bd3['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x42ddd5[_0x30fd9f(0xfa)])return console[_0x30fd9f(0x120)]('\x0aSetup\x20cancelled'),0x1;const _0x573f12=_0x42ddd5[_0x30fd9f(0xfa)];console['log'](_0x30fd9f(0x14f));try{const _0x5f5b5b=TDX[_0x30fd9f(0x136)]({'site':_0x6215dc,'apiKey':_0x573f12['trim'](),'logLevel':_0x296b16[_0x30fd9f(0x109)]??LogLevel[_0x30fd9f(0x13e)]}),_0x35efc0=await _0x5f5b5b[_0x30fd9f(0xf9)][_0x30fd9f(0x106)]();console[_0x30fd9f(0x120)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x35efc0[_0x30fd9f(0x137)]+')');const _0x296084=await isKeychainAvailable();_0x296084?(await saveAPIKeyAsync(_0x573f12[_0x30fd9f(0x12e)](),_0x6215dc,_0x313d11),console[_0x30fd9f(0x120)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x313d11?'\x20(profile:\x20'+_0x313d11+')':''))):(console['warn'](a7_0x34a050[_0x30fd9f(0x129)](_0x30fd9f(0x15d))),console[_0x30fd9f(0x161)](a7_0x34a050[_0x30fd9f(0x129)](_0x30fd9f(0x103))));if(_0x313d11){const _0x4de2ce={'site':_0x6215dc};saveProfileToUserConfig(_0x313d11,_0x4de2ce),console[_0x30fd9f(0x120)](_0x30fd9f(0x135)+_0x313d11+_0x30fd9f(0x125));}else saveDefaultSiteToUserConfig(_0x6215dc),console[_0x30fd9f(0x120)](_0x30fd9f(0x124)+_0x6215dc);const _0xb1ea0e=_0x313d11?_0x30fd9f(0x163)+_0x313d11:'';return console[_0x30fd9f(0x120)](),console[_0x30fd9f(0x120)](_0x30fd9f(0x11e)),console[_0x30fd9f(0x120)](_0x30fd9f(0x145)+_0xb1ea0e+_0x30fd9f(0x10d)),console[_0x30fd9f(0x120)](_0x30fd9f(0x145)+_0xb1ea0e+_0x30fd9f(0x12a)),0x0;}catch(_0x463de9){if(_0x463de9 instanceof HTTPClientError&&_0x463de9[_0x30fd9f(0x100)]===0x191)return printAuthError(_0x463de9),0x1;return console[_0x30fd9f(0x164)](a7_0x34a050[_0x30fd9f(0x11a)](_0x30fd9f(0x13d)+(_0x463de9 instanceof Error?_0x463de9['message']:String(_0x463de9)))),console['error'](_0x30fd9f(0x121)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x1d644f(0x12f);[a7_0x1d644f(0x12d)]=a7_0x1d644f(0x14e);async[a7_0x1d644f(0x11f)](_0x4af955){const _0x55da2a=a7_0x1d644f,{options:_0xe3369b,tdx:_0x4a1975}=_0x4af955,_0x3e859b=_0xe3369b[_0x55da2a(0x118)],_0x2fec97=_0xe3369b[_0x55da2a(0x140)],_0x4065b6=_0x2fec97?_0x2fec97:'N/A';console[_0x55da2a(0x120)](_0x55da2a(0x119)+_0x4065b6+_0x55da2a(0x142)+_0x3e859b+')');const _0x50210b=await getOAuthTokens(_0x2fec97);if(_0x50210b)console['log']('Credential\x20type:\x20OAuth'),console['log']('Read\x20credential\x20from\x20keychain'+(_0x2fec97?_0x55da2a(0x126)+_0x2fec97+')':''));else{const _0x2be4ed=await resolveAPIKeyAsync(_0x3e859b,_0x2fec97);if(_0x2be4ed){const {source:_0x5b564f,isDeprecated:_0x404394}=_0x2be4ed,_0x3e4c2b=_0x55da2a(0x13c)+_0x5b564f;console['log'](_0x404394?a7_0x34a050[_0x55da2a(0x129)](_0x3e4c2b):_0x3e4c2b);}else console[_0x55da2a(0x120)](a7_0x34a050['yellow'](_0x55da2a(0x12c)));}try{const _0x37546d=await _0x4a1975[_0x55da2a(0xf9)]['getUserInfo']();return console[_0x55da2a(0x120)](a7_0x34a050[_0x55da2a(0x144)](_0x55da2a(0x10e))),console[_0x55da2a(0x120)]('User:\x20'+_0x37546d['email']),(_0x37546d['first_name']||_0x37546d[_0x55da2a(0x157)])&&console[_0x55da2a(0x120)](_0x55da2a(0x14b)+[_0x37546d[_0x55da2a(0xf8)],_0x37546d[_0x55da2a(0x157)]]['filter'](Boolean)[_0x55da2a(0x11d)]('\x20')),0x0;}catch(_0x3425b2){return _0x3425b2 instanceof HTTPClientError&&_0x3425b2[_0x55da2a(0x100)]===0x191?printAuthError(_0x3425b2,!![],_0x2fec97):console[_0x55da2a(0x164)](a7_0x34a050[_0x55da2a(0x11a)](_0x55da2a(0x13d)+(_0x3425b2 instanceof Error?_0x3425b2[_0x55da2a(0x133)]:String(_0x3425b2)))),0x1;}}}export class AuthTokenCommand extends BaseCommand{[a7_0x1d644f(0x15c)]='auth:token';[a7_0x1d644f(0x12d)]=a7_0x1d644f(0x12b);async[a7_0x1d644f(0x11f)](_0xb709ef){const _0x24c41e=a7_0x1d644f,{options:_0x4e308d}=_0xb709ef,_0x56b44e=await resolveOAuthAccessToken({'site':resolveSite(_0x4e308d[_0x24c41e(0x118)]||_0x24c41e(0x105)),'profile':_0x4e308d[_0x24c41e(0x140)],'proxy':loadGlobalProxy()});return console[_0x24c41e(0x120)](_0x56b44e),0x0;}}function a7_0x5283(){const _0x58bb38=['first_name','jobs','apiKey','/app/mp/ak','\x20\x20(','filter','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','3681790fSkLxI','status','auth:clear','\x20and\x20','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','Setting\x20up\x20authentication\x20for\x20site:\x20','us01','getUserInfo','✓\x20Signed\x20in\x20successfully','apikey','logLevel','bold','account_id','7VHAFXv','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','✓\x20Authentication\x20successful\x0a','OAuth\x20tokens','method','8796lcQwCX','tdx:\x20auth\x20setup','tdx:\x20auth\x20clear','\x20\x20user_id:','/oauth/authorize','Sign\x20in\x20with\x20browser\x20(recommended)','auth:setup','site','tdx\x20profile:\x20','red','\x20removed\x20from\x20keychain','Opening\x20browser\x20for\x20authentication...','join','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','execute','log','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','15qafwtG','password','✓\x20Default\x20site\x20set\x20to\x20','\x27\x20registered','\x20(profile:\x20','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','yellow','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Print\x20the\x20current\x20OAuth\x20access\x20token','No\x20credential\x20found','description','trim','auth','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','242226KfsYDZ','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','message','4901VEuyJr','✓\x20Profile\x20\x27','create','email','356548gPsNVC','No\x20credentials\x20found\x20in\x20keychain','871530rjSHmb','Choose\x20how\x20to\x20sign\x20in:','Read\x20credential\x20from\x20','✗\x20Validation\x20failed:\x20','ERROR','access_token','profile','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','\x20(site:\x20','Setup\x20API\x20key\x20authentication\x20interactively','green','\x20\x20tdx','6374hbTGjb','all','/users/initiate_sso\x20(account:\x20','accountName','18HwVaHq','Name:\x20','Setup\x20cancelled','48derYrl','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','Validating\x20API\x20key...','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','text','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','dim','11YjCGtx','select','oauth','last_name','Validating\x20OAuth\x20tokens...','2005551xUyWLQ','For\x20scripts\x20or\x20headless\x20servers','You\x20can\x20find\x20your\x20API\x20key\x20at:','name','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','\x20for\x20profile:\x20','System\x20keychain\x20is\x20not\x20available','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','warn','API\x20key','\x20--profile\x20','error','Enter\x20your\x20TD\x20API\x20key:'];a7_0x5283=function(){return _0x58bb38;};return a7_0x5283();}export class AuthClearCommand extends BaseCommand{[a7_0x1d644f(0x15c)]=a7_0x1d644f(0x101);[a7_0x1d644f(0x12d)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x1d644f(0x11f)](_0x34317c){const _0x129501=a7_0x1d644f,{options:_0xbf7f2c}=_0x34317c,_0x1f15e7=_0xbf7f2c[_0x129501(0x140)];console[_0x129501(0x120)](a7_0x34a050[_0x129501(0x10a)](_0x129501(0x113)));const _0x15226e=await isKeychainAvailable();if(!_0x15226e)return console[_0x129501(0x164)](a7_0x34a050[_0x129501(0x11a)](_0x129501(0x15f))),0x1;const [_0x405572,_0x4060f7]=await Promise[_0x129501(0x147)]([deleteKeychainAPIKey(_0x1f15e7),deleteOAuthTokens(_0x1f15e7)]);if(_0x405572||_0x4060f7){clearCredentialCache();const _0x1ea015=[_0x405572&&_0x129501(0x162),_0x4060f7&&_0x129501(0x10f)][_0x129501(0xfd)](Boolean)['join'](_0x129501(0x102));return console['log']('✓\x20'+_0x1ea015+_0x129501(0x11b)+(_0x1f15e7?_0x129501(0x126)+_0x1f15e7+')':'')),0x0;}else return console[_0x129501(0x120)](_0x129501(0x139)+(_0x1f15e7?_0x129501(0x15e)+_0x1f15e7:'')),0x1;}}