@treasuredata/tdx 2026.4.10 → 2026.4.11

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 (220) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/access-tracker.js +1 -1
  182. package/dist/sdk/workspace/frontmatter.js +1 -1
  183. package/dist/sdk/workspace/git.js +1 -1
  184. package/dist/sdk/workspace/index.js +1 -1
  185. package/dist/sdk/workspace/templates.js +1 -1
  186. package/dist/sdk/workspace/weekly.js +1 -1
  187. package/dist/sdk/workspace/wikilinks.js +1 -1
  188. package/dist/test-utils/command-runner.js +1 -1
  189. package/dist/test-utils/factories.js +1 -1
  190. package/dist/test-utils/fixtures.js +1 -1
  191. package/dist/test-utils/http-mock.js +1 -1
  192. package/dist/test-utils/index.js +1 -1
  193. package/dist/utils/async.js +1 -1
  194. package/dist/utils/colors.js +1 -1
  195. package/dist/utils/diff.js +1 -1
  196. package/dist/utils/file-permissions.js +1 -1
  197. package/dist/utils/file-reader.js +1 -1
  198. package/dist/utils/github-releases.js +1 -1
  199. package/dist/utils/global-cache.js +1 -1
  200. package/dist/utils/json-loader.js +1 -1
  201. package/dist/utils/local-cache.js +1 -1
  202. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  203. package/dist/utils/logger/formatters/index.js +1 -1
  204. package/dist/utils/logger/handlers/console-handler.js +1 -1
  205. package/dist/utils/logger/handlers/file-handler.js +1 -1
  206. package/dist/utils/logger/handlers/index.js +1 -1
  207. package/dist/utils/logger/handlers/null-handler.js +1 -1
  208. package/dist/utils/logger/index.js +1 -1
  209. package/dist/utils/logger/logger.js +1 -1
  210. package/dist/utils/logger/types.js +1 -1
  211. package/dist/utils/option-validation.js +1 -1
  212. package/dist/utils/process.js +1 -1
  213. package/dist/utils/prompt.js +1 -1
  214. package/dist/utils/spinner.js +1 -1
  215. package/dist/utils/sse-parser.js +1 -1
  216. package/dist/utils/string-utils.js +1 -1
  217. package/dist/utils/table-ref-parser.js +1 -1
  218. package/dist/utils/tdx-logger.js +1 -1
  219. package/dist/utils/version-check.js +1 -1
  220. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x5b56f8=a3_0x5206;(function(_0x41e8de,_0x128d03){const _0x433b24=a3_0x5206,_0x104818=_0x41e8de();while(!![]){try{const _0x380cd6=parseInt(_0x433b24(0x147))/0x1*(-parseInt(_0x433b24(0x146))/0x2)+parseInt(_0x433b24(0x145))/0x3+parseInt(_0x433b24(0x15b))/0x4*(-parseInt(_0x433b24(0x14f))/0x5)+-parseInt(_0x433b24(0x15c))/0x6+-parseInt(_0x433b24(0x14d))/0x7*(-parseInt(_0x433b24(0x15d))/0x8)+-parseInt(_0x433b24(0x14c))/0x9+parseInt(_0x433b24(0x15f))/0xa;if(_0x380cd6===_0x128d03)break;else _0x104818['push'](_0x104818['shift']());}catch(_0x1d3da4){_0x104818['push'](_0x104818['shift']());}}}(a3_0xdcdc,0xa17b3));import{BaseCommand}from'./command.js';function a3_0x5206(_0x396541,_0x3ac27d){_0x396541=_0x396541-0x144;const _0xdcdc13=a3_0xdcdc();let _0x5206b5=_0xdcdc13[_0x396541];return _0x5206b5;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0xdcdc(){const _0x7bba1e=['Resolving\x20child\x20segment\x20\x27','Resolved\x20child\x20ID:\x20','data','verbose','Child\x20name:\x20','resolveSegmentId','segment','\x27...','12tGLtzL','2539422HrqHNP','4089784EeRoBa','cause','20833000JvadEx','resolveParentId','\x20activation','List\x20activations\x20for\x20a\x20segment','\x20\x20Cause:\x20','2019336JHbYtQ','2QDPNqg','1232702GNBsEX','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','length','error','activations','3805569SJlYFu','14CcZfok','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','1731085lkSQZC','Resolved\x20parent\x20ID:\x20','description','Resolving\x20parent\x20segment\x20\x27'];a3_0xdcdc=function(){return _0x7bba1e;};return a3_0xdcdc();}export class ActivationsCommand extends BaseCommand{['name']=a3_0x5b56f8(0x14b);[a3_0x5b56f8(0x151)]=a3_0x5b56f8(0x162);async['execute'](_0x248398){const _0x3414fd=a3_0x5b56f8,{options:_0x35e031,args:_0x55c8aa,tdx:_0x53428e}=_0x248398;if(_0x55c8aa[_0x3414fd(0x149)]===0x0)return console[_0x3414fd(0x14a)]('Error:\x20Segment\x20name\x20is\x20required'),console[_0x3414fd(0x14a)](_0x3414fd(0x148)),0x1;try{const {parentId:_0x448274,childId:_0x45900f}=parseSegmentRef(_0x55c8aa[0x0]);if(!_0x45900f)return console['error'](_0x3414fd(0x14e)),console[_0x3414fd(0x14a)](_0x3414fd(0x148)),0x1;_0x35e031[_0x3414fd(0x156)]&&(console[_0x3414fd(0x14a)]('Site:\x20'+_0x35e031['site']),console[_0x3414fd(0x14a)]('Parent\x20name:\x20'+_0x448274),console['error'](_0x3414fd(0x157)+_0x45900f));const _0x1293c6=await withSpinner(_0x3414fd(0x152)+_0x448274+_0x3414fd(0x15a),()=>_0x53428e['segment'][_0x3414fd(0x160)](_0x448274),{'verbose':_0x35e031[_0x3414fd(0x156)]}),_0x1a078f=_0x1293c6[_0x3414fd(0x155)];_0x35e031[_0x3414fd(0x156)]&&console[_0x3414fd(0x14a)](_0x3414fd(0x150)+_0x1a078f);const _0x21c4dd=await withSpinner(_0x3414fd(0x153)+_0x45900f+_0x3414fd(0x15a),()=>_0x53428e[_0x3414fd(0x159)][_0x3414fd(0x158)](_0x1a078f,_0x45900f),{'verbose':_0x35e031[_0x3414fd(0x156)]}),_0x131402=_0x21c4dd[_0x3414fd(0x155)];_0x35e031[_0x3414fd(0x156)]&&console['error'](_0x3414fd(0x154)+_0x131402);const _0x1fc50f=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x45900f+_0x3414fd(0x15a),()=>_0x53428e[_0x3414fd(0x159)]['listActivations'](_0x1a078f,_0x131402),{'verbose':_0x35e031[_0x3414fd(0x156)]}),_0x303075=_0x1fc50f[_0x3414fd(0x155)];return console[_0x3414fd(0x14a)]('✔\x20Found\x20'+_0x303075[_0x3414fd(0x149)]+_0x3414fd(0x161)+(_0x303075[_0x3414fd(0x149)]!==0x1?'s':'')),await handleSDKOutput(_0x303075,_0x35e031),0x0;}catch(_0x5c1edc){if(_0x5c1edc instanceof SDKError)return console['error']('Error:\x20'+_0x5c1edc['message']),_0x5c1edc[_0x3414fd(0x15e)]&&console[_0x3414fd(0x14a)](_0x3414fd(0x144)+_0x5c1edc[_0x3414fd(0x15e)]),0x1;throw _0x5c1edc;}}}
