@treasuredata/tdx 2026.6.4 → 2026.6.5

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 (241) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/cas-command.js +1 -1
  13. package/dist/commands/cas-segment-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/engage-template-pull-command.js +1 -1
  28. package/dist/commands/engage-template-push-command.js +1 -1
  29. package/dist/commands/engage-template-validate-command.js +1 -1
  30. package/dist/commands/job-command.js +1 -1
  31. package/dist/commands/journey-command.js +1 -1
  32. package/dist/commands/journey-validate-command.js +1 -1
  33. package/dist/commands/llm-command.js +1 -1
  34. package/dist/commands/mcp-command.js +1 -1
  35. package/dist/commands/parent-segment-command.js +1 -1
  36. package/dist/commands/policy-command.js +1 -1
  37. package/dist/commands/profile-command.js +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-command.js +1 -1
  40. package/dist/commands/schedule-command.js +1 -1
  41. package/dist/commands/segment-command.js +1 -1
  42. package/dist/commands/segment-create-command.js +1 -1
  43. package/dist/commands/segment-fields-command.js +1 -1
  44. package/dist/commands/segment-move-command.d.ts +19 -0
  45. package/dist/commands/segment-move-command.d.ts.map +1 -0
  46. package/dist/commands/segment-move-command.js +1 -0
  47. package/dist/commands/segment-move-command.js.map +1 -0
  48. package/dist/commands/segment-pull-command.js +1 -1
  49. package/dist/commands/segment-push-command.js +1 -1
  50. package/dist/commands/segment-update-command.js +1 -1
  51. package/dist/commands/segment-use-command.js +1 -1
  52. package/dist/commands/segment-validate-command.js +1 -1
  53. package/dist/commands/segments.js +1 -1
  54. package/dist/commands/show.js +1 -1
  55. package/dist/commands/status-command.js +1 -1
  56. package/dist/commands/table-deleted.js +1 -1
  57. package/dist/commands/tables.js +1 -1
  58. package/dist/commands/unset-command.js +1 -1
  59. package/dist/commands/upgrade-command.js +1 -1
  60. package/dist/commands/use-command.js +1 -1
  61. package/dist/commands/user-command.js +1 -1
  62. package/dist/commands/work-command.js +1 -1
  63. package/dist/commands/workflow-command.js +1 -1
  64. package/dist/core/auth.js +1 -1
  65. package/dist/core/command-output.js +1 -1
  66. package/dist/core/config.js +1 -1
  67. package/dist/core/connection-cache.js +1 -1
  68. package/dist/core/constants.js +1 -1
  69. package/dist/core/credential-cache.js +1 -1
  70. package/dist/core/global-context.js +1 -1
  71. package/dist/core/keychain.js +1 -1
  72. package/dist/core/oauth-keychain.js +1 -1
  73. package/dist/core/oauth.js +1 -1
  74. package/dist/core/profile.js +1 -1
  75. package/dist/core/project-config.js +1 -1
  76. package/dist/core/session.js +1 -1
  77. package/dist/core/user-cache.js +1 -1
  78. package/dist/core/version.js +1 -1
  79. package/dist/index.js +1 -1
  80. package/dist/mcp/server.js +1 -1
  81. package/dist/mcp/tools/index.js +1 -1
  82. package/dist/mcp/tools/tdx-run.js +1 -1
  83. package/dist/mcp/tools/tdx-search.js +1 -1
  84. package/dist/mcp/tools/work-create-item.js +1 -1
  85. package/dist/mcp/utils.js +1 -1
  86. package/dist/proxy/claude-usage-tracker.js +1 -1
  87. package/dist/proxy/passthrough-server.js +1 -1
  88. package/dist/proxy/sse-usage-parser.js +1 -1
  89. package/dist/sdk/agent/agent-config.js +1 -1
  90. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  91. package/dist/sdk/agent/agent-yaml.js +1 -1
  92. package/dist/sdk/agent/test/evaluator.js +1 -1
  93. package/dist/sdk/agent/test/executor.js +1 -1
  94. package/dist/sdk/agent/test/index.js +1 -1
  95. package/dist/sdk/agent/test/output.js +1 -1
  96. package/dist/sdk/agent/test/parser.js +1 -1
  97. package/dist/sdk/agent/tool-target-registry.js +1 -1
  98. package/dist/sdk/api.js +1 -1
  99. package/dist/sdk/cas/cas-api-client.js +1 -1
  100. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  101. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  102. package/dist/sdk/cas/index.js +1 -1
  103. package/dist/sdk/cas/pull-workflow.js +1 -1
  104. package/dist/sdk/cas/push-workflow.js +1 -1
  105. package/dist/sdk/client/cdp-api-client.d.ts +18 -0
  106. package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
  107. package/dist/sdk/client/cdp-api-client.js +1 -1
  108. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  109. package/dist/sdk/client/delivery-api-client.js +1 -1
  110. package/dist/sdk/client/endpoints.js +1 -1
  111. package/dist/sdk/client/engage-api-client.js +1 -1
  112. package/dist/sdk/client/http-client.js +1 -1
  113. package/dist/sdk/client/llm-api-client.js +1 -1
  114. package/dist/sdk/client/oauth-refresh.js +1 -1
  115. package/dist/sdk/client/rate-limiter.js +1 -1
  116. package/dist/sdk/client/td-api-client.js +1 -1
  117. package/dist/sdk/client/trino-api-client.js +1 -1
  118. package/dist/sdk/client/workflow-client.js +1 -1
  119. package/dist/sdk/connection-validator.js +1 -1
  120. package/dist/sdk/connection.js +1 -1
  121. package/dist/sdk/delivery.js +1 -1
  122. package/dist/sdk/engage/campaign-pull.js +1 -1
  123. package/dist/sdk/engage/campaign-push.js +1 -1
  124. package/dist/sdk/engage/campaign-validator.js +1 -1
  125. package/dist/sdk/engage/campaign-yaml.js +1 -1
  126. package/dist/sdk/engage/template-pull.js +1 -1
  127. package/dist/sdk/engage/template-push.js +1 -1
  128. package/dist/sdk/engage/template-validator.js +1 -1
  129. package/dist/sdk/engage/template-yaml.js +1 -1
  130. package/dist/sdk/engage/types/campaign-def.js +1 -1
  131. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  132. package/dist/sdk/engage/types/template-schema.js +1 -1
  133. package/dist/sdk/engage.js +1 -1
  134. package/dist/sdk/errors.js +1 -1
  135. package/dist/sdk/index.js +1 -1
  136. package/dist/sdk/io/index.js +1 -1
  137. package/dist/sdk/io/node-filesystem.js +1 -1
  138. package/dist/sdk/job.js +1 -1
  139. package/dist/sdk/journey.js +1 -1
  140. package/dist/sdk/llm/chat-cache.js +1 -1
  141. package/dist/sdk/llm/index.js +1 -1
  142. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  143. package/dist/sdk/llm/model-factors.js +1 -1
  144. package/dist/sdk/llm/user-settings.js +1 -1
  145. package/dist/sdk/personalization.js +1 -1
  146. package/dist/sdk/policy.js +1 -1
  147. package/dist/sdk/query/deleted-table-validation.js +1 -1
  148. package/dist/sdk/query/index.js +1 -1
  149. package/dist/sdk/query/sql-parser.js +1 -1
  150. package/dist/sdk/realtime.js +1 -1
  151. package/dist/sdk/schedule.js +1 -1
  152. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  153. package/dist/sdk/segment/fields-display.js +1 -1
  154. package/dist/sdk/segment/file-discovery.js +1 -1
  155. package/dist/sdk/segment/journey-utils.js +1 -1
  156. package/dist/sdk/segment/journey-validator.js +1 -1
  157. package/dist/sdk/segment/journey-yaml.js +1 -1
  158. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  159. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  160. package/dist/sdk/segment/pull-workflow.js +1 -1
  161. package/dist/sdk/segment/push-recovery.js +1 -1
  162. package/dist/sdk/segment/push-workflow.js +1 -1
  163. package/dist/sdk/segment/resolution-context.js +1 -1
  164. package/dist/sdk/segment/segment-path-parser.js +1 -1
  165. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  166. package/dist/sdk/segment/segment-validator.js +1 -1
  167. package/dist/sdk/segment/target-resolution.js +1 -1
  168. package/dist/sdk/segment/tdx-config.js +1 -1
  169. package/dist/sdk/segment/types/activation-schema.js +1 -1
  170. package/dist/sdk/segment/types/journey-def.js +1 -1
  171. package/dist/sdk/segment/types/journey-schema.js +1 -1
  172. package/dist/sdk/segment/types/segment-def.js +1 -1
  173. package/dist/sdk/segment/types/segment-schema.js +1 -1
  174. package/dist/sdk/segment/validate-files.js +1 -1
  175. package/dist/sdk/segment/yaml-validator.js +1 -1
  176. package/dist/sdk/segment.d.ts +28 -1
  177. package/dist/sdk/segment.d.ts.map +1 -1
  178. package/dist/sdk/segment.js +1 -1
  179. package/dist/sdk/segment.js.map +1 -1
  180. package/dist/sdk/types/cdp.d.ts +15 -0
  181. package/dist/sdk/types/cdp.d.ts.map +1 -1
  182. package/dist/sdk/types/index.d.ts +1 -1
  183. package/dist/sdk/types/index.d.ts.map +1 -1
  184. package/dist/sdk/types/index.js +1 -1
  185. package/dist/sdk/types/index.js.map +1 -1
  186. package/dist/sdk/types/progress.js +1 -1
  187. package/dist/sdk/types/workspace.js +1 -1
  188. package/dist/sdk/user.js +1 -1
  189. package/dist/sdk/util/format-detector.js +1 -1
  190. package/dist/sdk/util/formatters.js +1 -1
  191. package/dist/sdk/util/index.js +1 -1
  192. package/dist/sdk/util/paginate.js +1 -1
  193. package/dist/sdk/util/tree-formatter.js +1 -1
  194. package/dist/sdk/workflow/archive-validation.js +1 -1
  195. package/dist/sdk/workflow/clone-workflow.js +1 -1
  196. package/dist/sdk/workflow/index.js +1 -1
  197. package/dist/sdk/workflow/pull-workflow.js +1 -1
  198. package/dist/sdk/workflow/push-workflow.js +1 -1
  199. package/dist/sdk/workflow/task-graph.js +1 -1
  200. package/dist/sdk/workflow/tdx-config.js +1 -1
  201. package/dist/sdk/workflow/workflow-utils.js +1 -1
  202. package/dist/sdk/workspace/access-tracker.js +1 -1
  203. package/dist/sdk/workspace/frontmatter.js +1 -1
  204. package/dist/sdk/workspace/git.js +1 -1
  205. package/dist/sdk/workspace/index.js +1 -1
  206. package/dist/sdk/workspace/templates.js +1 -1
  207. package/dist/sdk/workspace/weekly.js +1 -1
  208. package/dist/sdk/workspace/wikilinks.js +1 -1
  209. package/dist/test-utils/command-runner.js +1 -1
  210. package/dist/test-utils/factories.js +1 -1
  211. package/dist/test-utils/fixtures.js +1 -1
  212. package/dist/test-utils/http-mock.js +1 -1
  213. package/dist/test-utils/index.js +1 -1
  214. package/dist/utils/async.js +1 -1
  215. package/dist/utils/colors.js +1 -1
  216. package/dist/utils/diff.js +1 -1
  217. package/dist/utils/file-permissions.js +1 -1
  218. package/dist/utils/file-reader.js +1 -1
  219. package/dist/utils/github-releases.js +1 -1
  220. package/dist/utils/global-cache.js +1 -1
  221. package/dist/utils/json-loader.js +1 -1
  222. package/dist/utils/local-cache.js +1 -1
  223. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  224. package/dist/utils/logger/formatters/index.js +1 -1
  225. package/dist/utils/logger/handlers/console-handler.js +1 -1
  226. package/dist/utils/logger/handlers/file-handler.js +1 -1
  227. package/dist/utils/logger/handlers/index.js +1 -1
  228. package/dist/utils/logger/handlers/null-handler.js +1 -1
  229. package/dist/utils/logger/index.js +1 -1
  230. package/dist/utils/logger/logger.js +1 -1
  231. package/dist/utils/logger/types.js +1 -1
  232. package/dist/utils/option-validation.js +1 -1
  233. package/dist/utils/process.js +1 -1
  234. package/dist/utils/prompt.js +1 -1
  235. package/dist/utils/spinner.js +1 -1
  236. package/dist/utils/sse-parser.js +1 -1
  237. package/dist/utils/string-utils.js +1 -1
  238. package/dist/utils/table-ref-parser.js +1 -1
  239. package/dist/utils/tdx-logger.js +1 -1
  240. package/dist/utils/version-check.js +1 -1
  241. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x14089a=a3_0x2804;(function(_0x44c304,_0x106980){const _0x4d9704=a3_0x2804,_0x57d3e6=_0x44c304();while(!![]){try{const _0x1cf5e1=parseInt(_0x4d9704(0x1ba))/0x1+-parseInt(_0x4d9704(0x1ac))/0x2+-parseInt(_0x4d9704(0x19d))/0x3+parseInt(_0x4d9704(0x1b7))/0x4+parseInt(_0x4d9704(0x1bc))/0x5+-parseInt(_0x4d9704(0x1a3))/0x6*(-parseInt(_0x4d9704(0x1b9))/0x7)+parseInt(_0x4d9704(0x1b0))/0x8*(-parseInt(_0x4d9704(0x1b1))/0x9);if(_0x1cf5e1===_0x106980)break;else _0x57d3e6['push'](_0x57d3e6['shift']());}catch(_0x25e1b7){_0x57d3e6['push'](_0x57d3e6['shift']());}}}(a3_0x3562,0xc2277));import{BaseCommand}from'./command.js';function a3_0x3562(){const _0x4f6dde=['30UeDlxX','verbose','List\x20activations\x20for\x20a\x20segment','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','cause','\x27...','resolveParentId','data','length','776478GSpYAM','execute','Resolved\x20parent\x20ID:\x20','listActivations','11213608mRLIZs','9mYhjGp','description','Resolving\x20child\x20segment\x20\x27','resolveSegmentId','Error:\x20Segment\x20name\x20is\x20required','\x20\x20Cause:\x20','97324kPVWbs','name','1600172vcsgKX','1517137ttsQfZ','activations','3431035bcJarm','Resolved\x20child\x20ID:\x20','\x20activation','2356380erWQyY','error','✔\x20Found\x20','site','Resolving\x20parent\x20segment\x20\x27','segment'];a3_0x3562=function(){return _0x4f6dde;};return a3_0x3562();}import{SDKError}from'../sdk/index.js';function a3_0x2804(_0x2ae58b,_0x446f3b){_0x2ae58b=_0x2ae58b-0x19b;const _0x3562df=a3_0x3562();let _0x280436=_0x3562df[_0x2ae58b];return _0x280436;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x14089a(0x1b8)]=a3_0x14089a(0x1bb);[a3_0x14089a(0x1b2)]=a3_0x14089a(0x1a5);async[a3_0x14089a(0x1ad)](_0x5ca68f){const _0x140d64=a3_0x14089a,{options:_0x461028,args:_0x41108d,tdx:_0x224bec}=_0x5ca68f;if(_0x41108d['length']===0x0)return console[_0x140d64(0x19e)](_0x140d64(0x1b5)),console[_0x140d64(0x19e)](_0x140d64(0x1a6)),0x1;try{const {parentId:_0x225d1e,childId:_0x20843f}=parseSegmentRef(_0x41108d[0x0]);if(!_0x20843f)return console['error']('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x140d64(0x19e)](_0x140d64(0x1a6)),0x1;_0x461028[_0x140d64(0x1a4)]&&(console[_0x140d64(0x19e)]('Site:\x20'+_0x461028[_0x140d64(0x1a0)]),console[_0x140d64(0x19e)]('Parent\x20name:\x20'+_0x225d1e),console[_0x140d64(0x19e)]('Child\x20name:\x20'+_0x20843f));const _0x2a311b=await withSpinner(_0x140d64(0x1a1)+_0x225d1e+_0x140d64(0x1a8),()=>_0x224bec[_0x140d64(0x1a2)][_0x140d64(0x1a9)](_0x225d1e),{'verbose':_0x461028[_0x140d64(0x1a4)]}),_0x2d1458=_0x2a311b[_0x140d64(0x1aa)];_0x461028[_0x140d64(0x1a4)]&&console[_0x140d64(0x19e)](_0x140d64(0x1ae)+_0x2d1458);const _0x374445=await withSpinner(_0x140d64(0x1b3)+_0x20843f+_0x140d64(0x1a8),()=>_0x224bec['segment'][_0x140d64(0x1b4)](_0x2d1458,_0x20843f),{'verbose':_0x461028[_0x140d64(0x1a4)]}),_0x46557a=_0x374445['data'];_0x461028[_0x140d64(0x1a4)]&&console[_0x140d64(0x19e)](_0x140d64(0x19b)+_0x46557a);const _0x592c80=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x20843f+'\x27...',()=>_0x224bec['segment'][_0x140d64(0x1af)](_0x2d1458,_0x46557a),{'verbose':_0x461028['verbose']}),_0x5c5bad=_0x592c80[_0x140d64(0x1aa)];return console[_0x140d64(0x19e)](_0x140d64(0x19f)+_0x5c5bad[_0x140d64(0x1ab)]+_0x140d64(0x19c)+(_0x5c5bad['length']!==0x1?'s':'')),await handleSDKOutput(_0x5c5bad,_0x461028),0x0;}catch(_0x4b13d4){if(_0x4b13d4 instanceof SDKError)return console[_0x140d64(0x19e)]('Error:\x20'+_0x4b13d4['message']),_0x4b13d4[_0x140d64(0x1a7)]&&console[_0x140d64(0x19e)](_0x140d64(0x1b6)+_0x4b13d4['cause']),0x1;throw _0x4b13d4;}}}
1
+ const a3_0x34b07e=a3_0x13eb;function a3_0x13eb(_0xfc8515,_0x42ee55){_0xfc8515=_0xfc8515-0x123;const _0x497698=a3_0x4976();let _0x13eb6c=_0x497698[_0xfc8515];return _0x13eb6c;}function a3_0x4976(){const _0x42b4d5=['Usage:\x20tdx\x20activations\x20<parent_name/child_name>','length','Resolving\x20child\x20segment\x20\x27','execute','2117790rfFxze','Resolving\x20parent\x20segment\x20\x27','listActivations','✔\x20Found\x20','9XPhhrN','7ETyVGI','Child\x20name:\x20','Resolved\x20child\x20ID:\x20','15hYCPPI','Listing\x20activations\x20for\x20segment\x20\x27','Resolved\x20parent\x20ID:\x20','description','981LeUbkd','\x20\x20Cause:\x20','resolveSegmentId','site','cause','verbose','data','6917757pWgpTQ','\x27...','\x20activation','error','4450408JDBAmG','289952bFHQVK','224012LxFktj','resolveParentId','List\x20activations\x20for\x20a\x20segment','segment','36390FEGIQv','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','434289LhHccP'];a3_0x4976=function(){return _0x42b4d5;};return a3_0x4976();}(function(_0x2ae221,_0x84093a){const _0xb02563=a3_0x13eb,_0x34319b=_0x2ae221();while(!![]){try{const _0x1556d0=parseInt(_0xb02563(0x143))/0x1+-parseInt(_0xb02563(0x13d))/0x2*(parseInt(_0xb02563(0x128))/0x3)+-parseInt(_0xb02563(0x13c))/0x4*(-parseInt(_0xb02563(0x12c))/0x5)+parseInt(_0xb02563(0x124))/0x6+-parseInt(_0xb02563(0x129))/0x7*(parseInt(_0xb02563(0x13b))/0x8)+parseInt(_0xb02563(0x130))/0x9*(-parseInt(_0xb02563(0x141))/0xa)+parseInt(_0xb02563(0x137))/0xb;if(_0x1556d0===_0x84093a)break;else _0x34319b['push'](_0x34319b['shift']());}catch(_0x4f41fe){_0x34319b['push'](_0x34319b['shift']());}}}(a3_0x4976,0x5423b));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{['name']='activations';[a3_0x34b07e(0x12f)]=a3_0x34b07e(0x13f);async[a3_0x34b07e(0x123)](_0x444e25){const _0x46c06f=a3_0x34b07e,{options:_0x58bbdc,args:_0x16d40e,tdx:_0x1ba457}=_0x444e25;if(_0x16d40e[_0x46c06f(0x145)]===0x0)return console[_0x46c06f(0x13a)]('Error:\x20Segment\x20name\x20is\x20required'),console[_0x46c06f(0x13a)](_0x46c06f(0x144)),0x1;try{const {parentId:_0x302d3c,childId:_0x4488ad}=parseSegmentRef(_0x16d40e[0x0]);if(!_0x4488ad)return console[_0x46c06f(0x13a)](_0x46c06f(0x142)),console[_0x46c06f(0x13a)](_0x46c06f(0x144)),0x1;_0x58bbdc[_0x46c06f(0x135)]&&(console['error']('Site:\x20'+_0x58bbdc[_0x46c06f(0x133)]),console['error']('Parent\x20name:\x20'+_0x302d3c),console['error'](_0x46c06f(0x12a)+_0x4488ad));const _0x5f2bd6=await withSpinner(_0x46c06f(0x125)+_0x302d3c+_0x46c06f(0x138),()=>_0x1ba457[_0x46c06f(0x140)][_0x46c06f(0x13e)](_0x302d3c),{'verbose':_0x58bbdc[_0x46c06f(0x135)]}),_0x3c04a8=_0x5f2bd6[_0x46c06f(0x136)];_0x58bbdc['verbose']&&console[_0x46c06f(0x13a)](_0x46c06f(0x12e)+_0x3c04a8);const _0x3bd777=await withSpinner(_0x46c06f(0x146)+_0x4488ad+'\x27...',()=>_0x1ba457[_0x46c06f(0x140)][_0x46c06f(0x132)](_0x3c04a8,_0x4488ad),{'verbose':_0x58bbdc[_0x46c06f(0x135)]}),_0x378e45=_0x3bd777['data'];_0x58bbdc[_0x46c06f(0x135)]&&console['error'](_0x46c06f(0x12b)+_0x378e45);const _0x427af1=await withSpinner(_0x46c06f(0x12d)+_0x4488ad+'\x27...',()=>_0x1ba457[_0x46c06f(0x140)][_0x46c06f(0x126)](_0x3c04a8,_0x378e45),{'verbose':_0x58bbdc[_0x46c06f(0x135)]}),_0x295937=_0x427af1[_0x46c06f(0x136)];return console[_0x46c06f(0x13a)](_0x46c06f(0x127)+_0x295937['length']+_0x46c06f(0x139)+(_0x295937[_0x46c06f(0x145)]!==0x1?'s':'')),await handleSDKOutput(_0x295937,_0x58bbdc),0x0;}catch(_0x40ed03){if(_0x40ed03 instanceof SDKError)return console[_0x46c06f(0x13a)]('Error:\x20'+_0x40ed03['message']),_0x40ed03[_0x46c06f(0x134)]&&console[_0x46c06f(0x13a)](_0x46c06f(0x131)+_0x40ed03[_0x46c06f(0x134)]),0x1;throw _0x40ed03;}}}
@@ -1 +1 @@
1
- const a4_0x149976=a4_0x2e6b;function a4_0x2e6b(_0x148227,_0x2374cd){_0x148227=_0x148227-0x14e;const _0x4e34a5=a4_0x4e34();let _0x2e6b9d=_0x4e34a5[_0x148227];return _0x2e6b9d;}(function(_0x4b2c54,_0x6522f6){const _0x23c69f=a4_0x2e6b,_0x677410=_0x4b2c54();while(!![]){try{const _0x5ebd2e=parseInt(_0x23c69f(0x1d2))/0x1*(parseInt(_0x23c69f(0x1f1))/0x2)+parseInt(_0x23c69f(0x155))/0x3*(parseInt(_0x23c69f(0x1b2))/0x4)+parseInt(_0x23c69f(0x1f0))/0x5*(-parseInt(_0x23c69f(0x1de))/0x6)+-parseInt(_0x23c69f(0x1eb))/0x7*(-parseInt(_0x23c69f(0x204))/0x8)+parseInt(_0x23c69f(0x1c8))/0x9*(parseInt(_0x23c69f(0x15a))/0xa)+parseInt(_0x23c69f(0x18c))/0xb*(parseInt(_0x23c69f(0x167))/0xc)+-parseInt(_0x23c69f(0x15b))/0xd*(parseInt(_0x23c69f(0x196))/0xe);if(_0x5ebd2e===_0x6522f6)break;else _0x677410['push'](_0x677410['shift']());}catch(_0x23e3be){_0x677410['push'](_0x677410['shift']());}}}(a4_0x4e34,0x7d5d2));import a4_0x29bfb6 from'chalk';import a4_0x316b39 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x5cb6fb){const _0x10d355=a4_0x2e6b,_0x50cde6=[];if(_0x5cb6fb[_0x10d355(0x1ed)]!==undefined)_0x50cde6[_0x10d355(0x20a)](_0x5cb6fb[_0x10d355(0x1ed)]+'\x20total');if(_0x5cb6fb[_0x10d355(0x199)]!==undefined&&_0x5cb6fb[_0x10d355(0x199)]>0x0)_0x50cde6[_0x10d355(0x20a)](a4_0x29bfb6[_0x10d355(0x180)](_0x5cb6fb[_0x10d355(0x199)]+'\x20new'));if(_0x5cb6fb['created']!==undefined&&_0x5cb6fb['created']>0x0)_0x50cde6[_0x10d355(0x20a)](a4_0x29bfb6[_0x10d355(0x180)](_0x5cb6fb['created']+_0x10d355(0x16c)));if(_0x5cb6fb[_0x10d355(0x1ac)]!==undefined&&_0x5cb6fb[_0x10d355(0x1ac)]>0x0)_0x50cde6[_0x10d355(0x20a)](a4_0x29bfb6[_0x10d355(0x15c)](_0x5cb6fb[_0x10d355(0x1ac)]+_0x10d355(0x17c)));if(_0x5cb6fb[_0x10d355(0x201)]!==undefined&&_0x5cb6fb[_0x10d355(0x201)]>0x0)_0x50cde6[_0x10d355(0x20a)](a4_0x29bfb6['gray'](_0x5cb6fb[_0x10d355(0x201)]+_0x10d355(0x1d3)));if(_0x5cb6fb[_0x10d355(0x18b)]!==undefined&&_0x5cb6fb[_0x10d355(0x18b)]>0x0)_0x50cde6[_0x10d355(0x20a)](a4_0x29bfb6['red'](_0x5cb6fb[_0x10d355(0x18b)]+_0x10d355(0x1c1)));return _0x50cde6['join'](',\x20');}function displayDiffs(_0x420469,_0x24f847,_0xc24555,_0x14831c,_0x2241e4,_0x449232,_0x3f3019,_0x5b8bbf,_0x5645bd){const _0x2d7d9b=a4_0x2e6b;for(const _0x563cc0 of _0x420469){if(_0x563cc0[_0x2d7d9b(0x17d)]){const _0xd86f2=_0x563cc0['agentName']||_0x563cc0[_0x2d7d9b(0x186)];console['log'](_0x2d7d9b(0x20e)+_0xd86f2+'\x27:'),console[_0x2d7d9b(0x1c2)]('─'[_0x2d7d9b(0x1e5)](0x3c)),console[_0x2d7d9b(0x1c2)](_0x563cc0[_0x2d7d9b(0x17d)]),console[_0x2d7d9b(0x1c2)]('─'[_0x2d7d9b(0x1e5)](0x3c));}}for(const _0x1ca62c of _0x24f847){_0x1ca62c['diff']&&(console[_0x2d7d9b(0x1c2)](_0x2d7d9b(0x1fb)+_0x1ca62c[_0x2d7d9b(0x186)]+'\x27:'),console[_0x2d7d9b(0x1c2)]('─'[_0x2d7d9b(0x1e5)](0x3c)),console[_0x2d7d9b(0x1c2)](_0x1ca62c[_0x2d7d9b(0x17d)]),console['log']('─'[_0x2d7d9b(0x1e5)](0x3c)));}for(const _0x560b4c of _0xc24555){_0x560b4c[_0x2d7d9b(0x17d)]&&(console[_0x2d7d9b(0x1c2)](_0x2d7d9b(0x1c9)+_0x560b4c[_0x2d7d9b(0x186)]+'\x27:'),console[_0x2d7d9b(0x1c2)]('─'[_0x2d7d9b(0x1e5)](0x3c)),console[_0x2d7d9b(0x1c2)](_0x560b4c[_0x2d7d9b(0x17d)]),console[_0x2d7d9b(0x1c2)]('─'['repeat'](0x3c)));}for(const _0x3bb17e of _0x14831c){_0x3bb17e[_0x2d7d9b(0x17d)]&&(console[_0x2d7d9b(0x1c2)](_0x2d7d9b(0x1be)+_0x3bb17e['name']+'\x27:'),console['log']('─'[_0x2d7d9b(0x1e5)](0x3c)),console[_0x2d7d9b(0x1c2)](_0x3bb17e[_0x2d7d9b(0x17d)]),console[_0x2d7d9b(0x1c2)]('─'[_0x2d7d9b(0x1e5)](0x3c)));}for(const _0x402c90 of _0x2241e4){_0x402c90['diff']&&(console['log'](_0x2d7d9b(0x1ba)+_0x402c90[_0x2d7d9b(0x186)]+'\x27:'),console['log']('─'[_0x2d7d9b(0x1e5)](0x3c)),console['log'](_0x402c90[_0x2d7d9b(0x17d)]),console[_0x2d7d9b(0x1c2)]('─'['repeat'](0x3c)));}for(const _0x21f145 of _0x449232){_0x21f145[_0x2d7d9b(0x17d)]&&(console['log']('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x21f145[_0x2d7d9b(0x186)]+'\x27:'),console[_0x2d7d9b(0x1c2)]('─'['repeat'](0x3c)),console[_0x2d7d9b(0x1c2)](_0x21f145[_0x2d7d9b(0x17d)]),console[_0x2d7d9b(0x1c2)]('─'[_0x2d7d9b(0x1e5)](0x3c)));}for(const _0x4c81b4 of _0x3f3019){_0x4c81b4[_0x2d7d9b(0x17d)]&&(console['log']('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x4c81b4[_0x2d7d9b(0x186)]+'\x27:'),console[_0x2d7d9b(0x1c2)]('─'[_0x2d7d9b(0x1e5)](0x3c)),console[_0x2d7d9b(0x1c2)](_0x4c81b4[_0x2d7d9b(0x17d)]),console[_0x2d7d9b(0x1c2)]('─'[_0x2d7d9b(0x1e5)](0x3c)));}for(const _0x32b436 of _0x5b8bbf){_0x32b436[_0x2d7d9b(0x17d)]&&(console['log'](_0x2d7d9b(0x1d1)+_0x32b436[_0x2d7d9b(0x186)]+'\x27:'),console['log']('─'[_0x2d7d9b(0x1e5)](0x3c)),console[_0x2d7d9b(0x1c2)](_0x32b436[_0x2d7d9b(0x17d)]),console['log']('─'['repeat'](0x3c)));}for(const _0x5c431a of _0x5645bd){_0x5c431a[_0x2d7d9b(0x17d)]&&(console['log'](_0x2d7d9b(0x1e1)+_0x5c431a[_0x2d7d9b(0x186)]+'\x27:'),console[_0x2d7d9b(0x1c2)]('─'[_0x2d7d9b(0x1e5)](0x3c)),console[_0x2d7d9b(0x1c2)](_0x5c431a[_0x2d7d9b(0x17d)]),console[_0x2d7d9b(0x1c2)]('─'[_0x2d7d9b(0x1e5)](0x3c)));}}function a4_0x4e34(){const _0x4ed3a4=['\x20\x20Chat\x20Interfaces:\x20','3740HvWBND','2113345wdOIXB','yellow','description','session','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','New\x20project:\x20','\x20\x20Prompts:\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','no_local_folder','\x20\x20Knowledge\x20Bases:\x20','Cloning\x20\x22','Chat:\x20','1567284FlpXZx','experimentalArtifacts','Status:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','output','\x20created','-\x20nothing\x20pushed','gray','action','\x0a✔\x20Pushed\x20','parse','\x20\x20Experimental\x20Artifact\x20\x22','\x22\x20to\x20new\x20project\x20\x22','reason','\x22\x20to\x20\x22','\x20--profile\x20','\x20\x20Agent\x20\x22','\x20\x20Form\x20Interface\x20\x22','context','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20updated','diff','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','pushAgent','green','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','pushProject','textKnowledgeBases','tdx.json','Agent\x20pulled\x20successfully','name','knowledgeBases','arg-dir','Would\x20pull\x20agent:\x20','\x20|\x20','errors','33wfSRnO','dim','Project\x20cloned\x20with\x20errors','\x20files?','Using\x20project\x20from\x20','Errors:','\x22:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','newProjectName','126bbjbZP','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','new','\x20\x20Chat\x20Interface\x20\x22','projectId','\x20files\x20to\x20','agent.yml','\x20\x20Source:\x20','Analyzing\x20changes\x20to\x20push...','Failed\x20to\x20push\x20agent:\x20','No\x20tdx.json\x20found\x20in\x20','<new-name>','\x20\x20tdx\x20agent\x20pull\x20','sourceProjectName','outputDir','\x20=\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x22\x20from\x20project\x20\x22','pullAgent','\x22...','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','updated','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','cwd','Cancelled','\x20\x20Prompt\x20\x22','\x20--name\x20','4wUXlti','error','utf-8','integrations','hasChanges','New\x20project\x20ID:\x20','found','Pushing\x20to\x20project...','\x0aChanges\x20to\x20integration\x20\x27','prompts','yes','Using\x20context\x20project:\x20','\x0aChanges\x20to\x20prompt\x20\x27','Clone\x20\x22','Using\x20project\x20from\x20context:\x20','\x20errors','log','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Using\x20current\x20project:\x20','\x0aError:','cwd-config','Output\x20path:\x20','6777opAZUe','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','INVALID_ARGUMENT','\x20\x20tdx\x20agent\x20clone\x20agents/','\x0aProject\x20pushed\x20with\x20errors','Using\x20local\x20project:\x20','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)','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20resources\x20to\x20\x27','\x0aChanges\x20to\x20form\x20interface\x20\x27','1863InpFkJ','\x20unchanged','llm','chatInterfaces','cloneProject','execute','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','Pulling\x20agent\x20\x22','newProjectId','projectName','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20\x20Text\x20Knowledge\x20Base\x20\x22','3342aXQaFc','cyan','✔\x20Context\x20set:\x20','\x0aChanges\x20to\x20chat\x20interface\x20\x27','site','profile','\x20\x20Text\x20Knowledge\x20Bases:\x20','repeat','Agent:\x20','red','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','64057PfPUNR','\x20\x20Form\x20Interfaces:\x20','total','\x20\x20Agents:\x20','outputPath','1530Uobohu','724QxRmoO','Output:\x20','dirname','Source:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','formInterfaces','\x20resources?','\x0aWrite\x20','Agent\x20','llm_project','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','message','\x22\x20to\x20a\x20different\x20profile','Project:\x20','\x0a✔\x20Pulled\x20','unchanged','\x0aPush\x20','\x20\x20Integrations:\x20','328CpzKVE','\x0aPush\x20summary\x20for\x20\x27','agent:pull','Would\x20push\x20agent:\x20','\x20changed','experimentalKnowledgeBases','push','New\x20project\x20name\x20is\x20required','created','\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','\x0aChanges\x20to\x20agent\x20\x27','agents','Dry\x20run\x20-\x20no\x20changes\x20made','force','counts','-\x20no\x20files\x20written','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Writing\x20files...','agentId','join','\x0aPull\x20summary\x20for\x20\x27','\x0aChanges:','\x20new','agentName','Cannot\x20clone\x20from\x20context\x20project\x20\x22','1271931Ucoigi','\x20\x20Knowledge\x20Base\x20\x22','pullProject','llmProject'];a4_0x4e34=function(){return _0x4ed3a4;};return a4_0x4e34();}export class AgentPullCommand extends BaseCommand{[a4_0x149976(0x186)]=a4_0x149976(0x206);[a4_0x149976(0x15d)]=a4_0x149976(0x193);async[a4_0x149976(0x1d7)](_0x2ec3df){const _0x1972de=a4_0x149976,{options:_0x1144b8,args:_0x336846,tdx:_0x2365af}=_0x2ec3df,_0x27d0d8=_0x336846[0x0],_0xc770c5=_0x336846[0x1],_0x265971=_0x1144b8[_0x1972de(0x16b)],_0x1ea339=_0x1144b8['dryRun'],_0x18dc7d=_0x1144b8[_0x1972de(0x211)],_0x37c274=_0x1144b8['yes'],_0x5797a7=_0x1144b8[_0x1972de(0x158)],_0x23a62e=_0x1144b8['agent'];let _0x594988;if(_0x27d0d8){const _0x21fa51=a4_0x316b39['join'](_0x27d0d8,_0x1972de(0x184));if(existsSync(_0x21fa51))try{const _0x1f78df=JSON[_0x1972de(0x171)](readFileSync(_0x21fa51,_0x1972de(0x1b4)));_0x1f78df['llm_project']&&(_0x594988={'llm_project':_0x1f78df[_0x1972de(0x1fa)]});}catch{}}const _0x570653=findAgentConfigPath(process[_0x1972de(0x1ae)]());let _0x431197;if(_0x570653)try{const _0x5f39fd=JSON[_0x1972de(0x171)](readFileSync(_0x570653,_0x1972de(0x1b4)));_0x5f39fd[_0x1972de(0x1fa)]&&(_0x431197={'llm_project':_0x5f39fd['llm_project']});}catch{}const _0x3aa740=resolveAgentPullArgs({'arg':_0x27d0d8,'agentNameArg':_0xc770c5,'agentFlag':_0x23a62e,'contextProject':_0x5797a7,'argDirConfig':_0x594988,'cwdConfigPath':_0x570653||undefined,'cwdConfig':_0x431197}),{projectNameOrId:_0xdde4c,targetAgentName:_0x229b18,existingOutputDir:_0x33e256,source:_0x46dcd2}=_0x3aa740;if(_0x46dcd2===_0x1972de(0x188))console[_0x1972de(0x1c2)](a4_0x29bfb6[_0x1972de(0x18d)](_0x1972de(0x190)+a4_0x316b39[_0x1972de(0x14f)](_0x27d0d8,_0x1972de(0x184))+':\x20'+_0xdde4c));else{if(_0x46dcd2===_0x1972de(0x1c6))console['log'](a4_0x29bfb6[_0x1972de(0x18d)]('Using\x20project:\x20'+_0xdde4c));else _0x46dcd2===_0x1972de(0x179)&&console['log'](a4_0x29bfb6[_0x1972de(0x18d)](_0x1972de(0x1c0)+_0xdde4c));}if(!_0xdde4c)return _0x23a62e?(console['log'](a4_0x29bfb6[_0x1972de(0x15c)](_0x1972de(0x1e9))),console[_0x1972de(0x1c2)](_0x1972de(0x1c3)),console[_0x1972de(0x1c2)](_0x1972de(0x1d8))):(console[_0x1972de(0x1c2)](a4_0x29bfb6[_0x1972de(0x15c)](_0x1972de(0x16a))),console[_0x1972de(0x1c2)](_0x1972de(0x1ce)),console[_0x1972de(0x1c2)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console['log'](_0x1972de(0x1ab)),console[_0x1972de(0x1c2)](_0x1972de(0x198)),console[_0x1972de(0x1c2)](_0x1972de(0x20d))),0x1;if(_0x229b18){const {data:_0x3c2794}=await withSpinner(_0x1972de(0x1d9)+_0x229b18+_0x1972de(0x1a8)+_0xdde4c+'\x22...',()=>_0x2365af[_0x1972de(0x1d4)][_0x1972de(0x1a9)](_0xdde4c,_0x229b18,_0x265971,{'dryRun':_0x1ea339,'force':_0x18dc7d}));if(_0x1ea339)return console[_0x1972de(0x1c2)](a4_0x29bfb6[_0x1972de(0x15c)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x1972de(0x1c2)](_0x1972de(0x189)+_0x3c2794['agentName']),console[_0x1972de(0x1c2)](_0x1972de(0x1c7)+_0x3c2794[_0x1972de(0x1ef)]),_0x3c2794[_0x1972de(0x17d)]&&(console[_0x1972de(0x1c2)](_0x1972de(0x151)),console[_0x1972de(0x1c2)]('─'[_0x1972de(0x1e5)](0x3c)),console[_0x1972de(0x1c2)](_0x3c2794['diff']),console[_0x1972de(0x1c2)]('─'[_0x1972de(0x1e5)](0x3c))),0x0;return console['log'](a4_0x29bfb6[_0x1972de(0x180)](_0x1972de(0x185))),console[_0x1972de(0x1c2)](_0x1972de(0x1e6)+_0x3c2794['agentName']),console[_0x1972de(0x1c2)](_0x1972de(0x1f2)+_0x3c2794['outputPath']),console[_0x1972de(0x1c2)](_0x1972de(0x169)+(_0x3c2794['isNew']?a4_0x29bfb6['green']('new'):_0x3c2794[_0x1972de(0x1b6)]?a4_0x29bfb6[_0x1972de(0x15c)](_0x1972de(0x1ac)):a4_0x29bfb6[_0x1972de(0x16e)](_0x1972de(0x201)))),0x0;}const _0x6259db=_0x33e256||_0x265971,{data:_0x15b9f8}=await withSpinner('Analyzing\x20project\x20\x22'+_0xdde4c+_0x1972de(0x1aa),()=>_0x2365af[_0x1972de(0x1d4)][_0x1972de(0x157)](_0xdde4c,_0x6259db,{'dryRun':!![]})),_0x5a2d4b=_0x15b9f8['counts'][_0x1972de(0x20f)][_0x1972de(0x199)]+_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x187)][_0x1972de(0x199)]+_0x15b9f8['counts'][_0x1972de(0x183)]['new']+_0x15b9f8['counts']['prompts'][_0x1972de(0x199)]+_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x1b5)]['new']+_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x209)]['new']+_0x15b9f8[_0x1972de(0x212)]['experimentalArtifacts'][_0x1972de(0x199)]+_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x1f6)][_0x1972de(0x199)]+_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x1d5)]['new'],_0x32d89d=_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x20f)][_0x1972de(0x1ac)]+_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x187)][_0x1972de(0x1ac)]+_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x183)][_0x1972de(0x1ac)]+_0x15b9f8[_0x1972de(0x212)]['prompts'][_0x1972de(0x1ac)]+_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x1b5)][_0x1972de(0x1ac)]+_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x209)][_0x1972de(0x1ac)]+_0x15b9f8[_0x1972de(0x212)]['experimentalArtifacts'][_0x1972de(0x1ac)]+_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x1f6)]['updated']+_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x1d5)][_0x1972de(0x1ac)],_0x5832cb=_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x20f)][_0x1972de(0x201)]+_0x15b9f8['counts'][_0x1972de(0x187)][_0x1972de(0x201)]+_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x183)]['unchanged']+_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x1bb)]['unchanged']+_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x1b5)]['unchanged']+_0x15b9f8[_0x1972de(0x212)]['experimentalKnowledgeBases'][_0x1972de(0x201)]+_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x168)]['unchanged']+_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x1f6)]['unchanged']+_0x15b9f8['counts'][_0x1972de(0x1d5)][_0x1972de(0x201)];console['log'](_0x1972de(0x150)+_0x15b9f8[_0x1972de(0x1db)]+'\x27:'),console[_0x1972de(0x1c2)]('\x20\x20'+a4_0x29bfb6[_0x1972de(0x180)]('+\x20'+_0x5a2d4b+_0x1972de(0x152))+_0x1972de(0x18a)+a4_0x29bfb6[_0x1972de(0x15c)]('~\x20'+_0x32d89d+_0x1972de(0x208))+'\x20|\x20'+a4_0x29bfb6['dim']('=\x20'+_0x5832cb+'\x20unchanged')),console['log'](_0x1972de(0x1ee)+formatCountSummary(_0x15b9f8[_0x1972de(0x212)]['agents'])),console['log'](_0x1972de(0x164)+formatCountSummary(_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x187)])),console['log'](_0x1972de(0x1e4)+formatCountSummary(_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x183)])),console['log'](_0x1972de(0x161)+formatCountSummary(_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x1bb)])),console[_0x1972de(0x1c2)](_0x1972de(0x203)+formatCountSummary(_0x15b9f8[_0x1972de(0x212)]['integrations'])),console[_0x1972de(0x1c2)](_0x1972de(0x1ec)+formatCountSummary(_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x1f6)])),console[_0x1972de(0x1c2)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x1d5)]));const _0x7db504=_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x209)][_0x1972de(0x1ed)]>0x0||_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x168)]['total']>0x0;_0x7db504&&(console[_0x1972de(0x1c2)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x15b9f8[_0x1972de(0x212)]['experimentalKnowledgeBases'])),console['log'](_0x1972de(0x197)+formatCountSummary(_0x15b9f8[_0x1972de(0x212)][_0x1972de(0x168)])));console[_0x1972de(0x1c2)]('\x20\x20Target:\x20'+a4_0x29bfb6[_0x1972de(0x1df)](_0x15b9f8[_0x1972de(0x1a5)])),displayDiffs(_0x15b9f8[_0x1972de(0x20f)],_0x15b9f8[_0x1972de(0x187)],_0x15b9f8[_0x1972de(0x183)],_0x15b9f8[_0x1972de(0x1bb)],_0x15b9f8[_0x1972de(0x1b5)],_0x15b9f8[_0x1972de(0x209)],_0x15b9f8[_0x1972de(0x168)],_0x15b9f8[_0x1972de(0x1f6)],_0x15b9f8['chatInterfaces']);if(_0x1ea339)return console[_0x1972de(0x1c2)](a4_0x29bfb6[_0x1972de(0x15c)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x5a2d4b===0x0&&_0x32d89d===0x0)return console[_0x1972de(0x1c2)](a4_0x29bfb6[_0x1972de(0x180)](_0x1972de(0x15f))),saveSessionContext({'llm_project':_0x15b9f8[_0x1972de(0x1db)]},_0x1144b8[_0x1972de(0x15e)]),console[_0x1972de(0x1c2)](a4_0x29bfb6[_0x1972de(0x180)]('✔\x20Context\x20set:\x20'+a4_0x29bfb6[_0x1972de(0x18d)](_0x1972de(0x1fa))+_0x1972de(0x1a6)+a4_0x29bfb6[_0x1972de(0x1df)](_0x15b9f8[_0x1972de(0x1db)]))),0x0;if(!_0x37c274&&!_0x18dc7d){if(!isInteractive())return console[_0x1972de(0x1b3)](a4_0x29bfb6['red'](_0x1972de(0x1c5)),_0x1972de(0x1fc)),console[_0x1972de(0x1b3)](a4_0x29bfb6[_0x1972de(0x18d)](_0x1972de(0x194))),0x1;const _0x572242=await confirmKey(_0x1972de(0x1f8)+(_0x5a2d4b+_0x32d89d)+_0x1972de(0x18f));if(!_0x572242)return console[_0x1972de(0x1c2)](a4_0x29bfb6['yellow'](_0x1972de(0x1af)),_0x1972de(0x213)),0x1;}const {data:_0x5094f2}=await withSpinner(_0x1972de(0x217),()=>_0x2365af[_0x1972de(0x1d4)]['pullProject'](_0xdde4c,_0x6259db,{'force':_0x18dc7d}));return console['log'](a4_0x29bfb6[_0x1972de(0x180)](_0x1972de(0x200)+(_0x5a2d4b+_0x32d89d)+_0x1972de(0x19c)+_0x5094f2[_0x1972de(0x1a5)])),saveSessionContext({'llm_project':_0x5094f2[_0x1972de(0x1db)]},_0x1144b8[_0x1972de(0x15e)]),console[_0x1972de(0x1c2)](a4_0x29bfb6[_0x1972de(0x180)](_0x1972de(0x1e0)+a4_0x29bfb6[_0x1972de(0x18d)]('llm_project')+'\x20=\x20'+a4_0x29bfb6[_0x1972de(0x1df)](_0x5094f2[_0x1972de(0x1db)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']='agent:clone';[a4_0x149976(0x15d)]=a4_0x149976(0x17b);async[a4_0x149976(0x1d7)](_0x543520){const _0x8de9ab=a4_0x149976,{options:_0x312aeb,args:_0x472d28,tdx:_0x408ca2}=_0x543520,_0x2eb884=_0x472d28[0x0],_0x554ab4=_0x312aeb[_0x8de9ab(0x186)],_0x200bc3=_0x312aeb['dryRun'],_0x1fe4aa=_0x312aeb[_0x8de9ab(0x1bc)],_0x30d34d=_0x312aeb['site'],_0x11e997=_0x312aeb[_0x8de9ab(0x158)];let _0x561a1d;const _0x211371=findAgentConfigPath(process[_0x8de9ab(0x1ae)]());if(_0x2eb884){const _0x3add13=a4_0x316b39[_0x8de9ab(0x14f)](_0x2eb884,'tdx.json');existsSync(_0x3add13)?(_0x561a1d=_0x2eb884,console[_0x8de9ab(0x1c2)](a4_0x29bfb6[_0x8de9ab(0x18d)](_0x8de9ab(0x1cd)+_0x2eb884))):_0x561a1d=_0x2eb884;}else{if(_0x211371)_0x561a1d=a4_0x316b39[_0x8de9ab(0x1f3)](_0x211371),console[_0x8de9ab(0x1c2)](a4_0x29bfb6['dim'](_0x8de9ab(0x1c4)+_0x561a1d));else{if(_0x11e997){const _0x35cfb2=sanitizeForFilesystem(_0x11e997);let _0x1f65ec=_0x35cfb2,_0x477938=a4_0x316b39[_0x8de9ab(0x14f)](process['cwd'](),_0x8de9ab(0x20f),_0x35cfb2,_0x8de9ab(0x184));if(!existsSync(_0x477938)){const _0x245b67=normalizeName(_0x11e997),_0x13a2e4=a4_0x316b39[_0x8de9ab(0x14f)](process[_0x8de9ab(0x1ae)](),'agents',_0x245b67,_0x8de9ab(0x184));existsSync(_0x13a2e4)&&(_0x1f65ec=_0x245b67,_0x477938=_0x13a2e4);}if(existsSync(_0x477938))_0x561a1d=a4_0x316b39[_0x8de9ab(0x1f3)](_0x477938),console[_0x8de9ab(0x1c2)](a4_0x29bfb6[_0x8de9ab(0x18d)]('Using\x20local\x20project:\x20'+_0x561a1d));else{const _0x9cb05a=_0x312aeb[_0x8de9ab(0x1e3)];if(_0x9cb05a)throw new SDKError(ErrorCode[_0x8de9ab(0x1ca)],_0x8de9ab(0x154)+_0x11e997+_0x8de9ab(0x1fe),undefined,{'helpText':_0x8de9ab(0x1cf)+_0x8de9ab(0x216)+(_0x8de9ab(0x1a3)+_0x11e997+'\x0a')+(_0x8de9ab(0x1cb)+_0x1f65ec+_0x8de9ab(0x1b1)+(_0x554ab4||_0x8de9ab(0x1a2))+_0x8de9ab(0x176)+_0x9cb05a)});_0x561a1d=_0x11e997,console[_0x8de9ab(0x1c2)](a4_0x29bfb6[_0x8de9ab(0x18d)](_0x8de9ab(0x1bd)+_0x11e997));}}}}if(!_0x561a1d)return console[_0x8de9ab(0x1c2)](a4_0x29bfb6[_0x8de9ab(0x15c)](_0x8de9ab(0x181))),console[_0x8de9ab(0x1c2)](_0x8de9ab(0x215)),console[_0x8de9ab(0x1c2)](_0x8de9ab(0x162)),console[_0x8de9ab(0x1c2)](_0x8de9ab(0x17a)),console[_0x8de9ab(0x1c2)](_0x8de9ab(0x1ea)),0x1;if(!_0x554ab4)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x8de9ab(0x20b),undefined,{'helpText':_0x8de9ab(0x1ad)});if(!_0x1fe4aa&&!_0x200bc3){if(!isInteractive())return console[_0x8de9ab(0x1b3)](a4_0x29bfb6[_0x8de9ab(0x1e7)](_0x8de9ab(0x1c5)),_0x8de9ab(0x1fc)),console[_0x8de9ab(0x1b3)](a4_0x29bfb6['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x36edc7=await confirmKey(_0x8de9ab(0x1bf)+_0x561a1d+_0x8de9ab(0x173)+_0x554ab4+'\x22?');if(!_0x36edc7)return console[_0x8de9ab(0x1c2)](a4_0x29bfb6[_0x8de9ab(0x15c)]('Cancelled')),0x1;}const {data:_0x5de113}=await withSpinner(_0x8de9ab(0x165)+_0x561a1d+_0x8de9ab(0x175)+_0x554ab4+_0x8de9ab(0x1aa),()=>_0x408ca2[_0x8de9ab(0x1d4)][_0x8de9ab(0x1d6)](_0x561a1d,_0x554ab4,{'dryRun':_0x200bc3}));if(_0x200bc3){console[_0x8de9ab(0x1c2)](a4_0x29bfb6['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x8de9ab(0x1c2)](_0x8de9ab(0x1f4)+_0x5de113[_0x8de9ab(0x1a4)]),console['log'](_0x8de9ab(0x160)+_0x554ab4),console[_0x8de9ab(0x1c2)]('Would\x20clone:'),console[_0x8de9ab(0x1c2)](_0x8de9ab(0x1ee)+_0x5de113[_0x8de9ab(0x212)]['agents']['created']),console['log'](_0x8de9ab(0x164)+_0x5de113[_0x8de9ab(0x212)]['knowledgeBases'][_0x8de9ab(0x20c)]),console[_0x8de9ab(0x1c2)]('\x20\x20Prompts:\x20'+_0x5de113[_0x8de9ab(0x212)]['prompts'][_0x8de9ab(0x20c)]),console[_0x8de9ab(0x1c2)](_0x8de9ab(0x1ec)+_0x5de113['counts'][_0x8de9ab(0x1f6)][_0x8de9ab(0x20c)]),console[_0x8de9ab(0x1c2)]('\x20\x20Chat\x20Interfaces:\x20'+_0x5de113[_0x8de9ab(0x212)][_0x8de9ab(0x1d5)][_0x8de9ab(0x20c)]);const _0x252c50=_0x5de113[_0x8de9ab(0x212)]['experimentalKnowledgeBases'][_0x8de9ab(0x20c)]>0x0||_0x5de113[_0x8de9ab(0x212)][_0x8de9ab(0x168)][_0x8de9ab(0x20c)]>0x0;return _0x252c50&&(console[_0x8de9ab(0x1c2)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x5de113['counts'][_0x8de9ab(0x209)][_0x8de9ab(0x20c)]),console[_0x8de9ab(0x1c2)](_0x8de9ab(0x197)+_0x5de113[_0x8de9ab(0x212)]['experimentalArtifacts'][_0x8de9ab(0x20c)])),0x0;}const _0x12c752=_0x5de113[_0x8de9ab(0x212)][_0x8de9ab(0x20f)][_0x8de9ab(0x18b)]>0x0||_0x5de113[_0x8de9ab(0x212)][_0x8de9ab(0x187)][_0x8de9ab(0x18b)]>0x0||_0x5de113[_0x8de9ab(0x212)][_0x8de9ab(0x1bb)]['errors']>0x0||_0x5de113[_0x8de9ab(0x212)][_0x8de9ab(0x1f6)][_0x8de9ab(0x18b)]>0x0||_0x5de113[_0x8de9ab(0x212)][_0x8de9ab(0x1d5)][_0x8de9ab(0x18b)]>0x0||_0x5de113['counts'][_0x8de9ab(0x209)][_0x8de9ab(0x18b)]>0x0||_0x5de113[_0x8de9ab(0x212)][_0x8de9ab(0x168)][_0x8de9ab(0x18b)]>0x0;_0x12c752?console[_0x8de9ab(0x1c2)](a4_0x29bfb6['yellow'](_0x8de9ab(0x18e))):console[_0x8de9ab(0x1c2)](a4_0x29bfb6[_0x8de9ab(0x180)]('Project\x20cloned\x20successfully'));console[_0x8de9ab(0x1c2)](_0x8de9ab(0x1f4)+_0x5de113[_0x8de9ab(0x1a4)]),console['log']('New\x20project:\x20'+_0x5de113[_0x8de9ab(0x195)]),console[_0x8de9ab(0x1c2)](_0x8de9ab(0x1b7)+_0x5de113[_0x8de9ab(0x1da)]),console[_0x8de9ab(0x1c2)](),console[_0x8de9ab(0x1c2)]('Summary:'),console[_0x8de9ab(0x1c2)](_0x8de9ab(0x1ee)+formatCountSummary(_0x5de113[_0x8de9ab(0x212)][_0x8de9ab(0x20f)])),console[_0x8de9ab(0x1c2)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5de113['counts'][_0x8de9ab(0x187)])),console[_0x8de9ab(0x1c2)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x5de113[_0x8de9ab(0x212)][_0x8de9ab(0x1bb)])),console[_0x8de9ab(0x1c2)](_0x8de9ab(0x203)+formatCountSummary(_0x5de113[_0x8de9ab(0x212)][_0x8de9ab(0x1b5)])),console[_0x8de9ab(0x1c2)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x5de113[_0x8de9ab(0x212)]['formInterfaces'])),console[_0x8de9ab(0x1c2)](_0x8de9ab(0x159)+formatCountSummary(_0x5de113[_0x8de9ab(0x212)]['chatInterfaces']));const _0x1c1c4c=_0x5de113[_0x8de9ab(0x212)][_0x8de9ab(0x209)][_0x8de9ab(0x20c)]>0x0||_0x5de113[_0x8de9ab(0x212)]['experimentalKnowledgeBases'][_0x8de9ab(0x1ac)]>0x0||_0x5de113['counts'][_0x8de9ab(0x209)][_0x8de9ab(0x201)]>0x0||_0x5de113[_0x8de9ab(0x212)][_0x8de9ab(0x168)][_0x8de9ab(0x20c)]>0x0||_0x5de113[_0x8de9ab(0x212)][_0x8de9ab(0x168)][_0x8de9ab(0x1ac)]>0x0||_0x5de113[_0x8de9ab(0x212)][_0x8de9ab(0x168)][_0x8de9ab(0x201)]>0x0;_0x1c1c4c&&(console['log'](_0x8de9ab(0x17e)+formatCountSummary(_0x5de113[_0x8de9ab(0x212)][_0x8de9ab(0x209)])),console[_0x8de9ab(0x1c2)](_0x8de9ab(0x197)+formatCountSummary(_0x5de113[_0x8de9ab(0x212)][_0x8de9ab(0x168)])));if(_0x12c752){console[_0x8de9ab(0x1c2)](),console[_0x8de9ab(0x1c2)](a4_0x29bfb6[_0x8de9ab(0x1e7)](_0x8de9ab(0x191)));for(const _0x375c13 of _0x5de113['agents']){_0x375c13[_0x8de9ab(0x16f)]==='error'&&console[_0x8de9ab(0x1c2)](a4_0x29bfb6[_0x8de9ab(0x1e7)](_0x8de9ab(0x177)+_0x375c13[_0x8de9ab(0x153)]+_0x8de9ab(0x192)+_0x375c13[_0x8de9ab(0x1b3)]));}for(const _0xb0d85d of _0x5de113[_0x8de9ab(0x187)]){_0xb0d85d[_0x8de9ab(0x16f)]===_0x8de9ab(0x1b3)&&console[_0x8de9ab(0x1c2)](a4_0x29bfb6['red'](_0x8de9ab(0x156)+_0xb0d85d['name']+'\x22:\x20'+_0xb0d85d[_0x8de9ab(0x1b3)]));}for(const _0x13de97 of _0x5de113[_0x8de9ab(0x1bb)]){_0x13de97[_0x8de9ab(0x16f)]===_0x8de9ab(0x1b3)&&console[_0x8de9ab(0x1c2)](a4_0x29bfb6[_0x8de9ab(0x1e7)](_0x8de9ab(0x1b0)+_0x13de97[_0x8de9ab(0x186)]+_0x8de9ab(0x192)+_0x13de97[_0x8de9ab(0x1b3)]));}for(const _0x4e8904 of _0x5de113['integrations']){_0x4e8904['action']===_0x8de9ab(0x1b3)&&console[_0x8de9ab(0x1c2)](a4_0x29bfb6['red']('\x20\x20Integration\x20\x22'+_0x4e8904[_0x8de9ab(0x186)]+_0x8de9ab(0x192)+_0x4e8904['error']));}for(const _0x3a8670 of _0x5de113[_0x8de9ab(0x1f6)]){_0x3a8670[_0x8de9ab(0x16f)]==='error'&&console['log'](a4_0x29bfb6[_0x8de9ab(0x1e7)](_0x8de9ab(0x178)+_0x3a8670[_0x8de9ab(0x186)]+'\x22:\x20'+_0x3a8670[_0x8de9ab(0x1b3)]));}for(const _0x35c876 of _0x5de113[_0x8de9ab(0x1d5)]){_0x35c876[_0x8de9ab(0x16f)]===_0x8de9ab(0x1b3)&&console[_0x8de9ab(0x1c2)](a4_0x29bfb6[_0x8de9ab(0x1e7)](_0x8de9ab(0x19a)+_0x35c876[_0x8de9ab(0x186)]+_0x8de9ab(0x192)+_0x35c876[_0x8de9ab(0x1b3)]));}for(const _0xa5c7ea of _0x5de113['experimentalKnowledgeBases']){_0xa5c7ea[_0x8de9ab(0x16f)]==='error'&&console['log'](a4_0x29bfb6['red'](_0x8de9ab(0x1e8)+_0xa5c7ea[_0x8de9ab(0x186)]+'\x22:\x20'+_0xa5c7ea[_0x8de9ab(0x1b3)]));}for(const _0x3938b2 of _0x5de113[_0x8de9ab(0x168)]){_0x3938b2[_0x8de9ab(0x16f)]===_0x8de9ab(0x1b3)&&console[_0x8de9ab(0x1c2)](a4_0x29bfb6[_0x8de9ab(0x1e7)](_0x8de9ab(0x172)+_0x3938b2[_0x8de9ab(0x186)]+_0x8de9ab(0x192)+_0x3938b2['error']));}return 0x1;}console['log']();const _0x85aa6e=getLLMProjectUrl(_0x30d34d,_0x5de113[_0x8de9ab(0x1da)]);return console[_0x8de9ab(0x1c2)]('Project:\x20'+a4_0x29bfb6[_0x8de9ab(0x1df)](_0x85aa6e)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x149976(0x186)]='agent:push';['description']=a4_0x149976(0x1a7);async[a4_0x149976(0x1d7)](_0x1f6349){const _0x7bd269=a4_0x149976,{options:_0x251748,args:_0x4cc156,tdx:_0xb85078}=_0x1f6349;let _0x5b2a8a=_0x4cc156[0x0]||process[_0x7bd269(0x1ae)]();const _0x50e2a8=_0x251748['dryRun'],_0x491be8=_0x251748[_0x7bd269(0x211)],_0x171103=_0x251748[_0x7bd269(0x1bc)],_0x21dcc7=_0x251748[_0x7bd269(0x1e2)],_0x2eea13=a4_0x316b39[_0x7bd269(0x14f)](_0x5b2a8a,_0x7bd269(0x19d)),_0x1d5566=existsSync(_0x2eea13);if(_0x1d5566){const {data:_0x33db72}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x5b2a8a+_0x7bd269(0x1aa),()=>_0xb85078[_0x7bd269(0x1d4)][_0x7bd269(0x17f)](_0x5b2a8a,{'dryRun':_0x50e2a8,'force':_0x491be8}));if(_0x50e2a8)return console['log'](a4_0x29bfb6[_0x7bd269(0x15c)](_0x7bd269(0x210))),console[_0x7bd269(0x1c2)](_0x7bd269(0x207)+_0x33db72['agentName']),0x0;if(_0x33db72['action']==='error')return console[_0x7bd269(0x1c2)](a4_0x29bfb6[_0x7bd269(0x1e7)](_0x7bd269(0x1a0)+_0x33db72[_0x7bd269(0x1b3)])),0x1;console[_0x7bd269(0x1c2)](a4_0x29bfb6[_0x7bd269(0x180)](_0x7bd269(0x1f9)+_0x33db72[_0x7bd269(0x16f)]+'\x20successfully')),console[_0x7bd269(0x1c2)]('Agent:\x20'+_0x33db72[_0x7bd269(0x153)]);if(_0x33db72['agentId']&&_0x33db72[_0x7bd269(0x19b)]){const _0x349df0=getLLMAgentChatUrl(_0x21dcc7,_0x33db72[_0x7bd269(0x19b)],_0x33db72[_0x7bd269(0x14e)]);console['log'](_0x7bd269(0x166)+a4_0x29bfb6[_0x7bd269(0x1df)](_0x349df0));}return 0x0;}const _0x6d3c73=_0x251748[_0x7bd269(0x158)],_0x117a5e=resolveProjectFromContext(_0x5b2a8a,_0x6d3c73);if(_0x117a5e[_0x7bd269(0x1b8)])_0x5b2a8a=_0x117a5e['projectDir'],_0x117a5e['source']===_0x7bd269(0x179)&&console[_0x7bd269(0x1c2)](a4_0x29bfb6['dim']('Using\x20project:\x20'+_0x5b2a8a));else{let _0x2fe1af='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x117a5e[_0x7bd269(0x174)]===_0x7bd269(0x163)&&(_0x2fe1af=_0x117a5e['message']+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x117a5e[_0x7bd269(0x158)]+_0x7bd269(0x1dc));throw new SDKError(ErrorCode[_0x7bd269(0x1ca)],_0x117a5e[_0x7bd269(0x174)]==='no_context'?_0x117a5e[_0x7bd269(0x1fd)]:_0x7bd269(0x1a1)+_0x5b2a8a,undefined,{'helpText':_0x2fe1af});}const {data:_0x3eac19}=await withSpinner(_0x7bd269(0x19f),()=>_0xb85078[_0x7bd269(0x1d4)][_0x7bd269(0x182)](_0x5b2a8a,{'dryRun':!![]})),_0x210adb=_0x3eac19[_0x7bd269(0x212)][_0x7bd269(0x20f)]['errors']>0x0;if(_0x210adb){console[_0x7bd269(0x1c2)](a4_0x29bfb6[_0x7bd269(0x1e7)]('\x0aErrors\x20found:'));for(const _0x36be0a of _0x3eac19[_0x7bd269(0x20f)]){_0x36be0a[_0x7bd269(0x16f)]===_0x7bd269(0x1b3)&&console[_0x7bd269(0x1c2)](a4_0x29bfb6[_0x7bd269(0x1e7)](_0x7bd269(0x177)+_0x36be0a[_0x7bd269(0x153)]+_0x7bd269(0x192)+_0x36be0a[_0x7bd269(0x1b3)]));}return 0x1;}const _0x24f479=_0x3eac19['counts']['agents'][_0x7bd269(0x20c)]+_0x3eac19[_0x7bd269(0x212)][_0x7bd269(0x187)][_0x7bd269(0x20c)]+_0x3eac19[_0x7bd269(0x212)][_0x7bd269(0x183)]['created']+_0x3eac19['counts'][_0x7bd269(0x1bb)][_0x7bd269(0x20c)]+_0x3eac19[_0x7bd269(0x212)][_0x7bd269(0x1b5)][_0x7bd269(0x20c)]+_0x3eac19['counts'][_0x7bd269(0x209)][_0x7bd269(0x20c)]+_0x3eac19['counts']['experimentalArtifacts'][_0x7bd269(0x20c)]+_0x3eac19[_0x7bd269(0x212)][_0x7bd269(0x1f6)][_0x7bd269(0x20c)]+_0x3eac19[_0x7bd269(0x212)]['chatInterfaces'][_0x7bd269(0x20c)],_0xf84c85=_0x3eac19[_0x7bd269(0x212)][_0x7bd269(0x20f)][_0x7bd269(0x1ac)]+_0x3eac19[_0x7bd269(0x212)][_0x7bd269(0x187)][_0x7bd269(0x1ac)]+_0x3eac19[_0x7bd269(0x212)][_0x7bd269(0x183)][_0x7bd269(0x1ac)]+_0x3eac19['counts'][_0x7bd269(0x1bb)]['updated']+_0x3eac19['counts'][_0x7bd269(0x1b5)]['updated']+_0x3eac19[_0x7bd269(0x212)]['experimentalKnowledgeBases'][_0x7bd269(0x1ac)]+_0x3eac19[_0x7bd269(0x212)][_0x7bd269(0x168)][_0x7bd269(0x1ac)]+_0x3eac19[_0x7bd269(0x212)][_0x7bd269(0x1f6)][_0x7bd269(0x1ac)]+_0x3eac19[_0x7bd269(0x212)][_0x7bd269(0x1d5)][_0x7bd269(0x1ac)],_0x13004f=_0x3eac19[_0x7bd269(0x212)]['agents'][_0x7bd269(0x201)]+_0x3eac19['counts'][_0x7bd269(0x187)]['unchanged']+_0x3eac19[_0x7bd269(0x212)][_0x7bd269(0x183)][_0x7bd269(0x201)]+_0x3eac19[_0x7bd269(0x212)][_0x7bd269(0x1bb)][_0x7bd269(0x201)]+_0x3eac19[_0x7bd269(0x212)][_0x7bd269(0x1b5)]['unchanged']+_0x3eac19['counts'][_0x7bd269(0x209)][_0x7bd269(0x201)]+_0x3eac19['counts'][_0x7bd269(0x168)][_0x7bd269(0x201)]+_0x3eac19['counts'][_0x7bd269(0x1f6)][_0x7bd269(0x201)]+_0x3eac19[_0x7bd269(0x212)][_0x7bd269(0x1d5)][_0x7bd269(0x201)];console['log'](_0x7bd269(0x205)+_0x3eac19['projectName']+'\x27:'),console[_0x7bd269(0x1c2)]('\x20\x20'+a4_0x29bfb6[_0x7bd269(0x180)]('+\x20'+_0x24f479+'\x20new')+_0x7bd269(0x18a)+a4_0x29bfb6[_0x7bd269(0x15c)]('~\x20'+_0xf84c85+_0x7bd269(0x208))+_0x7bd269(0x18a)+a4_0x29bfb6[_0x7bd269(0x18d)]('=\x20'+_0x13004f+_0x7bd269(0x1d3))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x3eac19[_0x7bd269(0x212)][_0x7bd269(0x20f)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3eac19['counts'][_0x7bd269(0x187)])),console[_0x7bd269(0x1c2)](_0x7bd269(0x1e4)+formatCountSummary(_0x3eac19[_0x7bd269(0x212)]['textKnowledgeBases'])),console[_0x7bd269(0x1c2)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x3eac19[_0x7bd269(0x212)][_0x7bd269(0x1bb)])),console['log'](_0x7bd269(0x203)+formatCountSummary(_0x3eac19['counts'][_0x7bd269(0x1b5)])),console[_0x7bd269(0x1c2)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x3eac19[_0x7bd269(0x212)][_0x7bd269(0x1f6)])),console[_0x7bd269(0x1c2)](_0x7bd269(0x159)+formatCountSummary(_0x3eac19[_0x7bd269(0x212)][_0x7bd269(0x1d5)]));const _0x4c3491=_0x3eac19[_0x7bd269(0x212)][_0x7bd269(0x209)][_0x7bd269(0x20c)]>0x0||_0x3eac19[_0x7bd269(0x212)][_0x7bd269(0x209)][_0x7bd269(0x1ac)]>0x0||_0x3eac19['counts']['experimentalKnowledgeBases']['unchanged']>0x0||_0x3eac19['counts'][_0x7bd269(0x168)]['created']>0x0||_0x3eac19[_0x7bd269(0x212)][_0x7bd269(0x168)][_0x7bd269(0x1ac)]>0x0||_0x3eac19[_0x7bd269(0x212)][_0x7bd269(0x168)][_0x7bd269(0x201)]>0x0;_0x4c3491&&(console[_0x7bd269(0x1c2)](_0x7bd269(0x17e)+formatCountSummary(_0x3eac19['counts'][_0x7bd269(0x209)])),console[_0x7bd269(0x1c2)](_0x7bd269(0x197)+formatCountSummary(_0x3eac19[_0x7bd269(0x212)][_0x7bd269(0x168)])));console['log'](_0x7bd269(0x19e)+a4_0x29bfb6[_0x7bd269(0x1df)](_0x5b2a8a)),displayDiffs(_0x3eac19[_0x7bd269(0x20f)],_0x3eac19['knowledgeBases'],_0x3eac19[_0x7bd269(0x183)],_0x3eac19['prompts'],_0x3eac19[_0x7bd269(0x1b5)],_0x3eac19[_0x7bd269(0x209)],_0x3eac19[_0x7bd269(0x168)],_0x3eac19[_0x7bd269(0x1f6)],_0x3eac19[_0x7bd269(0x1d5)]);if(_0x50e2a8)return console[_0x7bd269(0x1c2)](a4_0x29bfb6[_0x7bd269(0x15c)](_0x7bd269(0x1f5))),0x0;if(_0x24f479===0x0&&_0xf84c85===0x0){console['log'](a4_0x29bfb6['green'](_0x7bd269(0x214)));const _0x3edc1b=getLLMProjectUrl(_0x21dcc7,_0x3eac19[_0x7bd269(0x19b)]);return console[_0x7bd269(0x1c2)](_0x7bd269(0x1ff)+a4_0x29bfb6[_0x7bd269(0x1df)](_0x3edc1b)),0x0;}if(!_0x171103&&!_0x491be8){if(!isInteractive())return console[_0x7bd269(0x1b3)](a4_0x29bfb6[_0x7bd269(0x1e7)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x7bd269(0x1b3)](a4_0x29bfb6[_0x7bd269(0x18d)](_0x7bd269(0x194))),0x1;const _0x3f6f7e=await confirmKey(_0x7bd269(0x202)+(_0x24f479+_0xf84c85)+_0x7bd269(0x1f7));if(!_0x3f6f7e)return console[_0x7bd269(0x1c2)](a4_0x29bfb6['yellow'](_0x7bd269(0x1af)),_0x7bd269(0x16d)),0x1;}const {data:_0x551de8}=await withSpinner(_0x7bd269(0x1b9),()=>_0xb85078[_0x7bd269(0x1d4)][_0x7bd269(0x182)](_0x5b2a8a,{'force':_0x491be8})),_0x5cda32=_0x551de8[_0x7bd269(0x212)][_0x7bd269(0x20f)][_0x7bd269(0x18b)]>0x0||_0x551de8[_0x7bd269(0x212)][_0x7bd269(0x187)][_0x7bd269(0x18b)]>0x0||_0x551de8[_0x7bd269(0x212)][_0x7bd269(0x183)][_0x7bd269(0x18b)]>0x0||_0x551de8[_0x7bd269(0x212)][_0x7bd269(0x1bb)][_0x7bd269(0x18b)]>0x0||_0x551de8[_0x7bd269(0x212)]['formInterfaces'][_0x7bd269(0x18b)]>0x0||_0x551de8[_0x7bd269(0x212)][_0x7bd269(0x1d5)][_0x7bd269(0x18b)]>0x0;if(_0x5cda32){console['log'](a4_0x29bfb6[_0x7bd269(0x15c)](_0x7bd269(0x1cc))),console[_0x7bd269(0x1c2)](),console[_0x7bd269(0x1c2)](a4_0x29bfb6[_0x7bd269(0x1e7)](_0x7bd269(0x191)));for(const _0x43e768 of _0x551de8['agents']){_0x43e768[_0x7bd269(0x16f)]===_0x7bd269(0x1b3)&&console[_0x7bd269(0x1c2)](a4_0x29bfb6[_0x7bd269(0x1e7)](_0x7bd269(0x177)+_0x43e768['agentName']+_0x7bd269(0x192)+_0x43e768['error']));}for(const _0xf40f7f of _0x551de8[_0x7bd269(0x187)]){_0xf40f7f['action']===_0x7bd269(0x1b3)&&console['log'](a4_0x29bfb6[_0x7bd269(0x1e7)]('\x20\x20Knowledge\x20Base\x20\x22'+_0xf40f7f[_0x7bd269(0x186)]+'\x22:\x20'+_0xf40f7f[_0x7bd269(0x1b3)]));}for(const _0x2e525d of _0x551de8[_0x7bd269(0x183)]){_0x2e525d[_0x7bd269(0x16f)]===_0x7bd269(0x1b3)&&console[_0x7bd269(0x1c2)](a4_0x29bfb6[_0x7bd269(0x1e7)](_0x7bd269(0x1dd)+_0x2e525d[_0x7bd269(0x186)]+_0x7bd269(0x192)+_0x2e525d[_0x7bd269(0x1b3)]));}for(const _0x5e49d4 of _0x551de8[_0x7bd269(0x1bb)]){_0x5e49d4[_0x7bd269(0x16f)]===_0x7bd269(0x1b3)&&console[_0x7bd269(0x1c2)](a4_0x29bfb6[_0x7bd269(0x1e7)](_0x7bd269(0x1b0)+_0x5e49d4[_0x7bd269(0x186)]+'\x22:\x20'+_0x5e49d4[_0x7bd269(0x1b3)]));}for(const _0x16ec9f of _0x551de8[_0x7bd269(0x1b5)]){_0x16ec9f[_0x7bd269(0x16f)]===_0x7bd269(0x1b3)&&console[_0x7bd269(0x1c2)](a4_0x29bfb6[_0x7bd269(0x1e7)]('\x20\x20Integration\x20\x22'+_0x16ec9f[_0x7bd269(0x186)]+_0x7bd269(0x192)+_0x16ec9f[_0x7bd269(0x1b3)]));}for(const _0x460e58 of _0x551de8[_0x7bd269(0x1f6)]){_0x460e58[_0x7bd269(0x16f)]===_0x7bd269(0x1b3)&&console['log'](a4_0x29bfb6[_0x7bd269(0x1e7)]('\x20\x20Form\x20Interface\x20\x22'+_0x460e58[_0x7bd269(0x186)]+_0x7bd269(0x192)+_0x460e58[_0x7bd269(0x1b3)]));}for(const _0x3b7432 of _0x551de8['chatInterfaces']){_0x3b7432[_0x7bd269(0x16f)]===_0x7bd269(0x1b3)&&console[_0x7bd269(0x1c2)](a4_0x29bfb6[_0x7bd269(0x1e7)](_0x7bd269(0x19a)+_0x3b7432[_0x7bd269(0x186)]+'\x22:\x20'+_0x3b7432[_0x7bd269(0x1b3)]));}return 0x1;}console['log'](a4_0x29bfb6[_0x7bd269(0x180)](_0x7bd269(0x170)+(_0x24f479+_0xf84c85)+_0x7bd269(0x1d0)+_0x551de8[_0x7bd269(0x1db)]+'\x27'));const _0x1f4198=getLLMProjectUrl(_0x21dcc7,_0x551de8[_0x7bd269(0x19b)]);return console[_0x7bd269(0x1c2)](_0x7bd269(0x1ff)+a4_0x29bfb6[_0x7bd269(0x1df)](_0x1f4198)),0x0;}}
1
+ const a4_0x216ccd=a4_0x15c3;(function(_0x3c0d4c,_0x1adb94){const _0x3199cb=a4_0x15c3,_0x5e3dda=_0x3c0d4c();while(!![]){try{const _0x210dbb=parseInt(_0x3199cb(0x13f))/0x1*(-parseInt(_0x3199cb(0x118))/0x2)+-parseInt(_0x3199cb(0x15b))/0x3*(-parseInt(_0x3199cb(0x184))/0x4)+-parseInt(_0x3199cb(0x183))/0x5+parseInt(_0x3199cb(0x192))/0x6*(-parseInt(_0x3199cb(0x158))/0x7)+parseInt(_0x3199cb(0x1a8))/0x8*(parseInt(_0x3199cb(0x147))/0x9)+-parseInt(_0x3199cb(0x1a7))/0xa+parseInt(_0x3199cb(0x17a))/0xb;if(_0x210dbb===_0x1adb94)break;else _0x5e3dda['push'](_0x5e3dda['shift']());}catch(_0x153c63){_0x5e3dda['push'](_0x5e3dda['shift']());}}}(a4_0x5680,0x4f917));import a4_0xfc4d30 from'chalk';import a4_0x1a0f62 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';function a4_0x5680(){const _0x484d0c=['\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','llm','experimentalKnowledgeBases','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20\x20Prompt\x20\x22','agent:clone','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','description','<new-name>','pushProject','llm_project','Using\x20project\x20from\x20context:\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Pushing\x20to\x20project...','\x20resources\x20to\x20\x27','found','\x22\x20to\x20\x22','created','\x20\x20Experimental\x20Artifact\x20\x22','\x20|\x20','newProjectId','counts','Project\x20cloned\x20successfully','\x0aWrite\x20','\x20new','new','\x20updated','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','Would\x20pull\x20agent:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20unchanged','MISSING_ARGUMENT','4657yqbGTI','Dry\x20run\x20-\x20no\x20changes\x20made','chatInterfaces','formInterfaces','output','experimentalArtifacts','New\x20project:\x20','updated','9lHcgiC','Cancelled','Project:\x20','total','\x20\x20Agent\x20\x22','\x0aPush\x20','Using\x20context\x20project:\x20','\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','projectDir','Project\x20cloned\x20with\x20errors','\x0a✔\x20Pulled\x20','Output:\x20','source','agent','parse','agentId','\x0aPush\x20summary\x20for\x20\x27','18970vpVgYQ','\x20\x20tdx\x20agent\x20pull\x20','sourceProjectName','787860tNEgMX','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Failed\x20to\x20push\x20agent:\x20','\x0aChanges:','Using\x20project\x20from\x20','\x20created','\x20\x20Integration\x20\x22','\x20\x20Source:\x20','Would\x20clone:','\x0aErrors\x20found:','agent:pull','\x20=\x20','projectName','projectId','\x0aChanges\x20to\x20form\x20interface\x20\x27','name','\x20\x20Knowledge\x20Base\x20\x22','message','\x20successfully','\x20\x20Form\x20Interface\x20\x22','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x22\x20to\x20a\x20different\x20profile','Clone\x20\x22','\x20\x20Chat\x20Interfaces:\x20','\x0aChanges\x20to\x20integration\x20\x27','Cloning\x20\x22','\x20errors','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','4613114yZigGO','\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','knowledgeBases','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','integrations','textKnowledgeBases','newProjectName','Status:\x20','\x22:\x20','219675TQBUVb','4tuuLbD','Source:\x20','utf-8','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','agentName','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','prompts','\x20\x20Integrations:\x20','log','isNew','yes','Output\x20path:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','dryRun','378fMSSyx','\x22...','repeat','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','tdx.json','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','dirname','agents','force','agent:push','diff','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','session','\x0aProject\x20pushed\x20with\x20errors','\x20\x20tdx\x20agent\x20clone\x20agents/','pullAgent','cloneProject','outputPath','red','INVALID_ARGUMENT','cyan','2785470KSTClG','1804896lDMVgi','\x20files?','error','\x20\x20Form\x20Interfaces:\x20','No\x20tdx.json\x20found\x20in\x20','dim','\x20\x20Prompts:\x20','cwd','\x20--profile\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','context','-\x20nothing\x20pushed','Agent\x20','reason','gray','Summary:','\x20files\x20to\x20','push','pushAgent','outputDir','llmProject','\x0aChanges\x20to\x20prompt\x20\x27','New\x20project\x20name\x20is\x20required','hasChanges','unchanged','\x20\x20Experimental\x20Artifacts:\x20','action','-\x20no\x20files\x20written','\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','Agent\x20pulled\x20successfully','execute','site','\x0aPull\x20summary\x20for\x20\x27','\x20resources?','\x0aError:','pullProject','errors','\x20changed','green','no_local_folder','\x0aChanges\x20to\x20chat\x20interface\x20\x27','\x0a✔\x20Pushed\x20','\x0aChanges\x20to\x20agent\x20\x27','Agent:\x20','\x20\x20Agents:\x20','\x20total','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)','Using\x20local\x20project:\x20','yellow','✔\x20Context\x20set:\x20','Using\x20project:\x20','profile','38GipHrD','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20\x20Knowledge\x20Bases:\x20','\x20\x20Chat\x20Interface\x20\x22','join'];a4_0x5680=function(){return _0x484d0c;};return a4_0x5680();}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(_0x59fb6e){const _0x10a5ef=a4_0x15c3,_0x104168=[];if(_0x59fb6e[_0x10a5ef(0x14a)]!==undefined)_0x104168[_0x10a5ef(0xf5)](_0x59fb6e['total']+_0x10a5ef(0x111));if(_0x59fb6e[_0x10a5ef(0x138)]!==undefined&&_0x59fb6e[_0x10a5ef(0x138)]>0x0)_0x104168[_0x10a5ef(0xf5)](a4_0xfc4d30[_0x10a5ef(0x10a)](_0x59fb6e[_0x10a5ef(0x138)]+_0x10a5ef(0x137)));if(_0x59fb6e[_0x10a5ef(0x130)]!==undefined&&_0x59fb6e[_0x10a5ef(0x130)]>0x0)_0x104168['push'](a4_0xfc4d30[_0x10a5ef(0x10a)](_0x59fb6e['created']+_0x10a5ef(0x161)));if(_0x59fb6e[_0x10a5ef(0x146)]!==undefined&&_0x59fb6e['updated']>0x0)_0x104168[_0x10a5ef(0xf5)](a4_0xfc4d30[_0x10a5ef(0x114)](_0x59fb6e[_0x10a5ef(0x146)]+_0x10a5ef(0x139)));if(_0x59fb6e['unchanged']!==undefined&&_0x59fb6e[_0x10a5ef(0xfc)]>0x0)_0x104168[_0x10a5ef(0xf5)](a4_0xfc4d30['gray'](_0x59fb6e['unchanged']+_0x10a5ef(0x13d)));if(_0x59fb6e[_0x10a5ef(0x108)]!==undefined&&_0x59fb6e[_0x10a5ef(0x108)]>0x0)_0x104168[_0x10a5ef(0xf5)](a4_0xfc4d30['red'](_0x59fb6e[_0x10a5ef(0x108)]+_0x10a5ef(0x178)));return _0x104168['join'](',\x20');}function displayDiffs(_0xf9b738,_0x1d2a8d,_0x949d76,_0x39bc49,_0x5d3924,_0x3c55a0,_0x2691b2,_0x392338,_0x470889){const _0x318b1f=a4_0x15c3;for(const _0xfdcec8 of _0xf9b738){if(_0xfdcec8['diff']){const _0xf8d241=_0xfdcec8['agentName']||_0xfdcec8[_0x318b1f(0x16b)];console['log'](_0x318b1f(0x10e)+_0xf8d241+'\x27:'),console[_0x318b1f(0x18c)]('─'[_0x318b1f(0x194)](0x3c)),console[_0x318b1f(0x18c)](_0xfdcec8[_0x318b1f(0x19c)]),console[_0x318b1f(0x18c)]('─'[_0x318b1f(0x194)](0x3c));}}for(const _0x4c2a36 of _0x1d2a8d){_0x4c2a36['diff']&&(console[_0x318b1f(0x18c)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x4c2a36[_0x318b1f(0x16b)]+'\x27:'),console[_0x318b1f(0x18c)]('─'[_0x318b1f(0x194)](0x3c)),console[_0x318b1f(0x18c)](_0x4c2a36[_0x318b1f(0x19c)]),console[_0x318b1f(0x18c)]('─'[_0x318b1f(0x194)](0x3c)));}for(const _0x37c300 of _0x949d76){_0x37c300['diff']&&(console[_0x318b1f(0x18c)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x37c300[_0x318b1f(0x16b)]+'\x27:'),console[_0x318b1f(0x18c)]('─'[_0x318b1f(0x194)](0x3c)),console[_0x318b1f(0x18c)](_0x37c300[_0x318b1f(0x19c)]),console[_0x318b1f(0x18c)]('─'[_0x318b1f(0x194)](0x3c)));}for(const _0x7dd3ac of _0x39bc49){_0x7dd3ac[_0x318b1f(0x19c)]&&(console['log'](_0x318b1f(0xf9)+_0x7dd3ac[_0x318b1f(0x16b)]+'\x27:'),console[_0x318b1f(0x18c)]('─'['repeat'](0x3c)),console[_0x318b1f(0x18c)](_0x7dd3ac['diff']),console[_0x318b1f(0x18c)]('─'['repeat'](0x3c)));}for(const _0x544854 of _0x5d3924){_0x544854['diff']&&(console[_0x318b1f(0x18c)](_0x318b1f(0x176)+_0x544854['name']+'\x27:'),console[_0x318b1f(0x18c)]('─'['repeat'](0x3c)),console[_0x318b1f(0x18c)](_0x544854[_0x318b1f(0x19c)]),console[_0x318b1f(0x18c)]('─'['repeat'](0x3c)));}for(const _0x41c1f5 of _0x3c55a0){_0x41c1f5[_0x318b1f(0x19c)]&&(console[_0x318b1f(0x18c)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x41c1f5['name']+'\x27:'),console[_0x318b1f(0x18c)]('─'['repeat'](0x3c)),console['log'](_0x41c1f5[_0x318b1f(0x19c)]),console[_0x318b1f(0x18c)]('─'[_0x318b1f(0x194)](0x3c)));}for(const _0x244f0c of _0x2691b2){_0x244f0c['diff']&&(console[_0x318b1f(0x18c)](_0x318b1f(0x170)+_0x244f0c[_0x318b1f(0x16b)]+'\x27:'),console['log']('─'[_0x318b1f(0x194)](0x3c)),console[_0x318b1f(0x18c)](_0x244f0c[_0x318b1f(0x19c)]),console[_0x318b1f(0x18c)]('─'[_0x318b1f(0x194)](0x3c)));}for(const _0x266284 of _0x392338){_0x266284[_0x318b1f(0x19c)]&&(console[_0x318b1f(0x18c)](_0x318b1f(0x16a)+_0x266284[_0x318b1f(0x16b)]+'\x27:'),console[_0x318b1f(0x18c)]('─'[_0x318b1f(0x194)](0x3c)),console[_0x318b1f(0x18c)](_0x266284[_0x318b1f(0x19c)]),console[_0x318b1f(0x18c)]('─'[_0x318b1f(0x194)](0x3c)));}for(const _0xf6a7f5 of _0x470889){_0xf6a7f5[_0x318b1f(0x19c)]&&(console['log'](_0x318b1f(0x10c)+_0xf6a7f5[_0x318b1f(0x16b)]+'\x27:'),console[_0x318b1f(0x18c)]('─'['repeat'](0x3c)),console[_0x318b1f(0x18c)](_0xf6a7f5[_0x318b1f(0x19c)]),console['log']('─'[_0x318b1f(0x194)](0x3c)));}}function a4_0x15c3(_0x56bbd2,_0x40a301){_0x56bbd2=_0x56bbd2-0xed;const _0x568075=a4_0x5680();let _0x15c385=_0x568075[_0x56bbd2];return _0x15c385;}export class AgentPullCommand extends BaseCommand{[a4_0x216ccd(0x16b)]=a4_0x216ccd(0x166);['description']=a4_0x216ccd(0x13c);async['execute'](_0x4ac4bd){const _0xc831a4=a4_0x216ccd,{options:_0x550c1d,args:_0xf52194,tdx:_0x4de323}=_0x4ac4bd,_0x42fc93=_0xf52194[0x0],_0x43e9ea=_0xf52194[0x1],_0x1f081d=_0x550c1d[_0xc831a4(0x143)],_0x8dea6d=_0x550c1d[_0xc831a4(0x191)],_0xb8eeb1=_0x550c1d[_0xc831a4(0x19a)],_0x49525a=_0x550c1d['yes'],_0x4c88d0=_0x550c1d[_0xc831a4(0xf8)],_0x59e0a9=_0x550c1d[_0xc831a4(0x154)];let _0x46e8ee;if(_0x42fc93){const _0x5e5bf5=a4_0x1a0f62[_0xc831a4(0x11c)](_0x42fc93,'tdx.json');if(existsSync(_0x5e5bf5))try{const _0x4fdfa3=JSON['parse'](readFileSync(_0x5e5bf5,_0xc831a4(0x186)));_0x4fdfa3[_0xc831a4(0x129)]&&(_0x46e8ee={'llm_project':_0x4fdfa3['llm_project']});}catch{}}const _0x5d5ba9=findAgentConfigPath(process[_0xc831a4(0x1af)]());let _0x5cf424;if(_0x5d5ba9)try{const _0x525039=JSON[_0xc831a4(0x155)](readFileSync(_0x5d5ba9,_0xc831a4(0x186)));_0x525039[_0xc831a4(0x129)]&&(_0x5cf424={'llm_project':_0x525039['llm_project']});}catch{}const _0x267bd9=resolveAgentPullArgs({'arg':_0x42fc93,'agentNameArg':_0x43e9ea,'agentFlag':_0x59e0a9,'contextProject':_0x4c88d0,'argDirConfig':_0x46e8ee,'cwdConfigPath':_0x5d5ba9||undefined,'cwdConfig':_0x5cf424}),{projectNameOrId:_0x238451,targetAgentName:_0x552be1,existingOutputDir:_0x76a152,source:_0x3f536a}=_0x267bd9;if(_0x3f536a==='arg-dir')console[_0xc831a4(0x18c)](a4_0xfc4d30[_0xc831a4(0x1ad)](_0xc831a4(0x160)+a4_0x1a0f62[_0xc831a4(0x11c)](_0x42fc93,'tdx.json')+':\x20'+_0x238451));else{if(_0x3f536a==='cwd-config')console[_0xc831a4(0x18c)](a4_0xfc4d30[_0xc831a4(0x1ad)](_0xc831a4(0x116)+_0x238451));else _0x3f536a===_0xc831a4(0xee)&&console[_0xc831a4(0x18c)](a4_0xfc4d30[_0xc831a4(0x1ad)](_0xc831a4(0x12a)+_0x238451));}if(!_0x238451)return _0x59e0a9?(console['log'](a4_0xfc4d30[_0xc831a4(0x114)]('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console['log'](_0xc831a4(0x189)),console[_0xc831a4(0x18c)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console['log'](a4_0xfc4d30[_0xc831a4(0x114)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0xc831a4(0x18c)](_0xc831a4(0x112)),console[_0xc831a4(0x18c)](_0xc831a4(0x171)),console[_0xc831a4(0x18c)](_0xc831a4(0x17b)),console[_0xc831a4(0x18c)](_0xc831a4(0x100)),console[_0xc831a4(0x18c)](_0xc831a4(0x14e))),0x1;if(_0x552be1){const {data:_0x3d4d30}=await withSpinner('Pulling\x20agent\x20\x22'+_0x552be1+'\x22\x20from\x20project\x20\x22'+_0x238451+'\x22...',()=>_0x4de323[_0xc831a4(0x11e)][_0xc831a4(0x1a1)](_0x238451,_0x552be1,_0x1f081d,{'dryRun':_0x8dea6d,'force':_0xb8eeb1}));if(_0x8dea6d)return console[_0xc831a4(0x18c)](a4_0xfc4d30[_0xc831a4(0x114)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0xc831a4(0x18c)](_0xc831a4(0x13b)+_0x3d4d30[_0xc831a4(0x188)]),console['log'](_0xc831a4(0x18f)+_0x3d4d30['outputPath']),_0x3d4d30[_0xc831a4(0x19c)]&&(console[_0xc831a4(0x18c)](_0xc831a4(0x15f)),console[_0xc831a4(0x18c)]('─'['repeat'](0x3c)),console['log'](_0x3d4d30[_0xc831a4(0x19c)]),console['log']('─'['repeat'](0x3c))),0x0;return console[_0xc831a4(0x18c)](a4_0xfc4d30[_0xc831a4(0x10a)](_0xc831a4(0x101))),console[_0xc831a4(0x18c)](_0xc831a4(0x10f)+_0x3d4d30[_0xc831a4(0x188)]),console[_0xc831a4(0x18c)](_0xc831a4(0x152)+_0x3d4d30[_0xc831a4(0x1a3)]),console['log'](_0xc831a4(0x181)+(_0x3d4d30[_0xc831a4(0x18d)]?a4_0xfc4d30[_0xc831a4(0x10a)](_0xc831a4(0x138)):_0x3d4d30[_0xc831a4(0xfb)]?a4_0xfc4d30['yellow']('updated'):a4_0xfc4d30[_0xc831a4(0xf2)](_0xc831a4(0xfc)))),0x0;}const _0xb16376=_0x76a152||_0x1f081d,{data:_0x43e1ad}=await withSpinner('Analyzing\x20project\x20\x22'+_0x238451+_0xc831a4(0x193),()=>_0x4de323[_0xc831a4(0x11e)][_0xc831a4(0x107)](_0x238451,_0xb16376,{'dryRun':!![]})),_0x95c12a=_0x43e1ad[_0xc831a4(0x134)][_0xc831a4(0x199)][_0xc831a4(0x138)]+_0x43e1ad[_0xc831a4(0x134)][_0xc831a4(0x17c)][_0xc831a4(0x138)]+_0x43e1ad[_0xc831a4(0x134)][_0xc831a4(0x17f)][_0xc831a4(0x138)]+_0x43e1ad[_0xc831a4(0x134)][_0xc831a4(0x18a)]['new']+_0x43e1ad[_0xc831a4(0x134)][_0xc831a4(0x17e)]['new']+_0x43e1ad[_0xc831a4(0x134)][_0xc831a4(0x11f)][_0xc831a4(0x138)]+_0x43e1ad[_0xc831a4(0x134)]['experimentalArtifacts'][_0xc831a4(0x138)]+_0x43e1ad[_0xc831a4(0x134)][_0xc831a4(0x142)][_0xc831a4(0x138)]+_0x43e1ad[_0xc831a4(0x134)][_0xc831a4(0x141)]['new'],_0xcd1802=_0x43e1ad[_0xc831a4(0x134)][_0xc831a4(0x199)]['updated']+_0x43e1ad['counts'][_0xc831a4(0x17c)][_0xc831a4(0x146)]+_0x43e1ad[_0xc831a4(0x134)][_0xc831a4(0x17f)][_0xc831a4(0x146)]+_0x43e1ad[_0xc831a4(0x134)]['prompts'][_0xc831a4(0x146)]+_0x43e1ad[_0xc831a4(0x134)]['integrations']['updated']+_0x43e1ad[_0xc831a4(0x134)][_0xc831a4(0x11f)][_0xc831a4(0x146)]+_0x43e1ad[_0xc831a4(0x134)]['experimentalArtifacts']['updated']+_0x43e1ad[_0xc831a4(0x134)]['formInterfaces']['updated']+_0x43e1ad[_0xc831a4(0x134)][_0xc831a4(0x141)][_0xc831a4(0x146)],_0x167afe=_0x43e1ad[_0xc831a4(0x134)][_0xc831a4(0x199)]['unchanged']+_0x43e1ad[_0xc831a4(0x134)][_0xc831a4(0x17c)][_0xc831a4(0xfc)]+_0x43e1ad[_0xc831a4(0x134)]['textKnowledgeBases'][_0xc831a4(0xfc)]+_0x43e1ad[_0xc831a4(0x134)][_0xc831a4(0x18a)][_0xc831a4(0xfc)]+_0x43e1ad[_0xc831a4(0x134)][_0xc831a4(0x17e)][_0xc831a4(0xfc)]+_0x43e1ad[_0xc831a4(0x134)]['experimentalKnowledgeBases']['unchanged']+_0x43e1ad[_0xc831a4(0x134)][_0xc831a4(0x144)][_0xc831a4(0xfc)]+_0x43e1ad[_0xc831a4(0x134)][_0xc831a4(0x142)][_0xc831a4(0xfc)]+_0x43e1ad[_0xc831a4(0x134)][_0xc831a4(0x141)][_0xc831a4(0xfc)];console['log'](_0xc831a4(0x104)+_0x43e1ad[_0xc831a4(0x168)]+'\x27:'),console['log']('\x20\x20'+a4_0xfc4d30[_0xc831a4(0x10a)]('+\x20'+_0x95c12a+_0xc831a4(0x137))+_0xc831a4(0x132)+a4_0xfc4d30['yellow']('~\x20'+_0xcd1802+_0xc831a4(0x109))+_0xc831a4(0x132)+a4_0xfc4d30[_0xc831a4(0x1ad)]('=\x20'+_0x167afe+_0xc831a4(0x13d))),console[_0xc831a4(0x18c)]('\x20\x20Agents:\x20'+formatCountSummary(_0x43e1ad[_0xc831a4(0x134)][_0xc831a4(0x199)])),console[_0xc831a4(0x18c)](_0xc831a4(0x11a)+formatCountSummary(_0x43e1ad[_0xc831a4(0x134)]['knowledgeBases'])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x43e1ad[_0xc831a4(0x134)][_0xc831a4(0x17f)])),console[_0xc831a4(0x18c)](_0xc831a4(0x1ae)+formatCountSummary(_0x43e1ad[_0xc831a4(0x134)][_0xc831a4(0x18a)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x43e1ad['counts'][_0xc831a4(0x17e)])),console['log'](_0xc831a4(0x1ab)+formatCountSummary(_0x43e1ad[_0xc831a4(0x134)]['formInterfaces'])),console[_0xc831a4(0x18c)](_0xc831a4(0x175)+formatCountSummary(_0x43e1ad[_0xc831a4(0x134)][_0xc831a4(0x141)]));const _0x1018fd=_0x43e1ad['counts'][_0xc831a4(0x11f)][_0xc831a4(0x14a)]>0x0||_0x43e1ad[_0xc831a4(0x134)][_0xc831a4(0x144)][_0xc831a4(0x14a)]>0x0;_0x1018fd&&(console[_0xc831a4(0x18c)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x43e1ad[_0xc831a4(0x134)][_0xc831a4(0x11f)])),console['log'](_0xc831a4(0xfd)+formatCountSummary(_0x43e1ad[_0xc831a4(0x134)]['experimentalArtifacts'])));console[_0xc831a4(0x18c)]('\x20\x20Target:\x20'+a4_0xfc4d30[_0xc831a4(0x1a6)](_0x43e1ad[_0xc831a4(0xf7)])),displayDiffs(_0x43e1ad[_0xc831a4(0x199)],_0x43e1ad[_0xc831a4(0x17c)],_0x43e1ad['textKnowledgeBases'],_0x43e1ad[_0xc831a4(0x18a)],_0x43e1ad['integrations'],_0x43e1ad[_0xc831a4(0x11f)],_0x43e1ad['experimentalArtifacts'],_0x43e1ad[_0xc831a4(0x142)],_0x43e1ad['chatInterfaces']);if(_0x8dea6d)return console['log'](a4_0xfc4d30['yellow'](_0xc831a4(0x187))),0x0;if(_0x95c12a===0x0&&_0xcd1802===0x0)return console[_0xc831a4(0x18c)](a4_0xfc4d30[_0xc831a4(0x10a)](_0xc831a4(0x179))),saveSessionContext({'llm_project':_0x43e1ad[_0xc831a4(0x168)]},_0x550c1d[_0xc831a4(0x19e)]),console[_0xc831a4(0x18c)](a4_0xfc4d30[_0xc831a4(0x10a)](_0xc831a4(0x115)+a4_0xfc4d30[_0xc831a4(0x1ad)](_0xc831a4(0x129))+_0xc831a4(0x167)+a4_0xfc4d30['cyan'](_0x43e1ad[_0xc831a4(0x168)]))),0x0;if(!_0x49525a&&!_0xb8eeb1){if(!isInteractive())return console[_0xc831a4(0x1aa)](a4_0xfc4d30[_0xc831a4(0x1a4)](_0xc831a4(0x106)),_0xc831a4(0x123)),console[_0xc831a4(0x1aa)](a4_0xfc4d30[_0xc831a4(0x1ad)](_0xc831a4(0x124))),0x1;const _0x4dedd2=await confirmKey(_0xc831a4(0x136)+(_0x95c12a+_0xcd1802)+_0xc831a4(0x1a9));if(!_0x4dedd2)return console[_0xc831a4(0x18c)](a4_0xfc4d30['yellow'](_0xc831a4(0x148)),_0xc831a4(0xff)),0x1;}const {data:_0x31eb15}=await withSpinner('Writing\x20files...',()=>_0x4de323[_0xc831a4(0x11e)][_0xc831a4(0x107)](_0x238451,_0xb16376,{'force':_0xb8eeb1}));return console[_0xc831a4(0x18c)](a4_0xfc4d30['green'](_0xc831a4(0x151)+(_0x95c12a+_0xcd1802)+_0xc831a4(0xf4)+_0x31eb15[_0xc831a4(0xf7)])),saveSessionContext({'llm_project':_0x31eb15[_0xc831a4(0x168)]},_0x550c1d[_0xc831a4(0x19e)]),console[_0xc831a4(0x18c)](a4_0xfc4d30['green'](_0xc831a4(0x115)+a4_0xfc4d30['dim'](_0xc831a4(0x129))+_0xc831a4(0x167)+a4_0xfc4d30[_0xc831a4(0x1a6)](_0x31eb15[_0xc831a4(0x168)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x216ccd(0x122);[a4_0x216ccd(0x126)]=a4_0x216ccd(0x172);async[a4_0x216ccd(0x102)](_0x534aeb){const _0x5b7559=a4_0x216ccd,{options:_0xc3b663,args:_0x13d963,tdx:_0x333cd4}=_0x534aeb,_0x2d2f6f=_0x13d963[0x0],_0x56ca89=_0xc3b663[_0x5b7559(0x16b)],_0x2a7713=_0xc3b663[_0x5b7559(0x191)],_0x23c810=_0xc3b663[_0x5b7559(0x18e)],_0x3814a0=_0xc3b663['site'],_0x5e0ee0=_0xc3b663[_0x5b7559(0xf8)];let _0x218ee4;const _0xde22a5=findAgentConfigPath(process[_0x5b7559(0x1af)]());if(_0x2d2f6f){const _0x13a987=a4_0x1a0f62[_0x5b7559(0x11c)](_0x2d2f6f,_0x5b7559(0x196));existsSync(_0x13a987)?(_0x218ee4=_0x2d2f6f,console[_0x5b7559(0x18c)](a4_0xfc4d30[_0x5b7559(0x1ad)](_0x5b7559(0x113)+_0x2d2f6f))):_0x218ee4=_0x2d2f6f;}else{if(_0xde22a5)_0x218ee4=a4_0x1a0f62[_0x5b7559(0x198)](_0xde22a5),console[_0x5b7559(0x18c)](a4_0xfc4d30[_0x5b7559(0x1ad)]('Using\x20current\x20project:\x20'+_0x218ee4));else{if(_0x5e0ee0){const _0x5b74f5=sanitizeForFilesystem(_0x5e0ee0);let _0x3706b7=_0x5b74f5,_0x2260a5=a4_0x1a0f62[_0x5b7559(0x11c)](process[_0x5b7559(0x1af)](),'agents',_0x5b74f5,_0x5b7559(0x196));if(!existsSync(_0x2260a5)){const _0x177620=normalizeName(_0x5e0ee0),_0x3fd9d2=a4_0x1a0f62[_0x5b7559(0x11c)](process['cwd'](),_0x5b7559(0x199),_0x177620,_0x5b7559(0x196));existsSync(_0x3fd9d2)&&(_0x3706b7=_0x177620,_0x2260a5=_0x3fd9d2);}if(existsSync(_0x2260a5))_0x218ee4=a4_0x1a0f62[_0x5b7559(0x198)](_0x2260a5),console[_0x5b7559(0x18c)](a4_0xfc4d30['dim'](_0x5b7559(0x113)+_0x218ee4));else{const _0x376fea=_0xc3b663[_0x5b7559(0x117)];if(_0x376fea)throw new SDKError(ErrorCode[_0x5b7559(0x1a5)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x5e0ee0+_0x5b7559(0x173),undefined,{'helpText':_0x5b7559(0x190)+_0x5b7559(0x125)+(_0x5b7559(0x159)+_0x5e0ee0+'\x0a')+(_0x5b7559(0x1a0)+_0x3706b7+'\x20--name\x20'+(_0x56ca89||_0x5b7559(0x127))+_0x5b7559(0x1b0)+_0x376fea)});_0x218ee4=_0x5e0ee0,console[_0x5b7559(0x18c)](a4_0xfc4d30[_0x5b7559(0x1ad)](_0x5b7559(0x14d)+_0x5e0ee0));}}}}if(!_0x218ee4)return console[_0x5b7559(0x18c)](a4_0xfc4d30[_0x5b7559(0x114)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x5b7559(0x18c)](_0x5b7559(0x11d)),console[_0x5b7559(0x18c)](_0x5b7559(0x15c)),console[_0x5b7559(0x18c)]('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console[_0x5b7559(0x18c)](_0x5b7559(0x15d)),0x1;if(!_0x56ca89)throw new SDKError(ErrorCode[_0x5b7559(0x13e)],_0x5b7559(0xfa),undefined,{'helpText':_0x5b7559(0x119)});if(!_0x23c810&&!_0x2a7713){if(!isInteractive())return console['error'](a4_0xfc4d30[_0x5b7559(0x1a4)](_0x5b7559(0x106)),_0x5b7559(0x123)),console[_0x5b7559(0x1aa)](a4_0xfc4d30[_0x5b7559(0x1ad)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x595f4a=await confirmKey(_0x5b7559(0x174)+_0x218ee4+'\x22\x20to\x20new\x20project\x20\x22'+_0x56ca89+'\x22?');if(!_0x595f4a)return console[_0x5b7559(0x18c)](a4_0xfc4d30[_0x5b7559(0x114)](_0x5b7559(0x148))),0x1;}const {data:_0x3f29ef}=await withSpinner(_0x5b7559(0x177)+_0x218ee4+_0x5b7559(0x12f)+_0x56ca89+_0x5b7559(0x193),()=>_0x333cd4['llm'][_0x5b7559(0x1a2)](_0x218ee4,_0x56ca89,{'dryRun':_0x2a7713}));if(_0x2a7713){console[_0x5b7559(0x18c)](a4_0xfc4d30[_0x5b7559(0x114)](_0x5b7559(0x140))),console[_0x5b7559(0x18c)]('Source:\x20'+_0x3f29ef[_0x5b7559(0x15a)]),console[_0x5b7559(0x18c)](_0x5b7559(0x145)+_0x56ca89),console[_0x5b7559(0x18c)](_0x5b7559(0x164)),console[_0x5b7559(0x18c)](_0x5b7559(0x110)+_0x3f29ef[_0x5b7559(0x134)][_0x5b7559(0x199)][_0x5b7559(0x130)]),console[_0x5b7559(0x18c)](_0x5b7559(0x11a)+_0x3f29ef[_0x5b7559(0x134)][_0x5b7559(0x17c)][_0x5b7559(0x130)]),console[_0x5b7559(0x18c)](_0x5b7559(0x1ae)+_0x3f29ef[_0x5b7559(0x134)][_0x5b7559(0x18a)][_0x5b7559(0x130)]),console[_0x5b7559(0x18c)](_0x5b7559(0x1ab)+_0x3f29ef[_0x5b7559(0x134)][_0x5b7559(0x142)][_0x5b7559(0x130)]),console[_0x5b7559(0x18c)](_0x5b7559(0x175)+_0x3f29ef[_0x5b7559(0x134)][_0x5b7559(0x141)][_0x5b7559(0x130)]);const _0x5787fc=_0x3f29ef[_0x5b7559(0x134)]['experimentalKnowledgeBases'][_0x5b7559(0x130)]>0x0||_0x3f29ef[_0x5b7559(0x134)][_0x5b7559(0x144)][_0x5b7559(0x130)]>0x0;return _0x5787fc&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x3f29ef[_0x5b7559(0x134)][_0x5b7559(0x11f)][_0x5b7559(0x130)]),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+_0x3f29ef[_0x5b7559(0x134)]['experimentalArtifacts'][_0x5b7559(0x130)])),0x0;}const _0x616169=_0x3f29ef[_0x5b7559(0x134)][_0x5b7559(0x199)][_0x5b7559(0x108)]>0x0||_0x3f29ef['counts']['knowledgeBases']['errors']>0x0||_0x3f29ef[_0x5b7559(0x134)][_0x5b7559(0x18a)]['errors']>0x0||_0x3f29ef[_0x5b7559(0x134)]['formInterfaces'][_0x5b7559(0x108)]>0x0||_0x3f29ef['counts'][_0x5b7559(0x141)][_0x5b7559(0x108)]>0x0||_0x3f29ef['counts']['experimentalKnowledgeBases'][_0x5b7559(0x108)]>0x0||_0x3f29ef[_0x5b7559(0x134)][_0x5b7559(0x144)]['errors']>0x0;_0x616169?console['log'](a4_0xfc4d30[_0x5b7559(0x114)](_0x5b7559(0x150))):console[_0x5b7559(0x18c)](a4_0xfc4d30[_0x5b7559(0x10a)](_0x5b7559(0x135)));console[_0x5b7559(0x18c)](_0x5b7559(0x185)+_0x3f29ef[_0x5b7559(0x15a)]),console['log'](_0x5b7559(0x145)+_0x3f29ef[_0x5b7559(0x180)]),console[_0x5b7559(0x18c)]('New\x20project\x20ID:\x20'+_0x3f29ef[_0x5b7559(0x133)]),console[_0x5b7559(0x18c)](),console[_0x5b7559(0x18c)](_0x5b7559(0xf3)),console[_0x5b7559(0x18c)](_0x5b7559(0x110)+formatCountSummary(_0x3f29ef[_0x5b7559(0x134)]['agents'])),console[_0x5b7559(0x18c)](_0x5b7559(0x11a)+formatCountSummary(_0x3f29ef[_0x5b7559(0x134)][_0x5b7559(0x17c)])),console[_0x5b7559(0x18c)](_0x5b7559(0x1ae)+formatCountSummary(_0x3f29ef['counts'][_0x5b7559(0x18a)])),console[_0x5b7559(0x18c)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x3f29ef['counts'][_0x5b7559(0x17e)])),console['log'](_0x5b7559(0x1ab)+formatCountSummary(_0x3f29ef[_0x5b7559(0x134)][_0x5b7559(0x142)])),console['log'](_0x5b7559(0x175)+formatCountSummary(_0x3f29ef['counts']['chatInterfaces']));const _0x29965a=_0x3f29ef[_0x5b7559(0x134)][_0x5b7559(0x11f)][_0x5b7559(0x130)]>0x0||_0x3f29ef[_0x5b7559(0x134)][_0x5b7559(0x11f)][_0x5b7559(0x146)]>0x0||_0x3f29ef['counts'][_0x5b7559(0x11f)][_0x5b7559(0xfc)]>0x0||_0x3f29ef[_0x5b7559(0x134)][_0x5b7559(0x144)]['created']>0x0||_0x3f29ef[_0x5b7559(0x134)][_0x5b7559(0x144)][_0x5b7559(0x146)]>0x0||_0x3f29ef[_0x5b7559(0x134)]['experimentalArtifacts']['unchanged']>0x0;_0x29965a&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3f29ef['counts'][_0x5b7559(0x11f)])),console[_0x5b7559(0x18c)](_0x5b7559(0xfd)+formatCountSummary(_0x3f29ef['counts'][_0x5b7559(0x144)])));if(_0x616169){console['log'](),console[_0x5b7559(0x18c)](a4_0xfc4d30['red']('Errors:'));for(const _0x46f55d of _0x3f29ef[_0x5b7559(0x199)]){_0x46f55d[_0x5b7559(0xfe)]===_0x5b7559(0x1aa)&&console['log'](a4_0xfc4d30[_0x5b7559(0x1a4)]('\x20\x20Agent\x20\x22'+_0x46f55d['agentName']+_0x5b7559(0x182)+_0x46f55d[_0x5b7559(0x1aa)]));}for(const _0x51004d of _0x3f29ef[_0x5b7559(0x17c)]){_0x51004d['action']==='error'&&console[_0x5b7559(0x18c)](a4_0xfc4d30[_0x5b7559(0x1a4)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x51004d[_0x5b7559(0x16b)]+_0x5b7559(0x182)+_0x51004d['error']));}for(const _0x14a196 of _0x3f29ef['prompts']){_0x14a196[_0x5b7559(0xfe)]===_0x5b7559(0x1aa)&&console['log'](a4_0xfc4d30[_0x5b7559(0x1a4)](_0x5b7559(0x121)+_0x14a196['name']+_0x5b7559(0x182)+_0x14a196[_0x5b7559(0x1aa)]));}for(const _0x37c235 of _0x3f29ef[_0x5b7559(0x17e)]){_0x37c235[_0x5b7559(0xfe)]==='error'&&console[_0x5b7559(0x18c)](a4_0xfc4d30[_0x5b7559(0x1a4)](_0x5b7559(0x162)+_0x37c235[_0x5b7559(0x16b)]+_0x5b7559(0x182)+_0x37c235['error']));}for(const _0x1a1ac5 of _0x3f29ef[_0x5b7559(0x142)]){_0x1a1ac5[_0x5b7559(0xfe)]===_0x5b7559(0x1aa)&&console[_0x5b7559(0x18c)](a4_0xfc4d30[_0x5b7559(0x1a4)](_0x5b7559(0x16f)+_0x1a1ac5[_0x5b7559(0x16b)]+_0x5b7559(0x182)+_0x1a1ac5[_0x5b7559(0x1aa)]));}for(const _0x5a32f1 of _0x3f29ef[_0x5b7559(0x141)]){_0x5a32f1[_0x5b7559(0xfe)]===_0x5b7559(0x1aa)&&console[_0x5b7559(0x18c)](a4_0xfc4d30[_0x5b7559(0x1a4)](_0x5b7559(0x11b)+_0x5a32f1[_0x5b7559(0x16b)]+_0x5b7559(0x182)+_0x5a32f1[_0x5b7559(0x1aa)]));}for(const _0x24cbbf of _0x3f29ef[_0x5b7559(0x11f)]){_0x24cbbf[_0x5b7559(0xfe)]===_0x5b7559(0x1aa)&&console[_0x5b7559(0x18c)](a4_0xfc4d30['red'](_0x5b7559(0x17d)+_0x24cbbf['name']+_0x5b7559(0x182)+_0x24cbbf[_0x5b7559(0x1aa)]));}for(const _0x5845c4 of _0x3f29ef[_0x5b7559(0x144)]){_0x5845c4['action']===_0x5b7559(0x1aa)&&console[_0x5b7559(0x18c)](a4_0xfc4d30[_0x5b7559(0x1a4)](_0x5b7559(0x131)+_0x5845c4[_0x5b7559(0x16b)]+_0x5b7559(0x182)+_0x5845c4['error']));}return 0x1;}console['log']();const _0x357575=getLLMProjectUrl(_0x3814a0,_0x3f29ef[_0x5b7559(0x133)]);return console[_0x5b7559(0x18c)](_0x5b7559(0x149)+a4_0xfc4d30[_0x5b7559(0x1a6)](_0x357575)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x216ccd(0x16b)]=a4_0x216ccd(0x19b);['description']=a4_0x216ccd(0x120);async[a4_0x216ccd(0x102)](_0x2e154a){const _0x2eea71=a4_0x216ccd,{options:_0x4381b2,args:_0x1f8026,tdx:_0x1ef58f}=_0x2e154a;let _0x530d57=_0x1f8026[0x0]||process[_0x2eea71(0x1af)]();const _0x1a5e20=_0x4381b2[_0x2eea71(0x191)],_0x29962e=_0x4381b2[_0x2eea71(0x19a)],_0x460ae8=_0x4381b2['yes'],_0x4ae180=_0x4381b2[_0x2eea71(0x103)],_0x4ba2e6=a4_0x1a0f62['join'](_0x530d57,'agent.yml'),_0x31bb03=existsSync(_0x4ba2e6);if(_0x31bb03){const {data:_0x1f13c0}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x530d57+_0x2eea71(0x193),()=>_0x1ef58f[_0x2eea71(0x11e)][_0x2eea71(0xf6)](_0x530d57,{'dryRun':_0x1a5e20,'force':_0x29962e}));if(_0x1a5e20)return console[_0x2eea71(0x18c)](a4_0xfc4d30[_0x2eea71(0x114)](_0x2eea71(0x140))),console[_0x2eea71(0x18c)]('Would\x20push\x20agent:\x20'+_0x1f13c0[_0x2eea71(0x188)]),0x0;if(_0x1f13c0[_0x2eea71(0xfe)]===_0x2eea71(0x1aa))return console[_0x2eea71(0x18c)](a4_0xfc4d30[_0x2eea71(0x1a4)](_0x2eea71(0x15e)+_0x1f13c0[_0x2eea71(0x1aa)])),0x1;console[_0x2eea71(0x18c)](a4_0xfc4d30['green'](_0x2eea71(0xf0)+_0x1f13c0[_0x2eea71(0xfe)]+_0x2eea71(0x16e))),console[_0x2eea71(0x18c)](_0x2eea71(0x10f)+_0x1f13c0[_0x2eea71(0x188)]);if(_0x1f13c0[_0x2eea71(0x156)]&&_0x1f13c0[_0x2eea71(0x169)]){const _0x15fac3=getLLMAgentChatUrl(_0x4ae180,_0x1f13c0[_0x2eea71(0x169)],_0x1f13c0[_0x2eea71(0x156)]);console[_0x2eea71(0x18c)]('Chat:\x20'+a4_0xfc4d30[_0x2eea71(0x1a6)](_0x15fac3));}return 0x0;}const _0x2f3e89=_0x4381b2[_0x2eea71(0xf8)],_0x1c4ecf=resolveProjectFromContext(_0x530d57,_0x2f3e89);if(_0x1c4ecf[_0x2eea71(0x12e)])_0x530d57=_0x1c4ecf[_0x2eea71(0x14f)],_0x1c4ecf[_0x2eea71(0x153)]===_0x2eea71(0xee)&&console[_0x2eea71(0x18c)](a4_0xfc4d30[_0x2eea71(0x1ad)]('Using\x20project:\x20'+_0x530d57));else{let _0x537168=_0x2eea71(0x197);_0x1c4ecf['reason']===_0x2eea71(0x10b)&&(_0x537168=_0x1c4ecf[_0x2eea71(0x16d)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x1c4ecf[_0x2eea71(0xf8)]+_0x2eea71(0xed));throw new SDKError(ErrorCode[_0x2eea71(0x1a5)],_0x1c4ecf[_0x2eea71(0xf1)]==='no_context'?_0x1c4ecf[_0x2eea71(0x16d)]:_0x2eea71(0x1ac)+_0x530d57,undefined,{'helpText':_0x537168});}const {data:_0x1afac9}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x1ef58f['llm'][_0x2eea71(0x128)](_0x530d57,{'dryRun':!![]})),_0x4b2a7a=_0x1afac9[_0x2eea71(0x134)][_0x2eea71(0x199)]['errors']>0x0;if(_0x4b2a7a){console['log'](a4_0xfc4d30[_0x2eea71(0x1a4)](_0x2eea71(0x165)));for(const _0x21acbf of _0x1afac9['agents']){_0x21acbf[_0x2eea71(0xfe)]===_0x2eea71(0x1aa)&&console[_0x2eea71(0x18c)](a4_0xfc4d30['red'](_0x2eea71(0x14b)+_0x21acbf[_0x2eea71(0x188)]+_0x2eea71(0x182)+_0x21acbf[_0x2eea71(0x1aa)]));}return 0x1;}const _0x2af24d=_0x1afac9[_0x2eea71(0x134)][_0x2eea71(0x199)][_0x2eea71(0x130)]+_0x1afac9['counts']['knowledgeBases'][_0x2eea71(0x130)]+_0x1afac9[_0x2eea71(0x134)]['textKnowledgeBases']['created']+_0x1afac9[_0x2eea71(0x134)][_0x2eea71(0x18a)][_0x2eea71(0x130)]+_0x1afac9[_0x2eea71(0x134)][_0x2eea71(0x17e)][_0x2eea71(0x130)]+_0x1afac9[_0x2eea71(0x134)][_0x2eea71(0x11f)][_0x2eea71(0x130)]+_0x1afac9[_0x2eea71(0x134)][_0x2eea71(0x144)]['created']+_0x1afac9[_0x2eea71(0x134)][_0x2eea71(0x142)][_0x2eea71(0x130)]+_0x1afac9['counts']['chatInterfaces'][_0x2eea71(0x130)],_0x3192e6=_0x1afac9[_0x2eea71(0x134)][_0x2eea71(0x199)][_0x2eea71(0x146)]+_0x1afac9[_0x2eea71(0x134)][_0x2eea71(0x17c)][_0x2eea71(0x146)]+_0x1afac9[_0x2eea71(0x134)][_0x2eea71(0x17f)][_0x2eea71(0x146)]+_0x1afac9[_0x2eea71(0x134)][_0x2eea71(0x18a)][_0x2eea71(0x146)]+_0x1afac9[_0x2eea71(0x134)][_0x2eea71(0x17e)][_0x2eea71(0x146)]+_0x1afac9[_0x2eea71(0x134)]['experimentalKnowledgeBases'][_0x2eea71(0x146)]+_0x1afac9['counts'][_0x2eea71(0x144)][_0x2eea71(0x146)]+_0x1afac9[_0x2eea71(0x134)]['formInterfaces'][_0x2eea71(0x146)]+_0x1afac9['counts'][_0x2eea71(0x141)][_0x2eea71(0x146)],_0x4909e4=_0x1afac9['counts'][_0x2eea71(0x199)][_0x2eea71(0xfc)]+_0x1afac9[_0x2eea71(0x134)]['knowledgeBases'][_0x2eea71(0xfc)]+_0x1afac9[_0x2eea71(0x134)]['textKnowledgeBases'][_0x2eea71(0xfc)]+_0x1afac9[_0x2eea71(0x134)]['prompts'][_0x2eea71(0xfc)]+_0x1afac9[_0x2eea71(0x134)][_0x2eea71(0x17e)][_0x2eea71(0xfc)]+_0x1afac9[_0x2eea71(0x134)]['experimentalKnowledgeBases'][_0x2eea71(0xfc)]+_0x1afac9['counts'][_0x2eea71(0x144)]['unchanged']+_0x1afac9[_0x2eea71(0x134)][_0x2eea71(0x142)][_0x2eea71(0xfc)]+_0x1afac9[_0x2eea71(0x134)]['chatInterfaces'][_0x2eea71(0xfc)];console[_0x2eea71(0x18c)](_0x2eea71(0x157)+_0x1afac9[_0x2eea71(0x168)]+'\x27:'),console[_0x2eea71(0x18c)]('\x20\x20'+a4_0xfc4d30[_0x2eea71(0x10a)]('+\x20'+_0x2af24d+_0x2eea71(0x137))+'\x20|\x20'+a4_0xfc4d30[_0x2eea71(0x114)]('~\x20'+_0x3192e6+'\x20changed')+_0x2eea71(0x132)+a4_0xfc4d30['dim']('=\x20'+_0x4909e4+_0x2eea71(0x13d))),console['log'](_0x2eea71(0x110)+formatCountSummary(_0x1afac9['counts'][_0x2eea71(0x199)])),console[_0x2eea71(0x18c)](_0x2eea71(0x11a)+formatCountSummary(_0x1afac9[_0x2eea71(0x134)][_0x2eea71(0x17c)])),console[_0x2eea71(0x18c)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1afac9[_0x2eea71(0x134)][_0x2eea71(0x17f)])),console[_0x2eea71(0x18c)](_0x2eea71(0x1ae)+formatCountSummary(_0x1afac9['counts'][_0x2eea71(0x18a)])),console[_0x2eea71(0x18c)](_0x2eea71(0x18b)+formatCountSummary(_0x1afac9[_0x2eea71(0x134)][_0x2eea71(0x17e)])),console['log']('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x1afac9[_0x2eea71(0x134)][_0x2eea71(0x142)])),console[_0x2eea71(0x18c)](_0x2eea71(0x175)+formatCountSummary(_0x1afac9[_0x2eea71(0x134)][_0x2eea71(0x141)]));const _0x4628fc=_0x1afac9['counts'][_0x2eea71(0x11f)][_0x2eea71(0x130)]>0x0||_0x1afac9[_0x2eea71(0x134)][_0x2eea71(0x11f)][_0x2eea71(0x146)]>0x0||_0x1afac9['counts'][_0x2eea71(0x11f)][_0x2eea71(0xfc)]>0x0||_0x1afac9[_0x2eea71(0x134)]['experimentalArtifacts'][_0x2eea71(0x130)]>0x0||_0x1afac9[_0x2eea71(0x134)]['experimentalArtifacts'][_0x2eea71(0x146)]>0x0||_0x1afac9['counts'][_0x2eea71(0x144)][_0x2eea71(0xfc)]>0x0;_0x4628fc&&(console['log'](_0x2eea71(0x195)+formatCountSummary(_0x1afac9[_0x2eea71(0x134)][_0x2eea71(0x11f)])),console[_0x2eea71(0x18c)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x1afac9['counts'][_0x2eea71(0x144)])));console[_0x2eea71(0x18c)](_0x2eea71(0x163)+a4_0xfc4d30[_0x2eea71(0x1a6)](_0x530d57)),displayDiffs(_0x1afac9[_0x2eea71(0x199)],_0x1afac9['knowledgeBases'],_0x1afac9[_0x2eea71(0x17f)],_0x1afac9['prompts'],_0x1afac9['integrations'],_0x1afac9['experimentalKnowledgeBases'],_0x1afac9[_0x2eea71(0x144)],_0x1afac9[_0x2eea71(0x142)],_0x1afac9['chatInterfaces']);if(_0x1a5e20)return console[_0x2eea71(0x18c)](a4_0xfc4d30[_0x2eea71(0x114)](_0x2eea71(0x13a))),0x0;if(_0x2af24d===0x0&&_0x3192e6===0x0){console[_0x2eea71(0x18c)](a4_0xfc4d30[_0x2eea71(0x10a)](_0x2eea71(0x19d)));const _0x217f39=getLLMProjectUrl(_0x4ae180,_0x1afac9[_0x2eea71(0x169)]);return console[_0x2eea71(0x18c)](_0x2eea71(0x149)+a4_0xfc4d30[_0x2eea71(0x1a6)](_0x217f39)),0x0;}if(!_0x460ae8&&!_0x29962e){if(!isInteractive())return console[_0x2eea71(0x1aa)](a4_0xfc4d30['red'](_0x2eea71(0x106)),_0x2eea71(0x123)),console[_0x2eea71(0x1aa)](a4_0xfc4d30['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4c96da=await confirmKey(_0x2eea71(0x14c)+(_0x2af24d+_0x3192e6)+_0x2eea71(0x105));if(!_0x4c96da)return console['log'](a4_0xfc4d30[_0x2eea71(0x114)]('Cancelled'),_0x2eea71(0xef)),0x1;}const {data:_0x28848a}=await withSpinner(_0x2eea71(0x12c),()=>_0x1ef58f[_0x2eea71(0x11e)]['pushProject'](_0x530d57,{'force':_0x29962e})),_0x2b0858=_0x28848a[_0x2eea71(0x134)]['agents'][_0x2eea71(0x108)]>0x0||_0x28848a[_0x2eea71(0x134)]['knowledgeBases'][_0x2eea71(0x108)]>0x0||_0x28848a['counts'][_0x2eea71(0x17f)][_0x2eea71(0x108)]>0x0||_0x28848a[_0x2eea71(0x134)]['prompts'][_0x2eea71(0x108)]>0x0||_0x28848a[_0x2eea71(0x134)]['formInterfaces'][_0x2eea71(0x108)]>0x0||_0x28848a[_0x2eea71(0x134)][_0x2eea71(0x141)]['errors']>0x0;if(_0x2b0858){console['log'](a4_0xfc4d30['yellow'](_0x2eea71(0x19f))),console[_0x2eea71(0x18c)](),console[_0x2eea71(0x18c)](a4_0xfc4d30[_0x2eea71(0x1a4)]('Errors:'));for(const _0x3920dd of _0x28848a[_0x2eea71(0x199)]){_0x3920dd[_0x2eea71(0xfe)]===_0x2eea71(0x1aa)&&console[_0x2eea71(0x18c)](a4_0xfc4d30[_0x2eea71(0x1a4)](_0x2eea71(0x14b)+_0x3920dd[_0x2eea71(0x188)]+'\x22:\x20'+_0x3920dd['error']));}for(const _0x206392 of _0x28848a[_0x2eea71(0x17c)]){_0x206392[_0x2eea71(0xfe)]===_0x2eea71(0x1aa)&&console['log'](a4_0xfc4d30['red'](_0x2eea71(0x16c)+_0x206392['name']+'\x22:\x20'+_0x206392[_0x2eea71(0x1aa)]));}for(const _0x228dc8 of _0x28848a['textKnowledgeBases']){_0x228dc8[_0x2eea71(0xfe)]===_0x2eea71(0x1aa)&&console[_0x2eea71(0x18c)](a4_0xfc4d30[_0x2eea71(0x1a4)](_0x2eea71(0x12b)+_0x228dc8[_0x2eea71(0x16b)]+_0x2eea71(0x182)+_0x228dc8[_0x2eea71(0x1aa)]));}for(const _0x149e09 of _0x28848a[_0x2eea71(0x18a)]){_0x149e09[_0x2eea71(0xfe)]===_0x2eea71(0x1aa)&&console[_0x2eea71(0x18c)](a4_0xfc4d30[_0x2eea71(0x1a4)]('\x20\x20Prompt\x20\x22'+_0x149e09['name']+_0x2eea71(0x182)+_0x149e09[_0x2eea71(0x1aa)]));}for(const _0x349322 of _0x28848a[_0x2eea71(0x17e)]){_0x349322[_0x2eea71(0xfe)]===_0x2eea71(0x1aa)&&console[_0x2eea71(0x18c)](a4_0xfc4d30[_0x2eea71(0x1a4)](_0x2eea71(0x162)+_0x349322['name']+_0x2eea71(0x182)+_0x349322[_0x2eea71(0x1aa)]));}for(const _0x189209 of _0x28848a[_0x2eea71(0x142)]){_0x189209[_0x2eea71(0xfe)]==='error'&&console['log'](a4_0xfc4d30['red'](_0x2eea71(0x16f)+_0x189209[_0x2eea71(0x16b)]+'\x22:\x20'+_0x189209[_0x2eea71(0x1aa)]));}for(const _0x5e1326 of _0x28848a[_0x2eea71(0x141)]){_0x5e1326['action']===_0x2eea71(0x1aa)&&console['log'](a4_0xfc4d30[_0x2eea71(0x1a4)](_0x2eea71(0x11b)+_0x5e1326[_0x2eea71(0x16b)]+'\x22:\x20'+_0x5e1326['error']));}return 0x1;}console['log'](a4_0xfc4d30[_0x2eea71(0x10a)](_0x2eea71(0x10d)+(_0x2af24d+_0x3192e6)+_0x2eea71(0x12d)+_0x28848a[_0x2eea71(0x168)]+'\x27'));const _0x5bd4ef=getLLMProjectUrl(_0x4ae180,_0x28848a[_0x2eea71(0x169)]);return console['log'](_0x2eea71(0x149)+a4_0xfc4d30[_0x2eea71(0x1a6)](_0x5bd4ef)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x5bcf6f=a5_0x718d;(function(_0x2be512,_0x30febf){const _0x4c2de6=a5_0x718d,_0x47e91e=_0x2be512();while(!![]){try{const _0x5d693e=-parseInt(_0x4c2de6(0x202))/0x1+-parseInt(_0x4c2de6(0x1ff))/0x2+-parseInt(_0x4c2de6(0x23f))/0x3+parseInt(_0x4c2de6(0x225))/0x4+-parseInt(_0x4c2de6(0x1dc))/0x5*(-parseInt(_0x4c2de6(0x214))/0x6)+-parseInt(_0x4c2de6(0x1f8))/0x7*(parseInt(_0x4c2de6(0x1c4))/0x8)+parseInt(_0x4c2de6(0x216))/0x9*(parseInt(_0x4c2de6(0x1de))/0xa);if(_0x5d693e===_0x30febf)break;else _0x47e91e['push'](_0x47e91e['shift']());}catch(_0x35ced3){_0x47e91e['push'](_0x47e91e['shift']());}}}(a5_0x49c6,0x97afc));import*as a5_0xc7e23 from'node:fs';import*as a5_0x373414 from'node:path';import a5_0x151568 from'chalk';function a5_0x49c6(){const _0x4f987f=['Site:\x20','dim','/<agent-name>','Round\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','reeval','length','conversation_url','4890200SwvlFN','text','404','tags','Available\x20tests:\x20','agent','No\x20tests\x20have\x20tags\x20defined.','message','ERROR','filter','Project\x20path:\x20','Test\x20','\x20\x20Conversation:\x20','trim','has','Duration:\x20','table','start','map','✗\x20ERROR:\x20','⚠\x20SKIPPED:\x20','rounds','\x20-\x20','jsonl','Using\x20agent:\x20','Test\x20Configuration:','1971759HCOQvF','dryRun','Failed:\x20\x20\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)','Error:\x20No\x20previous\x20test\x20run\x20found.','now','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','status','no_tests','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','toISOString','conversations','site','context','toLowerCase','verbose','size','No\x20tests\x20found\x20with\x20tags:\x20','Errors:\x20\x20\x20','Running\x20test:\x20','utf-8','\x20\x20Project:\x20','stop','red','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval',':\x20Sending\x20user\x20input...','Output\x20written\x20to:\x20','56rGETFS','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Run\x20tests\x20for\x20an\x20LLM\x20agent','\x20\x20Agent:\x20','tests','log','...\x20','\x20(cached)','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','timestamp','Error\x20writing\x20output\x20file:\x20','Re-evaluating\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','agent:test','No\x20tests\x20found\x20matching:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','green','Usage:','\x22,\x20but\x20current\x20site\x20is\x20\x22','\x20\x20Evaluating...\x20','resolveProjectId','find','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','506535KOilJm','includes','10ZdCsPs','\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','forEach','test.yml','projectDir','projectName','tsv','Run\x20\x27tdx\x20agent\x20pull\x20','Running:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Available\x20tags:\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','FAIL','testYmlPath','json','Passed:\x20\x20\x20','llmProject','Agent:\x20','Evaluating\x20response...','✓\x20PASS:\x20','reason','resolve','✗\x20FAIL:\x20','no_local_folder','name','white','1033291QtMFvS','Conversation\x20URL:\x20','New\x20tests\x20to\x20execute:\x20','yellow','Either\x20switch\x20to\x20the\x20\x22','...','push','1278358QcCPde','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','agentDirs','841966fJflgH','\x22:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','Cached\x20run\x20from:\x20','Round\x201/','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','writeFileSync','resolveAgentId','\x20\x20Round\x20','Total:\x20\x20\x20\x20','llm','not\x20found','executeReeval','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Re-evaluation\x20Summary','Cached\x20run\x20is\x20from\x20site\x20\x22','Re-evaluating\x20cached\x20test\x20run...','repeat','30TteMdx','PASS','18575208dOWNtV','cyan','\x20(new)','existsSync','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','agentName','join'];a5_0x49c6=function(){return _0x4f987f;};return a5_0x49c6();}function a5_0x718d(_0x5a8f35,_0x5d3652){_0x5a8f35=_0x5a8f35-0x1af;const _0x49c636=a5_0x49c6();let _0x718d20=_0x49c636[_0x5a8f35];return _0x718d20;}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_0x5bcf6f(0x1f6)]=a5_0x5bcf6f(0x1d2);['description']=a5_0x5bcf6f(0x1c6);async['execute'](_0x3a875f){const _0x1d8704=a5_0x5bcf6f,{options:_0x21bde3,args:_0x3b4e67,tdx:_0x403fde}=_0x3a875f,_0x843ccf=_0x3b4e67[0x0]||'.',_0x48367c=_0x21bde3[_0x1d8704(0x240)],_0x179ff0=_0x21bde3,_0x4bbe16=_0x179ff0['eval']===![],_0xed283=_0x179ff0[_0x1d8704(0x222)],_0x5b4ee2=_0x179ff0[_0x1d8704(0x1f6)],_0x322da5=_0x179ff0[_0x1d8704(0x228)],_0x3453d4=_0x21bde3[_0x1d8704(0x1b5)],_0x33bdce=_0x179ff0['output'];if(_0xed283&&_0x4bbe16)return console['log'](a5_0x151568[_0x1d8704(0x1c0)](_0x1d8704(0x1c1))),0x1;let _0x20f1c3='table';if(_0x179ff0[_0x1d8704(0x1ec)])_0x20f1c3=_0x1d8704(0x1ec);else{if(_0x179ff0['jsonl'])_0x20f1c3=_0x1d8704(0x23c);else{if(_0x179ff0['tsv'])_0x20f1c3=_0x1d8704(0x1e4);else{if(_0x179ff0[_0x1d8704(0x235)])_0x20f1c3=_0x1d8704(0x235);}}}const _0x300268=_0x179ff0[_0x1d8704(0x1ee)];let _0xc824b8=_0x843ccf;const _0xa91c40=a5_0xc7e23[_0x1d8704(0x219)](_0x843ccf),_0x4afe2d=_0x843ccf==='.';if(!_0xa91c40||_0x4afe2d){const _0x2b1bba=resolveProjectFromContext(_0x843ccf,_0x300268,{'requireFile':_0x1d8704(0x1e1)});if(_0x2b1bba['found'])_0xc824b8=_0x2b1bba[_0x1d8704(0x1e2)],_0x2b1bba['source']===_0x1d8704(0x1b6)&&console[_0x1d8704(0x1c9)](a5_0x151568[_0x1d8704(0x21e)](_0x1d8704(0x23d)+_0xc824b8));else switch(_0x2b1bba[_0x1d8704(0x1f2)]){case'no_context':console['log'](a5_0x151568['yellow'](_0x2b1bba[_0x1d8704(0x22c)])),console[_0x1d8704(0x1c9)](),console[_0x1d8704(0x1c9)](_0x1d8704(0x1d6)),console['log'](_0x1d8704(0x1df)),console[_0x1d8704(0x1c9)](_0x1d8704(0x242)),console[_0x1d8704(0x1c9)](),console['log'](_0x1d8704(0x21a));return 0x1;case _0x1d8704(0x1f5):console['log'](a5_0x151568[_0x1d8704(0x1fb)](_0x2b1bba[_0x1d8704(0x22c)])),console[_0x1d8704(0x1c9)](),console[_0x1d8704(0x1c9)](_0x1d8704(0x1e5)+_0x2b1bba[_0x1d8704(0x1ee)]+_0x1d8704(0x204));return 0x1;case'multiple_agents':{const _0x1f20f1=a5_0x373414['basename'](_0x2b1bba['projectDir']);console['log'](a5_0x151568[_0x1d8704(0x1fb)](_0x1d8704(0x1db)+_0x2b1bba[_0x1d8704(0x1ee)]+'\x22:'));for(const _0x5bee60 of _0x2b1bba[_0x1d8704(0x201)]){console['log']('\x20\x20-\x20'+_0x5bee60);}return console['log'](),console['log'](_0x1d8704(0x1cc)+_0x1f20f1+_0x1d8704(0x21f)),0x1;}case _0x1d8704(0x1b1):console[_0x1d8704(0x1c9)](a5_0x151568['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x2b1bba[_0x1d8704(0x1ee)]+'\x22.')),console['log'](a5_0x151568[_0x1d8704(0x21e)](_0x1d8704(0x22f)+_0x2b1bba['projectDir'])),console['log'](),console[_0x1d8704(0x1c9)](_0x1d8704(0x1c5));return 0x1;}}const {definition:_0xd603e9,agentInfo:_0x5906c8}=parseTestFile(_0xc824b8);let _0x56a9c9=_0xd603e9['tests'];if(_0x5b4ee2){const _0x15fb77=_0x5b4ee2['split'](',')[_0x1d8704(0x237)](_0x210d77=>_0x210d77[_0x1d8704(0x232)]());_0x56a9c9=_0xd603e9[_0x1d8704(0x1c8)]['filter'](_0x9b1933=>_0x15fb77[_0x1d8704(0x1dd)](_0x9b1933[_0x1d8704(0x1f6)]));if(_0x56a9c9[_0x1d8704(0x223)]===0x0)return console[_0x1d8704(0x1c9)](a5_0x151568[_0x1d8704(0x1fb)](_0x1d8704(0x1d3)+_0x5b4ee2)),console[_0x1d8704(0x1c9)](a5_0x151568[_0x1d8704(0x21e)](_0x1d8704(0x229)+_0xd603e9[_0x1d8704(0x1c8)]['map'](_0xb11f17=>_0xb11f17['name'])[_0x1d8704(0x21c)](',\x20'))),0x1;}if(_0x322da5){const _0x5d492e=_0x322da5['split'](',')[_0x1d8704(0x237)](_0x136814=>_0x136814['trim']()[_0x1d8704(0x1b7)]());_0x56a9c9=_0x56a9c9[_0x1d8704(0x22e)](_0x3d5d6f=>_0x3d5d6f[_0x1d8704(0x228)]?.['some'](_0x441659=>_0x5d492e['includes'](_0x441659[_0x1d8704(0x1b7)]())));if(_0x56a9c9[_0x1d8704(0x223)]===0x0){console[_0x1d8704(0x1c9)](a5_0x151568[_0x1d8704(0x1fb)](_0x1d8704(0x1ba)+_0x322da5));const _0x567edd=new Set();return _0xd603e9['tests'][_0x1d8704(0x1e0)](_0x476912=>_0x476912['tags']?.[_0x1d8704(0x1e0)](_0x36282f=>_0x567edd['add'](_0x36282f))),_0x567edd[_0x1d8704(0x1b9)]>0x0?console['log'](a5_0x151568['dim'](_0x1d8704(0x1e8)+[..._0x567edd]['join'](',\x20'))):console['log'](a5_0x151568['dim'](_0x1d8704(0x22b))),0x1;}}if(_0xed283)return this[_0x1d8704(0x20e)](_0x3a875f,{'definition':{'tests':_0x56a9c9},'agentInfo':_0x5906c8,'outputFormat':_0x20f1c3,'outputFile':_0x33bdce,'testNames':_0x5b4ee2});if(_0x48367c){console[_0x1d8704(0x1c9)](a5_0x151568[_0x1d8704(0x217)](_0x1d8704(0x23e))),console['log']('\x20\x20Site:\x20'+a5_0x151568[_0x1d8704(0x1f7)](_0x3453d4)),console['log'](_0x1d8704(0x1be)+a5_0x151568['white'](_0x5906c8[_0x1d8704(0x1e3)])),console['log'](_0x1d8704(0x1c7)+a5_0x151568[_0x1d8704(0x1f7)](_0x5906c8[_0x1d8704(0x21b)])),console[_0x1d8704(0x1c9)](),console['log']('Tests\x20found:\x20'+a5_0x151568[_0x1d8704(0x1f7)](_0x56a9c9[_0x1d8704(0x223)]));for(let _0x1c3804=0x0;_0x1c3804<_0x56a9c9['length'];_0x1c3804++){const _0x1c312c=_0x56a9c9[_0x1c3804],_0x4145e0=_0x1c312c['rounds'][_0x1d8704(0x223)]===0x1?'round':'rounds',_0x59244c=_0x1c312c[_0x1d8704(0x228)]?.['length']?'\x20['+_0x1c312c[_0x1d8704(0x228)][_0x1d8704(0x21c)](',\x20')+']':'';console[_0x1d8704(0x1c9)]('\x20\x20'+(_0x1c3804+0x1)+'.\x20'+a5_0x151568[_0x1d8704(0x1f7)](_0x1c312c['name'])+'\x20('+_0x1c312c['rounds'][_0x1d8704(0x223)]+'\x20'+_0x4145e0+')'+a5_0x151568[_0x1d8704(0x21e)](_0x59244c));}return 0x0;}let _0x4c2598,_0x45d64c;try{_0x4c2598=await _0x403fde[_0x1d8704(0x20c)][_0x1d8704(0x1d9)](_0x5906c8[_0x1d8704(0x1e3)]);}catch(_0x27db20){const _0xd0fab6=_0x27db20 instanceof Error?_0x27db20[_0x1d8704(0x22c)]:String(_0x27db20);return _0xd0fab6[_0x1d8704(0x1dd)](_0x1d8704(0x227))||_0xd0fab6[_0x1d8704(0x1b7)]()[_0x1d8704(0x1dd)](_0x1d8704(0x20d))?console[_0x1d8704(0x1c9)](a5_0x151568[_0x1d8704(0x1c0)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x5906c8[_0x1d8704(0x1e3)])):console[_0x1d8704(0x1c9)](a5_0x151568[_0x1d8704(0x1c0)](_0x1d8704(0x200)+_0x5906c8['projectName']+_0x1d8704(0x203)+_0xd0fab6)),0x1;}try{_0x45d64c=await _0x403fde['llm'][_0x1d8704(0x209)](_0x5906c8[_0x1d8704(0x21b)],_0x4c2598);}catch(_0x1d3323){const _0x31518c=_0x1d3323 instanceof Error?_0x1d3323['message']:String(_0x1d3323);return _0x31518c[_0x1d8704(0x1dd)]('404')||_0x31518c['toLowerCase']()[_0x1d8704(0x1dd)](_0x1d8704(0x20d))?console['log'](a5_0x151568[_0x1d8704(0x1c0)](_0x1d8704(0x1af)+_0x5906c8[_0x1d8704(0x21b)])):console[_0x1d8704(0x1c9)](a5_0x151568[_0x1d8704(0x1c0)](_0x1d8704(0x221)+_0x5906c8['agentName']+_0x1d8704(0x203)+_0x31518c)),0x1;}let _0x18ce3f;if(!_0x4bbe16)try{_0x18ce3f=await setupEvaluatorAgent(_0x403fde[_0x1d8704(0x20c)],_0x21bde3[_0x1d8704(0x1b8)]);}catch(_0x20cdef){const _0x5295e0=_0x20cdef instanceof Error?_0x20cdef['message']:String(_0x20cdef);return console[_0x1d8704(0x1c9)](a5_0x151568[_0x1d8704(0x1c0)](_0x1d8704(0x1d1)+_0x5295e0)),0x1;}console[_0x1d8704(0x1c9)](a5_0x151568[_0x1d8704(0x217)]('Running\x20agent\x20tests...')),console[_0x1d8704(0x1c9)](_0x1d8704(0x21d)+a5_0x151568[_0x1d8704(0x1f7)](_0x3453d4)),console[_0x1d8704(0x1c9)](_0x1d8704(0x1ef)+a5_0x151568[_0x1d8704(0x1f7)](_0x5906c8['projectName']+'/'+_0x5906c8[_0x1d8704(0x21b)])),console[_0x1d8704(0x1c9)]();const _0x30fcfb=[],_0x22d596=[],_0x16db51=Date[_0x1d8704(0x244)]();for(let _0x56a05a=0x0;_0x56a05a<_0x56a9c9['length'];_0x56a05a++){const _0x3cf81a=_0x56a9c9[_0x56a05a];_0x56a9c9[_0x1d8704(0x223)]>0x1?console[_0x1d8704(0x1c9)](_0x1d8704(0x230)+(_0x56a05a+0x1)+'/'+_0x56a9c9['length']+':\x20'+a5_0x151568['white'](_0x3cf81a[_0x1d8704(0x1f6)])):console[_0x1d8704(0x1c9)](_0x1d8704(0x1bc)+a5_0x151568[_0x1d8704(0x1f7)](_0x3cf81a['name']));const _0x543f78=createCommandSpinner(_0x1d8704(0x206)+_0x3cf81a[_0x1d8704(0x23a)][_0x1d8704(0x223)]+_0x1d8704(0x1c2));_0x543f78['start']();try{const {result:_0x4eb7cc,conversation:_0x157c4a}=await runTest(_0x403fde['llm'],_0x3cf81a,{'agentId':_0x45d64c,'projectId':_0x4c2598,'site':_0x3453d4,'noEval':_0x4bbe16,'evaluatorId':_0x18ce3f,'onRoundStart':(_0x4a90a7,_0x4a80e2)=>{const _0x4a04b7=_0x1d8704;_0x543f78[_0x4a04b7(0x226)]=_0x4a04b7(0x220)+(_0x4a90a7+0x1)+'/'+_0x4a80e2+_0x4a04b7(0x1c2);},'onRoundComplete':(_0x465a0f,_0x32bd13,_0x211cbd)=>{const _0x2e53cf=_0x1d8704,_0x3c3617=formatElapsed(_0x32bd13);_0x211cbd?console['log'](_0x2e53cf(0x20a)+(_0x465a0f+0x1)+'/'+_0x3cf81a[_0x2e53cf(0x23a)]['length']+_0x2e53cf(0x1ca)+a5_0x151568[_0x2e53cf(0x1d5)]('✓')+'\x20('+_0x3c3617+')'):console['log']('\x20\x20Round\x20'+(_0x465a0f+0x1)+'/'+_0x3cf81a[_0x2e53cf(0x23a)][_0x2e53cf(0x223)]+'...\x20'+a5_0x151568[_0x2e53cf(0x1c0)]('✗'));},'onEvaluationStart':()=>{const _0x288e6f=_0x1d8704;_0x543f78[_0x288e6f(0x226)]='Evaluating\x20response...';},'onEvaluationComplete':_0x7f10e2=>{const _0x135b20=_0x1d8704,_0x526e8c=formatElapsed(_0x7f10e2);console[_0x135b20(0x1c9)]('\x20\x20Evaluating...\x20'+a5_0x151568['green']('✓')+'\x20('+_0x526e8c+')');}});_0x543f78[_0x1d8704(0x1bf)](),_0x30fcfb[_0x1d8704(0x1fe)](_0x4eb7cc),_0x22d596[_0x1d8704(0x1fe)](_0x157c4a);if(_0x4eb7cc['status']===_0x1d8704(0x215))console[_0x1d8704(0x1c9)](a5_0x151568[_0x1d8704(0x1d5)](_0x1d8704(0x1f1)+_0x4eb7cc[_0x1d8704(0x1f2)]));else _0x4eb7cc['status']===_0x1d8704(0x1ea)?console[_0x1d8704(0x1c9)](a5_0x151568[_0x1d8704(0x1c0)](_0x1d8704(0x1f4)+_0x4eb7cc['reason'])):console[_0x1d8704(0x1c9)](a5_0x151568[_0x1d8704(0x1c0)](_0x1d8704(0x238)+_0x4eb7cc['reason']));_0x4eb7cc[_0x1d8704(0x224)]&&console[_0x1d8704(0x1c9)](a5_0x151568[_0x1d8704(0x21e)](_0x1d8704(0x1f9)+_0x4eb7cc[_0x1d8704(0x224)])),console[_0x1d8704(0x1c9)]();}catch(_0x1c6044){_0x543f78[_0x1d8704(0x1bf)]();const _0x1f4947=_0x1c6044 instanceof Error?_0x1c6044[_0x1d8704(0x22c)]:String(_0x1c6044);console['log'](a5_0x151568[_0x1d8704(0x1c0)]('✗\x20ERROR:\x20'+_0x1f4947)),console[_0x1d8704(0x1c9)](),_0x30fcfb[_0x1d8704(0x1fe)]({'name':_0x3cf81a['name'],'status':_0x1d8704(0x22d),'reason':_0x1f4947,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x315f65=Date['now']()-_0x16db51,_0x1b69db=_0x30fcfb[_0x1d8704(0x22e)](_0x13e548=>_0x13e548[_0x1d8704(0x1b0)]===_0x1d8704(0x215))['length'],_0x13955b=_0x30fcfb[_0x1d8704(0x22e)](_0x374150=>_0x374150[_0x1d8704(0x1b0)]==='FAIL')['length'],_0x183031=_0x30fcfb[_0x1d8704(0x22e)](_0x1a8741=>_0x1a8741[_0x1d8704(0x1b0)]===_0x1d8704(0x22d))[_0x1d8704(0x223)];console['log']('━'['repeat'](0x3c)),console[_0x1d8704(0x1c9)]('Test\x20Summary'),console['log']('━'[_0x1d8704(0x213)](0x3c)),console[_0x1d8704(0x1c9)](_0x1d8704(0x20b)+_0x30fcfb['length']),console['log'](_0x1d8704(0x1ed)+a5_0x151568['green'](_0x1b69db)),console[_0x1d8704(0x1c9)](_0x1d8704(0x241)+a5_0x151568[_0x1d8704(0x1c0)](_0x13955b));_0x183031>0x0&&console['log'](_0x1d8704(0x1bb)+a5_0x151568['red'](_0x183031));console[_0x1d8704(0x1c9)](_0x1d8704(0x234)+formatElapsed(_0x315f65)),console['log']('━'['repeat'](0x3c));const _0xf353f3=_0x30fcfb['filter'](_0x11a7c8=>_0x11a7c8[_0x1d8704(0x1b0)]!==_0x1d8704(0x215));if(_0xf353f3[_0x1d8704(0x223)]>0x0){console[_0x1d8704(0x1c9)](),console[_0x1d8704(0x1c9)]('Failed\x20Tests:');for(const _0x426919 of _0xf353f3){const _0x3dd181=a5_0x151568[_0x1d8704(0x1c0)]('✗'),_0x1d4708=_0x426919[_0x1d8704(0x1f2)][_0x1d8704(0x223)]>0x32?_0x426919[_0x1d8704(0x1f2)]['substring'](0x0,0x32)+_0x1d8704(0x1fd):_0x426919['reason'];console['log']('\x20\x20'+_0x3dd181+'\x20'+_0x426919[_0x1d8704(0x1f6)]+':\x20'+_0x1d4708);}}const _0x509f9b={'summary':{'total':_0x30fcfb[_0x1d8704(0x223)],'passed':_0x1b69db,'failed':_0x13955b,'errors':_0x183031>0x0?_0x183031:undefined,'duration_ms':_0x315f65},'tests':_0x30fcfb,'agent':{'project':_0x5906c8[_0x1d8704(0x1e3)],'name':_0x5906c8['agentName'],'site':_0x3453d4},'timestamp':new Date(_0x16db51)[_0x1d8704(0x1b3)]()};try{const _0x2ed5d3=buildCachedTestRun(_0x22d596,{'site':_0x3453d4,'projectId':_0x4c2598,'projectName':_0x5906c8[_0x1d8704(0x1e3)],'agentId':_0x45d64c,'agentName':_0x5906c8[_0x1d8704(0x21b)],'testYmlPath':a5_0x373414[_0x1d8704(0x1f3)](_0x5906c8[_0x1d8704(0x1eb)])});saveLastTestRun(_0x2ed5d3);}catch{}if(_0x20f1c3!=='table'||_0x33bdce){const _0x191cdf=formatResults(_0x509f9b,_0x20f1c3);if(_0x33bdce)try{a5_0xc7e23[_0x1d8704(0x208)](_0x33bdce,_0x191cdf,_0x1d8704(0x1bd)),console[_0x1d8704(0x1c9)](),console[_0x1d8704(0x1c9)](a5_0x151568['dim'](_0x1d8704(0x1c3)+_0x33bdce));}catch(_0x3c7d26){return console[_0x1d8704(0x1c9)](),console[_0x1d8704(0x1c9)](a5_0x151568[_0x1d8704(0x1c0)](_0x1d8704(0x1ce)+_0x3c7d26)),0x1;}else console['log'](),console[_0x1d8704(0x1c9)](_0x191cdf);}return _0xf353f3[_0x1d8704(0x223)]>0x0?0x1:0x0;}async['executeReeval'](_0x4f5a9f,_0x2e1732){const _0x39ccb9=a5_0x5bcf6f,{options:_0x454afe,tdx:_0x4fa446}=_0x4f5a9f,{definition:_0x42ed90,agentInfo:_0x1e9405,outputFormat:_0x151ec7,outputFile:_0x57f872}=_0x2e1732,_0x452081=_0x454afe[_0x39ccb9(0x1b5)],_0x50d3d8=loadLastTestRun();if(!_0x50d3d8)return console[_0x39ccb9(0x1c9)](a5_0x151568[_0x39ccb9(0x1c0)](_0x39ccb9(0x243))),console['log'](a5_0x151568[_0x39ccb9(0x21e)](_0x39ccb9(0x1d0))),0x1;if(_0x50d3d8[_0x39ccb9(0x22a)][_0x39ccb9(0x21b)]!==_0x1e9405['agentName'])return console[_0x39ccb9(0x1c9)](a5_0x151568[_0x39ccb9(0x1c0)](_0x39ccb9(0x207)+_0x50d3d8['agent'][_0x39ccb9(0x21b)]+_0x39ccb9(0x1e7)+_0x1e9405[_0x39ccb9(0x21b)]+'\x22.')),console[_0x39ccb9(0x1c9)](a5_0x151568[_0x39ccb9(0x21e)](_0x39ccb9(0x1e9))),0x1;const _0x1ea194=new Set(_0x50d3d8[_0x39ccb9(0x1b4)][_0x39ccb9(0x237)](_0x1125e1=>_0x1125e1['testName'])),_0x3bcd01=_0x42ed90[_0x39ccb9(0x1c8)]['filter'](_0x5c9981=>!_0x1ea194[_0x39ccb9(0x233)](_0x5c9981[_0x39ccb9(0x1f6)]));if(_0x3bcd01['length']>0x0&&_0x50d3d8[_0x39ccb9(0x1b5)]!==_0x452081)return console[_0x39ccb9(0x1c9)](a5_0x151568[_0x39ccb9(0x1c0)](_0x39ccb9(0x20f))),console[_0x39ccb9(0x1c9)](a5_0x151568[_0x39ccb9(0x21e)](_0x39ccb9(0x211)+_0x50d3d8[_0x39ccb9(0x1b5)]+_0x39ccb9(0x1d7)+_0x452081+'\x22.')),console[_0x39ccb9(0x1c9)](a5_0x151568[_0x39ccb9(0x21e)](_0x39ccb9(0x1fc)+_0x50d3d8[_0x39ccb9(0x1b5)]+_0x39ccb9(0x1d4))),0x1;const _0x282e1b=_0x42ed90[_0x39ccb9(0x1c8)]['filter'](_0x4c19e2=>_0x1ea194['has'](_0x4c19e2[_0x39ccb9(0x1f6)])),_0x2d226c=_0x3bcd01;let _0x32a53d;try{_0x32a53d=await setupEvaluatorAgent(_0x4fa446[_0x39ccb9(0x20c)],_0x454afe['verbose']);}catch(_0x43744c){const _0x373ea1=_0x43744c instanceof Error?_0x43744c[_0x39ccb9(0x22c)]:String(_0x43744c);return console[_0x39ccb9(0x1c9)](a5_0x151568[_0x39ccb9(0x1c0)](_0x39ccb9(0x1d1)+_0x373ea1)),0x1;}console[_0x39ccb9(0x1c9)](a5_0x151568[_0x39ccb9(0x217)](_0x39ccb9(0x212))),console[_0x39ccb9(0x1c9)](_0x39ccb9(0x205)+a5_0x151568['white'](_0x50d3d8[_0x39ccb9(0x1cd)])),console[_0x39ccb9(0x1c9)](_0x39ccb9(0x1ef)+a5_0x151568[_0x39ccb9(0x1f7)](_0x50d3d8[_0x39ccb9(0x22a)][_0x39ccb9(0x1e3)]+'/'+_0x50d3d8[_0x39ccb9(0x22a)][_0x39ccb9(0x21b)]));_0x2d226c[_0x39ccb9(0x223)]>0x0&&console[_0x39ccb9(0x1c9)](_0x39ccb9(0x1fa)+a5_0x151568[_0x39ccb9(0x1fb)](_0x2d226c['length']));console[_0x39ccb9(0x1c9)]();const _0x94107f=[],_0x49903e=Date[_0x39ccb9(0x244)](),_0x9cabda=createCommandSpinner('Re-evaluating...');if(_0x282e1b[_0x39ccb9(0x223)]>0x0)try{const _0x2465cb=await reevaluateFromCache(_0x4fa446[_0x39ccb9(0x20c)],_0x50d3d8,{'tests':_0x282e1b},{'evaluatorId':_0x32a53d,'onTestStart':(_0x3c4cb5,_0x1a3d07,_0x4a190b)=>{const _0x3aece1=_0x39ccb9;_0x9cabda[_0x3aece1(0x226)]=_0x3aece1(0x1cf)+(_0x1a3d07+0x1)+'/'+_0x4a190b+':\x20'+_0x3c4cb5+_0x3aece1(0x1fd);if(!_0x9cabda['isSpinning'])_0x9cabda['start']();},'onTestComplete':(_0x201b12,_0x571002)=>{const _0x403130=_0x39ccb9;_0x9cabda[_0x403130(0x1bf)]();if(_0x571002['status']==='PASS')console[_0x403130(0x1c9)](a5_0x151568[_0x403130(0x1d5)](_0x403130(0x1f1)+_0x201b12)+a5_0x151568[_0x403130(0x21e)](_0x403130(0x1cb)));else _0x571002['status']===_0x403130(0x1ea)?console[_0x403130(0x1c9)](a5_0x151568[_0x403130(0x1c0)](_0x403130(0x1f4)+_0x201b12+_0x403130(0x23b)+_0x571002[_0x403130(0x1f2)])+a5_0x151568[_0x403130(0x21e)](_0x403130(0x1cb))):console['log'](a5_0x151568[_0x403130(0x1c0)](_0x403130(0x238)+_0x201b12+'\x20-\x20'+_0x571002['reason']));_0x571002[_0x403130(0x224)]&&console[_0x403130(0x1c9)](a5_0x151568[_0x403130(0x21e)](_0x403130(0x231)+_0x571002[_0x403130(0x224)])),_0x94107f[_0x403130(0x1fe)](_0x571002);},'onTestSkipped':(_0x482493,_0x32b224)=>{const _0xf11493=_0x39ccb9;_0x9cabda[_0xf11493(0x1bf)](),console[_0xf11493(0x1c9)](a5_0x151568[_0xf11493(0x1fb)](_0xf11493(0x239)+_0x482493+_0xf11493(0x23b)+_0x32b224));}});for(const _0x7c991d of _0x2465cb){!_0x94107f[_0x39ccb9(0x1da)](_0x3f39fb=>_0x3f39fb[_0x39ccb9(0x1f6)]===_0x7c991d['name'])&&_0x94107f[_0x39ccb9(0x1fe)](_0x7c991d);}}catch(_0x45919c){_0x9cabda[_0x39ccb9(0x1bf)]();const _0x422bc8=_0x45919c instanceof Error?_0x45919c[_0x39ccb9(0x22c)]:String(_0x45919c);return console[_0x39ccb9(0x1c9)](a5_0x151568[_0x39ccb9(0x1c0)](_0x39ccb9(0x1b2)+_0x422bc8)),0x1;}_0x9cabda[_0x39ccb9(0x1bf)]();if(_0x2d226c['length']>0x0){console[_0x39ccb9(0x1c9)](),console[_0x39ccb9(0x1c9)](a5_0x151568[_0x39ccb9(0x217)]('Executing\x20new\x20tests...'));const {projectId:_0x488574,agentId:_0x3613eb}=_0x50d3d8[_0x39ccb9(0x22a)];for(const _0x1d140a of _0x2d226c){console[_0x39ccb9(0x1c9)](_0x39ccb9(0x1e6)+a5_0x151568[_0x39ccb9(0x1f7)](_0x1d140a['name']));const _0x3e44e7=createCommandSpinner(_0x39ccb9(0x206)+_0x1d140a['rounds'][_0x39ccb9(0x223)]+':\x20Sending\x20user\x20input...');_0x3e44e7[_0x39ccb9(0x236)]();try{const {result:_0x3fc34b}=await runTest(_0x4fa446[_0x39ccb9(0x20c)],_0x1d140a,{'agentId':_0x3613eb,'projectId':_0x488574,'site':_0x50d3d8[_0x39ccb9(0x1b5)],'noEval':![],'evaluatorId':_0x32a53d,'onRoundStart':(_0x3b7ddb,_0x5b69f8)=>{const _0x49798c=_0x39ccb9;_0x3e44e7[_0x49798c(0x226)]=_0x49798c(0x220)+(_0x3b7ddb+0x1)+'/'+_0x5b69f8+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x37dc3e,_0x2c40a2,_0x1cf608)=>{const _0x457aaf=_0x39ccb9,_0x46835e=formatElapsed(_0x2c40a2);_0x1cf608?console['log']('\x20\x20Round\x20'+(_0x37dc3e+0x1)+'/'+_0x1d140a[_0x457aaf(0x23a)]['length']+_0x457aaf(0x1ca)+a5_0x151568[_0x457aaf(0x1d5)]('✓')+'\x20('+_0x46835e+')'):console[_0x457aaf(0x1c9)](_0x457aaf(0x20a)+(_0x37dc3e+0x1)+'/'+_0x1d140a['rounds'][_0x457aaf(0x223)]+_0x457aaf(0x1ca)+a5_0x151568[_0x457aaf(0x1c0)]('✗'));},'onEvaluationStart':()=>{const _0x2f18a7=_0x39ccb9;_0x3e44e7[_0x2f18a7(0x226)]=_0x2f18a7(0x1f0);},'onEvaluationComplete':_0x258556=>{const _0x510f8c=_0x39ccb9,_0x4ba24c=formatElapsed(_0x258556);console['log'](_0x510f8c(0x1d8)+a5_0x151568['green']('✓')+'\x20('+_0x4ba24c+')');}});_0x3e44e7['stop'](),_0x94107f[_0x39ccb9(0x1fe)](_0x3fc34b);if(_0x3fc34b['status']===_0x39ccb9(0x215))console['log'](a5_0x151568['green'](_0x39ccb9(0x1f1)+_0x3fc34b[_0x39ccb9(0x1f2)])+a5_0x151568['dim'](_0x39ccb9(0x218)));else _0x3fc34b[_0x39ccb9(0x1b0)]===_0x39ccb9(0x1ea)?console['log'](a5_0x151568['red']('✗\x20FAIL:\x20'+_0x3fc34b['reason'])+a5_0x151568['dim'](_0x39ccb9(0x218))):console[_0x39ccb9(0x1c9)](a5_0x151568[_0x39ccb9(0x1c0)]('✗\x20ERROR:\x20'+_0x3fc34b[_0x39ccb9(0x1f2)]));_0x3fc34b[_0x39ccb9(0x224)]&&console[_0x39ccb9(0x1c9)](a5_0x151568[_0x39ccb9(0x21e)]('\x20\x20Conversation:\x20'+_0x3fc34b['conversation_url']));}catch(_0x900d6b){_0x3e44e7[_0x39ccb9(0x1bf)]();const _0x1786e1=_0x900d6b instanceof Error?_0x900d6b[_0x39ccb9(0x22c)]:String(_0x900d6b);console[_0x39ccb9(0x1c9)](a5_0x151568['red'](_0x39ccb9(0x238)+_0x1786e1)),_0x94107f[_0x39ccb9(0x1fe)]({'name':_0x1d140a[_0x39ccb9(0x1f6)],'status':_0x39ccb9(0x22d),'reason':_0x1786e1,'timestamp':new Date()[_0x39ccb9(0x1b3)](),'duration_ms':0x0});}}}console[_0x39ccb9(0x1c9)]();const _0x4e0df3=Date['now']()-_0x49903e,_0x14cf4b=_0x94107f[_0x39ccb9(0x22e)](_0x306f4c=>_0x306f4c[_0x39ccb9(0x1b0)]===_0x39ccb9(0x215))[_0x39ccb9(0x223)],_0x428230=_0x94107f[_0x39ccb9(0x22e)](_0x314999=>_0x314999[_0x39ccb9(0x1b0)]===_0x39ccb9(0x1ea))[_0x39ccb9(0x223)],_0x86c1d8=_0x94107f[_0x39ccb9(0x22e)](_0x17dff2=>_0x17dff2[_0x39ccb9(0x1b0)]===_0x39ccb9(0x22d))[_0x39ccb9(0x223)];console[_0x39ccb9(0x1c9)]('━'[_0x39ccb9(0x213)](0x3c)),console['log'](_0x39ccb9(0x210)),console[_0x39ccb9(0x1c9)]('━'[_0x39ccb9(0x213)](0x3c)),console[_0x39ccb9(0x1c9)](_0x39ccb9(0x20b)+_0x94107f['length']),console[_0x39ccb9(0x1c9)](_0x39ccb9(0x1ed)+a5_0x151568[_0x39ccb9(0x1d5)](_0x14cf4b)),console[_0x39ccb9(0x1c9)](_0x39ccb9(0x241)+a5_0x151568[_0x39ccb9(0x1c0)](_0x428230));_0x86c1d8>0x0&&console[_0x39ccb9(0x1c9)](_0x39ccb9(0x1bb)+a5_0x151568[_0x39ccb9(0x1c0)](_0x86c1d8));console[_0x39ccb9(0x1c9)](_0x39ccb9(0x234)+formatElapsed(_0x4e0df3)),console['log']('━'['repeat'](0x3c));const _0x5aaaf5={'summary':{'total':_0x94107f[_0x39ccb9(0x223)],'passed':_0x14cf4b,'failed':_0x428230,'errors':_0x86c1d8>0x0?_0x86c1d8:undefined,'duration_ms':_0x4e0df3},'tests':_0x94107f,'agent':{'project':_0x1e9405[_0x39ccb9(0x1e3)],'name':_0x1e9405[_0x39ccb9(0x21b)],'site':_0x452081},'timestamp':new Date(_0x49903e)['toISOString']()};if(_0x151ec7!==_0x39ccb9(0x235)||_0x57f872){const _0x193b4c=formatResults(_0x5aaaf5,_0x151ec7);if(_0x57f872)try{a5_0xc7e23[_0x39ccb9(0x208)](_0x57f872,_0x193b4c,_0x39ccb9(0x1bd)),console[_0x39ccb9(0x1c9)](),console[_0x39ccb9(0x1c9)](a5_0x151568['dim'](_0x39ccb9(0x1c3)+_0x57f872));}catch(_0x2a1274){return console[_0x39ccb9(0x1c9)](),console[_0x39ccb9(0x1c9)](a5_0x151568[_0x39ccb9(0x1c0)](_0x39ccb9(0x1ce)+_0x2a1274)),0x1;}else console[_0x39ccb9(0x1c9)](),console['log'](_0x193b4c);}const _0x312f3c=_0x94107f[_0x39ccb9(0x22e)](_0x18f32f=>_0x18f32f[_0x39ccb9(0x1b0)]!==_0x39ccb9(0x215));return _0x312f3c[_0x39ccb9(0x223)]>0x0?0x1:0x0;}}
1
+ const a5_0x55f8a5=a5_0xb968;(function(_0xdc9597,_0x597c20){const _0x1bc81b=a5_0xb968,_0x39ec0c=_0xdc9597();while(!![]){try{const _0x585922=-parseInt(_0x1bc81b(0x262))/0x1*(parseInt(_0x1bc81b(0x247))/0x2)+parseInt(_0x1bc81b(0x250))/0x3*(parseInt(_0x1bc81b(0x255))/0x4)+parseInt(_0x1bc81b(0x229))/0x5*(-parseInt(_0x1bc81b(0x239))/0x6)+parseInt(_0x1bc81b(0x213))/0x7*(-parseInt(_0x1bc81b(0x206))/0x8)+-parseInt(_0x1bc81b(0x25b))/0x9+-parseInt(_0x1bc81b(0x23a))/0xa+-parseInt(_0x1bc81b(0x20d))/0xb*(-parseInt(_0x1bc81b(0x279))/0xc);if(_0x585922===_0x597c20)break;else _0x39ec0c['push'](_0x39ec0c['shift']());}catch(_0x2f2f2c){_0x39ec0c['push'](_0x39ec0c['shift']());}}}(a5_0x3bd6,0x8c0a6));function a5_0x3bd6(){const _0x45c6f5=['Evaluating\x20response...','basename','✗\x20FAIL:\x20','toISOString','✗\x20ERROR:\x20Project\x20not\x20found:\x20','start','Re-evaluating\x20cached\x20test\x20run...','map','log','now','executeReeval','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','reason','\x20-\x20','text','Test\x20','\x20\x20Conversation:\x20','substring','testName','round','12dHIPRQ','conversation_url','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','join','utf-8','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','trim','No\x20tests\x20have\x20tags\x20defined.','New\x20tests\x20to\x20execute:\x20','find','message','Running\x20agent\x20tests...','push','Run\x20\x27tdx\x20agent\x20pull\x20','Cached\x20run\x20from:\x20','includes','tags','cyan','Agent:\x20','length','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','repeat','Tests\x20found:\x20','not\x20found','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','size','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','agentName','site','tsv','ERROR','Running\x20test:\x20','\x20(cached)','description','table','existsSync','forEach','251480wxBJgQ','test.yml','rounds','projectName','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','llm','33230879qskNLS','Output\x20written\x20to:\x20','Re-evaluation\x20Summary','Total:\x20\x20\x20\x20','found','Failed:\x20\x20\x20','203utlaqi','Either\x20switch\x20to\x20the\x20\x22','...','Re-evaluating\x20','timestamp','Round\x20','yellow','✗\x20ERROR:\x20','reeval','404','writeFileSync','isSpinning','json','Usage:','agent:test','\x20(new)','resolveProjectId','filter','tests','testYmlPath','⚠\x20SKIPPED:\x20','has','5NeDINr','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Conversation\x20URL:\x20','Project\x20path:\x20','status','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','\x20\x20Round\x20','add','stop','no_tests','Using\x20agent:\x20','Duration:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','\x20\x20Site:\x20','...\x20','Round\x201/','1961634NSQpwy','6491780GntMbW','✓\x20PASS:\x20','\x20\x20Project:\x20','name','resolve','Executing\x20new\x20tests...','Running:\x20','agent','FAIL','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','split','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','jsonl','242036PJSlpS','\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','execute','\x27\x20to\x20create\x20the\x20folder\x20structure.','green','Errors:\x20\x20\x20','llmProject','conversations','dim','33onYkhe','Site:\x20','source','red','verbose','198772AMvsiw','\x20\x20Agent:\x20','projectDir','PASS','resolveAgentId','white','7778142lXMgPj','dryRun','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Error\x20writing\x20output\x20file:\x20','Passed:\x20\x20\x20',':\x20Sending\x20user\x20input...','2XyYJMd','toLowerCase'];a5_0x3bd6=function(){return _0x45c6f5;};return a5_0x3bd6();}import*as a5_0x39ebc7 from'node:fs';import*as a5_0x6f11d6 from'node:path';import a5_0x60bf87 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0xb968(_0xfd25f7,_0x1bf5a1){_0xfd25f7=_0xfd25f7-0x1e8;const _0x3bd65c=a5_0x3bd6();let _0xb968eb=_0x3bd65c[_0xfd25f7];return _0xb968eb;}export class AgentTestCommand extends BaseCommand{[a5_0x55f8a5(0x23d)]=a5_0x55f8a5(0x221);[a5_0x55f8a5(0x202)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x55f8a5(0x249)](_0x2503f2){const _0x44727c=a5_0x55f8a5,{options:_0x2831fd,args:_0x474bd3,tdx:_0x3d0c5d}=_0x2503f2,_0x44546d=_0x474bd3[0x0]||'.',_0x5b15f6=_0x2831fd[_0x44727c(0x25c)],_0x139ca4=_0x2831fd,_0x1d5ffe=_0x139ca4['eval']===![],_0x2991a3=_0x139ca4[_0x44727c(0x21b)],_0x424ecd=_0x139ca4[_0x44727c(0x23d)],_0x2dbd49=_0x139ca4[_0x44727c(0x1f1)],_0xb8c150=_0x2831fd['site'],_0xcb2210=_0x139ca4['output'];if(_0x2991a3&&_0x1d5ffe)return console[_0x44727c(0x26c)](a5_0x60bf87[_0x44727c(0x253)](_0x44727c(0x243))),0x1;let _0x2fd881=_0x44727c(0x203);if(_0x139ca4[_0x44727c(0x21f)])_0x2fd881=_0x44727c(0x21f);else{if(_0x139ca4[_0x44727c(0x246)])_0x2fd881=_0x44727c(0x246);else{if(_0x139ca4[_0x44727c(0x1fe)])_0x2fd881='tsv';else{if(_0x139ca4[_0x44727c(0x203)])_0x2fd881=_0x44727c(0x203);}}}const _0x23766e=_0x139ca4['llmProject'];let _0x172643=_0x44546d;const _0x164afb=a5_0x39ebc7[_0x44727c(0x204)](_0x44546d),_0x5a004c=_0x44546d==='.';if(!_0x164afb||_0x5a004c){const _0x19b025=resolveProjectFromContext(_0x44546d,_0x23766e,{'requireFile':_0x44727c(0x207)});if(_0x19b025[_0x44727c(0x211)])_0x172643=_0x19b025[_0x44727c(0x257)],_0x19b025[_0x44727c(0x252)]==='context'&&console['log'](a5_0x60bf87[_0x44727c(0x24f)](_0x44727c(0x233)+_0x172643));else switch(_0x19b025[_0x44727c(0x271)]){case'no_context':console[_0x44727c(0x26c)](a5_0x60bf87['yellow'](_0x19b025['message'])),console[_0x44727c(0x26c)](),console[_0x44727c(0x26c)](_0x44727c(0x220)),console['log'](_0x44727c(0x248)),console['log']('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console['log'](),console['log'](_0x44727c(0x1f5));return 0x1;case'no_local_folder':console['log'](a5_0x60bf87['yellow'](_0x19b025['message'])),console[_0x44727c(0x26c)](),console[_0x44727c(0x26c)](_0x44727c(0x1ee)+_0x19b025[_0x44727c(0x24d)]+_0x44727c(0x24a));return 0x1;case'multiple_agents':{const _0x53de6d=a5_0x6f11d6[_0x44727c(0x265)](_0x19b025[_0x44727c(0x257)]);console['log'](a5_0x60bf87['yellow'](_0x44727c(0x1f9)+_0x19b025[_0x44727c(0x24d)]+'\x22:'));for(const _0x10a0eb of _0x19b025['agentDirs']){console[_0x44727c(0x26c)]('\x20\x20-\x20'+_0x10a0eb);}return console['log'](),console['log'](_0x44727c(0x22e)+_0x53de6d+'/<agent-name>'),0x1;}case _0x44727c(0x232):console[_0x44727c(0x26c)](a5_0x60bf87[_0x44727c(0x219)](_0x44727c(0x27e)+_0x19b025[_0x44727c(0x24d)]+'\x22.')),console[_0x44727c(0x26c)](a5_0x60bf87[_0x44727c(0x24f)](_0x44727c(0x22c)+_0x19b025['projectDir'])),console[_0x44727c(0x26c)](),console[_0x44727c(0x26c)](_0x44727c(0x245));return 0x1;}}const {definition:_0x5d1426,agentInfo:_0x453739}=parseTestFile(_0x172643);let _0x2ecbd1=_0x5d1426[_0x44727c(0x225)];if(_0x424ecd){const _0x388ee4=_0x424ecd[_0x44727c(0x244)](',')[_0x44727c(0x26b)](_0x3b6d49=>_0x3b6d49['trim']());_0x2ecbd1=_0x5d1426[_0x44727c(0x225)][_0x44727c(0x224)](_0x137b6f=>_0x388ee4[_0x44727c(0x1f0)](_0x137b6f[_0x44727c(0x23d)]));if(_0x2ecbd1[_0x44727c(0x1f4)]===0x0)return console[_0x44727c(0x26c)](a5_0x60bf87[_0x44727c(0x219)]('No\x20tests\x20found\x20matching:\x20'+_0x424ecd)),console[_0x44727c(0x26c)](a5_0x60bf87[_0x44727c(0x24f)]('Available\x20tests:\x20'+_0x5d1426[_0x44727c(0x225)][_0x44727c(0x26b)](_0x59f2ec=>_0x59f2ec[_0x44727c(0x23d)])[_0x44727c(0x27c)](',\x20'))),0x1;}if(_0x2dbd49){const _0x5d2779=_0x2dbd49[_0x44727c(0x244)](',')[_0x44727c(0x26b)](_0x3ec5b6=>_0x3ec5b6[_0x44727c(0x27f)]()[_0x44727c(0x263)]());_0x2ecbd1=_0x2ecbd1[_0x44727c(0x224)](_0x10f7a9=>_0x10f7a9['tags']?.['some'](_0x159698=>_0x5d2779[_0x44727c(0x1f0)](_0x159698['toLowerCase']())));if(_0x2ecbd1[_0x44727c(0x1f4)]===0x0){console[_0x44727c(0x26c)](a5_0x60bf87['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x2dbd49));const _0x722af3=new Set();return _0x5d1426['tests'][_0x44727c(0x205)](_0x5986b4=>_0x5986b4[_0x44727c(0x1f1)]?.[_0x44727c(0x205)](_0x40e664=>_0x722af3[_0x44727c(0x230)](_0x40e664))),_0x722af3[_0x44727c(0x1fa)]>0x0?console[_0x44727c(0x26c)](a5_0x60bf87[_0x44727c(0x24f)]('Available\x20tags:\x20'+[..._0x722af3][_0x44727c(0x27c)](',\x20'))):console['log'](a5_0x60bf87[_0x44727c(0x24f)](_0x44727c(0x1e8))),0x1;}}if(_0x2991a3)return this['executeReeval'](_0x2503f2,{'definition':{'tests':_0x2ecbd1},'agentInfo':_0x453739,'outputFormat':_0x2fd881,'outputFile':_0xcb2210,'testNames':_0x424ecd});if(_0x5b15f6){console[_0x44727c(0x26c)](a5_0x60bf87[_0x44727c(0x1f2)]('Test\x20Configuration:')),console[_0x44727c(0x26c)](_0x44727c(0x236)+a5_0x60bf87[_0x44727c(0x25a)](_0xb8c150)),console[_0x44727c(0x26c)](_0x44727c(0x23c)+a5_0x60bf87[_0x44727c(0x25a)](_0x453739['projectName'])),console[_0x44727c(0x26c)](_0x44727c(0x256)+a5_0x60bf87[_0x44727c(0x25a)](_0x453739[_0x44727c(0x1fc)])),console[_0x44727c(0x26c)](),console[_0x44727c(0x26c)](_0x44727c(0x1f7)+a5_0x60bf87[_0x44727c(0x25a)](_0x2ecbd1[_0x44727c(0x1f4)]));for(let _0x208b01=0x0;_0x208b01<_0x2ecbd1[_0x44727c(0x1f4)];_0x208b01++){const _0x57a36e=_0x2ecbd1[_0x208b01],_0x304aef=_0x57a36e[_0x44727c(0x208)][_0x44727c(0x1f4)]===0x1?_0x44727c(0x278):_0x44727c(0x208),_0x39a42a=_0x57a36e['tags']?.[_0x44727c(0x1f4)]?'\x20['+_0x57a36e[_0x44727c(0x1f1)]['join'](',\x20')+']':'';console[_0x44727c(0x26c)]('\x20\x20'+(_0x208b01+0x1)+'.\x20'+a5_0x60bf87[_0x44727c(0x25a)](_0x57a36e['name'])+'\x20('+_0x57a36e[_0x44727c(0x208)][_0x44727c(0x1f4)]+'\x20'+_0x304aef+')'+a5_0x60bf87[_0x44727c(0x24f)](_0x39a42a));}return 0x0;}let _0x3173fc,_0x4d933f;try{_0x3173fc=await _0x3d0c5d[_0x44727c(0x20c)][_0x44727c(0x223)](_0x453739[_0x44727c(0x209)]);}catch(_0x4f9ab8){const _0x2d2a8e=_0x4f9ab8 instanceof Error?_0x4f9ab8[_0x44727c(0x1eb)]:String(_0x4f9ab8);return _0x2d2a8e[_0x44727c(0x1f0)]('404')||_0x2d2a8e['toLowerCase']()[_0x44727c(0x1f0)](_0x44727c(0x1f8))?console[_0x44727c(0x26c)](a5_0x60bf87[_0x44727c(0x253)](_0x44727c(0x268)+_0x453739[_0x44727c(0x209)])):console[_0x44727c(0x26c)](a5_0x60bf87[_0x44727c(0x253)](_0x44727c(0x20b)+_0x453739[_0x44727c(0x209)]+'\x22:\x20'+_0x2d2a8e)),0x1;}try{_0x4d933f=await _0x3d0c5d[_0x44727c(0x20c)][_0x44727c(0x259)](_0x453739['agentName'],_0x3173fc);}catch(_0x4ff807){const _0x2ead83=_0x4ff807 instanceof Error?_0x4ff807[_0x44727c(0x1eb)]:String(_0x4ff807);return _0x2ead83[_0x44727c(0x1f0)](_0x44727c(0x21c))||_0x2ead83[_0x44727c(0x263)]()[_0x44727c(0x1f0)](_0x44727c(0x1f8))?console['log'](a5_0x60bf87[_0x44727c(0x253)](_0x44727c(0x27b)+_0x453739[_0x44727c(0x1fc)])):console[_0x44727c(0x26c)](a5_0x60bf87['red'](_0x44727c(0x22a)+_0x453739[_0x44727c(0x1fc)]+'\x22:\x20'+_0x2ead83)),0x1;}let _0x24e955;if(!_0x1d5ffe)try{_0x24e955=await setupEvaluatorAgent(_0x3d0c5d[_0x44727c(0x20c)],_0x2831fd[_0x44727c(0x254)]);}catch(_0x3ad9ec){const _0x32ab1b=_0x3ad9ec instanceof Error?_0x3ad9ec[_0x44727c(0x1eb)]:String(_0x3ad9ec);return console['log'](a5_0x60bf87['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x32ab1b)),0x1;}console[_0x44727c(0x26c)](a5_0x60bf87[_0x44727c(0x1f2)](_0x44727c(0x1ec))),console['log'](_0x44727c(0x251)+a5_0x60bf87[_0x44727c(0x25a)](_0xb8c150)),console[_0x44727c(0x26c)](_0x44727c(0x1f3)+a5_0x60bf87[_0x44727c(0x25a)](_0x453739['projectName']+'/'+_0x453739[_0x44727c(0x1fc)])),console[_0x44727c(0x26c)]();const _0x57a773=[],_0x1e5497=[],_0x448079=Date[_0x44727c(0x26d)]();for(let _0x571012=0x0;_0x571012<_0x2ecbd1[_0x44727c(0x1f4)];_0x571012++){const _0x5afe6e=_0x2ecbd1[_0x571012];_0x2ecbd1[_0x44727c(0x1f4)]>0x1?console[_0x44727c(0x26c)](_0x44727c(0x274)+(_0x571012+0x1)+'/'+_0x2ecbd1[_0x44727c(0x1f4)]+':\x20'+a5_0x60bf87[_0x44727c(0x25a)](_0x5afe6e['name'])):console[_0x44727c(0x26c)](_0x44727c(0x200)+a5_0x60bf87[_0x44727c(0x25a)](_0x5afe6e[_0x44727c(0x23d)]));const _0x14dffe=createCommandSpinner(_0x44727c(0x238)+_0x5afe6e[_0x44727c(0x208)][_0x44727c(0x1f4)]+_0x44727c(0x261));_0x14dffe[_0x44727c(0x269)]();try{const {result:_0x24f0ab,conversation:_0x2dc1e5}=await runTest(_0x3d0c5d[_0x44727c(0x20c)],_0x5afe6e,{'agentId':_0x4d933f,'projectId':_0x3173fc,'site':_0xb8c150,'noEval':_0x1d5ffe,'evaluatorId':_0x24e955,'onRoundStart':(_0x5e2807,_0x714870)=>{const _0x126492=_0x44727c;_0x14dffe['text']=_0x126492(0x218)+(_0x5e2807+0x1)+'/'+_0x714870+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x2d720a,_0x2d9ffe,_0x5f5a99)=>{const _0x2f4ae8=_0x44727c,_0x58cec4=formatElapsed(_0x2d9ffe);_0x5f5a99?console[_0x2f4ae8(0x26c)]('\x20\x20Round\x20'+(_0x2d720a+0x1)+'/'+_0x5afe6e[_0x2f4ae8(0x208)][_0x2f4ae8(0x1f4)]+_0x2f4ae8(0x237)+a5_0x60bf87[_0x2f4ae8(0x24b)]('✓')+'\x20('+_0x58cec4+')'):console[_0x2f4ae8(0x26c)](_0x2f4ae8(0x22f)+(_0x2d720a+0x1)+'/'+_0x5afe6e[_0x2f4ae8(0x208)]['length']+_0x2f4ae8(0x237)+a5_0x60bf87[_0x2f4ae8(0x253)]('✗'));},'onEvaluationStart':()=>{const _0x2701a0=_0x44727c;_0x14dffe[_0x2701a0(0x273)]=_0x2701a0(0x264);},'onEvaluationComplete':_0x5c3d33=>{const _0x37b781=_0x44727c,_0x2aa0e7=formatElapsed(_0x5c3d33);console[_0x37b781(0x26c)]('\x20\x20Evaluating...\x20'+a5_0x60bf87['green']('✓')+'\x20('+_0x2aa0e7+')');}});_0x14dffe['stop'](),_0x57a773['push'](_0x24f0ab),_0x1e5497[_0x44727c(0x1ed)](_0x2dc1e5);if(_0x24f0ab['status']==='PASS')console[_0x44727c(0x26c)](a5_0x60bf87[_0x44727c(0x24b)]('✓\x20PASS:\x20'+_0x24f0ab[_0x44727c(0x271)]));else _0x24f0ab[_0x44727c(0x22d)]==='FAIL'?console['log'](a5_0x60bf87[_0x44727c(0x253)](_0x44727c(0x266)+_0x24f0ab[_0x44727c(0x271)])):console['log'](a5_0x60bf87[_0x44727c(0x253)](_0x44727c(0x21a)+_0x24f0ab[_0x44727c(0x271)]));_0x24f0ab[_0x44727c(0x27a)]&&console[_0x44727c(0x26c)](a5_0x60bf87[_0x44727c(0x24f)](_0x44727c(0x22b)+_0x24f0ab['conversation_url'])),console[_0x44727c(0x26c)]();}catch(_0x50a730){_0x14dffe['stop']();const _0x3c18dc=_0x50a730 instanceof Error?_0x50a730[_0x44727c(0x1eb)]:String(_0x50a730);console[_0x44727c(0x26c)](a5_0x60bf87[_0x44727c(0x253)](_0x44727c(0x21a)+_0x3c18dc)),console[_0x44727c(0x26c)](),_0x57a773['push']({'name':_0x5afe6e[_0x44727c(0x23d)],'status':_0x44727c(0x1ff),'reason':_0x3c18dc,'timestamp':new Date()[_0x44727c(0x267)](),'duration_ms':0x0});}}const _0x13ff8a=Date['now']()-_0x448079,_0x4cb41f=_0x57a773[_0x44727c(0x224)](_0x4cc8aa=>_0x4cc8aa[_0x44727c(0x22d)]===_0x44727c(0x258))[_0x44727c(0x1f4)],_0x33973e=_0x57a773[_0x44727c(0x224)](_0x5591c3=>_0x5591c3['status']==='FAIL')['length'],_0x4ba205=_0x57a773[_0x44727c(0x224)](_0x15f0ad=>_0x15f0ad[_0x44727c(0x22d)]===_0x44727c(0x1ff))[_0x44727c(0x1f4)];console[_0x44727c(0x26c)]('━'[_0x44727c(0x1f6)](0x3c)),console[_0x44727c(0x26c)]('Test\x20Summary'),console[_0x44727c(0x26c)]('━'[_0x44727c(0x1f6)](0x3c)),console[_0x44727c(0x26c)](_0x44727c(0x210)+_0x57a773[_0x44727c(0x1f4)]),console[_0x44727c(0x26c)]('Passed:\x20\x20\x20'+a5_0x60bf87[_0x44727c(0x24b)](_0x4cb41f)),console[_0x44727c(0x26c)](_0x44727c(0x212)+a5_0x60bf87[_0x44727c(0x253)](_0x33973e));_0x4ba205>0x0&&console[_0x44727c(0x26c)](_0x44727c(0x24c)+a5_0x60bf87[_0x44727c(0x253)](_0x4ba205));console['log'](_0x44727c(0x234)+formatElapsed(_0x13ff8a)),console['log']('━'[_0x44727c(0x1f6)](0x3c));const _0x3886d7=_0x57a773[_0x44727c(0x224)](_0x52ff65=>_0x52ff65[_0x44727c(0x22d)]!=='PASS');if(_0x3886d7[_0x44727c(0x1f4)]>0x0){console[_0x44727c(0x26c)](),console[_0x44727c(0x26c)]('Failed\x20Tests:');for(const _0x2b0449 of _0x3886d7){const _0x48bec7=a5_0x60bf87[_0x44727c(0x253)]('✗'),_0x6c2379=_0x2b0449['reason'][_0x44727c(0x1f4)]>0x32?_0x2b0449['reason'][_0x44727c(0x276)](0x0,0x32)+_0x44727c(0x215):_0x2b0449['reason'];console[_0x44727c(0x26c)]('\x20\x20'+_0x48bec7+'\x20'+_0x2b0449[_0x44727c(0x23d)]+':\x20'+_0x6c2379);}}const _0x22a271={'summary':{'total':_0x57a773[_0x44727c(0x1f4)],'passed':_0x4cb41f,'failed':_0x33973e,'errors':_0x4ba205>0x0?_0x4ba205:undefined,'duration_ms':_0x13ff8a},'tests':_0x57a773,'agent':{'project':_0x453739[_0x44727c(0x209)],'name':_0x453739[_0x44727c(0x1fc)],'site':_0xb8c150},'timestamp':new Date(_0x448079)[_0x44727c(0x267)]()};try{const _0x339abd=buildCachedTestRun(_0x1e5497,{'site':_0xb8c150,'projectId':_0x3173fc,'projectName':_0x453739[_0x44727c(0x209)],'agentId':_0x4d933f,'agentName':_0x453739[_0x44727c(0x1fc)],'testYmlPath':a5_0x6f11d6[_0x44727c(0x23e)](_0x453739[_0x44727c(0x226)])});saveLastTestRun(_0x339abd);}catch{}if(_0x2fd881!==_0x44727c(0x203)||_0xcb2210){const _0x24b91a=formatResults(_0x22a271,_0x2fd881);if(_0xcb2210)try{a5_0x39ebc7[_0x44727c(0x21d)](_0xcb2210,_0x24b91a,_0x44727c(0x27d)),console[_0x44727c(0x26c)](),console[_0x44727c(0x26c)](a5_0x60bf87[_0x44727c(0x24f)](_0x44727c(0x20e)+_0xcb2210));}catch(_0x5c07fb){return console[_0x44727c(0x26c)](),console['log'](a5_0x60bf87['red'](_0x44727c(0x25f)+_0x5c07fb)),0x1;}else console['log'](),console[_0x44727c(0x26c)](_0x24b91a);}return _0x3886d7[_0x44727c(0x1f4)]>0x0?0x1:0x0;}async[a5_0x55f8a5(0x26e)](_0x5447ee,_0x47ea2a){const _0x230024=a5_0x55f8a5,{options:_0x50ae52,tdx:_0x299911}=_0x5447ee,{definition:_0x5e9073,agentInfo:_0x4c53d7,outputFormat:_0x4d9d33,outputFile:_0x50f6e5}=_0x47ea2a,_0x2db415=_0x50ae52['site'],_0x254e6e=loadLastTestRun();if(!_0x254e6e)return console[_0x230024(0x26c)](a5_0x60bf87[_0x230024(0x253)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x230024(0x26c)](a5_0x60bf87['dim'](_0x230024(0x20a))),0x1;if(_0x254e6e[_0x230024(0x241)]['agentName']!==_0x4c53d7[_0x230024(0x1fc)])return console[_0x230024(0x26c)](a5_0x60bf87['red'](_0x230024(0x26f)+_0x254e6e[_0x230024(0x241)]['agentName']+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x4c53d7['agentName']+'\x22.')),console['log'](a5_0x60bf87[_0x230024(0x24f)](_0x230024(0x270))),0x1;const _0x217684=new Set(_0x254e6e[_0x230024(0x24e)][_0x230024(0x26b)](_0x35c618=>_0x35c618[_0x230024(0x277)])),_0x81b731=_0x5e9073['tests'][_0x230024(0x224)](_0x23c8be=>!_0x217684[_0x230024(0x228)](_0x23c8be[_0x230024(0x23d)]));if(_0x81b731[_0x230024(0x1f4)]>0x0&&_0x254e6e[_0x230024(0x1fd)]!==_0x2db415)return console['log'](a5_0x60bf87[_0x230024(0x253)](_0x230024(0x1fb))),console[_0x230024(0x26c)](a5_0x60bf87['dim']('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x254e6e[_0x230024(0x1fd)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x2db415+'\x22.')),console[_0x230024(0x26c)](a5_0x60bf87[_0x230024(0x24f)](_0x230024(0x214)+_0x254e6e[_0x230024(0x1fd)]+_0x230024(0x25d))),0x1;const _0x31fca9=_0x5e9073[_0x230024(0x225)][_0x230024(0x224)](_0x57db47=>_0x217684[_0x230024(0x228)](_0x57db47[_0x230024(0x23d)])),_0x4a78b6=_0x81b731;let _0x1a0759;try{_0x1a0759=await setupEvaluatorAgent(_0x299911[_0x230024(0x20c)],_0x50ae52['verbose']);}catch(_0x4a9f4c){const _0x17ada0=_0x4a9f4c instanceof Error?_0x4a9f4c[_0x230024(0x1eb)]:String(_0x4a9f4c);return console['log'](a5_0x60bf87[_0x230024(0x253)](_0x230024(0x25e)+_0x17ada0)),0x1;}console[_0x230024(0x26c)](a5_0x60bf87['cyan'](_0x230024(0x26a))),console[_0x230024(0x26c)](_0x230024(0x1ef)+a5_0x60bf87['white'](_0x254e6e[_0x230024(0x217)])),console[_0x230024(0x26c)](_0x230024(0x1f3)+a5_0x60bf87[_0x230024(0x25a)](_0x254e6e['agent']['projectName']+'/'+_0x254e6e[_0x230024(0x241)]['agentName']));_0x4a78b6[_0x230024(0x1f4)]>0x0&&console[_0x230024(0x26c)](_0x230024(0x1e9)+a5_0x60bf87[_0x230024(0x219)](_0x4a78b6[_0x230024(0x1f4)]));console[_0x230024(0x26c)]();const _0x457dd1=[],_0x24bb07=Date[_0x230024(0x26d)](),_0x56cfcb=createCommandSpinner('Re-evaluating...');if(_0x31fca9[_0x230024(0x1f4)]>0x0)try{const _0x3cd238=await reevaluateFromCache(_0x299911[_0x230024(0x20c)],_0x254e6e,{'tests':_0x31fca9},{'evaluatorId':_0x1a0759,'onTestStart':(_0x576c3c,_0x4e0da6,_0x32ba0e)=>{const _0x261aec=_0x230024;_0x56cfcb[_0x261aec(0x273)]=_0x261aec(0x216)+(_0x4e0da6+0x1)+'/'+_0x32ba0e+':\x20'+_0x576c3c+_0x261aec(0x215);if(!_0x56cfcb[_0x261aec(0x21e)])_0x56cfcb[_0x261aec(0x269)]();},'onTestComplete':(_0x16a9ad,_0x4326de)=>{const _0x4485ba=_0x230024;_0x56cfcb[_0x4485ba(0x231)]();if(_0x4326de[_0x4485ba(0x22d)]===_0x4485ba(0x258))console['log'](a5_0x60bf87['green'](_0x4485ba(0x23b)+_0x16a9ad)+a5_0x60bf87['dim'](_0x4485ba(0x201)));else _0x4326de[_0x4485ba(0x22d)]===_0x4485ba(0x242)?console[_0x4485ba(0x26c)](a5_0x60bf87[_0x4485ba(0x253)](_0x4485ba(0x266)+_0x16a9ad+'\x20-\x20'+_0x4326de[_0x4485ba(0x271)])+a5_0x60bf87[_0x4485ba(0x24f)](_0x4485ba(0x201))):console[_0x4485ba(0x26c)](a5_0x60bf87[_0x4485ba(0x253)](_0x4485ba(0x21a)+_0x16a9ad+_0x4485ba(0x272)+_0x4326de[_0x4485ba(0x271)]));_0x4326de['conversation_url']&&console[_0x4485ba(0x26c)](a5_0x60bf87[_0x4485ba(0x24f)](_0x4485ba(0x275)+_0x4326de[_0x4485ba(0x27a)])),_0x457dd1[_0x4485ba(0x1ed)](_0x4326de);},'onTestSkipped':(_0x8ef863,_0x126018)=>{const _0x1b8e66=_0x230024;_0x56cfcb[_0x1b8e66(0x231)](),console[_0x1b8e66(0x26c)](a5_0x60bf87[_0x1b8e66(0x219)](_0x1b8e66(0x227)+_0x8ef863+_0x1b8e66(0x272)+_0x126018));}});for(const _0x2c8899 of _0x3cd238){!_0x457dd1[_0x230024(0x1ea)](_0x3179b1=>_0x3179b1[_0x230024(0x23d)]===_0x2c8899[_0x230024(0x23d)])&&_0x457dd1['push'](_0x2c8899);}}catch(_0xf28be7){_0x56cfcb[_0x230024(0x231)]();const _0x4bb6a6=_0xf28be7 instanceof Error?_0xf28be7[_0x230024(0x1eb)]:String(_0xf28be7);return console['log'](a5_0x60bf87[_0x230024(0x253)](_0x230024(0x235)+_0x4bb6a6)),0x1;}_0x56cfcb['stop']();if(_0x4a78b6[_0x230024(0x1f4)]>0x0){console[_0x230024(0x26c)](),console['log'](a5_0x60bf87['cyan'](_0x230024(0x23f)));const {projectId:_0x4e6c3c,agentId:_0x2074df}=_0x254e6e[_0x230024(0x241)];for(const _0x53db06 of _0x4a78b6){console[_0x230024(0x26c)](_0x230024(0x240)+a5_0x60bf87['white'](_0x53db06[_0x230024(0x23d)]));const _0xa60dd1=createCommandSpinner(_0x230024(0x238)+_0x53db06[_0x230024(0x208)][_0x230024(0x1f4)]+':\x20Sending\x20user\x20input...');_0xa60dd1[_0x230024(0x269)]();try{const {result:_0x566c41}=await runTest(_0x299911['llm'],_0x53db06,{'agentId':_0x2074df,'projectId':_0x4e6c3c,'site':_0x254e6e[_0x230024(0x1fd)],'noEval':![],'evaluatorId':_0x1a0759,'onRoundStart':(_0x5e4efe,_0x20b33b)=>{const _0x94670c=_0x230024;_0xa60dd1[_0x94670c(0x273)]=_0x94670c(0x218)+(_0x5e4efe+0x1)+'/'+_0x20b33b+_0x94670c(0x261);},'onRoundComplete':(_0x5beabf,_0xf83477,_0x390aa2)=>{const _0x5b1c82=_0x230024,_0x141ab3=formatElapsed(_0xf83477);_0x390aa2?console[_0x5b1c82(0x26c)](_0x5b1c82(0x22f)+(_0x5beabf+0x1)+'/'+_0x53db06['rounds'][_0x5b1c82(0x1f4)]+_0x5b1c82(0x237)+a5_0x60bf87['green']('✓')+'\x20('+_0x141ab3+')'):console[_0x5b1c82(0x26c)](_0x5b1c82(0x22f)+(_0x5beabf+0x1)+'/'+_0x53db06[_0x5b1c82(0x208)][_0x5b1c82(0x1f4)]+'...\x20'+a5_0x60bf87[_0x5b1c82(0x253)]('✗'));},'onEvaluationStart':()=>{const _0x33029e=_0x230024;_0xa60dd1[_0x33029e(0x273)]='Evaluating\x20response...';},'onEvaluationComplete':_0xe988b=>{const _0x5d6139=_0x230024,_0x47b918=formatElapsed(_0xe988b);console[_0x5d6139(0x26c)]('\x20\x20Evaluating...\x20'+a5_0x60bf87[_0x5d6139(0x24b)]('✓')+'\x20('+_0x47b918+')');}});_0xa60dd1[_0x230024(0x231)](),_0x457dd1[_0x230024(0x1ed)](_0x566c41);if(_0x566c41[_0x230024(0x22d)]===_0x230024(0x258))console[_0x230024(0x26c)](a5_0x60bf87[_0x230024(0x24b)]('✓\x20PASS:\x20'+_0x566c41[_0x230024(0x271)])+a5_0x60bf87[_0x230024(0x24f)](_0x230024(0x222)));else _0x566c41[_0x230024(0x22d)]===_0x230024(0x242)?console[_0x230024(0x26c)](a5_0x60bf87['red'](_0x230024(0x266)+_0x566c41[_0x230024(0x271)])+a5_0x60bf87['dim'](_0x230024(0x222))):console[_0x230024(0x26c)](a5_0x60bf87[_0x230024(0x253)](_0x230024(0x21a)+_0x566c41[_0x230024(0x271)]));_0x566c41[_0x230024(0x27a)]&&console[_0x230024(0x26c)](a5_0x60bf87[_0x230024(0x24f)](_0x230024(0x275)+_0x566c41[_0x230024(0x27a)]));}catch(_0x34cb33){_0xa60dd1[_0x230024(0x231)]();const _0x16dd36=_0x34cb33 instanceof Error?_0x34cb33[_0x230024(0x1eb)]:String(_0x34cb33);console[_0x230024(0x26c)](a5_0x60bf87[_0x230024(0x253)]('✗\x20ERROR:\x20'+_0x16dd36)),_0x457dd1[_0x230024(0x1ed)]({'name':_0x53db06[_0x230024(0x23d)],'status':_0x230024(0x1ff),'reason':_0x16dd36,'timestamp':new Date()[_0x230024(0x267)](),'duration_ms':0x0});}}}console[_0x230024(0x26c)]();const _0x354bb0=Date[_0x230024(0x26d)]()-_0x24bb07,_0x1a8cfb=_0x457dd1[_0x230024(0x224)](_0x59362c=>_0x59362c['status']===_0x230024(0x258))['length'],_0x45571f=_0x457dd1[_0x230024(0x224)](_0x435b1c=>_0x435b1c['status']===_0x230024(0x242))['length'],_0x5a140f=_0x457dd1[_0x230024(0x224)](_0xace485=>_0xace485[_0x230024(0x22d)]==='ERROR')[_0x230024(0x1f4)];console[_0x230024(0x26c)]('━'['repeat'](0x3c)),console[_0x230024(0x26c)](_0x230024(0x20f)),console[_0x230024(0x26c)]('━'[_0x230024(0x1f6)](0x3c)),console[_0x230024(0x26c)](_0x230024(0x210)+_0x457dd1[_0x230024(0x1f4)]),console[_0x230024(0x26c)](_0x230024(0x260)+a5_0x60bf87[_0x230024(0x24b)](_0x1a8cfb)),console[_0x230024(0x26c)](_0x230024(0x212)+a5_0x60bf87[_0x230024(0x253)](_0x45571f));_0x5a140f>0x0&&console[_0x230024(0x26c)](_0x230024(0x24c)+a5_0x60bf87[_0x230024(0x253)](_0x5a140f));console[_0x230024(0x26c)]('Duration:\x20'+formatElapsed(_0x354bb0)),console[_0x230024(0x26c)]('━'['repeat'](0x3c));const _0x47526a={'summary':{'total':_0x457dd1[_0x230024(0x1f4)],'passed':_0x1a8cfb,'failed':_0x45571f,'errors':_0x5a140f>0x0?_0x5a140f:undefined,'duration_ms':_0x354bb0},'tests':_0x457dd1,'agent':{'project':_0x4c53d7[_0x230024(0x209)],'name':_0x4c53d7['agentName'],'site':_0x2db415},'timestamp':new Date(_0x24bb07)[_0x230024(0x267)]()};if(_0x4d9d33!=='table'||_0x50f6e5){const _0x40a52e=formatResults(_0x47526a,_0x4d9d33);if(_0x50f6e5)try{a5_0x39ebc7['writeFileSync'](_0x50f6e5,_0x40a52e,_0x230024(0x27d)),console['log'](),console[_0x230024(0x26c)](a5_0x60bf87[_0x230024(0x24f)](_0x230024(0x20e)+_0x50f6e5));}catch(_0x4d013f){return console['log'](),console[_0x230024(0x26c)](a5_0x60bf87[_0x230024(0x253)](_0x230024(0x25f)+_0x4d013f)),0x1;}else console[_0x230024(0x26c)](),console['log'](_0x40a52e);}const _0x1e74e6=_0x457dd1[_0x230024(0x224)](_0x548fe3=>_0x548fe3[_0x230024(0x22d)]!==_0x230024(0x258));return _0x1e74e6[_0x230024(0x1f4)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x506528=a6_0x288e;function a6_0x288e(_0x212952,_0x2e46b8){_0x212952=_0x212952-0x196;const _0x2b1604=a6_0x2b16();let _0x288e9d=_0x2b1604[_0x212952];return _0x288e9d;}(function(_0xc1a6d9,_0x4d0cbd){const _0x4c3b03=a6_0x288e,_0x3e17c5=_0xc1a6d9();while(!![]){try{const _0x1d7463=parseInt(_0x4c3b03(0x1c4))/0x1+-parseInt(_0x4c3b03(0x1bd))/0x2*(-parseInt(_0x4c3b03(0x1a9))/0x3)+-parseInt(_0x4c3b03(0x1da))/0x4+parseInt(_0x4c3b03(0x1b0))/0x5+-parseInt(_0x4c3b03(0x19f))/0x6+parseInt(_0x4c3b03(0x1d9))/0x7*(-parseInt(_0x4c3b03(0x1b9))/0x8)+-parseInt(_0x4c3b03(0x1b2))/0x9*(parseInt(_0x4c3b03(0x1ab))/0xa);if(_0x1d7463===_0x4d0cbd)break;else _0x3e17c5['push'](_0x3e17c5['shift']());}catch(_0x25dff7){_0x3e17c5['push'](_0x3e17c5['shift']());}}}(a6_0x2b16,0xb3992));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';function a6_0x2b16(){const _0x168794=['Invalid\x20header\x20format:\x20\x22','message','verbose','2tKqeMh','cas','startsWith','PUT','.\x20Valid\x20methods:\x20','method','type','1235851SgIIuc','length','set-cookie','substring','Results\x20saved\x20to\x20','Error:\x20','data','llm','x-auth-token','join','POST','readBodyFromFile','status','log','\x22.\x20','keys','file','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','api','toUpperCase','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','49rWtPuN','1255716NoCIoP','proxy-authorization','authorization','entries','has','<\x20HTTP/1.1\x20','x-trino-user','trim','validate','error','\x0aStack\x20trace:\x0a','6392340QvtZPg','workflow','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','DELETE','.\x20Valid\x20types:\x20','description','PATCH','noColor','Invalid\x20API\x20type:\x20','x-xsrf-token','3453699proJSD','request','12079190VTIuBM','includes','Endpoint\x20must\x20start\x20with\x20/:\x20','color','output','4707220bjxGKa','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','9zNUoIm','stack','body','GET','set-cookie2','headers','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','6464BIdUlE'];a6_0x2b16=function(){return _0x168794;};return a6_0x2b16();}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x506528(0x196),a6_0x506528(0x1db),'cookie',a6_0x506528(0x1c6),a6_0x506528(0x1b6),a6_0x506528(0x1a8),a6_0x506528(0x1cc),a6_0x506528(0x19a)]);function isSensitiveHeader(_0x59e91f){const _0x4783de=a6_0x506528;return SENSITIVE_HEADERS[_0x4783de(0x198)](_0x59e91f['toLowerCase']());}function parseHeader(_0x552dbd){const _0x5488c7=a6_0x506528,_0x17aa0d=_0x552dbd['indexOf'](':');if(_0x17aa0d===-0x1)throw new Error(_0x5488c7(0x1ba)+_0x552dbd+_0x5488c7(0x1d2)+_0x5488c7(0x1b1));const _0x3c81d9=_0x552dbd[_0x5488c7(0x1c7)](0x0,_0x17aa0d)['trim'](),_0x35cf53=_0x552dbd[_0x5488c7(0x1c7)](_0x17aa0d+0x1)[_0x5488c7(0x19b)]();if(!_0x3c81d9)throw new Error(_0x5488c7(0x1a1)+_0x552dbd+'\x22');return[_0x3c81d9,_0x35cf53];}export class ApiCommand extends BaseCommand{['name']=a6_0x506528(0x1d6);[a6_0x506528(0x1a4)]=a6_0x506528(0x1d5);[a6_0x506528(0x19c)](_0x20d548){const _0x314435=a6_0x506528,{args:_0x28c090,options:_0x227305}=_0x20d548,_0x39a6ad=_0x227305;if(_0x28c090[_0x314435(0x1c5)]===0x0)return _0x314435(0x1b8);const _0x46a299=_0x28c090[0x0];if(!_0x46a299[_0x314435(0x1bf)]('/'))return _0x314435(0x1ad)+_0x46a299;const _0x541da8=_0x39a6ad['data'],_0x327e0f=_0x39a6ad['file'];if(_0x541da8&&_0x327e0f)return _0x314435(0x1d8);const _0x3628ad=_0x39a6ad[_0x314435(0x1c2)]||'GET',_0x513f12=['GET',_0x314435(0x1ce),_0x314435(0x1c0),_0x314435(0x1a2),_0x314435(0x1a5)];if(!_0x513f12[_0x314435(0x1ac)](_0x3628ad['toUpperCase']()))return'Invalid\x20HTTP\x20method:\x20'+_0x3628ad+_0x314435(0x1c1)+_0x513f12[_0x314435(0x1cd)](',\x20');const _0x1b171a=_0x39a6ad[_0x314435(0x1c3)]||'td',_0x2aa493=['td','cdp',_0x314435(0x1a0),'trino',_0x314435(0x1cb),'llm-proxy',_0x314435(0x1be)];if(!_0x2aa493[_0x314435(0x1ac)](_0x1b171a))return _0x314435(0x1a7)+_0x1b171a+_0x314435(0x1a3)+_0x2aa493['join'](',\x20');return undefined;}async['execute'](_0x1fb43a){const _0x1df747=a6_0x506528,{options:_0x2b6f72,args:_0x477b68,tdx:_0xce213d}=_0x1fb43a,_0x3cdfd4=_0x2b6f72,_0x437b02=_0x477b68[0x0],_0xcbd67c=(_0x3cdfd4[_0x1df747(0x1c2)]||_0x1df747(0x1b5))[_0x1df747(0x1d7)](),_0x271d29=_0x3cdfd4[_0x1df747(0x1ca)],_0x4fff7b=_0x3cdfd4[_0x1df747(0x1d4)],_0x37dde5=_0x3cdfd4['header'],_0x3ec7a7=_0x3cdfd4[_0x1df747(0x1c3)]||'td';try{const _0x550a3d={};if(_0x37dde5){const _0x4a4f59=Array['isArray'](_0x37dde5)?_0x37dde5:[_0x37dde5];for(const _0x554974 of _0x4a4f59){const [_0x1d7d80,_0x54bffe]=parseHeader(_0x554974);_0x550a3d[_0x1d7d80]=_0x54bffe;}}let _0x157e32;if(_0x271d29)_0x157e32=_0x271d29;else{if(_0x4fff7b)try{_0x157e32=RawAPI[_0x1df747(0x1cf)](_0x4fff7b);}catch(_0x157b4a){return console[_0x1df747(0x19d)](_0x1df747(0x1c9)+(_0x157b4a instanceof Error?_0x157b4a[_0x1df747(0x1bb)]:String(_0x157b4a))),0x1;}}const _0x54aed6={'method':_0xcbd67c,'apiType':_0x3ec7a7,'includeHeaders':_0x2b6f72['verbose']};_0x157e32&&(_0x54aed6[_0x1df747(0x1b4)]=_0x157e32);Object[_0x1df747(0x1d3)](_0x550a3d)[_0x1df747(0x1c5)]>0x0&&(_0x54aed6[_0x1df747(0x1b7)]=_0x550a3d);if(_0x2b6f72[_0x1df747(0x1bc)]){const _0x1218ff=resolveSite(_0x2b6f72['site']),_0x4a729a=getEndpoint(_0x1218ff,_0x3ec7a7),_0x23d3fe=''+_0x4a729a+_0x437b02;console[_0x1df747(0x19d)]('>\x20'+_0xcbd67c+'\x20'+_0x23d3fe);const _0x2cdfbe=getAuthHeaders(_0x1218ff),_0x490958={..._0x2cdfbe,..._0x550a3d};for(const [_0x1942a2,_0x49e687]of Object['entries'](_0x490958)){!isSensitiveHeader(_0x1942a2)&&console[_0x1df747(0x19d)]('>\x20'+_0x1942a2+':\x20'+_0x49e687);}_0x157e32&&console[_0x1df747(0x19d)]('>'),console[_0x1df747(0x19d)]('');}const _0x4bffbe=await _0xce213d[_0x1df747(0x1d6)][_0x1df747(0x1aa)](_0x437b02,_0x54aed6);if(_0x2b6f72['verbose']&&_0x4bffbe[_0x1df747(0x1b7)]){console[_0x1df747(0x19d)](_0x1df747(0x199)+_0x4bffbe[_0x1df747(0x1d0)]);for(const [_0x1156d7,_0x581422]of Object[_0x1df747(0x197)](_0x4bffbe[_0x1df747(0x1b7)])){!isSensitiveHeader(_0x1156d7)&&console[_0x1df747(0x19d)]('<\x20'+_0x1156d7+':\x20'+_0x581422);}console[_0x1df747(0x19d)]('');}const _0x275cbb=Boolean(_0x2b6f72[_0x1df747(0x1af)]),_0x436bd3={'color':_0x2b6f72['color'],'noColor':_0x2b6f72[_0x1df747(0x1a6)]||_0x275cbb&&!_0x2b6f72[_0x1df747(0x1ae)]},_0x244a46=colorizeJSON(_0x4bffbe['data'],_0x436bd3);return _0x2b6f72[_0x1df747(0x1af)]?(writeFileSync(_0x2b6f72[_0x1df747(0x1af)],_0x244a46),console[_0x1df747(0x19d)](_0x1df747(0x1c8)+_0x2b6f72[_0x1df747(0x1af)])):console[_0x1df747(0x1d1)](_0x244a46),0x0;}catch(_0xe7fbe9){return _0xe7fbe9 instanceof Error?(console['error'](_0x1df747(0x1c9)+_0xe7fbe9[_0x1df747(0x1bb)]),_0x2b6f72[_0x1df747(0x1bc)]&&_0xe7fbe9['stack']&&console['error'](_0x1df747(0x19e)+_0xe7fbe9[_0x1df747(0x1b3)])):console[_0x1df747(0x19d)](_0x1df747(0x1c9)+String(_0xe7fbe9)),0x1;}}}
1
+ const a6_0x5a4932=a6_0x5d42;(function(_0x850336,_0x486668){const _0x333ec0=a6_0x5d42,_0xa2fa0b=_0x850336();while(!![]){try{const _0x401ef7=-parseInt(_0x333ec0(0x1a4))/0x1+parseInt(_0x333ec0(0x1b3))/0x2*(parseInt(_0x333ec0(0x1ad))/0x3)+parseInt(_0x333ec0(0x17f))/0x4+parseInt(_0x333ec0(0x17c))/0x5*(-parseInt(_0x333ec0(0x1b1))/0x6)+parseInt(_0x333ec0(0x193))/0x7+parseInt(_0x333ec0(0x1a9))/0x8+-parseInt(_0x333ec0(0x17e))/0x9*(parseInt(_0x333ec0(0x190))/0xa);if(_0x401ef7===_0x486668)break;else _0xa2fa0b['push'](_0xa2fa0b['shift']());}catch(_0x558979){_0xa2fa0b['push'](_0xa2fa0b['shift']());}}}(a6_0x29b4,0x8fdef));import{BaseCommand}from'./command.js';function a6_0x29b4(){const _0x3112d8=['POST','x-trino-user','x-auth-token','authorization','site','join','proxy-authorization','.\x20Valid\x20methods:\x20','trim','Error:\x20','Invalid\x20API\x20type:\x20','data','entries','type','584318kXPeDP','stack','toUpperCase','noColor','workflow','4765288stWgRt','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','PUT','GET','3kdCxSP','verbose','Results\x20saved\x20to\x20','set-cookie','12bJHcRH','\x22.\x20','202546qeMqjC','llm-proxy','request','message','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','header','x-xsrf-token','isArray','cookie','has','417310bJOoOB','body','99HRGnCN','4172000KHBxdd','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','includes','length','error','cas','file','method','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','name','readBodyFromFile','PATCH','output','api','set-cookie2','color','keys','1067030LoLvef','.\x20Valid\x20types:\x20','execute','5420352gsXwEL','headers','description'];a6_0x29b4=function(){return _0x3112d8;};return a6_0x29b4();}function a6_0x5d42(_0x43d7c3,_0x4d6c88){_0x43d7c3=_0x43d7c3-0x178;const _0x29b43b=a6_0x29b4();let _0x5d4249=_0x29b43b[_0x43d7c3];return _0x5d4249;}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_0x5a4932(0x199),a6_0x5a4932(0x19c),a6_0x5a4932(0x17a),a6_0x5a4932(0x1b0),a6_0x5a4932(0x18d),a6_0x5a4932(0x178),a6_0x5a4932(0x198),a6_0x5a4932(0x197)]);function isSensitiveHeader(_0x2aed87){const _0x13c50c=a6_0x5a4932;return SENSITIVE_HEADERS[_0x13c50c(0x17b)](_0x2aed87['toLowerCase']());}function parseHeader(_0x3a10fc){const _0x5459ea=a6_0x5a4932,_0x1ce9b6=_0x3a10fc['indexOf'](':');if(_0x1ce9b6===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x3a10fc+_0x5459ea(0x1b2)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x58f6fd=_0x3a10fc['substring'](0x0,_0x1ce9b6)['trim'](),_0xae523a=_0x3a10fc['substring'](_0x1ce9b6+0x1)[_0x5459ea(0x19e)]();if(!_0x58f6fd)throw new Error(_0x5459ea(0x187)+_0x3a10fc+'\x22');return[_0x58f6fd,_0xae523a];}export class ApiCommand extends BaseCommand{[a6_0x5a4932(0x188)]='api';[a6_0x5a4932(0x195)]=a6_0x5a4932(0x1b7);['validate'](_0x1625cb){const _0x2b0da0=a6_0x5a4932,{args:_0x4023df,options:_0x943060}=_0x1625cb,_0x35f309=_0x943060;if(_0x4023df['length']===0x0)return _0x2b0da0(0x180);const _0x3b88e4=_0x4023df[0x0];if(!_0x3b88e4['startsWith']('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x3b88e4;const _0x136044=_0x35f309[_0x2b0da0(0x1a1)],_0x21a9d5=_0x35f309['file'];if(_0x136044&&_0x21a9d5)return _0x2b0da0(0x1aa);const _0x2c47c4=_0x35f309[_0x2b0da0(0x186)]||_0x2b0da0(0x1ac),_0x15f3cd=[_0x2b0da0(0x1ac),_0x2b0da0(0x196),_0x2b0da0(0x1ab),'DELETE',_0x2b0da0(0x18a)];if(!_0x15f3cd[_0x2b0da0(0x181)](_0x2c47c4['toUpperCase']()))return'Invalid\x20HTTP\x20method:\x20'+_0x2c47c4+_0x2b0da0(0x19d)+_0x15f3cd[_0x2b0da0(0x19b)](',\x20');const _0x53f431=_0x35f309[_0x2b0da0(0x1a3)]||'td',_0x21a080=['td','cdp',_0x2b0da0(0x1a8),'trino','llm',_0x2b0da0(0x1b4),_0x2b0da0(0x184)];if(!_0x21a080[_0x2b0da0(0x181)](_0x53f431))return _0x2b0da0(0x1a0)+_0x53f431+_0x2b0da0(0x191)+_0x21a080[_0x2b0da0(0x19b)](',\x20');return undefined;}async[a6_0x5a4932(0x192)](_0xb42348){const _0xdc80c7=a6_0x5a4932,{options:_0x15affc,args:_0x58e7f1,tdx:_0x102b62}=_0xb42348,_0x51867d=_0x15affc,_0x41c57f=_0x58e7f1[0x0],_0x4d416a=(_0x51867d[_0xdc80c7(0x186)]||'GET')[_0xdc80c7(0x1a6)](),_0x5f0f60=_0x51867d['data'],_0x350093=_0x51867d[_0xdc80c7(0x185)],_0xff0c0f=_0x51867d[_0xdc80c7(0x1b8)],_0x4ab7b6=_0x51867d[_0xdc80c7(0x1a3)]||'td';try{const _0x4edeaa={};if(_0xff0c0f){const _0x251c22=Array[_0xdc80c7(0x179)](_0xff0c0f)?_0xff0c0f:[_0xff0c0f];for(const _0x74aef7 of _0x251c22){const [_0xfd46a,_0x2a08c0]=parseHeader(_0x74aef7);_0x4edeaa[_0xfd46a]=_0x2a08c0;}}let _0x310733;if(_0x5f0f60)_0x310733=_0x5f0f60;else{if(_0x350093)try{_0x310733=RawAPI[_0xdc80c7(0x189)](_0x350093);}catch(_0x1ab8aa){return console[_0xdc80c7(0x183)](_0xdc80c7(0x19f)+(_0x1ab8aa instanceof Error?_0x1ab8aa[_0xdc80c7(0x1b6)]:String(_0x1ab8aa))),0x1;}}const _0x51131d={'method':_0x4d416a,'apiType':_0x4ab7b6,'includeHeaders':_0x15affc[_0xdc80c7(0x1ae)]};_0x310733&&(_0x51131d[_0xdc80c7(0x17d)]=_0x310733);Object[_0xdc80c7(0x18f)](_0x4edeaa)[_0xdc80c7(0x182)]>0x0&&(_0x51131d[_0xdc80c7(0x194)]=_0x4edeaa);if(_0x15affc['verbose']){const _0x548513=resolveSite(_0x15affc[_0xdc80c7(0x19a)]),_0xd28dd7=getEndpoint(_0x548513,_0x4ab7b6),_0x2368b4=''+_0xd28dd7+_0x41c57f;console[_0xdc80c7(0x183)]('>\x20'+_0x4d416a+'\x20'+_0x2368b4);const _0x129426=getAuthHeaders(_0x548513),_0x7dc6d0={..._0x129426,..._0x4edeaa};for(const [_0x4c42be,_0x44612e]of Object[_0xdc80c7(0x1a2)](_0x7dc6d0)){!isSensitiveHeader(_0x4c42be)&&console[_0xdc80c7(0x183)]('>\x20'+_0x4c42be+':\x20'+_0x44612e);}_0x310733&&console[_0xdc80c7(0x183)]('>'),console[_0xdc80c7(0x183)]('');}const _0x5def23=await _0x102b62[_0xdc80c7(0x18c)][_0xdc80c7(0x1b5)](_0x41c57f,_0x51131d);if(_0x15affc['verbose']&&_0x5def23[_0xdc80c7(0x194)]){console[_0xdc80c7(0x183)]('<\x20HTTP/1.1\x20'+_0x5def23['status']);for(const [_0x2ab199,_0x2ea83e]of Object[_0xdc80c7(0x1a2)](_0x5def23[_0xdc80c7(0x194)])){!isSensitiveHeader(_0x2ab199)&&console[_0xdc80c7(0x183)]('<\x20'+_0x2ab199+':\x20'+_0x2ea83e);}console[_0xdc80c7(0x183)]('');}const _0x561e6a=Boolean(_0x15affc[_0xdc80c7(0x18b)]),_0x4907a9={'color':_0x15affc[_0xdc80c7(0x18e)],'noColor':_0x15affc[_0xdc80c7(0x1a7)]||_0x561e6a&&!_0x15affc[_0xdc80c7(0x18e)]},_0x4307b8=colorizeJSON(_0x5def23[_0xdc80c7(0x1a1)],_0x4907a9);return _0x15affc[_0xdc80c7(0x18b)]?(writeFileSync(_0x15affc[_0xdc80c7(0x18b)],_0x4307b8),console[_0xdc80c7(0x183)](_0xdc80c7(0x1af)+_0x15affc[_0xdc80c7(0x18b)])):console['log'](_0x4307b8),0x0;}catch(_0x39e1c5){return _0x39e1c5 instanceof Error?(console[_0xdc80c7(0x183)](_0xdc80c7(0x19f)+_0x39e1c5[_0xdc80c7(0x1b6)]),_0x15affc[_0xdc80c7(0x1ae)]&&_0x39e1c5[_0xdc80c7(0x1a5)]&&console[_0xdc80c7(0x183)]('\x0aStack\x20trace:\x0a'+_0x39e1c5[_0xdc80c7(0x1a5)])):console[_0xdc80c7(0x183)](_0xdc80c7(0x19f)+String(_0x39e1c5)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0xc184c7=a7_0xcf7a;(function(_0x5d5d62,_0x2dac35){const _0x172031=a7_0xcf7a,_0x2c96fb=_0x5d5d62();while(!![]){try{const _0x53d370=-parseInt(_0x172031(0x1c0))/0x1+-parseInt(_0x172031(0x1d4))/0x2+-parseInt(_0x172031(0x1a5))/0x3+-parseInt(_0x172031(0x1af))/0x4+-parseInt(_0x172031(0x1e3))/0x5+parseInt(_0x172031(0x18b))/0x6*(-parseInt(_0x172031(0x1bb))/0x7)+parseInt(_0x172031(0x18d))/0x8;if(_0x53d370===_0x2dac35)break;else _0x2c96fb['push'](_0x2c96fb['shift']());}catch(_0x5e2445){_0x2c96fb['push'](_0x2c96fb['shift']());}}}(a7_0x126e,0xb8926));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}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';function a7_0x126e(){const _0x57e527=['\x0aSetup\x20cancelled','apikey','For\x20scripts\x20or\x20headless\x20servers','method','4828884pSSSzZ','/app/mp/ak','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','name','create','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','last_name','API\x20key\x20cannot\x20be\x20empty','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','✗\x20Validation\x20failed:\x20','trim','all','66367VJndFr','red','auth:setup','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','site','1493209zFapDU','Opening\x20browser\x20for\x20authentication...','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','Enter\x20your\x20TD\x20API\x20key:','Use\x20an\x20API\x20key','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','getUserInfo','password','ERROR','logLevel','\x20for\x20profile:\x20','Setting\x20up\x20authentication\x20for\x20site:\x20','No\x20credential\x20found','tdx:\x20auth\x20setup','oauth','Validating\x20OAuth\x20tokens...','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Remove\x20API\x20key\x20from\x20system\x20keychain','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','\x20--profile\x20','2388870pGPdum','\x20\x20user_id:','Validating\x20API\x20key...','first_name','execute','✓\x20Profile\x20\x27','\x20(site:\x20','auth','/oauth/authorize','apiKey','\x20(profile:\x20','Choose\x20how\x20to\x20sign\x20in:','error','bold','✓\x20Signed\x20in\x20successfully','1220735ztJtdz','\x27\x20registered','join','Sign\x20in\x20with\x20browser\x20(recommended)','warn','User:\x20','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','status','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','tdx:\x20auth\x20clear','tdx\x20profile:\x20','message','filter','description','N/A','738ZqtNnO','account_id','59546192ErmoMm','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','✓\x20Authentication\x20successful\x0a','Setup\x20cancelled','\x20\x20tdx','email','accountName','Setup\x20API\x20key\x20authentication\x20interactively','profile','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','System\x20keychain\x20is\x20not\x20available','✓\x20Default\x20site\x20set\x20to\x20','log','green','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','You\x20can\x20find\x20your\x20API\x20key\x20at:','access_token','Name:\x20','jobs','dim','yellow','select','4146279rzNIML','OAuth\x20tokens','Credential\x20type:\x20OAuth','API\x20key','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','\x20and\x20'];a7_0x126e=function(){return _0x57e527;};return a7_0x126e();}import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x1900bb 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_0x560ad3 from'chalk';export async function runOAuthLoginFlow(_0x3dfa87,_0x264cb4,_0x4e256a,_0x59f44b){const _0x54b6e6=a7_0xcf7a,_0x1642bd=await isKeychainAvailable();if(!_0x1642bd)throw new Error(_0x54b6e6(0x1d0)+_0x54b6e6(0x19d));let _0x27c77a=_0x59f44b?.[_0x54b6e6(0x193)];if(!_0x27c77a){const _0x4b4091=await a7_0x1900bb({'type':'text','name':_0x54b6e6(0x193),'message':_0x54b6e6(0x1b1)});if(_0x4b4091['accountName']===undefined)throw new Error('Setup\x20cancelled');_0x27c77a=_0x4b4091['accountName']['trim']()||undefined;}const _0x3825b5=getConsoleUrl(_0x3dfa87);console[_0x54b6e6(0x19a)](_0x54b6e6(0x1c1));_0x27c77a?console[_0x54b6e6(0x19a)]('\x20\x20'+_0x3825b5+'/users/initiate_sso\x20(account:\x20'+_0x27c77a+')'):console[_0x54b6e6(0x19a)]('\x20\x20'+_0x3825b5+_0x54b6e6(0x1dc));console['log'](_0x54b6e6(0x1c2));const _0x5f27bc=await startOAuthFlow(_0x3dfa87,{'accountName':_0x27c77a});console['log'](_0x54b6e6(0x1cf));const _0x4b0979=TDX['create']({'site':_0x3dfa87,'accessToken':_0x5f27bc[_0x54b6e6(0x19f)],'logLevel':_0x4e256a??LogLevel['ERROR']}),_0x472909=await _0x4b0979[_0x54b6e6(0x1a1)][_0x54b6e6(0x1c6)]();console['log'](a7_0x560ad3['green'](_0x54b6e6(0x1e2))),console['log']('\x20\x20'+a7_0x560ad3['cyan'](_0x3dfa87+':'+_0x472909[_0x54b6e6(0x18c)])+_0x54b6e6(0x1d5)+_0x472909['id']+'\x20\x20('+_0x472909['email']+')');!_0x27c77a&&(console[_0x54b6e6(0x19a)](a7_0x560ad3[_0x54b6e6(0x1a2)](_0x54b6e6(0x182))),console[_0x54b6e6(0x19a)](a7_0x560ad3[_0x54b6e6(0x1a2)](_0x54b6e6(0x1c5))),console[_0x54b6e6(0x19a)](a7_0x560ad3[_0x54b6e6(0x1a2)](_0x54b6e6(0x1be))));await saveOAuthTokens(_0x5f27bc,_0x264cb4),console[_0x54b6e6(0x19a)](_0x54b6e6(0x184)+(_0x264cb4?_0x54b6e6(0x1de)+_0x264cb4+')':''));if(_0x264cb4){const _0x135778={'site':_0x3dfa87};saveProfileToUserConfig(_0x264cb4,_0x135778),console['log'](_0x54b6e6(0x1d9)+_0x264cb4+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x3dfa87),console[_0x54b6e6(0x19a)](_0x54b6e6(0x199)+_0x3dfa87);const _0x4ccf3f=_0x264cb4?_0x54b6e6(0x1d3)+_0x264cb4:'';console['log'](),console[_0x54b6e6(0x19a)](_0x54b6e6(0x18e)),console[_0x54b6e6(0x19a)](_0x54b6e6(0x191)+_0x4ccf3f+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x54b6e6(0x19a)]('\x20\x20tdx'+_0x4ccf3f+_0x54b6e6(0x196));}function a7_0xcf7a(_0x14fcab,_0x3968aa){_0x14fcab=_0x14fcab-0x181;const _0x126eb2=a7_0x126e();let _0xcf7ae4=_0x126eb2[_0x14fcab];return _0xcf7ae4;}export async function promptAuthMethod(){const _0x3d8ba4=a7_0xcf7a,_0x388717=await a7_0x1900bb({'type':_0x3d8ba4(0x1a4),'name':'method','message':_0x3d8ba4(0x1df),'choices':[{'title':_0x3d8ba4(0x1e6),'description':'Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','value':_0x3d8ba4(0x1ce)},{'title':_0x3d8ba4(0x1c4),'description':_0x3d8ba4(0x1ad),'value':_0x3d8ba4(0x1ac)}]});return _0x388717[_0x3d8ba4(0x1ae)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0xc184c7(0x1b2)]=a7_0xc184c7(0x1bd);[a7_0xc184c7(0x189)]=a7_0xc184c7(0x194);async[a7_0xc184c7(0x1d8)](_0x5659e6){const _0x38b049=a7_0xc184c7,{options:_0x6e570}=_0x5659e6,_0x583dc9=_0x6e570[_0x38b049(0x195)];console[_0x38b049(0x19a)](a7_0x560ad3[_0x38b049(0x1e1)](_0x38b049(0x1cd)));const _0x3b67ea=_0x6e570[_0x38b049(0x1bf)]||'us01',_0x48a47d=await promptSiteSelection(_0x3b67ea,_0x583dc9,_0x38b049(0x190));if(!_0x48a47d)return 0x1;const _0x132b22=resolveSite(_0x48a47d),_0x3ab8f7=await promptAuthMethod();if(!_0x3ab8f7)return console[_0x38b049(0x19a)](_0x38b049(0x1ab)),0x1;if(_0x3ab8f7===_0x38b049(0x1ce)){const {accountName:_0x41b086}=_0x6e570;return await runOAuthLoginFlow(_0x132b22,_0x583dc9,_0x6e570['logLevel']??LogLevel[_0x38b049(0x1c8)],{'accountName':_0x41b086}),0x0;}console['log'](_0x38b049(0x1cb)+_0x132b22),console[_0x38b049(0x19a)](_0x38b049(0x19e)),console[_0x38b049(0x19a)]('\x20\x20'+getConsoleUrl(_0x132b22,_0x38b049(0x1b0)));const _0x187cfd=await a7_0x1900bb({'type':_0x38b049(0x1c7),'name':_0x38b049(0x1dd),'message':_0x38b049(0x1c3),'validate':_0x289fdb=>{const _0x3586a3=_0x38b049;if(!_0x289fdb||!_0x289fdb[_0x3586a3(0x1b9)]())return _0x3586a3(0x1b6);return!![];}});if(!_0x187cfd[_0x38b049(0x1dd)])return console['log'](_0x38b049(0x1ab)),0x1;const _0x2a6356=_0x187cfd[_0x38b049(0x1dd)];console['log'](_0x38b049(0x1d6));try{const _0x4f58d9=TDX[_0x38b049(0x1b3)]({'site':_0x132b22,'apiKey':_0x2a6356['trim'](),'logLevel':_0x6e570[_0x38b049(0x1c9)]??LogLevel[_0x38b049(0x1c8)]}),_0x485911=await _0x4f58d9['jobs'][_0x38b049(0x1c6)]();console[_0x38b049(0x19a)](_0x38b049(0x1b7)+_0x485911[_0x38b049(0x192)]+')');const _0x3e3e8e=await isKeychainAvailable();_0x3e3e8e?(await saveAPIKeyAsync(_0x2a6356[_0x38b049(0x1b9)](),_0x132b22,_0x583dc9),console[_0x38b049(0x19a)](_0x38b049(0x19c)+(_0x583dc9?'\x20(profile:\x20'+_0x583dc9+')':''))):(console[_0x38b049(0x1e7)](a7_0x560ad3[_0x38b049(0x1a3)](_0x38b049(0x1b4))),console[_0x38b049(0x1e7)](a7_0x560ad3[_0x38b049(0x1a3)](_0x38b049(0x1d2))));if(_0x583dc9){const _0x5dafeb={'site':_0x132b22};saveProfileToUserConfig(_0x583dc9,_0x5dafeb),console[_0x38b049(0x19a)]('✓\x20Profile\x20\x27'+_0x583dc9+_0x38b049(0x1e4));}else saveDefaultSiteToUserConfig(_0x132b22),console[_0x38b049(0x19a)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x132b22);const _0x469881=_0x583dc9?'\x20--profile\x20'+_0x583dc9:'';return console['log'](),console[_0x38b049(0x19a)](_0x38b049(0x18e)),console['log'](_0x38b049(0x191)+_0x469881+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x38b049(0x19a)](_0x38b049(0x191)+_0x469881+_0x38b049(0x196)),0x0;}catch(_0x4c8c02){if(_0x4c8c02 instanceof HTTPClientError&&_0x4c8c02[_0x38b049(0x183)]===0x191)return printAuthError(_0x4c8c02),0x1;return console[_0x38b049(0x1e0)](a7_0x560ad3[_0x38b049(0x1bc)]('✗\x20Validation\x20failed:\x20'+(_0x4c8c02 instanceof Error?_0x4c8c02[_0x38b049(0x187)]:String(_0x4c8c02)))),console[_0x38b049(0x1e0)](_0x38b049(0x197)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0xc184c7(0x1b2)]=a7_0xc184c7(0x1db);['description']=a7_0xc184c7(0x1a9);async[a7_0xc184c7(0x1d8)](_0x4bb087){const _0x52fd0c=a7_0xc184c7,{options:_0x47facf,tdx:_0x5b4893}=_0x4bb087,_0x22bd06=_0x47facf[_0x52fd0c(0x1bf)],_0x11ed72=_0x47facf[_0x52fd0c(0x195)],_0x3c249c=_0x11ed72?_0x11ed72:_0x52fd0c(0x18a);console[_0x52fd0c(0x19a)](_0x52fd0c(0x186)+_0x3c249c+_0x52fd0c(0x1da)+_0x22bd06+')');const _0x1a1b08=await getOAuthTokens(_0x11ed72);if(_0x1a1b08)console[_0x52fd0c(0x19a)](_0x52fd0c(0x1a7)),console[_0x52fd0c(0x19a)]('Read\x20credential\x20from\x20keychain'+(_0x11ed72?'\x20(profile:\x20'+_0x11ed72+')':''));else{const _0x327165=await resolveAPIKeyAsync(_0x22bd06,_0x11ed72);if(_0x327165){const {source:_0x292a55,isDeprecated:_0xd2b4a}=_0x327165,_0x4e006f='Read\x20credential\x20from\x20'+_0x292a55;console['log'](_0xd2b4a?a7_0x560ad3[_0x52fd0c(0x1a3)](_0x4e006f):_0x4e006f);}else console[_0x52fd0c(0x19a)](a7_0x560ad3[_0x52fd0c(0x1a3)](_0x52fd0c(0x1cc)));}try{const _0x33bf8f=await _0x5b4893[_0x52fd0c(0x1a1)][_0x52fd0c(0x1c6)]();return console[_0x52fd0c(0x19a)](a7_0x560ad3[_0x52fd0c(0x19b)](_0x52fd0c(0x18f))),console['log'](_0x52fd0c(0x181)+_0x33bf8f['email']),(_0x33bf8f[_0x52fd0c(0x1d7)]||_0x33bf8f[_0x52fd0c(0x1b5)])&&console[_0x52fd0c(0x19a)](_0x52fd0c(0x1a0)+[_0x33bf8f[_0x52fd0c(0x1d7)],_0x33bf8f['last_name']]['filter'](Boolean)[_0x52fd0c(0x1e5)]('\x20')),0x0;}catch(_0x4e223d){return _0x4e223d instanceof HTTPClientError&&_0x4e223d[_0x52fd0c(0x183)]===0x191?printAuthError(_0x4e223d,!![],_0x11ed72):console['error'](a7_0x560ad3[_0x52fd0c(0x1bc)](_0x52fd0c(0x1b8)+(_0x4e223d instanceof Error?_0x4e223d['message']:String(_0x4e223d)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']='auth:clear';[a7_0xc184c7(0x189)]=a7_0xc184c7(0x1d1);async['execute'](_0x570c8d){const _0x3549ba=a7_0xc184c7,{options:_0x349fd8}=_0x570c8d,_0x5da640=_0x349fd8['profile'];console[_0x3549ba(0x19a)](a7_0x560ad3['bold'](_0x3549ba(0x185)));const _0x344727=await isKeychainAvailable();if(!_0x344727)return console[_0x3549ba(0x1e0)](a7_0x560ad3[_0x3549ba(0x1bc)](_0x3549ba(0x198))),0x1;const [_0x3d62c8,_0x32a28c]=await Promise[_0x3549ba(0x1ba)]([deleteKeychainAPIKey(_0x5da640),deleteOAuthTokens(_0x5da640)]);if(_0x3d62c8||_0x32a28c){clearCredentialCache();const _0x96c894=[_0x3d62c8&&_0x3549ba(0x1a8),_0x32a28c&&_0x3549ba(0x1a6)][_0x3549ba(0x188)](Boolean)[_0x3549ba(0x1e5)](_0x3549ba(0x1aa));return console['log']('✓\x20'+_0x96c894+'\x20removed\x20from\x20keychain'+(_0x5da640?_0x3549ba(0x1de)+_0x5da640+')':'')),0x0;}else return console[_0x3549ba(0x19a)]('No\x20credentials\x20found\x20in\x20keychain'+(_0x5da640?_0x3549ba(0x1ca)+_0x5da640:'')),0x1;}}
1
+ const a7_0x4529fb=a7_0x5b72;(function(_0x547043,_0x2b8cfd){const _0x2360d6=a7_0x5b72,_0x5a7c1f=_0x547043();while(!![]){try{const _0x59ed00=parseInt(_0x2360d6(0x149))/0x1*(-parseInt(_0x2360d6(0x13b))/0x2)+-parseInt(_0x2360d6(0x161))/0x3+parseInt(_0x2360d6(0x16d))/0x4*(parseInt(_0x2360d6(0x117))/0x5)+parseInt(_0x2360d6(0x11f))/0x6*(parseInt(_0x2360d6(0x15b))/0x7)+parseInt(_0x2360d6(0x130))/0x8+-parseInt(_0x2360d6(0x14c))/0x9+-parseInt(_0x2360d6(0x153))/0xa;if(_0x59ed00===_0x2b8cfd)break;else _0x5a7c1f['push'](_0x5a7c1f['shift']());}catch(_0x4887e9){_0x5a7c1f['push'](_0x5a7c1f['shift']());}}}(a7_0x357b,0x98c05));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}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_0x159470 from'prompts';function a7_0x5b72(_0x2b92c6,_0x59cc6f){_0x2b92c6=_0x2b92c6-0x117;const _0x357bf4=a7_0x357b();let _0x5b72c2=_0x357bf4[_0x2b92c6];return _0x5b72c2;}import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x4e4ad1 from'chalk';export async function runOAuthLoginFlow(_0x5d7382,_0xeb4408,_0x4ca591,_0x38858e){const _0x397d77=a7_0x5b72,_0x16d0ec=await isKeychainAvailable();if(!_0x16d0ec)throw new Error(_0x397d77(0x16c)+_0x397d77(0x124));let _0xe7b483=_0x38858e?.[_0x397d77(0x151)];if(!_0xe7b483){const _0x3c9f2d=await a7_0x159470({'type':_0x397d77(0x12c),'name':'accountName','message':_0x397d77(0x14b)});if(_0x3c9f2d[_0x397d77(0x151)]===undefined)throw new Error(_0x397d77(0x15d));_0xe7b483=_0x3c9f2d['accountName'][_0x397d77(0x142)]()||undefined;}const _0x432421=getConsoleUrl(_0x5d7382);console[_0x397d77(0x168)](_0x397d77(0x171));_0xe7b483?console['log']('\x20\x20'+_0x432421+_0x397d77(0x127)+_0xe7b483+')'):console[_0x397d77(0x168)]('\x20\x20'+_0x432421+_0x397d77(0x141));console[_0x397d77(0x168)](_0x397d77(0x169));const _0x24ac1b=await startOAuthFlow(_0x5d7382,{'accountName':_0xe7b483});console[_0x397d77(0x168)]('Validating\x20OAuth\x20tokens...');const _0xc2c319=TDX[_0x397d77(0x144)]({'site':_0x5d7382,'accessToken':_0x24ac1b[_0x397d77(0x11c)],'logLevel':_0x4ca591??LogLevel['ERROR']}),_0x2bcc6b=await _0xc2c319[_0x397d77(0x159)][_0x397d77(0x139)]();console[_0x397d77(0x168)](a7_0x4e4ad1[_0x397d77(0x12e)](_0x397d77(0x156))),console[_0x397d77(0x168)]('\x20\x20'+a7_0x4e4ad1[_0x397d77(0x150)](_0x5d7382+':'+_0x2bcc6b[_0x397d77(0x14e)])+'\x20\x20user_id:'+_0x2bcc6b['id']+_0x397d77(0x125)+_0x2bcc6b[_0x397d77(0x13a)]+')');!_0xe7b483&&(console[_0x397d77(0x168)](a7_0x4e4ad1['dim'](_0x397d77(0x121))),console[_0x397d77(0x168)](a7_0x4e4ad1[_0x397d77(0x13c)](_0x397d77(0x14f))),console['log'](a7_0x4e4ad1[_0x397d77(0x13c)](_0x397d77(0x11a))));await saveOAuthTokens(_0x24ac1b,_0xeb4408),console[_0x397d77(0x168)](_0x397d77(0x172)+(_0xeb4408?_0x397d77(0x14a)+_0xeb4408+')':''));if(_0xeb4408){const _0x768421={'site':_0x5d7382};saveProfileToUserConfig(_0xeb4408,_0x768421),console['log'](_0x397d77(0x137)+_0xeb4408+_0x397d77(0x126));}else saveDefaultSiteToUserConfig(_0x5d7382),console[_0x397d77(0x168)](_0x397d77(0x16f)+_0x5d7382);const _0x3c071c=_0xeb4408?_0x397d77(0x167)+_0xeb4408:'';console[_0x397d77(0x168)](),console[_0x397d77(0x168)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x397d77(0x168)](_0x397d77(0x154)+_0x3c071c+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x397d77(0x168)](_0x397d77(0x154)+_0x3c071c+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export async function promptAuthMethod(){const _0x473baf=a7_0x5b72,_0x48cf70=await a7_0x159470({'type':_0x473baf(0x15e),'name':'method','message':_0x473baf(0x11d),'choices':[{'title':'Sign\x20in\x20with\x20browser\x20(recommended)','description':_0x473baf(0x176),'value':_0x473baf(0x152)},{'title':'Use\x20an\x20API\x20key','description':_0x473baf(0x13d),'value':_0x473baf(0x165)}]});return _0x48cf70[_0x473baf(0x146)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x4529fb(0x145)]=a7_0x4529fb(0x135);[a7_0x4529fb(0x119)]=a7_0x4529fb(0x164);async[a7_0x4529fb(0x128)](_0x2f1f2b){const _0x2cbfe7=a7_0x4529fb,{options:_0x53a762}=_0x2f1f2b,_0x21b47c=_0x53a762[_0x2cbfe7(0x16b)];console[_0x2cbfe7(0x168)](a7_0x4e4ad1[_0x2cbfe7(0x174)]('tdx:\x20auth\x20setup'));const _0x5a2bd3=_0x53a762[_0x2cbfe7(0x132)]||'us01',_0xa0f59=await promptSiteSelection(_0x5a2bd3,_0x21b47c,_0x2cbfe7(0x15d));if(!_0xa0f59)return 0x1;const _0x5c1b30=resolveSite(_0xa0f59),_0x108017=await promptAuthMethod();if(!_0x108017)return console['log'](_0x2cbfe7(0x138)),0x1;if(_0x108017===_0x2cbfe7(0x152)){const {accountName:_0x2d44ee}=_0x53a762;return await runOAuthLoginFlow(_0x5c1b30,_0x21b47c,_0x53a762[_0x2cbfe7(0x133)]??LogLevel[_0x2cbfe7(0x15a)],{'accountName':_0x2d44ee}),0x0;}console[_0x2cbfe7(0x168)](_0x2cbfe7(0x15f)+_0x5c1b30),console['log'](_0x2cbfe7(0x15c)),console[_0x2cbfe7(0x168)]('\x20\x20'+getConsoleUrl(_0x5c1b30,_0x2cbfe7(0x175)));const _0x329e2c=await a7_0x159470({'type':_0x2cbfe7(0x123),'name':_0x2cbfe7(0x160),'message':_0x2cbfe7(0x157),'validate':_0x1eecb9=>{const _0x5974b6=_0x2cbfe7;if(!_0x1eecb9||!_0x1eecb9[_0x5974b6(0x142)]())return _0x5974b6(0x131);return!![];}});if(!_0x329e2c['apiKey'])return console[_0x2cbfe7(0x168)](_0x2cbfe7(0x138)),0x1;const _0x2e526c=_0x329e2c[_0x2cbfe7(0x160)];console[_0x2cbfe7(0x168)](_0x2cbfe7(0x170));try{const _0x2bb797=TDX[_0x2cbfe7(0x144)]({'site':_0x5c1b30,'apiKey':_0x2e526c[_0x2cbfe7(0x142)](),'logLevel':_0x53a762[_0x2cbfe7(0x133)]??LogLevel['ERROR']}),_0x54b09e=await _0x2bb797['jobs'][_0x2cbfe7(0x139)]();console[_0x2cbfe7(0x168)](_0x2cbfe7(0x162)+_0x54b09e['email']+')');const _0x527475=await isKeychainAvailable();_0x527475?(await saveAPIKeyAsync(_0x2e526c[_0x2cbfe7(0x142)](),_0x5c1b30,_0x21b47c),console['log'](_0x2cbfe7(0x12a)+(_0x21b47c?_0x2cbfe7(0x14a)+_0x21b47c+')':''))):(console['warn'](a7_0x4e4ad1['yellow'](_0x2cbfe7(0x173))),console[_0x2cbfe7(0x147)](a7_0x4e4ad1[_0x2cbfe7(0x177)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x21b47c){const _0x471e08={'site':_0x5c1b30};saveProfileToUserConfig(_0x21b47c,_0x471e08),console[_0x2cbfe7(0x168)](_0x2cbfe7(0x137)+_0x21b47c+_0x2cbfe7(0x126));}else saveDefaultSiteToUserConfig(_0x5c1b30),console[_0x2cbfe7(0x168)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x5c1b30);const _0x5c837c=_0x21b47c?_0x2cbfe7(0x167)+_0x21b47c:'';return console[_0x2cbfe7(0x168)](),console[_0x2cbfe7(0x168)](_0x2cbfe7(0x11e)),console[_0x2cbfe7(0x168)](_0x2cbfe7(0x154)+_0x5c837c+_0x2cbfe7(0x13e)),console[_0x2cbfe7(0x168)](_0x2cbfe7(0x154)+_0x5c837c+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x29da23){if(_0x29da23 instanceof HTTPClientError&&_0x29da23[_0x2cbfe7(0x148)]===0x191)return printAuthError(_0x29da23),0x1;return console['error'](a7_0x4e4ad1['red'](_0x2cbfe7(0x12b)+(_0x29da23 instanceof Error?_0x29da23[_0x2cbfe7(0x163)]:String(_0x29da23)))),console[_0x2cbfe7(0x122)](_0x2cbfe7(0x155)),0x1;}}}function a7_0x357b(){const _0x2cc585=['Setting\x20up\x20authentication\x20for\x20site:\x20','apiKey','3286299LxfVDD','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','message','Setup\x20API\x20key\x20authentication\x20interactively','apikey','filter','\x20--profile\x20','log','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','Read\x20credential\x20from\x20keychain','profile','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','46016HuLAoi','API\x20key','✓\x20Default\x20site\x20set\x20to\x20','Validating\x20API\x20key...','Opening\x20browser\x20for\x20authentication...','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','bold','/app/mp/ak','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','yellow','425srfQio','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','description','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','\x20removed\x20from\x20keychain','access_token','Choose\x20how\x20to\x20sign\x20in:','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','78fbSQCu','N/A','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','error','password','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','\x20\x20(','\x27\x20registered','/users/initiate_sso\x20(account:\x20','execute','✓\x20Authentication\x20successful\x0a','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','✗\x20Validation\x20failed:\x20','text','last_name','green','No\x20credentials\x20found\x20in\x20keychain','6641096MrEiBh','API\x20key\x20cannot\x20be\x20empty','site','logLevel','\x20and\x20','auth:setup','System\x20keychain\x20is\x20not\x20available','✓\x20Profile\x20\x27','\x0aSetup\x20cancelled','getUserInfo','email','6762KPQVzo','dim','For\x20scripts\x20or\x20headless\x20servers','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','join','tdx\x20profile:\x20','/oauth/authorize','trim','red','create','name','method','warn','status','15KBNAjE','\x20(profile:\x20','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','4073229TCoGlM','\x20for\x20profile:\x20','account_id','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','cyan','accountName','oauth','2772460BHIAvN','\x20\x20tdx','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','✓\x20Signed\x20in\x20successfully','Enter\x20your\x20TD\x20API\x20key:','Remove\x20API\x20key\x20from\x20system\x20keychain','jobs','ERROR','373513iQkhKE','You\x20can\x20find\x20your\x20API\x20key\x20at:','Setup\x20cancelled','select'];a7_0x357b=function(){return _0x2cc585;};return a7_0x357b();}export class AuthStatusCommand extends BaseCommand{[a7_0x4529fb(0x145)]='auth';[a7_0x4529fb(0x119)]=a7_0x4529fb(0x118);async[a7_0x4529fb(0x128)](_0x5d0e1b){const _0x4f7e94=a7_0x4529fb,{options:_0x50cc13,tdx:_0x10af09}=_0x5d0e1b,_0x315296=_0x50cc13['site'],_0xca62ac=_0x50cc13[_0x4f7e94(0x16b)],_0x2519b5=_0xca62ac?_0xca62ac:_0x4f7e94(0x120);console[_0x4f7e94(0x168)](_0x4f7e94(0x140)+_0x2519b5+'\x20(site:\x20'+_0x315296+')');const _0x13a658=await getOAuthTokens(_0xca62ac);if(_0x13a658)console[_0x4f7e94(0x168)]('Credential\x20type:\x20OAuth'),console[_0x4f7e94(0x168)](_0x4f7e94(0x16a)+(_0xca62ac?_0x4f7e94(0x14a)+_0xca62ac+')':''));else{const _0x301ee0=await resolveAPIKeyAsync(_0x315296,_0xca62ac);if(_0x301ee0){const {source:_0x399ab0,isDeprecated:_0x125d5a}=_0x301ee0,_0x2185f6='Read\x20credential\x20from\x20'+_0x399ab0;console[_0x4f7e94(0x168)](_0x125d5a?a7_0x4e4ad1[_0x4f7e94(0x177)](_0x2185f6):_0x2185f6);}else console[_0x4f7e94(0x168)](a7_0x4e4ad1['yellow']('No\x20credential\x20found'));}try{const _0x14633e=await _0x10af09[_0x4f7e94(0x159)][_0x4f7e94(0x139)]();return console[_0x4f7e94(0x168)](a7_0x4e4ad1['green'](_0x4f7e94(0x129))),console[_0x4f7e94(0x168)]('User:\x20'+_0x14633e[_0x4f7e94(0x13a)]),(_0x14633e['first_name']||_0x14633e[_0x4f7e94(0x12d)])&&console['log']('Name:\x20'+[_0x14633e['first_name'],_0x14633e['last_name']][_0x4f7e94(0x166)](Boolean)[_0x4f7e94(0x13f)]('\x20')),0x0;}catch(_0x170ae8){return _0x170ae8 instanceof HTTPClientError&&_0x170ae8[_0x4f7e94(0x148)]===0x191?printAuthError(_0x170ae8,!![],_0xca62ac):console['error'](a7_0x4e4ad1[_0x4f7e94(0x143)](_0x4f7e94(0x12b)+(_0x170ae8 instanceof Error?_0x170ae8[_0x4f7e94(0x163)]:String(_0x170ae8)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']='auth:clear';[a7_0x4529fb(0x119)]=a7_0x4529fb(0x158);async[a7_0x4529fb(0x128)](_0x35256b){const _0x151fda=a7_0x4529fb,{options:_0x281f08}=_0x35256b,_0x326a54=_0x281f08['profile'];console['log'](a7_0x4e4ad1[_0x151fda(0x174)]('tdx:\x20auth\x20clear'));const _0xe6c3da=await isKeychainAvailable();if(!_0xe6c3da)return console['error'](a7_0x4e4ad1['red'](_0x151fda(0x136))),0x1;const [_0x1e4d7d,_0x3dfd7f]=await Promise['all']([deleteKeychainAPIKey(_0x326a54),deleteOAuthTokens(_0x326a54)]);if(_0x1e4d7d||_0x3dfd7f){clearCredentialCache();const _0x4f019a=[_0x1e4d7d&&_0x151fda(0x16e),_0x3dfd7f&&'OAuth\x20tokens'][_0x151fda(0x166)](Boolean)[_0x151fda(0x13f)](_0x151fda(0x134));return console[_0x151fda(0x168)]('✓\x20'+_0x4f019a+_0x151fda(0x11b)+(_0x326a54?_0x151fda(0x14a)+_0x326a54+')':'')),0x0;}else return console['log'](_0x151fda(0x12f)+(_0x326a54?_0x151fda(0x14d)+_0x326a54:'')),0x1;}}