@treasuredata/tdx 2026.4.16 → 2026.4.17

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
- function a3_0x23fc(_0x45dd88,_0x5b2f1f){_0x45dd88=_0x45dd88-0x174;const _0x388771=a3_0x3887();let _0x23fcb7=_0x388771[_0x45dd88];return _0x23fcb7;}const a3_0xd513d=a3_0x23fc;(function(_0x467e0c,_0x39bb5f){const _0x1061b3=a3_0x23fc,_0x52afdc=_0x467e0c();while(!![]){try{const _0x55964f=parseInt(_0x1061b3(0x18a))/0x1+parseInt(_0x1061b3(0x17b))/0x2*(parseInt(_0x1061b3(0x182))/0x3)+parseInt(_0x1061b3(0x188))/0x4+-parseInt(_0x1061b3(0x18e))/0x5+-parseInt(_0x1061b3(0x17a))/0x6*(parseInt(_0x1061b3(0x193))/0x7)+parseInt(_0x1061b3(0x18c))/0x8+-parseInt(_0x1061b3(0x178))/0x9*(-parseInt(_0x1061b3(0x190))/0xa);if(_0x55964f===_0x39bb5f)break;else _0x52afdc['push'](_0x52afdc['shift']());}catch(_0x39880d){_0x52afdc['push'](_0x52afdc['shift']());}}}(a3_0x3887,0x1d183));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a3_0x3887(){const _0x214699=['Error:\x20','400542ugyADP','2oXTEhw','cause','description','List\x20activations\x20for\x20a\x20segment','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','data','Parent\x20name:\x20','89223riANhz','Listing\x20activations\x20for\x20segment\x20\x27','Resolving\x20child\x20segment\x20\x27','Child\x20name:\x20','\x20activation','error','485000SNBTqH','\x20\x20Cause:\x20','178430ckZsBo','length','619136fBLCBQ','segment','470950EljUop','site','22730mdvSZC','listActivations','✔\x20Found\x20','21JLQzzO','Error:\x20Segment\x20name\x20is\x20required','resolveSegmentId','Resolving\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Site:\x20','message','\x27...','verbose','Resolved\x20child\x20ID:\x20','27gnPTuJ'];a3_0x3887=function(){return _0x214699;};return a3_0x3887();}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{['name']='activations';[a3_0xd513d(0x17d)]=a3_0xd513d(0x17e);async['execute'](_0x8a8ddf){const _0x3e75e4=a3_0xd513d,{options:_0x452ce9,args:_0x24c2c3,tdx:_0x29547a}=_0x8a8ddf;if(_0x24c2c3['length']===0x0)return console[_0x3e75e4(0x187)](_0x3e75e4(0x194)),console[_0x3e75e4(0x187)](_0x3e75e4(0x197)),0x1;try{const {parentId:_0x39c842,childId:_0x293ae8}=parseSegmentRef(_0x24c2c3[0x0]);if(!_0x293ae8)return console['error'](_0x3e75e4(0x17f)),console[_0x3e75e4(0x187)](_0x3e75e4(0x197)),0x1;_0x452ce9[_0x3e75e4(0x176)]&&(console[_0x3e75e4(0x187)](_0x3e75e4(0x198)+_0x452ce9[_0x3e75e4(0x18f)]),console[_0x3e75e4(0x187)](_0x3e75e4(0x181)+_0x39c842),console[_0x3e75e4(0x187)](_0x3e75e4(0x185)+_0x293ae8));const _0xe1dd8f=await withSpinner(_0x3e75e4(0x196)+_0x39c842+_0x3e75e4(0x175),()=>_0x29547a[_0x3e75e4(0x18d)]['resolveParentId'](_0x39c842),{'verbose':_0x452ce9[_0x3e75e4(0x176)]}),_0x18a146=_0xe1dd8f[_0x3e75e4(0x180)];_0x452ce9['verbose']&&console[_0x3e75e4(0x187)]('Resolved\x20parent\x20ID:\x20'+_0x18a146);const _0x1c98e9=await withSpinner(_0x3e75e4(0x184)+_0x293ae8+_0x3e75e4(0x175),()=>_0x29547a[_0x3e75e4(0x18d)][_0x3e75e4(0x195)](_0x18a146,_0x293ae8),{'verbose':_0x452ce9[_0x3e75e4(0x176)]}),_0x57d16c=_0x1c98e9[_0x3e75e4(0x180)];_0x452ce9['verbose']&&console[_0x3e75e4(0x187)](_0x3e75e4(0x177)+_0x57d16c);const _0x1434a0=await withSpinner(_0x3e75e4(0x183)+_0x293ae8+'\x27...',()=>_0x29547a[_0x3e75e4(0x18d)][_0x3e75e4(0x191)](_0x18a146,_0x57d16c),{'verbose':_0x452ce9[_0x3e75e4(0x176)]}),_0x376cd2=_0x1434a0['data'];return console[_0x3e75e4(0x187)](_0x3e75e4(0x192)+_0x376cd2[_0x3e75e4(0x18b)]+_0x3e75e4(0x186)+(_0x376cd2[_0x3e75e4(0x18b)]!==0x1?'s':'')),await handleSDKOutput(_0x376cd2,_0x452ce9),0x0;}catch(_0x3e421f){if(_0x3e421f instanceof SDKError)return console[_0x3e75e4(0x187)](_0x3e75e4(0x179)+_0x3e421f[_0x3e75e4(0x174)]),_0x3e421f[_0x3e75e4(0x17c)]&&console[_0x3e75e4(0x187)](_0x3e75e4(0x189)+_0x3e421f[_0x3e75e4(0x17c)]),0x1;throw _0x3e421f;}}}
1
+ const a3_0x3485fa=a3_0xec2a;(function(_0x470cfe,_0x4e35bb){const _0x36076a=a3_0xec2a,_0x24d701=_0x470cfe();while(!![]){try{const _0x358ae1=-parseInt(_0x36076a(0x1c7))/0x1+parseInt(_0x36076a(0x1c1))/0x2*(parseInt(_0x36076a(0x1c5))/0x3)+-parseInt(_0x36076a(0x1b0))/0x4*(parseInt(_0x36076a(0x1b7))/0x5)+-parseInt(_0x36076a(0x1ba))/0x6+parseInt(_0x36076a(0x1b2))/0x7*(-parseInt(_0x36076a(0x1bc))/0x8)+parseInt(_0x36076a(0x1b6))/0x9+-parseInt(_0x36076a(0x1aa))/0xa*(-parseInt(_0x36076a(0x1b8))/0xb);if(_0x358ae1===_0x4e35bb)break;else _0x24d701['push'](_0x24d701['shift']());}catch(_0x34e019){_0x24d701['push'](_0x24d701['shift']());}}}(a3_0x42fd,0x4b76c));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a3_0xec2a(_0x495268,_0x22f1ac){_0x495268=_0x495268-0x1a5;const _0x42fd58=a3_0x42fd();let _0xec2aff=_0x42fd58[_0x495268];return _0xec2aff;}function a3_0x42fd(){const _0x5a1157=['5PRsHCz','22LgsfgY','error','2307504ygDEAG','message','32NumLqM','Listing\x20activations\x20for\x20segment\x20\x27','description','Child\x20name:\x20','\x27...','104908uDEDRs','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','listActivations','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','33DYFlDk','Site:\x20','85333JJivOC','Resolving\x20child\x20segment\x20\x27','segment','verbose','Error:\x20Segment\x20name\x20is\x20required','length','4203280jURZvJ','List\x20activations\x20for\x20a\x20segment','data','✔\x20Found\x20','cause','site','1165528VoiKaY','name','912667beVieF','\x20\x20Cause:\x20','\x20activation','Parent\x20name:\x20','1568457gJpCsB'];a3_0x42fd=function(){return _0x5a1157;};return a3_0x42fd();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x3485fa(0x1b1)]='activations';[a3_0x3485fa(0x1be)]=a3_0x3485fa(0x1ab);async['execute'](_0x44fe29){const _0x3a87a7=a3_0x3485fa,{options:_0x46330e,args:_0x5d40a5,tdx:_0x3c3583}=_0x44fe29;if(_0x5d40a5[_0x3a87a7(0x1a9)]===0x0)return console[_0x3a87a7(0x1b9)](_0x3a87a7(0x1a8)),console[_0x3a87a7(0x1b9)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x35404d,childId:_0x3ddad6}=parseSegmentRef(_0x5d40a5[0x0]);if(!_0x3ddad6)return console[_0x3a87a7(0x1b9)](_0x3a87a7(0x1c4)),console[_0x3a87a7(0x1b9)](_0x3a87a7(0x1c2)),0x1;_0x46330e[_0x3a87a7(0x1a7)]&&(console[_0x3a87a7(0x1b9)](_0x3a87a7(0x1c6)+_0x46330e[_0x3a87a7(0x1af)]),console[_0x3a87a7(0x1b9)](_0x3a87a7(0x1b5)+_0x35404d),console['error'](_0x3a87a7(0x1bf)+_0x3ddad6));const _0x5db63e=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x35404d+_0x3a87a7(0x1c0),()=>_0x3c3583[_0x3a87a7(0x1a6)]['resolveParentId'](_0x35404d),{'verbose':_0x46330e[_0x3a87a7(0x1a7)]}),_0x9dbb6b=_0x5db63e[_0x3a87a7(0x1ac)];_0x46330e[_0x3a87a7(0x1a7)]&&console[_0x3a87a7(0x1b9)]('Resolved\x20parent\x20ID:\x20'+_0x9dbb6b);const _0x2f1617=await withSpinner(_0x3a87a7(0x1a5)+_0x3ddad6+'\x27...',()=>_0x3c3583[_0x3a87a7(0x1a6)]['resolveSegmentId'](_0x9dbb6b,_0x3ddad6),{'verbose':_0x46330e[_0x3a87a7(0x1a7)]}),_0x111dbd=_0x2f1617['data'];_0x46330e[_0x3a87a7(0x1a7)]&&console[_0x3a87a7(0x1b9)]('Resolved\x20child\x20ID:\x20'+_0x111dbd);const _0x5d92c3=await withSpinner(_0x3a87a7(0x1bd)+_0x3ddad6+'\x27...',()=>_0x3c3583[_0x3a87a7(0x1a6)][_0x3a87a7(0x1c3)](_0x9dbb6b,_0x111dbd),{'verbose':_0x46330e[_0x3a87a7(0x1a7)]}),_0x520fd2=_0x5d92c3[_0x3a87a7(0x1ac)];return console[_0x3a87a7(0x1b9)](_0x3a87a7(0x1ad)+_0x520fd2['length']+_0x3a87a7(0x1b4)+(_0x520fd2[_0x3a87a7(0x1a9)]!==0x1?'s':'')),await handleSDKOutput(_0x520fd2,_0x46330e),0x0;}catch(_0x3624e2){if(_0x3624e2 instanceof SDKError)return console[_0x3a87a7(0x1b9)]('Error:\x20'+_0x3624e2[_0x3a87a7(0x1bb)]),_0x3624e2[_0x3a87a7(0x1ae)]&&console[_0x3a87a7(0x1b9)](_0x3a87a7(0x1b3)+_0x3624e2[_0x3a87a7(0x1ae)]),0x1;throw _0x3624e2;}}}
@@ -1 +1 @@
1
- const a4_0x55f474=a4_0xfe3d;(function(_0x3c5efb,_0x5e2166){const _0x28d61c=a4_0xfe3d,_0x1ce697=_0x3c5efb();while(!![]){try{const _0x1b5f8c=-parseInt(_0x28d61c(0x192))/0x1*(parseInt(_0x28d61c(0x11b))/0x2)+-parseInt(_0x28d61c(0x10c))/0x3*(-parseInt(_0x28d61c(0x136))/0x4)+parseInt(_0x28d61c(0x170))/0x5*(-parseInt(_0x28d61c(0x142))/0x6)+-parseInt(_0x28d61c(0x14a))/0x7+-parseInt(_0x28d61c(0x182))/0x8*(-parseInt(_0x28d61c(0x12a))/0x9)+parseInt(_0x28d61c(0x14e))/0xa*(parseInt(_0x28d61c(0x10e))/0xb)+parseInt(_0x28d61c(0x1a0))/0xc*(parseInt(_0x28d61c(0x1aa))/0xd);if(_0x1b5f8c===_0x5e2166)break;else _0x1ce697['push'](_0x1ce697['shift']());}catch(_0x220d75){_0x1ce697['push'](_0x1ce697['shift']());}}}(a4_0x141f,0x62e2a));import a4_0x52269a from'chalk';function a4_0xfe3d(_0x549e07,_0x1f89d5){_0x549e07=_0x549e07-0xf9;const _0x141f0c=a4_0x141f();let _0xfe3ddf=_0x141f0c[_0x549e07];return _0xfe3ddf;}import a4_0x644d9b from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x2873d8){const _0xeaa7f7=a4_0xfe3d,_0x25da73=[];if(_0x2873d8[_0xeaa7f7(0x1a1)]!==undefined)_0x25da73[_0xeaa7f7(0x1b3)](_0x2873d8[_0xeaa7f7(0x1a1)]+_0xeaa7f7(0x17d));if(_0x2873d8[_0xeaa7f7(0x1b6)]!==undefined&&_0x2873d8['new']>0x0)_0x25da73[_0xeaa7f7(0x1b3)](a4_0x52269a['green'](_0x2873d8[_0xeaa7f7(0x1b6)]+'\x20new'));if(_0x2873d8['created']!==undefined&&_0x2873d8[_0xeaa7f7(0x14d)]>0x0)_0x25da73['push'](a4_0x52269a[_0xeaa7f7(0x198)](_0x2873d8[_0xeaa7f7(0x14d)]+_0xeaa7f7(0x145)));if(_0x2873d8['updated']!==undefined&&_0x2873d8[_0xeaa7f7(0x1b0)]>0x0)_0x25da73[_0xeaa7f7(0x1b3)](a4_0x52269a[_0xeaa7f7(0x193)](_0x2873d8['updated']+_0xeaa7f7(0x109)));if(_0x2873d8['unchanged']!==undefined&&_0x2873d8[_0xeaa7f7(0x18b)]>0x0)_0x25da73[_0xeaa7f7(0x1b3)](a4_0x52269a[_0xeaa7f7(0x111)](_0x2873d8[_0xeaa7f7(0x18b)]+_0xeaa7f7(0x124)));if(_0x2873d8['errors']!==undefined&&_0x2873d8['errors']>0x0)_0x25da73[_0xeaa7f7(0x1b3)](a4_0x52269a[_0xeaa7f7(0x156)](_0x2873d8[_0xeaa7f7(0x16e)]+_0xeaa7f7(0x18d)));return _0x25da73[_0xeaa7f7(0x104)](',\x20');}function displayDiffs(_0x3a75b7,_0xd0fb22,_0x256c8f,_0x7c40b,_0x24e303,_0x153565,_0x31bc06,_0x3c79ba,_0x262f4c){const _0x273ea9=a4_0xfe3d;for(const _0x3af6e2 of _0x3a75b7){if(_0x3af6e2[_0x273ea9(0x13d)]){const _0xba918a=_0x3af6e2[_0x273ea9(0x127)]||_0x3af6e2[_0x273ea9(0x15c)];console[_0x273ea9(0x1c0)](_0x273ea9(0x1a8)+_0xba918a+'\x27:'),console[_0x273ea9(0x1c0)]('─'[_0x273ea9(0x1b4)](0x3c)),console[_0x273ea9(0x1c0)](_0x3af6e2[_0x273ea9(0x13d)]),console[_0x273ea9(0x1c0)]('─'[_0x273ea9(0x1b4)](0x3c));}}for(const _0x13e813 of _0xd0fb22){_0x13e813[_0x273ea9(0x13d)]&&(console[_0x273ea9(0x1c0)](_0x273ea9(0xfe)+_0x13e813[_0x273ea9(0x15c)]+'\x27:'),console[_0x273ea9(0x1c0)]('─'[_0x273ea9(0x1b4)](0x3c)),console['log'](_0x13e813[_0x273ea9(0x13d)]),console[_0x273ea9(0x1c0)]('─'[_0x273ea9(0x1b4)](0x3c)));}for(const _0x5f194b of _0x256c8f){_0x5f194b['diff']&&(console[_0x273ea9(0x1c0)](_0x273ea9(0x175)+_0x5f194b[_0x273ea9(0x15c)]+'\x27:'),console[_0x273ea9(0x1c0)]('─'[_0x273ea9(0x1b4)](0x3c)),console[_0x273ea9(0x1c0)](_0x5f194b[_0x273ea9(0x13d)]),console[_0x273ea9(0x1c0)]('─'[_0x273ea9(0x1b4)](0x3c)));}for(const _0x5ce972 of _0x7c40b){_0x5ce972[_0x273ea9(0x13d)]&&(console[_0x273ea9(0x1c0)](_0x273ea9(0x12e)+_0x5ce972[_0x273ea9(0x15c)]+'\x27:'),console[_0x273ea9(0x1c0)]('─'['repeat'](0x3c)),console['log'](_0x5ce972[_0x273ea9(0x13d)]),console[_0x273ea9(0x1c0)]('─'[_0x273ea9(0x1b4)](0x3c)));}for(const _0x2f2a97 of _0x24e303){_0x2f2a97[_0x273ea9(0x13d)]&&(console[_0x273ea9(0x1c0)](_0x273ea9(0x168)+_0x2f2a97[_0x273ea9(0x15c)]+'\x27:'),console[_0x273ea9(0x1c0)]('─'[_0x273ea9(0x1b4)](0x3c)),console[_0x273ea9(0x1c0)](_0x2f2a97[_0x273ea9(0x13d)]),console[_0x273ea9(0x1c0)]('─'[_0x273ea9(0x1b4)](0x3c)));}for(const _0x2df677 of _0x153565){_0x2df677[_0x273ea9(0x13d)]&&(console[_0x273ea9(0x1c0)](_0x273ea9(0x179)+_0x2df677[_0x273ea9(0x15c)]+'\x27:'),console[_0x273ea9(0x1c0)]('─'['repeat'](0x3c)),console[_0x273ea9(0x1c0)](_0x2df677[_0x273ea9(0x13d)]),console[_0x273ea9(0x1c0)]('─'['repeat'](0x3c)));}for(const _0x21d7c7 of _0x31bc06){_0x21d7c7[_0x273ea9(0x13d)]&&(console['log'](_0x273ea9(0x1c2)+_0x21d7c7[_0x273ea9(0x15c)]+'\x27:'),console['log']('─'[_0x273ea9(0x1b4)](0x3c)),console[_0x273ea9(0x1c0)](_0x21d7c7['diff']),console['log']('─'['repeat'](0x3c)));}for(const _0x58d545 of _0x3c79ba){_0x58d545[_0x273ea9(0x13d)]&&(console[_0x273ea9(0x1c0)](_0x273ea9(0x191)+_0x58d545[_0x273ea9(0x15c)]+'\x27:'),console[_0x273ea9(0x1c0)]('─'['repeat'](0x3c)),console[_0x273ea9(0x1c0)](_0x58d545['diff']),console[_0x273ea9(0x1c0)]('─'[_0x273ea9(0x1b4)](0x3c)));}for(const _0x47b767 of _0x262f4c){_0x47b767['diff']&&(console['log'](_0x273ea9(0x18a)+_0x47b767['name']+'\x27:'),console[_0x273ea9(0x1c0)]('─'[_0x273ea9(0x1b4)](0x3c)),console[_0x273ea9(0x1c0)](_0x47b767['diff']),console[_0x273ea9(0x1c0)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x55f474(0x15c)]=a4_0x55f474(0x113);[a4_0x55f474(0x13c)]=a4_0x55f474(0x172);async[a4_0x55f474(0x15f)](_0x3275b9){const _0x2ea26c=a4_0x55f474,{options:_0x5d698d,args:_0x4b23ef,tdx:_0x8ddaf3}=_0x3275b9,_0x374071=_0x4b23ef[0x0],_0x3018da=_0x4b23ef[0x1],_0x3e4b61=_0x5d698d['output'],_0xd23e73=_0x5d698d[_0x2ea26c(0x14c)],_0x169cbb=_0x5d698d[_0x2ea26c(0x13a)],_0x1d5f6c=_0x5d698d[_0x2ea26c(0x10f)],_0xbb4b45=_0x5d698d[_0x2ea26c(0x122)],_0x3511cd=_0x5d698d[_0x2ea26c(0x165)];let _0x35ca0b;if(_0x374071){const _0x3f6e83=a4_0x644d9b[_0x2ea26c(0x104)](_0x374071,_0x2ea26c(0x123));if(existsSync(_0x3f6e83))try{const _0x11a9c8=JSON[_0x2ea26c(0x141)](readFileSync(_0x3f6e83,'utf-8'));_0x11a9c8['llm_project']&&(_0x35ca0b={'llm_project':_0x11a9c8['llm_project']});}catch{}}const _0x30d465=findAgentConfigPath(process[_0x2ea26c(0x1b5)]());let _0x288f50;if(_0x30d465)try{const _0x21af9f=JSON[_0x2ea26c(0x141)](readFileSync(_0x30d465,_0x2ea26c(0x18c)));_0x21af9f[_0x2ea26c(0x14f)]&&(_0x288f50={'llm_project':_0x21af9f['llm_project']});}catch{}const _0x5b6b24=resolveAgentPullArgs({'arg':_0x374071,'agentNameArg':_0x3018da,'agentFlag':_0x3511cd,'contextProject':_0xbb4b45,'argDirConfig':_0x35ca0b,'cwdConfigPath':_0x30d465||undefined,'cwdConfig':_0x288f50}),{projectNameOrId:_0x3021fb,targetAgentName:_0x3d8e41,existingOutputDir:_0xa3374e,source:_0x3f973c}=_0x5b6b24;if(_0x3f973c===_0x2ea26c(0x1b9))console[_0x2ea26c(0x1c0)](a4_0x52269a['dim'](_0x2ea26c(0x154)+a4_0x644d9b[_0x2ea26c(0x104)](_0x374071,_0x2ea26c(0x123))+':\x20'+_0x3021fb));else{if(_0x3f973c==='cwd-config')console['log'](a4_0x52269a['dim'](_0x2ea26c(0x151)+_0x3021fb));else _0x3f973c==='context'&&console[_0x2ea26c(0x1c0)](a4_0x52269a['dim'](_0x2ea26c(0x19e)+_0x3021fb));}if(!_0x3021fb)return _0x3511cd?(console['log'](a4_0x52269a[_0x2ea26c(0x193)](_0x2ea26c(0x15b))),console[_0x2ea26c(0x1c0)](_0x2ea26c(0x183)),console['log'](_0x2ea26c(0x1b8))):(console[_0x2ea26c(0x1c0)](a4_0x52269a[_0x2ea26c(0x193)](_0x2ea26c(0xf9))),console[_0x2ea26c(0x1c0)](_0x2ea26c(0x19f)),console['log'](_0x2ea26c(0x12d)),console[_0x2ea26c(0x1c0)](_0x2ea26c(0x16b)),console['log'](_0x2ea26c(0x148)),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x3d8e41){const {data:_0x4e2016}=await withSpinner(_0x2ea26c(0x13e)+_0x3d8e41+_0x2ea26c(0x1b1)+_0x3021fb+_0x2ea26c(0xfb),()=>_0x8ddaf3[_0x2ea26c(0x1af)][_0x2ea26c(0x1b7)](_0x3021fb,_0x3d8e41,_0x3e4b61,{'dryRun':_0xd23e73,'force':_0x169cbb}));if(_0xd23e73)return console[_0x2ea26c(0x1c0)](a4_0x52269a[_0x2ea26c(0x193)](_0x2ea26c(0x139))),console[_0x2ea26c(0x1c0)](_0x2ea26c(0x1a7)+_0x4e2016[_0x2ea26c(0x127)]),console['log'](_0x2ea26c(0x108)+_0x4e2016[_0x2ea26c(0x184)]),_0x4e2016[_0x2ea26c(0x13d)]&&(console[_0x2ea26c(0x1c0)]('\x0aChanges:'),console[_0x2ea26c(0x1c0)]('─'[_0x2ea26c(0x1b4)](0x3c)),console[_0x2ea26c(0x1c0)](_0x4e2016[_0x2ea26c(0x13d)]),console[_0x2ea26c(0x1c0)]('─'['repeat'](0x3c))),0x0;return console['log'](a4_0x52269a[_0x2ea26c(0x198)](_0x2ea26c(0x15a))),console['log'](_0x2ea26c(0x144)+_0x4e2016['agentName']),console[_0x2ea26c(0x1c0)](_0x2ea26c(0x18e)+_0x4e2016['outputPath']),console[_0x2ea26c(0x1c0)]('Status:\x20'+(_0x4e2016['isNew']?a4_0x52269a[_0x2ea26c(0x198)](_0x2ea26c(0x1b6)):_0x4e2016[_0x2ea26c(0x199)]?a4_0x52269a[_0x2ea26c(0x193)](_0x2ea26c(0x1b0)):a4_0x52269a[_0x2ea26c(0x111)](_0x2ea26c(0x18b)))),0x0;}const _0x53d569=_0xa3374e||_0x3e4b61,{data:_0x455336}=await withSpinner('Analyzing\x20project\x20\x22'+_0x3021fb+'\x22...',()=>_0x8ddaf3[_0x2ea26c(0x1af)]['pullProject'](_0x3021fb,_0x53d569,{'dryRun':!![]})),_0x100730=_0x455336[_0x2ea26c(0x194)]['agents']['new']+_0x455336['counts'][_0x2ea26c(0x153)][_0x2ea26c(0x1b6)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x1bd)][_0x2ea26c(0x1b6)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x177)][_0x2ea26c(0x1b6)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x171)][_0x2ea26c(0x1b6)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x125)][_0x2ea26c(0x1b6)]+_0x455336[_0x2ea26c(0x194)]['experimentalArtifacts'][_0x2ea26c(0x1b6)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x126)][_0x2ea26c(0x1b6)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x135)][_0x2ea26c(0x1b6)],_0x6a1f33=_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x169)][_0x2ea26c(0x1b0)]+_0x455336['counts']['knowledgeBases'][_0x2ea26c(0x1b0)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x1bd)][_0x2ea26c(0x1b0)]+_0x455336[_0x2ea26c(0x194)]['prompts'][_0x2ea26c(0x1b0)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x171)][_0x2ea26c(0x1b0)]+_0x455336[_0x2ea26c(0x194)]['experimentalKnowledgeBases'][_0x2ea26c(0x1b0)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x116)][_0x2ea26c(0x1b0)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x126)][_0x2ea26c(0x1b0)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x135)][_0x2ea26c(0x1b0)],_0x270e00=_0x455336['counts'][_0x2ea26c(0x169)][_0x2ea26c(0x18b)]+_0x455336['counts'][_0x2ea26c(0x153)][_0x2ea26c(0x18b)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x1bd)][_0x2ea26c(0x18b)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x177)][_0x2ea26c(0x18b)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x171)]['unchanged']+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x125)][_0x2ea26c(0x18b)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x116)][_0x2ea26c(0x18b)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x126)][_0x2ea26c(0x18b)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x135)]['unchanged'];console[_0x2ea26c(0x1c0)](_0x2ea26c(0x19a)+_0x455336['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x52269a[_0x2ea26c(0x198)]('+\x20'+_0x100730+_0x2ea26c(0x159))+_0x2ea26c(0x11e)+a4_0x52269a['yellow']('~\x20'+_0x6a1f33+_0x2ea26c(0x1a4))+'\x20|\x20'+a4_0x52269a[_0x2ea26c(0x17e)]('=\x20'+_0x270e00+'\x20unchanged')),console[_0x2ea26c(0x1c0)](_0x2ea26c(0x1a6)+formatCountSummary(_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x169)])),console[_0x2ea26c(0x1c0)](_0x2ea26c(0x16c)+formatCountSummary(_0x455336['counts'][_0x2ea26c(0x153)])),console[_0x2ea26c(0x1c0)](_0x2ea26c(0x150)+formatCountSummary(_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x1bd)])),console[_0x2ea26c(0x1c0)](_0x2ea26c(0x149)+formatCountSummary(_0x455336['counts'][_0x2ea26c(0x177)])),console[_0x2ea26c(0x1c0)](_0x2ea26c(0x14b)+formatCountSummary(_0x455336[_0x2ea26c(0x194)]['integrations'])),console[_0x2ea26c(0x1c0)](_0x2ea26c(0x197)+formatCountSummary(_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x126)])),console['log'](_0x2ea26c(0x121)+formatCountSummary(_0x455336['counts'][_0x2ea26c(0x135)]));const _0x167e00=_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x125)][_0x2ea26c(0x1a1)]>0x0||_0x455336['counts'][_0x2ea26c(0x116)][_0x2ea26c(0x1a1)]>0x0;_0x167e00&&(console[_0x2ea26c(0x1c0)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x125)])),console[_0x2ea26c(0x1c0)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x116)])));console['log']('\x20\x20Target:\x20'+a4_0x52269a[_0x2ea26c(0x160)](_0x455336[_0x2ea26c(0x15d)])),displayDiffs(_0x455336[_0x2ea26c(0x169)],_0x455336[_0x2ea26c(0x153)],_0x455336[_0x2ea26c(0x1bd)],_0x455336['prompts'],_0x455336[_0x2ea26c(0x171)],_0x455336[_0x2ea26c(0x125)],_0x455336[_0x2ea26c(0x116)],_0x455336[_0x2ea26c(0x126)],_0x455336[_0x2ea26c(0x135)]);if(_0xd23e73)return console[_0x2ea26c(0x1c0)](a4_0x52269a[_0x2ea26c(0x193)](_0x2ea26c(0x1a9))),0x0;if(_0x100730===0x0&&_0x6a1f33===0x0)return console[_0x2ea26c(0x1c0)](a4_0x52269a['green'](_0x2ea26c(0x140))),saveSessionContext({'llm_project':_0x455336['projectName']},_0x5d698d[_0x2ea26c(0x1bc)]),console[_0x2ea26c(0x1c0)](a4_0x52269a[_0x2ea26c(0x198)]('✔\x20Context\x20set:\x20'+a4_0x52269a[_0x2ea26c(0x17e)](_0x2ea26c(0x14f))+_0x2ea26c(0x101)+a4_0x52269a['cyan'](_0x455336[_0x2ea26c(0xfa)]))),0x0;if(!_0x1d5f6c&&!_0x169cbb){if(!isInteractive())return console[_0x2ea26c(0x1ab)](a4_0x52269a['red'](_0x2ea26c(0x11d)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2ea26c(0x1ab)](a4_0x52269a[_0x2ea26c(0x17e)](_0x2ea26c(0x119))),0x1;const _0x411daa=await confirmKey(_0x2ea26c(0x132)+(_0x100730+_0x6a1f33)+_0x2ea26c(0x1be));if(!_0x411daa)return console[_0x2ea26c(0x1c0)](a4_0x52269a[_0x2ea26c(0x193)](_0x2ea26c(0x1b2)),_0x2ea26c(0x1ba)),0x1;}const {data:_0x26153b}=await withSpinner(_0x2ea26c(0x19c),()=>_0x8ddaf3[_0x2ea26c(0x1af)][_0x2ea26c(0x128)](_0x3021fb,_0x53d569,{'force':_0x169cbb}));return console[_0x2ea26c(0x1c0)](a4_0x52269a[_0x2ea26c(0x198)]('\x0a✔\x20Pulled\x20'+(_0x100730+_0x6a1f33)+_0x2ea26c(0x12b)+_0x26153b[_0x2ea26c(0x15d)])),saveSessionContext({'llm_project':_0x26153b[_0x2ea26c(0xfa)]},_0x5d698d[_0x2ea26c(0x1bc)]),console[_0x2ea26c(0x1c0)](a4_0x52269a[_0x2ea26c(0x198)](_0x2ea26c(0x105)+a4_0x52269a[_0x2ea26c(0x17e)]('llm_project')+_0x2ea26c(0x101)+a4_0x52269a[_0x2ea26c(0x160)](_0x26153b[_0x2ea26c(0xfa)]))),0x0;}}function a4_0x141f(){const _0x3f50f7=['pushProject','Dry\x20run\x20-\x20no\x20changes\x20made','\x0aChanges\x20to\x20chat\x20interface\x20\x27','unchanged','utf-8','\x20errors','Output:\x20','\x22:\x20','\x0aProject\x20pushed\x20with\x20errors','\x0aChanges\x20to\x20form\x20interface\x20\x27','178tOGVhh','yellow','counts','\x20resources?','Would\x20push\x20agent:\x20','\x20\x20Form\x20Interfaces:\x20','green','hasChanges','\x0aPull\x20summary\x20for\x20\x27','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Writing\x20files...','\x20\x20Prompt\x20\x22','Using\x20project\x20from\x20context:\x20','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','18444JiiIzy','total','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Chat:\x20','\x20changed','\x20\x20Source:\x20','\x20\x20Agents:\x20','Would\x20pull\x20agent:\x20','\x0aChanges\x20to\x20agent\x20\x27','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','8346RmOQzP','error','Cloning\x20\x22','Project:\x20','cloneProject','llm','updated','\x22\x20from\x20project\x20\x22','Cancelled','push','repeat','cwd','new','pullAgent','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','arg-dir','-\x20no\x20files\x20written','\x20successfully','session','textKnowledgeBases','\x20files?','projectDir','log','\x20--profile\x20','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','projectName','\x22...','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20\x20Chat\x20Interface\x20\x22','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','New\x20project\x20name\x20is\x20required','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x20=\x20','Clone\x20\x22','\x27\x20to\x20create\x20the\x20folder\x20structure.','join','✔\x20Context\x20set:\x20','\x22\x20to\x20new\x20project\x20\x22','Errors:','Output\x20path:\x20','\x20updated','Using\x20context\x20project:\x20','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','3wlJNvM','Analyzing\x20changes\x20to\x20push...','22mebYqC','yes','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','gray','\x20\x20tdx\x20agent\x20pull\x20','agent:pull','Failed\x20to\x20push\x20agent:\x20','Pushing\x20to\x20project...','experimentalArtifacts','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20resources\x20to\x20\x27','462VmQxhQ','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x0aError:','\x20|\x20','agent:push','site','\x20\x20Chat\x20Interfaces:\x20','llmProject','tdx.json','\x20unchanged','experimentalKnowledgeBases','formInterfaces','agentName','pullProject','agentId','6435dkntDW','\x20files\x20to\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\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','\x0aChanges\x20to\x20prompt\x20\x27','dirname','New\x20project:\x20','\x20\x20Agent\x20\x22','\x0aWrite\x20','\x20\x20Form\x20Interface\x20\x22','INVALID_ARGUMENT','chatInterfaces','894048NeuGkp','\x20\x20Experimental\x20Artifact\x20\x22','Using\x20local\x20project:\x20','Dry\x20run\x20-\x20no\x20files\x20written','force','New\x20project\x20ID:\x20','description','diff','Pulling\x20agent\x20\x22','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','parse','197004ODySAU','projectId','Agent:\x20','\x20created','\x20\x20Experimental\x20Artifacts:\x20','sourceProjectName','\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','\x20\x20Prompts:\x20','5625725jHbvLq','\x20\x20Integrations:\x20','dryRun','created','124840pvAlpq','llm_project','\x20\x20Text\x20Knowledge\x20Bases:\x20','Using\x20project:\x20','Source:\x20','knowledgeBases','Using\x20project\x20from\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','red','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Pushing\x20agent\x20from\x20\x22','\x20new','Agent\x20pulled\x20successfully','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','name','outputDir','action','execute','cyan','message','Summary:','\x20\x20Integration\x20\x22','context','agent','reason','newProjectName','\x0aChanges\x20to\x20integration\x20\x27','agents','No\x20tdx.json\x20found\x20in\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','\x20\x20Knowledge\x20Bases:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','errors','\x0aErrors\x20found:','90vVUPYn','integrations','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','newProjectId','agent.yml','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20--name\x20','prompts','Agent\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20\x20Knowledge\x20Base\x20\x22','\x0a✔\x20Pushed\x20','\x22\x20to\x20\x22','\x20total','dim','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x0aPush\x20summary\x20for\x20\x27','Would\x20clone:','6776sDlhnw','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','outputPath','no_context','Project\x20cloned\x20with\x20errors','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed'];a4_0x141f=function(){return _0x3f50f7;};return a4_0x141f();}export class AgentCloneCommand extends BaseCommand{[a4_0x55f474(0x15c)]='agent:clone';[a4_0x55f474(0x13c)]=a4_0x55f474(0x157);async['execute'](_0x543903){const _0x22380c=a4_0x55f474,{options:_0x483b0b,args:_0x26f37d,tdx:_0x106fc7}=_0x543903,_0x1b37ad=_0x26f37d[0x0],_0x5a93d9=_0x483b0b[_0x22380c(0x15c)],_0x17271a=_0x483b0b[_0x22380c(0x14c)],_0x41c2c3=_0x483b0b[_0x22380c(0x10f)],_0x3f68a4=_0x483b0b[_0x22380c(0x120)],_0x324311=_0x483b0b[_0x22380c(0x122)];let _0x52616d;const _0x17d5d0=findAgentConfigPath(process[_0x22380c(0x1b5)]());if(_0x1b37ad){const _0x196cef=a4_0x644d9b['join'](_0x1b37ad,'tdx.json');existsSync(_0x196cef)?(_0x52616d=_0x1b37ad,console[_0x22380c(0x1c0)](a4_0x52269a[_0x22380c(0x17e)](_0x22380c(0x138)+_0x1b37ad))):_0x52616d=_0x1b37ad;}else{if(_0x17d5d0)_0x52616d=a4_0x644d9b[_0x22380c(0x12f)](_0x17d5d0),console[_0x22380c(0x1c0)](a4_0x52269a[_0x22380c(0x17e)]('Using\x20current\x20project:\x20'+_0x52616d));else{if(_0x324311){const _0x44ca38=sanitizeForFilesystem(_0x324311);let _0x1b9ad3=_0x44ca38,_0x4bcd23=a4_0x644d9b[_0x22380c(0x104)](process[_0x22380c(0x1b5)](),_0x22380c(0x169),_0x44ca38,_0x22380c(0x123));if(!existsSync(_0x4bcd23)){const _0x14095d=normalizeName(_0x324311),_0x5c8d0e=a4_0x644d9b['join'](process[_0x22380c(0x1b5)](),'agents',_0x14095d,_0x22380c(0x123));existsSync(_0x5c8d0e)&&(_0x1b9ad3=_0x14095d,_0x4bcd23=_0x5c8d0e);}if(existsSync(_0x4bcd23))_0x52616d=a4_0x644d9b[_0x22380c(0x12f)](_0x4bcd23),console[_0x22380c(0x1c0)](a4_0x52269a[_0x22380c(0x17e)](_0x22380c(0x138)+_0x52616d));else{const _0x49b3df=_0x483b0b['profile'];if(_0x49b3df)throw new SDKError(ErrorCode[_0x22380c(0x134)],_0x22380c(0xfc)+_0x324311+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x22380c(0x16d)+(_0x22380c(0x112)+_0x324311+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x1b9ad3+_0x22380c(0x176)+(_0x5a93d9||'<new-name>')+_0x22380c(0x1c1)+_0x49b3df)});_0x52616d=_0x324311,console[_0x22380c(0x1c0)](a4_0x52269a['dim'](_0x22380c(0x10a)+_0x324311));}}}}if(!_0x52616d)return console['log'](a4_0x52269a[_0x22380c(0x193)](_0x22380c(0x10b))),console['log'](_0x22380c(0x17f)),console[_0x22380c(0x1c0)](_0x22380c(0x19b)),console[_0x22380c(0x1c0)]('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console[_0x22380c(0x1c0)](_0x22380c(0x12c)),0x1;if(!_0x5a93d9)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x22380c(0xff),undefined,{'helpText':_0x22380c(0x118)});if(!_0x41c2c3&&!_0x17271a){if(!isInteractive())return console[_0x22380c(0x1ab)](a4_0x52269a[_0x22380c(0x156)](_0x22380c(0x11d)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x22380c(0x1ab)](a4_0x52269a[_0x22380c(0x17e)](_0x22380c(0x119))),0x1;const _0x43697b=await confirmKey(_0x22380c(0x102)+_0x52616d+_0x22380c(0x106)+_0x5a93d9+'\x22?');if(!_0x43697b)return console[_0x22380c(0x1c0)](a4_0x52269a[_0x22380c(0x193)]('Cancelled')),0x1;}const {data:_0x183988}=await withSpinner(_0x22380c(0x1ac)+_0x52616d+_0x22380c(0x17c)+_0x5a93d9+_0x22380c(0xfb),()=>_0x106fc7['llm'][_0x22380c(0x1ae)](_0x52616d,_0x5a93d9,{'dryRun':_0x17271a}));if(_0x17271a){console[_0x22380c(0x1c0)](a4_0x52269a[_0x22380c(0x193)](_0x22380c(0x189))),console[_0x22380c(0x1c0)](_0x22380c(0x152)+_0x183988[_0x22380c(0x147)]),console['log'](_0x22380c(0x130)+_0x5a93d9),console[_0x22380c(0x1c0)](_0x22380c(0x181)),console[_0x22380c(0x1c0)](_0x22380c(0x1a6)+_0x183988[_0x22380c(0x194)][_0x22380c(0x169)]['created']),console[_0x22380c(0x1c0)](_0x22380c(0x16c)+_0x183988['counts'][_0x22380c(0x153)][_0x22380c(0x14d)]),console[_0x22380c(0x1c0)](_0x22380c(0x149)+_0x183988['counts'][_0x22380c(0x177)]['created']),console['log'](_0x22380c(0x197)+_0x183988[_0x22380c(0x194)][_0x22380c(0x126)][_0x22380c(0x14d)]),console['log'](_0x22380c(0x121)+_0x183988[_0x22380c(0x194)][_0x22380c(0x135)][_0x22380c(0x14d)]);const _0x14cded=_0x183988[_0x22380c(0x194)][_0x22380c(0x125)][_0x22380c(0x14d)]>0x0||_0x183988[_0x22380c(0x194)][_0x22380c(0x116)][_0x22380c(0x14d)]>0x0;return _0x14cded&&(console[_0x22380c(0x1c0)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x183988[_0x22380c(0x194)][_0x22380c(0x125)][_0x22380c(0x14d)]),console['log'](_0x22380c(0x146)+_0x183988[_0x22380c(0x194)][_0x22380c(0x116)]['created'])),0x0;}const _0x57751b=_0x183988['counts'][_0x22380c(0x169)][_0x22380c(0x16e)]>0x0||_0x183988[_0x22380c(0x194)][_0x22380c(0x153)]['errors']>0x0||_0x183988[_0x22380c(0x194)]['prompts'][_0x22380c(0x16e)]>0x0||_0x183988[_0x22380c(0x194)][_0x22380c(0x126)]['errors']>0x0||_0x183988[_0x22380c(0x194)][_0x22380c(0x135)][_0x22380c(0x16e)]>0x0||_0x183988[_0x22380c(0x194)][_0x22380c(0x125)][_0x22380c(0x16e)]>0x0||_0x183988[_0x22380c(0x194)][_0x22380c(0x116)]['errors']>0x0;_0x57751b?console[_0x22380c(0x1c0)](a4_0x52269a[_0x22380c(0x193)](_0x22380c(0x186))):console['log'](a4_0x52269a[_0x22380c(0x198)]('Project\x20cloned\x20successfully'));console[_0x22380c(0x1c0)](_0x22380c(0x152)+_0x183988[_0x22380c(0x147)]),console['log'](_0x22380c(0x130)+_0x183988[_0x22380c(0x167)]),console[_0x22380c(0x1c0)](_0x22380c(0x13b)+_0x183988['newProjectId']),console[_0x22380c(0x1c0)](),console[_0x22380c(0x1c0)](_0x22380c(0x162)),console[_0x22380c(0x1c0)](_0x22380c(0x1a6)+formatCountSummary(_0x183988['counts'][_0x22380c(0x169)])),console[_0x22380c(0x1c0)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x183988[_0x22380c(0x194)][_0x22380c(0x153)])),console[_0x22380c(0x1c0)](_0x22380c(0x149)+formatCountSummary(_0x183988[_0x22380c(0x194)][_0x22380c(0x177)])),console[_0x22380c(0x1c0)](_0x22380c(0x14b)+formatCountSummary(_0x183988[_0x22380c(0x194)][_0x22380c(0x171)])),console[_0x22380c(0x1c0)](_0x22380c(0x197)+formatCountSummary(_0x183988[_0x22380c(0x194)]['formInterfaces'])),console['log'](_0x22380c(0x121)+formatCountSummary(_0x183988[_0x22380c(0x194)][_0x22380c(0x135)]));const _0x24ff2c=_0x183988['counts'][_0x22380c(0x125)]['created']>0x0||_0x183988[_0x22380c(0x194)]['experimentalKnowledgeBases'][_0x22380c(0x1b0)]>0x0||_0x183988[_0x22380c(0x194)][_0x22380c(0x125)]['unchanged']>0x0||_0x183988[_0x22380c(0x194)]['experimentalArtifacts']['created']>0x0||_0x183988[_0x22380c(0x194)][_0x22380c(0x116)]['updated']>0x0||_0x183988[_0x22380c(0x194)][_0x22380c(0x116)][_0x22380c(0x18b)]>0x0;_0x24ff2c&&(console[_0x22380c(0x1c0)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x183988[_0x22380c(0x194)][_0x22380c(0x125)])),console['log'](_0x22380c(0x146)+formatCountSummary(_0x183988['counts'][_0x22380c(0x116)])));if(_0x57751b){console[_0x22380c(0x1c0)](),console['log'](a4_0x52269a[_0x22380c(0x156)](_0x22380c(0x107)));for(const _0x5c9008 of _0x183988['agents']){_0x5c9008[_0x22380c(0x15e)]==='error'&&console[_0x22380c(0x1c0)](a4_0x52269a[_0x22380c(0x156)](_0x22380c(0x131)+_0x5c9008[_0x22380c(0x127)]+'\x22:\x20'+_0x5c9008['error']));}for(const _0xe07623 of _0x183988[_0x22380c(0x153)]){_0xe07623[_0x22380c(0x15e)]===_0x22380c(0x1ab)&&console[_0x22380c(0x1c0)](a4_0x52269a[_0x22380c(0x156)](_0x22380c(0x17a)+_0xe07623[_0x22380c(0x15c)]+'\x22:\x20'+_0xe07623[_0x22380c(0x1ab)]));}for(const _0x138320 of _0x183988[_0x22380c(0x177)]){_0x138320[_0x22380c(0x15e)]===_0x22380c(0x1ab)&&console[_0x22380c(0x1c0)](a4_0x52269a[_0x22380c(0x156)](_0x22380c(0x19d)+_0x138320[_0x22380c(0x15c)]+_0x22380c(0x18f)+_0x138320[_0x22380c(0x1ab)]));}for(const _0x4eca98 of _0x183988[_0x22380c(0x171)]){_0x4eca98[_0x22380c(0x15e)]===_0x22380c(0x1ab)&&console[_0x22380c(0x1c0)](a4_0x52269a[_0x22380c(0x156)](_0x22380c(0x163)+_0x4eca98[_0x22380c(0x15c)]+_0x22380c(0x18f)+_0x4eca98[_0x22380c(0x1ab)]));}for(const _0x2709c7 of _0x183988[_0x22380c(0x126)]){_0x2709c7[_0x22380c(0x15e)]===_0x22380c(0x1ab)&&console['log'](a4_0x52269a[_0x22380c(0x156)](_0x22380c(0x133)+_0x2709c7[_0x22380c(0x15c)]+_0x22380c(0x18f)+_0x2709c7['error']));}for(const _0x3c5d32 of _0x183988[_0x22380c(0x135)]){_0x3c5d32[_0x22380c(0x15e)]===_0x22380c(0x1ab)&&console[_0x22380c(0x1c0)](a4_0x52269a['red'](_0x22380c(0xfd)+_0x3c5d32[_0x22380c(0x15c)]+_0x22380c(0x18f)+_0x3c5d32[_0x22380c(0x1ab)]));}for(const _0x3c20c9 of _0x183988[_0x22380c(0x125)]){_0x3c20c9['action']===_0x22380c(0x1ab)&&console['log'](a4_0x52269a[_0x22380c(0x156)](_0x22380c(0x110)+_0x3c20c9['name']+'\x22:\x20'+_0x3c20c9[_0x22380c(0x1ab)]));}for(const _0x394cdf of _0x183988['experimentalArtifacts']){_0x394cdf['action']==='error'&&console[_0x22380c(0x1c0)](a4_0x52269a['red'](_0x22380c(0x137)+_0x394cdf[_0x22380c(0x15c)]+_0x22380c(0x18f)+_0x394cdf['error']));}return 0x1;}console['log']();const _0x1083a8=getLLMProjectUrl(_0x3f68a4,_0x183988[_0x22380c(0x173)]);return console['log']('Project:\x20'+a4_0x52269a[_0x22380c(0x160)](_0x1083a8)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x55f474(0x15c)]=a4_0x55f474(0x11f);['description']=a4_0x55f474(0x13f);async[a4_0x55f474(0x15f)](_0x54f6a8){const _0x174987=a4_0x55f474,{options:_0x2f5e5a,args:_0x53c5a5,tdx:_0x276a13}=_0x54f6a8;let _0x1d3a1e=_0x53c5a5[0x0]||process[_0x174987(0x1b5)]();const _0x401fd4=_0x2f5e5a[_0x174987(0x14c)],_0x9e373=_0x2f5e5a[_0x174987(0x13a)],_0x50dcfc=_0x2f5e5a[_0x174987(0x10f)],_0x485f9b=_0x2f5e5a[_0x174987(0x120)],_0x410da5=a4_0x644d9b['join'](_0x1d3a1e,_0x174987(0x174)),_0x41d359=existsSync(_0x410da5);if(_0x41d359){const {data:_0x4f55a8}=await withSpinner(_0x174987(0x158)+_0x1d3a1e+_0x174987(0xfb),()=>_0x276a13['llm']['pushAgent'](_0x1d3a1e,{'dryRun':_0x401fd4,'force':_0x9e373}));if(_0x401fd4)return console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x193)](_0x174987(0x189))),console[_0x174987(0x1c0)](_0x174987(0x196)+_0x4f55a8[_0x174987(0x127)]),0x0;if(_0x4f55a8[_0x174987(0x15e)]===_0x174987(0x1ab))return console['log'](a4_0x52269a[_0x174987(0x156)](_0x174987(0x114)+_0x4f55a8['error'])),0x1;console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x198)](_0x174987(0x178)+_0x4f55a8[_0x174987(0x15e)]+_0x174987(0x1bb))),console[_0x174987(0x1c0)](_0x174987(0x144)+_0x4f55a8['agentName']);if(_0x4f55a8[_0x174987(0x129)]&&_0x4f55a8[_0x174987(0x143)]){const _0x29f998=getLLMAgentChatUrl(_0x485f9b,_0x4f55a8['projectId'],_0x4f55a8[_0x174987(0x129)]);console[_0x174987(0x1c0)](_0x174987(0x1a3)+a4_0x52269a[_0x174987(0x160)](_0x29f998));}return 0x0;}const _0x5c676c=_0x2f5e5a[_0x174987(0x122)],_0x2f9f75=resolveProjectFromContext(_0x1d3a1e,_0x5c676c);if(_0x2f9f75['found'])_0x1d3a1e=_0x2f9f75[_0x174987(0x1bf)],_0x2f9f75['source']===_0x174987(0x164)&&console['log'](a4_0x52269a[_0x174987(0x17e)]('Using\x20project:\x20'+_0x1d3a1e));else{let _0x330321=_0x174987(0x100);_0x2f9f75[_0x174987(0x166)]==='no_local_folder'&&(_0x330321=_0x2f9f75[_0x174987(0x161)]+_0x174987(0x11c)+_0x2f9f75[_0x174987(0x122)]+_0x174987(0x103));throw new SDKError(ErrorCode[_0x174987(0x134)],_0x2f9f75[_0x174987(0x166)]===_0x174987(0x185)?_0x2f9f75[_0x174987(0x161)]:_0x174987(0x16a)+_0x1d3a1e,undefined,{'helpText':_0x330321});}const {data:_0xa8850b}=await withSpinner(_0x174987(0x10d),()=>_0x276a13[_0x174987(0x1af)][_0x174987(0x188)](_0x1d3a1e,{'dryRun':!![]})),_0x30b378=_0xa8850b[_0x174987(0x194)][_0x174987(0x169)][_0x174987(0x16e)]>0x0;if(_0x30b378){console['log'](a4_0x52269a[_0x174987(0x156)](_0x174987(0x16f)));for(const _0x133e99 of _0xa8850b[_0x174987(0x169)]){_0x133e99[_0x174987(0x15e)]==='error'&&console['log'](a4_0x52269a[_0x174987(0x156)](_0x174987(0x131)+_0x133e99['agentName']+_0x174987(0x18f)+_0x133e99[_0x174987(0x1ab)]));}return 0x1;}const _0xc3c282=_0xa8850b[_0x174987(0x194)][_0x174987(0x169)][_0x174987(0x14d)]+_0xa8850b[_0x174987(0x194)][_0x174987(0x153)]['created']+_0xa8850b[_0x174987(0x194)][_0x174987(0x1bd)][_0x174987(0x14d)]+_0xa8850b['counts']['prompts']['created']+_0xa8850b['counts'][_0x174987(0x171)][_0x174987(0x14d)]+_0xa8850b[_0x174987(0x194)]['experimentalKnowledgeBases'][_0x174987(0x14d)]+_0xa8850b[_0x174987(0x194)][_0x174987(0x116)][_0x174987(0x14d)]+_0xa8850b['counts'][_0x174987(0x126)][_0x174987(0x14d)]+_0xa8850b['counts']['chatInterfaces'][_0x174987(0x14d)],_0x32034c=_0xa8850b['counts'][_0x174987(0x169)][_0x174987(0x1b0)]+_0xa8850b['counts'][_0x174987(0x153)][_0x174987(0x1b0)]+_0xa8850b[_0x174987(0x194)][_0x174987(0x1bd)][_0x174987(0x1b0)]+_0xa8850b[_0x174987(0x194)][_0x174987(0x177)]['updated']+_0xa8850b[_0x174987(0x194)]['integrations'][_0x174987(0x1b0)]+_0xa8850b[_0x174987(0x194)][_0x174987(0x125)]['updated']+_0xa8850b[_0x174987(0x194)][_0x174987(0x116)]['updated']+_0xa8850b[_0x174987(0x194)]['formInterfaces']['updated']+_0xa8850b[_0x174987(0x194)]['chatInterfaces'][_0x174987(0x1b0)],_0x353384=_0xa8850b['counts'][_0x174987(0x169)][_0x174987(0x18b)]+_0xa8850b[_0x174987(0x194)][_0x174987(0x153)][_0x174987(0x18b)]+_0xa8850b[_0x174987(0x194)][_0x174987(0x1bd)][_0x174987(0x18b)]+_0xa8850b['counts']['prompts'][_0x174987(0x18b)]+_0xa8850b[_0x174987(0x194)]['integrations'][_0x174987(0x18b)]+_0xa8850b[_0x174987(0x194)][_0x174987(0x125)][_0x174987(0x18b)]+_0xa8850b[_0x174987(0x194)][_0x174987(0x116)][_0x174987(0x18b)]+_0xa8850b[_0x174987(0x194)]['formInterfaces']['unchanged']+_0xa8850b['counts'][_0x174987(0x135)]['unchanged'];console[_0x174987(0x1c0)](_0x174987(0x180)+_0xa8850b[_0x174987(0xfa)]+'\x27:'),console[_0x174987(0x1c0)]('\x20\x20'+a4_0x52269a[_0x174987(0x198)]('+\x20'+_0xc3c282+_0x174987(0x159))+'\x20|\x20'+a4_0x52269a[_0x174987(0x193)]('~\x20'+_0x32034c+_0x174987(0x1a4))+_0x174987(0x11e)+a4_0x52269a[_0x174987(0x17e)]('=\x20'+_0x353384+_0x174987(0x124))),console[_0x174987(0x1c0)](_0x174987(0x1a6)+formatCountSummary(_0xa8850b[_0x174987(0x194)][_0x174987(0x169)])),console[_0x174987(0x1c0)](_0x174987(0x16c)+formatCountSummary(_0xa8850b[_0x174987(0x194)][_0x174987(0x153)])),console[_0x174987(0x1c0)](_0x174987(0x150)+formatCountSummary(_0xa8850b['counts'][_0x174987(0x1bd)])),console[_0x174987(0x1c0)](_0x174987(0x149)+formatCountSummary(_0xa8850b[_0x174987(0x194)][_0x174987(0x177)])),console[_0x174987(0x1c0)](_0x174987(0x14b)+formatCountSummary(_0xa8850b[_0x174987(0x194)][_0x174987(0x171)])),console[_0x174987(0x1c0)](_0x174987(0x197)+formatCountSummary(_0xa8850b[_0x174987(0x194)]['formInterfaces'])),console['log'](_0x174987(0x121)+formatCountSummary(_0xa8850b['counts'][_0x174987(0x135)]));const _0x1beb15=_0xa8850b[_0x174987(0x194)][_0x174987(0x125)][_0x174987(0x14d)]>0x0||_0xa8850b['counts'][_0x174987(0x125)]['updated']>0x0||_0xa8850b[_0x174987(0x194)]['experimentalKnowledgeBases']['unchanged']>0x0||_0xa8850b[_0x174987(0x194)]['experimentalArtifacts'][_0x174987(0x14d)]>0x0||_0xa8850b[_0x174987(0x194)][_0x174987(0x116)][_0x174987(0x1b0)]>0x0||_0xa8850b[_0x174987(0x194)][_0x174987(0x116)][_0x174987(0x18b)]>0x0;_0x1beb15&&(console[_0x174987(0x1c0)](_0x174987(0x155)+formatCountSummary(_0xa8850b[_0x174987(0x194)][_0x174987(0x125)])),console[_0x174987(0x1c0)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0xa8850b[_0x174987(0x194)][_0x174987(0x116)])));console[_0x174987(0x1c0)](_0x174987(0x1a5)+a4_0x52269a[_0x174987(0x160)](_0x1d3a1e)),displayDiffs(_0xa8850b['agents'],_0xa8850b['knowledgeBases'],_0xa8850b['textKnowledgeBases'],_0xa8850b['prompts'],_0xa8850b[_0x174987(0x171)],_0xa8850b[_0x174987(0x125)],_0xa8850b[_0x174987(0x116)],_0xa8850b[_0x174987(0x126)],_0xa8850b[_0x174987(0x135)]);if(_0x401fd4)return console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x193)](_0x174987(0x187))),0x0;if(_0xc3c282===0x0&&_0x32034c===0x0){console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x198)](_0x174987(0x117)));const _0xf42e64=getLLMProjectUrl(_0x485f9b,_0xa8850b[_0x174987(0x143)]);return console[_0x174987(0x1c0)](_0x174987(0x1ad)+a4_0x52269a['cyan'](_0xf42e64)),0x0;}if(!_0x50dcfc&&!_0x9e373){if(!isInteractive())return console[_0x174987(0x1ab)](a4_0x52269a['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x174987(0x1ab)](a4_0x52269a[_0x174987(0x17e)](_0x174987(0x119))),0x1;const _0x2cdbb2=await confirmKey('\x0aPush\x20'+(_0xc3c282+_0x32034c)+_0x174987(0x195));if(!_0x2cdbb2)return console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x193)](_0x174987(0x1b2)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x5f1844}=await withSpinner(_0x174987(0x115),()=>_0x276a13[_0x174987(0x1af)][_0x174987(0x188)](_0x1d3a1e,{'force':_0x9e373})),_0x11ff10=_0x5f1844[_0x174987(0x194)][_0x174987(0x169)][_0x174987(0x16e)]>0x0||_0x5f1844['counts'][_0x174987(0x153)][_0x174987(0x16e)]>0x0||_0x5f1844['counts']['textKnowledgeBases'][_0x174987(0x16e)]>0x0||_0x5f1844[_0x174987(0x194)][_0x174987(0x177)][_0x174987(0x16e)]>0x0||_0x5f1844[_0x174987(0x194)][_0x174987(0x126)][_0x174987(0x16e)]>0x0||_0x5f1844['counts'][_0x174987(0x135)][_0x174987(0x16e)]>0x0;if(_0x11ff10){console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x193)](_0x174987(0x190))),console[_0x174987(0x1c0)](),console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x156)](_0x174987(0x107)));for(const _0x1fdba8 of _0x5f1844[_0x174987(0x169)]){_0x1fdba8['action']===_0x174987(0x1ab)&&console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x156)](_0x174987(0x131)+_0x1fdba8[_0x174987(0x127)]+_0x174987(0x18f)+_0x1fdba8[_0x174987(0x1ab)]));}for(const _0x40e34b of _0x5f1844[_0x174987(0x153)]){_0x40e34b[_0x174987(0x15e)]===_0x174987(0x1ab)&&console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x156)](_0x174987(0x17a)+_0x40e34b['name']+_0x174987(0x18f)+_0x40e34b[_0x174987(0x1ab)]));}for(const _0x4b4a22 of _0x5f1844[_0x174987(0x1bd)]){_0x4b4a22[_0x174987(0x15e)]===_0x174987(0x1ab)&&console['log'](a4_0x52269a[_0x174987(0x156)](_0x174987(0x1a2)+_0x4b4a22[_0x174987(0x15c)]+_0x174987(0x18f)+_0x4b4a22[_0x174987(0x1ab)]));}for(const _0x259fd1 of _0x5f1844[_0x174987(0x177)]){_0x259fd1[_0x174987(0x15e)]===_0x174987(0x1ab)&&console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x156)](_0x174987(0x19d)+_0x259fd1[_0x174987(0x15c)]+'\x22:\x20'+_0x259fd1['error']));}for(const _0x20cf2e of _0x5f1844[_0x174987(0x171)]){_0x20cf2e['action']==='error'&&console['log'](a4_0x52269a[_0x174987(0x156)](_0x174987(0x163)+_0x20cf2e[_0x174987(0x15c)]+_0x174987(0x18f)+_0x20cf2e[_0x174987(0x1ab)]));}for(const _0x58f17a of _0x5f1844[_0x174987(0x126)]){_0x58f17a[_0x174987(0x15e)]===_0x174987(0x1ab)&&console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x156)]('\x20\x20Form\x20Interface\x20\x22'+_0x58f17a['name']+'\x22:\x20'+_0x58f17a[_0x174987(0x1ab)]));}for(const _0x50cd57 of _0x5f1844[_0x174987(0x135)]){_0x50cd57[_0x174987(0x15e)]===_0x174987(0x1ab)&&console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x156)]('\x20\x20Chat\x20Interface\x20\x22'+_0x50cd57[_0x174987(0x15c)]+_0x174987(0x18f)+_0x50cd57[_0x174987(0x1ab)]));}return 0x1;}console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x198)](_0x174987(0x17b)+(_0xc3c282+_0x32034c)+_0x174987(0x11a)+_0x5f1844['projectName']+'\x27'));const _0x4002b3=getLLMProjectUrl(_0x485f9b,_0x5f1844[_0x174987(0x143)]);return console[_0x174987(0x1c0)]('Project:\x20'+a4_0x52269a[_0x174987(0x160)](_0x4002b3)),0x0;}}
1
+ const a4_0x2fdcfe=a4_0x267c;(function(_0x20096c,_0x38b5fe){const _0x5c096f=a4_0x267c,_0xeb9299=_0x20096c();while(!![]){try{const _0x4add96=parseInt(_0x5c096f(0x1dd))/0x1*(parseInt(_0x5c096f(0x1fc))/0x2)+-parseInt(_0x5c096f(0x18b))/0x3+parseInt(_0x5c096f(0x17c))/0x4+-parseInt(_0x5c096f(0x17a))/0x5+-parseInt(_0x5c096f(0x1f9))/0x6+parseInt(_0x5c096f(0x1e0))/0x7+-parseInt(_0x5c096f(0x205))/0x8*(-parseInt(_0x5c096f(0x190))/0x9);if(_0x4add96===_0x38b5fe)break;else _0xeb9299['push'](_0xeb9299['shift']());}catch(_0x482e6e){_0xeb9299['push'](_0xeb9299['shift']());}}}(a4_0x13d0,0x657c8));import a4_0x2cca95 from'chalk';import a4_0x5933e5 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';function a4_0x13d0(){const _0x223708=['Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0aChanges\x20to\x20chat\x20interface\x20\x27','reason','context','unchanged','Using\x20project\x20from\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','llmProject','projectId','Agent\x20pulled\x20successfully','counts','hasChanges','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Output:\x20','Pushing\x20agent\x20from\x20\x22','join','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','green','action','\x20=\x20','agentName','agent:push','outputDir','agent.yml','Project\x20cloned\x20with\x20errors','131947MTWjHY','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','534597MiHTkf','Project:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','\x20\x20Form\x20Interface\x20\x22','knowledgeBases','profile','created','yellow','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','INVALID_ARGUMENT','\x0aWrite\x20','\x20updated','-\x20nothing\x20pushed','session','\x20\x20Form\x20Interfaces:\x20','textKnowledgeBases','\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','updated','pushProject','projectDir','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','experimentalKnowledgeBases','utf-8','\x20created','output','245706FkNjdN','Agent\x20','total','2RZSyFX','\x20\x20Agent\x20\x22','agentId','llm','execute','Cloning\x20\x22','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','source','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','15752CyYykP','\x22\x20from\x20project\x20\x22','Using\x20project\x20from\x20context:\x20','agents','\x20--profile\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','chatInterfaces','\x20\x20Experimental\x20Artifact\x20\x22','tdx.json','Project\x20cloned\x20successfully','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x0aChanges:','\x20successfully','Status:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','newProjectId','\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','dryRun','diff','name','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','arg-dir','found','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20\x20Agents:\x20','\x20total','Using\x20context\x20project:\x20','cwd-config','New\x20project:\x20','\x20\x20Knowledge\x20Bases:\x20','newProjectName','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','Using\x20project:\x20','\x20\x20Chat\x20Interfaces:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','yes','Using\x20current\x20project:\x20','Clone\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','Chat:\x20','message','agent:clone','integrations','\x0aError:','Using\x20local\x20project:\x20','error','\x20\x20Text\x20Knowledge\x20Base\x20\x22','prompts','sourceProjectName','\x22:\x20','pullProject','\x0aPull\x20summary\x20for\x20\x27','agent','\x20unchanged','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x20\x20tdx\x20agent\x20pull\x20','Source:\x20','Would\x20clone:','3611920ykhsrU','Cancelled','3085016zabEHx','\x0aChanges\x20to\x20form\x20interface\x20\x27','\x20changed','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Pulling\x20agent\x20\x22','\x20\x20Source:\x20','Errors:','repeat','\x20\x20Knowledge\x20Base\x20\x22','Analyzing\x20project\x20\x22','New\x20project\x20ID:\x20','gray','\x0aChanges\x20to\x20integration\x20\x27','description','\x20\x20Experimental\x20Artifacts:\x20','2361054lcxtmI','\x22\x20to\x20\x22','\x20\x20Chat\x20Interface\x20\x22','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','No\x20tdx.json\x20found\x20in\x20','4509rFqzWA','\x20files?','\x22...','log','✔\x20Context\x20set:\x20','\x20resources?','push','Failed\x20to\x20push\x20agent:\x20','new','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x0aChanges\x20to\x20agent\x20\x27','cyan','\x20\x20Prompt\x20\x22','cwd','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Pushing\x20to\x20project...','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)','Agent:\x20','\x20\x20Prompts:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','errors','\x0aProject\x20pushed\x20with\x20errors','Summary:','\x20\x20Integration\x20\x22','parse','Dry\x20run\x20-\x20no\x20files\x20written','\x20new','dim','red','New\x20project\x20name\x20is\x20required','-\x20no\x20files\x20written','cloneProject','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x0aPush\x20','Dry\x20run\x20-\x20no\x20changes\x20made','dirname','\x20\x20Integrations:\x20','projectName','site','MISSING_ARGUMENT','force','llm_project','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20--name\x20','experimentalArtifacts','Analyzing\x20changes\x20to\x20push...','\x0aChanges\x20to\x20prompt\x20\x27','\x20|\x20','\x0a✔\x20Pulled\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','formInterfaces','pushAgent'];a4_0x13d0=function(){return _0x223708;};return a4_0x13d0();}import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';function a4_0x267c(_0x2b44d7,_0x2b5e8b){_0x2b44d7=_0x2b44d7-0x173;const _0x13d02b=a4_0x13d0();let _0x267c1c=_0x13d02b[_0x2b44d7];return _0x267c1c;}import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x357bda){const _0x166ebc=a4_0x267c,_0x4adde3=[];if(_0x357bda[_0x166ebc(0x1fb)]!==undefined)_0x4adde3[_0x166ebc(0x196)](_0x357bda[_0x166ebc(0x1fb)]+_0x166ebc(0x21e));if(_0x357bda['new']!==undefined&&_0x357bda[_0x166ebc(0x198)]>0x0)_0x4adde3[_0x166ebc(0x196)](a4_0x2cca95[_0x166ebc(0x1d5)](_0x357bda[_0x166ebc(0x198)]+_0x166ebc(0x1aa)));if(_0x357bda['created']!==undefined&&_0x357bda[_0x166ebc(0x1e6)]>0x0)_0x4adde3[_0x166ebc(0x196)](a4_0x2cca95[_0x166ebc(0x1d5)](_0x357bda['created']+_0x166ebc(0x1f7)));if(_0x357bda['updated']!==undefined&&_0x357bda[_0x166ebc(0x1f1)]>0x0)_0x4adde3['push'](a4_0x2cca95[_0x166ebc(0x1e7)](_0x357bda[_0x166ebc(0x1f1)]+_0x166ebc(0x1eb)));if(_0x357bda[_0x166ebc(0x1c8)]!==undefined&&_0x357bda['unchanged']>0x0)_0x4adde3[_0x166ebc(0x196)](a4_0x2cca95[_0x166ebc(0x187)](_0x357bda[_0x166ebc(0x1c8)]+_0x166ebc(0x175)));if(_0x357bda[_0x166ebc(0x1a4)]!==undefined&&_0x357bda['errors']>0x0)_0x4adde3[_0x166ebc(0x196)](a4_0x2cca95[_0x166ebc(0x1ac)](_0x357bda[_0x166ebc(0x1a4)]+'\x20errors'));return _0x4adde3[_0x166ebc(0x1d3)](',\x20');}function displayDiffs(_0x15a005,_0x104962,_0x5ee80e,_0x27f6fa,_0x4d148c,_0x520700,_0x3e00a8,_0x190b84,_0xc77917){const _0x14db1e=a4_0x267c;for(const _0xedbedf of _0x15a005){if(_0xedbedf[_0x14db1e(0x217)]){const _0x385ddd=_0xedbedf[_0x14db1e(0x1d8)]||_0xedbedf[_0x14db1e(0x218)];console[_0x14db1e(0x193)](_0x14db1e(0x19a)+_0x385ddd+'\x27:'),console[_0x14db1e(0x193)]('─'[_0x14db1e(0x183)](0x3c)),console[_0x14db1e(0x193)](_0xedbedf[_0x14db1e(0x217)]),console[_0x14db1e(0x193)]('─'[_0x14db1e(0x183)](0x3c));}}for(const _0x16a735 of _0x104962){_0x16a735[_0x14db1e(0x217)]&&(console[_0x14db1e(0x193)](_0x14db1e(0x21c)+_0x16a735[_0x14db1e(0x218)]+'\x27:'),console[_0x14db1e(0x193)]('─'['repeat'](0x3c)),console[_0x14db1e(0x193)](_0x16a735[_0x14db1e(0x217)]),console[_0x14db1e(0x193)]('─'[_0x14db1e(0x183)](0x3c)));}for(const _0x458b70 of _0x5ee80e){_0x458b70[_0x14db1e(0x217)]&&(console[_0x14db1e(0x193)](_0x14db1e(0x1f4)+_0x458b70[_0x14db1e(0x218)]+'\x27:'),console['log']('─'[_0x14db1e(0x183)](0x3c)),console['log'](_0x458b70[_0x14db1e(0x217)]),console[_0x14db1e(0x193)]('─'[_0x14db1e(0x183)](0x3c)));}for(const _0x3dd502 of _0x27f6fa){_0x3dd502[_0x14db1e(0x217)]&&(console[_0x14db1e(0x193)](_0x14db1e(0x1be)+_0x3dd502[_0x14db1e(0x218)]+'\x27:'),console[_0x14db1e(0x193)]('─'[_0x14db1e(0x183)](0x3c)),console[_0x14db1e(0x193)](_0x3dd502[_0x14db1e(0x217)]),console[_0x14db1e(0x193)]('─'[_0x14db1e(0x183)](0x3c)));}for(const _0x4dd8c1 of _0x4d148c){_0x4dd8c1[_0x14db1e(0x217)]&&(console[_0x14db1e(0x193)](_0x14db1e(0x188)+_0x4dd8c1[_0x14db1e(0x218)]+'\x27:'),console[_0x14db1e(0x193)]('─'[_0x14db1e(0x183)](0x3c)),console[_0x14db1e(0x193)](_0x4dd8c1[_0x14db1e(0x217)]),console[_0x14db1e(0x193)]('─'[_0x14db1e(0x183)](0x3c)));}for(const _0x4421e5 of _0x520700){_0x4421e5['diff']&&(console[_0x14db1e(0x193)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x4421e5['name']+'\x27:'),console['log']('─'[_0x14db1e(0x183)](0x3c)),console['log'](_0x4421e5[_0x14db1e(0x217)]),console[_0x14db1e(0x193)]('─'['repeat'](0x3c)));}for(const _0x352967 of _0x3e00a8){_0x352967['diff']&&(console[_0x14db1e(0x193)](_0x14db1e(0x1de)+_0x352967['name']+'\x27:'),console[_0x14db1e(0x193)]('─'[_0x14db1e(0x183)](0x3c)),console['log'](_0x352967[_0x14db1e(0x217)]),console[_0x14db1e(0x193)]('─'[_0x14db1e(0x183)](0x3c)));}for(const _0x2913b6 of _0x190b84){_0x2913b6[_0x14db1e(0x217)]&&(console[_0x14db1e(0x193)](_0x14db1e(0x17d)+_0x2913b6[_0x14db1e(0x218)]+'\x27:'),console[_0x14db1e(0x193)]('─'[_0x14db1e(0x183)](0x3c)),console[_0x14db1e(0x193)](_0x2913b6[_0x14db1e(0x217)]),console['log']('─'['repeat'](0x3c)));}for(const _0x57471c of _0xc77917){_0x57471c['diff']&&(console['log'](_0x14db1e(0x1c5)+_0x57471c['name']+'\x27:'),console[_0x14db1e(0x193)]('─'[_0x14db1e(0x183)](0x3c)),console[_0x14db1e(0x193)](_0x57471c[_0x14db1e(0x217)]),console['log']('─'[_0x14db1e(0x183)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';[a4_0x2fdcfe(0x189)]=a4_0x2fdcfe(0x224);async['execute'](_0x59965e){const _0x3c9492=a4_0x2fdcfe,{options:_0x14be59,args:_0x5f17cf,tdx:_0x5efed4}=_0x59965e,_0x51df4a=_0x5f17cf[0x0],_0x1d473f=_0x5f17cf[0x1],_0x444fdd=_0x14be59[_0x3c9492(0x1f8)],_0x551879=_0x14be59['dryRun'],_0x500ae0=_0x14be59[_0x3c9492(0x1b8)],_0x61e6f2=_0x14be59[_0x3c9492(0x228)],_0x404436=_0x14be59[_0x3c9492(0x1cb)],_0x2ac59c=_0x14be59[_0x3c9492(0x174)];let _0x2ff6e9;if(_0x51df4a){const _0x5b1330=a4_0x5933e5['join'](_0x51df4a,_0x3c9492(0x20d));if(existsSync(_0x5b1330))try{const _0x39d66c=JSON[_0x3c9492(0x1a8)](readFileSync(_0x5b1330,'utf-8'));_0x39d66c['llm_project']&&(_0x2ff6e9={'llm_project':_0x39d66c[_0x3c9492(0x1b9)]});}catch{}}const _0x1a0cf0=findAgentConfigPath(process[_0x3c9492(0x19d)]());let _0x211967;if(_0x1a0cf0)try{const _0x2e2c7d=JSON[_0x3c9492(0x1a8)](readFileSync(_0x1a0cf0,_0x3c9492(0x1f6)));_0x2e2c7d[_0x3c9492(0x1b9)]&&(_0x211967={'llm_project':_0x2e2c7d[_0x3c9492(0x1b9)]});}catch{}const _0x4ed349=resolveAgentPullArgs({'arg':_0x51df4a,'agentNameArg':_0x1d473f,'agentFlag':_0x2ac59c,'contextProject':_0x404436,'argDirConfig':_0x2ff6e9,'cwdConfigPath':_0x1a0cf0||undefined,'cwdConfig':_0x211967}),{projectNameOrId:_0x5bfc5b,targetAgentName:_0x4d34c2,existingOutputDir:_0xe9fffb,source:_0x3afdfd}=_0x4ed349;if(_0x3afdfd===_0x3c9492(0x21a))console['log'](a4_0x2cca95[_0x3c9492(0x1ab)](_0x3c9492(0x1c9)+a4_0x5933e5[_0x3c9492(0x1d3)](_0x51df4a,'tdx.json')+':\x20'+_0x5bfc5b));else{if(_0x3afdfd===_0x3c9492(0x220))console[_0x3c9492(0x193)](a4_0x2cca95[_0x3c9492(0x1ab)](_0x3c9492(0x225)+_0x5bfc5b));else _0x3afdfd===_0x3c9492(0x1c7)&&console['log'](a4_0x2cca95['dim'](_0x3c9492(0x207)+_0x5bfc5b));}if(!_0x5bfc5b)return _0x2ac59c?(console[_0x3c9492(0x193)](a4_0x2cca95[_0x3c9492(0x1e7)](_0x3c9492(0x20a))),console[_0x3c9492(0x193)](_0x3c9492(0x219)),console[_0x3c9492(0x193)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console['log'](a4_0x2cca95[_0x3c9492(0x1e7)](_0x3c9492(0x176))),console['log'](_0x3c9492(0x1a0)),console['log'](_0x3c9492(0x1f0)),console[_0x3c9492(0x193)](_0x3c9492(0x215)),console[_0x3c9492(0x193)]('\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[_0x3c9492(0x193)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x4d34c2){const {data:_0x456bac}=await withSpinner(_0x3c9492(0x180)+_0x4d34c2+_0x3c9492(0x206)+_0x5bfc5b+'\x22...',()=>_0x5efed4[_0x3c9492(0x1ff)]['pullAgent'](_0x5bfc5b,_0x4d34c2,_0x444fdd,{'dryRun':_0x551879,'force':_0x500ae0}));if(_0x551879)return console['log'](a4_0x2cca95[_0x3c9492(0x1e7)](_0x3c9492(0x1a9))),console[_0x3c9492(0x193)]('Would\x20pull\x20agent:\x20'+_0x456bac['agentName']),console[_0x3c9492(0x193)]('Output\x20path:\x20'+_0x456bac['outputPath']),_0x456bac[_0x3c9492(0x217)]&&(console[_0x3c9492(0x193)](_0x3c9492(0x210)),console['log']('─'[_0x3c9492(0x183)](0x3c)),console[_0x3c9492(0x193)](_0x456bac[_0x3c9492(0x217)]),console[_0x3c9492(0x193)]('─'['repeat'](0x3c))),0x0;return console['log'](a4_0x2cca95[_0x3c9492(0x1d5)](_0x3c9492(0x1cd))),console[_0x3c9492(0x193)](_0x3c9492(0x1a1)+_0x456bac[_0x3c9492(0x1d8)]),console[_0x3c9492(0x193)](_0x3c9492(0x1d1)+_0x456bac['outputPath']),console[_0x3c9492(0x193)](_0x3c9492(0x212)+(_0x456bac['isNew']?a4_0x2cca95[_0x3c9492(0x1d5)](_0x3c9492(0x198)):_0x456bac[_0x3c9492(0x1cf)]?a4_0x2cca95[_0x3c9492(0x1e7)](_0x3c9492(0x1f1)):a4_0x2cca95[_0x3c9492(0x187)]('unchanged'))),0x0;}const _0x4d8c20=_0xe9fffb||_0x444fdd,{data:_0x58ad87}=await withSpinner(_0x3c9492(0x185)+_0x5bfc5b+_0x3c9492(0x192),()=>_0x5efed4[_0x3c9492(0x1ff)]['pullProject'](_0x5bfc5b,_0x4d8c20,{'dryRun':!![]})),_0x2120b2=_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x208)]['new']+_0x58ad87['counts'][_0x3c9492(0x1e4)][_0x3c9492(0x198)]+_0x58ad87['counts']['textKnowledgeBases']['new']+_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x234)]['new']+_0x58ad87[_0x3c9492(0x1ce)]['integrations'][_0x3c9492(0x198)]+_0x58ad87['counts'][_0x3c9492(0x1f5)][_0x3c9492(0x198)]+_0x58ad87[_0x3c9492(0x1ce)]['experimentalArtifacts'][_0x3c9492(0x198)]+_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1c2)]['new']+_0x58ad87[_0x3c9492(0x1ce)]['chatInterfaces'][_0x3c9492(0x198)],_0x50db2d=_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x208)]['updated']+_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1e4)]['updated']+_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1ef)][_0x3c9492(0x1f1)]+_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x234)]['updated']+_0x58ad87['counts'][_0x3c9492(0x22f)][_0x3c9492(0x1f1)]+_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1f5)][_0x3c9492(0x1f1)]+_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1bc)][_0x3c9492(0x1f1)]+_0x58ad87[_0x3c9492(0x1ce)]['formInterfaces'][_0x3c9492(0x1f1)]+_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x20b)][_0x3c9492(0x1f1)],_0x1f00aa=_0x58ad87['counts']['agents'][_0x3c9492(0x1c8)]+_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1e4)][_0x3c9492(0x1c8)]+_0x58ad87['counts'][_0x3c9492(0x1ef)]['unchanged']+_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x234)][_0x3c9492(0x1c8)]+_0x58ad87['counts'][_0x3c9492(0x22f)][_0x3c9492(0x1c8)]+_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1f5)]['unchanged']+_0x58ad87['counts'][_0x3c9492(0x1bc)][_0x3c9492(0x1c8)]+_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1c2)]['unchanged']+_0x58ad87['counts']['chatInterfaces'][_0x3c9492(0x1c8)];console[_0x3c9492(0x193)](_0x3c9492(0x173)+_0x58ad87[_0x3c9492(0x1b5)]+'\x27:'),console[_0x3c9492(0x193)]('\x20\x20'+a4_0x2cca95['green']('+\x20'+_0x2120b2+'\x20new')+'\x20|\x20'+a4_0x2cca95[_0x3c9492(0x1e7)]('~\x20'+_0x50db2d+'\x20changed')+_0x3c9492(0x1bf)+a4_0x2cca95[_0x3c9492(0x1ab)]('=\x20'+_0x1f00aa+_0x3c9492(0x175))),console[_0x3c9492(0x193)](_0x3c9492(0x21d)+formatCountSummary(_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x208)])),console[_0x3c9492(0x193)](_0x3c9492(0x222)+formatCountSummary(_0x58ad87['counts'][_0x3c9492(0x1e4)])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1ef)])),console[_0x3c9492(0x193)](_0x3c9492(0x1a2)+formatCountSummary(_0x58ad87[_0x3c9492(0x1ce)]['prompts'])),console[_0x3c9492(0x193)](_0x3c9492(0x1b4)+formatCountSummary(_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x22f)])),console['log'](_0x3c9492(0x1ee)+formatCountSummary(_0x58ad87['counts'][_0x3c9492(0x1c2)])),console['log'](_0x3c9492(0x226)+formatCountSummary(_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x20b)]));const _0x6887b4=_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1f5)][_0x3c9492(0x1fb)]>0x0||_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1bc)][_0x3c9492(0x1fb)]>0x0;_0x6887b4&&(console['log'](_0x3c9492(0x1d4)+formatCountSummary(_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1f5)])),console[_0x3c9492(0x193)](_0x3c9492(0x18a)+formatCountSummary(_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1bc)])));console['log']('\x20\x20Target:\x20'+a4_0x2cca95[_0x3c9492(0x19b)](_0x58ad87[_0x3c9492(0x1da)])),displayDiffs(_0x58ad87[_0x3c9492(0x208)],_0x58ad87[_0x3c9492(0x1e4)],_0x58ad87['textKnowledgeBases'],_0x58ad87['prompts'],_0x58ad87[_0x3c9492(0x22f)],_0x58ad87[_0x3c9492(0x1f5)],_0x58ad87['experimentalArtifacts'],_0x58ad87['formInterfaces'],_0x58ad87['chatInterfaces']);if(_0x551879)return console[_0x3c9492(0x193)](a4_0x2cca95[_0x3c9492(0x1e7)](_0x3c9492(0x19e))),0x0;if(_0x2120b2===0x0&&_0x50db2d===0x0)return console[_0x3c9492(0x193)](a4_0x2cca95['green'](_0x3c9492(0x202))),saveSessionContext({'llm_project':_0x58ad87[_0x3c9492(0x1b5)]},_0x14be59[_0x3c9492(0x1ed)]),console[_0x3c9492(0x193)](a4_0x2cca95[_0x3c9492(0x1d5)](_0x3c9492(0x194)+a4_0x2cca95[_0x3c9492(0x1ab)](_0x3c9492(0x1b9))+'\x20=\x20'+a4_0x2cca95[_0x3c9492(0x19b)](_0x58ad87[_0x3c9492(0x1b5)]))),0x0;if(!_0x61e6f2&&!_0x500ae0){if(!isInteractive())return console[_0x3c9492(0x232)](a4_0x2cca95[_0x3c9492(0x1ac)](_0x3c9492(0x230)),_0x3c9492(0x1c4)),console[_0x3c9492(0x232)](a4_0x2cca95[_0x3c9492(0x1ab)](_0x3c9492(0x18e))),0x1;const _0x25feca=await confirmKey(_0x3c9492(0x1ea)+(_0x2120b2+_0x50db2d)+_0x3c9492(0x191));if(!_0x25feca)return console[_0x3c9492(0x193)](a4_0x2cca95[_0x3c9492(0x1e7)]('Cancelled'),_0x3c9492(0x1ae)),0x1;}const {data:_0x5508e6}=await withSpinner('Writing\x20files...',()=>_0x5efed4['llm'][_0x3c9492(0x237)](_0x5bfc5b,_0x4d8c20,{'force':_0x500ae0}));return console[_0x3c9492(0x193)](a4_0x2cca95['green'](_0x3c9492(0x1c0)+(_0x2120b2+_0x50db2d)+'\x20files\x20to\x20'+_0x5508e6[_0x3c9492(0x1da)])),saveSessionContext({'llm_project':_0x5508e6['projectName']},_0x14be59[_0x3c9492(0x1ed)]),console[_0x3c9492(0x193)](a4_0x2cca95[_0x3c9492(0x1d5)](_0x3c9492(0x194)+a4_0x2cca95[_0x3c9492(0x1ab)](_0x3c9492(0x1b9))+_0x3c9492(0x1d7)+a4_0x2cca95[_0x3c9492(0x19b)](_0x5508e6[_0x3c9492(0x1b5)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x2fdcfe(0x22e);['description']=a4_0x2fdcfe(0x17f);async[a4_0x2fdcfe(0x200)](_0x3c1ffe){const _0x1e7136=a4_0x2fdcfe,{options:_0x3b8b2e,args:_0x25538d,tdx:_0x462a9a}=_0x3c1ffe,_0x43b81e=_0x25538d[0x0],_0x3706d8=_0x3b8b2e['name'],_0x5eb3d1=_0x3b8b2e[_0x1e7136(0x216)],_0x5cf43e=_0x3b8b2e['yes'],_0x895ee8=_0x3b8b2e[_0x1e7136(0x1b6)],_0x24723e=_0x3b8b2e[_0x1e7136(0x1cb)];let _0x5c9902;const _0x59b01e=findAgentConfigPath(process[_0x1e7136(0x19d)]());if(_0x43b81e){const _0x5e13ab=a4_0x5933e5[_0x1e7136(0x1d3)](_0x43b81e,'tdx.json');existsSync(_0x5e13ab)?(_0x5c9902=_0x43b81e,console[_0x1e7136(0x193)](a4_0x2cca95[_0x1e7136(0x1ab)](_0x1e7136(0x231)+_0x43b81e))):_0x5c9902=_0x43b81e;}else{if(_0x59b01e)_0x5c9902=a4_0x5933e5[_0x1e7136(0x1b3)](_0x59b01e),console[_0x1e7136(0x193)](a4_0x2cca95[_0x1e7136(0x1ab)](_0x1e7136(0x229)+_0x5c9902));else{if(_0x24723e){const _0x502f30=sanitizeForFilesystem(_0x24723e);let _0x51d84f=_0x502f30,_0x3660c3=a4_0x5933e5[_0x1e7136(0x1d3)](process[_0x1e7136(0x19d)](),'agents',_0x502f30,_0x1e7136(0x20d));if(!existsSync(_0x3660c3)){const _0x35a677=normalizeName(_0x24723e),_0x4b6e27=a4_0x5933e5['join'](process[_0x1e7136(0x19d)](),'agents',_0x35a677,_0x1e7136(0x20d));existsSync(_0x4b6e27)&&(_0x51d84f=_0x35a677,_0x3660c3=_0x4b6e27);}if(existsSync(_0x3660c3))_0x5c9902=a4_0x5933e5[_0x1e7136(0x1b3)](_0x3660c3),console[_0x1e7136(0x193)](a4_0x2cca95['dim'](_0x1e7136(0x231)+_0x5c9902));else{const _0x5d3e0c=_0x3b8b2e[_0x1e7136(0x1e5)];if(_0x5d3e0c)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1e7136(0x1b0)+_0x24723e+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x1e7136(0x1a3)+_0x1e7136(0x204)+(_0x1e7136(0x177)+_0x24723e+'\x0a')+(_0x1e7136(0x1e2)+_0x51d84f+_0x1e7136(0x1bb)+(_0x3706d8||'<new-name>')+_0x1e7136(0x209)+_0x5d3e0c)});_0x5c9902=_0x24723e,console['log'](a4_0x2cca95[_0x1e7136(0x1ab)](_0x1e7136(0x21f)+_0x24723e));}}}}if(!_0x5c9902)return console[_0x1e7136(0x193)](a4_0x2cca95[_0x1e7136(0x1e7)](_0x1e7136(0x1d0))),console['log'](_0x1e7136(0x199)),console[_0x1e7136(0x193)](_0x1e7136(0x1c1)),console[_0x1e7136(0x193)]('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console['log'](_0x1e7136(0x1df)),0x1;if(!_0x3706d8)throw new SDKError(ErrorCode[_0x1e7136(0x1b7)],_0x1e7136(0x1ad),undefined,{'helpText':_0x1e7136(0x20f)});if(!_0x5cf43e&&!_0x5eb3d1){if(!isInteractive())return console['error'](a4_0x2cca95['red'](_0x1e7136(0x230)),_0x1e7136(0x1c4)),console[_0x1e7136(0x232)](a4_0x2cca95[_0x1e7136(0x1ab)](_0x1e7136(0x18e))),0x1;const _0x30ca39=await confirmKey(_0x1e7136(0x22a)+_0x5c9902+'\x22\x20to\x20new\x20project\x20\x22'+_0x3706d8+'\x22?');if(!_0x30ca39)return console['log'](a4_0x2cca95['yellow'](_0x1e7136(0x17b))),0x1;}const {data:_0x38affd}=await withSpinner(_0x1e7136(0x201)+_0x5c9902+_0x1e7136(0x18c)+_0x3706d8+_0x1e7136(0x192),()=>_0x462a9a[_0x1e7136(0x1ff)][_0x1e7136(0x1af)](_0x5c9902,_0x3706d8,{'dryRun':_0x5eb3d1}));if(_0x5eb3d1){console[_0x1e7136(0x193)](a4_0x2cca95['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x1e7136(0x193)](_0x1e7136(0x178)+_0x38affd[_0x1e7136(0x235)]),console[_0x1e7136(0x193)]('New\x20project:\x20'+_0x3706d8),console[_0x1e7136(0x193)](_0x1e7136(0x179)),console[_0x1e7136(0x193)]('\x20\x20Agents:\x20'+_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x208)][_0x1e7136(0x1e6)]),console[_0x1e7136(0x193)]('\x20\x20Knowledge\x20Bases:\x20'+_0x38affd['counts'][_0x1e7136(0x1e4)][_0x1e7136(0x1e6)]),console[_0x1e7136(0x193)](_0x1e7136(0x1a2)+_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x234)][_0x1e7136(0x1e6)]),console[_0x1e7136(0x193)]('\x20\x20Form\x20Interfaces:\x20'+_0x38affd['counts']['formInterfaces'][_0x1e7136(0x1e6)]),console['log']('\x20\x20Chat\x20Interfaces:\x20'+_0x38affd['counts'][_0x1e7136(0x20b)][_0x1e7136(0x1e6)]);const _0x3f88e9=_0x38affd['counts'][_0x1e7136(0x1f5)]['created']>0x0||_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x1bc)][_0x1e7136(0x1e6)]>0x0;return _0x3f88e9&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x1f5)][_0x1e7136(0x1e6)]),console[_0x1e7136(0x193)](_0x1e7136(0x18a)+_0x38affd[_0x1e7136(0x1ce)]['experimentalArtifacts'][_0x1e7136(0x1e6)])),0x0;}const _0x2803c6=_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x208)][_0x1e7136(0x1a4)]>0x0||_0x38affd[_0x1e7136(0x1ce)]['knowledgeBases'][_0x1e7136(0x1a4)]>0x0||_0x38affd[_0x1e7136(0x1ce)]['prompts'][_0x1e7136(0x1a4)]>0x0||_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x1c2)]['errors']>0x0||_0x38affd[_0x1e7136(0x1ce)]['chatInterfaces'][_0x1e7136(0x1a4)]>0x0||_0x38affd['counts'][_0x1e7136(0x1f5)][_0x1e7136(0x1a4)]>0x0||_0x38affd[_0x1e7136(0x1ce)]['experimentalArtifacts']['errors']>0x0;_0x2803c6?console[_0x1e7136(0x193)](a4_0x2cca95['yellow'](_0x1e7136(0x1dc))):console[_0x1e7136(0x193)](a4_0x2cca95[_0x1e7136(0x1d5)](_0x1e7136(0x20e)));console[_0x1e7136(0x193)](_0x1e7136(0x178)+_0x38affd[_0x1e7136(0x235)]),console['log'](_0x1e7136(0x221)+_0x38affd[_0x1e7136(0x223)]),console['log'](_0x1e7136(0x186)+_0x38affd[_0x1e7136(0x214)]),console[_0x1e7136(0x193)](),console[_0x1e7136(0x193)](_0x1e7136(0x1a6)),console[_0x1e7136(0x193)](_0x1e7136(0x21d)+formatCountSummary(_0x38affd['counts'][_0x1e7136(0x208)])),console[_0x1e7136(0x193)](_0x1e7136(0x222)+formatCountSummary(_0x38affd[_0x1e7136(0x1ce)]['knowledgeBases'])),console[_0x1e7136(0x193)](_0x1e7136(0x1a2)+formatCountSummary(_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x234)])),console[_0x1e7136(0x193)](_0x1e7136(0x1b4)+formatCountSummary(_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x22f)])),console[_0x1e7136(0x193)](_0x1e7136(0x1ee)+formatCountSummary(_0x38affd[_0x1e7136(0x1ce)]['formInterfaces'])),console[_0x1e7136(0x193)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x20b)]));const _0x5230ce=_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x1f5)][_0x1e7136(0x1e6)]>0x0||_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x1f5)][_0x1e7136(0x1f1)]>0x0||_0x38affd['counts'][_0x1e7136(0x1f5)][_0x1e7136(0x1c8)]>0x0||_0x38affd['counts'][_0x1e7136(0x1bc)][_0x1e7136(0x1e6)]>0x0||_0x38affd['counts']['experimentalArtifacts'][_0x1e7136(0x1f1)]>0x0||_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x1bc)]['unchanged']>0x0;_0x5230ce&&(console[_0x1e7136(0x193)](_0x1e7136(0x1d4)+formatCountSummary(_0x38affd['counts'][_0x1e7136(0x1f5)])),console[_0x1e7136(0x193)](_0x1e7136(0x18a)+formatCountSummary(_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x1bc)])));if(_0x2803c6){console[_0x1e7136(0x193)](),console[_0x1e7136(0x193)](a4_0x2cca95[_0x1e7136(0x1ac)](_0x1e7136(0x182)));for(const _0x3438bc of _0x38affd[_0x1e7136(0x208)]){_0x3438bc[_0x1e7136(0x1d6)]===_0x1e7136(0x232)&&console[_0x1e7136(0x193)](a4_0x2cca95['red']('\x20\x20Agent\x20\x22'+_0x3438bc[_0x1e7136(0x1d8)]+'\x22:\x20'+_0x3438bc['error']));}for(const _0x6a4c13 of _0x38affd[_0x1e7136(0x1e4)]){_0x6a4c13[_0x1e7136(0x1d6)]==='error'&&console[_0x1e7136(0x193)](a4_0x2cca95[_0x1e7136(0x1ac)](_0x1e7136(0x184)+_0x6a4c13[_0x1e7136(0x218)]+_0x1e7136(0x236)+_0x6a4c13['error']));}for(const _0x1c1e99 of _0x38affd[_0x1e7136(0x234)]){_0x1c1e99[_0x1e7136(0x1d6)]==='error'&&console['log'](a4_0x2cca95[_0x1e7136(0x1ac)](_0x1e7136(0x19c)+_0x1c1e99[_0x1e7136(0x218)]+_0x1e7136(0x236)+_0x1c1e99[_0x1e7136(0x232)]));}for(const _0x150313 of _0x38affd[_0x1e7136(0x22f)]){_0x150313['action']===_0x1e7136(0x232)&&console[_0x1e7136(0x193)](a4_0x2cca95[_0x1e7136(0x1ac)](_0x1e7136(0x1a7)+_0x150313['name']+_0x1e7136(0x236)+_0x150313[_0x1e7136(0x232)]));}for(const _0x15cf99 of _0x38affd['formInterfaces']){_0x15cf99['action']===_0x1e7136(0x232)&&console[_0x1e7136(0x193)](a4_0x2cca95['red'](_0x1e7136(0x1e3)+_0x15cf99[_0x1e7136(0x218)]+'\x22:\x20'+_0x15cf99[_0x1e7136(0x232)]));}for(const _0x3ca02f of _0x38affd['chatInterfaces']){_0x3ca02f[_0x1e7136(0x1d6)]===_0x1e7136(0x232)&&console['log'](a4_0x2cca95[_0x1e7136(0x1ac)]('\x20\x20Chat\x20Interface\x20\x22'+_0x3ca02f[_0x1e7136(0x218)]+_0x1e7136(0x236)+_0x3ca02f[_0x1e7136(0x232)]));}for(const _0x25a95a of _0x38affd[_0x1e7136(0x1f5)]){_0x25a95a[_0x1e7136(0x1d6)]===_0x1e7136(0x232)&&console[_0x1e7136(0x193)](a4_0x2cca95[_0x1e7136(0x1ac)](_0x1e7136(0x1ca)+_0x25a95a[_0x1e7136(0x218)]+_0x1e7136(0x236)+_0x25a95a[_0x1e7136(0x232)]));}for(const _0x506625 of _0x38affd['experimentalArtifacts']){_0x506625[_0x1e7136(0x1d6)]===_0x1e7136(0x232)&&console[_0x1e7136(0x193)](a4_0x2cca95[_0x1e7136(0x1ac)](_0x1e7136(0x20c)+_0x506625[_0x1e7136(0x218)]+_0x1e7136(0x236)+_0x506625[_0x1e7136(0x232)]));}return 0x1;}console[_0x1e7136(0x193)]();const _0x26d2b7=getLLMProjectUrl(_0x895ee8,_0x38affd[_0x1e7136(0x214)]);return console['log'](_0x1e7136(0x1e1)+a4_0x2cca95['cyan'](_0x26d2b7)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x2fdcfe(0x1d9);[a4_0x2fdcfe(0x189)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x2fdcfe(0x200)](_0x8b2d1d){const _0x23e7b6=a4_0x2fdcfe,{options:_0x3e2db6,args:_0x495a73,tdx:_0x2281dc}=_0x8b2d1d;let _0x5ad11e=_0x495a73[0x0]||process[_0x23e7b6(0x19d)]();const _0x43b4df=_0x3e2db6[_0x23e7b6(0x216)],_0x43b9b1=_0x3e2db6['force'],_0x24cbb7=_0x3e2db6['yes'],_0x2555a9=_0x3e2db6[_0x23e7b6(0x1b6)],_0x259e7f=a4_0x5933e5['join'](_0x5ad11e,_0x23e7b6(0x1db)),_0x5a6ff7=existsSync(_0x259e7f);if(_0x5a6ff7){const {data:_0x535b15}=await withSpinner(_0x23e7b6(0x1d2)+_0x5ad11e+'\x22...',()=>_0x2281dc[_0x23e7b6(0x1ff)][_0x23e7b6(0x1c3)](_0x5ad11e,{'dryRun':_0x43b4df,'force':_0x43b9b1}));if(_0x43b4df)return console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1e7)](_0x23e7b6(0x1b2))),console[_0x23e7b6(0x193)]('Would\x20push\x20agent:\x20'+_0x535b15[_0x23e7b6(0x1d8)]),0x0;if(_0x535b15[_0x23e7b6(0x1d6)]===_0x23e7b6(0x232))return console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1ac)](_0x23e7b6(0x197)+_0x535b15[_0x23e7b6(0x232)])),0x1;console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1d5)](_0x23e7b6(0x1fa)+_0x535b15[_0x23e7b6(0x1d6)]+_0x23e7b6(0x211))),console[_0x23e7b6(0x193)]('Agent:\x20'+_0x535b15[_0x23e7b6(0x1d8)]);if(_0x535b15['agentId']&&_0x535b15[_0x23e7b6(0x1cc)]){const _0x3b626f=getLLMAgentChatUrl(_0x2555a9,_0x535b15[_0x23e7b6(0x1cc)],_0x535b15[_0x23e7b6(0x1fe)]);console[_0x23e7b6(0x193)](_0x23e7b6(0x22c)+a4_0x2cca95['cyan'](_0x3b626f));}return 0x0;}const _0x19ece=_0x3e2db6[_0x23e7b6(0x1cb)],_0x542592=resolveProjectFromContext(_0x5ad11e,_0x19ece);if(_0x542592[_0x23e7b6(0x21b)])_0x5ad11e=_0x542592[_0x23e7b6(0x1f3)],_0x542592[_0x23e7b6(0x203)]===_0x23e7b6(0x1c7)&&console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1ab)](_0x23e7b6(0x225)+_0x5ad11e));else{let _0x5b6c90=_0x23e7b6(0x1e8);_0x542592[_0x23e7b6(0x1c6)]==='no_local_folder'&&(_0x5b6c90=_0x542592[_0x23e7b6(0x22d)]+_0x23e7b6(0x227)+_0x542592[_0x23e7b6(0x1cb)]+_0x23e7b6(0x213));throw new SDKError(ErrorCode[_0x23e7b6(0x1e9)],_0x542592[_0x23e7b6(0x1c6)]==='no_context'?_0x542592[_0x23e7b6(0x22d)]:_0x23e7b6(0x18f)+_0x5ad11e,undefined,{'helpText':_0x5b6c90});}const {data:_0x20ee30}=await withSpinner(_0x23e7b6(0x1bd),()=>_0x2281dc[_0x23e7b6(0x1ff)][_0x23e7b6(0x1f2)](_0x5ad11e,{'dryRun':!![]})),_0x2d4edd=_0x20ee30[_0x23e7b6(0x1ce)]['agents'][_0x23e7b6(0x1a4)]>0x0;if(_0x2d4edd){console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1ac)]('\x0aErrors\x20found:'));for(const _0x193bdf of _0x20ee30['agents']){_0x193bdf[_0x23e7b6(0x1d6)]===_0x23e7b6(0x232)&&console[_0x23e7b6(0x193)](a4_0x2cca95['red'](_0x23e7b6(0x1fd)+_0x193bdf[_0x23e7b6(0x1d8)]+_0x23e7b6(0x236)+_0x193bdf[_0x23e7b6(0x232)]));}return 0x1;}const _0x4292de=_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x208)]['created']+_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1e4)]['created']+_0x20ee30['counts']['textKnowledgeBases'][_0x23e7b6(0x1e6)]+_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x234)][_0x23e7b6(0x1e6)]+_0x20ee30[_0x23e7b6(0x1ce)]['integrations'][_0x23e7b6(0x1e6)]+_0x20ee30['counts'][_0x23e7b6(0x1f5)][_0x23e7b6(0x1e6)]+_0x20ee30['counts'][_0x23e7b6(0x1bc)][_0x23e7b6(0x1e6)]+_0x20ee30['counts'][_0x23e7b6(0x1c2)]['created']+_0x20ee30[_0x23e7b6(0x1ce)]['chatInterfaces'][_0x23e7b6(0x1e6)],_0x3c3f73=_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x208)][_0x23e7b6(0x1f1)]+_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1e4)][_0x23e7b6(0x1f1)]+_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1ef)][_0x23e7b6(0x1f1)]+_0x20ee30['counts'][_0x23e7b6(0x234)][_0x23e7b6(0x1f1)]+_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x22f)]['updated']+_0x20ee30[_0x23e7b6(0x1ce)]['experimentalKnowledgeBases'][_0x23e7b6(0x1f1)]+_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1bc)][_0x23e7b6(0x1f1)]+_0x20ee30[_0x23e7b6(0x1ce)]['formInterfaces']['updated']+_0x20ee30['counts'][_0x23e7b6(0x20b)][_0x23e7b6(0x1f1)],_0x5e6138=_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x208)][_0x23e7b6(0x1c8)]+_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1e4)][_0x23e7b6(0x1c8)]+_0x20ee30[_0x23e7b6(0x1ce)]['textKnowledgeBases'][_0x23e7b6(0x1c8)]+_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x234)][_0x23e7b6(0x1c8)]+_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x22f)]['unchanged']+_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1f5)][_0x23e7b6(0x1c8)]+_0x20ee30['counts']['experimentalArtifacts'][_0x23e7b6(0x1c8)]+_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1c2)][_0x23e7b6(0x1c8)]+_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x20b)][_0x23e7b6(0x1c8)];console[_0x23e7b6(0x193)]('\x0aPush\x20summary\x20for\x20\x27'+_0x20ee30['projectName']+'\x27:'),console[_0x23e7b6(0x193)]('\x20\x20'+a4_0x2cca95[_0x23e7b6(0x1d5)]('+\x20'+_0x4292de+'\x20new')+_0x23e7b6(0x1bf)+a4_0x2cca95[_0x23e7b6(0x1e7)]('~\x20'+_0x3c3f73+_0x23e7b6(0x17e))+_0x23e7b6(0x1bf)+a4_0x2cca95[_0x23e7b6(0x1ab)]('=\x20'+_0x5e6138+_0x23e7b6(0x175))),console['log'](_0x23e7b6(0x21d)+formatCountSummary(_0x20ee30[_0x23e7b6(0x1ce)]['agents'])),console[_0x23e7b6(0x193)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1e4)])),console[_0x23e7b6(0x193)](_0x23e7b6(0x22b)+formatCountSummary(_0x20ee30[_0x23e7b6(0x1ce)]['textKnowledgeBases'])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x20ee30[_0x23e7b6(0x1ce)]['prompts'])),console[_0x23e7b6(0x193)](_0x23e7b6(0x1b4)+formatCountSummary(_0x20ee30['counts'][_0x23e7b6(0x22f)])),console['log'](_0x23e7b6(0x1ee)+formatCountSummary(_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1c2)])),console[_0x23e7b6(0x193)](_0x23e7b6(0x226)+formatCountSummary(_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x20b)]));const _0x19ada5=_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1f5)][_0x23e7b6(0x1e6)]>0x0||_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1f5)][_0x23e7b6(0x1f1)]>0x0||_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1f5)]['unchanged']>0x0||_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1bc)][_0x23e7b6(0x1e6)]>0x0||_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1bc)]['updated']>0x0||_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1bc)][_0x23e7b6(0x1c8)]>0x0;_0x19ada5&&(console[_0x23e7b6(0x193)](_0x23e7b6(0x1d4)+formatCountSummary(_0x20ee30['counts'][_0x23e7b6(0x1f5)])),console['log'](_0x23e7b6(0x18a)+formatCountSummary(_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1bc)])));console['log'](_0x23e7b6(0x181)+a4_0x2cca95[_0x23e7b6(0x19b)](_0x5ad11e)),displayDiffs(_0x20ee30[_0x23e7b6(0x208)],_0x20ee30['knowledgeBases'],_0x20ee30[_0x23e7b6(0x1ef)],_0x20ee30[_0x23e7b6(0x234)],_0x20ee30[_0x23e7b6(0x22f)],_0x20ee30[_0x23e7b6(0x1f5)],_0x20ee30[_0x23e7b6(0x1bc)],_0x20ee30[_0x23e7b6(0x1c2)],_0x20ee30[_0x23e7b6(0x20b)]);if(_0x43b4df)return console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1e7)](_0x23e7b6(0x1ba))),0x0;if(_0x4292de===0x0&&_0x3c3f73===0x0){console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1d5)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x13a760=getLLMProjectUrl(_0x2555a9,_0x20ee30[_0x23e7b6(0x1cc)]);return console[_0x23e7b6(0x193)](_0x23e7b6(0x1e1)+a4_0x2cca95[_0x23e7b6(0x19b)](_0x13a760)),0x0;}if(!_0x24cbb7&&!_0x43b9b1){if(!isInteractive())return console[_0x23e7b6(0x232)](a4_0x2cca95[_0x23e7b6(0x1ac)](_0x23e7b6(0x230)),_0x23e7b6(0x1c4)),console['error'](a4_0x2cca95[_0x23e7b6(0x1ab)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x43a159=await confirmKey(_0x23e7b6(0x1b1)+(_0x4292de+_0x3c3f73)+_0x23e7b6(0x195));if(!_0x43a159)return console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1e7)](_0x23e7b6(0x17b)),_0x23e7b6(0x1ec)),0x1;}const {data:_0x5ef2ec}=await withSpinner(_0x23e7b6(0x19f),()=>_0x2281dc[_0x23e7b6(0x1ff)]['pushProject'](_0x5ad11e,{'force':_0x43b9b1})),_0x1b90d8=_0x5ef2ec[_0x23e7b6(0x1ce)][_0x23e7b6(0x208)][_0x23e7b6(0x1a4)]>0x0||_0x5ef2ec[_0x23e7b6(0x1ce)][_0x23e7b6(0x1e4)][_0x23e7b6(0x1a4)]>0x0||_0x5ef2ec['counts'][_0x23e7b6(0x1ef)][_0x23e7b6(0x1a4)]>0x0||_0x5ef2ec['counts'][_0x23e7b6(0x234)][_0x23e7b6(0x1a4)]>0x0||_0x5ef2ec[_0x23e7b6(0x1ce)][_0x23e7b6(0x1c2)][_0x23e7b6(0x1a4)]>0x0||_0x5ef2ec[_0x23e7b6(0x1ce)][_0x23e7b6(0x20b)][_0x23e7b6(0x1a4)]>0x0;if(_0x1b90d8){console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1e7)](_0x23e7b6(0x1a5))),console['log'](),console['log'](a4_0x2cca95[_0x23e7b6(0x1ac)]('Errors:'));for(const _0x12ccfa of _0x5ef2ec[_0x23e7b6(0x208)]){_0x12ccfa['action']===_0x23e7b6(0x232)&&console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1ac)](_0x23e7b6(0x1fd)+_0x12ccfa[_0x23e7b6(0x1d8)]+_0x23e7b6(0x236)+_0x12ccfa[_0x23e7b6(0x232)]));}for(const _0x1dd94f of _0x5ef2ec[_0x23e7b6(0x1e4)]){_0x1dd94f[_0x23e7b6(0x1d6)]===_0x23e7b6(0x232)&&console[_0x23e7b6(0x193)](a4_0x2cca95['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x1dd94f['name']+'\x22:\x20'+_0x1dd94f[_0x23e7b6(0x232)]));}for(const _0x2648ba of _0x5ef2ec['textKnowledgeBases']){_0x2648ba[_0x23e7b6(0x1d6)]==='error'&&console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1ac)](_0x23e7b6(0x233)+_0x2648ba[_0x23e7b6(0x218)]+_0x23e7b6(0x236)+_0x2648ba[_0x23e7b6(0x232)]));}for(const _0x30323e of _0x5ef2ec[_0x23e7b6(0x234)]){_0x30323e[_0x23e7b6(0x1d6)]===_0x23e7b6(0x232)&&console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1ac)](_0x23e7b6(0x19c)+_0x30323e[_0x23e7b6(0x218)]+_0x23e7b6(0x236)+_0x30323e[_0x23e7b6(0x232)]));}for(const _0x410e46 of _0x5ef2ec[_0x23e7b6(0x22f)]){_0x410e46['action']===_0x23e7b6(0x232)&&console[_0x23e7b6(0x193)](a4_0x2cca95['red'](_0x23e7b6(0x1a7)+_0x410e46[_0x23e7b6(0x218)]+_0x23e7b6(0x236)+_0x410e46[_0x23e7b6(0x232)]));}for(const _0x3ff7ac of _0x5ef2ec[_0x23e7b6(0x1c2)]){_0x3ff7ac['action']==='error'&&console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1ac)]('\x20\x20Form\x20Interface\x20\x22'+_0x3ff7ac[_0x23e7b6(0x218)]+'\x22:\x20'+_0x3ff7ac['error']));}for(const _0x549194 of _0x5ef2ec[_0x23e7b6(0x20b)]){_0x549194[_0x23e7b6(0x1d6)]===_0x23e7b6(0x232)&&console[_0x23e7b6(0x193)](a4_0x2cca95['red'](_0x23e7b6(0x18d)+_0x549194[_0x23e7b6(0x218)]+_0x23e7b6(0x236)+_0x549194['error']));}return 0x1;}console['log'](a4_0x2cca95['green']('\x0a✔\x20Pushed\x20'+(_0x4292de+_0x3c3f73)+'\x20resources\x20to\x20\x27'+_0x5ef2ec[_0x23e7b6(0x1b5)]+'\x27'));const _0x33bee2=getLLMProjectUrl(_0x2555a9,_0x5ef2ec['projectId']);return console[_0x23e7b6(0x193)](_0x23e7b6(0x1e1)+a4_0x2cca95[_0x23e7b6(0x19b)](_0x33bee2)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x3db408=a5_0x5ca1;(function(_0x4ab298,_0x5d1d2b){const _0x5ea390=a5_0x5ca1,_0x1aa91f=_0x4ab298();while(!![]){try{const _0x5b5b70=-parseInt(_0x5ea390(0x110))/0x1*(parseInt(_0x5ea390(0x140))/0x2)+-parseInt(_0x5ea390(0x122))/0x3*(-parseInt(_0x5ea390(0x147))/0x4)+parseInt(_0x5ea390(0x11d))/0x5*(parseInt(_0x5ea390(0x18b))/0x6)+-parseInt(_0x5ea390(0x148))/0x7+parseInt(_0x5ea390(0x105))/0x8+parseInt(_0x5ea390(0x138))/0x9*(-parseInt(_0x5ea390(0x150))/0xa)+-parseInt(_0x5ea390(0x12c))/0xb*(-parseInt(_0x5ea390(0x142))/0xc);if(_0x5b5b70===_0x5d1d2b)break;else _0x1aa91f['push'](_0x1aa91f['shift']());}catch(_0x673a06){_0x1aa91f['push'](_0x1aa91f['shift']());}}}(a5_0x3319,0xef71e));import*as a5_0x1173a6 from'node:fs';function a5_0x3319(){const _0x3a0203=['message','Errors:\x20\x20\x20','size','Output\x20written\x20to:\x20','tests','join','Round\x20','Re-evaluation\x20Summary','now','213666ByxhXF','executeReeval','testName','Round\x201/','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Cached\x20run\x20from:\x20',':\x20Sending\x20user\x20input...','\x20\x20Round\x20','description','\x20\x20Project:\x20','includes','Project\x20path:\x20','json','output','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','timestamp','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','404','Run\x20\x27tdx\x20agent\x20pull\x20','8722872MvfsIT','Available\x20tests:\x20','source','/<agent-name>','projectDir','stop','utf-8','Either\x20switch\x20to\x20the\x20\x22','...','site','llm','1aAxMnd','no_tests','red','\x20\x20-\x20','tsv','Duration:\x20','No\x20tests\x20found\x20matching:\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)','filter','Test\x20','Usage:','jsonl','some','80WFPprV','rounds','\x22,\x20but\x20current\x20site\x20is\x20\x22','conversations','Using\x20agent:\x20','147fqvRpc','dim','round','Failed:\x20\x20\x20','Total:\x20\x20\x20\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','existsSync','FAIL','toLowerCase','8661015IVBTTE','\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','...\x20','status','Available\x20tags:\x20','length','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','conversation_url','map','✗\x20ERROR:\x20Project\x20not\x20found:\x20','start','Failed\x20Tests:','10297341bLoJtk','basename','Conversation\x20URL:\x20','Re-evaluating\x20cached\x20test\x20run...','green','toISOString','Agent:\x20','No\x20tests\x20have\x20tags\x20defined.','574612PBVVWY','writeFileSync','12KbPzvX','Test\x20Summary','\x20-\x20','agent:test','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','113392RJSsiW','9970317BcfKLN','add','agent','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','\x20\x20Site:\x20','push','✗\x20ERROR:\x20','No\x20tests\x20found\x20with\x20tags:\x20','10oQdOHx','Executing\x20new\x20tests...','no_local_folder','execute','✗\x20FAIL:\x20','tags','✓\x20PASS:\x20','llmProject','\x22:\x20','testYmlPath','resolveAgentId','New\x20tests\x20to\x20execute:\x20','white','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','resolve','\x20(cached)','reason','verbose','log','name','agentName','substring','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','dryRun','Error\x20writing\x20output\x20file:\x20','forEach','\x20\x20Evaluating...\x20','repeat','\x20\x20Conversation:\x20','PASS','split','trim','yellow','has','Running\x20test:\x20','Passed:\x20\x20\x20','projectName','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Running:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Error:\x20No\x20previous\x20test\x20run\x20found.','multiple_agents','cyan','Re-evaluating\x20','\x20(new)','table','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','ERROR','text','no_context'];a5_0x3319=function(){return _0x3a0203;};return a5_0x3319();}import*as a5_0x1f8473 from'node:path';import a5_0x53e721 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_0x5ca1(_0x594e78,_0x2d5b65){_0x594e78=_0x594e78-0xf3;const _0x331969=a5_0x3319();let _0x5ca1bc=_0x331969[_0x594e78];return _0x5ca1bc;}export class AgentTestCommand extends BaseCommand{[a5_0x3db408(0x163)]=a5_0x3db408(0x145);[a5_0x3db408(0xfa)]=a5_0x3db408(0x127);async[a5_0x3db408(0x153)](_0x18af7f){const _0x381120=a5_0x3db408,{options:_0x1291c5,args:_0x39d847,tdx:_0x1d084a}=_0x18af7f,_0x5d4e9c=_0x39d847[0x0]||'.',_0x494c2b=_0x1291c5[_0x381120(0x167)],_0x11bc47=_0x1291c5,_0x1bf8cd=_0x11bc47['eval']===![],_0x27a320=_0x11bc47['reeval'],_0x1f9b41=_0x11bc47[_0x381120(0x163)],_0x3a8e99=_0x11bc47[_0x381120(0x155)],_0x588b1f=_0x1291c5['site'],_0x3810f6=_0x11bc47[_0x381120(0xff)];if(_0x27a320&&_0x1bf8cd)return console['log'](a5_0x53e721[_0x381120(0x112)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x5e5eb4=_0x381120(0x17d);if(_0x11bc47['json'])_0x5e5eb4=_0x381120(0xfe);else{if(_0x11bc47[_0x381120(0x11b)])_0x5e5eb4=_0x381120(0x11b);else{if(_0x11bc47[_0x381120(0x114)])_0x5e5eb4=_0x381120(0x114);else{if(_0x11bc47['table'])_0x5e5eb4=_0x381120(0x17d);}}}const _0x593cbe=_0x11bc47[_0x381120(0x157)];let _0x2453cc=_0x5d4e9c;const _0x41ac02=a5_0x1173a6[_0x381120(0x129)](_0x5d4e9c),_0x4833af=_0x5d4e9c==='.';if(!_0x41ac02||_0x4833af){const _0x51b29b=resolveProjectFromContext(_0x5d4e9c,_0x593cbe,{'requireFile':'test.yml'});if(_0x51b29b['found'])_0x2453cc=_0x51b29b[_0x381120(0x109)],_0x51b29b[_0x381120(0x107)]==='context'&&console['log'](a5_0x53e721[_0x381120(0x123)](_0x381120(0x121)+_0x2453cc));else switch(_0x51b29b['reason']){case _0x381120(0x181):console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x170)](_0x51b29b[_0x381120(0x182)])),console[_0x381120(0x162)](),console[_0x381120(0x162)](_0x381120(0x11a)),console[_0x381120(0x162)](_0x381120(0x12d)),console[_0x381120(0x162)](_0x381120(0x117)),console['log'](),console[_0x381120(0x162)](_0x381120(0x128));return 0x1;case _0x381120(0x152):console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x170)](_0x51b29b[_0x381120(0x182)])),console[_0x381120(0x162)](),console['log'](_0x381120(0x104)+_0x51b29b['llmProject']+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x381120(0x179):{const _0x4ae4a0=a5_0x1f8473[_0x381120(0x139)](_0x51b29b[_0x381120(0x109)]);console['log'](a5_0x53e721[_0x381120(0x170)](_0x381120(0x175)+_0x51b29b['llmProject']+'\x22:'));for(const _0x4e1d35 of _0x51b29b['agentDirs']){console[_0x381120(0x162)](_0x381120(0x113)+_0x4e1d35);}return console[_0x381120(0x162)](),console[_0x381120(0x162)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x4ae4a0+_0x381120(0x108)),0x1;}case _0x381120(0x111):console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x170)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x51b29b[_0x381120(0x157)]+'\x22.')),console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x123)](_0x381120(0xfd)+_0x51b29b['projectDir'])),console['log'](),console[_0x381120(0x162)](_0x381120(0x15d));return 0x1;}}const {definition:_0x3ea7a2,agentInfo:_0x30905e}=parseTestFile(_0x2453cc);let _0x4e879d=_0x3ea7a2[_0x381120(0x186)];if(_0x1f9b41){const _0x167b07=_0x1f9b41[_0x381120(0x16e)](',')[_0x381120(0x134)](_0x2963df=>_0x2963df[_0x381120(0x16f)]());_0x4e879d=_0x3ea7a2[_0x381120(0x186)][_0x381120(0x118)](_0x1c558a=>_0x167b07[_0x381120(0xfc)](_0x1c558a[_0x381120(0x163)]));if(_0x4e879d['length']===0x0)return console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x170)](_0x381120(0x116)+_0x1f9b41)),console[_0x381120(0x162)](a5_0x53e721['dim'](_0x381120(0x106)+_0x3ea7a2[_0x381120(0x186)][_0x381120(0x134)](_0x53af5a=>_0x53af5a[_0x381120(0x163)])[_0x381120(0x187)](',\x20'))),0x1;}if(_0x3a8e99){const _0x43c6fa=_0x3a8e99['split'](',')[_0x381120(0x134)](_0x49f2df=>_0x49f2df[_0x381120(0x16f)]()[_0x381120(0x12b)]());_0x4e879d=_0x4e879d[_0x381120(0x118)](_0x134659=>_0x134659[_0x381120(0x155)]?.[_0x381120(0x11c)](_0x457ff5=>_0x43c6fa[_0x381120(0xfc)](_0x457ff5[_0x381120(0x12b)]())));if(_0x4e879d[_0x381120(0x131)]===0x0){console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x170)](_0x381120(0x14f)+_0x3a8e99));const _0x578191=new Set();return _0x3ea7a2[_0x381120(0x186)][_0x381120(0x169)](_0x2deedb=>_0x2deedb[_0x381120(0x155)]?.['forEach'](_0x1bd9ae=>_0x578191[_0x381120(0x149)](_0x1bd9ae))),_0x578191[_0x381120(0x184)]>0x0?console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x123)](_0x381120(0x130)+[..._0x578191][_0x381120(0x187)](',\x20'))):console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x123)](_0x381120(0x13f))),0x1;}}if(_0x27a320)return this['executeReeval'](_0x18af7f,{'definition':{'tests':_0x4e879d},'agentInfo':_0x30905e,'outputFormat':_0x5e5eb4,'outputFile':_0x3810f6,'testNames':_0x1f9b41});if(_0x494c2b){console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x17a)]('Test\x20Configuration:')),console[_0x381120(0x162)](_0x381120(0x14c)+a5_0x53e721[_0x381120(0x15c)](_0x588b1f)),console[_0x381120(0x162)](_0x381120(0xfb)+a5_0x53e721[_0x381120(0x15c)](_0x30905e[_0x381120(0x174)])),console[_0x381120(0x162)]('\x20\x20Agent:\x20'+a5_0x53e721[_0x381120(0x15c)](_0x30905e[_0x381120(0x164)])),console['log'](),console[_0x381120(0x162)]('Tests\x20found:\x20'+a5_0x53e721[_0x381120(0x15c)](_0x4e879d[_0x381120(0x131)]));for(let _0x421c71=0x0;_0x421c71<_0x4e879d['length'];_0x421c71++){const _0x3ebc46=_0x4e879d[_0x421c71],_0x54fc19=_0x3ebc46[_0x381120(0x11e)][_0x381120(0x131)]===0x1?_0x381120(0x124):'rounds',_0x4b2b1d=_0x3ebc46[_0x381120(0x155)]?.[_0x381120(0x131)]?'\x20['+_0x3ebc46[_0x381120(0x155)]['join'](',\x20')+']':'';console[_0x381120(0x162)]('\x20\x20'+(_0x421c71+0x1)+'.\x20'+a5_0x53e721[_0x381120(0x15c)](_0x3ebc46[_0x381120(0x163)])+'\x20('+_0x3ebc46[_0x381120(0x11e)][_0x381120(0x131)]+'\x20'+_0x54fc19+')'+a5_0x53e721[_0x381120(0x123)](_0x4b2b1d));}return 0x0;}let _0x88506d,_0x248fcb;try{_0x88506d=await _0x1d084a[_0x381120(0x10f)]['resolveProjectId'](_0x30905e['projectName']);}catch(_0x2c7d40){const _0x22cc50=_0x2c7d40 instanceof Error?_0x2c7d40[_0x381120(0x182)]:String(_0x2c7d40);return _0x22cc50[_0x381120(0xfc)]('404')||_0x22cc50['toLowerCase']()[_0x381120(0xfc)]('not\x20found')?console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x112)](_0x381120(0x135)+_0x30905e[_0x381120(0x174)])):console['log'](a5_0x53e721[_0x381120(0x112)](_0x381120(0x146)+_0x30905e[_0x381120(0x174)]+_0x381120(0x158)+_0x22cc50)),0x1;}try{_0x248fcb=await _0x1d084a[_0x381120(0x10f)][_0x381120(0x15a)](_0x30905e['agentName'],_0x88506d);}catch(_0x5b2bea){const _0x2fbe21=_0x5b2bea instanceof Error?_0x5b2bea[_0x381120(0x182)]:String(_0x5b2bea);return _0x2fbe21[_0x381120(0xfc)](_0x381120(0x103))||_0x2fbe21[_0x381120(0x12b)]()[_0x381120(0xfc)]('not\x20found')?console['log'](a5_0x53e721[_0x381120(0x112)](_0x381120(0xf6)+_0x30905e['agentName'])):console['log'](a5_0x53e721[_0x381120(0x112)](_0x381120(0x100)+_0x30905e[_0x381120(0x164)]+_0x381120(0x158)+_0x2fbe21)),0x1;}let _0x2b1134;if(!_0x1bf8cd)try{_0x2b1134=await setupEvaluatorAgent(_0x1d084a[_0x381120(0x10f)],_0x1291c5['verbose']);}catch(_0x488865){const _0x12a206=_0x488865 instanceof Error?_0x488865[_0x381120(0x182)]:String(_0x488865);return console['log'](a5_0x53e721[_0x381120(0x112)](_0x381120(0x166)+_0x12a206)),0x1;}console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x17a)]('Running\x20agent\x20tests...')),console[_0x381120(0x162)]('Site:\x20'+a5_0x53e721['white'](_0x588b1f)),console[_0x381120(0x162)]('Agent:\x20'+a5_0x53e721[_0x381120(0x15c)](_0x30905e['projectName']+'/'+_0x30905e[_0x381120(0x164)])),console[_0x381120(0x162)]();const _0x4aeac2=[],_0x5dd2a5=[],_0x4a2c67=Date[_0x381120(0x18a)]();for(let _0x5befbe=0x0;_0x5befbe<_0x4e879d[_0x381120(0x131)];_0x5befbe++){const _0x478510=_0x4e879d[_0x5befbe];_0x4e879d[_0x381120(0x131)]>0x1?console[_0x381120(0x162)](_0x381120(0x119)+(_0x5befbe+0x1)+'/'+_0x4e879d[_0x381120(0x131)]+':\x20'+a5_0x53e721[_0x381120(0x15c)](_0x478510['name'])):console[_0x381120(0x162)](_0x381120(0x172)+a5_0x53e721[_0x381120(0x15c)](_0x478510[_0x381120(0x163)]));const _0x444d00=createCommandSpinner(_0x381120(0xf5)+_0x478510[_0x381120(0x11e)]['length']+_0x381120(0xf8));_0x444d00[_0x381120(0x136)]();try{const {result:_0xebb7b5,conversation:_0x33496d}=await runTest(_0x1d084a['llm'],_0x478510,{'agentId':_0x248fcb,'projectId':_0x88506d,'site':_0x588b1f,'noEval':_0x1bf8cd,'evaluatorId':_0x2b1134,'onRoundStart':(_0x4826f6,_0x18c85c)=>{const _0x4a09eb=_0x381120;_0x444d00[_0x4a09eb(0x180)]=_0x4a09eb(0x188)+(_0x4826f6+0x1)+'/'+_0x18c85c+_0x4a09eb(0xf8);},'onRoundComplete':(_0x90dee8,_0x2dfb9,_0x1d3911)=>{const _0x36c8fc=_0x381120,_0x1c15f5=formatElapsed(_0x2dfb9);_0x1d3911?console[_0x36c8fc(0x162)](_0x36c8fc(0xf9)+(_0x90dee8+0x1)+'/'+_0x478510[_0x36c8fc(0x11e)][_0x36c8fc(0x131)]+_0x36c8fc(0x12e)+a5_0x53e721[_0x36c8fc(0x13c)]('✓')+'\x20('+_0x1c15f5+')'):console[_0x36c8fc(0x162)](_0x36c8fc(0xf9)+(_0x90dee8+0x1)+'/'+_0x478510[_0x36c8fc(0x11e)][_0x36c8fc(0x131)]+_0x36c8fc(0x12e)+a5_0x53e721[_0x36c8fc(0x112)]('✗'));},'onEvaluationStart':()=>{const _0x247a9f=_0x381120;_0x444d00[_0x247a9f(0x180)]='Evaluating\x20response...';},'onEvaluationComplete':_0x36958e=>{const _0x285847=_0x381120,_0x4bc48d=formatElapsed(_0x36958e);console[_0x285847(0x162)](_0x285847(0x16a)+a5_0x53e721[_0x285847(0x13c)]('✓')+'\x20('+_0x4bc48d+')');}});_0x444d00[_0x381120(0x10a)](),_0x4aeac2[_0x381120(0x14d)](_0xebb7b5),_0x5dd2a5[_0x381120(0x14d)](_0x33496d);if(_0xebb7b5[_0x381120(0x12f)]===_0x381120(0x16d))console[_0x381120(0x162)](a5_0x53e721['green'](_0x381120(0x156)+_0xebb7b5[_0x381120(0x160)]));else _0xebb7b5['status']==='FAIL'?console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x112)]('✗\x20FAIL:\x20'+_0xebb7b5[_0x381120(0x160)])):console[_0x381120(0x162)](a5_0x53e721['red'](_0x381120(0x14e)+_0xebb7b5[_0x381120(0x160)]));_0xebb7b5[_0x381120(0x133)]&&console[_0x381120(0x162)](a5_0x53e721['dim'](_0x381120(0x13a)+_0xebb7b5[_0x381120(0x133)])),console[_0x381120(0x162)]();}catch(_0x1f40da){_0x444d00[_0x381120(0x10a)]();const _0x1f569a=_0x1f40da instanceof Error?_0x1f40da[_0x381120(0x182)]:String(_0x1f40da);console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x112)](_0x381120(0x14e)+_0x1f569a)),console['log'](),_0x4aeac2[_0x381120(0x14d)]({'name':_0x478510[_0x381120(0x163)],'status':_0x381120(0x17f),'reason':_0x1f569a,'timestamp':new Date()[_0x381120(0x13d)](),'duration_ms':0x0});}}const _0x17833d=Date[_0x381120(0x18a)]()-_0x4a2c67,_0x519dfa=_0x4aeac2[_0x381120(0x118)](_0x168567=>_0x168567[_0x381120(0x12f)]===_0x381120(0x16d))[_0x381120(0x131)],_0x3b10d8=_0x4aeac2[_0x381120(0x118)](_0x5b8410=>_0x5b8410['status']===_0x381120(0x12a))[_0x381120(0x131)],_0x30b991=_0x4aeac2['filter'](_0xe94ce9=>_0xe94ce9[_0x381120(0x12f)]===_0x381120(0x17f))[_0x381120(0x131)];console[_0x381120(0x162)]('━'[_0x381120(0x16b)](0x3c)),console[_0x381120(0x162)](_0x381120(0x143)),console[_0x381120(0x162)]('━'[_0x381120(0x16b)](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x4aeac2[_0x381120(0x131)]),console['log'](_0x381120(0x173)+a5_0x53e721[_0x381120(0x13c)](_0x519dfa)),console[_0x381120(0x162)](_0x381120(0x125)+a5_0x53e721['red'](_0x3b10d8));_0x30b991>0x0&&console[_0x381120(0x162)]('Errors:\x20\x20\x20'+a5_0x53e721[_0x381120(0x112)](_0x30b991));console[_0x381120(0x162)]('Duration:\x20'+formatElapsed(_0x17833d)),console[_0x381120(0x162)]('━'[_0x381120(0x16b)](0x3c));const _0x209e8a=_0x4aeac2[_0x381120(0x118)](_0x1ce228=>_0x1ce228[_0x381120(0x12f)]!=='PASS');if(_0x209e8a['length']>0x0){console[_0x381120(0x162)](),console['log'](_0x381120(0x137));for(const _0x1321cd of _0x209e8a){const _0x48ea88=a5_0x53e721[_0x381120(0x112)]('✗'),_0x5c40d8=_0x1321cd[_0x381120(0x160)][_0x381120(0x131)]>0x32?_0x1321cd[_0x381120(0x160)][_0x381120(0x165)](0x0,0x32)+_0x381120(0x10d):_0x1321cd['reason'];console[_0x381120(0x162)]('\x20\x20'+_0x48ea88+'\x20'+_0x1321cd[_0x381120(0x163)]+':\x20'+_0x5c40d8);}}const _0x3cf99c={'summary':{'total':_0x4aeac2[_0x381120(0x131)],'passed':_0x519dfa,'failed':_0x3b10d8,'errors':_0x30b991>0x0?_0x30b991:undefined,'duration_ms':_0x17833d},'tests':_0x4aeac2,'agent':{'project':_0x30905e[_0x381120(0x174)],'name':_0x30905e[_0x381120(0x164)],'site':_0x588b1f},'timestamp':new Date(_0x4a2c67)[_0x381120(0x13d)]()};try{const _0x1d282b=buildCachedTestRun(_0x5dd2a5,{'site':_0x588b1f,'projectId':_0x88506d,'projectName':_0x30905e[_0x381120(0x174)],'agentId':_0x248fcb,'agentName':_0x30905e['agentName'],'testYmlPath':a5_0x1f8473[_0x381120(0x15e)](_0x30905e[_0x381120(0x159)])});saveLastTestRun(_0x1d282b);}catch{}if(_0x5e5eb4!==_0x381120(0x17d)||_0x3810f6){const _0x31e0cf=formatResults(_0x3cf99c,_0x5e5eb4);if(_0x3810f6)try{a5_0x1173a6[_0x381120(0x141)](_0x3810f6,_0x31e0cf,_0x381120(0x10b)),console[_0x381120(0x162)](),console[_0x381120(0x162)](a5_0x53e721['dim'](_0x381120(0x185)+_0x3810f6));}catch(_0x296c17){return console[_0x381120(0x162)](),console[_0x381120(0x162)](a5_0x53e721['red'](_0x381120(0x168)+_0x296c17)),0x1;}else console[_0x381120(0x162)](),console[_0x381120(0x162)](_0x31e0cf);}return _0x209e8a[_0x381120(0x131)]>0x0?0x1:0x0;}async[a5_0x3db408(0xf3)](_0x1625ce,_0x103758){const _0x331d45=a5_0x3db408,{options:_0x2adc0c,tdx:_0x297398}=_0x1625ce,{definition:_0x4445f0,agentInfo:_0xeff7c0,outputFormat:_0x45a99b,outputFile:_0x3a6be6}=_0x103758,_0x5a2b39=_0x2adc0c[_0x331d45(0x10e)],_0x4828a0=loadLastTestRun();if(!_0x4828a0)return console[_0x331d45(0x162)](a5_0x53e721[_0x331d45(0x112)](_0x331d45(0x178))),console[_0x331d45(0x162)](a5_0x53e721['dim'](_0x331d45(0x14b))),0x1;if(_0x4828a0[_0x331d45(0x14a)][_0x331d45(0x164)]!==_0xeff7c0['agentName'])return console[_0x331d45(0x162)](a5_0x53e721[_0x331d45(0x112)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x4828a0['agent'][_0x331d45(0x164)]+_0x331d45(0x17e)+_0xeff7c0[_0x331d45(0x164)]+'\x22.')),console[_0x331d45(0x162)](a5_0x53e721['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x181a1c=new Set(_0x4828a0[_0x331d45(0x120)][_0x331d45(0x134)](_0x3bd8f6=>_0x3bd8f6[_0x331d45(0xf4)])),_0x49703b=_0x4445f0[_0x331d45(0x186)][_0x331d45(0x118)](_0x41f983=>!_0x181a1c[_0x331d45(0x171)](_0x41f983['name']));if(_0x49703b[_0x331d45(0x131)]>0x0&&_0x4828a0[_0x331d45(0x10e)]!==_0x5a2b39)return console[_0x331d45(0x162)](a5_0x53e721['red'](_0x331d45(0x102))),console['log'](a5_0x53e721['dim']('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x4828a0[_0x331d45(0x10e)]+_0x331d45(0x11f)+_0x5a2b39+'\x22.')),console['log'](a5_0x53e721[_0x331d45(0x123)](_0x331d45(0x10c)+_0x4828a0['site']+_0x331d45(0x177))),0x1;const _0x5e14cd=_0x4445f0[_0x331d45(0x186)][_0x331d45(0x118)](_0x2bbd8e=>_0x181a1c[_0x331d45(0x171)](_0x2bbd8e[_0x331d45(0x163)])),_0x58f4ea=_0x49703b;let _0x26a7c9;try{_0x26a7c9=await setupEvaluatorAgent(_0x297398[_0x331d45(0x10f)],_0x2adc0c[_0x331d45(0x161)]);}catch(_0x145901){const _0x49d0aa=_0x145901 instanceof Error?_0x145901[_0x331d45(0x182)]:String(_0x145901);return console['log'](a5_0x53e721[_0x331d45(0x112)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x49d0aa)),0x1;}console[_0x331d45(0x162)](a5_0x53e721[_0x331d45(0x17a)](_0x331d45(0x13b))),console[_0x331d45(0x162)](_0x331d45(0xf7)+a5_0x53e721[_0x331d45(0x15c)](_0x4828a0[_0x331d45(0x101)])),console[_0x331d45(0x162)](_0x331d45(0x13e)+a5_0x53e721[_0x331d45(0x15c)](_0x4828a0['agent'][_0x331d45(0x174)]+'/'+_0x4828a0['agent'][_0x331d45(0x164)]));_0x58f4ea[_0x331d45(0x131)]>0x0&&console['log'](_0x331d45(0x15b)+a5_0x53e721[_0x331d45(0x170)](_0x58f4ea['length']));console[_0x331d45(0x162)]();const _0x2549d7=[],_0x4efea6=Date['now'](),_0x39794a=createCommandSpinner('Re-evaluating...');if(_0x5e14cd['length']>0x0)try{const _0x419031=await reevaluateFromCache(_0x297398[_0x331d45(0x10f)],_0x4828a0,{'tests':_0x5e14cd},{'evaluatorId':_0x26a7c9,'onTestStart':(_0x26cfe9,_0x3e4721,_0x2dbf5a)=>{const _0x2b7e68=_0x331d45;_0x39794a['text']=_0x2b7e68(0x17b)+(_0x3e4721+0x1)+'/'+_0x2dbf5a+':\x20'+_0x26cfe9+_0x2b7e68(0x10d);if(!_0x39794a['isSpinning'])_0x39794a['start']();},'onTestComplete':(_0x441ef2,_0x54c9c5)=>{const _0x284391=_0x331d45;_0x39794a[_0x284391(0x10a)]();if(_0x54c9c5['status']===_0x284391(0x16d))console[_0x284391(0x162)](a5_0x53e721['green'](_0x284391(0x156)+_0x441ef2)+a5_0x53e721[_0x284391(0x123)](_0x284391(0x15f)));else _0x54c9c5[_0x284391(0x12f)]===_0x284391(0x12a)?console[_0x284391(0x162)](a5_0x53e721['red'](_0x284391(0x154)+_0x441ef2+_0x284391(0x144)+_0x54c9c5[_0x284391(0x160)])+a5_0x53e721[_0x284391(0x123)](_0x284391(0x15f))):console[_0x284391(0x162)](a5_0x53e721['red'](_0x284391(0x14e)+_0x441ef2+_0x284391(0x144)+_0x54c9c5[_0x284391(0x160)]));_0x54c9c5[_0x284391(0x133)]&&console[_0x284391(0x162)](a5_0x53e721[_0x284391(0x123)](_0x284391(0x16c)+_0x54c9c5[_0x284391(0x133)])),_0x2549d7[_0x284391(0x14d)](_0x54c9c5);},'onTestSkipped':(_0x151385,_0x509fd3)=>{const _0x67bc5d=_0x331d45;_0x39794a['stop'](),console[_0x67bc5d(0x162)](a5_0x53e721[_0x67bc5d(0x170)]('⚠\x20SKIPPED:\x20'+_0x151385+_0x67bc5d(0x144)+_0x509fd3));}});for(const _0x5c661d of _0x419031){!_0x2549d7['find'](_0x2d88f7=>_0x2d88f7[_0x331d45(0x163)]===_0x5c661d[_0x331d45(0x163)])&&_0x2549d7[_0x331d45(0x14d)](_0x5c661d);}}catch(_0x21624d){_0x39794a[_0x331d45(0x10a)]();const _0x17d1c6=_0x21624d instanceof Error?_0x21624d[_0x331d45(0x182)]:String(_0x21624d);return console[_0x331d45(0x162)](a5_0x53e721['red'](_0x331d45(0x132)+_0x17d1c6)),0x1;}_0x39794a['stop']();if(_0x58f4ea['length']>0x0){console[_0x331d45(0x162)](),console[_0x331d45(0x162)](a5_0x53e721[_0x331d45(0x17a)](_0x331d45(0x151)));const {projectId:_0x17a994,agentId:_0x544b8a}=_0x4828a0['agent'];for(const _0x32f4e0 of _0x58f4ea){console['log'](_0x331d45(0x176)+a5_0x53e721[_0x331d45(0x15c)](_0x32f4e0['name']));const _0x441f6c=createCommandSpinner(_0x331d45(0xf5)+_0x32f4e0['rounds']['length']+_0x331d45(0xf8));_0x441f6c[_0x331d45(0x136)]();try{const {result:_0x4c874f}=await runTest(_0x297398[_0x331d45(0x10f)],_0x32f4e0,{'agentId':_0x544b8a,'projectId':_0x17a994,'site':_0x4828a0[_0x331d45(0x10e)],'noEval':![],'evaluatorId':_0x26a7c9,'onRoundStart':(_0x1cd167,_0x52b172)=>{const _0x202450=_0x331d45;_0x441f6c[_0x202450(0x180)]='Round\x20'+(_0x1cd167+0x1)+'/'+_0x52b172+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x5b2a89,_0x34e4ef,_0x488e62)=>{const _0x3e5f95=_0x331d45,_0x30daad=formatElapsed(_0x34e4ef);_0x488e62?console[_0x3e5f95(0x162)](_0x3e5f95(0xf9)+(_0x5b2a89+0x1)+'/'+_0x32f4e0[_0x3e5f95(0x11e)][_0x3e5f95(0x131)]+_0x3e5f95(0x12e)+a5_0x53e721[_0x3e5f95(0x13c)]('✓')+'\x20('+_0x30daad+')'):console[_0x3e5f95(0x162)](_0x3e5f95(0xf9)+(_0x5b2a89+0x1)+'/'+_0x32f4e0[_0x3e5f95(0x11e)][_0x3e5f95(0x131)]+'...\x20'+a5_0x53e721[_0x3e5f95(0x112)]('✗'));},'onEvaluationStart':()=>{const _0x2d5ea8=_0x331d45;_0x441f6c[_0x2d5ea8(0x180)]='Evaluating\x20response...';},'onEvaluationComplete':_0x2f7b68=>{const _0x30e26a=_0x331d45,_0xaebb7e=formatElapsed(_0x2f7b68);console[_0x30e26a(0x162)]('\x20\x20Evaluating...\x20'+a5_0x53e721['green']('✓')+'\x20('+_0xaebb7e+')');}});_0x441f6c[_0x331d45(0x10a)](),_0x2549d7[_0x331d45(0x14d)](_0x4c874f);if(_0x4c874f['status']==='PASS')console[_0x331d45(0x162)](a5_0x53e721[_0x331d45(0x13c)]('✓\x20PASS:\x20'+_0x4c874f[_0x331d45(0x160)])+a5_0x53e721[_0x331d45(0x123)](_0x331d45(0x17c)));else _0x4c874f[_0x331d45(0x12f)]===_0x331d45(0x12a)?console[_0x331d45(0x162)](a5_0x53e721[_0x331d45(0x112)](_0x331d45(0x154)+_0x4c874f['reason'])+a5_0x53e721['dim'](_0x331d45(0x17c))):console['log'](a5_0x53e721[_0x331d45(0x112)](_0x331d45(0x14e)+_0x4c874f[_0x331d45(0x160)]));_0x4c874f[_0x331d45(0x133)]&&console[_0x331d45(0x162)](a5_0x53e721[_0x331d45(0x123)]('\x20\x20Conversation:\x20'+_0x4c874f['conversation_url']));}catch(_0x572cf2){_0x441f6c['stop']();const _0x1612f8=_0x572cf2 instanceof Error?_0x572cf2[_0x331d45(0x182)]:String(_0x572cf2);console[_0x331d45(0x162)](a5_0x53e721['red'](_0x331d45(0x14e)+_0x1612f8)),_0x2549d7[_0x331d45(0x14d)]({'name':_0x32f4e0['name'],'status':_0x331d45(0x17f),'reason':_0x1612f8,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console['log']();const _0x5d967c=Date[_0x331d45(0x18a)]()-_0x4efea6,_0x1ca673=_0x2549d7['filter'](_0x49a057=>_0x49a057[_0x331d45(0x12f)]===_0x331d45(0x16d))[_0x331d45(0x131)],_0x2d57f9=_0x2549d7[_0x331d45(0x118)](_0x3b132b=>_0x3b132b[_0x331d45(0x12f)]===_0x331d45(0x12a))['length'],_0x2c69fb=_0x2549d7[_0x331d45(0x118)](_0x5c0255=>_0x5c0255[_0x331d45(0x12f)]==='ERROR')[_0x331d45(0x131)];console[_0x331d45(0x162)]('━'[_0x331d45(0x16b)](0x3c)),console[_0x331d45(0x162)](_0x331d45(0x189)),console[_0x331d45(0x162)]('━'[_0x331d45(0x16b)](0x3c)),console[_0x331d45(0x162)](_0x331d45(0x126)+_0x2549d7['length']),console[_0x331d45(0x162)]('Passed:\x20\x20\x20'+a5_0x53e721[_0x331d45(0x13c)](_0x1ca673)),console[_0x331d45(0x162)](_0x331d45(0x125)+a5_0x53e721[_0x331d45(0x112)](_0x2d57f9));_0x2c69fb>0x0&&console[_0x331d45(0x162)](_0x331d45(0x183)+a5_0x53e721[_0x331d45(0x112)](_0x2c69fb));console[_0x331d45(0x162)](_0x331d45(0x115)+formatElapsed(_0x5d967c)),console[_0x331d45(0x162)]('━'[_0x331d45(0x16b)](0x3c));const _0x57e27d={'summary':{'total':_0x2549d7['length'],'passed':_0x1ca673,'failed':_0x2d57f9,'errors':_0x2c69fb>0x0?_0x2c69fb:undefined,'duration_ms':_0x5d967c},'tests':_0x2549d7,'agent':{'project':_0xeff7c0['projectName'],'name':_0xeff7c0[_0x331d45(0x164)],'site':_0x5a2b39},'timestamp':new Date(_0x4efea6)[_0x331d45(0x13d)]()};if(_0x45a99b!=='table'||_0x3a6be6){const _0xe58604=formatResults(_0x57e27d,_0x45a99b);if(_0x3a6be6)try{a5_0x1173a6[_0x331d45(0x141)](_0x3a6be6,_0xe58604,'utf-8'),console[_0x331d45(0x162)](),console[_0x331d45(0x162)](a5_0x53e721[_0x331d45(0x123)](_0x331d45(0x185)+_0x3a6be6));}catch(_0x207580){return console[_0x331d45(0x162)](),console['log'](a5_0x53e721['red'](_0x331d45(0x168)+_0x207580)),0x1;}else console[_0x331d45(0x162)](),console[_0x331d45(0x162)](_0xe58604);}const _0x205dd4=_0x2549d7['filter'](_0x2e8b7c=>_0x2e8b7c[_0x331d45(0x12f)]!=='PASS');return _0x205dd4[_0x331d45(0x131)]>0x0?0x1:0x0;}}
1
+ function a5_0x1a5b(_0x1d694c,_0x125670){_0x1d694c=_0x1d694c-0x1a5;const _0x366b7d=a5_0x366b();let _0x1a5bee=_0x366b7d[_0x1d694c];return _0x1a5bee;}const a5_0x2badb6=a5_0x1a5b;(function(_0x2bacca,_0x3f58b1){const _0x160870=a5_0x1a5b,_0x51c85d=_0x2bacca();while(!![]){try{const _0xd20df7=parseInt(_0x160870(0x1ed))/0x1+parseInt(_0x160870(0x202))/0x2+-parseInt(_0x160870(0x1b2))/0x3+parseInt(_0x160870(0x1ef))/0x4+-parseInt(_0x160870(0x1b5))/0x5+-parseInt(_0x160870(0x203))/0x6+parseInt(_0x160870(0x1e7))/0x7*(parseInt(_0x160870(0x22f))/0x8);if(_0xd20df7===_0x3f58b1)break;else _0x51c85d['push'](_0x51c85d['shift']());}catch(_0x5603ea){_0x51c85d['push'](_0x51c85d['shift']());}}}(a5_0x366b,0x976bd));function a5_0x366b(){const _0x493cbe=['multiple_agents','conversations','Available\x20tags:\x20','Re-evaluating\x20cached\x20test\x20run...','push','Round\x20','existsSync','red','no_local_folder','repeat','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','8144mDENjH','execute','\x20\x20-\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','tags','toISOString','join','now','rounds','conversation_url','llm','filter','name','\x20-\x20','status','\x20\x20Project:\x20','not\x20found','Total:\x20\x20\x20\x20','Usage:','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','yellow','Passed:\x20\x20\x20','Test\x20Configuration:','1818060CndMxc','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','\x27\x20to\x20create\x20the\x20folder\x20structure.','2750975UprHki','resolveAgentId','context','reason','source','writeFileSync','\x20(new)','...\x20','log','eval','jsonl','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','substring','Test\x20','no_context','Project\x20path:\x20','agentDirs','tests','\x20\x20Evaluating...\x20','projectDir','llmProject','Evaluating\x20response...','description','✗\x20ERROR:\x20','Tests\x20found:\x20','trim','Run\x20\x27tdx\x20agent\x20pull\x20','site','resolveProjectId','Agent:\x20','Running:\x20','Round\x201/','text','basename','toLowerCase','Output\x20written\x20to:\x20','start','ERROR','No\x20tests\x20found\x20with\x20tags:\x20','no_tests','\x20\x20Site:\x20','has','some','\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','No\x20tests\x20found\x20matching:\x20','✓\x20PASS:\x20','✗\x20FAIL:\x20','isSpinning','\x20\x20Agent:\x20','3178FvwpiR','No\x20tests\x20have\x20tags\x20defined.','split','Test\x20Summary',':\x20Sending\x20user\x20input...','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','852610xKQTer','json','733080qymzWa','dryRun','Duration:\x20','includes','stop','FAIL','Cached\x20run\x20from:\x20','agentName','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Error\x20writing\x20output\x20file:\x20','Available\x20tests:\x20','cyan','Re-evaluating\x20','executeReeval','Cached\x20run\x20is\x20from\x20site\x20\x22','...','\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)','2427312EBEeom','5611632eFyJKr','PASS','message','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','agent','agent:test','404','Running\x20agent\x20tests...','add','length','green','utf-8','tsv','dim','\x20\x20Round\x20','find','resolve','size','map','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','projectName','Errors:\x20\x20\x20','Failed:\x20\x20\x20','testYmlPath','table','Failed\x20Tests:','round','found','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','\x20(cached)','verbose','white'];a5_0x366b=function(){return _0x493cbe;};return a5_0x366b();}import*as a5_0x306e8a from'node:fs';import*as a5_0x4b04ce from'node:path';import a5_0x76862c from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x2badb6(0x1a7)]=a5_0x2badb6(0x208);[a5_0x2badb6(0x1cc)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x2badb6(0x230)](_0x4b6a19){const _0x34d658=a5_0x2badb6,{options:_0x5a33a5,args:_0x396989,tdx:_0xd91308}=_0x4b6a19,_0x2ac85b=_0x396989[0x0]||'.',_0x30b81b=_0x5a33a5[_0x34d658(0x1f0)],_0x2d4bad=_0x5a33a5,_0x40f532=_0x2d4bad[_0x34d658(0x1be)]===![],_0x1b559c=_0x2d4bad['reeval'],_0x2b764b=_0x2d4bad['name'],_0x333477=_0x2d4bad[_0x34d658(0x233)],_0x21869a=_0x5a33a5[_0x34d658(0x1d1)],_0x4876a4=_0x2d4bad['output'];if(_0x1b559c&&_0x40f532)return console['log'](a5_0x76862c[_0x34d658(0x22b)](_0x34d658(0x1f9))),0x1;let _0x360bb8=_0x34d658(0x21c);if(_0x2d4bad['json'])_0x360bb8=_0x34d658(0x1ee);else{if(_0x2d4bad[_0x34d658(0x1bf)])_0x360bb8='jsonl';else{if(_0x2d4bad[_0x34d658(0x20f)])_0x360bb8=_0x34d658(0x20f);else{if(_0x2d4bad['table'])_0x360bb8=_0x34d658(0x21c);}}}const _0xc3296f=_0x2d4bad[_0x34d658(0x1ca)];let _0x542c9b=_0x2ac85b;const _0x6b3539=a5_0x306e8a[_0x34d658(0x22a)](_0x2ac85b),_0x3cc615=_0x2ac85b==='.';if(!_0x6b3539||_0x3cc615){const _0x4c8d08=resolveProjectFromContext(_0x2ac85b,_0xc3296f,{'requireFile':'test.yml'});if(_0x4c8d08[_0x34d658(0x21f)])_0x542c9b=_0x4c8d08[_0x34d658(0x1c9)],_0x4c8d08[_0x34d658(0x1b9)]===_0x34d658(0x1b7)&&console[_0x34d658(0x1bd)](a5_0x76862c['dim']('Using\x20agent:\x20'+_0x542c9b));else switch(_0x4c8d08[_0x34d658(0x1b8)]){case _0x34d658(0x1c4):console['log'](a5_0x76862c[_0x34d658(0x1af)](_0x4c8d08[_0x34d658(0x205)])),console['log'](),console[_0x34d658(0x1bd)](_0x34d658(0x1ad)),console['log'](_0x34d658(0x1e1)),console[_0x34d658(0x1bd)](_0x34d658(0x201)),console['log'](),console[_0x34d658(0x1bd)](_0x34d658(0x232));return 0x1;case _0x34d658(0x22c):console['log'](a5_0x76862c[_0x34d658(0x1af)](_0x4c8d08[_0x34d658(0x205)])),console[_0x34d658(0x1bd)](),console[_0x34d658(0x1bd)](_0x34d658(0x1d0)+_0x4c8d08[_0x34d658(0x1ca)]+_0x34d658(0x1b4));return 0x1;case _0x34d658(0x224):{const _0x2cebf5=a5_0x4b04ce[_0x34d658(0x1d7)](_0x4c8d08[_0x34d658(0x1c9)]);console[_0x34d658(0x1bd)](a5_0x76862c['yellow'](_0x34d658(0x217)+_0x4c8d08[_0x34d658(0x1ca)]+'\x22:'));for(const _0x514ecb of _0x4c8d08[_0x34d658(0x1c6)]){console[_0x34d658(0x1bd)](_0x34d658(0x231)+_0x514ecb);}return console['log'](),console[_0x34d658(0x1bd)](_0x34d658(0x206)+_0x2cebf5+'/<agent-name>'),0x1;}case _0x34d658(0x1dd):console[_0x34d658(0x1bd)](a5_0x76862c['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x4c8d08[_0x34d658(0x1ca)]+'\x22.')),console['log'](a5_0x76862c[_0x34d658(0x210)](_0x34d658(0x1c5)+_0x4c8d08['projectDir'])),console[_0x34d658(0x1bd)](),console['log'](_0x34d658(0x1b3));return 0x1;}}const {definition:_0x44eb60,agentInfo:_0x17efc5}=parseTestFile(_0x542c9b);let _0x186964=_0x44eb60['tests'];if(_0x2b764b){const _0x517626=_0x2b764b[_0x34d658(0x1e9)](',')[_0x34d658(0x215)](_0x41d36a=>_0x41d36a[_0x34d658(0x1cf)]());_0x186964=_0x44eb60['tests']['filter'](_0x5a50f1=>_0x517626[_0x34d658(0x1f2)](_0x5a50f1[_0x34d658(0x1a7)]));if(_0x186964[_0x34d658(0x20c)]===0x0)return console[_0x34d658(0x1bd)](a5_0x76862c[_0x34d658(0x1af)](_0x34d658(0x1e2)+_0x2b764b)),console[_0x34d658(0x1bd)](a5_0x76862c[_0x34d658(0x210)](_0x34d658(0x1fb)+_0x44eb60['tests'][_0x34d658(0x215)](_0x284edd=>_0x284edd[_0x34d658(0x1a7)])[_0x34d658(0x235)](',\x20'))),0x1;}if(_0x333477){const _0xcdd902=_0x333477[_0x34d658(0x1e9)](',')[_0x34d658(0x215)](_0x4c6204=>_0x4c6204[_0x34d658(0x1cf)]()['toLowerCase']());_0x186964=_0x186964[_0x34d658(0x1a6)](_0x27db74=>_0x27db74['tags']?.[_0x34d658(0x1e0)](_0x3bdaec=>_0xcdd902[_0x34d658(0x1f2)](_0x3bdaec[_0x34d658(0x1d8)]())));if(_0x186964[_0x34d658(0x20c)]===0x0){console['log'](a5_0x76862c['yellow'](_0x34d658(0x1dc)+_0x333477));const _0x16e38c=new Set();return _0x44eb60[_0x34d658(0x1c7)]['forEach'](_0x557184=>_0x557184[_0x34d658(0x233)]?.['forEach'](_0x1f128e=>_0x16e38c[_0x34d658(0x20b)](_0x1f128e))),_0x16e38c[_0x34d658(0x214)]>0x0?console[_0x34d658(0x1bd)](a5_0x76862c['dim'](_0x34d658(0x226)+[..._0x16e38c][_0x34d658(0x235)](',\x20'))):console[_0x34d658(0x1bd)](a5_0x76862c[_0x34d658(0x210)](_0x34d658(0x1e8))),0x1;}}if(_0x1b559c)return this[_0x34d658(0x1fe)](_0x4b6a19,{'definition':{'tests':_0x186964},'agentInfo':_0x17efc5,'outputFormat':_0x360bb8,'outputFile':_0x4876a4,'testNames':_0x2b764b});if(_0x30b81b){console['log'](a5_0x76862c[_0x34d658(0x1fc)](_0x34d658(0x1b1))),console[_0x34d658(0x1bd)](_0x34d658(0x1de)+a5_0x76862c[_0x34d658(0x223)](_0x21869a)),console[_0x34d658(0x1bd)](_0x34d658(0x1aa)+a5_0x76862c['white'](_0x17efc5[_0x34d658(0x218)])),console[_0x34d658(0x1bd)](_0x34d658(0x1e6)+a5_0x76862c[_0x34d658(0x223)](_0x17efc5[_0x34d658(0x1f6)])),console[_0x34d658(0x1bd)](),console[_0x34d658(0x1bd)](_0x34d658(0x1ce)+a5_0x76862c[_0x34d658(0x223)](_0x186964['length']));for(let _0x3dab24=0x0;_0x3dab24<_0x186964[_0x34d658(0x20c)];_0x3dab24++){const _0x99d11c=_0x186964[_0x3dab24],_0x3e6b10=_0x99d11c[_0x34d658(0x237)][_0x34d658(0x20c)]===0x1?_0x34d658(0x21e):_0x34d658(0x237),_0xf003c3=_0x99d11c[_0x34d658(0x233)]?.[_0x34d658(0x20c)]?'\x20['+_0x99d11c[_0x34d658(0x233)][_0x34d658(0x235)](',\x20')+']':'';console[_0x34d658(0x1bd)]('\x20\x20'+(_0x3dab24+0x1)+'.\x20'+a5_0x76862c[_0x34d658(0x223)](_0x99d11c[_0x34d658(0x1a7)])+'\x20('+_0x99d11c[_0x34d658(0x237)]['length']+'\x20'+_0x3e6b10+')'+a5_0x76862c[_0x34d658(0x210)](_0xf003c3));}return 0x0;}let _0x2f407d,_0x489244;try{_0x2f407d=await _0xd91308[_0x34d658(0x1a5)][_0x34d658(0x1d2)](_0x17efc5['projectName']);}catch(_0x7d146f){const _0x438a4e=_0x7d146f instanceof Error?_0x7d146f['message']:String(_0x7d146f);return _0x438a4e[_0x34d658(0x1f2)](_0x34d658(0x209))||_0x438a4e[_0x34d658(0x1d8)]()[_0x34d658(0x1f2)](_0x34d658(0x1ab))?console[_0x34d658(0x1bd)](a5_0x76862c[_0x34d658(0x22b)](_0x34d658(0x216)+_0x17efc5['projectName'])):console['log'](a5_0x76862c[_0x34d658(0x22b)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x17efc5[_0x34d658(0x218)]+'\x22:\x20'+_0x438a4e)),0x1;}try{_0x489244=await _0xd91308[_0x34d658(0x1a5)][_0x34d658(0x1b6)](_0x17efc5['agentName'],_0x2f407d);}catch(_0x1f57eb){const _0x23fdcb=_0x1f57eb instanceof Error?_0x1f57eb[_0x34d658(0x205)]:String(_0x1f57eb);return _0x23fdcb[_0x34d658(0x1f2)](_0x34d658(0x209))||_0x23fdcb[_0x34d658(0x1d8)]()['includes'](_0x34d658(0x1ab))?console[_0x34d658(0x1bd)](a5_0x76862c['red'](_0x34d658(0x1f8)+_0x17efc5[_0x34d658(0x1f6)])):console[_0x34d658(0x1bd)](a5_0x76862c[_0x34d658(0x22b)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x17efc5[_0x34d658(0x1f6)]+'\x22:\x20'+_0x23fdcb)),0x1;}let _0x32e5a8;if(!_0x40f532)try{_0x32e5a8=await setupEvaluatorAgent(_0xd91308['llm'],_0x5a33a5['verbose']);}catch(_0x3208f3){const _0x293a51=_0x3208f3 instanceof Error?_0x3208f3[_0x34d658(0x205)]:String(_0x3208f3);return console['log'](a5_0x76862c[_0x34d658(0x22b)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x293a51)),0x1;}console[_0x34d658(0x1bd)](a5_0x76862c[_0x34d658(0x1fc)](_0x34d658(0x20a))),console[_0x34d658(0x1bd)]('Site:\x20'+a5_0x76862c[_0x34d658(0x223)](_0x21869a)),console['log']('Agent:\x20'+a5_0x76862c['white'](_0x17efc5[_0x34d658(0x218)]+'/'+_0x17efc5[_0x34d658(0x1f6)])),console[_0x34d658(0x1bd)]();const _0x2e0240=[],_0x7cb4d4=[],_0x851228=Date[_0x34d658(0x236)]();for(let _0x18b6c5=0x0;_0x18b6c5<_0x186964[_0x34d658(0x20c)];_0x18b6c5++){const _0x14a2b0=_0x186964[_0x18b6c5];_0x186964[_0x34d658(0x20c)]>0x1?console[_0x34d658(0x1bd)](_0x34d658(0x1c3)+(_0x18b6c5+0x1)+'/'+_0x186964[_0x34d658(0x20c)]+':\x20'+a5_0x76862c[_0x34d658(0x223)](_0x14a2b0[_0x34d658(0x1a7)])):console['log']('Running\x20test:\x20'+a5_0x76862c[_0x34d658(0x223)](_0x14a2b0['name']));const _0x5a01b1=createCommandSpinner(_0x34d658(0x1d5)+_0x14a2b0['rounds']['length']+_0x34d658(0x1eb));_0x5a01b1[_0x34d658(0x1da)]();try{const {result:_0x5ee29b,conversation:_0x229c9d}=await runTest(_0xd91308['llm'],_0x14a2b0,{'agentId':_0x489244,'projectId':_0x2f407d,'site':_0x21869a,'noEval':_0x40f532,'evaluatorId':_0x32e5a8,'onRoundStart':(_0x223907,_0x5c1e46)=>{const _0x3d6eb8=_0x34d658;_0x5a01b1[_0x3d6eb8(0x1d6)]=_0x3d6eb8(0x229)+(_0x223907+0x1)+'/'+_0x5c1e46+_0x3d6eb8(0x1eb);},'onRoundComplete':(_0x9810c1,_0x95b99c,_0x36185d)=>{const _0x22c1de=_0x34d658,_0x1a909e=formatElapsed(_0x95b99c);_0x36185d?console[_0x22c1de(0x1bd)](_0x22c1de(0x211)+(_0x9810c1+0x1)+'/'+_0x14a2b0[_0x22c1de(0x237)][_0x22c1de(0x20c)]+_0x22c1de(0x1bc)+a5_0x76862c[_0x22c1de(0x20d)]('✓')+'\x20('+_0x1a909e+')'):console['log'](_0x22c1de(0x211)+(_0x9810c1+0x1)+'/'+_0x14a2b0[_0x22c1de(0x237)][_0x22c1de(0x20c)]+_0x22c1de(0x1bc)+a5_0x76862c['red']('✗'));},'onEvaluationStart':()=>{const _0x1713e6=_0x34d658;_0x5a01b1[_0x1713e6(0x1d6)]=_0x1713e6(0x1cb);},'onEvaluationComplete':_0x42c12b=>{const _0x7b1757=_0x34d658,_0x1fe86c=formatElapsed(_0x42c12b);console[_0x7b1757(0x1bd)](_0x7b1757(0x1c8)+a5_0x76862c[_0x7b1757(0x20d)]('✓')+'\x20('+_0x1fe86c+')');}});_0x5a01b1[_0x34d658(0x1f3)](),_0x2e0240['push'](_0x5ee29b),_0x7cb4d4['push'](_0x229c9d);if(_0x5ee29b[_0x34d658(0x1a9)]===_0x34d658(0x204))console[_0x34d658(0x1bd)](a5_0x76862c['green'](_0x34d658(0x1e3)+_0x5ee29b[_0x34d658(0x1b8)]));else _0x5ee29b[_0x34d658(0x1a9)]===_0x34d658(0x1f4)?console[_0x34d658(0x1bd)](a5_0x76862c[_0x34d658(0x22b)]('✗\x20FAIL:\x20'+_0x5ee29b['reason'])):console[_0x34d658(0x1bd)](a5_0x76862c['red'](_0x34d658(0x1cd)+_0x5ee29b[_0x34d658(0x1b8)]));_0x5ee29b[_0x34d658(0x238)]&&console[_0x34d658(0x1bd)](a5_0x76862c[_0x34d658(0x210)]('Conversation\x20URL:\x20'+_0x5ee29b[_0x34d658(0x238)])),console[_0x34d658(0x1bd)]();}catch(_0x1d111c){_0x5a01b1['stop']();const _0x472093=_0x1d111c instanceof Error?_0x1d111c[_0x34d658(0x205)]:String(_0x1d111c);console['log'](a5_0x76862c[_0x34d658(0x22b)](_0x34d658(0x1cd)+_0x472093)),console[_0x34d658(0x1bd)](),_0x2e0240['push']({'name':_0x14a2b0[_0x34d658(0x1a7)],'status':_0x34d658(0x1db),'reason':_0x472093,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x25301a=Date[_0x34d658(0x236)]()-_0x851228,_0x5308fe=_0x2e0240[_0x34d658(0x1a6)](_0x39b7d6=>_0x39b7d6[_0x34d658(0x1a9)]===_0x34d658(0x204))[_0x34d658(0x20c)],_0x1740ba=_0x2e0240['filter'](_0x293355=>_0x293355[_0x34d658(0x1a9)]==='FAIL')['length'],_0x4e7774=_0x2e0240['filter'](_0xe0e8ff=>_0xe0e8ff[_0x34d658(0x1a9)]===_0x34d658(0x1db))[_0x34d658(0x20c)];console[_0x34d658(0x1bd)]('━'[_0x34d658(0x22d)](0x3c)),console['log'](_0x34d658(0x1ea)),console[_0x34d658(0x1bd)]('━'[_0x34d658(0x22d)](0x3c)),console[_0x34d658(0x1bd)](_0x34d658(0x1ac)+_0x2e0240[_0x34d658(0x20c)]),console['log']('Passed:\x20\x20\x20'+a5_0x76862c[_0x34d658(0x20d)](_0x5308fe)),console[_0x34d658(0x1bd)](_0x34d658(0x21a)+a5_0x76862c[_0x34d658(0x22b)](_0x1740ba));_0x4e7774>0x0&&console[_0x34d658(0x1bd)](_0x34d658(0x219)+a5_0x76862c[_0x34d658(0x22b)](_0x4e7774));console['log']('Duration:\x20'+formatElapsed(_0x25301a)),console[_0x34d658(0x1bd)]('━'[_0x34d658(0x22d)](0x3c));const _0x2b92c8=_0x2e0240[_0x34d658(0x1a6)](_0x387255=>_0x387255[_0x34d658(0x1a9)]!==_0x34d658(0x204));if(_0x2b92c8[_0x34d658(0x20c)]>0x0){console[_0x34d658(0x1bd)](),console[_0x34d658(0x1bd)](_0x34d658(0x21d));for(const _0x50193e of _0x2b92c8){const _0x33a965=a5_0x76862c['red']('✗'),_0x4ceabc=_0x50193e['reason']['length']>0x32?_0x50193e[_0x34d658(0x1b8)][_0x34d658(0x1c2)](0x0,0x32)+_0x34d658(0x200):_0x50193e['reason'];console['log']('\x20\x20'+_0x33a965+'\x20'+_0x50193e[_0x34d658(0x1a7)]+':\x20'+_0x4ceabc);}}const _0x4692a4={'summary':{'total':_0x2e0240[_0x34d658(0x20c)],'passed':_0x5308fe,'failed':_0x1740ba,'errors':_0x4e7774>0x0?_0x4e7774:undefined,'duration_ms':_0x25301a},'tests':_0x2e0240,'agent':{'project':_0x17efc5['projectName'],'name':_0x17efc5[_0x34d658(0x1f6)],'site':_0x21869a},'timestamp':new Date(_0x851228)[_0x34d658(0x234)]()};try{const _0x1d9609=buildCachedTestRun(_0x7cb4d4,{'site':_0x21869a,'projectId':_0x2f407d,'projectName':_0x17efc5['projectName'],'agentId':_0x489244,'agentName':_0x17efc5[_0x34d658(0x1f6)],'testYmlPath':a5_0x4b04ce[_0x34d658(0x213)](_0x17efc5[_0x34d658(0x21b)])});saveLastTestRun(_0x1d9609);}catch{}if(_0x360bb8!==_0x34d658(0x21c)||_0x4876a4){const _0x5b2ff9=formatResults(_0x4692a4,_0x360bb8);if(_0x4876a4)try{a5_0x306e8a['writeFileSync'](_0x4876a4,_0x5b2ff9,_0x34d658(0x20e)),console[_0x34d658(0x1bd)](),console[_0x34d658(0x1bd)](a5_0x76862c[_0x34d658(0x210)]('Output\x20written\x20to:\x20'+_0x4876a4));}catch(_0x367c37){return console[_0x34d658(0x1bd)](),console[_0x34d658(0x1bd)](a5_0x76862c[_0x34d658(0x22b)](_0x34d658(0x1fa)+_0x367c37)),0x1;}else console['log'](),console[_0x34d658(0x1bd)](_0x5b2ff9);}return _0x2b92c8[_0x34d658(0x20c)]>0x0?0x1:0x0;}async['executeReeval'](_0x6e2650,_0x1cb467){const _0x4a8ffb=a5_0x2badb6,{options:_0x2121ed,tdx:_0x12d9f7}=_0x6e2650,{definition:_0x7dd32,agentInfo:_0x13b82e,outputFormat:_0x177021,outputFile:_0x217937}=_0x1cb467,_0x54af9c=_0x2121ed[_0x4a8ffb(0x1d1)],_0x33f93d=loadLastTestRun();if(!_0x33f93d)return console[_0x4a8ffb(0x1bd)](a5_0x76862c[_0x4a8ffb(0x22b)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x4a8ffb(0x1bd)](a5_0x76862c[_0x4a8ffb(0x210)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x33f93d[_0x4a8ffb(0x207)]['agentName']!==_0x13b82e[_0x4a8ffb(0x1f6)])return console[_0x4a8ffb(0x1bd)](a5_0x76862c[_0x4a8ffb(0x22b)](_0x4a8ffb(0x1f7)+_0x33f93d[_0x4a8ffb(0x207)][_0x4a8ffb(0x1f6)]+_0x4a8ffb(0x220)+_0x13b82e[_0x4a8ffb(0x1f6)]+'\x22.')),console[_0x4a8ffb(0x1bd)](a5_0x76862c['dim'](_0x4a8ffb(0x1ae))),0x1;const _0x3ad159=new Set(_0x33f93d[_0x4a8ffb(0x225)][_0x4a8ffb(0x215)](_0x1b7fc4=>_0x1b7fc4['testName'])),_0x50abfd=_0x7dd32[_0x4a8ffb(0x1c7)][_0x4a8ffb(0x1a6)](_0x349af0=>!_0x3ad159['has'](_0x349af0['name']));if(_0x50abfd[_0x4a8ffb(0x20c)]>0x0&&_0x33f93d[_0x4a8ffb(0x1d1)]!==_0x54af9c)return console[_0x4a8ffb(0x1bd)](a5_0x76862c[_0x4a8ffb(0x22b)](_0x4a8ffb(0x1ec))),console[_0x4a8ffb(0x1bd)](a5_0x76862c['dim'](_0x4a8ffb(0x1ff)+_0x33f93d[_0x4a8ffb(0x1d1)]+_0x4a8ffb(0x1c1)+_0x54af9c+'\x22.')),console[_0x4a8ffb(0x1bd)](a5_0x76862c[_0x4a8ffb(0x210)]('Either\x20switch\x20to\x20the\x20\x22'+_0x33f93d['site']+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0xceba3a=_0x7dd32[_0x4a8ffb(0x1c7)][_0x4a8ffb(0x1a6)](_0x5dc943=>_0x3ad159[_0x4a8ffb(0x1df)](_0x5dc943[_0x4a8ffb(0x1a7)])),_0x58e445=_0x50abfd;let _0x1c5cd0;try{_0x1c5cd0=await setupEvaluatorAgent(_0x12d9f7[_0x4a8ffb(0x1a5)],_0x2121ed[_0x4a8ffb(0x222)]);}catch(_0x2e97e9){const _0x587d19=_0x2e97e9 instanceof Error?_0x2e97e9[_0x4a8ffb(0x205)]:String(_0x2e97e9);return console[_0x4a8ffb(0x1bd)](a5_0x76862c['red'](_0x4a8ffb(0x22e)+_0x587d19)),0x1;}console['log'](a5_0x76862c[_0x4a8ffb(0x1fc)](_0x4a8ffb(0x227))),console['log'](_0x4a8ffb(0x1f5)+a5_0x76862c[_0x4a8ffb(0x223)](_0x33f93d['timestamp'])),console[_0x4a8ffb(0x1bd)](_0x4a8ffb(0x1d3)+a5_0x76862c['white'](_0x33f93d[_0x4a8ffb(0x207)][_0x4a8ffb(0x218)]+'/'+_0x33f93d[_0x4a8ffb(0x207)][_0x4a8ffb(0x1f6)]));_0x58e445[_0x4a8ffb(0x20c)]>0x0&&console[_0x4a8ffb(0x1bd)]('New\x20tests\x20to\x20execute:\x20'+a5_0x76862c['yellow'](_0x58e445[_0x4a8ffb(0x20c)]));console[_0x4a8ffb(0x1bd)]();const _0x231132=[],_0x3010f9=Date[_0x4a8ffb(0x236)](),_0x57bd6c=createCommandSpinner('Re-evaluating...');if(_0xceba3a[_0x4a8ffb(0x20c)]>0x0)try{const _0x56e035=await reevaluateFromCache(_0x12d9f7[_0x4a8ffb(0x1a5)],_0x33f93d,{'tests':_0xceba3a},{'evaluatorId':_0x1c5cd0,'onTestStart':(_0x2e49ed,_0xc0e43f,_0x1e4572)=>{const _0xc1bfcf=_0x4a8ffb;_0x57bd6c[_0xc1bfcf(0x1d6)]=_0xc1bfcf(0x1fd)+(_0xc0e43f+0x1)+'/'+_0x1e4572+':\x20'+_0x2e49ed+_0xc1bfcf(0x200);if(!_0x57bd6c[_0xc1bfcf(0x1e5)])_0x57bd6c[_0xc1bfcf(0x1da)]();},'onTestComplete':(_0x36e43d,_0x5d8bdf)=>{const _0x17e402=_0x4a8ffb;_0x57bd6c[_0x17e402(0x1f3)]();if(_0x5d8bdf[_0x17e402(0x1a9)]===_0x17e402(0x204))console[_0x17e402(0x1bd)](a5_0x76862c[_0x17e402(0x20d)](_0x17e402(0x1e3)+_0x36e43d)+a5_0x76862c[_0x17e402(0x210)](_0x17e402(0x221)));else _0x5d8bdf[_0x17e402(0x1a9)]==='FAIL'?console[_0x17e402(0x1bd)](a5_0x76862c[_0x17e402(0x22b)](_0x17e402(0x1e4)+_0x36e43d+_0x17e402(0x1a8)+_0x5d8bdf[_0x17e402(0x1b8)])+a5_0x76862c[_0x17e402(0x210)](_0x17e402(0x221))):console[_0x17e402(0x1bd)](a5_0x76862c['red'](_0x17e402(0x1cd)+_0x36e43d+_0x17e402(0x1a8)+_0x5d8bdf[_0x17e402(0x1b8)]));_0x5d8bdf[_0x17e402(0x238)]&&console[_0x17e402(0x1bd)](a5_0x76862c['dim']('\x20\x20Conversation:\x20'+_0x5d8bdf[_0x17e402(0x238)])),_0x231132[_0x17e402(0x228)](_0x5d8bdf);},'onTestSkipped':(_0x14f0b6,_0x8262d7)=>{const _0x3b1a9c=_0x4a8ffb;_0x57bd6c[_0x3b1a9c(0x1f3)](),console[_0x3b1a9c(0x1bd)](a5_0x76862c[_0x3b1a9c(0x1af)]('⚠\x20SKIPPED:\x20'+_0x14f0b6+_0x3b1a9c(0x1a8)+_0x8262d7));}});for(const _0x2ad9bc of _0x56e035){!_0x231132[_0x4a8ffb(0x212)](_0x55962a=>_0x55962a[_0x4a8ffb(0x1a7)]===_0x2ad9bc['name'])&&_0x231132[_0x4a8ffb(0x228)](_0x2ad9bc);}}catch(_0x23043a){_0x57bd6c[_0x4a8ffb(0x1f3)]();const _0x40ba66=_0x23043a instanceof Error?_0x23043a[_0x4a8ffb(0x205)]:String(_0x23043a);return console[_0x4a8ffb(0x1bd)](a5_0x76862c[_0x4a8ffb(0x22b)](_0x4a8ffb(0x1c0)+_0x40ba66)),0x1;}_0x57bd6c[_0x4a8ffb(0x1f3)]();if(_0x58e445[_0x4a8ffb(0x20c)]>0x0){console['log'](),console[_0x4a8ffb(0x1bd)](a5_0x76862c['cyan']('Executing\x20new\x20tests...'));const {projectId:_0x2fb763,agentId:_0x590b41}=_0x33f93d['agent'];for(const _0x509f65 of _0x58e445){console['log'](_0x4a8ffb(0x1d4)+a5_0x76862c[_0x4a8ffb(0x223)](_0x509f65[_0x4a8ffb(0x1a7)]));const _0x182936=createCommandSpinner(_0x4a8ffb(0x1d5)+_0x509f65[_0x4a8ffb(0x237)][_0x4a8ffb(0x20c)]+':\x20Sending\x20user\x20input...');_0x182936[_0x4a8ffb(0x1da)]();try{const {result:_0xbf9c36}=await runTest(_0x12d9f7['llm'],_0x509f65,{'agentId':_0x590b41,'projectId':_0x2fb763,'site':_0x33f93d[_0x4a8ffb(0x1d1)],'noEval':![],'evaluatorId':_0x1c5cd0,'onRoundStart':(_0x51af34,_0x441ee4)=>{const _0x152606=_0x4a8ffb;_0x182936['text']=_0x152606(0x229)+(_0x51af34+0x1)+'/'+_0x441ee4+_0x152606(0x1eb);},'onRoundComplete':(_0x12bdd2,_0x566fd2,_0x18cce6)=>{const _0x2d1d35=_0x4a8ffb,_0xa980ef=formatElapsed(_0x566fd2);_0x18cce6?console[_0x2d1d35(0x1bd)]('\x20\x20Round\x20'+(_0x12bdd2+0x1)+'/'+_0x509f65['rounds'][_0x2d1d35(0x20c)]+_0x2d1d35(0x1bc)+a5_0x76862c[_0x2d1d35(0x20d)]('✓')+'\x20('+_0xa980ef+')'):console[_0x2d1d35(0x1bd)](_0x2d1d35(0x211)+(_0x12bdd2+0x1)+'/'+_0x509f65[_0x2d1d35(0x237)][_0x2d1d35(0x20c)]+_0x2d1d35(0x1bc)+a5_0x76862c[_0x2d1d35(0x22b)]('✗'));},'onEvaluationStart':()=>{const _0x44a307=_0x4a8ffb;_0x182936[_0x44a307(0x1d6)]=_0x44a307(0x1cb);},'onEvaluationComplete':_0xb1a49c=>{const _0x30121b=_0x4a8ffb,_0x565cd9=formatElapsed(_0xb1a49c);console[_0x30121b(0x1bd)](_0x30121b(0x1c8)+a5_0x76862c[_0x30121b(0x20d)]('✓')+'\x20('+_0x565cd9+')');}});_0x182936[_0x4a8ffb(0x1f3)](),_0x231132[_0x4a8ffb(0x228)](_0xbf9c36);if(_0xbf9c36[_0x4a8ffb(0x1a9)]===_0x4a8ffb(0x204))console['log'](a5_0x76862c['green']('✓\x20PASS:\x20'+_0xbf9c36[_0x4a8ffb(0x1b8)])+a5_0x76862c[_0x4a8ffb(0x210)](_0x4a8ffb(0x1bb)));else _0xbf9c36[_0x4a8ffb(0x1a9)]==='FAIL'?console[_0x4a8ffb(0x1bd)](a5_0x76862c[_0x4a8ffb(0x22b)](_0x4a8ffb(0x1e4)+_0xbf9c36[_0x4a8ffb(0x1b8)])+a5_0x76862c[_0x4a8ffb(0x210)]('\x20(new)')):console[_0x4a8ffb(0x1bd)](a5_0x76862c['red'](_0x4a8ffb(0x1cd)+_0xbf9c36['reason']));_0xbf9c36['conversation_url']&&console[_0x4a8ffb(0x1bd)](a5_0x76862c[_0x4a8ffb(0x210)]('\x20\x20Conversation:\x20'+_0xbf9c36[_0x4a8ffb(0x238)]));}catch(_0x332467){_0x182936['stop']();const _0x5c9b4c=_0x332467 instanceof Error?_0x332467[_0x4a8ffb(0x205)]:String(_0x332467);console[_0x4a8ffb(0x1bd)](a5_0x76862c['red'](_0x4a8ffb(0x1cd)+_0x5c9b4c)),_0x231132[_0x4a8ffb(0x228)]({'name':_0x509f65[_0x4a8ffb(0x1a7)],'status':'ERROR','reason':_0x5c9b4c,'timestamp':new Date()[_0x4a8ffb(0x234)](),'duration_ms':0x0});}}}console[_0x4a8ffb(0x1bd)]();const _0x57b4fd=Date[_0x4a8ffb(0x236)]()-_0x3010f9,_0x27ac52=_0x231132[_0x4a8ffb(0x1a6)](_0x550f24=>_0x550f24[_0x4a8ffb(0x1a9)]==='PASS')[_0x4a8ffb(0x20c)],_0xf227a6=_0x231132[_0x4a8ffb(0x1a6)](_0xbffde8=>_0xbffde8[_0x4a8ffb(0x1a9)]===_0x4a8ffb(0x1f4))[_0x4a8ffb(0x20c)],_0x4cc7f2=_0x231132[_0x4a8ffb(0x1a6)](_0x29063b=>_0x29063b['status']===_0x4a8ffb(0x1db))[_0x4a8ffb(0x20c)];console[_0x4a8ffb(0x1bd)]('━'[_0x4a8ffb(0x22d)](0x3c)),console[_0x4a8ffb(0x1bd)]('Re-evaluation\x20Summary'),console[_0x4a8ffb(0x1bd)]('━'[_0x4a8ffb(0x22d)](0x3c)),console['log'](_0x4a8ffb(0x1ac)+_0x231132[_0x4a8ffb(0x20c)]),console[_0x4a8ffb(0x1bd)](_0x4a8ffb(0x1b0)+a5_0x76862c[_0x4a8ffb(0x20d)](_0x27ac52)),console[_0x4a8ffb(0x1bd)]('Failed:\x20\x20\x20'+a5_0x76862c[_0x4a8ffb(0x22b)](_0xf227a6));_0x4cc7f2>0x0&&console[_0x4a8ffb(0x1bd)]('Errors:\x20\x20\x20'+a5_0x76862c[_0x4a8ffb(0x22b)](_0x4cc7f2));console[_0x4a8ffb(0x1bd)](_0x4a8ffb(0x1f1)+formatElapsed(_0x57b4fd)),console[_0x4a8ffb(0x1bd)]('━'[_0x4a8ffb(0x22d)](0x3c));const _0xaad830={'summary':{'total':_0x231132[_0x4a8ffb(0x20c)],'passed':_0x27ac52,'failed':_0xf227a6,'errors':_0x4cc7f2>0x0?_0x4cc7f2:undefined,'duration_ms':_0x57b4fd},'tests':_0x231132,'agent':{'project':_0x13b82e['projectName'],'name':_0x13b82e[_0x4a8ffb(0x1f6)],'site':_0x54af9c},'timestamp':new Date(_0x3010f9)[_0x4a8ffb(0x234)]()};if(_0x177021!==_0x4a8ffb(0x21c)||_0x217937){const _0x33748d=formatResults(_0xaad830,_0x177021);if(_0x217937)try{a5_0x306e8a[_0x4a8ffb(0x1ba)](_0x217937,_0x33748d,'utf-8'),console[_0x4a8ffb(0x1bd)](),console[_0x4a8ffb(0x1bd)](a5_0x76862c[_0x4a8ffb(0x210)](_0x4a8ffb(0x1d9)+_0x217937));}catch(_0x5ad6ca){return console['log'](),console[_0x4a8ffb(0x1bd)](a5_0x76862c['red']('Error\x20writing\x20output\x20file:\x20'+_0x5ad6ca)),0x1;}else console[_0x4a8ffb(0x1bd)](),console[_0x4a8ffb(0x1bd)](_0x33748d);}const _0x52b42c=_0x231132[_0x4a8ffb(0x1a6)](_0x65e8d9=>_0x65e8d9[_0x4a8ffb(0x1a9)]!=='PASS');return _0x52b42c[_0x4a8ffb(0x20c)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x5bb120=a6_0x2e00;(function(_0x46cc62,_0x2421c1){const _0x3145dd=a6_0x2e00,_0xbc8af3=_0x46cc62();while(!![]){try{const _0x29146b=-parseInt(_0x3145dd(0xe8))/0x1+parseInt(_0x3145dd(0xb3))/0x2+-parseInt(_0x3145dd(0xe4))/0x3*(-parseInt(_0x3145dd(0xcb))/0x4)+parseInt(_0x3145dd(0xdb))/0x5*(parseInt(_0x3145dd(0xb8))/0x6)+parseInt(_0x3145dd(0xd7))/0x7+parseInt(_0x3145dd(0xa7))/0x8*(parseInt(_0x3145dd(0xda))/0x9)+parseInt(_0x3145dd(0xd9))/0xa*(-parseInt(_0x3145dd(0xb1))/0xb);if(_0x29146b===_0x2421c1)break;else _0xbc8af3['push'](_0xbc8af3['shift']());}catch(_0xd471e){_0xbc8af3['push'](_0xbc8af3['shift']());}}}(a6_0x84f6,0x41e7b));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a6_0x84f6(){const _0x581985=['90JaJTwM','2246905lGujPf','<\x20HTTP/1.1\x20','log','validate','error','Invalid\x20header\x20format:\x20\x22','\x22.\x20','Results\x20saved\x20to\x20','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','9ygubbj','includes','join','file','104385KUWgPy','request','239144tVcmGe','DELETE','data','set-cookie2','POST','stack','message','toUpperCase','llm','keys','11lYONLb','workflow','85818hOdJnR','PATCH','cdp','GET','substring','6JQAmTB','proxy-authorization','\x0aStack\x20trace:\x0a','llm-proxy','isArray','type','cookie','api','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','noColor','name','execute','headers','has','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','body','readBodyFromFile','Error:\x20','header','379216diQhIh','method','length','verbose','cas','trino','entries','Invalid\x20HTTP\x20method:\x20','status','Endpoint\x20must\x20start\x20with\x20/:\x20','description','color','1329125LJqEGV','output','8911750PMxKGQ'];a6_0x84f6=function(){return _0x581985;};return a6_0x84f6();}import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';function a6_0x2e00(_0x5e9e57,_0x9b0e57){_0x5e9e57=_0x5e9e57-0xa7;const _0x84f6a7=a6_0x84f6();let _0x2e005d=_0x84f6a7[_0x5e9e57];return _0x2e005d;}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization',a6_0x5bb120(0xb9),a6_0x5bb120(0xbe),'set-cookie',a6_0x5bb120(0xaa),'x-xsrf-token','x-auth-token','x-trino-user']);function isSensitiveHeader(_0x5b28be){const _0x47268c=a6_0x5bb120;return SENSITIVE_HEADERS[_0x47268c(0xc5)](_0x5b28be['toLowerCase']());}function parseHeader(_0x5b3711){const _0x38eafb=a6_0x5bb120,_0x11ea7e=_0x5b3711['indexOf'](':');if(_0x11ea7e===-0x1)throw new Error(_0x38eafb(0xe0)+_0x5b3711+_0x38eafb(0xe1)+_0x38eafb(0xc0));const _0x567a2f=_0x5b3711[_0x38eafb(0xb7)](0x0,_0x11ea7e)['trim'](),_0x5138bc=_0x5b3711[_0x38eafb(0xb7)](_0x11ea7e+0x1)['trim']();if(!_0x567a2f)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x5b3711+'\x22');return[_0x567a2f,_0x5138bc];}export class ApiCommand extends BaseCommand{[a6_0x5bb120(0xc2)]=a6_0x5bb120(0xbf);[a6_0x5bb120(0xd5)]=a6_0x5bb120(0xe3);[a6_0x5bb120(0xde)](_0x495429){const _0x8a471f=a6_0x5bb120,{args:_0x2a66b5,options:_0x1c94e2}=_0x495429,_0x4cb59f=_0x1c94e2;if(_0x2a66b5[_0x8a471f(0xcd)]===0x0)return _0x8a471f(0xc6);const _0x575f87=_0x2a66b5[0x0];if(!_0x575f87['startsWith']('/'))return _0x8a471f(0xd4)+_0x575f87;const _0x272ae3=_0x4cb59f['data'],_0x4589a8=_0x4cb59f[_0x8a471f(0xe7)];if(_0x272ae3&&_0x4589a8)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x356034=_0x4cb59f['method']||_0x8a471f(0xb6),_0x5b16a4=['GET',_0x8a471f(0xab),'PUT',_0x8a471f(0xa8),_0x8a471f(0xb4)];if(!_0x5b16a4[_0x8a471f(0xe5)](_0x356034[_0x8a471f(0xae)]()))return _0x8a471f(0xd2)+_0x356034+'.\x20Valid\x20methods:\x20'+_0x5b16a4[_0x8a471f(0xe6)](',\x20');const _0x2c272c=_0x4cb59f[_0x8a471f(0xbd)]||'td',_0x639e99=['td',_0x8a471f(0xb5),_0x8a471f(0xb2),_0x8a471f(0xd0),_0x8a471f(0xaf),_0x8a471f(0xbb),_0x8a471f(0xcf)];if(!_0x639e99['includes'](_0x2c272c))return'Invalid\x20API\x20type:\x20'+_0x2c272c+'.\x20Valid\x20types:\x20'+_0x639e99[_0x8a471f(0xe6)](',\x20');return undefined;}async[a6_0x5bb120(0xc3)](_0x42691f){const _0x34ccd3=a6_0x5bb120,{options:_0x1c4d6c,args:_0x325215,tdx:_0x380c27}=_0x42691f,_0x3592ba=_0x1c4d6c,_0x48d0c1=_0x325215[0x0],_0x302547=(_0x3592ba[_0x34ccd3(0xcc)]||'GET')[_0x34ccd3(0xae)](),_0x2f23d1=_0x3592ba[_0x34ccd3(0xa9)],_0x25a27d=_0x3592ba[_0x34ccd3(0xe7)],_0x3f7176=_0x3592ba[_0x34ccd3(0xca)],_0x36aa3b=_0x3592ba[_0x34ccd3(0xbd)]||'td';try{const _0x394d93={};if(_0x3f7176){const _0x5bdfcd=Array[_0x34ccd3(0xbc)](_0x3f7176)?_0x3f7176:[_0x3f7176];for(const _0x48a792 of _0x5bdfcd){const [_0x8c6228,_0x337688]=parseHeader(_0x48a792);_0x394d93[_0x8c6228]=_0x337688;}}let _0x224459;if(_0x2f23d1)_0x224459=_0x2f23d1;else{if(_0x25a27d)try{_0x224459=RawAPI[_0x34ccd3(0xc8)](_0x25a27d);}catch(_0x122c3c){return console[_0x34ccd3(0xdf)]('Error:\x20'+(_0x122c3c instanceof Error?_0x122c3c[_0x34ccd3(0xad)]:String(_0x122c3c))),0x1;}}const _0x16f578={'method':_0x302547,'apiType':_0x36aa3b,'includeHeaders':_0x1c4d6c[_0x34ccd3(0xce)]};_0x224459&&(_0x16f578[_0x34ccd3(0xc7)]=_0x224459);Object[_0x34ccd3(0xb0)](_0x394d93)[_0x34ccd3(0xcd)]>0x0&&(_0x16f578[_0x34ccd3(0xc4)]=_0x394d93);if(_0x1c4d6c[_0x34ccd3(0xce)]){const _0x135717=resolveSite(_0x1c4d6c['site']),_0x1edcf1=getEndpoint(_0x135717,_0x36aa3b),_0x33d69f=''+_0x1edcf1+_0x48d0c1;console[_0x34ccd3(0xdf)]('>\x20'+_0x302547+'\x20'+_0x33d69f);const _0x21b3e7=getAuthHeaders(_0x135717),_0x4564f9={..._0x21b3e7,..._0x394d93};for(const [_0x2c58c1,_0x3afe37]of Object[_0x34ccd3(0xd1)](_0x4564f9)){!isSensitiveHeader(_0x2c58c1)&&console['error']('>\x20'+_0x2c58c1+':\x20'+_0x3afe37);}_0x224459&&console[_0x34ccd3(0xdf)]('>'),console[_0x34ccd3(0xdf)]('');}const _0x5f35c7=await _0x380c27['api'][_0x34ccd3(0xe9)](_0x48d0c1,_0x16f578);if(_0x1c4d6c['verbose']&&_0x5f35c7[_0x34ccd3(0xc4)]){console['error'](_0x34ccd3(0xdc)+_0x5f35c7[_0x34ccd3(0xd3)]);for(const [_0x125849,_0x482a8f]of Object[_0x34ccd3(0xd1)](_0x5f35c7[_0x34ccd3(0xc4)])){!isSensitiveHeader(_0x125849)&&console[_0x34ccd3(0xdf)]('<\x20'+_0x125849+':\x20'+_0x482a8f);}console[_0x34ccd3(0xdf)]('');}const _0x44a2fb=Boolean(_0x1c4d6c[_0x34ccd3(0xd8)]),_0x1e5be3={'color':_0x1c4d6c[_0x34ccd3(0xd6)],'noColor':_0x1c4d6c[_0x34ccd3(0xc1)]||_0x44a2fb&&!_0x1c4d6c[_0x34ccd3(0xd6)]},_0x538f50=colorizeJSON(_0x5f35c7['data'],_0x1e5be3);return _0x1c4d6c['output']?(writeFileSync(_0x1c4d6c[_0x34ccd3(0xd8)],_0x538f50),console['error'](_0x34ccd3(0xe2)+_0x1c4d6c[_0x34ccd3(0xd8)])):console[_0x34ccd3(0xdd)](_0x538f50),0x0;}catch(_0x4d0d5c){return _0x4d0d5c instanceof Error?(console[_0x34ccd3(0xdf)](_0x34ccd3(0xc9)+_0x4d0d5c[_0x34ccd3(0xad)]),_0x1c4d6c[_0x34ccd3(0xce)]&&_0x4d0d5c[_0x34ccd3(0xac)]&&console[_0x34ccd3(0xdf)](_0x34ccd3(0xba)+_0x4d0d5c[_0x34ccd3(0xac)])):console['error']('Error:\x20'+String(_0x4d0d5c)),0x1;}}}
1
+ const a6_0x40b59b=a6_0x1a40;(function(_0x50180b,_0x29308f){const _0x3dbbf7=a6_0x1a40,_0x3efb3e=_0x50180b();while(!![]){try{const _0x26e972=-parseInt(_0x3dbbf7(0xa2))/0x1+parseInt(_0x3dbbf7(0x9e))/0x2+parseInt(_0x3dbbf7(0xb7))/0x3*(-parseInt(_0x3dbbf7(0xc0))/0x4)+-parseInt(_0x3dbbf7(0xc9))/0x5*(parseInt(_0x3dbbf7(0xac))/0x6)+parseInt(_0x3dbbf7(0xc3))/0x7+parseInt(_0x3dbbf7(0xce))/0x8*(-parseInt(_0x3dbbf7(0xbd))/0x9)+-parseInt(_0x3dbbf7(0xbe))/0xa*(-parseInt(_0x3dbbf7(0xa4))/0xb);if(_0x26e972===_0x29308f)break;else _0x3efb3e['push'](_0x3efb3e['shift']());}catch(_0x301e45){_0x3efb3e['push'](_0x3efb3e['shift']());}}}(a6_0x3cf4,0x8ad61));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';function a6_0x1a40(_0x108e99,_0x3321a8){_0x108e99=_0x108e99-0x8c;const _0x3cf43d=a6_0x3cf4();let _0x1a4076=_0x3cf43d[_0x108e99];return _0x1a4076;}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x40b59b(0x8e),a6_0x40b59b(0xa1),a6_0x40b59b(0xbb),'set-cookie',a6_0x40b59b(0xaf),a6_0x40b59b(0xcf),a6_0x40b59b(0xad),a6_0x40b59b(0xca)]);function a6_0x3cf4(){const _0x5e78c6=['isArray','Error:\x20','readBodyFromFile','21981WYdAes','join','validate','trim','cookie','headers','468603KovXBT','10DvnqRR','status','572buVInz','toLowerCase','startsWith','6127947ySBvZp','llm','.\x20Valid\x20methods:\x20','message','Endpoint\x20must\x20start\x20with\x20/:\x20','file','2555FKCjKX','x-trino-user','color','indexOf','PUT','16gpbOrg','x-xsrf-token','output','DELETE','noColor','.\x20Valid\x20types:\x20','execute','POST','Invalid\x20API\x20type:\x20','site','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','authorization','GET','toUpperCase','type','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','name','description','request','header','llm-proxy','\x22.\x20','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','length','verbose','has','1688166BJYoKc','Results\x20saved\x20to\x20','PATCH','proxy-authorization','428054jgBRYU','data','8323359QkLXyX','<\x20HTTP/1.1\x20','Invalid\x20header\x20format:\x20\x22','stack','workflow','trino','substring','entries','3846zCScQU','x-auth-token','api','set-cookie2','Invalid\x20HTTP\x20method:\x20','error','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','method'];a6_0x3cf4=function(){return _0x5e78c6;};return a6_0x3cf4();}function isSensitiveHeader(_0x48108b){const _0x39c730=a6_0x40b59b;return SENSITIVE_HEADERS[_0x39c730(0x9d)](_0x48108b[_0x39c730(0xc1)]());}function parseHeader(_0x3126b9){const _0x26dd1c=a6_0x40b59b,_0x55a256=_0x3126b9[_0x26dd1c(0xcc)](':');if(_0x55a256===-0x1)throw new Error(_0x26dd1c(0xa6)+_0x3126b9+_0x26dd1c(0x99)+_0x26dd1c(0x8d));const _0x33e8b0=_0x3126b9[_0x26dd1c(0xaa)](0x0,_0x55a256)[_0x26dd1c(0xba)](),_0x103ec0=_0x3126b9[_0x26dd1c(0xaa)](_0x55a256+0x1)[_0x26dd1c(0xba)]();if(!_0x33e8b0)throw new Error(_0x26dd1c(0xb2)+_0x3126b9+'\x22');return[_0x33e8b0,_0x103ec0];}export class ApiCommand extends BaseCommand{[a6_0x40b59b(0x94)]=a6_0x40b59b(0xae);[a6_0x40b59b(0x95)]=a6_0x40b59b(0x93);[a6_0x40b59b(0xb9)](_0x72b1df){const _0x3bf520=a6_0x40b59b,{args:_0x14d8b6,options:_0x17655f}=_0x72b1df,_0x3eb6cb=_0x17655f;if(_0x14d8b6[_0x3bf520(0x9b)]===0x0)return _0x3bf520(0x9a);const _0x2f0de0=_0x14d8b6[0x0];if(!_0x2f0de0[_0x3bf520(0xc2)]('/'))return _0x3bf520(0xc7)+_0x2f0de0;const _0x4501e8=_0x3eb6cb[_0x3bf520(0xa3)],_0x2b8626=_0x3eb6cb[_0x3bf520(0xc8)];if(_0x4501e8&&_0x2b8626)return _0x3bf520(0x92);const _0x35f56d=_0x3eb6cb[_0x3bf520(0xb3)]||'GET',_0x179638=[_0x3bf520(0x8f),_0x3bf520(0xd5),_0x3bf520(0xcd),_0x3bf520(0xd1),_0x3bf520(0xa0)];if(!_0x179638['includes'](_0x35f56d[_0x3bf520(0x90)]()))return _0x3bf520(0xb0)+_0x35f56d+_0x3bf520(0xc5)+_0x179638[_0x3bf520(0xb8)](',\x20');const _0x1ed008=_0x3eb6cb['type']||'td',_0x3ae0fe=['td','cdp',_0x3bf520(0xa8),_0x3bf520(0xa9),_0x3bf520(0xc4),_0x3bf520(0x98),'cas'];if(!_0x3ae0fe['includes'](_0x1ed008))return _0x3bf520(0xd6)+_0x1ed008+_0x3bf520(0xd3)+_0x3ae0fe[_0x3bf520(0xb8)](',\x20');return undefined;}async[a6_0x40b59b(0xd4)](_0x441bf1){const _0x5149d3=a6_0x40b59b,{options:_0x39c91f,args:_0x4ccbdc,tdx:_0x18d9e3}=_0x441bf1,_0x1d0aca=_0x39c91f,_0x11cc8b=_0x4ccbdc[0x0],_0x51c46e=(_0x1d0aca['method']||_0x5149d3(0x8f))[_0x5149d3(0x90)](),_0x412b54=_0x1d0aca[_0x5149d3(0xa3)],_0x5f275c=_0x1d0aca[_0x5149d3(0xc8)],_0x497f5d=_0x1d0aca[_0x5149d3(0x97)],_0x3cdb65=_0x1d0aca[_0x5149d3(0x91)]||'td';try{const _0x237223={};if(_0x497f5d){const _0xd489d3=Array[_0x5149d3(0xb4)](_0x497f5d)?_0x497f5d:[_0x497f5d];for(const _0x29e1f2 of _0xd489d3){const [_0x467410,_0x22dc4d]=parseHeader(_0x29e1f2);_0x237223[_0x467410]=_0x22dc4d;}}let _0x50ff86;if(_0x412b54)_0x50ff86=_0x412b54;else{if(_0x5f275c)try{_0x50ff86=RawAPI[_0x5149d3(0xb6)](_0x5f275c);}catch(_0x4cec37){return console['error'](_0x5149d3(0xb5)+(_0x4cec37 instanceof Error?_0x4cec37['message']:String(_0x4cec37))),0x1;}}const _0x7fdc0e={'method':_0x51c46e,'apiType':_0x3cdb65,'includeHeaders':_0x39c91f[_0x5149d3(0x9c)]};_0x50ff86&&(_0x7fdc0e['body']=_0x50ff86);Object['keys'](_0x237223)[_0x5149d3(0x9b)]>0x0&&(_0x7fdc0e[_0x5149d3(0xbc)]=_0x237223);if(_0x39c91f[_0x5149d3(0x9c)]){const _0x37c079=resolveSite(_0x39c91f[_0x5149d3(0x8c)]),_0x12a198=getEndpoint(_0x37c079,_0x3cdb65),_0x350346=''+_0x12a198+_0x11cc8b;console[_0x5149d3(0xb1)]('>\x20'+_0x51c46e+'\x20'+_0x350346);const _0x1635ff=getAuthHeaders(_0x37c079),_0x46aaf2={..._0x1635ff,..._0x237223};for(const [_0x58375c,_0x42911d]of Object[_0x5149d3(0xab)](_0x46aaf2)){!isSensitiveHeader(_0x58375c)&&console['error']('>\x20'+_0x58375c+':\x20'+_0x42911d);}_0x50ff86&&console[_0x5149d3(0xb1)]('>'),console[_0x5149d3(0xb1)]('');}const _0x27c259=await _0x18d9e3['api'][_0x5149d3(0x96)](_0x11cc8b,_0x7fdc0e);if(_0x39c91f[_0x5149d3(0x9c)]&&_0x27c259[_0x5149d3(0xbc)]){console['error'](_0x5149d3(0xa5)+_0x27c259[_0x5149d3(0xbf)]);for(const [_0x5ef915,_0x2f17f3]of Object[_0x5149d3(0xab)](_0x27c259[_0x5149d3(0xbc)])){!isSensitiveHeader(_0x5ef915)&&console[_0x5149d3(0xb1)]('<\x20'+_0x5ef915+':\x20'+_0x2f17f3);}console[_0x5149d3(0xb1)]('');}const _0x131730=Boolean(_0x39c91f['output']),_0x457eb8={'color':_0x39c91f['color'],'noColor':_0x39c91f[_0x5149d3(0xd2)]||_0x131730&&!_0x39c91f[_0x5149d3(0xcb)]},_0xbc15f9=colorizeJSON(_0x27c259['data'],_0x457eb8);return _0x39c91f[_0x5149d3(0xd0)]?(writeFileSync(_0x39c91f[_0x5149d3(0xd0)],_0xbc15f9),console['error'](_0x5149d3(0x9f)+_0x39c91f[_0x5149d3(0xd0)])):console['log'](_0xbc15f9),0x0;}catch(_0xd0d81b){return _0xd0d81b instanceof Error?(console[_0x5149d3(0xb1)](_0x5149d3(0xb5)+_0xd0d81b[_0x5149d3(0xc6)]),_0x39c91f[_0x5149d3(0x9c)]&&_0xd0d81b['stack']&&console[_0x5149d3(0xb1)]('\x0aStack\x20trace:\x0a'+_0xd0d81b[_0x5149d3(0xa7)])):console['error'](_0x5149d3(0xb5)+String(_0xd0d81b)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x1fe559=a7_0x5eaf;(function(_0x4d1990,_0x1c3bd0){const _0x4ac45a=a7_0x5eaf,_0x3bfd55=_0x4d1990();while(!![]){try{const _0xd2d3a3=parseInt(_0x4ac45a(0x223))/0x1*(parseInt(_0x4ac45a(0x21f))/0x2)+parseInt(_0x4ac45a(0x1e5))/0x3*(parseInt(_0x4ac45a(0x222))/0x4)+-parseInt(_0x4ac45a(0x20f))/0x5*(parseInt(_0x4ac45a(0x20b))/0x6)+parseInt(_0x4ac45a(0x1d6))/0x7*(-parseInt(_0x4ac45a(0x226))/0x8)+-parseInt(_0x4ac45a(0x221))/0x9*(parseInt(_0x4ac45a(0x1e0))/0xa)+parseInt(_0x4ac45a(0x217))/0xb*(parseInt(_0x4ac45a(0x219))/0xc)+parseInt(_0x4ac45a(0x1df))/0xd*(-parseInt(_0x4ac45a(0x1ee))/0xe);if(_0xd2d3a3===_0x1c3bd0)break;else _0x3bfd55['push'](_0x3bfd55['shift']());}catch(_0x25f72c){_0x3bfd55['push'](_0x3bfd55['shift']());}}}(a7_0x5a13,0xd5e88));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0xe83ced from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a7_0x5eaf(_0x470d76,_0x3d8446){_0x470d76=_0x470d76-0x1d2;const _0x5a1396=a7_0x5a13();let _0x5eaf38=_0x5a1396[_0x470d76];return _0x5eaf38;}import{LogLevel}from'../utils/tdx-logger.js';import a7_0x45b8a8 from'chalk';export async function runOAuthLoginFlow(_0xd81468,_0x17e9dc,_0x364e50,_0x1a12c6){const _0x32977a=a7_0x5eaf,_0x36c8e9=await isKeychainAvailable();if(!_0x36c8e9)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+_0x32977a(0x207));let _0x1e4455=_0x1a12c6?.[_0x32977a(0x206)];if(!_0x1e4455){const _0x163f7a=await a7_0xe83ced({'type':_0x32977a(0x232),'name':_0x32977a(0x206),'message':'Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):'});if(_0x163f7a[_0x32977a(0x206)]===undefined)throw new Error('Setup\x20cancelled');_0x1e4455=_0x163f7a[_0x32977a(0x206)][_0x32977a(0x1dd)]()||undefined;}const _0x193429=getConsoleUrl(_0xd81468);console[_0x32977a(0x235)](_0x32977a(0x228));_0x1e4455?console['log']('\x20\x20'+_0x193429+_0x32977a(0x1ea)+_0x1e4455+')'):console[_0x32977a(0x235)]('\x20\x20'+_0x193429+_0x32977a(0x21d));console[_0x32977a(0x235)](_0x32977a(0x1dc));const _0x4d1e1c=await startOAuthFlow(_0xd81468,{'accountName':_0x1e4455});console[_0x32977a(0x235)](_0x32977a(0x1e2));const _0x4e5016=TDX[_0x32977a(0x234)]({'site':_0xd81468,'accessToken':_0x4d1e1c['access_token'],'logLevel':_0x364e50??LogLevel[_0x32977a(0x1ef)]}),_0x46dec8=await _0x4e5016[_0x32977a(0x1d9)][_0x32977a(0x20d)]();console[_0x32977a(0x235)](a7_0x45b8a8['green']('✓\x20Signed\x20in\x20successfully')),console[_0x32977a(0x235)]('\x20\x20'+a7_0x45b8a8[_0x32977a(0x1db)](_0xd81468+':'+_0x46dec8['account_id'])+_0x32977a(0x225)+_0x46dec8['id']+'\x20\x20('+_0x46dec8[_0x32977a(0x1d7)]+')');!_0x1e4455&&(console[_0x32977a(0x235)](a7_0x45b8a8[_0x32977a(0x21c)](_0x32977a(0x1e9))),console[_0x32977a(0x235)](a7_0x45b8a8[_0x32977a(0x21c)](_0x32977a(0x22c))),console[_0x32977a(0x235)](a7_0x45b8a8['dim'](_0x32977a(0x215))));await saveOAuthTokens(_0x4d1e1c,_0x17e9dc),console[_0x32977a(0x235)](_0x32977a(0x213)+(_0x17e9dc?_0x32977a(0x1fe)+_0x17e9dc+')':''));if(_0x17e9dc){const _0x22be56={'site':_0xd81468};saveProfileToUserConfig(_0x17e9dc,_0x22be56),console['log'](_0x32977a(0x209)+_0x17e9dc+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0xd81468),console[_0x32977a(0x235)]('✓\x20Default\x20site\x20set\x20to\x20'+_0xd81468);const _0x5a7f75=_0x17e9dc?_0x32977a(0x1f3)+_0x17e9dc:'';console[_0x32977a(0x235)](),console[_0x32977a(0x235)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x32977a(0x235)]('\x20\x20tdx'+_0x5a7f75+_0x32977a(0x212)),console['log'](_0x32977a(0x1f2)+_0x5a7f75+_0x32977a(0x216));}export async function promptAuthMethod(){const _0x335823=a7_0x5eaf,_0x4bd36b=await a7_0xe83ced({'type':_0x335823(0x1e4),'name':'method','message':_0x335823(0x1eb),'choices':[{'title':'Sign\x20in\x20with\x20browser\x20(recommended)','description':_0x335823(0x1f4),'value':_0x335823(0x208)},{'title':_0x335823(0x1f8),'description':'For\x20scripts\x20or\x20headless\x20servers','value':'apikey'}]});return _0x4bd36b[_0x335823(0x224)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x1fe559(0x1e3)]='auth:setup';[a7_0x1fe559(0x1e1)]=a7_0x1fe559(0x200);async[a7_0x1fe559(0x1f9)](_0x1cf9f1){const _0x265d29=a7_0x1fe559,{options:_0x547564}=_0x1cf9f1,_0x196bd1=_0x547564[_0x265d29(0x1fc)];console[_0x265d29(0x235)](a7_0x45b8a8['bold']('tdx:\x20auth\x20setup'));const _0x370007=_0x547564[_0x265d29(0x1d3)]||'us01',_0x1155c9=await promptSiteSelection(_0x370007,_0x196bd1,_0x265d29(0x1fa));if(!_0x1155c9)return 0x1;const _0x280010=resolveSite(_0x1155c9),_0x2f15f6=await promptAuthMethod();if(!_0x2f15f6)return console[_0x265d29(0x235)](_0x265d29(0x1f5)),0x1;if(_0x2f15f6===_0x265d29(0x208)){const {accountName:_0x587e1b}=_0x547564;return await runOAuthLoginFlow(_0x280010,_0x196bd1,_0x547564[_0x265d29(0x1fd)]??LogLevel[_0x265d29(0x1ef)],{'accountName':_0x587e1b}),0x0;}console[_0x265d29(0x235)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x280010),console[_0x265d29(0x235)](_0x265d29(0x231)),console[_0x265d29(0x235)]('\x20\x20'+getConsoleUrl(_0x280010,_0x265d29(0x1ff)));const _0x724339=await a7_0xe83ced({'type':'password','name':'apiKey','message':_0x265d29(0x21b),'validate':_0x4d747a=>{const _0x6dacf5=_0x265d29;if(!_0x4d747a||!_0x4d747a[_0x6dacf5(0x1dd)]())return _0x6dacf5(0x233);return!![];}});if(!_0x724339[_0x265d29(0x1da)])return console['log'](_0x265d29(0x1f5)),0x1;const _0x3aa54e=_0x724339[_0x265d29(0x1da)];console[_0x265d29(0x235)](_0x265d29(0x1f6));try{const _0x47984e=TDX[_0x265d29(0x234)]({'site':_0x280010,'apiKey':_0x3aa54e[_0x265d29(0x1dd)](),'logLevel':_0x547564[_0x265d29(0x1fd)]??LogLevel[_0x265d29(0x1ef)]}),_0x1f824e=await _0x47984e[_0x265d29(0x1d9)][_0x265d29(0x20d)]();console['log'](_0x265d29(0x1ed)+_0x1f824e[_0x265d29(0x1d7)]+')');const _0x5048c4=await isKeychainAvailable();_0x5048c4?(await saveAPIKeyAsync(_0x3aa54e[_0x265d29(0x1dd)](),_0x280010,_0x196bd1),console['log'](_0x265d29(0x1f7)+(_0x196bd1?_0x265d29(0x1fe)+_0x196bd1+')':''))):(console['warn'](a7_0x45b8a8['yellow'](_0x265d29(0x1ec))),console['warn'](a7_0x45b8a8[_0x265d29(0x202)](_0x265d29(0x1d4))));if(_0x196bd1){const _0x15776a={'site':_0x280010};saveProfileToUserConfig(_0x196bd1,_0x15776a),console['log'](_0x265d29(0x209)+_0x196bd1+_0x265d29(0x1f0));}else saveDefaultSiteToUserConfig(_0x280010),console[_0x265d29(0x235)](_0x265d29(0x1d5)+_0x280010);const _0x350f75=_0x196bd1?_0x265d29(0x1f3)+_0x196bd1:'';return console[_0x265d29(0x235)](),console[_0x265d29(0x235)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x265d29(0x235)](_0x265d29(0x1f2)+_0x350f75+_0x265d29(0x212)),console['log']('\x20\x20tdx'+_0x350f75+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x1ce938){if(_0x1ce938 instanceof HTTPClientError&&_0x1ce938['status']===0x191)return printAuthError(_0x1ce938),0x1;return console[_0x265d29(0x205)](a7_0x45b8a8[_0x265d29(0x21a)](_0x265d29(0x20a)+(_0x1ce938 instanceof Error?_0x1ce938[_0x265d29(0x227)]:String(_0x1ce938)))),console[_0x265d29(0x205)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x1fe559(0x1d8);[a7_0x1fe559(0x1e1)]=a7_0x1fe559(0x20e);async[a7_0x1fe559(0x1f9)](_0x2e4730){const _0x559ef6=a7_0x1fe559,{options:_0x159fb3,tdx:_0x3e9bfc}=_0x2e4730,_0x1d2990=_0x159fb3['site'],_0x21530f=_0x159fb3[_0x559ef6(0x1fc)],_0x2c0068=_0x21530f?_0x21530f:_0x559ef6(0x1d2);console['log'](_0x559ef6(0x1e8)+_0x2c0068+_0x559ef6(0x20c)+_0x1d2990+')');const _0x2f277b=await getOAuthTokens(_0x21530f);if(_0x2f277b)console['log']('Credential\x20type:\x20OAuth'),console[_0x559ef6(0x235)](_0x559ef6(0x229)+(_0x21530f?_0x559ef6(0x1fe)+_0x21530f+')':''));else{const _0x1710b9=await resolveAPIKeyAsync(_0x1d2990,_0x21530f);if(_0x1710b9){const {source:_0x4e6612,isDeprecated:_0x2fb757}=_0x1710b9,_0x222d95=_0x559ef6(0x1f1)+_0x4e6612;console['log'](_0x2fb757?a7_0x45b8a8[_0x559ef6(0x202)](_0x222d95):_0x222d95);}else console['log'](a7_0x45b8a8[_0x559ef6(0x202)](_0x559ef6(0x22a)));}try{const _0x3f7c35=await _0x3e9bfc[_0x559ef6(0x1d9)][_0x559ef6(0x20d)]();return console[_0x559ef6(0x235)](a7_0x45b8a8[_0x559ef6(0x22f)](_0x559ef6(0x22d))),console[_0x559ef6(0x235)](_0x559ef6(0x220)+_0x3f7c35['email']),(_0x3f7c35[_0x559ef6(0x22b)]||_0x3f7c35['last_name'])&&console[_0x559ef6(0x235)]('Name:\x20'+[_0x3f7c35['first_name'],_0x3f7c35[_0x559ef6(0x22e)]]['filter'](Boolean)[_0x559ef6(0x1e6)]('\x20')),0x0;}catch(_0x1cf8e5){return _0x1cf8e5 instanceof HTTPClientError&&_0x1cf8e5[_0x559ef6(0x1fb)]===0x191?printAuthError(_0x1cf8e5,!![],_0x21530f):console[_0x559ef6(0x205)](a7_0x45b8a8[_0x559ef6(0x21a)](_0x559ef6(0x20a)+(_0x1cf8e5 instanceof Error?_0x1cf8e5['message']:String(_0x1cf8e5)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x1fe559(0x1e3)]=a7_0x1fe559(0x1e7);[a7_0x1fe559(0x1e1)]=a7_0x1fe559(0x1de);async[a7_0x1fe559(0x1f9)](_0x50e55f){const _0xe9fac5=a7_0x1fe559,{options:_0x5da036}=_0x50e55f,_0x4f4136=_0x5da036[_0xe9fac5(0x1fc)];console[_0xe9fac5(0x235)](a7_0x45b8a8[_0xe9fac5(0x203)]('tdx:\x20auth\x20clear'));const _0x338fd5=await isKeychainAvailable();if(!_0x338fd5)return console['error'](a7_0x45b8a8[_0xe9fac5(0x21a)](_0xe9fac5(0x211))),0x1;const [_0x4fb2f8,_0x399d3e]=await Promise[_0xe9fac5(0x21e)]([deleteKeychainAPIKey(_0x4f4136),deleteOAuthTokens(_0x4f4136)]);if(_0x4fb2f8||_0x399d3e){clearCredentialCache();const _0x228391=[_0x4fb2f8&&_0xe9fac5(0x210),_0x399d3e&&_0xe9fac5(0x218)][_0xe9fac5(0x201)](Boolean)[_0xe9fac5(0x1e6)](_0xe9fac5(0x204));return console[_0xe9fac5(0x235)]('✓\x20'+_0x228391+_0xe9fac5(0x214)+(_0x4f4136?_0xe9fac5(0x1fe)+_0x4f4136+')':'')),0x0;}else return console[_0xe9fac5(0x235)]('No\x20credentials\x20found\x20in\x20keychain'+(_0x4f4136?_0xe9fac5(0x230)+_0x4f4136:'')),0x1;}}function a7_0x5a13(){const _0x4e7def=['auth:clear','tdx\x20profile:\x20','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','/users/initiate_sso\x20(account:\x20','Choose\x20how\x20to\x20sign\x20in:','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','14CIoQYd','ERROR','\x27\x20registered','Read\x20credential\x20from\x20','\x20\x20tdx','\x20--profile\x20','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','\x0aSetup\x20cancelled','Validating\x20API\x20key...','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','Use\x20an\x20API\x20key','execute','Setup\x20cancelled','status','profile','logLevel','\x20(profile:\x20','/app/mp/ak','Setup\x20API\x20key\x20authentication\x20interactively','filter','yellow','bold','\x20and\x20','error','accountName','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','oauth','✓\x20Profile\x20\x27','✗\x20Validation\x20failed:\x20','108cTwCJR','\x20(site:\x20','getUserInfo','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','14395wsZrXw','API\x20key','System\x20keychain\x20is\x20not\x20available','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','\x20removed\x20from\x20keychain','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','143obfxFm','OAuth\x20tokens','380256abjdrf','red','Enter\x20your\x20TD\x20API\x20key:','dim','/oauth/authorize','all','2BEfrxA','User:\x20','2900943CpIEiY','358864hoSEmg','1170035lnABUw','method','\x20\x20user_id:','48QJSsTK','message','Opening\x20browser\x20for\x20authentication...','Read\x20credential\x20from\x20keychain','No\x20credential\x20found','first_name','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','✓\x20Authentication\x20successful\x0a','last_name','green','\x20for\x20profile:\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','text','API\x20key\x20cannot\x20be\x20empty','create','log','N/A','site','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','✓\x20Default\x20site\x20set\x20to\x20','435281dJbGKj','email','auth','jobs','apiKey','cyan','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','trim','Remove\x20API\x20key\x20from\x20system\x20keychain','6242834QKvByd','30wwDmyb','description','Validating\x20OAuth\x20tokens...','name','select','39gMhZfQ','join'];a7_0x5a13=function(){return _0x4e7def;};return a7_0x5a13();}
1
+ const a7_0x9826d2=a7_0xaf05;(function(_0x406538,_0x35e11d){const _0x4dc29e=a7_0xaf05,_0x5b8b75=_0x406538();while(!![]){try{const _0x2c5d1a=parseInt(_0x4dc29e(0x135))/0x1*(-parseInt(_0x4dc29e(0x128))/0x2)+-parseInt(_0x4dc29e(0x140))/0x3+-parseInt(_0x4dc29e(0x132))/0x4*(parseInt(_0x4dc29e(0x142))/0x5)+parseInt(_0x4dc29e(0x13a))/0x6*(-parseInt(_0x4dc29e(0x12f))/0x7)+-parseInt(_0x4dc29e(0x100))/0x8*(-parseInt(_0x4dc29e(0x136))/0x9)+-parseInt(_0x4dc29e(0x14d))/0xa*(-parseInt(_0x4dc29e(0x13b))/0xb)+parseInt(_0x4dc29e(0x111))/0xc;if(_0x2c5d1a===_0x35e11d)break;else _0x5b8b75['push'](_0x5b8b75['shift']());}catch(_0x4de3f0){_0x5b8b75['push'](_0x5b8b75['shift']());}}}(a7_0x1b16,0xec010));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';function a7_0xaf05(_0x396bbb,_0x16ff19){_0x396bbb=_0x396bbb-0xee;const _0x1b16d7=a7_0x1b16();let _0xaf05d4=_0x1b16d7[_0x396bbb];return _0xaf05d4;}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_0x27dfa6 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';function a7_0x1b16(){const _0x5749d2=['/app/mp/ak','4150806qlhSyW','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','8093710tfjDOg','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Setup\x20API\x20key\x20authentication\x20interactively','OAuth\x20tokens','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','apiKey','apikey','User:\x20','name','\x20--profile\x20','status','850NtRFGf','site','\x20(site:\x20','access_token','yellow','join','filter','No\x20credentials\x20found\x20in\x20keychain','\x27\x20registered','all','API\x20key','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','API\x20key\x20cannot\x20be\x20empty','description','Read\x20credential\x20from\x20keychain','text','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','logLevel','System\x20keychain\x20is\x20not\x20available','\x20\x20user_id:','\x20and\x20','✗\x20Validation\x20failed:\x20','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','getUserInfo','Validating\x20OAuth\x20tokens...','error','ERROR','trim','Name:\x20','N/A','34912BecJPs','\x0aSetup\x20cancelled','execute','\x20\x20tdx','\x20(profile:\x20','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','jobs','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','Setup\x20cancelled','\x20\x20(','create','tdx\x20profile:\x20','message','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','oauth','warn','last_name','58258752JQPPeR','Use\x20an\x20API\x20key','✓\x20Profile\x20\x27','accountName','email','/users/initiate_sso\x20(account:\x20','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','/oauth/authorize','No\x20credential\x20found','✓\x20Default\x20site\x20set\x20to\x20','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','bold','us01','Read\x20credential\x20from\x20','method','Choose\x20how\x20to\x20sign\x20in:','auth:clear','profile','\x20removed\x20from\x20keychain','log','Remove\x20API\x20key\x20from\x20system\x20keychain','password','2uYFcDX','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','✓\x20Authentication\x20successful\x0a','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','dim','✓\x20Signed\x20in\x20successfully','tdx:\x20auth\x20clear','29659nNozZk','red','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','4ZCuPQQ','cyan','green','1074572kyBjBa','2007bZTPHS','For\x20scripts\x20or\x20headless\x20servers','\x20for\x20profile:\x20','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','1170yQVdgg','5401bgLMEf','You\x20can\x20find\x20your\x20API\x20key\x20at:','Credential\x20type:\x20OAuth','tdx:\x20auth\x20setup'];a7_0x1b16=function(){return _0x5749d2;};return a7_0x1b16();}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x1e2464 from'chalk';export async function runOAuthLoginFlow(_0x531c12,_0x1852a0,_0x1e061e,_0x344bb2){const _0x3bd0b5=a7_0xaf05,_0x1d9ed0=await isKeychainAvailable();if(!_0x1d9ed0)throw new Error(_0x3bd0b5(0xf1)+_0x3bd0b5(0xf8));let _0x282fc5=_0x344bb2?.[_0x3bd0b5(0x114)];if(!_0x282fc5){const _0x4d9a39=await a7_0x27dfa6({'type':_0x3bd0b5(0xf0),'name':'accountName','message':_0x3bd0b5(0x158)});if(_0x4d9a39[_0x3bd0b5(0x114)]===undefined)throw new Error(_0x3bd0b5(0x108));_0x282fc5=_0x4d9a39[_0x3bd0b5(0x114)][_0x3bd0b5(0xfd)]()||undefined;}const _0x147c16=getConsoleUrl(_0x531c12);console[_0x3bd0b5(0x125)]('Opening\x20browser\x20for\x20authentication...');_0x282fc5?console['log']('\x20\x20'+_0x147c16+_0x3bd0b5(0x116)+_0x282fc5+')'):console[_0x3bd0b5(0x125)]('\x20\x20'+_0x147c16+_0x3bd0b5(0x119));console['log'](_0x3bd0b5(0x118));const _0x381ff6=await startOAuthFlow(_0x531c12,{'accountName':_0x282fc5});console['log'](_0x3bd0b5(0xfa));const _0x35056f=TDX[_0x3bd0b5(0x10a)]({'site':_0x531c12,'accessToken':_0x381ff6[_0x3bd0b5(0x150)],'logLevel':_0x1e061e??LogLevel[_0x3bd0b5(0xfc)]}),_0x5bf4e0=await _0x35056f['jobs']['getUserInfo']();console[_0x3bd0b5(0x125)](a7_0x1e2464[_0x3bd0b5(0x134)](_0x3bd0b5(0x12d))),console[_0x3bd0b5(0x125)]('\x20\x20'+a7_0x1e2464[_0x3bd0b5(0x133)](_0x531c12+':'+_0x5bf4e0['account_id'])+_0x3bd0b5(0xf5)+_0x5bf4e0['id']+_0x3bd0b5(0x109)+_0x5bf4e0['email']+')');!_0x282fc5&&(console['log'](a7_0x1e2464[_0x3bd0b5(0x12c)](_0x3bd0b5(0x117))),console[_0x3bd0b5(0x125)](a7_0x1e2464['dim'](_0x3bd0b5(0x107))),console[_0x3bd0b5(0x125)](a7_0x1e2464[_0x3bd0b5(0x12c)](_0x3bd0b5(0x11c))));await saveOAuthTokens(_0x381ff6,_0x1852a0),console[_0x3bd0b5(0x125)](_0x3bd0b5(0x12b)+(_0x1852a0?'\x20(profile:\x20'+_0x1852a0+')':''));if(_0x1852a0){const _0x4de11d={'site':_0x531c12};saveProfileToUserConfig(_0x1852a0,_0x4de11d),console['log']('✓\x20Profile\x20\x27'+_0x1852a0+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x531c12),console[_0x3bd0b5(0x125)](_0x3bd0b5(0x11b)+_0x531c12);const _0x5b1665=_0x1852a0?_0x3bd0b5(0x14b)+_0x1852a0:'';console[_0x3bd0b5(0x125)](),console[_0x3bd0b5(0x125)](_0x3bd0b5(0x131)),console[_0x3bd0b5(0x125)](_0x3bd0b5(0x103)+_0x5b1665+_0x3bd0b5(0x10d)),console[_0x3bd0b5(0x125)](_0x3bd0b5(0x103)+_0x5b1665+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export async function promptAuthMethod(){const _0x102066=a7_0xaf05,_0x53f816=await a7_0x27dfa6({'type':'select','name':_0x102066(0x120),'message':_0x102066(0x121),'choices':[{'title':'Sign\x20in\x20with\x20browser\x20(recommended)','description':_0x102066(0x139),'value':_0x102066(0x10e)},{'title':_0x102066(0x112),'description':_0x102066(0x137),'value':_0x102066(0x148)}]});return _0x53f816[_0x102066(0x120)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x9826d2(0x14a)]='auth:setup';[a7_0x9826d2(0xee)]=a7_0x9826d2(0x144);async[a7_0x9826d2(0x102)](_0x13c449){const _0x5d553b=a7_0x9826d2,{options:_0x2f4c3d}=_0x13c449,_0x32c8aa=_0x2f4c3d[_0x5d553b(0x123)];console[_0x5d553b(0x125)](a7_0x1e2464[_0x5d553b(0x11d)](_0x5d553b(0x13e)));const _0x50d066=_0x2f4c3d[_0x5d553b(0x14e)]||_0x5d553b(0x11e),_0x14c689=await promptSiteSelection(_0x50d066,_0x32c8aa,'Setup\x20cancelled');if(!_0x14c689)return 0x1;const _0x4f66f5=resolveSite(_0x14c689),_0x1c30e9=await promptAuthMethod();if(!_0x1c30e9)return console['log'](_0x5d553b(0x101)),0x1;if(_0x1c30e9===_0x5d553b(0x10e)){const {accountName:_0x58cb7c}=_0x2f4c3d;return await runOAuthLoginFlow(_0x4f66f5,_0x32c8aa,_0x2f4c3d[_0x5d553b(0xf3)]??LogLevel[_0x5d553b(0xfc)],{'accountName':_0x58cb7c}),0x0;}console[_0x5d553b(0x125)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x4f66f5),console['log'](_0x5d553b(0x13c)),console[_0x5d553b(0x125)]('\x20\x20'+getConsoleUrl(_0x4f66f5,_0x5d553b(0x13f)));const _0xa466b8=await a7_0x27dfa6({'type':_0x5d553b(0x127),'name':_0x5d553b(0x147),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x508e7c=>{const _0x431e4b=_0x5d553b;if(!_0x508e7c||!_0x508e7c[_0x431e4b(0xfd)]())return _0x431e4b(0x159);return!![];}});if(!_0xa466b8['apiKey'])return console[_0x5d553b(0x125)](_0x5d553b(0x101)),0x1;const _0xc06b73=_0xa466b8[_0x5d553b(0x147)];console['log']('Validating\x20API\x20key...');try{const _0xd412c1=TDX['create']({'site':_0x4f66f5,'apiKey':_0xc06b73[_0x5d553b(0xfd)](),'logLevel':_0x2f4c3d[_0x5d553b(0xf3)]??LogLevel[_0x5d553b(0xfc)]}),_0x222726=await _0xd412c1[_0x5d553b(0x106)][_0x5d553b(0xf9)]();console[_0x5d553b(0x125)](_0x5d553b(0x146)+_0x222726['email']+')');const _0x230863=await isKeychainAvailable();_0x230863?(await saveAPIKeyAsync(_0xc06b73[_0x5d553b(0xfd)](),_0x4f66f5,_0x32c8aa),console[_0x5d553b(0x125)](_0x5d553b(0x129)+(_0x32c8aa?_0x5d553b(0x104)+_0x32c8aa+')':''))):(console['warn'](a7_0x1e2464[_0x5d553b(0x151)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x5d553b(0x10f)](a7_0x1e2464['yellow'](_0x5d553b(0x105))));if(_0x32c8aa){const _0x1db964={'site':_0x4f66f5};saveProfileToUserConfig(_0x32c8aa,_0x1db964),console[_0x5d553b(0x125)](_0x5d553b(0x113)+_0x32c8aa+_0x5d553b(0x155));}else saveDefaultSiteToUserConfig(_0x4f66f5),console[_0x5d553b(0x125)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x4f66f5);const _0x4d0257=_0x32c8aa?_0x5d553b(0x14b)+_0x32c8aa:'';return console[_0x5d553b(0x125)](),console[_0x5d553b(0x125)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log'](_0x5d553b(0x103)+_0x4d0257+_0x5d553b(0x10d)),console['log'](_0x5d553b(0x103)+_0x4d0257+_0x5d553b(0x141)),0x0;}catch(_0x2ce8e6){if(_0x2ce8e6 instanceof HTTPClientError&&_0x2ce8e6[_0x5d553b(0x14c)]===0x191)return printAuthError(_0x2ce8e6),0x1;return console[_0x5d553b(0xfb)](a7_0x1e2464[_0x5d553b(0x130)](_0x5d553b(0xf7)+(_0x2ce8e6 instanceof Error?_0x2ce8e6[_0x5d553b(0x10c)]:String(_0x2ce8e6)))),console[_0x5d553b(0xfb)](_0x5d553b(0x143)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x9826d2(0x14a)]='auth';[a7_0x9826d2(0xee)]=a7_0x9826d2(0xf2);async['execute'](_0x4385ed){const _0x3c731b=a7_0x9826d2,{options:_0x4c8cfc,tdx:_0x564f59}=_0x4385ed,_0x1ff131=_0x4c8cfc[_0x3c731b(0x14e)],_0x43a545=_0x4c8cfc[_0x3c731b(0x123)],_0x45b011=_0x43a545?_0x43a545:_0x3c731b(0xff);console[_0x3c731b(0x125)](_0x3c731b(0x10b)+_0x45b011+_0x3c731b(0x14f)+_0x1ff131+')');const _0x703eb0=await getOAuthTokens(_0x43a545);if(_0x703eb0)console[_0x3c731b(0x125)](_0x3c731b(0x13d)),console[_0x3c731b(0x125)](_0x3c731b(0xef)+(_0x43a545?'\x20(profile:\x20'+_0x43a545+')':''));else{const _0x2493f7=await resolveAPIKeyAsync(_0x1ff131,_0x43a545);if(_0x2493f7){const {source:_0x28ab6e,isDeprecated:_0x3425b3}=_0x2493f7,_0x59659d=_0x3c731b(0x11f)+_0x28ab6e;console[_0x3c731b(0x125)](_0x3425b3?a7_0x1e2464[_0x3c731b(0x151)](_0x59659d):_0x59659d);}else console[_0x3c731b(0x125)](a7_0x1e2464['yellow'](_0x3c731b(0x11a)));}try{const _0x389873=await _0x564f59[_0x3c731b(0x106)][_0x3c731b(0xf9)]();return console[_0x3c731b(0x125)](a7_0x1e2464[_0x3c731b(0x134)](_0x3c731b(0x12a))),console[_0x3c731b(0x125)](_0x3c731b(0x149)+_0x389873[_0x3c731b(0x115)]),(_0x389873['first_name']||_0x389873[_0x3c731b(0x110)])&&console['log'](_0x3c731b(0xfe)+[_0x389873['first_name'],_0x389873[_0x3c731b(0x110)]][_0x3c731b(0x153)](Boolean)['join']('\x20')),0x0;}catch(_0x5b834b){return _0x5b834b instanceof HTTPClientError&&_0x5b834b[_0x3c731b(0x14c)]===0x191?printAuthError(_0x5b834b,!![],_0x43a545):console[_0x3c731b(0xfb)](a7_0x1e2464[_0x3c731b(0x130)](_0x3c731b(0xf7)+(_0x5b834b instanceof Error?_0x5b834b['message']:String(_0x5b834b)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x9826d2(0x122);[a7_0x9826d2(0xee)]=a7_0x9826d2(0x126);async[a7_0x9826d2(0x102)](_0xaa94e8){const _0x110afa=a7_0x9826d2,{options:_0x515380}=_0xaa94e8,_0x19865b=_0x515380['profile'];console[_0x110afa(0x125)](a7_0x1e2464[_0x110afa(0x11d)](_0x110afa(0x12e)));const _0x56b2d7=await isKeychainAvailable();if(!_0x56b2d7)return console[_0x110afa(0xfb)](a7_0x1e2464[_0x110afa(0x130)](_0x110afa(0xf4))),0x1;const [_0x2983ef,_0x48c116]=await Promise[_0x110afa(0x156)]([deleteKeychainAPIKey(_0x19865b),deleteOAuthTokens(_0x19865b)]);if(_0x2983ef||_0x48c116){clearCredentialCache();const _0x33a50e=[_0x2983ef&&_0x110afa(0x157),_0x48c116&&_0x110afa(0x145)][_0x110afa(0x153)](Boolean)[_0x110afa(0x152)](_0x110afa(0xf6));return console['log']('✓\x20'+_0x33a50e+_0x110afa(0x124)+(_0x19865b?'\x20(profile:\x20'+_0x19865b+')':'')),0x0;}else return console['log'](_0x110afa(0x154)+(_0x19865b?_0x110afa(0x138)+_0x19865b:'')),0x1;}}