1
+ const a3_0x297b4c=a3_0xe324;(function(_0x3b5bcb,_0x35bcb1){const _0x511eeb=a3_0xe324,_0x5e8fd=_0x3b5bcb();while(!![]){try{const _0x507ed2=parseInt(_0x511eeb(0xf9))/0x1*(-parseInt(_0x511eeb(0x10a))/0x2)+parseInt(_0x511eeb(0x109))/0x3+-parseInt(_0x511eeb(0xfa))/0x4*(-parseInt(_0x511eeb(0xfb))/0x5)+-parseInt(_0x511eeb(0x11b))/0x6+parseInt(_0x511eeb(0x117))/0x7*(parseInt(_0x511eeb(0xfe))/0x8)+-parseInt(_0x511eeb(0x104))/0x9*(-parseInt(_0x511eeb(0x108))/0xa)+parseInt(_0x511eeb(0x10b))/0xb*(parseInt(_0x511eeb(0x11a))/0xc);if(_0x507ed2===_0x35bcb1)break;else _0x5e8fd['push'](_0x5e8fd['shift']());}catch(_0x999861){_0x5e8fd['push'](_0x5e8fd['shift']());}}}(a3_0x4ba0,0xb1efc));function a3_0xe324(_0x550af9,_0x3e927d){_0x550af9=_0x550af9-0xf8;const _0x4ba01b=a3_0x4ba0();let _0xe32432=_0x4ba01b[_0x550af9];return _0xe32432;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a3_0x4ba0(){const _0xde8ffe=['execute','description','1077OQkrJA','1413188fcJQXa','5sgTjgU','site','\x27...','5080FDmlrw','\x20\x20Cause:\x20','Error:\x20Segment\x20name\x20is\x20required','data','List\x20activations\x20for\x20a\x20segment','listActivations','198IkvKJa','Site:\x20','message','Child\x20name:\x20','117400ifOYqq','2594268lgsbFY','772oZmoll','341KtLVqF','activations','Resolved\x20parent\x20ID:\x20','Listing\x20activations\x20for\x20segment\x20\x27','resolveParentId','Resolved\x20child\x20ID:\x20','✔\x20Found\x20','segment','\x20activation','length','Resolving\x20child\x20segment\x20\x27','error','4137NuplCK','cause','name','199596pgsgqr','7336146PcNKeP','Parent\x20name:\x20','verbose','resolveSegmentId'];a3_0x4ba0=function(){return _0xde8ffe;};return a3_0x4ba0();}import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x297b4c(0x119)]=a3_0x297b4c(0x10c);[a3_0x297b4c(0xf8)]=a3_0x297b4c(0x102);async[a3_0x297b4c(0x11f)](_0x157015){const _0x582e8f=a3_0x297b4c,{options:_0x285872,args:_0x57b6fd,tdx:_0x17fde4}=_0x157015;if(_0x57b6fd[_0x582e8f(0x114)]===0x0)return console['error'](_0x582e8f(0x100)),console[_0x582e8f(0x116)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x57c62e,childId:_0x46dd31}=parseSegmentRef(_0x57b6fd[0x0]);if(!_0x46dd31)return console['error']('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x582e8f(0x116)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x285872[_0x582e8f(0x11d)]&&(console[_0x582e8f(0x116)](_0x582e8f(0x105)+_0x285872[_0x582e8f(0xfc)]),console[_0x582e8f(0x116)](_0x582e8f(0x11c)+_0x57c62e),console['error'](_0x582e8f(0x107)+_0x46dd31));const _0xf07a52=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x57c62e+_0x582e8f(0xfd),()=>_0x17fde4[_0x582e8f(0x112)][_0x582e8f(0x10f)](_0x57c62e),{'verbose':_0x285872['verbose']}),_0x4d6533=_0xf07a52['data'];_0x285872['verbose']&&console[_0x582e8f(0x116)](_0x582e8f(0x10d)+_0x4d6533);const _0x45bdf6=await withSpinner(_0x582e8f(0x115)+_0x46dd31+_0x582e8f(0xfd),()=>_0x17fde4[_0x582e8f(0x112)][_0x582e8f(0x11e)](_0x4d6533,_0x46dd31),{'verbose':_0x285872[_0x582e8f(0x11d)]}),_0x39957c=_0x45bdf6['data'];_0x285872[_0x582e8f(0x11d)]&&console[_0x582e8f(0x116)](_0x582e8f(0x110)+_0x39957c);const _0x31df3d=await withSpinner(_0x582e8f(0x10e)+_0x46dd31+_0x582e8f(0xfd),()=>_0x17fde4[_0x582e8f(0x112)][_0x582e8f(0x103)](_0x4d6533,_0x39957c),{'verbose':_0x285872[_0x582e8f(0x11d)]}),_0x1c2302=_0x31df3d[_0x582e8f(0x101)];return console[_0x582e8f(0x116)](_0x582e8f(0x111)+_0x1c2302[_0x582e8f(0x114)]+_0x582e8f(0x113)+(_0x1c2302['length']!==0x1?'s':'')),await handleSDKOutput(_0x1c2302,_0x285872),0x0;}catch(_0x114597){if(_0x114597 instanceof SDKError)return console['error']('Error:\x20'+_0x114597[_0x582e8f(0x106)]),_0x114597[_0x582e8f(0x118)]&&console[_0x582e8f(0x116)](_0x582e8f(0xff)+_0x114597['cause']),0x1;throw _0x114597;}}}
@@ -1 +1 @@
1
- function a4_0x3c74(){const _0x24876d=['repeat','Analyzing\x20project\x20\x22','\x0a✔\x20Pulled\x20','llm_project','Using\x20project\x20from\x20','arg-dir','\x20\x20Text\x20Knowledge\x20Base\x20\x22','projectName','\x0aChanges\x20to\x20agent\x20\x27','\x0aChanges\x20to\x20form\x20interface\x20\x27','Source:\x20','128793YeORsC','Using\x20project\x20from\x20context:\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Dry\x20run\x20-\x20no\x20changes\x20made','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','4961NakOii','191050BsxhJl','\x22...','tdx.json','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','profile','\x0aChanges\x20to\x20integration\x20\x27','283230nETFfr','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','\x20\x20Form\x20Interfaces:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','diff','MISSING_ARGUMENT','Pushing\x20to\x20project...','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Using\x20local\x20project:\x20','\x20\x20Source:\x20','no_local_folder','\x22\x20from\x20project\x20\x22','\x20changed','28ogkDrC','error','\x20\x20Experimental\x20Artifacts:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20total','\x22\x20to\x20new\x20project\x20\x22','knowledgeBases','\x20--profile\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','site','\x20new','agents','no_context','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','output','-\x20nothing\x20pushed','hasChanges','Pulling\x20agent\x20\x22','\x20\x20Integration\x20\x22','New\x20project:\x20','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20files?','\x20resources?','Status:\x20','\x22\x20to\x20\x22','\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','Agent:\x20','isNew','\x20\x20Text\x20Knowledge\x20Bases:\x20','session','dirname','✔\x20Context\x20set:\x20','\x20files\x20to\x20','\x20\x20Experimental\x20Artifact\x20\x22','dim','\x22:\x20','\x20\x20Prompts:\x20','New\x20project\x20name\x20is\x20required','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','context','Would\x20push\x20agent:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','agent:push','\x27\x20to\x20create\x20the\x20folder\x20structure.','action','2305359cUZWiD','chatInterfaces','red','reason','Using\x20current\x20project:\x20','yes','agentName','Agent\x20pulled\x20successfully','green','\x20\x20Knowledge\x20Bases:\x20','\x20=\x20','agent','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','errors','integrations','1256nADybI','\x20--name\x20','\x0aChanges\x20to\x20prompt\x20\x27','outputDir','outputPath','New\x20project\x20ID:\x20','cwd','Failed\x20to\x20push\x20agent:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','prompts','Analyzing\x20changes\x20to\x20push...','push','7950kmWAzp','Cancelled','<new-name>','\x0aError:','updated','pullProject','Clone\x20\x22','Cloning\x20\x22','utf-8','pushProject','\x20|\x20','INVALID_ARGUMENT','\x20\x20tdx\x20agent\x20pull\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','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','new','llm','\x20errors','1873374JNYcpa','name','Errors:','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','projectId','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x0a✔\x20Pushed\x20','description','experimentalArtifacts','Using\x20context\x20project:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x0aPush\x20summary\x20for\x20\x27','Would\x20pull\x20agent:\x20','experimentalKnowledgeBases','\x20\x20Target:\x20','cyan','-\x20no\x20files\x20written','agentId','\x20unchanged','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','5LyuGrq','9793abYLBk','No\x20tdx.json\x20found\x20in\x20','dryRun','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Project\x20cloned\x20with\x20errors','Chat:\x20','\x20\x20Chat\x20Interface\x20\x22','parse','Using\x20project:\x20','found','message','\x20created','unchanged','log','newProjectId','gray','yellow','\x20\x20Knowledge\x20Base\x20\x22','textKnowledgeBases','\x20\x20Prompt\x20\x22','execute','\x0aChanges\x20to\x20chat\x20interface\x20\x27','created','\x20\x20Chat\x20Interfaces:\x20','llmProject','join','\x20\x20Form\x20Interface\x20\x22','counts','Dry\x20run\x20-\x20no\x20files\x20written','Output:\x20','\x0aPush\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Project:\x20','sourceProjectName','\x20\x20Integrations:\x20','\x0aChanges:','\x20\x20Agent\x20\x22','\x20\x20Agents:\x20','Pushing\x20agent\x20from\x20\x22','total','cloneProject','formInterfaces','Summary:'];a4_0x3c74=function(){return _0x24876d;};return a4_0x3c74();}const a4_0x1f9977=a4_0x1da7;(function(_0x4abae6,_0x2f5b77){const _0x56fe72=a4_0x1da7,_0x390225=_0x4abae6();while(!![]){try{const _0x39aea8=parseInt(_0x56fe72(0x203))/0x1+parseInt(_0x56fe72(0x209))/0x2+parseInt(_0x56fe72(0x1fd))/0x3*(-parseInt(_0x56fe72(0x216))/0x4)+parseInt(_0x56fe72(0x1c5))/0x5*(parseInt(_0x56fe72(0x1b1))/0x6)+-parseInt(_0x56fe72(0x1c6))/0x7*(parseInt(_0x56fe72(0x193))/0x8)+-parseInt(_0x56fe72(0x184))/0x9+parseInt(_0x56fe72(0x19f))/0xa*(parseInt(_0x56fe72(0x202))/0xb);if(_0x39aea8===_0x2f5b77)break;else _0x390225['push'](_0x390225['shift']());}catch(_0x3d5417){_0x390225['push'](_0x390225['shift']());}}}(a4_0x3c74,0x37738));import a4_0xe874cd from'chalk';import a4_0x5303ac 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 a4_0x1da7(_0x591388,_0x2e62cc){_0x591388=_0x591388-0x16e;const _0x3c74ff=a4_0x3c74();let _0x1da769=_0x3c74ff[_0x591388];return _0x1da769;}function formatCountSummary(_0x482d62){const _0x139628=a4_0x1da7,_0x4cd888=[];if(_0x482d62[_0x139628(0x1ee)]!==undefined)_0x4cd888[_0x139628(0x19e)](_0x482d62[_0x139628(0x1ee)]+_0x139628(0x21a));if(_0x482d62[_0x139628(0x1ae)]!==undefined&&_0x482d62[_0x139628(0x1ae)]>0x0)_0x4cd888[_0x139628(0x19e)](a4_0xe874cd[_0x139628(0x18c)](_0x482d62[_0x139628(0x1ae)]+_0x139628(0x220)));if(_0x482d62[_0x139628(0x1dc)]!==undefined&&_0x482d62['created']>0x0)_0x4cd888[_0x139628(0x19e)](a4_0xe874cd[_0x139628(0x18c)](_0x482d62['created']+_0x139628(0x1d1)));if(_0x482d62[_0x139628(0x1a3)]!==undefined&&_0x482d62[_0x139628(0x1a3)]>0x0)_0x4cd888[_0x139628(0x19e)](a4_0xe874cd['yellow'](_0x482d62[_0x139628(0x1a3)]+'\x20updated'));if(_0x482d62[_0x139628(0x1d2)]!==undefined&&_0x482d62['unchanged']>0x0)_0x4cd888[_0x139628(0x19e)](a4_0xe874cd[_0x139628(0x1d5)](_0x482d62['unchanged']+_0x139628(0x1c3)));if(_0x482d62[_0x139628(0x191)]!==undefined&&_0x482d62[_0x139628(0x191)]>0x0)_0x4cd888[_0x139628(0x19e)](a4_0xe874cd[_0x139628(0x186)](_0x482d62[_0x139628(0x191)]+_0x139628(0x1b0)));return _0x4cd888[_0x139628(0x1df)](',\x20');}function displayDiffs(_0xeadab4,_0x5dbaae,_0x367c63,_0x22e2fc,_0x4c23f4,_0x485707,_0x30f2ad,_0x4b16b6,_0x480b68){const _0x378447=a4_0x1da7;for(const _0x5ec2fc of _0xeadab4){if(_0x5ec2fc['diff']){const _0x271e48=_0x5ec2fc[_0x378447(0x18a)]||_0x5ec2fc['name'];console[_0x378447(0x1d3)](_0x378447(0x1fa)+_0x271e48+'\x27:'),console[_0x378447(0x1d3)]('─'[_0x378447(0x1f2)](0x3c)),console[_0x378447(0x1d3)](_0x5ec2fc['diff']),console[_0x378447(0x1d3)]('─'[_0x378447(0x1f2)](0x3c));}}for(const _0x5df9f6 of _0x5dbaae){_0x5df9f6[_0x378447(0x20d)]&&(console[_0x378447(0x1d3)](_0x378447(0x1b4)+_0x5df9f6['name']+'\x27:'),console[_0x378447(0x1d3)]('─'['repeat'](0x3c)),console[_0x378447(0x1d3)](_0x5df9f6['diff']),console[_0x378447(0x1d3)]('─'[_0x378447(0x1f2)](0x3c)));}for(const _0x2fa77e of _0x367c63){_0x2fa77e[_0x378447(0x20d)]&&(console['log'](_0x378447(0x1c9)+_0x2fa77e[_0x378447(0x1b2)]+'\x27:'),console['log']('─'[_0x378447(0x1f2)](0x3c)),console[_0x378447(0x1d3)](_0x2fa77e[_0x378447(0x20d)]),console[_0x378447(0x1d3)]('─'[_0x378447(0x1f2)](0x3c)));}for(const _0x54acd6 of _0x22e2fc){_0x54acd6[_0x378447(0x20d)]&&(console[_0x378447(0x1d3)](_0x378447(0x195)+_0x54acd6[_0x378447(0x1b2)]+'\x27:'),console[_0x378447(0x1d3)]('─'[_0x378447(0x1f2)](0x3c)),console['log'](_0x54acd6['diff']),console[_0x378447(0x1d3)]('─'[_0x378447(0x1f2)](0x3c)));}for(const _0x527bae of _0x4c23f4){_0x527bae[_0x378447(0x20d)]&&(console[_0x378447(0x1d3)](_0x378447(0x208)+_0x527bae[_0x378447(0x1b2)]+'\x27:'),console[_0x378447(0x1d3)]('─'[_0x378447(0x1f2)](0x3c)),console[_0x378447(0x1d3)](_0x527bae[_0x378447(0x20d)]),console[_0x378447(0x1d3)]('─'[_0x378447(0x1f2)](0x3c)));}for(const _0x56ba52 of _0x485707){_0x56ba52[_0x378447(0x20d)]&&(console['log'](_0x378447(0x180)+_0x56ba52[_0x378447(0x1b2)]+'\x27:'),console[_0x378447(0x1d3)]('─'[_0x378447(0x1f2)](0x3c)),console[_0x378447(0x1d3)](_0x56ba52[_0x378447(0x20d)]),console[_0x378447(0x1d3)]('─'[_0x378447(0x1f2)](0x3c)));}for(const _0x56c5c3 of _0x30f2ad){_0x56c5c3[_0x378447(0x20d)]&&(console[_0x378447(0x1d3)](_0x378447(0x223)+_0x56c5c3[_0x378447(0x1b2)]+'\x27:'),console[_0x378447(0x1d3)]('─'[_0x378447(0x1f2)](0x3c)),console['log'](_0x56c5c3[_0x378447(0x20d)]),console['log']('─'[_0x378447(0x1f2)](0x3c)));}for(const _0x18b150 of _0x4b16b6){_0x18b150[_0x378447(0x20d)]&&(console[_0x378447(0x1d3)](_0x378447(0x1fb)+_0x18b150[_0x378447(0x1b2)]+'\x27:'),console['log']('─'[_0x378447(0x1f2)](0x3c)),console[_0x378447(0x1d3)](_0x18b150['diff']),console['log']('─'[_0x378447(0x1f2)](0x3c)));}for(const _0x1d097c of _0x480b68){_0x1d097c[_0x378447(0x20d)]&&(console[_0x378447(0x1d3)](_0x378447(0x1db)+_0x1d097c[_0x378447(0x1b2)]+'\x27:'),console[_0x378447(0x1d3)]('─'[_0x378447(0x1f2)](0x3c)),console[_0x378447(0x1d3)](_0x1d097c[_0x378447(0x20d)]),console['log']('─'[_0x378447(0x1f2)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';[a4_0x1f9977(0x1b8)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x1f9977(0x1da)](_0x277455){const _0xbefb34=a4_0x1f9977,{options:_0x35a769,args:_0x3171ed,tdx:_0x50558a}=_0x277455,_0x12e282=_0x3171ed[0x0],_0x250ad1=_0x3171ed[0x1],_0x49c83f=_0x35a769[_0xbefb34(0x224)],_0x453e87=_0x35a769['dryRun'],_0x1f5893=_0x35a769['force'],_0x4b3ae9=_0x35a769['yes'],_0x3f98d0=_0x35a769[_0xbefb34(0x1de)],_0x4cf414=_0x35a769[_0xbefb34(0x18f)];let _0x4fed24;if(_0x12e282){const _0x412357=a4_0x5303ac['join'](_0x12e282,'tdx.json');if(existsSync(_0x412357))try{const _0x3ffc98=JSON[_0xbefb34(0x1cd)](readFileSync(_0x412357,_0xbefb34(0x1a7)));_0x3ffc98[_0xbefb34(0x1f5)]&&(_0x4fed24={'llm_project':_0x3ffc98[_0xbefb34(0x1f5)]});}catch{}}const _0x1feb4d=findAgentConfigPath(process[_0xbefb34(0x199)]());let _0xdbf453;if(_0x1feb4d)try{const _0x27483b=JSON[_0xbefb34(0x1cd)](readFileSync(_0x1feb4d,_0xbefb34(0x1a7)));_0x27483b[_0xbefb34(0x1f5)]&&(_0xdbf453={'llm_project':_0x27483b['llm_project']});}catch{}const _0x19bd97=resolveAgentPullArgs({'arg':_0x12e282,'agentNameArg':_0x250ad1,'agentFlag':_0x4cf414,'contextProject':_0x3f98d0,'argDirConfig':_0x4fed24,'cwdConfigPath':_0x1feb4d||undefined,'cwdConfig':_0xdbf453}),{projectNameOrId:_0x2528ab,targetAgentName:_0x4255e6,existingOutputDir:_0x39615b,source:_0x1a10e5}=_0x19bd97;if(_0x1a10e5===_0xbefb34(0x1f7))console[_0xbefb34(0x1d3)](a4_0xe874cd[_0xbefb34(0x179)](_0xbefb34(0x1f6)+a4_0x5303ac[_0xbefb34(0x1df)](_0x12e282,_0xbefb34(0x205))+':\x20'+_0x2528ab));else{if(_0x1a10e5==='cwd-config')console[_0xbefb34(0x1d3)](a4_0xe874cd[_0xbefb34(0x179)]('Using\x20project:\x20'+_0x2528ab));else _0x1a10e5==='context'&&console[_0xbefb34(0x1d3)](a4_0xe874cd[_0xbefb34(0x179)](_0xbefb34(0x1fe)+_0x2528ab));}if(!_0x2528ab)return _0x4cf414?(console['log'](a4_0xe874cd[_0xbefb34(0x1d6)](_0xbefb34(0x1b6))),console[_0xbefb34(0x1d3)](_0xbefb34(0x22a)),console[_0xbefb34(0x1d3)](_0xbefb34(0x1bb))):(console[_0xbefb34(0x1d3)](a4_0xe874cd[_0xbefb34(0x1d6)](_0xbefb34(0x19b))),console[_0xbefb34(0x1d3)]('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0xbefb34(0x1d3)](_0xbefb34(0x1e5)),console[_0xbefb34(0x1d3)](_0xbefb34(0x20c)),console[_0xbefb34(0x1d3)](_0xbefb34(0x1ac)),console[_0xbefb34(0x1d3)](_0xbefb34(0x170))),0x1;if(_0x4255e6){const {data:_0xdb5fa0}=await withSpinner(_0xbefb34(0x227)+_0x4255e6+_0xbefb34(0x214)+_0x2528ab+_0xbefb34(0x204),()=>_0x50558a[_0xbefb34(0x1af)]['pullAgent'](_0x2528ab,_0x4255e6,_0x49c83f,{'dryRun':_0x453e87,'force':_0x1f5893}));if(_0x453e87)return console[_0xbefb34(0x1d3)](a4_0xe874cd[_0xbefb34(0x1d6)](_0xbefb34(0x1e2))),console[_0xbefb34(0x1d3)](_0xbefb34(0x1bd)+_0xdb5fa0['agentName']),console['log']('Output\x20path:\x20'+_0xdb5fa0[_0xbefb34(0x197)]),_0xdb5fa0[_0xbefb34(0x20d)]&&(console[_0xbefb34(0x1d3)](_0xbefb34(0x1ea)),console[_0xbefb34(0x1d3)]('─'[_0xbefb34(0x1f2)](0x3c)),console[_0xbefb34(0x1d3)](_0xdb5fa0[_0xbefb34(0x20d)]),console[_0xbefb34(0x1d3)]('─'[_0xbefb34(0x1f2)](0x3c))),0x0;return console[_0xbefb34(0x1d3)](a4_0xe874cd['green'](_0xbefb34(0x18b))),console['log']('Agent:\x20'+_0xdb5fa0[_0xbefb34(0x18a)]),console[_0xbefb34(0x1d3)](_0xbefb34(0x1e3)+_0xdb5fa0['outputPath']),console[_0xbefb34(0x1d3)](_0xbefb34(0x16e)+(_0xdb5fa0[_0xbefb34(0x172)]?a4_0xe874cd[_0xbefb34(0x18c)](_0xbefb34(0x1ae)):_0xdb5fa0[_0xbefb34(0x226)]?a4_0xe874cd['yellow'](_0xbefb34(0x1a3)):a4_0xe874cd[_0xbefb34(0x1d5)]('unchanged'))),0x0;}const _0x3cc875=_0x39615b||_0x49c83f,{data:_0x4ebf7b}=await withSpinner(_0xbefb34(0x1f3)+_0x2528ab+_0xbefb34(0x204),()=>_0x50558a[_0xbefb34(0x1af)][_0xbefb34(0x1a4)](_0x2528ab,_0x3cc875,{'dryRun':!![]})),_0x19ecda=_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x221)]['new']+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x21c)][_0xbefb34(0x1ae)]+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x1d8)][_0xbefb34(0x1ae)]+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x19c)][_0xbefb34(0x1ae)]+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x192)][_0xbefb34(0x1ae)]+_0x4ebf7b[_0xbefb34(0x1e1)]['experimentalKnowledgeBases'][_0xbefb34(0x1ae)]+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x1b9)][_0xbefb34(0x1ae)]+_0x4ebf7b['counts'][_0xbefb34(0x1f0)][_0xbefb34(0x1ae)]+_0x4ebf7b[_0xbefb34(0x1e1)]['chatInterfaces'][_0xbefb34(0x1ae)],_0x409d82=_0x4ebf7b[_0xbefb34(0x1e1)]['agents'][_0xbefb34(0x1a3)]+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x21c)][_0xbefb34(0x1a3)]+_0x4ebf7b[_0xbefb34(0x1e1)]['textKnowledgeBases'][_0xbefb34(0x1a3)]+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x19c)][_0xbefb34(0x1a3)]+_0x4ebf7b['counts']['integrations'][_0xbefb34(0x1a3)]+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x1be)][_0xbefb34(0x1a3)]+_0x4ebf7b[_0xbefb34(0x1e1)]['experimentalArtifacts'][_0xbefb34(0x1a3)]+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x1f0)][_0xbefb34(0x1a3)]+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x185)][_0xbefb34(0x1a3)],_0x1b841a=_0x4ebf7b[_0xbefb34(0x1e1)]['agents'][_0xbefb34(0x1d2)]+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x21c)][_0xbefb34(0x1d2)]+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x1d8)][_0xbefb34(0x1d2)]+_0x4ebf7b[_0xbefb34(0x1e1)]['prompts']['unchanged']+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x192)]['unchanged']+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x1be)][_0xbefb34(0x1d2)]+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x1b9)]['unchanged']+_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x1f0)]['unchanged']+_0x4ebf7b[_0xbefb34(0x1e1)]['chatInterfaces'][_0xbefb34(0x1d2)];console[_0xbefb34(0x1d3)]('\x0aPull\x20summary\x20for\x20\x27'+_0x4ebf7b[_0xbefb34(0x1f9)]+'\x27:'),console[_0xbefb34(0x1d3)]('\x20\x20'+a4_0xe874cd[_0xbefb34(0x18c)]('+\x20'+_0x19ecda+_0xbefb34(0x220))+'\x20|\x20'+a4_0xe874cd[_0xbefb34(0x1d6)]('~\x20'+_0x409d82+_0xbefb34(0x215))+_0xbefb34(0x1a9)+a4_0xe874cd['dim']('=\x20'+_0x1b841a+_0xbefb34(0x1c3))),console['log'](_0xbefb34(0x1ec)+formatCountSummary(_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x221)])),console[_0xbefb34(0x1d3)](_0xbefb34(0x18d)+formatCountSummary(_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x21c)])),console[_0xbefb34(0x1d3)](_0xbefb34(0x173)+formatCountSummary(_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x1d8)])),console[_0xbefb34(0x1d3)](_0xbefb34(0x17b)+formatCountSummary(_0x4ebf7b[_0xbefb34(0x1e1)]['prompts'])),console[_0xbefb34(0x1d3)](_0xbefb34(0x1e9)+formatCountSummary(_0x4ebf7b[_0xbefb34(0x1e1)]['integrations'])),console[_0xbefb34(0x1d3)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x4ebf7b[_0xbefb34(0x1e1)]['formInterfaces'])),console[_0xbefb34(0x1d3)](_0xbefb34(0x1dd)+formatCountSummary(_0x4ebf7b[_0xbefb34(0x1e1)]['chatInterfaces']));const _0x29d042=_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x1be)][_0xbefb34(0x1ee)]>0x0||_0x4ebf7b['counts'][_0xbefb34(0x1b9)][_0xbefb34(0x1ee)]>0x0;_0x29d042&&(console[_0xbefb34(0x1d3)](_0xbefb34(0x206)+formatCountSummary(_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x1be)])),console[_0xbefb34(0x1d3)](_0xbefb34(0x218)+formatCountSummary(_0x4ebf7b[_0xbefb34(0x1e1)][_0xbefb34(0x1b9)])));console['log'](_0xbefb34(0x1bf)+a4_0xe874cd[_0xbefb34(0x1c0)](_0x4ebf7b['outputDir'])),displayDiffs(_0x4ebf7b['agents'],_0x4ebf7b['knowledgeBases'],_0x4ebf7b['textKnowledgeBases'],_0x4ebf7b[_0xbefb34(0x19c)],_0x4ebf7b[_0xbefb34(0x192)],_0x4ebf7b[_0xbefb34(0x1be)],_0x4ebf7b[_0xbefb34(0x1b9)],_0x4ebf7b[_0xbefb34(0x1f0)],_0x4ebf7b[_0xbefb34(0x185)]);if(_0x453e87)return console['log'](a4_0xe874cd[_0xbefb34(0x1d6)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x19ecda===0x0&&_0x409d82===0x0)return console['log'](a4_0xe874cd['green'](_0xbefb34(0x17d))),saveSessionContext({'llm_project':_0x4ebf7b[_0xbefb34(0x1f9)]},_0x35a769[_0xbefb34(0x174)]),console['log'](a4_0xe874cd[_0xbefb34(0x18c)](_0xbefb34(0x176)+a4_0xe874cd[_0xbefb34(0x179)](_0xbefb34(0x1f5))+_0xbefb34(0x18e)+a4_0xe874cd[_0xbefb34(0x1c0)](_0x4ebf7b['projectName']))),0x0;if(!_0x4b3ae9&&!_0x1f5893){if(!isInteractive())return console['error'](a4_0xe874cd[_0xbefb34(0x186)](_0xbefb34(0x1a2)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xbefb34(0x217)](a4_0xe874cd[_0xbefb34(0x179)](_0xbefb34(0x219))),0x1;const _0x175d70=await confirmKey('\x0aWrite\x20'+(_0x19ecda+_0x409d82)+_0xbefb34(0x22d));if(!_0x175d70)return console[_0xbefb34(0x1d3)](a4_0xe874cd[_0xbefb34(0x1d6)](_0xbefb34(0x1a0)),_0xbefb34(0x1c1)),0x1;}const {data:_0x4b8b3c}=await withSpinner('Writing\x20files...',()=>_0x50558a[_0xbefb34(0x1af)][_0xbefb34(0x1a4)](_0x2528ab,_0x3cc875,{'force':_0x1f5893}));return console[_0xbefb34(0x1d3)](a4_0xe874cd['green'](_0xbefb34(0x1f4)+(_0x19ecda+_0x409d82)+_0xbefb34(0x177)+_0x4b8b3c[_0xbefb34(0x196)])),saveSessionContext({'llm_project':_0x4b8b3c['projectName']},_0x35a769[_0xbefb34(0x174)]),console[_0xbefb34(0x1d3)](a4_0xe874cd[_0xbefb34(0x18c)](_0xbefb34(0x176)+a4_0xe874cd[_0xbefb34(0x179)](_0xbefb34(0x1f5))+_0xbefb34(0x18e)+a4_0xe874cd[_0xbefb34(0x1c0)](_0x4b8b3c[_0xbefb34(0x1f9)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x1f9977(0x1b2)]='agent:clone';['description']=a4_0x1f9977(0x201);async[a4_0x1f9977(0x1da)](_0x2d5766){const _0x2749d3=a4_0x1f9977,{options:_0x59bcba,args:_0x107ad7,tdx:_0x507f21}=_0x2d5766,_0x37e216=_0x107ad7[0x0],_0x115380=_0x59bcba['name'],_0xff63a3=_0x59bcba[_0x2749d3(0x1c8)],_0x2bc007=_0x59bcba['yes'],_0x352ce0=_0x59bcba['site'],_0x47c62c=_0x59bcba[_0x2749d3(0x1de)];let _0x240d4b;const _0x4b0893=findAgentConfigPath(process['cwd']());if(_0x37e216){const _0x4a212b=a4_0x5303ac[_0x2749d3(0x1df)](_0x37e216,'tdx.json');existsSync(_0x4a212b)?(_0x240d4b=_0x37e216,console['log'](a4_0xe874cd[_0x2749d3(0x179)](_0x2749d3(0x211)+_0x37e216))):_0x240d4b=_0x37e216;}else{if(_0x4b0893)_0x240d4b=a4_0x5303ac[_0x2749d3(0x175)](_0x4b0893),console['log'](a4_0xe874cd[_0x2749d3(0x179)](_0x2749d3(0x188)+_0x240d4b));else{if(_0x47c62c){const _0x4b24fb=sanitizeForFilesystem(_0x47c62c);let _0x164a08=_0x4b24fb,_0x7e7093=a4_0x5303ac[_0x2749d3(0x1df)](process[_0x2749d3(0x199)](),_0x2749d3(0x221),_0x4b24fb,_0x2749d3(0x205));if(!existsSync(_0x7e7093)){const _0x56eb2d=normalizeName(_0x47c62c),_0x57931a=a4_0x5303ac['join'](process[_0x2749d3(0x199)](),_0x2749d3(0x221),_0x56eb2d,_0x2749d3(0x205));existsSync(_0x57931a)&&(_0x164a08=_0x56eb2d,_0x7e7093=_0x57931a);}if(existsSync(_0x7e7093))_0x240d4b=a4_0x5303ac[_0x2749d3(0x175)](_0x7e7093),console['log'](a4_0xe874cd[_0x2749d3(0x179)](_0x2749d3(0x211)+_0x240d4b));else{const _0x50edbd=_0x59bcba[_0x2749d3(0x207)];if(_0x50edbd)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2749d3(0x22c)+_0x47c62c+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x2749d3(0x22b)+_0x2749d3(0x1ad)+(_0x2749d3(0x1ab)+_0x47c62c+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x164a08+_0x2749d3(0x194)+(_0x115380||_0x2749d3(0x1a1))+_0x2749d3(0x21d)+_0x50edbd)});_0x240d4b=_0x47c62c,console[_0x2749d3(0x1d3)](a4_0xe874cd[_0x2749d3(0x179)](_0x2749d3(0x1ba)+_0x47c62c));}}}}if(!_0x240d4b)return console[_0x2749d3(0x1d3)](a4_0xe874cd[_0x2749d3(0x1d6)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x2749d3(0x1d3)](_0x2749d3(0x1e6)),console['log'](_0x2749d3(0x190)),console[_0x2749d3(0x1d3)](_0x2749d3(0x20a)),console[_0x2749d3(0x1d3)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x115380)throw new SDKError(ErrorCode[_0x2749d3(0x20e)],_0x2749d3(0x17c),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x2bc007&&!_0xff63a3){if(!isInteractive())return console[_0x2749d3(0x217)](a4_0xe874cd['red'](_0x2749d3(0x1a2)),_0x2749d3(0x210)),console[_0x2749d3(0x217)](a4_0xe874cd[_0x2749d3(0x179)](_0x2749d3(0x219))),0x1;const _0x14c5d6=await confirmKey(_0x2749d3(0x1a5)+_0x240d4b+_0x2749d3(0x21b)+_0x115380+'\x22?');if(!_0x14c5d6)return console[_0x2749d3(0x1d3)](a4_0xe874cd[_0x2749d3(0x1d6)](_0x2749d3(0x1a0))),0x1;}const {data:_0x1a4c17}=await withSpinner(_0x2749d3(0x1a6)+_0x240d4b+_0x2749d3(0x16f)+_0x115380+_0x2749d3(0x204),()=>_0x507f21[_0x2749d3(0x1af)][_0x2749d3(0x1ef)](_0x240d4b,_0x115380,{'dryRun':_0xff63a3}));if(_0xff63a3){console[_0x2749d3(0x1d3)](a4_0xe874cd[_0x2749d3(0x1d6)](_0x2749d3(0x200))),console[_0x2749d3(0x1d3)](_0x2749d3(0x1fc)+_0x1a4c17[_0x2749d3(0x1e8)]),console[_0x2749d3(0x1d3)](_0x2749d3(0x229)+_0x115380),console[_0x2749d3(0x1d3)]('Would\x20clone:'),console[_0x2749d3(0x1d3)](_0x2749d3(0x1ec)+_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x221)]['created']),console['log'](_0x2749d3(0x18d)+_0x1a4c17['counts'][_0x2749d3(0x21c)][_0x2749d3(0x1dc)]),console[_0x2749d3(0x1d3)](_0x2749d3(0x17b)+_0x1a4c17['counts'][_0x2749d3(0x19c)][_0x2749d3(0x1dc)]),console['log'](_0x2749d3(0x20b)+_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x1f0)][_0x2749d3(0x1dc)]),console[_0x2749d3(0x1d3)](_0x2749d3(0x1dd)+_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x185)][_0x2749d3(0x1dc)]);const _0x4dbc8f=_0x1a4c17['counts'][_0x2749d3(0x1be)][_0x2749d3(0x1dc)]>0x0||_0x1a4c17['counts'][_0x2749d3(0x1b9)][_0x2749d3(0x1dc)]>0x0;return _0x4dbc8f&&(console[_0x2749d3(0x1d3)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x1a4c17[_0x2749d3(0x1e1)]['experimentalKnowledgeBases'][_0x2749d3(0x1dc)]),console['log'](_0x2749d3(0x218)+_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x1b9)][_0x2749d3(0x1dc)])),0x0;}const _0x23594e=_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x221)][_0x2749d3(0x191)]>0x0||_0x1a4c17['counts'][_0x2749d3(0x21c)][_0x2749d3(0x191)]>0x0||_0x1a4c17['counts'][_0x2749d3(0x19c)]['errors']>0x0||_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x1f0)][_0x2749d3(0x191)]>0x0||_0x1a4c17['counts'][_0x2749d3(0x185)][_0x2749d3(0x191)]>0x0||_0x1a4c17['counts']['experimentalKnowledgeBases'][_0x2749d3(0x191)]>0x0||_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x1b9)][_0x2749d3(0x191)]>0x0;_0x23594e?console[_0x2749d3(0x1d3)](a4_0xe874cd[_0x2749d3(0x1d6)](_0x2749d3(0x1ca))):console[_0x2749d3(0x1d3)](a4_0xe874cd[_0x2749d3(0x18c)]('Project\x20cloned\x20successfully'));console[_0x2749d3(0x1d3)](_0x2749d3(0x1fc)+_0x1a4c17[_0x2749d3(0x1e8)]),console[_0x2749d3(0x1d3)]('New\x20project:\x20'+_0x1a4c17['newProjectName']),console[_0x2749d3(0x1d3)](_0x2749d3(0x198)+_0x1a4c17[_0x2749d3(0x1d4)]),console[_0x2749d3(0x1d3)](),console[_0x2749d3(0x1d3)](_0x2749d3(0x1f1)),console['log'](_0x2749d3(0x1ec)+formatCountSummary(_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x221)])),console[_0x2749d3(0x1d3)](_0x2749d3(0x18d)+formatCountSummary(_0x1a4c17[_0x2749d3(0x1e1)]['knowledgeBases'])),console[_0x2749d3(0x1d3)](_0x2749d3(0x17b)+formatCountSummary(_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x19c)])),console[_0x2749d3(0x1d3)](_0x2749d3(0x1e9)+formatCountSummary(_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x192)])),console[_0x2749d3(0x1d3)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x1a4c17['counts'][_0x2749d3(0x1f0)])),console[_0x2749d3(0x1d3)](_0x2749d3(0x1dd)+formatCountSummary(_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x185)]));const _0x406ce2=_0x1a4c17['counts'][_0x2749d3(0x1be)][_0x2749d3(0x1dc)]>0x0||_0x1a4c17['counts'][_0x2749d3(0x1be)]['updated']>0x0||_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x1be)]['unchanged']>0x0||_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x1b9)][_0x2749d3(0x1dc)]>0x0||_0x1a4c17[_0x2749d3(0x1e1)]['experimentalArtifacts']['updated']>0x0||_0x1a4c17['counts']['experimentalArtifacts'][_0x2749d3(0x1d2)]>0x0;_0x406ce2&&(console[_0x2749d3(0x1d3)](_0x2749d3(0x206)+formatCountSummary(_0x1a4c17['counts'][_0x2749d3(0x1be)])),console[_0x2749d3(0x1d3)](_0x2749d3(0x218)+formatCountSummary(_0x1a4c17[_0x2749d3(0x1e1)][_0x2749d3(0x1b9)])));if(_0x23594e){console[_0x2749d3(0x1d3)](),console['log'](a4_0xe874cd[_0x2749d3(0x186)](_0x2749d3(0x1b3)));for(const _0x27d3cb of _0x1a4c17[_0x2749d3(0x221)]){_0x27d3cb[_0x2749d3(0x183)]===_0x2749d3(0x217)&&console[_0x2749d3(0x1d3)](a4_0xe874cd[_0x2749d3(0x186)]('\x20\x20Agent\x20\x22'+_0x27d3cb[_0x2749d3(0x18a)]+_0x2749d3(0x17a)+_0x27d3cb[_0x2749d3(0x217)]));}for(const _0x2b9563 of _0x1a4c17[_0x2749d3(0x21c)]){_0x2b9563[_0x2749d3(0x183)]==='error'&&console[_0x2749d3(0x1d3)](a4_0xe874cd['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x2b9563[_0x2749d3(0x1b2)]+_0x2749d3(0x17a)+_0x2b9563[_0x2749d3(0x217)]));}for(const _0x31be05 of _0x1a4c17[_0x2749d3(0x19c)]){_0x31be05[_0x2749d3(0x183)]===_0x2749d3(0x217)&&console['log'](a4_0xe874cd[_0x2749d3(0x186)]('\x20\x20Prompt\x20\x22'+_0x31be05[_0x2749d3(0x1b2)]+_0x2749d3(0x17a)+_0x31be05[_0x2749d3(0x217)]));}for(const _0x1d241d of _0x1a4c17[_0x2749d3(0x192)]){_0x1d241d[_0x2749d3(0x183)]===_0x2749d3(0x217)&&console[_0x2749d3(0x1d3)](a4_0xe874cd[_0x2749d3(0x186)]('\x20\x20Integration\x20\x22'+_0x1d241d[_0x2749d3(0x1b2)]+'\x22:\x20'+_0x1d241d['error']));}for(const _0x3f7266 of _0x1a4c17[_0x2749d3(0x1f0)]){_0x3f7266[_0x2749d3(0x183)]===_0x2749d3(0x217)&&console['log'](a4_0xe874cd[_0x2749d3(0x186)]('\x20\x20Form\x20Interface\x20\x22'+_0x3f7266['name']+_0x2749d3(0x17a)+_0x3f7266[_0x2749d3(0x217)]));}for(const _0xb53fc9 of _0x1a4c17[_0x2749d3(0x185)]){_0xb53fc9[_0x2749d3(0x183)]===_0x2749d3(0x217)&&console['log'](a4_0xe874cd['red'](_0x2749d3(0x1cc)+_0xb53fc9['name']+_0x2749d3(0x17a)+_0xb53fc9[_0x2749d3(0x217)]));}for(const _0x4f9ce8 of _0x1a4c17[_0x2749d3(0x1be)]){_0x4f9ce8[_0x2749d3(0x183)]===_0x2749d3(0x217)&&console[_0x2749d3(0x1d3)](a4_0xe874cd['red']('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x4f9ce8[_0x2749d3(0x1b2)]+_0x2749d3(0x17a)+_0x4f9ce8[_0x2749d3(0x217)]));}for(const _0x10653e of _0x1a4c17[_0x2749d3(0x1b9)]){_0x10653e[_0x2749d3(0x183)]===_0x2749d3(0x217)&&console[_0x2749d3(0x1d3)](a4_0xe874cd[_0x2749d3(0x186)](_0x2749d3(0x178)+_0x10653e['name']+_0x2749d3(0x17a)+_0x10653e[_0x2749d3(0x217)]));}return 0x1;}console[_0x2749d3(0x1d3)]();const _0x1f7951=getLLMProjectUrl(_0x352ce0,_0x1a4c17[_0x2749d3(0x1d4)]);return console[_0x2749d3(0x1d3)](_0x2749d3(0x1e7)+a4_0xe874cd[_0x2749d3(0x1c0)](_0x1f7951)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x1f9977(0x1b2)]=a4_0x1f9977(0x181);[a4_0x1f9977(0x1b8)]=a4_0x1f9977(0x1c4);async['execute'](_0x426e26){const _0x2dcf7b=a4_0x1f9977,{options:_0x2c962e,args:_0x543da4,tdx:_0x2d61cf}=_0x426e26;let _0x2c02e4=_0x543da4[0x0]||process[_0x2dcf7b(0x199)]();const _0x406e80=_0x2c962e[_0x2dcf7b(0x1c8)],_0x3126de=_0x2c962e['force'],_0x46fd42=_0x2c962e[_0x2dcf7b(0x189)],_0x660154=_0x2c962e[_0x2dcf7b(0x21f)],_0x25df65=a4_0x5303ac[_0x2dcf7b(0x1df)](_0x2c02e4,'agent.yml'),_0x38bf14=existsSync(_0x25df65);if(_0x38bf14){const {data:_0x33529f}=await withSpinner(_0x2dcf7b(0x1ed)+_0x2c02e4+_0x2dcf7b(0x204),()=>_0x2d61cf[_0x2dcf7b(0x1af)]['pushAgent'](_0x2c02e4,{'dryRun':_0x406e80,'force':_0x3126de}));if(_0x406e80)return console[_0x2dcf7b(0x1d3)](a4_0xe874cd['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x17f)+_0x33529f['agentName']),0x0;if(_0x33529f[_0x2dcf7b(0x183)]===_0x2dcf7b(0x217))return console[_0x2dcf7b(0x1d3)](a4_0xe874cd[_0x2dcf7b(0x186)](_0x2dcf7b(0x19a)+_0x33529f[_0x2dcf7b(0x217)])),0x1;console['log'](a4_0xe874cd[_0x2dcf7b(0x18c)]('Agent\x20'+_0x33529f['action']+'\x20successfully')),console['log'](_0x2dcf7b(0x171)+_0x33529f[_0x2dcf7b(0x18a)]);if(_0x33529f['agentId']&&_0x33529f[_0x2dcf7b(0x1b5)]){const _0x56ba53=getLLMAgentChatUrl(_0x660154,_0x33529f[_0x2dcf7b(0x1b5)],_0x33529f[_0x2dcf7b(0x1c2)]);console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x1cb)+a4_0xe874cd[_0x2dcf7b(0x1c0)](_0x56ba53));}return 0x0;}const _0x2f9a3d=_0x2c962e[_0x2dcf7b(0x1de)],_0x1e385a=resolveProjectFromContext(_0x2c02e4,_0x2f9a3d);if(_0x1e385a[_0x2dcf7b(0x1cf)])_0x2c02e4=_0x1e385a['projectDir'],_0x1e385a['source']===_0x2dcf7b(0x17e)&&console[_0x2dcf7b(0x1d3)](a4_0xe874cd['dim'](_0x2dcf7b(0x1ce)+_0x2c02e4));else{let _0x1f20e7=_0x2dcf7b(0x1ff);_0x1e385a[_0x2dcf7b(0x187)]===_0x2dcf7b(0x213)&&(_0x1f20e7=_0x1e385a[_0x2dcf7b(0x1d0)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x1e385a['llmProject']+_0x2dcf7b(0x182));throw new SDKError(ErrorCode[_0x2dcf7b(0x1aa)],_0x1e385a[_0x2dcf7b(0x187)]===_0x2dcf7b(0x222)?_0x1e385a[_0x2dcf7b(0x1d0)]:_0x2dcf7b(0x1c7)+_0x2c02e4,undefined,{'helpText':_0x1f20e7});}const {data:_0x22df4a}=await withSpinner(_0x2dcf7b(0x19d),()=>_0x2d61cf[_0x2dcf7b(0x1af)][_0x2dcf7b(0x1a8)](_0x2c02e4,{'dryRun':!![]})),_0x47a766=_0x22df4a[_0x2dcf7b(0x1e1)]['agents'][_0x2dcf7b(0x191)]>0x0;if(_0x47a766){console['log'](a4_0xe874cd[_0x2dcf7b(0x186)]('\x0aErrors\x20found:'));for(const _0x518c52 of _0x22df4a[_0x2dcf7b(0x221)]){_0x518c52['action']==='error'&&console[_0x2dcf7b(0x1d3)](a4_0xe874cd[_0x2dcf7b(0x186)](_0x2dcf7b(0x1eb)+_0x518c52['agentName']+_0x2dcf7b(0x17a)+_0x518c52[_0x2dcf7b(0x217)]));}return 0x1;}const _0x3afc27=_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x221)]['created']+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x21c)][_0x2dcf7b(0x1dc)]+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1d8)][_0x2dcf7b(0x1dc)]+_0x22df4a[_0x2dcf7b(0x1e1)]['prompts'][_0x2dcf7b(0x1dc)]+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x192)][_0x2dcf7b(0x1dc)]+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1be)][_0x2dcf7b(0x1dc)]+_0x22df4a['counts']['experimentalArtifacts'][_0x2dcf7b(0x1dc)]+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1f0)][_0x2dcf7b(0x1dc)]+_0x22df4a['counts']['chatInterfaces']['created'],_0x119bd2=_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x221)][_0x2dcf7b(0x1a3)]+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x21c)][_0x2dcf7b(0x1a3)]+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1d8)][_0x2dcf7b(0x1a3)]+_0x22df4a[_0x2dcf7b(0x1e1)]['prompts'][_0x2dcf7b(0x1a3)]+_0x22df4a['counts'][_0x2dcf7b(0x192)][_0x2dcf7b(0x1a3)]+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1be)][_0x2dcf7b(0x1a3)]+_0x22df4a['counts'][_0x2dcf7b(0x1b9)][_0x2dcf7b(0x1a3)]+_0x22df4a[_0x2dcf7b(0x1e1)]['formInterfaces'][_0x2dcf7b(0x1a3)]+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x185)][_0x2dcf7b(0x1a3)],_0x1ce19e=_0x22df4a[_0x2dcf7b(0x1e1)]['agents']['unchanged']+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x21c)][_0x2dcf7b(0x1d2)]+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1d8)]['unchanged']+_0x22df4a[_0x2dcf7b(0x1e1)]['prompts'][_0x2dcf7b(0x1d2)]+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x192)]['unchanged']+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1be)]['unchanged']+_0x22df4a[_0x2dcf7b(0x1e1)]['experimentalArtifacts'][_0x2dcf7b(0x1d2)]+_0x22df4a['counts']['formInterfaces'][_0x2dcf7b(0x1d2)]+_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x185)][_0x2dcf7b(0x1d2)];console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x1bc)+_0x22df4a[_0x2dcf7b(0x1f9)]+'\x27:'),console[_0x2dcf7b(0x1d3)]('\x20\x20'+a4_0xe874cd[_0x2dcf7b(0x18c)]('+\x20'+_0x3afc27+_0x2dcf7b(0x220))+_0x2dcf7b(0x1a9)+a4_0xe874cd['yellow']('~\x20'+_0x119bd2+_0x2dcf7b(0x215))+_0x2dcf7b(0x1a9)+a4_0xe874cd[_0x2dcf7b(0x179)]('=\x20'+_0x1ce19e+_0x2dcf7b(0x1c3))),console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x1ec)+formatCountSummary(_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x221)])),console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x18d)+formatCountSummary(_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x21c)])),console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x173)+formatCountSummary(_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1d8)])),console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x17b)+formatCountSummary(_0x22df4a[_0x2dcf7b(0x1e1)]['prompts'])),console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x1e9)+formatCountSummary(_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x192)])),console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x20b)+formatCountSummary(_0x22df4a['counts'][_0x2dcf7b(0x1f0)])),console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x1dd)+formatCountSummary(_0x22df4a['counts'][_0x2dcf7b(0x185)]));const _0x332f87=_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1be)][_0x2dcf7b(0x1dc)]>0x0||_0x22df4a['counts'][_0x2dcf7b(0x1be)]['updated']>0x0||_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1be)][_0x2dcf7b(0x1d2)]>0x0||_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1b9)][_0x2dcf7b(0x1dc)]>0x0||_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1b9)]['updated']>0x0||_0x22df4a[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1b9)][_0x2dcf7b(0x1d2)]>0x0;_0x332f87&&(console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x206)+formatCountSummary(_0x22df4a[_0x2dcf7b(0x1e1)]['experimentalKnowledgeBases'])),console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x218)+formatCountSummary(_0x22df4a['counts']['experimentalArtifacts'])));console[_0x2dcf7b(0x1d3)](_0x2dcf7b(0x212)+a4_0xe874cd[_0x2dcf7b(0x1c0)](_0x2c02e4)),displayDiffs(_0x22df4a[_0x2dcf7b(0x221)],_0x22df4a[_0x2dcf7b(0x21c)],_0x22df4a[_0x2dcf7b(0x1d8)],_0x22df4a[_0x2dcf7b(0x19c)],_0x22df4a['integrations'],_0x22df4a['experimentalKnowledgeBases'],_0x22df4a[_0x2dcf7b(0x1b9)],_0x22df4a[_0x2dcf7b(0x1f0)],_0x22df4a[_0x2dcf7b(0x185)]);if(_0x406e80)return console[_0x2dcf7b(0x1d3)](a4_0xe874cd[_0x2dcf7b(0x1d6)](_0x2dcf7b(0x21e))),0x0;if(_0x3afc27===0x0&&_0x119bd2===0x0){console[_0x2dcf7b(0x1d3)](a4_0xe874cd[_0x2dcf7b(0x18c)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x1d0c70=getLLMProjectUrl(_0x660154,_0x22df4a[_0x2dcf7b(0x1b5)]);return console['log'](_0x2dcf7b(0x1e7)+a4_0xe874cd[_0x2dcf7b(0x1c0)](_0x1d0c70)),0x0;}if(!_0x46fd42&&!_0x3126de){if(!isInteractive())return console['error'](a4_0xe874cd[_0x2dcf7b(0x186)](_0x2dcf7b(0x1a2)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2dcf7b(0x217)](a4_0xe874cd[_0x2dcf7b(0x179)](_0x2dcf7b(0x219))),0x1;const _0x16825a=await confirmKey(_0x2dcf7b(0x1e4)+(_0x3afc27+_0x119bd2)+_0x2dcf7b(0x22e));if(!_0x16825a)return console['log'](a4_0xe874cd[_0x2dcf7b(0x1d6)](_0x2dcf7b(0x1a0)),_0x2dcf7b(0x225)),0x1;}const {data:_0xa4e099}=await withSpinner(_0x2dcf7b(0x20f),()=>_0x2d61cf['llm']['pushProject'](_0x2c02e4,{'force':_0x3126de})),_0x428d4c=_0xa4e099[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x221)][_0x2dcf7b(0x191)]>0x0||_0xa4e099[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x21c)][_0x2dcf7b(0x191)]>0x0||_0xa4e099[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1d8)][_0x2dcf7b(0x191)]>0x0||_0xa4e099['counts'][_0x2dcf7b(0x19c)][_0x2dcf7b(0x191)]>0x0||_0xa4e099[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x1f0)][_0x2dcf7b(0x191)]>0x0||_0xa4e099[_0x2dcf7b(0x1e1)][_0x2dcf7b(0x185)][_0x2dcf7b(0x191)]>0x0;if(_0x428d4c){console[_0x2dcf7b(0x1d3)](a4_0xe874cd[_0x2dcf7b(0x1d6)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x2dcf7b(0x1d3)](),console[_0x2dcf7b(0x1d3)](a4_0xe874cd[_0x2dcf7b(0x186)]('Errors:'));for(const _0xb8cbc9 of _0xa4e099[_0x2dcf7b(0x221)]){_0xb8cbc9['action']==='error'&&console['log'](a4_0xe874cd[_0x2dcf7b(0x186)]('\x20\x20Agent\x20\x22'+_0xb8cbc9[_0x2dcf7b(0x18a)]+_0x2dcf7b(0x17a)+_0xb8cbc9['error']));}for(const _0x20ab53 of _0xa4e099[_0x2dcf7b(0x21c)]){_0x20ab53['action']==='error'&&console['log'](a4_0xe874cd['red'](_0x2dcf7b(0x1d7)+_0x20ab53[_0x2dcf7b(0x1b2)]+_0x2dcf7b(0x17a)+_0x20ab53[_0x2dcf7b(0x217)]));}for(const _0x1897d6 of _0xa4e099[_0x2dcf7b(0x1d8)]){_0x1897d6[_0x2dcf7b(0x183)]==='error'&&console[_0x2dcf7b(0x1d3)](a4_0xe874cd[_0x2dcf7b(0x186)](_0x2dcf7b(0x1f8)+_0x1897d6['name']+_0x2dcf7b(0x17a)+_0x1897d6[_0x2dcf7b(0x217)]));}for(const _0x468740 of _0xa4e099[_0x2dcf7b(0x19c)]){_0x468740[_0x2dcf7b(0x183)]===_0x2dcf7b(0x217)&&console[_0x2dcf7b(0x1d3)](a4_0xe874cd[_0x2dcf7b(0x186)](_0x2dcf7b(0x1d9)+_0x468740['name']+_0x2dcf7b(0x17a)+_0x468740[_0x2dcf7b(0x217)]));}for(const _0x59056d of _0xa4e099[_0x2dcf7b(0x192)]){_0x59056d[_0x2dcf7b(0x183)]===_0x2dcf7b(0x217)&&console['log'](a4_0xe874cd['red'](_0x2dcf7b(0x228)+_0x59056d[_0x2dcf7b(0x1b2)]+_0x2dcf7b(0x17a)+_0x59056d[_0x2dcf7b(0x217)]));}for(const _0x721aa8 of _0xa4e099['formInterfaces']){_0x721aa8[_0x2dcf7b(0x183)]===_0x2dcf7b(0x217)&&console['log'](a4_0xe874cd['red'](_0x2dcf7b(0x1e0)+_0x721aa8['name']+_0x2dcf7b(0x17a)+_0x721aa8[_0x2dcf7b(0x217)]));}for(const _0x16897c of _0xa4e099[_0x2dcf7b(0x185)]){_0x16897c['action']==='error'&&console[_0x2dcf7b(0x1d3)](a4_0xe874cd[_0x2dcf7b(0x186)]('\x20\x20Chat\x20Interface\x20\x22'+_0x16897c[_0x2dcf7b(0x1b2)]+_0x2dcf7b(0x17a)+_0x16897c[_0x2dcf7b(0x217)]));}return 0x1;}console[_0x2dcf7b(0x1d3)](a4_0xe874cd[_0x2dcf7b(0x18c)](_0x2dcf7b(0x1b7)+(_0x3afc27+_0x119bd2)+'\x20resources\x20to\x20\x27'+_0xa4e099[_0x2dcf7b(0x1f9)]+'\x27'));const _0x56c4ee=getLLMProjectUrl(_0x660154,_0xa4e099[_0x2dcf7b(0x1b5)]);return console[_0x2dcf7b(0x1d3)]('Project:\x20'+a4_0xe874cd[_0x2dcf7b(0x1c0)](_0x56c4ee)),0x0;}}
1
+ const a4_0x4e85d1=a4_0x35e5;(function(_0x1ee4fe,_0x10e81a){const _0x18d610=a4_0x35e5,_0x705e00=_0x1ee4fe();while(!![]){try{const _0x1de0f2=-parseInt(_0x18d610(0x1c8))/0x1+parseInt(_0x18d610(0x162))/0x2+parseInt(_0x18d610(0x1c5))/0x3+-parseInt(_0x18d610(0x180))/0x4+parseInt(_0x18d610(0x18a))/0x5+-parseInt(_0x18d610(0x175))/0x6+parseInt(_0x18d610(0x161))/0x7;if(_0x1de0f2===_0x10e81a)break;else _0x705e00['push'](_0x705e00['shift']());}catch(_0x3053fa){_0x705e00['push'](_0x705e00['shift']());}}}(a4_0x358c,0x74018));import a4_0x584ae5 from'chalk';import a4_0xb9399 from'path';import{existsSync,readFileSync}from'fs';function a4_0x35e5(_0x10c590,_0x57c72f){_0x10c590=_0x10c590-0x151;const _0x358cfc=a4_0x358c();let _0x35e577=_0x358cfc[_0x10c590];return _0x35e577;}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';function a4_0x358c(){const _0x101daf=['agentId','INVALID_ARGUMENT','execute','<new-name>','push','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x20\x20tdx\x20agent\x20pull\x20','\x0aChanges\x20to\x20integration\x20\x27','agents','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20files\x20to\x20','force','dryRun','projectId','-\x20no\x20files\x20written','created','llm','Analyzing\x20project\x20\x22','\x20updated','description','pushProject','parse','\x0a✔\x20Pulled\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20changed','Dry\x20run\x20-\x20no\x20changes\x20made','output','Project\x20cloned\x20with\x20errors','Using\x20local\x20project:\x20','message','Output:\x20','\x0aChanges\x20to\x20chat\x20interface\x20\x27','Using\x20current\x20project:\x20','green','isNew','\x22\x20to\x20a\x20different\x20profile','Using\x20project\x20from\x20','539070XUlpPn','New\x20project\x20ID:\x20','integrations','406316HXmcYq','textKnowledgeBases','\x20new','dim','\x20\x20Prompt\x20\x22','\x20\x20tdx\x20agent\x20clone\x20agents/','outputPath','New\x20project\x20name\x20is\x20required','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Source:\x20','updated','errors','\x20resources\x20to\x20\x27','sourceProjectName','utf-8','Output\x20path:\x20','\x20errors','cwd','no_local_folder','\x0aPull\x20summary\x20for\x20\x27','repeat','\x20\x20Form\x20Interface\x20\x22','-\x20nothing\x20pushed','formInterfaces','\x20\x20Form\x20Interfaces:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x0aProject\x20pushed\x20with\x20errors','Using\x20project\x20from\x20context:\x20','New\x20project:\x20','\x22\x20to\x20new\x20project\x20\x22','Errors:','unchanged','Cloning\x20\x22','agentName','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20\x20Prompts:\x20','\x20resources?','\x0aPush\x20summary\x20for\x20\x27','Project\x20cloned\x20successfully','cloneProject','reason','site','\x20successfully','dirname','Writing\x20files...','prompts','\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)','\x0a✔\x20Pushed\x20','\x0aWrite\x20','Project:\x20','projectName','experimentalKnowledgeBases','\x0aError:','\x20=\x20','newProjectId','pullProject','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x22:\x20','\x22\x20from\x20project\x20\x22','log','No\x20tdx.json\x20found\x20in\x20','Failed\x20to\x20push\x20agent:\x20','context','\x20|\x20','\x20\x20Integrations:\x20','\x20\x20Chat\x20Interfaces:\x20','Agent\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','tdx.json','\x20--name\x20','\x20\x20Target:\x20','arg-dir','\x27\x20to\x20create\x20the\x20folder\x20structure.','llmProject','counts','agent:push','\x22...','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','experimentalArtifacts','\x20\x20Chat\x20Interface\x20\x22','new','action','knowledgeBases','Would\x20clone:','Analyzing\x20changes\x20to\x20push...','Chat:\x20','\x20\x20Integration\x20\x22','3538766hqQxvr','274700yBrUrQ','diff','Pushing\x20agent\x20from\x20\x22','\x0aChanges:','\x20\x20Agent\x20\x22','\x22\x20to\x20\x22','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','chatInterfaces','found','Pulling\x20agent\x20\x22','Would\x20push\x20agent:\x20','\x0aErrors\x20found:','\x20\x20Source:\x20','cyan','yellow','llm_project','\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','join','\x0aPush\x20','373266eHXJTP','pushAgent','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Agent:\x20','profile','\x20\x20Experimental\x20Artifacts:\x20','total','pullAgent','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Pushing\x20to\x20project...','\x20\x20Text\x20Knowledge\x20Bases:\x20','546364XVqVop','newProjectName','\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','source','hasChanges','\x20unchanged','Using\x20context\x20project:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Cannot\x20clone\x20from\x20context\x20project\x20\x22','cwd-config','1288500zZZOeE','error','\x20\x20Agents:\x20','Using\x20project:\x20','outputDir','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x0aChanges\x20to\x20agent\x20\x27','red','\x20\x20Knowledge\x20Bases:\x20','session','name','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','gray','✔\x20Context\x20set:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20files?','Dry\x20run\x20-\x20no\x20files\x20written','agent:pull','yes','Cancelled'];a4_0x358c=function(){return _0x101daf;};return a4_0x358c();}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x4099ba){const _0x2291a4=a4_0x35e5,_0x5d6bd4=[];if(_0x4099ba[_0x2291a4(0x17b)]!==undefined)_0x5d6bd4[_0x2291a4(0x1a4)](_0x4099ba['total']+'\x20total');if(_0x4099ba['new']!==undefined&&_0x4099ba[_0x2291a4(0x15a)]>0x0)_0x5d6bd4['push'](a4_0x584ae5[_0x2291a4(0x1c1)](_0x4099ba[_0x2291a4(0x15a)]+_0x2291a4(0x1ca)));if(_0x4099ba[_0x2291a4(0x1af)]!==undefined&&_0x4099ba[_0x2291a4(0x1af)]>0x0)_0x5d6bd4[_0x2291a4(0x1a4)](a4_0x584ae5[_0x2291a4(0x1c1)](_0x4099ba[_0x2291a4(0x1af)]+'\x20created'));if(_0x4099ba['updated']!==undefined&&_0x4099ba[_0x2291a4(0x1d2)]>0x0)_0x5d6bd4[_0x2291a4(0x1a4)](a4_0x584ae5[_0x2291a4(0x170)](_0x4099ba[_0x2291a4(0x1d2)]+_0x2291a4(0x1b2)));if(_0x4099ba['unchanged']!==undefined&&_0x4099ba[_0x2291a4(0x1e7)]>0x0)_0x5d6bd4[_0x2291a4(0x1a4)](a4_0x584ae5[_0x2291a4(0x196)](_0x4099ba[_0x2291a4(0x1e7)]+_0x2291a4(0x185)));if(_0x4099ba['errors']!==undefined&&_0x4099ba[_0x2291a4(0x1d3)]>0x0)_0x5d6bd4[_0x2291a4(0x1a4)](a4_0x584ae5[_0x2291a4(0x191)](_0x4099ba[_0x2291a4(0x1d3)]+_0x2291a4(0x1d8)));return _0x5d6bd4[_0x2291a4(0x173)](',\x20');}function displayDiffs(_0x4fa5b5,_0x3a3b01,_0x5f207d,_0x25c6f0,_0x37ce88,_0x1167b3,_0x436765,_0x2af8e1,_0x95ca2e){const _0x517fa0=a4_0x35e5;for(const _0xf32ff of _0x4fa5b5){if(_0xf32ff[_0x517fa0(0x163)]){const _0x4dd7a9=_0xf32ff['agentName']||_0xf32ff[_0x517fa0(0x194)];console['log'](_0x517fa0(0x190)+_0x4dd7a9+'\x27:'),console[_0x517fa0(0x203)]('─'['repeat'](0x3c)),console[_0x517fa0(0x203)](_0xf32ff[_0x517fa0(0x163)]),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c));}}for(const _0x5de3e0 of _0x3a3b01){_0x5de3e0[_0x517fa0(0x163)]&&(console[_0x517fa0(0x203)](_0x517fa0(0x19a)+_0x5de3e0[_0x517fa0(0x194)]+'\x27:'),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)),console[_0x517fa0(0x203)](_0x5de3e0[_0x517fa0(0x163)]),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)));}for(const _0x82bb0c of _0x5f207d){_0x82bb0c[_0x517fa0(0x163)]&&(console['log'](_0x517fa0(0x199)+_0x82bb0c[_0x517fa0(0x194)]+'\x27:'),console['log']('─'[_0x517fa0(0x1dc)](0x3c)),console[_0x517fa0(0x203)](_0x82bb0c[_0x517fa0(0x163)]),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)));}for(const _0x2a7817 of _0x25c6f0){_0x2a7817['diff']&&(console[_0x517fa0(0x203)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x2a7817[_0x517fa0(0x194)]+'\x27:'),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)),console[_0x517fa0(0x203)](_0x2a7817[_0x517fa0(0x163)]),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)));}for(const _0x2f1b18 of _0x37ce88){_0x2f1b18['diff']&&(console[_0x517fa0(0x203)](_0x517fa0(0x1a7)+_0x2f1b18[_0x517fa0(0x194)]+'\x27:'),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)),console[_0x517fa0(0x203)](_0x2f1b18['diff']),console['log']('─'[_0x517fa0(0x1dc)](0x3c)));}for(const _0x48aafe of _0x1167b3){_0x48aafe[_0x517fa0(0x163)]&&(console[_0x517fa0(0x203)](_0x517fa0(0x1ea)+_0x48aafe[_0x517fa0(0x194)]+'\x27:'),console['log']('─'[_0x517fa0(0x1dc)](0x3c)),console[_0x517fa0(0x203)](_0x48aafe['diff']),console['log']('─'[_0x517fa0(0x1dc)](0x3c)));}for(const _0x19407c of _0x436765){_0x19407c['diff']&&(console['log'](_0x517fa0(0x1a9)+_0x19407c['name']+'\x27:'),console['log']('─'[_0x517fa0(0x1dc)](0x3c)),console[_0x517fa0(0x203)](_0x19407c['diff']),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)));}for(const _0x4d0d9c of _0x2af8e1){_0x4d0d9c['diff']&&(console[_0x517fa0(0x203)]('\x0aChanges\x20to\x20form\x20interface\x20\x27'+_0x4d0d9c[_0x517fa0(0x194)]+'\x27:'),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)),console[_0x517fa0(0x203)](_0x4d0d9c[_0x517fa0(0x163)]),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)));}for(const _0x15bdc3 of _0x95ca2e){_0x15bdc3[_0x517fa0(0x163)]&&(console['log'](_0x517fa0(0x1bf)+_0x15bdc3[_0x517fa0(0x194)]+'\x27:'),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)),console[_0x517fa0(0x203)](_0x15bdc3[_0x517fa0(0x163)]),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x4e85d1(0x194)]=a4_0x4e85d1(0x19d);[a4_0x4e85d1(0x1b3)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async['execute'](_0x495339){const _0x12e6fc=a4_0x4e85d1,{options:_0x136068,args:_0x22dfc8,tdx:_0x5d5126}=_0x495339,_0x52ba78=_0x22dfc8[0x0],_0x18fc02=_0x22dfc8[0x1],_0x2fc601=_0x136068[_0x12e6fc(0x1ba)],_0x5d548a=_0x136068[_0x12e6fc(0x1ac)],_0x472513=_0x136068[_0x12e6fc(0x1ab)],_0x2abceb=_0x136068[_0x12e6fc(0x19e)],_0x34b64b=_0x136068[_0x12e6fc(0x153)],_0x19614c=_0x136068['agent'];let _0x539b32;if(_0x52ba78){const _0x443471=a4_0xb9399[_0x12e6fc(0x173)](_0x52ba78,_0x12e6fc(0x20d));if(existsSync(_0x443471))try{const _0x3e13ae=JSON[_0x12e6fc(0x1b5)](readFileSync(_0x443471,_0x12e6fc(0x1d6)));_0x3e13ae[_0x12e6fc(0x171)]&&(_0x539b32={'llm_project':_0x3e13ae[_0x12e6fc(0x171)]});}catch{}}const _0x55e1cc=findAgentConfigPath(process[_0x12e6fc(0x1d9)]());let _0x2fe8ba;if(_0x55e1cc)try{const _0xcc33af=JSON['parse'](readFileSync(_0x55e1cc,_0x12e6fc(0x1d6)));_0xcc33af[_0x12e6fc(0x171)]&&(_0x2fe8ba={'llm_project':_0xcc33af[_0x12e6fc(0x171)]});}catch{}const _0x3c0c6f=resolveAgentPullArgs({'arg':_0x52ba78,'agentNameArg':_0x18fc02,'agentFlag':_0x19614c,'contextProject':_0x34b64b,'argDirConfig':_0x539b32,'cwdConfigPath':_0x55e1cc||undefined,'cwdConfig':_0x2fe8ba}),{projectNameOrId:_0x109af8,targetAgentName:_0x4e959e,existingOutputDir:_0x113734,source:_0x2a40c5}=_0x3c0c6f;if(_0x2a40c5===_0x12e6fc(0x151))console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x1cb)](_0x12e6fc(0x1c4)+a4_0xb9399[_0x12e6fc(0x173)](_0x52ba78,_0x12e6fc(0x20d))+':\x20'+_0x109af8));else{if(_0x2a40c5===_0x12e6fc(0x189))console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x1cb)](_0x12e6fc(0x18d)+_0x109af8));else _0x2a40c5===_0x12e6fc(0x206)&&console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x1cb)](_0x12e6fc(0x1e3)+_0x109af8));}if(!_0x109af8)return _0x19614c?(console[_0x12e6fc(0x203)](a4_0x584ae5['yellow']('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console['log'](_0x12e6fc(0x1d0)),console[_0x12e6fc(0x203)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x170)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x12e6fc(0x203)]('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x12e6fc(0x203)](_0x12e6fc(0x200)),console[_0x12e6fc(0x203)](_0x12e6fc(0x182)),console[_0x12e6fc(0x203)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project'),console[_0x12e6fc(0x203)](_0x12e6fc(0x172))),0x1;if(_0x4e959e){const {data:_0x1042b9}=await withSpinner(_0x12e6fc(0x16b)+_0x4e959e+_0x12e6fc(0x202)+_0x109af8+_0x12e6fc(0x156),()=>_0x5d5126[_0x12e6fc(0x1b0)][_0x12e6fc(0x17c)](_0x109af8,_0x4e959e,_0x2fc601,{'dryRun':_0x5d548a,'force':_0x472513}));if(_0x5d548a)return console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x170)](_0x12e6fc(0x19c))),console[_0x12e6fc(0x203)]('Would\x20pull\x20agent:\x20'+_0x1042b9['agentName']),console[_0x12e6fc(0x203)](_0x12e6fc(0x1d7)+_0x1042b9[_0x12e6fc(0x1ce)]),_0x1042b9[_0x12e6fc(0x163)]&&(console['log'](_0x12e6fc(0x165)),console[_0x12e6fc(0x203)]('─'[_0x12e6fc(0x1dc)](0x3c)),console[_0x12e6fc(0x203)](_0x1042b9[_0x12e6fc(0x163)]),console[_0x12e6fc(0x203)]('─'[_0x12e6fc(0x1dc)](0x3c))),0x0;return console[_0x12e6fc(0x203)](a4_0x584ae5['green']('Agent\x20pulled\x20successfully')),console[_0x12e6fc(0x203)](_0x12e6fc(0x178)+_0x1042b9[_0x12e6fc(0x1e9)]),console[_0x12e6fc(0x203)](_0x12e6fc(0x1be)+_0x1042b9['outputPath']),console['log']('Status:\x20'+(_0x1042b9[_0x12e6fc(0x1c2)]?a4_0x584ae5['green']('new'):_0x1042b9[_0x12e6fc(0x184)]?a4_0x584ae5[_0x12e6fc(0x170)](_0x12e6fc(0x1d2)):a4_0x584ae5['gray']('unchanged'))),0x0;}const _0x34352b=_0x113734||_0x2fc601,{data:_0x57b648}=await withSpinner(_0x12e6fc(0x1b1)+_0x109af8+'\x22...',()=>_0x5d5126['llm']['pullProject'](_0x109af8,_0x34352b,{'dryRun':!![]})),_0x4cc555=_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1a8)][_0x12e6fc(0x15a)]+_0x57b648['counts'][_0x12e6fc(0x15c)][_0x12e6fc(0x15a)]+_0x57b648['counts'][_0x12e6fc(0x1c9)][_0x12e6fc(0x15a)]+_0x57b648['counts'][_0x12e6fc(0x1f5)][_0x12e6fc(0x15a)]+_0x57b648[_0x12e6fc(0x154)]['integrations']['new']+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1fb)][_0x12e6fc(0x15a)]+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x158)][_0x12e6fc(0x15a)]+_0x57b648[_0x12e6fc(0x154)]['formInterfaces']['new']+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x169)][_0x12e6fc(0x15a)],_0x4810f6=_0x57b648['counts']['agents'][_0x12e6fc(0x1d2)]+_0x57b648['counts']['knowledgeBases'][_0x12e6fc(0x1d2)]+_0x57b648[_0x12e6fc(0x154)]['textKnowledgeBases']['updated']+_0x57b648['counts'][_0x12e6fc(0x1f5)][_0x12e6fc(0x1d2)]+_0x57b648[_0x12e6fc(0x154)]['integrations']['updated']+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1fb)][_0x12e6fc(0x1d2)]+_0x57b648['counts'][_0x12e6fc(0x158)][_0x12e6fc(0x1d2)]+_0x57b648['counts'][_0x12e6fc(0x1df)][_0x12e6fc(0x1d2)]+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x169)][_0x12e6fc(0x1d2)],_0x5e8698=_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1a8)][_0x12e6fc(0x1e7)]+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x15c)][_0x12e6fc(0x1e7)]+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1c9)][_0x12e6fc(0x1e7)]+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1f5)]['unchanged']+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1c7)]['unchanged']+_0x57b648[_0x12e6fc(0x154)]['experimentalKnowledgeBases'][_0x12e6fc(0x1e7)]+_0x57b648['counts'][_0x12e6fc(0x158)][_0x12e6fc(0x1e7)]+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1df)][_0x12e6fc(0x1e7)]+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x169)][_0x12e6fc(0x1e7)];console[_0x12e6fc(0x203)](_0x12e6fc(0x1db)+_0x57b648[_0x12e6fc(0x1fa)]+'\x27:'),console['log']('\x20\x20'+a4_0x584ae5[_0x12e6fc(0x1c1)]('+\x20'+_0x4cc555+_0x12e6fc(0x1ca))+_0x12e6fc(0x207)+a4_0x584ae5['yellow']('~\x20'+_0x4810f6+'\x20changed')+_0x12e6fc(0x207)+a4_0x584ae5[_0x12e6fc(0x1cb)]('=\x20'+_0x5e8698+_0x12e6fc(0x185))),console[_0x12e6fc(0x203)](_0x12e6fc(0x18c)+formatCountSummary(_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1a8)])),console[_0x12e6fc(0x203)](_0x12e6fc(0x192)+formatCountSummary(_0x57b648[_0x12e6fc(0x154)]['knowledgeBases'])),console[_0x12e6fc(0x203)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x57b648['counts'][_0x12e6fc(0x1c9)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1f5)])),console['log'](_0x12e6fc(0x208)+formatCountSummary(_0x57b648[_0x12e6fc(0x154)]['integrations'])),console[_0x12e6fc(0x203)](_0x12e6fc(0x1e0)+formatCountSummary(_0x57b648['counts'][_0x12e6fc(0x1df)])),console[_0x12e6fc(0x203)](_0x12e6fc(0x209)+formatCountSummary(_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x169)]));const _0x5bc1d3=_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1fb)][_0x12e6fc(0x17b)]>0x0||_0x57b648['counts'][_0x12e6fc(0x158)][_0x12e6fc(0x17b)]>0x0;_0x5bc1d3&&(console[_0x12e6fc(0x203)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x57b648[_0x12e6fc(0x154)]['experimentalKnowledgeBases'])),console[_0x12e6fc(0x203)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x158)])));console[_0x12e6fc(0x203)](_0x12e6fc(0x20f)+a4_0x584ae5[_0x12e6fc(0x16f)](_0x57b648[_0x12e6fc(0x18e)])),displayDiffs(_0x57b648[_0x12e6fc(0x1a8)],_0x57b648['knowledgeBases'],_0x57b648[_0x12e6fc(0x1c9)],_0x57b648[_0x12e6fc(0x1f5)],_0x57b648['integrations'],_0x57b648[_0x12e6fc(0x1fb)],_0x57b648[_0x12e6fc(0x158)],_0x57b648[_0x12e6fc(0x1df)],_0x57b648[_0x12e6fc(0x169)]);if(_0x5d548a)return console['log'](a4_0x584ae5['yellow'](_0x12e6fc(0x198))),0x0;if(_0x4cc555===0x0&&_0x4810f6===0x0)return console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x1c1)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x57b648[_0x12e6fc(0x1fa)]},_0x136068[_0x12e6fc(0x193)]),console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x1c1)](_0x12e6fc(0x197)+a4_0x584ae5['dim'](_0x12e6fc(0x171))+_0x12e6fc(0x1fd)+a4_0x584ae5[_0x12e6fc(0x16f)](_0x57b648[_0x12e6fc(0x1fa)]))),0x0;if(!_0x2abceb&&!_0x472513){if(!isInteractive())return console['error'](a4_0x584ae5['red'](_0x12e6fc(0x1fc)),_0x12e6fc(0x187)),console[_0x12e6fc(0x18b)](a4_0x584ae5[_0x12e6fc(0x1cb)](_0x12e6fc(0x195))),0x1;const _0x615c9f=await confirmKey(_0x12e6fc(0x1f8)+(_0x4cc555+_0x4810f6)+_0x12e6fc(0x19b));if(!_0x615c9f)return console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x170)](_0x12e6fc(0x19f)),_0x12e6fc(0x1ae)),0x1;}const {data:_0x54ca95}=await withSpinner(_0x12e6fc(0x1f4),()=>_0x5d5126['llm'][_0x12e6fc(0x1ff)](_0x109af8,_0x34352b,{'force':_0x472513}));return console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x1c1)](_0x12e6fc(0x1b6)+(_0x4cc555+_0x4810f6)+_0x12e6fc(0x1aa)+_0x54ca95[_0x12e6fc(0x18e)])),saveSessionContext({'llm_project':_0x54ca95[_0x12e6fc(0x1fa)]},_0x136068[_0x12e6fc(0x193)]),console['log'](a4_0x584ae5[_0x12e6fc(0x1c1)](_0x12e6fc(0x197)+a4_0x584ae5['dim'](_0x12e6fc(0x171))+_0x12e6fc(0x1fd)+a4_0x584ae5[_0x12e6fc(0x16f)](_0x54ca95['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x4e85d1(0x194)]='agent:clone';[a4_0x4e85d1(0x1b3)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x4e85d1(0x1a2)](_0x54bac1){const _0x23d90a=a4_0x4e85d1,{options:_0x39f3c7,args:_0x2f184b,tdx:_0x10cc78}=_0x54bac1,_0x38a444=_0x2f184b[0x0],_0x25391b=_0x39f3c7[_0x23d90a(0x194)],_0x31aef3=_0x39f3c7[_0x23d90a(0x1ac)],_0x469402=_0x39f3c7[_0x23d90a(0x19e)],_0x34b9a3=_0x39f3c7[_0x23d90a(0x1f1)],_0x4f5faf=_0x39f3c7[_0x23d90a(0x153)];let _0x4f604e;const _0x22081d=findAgentConfigPath(process[_0x23d90a(0x1d9)]());if(_0x38a444){const _0x998087=a4_0xb9399['join'](_0x38a444,_0x23d90a(0x20d));existsSync(_0x998087)?(_0x4f604e=_0x38a444,console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x1cb)](_0x23d90a(0x1bc)+_0x38a444))):_0x4f604e=_0x38a444;}else{if(_0x22081d)_0x4f604e=a4_0xb9399['dirname'](_0x22081d),console['log'](a4_0x584ae5[_0x23d90a(0x1cb)](_0x23d90a(0x1c0)+_0x4f604e));else{if(_0x4f5faf){const _0x341cec=sanitizeForFilesystem(_0x4f5faf);let _0x152bf4=_0x341cec,_0x21e899=a4_0xb9399['join'](process[_0x23d90a(0x1d9)](),_0x23d90a(0x1a8),_0x341cec,_0x23d90a(0x20d));if(!existsSync(_0x21e899)){const _0x3ba8d9=normalizeName(_0x4f5faf),_0x54f5e3=a4_0xb9399[_0x23d90a(0x173)](process['cwd'](),'agents',_0x3ba8d9,_0x23d90a(0x20d));existsSync(_0x54f5e3)&&(_0x152bf4=_0x3ba8d9,_0x21e899=_0x54f5e3);}if(existsSync(_0x21e899))_0x4f604e=a4_0xb9399[_0x23d90a(0x1f3)](_0x21e899),console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x1cb)](_0x23d90a(0x1bc)+_0x4f604e));else{const _0x18ac40=_0x39f3c7[_0x23d90a(0x179)];if(_0x18ac40)throw new SDKError(ErrorCode[_0x23d90a(0x1a1)],_0x23d90a(0x188)+_0x4f5faf+_0x23d90a(0x1c3),undefined,{'helpText':_0x23d90a(0x20c)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x23d90a(0x1a6)+_0x4f5faf+'\x0a')+(_0x23d90a(0x1cd)+_0x152bf4+_0x23d90a(0x20e)+(_0x25391b||_0x23d90a(0x1a3))+'\x20--profile\x20'+_0x18ac40)});_0x4f604e=_0x4f5faf,console['log'](a4_0x584ae5['dim'](_0x23d90a(0x186)+_0x4f5faf));}}}}if(!_0x4f604e)return console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x170)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x23d90a(0x203)](_0x23d90a(0x17d)),console[_0x23d90a(0x203)](_0x23d90a(0x157)),console['log'](_0x23d90a(0x1f6)),console[_0x23d90a(0x203)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x25391b)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x23d90a(0x1cf),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x469402&&!_0x31aef3){if(!isInteractive())return console[_0x23d90a(0x18b)](a4_0x584ae5[_0x23d90a(0x191)](_0x23d90a(0x1fc)),_0x23d90a(0x187)),console[_0x23d90a(0x18b)](a4_0x584ae5[_0x23d90a(0x1cb)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x29f59b=await confirmKey('Clone\x20\x22'+_0x4f604e+_0x23d90a(0x1e5)+_0x25391b+'\x22?');if(!_0x29f59b)return console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x170)](_0x23d90a(0x19f))),0x1;}const {data:_0x3eee0f}=await withSpinner(_0x23d90a(0x1e8)+_0x4f604e+_0x23d90a(0x167)+_0x25391b+_0x23d90a(0x156),()=>_0x10cc78[_0x23d90a(0x1b0)][_0x23d90a(0x1ef)](_0x4f604e,_0x25391b,{'dryRun':_0x31aef3}));if(_0x31aef3){console[_0x23d90a(0x203)](a4_0x584ae5['yellow'](_0x23d90a(0x1b9))),console[_0x23d90a(0x203)](_0x23d90a(0x1d1)+_0x3eee0f[_0x23d90a(0x1d5)]),console[_0x23d90a(0x203)](_0x23d90a(0x1e4)+_0x25391b),console[_0x23d90a(0x203)](_0x23d90a(0x15d)),console['log'](_0x23d90a(0x18c)+_0x3eee0f['counts']['agents'][_0x23d90a(0x1af)]),console[_0x23d90a(0x203)](_0x23d90a(0x192)+_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x15c)][_0x23d90a(0x1af)]),console['log'](_0x23d90a(0x1eb)+_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1f5)]['created']),console[_0x23d90a(0x203)](_0x23d90a(0x1e0)+_0x3eee0f['counts'][_0x23d90a(0x1df)]['created']),console['log']('\x20\x20Chat\x20Interfaces:\x20'+_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x169)]['created']);const _0x151163=_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1fb)]['created']>0x0||_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x158)][_0x23d90a(0x1af)]>0x0;return _0x151163&&(console[_0x23d90a(0x203)](_0x23d90a(0x177)+_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1fb)][_0x23d90a(0x1af)]),console[_0x23d90a(0x203)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x158)][_0x23d90a(0x1af)])),0x0;}const _0x3d8f25=_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1a8)][_0x23d90a(0x1d3)]>0x0||_0x3eee0f[_0x23d90a(0x154)]['knowledgeBases']['errors']>0x0||_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1f5)][_0x23d90a(0x1d3)]>0x0||_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1df)][_0x23d90a(0x1d3)]>0x0||_0x3eee0f['counts'][_0x23d90a(0x169)][_0x23d90a(0x1d3)]>0x0||_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1fb)][_0x23d90a(0x1d3)]>0x0||_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x158)][_0x23d90a(0x1d3)]>0x0;_0x3d8f25?console['log'](a4_0x584ae5['yellow'](_0x23d90a(0x1bb))):console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x1c1)](_0x23d90a(0x1ee)));console[_0x23d90a(0x203)]('Source:\x20'+_0x3eee0f[_0x23d90a(0x1d5)]),console[_0x23d90a(0x203)](_0x23d90a(0x1e4)+_0x3eee0f[_0x23d90a(0x181)]),console[_0x23d90a(0x203)](_0x23d90a(0x1c6)+_0x3eee0f[_0x23d90a(0x1fe)]),console['log'](),console[_0x23d90a(0x203)]('Summary:'),console['log'](_0x23d90a(0x18c)+formatCountSummary(_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1a8)])),console[_0x23d90a(0x203)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3eee0f[_0x23d90a(0x154)]['knowledgeBases'])),console[_0x23d90a(0x203)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1f5)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1c7)])),console[_0x23d90a(0x203)](_0x23d90a(0x1e0)+formatCountSummary(_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1df)])),console['log'](_0x23d90a(0x209)+formatCountSummary(_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x169)]));const _0x58bf41=_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1fb)][_0x23d90a(0x1af)]>0x0||_0x3eee0f[_0x23d90a(0x154)]['experimentalKnowledgeBases'][_0x23d90a(0x1d2)]>0x0||_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1fb)][_0x23d90a(0x1e7)]>0x0||_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x158)][_0x23d90a(0x1af)]>0x0||_0x3eee0f[_0x23d90a(0x154)]['experimentalArtifacts'][_0x23d90a(0x1d2)]>0x0||_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x158)][_0x23d90a(0x1e7)]>0x0;_0x58bf41&&(console['log'](_0x23d90a(0x177)+formatCountSummary(_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1fb)])),console[_0x23d90a(0x203)](_0x23d90a(0x17a)+formatCountSummary(_0x3eee0f[_0x23d90a(0x154)]['experimentalArtifacts'])));if(_0x3d8f25){console[_0x23d90a(0x203)](),console['log'](a4_0x584ae5['red'](_0x23d90a(0x1e6)));for(const _0x34c9f0 of _0x3eee0f[_0x23d90a(0x1a8)]){_0x34c9f0[_0x23d90a(0x15b)]===_0x23d90a(0x18b)&&console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x191)](_0x23d90a(0x166)+_0x34c9f0[_0x23d90a(0x1e9)]+_0x23d90a(0x201)+_0x34c9f0[_0x23d90a(0x18b)]));}for(const _0x5bd708 of _0x3eee0f['knowledgeBases']){_0x5bd708[_0x23d90a(0x15b)]===_0x23d90a(0x18b)&&console[_0x23d90a(0x203)](a4_0x584ae5['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x5bd708[_0x23d90a(0x194)]+'\x22:\x20'+_0x5bd708['error']));}for(const _0x154f1b of _0x3eee0f['prompts']){_0x154f1b[_0x23d90a(0x15b)]===_0x23d90a(0x18b)&&console['log'](a4_0x584ae5[_0x23d90a(0x191)](_0x23d90a(0x1cc)+_0x154f1b['name']+_0x23d90a(0x201)+_0x154f1b[_0x23d90a(0x18b)]));}for(const _0xe85486 of _0x3eee0f[_0x23d90a(0x1c7)]){_0xe85486[_0x23d90a(0x15b)]===_0x23d90a(0x18b)&&console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x191)]('\x20\x20Integration\x20\x22'+_0xe85486[_0x23d90a(0x194)]+_0x23d90a(0x201)+_0xe85486['error']));}for(const _0x55287d of _0x3eee0f[_0x23d90a(0x1df)]){_0x55287d[_0x23d90a(0x15b)]===_0x23d90a(0x18b)&&console['log'](a4_0x584ae5[_0x23d90a(0x191)](_0x23d90a(0x1dd)+_0x55287d[_0x23d90a(0x194)]+'\x22:\x20'+_0x55287d[_0x23d90a(0x18b)]));}for(const _0x20fd88 of _0x3eee0f[_0x23d90a(0x169)]){_0x20fd88[_0x23d90a(0x15b)]==='error'&&console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x191)]('\x20\x20Chat\x20Interface\x20\x22'+_0x20fd88[_0x23d90a(0x194)]+_0x23d90a(0x201)+_0x20fd88[_0x23d90a(0x18b)]));}for(const _0x377fec of _0x3eee0f[_0x23d90a(0x1fb)]){_0x377fec[_0x23d90a(0x15b)]===_0x23d90a(0x18b)&&console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x191)](_0x23d90a(0x1e1)+_0x377fec[_0x23d90a(0x194)]+'\x22:\x20'+_0x377fec['error']));}for(const _0xd055eb of _0x3eee0f['experimentalArtifacts']){_0xd055eb['action']===_0x23d90a(0x18b)&&console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x191)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0xd055eb[_0x23d90a(0x194)]+_0x23d90a(0x201)+_0xd055eb[_0x23d90a(0x18b)]));}return 0x1;}console[_0x23d90a(0x203)]();const _0x4d5b3b=getLLMProjectUrl(_0x34b9a3,_0x3eee0f[_0x23d90a(0x1fe)]);return console[_0x23d90a(0x203)](_0x23d90a(0x1f9)+a4_0x584ae5['cyan'](_0x4d5b3b)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x4e85d1(0x194)]=a4_0x4e85d1(0x155);['description']=a4_0x4e85d1(0x20b);async[a4_0x4e85d1(0x1a2)](_0xee2229){const _0x2d6379=a4_0x4e85d1,{options:_0x5bfdc2,args:_0x5d1957,tdx:_0x12ed4e}=_0xee2229;let _0x73de72=_0x5d1957[0x0]||process['cwd']();const _0x16687b=_0x5bfdc2[_0x2d6379(0x1ac)],_0x35dd33=_0x5bfdc2[_0x2d6379(0x1ab)],_0x3b5ae2=_0x5bfdc2['yes'],_0xaace85=_0x5bfdc2['site'],_0x3b83fc=a4_0xb9399[_0x2d6379(0x173)](_0x73de72,'agent.yml'),_0xf4ac48=existsSync(_0x3b83fc);if(_0xf4ac48){const {data:_0x44cfa9}=await withSpinner(_0x2d6379(0x164)+_0x73de72+_0x2d6379(0x156),()=>_0x12ed4e[_0x2d6379(0x1b0)][_0x2d6379(0x176)](_0x73de72,{'dryRun':_0x16687b,'force':_0x35dd33}));if(_0x16687b)return console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x170)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x2d6379(0x203)](_0x2d6379(0x16c)+_0x44cfa9[_0x2d6379(0x1e9)]),0x0;if(_0x44cfa9[_0x2d6379(0x15b)]===_0x2d6379(0x18b))return console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x191)](_0x2d6379(0x205)+_0x44cfa9[_0x2d6379(0x18b)])),0x1;console[_0x2d6379(0x203)](a4_0x584ae5['green'](_0x2d6379(0x20a)+_0x44cfa9[_0x2d6379(0x15b)]+_0x2d6379(0x1f2))),console[_0x2d6379(0x203)](_0x2d6379(0x178)+_0x44cfa9[_0x2d6379(0x1e9)]);if(_0x44cfa9[_0x2d6379(0x1a0)]&&_0x44cfa9['projectId']){const _0x247b54=getLLMAgentChatUrl(_0xaace85,_0x44cfa9[_0x2d6379(0x1ad)],_0x44cfa9[_0x2d6379(0x1a0)]);console['log'](_0x2d6379(0x15f)+a4_0x584ae5[_0x2d6379(0x16f)](_0x247b54));}return 0x0;}const _0x4f36e2=_0x5bfdc2['llmProject'],_0x4d6714=resolveProjectFromContext(_0x73de72,_0x4f36e2);if(_0x4d6714[_0x2d6379(0x16a)])_0x73de72=_0x4d6714['projectDir'],_0x4d6714[_0x2d6379(0x183)]===_0x2d6379(0x206)&&console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x1cb)](_0x2d6379(0x18d)+_0x73de72));else{let _0x164aad=_0x2d6379(0x1a5);_0x4d6714[_0x2d6379(0x1f0)]===_0x2d6379(0x1da)&&(_0x164aad=_0x4d6714[_0x2d6379(0x1bd)]+_0x2d6379(0x168)+_0x4d6714[_0x2d6379(0x153)]+_0x2d6379(0x152));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4d6714['reason']==='no_context'?_0x4d6714[_0x2d6379(0x1bd)]:_0x2d6379(0x204)+_0x73de72,undefined,{'helpText':_0x164aad});}const {data:_0x4692d6}=await withSpinner(_0x2d6379(0x15e),()=>_0x12ed4e[_0x2d6379(0x1b0)][_0x2d6379(0x1b4)](_0x73de72,{'dryRun':!![]})),_0x2cb7a3=_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1a8)]['errors']>0x0;if(_0x2cb7a3){console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x191)](_0x2d6379(0x16d)));for(const _0x3b06ee of _0x4692d6[_0x2d6379(0x1a8)]){_0x3b06ee[_0x2d6379(0x15b)]===_0x2d6379(0x18b)&&console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x191)](_0x2d6379(0x166)+_0x3b06ee[_0x2d6379(0x1e9)]+'\x22:\x20'+_0x3b06ee[_0x2d6379(0x18b)]));}return 0x1;}const _0x335234=_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1a8)][_0x2d6379(0x1af)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x15c)][_0x2d6379(0x1af)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1c9)][_0x2d6379(0x1af)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1f5)][_0x2d6379(0x1af)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1c7)][_0x2d6379(0x1af)]+_0x4692d6[_0x2d6379(0x154)]['experimentalKnowledgeBases'][_0x2d6379(0x1af)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x158)][_0x2d6379(0x1af)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1df)]['created']+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x169)][_0x2d6379(0x1af)],_0x29c2e4=_0x4692d6['counts'][_0x2d6379(0x1a8)][_0x2d6379(0x1d2)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x15c)]['updated']+_0x4692d6[_0x2d6379(0x154)]['textKnowledgeBases'][_0x2d6379(0x1d2)]+_0x4692d6['counts']['prompts'][_0x2d6379(0x1d2)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1c7)]['updated']+_0x4692d6[_0x2d6379(0x154)]['experimentalKnowledgeBases'][_0x2d6379(0x1d2)]+_0x4692d6[_0x2d6379(0x154)]['experimentalArtifacts'][_0x2d6379(0x1d2)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1df)][_0x2d6379(0x1d2)]+_0x4692d6[_0x2d6379(0x154)]['chatInterfaces']['updated'],_0x5c66d1=_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1a8)][_0x2d6379(0x1e7)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x15c)][_0x2d6379(0x1e7)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1c9)]['unchanged']+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1f5)][_0x2d6379(0x1e7)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1c7)][_0x2d6379(0x1e7)]+_0x4692d6['counts'][_0x2d6379(0x1fb)][_0x2d6379(0x1e7)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x158)]['unchanged']+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1df)][_0x2d6379(0x1e7)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x169)]['unchanged'];console[_0x2d6379(0x203)](_0x2d6379(0x1ed)+_0x4692d6[_0x2d6379(0x1fa)]+'\x27:'),console[_0x2d6379(0x203)]('\x20\x20'+a4_0x584ae5[_0x2d6379(0x1c1)]('+\x20'+_0x335234+_0x2d6379(0x1ca))+'\x20|\x20'+a4_0x584ae5[_0x2d6379(0x170)]('~\x20'+_0x29c2e4+_0x2d6379(0x1b8))+'\x20|\x20'+a4_0x584ae5[_0x2d6379(0x1cb)]('=\x20'+_0x5c66d1+'\x20unchanged')),console['log'](_0x2d6379(0x18c)+formatCountSummary(_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1a8)])),console[_0x2d6379(0x203)](_0x2d6379(0x192)+formatCountSummary(_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x15c)])),console[_0x2d6379(0x203)](_0x2d6379(0x17f)+formatCountSummary(_0x4692d6['counts'][_0x2d6379(0x1c9)])),console[_0x2d6379(0x203)](_0x2d6379(0x1eb)+formatCountSummary(_0x4692d6['counts'][_0x2d6379(0x1f5)])),console[_0x2d6379(0x203)](_0x2d6379(0x208)+formatCountSummary(_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1c7)])),console[_0x2d6379(0x203)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1df)])),console[_0x2d6379(0x203)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x169)]));const _0x366260=_0x4692d6['counts']['experimentalKnowledgeBases'][_0x2d6379(0x1af)]>0x0||_0x4692d6['counts'][_0x2d6379(0x1fb)][_0x2d6379(0x1d2)]>0x0||_0x4692d6['counts'][_0x2d6379(0x1fb)]['unchanged']>0x0||_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x158)][_0x2d6379(0x1af)]>0x0||_0x4692d6[_0x2d6379(0x154)]['experimentalArtifacts']['updated']>0x0||_0x4692d6['counts'][_0x2d6379(0x158)]['unchanged']>0x0;_0x366260&&(console[_0x2d6379(0x203)](_0x2d6379(0x177)+formatCountSummary(_0x4692d6['counts'][_0x2d6379(0x1fb)])),console[_0x2d6379(0x203)](_0x2d6379(0x17a)+formatCountSummary(_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x158)])));console[_0x2d6379(0x203)](_0x2d6379(0x16e)+a4_0x584ae5[_0x2d6379(0x16f)](_0x73de72)),displayDiffs(_0x4692d6[_0x2d6379(0x1a8)],_0x4692d6[_0x2d6379(0x15c)],_0x4692d6[_0x2d6379(0x1c9)],_0x4692d6['prompts'],_0x4692d6[_0x2d6379(0x1c7)],_0x4692d6[_0x2d6379(0x1fb)],_0x4692d6[_0x2d6379(0x158)],_0x4692d6[_0x2d6379(0x1df)],_0x4692d6[_0x2d6379(0x169)]);if(_0x16687b)return console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x170)](_0x2d6379(0x1b7))),0x0;if(_0x335234===0x0&&_0x29c2e4===0x0){console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x1c1)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x3d90b2=getLLMProjectUrl(_0xaace85,_0x4692d6[_0x2d6379(0x1ad)]);return console[_0x2d6379(0x203)](_0x2d6379(0x1f9)+a4_0x584ae5[_0x2d6379(0x16f)](_0x3d90b2)),0x0;}if(!_0x3b5ae2&&!_0x35dd33){if(!isInteractive())return console['error'](a4_0x584ae5[_0x2d6379(0x191)](_0x2d6379(0x1fc)),_0x2d6379(0x187)),console['error'](a4_0x584ae5[_0x2d6379(0x1cb)](_0x2d6379(0x195))),0x1;const _0x38b2ce=await confirmKey(_0x2d6379(0x174)+(_0x335234+_0x29c2e4)+_0x2d6379(0x1ec));if(!_0x38b2ce)return console[_0x2d6379(0x203)](a4_0x584ae5['yellow'](_0x2d6379(0x19f)),_0x2d6379(0x1de)),0x1;}const {data:_0xb88828}=await withSpinner(_0x2d6379(0x17e),()=>_0x12ed4e[_0x2d6379(0x1b0)][_0x2d6379(0x1b4)](_0x73de72,{'force':_0x35dd33})),_0x1e83a0=_0xb88828[_0x2d6379(0x154)][_0x2d6379(0x1a8)]['errors']>0x0||_0xb88828[_0x2d6379(0x154)]['knowledgeBases'][_0x2d6379(0x1d3)]>0x0||_0xb88828[_0x2d6379(0x154)][_0x2d6379(0x1c9)][_0x2d6379(0x1d3)]>0x0||_0xb88828[_0x2d6379(0x154)][_0x2d6379(0x1f5)]['errors']>0x0||_0xb88828[_0x2d6379(0x154)][_0x2d6379(0x1df)][_0x2d6379(0x1d3)]>0x0||_0xb88828[_0x2d6379(0x154)]['chatInterfaces'][_0x2d6379(0x1d3)]>0x0;if(_0x1e83a0){console['log'](a4_0x584ae5['yellow'](_0x2d6379(0x1e2))),console[_0x2d6379(0x203)](),console[_0x2d6379(0x203)](a4_0x584ae5['red']('Errors:'));for(const _0x282b79 of _0xb88828['agents']){_0x282b79['action']===_0x2d6379(0x18b)&&console['log'](a4_0x584ae5[_0x2d6379(0x191)]('\x20\x20Agent\x20\x22'+_0x282b79[_0x2d6379(0x1e9)]+_0x2d6379(0x201)+_0x282b79[_0x2d6379(0x18b)]));}for(const _0x40c3cd of _0xb88828[_0x2d6379(0x15c)]){_0x40c3cd[_0x2d6379(0x15b)]==='error'&&console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x191)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x40c3cd[_0x2d6379(0x194)]+_0x2d6379(0x201)+_0x40c3cd['error']));}for(const _0x14d448 of _0xb88828['textKnowledgeBases']){_0x14d448[_0x2d6379(0x15b)]==='error'&&console[_0x2d6379(0x203)](a4_0x584ae5['red'](_0x2d6379(0x18f)+_0x14d448[_0x2d6379(0x194)]+_0x2d6379(0x201)+_0x14d448['error']));}for(const _0x42f106 of _0xb88828[_0x2d6379(0x1f5)]){_0x42f106[_0x2d6379(0x15b)]===_0x2d6379(0x18b)&&console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x191)](_0x2d6379(0x1cc)+_0x42f106[_0x2d6379(0x194)]+'\x22:\x20'+_0x42f106[_0x2d6379(0x18b)]));}for(const _0x4acbb4 of _0xb88828[_0x2d6379(0x1c7)]){_0x4acbb4['action']==='error'&&console[_0x2d6379(0x203)](a4_0x584ae5['red'](_0x2d6379(0x160)+_0x4acbb4['name']+_0x2d6379(0x201)+_0x4acbb4[_0x2d6379(0x18b)]));}for(const _0x1df98b of _0xb88828['formInterfaces']){_0x1df98b[_0x2d6379(0x15b)]===_0x2d6379(0x18b)&&console[_0x2d6379(0x203)](a4_0x584ae5['red']('\x20\x20Form\x20Interface\x20\x22'+_0x1df98b[_0x2d6379(0x194)]+'\x22:\x20'+_0x1df98b[_0x2d6379(0x18b)]));}for(const _0x3ae24c of _0xb88828[_0x2d6379(0x169)]){_0x3ae24c[_0x2d6379(0x15b)]===_0x2d6379(0x18b)&&console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x191)](_0x2d6379(0x159)+_0x3ae24c[_0x2d6379(0x194)]+'\x22:\x20'+_0x3ae24c[_0x2d6379(0x18b)]));}return 0x1;}console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x1c1)](_0x2d6379(0x1f7)+(_0x335234+_0x29c2e4)+_0x2d6379(0x1d4)+_0xb88828[_0x2d6379(0x1fa)]+'\x27'));const _0x1753b6=getLLMProjectUrl(_0xaace85,_0xb88828[_0x2d6379(0x1ad)]);return console['log'](_0x2d6379(0x1f9)+a4_0x584ae5[_0x2d6379(0x16f)](_0x1753b6)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x2c5f76=a5_0x1123;(function(_0x2a2d92,_0x1bf019){const _0x4e473a=a5_0x1123,_0x49b7c0=_0x2a2d92();while(!![]){try{const _0x1d7e09=parseInt(_0x4e473a(0x1e1))/0x1*(-parseInt(_0x4e473a(0x212))/0x2)+-parseInt(_0x4e473a(0x208))/0x3+-parseInt(_0x4e473a(0x1d0))/0x4+-parseInt(_0x4e473a(0x1b9))/0x5*(-parseInt(_0x4e473a(0x1be))/0x6)+parseInt(_0x4e473a(0x1ec))/0x7+-parseInt(_0x4e473a(0x1c3))/0x8+-parseInt(_0x4e473a(0x1a0))/0x9*(-parseInt(_0x4e473a(0x1c0))/0xa);if(_0x1d7e09===_0x1bf019)break;else _0x49b7c0['push'](_0x49b7c0['shift']());}catch(_0x1835e8){_0x49b7c0['push'](_0x49b7c0['shift']());}}}(a5_0x2168,0x27bf1));import*as a5_0x1ea400 from'node:fs';import*as a5_0x15ad3a from'node:path';import a5_0x1a9c86 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x2168(){const _0x1af78f=['\x20\x20-\x20','push','✗\x20ERROR:\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)','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','start','length','white','conversation_url','581682mvjTmc','verbose','\x22,\x20but\x20current\x20site\x20is\x20\x22','\x20\x20Round\x20','writeFileSync','New\x20tests\x20to\x20execute:\x20','Usage:','✗\x20FAIL:\x20','utf-8','no_tests','PASS','\x20(cached)','Error\x20writing\x20output\x20file:\x20','Agent:\x20','execute','reason','description','find','green','round','yellow','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','has','status','Error:\x20No\x20previous\x20test\x20run\x20found.','some','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','projectName','Run\x20tests\x20for\x20an\x20LLM\x20agent','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','resolveAgentId','No\x20tests\x20found\x20with\x20tags:\x20','text','json','No\x20tests\x20found\x20matching:\x20','test.yml','1920087XPZjiQ','Errors:\x20\x20\x20','Running\x20test:\x20','executeReeval','Failed\x20Tests:','substring','Run\x20\x27tdx\x20agent\x20pull\x20','\x20\x20Site:\x20','Evaluating\x20response...','no_context','table','message','size','\x20\x20Evaluating...\x20','projectDir','log','tests','agent','not\x20found','rounds','now','Passed:\x20\x20\x20','\x22:\x20','llm','tags','61055SdPsnP',':\x20Sending\x20user\x20input...','\x20\x20Agent:\x20','forEach','red','84uykfxC','Re-evaluation\x20Summary','30tOjjeU','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','basename','723376jJpWdD','\x20\x20Project:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','\x20\x20Conversation:\x20','\x20-\x20','404','timestamp','agentDirs','Using\x20agent:\x20','ERROR','repeat','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','791852wotPUi','Site:\x20','Executing\x20new\x20tests...','multiple_agents','Test\x20Configuration:','resolve','llmProject','Output\x20written\x20to:\x20','toISOString','agent:test','Project\x20path:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Cached\x20run\x20from:\x20','dryRun','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','FAIL','name','1oZoDKX','site','\x20(new)','/<agent-name>','Failed:\x20\x20\x20','cyan','Either\x20switch\x20to\x20the\x20\x22','join','conversations','No\x20tests\x20have\x20tags\x20defined.','Test\x20Summary','33467TQJxSR','...','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','filter','dim','Re-evaluating\x20cached\x20test\x20run...','Cached\x20run\x20is\x20from\x20site\x20\x22','toLowerCase','split','...\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','trim','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','reeval','add','Total:\x20\x20\x20\x20','testYmlPath','includes','stop','isSpinning','Duration:\x20','✓\x20PASS:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','map','eval','jsonl','agentName','no_local_folder','221211CzQQJj'];a5_0x2168=function(){return _0x1af78f;};return a5_0x2168();}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x1123(_0x338da0,_0x55efb2){_0x338da0=_0x338da0-0x193;const _0x21684e=a5_0x2168();let _0x112372=_0x21684e[_0x338da0];return _0x112372;}export class AgentTestCommand extends BaseCommand{[a5_0x2c5f76(0x1e0)]=a5_0x2c5f76(0x1d9);[a5_0x2c5f76(0x222)]=a5_0x2c5f76(0x198);async[a5_0x2c5f76(0x220)](_0x549629){const _0x4e6d52=a5_0x2c5f76,{options:_0x1b8edd,args:_0x247e1a,tdx:_0x521cee}=_0x549629,_0x217fd1=_0x247e1a[0x0]||'.',_0x34023c=_0x1b8edd[_0x4e6d52(0x1dd)],_0xa6818=_0x1b8edd,_0x4fdb5b=_0xa6818[_0x4e6d52(0x204)]===![],_0x291010=_0xa6818[_0x4e6d52(0x1f9)],_0x465083=_0xa6818[_0x4e6d52(0x1e0)],_0x2e5fdc=_0xa6818[_0x4e6d52(0x1b8)],_0x477dd2=_0x1b8edd['site'],_0x28159a=_0xa6818['output'];if(_0x291010&&_0x4fdb5b)return console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x1bd)](_0x4e6d52(0x196))),0x1;let _0x2e6b2b=_0x4e6d52(0x1aa);if(_0xa6818['json'])_0x2e6b2b=_0x4e6d52(0x19d);else{if(_0xa6818[_0x4e6d52(0x205)])_0x2e6b2b=_0x4e6d52(0x205);else{if(_0xa6818['tsv'])_0x2e6b2b='tsv';else{if(_0xa6818['table'])_0x2e6b2b='table';}}}const _0x59876f=_0xa6818[_0x4e6d52(0x1d6)];let _0x59fc09=_0x217fd1;const _0x5e8293=a5_0x1ea400['existsSync'](_0x217fd1),_0x8428a5=_0x217fd1==='.';if(!_0x5e8293||_0x8428a5){const _0x5dbb4f=resolveProjectFromContext(_0x217fd1,_0x59876f,{'requireFile':_0x4e6d52(0x19f)});if(_0x5dbb4f['found'])_0x59fc09=_0x5dbb4f['projectDir'],_0x5dbb4f['source']==='context'&&console['log'](a5_0x1a9c86[_0x4e6d52(0x1f0)](_0x4e6d52(0x1cc)+_0x59fc09));else switch(_0x5dbb4f[_0x4e6d52(0x221)]){case _0x4e6d52(0x1a9):console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x226)](_0x5dbb4f[_0x4e6d52(0x1ab)])),console[_0x4e6d52(0x1af)](),console[_0x4e6d52(0x1af)](_0x4e6d52(0x218)),console['log']('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console[_0x4e6d52(0x1af)](_0x4e6d52(0x20c)),console[_0x4e6d52(0x1af)](),console[_0x4e6d52(0x1af)](_0x4e6d52(0x1c1));return 0x1;case _0x4e6d52(0x207):console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x226)](_0x5dbb4f[_0x4e6d52(0x1ab)])),console[_0x4e6d52(0x1af)](),console[_0x4e6d52(0x1af)](_0x4e6d52(0x1a6)+_0x5dbb4f[_0x4e6d52(0x1d6)]+_0x4e6d52(0x1f6));return 0x1;case _0x4e6d52(0x1d3):{const _0x3c8e30=a5_0x15ad3a[_0x4e6d52(0x1c2)](_0x5dbb4f[_0x4e6d52(0x1ae)]);console[_0x4e6d52(0x1af)](a5_0x1a9c86['yellow']('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x5dbb4f[_0x4e6d52(0x1d6)]+'\x22:'));for(const _0x22e22d of _0x5dbb4f[_0x4e6d52(0x1cb)]){console[_0x4e6d52(0x1af)](_0x4e6d52(0x209)+_0x22e22d);}return console['log'](),console[_0x4e6d52(0x1af)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x3c8e30+_0x4e6d52(0x1e4)),0x1;}case _0x4e6d52(0x21b):console[_0x4e6d52(0x1af)](a5_0x1a9c86['yellow'](_0x4e6d52(0x1de)+_0x5dbb4f['llmProject']+'\x22.')),console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x1f0)](_0x4e6d52(0x1da)+_0x5dbb4f[_0x4e6d52(0x1ae)])),console[_0x4e6d52(0x1af)](),console[_0x4e6d52(0x1af)](_0x4e6d52(0x227));return 0x1;}}const {definition:_0x1b1eae,agentInfo:_0x4cb5c0}=parseTestFile(_0x59fc09);let _0x14ecc6=_0x1b1eae[_0x4e6d52(0x1b0)];if(_0x465083){const _0x282764=_0x465083[_0x4e6d52(0x1f4)](',')['map'](_0x418f90=>_0x418f90[_0x4e6d52(0x1f7)]());_0x14ecc6=_0x1b1eae[_0x4e6d52(0x1b0)][_0x4e6d52(0x1ef)](_0x56a005=>_0x282764['includes'](_0x56a005[_0x4e6d52(0x1e0)]));if(_0x14ecc6[_0x4e6d52(0x20f)]===0x0)return console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x226)](_0x4e6d52(0x19e)+_0x465083)),console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x1f0)]('Available\x20tests:\x20'+_0x1b1eae[_0x4e6d52(0x1b0)][_0x4e6d52(0x203)](_0x3a3448=>_0x3a3448[_0x4e6d52(0x1e0)])['join'](',\x20'))),0x1;}if(_0x2e5fdc){const _0x7515eb=_0x2e5fdc[_0x4e6d52(0x1f4)](',')[_0x4e6d52(0x203)](_0x316cb4=>_0x316cb4[_0x4e6d52(0x1f7)]()[_0x4e6d52(0x1f3)]());_0x14ecc6=_0x14ecc6[_0x4e6d52(0x1ef)](_0x57e6d0=>_0x57e6d0['tags']?.[_0x4e6d52(0x195)](_0x19962f=>_0x7515eb[_0x4e6d52(0x1fd)](_0x19962f[_0x4e6d52(0x1f3)]())));if(_0x14ecc6[_0x4e6d52(0x20f)]===0x0){console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x226)](_0x4e6d52(0x19b)+_0x2e5fdc));const _0x1418cc=new Set();return _0x1b1eae[_0x4e6d52(0x1b0)][_0x4e6d52(0x1bc)](_0x4da2db=>_0x4da2db[_0x4e6d52(0x1b8)]?.[_0x4e6d52(0x1bc)](_0x38cfad=>_0x1418cc[_0x4e6d52(0x1fa)](_0x38cfad))),_0x1418cc[_0x4e6d52(0x1ac)]>0x0?console['log'](a5_0x1a9c86[_0x4e6d52(0x1f0)]('Available\x20tags:\x20'+[..._0x1418cc][_0x4e6d52(0x1e8)](',\x20'))):console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x1f0)](_0x4e6d52(0x1ea))),0x1;}}if(_0x291010)return this['executeReeval'](_0x549629,{'definition':{'tests':_0x14ecc6},'agentInfo':_0x4cb5c0,'outputFormat':_0x2e6b2b,'outputFile':_0x28159a,'testNames':_0x465083});if(_0x34023c){console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x1e6)](_0x4e6d52(0x1d4))),console[_0x4e6d52(0x1af)](_0x4e6d52(0x1a7)+a5_0x1a9c86[_0x4e6d52(0x210)](_0x477dd2)),console[_0x4e6d52(0x1af)](_0x4e6d52(0x1c4)+a5_0x1a9c86[_0x4e6d52(0x210)](_0x4cb5c0[_0x4e6d52(0x197)])),console[_0x4e6d52(0x1af)](_0x4e6d52(0x1bb)+a5_0x1a9c86[_0x4e6d52(0x210)](_0x4cb5c0['agentName'])),console[_0x4e6d52(0x1af)](),console[_0x4e6d52(0x1af)]('Tests\x20found:\x20'+a5_0x1a9c86['white'](_0x14ecc6[_0x4e6d52(0x20f)]));for(let _0x1f2025=0x0;_0x1f2025<_0x14ecc6['length'];_0x1f2025++){const _0x2ebf13=_0x14ecc6[_0x1f2025],_0x5021a3=_0x2ebf13[_0x4e6d52(0x1b3)][_0x4e6d52(0x20f)]===0x1?_0x4e6d52(0x225):'rounds',_0x41b3ae=_0x2ebf13[_0x4e6d52(0x1b8)]?.[_0x4e6d52(0x20f)]?'\x20['+_0x2ebf13['tags'][_0x4e6d52(0x1e8)](',\x20')+']':'';console[_0x4e6d52(0x1af)]('\x20\x20'+(_0x1f2025+0x1)+'.\x20'+a5_0x1a9c86[_0x4e6d52(0x210)](_0x2ebf13[_0x4e6d52(0x1e0)])+'\x20('+_0x2ebf13[_0x4e6d52(0x1b3)][_0x4e6d52(0x20f)]+'\x20'+_0x5021a3+')'+a5_0x1a9c86[_0x4e6d52(0x1f0)](_0x41b3ae));}return 0x0;}let _0x66f5c2,_0x2dea37;try{_0x66f5c2=await _0x521cee[_0x4e6d52(0x1b7)]['resolveProjectId'](_0x4cb5c0[_0x4e6d52(0x197)]);}catch(_0x582277){const _0xd69a38=_0x582277 instanceof Error?_0x582277['message']:String(_0x582277);return _0xd69a38['includes'](_0x4e6d52(0x1c9))||_0xd69a38['toLowerCase']()[_0x4e6d52(0x1fd)](_0x4e6d52(0x1b2))?console['log'](a5_0x1a9c86[_0x4e6d52(0x1bd)](_0x4e6d52(0x1db)+_0x4cb5c0[_0x4e6d52(0x197)])):console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x1bd)](_0x4e6d52(0x202)+_0x4cb5c0['projectName']+'\x22:\x20'+_0xd69a38)),0x1;}try{_0x2dea37=await _0x521cee[_0x4e6d52(0x1b7)][_0x4e6d52(0x19a)](_0x4cb5c0[_0x4e6d52(0x206)],_0x66f5c2);}catch(_0x1633ff){const _0x4c1037=_0x1633ff instanceof Error?_0x1633ff[_0x4e6d52(0x1ab)]:String(_0x1633ff);return _0x4c1037['includes'](_0x4e6d52(0x1c9))||_0x4c1037[_0x4e6d52(0x1f3)]()['includes'](_0x4e6d52(0x1b2))?console[_0x4e6d52(0x1af)](a5_0x1a9c86['red']('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x4cb5c0[_0x4e6d52(0x206)])):console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x1bd)](_0x4e6d52(0x199)+_0x4cb5c0[_0x4e6d52(0x206)]+_0x4e6d52(0x1b6)+_0x4c1037)),0x1;}let _0x206972;if(!_0x4fdb5b)try{_0x206972=await setupEvaluatorAgent(_0x521cee[_0x4e6d52(0x1b7)],_0x1b8edd[_0x4e6d52(0x213)]);}catch(_0xf44828){const _0x53ddf3=_0xf44828 instanceof Error?_0xf44828[_0x4e6d52(0x1ab)]:String(_0xf44828);return console[_0x4e6d52(0x1af)](a5_0x1a9c86['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x53ddf3)),0x1;}console['log'](a5_0x1a9c86[_0x4e6d52(0x1e6)]('Running\x20agent\x20tests...')),console['log'](_0x4e6d52(0x1d1)+a5_0x1a9c86[_0x4e6d52(0x210)](_0x477dd2)),console[_0x4e6d52(0x1af)](_0x4e6d52(0x21f)+a5_0x1a9c86[_0x4e6d52(0x210)](_0x4cb5c0[_0x4e6d52(0x197)]+'/'+_0x4cb5c0[_0x4e6d52(0x206)])),console['log']();const _0x52b6b1=[],_0x16d2cb=[],_0x42d5d5=Date['now']();for(let _0x2c96cf=0x0;_0x2c96cf<_0x14ecc6[_0x4e6d52(0x20f)];_0x2c96cf++){const _0x3f172f=_0x14ecc6[_0x2c96cf];_0x14ecc6[_0x4e6d52(0x20f)]>0x1?console[_0x4e6d52(0x1af)]('Test\x20'+(_0x2c96cf+0x1)+'/'+_0x14ecc6[_0x4e6d52(0x20f)]+':\x20'+a5_0x1a9c86['white'](_0x3f172f[_0x4e6d52(0x1e0)])):console['log'](_0x4e6d52(0x1a2)+a5_0x1a9c86[_0x4e6d52(0x210)](_0x3f172f[_0x4e6d52(0x1e0)]));const _0x3106cc=createCommandSpinner('Round\x201/'+_0x3f172f[_0x4e6d52(0x1b3)][_0x4e6d52(0x20f)]+_0x4e6d52(0x1ba));_0x3106cc[_0x4e6d52(0x20e)]();try{const {result:_0x432438,conversation:_0x44a3a4}=await runTest(_0x521cee[_0x4e6d52(0x1b7)],_0x3f172f,{'agentId':_0x2dea37,'projectId':_0x66f5c2,'site':_0x477dd2,'noEval':_0x4fdb5b,'evaluatorId':_0x206972,'onRoundStart':(_0x223b47,_0x97743b)=>{const _0x4288e6=_0x4e6d52;_0x3106cc['text']='Round\x20'+(_0x223b47+0x1)+'/'+_0x97743b+_0x4288e6(0x1ba);},'onRoundComplete':(_0x2d1ccd,_0x164482,_0x557558)=>{const _0x3b2e1c=_0x4e6d52,_0x48b126=formatElapsed(_0x164482);_0x557558?console[_0x3b2e1c(0x1af)](_0x3b2e1c(0x215)+(_0x2d1ccd+0x1)+'/'+_0x3f172f[_0x3b2e1c(0x1b3)][_0x3b2e1c(0x20f)]+_0x3b2e1c(0x1f5)+a5_0x1a9c86[_0x3b2e1c(0x224)]('✓')+'\x20('+_0x48b126+')'):console[_0x3b2e1c(0x1af)](_0x3b2e1c(0x215)+(_0x2d1ccd+0x1)+'/'+_0x3f172f['rounds'][_0x3b2e1c(0x20f)]+_0x3b2e1c(0x1f5)+a5_0x1a9c86[_0x3b2e1c(0x1bd)]('✗'));},'onEvaluationStart':()=>{const _0x3870a3=_0x4e6d52;_0x3106cc[_0x3870a3(0x19c)]='Evaluating\x20response...';},'onEvaluationComplete':_0x4bd504=>{const _0x567cb7=_0x4e6d52,_0x5c8932=formatElapsed(_0x4bd504);console['log']('\x20\x20Evaluating...\x20'+a5_0x1a9c86[_0x567cb7(0x224)]('✓')+'\x20('+_0x5c8932+')');}});_0x3106cc[_0x4e6d52(0x1fe)](),_0x52b6b1[_0x4e6d52(0x20a)](_0x432438),_0x16d2cb['push'](_0x44a3a4);if(_0x432438['status']===_0x4e6d52(0x21c))console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x224)](_0x4e6d52(0x201)+_0x432438[_0x4e6d52(0x221)]));else _0x432438[_0x4e6d52(0x193)]===_0x4e6d52(0x1df)?console['log'](a5_0x1a9c86[_0x4e6d52(0x1bd)](_0x4e6d52(0x219)+_0x432438[_0x4e6d52(0x221)])):console[_0x4e6d52(0x1af)](a5_0x1a9c86[_0x4e6d52(0x1bd)](_0x4e6d52(0x20b)+_0x432438[_0x4e6d52(0x221)]));_0x432438[_0x4e6d52(0x211)]&&console[_0x4e6d52(0x1af)](a5_0x1a9c86['dim']('Conversation\x20URL:\x20'+_0x432438[_0x4e6d52(0x211)])),console[_0x4e6d52(0x1af)]();}catch(_0x37dc59){_0x3106cc[_0x4e6d52(0x1fe)]();const _0x8a762=_0x37dc59 instanceof Error?_0x37dc59[_0x4e6d52(0x1ab)]:String(_0x37dc59);console['log'](a5_0x1a9c86[_0x4e6d52(0x1bd)]('✗\x20ERROR:\x20'+_0x8a762)),console['log'](),_0x52b6b1[_0x4e6d52(0x20a)]({'name':_0x3f172f[_0x4e6d52(0x1e0)],'status':_0x4e6d52(0x1cd),'reason':_0x8a762,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x4bce7b=Date[_0x4e6d52(0x1b4)]()-_0x42d5d5,_0x40f222=_0x52b6b1['filter'](_0x12fd34=>_0x12fd34[_0x4e6d52(0x193)]===_0x4e6d52(0x21c))[_0x4e6d52(0x20f)],_0x1e0f03=_0x52b6b1[_0x4e6d52(0x1ef)](_0x2ca7ba=>_0x2ca7ba[_0x4e6d52(0x193)]===_0x4e6d52(0x1df))[_0x4e6d52(0x20f)],_0x1fcf45=_0x52b6b1['filter'](_0x201329=>_0x201329[_0x4e6d52(0x193)]==='ERROR')[_0x4e6d52(0x20f)];console[_0x4e6d52(0x1af)]('━'[_0x4e6d52(0x1ce)](0x3c)),console['log'](_0x4e6d52(0x1eb)),console[_0x4e6d52(0x1af)]('━'[_0x4e6d52(0x1ce)](0x3c)),console[_0x4e6d52(0x1af)](_0x4e6d52(0x1fb)+_0x52b6b1[_0x4e6d52(0x20f)]),console['log'](_0x4e6d52(0x1b5)+a5_0x1a9c86[_0x4e6d52(0x224)](_0x40f222)),console[_0x4e6d52(0x1af)](_0x4e6d52(0x1e5)+a5_0x1a9c86['red'](_0x1e0f03));_0x1fcf45>0x0&&console['log'](_0x4e6d52(0x1a1)+a5_0x1a9c86['red'](_0x1fcf45));console[_0x4e6d52(0x1af)](_0x4e6d52(0x200)+formatElapsed(_0x4bce7b)),console[_0x4e6d52(0x1af)]('━'[_0x4e6d52(0x1ce)](0x3c));const _0x544e4e=_0x52b6b1[_0x4e6d52(0x1ef)](_0x12b0ac=>_0x12b0ac['status']!=='PASS');if(_0x544e4e[_0x4e6d52(0x20f)]>0x0){console[_0x4e6d52(0x1af)](),console[_0x4e6d52(0x1af)](_0x4e6d52(0x1a4));for(const _0x359397 of _0x544e4e){const _0x403721=a5_0x1a9c86[_0x4e6d52(0x1bd)]('✗'),_0x27a6a5=_0x359397[_0x4e6d52(0x221)][_0x4e6d52(0x20f)]>0x32?_0x359397['reason'][_0x4e6d52(0x1a5)](0x0,0x32)+_0x4e6d52(0x1ed):_0x359397[_0x4e6d52(0x221)];console[_0x4e6d52(0x1af)]('\x20\x20'+_0x403721+'\x20'+_0x359397[_0x4e6d52(0x1e0)]+':\x20'+_0x27a6a5);}}const _0x5a0a90={'summary':{'total':_0x52b6b1[_0x4e6d52(0x20f)],'passed':_0x40f222,'failed':_0x1e0f03,'errors':_0x1fcf45>0x0?_0x1fcf45:undefined,'duration_ms':_0x4bce7b},'tests':_0x52b6b1,'agent':{'project':_0x4cb5c0['projectName'],'name':_0x4cb5c0[_0x4e6d52(0x206)],'site':_0x477dd2},'timestamp':new Date(_0x42d5d5)['toISOString']()};try{const _0x3724eb=buildCachedTestRun(_0x16d2cb,{'site':_0x477dd2,'projectId':_0x66f5c2,'projectName':_0x4cb5c0[_0x4e6d52(0x197)],'agentId':_0x2dea37,'agentName':_0x4cb5c0[_0x4e6d52(0x206)],'testYmlPath':a5_0x15ad3a[_0x4e6d52(0x1d5)](_0x4cb5c0[_0x4e6d52(0x1fc)])});saveLastTestRun(_0x3724eb);}catch{}if(_0x2e6b2b!=='table'||_0x28159a){const _0x21ed3e=formatResults(_0x5a0a90,_0x2e6b2b);if(_0x28159a)try{a5_0x1ea400['writeFileSync'](_0x28159a,_0x21ed3e,_0x4e6d52(0x21a)),console['log'](),console['log'](a5_0x1a9c86[_0x4e6d52(0x1f0)](_0x4e6d52(0x1d7)+_0x28159a));}catch(_0x10f10d){return console['log'](),console['log'](a5_0x1a9c86[_0x4e6d52(0x1bd)](_0x4e6d52(0x21e)+_0x10f10d)),0x1;}else console[_0x4e6d52(0x1af)](),console[_0x4e6d52(0x1af)](_0x21ed3e);}return _0x544e4e[_0x4e6d52(0x20f)]>0x0?0x1:0x0;}async[a5_0x2c5f76(0x1a3)](_0x5b0e11,_0x964201){const _0xe7c8e7=a5_0x2c5f76,{options:_0x5deff2,tdx:_0x11305d}=_0x5b0e11,{definition:_0x1575cc,agentInfo:_0x315fe9,outputFormat:_0x4f47da,outputFile:_0x24bea1}=_0x964201,_0xc03b56=_0x5deff2['site'],_0x4aeecb=loadLastTestRun();if(!_0x4aeecb)return console[_0xe7c8e7(0x1af)](a5_0x1a9c86[_0xe7c8e7(0x1bd)](_0xe7c8e7(0x194))),console[_0xe7c8e7(0x1af)](a5_0x1a9c86[_0xe7c8e7(0x1f0)](_0xe7c8e7(0x1cf))),0x1;if(_0x4aeecb[_0xe7c8e7(0x1b1)][_0xe7c8e7(0x206)]!==_0x315fe9[_0xe7c8e7(0x206)])return console[_0xe7c8e7(0x1af)](a5_0x1a9c86['red']('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x4aeecb[_0xe7c8e7(0x1b1)]['agentName']+_0xe7c8e7(0x1c6)+_0x315fe9[_0xe7c8e7(0x206)]+'\x22.')),console[_0xe7c8e7(0x1af)](a5_0x1a9c86[_0xe7c8e7(0x1f0)](_0xe7c8e7(0x1ee))),0x1;const _0x5e29b9=new Set(_0x4aeecb[_0xe7c8e7(0x1e9)][_0xe7c8e7(0x203)](_0x2d5540=>_0x2d5540['testName'])),_0x469563=_0x1575cc[_0xe7c8e7(0x1b0)]['filter'](_0x2b7316=>!_0x5e29b9[_0xe7c8e7(0x228)](_0x2b7316[_0xe7c8e7(0x1e0)]));if(_0x469563[_0xe7c8e7(0x20f)]>0x0&&_0x4aeecb['site']!==_0xc03b56)return console[_0xe7c8e7(0x1af)](a5_0x1a9c86[_0xe7c8e7(0x1bd)](_0xe7c8e7(0x1f8))),console[_0xe7c8e7(0x1af)](a5_0x1a9c86[_0xe7c8e7(0x1f0)](_0xe7c8e7(0x1f2)+_0x4aeecb[_0xe7c8e7(0x1e2)]+_0xe7c8e7(0x214)+_0xc03b56+'\x22.')),console['log'](a5_0x1a9c86[_0xe7c8e7(0x1f0)](_0xe7c8e7(0x1e7)+_0x4aeecb['site']+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x354a54=_0x1575cc['tests'][_0xe7c8e7(0x1ef)](_0x408989=>_0x5e29b9[_0xe7c8e7(0x228)](_0x408989['name'])),_0xd55dd1=_0x469563;let _0x463bbb;try{_0x463bbb=await setupEvaluatorAgent(_0x11305d[_0xe7c8e7(0x1b7)],_0x5deff2[_0xe7c8e7(0x213)]);}catch(_0x5a79a0){const _0x458218=_0x5a79a0 instanceof Error?_0x5a79a0[_0xe7c8e7(0x1ab)]:String(_0x5a79a0);return console[_0xe7c8e7(0x1af)](a5_0x1a9c86['red'](_0xe7c8e7(0x20d)+_0x458218)),0x1;}console[_0xe7c8e7(0x1af)](a5_0x1a9c86[_0xe7c8e7(0x1e6)](_0xe7c8e7(0x1f1))),console[_0xe7c8e7(0x1af)](_0xe7c8e7(0x1dc)+a5_0x1a9c86[_0xe7c8e7(0x210)](_0x4aeecb[_0xe7c8e7(0x1ca)])),console['log']('Agent:\x20'+a5_0x1a9c86[_0xe7c8e7(0x210)](_0x4aeecb[_0xe7c8e7(0x1b1)][_0xe7c8e7(0x197)]+'/'+_0x4aeecb[_0xe7c8e7(0x1b1)][_0xe7c8e7(0x206)]));_0xd55dd1[_0xe7c8e7(0x20f)]>0x0&&console[_0xe7c8e7(0x1af)](_0xe7c8e7(0x217)+a5_0x1a9c86[_0xe7c8e7(0x226)](_0xd55dd1[_0xe7c8e7(0x20f)]));console[_0xe7c8e7(0x1af)]();const _0x443ba3=[],_0x4070c8=Date[_0xe7c8e7(0x1b4)](),_0x331c3c=createCommandSpinner('Re-evaluating...');if(_0x354a54[_0xe7c8e7(0x20f)]>0x0)try{const _0x43cdb0=await reevaluateFromCache(_0x11305d[_0xe7c8e7(0x1b7)],_0x4aeecb,{'tests':_0x354a54},{'evaluatorId':_0x463bbb,'onTestStart':(_0x2de842,_0x38f816,_0x30b72d)=>{const _0xfb87b2=_0xe7c8e7;_0x331c3c[_0xfb87b2(0x19c)]='Re-evaluating\x20'+(_0x38f816+0x1)+'/'+_0x30b72d+':\x20'+_0x2de842+_0xfb87b2(0x1ed);if(!_0x331c3c[_0xfb87b2(0x1ff)])_0x331c3c[_0xfb87b2(0x20e)]();},'onTestComplete':(_0x546b33,_0x2cf474)=>{const _0x52c942=_0xe7c8e7;_0x331c3c[_0x52c942(0x1fe)]();if(_0x2cf474[_0x52c942(0x193)]===_0x52c942(0x21c))console['log'](a5_0x1a9c86[_0x52c942(0x224)](_0x52c942(0x201)+_0x546b33)+a5_0x1a9c86['dim']('\x20(cached)'));else _0x2cf474[_0x52c942(0x193)]===_0x52c942(0x1df)?console[_0x52c942(0x1af)](a5_0x1a9c86[_0x52c942(0x1bd)](_0x52c942(0x219)+_0x546b33+_0x52c942(0x1c8)+_0x2cf474[_0x52c942(0x221)])+a5_0x1a9c86[_0x52c942(0x1f0)](_0x52c942(0x21d))):console['log'](a5_0x1a9c86['red'](_0x52c942(0x20b)+_0x546b33+_0x52c942(0x1c8)+_0x2cf474['reason']));_0x2cf474[_0x52c942(0x211)]&&console['log'](a5_0x1a9c86[_0x52c942(0x1f0)]('\x20\x20Conversation:\x20'+_0x2cf474['conversation_url'])),_0x443ba3[_0x52c942(0x20a)](_0x2cf474);},'onTestSkipped':(_0x35b673,_0x33898a)=>{const _0x4c2de5=_0xe7c8e7;_0x331c3c[_0x4c2de5(0x1fe)](),console[_0x4c2de5(0x1af)](a5_0x1a9c86[_0x4c2de5(0x226)]('⚠\x20SKIPPED:\x20'+_0x35b673+_0x4c2de5(0x1c8)+_0x33898a));}});for(const _0x1a2d07 of _0x43cdb0){!_0x443ba3[_0xe7c8e7(0x223)](_0x42e41c=>_0x42e41c['name']===_0x1a2d07['name'])&&_0x443ba3['push'](_0x1a2d07);}}catch(_0x587284){_0x331c3c[_0xe7c8e7(0x1fe)]();const _0x12c107=_0x587284 instanceof Error?_0x587284[_0xe7c8e7(0x1ab)]:String(_0x587284);return console[_0xe7c8e7(0x1af)](a5_0x1a9c86[_0xe7c8e7(0x1bd)](_0xe7c8e7(0x1c5)+_0x12c107)),0x1;}_0x331c3c[_0xe7c8e7(0x1fe)]();if(_0xd55dd1[_0xe7c8e7(0x20f)]>0x0){console[_0xe7c8e7(0x1af)](),console['log'](a5_0x1a9c86[_0xe7c8e7(0x1e6)](_0xe7c8e7(0x1d2)));const {projectId:_0x2bbe45,agentId:_0x41685e}=_0x4aeecb['agent'];for(const _0x37705d of _0xd55dd1){console[_0xe7c8e7(0x1af)]('Running:\x20'+a5_0x1a9c86['white'](_0x37705d[_0xe7c8e7(0x1e0)]));const _0x3fb5c5=createCommandSpinner('Round\x201/'+_0x37705d['rounds'][_0xe7c8e7(0x20f)]+_0xe7c8e7(0x1ba));_0x3fb5c5[_0xe7c8e7(0x20e)]();try{const {result:_0x18c936}=await runTest(_0x11305d[_0xe7c8e7(0x1b7)],_0x37705d,{'agentId':_0x41685e,'projectId':_0x2bbe45,'site':_0x4aeecb[_0xe7c8e7(0x1e2)],'noEval':![],'evaluatorId':_0x463bbb,'onRoundStart':(_0x514fc7,_0x5f7e95)=>{const _0x48e66a=_0xe7c8e7;_0x3fb5c5[_0x48e66a(0x19c)]='Round\x20'+(_0x514fc7+0x1)+'/'+_0x5f7e95+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x3ad35d,_0x353c7f,_0x323984)=>{const _0x1d6fbd=_0xe7c8e7,_0x1097ef=formatElapsed(_0x353c7f);_0x323984?console[_0x1d6fbd(0x1af)](_0x1d6fbd(0x215)+(_0x3ad35d+0x1)+'/'+_0x37705d['rounds'][_0x1d6fbd(0x20f)]+_0x1d6fbd(0x1f5)+a5_0x1a9c86[_0x1d6fbd(0x224)]('✓')+'\x20('+_0x1097ef+')'):console[_0x1d6fbd(0x1af)](_0x1d6fbd(0x215)+(_0x3ad35d+0x1)+'/'+_0x37705d[_0x1d6fbd(0x1b3)]['length']+_0x1d6fbd(0x1f5)+a5_0x1a9c86['red']('✗'));},'onEvaluationStart':()=>{const _0x47f9e1=_0xe7c8e7;_0x3fb5c5['text']=_0x47f9e1(0x1a8);},'onEvaluationComplete':_0x1f7049=>{const _0xe0d08=_0xe7c8e7,_0x1db27c=formatElapsed(_0x1f7049);console[_0xe0d08(0x1af)](_0xe0d08(0x1ad)+a5_0x1a9c86[_0xe0d08(0x224)]('✓')+'\x20('+_0x1db27c+')');}});_0x3fb5c5[_0xe7c8e7(0x1fe)](),_0x443ba3['push'](_0x18c936);if(_0x18c936[_0xe7c8e7(0x193)]===_0xe7c8e7(0x21c))console[_0xe7c8e7(0x1af)](a5_0x1a9c86[_0xe7c8e7(0x224)](_0xe7c8e7(0x201)+_0x18c936['reason'])+a5_0x1a9c86[_0xe7c8e7(0x1f0)](_0xe7c8e7(0x1e3)));else _0x18c936[_0xe7c8e7(0x193)]===_0xe7c8e7(0x1df)?console[_0xe7c8e7(0x1af)](a5_0x1a9c86[_0xe7c8e7(0x1bd)](_0xe7c8e7(0x219)+_0x18c936[_0xe7c8e7(0x221)])+a5_0x1a9c86[_0xe7c8e7(0x1f0)](_0xe7c8e7(0x1e3))):console[_0xe7c8e7(0x1af)](a5_0x1a9c86[_0xe7c8e7(0x1bd)]('✗\x20ERROR:\x20'+_0x18c936[_0xe7c8e7(0x221)]));_0x18c936[_0xe7c8e7(0x211)]&&console[_0xe7c8e7(0x1af)](a5_0x1a9c86['dim'](_0xe7c8e7(0x1c7)+_0x18c936[_0xe7c8e7(0x211)]));}catch(_0x4e2f84){_0x3fb5c5[_0xe7c8e7(0x1fe)]();const _0x42a48c=_0x4e2f84 instanceof Error?_0x4e2f84['message']:String(_0x4e2f84);console['log'](a5_0x1a9c86[_0xe7c8e7(0x1bd)](_0xe7c8e7(0x20b)+_0x42a48c)),_0x443ba3['push']({'name':_0x37705d['name'],'status':_0xe7c8e7(0x1cd),'reason':_0x42a48c,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0xe7c8e7(0x1af)]();const _0x5d76f4=Date[_0xe7c8e7(0x1b4)]()-_0x4070c8,_0x300bf6=_0x443ba3[_0xe7c8e7(0x1ef)](_0x3eb032=>_0x3eb032['status']===_0xe7c8e7(0x21c))[_0xe7c8e7(0x20f)],_0x3c79a6=_0x443ba3['filter'](_0x5f019a=>_0x5f019a[_0xe7c8e7(0x193)]===_0xe7c8e7(0x1df))[_0xe7c8e7(0x20f)],_0x56c247=_0x443ba3[_0xe7c8e7(0x1ef)](_0x38ac1a=>_0x38ac1a[_0xe7c8e7(0x193)]===_0xe7c8e7(0x1cd))[_0xe7c8e7(0x20f)];console['log']('━'[_0xe7c8e7(0x1ce)](0x3c)),console[_0xe7c8e7(0x1af)](_0xe7c8e7(0x1bf)),console[_0xe7c8e7(0x1af)]('━'['repeat'](0x3c)),console[_0xe7c8e7(0x1af)](_0xe7c8e7(0x1fb)+_0x443ba3['length']),console[_0xe7c8e7(0x1af)](_0xe7c8e7(0x1b5)+a5_0x1a9c86[_0xe7c8e7(0x224)](_0x300bf6)),console[_0xe7c8e7(0x1af)](_0xe7c8e7(0x1e5)+a5_0x1a9c86[_0xe7c8e7(0x1bd)](_0x3c79a6));_0x56c247>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x1a9c86[_0xe7c8e7(0x1bd)](_0x56c247));console[_0xe7c8e7(0x1af)](_0xe7c8e7(0x200)+formatElapsed(_0x5d76f4)),console[_0xe7c8e7(0x1af)]('━'[_0xe7c8e7(0x1ce)](0x3c));const _0x1cff1b={'summary':{'total':_0x443ba3[_0xe7c8e7(0x20f)],'passed':_0x300bf6,'failed':_0x3c79a6,'errors':_0x56c247>0x0?_0x56c247:undefined,'duration_ms':_0x5d76f4},'tests':_0x443ba3,'agent':{'project':_0x315fe9[_0xe7c8e7(0x197)],'name':_0x315fe9[_0xe7c8e7(0x206)],'site':_0xc03b56},'timestamp':new Date(_0x4070c8)[_0xe7c8e7(0x1d8)]()};if(_0x4f47da!==_0xe7c8e7(0x1aa)||_0x24bea1){const _0x239722=formatResults(_0x1cff1b,_0x4f47da);if(_0x24bea1)try{a5_0x1ea400[_0xe7c8e7(0x216)](_0x24bea1,_0x239722,_0xe7c8e7(0x21a)),console[_0xe7c8e7(0x1af)](),console[_0xe7c8e7(0x1af)](a5_0x1a9c86[_0xe7c8e7(0x1f0)](_0xe7c8e7(0x1d7)+_0x24bea1));}catch(_0x59e5f5){return console['log'](),console[_0xe7c8e7(0x1af)](a5_0x1a9c86[_0xe7c8e7(0x1bd)](_0xe7c8e7(0x21e)+_0x59e5f5)),0x1;}else console[_0xe7c8e7(0x1af)](),console[_0xe7c8e7(0x1af)](_0x239722);}const _0x18fe4e=_0x443ba3[_0xe7c8e7(0x1ef)](_0x1d6659=>_0x1d6659[_0xe7c8e7(0x193)]!==_0xe7c8e7(0x21c));return _0x18fe4e[_0xe7c8e7(0x20f)]>0x0?0x1:0x0;}}
1
+ const a5_0x3f0b29=a5_0x58d7;(function(_0x792dff,_0x95bf72){const _0x370ee6=a5_0x58d7,_0x28de38=_0x792dff();while(!![]){try{const _0x5711b4=parseInt(_0x370ee6(0x1a3))/0x1*(parseInt(_0x370ee6(0x1f6))/0x2)+-parseInt(_0x370ee6(0x1e9))/0x3*(parseInt(_0x370ee6(0x17e))/0x4)+-parseInt(_0x370ee6(0x1db))/0x5+parseInt(_0x370ee6(0x1b1))/0x6+parseInt(_0x370ee6(0x172))/0x7*(-parseInt(_0x370ee6(0x178))/0x8)+parseInt(_0x370ee6(0x173))/0x9+parseInt(_0x370ee6(0x1ca))/0xa*(parseInt(_0x370ee6(0x16f))/0xb);if(_0x5711b4===_0x95bf72)break;else _0x28de38['push'](_0x28de38['shift']());}catch(_0x240403){_0x28de38['push'](_0x28de38['shift']());}}}(a5_0x1187,0x6d17e));import*as a5_0x2a94c5 from'node:fs';import*as a5_0x439b96 from'node:path';function a5_0x58d7(_0x1563b4,_0x2cdf4a){_0x1563b4=_0x1563b4-0x162;const _0x11874d=a5_0x1187();let _0x58d7f6=_0x11874d[_0x1563b4];return _0x58d7f6;}import a5_0x809fd0 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_0x1187(){const _0x57691f=['projectDir','tests','\x20\x20Agent:\x20','rounds','\x20-\x20','Re-evaluation\x20Summary','json','\x20\x20Project:\x20','message','agent','start','some','\x20\x20Site:\x20',':\x20Sending\x20user\x20input...','Re-evaluating\x20cached\x20test\x20run...','writeFileSync','substring','No\x20tests\x20found\x20matching:\x20','Error\x20writing\x20output\x20file:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','587807IjodAS','Running:\x20','agentDirs','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','No\x20tests\x20found\x20with\x20tags:\x20','stop','Cached\x20run\x20from:\x20','toLowerCase','Errors:\x20\x20\x20','basename','✗\x20ERROR:\x20','white','testYmlPath','isSpinning','859260LxNkEV','\x20\x20Conversation:\x20','llm','name','Executing\x20new\x20tests...','now','not\x20found','dryRun','red','eval','resolveAgentId','tags','join','size','PASS','projectName','...\x20','404','\x20(new)','Output\x20written\x20to:\x20','Conversation\x20URL:\x20','reeval','has','Failed\x20Tests:','utf-8','270oeMgDT','conversations','find','\x20\x20Round\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','status','Evaluating\x20response...','\x20\x20-\x20','agent:test','FAIL','\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','Running\x20agent\x20tests...','...','toISOString','existsSync','resolveProjectId','Available\x20tags:\x20','2874990hzPFvt','Error:\x20No\x20previous\x20test\x20run\x20found.','\x20\x20Evaluating...\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','agentName','Test\x20Summary','length','Usage:','Re-evaluating...','verbose','no_local_folder','ERROR','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Test\x20Configuration:','8097MZmwkm','✓\x20PASS:\x20','New\x20tests\x20to\x20execute:\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)','green','jsonl','conversation_url','Agent:\x20','Round\x20','reason','output','✗\x20ERROR:\x20Project\x20not\x20found:\x20','\x22:\x20','2ztyokv','timestamp','cyan','llmProject','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','map','resolve','✗\x20FAIL:\x20','table','\x27\x20to\x20create\x20the\x20folder\x20structure.','log','no_tests','Site:\x20','execute','test.yml','\x20(cached)','Passed:\x20\x20\x20','filter','push','Running\x20test:\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','354827vDVHEW','/<agent-name>','Available\x20tests:\x20','7mNVoip','6861006FzbHOF','includes','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','multiple_agents','split','5773408AIeBEf','found','Re-evaluating\x20','Round\x201/','site','description','920tGVLhb','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','dim','context','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Test\x20','add','Total:\x20\x20\x20\x20','repeat','No\x20tests\x20have\x20tags\x20defined.','Duration:\x20','yellow','executeReeval','text','source'];a5_0x1187=function(){return _0x57691f;};return a5_0x1187();}export class AgentTestCommand extends BaseCommand{[a5_0x3f0b29(0x1b4)]=a5_0x3f0b29(0x1d2);[a5_0x3f0b29(0x17d)]=a5_0x3f0b29(0x1ce);async[a5_0x3f0b29(0x167)](_0x3d37bf){const _0x30576c=a5_0x3f0b29,{options:_0x26664c,args:_0x3a1eaa,tdx:_0x1f1d77}=_0x3d37bf,_0x5f2b1a=_0x3a1eaa[0x0]||'.',_0x29f628=_0x26664c[_0x30576c(0x1b8)],_0x21a43d=_0x26664c,_0x484cc9=_0x21a43d[_0x30576c(0x1ba)]===![],_0x161d23=_0x21a43d[_0x30576c(0x1c6)],_0x257a4a=_0x21a43d['name'],_0x336b04=_0x21a43d['tags'],_0x4f7359=_0x26664c[_0x30576c(0x17c)],_0x3f55bf=_0x21a43d[_0x30576c(0x1f3)];if(_0x161d23&&_0x484cc9)return console['log'](a5_0x809fd0[_0x30576c(0x1b9)](_0x30576c(0x1fa))),0x1;let _0x1305ca=_0x30576c(0x162);if(_0x21a43d['json'])_0x1305ca=_0x30576c(0x193);else{if(_0x21a43d[_0x30576c(0x1ee)])_0x1305ca=_0x30576c(0x1ee);else{if(_0x21a43d['tsv'])_0x1305ca='tsv';else{if(_0x21a43d[_0x30576c(0x162)])_0x1305ca='table';}}}const _0x5ddb1e=_0x21a43d['llmProject'];let _0x324ac7=_0x5f2b1a;const _0x2c8286=a5_0x2a94c5[_0x30576c(0x1d8)](_0x5f2b1a),_0xc45613=_0x5f2b1a==='.';if(!_0x2c8286||_0xc45613){const _0xe87cfb=resolveProjectFromContext(_0x5f2b1a,_0x5ddb1e,{'requireFile':_0x30576c(0x168)});if(_0xe87cfb[_0x30576c(0x179)])_0x324ac7=_0xe87cfb['projectDir'],_0xe87cfb[_0x30576c(0x18c)]===_0x30576c(0x181)&&console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x180)]('Using\x20agent:\x20'+_0x324ac7));else switch(_0xe87cfb[_0x30576c(0x1f2)]){case'no_context':console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x189)](_0xe87cfb[_0x30576c(0x195)])),console['log'](),console['log'](_0x30576c(0x1e2)),console[_0x30576c(0x164)](_0x30576c(0x1d4)),console[_0x30576c(0x164)](_0x30576c(0x1ec)),console[_0x30576c(0x164)](),console[_0x30576c(0x164)](_0x30576c(0x1a1));return 0x1;case _0x30576c(0x1e5):console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x189)](_0xe87cfb[_0x30576c(0x195)])),console['log'](),console[_0x30576c(0x164)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0xe87cfb['llmProject']+_0x30576c(0x163));return 0x1;case _0x30576c(0x176):{const _0x5dc075=a5_0x439b96[_0x30576c(0x1ac)](_0xe87cfb[_0x30576c(0x18d)]);console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x189)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0xe87cfb[_0x30576c(0x1f9)]+'\x22:'));for(const _0x73df1a of _0xe87cfb[_0x30576c(0x1a5)]){console[_0x30576c(0x164)](_0x30576c(0x1d1)+_0x73df1a);}return console[_0x30576c(0x164)](),console[_0x30576c(0x164)](_0x30576c(0x16e)+_0x5dc075+_0x30576c(0x170)),0x1;}case _0x30576c(0x165):console['log'](a5_0x809fd0[_0x30576c(0x189)](_0x30576c(0x175)+_0xe87cfb[_0x30576c(0x1f9)]+'\x22.')),console[_0x30576c(0x164)](a5_0x809fd0['dim']('Project\x20path:\x20'+_0xe87cfb['projectDir'])),console[_0x30576c(0x164)](),console[_0x30576c(0x164)](_0x30576c(0x1e7));return 0x1;}}const {definition:_0x6939a5,agentInfo:_0x4d67ad}=parseTestFile(_0x324ac7);let _0x483b22=_0x6939a5[_0x30576c(0x18e)];if(_0x257a4a){const _0x31ee7e=_0x257a4a[_0x30576c(0x177)](',')[_0x30576c(0x1fb)](_0x2fe466=>_0x2fe466['trim']());_0x483b22=_0x6939a5[_0x30576c(0x18e)][_0x30576c(0x16b)](_0x4edac6=>_0x31ee7e[_0x30576c(0x174)](_0x4edac6[_0x30576c(0x1b4)]));if(_0x483b22[_0x30576c(0x1e1)]===0x0)return console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x189)](_0x30576c(0x19e)+_0x257a4a)),console['log'](a5_0x809fd0[_0x30576c(0x180)](_0x30576c(0x171)+_0x6939a5[_0x30576c(0x18e)][_0x30576c(0x1fb)](_0x158354=>_0x158354['name'])[_0x30576c(0x1bd)](',\x20'))),0x1;}if(_0x336b04){const _0x2f4518=_0x336b04[_0x30576c(0x177)](',')[_0x30576c(0x1fb)](_0x15fb67=>_0x15fb67['trim']()['toLowerCase']());_0x483b22=_0x483b22[_0x30576c(0x16b)](_0x321299=>_0x321299[_0x30576c(0x1bc)]?.[_0x30576c(0x198)](_0xa8feff=>_0x2f4518[_0x30576c(0x174)](_0xa8feff[_0x30576c(0x1aa)]())));if(_0x483b22[_0x30576c(0x1e1)]===0x0){console['log'](a5_0x809fd0[_0x30576c(0x189)](_0x30576c(0x1a7)+_0x336b04));const _0x374bf6=new Set();return _0x6939a5['tests']['forEach'](_0x1cbede=>_0x1cbede['tags']?.['forEach'](_0x283e57=>_0x374bf6[_0x30576c(0x184)](_0x283e57))),_0x374bf6[_0x30576c(0x1be)]>0x0?console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x180)](_0x30576c(0x1da)+[..._0x374bf6][_0x30576c(0x1bd)](',\x20'))):console['log'](a5_0x809fd0[_0x30576c(0x180)](_0x30576c(0x187))),0x1;}}if(_0x161d23)return this[_0x30576c(0x18a)](_0x3d37bf,{'definition':{'tests':_0x483b22},'agentInfo':_0x4d67ad,'outputFormat':_0x1305ca,'outputFile':_0x3f55bf,'testNames':_0x257a4a});if(_0x29f628){console[_0x30576c(0x164)](a5_0x809fd0['cyan'](_0x30576c(0x1e8))),console[_0x30576c(0x164)](_0x30576c(0x199)+a5_0x809fd0[_0x30576c(0x1ae)](_0x4f7359)),console[_0x30576c(0x164)](_0x30576c(0x194)+a5_0x809fd0[_0x30576c(0x1ae)](_0x4d67ad[_0x30576c(0x1c0)])),console[_0x30576c(0x164)](_0x30576c(0x18f)+a5_0x809fd0[_0x30576c(0x1ae)](_0x4d67ad['agentName'])),console[_0x30576c(0x164)](),console[_0x30576c(0x164)]('Tests\x20found:\x20'+a5_0x809fd0[_0x30576c(0x1ae)](_0x483b22['length']));for(let _0x3ed139=0x0;_0x3ed139<_0x483b22[_0x30576c(0x1e1)];_0x3ed139++){const _0x181c2e=_0x483b22[_0x3ed139],_0x152127=_0x181c2e['rounds'][_0x30576c(0x1e1)]===0x1?'round':_0x30576c(0x190),_0x359dcf=_0x181c2e[_0x30576c(0x1bc)]?.['length']?'\x20['+_0x181c2e[_0x30576c(0x1bc)]['join'](',\x20')+']':'';console[_0x30576c(0x164)]('\x20\x20'+(_0x3ed139+0x1)+'.\x20'+a5_0x809fd0[_0x30576c(0x1ae)](_0x181c2e[_0x30576c(0x1b4)])+'\x20('+_0x181c2e[_0x30576c(0x190)]['length']+'\x20'+_0x152127+')'+a5_0x809fd0[_0x30576c(0x180)](_0x359dcf));}return 0x0;}let _0x293a31,_0x439653;try{_0x293a31=await _0x1f1d77[_0x30576c(0x1b3)][_0x30576c(0x1d9)](_0x4d67ad['projectName']);}catch(_0x3b1305){const _0x3c50df=_0x3b1305 instanceof Error?_0x3b1305['message']:String(_0x3b1305);return _0x3c50df[_0x30576c(0x174)](_0x30576c(0x1c2))||_0x3c50df[_0x30576c(0x1aa)]()[_0x30576c(0x174)](_0x30576c(0x1b7))?console['log'](a5_0x809fd0[_0x30576c(0x1b9)](_0x30576c(0x1f4)+_0x4d67ad[_0x30576c(0x1c0)])):console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x1b9)](_0x30576c(0x1a0)+_0x4d67ad[_0x30576c(0x1c0)]+_0x30576c(0x1f5)+_0x3c50df)),0x1;}try{_0x439653=await _0x1f1d77[_0x30576c(0x1b3)][_0x30576c(0x1bb)](_0x4d67ad[_0x30576c(0x1df)],_0x293a31);}catch(_0x2d2f61){const _0x2c0024=_0x2d2f61 instanceof Error?_0x2d2f61[_0x30576c(0x195)]:String(_0x2d2f61);return _0x2c0024['includes']('404')||_0x2c0024[_0x30576c(0x1aa)]()['includes'](_0x30576c(0x1b7))?console['log'](a5_0x809fd0[_0x30576c(0x1b9)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x4d67ad['agentName'])):console['log'](a5_0x809fd0[_0x30576c(0x1b9)](_0x30576c(0x1a6)+_0x4d67ad['agentName']+_0x30576c(0x1f5)+_0x2c0024)),0x1;}let _0x260687;if(!_0x484cc9)try{_0x260687=await setupEvaluatorAgent(_0x1f1d77[_0x30576c(0x1b3)],_0x26664c[_0x30576c(0x1e4)]);}catch(_0x473a96){const _0x5cbc15=_0x473a96 instanceof Error?_0x473a96[_0x30576c(0x195)]:String(_0x473a96);return console['log'](a5_0x809fd0[_0x30576c(0x1b9)](_0x30576c(0x17f)+_0x5cbc15)),0x1;}console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x1f8)](_0x30576c(0x1d5))),console['log'](_0x30576c(0x166)+a5_0x809fd0[_0x30576c(0x1ae)](_0x4f7359)),console[_0x30576c(0x164)]('Agent:\x20'+a5_0x809fd0[_0x30576c(0x1ae)](_0x4d67ad[_0x30576c(0x1c0)]+'/'+_0x4d67ad['agentName'])),console[_0x30576c(0x164)]();const _0x5288c7=[],_0x4db4c8=[],_0x4c6ad4=Date[_0x30576c(0x1b6)]();for(let _0xf56221=0x0;_0xf56221<_0x483b22[_0x30576c(0x1e1)];_0xf56221++){const _0x1b25f8=_0x483b22[_0xf56221];_0x483b22[_0x30576c(0x1e1)]>0x1?console[_0x30576c(0x164)](_0x30576c(0x183)+(_0xf56221+0x1)+'/'+_0x483b22['length']+':\x20'+a5_0x809fd0[_0x30576c(0x1ae)](_0x1b25f8[_0x30576c(0x1b4)])):console[_0x30576c(0x164)](_0x30576c(0x16d)+a5_0x809fd0[_0x30576c(0x1ae)](_0x1b25f8[_0x30576c(0x1b4)]));const _0x34b29c=createCommandSpinner(_0x30576c(0x17b)+_0x1b25f8[_0x30576c(0x190)][_0x30576c(0x1e1)]+_0x30576c(0x19a));_0x34b29c[_0x30576c(0x197)]();try{const {result:_0x19f29d,conversation:_0x259c76}=await runTest(_0x1f1d77['llm'],_0x1b25f8,{'agentId':_0x439653,'projectId':_0x293a31,'site':_0x4f7359,'noEval':_0x484cc9,'evaluatorId':_0x260687,'onRoundStart':(_0x4b59de,_0x2c51c6)=>{const _0x21e425=_0x30576c;_0x34b29c['text']='Round\x20'+(_0x4b59de+0x1)+'/'+_0x2c51c6+_0x21e425(0x19a);},'onRoundComplete':(_0x47dbd6,_0xd415ad,_0x307eed)=>{const _0xf8441d=_0x30576c,_0x466b14=formatElapsed(_0xd415ad);_0x307eed?console[_0xf8441d(0x164)](_0xf8441d(0x1cd)+(_0x47dbd6+0x1)+'/'+_0x1b25f8[_0xf8441d(0x190)][_0xf8441d(0x1e1)]+_0xf8441d(0x1c1)+a5_0x809fd0[_0xf8441d(0x1ed)]('✓')+'\x20('+_0x466b14+')'):console['log'](_0xf8441d(0x1cd)+(_0x47dbd6+0x1)+'/'+_0x1b25f8[_0xf8441d(0x190)]['length']+_0xf8441d(0x1c1)+a5_0x809fd0['red']('✗'));},'onEvaluationStart':()=>{const _0x2e240c=_0x30576c;_0x34b29c['text']=_0x2e240c(0x1d0);},'onEvaluationComplete':_0x488582=>{const _0x2eca8d=_0x30576c,_0x5def32=formatElapsed(_0x488582);console['log'](_0x2eca8d(0x1dd)+a5_0x809fd0[_0x2eca8d(0x1ed)]('✓')+'\x20('+_0x5def32+')');}});_0x34b29c[_0x30576c(0x1a8)](),_0x5288c7[_0x30576c(0x16c)](_0x19f29d),_0x4db4c8[_0x30576c(0x16c)](_0x259c76);if(_0x19f29d[_0x30576c(0x1cf)]==='PASS')console[_0x30576c(0x164)](a5_0x809fd0['green'](_0x30576c(0x1ea)+_0x19f29d[_0x30576c(0x1f2)]));else _0x19f29d[_0x30576c(0x1cf)]===_0x30576c(0x1d3)?console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x1b9)](_0x30576c(0x1fd)+_0x19f29d['reason'])):console[_0x30576c(0x164)](a5_0x809fd0['red'](_0x30576c(0x1ad)+_0x19f29d[_0x30576c(0x1f2)]));_0x19f29d[_0x30576c(0x1ef)]&&console['log'](a5_0x809fd0[_0x30576c(0x180)](_0x30576c(0x1c5)+_0x19f29d[_0x30576c(0x1ef)])),console[_0x30576c(0x164)]();}catch(_0x54fb17){_0x34b29c['stop']();const _0x551bab=_0x54fb17 instanceof Error?_0x54fb17[_0x30576c(0x195)]:String(_0x54fb17);console['log'](a5_0x809fd0[_0x30576c(0x1b9)]('✗\x20ERROR:\x20'+_0x551bab)),console[_0x30576c(0x164)](),_0x5288c7[_0x30576c(0x16c)]({'name':_0x1b25f8[_0x30576c(0x1b4)],'status':_0x30576c(0x1e6),'reason':_0x551bab,'timestamp':new Date()[_0x30576c(0x1d7)](),'duration_ms':0x0});}}const _0x55657e=Date[_0x30576c(0x1b6)]()-_0x4c6ad4,_0x3fc24e=_0x5288c7['filter'](_0x3bcfda=>_0x3bcfda[_0x30576c(0x1cf)]===_0x30576c(0x1bf))[_0x30576c(0x1e1)],_0x4f4590=_0x5288c7['filter'](_0x4893e6=>_0x4893e6[_0x30576c(0x1cf)]==='FAIL')['length'],_0x4653b=_0x5288c7['filter'](_0x4bffc8=>_0x4bffc8[_0x30576c(0x1cf)]===_0x30576c(0x1e6))[_0x30576c(0x1e1)];console[_0x30576c(0x164)]('━'[_0x30576c(0x186)](0x3c)),console[_0x30576c(0x164)](_0x30576c(0x1e0)),console[_0x30576c(0x164)]('━'[_0x30576c(0x186)](0x3c)),console[_0x30576c(0x164)](_0x30576c(0x185)+_0x5288c7['length']),console[_0x30576c(0x164)](_0x30576c(0x16a)+a5_0x809fd0['green'](_0x3fc24e)),console['log']('Failed:\x20\x20\x20'+a5_0x809fd0['red'](_0x4f4590));_0x4653b>0x0&&console[_0x30576c(0x164)](_0x30576c(0x1ab)+a5_0x809fd0[_0x30576c(0x1b9)](_0x4653b));console[_0x30576c(0x164)](_0x30576c(0x188)+formatElapsed(_0x55657e)),console[_0x30576c(0x164)]('━'[_0x30576c(0x186)](0x3c));const _0x221403=_0x5288c7[_0x30576c(0x16b)](_0x3e4e4e=>_0x3e4e4e[_0x30576c(0x1cf)]!=='PASS');if(_0x221403['length']>0x0){console[_0x30576c(0x164)](),console['log'](_0x30576c(0x1c8));for(const _0x9ea1d5 of _0x221403){const _0x4ccb7f=a5_0x809fd0[_0x30576c(0x1b9)]('✗'),_0x3df8b3=_0x9ea1d5[_0x30576c(0x1f2)][_0x30576c(0x1e1)]>0x32?_0x9ea1d5[_0x30576c(0x1f2)][_0x30576c(0x19d)](0x0,0x32)+_0x30576c(0x1d6):_0x9ea1d5[_0x30576c(0x1f2)];console[_0x30576c(0x164)]('\x20\x20'+_0x4ccb7f+'\x20'+_0x9ea1d5['name']+':\x20'+_0x3df8b3);}}const _0x44e875={'summary':{'total':_0x5288c7[_0x30576c(0x1e1)],'passed':_0x3fc24e,'failed':_0x4f4590,'errors':_0x4653b>0x0?_0x4653b:undefined,'duration_ms':_0x55657e},'tests':_0x5288c7,'agent':{'project':_0x4d67ad[_0x30576c(0x1c0)],'name':_0x4d67ad[_0x30576c(0x1df)],'site':_0x4f7359},'timestamp':new Date(_0x4c6ad4)[_0x30576c(0x1d7)]()};try{const _0x58b170=buildCachedTestRun(_0x4db4c8,{'site':_0x4f7359,'projectId':_0x293a31,'projectName':_0x4d67ad[_0x30576c(0x1c0)],'agentId':_0x439653,'agentName':_0x4d67ad[_0x30576c(0x1df)],'testYmlPath':a5_0x439b96[_0x30576c(0x1fc)](_0x4d67ad[_0x30576c(0x1af)])});saveLastTestRun(_0x58b170);}catch{}if(_0x1305ca!=='table'||_0x3f55bf){const _0x20f441=formatResults(_0x44e875,_0x1305ca);if(_0x3f55bf)try{a5_0x2a94c5[_0x30576c(0x19c)](_0x3f55bf,_0x20f441,_0x30576c(0x1c9)),console['log'](),console['log'](a5_0x809fd0['dim'](_0x30576c(0x1c4)+_0x3f55bf));}catch(_0x1d9c7c){return console[_0x30576c(0x164)](),console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x1b9)]('Error\x20writing\x20output\x20file:\x20'+_0x1d9c7c)),0x1;}else console[_0x30576c(0x164)](),console[_0x30576c(0x164)](_0x20f441);}return _0x221403[_0x30576c(0x1e1)]>0x0?0x1:0x0;}async[a5_0x3f0b29(0x18a)](_0x5c6e02,_0x98b6e1){const _0x4dd8b9=a5_0x3f0b29,{options:_0x2e27da,tdx:_0x579122}=_0x5c6e02,{definition:_0x3577d5,agentInfo:_0x118bd2,outputFormat:_0x328f46,outputFile:_0x2c2182}=_0x98b6e1,_0x47fe31=_0x2e27da['site'],_0x3a0b64=loadLastTestRun();if(!_0x3a0b64)return console['log'](a5_0x809fd0['red'](_0x4dd8b9(0x1dc))),console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x180)](_0x4dd8b9(0x1de))),0x1;if(_0x3a0b64[_0x4dd8b9(0x196)][_0x4dd8b9(0x1df)]!==_0x118bd2[_0x4dd8b9(0x1df)])return console['log'](a5_0x809fd0['red']('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x3a0b64[_0x4dd8b9(0x196)]['agentName']+_0x4dd8b9(0x182)+_0x118bd2['agentName']+'\x22.')),console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x180)](_0x4dd8b9(0x1a2))),0x1;const _0x15f693=new Set(_0x3a0b64[_0x4dd8b9(0x1cb)]['map'](_0x151747=>_0x151747['testName'])),_0x35f4b3=_0x3577d5[_0x4dd8b9(0x18e)][_0x4dd8b9(0x16b)](_0x5926b5=>!_0x15f693[_0x4dd8b9(0x1c7)](_0x5926b5[_0x4dd8b9(0x1b4)]));if(_0x35f4b3[_0x4dd8b9(0x1e1)]>0x0&&_0x3a0b64['site']!==_0x47fe31)return console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x1b9)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x180)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x3a0b64[_0x4dd8b9(0x17c)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x47fe31+'\x22.')),console[_0x4dd8b9(0x164)](a5_0x809fd0['dim']('Either\x20switch\x20to\x20the\x20\x22'+_0x3a0b64['site']+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x1086b5=_0x3577d5['tests'][_0x4dd8b9(0x16b)](_0x496655=>_0x15f693['has'](_0x496655['name'])),_0x241a2a=_0x35f4b3;let _0xd19f03;try{_0xd19f03=await setupEvaluatorAgent(_0x579122[_0x4dd8b9(0x1b3)],_0x2e27da[_0x4dd8b9(0x1e4)]);}catch(_0x17f81d){const _0xeeb73=_0x17f81d instanceof Error?_0x17f81d['message']:String(_0x17f81d);return console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x1b9)](_0x4dd8b9(0x17f)+_0xeeb73)),0x1;}console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x1f8)](_0x4dd8b9(0x19b))),console[_0x4dd8b9(0x164)](_0x4dd8b9(0x1a9)+a5_0x809fd0['white'](_0x3a0b64[_0x4dd8b9(0x1f7)])),console['log'](_0x4dd8b9(0x1f0)+a5_0x809fd0[_0x4dd8b9(0x1ae)](_0x3a0b64[_0x4dd8b9(0x196)][_0x4dd8b9(0x1c0)]+'/'+_0x3a0b64[_0x4dd8b9(0x196)][_0x4dd8b9(0x1df)]));_0x241a2a[_0x4dd8b9(0x1e1)]>0x0&&console[_0x4dd8b9(0x164)](_0x4dd8b9(0x1eb)+a5_0x809fd0['yellow'](_0x241a2a['length']));console[_0x4dd8b9(0x164)]();const _0xec4570=[],_0x2819fd=Date[_0x4dd8b9(0x1b6)](),_0x1da302=createCommandSpinner(_0x4dd8b9(0x1e3));if(_0x1086b5['length']>0x0)try{const _0x53ed0f=await reevaluateFromCache(_0x579122['llm'],_0x3a0b64,{'tests':_0x1086b5},{'evaluatorId':_0xd19f03,'onTestStart':(_0x3a0de3,_0x52bd94,_0x296a83)=>{const _0x176d0a=_0x4dd8b9;_0x1da302[_0x176d0a(0x18b)]=_0x176d0a(0x17a)+(_0x52bd94+0x1)+'/'+_0x296a83+':\x20'+_0x3a0de3+_0x176d0a(0x1d6);if(!_0x1da302[_0x176d0a(0x1b0)])_0x1da302[_0x176d0a(0x197)]();},'onTestComplete':(_0x325b27,_0x286a2c)=>{const _0x22715c=_0x4dd8b9;_0x1da302[_0x22715c(0x1a8)]();if(_0x286a2c['status']===_0x22715c(0x1bf))console[_0x22715c(0x164)](a5_0x809fd0[_0x22715c(0x1ed)]('✓\x20PASS:\x20'+_0x325b27)+a5_0x809fd0['dim'](_0x22715c(0x169)));else _0x286a2c[_0x22715c(0x1cf)]===_0x22715c(0x1d3)?console[_0x22715c(0x164)](a5_0x809fd0[_0x22715c(0x1b9)](_0x22715c(0x1fd)+_0x325b27+_0x22715c(0x191)+_0x286a2c[_0x22715c(0x1f2)])+a5_0x809fd0['dim'](_0x22715c(0x169))):console[_0x22715c(0x164)](a5_0x809fd0[_0x22715c(0x1b9)](_0x22715c(0x1ad)+_0x325b27+'\x20-\x20'+_0x286a2c[_0x22715c(0x1f2)]));_0x286a2c['conversation_url']&&console[_0x22715c(0x164)](a5_0x809fd0[_0x22715c(0x180)](_0x22715c(0x1b2)+_0x286a2c['conversation_url'])),_0xec4570[_0x22715c(0x16c)](_0x286a2c);},'onTestSkipped':(_0x5158f3,_0x1f3822)=>{const _0x4d3272=_0x4dd8b9;_0x1da302['stop'](),console[_0x4d3272(0x164)](a5_0x809fd0[_0x4d3272(0x189)]('⚠\x20SKIPPED:\x20'+_0x5158f3+_0x4d3272(0x191)+_0x1f3822));}});for(const _0x2306a6 of _0x53ed0f){!_0xec4570[_0x4dd8b9(0x1cc)](_0x37de69=>_0x37de69['name']===_0x2306a6[_0x4dd8b9(0x1b4)])&&_0xec4570['push'](_0x2306a6);}}catch(_0x250386){_0x1da302['stop']();const _0x4d9608=_0x250386 instanceof Error?_0x250386[_0x4dd8b9(0x195)]:String(_0x250386);return console['log'](a5_0x809fd0[_0x4dd8b9(0x1b9)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x4d9608)),0x1;}_0x1da302[_0x4dd8b9(0x1a8)]();if(_0x241a2a[_0x4dd8b9(0x1e1)]>0x0){console[_0x4dd8b9(0x164)](),console['log'](a5_0x809fd0[_0x4dd8b9(0x1f8)](_0x4dd8b9(0x1b5)));const {projectId:_0x50630b,agentId:_0x4c377a}=_0x3a0b64['agent'];for(const _0x24f326 of _0x241a2a){console[_0x4dd8b9(0x164)](_0x4dd8b9(0x1a4)+a5_0x809fd0[_0x4dd8b9(0x1ae)](_0x24f326[_0x4dd8b9(0x1b4)]));const _0x14aee2=createCommandSpinner(_0x4dd8b9(0x17b)+_0x24f326[_0x4dd8b9(0x190)]['length']+_0x4dd8b9(0x19a));_0x14aee2[_0x4dd8b9(0x197)]();try{const {result:_0x3beee5}=await runTest(_0x579122[_0x4dd8b9(0x1b3)],_0x24f326,{'agentId':_0x4c377a,'projectId':_0x50630b,'site':_0x3a0b64['site'],'noEval':![],'evaluatorId':_0xd19f03,'onRoundStart':(_0x1f10ac,_0x2d0852)=>{const _0x2ff675=_0x4dd8b9;_0x14aee2[_0x2ff675(0x18b)]=_0x2ff675(0x1f1)+(_0x1f10ac+0x1)+'/'+_0x2d0852+_0x2ff675(0x19a);},'onRoundComplete':(_0x30765a,_0x481263,_0x59edd6)=>{const _0x3e91a1=_0x4dd8b9,_0x1db375=formatElapsed(_0x481263);_0x59edd6?console[_0x3e91a1(0x164)](_0x3e91a1(0x1cd)+(_0x30765a+0x1)+'/'+_0x24f326['rounds'][_0x3e91a1(0x1e1)]+_0x3e91a1(0x1c1)+a5_0x809fd0[_0x3e91a1(0x1ed)]('✓')+'\x20('+_0x1db375+')'):console[_0x3e91a1(0x164)](_0x3e91a1(0x1cd)+(_0x30765a+0x1)+'/'+_0x24f326['rounds'][_0x3e91a1(0x1e1)]+'...\x20'+a5_0x809fd0['red']('✗'));},'onEvaluationStart':()=>{const _0x2b2b28=_0x4dd8b9;_0x14aee2[_0x2b2b28(0x18b)]=_0x2b2b28(0x1d0);},'onEvaluationComplete':_0x138940=>{const _0x4124a2=_0x4dd8b9,_0x397c1e=formatElapsed(_0x138940);console[_0x4124a2(0x164)](_0x4124a2(0x1dd)+a5_0x809fd0[_0x4124a2(0x1ed)]('✓')+'\x20('+_0x397c1e+')');}});_0x14aee2[_0x4dd8b9(0x1a8)](),_0xec4570[_0x4dd8b9(0x16c)](_0x3beee5);if(_0x3beee5[_0x4dd8b9(0x1cf)]==='PASS')console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x1ed)](_0x4dd8b9(0x1ea)+_0x3beee5[_0x4dd8b9(0x1f2)])+a5_0x809fd0[_0x4dd8b9(0x180)](_0x4dd8b9(0x1c3)));else _0x3beee5['status']===_0x4dd8b9(0x1d3)?console[_0x4dd8b9(0x164)](a5_0x809fd0['red']('✗\x20FAIL:\x20'+_0x3beee5[_0x4dd8b9(0x1f2)])+a5_0x809fd0[_0x4dd8b9(0x180)](_0x4dd8b9(0x1c3))):console['log'](a5_0x809fd0[_0x4dd8b9(0x1b9)]('✗\x20ERROR:\x20'+_0x3beee5[_0x4dd8b9(0x1f2)]));_0x3beee5[_0x4dd8b9(0x1ef)]&&console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x180)](_0x4dd8b9(0x1b2)+_0x3beee5[_0x4dd8b9(0x1ef)]));}catch(_0x2fb8cf){_0x14aee2[_0x4dd8b9(0x1a8)]();const _0x40820b=_0x2fb8cf instanceof Error?_0x2fb8cf[_0x4dd8b9(0x195)]:String(_0x2fb8cf);console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x1b9)](_0x4dd8b9(0x1ad)+_0x40820b)),_0xec4570[_0x4dd8b9(0x16c)]({'name':_0x24f326[_0x4dd8b9(0x1b4)],'status':_0x4dd8b9(0x1e6),'reason':_0x40820b,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console['log']();const _0x1a88f7=Date['now']()-_0x2819fd,_0x14f481=_0xec4570['filter'](_0x4accb3=>_0x4accb3[_0x4dd8b9(0x1cf)]===_0x4dd8b9(0x1bf))['length'],_0x129e0f=_0xec4570['filter'](_0x327f78=>_0x327f78[_0x4dd8b9(0x1cf)]===_0x4dd8b9(0x1d3))[_0x4dd8b9(0x1e1)],_0x14c2bc=_0xec4570[_0x4dd8b9(0x16b)](_0x4db3e3=>_0x4db3e3[_0x4dd8b9(0x1cf)]===_0x4dd8b9(0x1e6))[_0x4dd8b9(0x1e1)];console[_0x4dd8b9(0x164)]('━'[_0x4dd8b9(0x186)](0x3c)),console[_0x4dd8b9(0x164)](_0x4dd8b9(0x192)),console[_0x4dd8b9(0x164)]('━'[_0x4dd8b9(0x186)](0x3c)),console[_0x4dd8b9(0x164)](_0x4dd8b9(0x185)+_0xec4570['length']),console[_0x4dd8b9(0x164)]('Passed:\x20\x20\x20'+a5_0x809fd0['green'](_0x14f481)),console[_0x4dd8b9(0x164)]('Failed:\x20\x20\x20'+a5_0x809fd0[_0x4dd8b9(0x1b9)](_0x129e0f));_0x14c2bc>0x0&&console[_0x4dd8b9(0x164)](_0x4dd8b9(0x1ab)+a5_0x809fd0['red'](_0x14c2bc));console['log']('Duration:\x20'+formatElapsed(_0x1a88f7)),console[_0x4dd8b9(0x164)]('━'[_0x4dd8b9(0x186)](0x3c));const _0x523ba1={'summary':{'total':_0xec4570['length'],'passed':_0x14f481,'failed':_0x129e0f,'errors':_0x14c2bc>0x0?_0x14c2bc:undefined,'duration_ms':_0x1a88f7},'tests':_0xec4570,'agent':{'project':_0x118bd2['projectName'],'name':_0x118bd2[_0x4dd8b9(0x1df)],'site':_0x47fe31},'timestamp':new Date(_0x2819fd)['toISOString']()};if(_0x328f46!==_0x4dd8b9(0x162)||_0x2c2182){const _0x26b329=formatResults(_0x523ba1,_0x328f46);if(_0x2c2182)try{a5_0x2a94c5[_0x4dd8b9(0x19c)](_0x2c2182,_0x26b329,_0x4dd8b9(0x1c9)),console[_0x4dd8b9(0x164)](),console['log'](a5_0x809fd0[_0x4dd8b9(0x180)]('Output\x20written\x20to:\x20'+_0x2c2182));}catch(_0x438299){return console['log'](),console['log'](a5_0x809fd0[_0x4dd8b9(0x1b9)](_0x4dd8b9(0x19f)+_0x438299)),0x1;}else console[_0x4dd8b9(0x164)](),console[_0x4dd8b9(0x164)](_0x26b329);}const _0x3305b4=_0xec4570[_0x4dd8b9(0x16b)](_0x70b784=>_0x70b784['status']!==_0x4dd8b9(0x1bf));return _0x3305b4['length']>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x36469d=a6_0x1862;(function(_0x59598b,_0x12b931){const _0xdca2f5=a6_0x1862,_0x589fd8=_0x59598b();while(!![]){try{const _0x4c36c4=-parseInt(_0xdca2f5(0x10a))/0x1*(-parseInt(_0xdca2f5(0x10b))/0x2)+-parseInt(_0xdca2f5(0xe3))/0x3+-parseInt(_0xdca2f5(0xde))/0x4+-parseInt(_0xdca2f5(0x104))/0x5*(-parseInt(_0xdca2f5(0xe6))/0x6)+parseInt(_0xdca2f5(0xdb))/0x7*(parseInt(_0xdca2f5(0x113))/0x8)+-parseInt(_0xdca2f5(0x10d))/0x9*(parseInt(_0xdca2f5(0xdd))/0xa)+parseInt(_0xdca2f5(0x117))/0xb;if(_0x4c36c4===_0x12b931)break;else _0x589fd8['push'](_0x589fd8['shift']());}catch(_0x39de03){_0x589fd8['push'](_0x589fd8['shift']());}}}(a6_0x4212,0x5558f));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';function a6_0x1862(_0x3d2936,_0x29e466){_0x3d2936=_0x3d2936-0xd2;const _0x4212ce=a6_0x4212();let _0x186203=_0x4212ce[_0x3d2936];return _0x186203;}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_0x36469d(0x10f),a6_0x36469d(0xf8),a6_0x36469d(0x103),a6_0x36469d(0x10c),a6_0x36469d(0x11c),'x-xsrf-token','x-auth-token',a6_0x36469d(0xe4)]);function isSensitiveHeader(_0x3782c4){const _0x144520=a6_0x36469d;return SENSITIVE_HEADERS['has'](_0x3782c4[_0x144520(0x100)]());}function parseHeader(_0x1e69a3){const _0x2027b6=a6_0x36469d,_0x382863=_0x1e69a3[_0x2027b6(0x101)](':');if(_0x382863===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x1e69a3+_0x2027b6(0xfd)+_0x2027b6(0xeb));const _0x2e4b80=_0x1e69a3[_0x2027b6(0x110)](0x0,_0x382863)[_0x2027b6(0xd5)](),_0x424af4=_0x1e69a3[_0x2027b6(0x110)](_0x382863+0x1)[_0x2027b6(0xd5)]();if(!_0x2e4b80)throw new Error(_0x2027b6(0xf9)+_0x1e69a3+'\x22');return[_0x2e4b80,_0x424af4];}function a6_0x4212(){const _0x126b6b=['x-trino-user','noColor','9480lJvNWT','status','body','POST','readBodyFromFile','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','data','headers','api','workflow','color','\x0aStack\x20trace:\x0a','type','site','trino','llm-proxy','keys','join','proxy-authorization','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','toUpperCase','error','verbose','\x22.\x20','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','output','toLowerCase','indexOf','Endpoint\x20must\x20start\x20with\x20/:\x20','cookie','1420wuOOsR','DELETE','includes','stack','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','.\x20Valid\x20types:\x20','1HBvmyG','1110278lncvpl','set-cookie','9RujHpc','Error:\x20','authorization','substring','cdp','GET','1113608TeSvtE','startsWith','PATCH','llm','4250180PaSvFg','message','Results\x20saved\x20to\x20','.\x20Valid\x20methods:\x20','entries','set-cookie2','Invalid\x20API\x20type:\x20','file','isArray','trim','name','Invalid\x20HTTP\x20method:\x20','length','method','request','7CjaXrg','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','6671710JcUCeO','1528276Wtecog','header','description','execute','validate','391851oKQyzr'];a6_0x4212=function(){return _0x126b6b;};return a6_0x4212();}export class ApiCommand extends BaseCommand{[a6_0x36469d(0xd6)]=a6_0x36469d(0xee);[a6_0x36469d(0xe0)]=a6_0x36469d(0xfe);[a6_0x36469d(0xe2)](_0x39eceb){const _0x2af099=a6_0x36469d,{args:_0x49480e,options:_0x5cbfb4}=_0x39eceb,_0x4da227=_0x5cbfb4;if(_0x49480e[_0x2af099(0xd8)]===0x0)return _0x2af099(0x108);const _0x18fa2c=_0x49480e[0x0];if(!_0x18fa2c[_0x2af099(0x114)]('/'))return _0x2af099(0x102)+_0x18fa2c;const _0x11e87d=_0x4da227[_0x2af099(0xec)],_0x487ea5=_0x4da227[_0x2af099(0xd3)];if(_0x11e87d&&_0x487ea5)return _0x2af099(0xdc);const _0x5a244a=_0x4da227[_0x2af099(0xd9)]||_0x2af099(0x112),_0x351aa3=['GET',_0x2af099(0xe9),'PUT',_0x2af099(0x105),_0x2af099(0x115)];if(!_0x351aa3['includes'](_0x5a244a[_0x2af099(0xfa)]()))return _0x2af099(0xd7)+_0x5a244a+_0x2af099(0x11a)+_0x351aa3[_0x2af099(0xf7)](',\x20');const _0x6e6f2=_0x4da227[_0x2af099(0xf2)]||'td',_0x4914d4=['td',_0x2af099(0x111),_0x2af099(0xef),_0x2af099(0xf4),_0x2af099(0x116),_0x2af099(0xf5),'cas'];if(!_0x4914d4[_0x2af099(0x106)](_0x6e6f2))return _0x2af099(0xd2)+_0x6e6f2+_0x2af099(0x109)+_0x4914d4[_0x2af099(0xf7)](',\x20');return undefined;}async[a6_0x36469d(0xe1)](_0x4f0a71){const _0x2993a5=a6_0x36469d,{options:_0x4b5ca4,args:_0x420998,tdx:_0x4c6230}=_0x4f0a71,_0x442a6c=_0x4b5ca4,_0x35a9c5=_0x420998[0x0],_0xeef9ba=(_0x442a6c[_0x2993a5(0xd9)]||'GET')[_0x2993a5(0xfa)](),_0x51d0f9=_0x442a6c['data'],_0x2f4294=_0x442a6c['file'],_0x3219e2=_0x442a6c[_0x2993a5(0xdf)],_0x1c7441=_0x442a6c[_0x2993a5(0xf2)]||'td';try{const _0xea7e3c={};if(_0x3219e2){const _0x1f54fb=Array[_0x2993a5(0xd4)](_0x3219e2)?_0x3219e2:[_0x3219e2];for(const _0x1e5260 of _0x1f54fb){const [_0x53c7c9,_0x5f3132]=parseHeader(_0x1e5260);_0xea7e3c[_0x53c7c9]=_0x5f3132;}}let _0x224e4e;if(_0x51d0f9)_0x224e4e=_0x51d0f9;else{if(_0x2f4294)try{_0x224e4e=RawAPI[_0x2993a5(0xea)](_0x2f4294);}catch(_0x80d8cc){return console[_0x2993a5(0xfb)](_0x2993a5(0x10e)+(_0x80d8cc instanceof Error?_0x80d8cc[_0x2993a5(0x118)]:String(_0x80d8cc))),0x1;}}const _0x5d3d3e={'method':_0xeef9ba,'apiType':_0x1c7441,'includeHeaders':_0x4b5ca4[_0x2993a5(0xfc)]};_0x224e4e&&(_0x5d3d3e[_0x2993a5(0xe8)]=_0x224e4e);Object[_0x2993a5(0xf6)](_0xea7e3c)['length']>0x0&&(_0x5d3d3e['headers']=_0xea7e3c);if(_0x4b5ca4[_0x2993a5(0xfc)]){const _0x217645=resolveSite(_0x4b5ca4[_0x2993a5(0xf3)]),_0x5ad69f=getEndpoint(_0x217645,_0x1c7441),_0x5cb5b7=''+_0x5ad69f+_0x35a9c5;console[_0x2993a5(0xfb)]('>\x20'+_0xeef9ba+'\x20'+_0x5cb5b7);const _0x54d993=getAuthHeaders(_0x217645),_0x3211f5={..._0x54d993,..._0xea7e3c};for(const [_0x49b427,_0xfe42c7]of Object[_0x2993a5(0x11b)](_0x3211f5)){!isSensitiveHeader(_0x49b427)&&console[_0x2993a5(0xfb)]('>\x20'+_0x49b427+':\x20'+_0xfe42c7);}_0x224e4e&&console[_0x2993a5(0xfb)]('>'),console['error']('');}const _0x2546aa=await _0x4c6230[_0x2993a5(0xee)][_0x2993a5(0xda)](_0x35a9c5,_0x5d3d3e);if(_0x4b5ca4[_0x2993a5(0xfc)]&&_0x2546aa[_0x2993a5(0xed)]){console[_0x2993a5(0xfb)]('<\x20HTTP/1.1\x20'+_0x2546aa[_0x2993a5(0xe7)]);for(const [_0x493b99,_0x5a2e62]of Object[_0x2993a5(0x11b)](_0x2546aa[_0x2993a5(0xed)])){!isSensitiveHeader(_0x493b99)&&console[_0x2993a5(0xfb)]('<\x20'+_0x493b99+':\x20'+_0x5a2e62);}console[_0x2993a5(0xfb)]('');}const _0xd1df2e=Boolean(_0x4b5ca4[_0x2993a5(0xff)]),_0x2b1bd1={'color':_0x4b5ca4[_0x2993a5(0xf0)],'noColor':_0x4b5ca4[_0x2993a5(0xe5)]||_0xd1df2e&&!_0x4b5ca4[_0x2993a5(0xf0)]},_0x11daeb=colorizeJSON(_0x2546aa[_0x2993a5(0xec)],_0x2b1bd1);return _0x4b5ca4[_0x2993a5(0xff)]?(writeFileSync(_0x4b5ca4['output'],_0x11daeb),console[_0x2993a5(0xfb)](_0x2993a5(0x119)+_0x4b5ca4[_0x2993a5(0xff)])):console['log'](_0x11daeb),0x0;}catch(_0x5697f4){return _0x5697f4 instanceof Error?(console[_0x2993a5(0xfb)](_0x2993a5(0x10e)+_0x5697f4[_0x2993a5(0x118)]),_0x4b5ca4[_0x2993a5(0xfc)]&&_0x5697f4['stack']&&console['error'](_0x2993a5(0xf1)+_0x5697f4[_0x2993a5(0x107)])):console[_0x2993a5(0xfb)](_0x2993a5(0x10e)+String(_0x5697f4)),0x1;}}}
1
+ const a6_0x37d9f4=a6_0x5001;(function(_0x35a725,_0x440c8e){const _0x4b49a1=a6_0x5001,_0x361909=_0x35a725();while(!![]){try{const _0x2f038e=parseInt(_0x4b49a1(0x1fb))/0x1*(parseInt(_0x4b49a1(0x205))/0x2)+-parseInt(_0x4b49a1(0x1d5))/0x3+-parseInt(_0x4b49a1(0x1d3))/0x4*(parseInt(_0x4b49a1(0x1ee))/0x5)+parseInt(_0x4b49a1(0x1fc))/0x6+-parseInt(_0x4b49a1(0x1f2))/0x7+parseInt(_0x4b49a1(0x214))/0x8+-parseInt(_0x4b49a1(0x1f4))/0x9;if(_0x2f038e===_0x440c8e)break;else _0x361909['push'](_0x361909['shift']());}catch(_0x5c92bb){_0x361909['push'](_0x361909['shift']());}}}(a6_0x436e,0xd00c7));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_0x436e(){const _0x808cd1=['trim','error','Error:\x20','<\x20HTTP/1.1\x20','status','stack','substring','execute','authorization','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','header','color','startsWith','llm-proxy','file','api','noColor','Endpoint\x20must\x20start\x20with\x20/:\x20','DELETE','name','x-auth-token','13970oiQXDL','set-cookie','body','data','6959316dxZbKf','toUpperCase','9916389VjOhbw','proxy-authorization','entries','Invalid\x20API\x20type:\x20','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','includes','join','56rVuJkA','1923216bYxEFx','verbose','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','output','PUT','indexOf','.\x20Valid\x20types:\x20','.\x20Valid\x20methods:\x20','Invalid\x20HTTP\x20method:\x20','56998XSzyVg','keys','POST','Invalid\x20header\x20format:\x20\x22','length','isArray','cas','headers','type','has','message','description','validate','readBodyFromFile','GET','12896520KGQNfz','x-trino-user','toLowerCase','trino','site','method','328bDBrad','cdp','1053783MBwJmW','workflow','cookie','set-cookie2'];a6_0x436e=function(){return _0x808cd1;};return a6_0x436e();}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x37d9f4(0x1e1),a6_0x37d9f4(0x1f5),a6_0x37d9f4(0x1d7),a6_0x37d9f4(0x1ef),a6_0x37d9f4(0x1d8),'x-xsrf-token',a6_0x37d9f4(0x1ed),a6_0x37d9f4(0x215)]);function a6_0x5001(_0x764039,_0x2f7689){_0x764039=_0x764039-0x1cf;const _0x436e9e=a6_0x436e();let _0x5001bf=_0x436e9e[_0x764039];return _0x5001bf;}function isSensitiveHeader(_0x6b4214){const _0x252497=a6_0x37d9f4;return SENSITIVE_HEADERS[_0x252497(0x20e)](_0x6b4214[_0x252497(0x1cf)]());}function parseHeader(_0x103a71){const _0x56640b=a6_0x37d9f4,_0x1485a0=_0x103a71[_0x56640b(0x201)](':');if(_0x1485a0===-0x1)throw new Error(_0x56640b(0x208)+_0x103a71+'\x22.\x20'+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x4a3a16=_0x103a71[_0x56640b(0x1df)](0x0,_0x1485a0)[_0x56640b(0x1d9)](),_0x3b5063=_0x103a71[_0x56640b(0x1df)](_0x1485a0+0x1)['trim']();if(!_0x4a3a16)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x103a71+'\x22');return[_0x4a3a16,_0x3b5063];}export class ApiCommand extends BaseCommand{[a6_0x37d9f4(0x1ec)]=a6_0x37d9f4(0x1e8);[a6_0x37d9f4(0x210)]=a6_0x37d9f4(0x1fe);[a6_0x37d9f4(0x211)](_0x17c57a){const _0x421852=a6_0x37d9f4,{args:_0xb7208f,options:_0x24c2b4}=_0x17c57a,_0x407dc0=_0x24c2b4;if(_0xb7208f[_0x421852(0x209)]===0x0)return _0x421852(0x1f8);const _0x4e4eed=_0xb7208f[0x0];if(!_0x4e4eed[_0x421852(0x1e5)]('/'))return _0x421852(0x1ea)+_0x4e4eed;const _0x20f554=_0x407dc0['data'],_0xe08855=_0x407dc0['file'];if(_0x20f554&&_0xe08855)return _0x421852(0x1e2);const _0x112f30=_0x407dc0[_0x421852(0x1d2)]||'GET',_0x3f994f=[_0x421852(0x213),_0x421852(0x207),_0x421852(0x200),_0x421852(0x1eb),'PATCH'];if(!_0x3f994f['includes'](_0x112f30[_0x421852(0x1f3)]()))return _0x421852(0x204)+_0x112f30+_0x421852(0x203)+_0x3f994f[_0x421852(0x1fa)](',\x20');const _0x4562b4=_0x407dc0[_0x421852(0x20d)]||'td',_0x36e353=['td',_0x421852(0x1d4),_0x421852(0x1d6),_0x421852(0x1d0),'llm',_0x421852(0x1e6),_0x421852(0x20b)];if(!_0x36e353[_0x421852(0x1f9)](_0x4562b4))return _0x421852(0x1f7)+_0x4562b4+_0x421852(0x202)+_0x36e353[_0x421852(0x1fa)](',\x20');return undefined;}async[a6_0x37d9f4(0x1e0)](_0x4d813c){const _0x41085c=a6_0x37d9f4,{options:_0x40cf3e,args:_0x1cc354,tdx:_0x2f7538}=_0x4d813c,_0xbd3955=_0x40cf3e,_0x395e14=_0x1cc354[0x0],_0x45a9f3=(_0xbd3955[_0x41085c(0x1d2)]||'GET')['toUpperCase'](),_0x2be955=_0xbd3955[_0x41085c(0x1f1)],_0x12fa15=_0xbd3955[_0x41085c(0x1e7)],_0x64a747=_0xbd3955[_0x41085c(0x1e3)],_0x24c23a=_0xbd3955[_0x41085c(0x20d)]||'td';try{const _0x3bcb14={};if(_0x64a747){const _0x21c5ff=Array[_0x41085c(0x20a)](_0x64a747)?_0x64a747:[_0x64a747];for(const _0x212877 of _0x21c5ff){const [_0xd18dba,_0x14ba7a]=parseHeader(_0x212877);_0x3bcb14[_0xd18dba]=_0x14ba7a;}}let _0x26452f;if(_0x2be955)_0x26452f=_0x2be955;else{if(_0x12fa15)try{_0x26452f=RawAPI[_0x41085c(0x212)](_0x12fa15);}catch(_0x4428e1){return console[_0x41085c(0x1da)](_0x41085c(0x1db)+(_0x4428e1 instanceof Error?_0x4428e1[_0x41085c(0x20f)]:String(_0x4428e1))),0x1;}}const _0x592ce9={'method':_0x45a9f3,'apiType':_0x24c23a,'includeHeaders':_0x40cf3e['verbose']};_0x26452f&&(_0x592ce9[_0x41085c(0x1f0)]=_0x26452f);Object[_0x41085c(0x206)](_0x3bcb14)[_0x41085c(0x209)]>0x0&&(_0x592ce9[_0x41085c(0x20c)]=_0x3bcb14);if(_0x40cf3e[_0x41085c(0x1fd)]){const _0x22ddc2=resolveSite(_0x40cf3e[_0x41085c(0x1d1)]),_0x5aabc8=getEndpoint(_0x22ddc2,_0x24c23a),_0x530cce=''+_0x5aabc8+_0x395e14;console['error']('>\x20'+_0x45a9f3+'\x20'+_0x530cce);const _0x1f8436=getAuthHeaders(_0x22ddc2),_0x26bb99={..._0x1f8436,..._0x3bcb14};for(const [_0x1dcd7c,_0x250531]of Object[_0x41085c(0x1f6)](_0x26bb99)){!isSensitiveHeader(_0x1dcd7c)&&console[_0x41085c(0x1da)]('>\x20'+_0x1dcd7c+':\x20'+_0x250531);}_0x26452f&&console[_0x41085c(0x1da)]('>'),console[_0x41085c(0x1da)]('');}const _0x56ae2f=await _0x2f7538[_0x41085c(0x1e8)]['request'](_0x395e14,_0x592ce9);if(_0x40cf3e['verbose']&&_0x56ae2f[_0x41085c(0x20c)]){console[_0x41085c(0x1da)](_0x41085c(0x1dc)+_0x56ae2f[_0x41085c(0x1dd)]);for(const [_0x30289f,_0xb592c6]of Object[_0x41085c(0x1f6)](_0x56ae2f['headers'])){!isSensitiveHeader(_0x30289f)&&console[_0x41085c(0x1da)]('<\x20'+_0x30289f+':\x20'+_0xb592c6);}console[_0x41085c(0x1da)]('');}const _0x4a430b=Boolean(_0x40cf3e['output']),_0x2c7f9a={'color':_0x40cf3e[_0x41085c(0x1e4)],'noColor':_0x40cf3e[_0x41085c(0x1e9)]||_0x4a430b&&!_0x40cf3e[_0x41085c(0x1e4)]},_0x3af26d=colorizeJSON(_0x56ae2f[_0x41085c(0x1f1)],_0x2c7f9a);return _0x40cf3e[_0x41085c(0x1ff)]?(writeFileSync(_0x40cf3e[_0x41085c(0x1ff)],_0x3af26d),console[_0x41085c(0x1da)]('Results\x20saved\x20to\x20'+_0x40cf3e[_0x41085c(0x1ff)])):console['log'](_0x3af26d),0x0;}catch(_0x4d66e9){return _0x4d66e9 instanceof Error?(console[_0x41085c(0x1da)](_0x41085c(0x1db)+_0x4d66e9['message']),_0x40cf3e[_0x41085c(0x1fd)]&&_0x4d66e9[_0x41085c(0x1de)]&&console[_0x41085c(0x1da)]('\x0aStack\x20trace:\x0a'+_0x4d66e9[_0x41085c(0x1de)])):console[_0x41085c(0x1da)](_0x41085c(0x1db)+String(_0x4d66e9)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x31d31d=a7_0x26b1;(function(_0x2a4290,_0x58b237){const _0xf92c5=a7_0x26b1,_0x82357c=_0x2a4290();while(!![]){try{const _0x40e8a2=-parseInt(_0xf92c5(0x17e))/0x1+parseInt(_0xf92c5(0x191))/0x2+-parseInt(_0xf92c5(0x1c5))/0x3*(-parseInt(_0xf92c5(0x18b))/0x4)+-parseInt(_0xf92c5(0x171))/0x5*(-parseInt(_0xf92c5(0x17a))/0x6)+parseInt(_0xf92c5(0x1c6))/0x7+-parseInt(_0xf92c5(0x1cc))/0x8*(-parseInt(_0xf92c5(0x194))/0x9)+-parseInt(_0xf92c5(0x189))/0xa*(parseInt(_0xf92c5(0x18e))/0xb);if(_0x40e8a2===_0x58b237)break;else _0x82357c['push'](_0x82357c['shift']());}catch(_0x2bf6d3){_0x82357c['push'](_0x82357c['shift']());}}}(a7_0x8422,0x74922));import{BaseCommand,printAuthError}from'./command.js';function a7_0x8422(){const _0x534ab9=['\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','method','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','ERROR','Read\x20credential\x20from\x20','error','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','Validating\x20API\x20key...','Setup\x20cancelled','Credential\x20type:\x20OAuth','System\x20keychain\x20is\x20not\x20available','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','\x20(site:\x20','bold','Opening\x20browser\x20for\x20authentication...','\x20for\x20profile:\x20','\x20\x20(','filter','Remove\x20API\x20key\x20from\x20system\x20keychain','✓\x20Authentication\x20successful\x0a','description','log','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','last_name','dim','status','email','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','red','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','✓\x20Profile\x20\x27','all','create','User:\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','Setup\x20API\x20key\x20authentication\x20interactively','green','✓\x20Default\x20site\x20set\x20to\x20','/app/mp/ak','85497MxzYgm','2238971LjWCxK','auth:setup','account_id','Choose\x20how\x20to\x20sign\x20in:','apiKey','jobs','1056072wBUtPC','tdx:\x20auth\x20clear','us01','\x20removed\x20from\x20keychain','✗\x20Validation\x20failed:\x20','\x0aSetup\x20cancelled','2610KoCgcS','yellow','N/A','logLevel','No\x20credentials\x20found\x20in\x20keychain','/users/initiate_sso\x20(account:\x20','\x20\x20user_id:','name','\x20and\x20','2424TKyETw','trim','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','getUserInfo','137720gzUnDI','password','select','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','accountName','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','access_token','Sign\x20in\x20with\x20browser\x20(recommended)','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','/oauth/authorize','1080Naawte','warn','92spGSFz','\x20\x20tdx','For\x20scripts\x20or\x20headless\x20servers','72138fajWVu','oauth','auth:clear','10462TBQRmU','profile','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','9dVzGIS','tdx\x20profile:\x20','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','OAuth\x20tokens','✓\x20Signed\x20in\x20successfully','site','\x20(profile:\x20','Validating\x20OAuth\x20tokens...','\x27\x20registered'];a7_0x8422=function(){return _0x534ab9;};return a7_0x8422();}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_0x4d5ff3 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_0x26bf08 from'chalk';export async function runOAuthLoginFlow(_0x50d1bd,_0x9f155a,_0x3272a7,_0x570dc7){const _0x16ca04=a7_0x26b1,_0x5d059e=await isKeychainAvailable();if(!_0x5d059e)throw new Error(_0x16ca04(0x1a3)+_0x16ca04(0x187));let _0x4db57a=_0x570dc7?.[_0x16ca04(0x182)];if(!_0x4db57a){const _0x2ef08a=await a7_0x4d5ff3({'type':'text','name':'accountName','message':_0x16ca04(0x1a4)});if(_0x2ef08a[_0x16ca04(0x182)]===undefined)throw new Error(_0x16ca04(0x1a6));_0x4db57a=_0x2ef08a[_0x16ca04(0x182)][_0x16ca04(0x17b)]()||undefined;}const _0x44e143=getConsoleUrl(_0x50d1bd);console['log'](_0x16ca04(0x1ac));_0x4db57a?console[_0x16ca04(0x1b3)]('\x20\x20'+_0x44e143+_0x16ca04(0x176)+_0x4db57a+')'):console['log']('\x20\x20'+_0x44e143+_0x16ca04(0x188));console[_0x16ca04(0x1b3)](_0x16ca04(0x1bb));const _0x2b52e0=await startOAuthFlow(_0x50d1bd,{'accountName':_0x4db57a});console[_0x16ca04(0x1b3)](_0x16ca04(0x19b));const _0x3deba2=TDX['create']({'site':_0x50d1bd,'accessToken':_0x2b52e0[_0x16ca04(0x184)],'logLevel':_0x3272a7??LogLevel[_0x16ca04(0x1a0)]}),_0x3de530=await _0x3deba2['jobs'][_0x16ca04(0x17d)]();console[_0x16ca04(0x1b3)](a7_0x26bf08[_0x16ca04(0x1c2)](_0x16ca04(0x198))),console['log']('\x20\x20'+a7_0x26bf08['cyan'](_0x50d1bd+':'+_0x3de530[_0x16ca04(0x1c8)])+_0x16ca04(0x177)+_0x3de530['id']+_0x16ca04(0x1ae)+_0x3de530[_0x16ca04(0x1b8)]+')');!_0x4db57a&&(console[_0x16ca04(0x1b3)](a7_0x26bf08[_0x16ca04(0x1b6)](_0x16ca04(0x181))),console[_0x16ca04(0x1b3)](a7_0x26bf08[_0x16ca04(0x1b6)](_0x16ca04(0x19d))),console[_0x16ca04(0x1b3)](a7_0x26bf08[_0x16ca04(0x1b6)](_0x16ca04(0x193))));await saveOAuthTokens(_0x2b52e0,_0x9f155a),console[_0x16ca04(0x1b3)](_0x16ca04(0x1b9)+(_0x9f155a?'\x20(profile:\x20'+_0x9f155a+')':''));if(_0x9f155a){const _0x41aafe={'site':_0x50d1bd};saveProfileToUserConfig(_0x9f155a,_0x41aafe),console[_0x16ca04(0x1b3)](_0x16ca04(0x1bc)+_0x9f155a+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x50d1bd),console[_0x16ca04(0x1b3)](_0x16ca04(0x1c3)+_0x50d1bd);const _0x286c70=_0x9f155a?'\x20--profile\x20'+_0x9f155a:'';console[_0x16ca04(0x1b3)](),console[_0x16ca04(0x1b3)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x16ca04(0x1b3)](_0x16ca04(0x18c)+_0x286c70+_0x16ca04(0x196)),console[_0x16ca04(0x1b3)](_0x16ca04(0x18c)+_0x286c70+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}function a7_0x26b1(_0x468169,_0x53d80f){_0x468169=_0x468169-0x16e;const _0x842299=a7_0x8422();let _0x26b1cf=_0x842299[_0x468169];return _0x26b1cf;}export async function promptAuthMethod(){const _0x332982=a7_0x26b1,_0x32ceab=await a7_0x4d5ff3({'type':_0x332982(0x180),'name':_0x332982(0x19e),'message':_0x332982(0x1c9),'choices':[{'title':_0x332982(0x185),'description':_0x332982(0x19f),'value':_0x332982(0x18f)},{'title':'Use\x20an\x20API\x20key','description':_0x332982(0x18d),'value':'apikey'}]});return _0x32ceab[_0x332982(0x19e)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x31d31d(0x178)]=a7_0x31d31d(0x1c7);[a7_0x31d31d(0x1b2)]=a7_0x31d31d(0x1c1);async['execute'](_0xfd9993){const _0xbf3fe9=a7_0x31d31d,{options:_0x3a9160}=_0xfd9993,_0x47d1fb=_0x3a9160[_0xbf3fe9(0x192)];console[_0xbf3fe9(0x1b3)](a7_0x26bf08[_0xbf3fe9(0x1ab)]('tdx:\x20auth\x20setup'));const _0x3f110d=_0x3a9160['site']||_0xbf3fe9(0x1ce),_0x43d3b7=await promptSiteSelection(_0x3f110d,_0x47d1fb,'Setup\x20cancelled');if(!_0x43d3b7)return 0x1;const _0x3f9b0e=resolveSite(_0x43d3b7),_0x77c25b=await promptAuthMethod();if(!_0x77c25b)return console[_0xbf3fe9(0x1b3)](_0xbf3fe9(0x170)),0x1;if(_0x77c25b==='oauth'){const {accountName:_0x42ac28}=_0x3a9160;return await runOAuthLoginFlow(_0x3f9b0e,_0x47d1fb,_0x3a9160[_0xbf3fe9(0x174)]??LogLevel[_0xbf3fe9(0x1a0)],{'accountName':_0x42ac28}),0x0;}console['log']('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x3f9b0e),console[_0xbf3fe9(0x1b3)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console['log']('\x20\x20'+getConsoleUrl(_0x3f9b0e,_0xbf3fe9(0x1c4)));const _0x46cfaf=await a7_0x4d5ff3({'type':_0xbf3fe9(0x17f),'name':_0xbf3fe9(0x1ca),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x546c2=>{const _0xf7a836=_0xbf3fe9;if(!_0x546c2||!_0x546c2[_0xf7a836(0x17b)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x46cfaf[_0xbf3fe9(0x1ca)])return console['log'](_0xbf3fe9(0x170)),0x1;const _0x5c892d=_0x46cfaf[_0xbf3fe9(0x1ca)];console['log'](_0xbf3fe9(0x1a5));try{const _0x58116a=TDX[_0xbf3fe9(0x1be)]({'site':_0x3f9b0e,'apiKey':_0x5c892d[_0xbf3fe9(0x17b)](),'logLevel':_0x3a9160[_0xbf3fe9(0x174)]??LogLevel[_0xbf3fe9(0x1a0)]}),_0x3400a5=await _0x58116a[_0xbf3fe9(0x1cb)][_0xbf3fe9(0x17d)]();console[_0xbf3fe9(0x1b3)](_0xbf3fe9(0x186)+_0x3400a5[_0xbf3fe9(0x1b8)]+')');const _0x18b785=await isKeychainAvailable();_0x18b785?(await saveAPIKeyAsync(_0x5c892d[_0xbf3fe9(0x17b)](),_0x3f9b0e,_0x47d1fb),console[_0xbf3fe9(0x1b3)](_0xbf3fe9(0x1b4)+(_0x47d1fb?_0xbf3fe9(0x19a)+_0x47d1fb+')':''))):(console[_0xbf3fe9(0x18a)](a7_0x26bf08[_0xbf3fe9(0x172)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0xbf3fe9(0x18a)](a7_0x26bf08[_0xbf3fe9(0x172)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x47d1fb){const _0x76dbb7={'site':_0x3f9b0e};saveProfileToUserConfig(_0x47d1fb,_0x76dbb7),console[_0xbf3fe9(0x1b3)](_0xbf3fe9(0x1bc)+_0x47d1fb+_0xbf3fe9(0x19c));}else saveDefaultSiteToUserConfig(_0x3f9b0e),console[_0xbf3fe9(0x1b3)](_0xbf3fe9(0x1c3)+_0x3f9b0e);const _0x302bae=_0x47d1fb?'\x20--profile\x20'+_0x47d1fb:'';return console[_0xbf3fe9(0x1b3)](),console[_0xbf3fe9(0x1b3)](_0xbf3fe9(0x1c0)),console['log']('\x20\x20tdx'+_0x302bae+_0xbf3fe9(0x196)),console[_0xbf3fe9(0x1b3)](_0xbf3fe9(0x18c)+_0x302bae+_0xbf3fe9(0x17c)),0x0;}catch(_0x222c17){if(_0x222c17 instanceof HTTPClientError&&_0x222c17['status']===0x191)return printAuthError(_0x222c17),0x1;return console[_0xbf3fe9(0x1a2)](a7_0x26bf08[_0xbf3fe9(0x1ba)](_0xbf3fe9(0x16f)+(_0x222c17 instanceof Error?_0x222c17['message']:String(_0x222c17)))),console[_0xbf3fe9(0x1a2)](_0xbf3fe9(0x1a9)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x31d31d(0x178)]='auth';[a7_0x31d31d(0x1b2)]=a7_0x31d31d(0x183);async['execute'](_0x3696c3){const _0x48f688=a7_0x31d31d,{options:_0x4f5e8c,tdx:_0x3eaabb}=_0x3696c3,_0x54e2ec=_0x4f5e8c[_0x48f688(0x199)],_0x5f3911=_0x4f5e8c[_0x48f688(0x192)],_0x107d28=_0x5f3911?_0x5f3911:_0x48f688(0x173);console['log'](_0x48f688(0x195)+_0x107d28+_0x48f688(0x1aa)+_0x54e2ec+')');const _0x2fe4b9=await getOAuthTokens(_0x5f3911);if(_0x2fe4b9)console[_0x48f688(0x1b3)](_0x48f688(0x1a7)),console[_0x48f688(0x1b3)]('Read\x20credential\x20from\x20keychain'+(_0x5f3911?_0x48f688(0x19a)+_0x5f3911+')':''));else{const _0xa2c55b=await resolveAPIKeyAsync(_0x54e2ec,_0x5f3911);if(_0xa2c55b){const {source:_0x5f135d,isDeprecated:_0xcdf241}=_0xa2c55b,_0x20bf73=_0x48f688(0x1a1)+_0x5f135d;console['log'](_0xcdf241?a7_0x26bf08[_0x48f688(0x172)](_0x20bf73):_0x20bf73);}else console[_0x48f688(0x1b3)](a7_0x26bf08[_0x48f688(0x172)]('No\x20credential\x20found'));}try{const _0x147e34=await _0x3eaabb[_0x48f688(0x1cb)][_0x48f688(0x17d)]();return console[_0x48f688(0x1b3)](a7_0x26bf08[_0x48f688(0x1c2)](_0x48f688(0x1b1))),console['log'](_0x48f688(0x1bf)+_0x147e34[_0x48f688(0x1b8)]),(_0x147e34['first_name']||_0x147e34['last_name'])&&console[_0x48f688(0x1b3)]('Name:\x20'+[_0x147e34['first_name'],_0x147e34[_0x48f688(0x1b5)]][_0x48f688(0x1af)](Boolean)['join']('\x20')),0x0;}catch(_0x59a204){return _0x59a204 instanceof HTTPClientError&&_0x59a204[_0x48f688(0x1b7)]===0x191?printAuthError(_0x59a204,!![],_0x5f3911):console[_0x48f688(0x1a2)](a7_0x26bf08[_0x48f688(0x1ba)](_0x48f688(0x16f)+(_0x59a204 instanceof Error?_0x59a204['message']:String(_0x59a204)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x31d31d(0x178)]=a7_0x31d31d(0x190);[a7_0x31d31d(0x1b2)]=a7_0x31d31d(0x1b0);async['execute'](_0x2d8187){const _0xc34504=a7_0x31d31d,{options:_0x3564d4}=_0x2d8187,_0x424c2a=_0x3564d4[_0xc34504(0x192)];console['log'](a7_0x26bf08[_0xc34504(0x1ab)](_0xc34504(0x1cd)));const _0x5309aa=await isKeychainAvailable();if(!_0x5309aa)return console[_0xc34504(0x1a2)](a7_0x26bf08[_0xc34504(0x1ba)](_0xc34504(0x1a8))),0x1;const [_0x2c4c8b,_0x5ebb60]=await Promise[_0xc34504(0x1bd)]([deleteKeychainAPIKey(_0x424c2a),deleteOAuthTokens(_0x424c2a)]);if(_0x2c4c8b||_0x5ebb60){clearCredentialCache();const _0x4c5dfc=[_0x2c4c8b&&'API\x20key',_0x5ebb60&&_0xc34504(0x197)]['filter'](Boolean)['join'](_0xc34504(0x179));return console['log']('✓\x20'+_0x4c5dfc+_0xc34504(0x16e)+(_0x424c2a?_0xc34504(0x19a)+_0x424c2a+')':'')),0x0;}else return console['log'](_0xc34504(0x175)+(_0x424c2a?_0xc34504(0x1ad)+_0x424c2a:'')),0x1;}}
1
+ const a7_0x1c3326=a7_0xc00d;(function(_0x23e948,_0x4af7d5){const _0x13c1bb=a7_0xc00d,_0x538c92=_0x23e948();while(!![]){try{const _0x482f2f=parseInt(_0x13c1bb(0x124))/0x1+-parseInt(_0x13c1bb(0x127))/0x2+-parseInt(_0x13c1bb(0x139))/0x3+-parseInt(_0x13c1bb(0x122))/0x4*(parseInt(_0x13c1bb(0x113))/0x5)+-parseInt(_0x13c1bb(0x120))/0x6*(-parseInt(_0x13c1bb(0x143))/0x7)+parseInt(_0x13c1bb(0x13f))/0x8+parseInt(_0x13c1bb(0x121))/0x9;if(_0x482f2f===_0x4af7d5)break;else _0x538c92['push'](_0x538c92['shift']());}catch(_0x2b68fb){_0x538c92['push'](_0x538c92['shift']());}}}(a7_0x194b,0x58a86));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';function a7_0x194b(){const _0x39c0af=['bold','accountName','jobs','status','API\x20key\x20cannot\x20be\x20empty','logLevel','create','filter','Enter\x20your\x20TD\x20API\x20key:','error','✓\x20Authentication\x20successful\x0a','Choose\x20how\x20to\x20sign\x20in:','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','yellow','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','tdx:\x20auth\x20setup','dim','profile','name','Credential\x20type:\x20OAuth','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','160ODHiaV','No\x20credential\x20found','apiKey','/app/mp/ak','For\x20scripts\x20or\x20headless\x20servers','site','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','Read\x20credential\x20from\x20','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','email','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','\x20(site:\x20','13254iYqMaR','7634205oDphNg','76644mOzxrW','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','212392ZvzrKO','text','\x20(profile:\x20','727162kKocAH','first_name','apikey','No\x20credentials\x20found\x20in\x20keychain','\x20\x20user_id:','Sign\x20in\x20with\x20browser\x20(recommended)','last_name','ERROR','tdx\x20profile:\x20','Setup\x20cancelled','\x20--profile\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','✓\x20Default\x20site\x20set\x20to\x20','account_id','warn','Read\x20credential\x20from\x20keychain','User:\x20','access_token','1624521OqwzqM','✗\x20Validation\x20failed:\x20','\x20\x20tdx','Remove\x20API\x20key\x20from\x20system\x20keychain','green','getUserInfo','963936CFUUmf','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','auth','2219nSVUzf','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','all','log','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','method','auth:clear','oauth','N/A','Validating\x20API\x20key...','\x20and\x20','✓\x20Profile\x20\x27','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','trim','Use\x20an\x20API\x20key','/oauth/authorize','\x20removed\x20from\x20keychain','execute','description','red','\x27\x20registered'];a7_0x194b=function(){return _0x39c0af;};return a7_0x194b();}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_0x5ef294 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_0x13f29f from'chalk';export async function runOAuthLoginFlow(_0x5f0703,_0x2b3bbe,_0x259eaf,_0x2d624c){const _0x2a203f=a7_0xc00d,_0x19a2d6=await isKeychainAvailable();if(!_0x19a2d6)throw new Error(_0x2a203f(0x141)+_0x2a203f(0x123));let _0x3d7f34=_0x2d624c?.[_0x2a203f(0xff)];if(!_0x3d7f34){const _0x6ccaf3=await a7_0x5ef294({'type':_0x2a203f(0x125),'name':_0x2a203f(0xff),'message':_0x2a203f(0xf5)});if(_0x6ccaf3[_0x2a203f(0xff)]===undefined)throw new Error(_0x2a203f(0x130));_0x3d7f34=_0x6ccaf3[_0x2a203f(0xff)][_0x2a203f(0xf6)]()||undefined;}const _0x2e7db0=getConsoleUrl(_0x5f0703);console[_0x2a203f(0x146)]('Opening\x20browser\x20for\x20authentication...');_0x3d7f34?console[_0x2a203f(0x146)]('\x20\x20'+_0x2e7db0+'/users/initiate_sso\x20(account:\x20'+_0x3d7f34+')'):console[_0x2a203f(0x146)]('\x20\x20'+_0x2e7db0+_0x2a203f(0xf8));console[_0x2a203f(0x146)]('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0x1d85fd=await startOAuthFlow(_0x5f0703,{'accountName':_0x3d7f34});console[_0x2a203f(0x146)]('Validating\x20OAuth\x20tokens...');const _0x42d1c9=TDX[_0x2a203f(0x104)]({'site':_0x5f0703,'accessToken':_0x1d85fd[_0x2a203f(0x138)],'logLevel':_0x259eaf??LogLevel[_0x2a203f(0x12e)]}),_0x36eb4c=await _0x42d1c9['jobs']['getUserInfo']();console[_0x2a203f(0x146)](a7_0x13f29f[_0x2a203f(0x13d)]('✓\x20Signed\x20in\x20successfully')),console[_0x2a203f(0x146)]('\x20\x20'+a7_0x13f29f['cyan'](_0x5f0703+':'+_0x36eb4c[_0x2a203f(0x134)])+_0x2a203f(0x12b)+_0x36eb4c['id']+'\x20\x20('+_0x36eb4c[_0x2a203f(0x11c)]+')');!_0x3d7f34&&(console['log'](a7_0x13f29f[_0x2a203f(0x10e)](_0x2a203f(0x147))),console[_0x2a203f(0x146)](a7_0x13f29f[_0x2a203f(0x10e)]('\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>')),console['log'](a7_0x13f29f['dim'](_0x2a203f(0x119))));await saveOAuthTokens(_0x1d85fd,_0x2b3bbe),console[_0x2a203f(0x146)](_0x2a203f(0x11b)+(_0x2b3bbe?_0x2a203f(0x126)+_0x2b3bbe+')':''));if(_0x2b3bbe){const _0x231a30={'site':_0x5f0703};saveProfileToUserConfig(_0x2b3bbe,_0x231a30),console[_0x2a203f(0x146)](_0x2a203f(0xf4)+_0x2b3bbe+_0x2a203f(0xfd));}else saveDefaultSiteToUserConfig(_0x5f0703),console[_0x2a203f(0x146)](_0x2a203f(0x133)+_0x5f0703);const _0x36d7d6=_0x2b3bbe?_0x2a203f(0x131)+_0x2b3bbe:'';console['log'](),console[_0x2a203f(0x146)](_0x2a203f(0x10c)),console['log'](_0x2a203f(0x13b)+_0x36d7d6+_0x2a203f(0x10a)),console[_0x2a203f(0x146)]('\x20\x20tdx'+_0x36d7d6+_0x2a203f(0x140));}export async function promptAuthMethod(){const _0x1f6a7d=a7_0xc00d,_0x139537=await a7_0x5ef294({'type':'select','name':_0x1f6a7d(0x148),'message':_0x1f6a7d(0x109),'choices':[{'title':_0x1f6a7d(0x12c),'description':'Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','value':_0x1f6a7d(0x14a)},{'title':_0x1f6a7d(0xf7),'description':_0x1f6a7d(0x117),'value':_0x1f6a7d(0x129)}]});return _0x139537['method']||null;}export class AuthSetupCommand extends BaseCommand{['name']='auth:setup';[a7_0x1c3326(0xfb)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x1c3326(0xfa)](_0x476730){const _0x262dbe=a7_0x1c3326,{options:_0x373a07}=_0x476730,_0x5dfa74=_0x373a07[_0x262dbe(0x10f)];console[_0x262dbe(0x146)](a7_0x13f29f[_0x262dbe(0xfe)](_0x262dbe(0x10d)));const _0xda6aec=_0x373a07[_0x262dbe(0x118)]||'us01',_0x20d855=await promptSiteSelection(_0xda6aec,_0x5dfa74,'Setup\x20cancelled');if(!_0x20d855)return 0x1;const _0x29e87f=resolveSite(_0x20d855),_0x47732a=await promptAuthMethod();if(!_0x47732a)return console[_0x262dbe(0x146)]('\x0aSetup\x20cancelled'),0x1;if(_0x47732a===_0x262dbe(0x14a)){const {accountName:_0x719ef}=_0x373a07;return await runOAuthLoginFlow(_0x29e87f,_0x5dfa74,_0x373a07[_0x262dbe(0x103)]??LogLevel[_0x262dbe(0x12e)],{'accountName':_0x719ef}),0x0;}console[_0x262dbe(0x146)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x29e87f),console[_0x262dbe(0x146)](_0x262dbe(0x132)),console['log']('\x20\x20'+getConsoleUrl(_0x29e87f,_0x262dbe(0x116)));const _0xa51d33=await a7_0x5ef294({'type':'password','name':_0x262dbe(0x115),'message':_0x262dbe(0x106),'validate':_0x5e7922=>{const _0x1a0038=_0x262dbe;if(!_0x5e7922||!_0x5e7922[_0x1a0038(0xf6)]())return _0x1a0038(0x102);return!![];}});if(!_0xa51d33['apiKey'])return console[_0x262dbe(0x146)]('\x0aSetup\x20cancelled'),0x1;const _0x127acb=_0xa51d33[_0x262dbe(0x115)];console[_0x262dbe(0x146)](_0x262dbe(0x14c));try{const _0x2da5c9=TDX['create']({'site':_0x29e87f,'apiKey':_0x127acb[_0x262dbe(0xf6)](),'logLevel':_0x373a07[_0x262dbe(0x103)]??LogLevel['ERROR']}),_0x401023=await _0x2da5c9[_0x262dbe(0x100)][_0x262dbe(0x13e)]();console['log'](_0x262dbe(0x112)+_0x401023['email']+')');const _0x3e8a52=await isKeychainAvailable();_0x3e8a52?(await saveAPIKeyAsync(_0x127acb[_0x262dbe(0xf6)](),_0x29e87f,_0x5dfa74),console[_0x262dbe(0x146)](_0x262dbe(0x144)+(_0x5dfa74?_0x262dbe(0x126)+_0x5dfa74+')':''))):(console[_0x262dbe(0x135)](a7_0x13f29f['yellow'](_0x262dbe(0x11e))),console[_0x262dbe(0x135)](a7_0x13f29f[_0x262dbe(0x10b)](_0x262dbe(0x11d))));if(_0x5dfa74){const _0x50161b={'site':_0x29e87f};saveProfileToUserConfig(_0x5dfa74,_0x50161b),console['log'](_0x262dbe(0xf4)+_0x5dfa74+_0x262dbe(0xfd));}else saveDefaultSiteToUserConfig(_0x29e87f),console[_0x262dbe(0x146)](_0x262dbe(0x133)+_0x29e87f);const _0x3639ca=_0x5dfa74?'\x20--profile\x20'+_0x5dfa74:'';return console[_0x262dbe(0x146)](),console[_0x262dbe(0x146)](_0x262dbe(0x10c)),console['log'](_0x262dbe(0x13b)+_0x3639ca+_0x262dbe(0x10a)),console[_0x262dbe(0x146)]('\x20\x20tdx'+_0x3639ca+_0x262dbe(0x140)),0x0;}catch(_0x3a8557){if(_0x3a8557 instanceof HTTPClientError&&_0x3a8557[_0x262dbe(0x101)]===0x191)return printAuthError(_0x3a8557),0x1;return console[_0x262dbe(0x107)](a7_0x13f29f['red'](_0x262dbe(0x13a)+(_0x3a8557 instanceof Error?_0x3a8557['message']:String(_0x3a8557)))),console['error']('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}function a7_0xc00d(_0x1bf3c2,_0x2e11d9){_0x1bf3c2=_0x1bf3c2-0xf3;const _0x194bf9=a7_0x194b();let _0xc00d87=_0x194bf9[_0x1bf3c2];return _0xc00d87;}export class AuthStatusCommand extends BaseCommand{[a7_0x1c3326(0x110)]=a7_0x1c3326(0x142);['description']='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x1c3326(0xfa)](_0x55512f){const _0x502cf8=a7_0x1c3326,{options:_0x3886a5,tdx:_0x1670a2}=_0x55512f,_0x34db80=_0x3886a5[_0x502cf8(0x118)],_0x274488=_0x3886a5[_0x502cf8(0x10f)],_0x11304a=_0x274488?_0x274488:_0x502cf8(0x14b);console[_0x502cf8(0x146)](_0x502cf8(0x12f)+_0x11304a+_0x502cf8(0x11f)+_0x34db80+')');const _0x2d2bc1=await getOAuthTokens(_0x274488);if(_0x2d2bc1)console[_0x502cf8(0x146)](_0x502cf8(0x111)),console[_0x502cf8(0x146)](_0x502cf8(0x136)+(_0x274488?_0x502cf8(0x126)+_0x274488+')':''));else{const _0x4f3021=await resolveAPIKeyAsync(_0x34db80,_0x274488);if(_0x4f3021){const {source:_0x5adbac,isDeprecated:_0x266067}=_0x4f3021,_0x45b58c=_0x502cf8(0x11a)+_0x5adbac;console[_0x502cf8(0x146)](_0x266067?a7_0x13f29f['yellow'](_0x45b58c):_0x45b58c);}else console[_0x502cf8(0x146)](a7_0x13f29f[_0x502cf8(0x10b)](_0x502cf8(0x114)));}try{const _0x3a007d=await _0x1670a2[_0x502cf8(0x100)][_0x502cf8(0x13e)]();return console[_0x502cf8(0x146)](a7_0x13f29f['green'](_0x502cf8(0x108))),console[_0x502cf8(0x146)](_0x502cf8(0x137)+_0x3a007d[_0x502cf8(0x11c)]),(_0x3a007d[_0x502cf8(0x128)]||_0x3a007d[_0x502cf8(0x12d)])&&console[_0x502cf8(0x146)]('Name:\x20'+[_0x3a007d[_0x502cf8(0x128)],_0x3a007d[_0x502cf8(0x12d)]][_0x502cf8(0x105)](Boolean)['join']('\x20')),0x0;}catch(_0x384559){return _0x384559 instanceof HTTPClientError&&_0x384559['status']===0x191?printAuthError(_0x384559,!![],_0x274488):console[_0x502cf8(0x107)](a7_0x13f29f[_0x502cf8(0xfc)](_0x502cf8(0x13a)+(_0x384559 instanceof Error?_0x384559['message']:String(_0x384559)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x1c3326(0x110)]=a7_0x1c3326(0x149);['description']=a7_0x1c3326(0x13c);async['execute'](_0x403127){const _0x5eb2a3=a7_0x1c3326,{options:_0x327b87}=_0x403127,_0x26e577=_0x327b87[_0x5eb2a3(0x10f)];console[_0x5eb2a3(0x146)](a7_0x13f29f[_0x5eb2a3(0xfe)]('tdx:\x20auth\x20clear'));const _0x119b7a=await isKeychainAvailable();if(!_0x119b7a)return console[_0x5eb2a3(0x107)](a7_0x13f29f[_0x5eb2a3(0xfc)]('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x2f78bf,_0x5b57f2]=await Promise[_0x5eb2a3(0x145)]([deleteKeychainAPIKey(_0x26e577),deleteOAuthTokens(_0x26e577)]);if(_0x2f78bf||_0x5b57f2){clearCredentialCache();const _0x5831d9=[_0x2f78bf&&'API\x20key',_0x5b57f2&&'OAuth\x20tokens'][_0x5eb2a3(0x105)](Boolean)['join'](_0x5eb2a3(0xf3));return console[_0x5eb2a3(0x146)]('✓\x20'+_0x5831d9+_0x5eb2a3(0xf9)+(_0x26e577?_0x5eb2a3(0x126)+_0x26e577+')':'')),0x0;}else return console['log'](_0x5eb2a3(0x12a)+(_0x26e577?'\x20for\x20profile:\x20'+_0x26e577:'')),0x1;}}