@treasuredata/tdx 2026.4.5 → 2026.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) 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.d.ts +3 -0
  168. package/dist/sdk/types/workspace.d.ts.map +1 -1
  169. package/dist/sdk/types/workspace.js +1 -1
  170. package/dist/sdk/types/workspace.js.map +1 -1
  171. package/dist/sdk/user.js +1 -1
  172. package/dist/sdk/util/format-detector.js +1 -1
  173. package/dist/sdk/util/formatters.js +1 -1
  174. package/dist/sdk/util/index.js +1 -1
  175. package/dist/sdk/util/paginate.js +1 -1
  176. package/dist/sdk/util/tree-formatter.js +1 -1
  177. package/dist/sdk/workflow/archive-validation.js +1 -1
  178. package/dist/sdk/workflow/clone-workflow.js +1 -1
  179. package/dist/sdk/workflow/index.js +1 -1
  180. package/dist/sdk/workflow/pull-workflow.js +1 -1
  181. package/dist/sdk/workflow/push-workflow.js +1 -1
  182. package/dist/sdk/workflow/tdx-config.js +1 -1
  183. package/dist/sdk/workflow/workflow-utils.js +1 -1
  184. package/dist/sdk/workspace/access-tracker.d.ts.map +1 -1
  185. package/dist/sdk/workspace/access-tracker.js +1 -1
  186. package/dist/sdk/workspace/access-tracker.js.map +1 -1
  187. package/dist/sdk/workspace/frontmatter.js +1 -1
  188. package/dist/sdk/workspace/git.js +1 -1
  189. package/dist/sdk/workspace/index.d.ts +1 -1
  190. package/dist/sdk/workspace/index.d.ts.map +1 -1
  191. package/dist/sdk/workspace/index.js +1 -1
  192. package/dist/sdk/workspace/index.js.map +1 -1
  193. package/dist/sdk/workspace/templates.js +1 -1
  194. package/dist/sdk/workspace/weekly.js +1 -1
  195. package/dist/sdk/workspace/wikilinks.d.ts +2 -0
  196. package/dist/sdk/workspace/wikilinks.d.ts.map +1 -1
  197. package/dist/sdk/workspace/wikilinks.js +1 -1
  198. package/dist/sdk/workspace/wikilinks.js.map +1 -1
  199. package/dist/test-utils/command-runner.js +1 -1
  200. package/dist/test-utils/factories.js +1 -1
  201. package/dist/test-utils/fixtures.js +1 -1
  202. package/dist/test-utils/http-mock.js +1 -1
  203. package/dist/test-utils/index.js +1 -1
  204. package/dist/utils/async.js +1 -1
  205. package/dist/utils/colors.js +1 -1
  206. package/dist/utils/diff.js +1 -1
  207. package/dist/utils/file-permissions.js +1 -1
  208. package/dist/utils/file-reader.js +1 -1
  209. package/dist/utils/github-releases.js +1 -1
  210. package/dist/utils/global-cache.js +1 -1
  211. package/dist/utils/json-loader.js +1 -1
  212. package/dist/utils/local-cache.js +1 -1
  213. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  214. package/dist/utils/logger/formatters/index.js +1 -1
  215. package/dist/utils/logger/handlers/console-handler.js +1 -1
  216. package/dist/utils/logger/handlers/file-handler.js +1 -1
  217. package/dist/utils/logger/handlers/index.js +1 -1
  218. package/dist/utils/logger/handlers/null-handler.js +1 -1
  219. package/dist/utils/logger/index.js +1 -1
  220. package/dist/utils/logger/logger.js +1 -1
  221. package/dist/utils/logger/types.js +1 -1
  222. package/dist/utils/option-validation.js +1 -1
  223. package/dist/utils/process.js +1 -1
  224. package/dist/utils/prompt.js +1 -1
  225. package/dist/utils/spinner.js +1 -1
  226. package/dist/utils/sse-parser.js +1 -1
  227. package/dist/utils/string-utils.js +1 -1
  228. package/dist/utils/table-ref-parser.js +1 -1
  229. package/dist/utils/tdx-logger.js +1 -1
  230. package/dist/utils/version-check.js +1 -1
  231. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x137b1b=a3_0x3817;function a3_0x28ff(){const _0x1cce3c=['Site:\x20','✔\x20Found\x20','resolveParentId','segment','\x20\x20Cause:\x20','Resolved\x20child\x20ID:\x20','10201275GHfcVp','8145ubCikf','6QlvIfN','5312UnCMxI','resolveSegmentId','message','Resolving\x20child\x20segment\x20\x27','length','5678888yZamOo','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Parent\x20name:\x20','\x20activation','Error:\x20','execute','\x27...','Error:\x20Segment\x20name\x20is\x20required','5052640fufeAg','Resolved\x20parent\x20ID:\x20','site','error','name','description','7290770ouwwVH','verbose','3WDnotV','data','List\x20activations\x20for\x20a\x20segment','663401wWAbGu','2236812gchVpm'];a3_0x28ff=function(){return _0x1cce3c;};return a3_0x28ff();}(function(_0x4708b0,_0x281d54){const _0x42580c=a3_0x3817,_0x4e0c05=_0x4708b0();while(!![]){try{const _0x2c6666=-parseInt(_0x42580c(0x19e))/0x1+parseInt(_0x42580c(0x17c))/0x2*(-parseInt(_0x42580c(0x19b))/0x3)+parseInt(_0x42580c(0x18b))/0x4+-parseInt(_0x42580c(0x199))/0x5*(parseInt(_0x42580c(0x185))/0x6)+parseInt(_0x42580c(0x183))/0x7+parseInt(_0x42580c(0x186))/0x8*(parseInt(_0x42580c(0x184))/0x9)+parseInt(_0x42580c(0x193))/0xa;if(_0x2c6666===_0x281d54)break;else _0x4e0c05['push'](_0x4e0c05['shift']());}catch(_0xa309f){_0x4e0c05['push'](_0x4e0c05['shift']());}}}(a3_0x28ff,0xb5766));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0x3817(_0x234edf,_0x2d57c9){_0x234edf=_0x234edf-0x17c;const _0x28ffec=a3_0x28ff();let _0x38177d=_0x28ffec[_0x234edf];return _0x38177d;}export class ActivationsCommand extends BaseCommand{[a3_0x137b1b(0x197)]='activations';[a3_0x137b1b(0x198)]=a3_0x137b1b(0x19d);async[a3_0x137b1b(0x190)](_0x3c5b1d){const _0x371456=a3_0x137b1b,{options:_0x98d4ed,args:_0x44da66,tdx:_0x48a66d}=_0x3c5b1d;if(_0x44da66[_0x371456(0x18a)]===0x0)return console[_0x371456(0x196)](_0x371456(0x192)),console[_0x371456(0x196)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x28bb5a,childId:_0x44a2a6}=parseSegmentRef(_0x44da66[0x0]);if(!_0x44a2a6)return console[_0x371456(0x196)]('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console['error'](_0x371456(0x18c)),0x1;_0x98d4ed[_0x371456(0x19a)]&&(console[_0x371456(0x196)](_0x371456(0x17d)+_0x98d4ed[_0x371456(0x195)]),console[_0x371456(0x196)](_0x371456(0x18d)+_0x28bb5a),console['error']('Child\x20name:\x20'+_0x44a2a6));const _0x4ce0f8=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x28bb5a+'\x27...',()=>_0x48a66d[_0x371456(0x180)][_0x371456(0x17f)](_0x28bb5a),{'verbose':_0x98d4ed[_0x371456(0x19a)]}),_0x478686=_0x4ce0f8[_0x371456(0x19c)];_0x98d4ed[_0x371456(0x19a)]&&console[_0x371456(0x196)](_0x371456(0x194)+_0x478686);const _0x56c0d0=await withSpinner(_0x371456(0x189)+_0x44a2a6+_0x371456(0x191),()=>_0x48a66d[_0x371456(0x180)][_0x371456(0x187)](_0x478686,_0x44a2a6),{'verbose':_0x98d4ed['verbose']}),_0x4e68e5=_0x56c0d0[_0x371456(0x19c)];_0x98d4ed[_0x371456(0x19a)]&&console[_0x371456(0x196)](_0x371456(0x182)+_0x4e68e5);const _0x50e983=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x44a2a6+'\x27...',()=>_0x48a66d['segment']['listActivations'](_0x478686,_0x4e68e5),{'verbose':_0x98d4ed['verbose']}),_0x248865=_0x50e983[_0x371456(0x19c)];return console[_0x371456(0x196)](_0x371456(0x17e)+_0x248865['length']+_0x371456(0x18e)+(_0x248865[_0x371456(0x18a)]!==0x1?'s':'')),await handleSDKOutput(_0x248865,_0x98d4ed),0x0;}catch(_0x24f200){if(_0x24f200 instanceof SDKError)return console[_0x371456(0x196)](_0x371456(0x18f)+_0x24f200[_0x371456(0x188)]),_0x24f200['cause']&&console[_0x371456(0x196)](_0x371456(0x181)+_0x24f200['cause']),0x1;throw _0x24f200;}}}
1
+ const a3_0x224367=a3_0x255f;(function(_0x1f6f47,_0x5654aa){const _0xe65be5=a3_0x255f,_0x544fcb=_0x1f6f47();while(!![]){try{const _0x5e440d=parseInt(_0xe65be5(0xe1))/0x1*(parseInt(_0xe65be5(0xc7))/0x2)+-parseInt(_0xe65be5(0xcd))/0x3+parseInt(_0xe65be5(0xc9))/0x4+parseInt(_0xe65be5(0xd5))/0x5+-parseInt(_0xe65be5(0xd2))/0x6+-parseInt(_0xe65be5(0xe0))/0x7*(parseInt(_0xe65be5(0xdc))/0x8)+parseInt(_0xe65be5(0xc6))/0x9;if(_0x5e440d===_0x5654aa)break;else _0x544fcb['push'](_0x544fcb['shift']());}catch(_0x54603e){_0x544fcb['push'](_0x544fcb['shift']());}}}(a3_0x40e6,0x9025c));function a3_0x40e6(){const _0x454801=['\x27...','activations','name','cause','segment','listActivations','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','7416666IBgXRi','1558uCNrzd','Error:\x20','2685920iWhcxU','Child\x20name:\x20','Site:\x20','error','3534672jOUOem','resolveParentId','length','Parent\x20name:\x20','Resolving\x20parent\x20segment\x20\x27','1889232AMxrKQ','✔\x20Found\x20','Error:\x20Segment\x20name\x20is\x20required','3622220UbcBUP','description','data','message','execute','Resolved\x20parent\x20ID:\x20','resolveSegmentId','7432mCnaSY','verbose','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','\x20\x20Cause:\x20','4333SMOkhH','563NGbILG','Listing\x20activations\x20for\x20segment\x20\x27'];a3_0x40e6=function(){return _0x454801;};return a3_0x40e6();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a3_0x255f(_0x29042e,_0x5b70a9){_0x29042e=_0x29042e-0xbe;const _0x40e651=a3_0x40e6();let _0x255f05=_0x40e651[_0x29042e];return _0x255f05;}import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x224367(0xc1)]=a3_0x224367(0xc0);[a3_0x224367(0xd6)]='List\x20activations\x20for\x20a\x20segment';async[a3_0x224367(0xd9)](_0x2499a5){const _0x30c54f=a3_0x224367,{options:_0x333345,args:_0x5c7776,tdx:_0x5e586d}=_0x2499a5;if(_0x5c7776[_0x30c54f(0xcf)]===0x0)return console['error'](_0x30c54f(0xd4)),console['error'](_0x30c54f(0xde)),0x1;try{const {parentId:_0x3c8a3b,childId:_0x182432}=parseSegmentRef(_0x5c7776[0x0]);if(!_0x182432)return console[_0x30c54f(0xcc)](_0x30c54f(0xc5)),console[_0x30c54f(0xcc)](_0x30c54f(0xde)),0x1;_0x333345[_0x30c54f(0xdd)]&&(console['error'](_0x30c54f(0xcb)+_0x333345['site']),console['error'](_0x30c54f(0xd0)+_0x3c8a3b),console['error'](_0x30c54f(0xca)+_0x182432));const _0x325909=await withSpinner(_0x30c54f(0xd1)+_0x3c8a3b+_0x30c54f(0xbf),()=>_0x5e586d['segment'][_0x30c54f(0xce)](_0x3c8a3b),{'verbose':_0x333345[_0x30c54f(0xdd)]}),_0x127540=_0x325909[_0x30c54f(0xd7)];_0x333345['verbose']&&console[_0x30c54f(0xcc)](_0x30c54f(0xda)+_0x127540);const _0x3a9c76=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x182432+_0x30c54f(0xbf),()=>_0x5e586d[_0x30c54f(0xc3)][_0x30c54f(0xdb)](_0x127540,_0x182432),{'verbose':_0x333345[_0x30c54f(0xdd)]}),_0x40cc61=_0x3a9c76[_0x30c54f(0xd7)];_0x333345[_0x30c54f(0xdd)]&&console[_0x30c54f(0xcc)]('Resolved\x20child\x20ID:\x20'+_0x40cc61);const _0x4d419f=await withSpinner(_0x30c54f(0xbe)+_0x182432+_0x30c54f(0xbf),()=>_0x5e586d['segment'][_0x30c54f(0xc4)](_0x127540,_0x40cc61),{'verbose':_0x333345['verbose']}),_0x4c7e54=_0x4d419f[_0x30c54f(0xd7)];return console[_0x30c54f(0xcc)](_0x30c54f(0xd3)+_0x4c7e54[_0x30c54f(0xcf)]+'\x20activation'+(_0x4c7e54[_0x30c54f(0xcf)]!==0x1?'s':'')),await handleSDKOutput(_0x4c7e54,_0x333345),0x0;}catch(_0x44e656){if(_0x44e656 instanceof SDKError)return console[_0x30c54f(0xcc)](_0x30c54f(0xc8)+_0x44e656[_0x30c54f(0xd8)]),_0x44e656['cause']&&console[_0x30c54f(0xcc)](_0x30c54f(0xdf)+_0x44e656[_0x30c54f(0xc2)]),0x1;throw _0x44e656;}}}
@@ -1 +1 @@
1
- const a4_0x1fa6a3=a4_0x33d7;(function(_0x182c36,_0x59df1e){const _0x3e51d0=a4_0x33d7,_0x193711=_0x182c36();while(!![]){try{const _0xc5375=-parseInt(_0x3e51d0(0xb5))/0x1+parseInt(_0x3e51d0(0xb3))/0x2+-parseInt(_0x3e51d0(0x14b))/0x3+-parseInt(_0x3e51d0(0x114))/0x4*(parseInt(_0x3e51d0(0x152))/0x5)+-parseInt(_0x3e51d0(0x133))/0x6+-parseInt(_0x3e51d0(0xbd))/0x7+-parseInt(_0x3e51d0(0x153))/0x8*(-parseInt(_0x3e51d0(0xf1))/0x9);if(_0xc5375===_0x59df1e)break;else _0x193711['push'](_0x193711['shift']());}catch(_0x3022c3){_0x193711['push'](_0x193711['shift']());}}}(a4_0x527c,0xbbb8d));import a4_0x9a357a from'chalk';import a4_0x1af64f 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(_0x2d12df){const _0x2e52f0=a4_0x33d7,_0x69dd3a=[];if(_0x2d12df[_0x2e52f0(0x10a)]!==undefined)_0x69dd3a['push'](_0x2d12df[_0x2e52f0(0x10a)]+_0x2e52f0(0xee));if(_0x2d12df[_0x2e52f0(0xaa)]!==undefined&&_0x2d12df[_0x2e52f0(0xaa)]>0x0)_0x69dd3a[_0x2e52f0(0x124)](a4_0x9a357a[_0x2e52f0(0xbe)](_0x2d12df['new']+_0x2e52f0(0x151)));if(_0x2d12df[_0x2e52f0(0x140)]!==undefined&&_0x2d12df['created']>0x0)_0x69dd3a[_0x2e52f0(0x124)](a4_0x9a357a[_0x2e52f0(0xbe)](_0x2d12df[_0x2e52f0(0x140)]+_0x2e52f0(0x130)));if(_0x2d12df[_0x2e52f0(0xd9)]!==undefined&&_0x2d12df[_0x2e52f0(0xd9)]>0x0)_0x69dd3a[_0x2e52f0(0x124)](a4_0x9a357a[_0x2e52f0(0x12c)](_0x2d12df[_0x2e52f0(0xd9)]+'\x20updated'));if(_0x2d12df[_0x2e52f0(0x13f)]!==undefined&&_0x2d12df[_0x2e52f0(0x13f)]>0x0)_0x69dd3a['push'](a4_0x9a357a[_0x2e52f0(0xb9)](_0x2d12df[_0x2e52f0(0x13f)]+_0x2e52f0(0x139)));if(_0x2d12df[_0x2e52f0(0xf0)]!==undefined&&_0x2d12df[_0x2e52f0(0xf0)]>0x0)_0x69dd3a['push'](a4_0x9a357a[_0x2e52f0(0xe8)](_0x2d12df[_0x2e52f0(0xf0)]+_0x2e52f0(0x150)));return _0x69dd3a[_0x2e52f0(0xdb)](',\x20');}function displayDiffs(_0x110430,_0x59bc04,_0xcf6ee5,_0x3def72,_0x38332e,_0x265219,_0x17c38f,_0x397195,_0x35b139){const _0x58af2b=a4_0x33d7;for(const _0x5a9c3d of _0x110430){if(_0x5a9c3d[_0x58af2b(0xfd)]){const _0x27da00=_0x5a9c3d['agentName']||_0x5a9c3d[_0x58af2b(0x154)];console[_0x58af2b(0x11e)](_0x58af2b(0xf7)+_0x27da00+'\x27:'),console['log']('─'[_0x58af2b(0x136)](0x3c)),console[_0x58af2b(0x11e)](_0x5a9c3d[_0x58af2b(0xfd)]),console[_0x58af2b(0x11e)]('─'[_0x58af2b(0x136)](0x3c));}}for(const _0x552e1a of _0x59bc04){_0x552e1a[_0x58af2b(0xfd)]&&(console[_0x58af2b(0x11e)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x552e1a[_0x58af2b(0x154)]+'\x27:'),console[_0x58af2b(0x11e)]('─'[_0x58af2b(0x136)](0x3c)),console[_0x58af2b(0x11e)](_0x552e1a['diff']),console[_0x58af2b(0x11e)]('─'[_0x58af2b(0x136)](0x3c)));}for(const _0x570c59 of _0xcf6ee5){_0x570c59['diff']&&(console['log']('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x570c59[_0x58af2b(0x154)]+'\x27:'),console[_0x58af2b(0x11e)]('─'['repeat'](0x3c)),console[_0x58af2b(0x11e)](_0x570c59['diff']),console[_0x58af2b(0x11e)]('─'[_0x58af2b(0x136)](0x3c)));}for(const _0x4037ac of _0x3def72){_0x4037ac['diff']&&(console['log'](_0x58af2b(0x12e)+_0x4037ac[_0x58af2b(0x154)]+'\x27:'),console[_0x58af2b(0x11e)]('─'[_0x58af2b(0x136)](0x3c)),console[_0x58af2b(0x11e)](_0x4037ac[_0x58af2b(0xfd)]),console['log']('─'['repeat'](0x3c)));}for(const _0x3d5538 of _0x38332e){_0x3d5538[_0x58af2b(0xfd)]&&(console[_0x58af2b(0x11e)](_0x58af2b(0xdc)+_0x3d5538['name']+'\x27:'),console[_0x58af2b(0x11e)]('─'[_0x58af2b(0x136)](0x3c)),console[_0x58af2b(0x11e)](_0x3d5538['diff']),console['log']('─'[_0x58af2b(0x136)](0x3c)));}for(const _0x40595a of _0x265219){_0x40595a['diff']&&(console['log']('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x40595a['name']+'\x27:'),console[_0x58af2b(0x11e)]('─'[_0x58af2b(0x136)](0x3c)),console[_0x58af2b(0x11e)](_0x40595a[_0x58af2b(0xfd)]),console[_0x58af2b(0x11e)]('─'[_0x58af2b(0x136)](0x3c)));}for(const _0x56d35c of _0x17c38f){_0x56d35c[_0x58af2b(0xfd)]&&(console[_0x58af2b(0x11e)](_0x58af2b(0x160)+_0x56d35c[_0x58af2b(0x154)]+'\x27:'),console['log']('─'[_0x58af2b(0x136)](0x3c)),console['log'](_0x56d35c[_0x58af2b(0xfd)]),console[_0x58af2b(0x11e)]('─'['repeat'](0x3c)));}for(const _0x2daeb1 of _0x397195){_0x2daeb1['diff']&&(console[_0x58af2b(0x11e)](_0x58af2b(0x168)+_0x2daeb1[_0x58af2b(0x154)]+'\x27:'),console[_0x58af2b(0x11e)]('─'[_0x58af2b(0x136)](0x3c)),console[_0x58af2b(0x11e)](_0x2daeb1[_0x58af2b(0xfd)]),console['log']('─'[_0x58af2b(0x136)](0x3c)));}for(const _0x531d06 of _0x35b139){_0x531d06['diff']&&(console[_0x58af2b(0x11e)](_0x58af2b(0x102)+_0x531d06[_0x58af2b(0x154)]+'\x27:'),console[_0x58af2b(0x11e)]('─'[_0x58af2b(0x136)](0x3c)),console[_0x58af2b(0x11e)](_0x531d06['diff']),console[_0x58af2b(0x11e)]('─'[_0x58af2b(0x136)](0x3c)));}}function a4_0x527c(){const _0x2ae0b9=['✔\x20Context\x20set:\x20','\x22...','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x20\x20Agent\x20\x22','updated','prompts','join','\x0aChanges\x20to\x20integration\x20\x27','arg-dir','\x20\x20Integration\x20\x22','\x20files\x20to\x20','\x20resources?','Writing\x20files...','agent','Would\x20pull\x20agent:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','pullProject','\x20\x20Source:\x20','\x20\x20Target:\x20','red','action','Using\x20project:\x20','Pushing\x20to\x20project...','dim','message','\x20total','\x20\x20Knowledge\x20Base\x20\x22','errors','9VrLyhk','\x0aPush\x20summary\x20for\x20\x27','\x0aChanges:','\x20\x20Form\x20Interfaces:\x20','dryRun','Output\x20path:\x20','\x0aChanges\x20to\x20agent\x20\x27','Would\x20clone:','\x22\x20from\x20project\x20\x22','\x0aError:','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Cancelled','diff','\x20resources\x20to\x20\x27','INVALID_ARGUMENT','\x22\x20to\x20a\x20different\x20profile','\x20\x20Prompts:\x20','\x0aChanges\x20to\x20chat\x20interface\x20\x27','\x22\x20to\x20new\x20project\x20\x22','knowledgeBases','\x0aErrors\x20found:','\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)','\x20changed','\x20\x20Knowledge\x20Bases:\x20','formInterfaces','total','Agent:\x20','outputDir','agentName','Using\x20local\x20project:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','no_context','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x20\x20Text\x20Knowledge\x20Base\x20\x22','textKnowledgeBases','16OmhCdY','Dry\x20run\x20-\x20no\x20files\x20written','cwd','sourceProjectName','source','Clone\x20\x22','Summary:','llmProject','\x20\x20Text\x20Knowledge\x20Bases:\x20','Pulling\x20agent\x20\x22','log','\x22:\x20','isNew','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20\x20Agents:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','push','<new-name>','\x20successfully','-\x20no\x20files\x20written','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','projectDir','MISSING_ARGUMENT','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','yellow','\x20\x20Chat\x20Interface\x20\x22','\x0aChanges\x20to\x20prompt\x20\x27','agentId','\x20created','tdx.json','Cloning\x20\x22','7203528GMSCYy','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20\x20Chat\x20Interfaces:\x20','repeat','no_local_folder','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20unchanged','\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\x20Integrations:\x20','agent:clone','experimentalKnowledgeBases','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','unchanged','created','\x20files?','-\x20nothing\x20pushed','Agent\x20','Status:\x20','cloneProject','agent.yml','Output:\x20','\x20\x20Experimental\x20Artifacts:\x20','Using\x20current\x20project:\x20','hasChanges','3183354pRXfAQ','Dry\x20run\x20-\x20no\x20changes\x20made','newProjectId','No\x20tdx.json\x20found\x20in\x20','counts','\x20errors','\x20new','830215nJqCQQ','37362400kikMOF','name','parse','chatInterfaces','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','agent:pull','\x0aProject\x20pushed\x20with\x20errors','integrations','Source:\x20','\x0aPull\x20summary\x20for\x20\x27','agent:push','Project\x20cloned\x20successfully','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x0aPush\x20','New\x20project\x20name\x20is\x20required','\x20\x20Prompt\x20\x22','experimentalArtifacts','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','cwd-config','llm','\x0aChanges\x20to\x20form\x20interface\x20\x27','utf-8','agents','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','new','\x20--name\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','Analyzing\x20project\x20\x22','\x20=\x20','yes','pushAgent','Errors:','1296386PTczwi','\x20|\x20','1022823thWfQu','New\x20project\x20ID:\x20','New\x20project:\x20','cyan','gray','output','\x22\x20to\x20\x22','error','4206181BiYDll','green','llm_project','projectId','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','newProjectName','pushProject','site','Agent\x20pulled\x20successfully','outputPath','reason','description','execute','Project:\x20','context','\x20--profile\x20','session','Project\x20cloned\x20with\x20errors','\x20\x20Experimental\x20Artifact\x20\x22','Using\x20project\x20from\x20','projectName','\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','profile','force'];a4_0x527c=function(){return _0x2ae0b9;};return a4_0x527c();}export class AgentPullCommand extends BaseCommand{['name']=a4_0x1fa6a3(0x158);[a4_0x1fa6a3(0xc8)]=a4_0x1fa6a3(0x10f);async[a4_0x1fa6a3(0xc9)](_0x10cb58){const _0xca8169=a4_0x1fa6a3,{options:_0x3cb9fe,args:_0x3cb19f,tdx:_0x5a53ae}=_0x10cb58,_0x33a603=_0x3cb19f[0x0],_0x54b084=_0x3cb19f[0x1],_0x1f6c33=_0x3cb9fe[_0xca8169(0xba)],_0x1e55e5=_0x3cb9fe['dryRun'],_0x46ecc2=_0x3cb9fe[_0xca8169(0xd4)],_0xb909ee=_0x3cb9fe[_0xca8169(0xb0)],_0x5bb109=_0x3cb9fe['llmProject'],_0xdbfb60=_0x3cb9fe[_0xca8169(0xe2)];let _0x6c036;if(_0x33a603){const _0x2f06b9=a4_0x1af64f[_0xca8169(0xdb)](_0x33a603,_0xca8169(0x131));if(existsSync(_0x2f06b9))try{const _0x2d5ea9=JSON[_0xca8169(0x155)](readFileSync(_0x2f06b9,_0xca8169(0x169)));_0x2d5ea9[_0xca8169(0xbf)]&&(_0x6c036={'llm_project':_0x2d5ea9[_0xca8169(0xbf)]});}catch{}}const _0x389e93=findAgentConfigPath(process[_0xca8169(0x116)]());let _0x44688b;if(_0x389e93)try{const _0x7b90a5=JSON['parse'](readFileSync(_0x389e93,_0xca8169(0x169)));_0x7b90a5[_0xca8169(0xbf)]&&(_0x44688b={'llm_project':_0x7b90a5[_0xca8169(0xbf)]});}catch{}const _0x375a4c=resolveAgentPullArgs({'arg':_0x33a603,'agentNameArg':_0x54b084,'agentFlag':_0xdbfb60,'contextProject':_0x5bb109,'argDirConfig':_0x6c036,'cwdConfigPath':_0x389e93||undefined,'cwdConfig':_0x44688b}),{projectNameOrId:_0x2b4497,targetAgentName:_0x24f6b6,existingOutputDir:_0x49c686,source:_0x19f07f}=_0x375a4c;if(_0x19f07f===_0xca8169(0xdd))console[_0xca8169(0x11e)](a4_0x9a357a[_0xca8169(0xec)](_0xca8169(0xd0)+a4_0x1af64f['join'](_0x33a603,_0xca8169(0x131))+':\x20'+_0x2b4497));else{if(_0x19f07f===_0xca8169(0x166))console[_0xca8169(0x11e)](a4_0x9a357a[_0xca8169(0xec)](_0xca8169(0xea)+_0x2b4497));else _0x19f07f===_0xca8169(0xcb)&&console[_0xca8169(0x11e)](a4_0x9a357a['dim']('Using\x20project\x20from\x20context:\x20'+_0x2b4497));}if(!_0x2b4497)return _0xdbfb60?(console[_0xca8169(0x11e)](a4_0x9a357a[_0xca8169(0x12c)](_0xca8169(0x13e))),console[_0xca8169(0x11e)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0xca8169(0x11e)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0xca8169(0x11e)](a4_0x9a357a[_0xca8169(0x12c)](_0xca8169(0x111))),console[_0xca8169(0x11e)]('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0xca8169(0x11e)](_0xca8169(0x123)),console[_0xca8169(0x11e)](_0xca8169(0x13a)),console[_0xca8169(0x11e)](_0xca8169(0x157)),console[_0xca8169(0x11e)](_0xca8169(0xd2))),0x1;if(_0x24f6b6){const {data:_0xef0839}=await withSpinner(_0xca8169(0x11d)+_0x24f6b6+_0xca8169(0xf9)+_0x2b4497+_0xca8169(0xd6),()=>_0x5a53ae[_0xca8169(0x167)]['pullAgent'](_0x2b4497,_0x24f6b6,_0x1f6c33,{'dryRun':_0x1e55e5,'force':_0x46ecc2}));if(_0x1e55e5)return console[_0xca8169(0x11e)](a4_0x9a357a['yellow'](_0xca8169(0x115))),console['log'](_0xca8169(0xe3)+_0xef0839['agentName']),console[_0xca8169(0x11e)](_0xca8169(0xf6)+_0xef0839[_0xca8169(0xc6)]),_0xef0839[_0xca8169(0xfd)]&&(console[_0xca8169(0x11e)](_0xca8169(0xf3)),console['log']('─'[_0xca8169(0x136)](0x3c)),console['log'](_0xef0839[_0xca8169(0xfd)]),console['log']('─'['repeat'](0x3c))),0x0;return console[_0xca8169(0x11e)](a4_0x9a357a[_0xca8169(0xbe)](_0xca8169(0xc5))),console[_0xca8169(0x11e)](_0xca8169(0x10b)+_0xef0839['agentName']),console[_0xca8169(0x11e)](_0xca8169(0x147)+_0xef0839[_0xca8169(0xc6)]),console[_0xca8169(0x11e)](_0xca8169(0x144)+(_0xef0839[_0xca8169(0x120)]?a4_0x9a357a[_0xca8169(0xbe)](_0xca8169(0xaa)):_0xef0839[_0xca8169(0x14a)]?a4_0x9a357a['yellow'](_0xca8169(0xd9)):a4_0x9a357a[_0xca8169(0xb9)](_0xca8169(0x13f)))),0x0;}const _0x490187=_0x49c686||_0x1f6c33,{data:_0x2104bc}=await withSpinner(_0xca8169(0xae)+_0x2b4497+'\x22...',()=>_0x5a53ae['llm'][_0xca8169(0xe5)](_0x2b4497,_0x490187,{'dryRun':!![]})),_0x41f370=_0x2104bc['counts'][_0xca8169(0xa8)][_0xca8169(0xaa)]+_0x2104bc[_0xca8169(0x14f)][_0xca8169(0x104)]['new']+_0x2104bc['counts'][_0xca8169(0x113)][_0xca8169(0xaa)]+_0x2104bc[_0xca8169(0x14f)]['prompts'][_0xca8169(0xaa)]+_0x2104bc['counts']['integrations']['new']+_0x2104bc['counts'][_0xca8169(0x13d)]['new']+_0x2104bc[_0xca8169(0x14f)][_0xca8169(0x164)][_0xca8169(0xaa)]+_0x2104bc[_0xca8169(0x14f)][_0xca8169(0x109)]['new']+_0x2104bc['counts'][_0xca8169(0x156)][_0xca8169(0xaa)],_0x133c47=_0x2104bc[_0xca8169(0x14f)][_0xca8169(0xa8)][_0xca8169(0xd9)]+_0x2104bc[_0xca8169(0x14f)][_0xca8169(0x104)]['updated']+_0x2104bc[_0xca8169(0x14f)][_0xca8169(0x113)][_0xca8169(0xd9)]+_0x2104bc[_0xca8169(0x14f)]['prompts'][_0xca8169(0xd9)]+_0x2104bc[_0xca8169(0x14f)][_0xca8169(0x15a)][_0xca8169(0xd9)]+_0x2104bc['counts'][_0xca8169(0x13d)][_0xca8169(0xd9)]+_0x2104bc['counts'][_0xca8169(0x164)][_0xca8169(0xd9)]+_0x2104bc[_0xca8169(0x14f)]['formInterfaces']['updated']+_0x2104bc[_0xca8169(0x14f)][_0xca8169(0x156)]['updated'],_0x26054d=_0x2104bc['counts']['agents'][_0xca8169(0x13f)]+_0x2104bc[_0xca8169(0x14f)][_0xca8169(0x104)][_0xca8169(0x13f)]+_0x2104bc[_0xca8169(0x14f)][_0xca8169(0x113)][_0xca8169(0x13f)]+_0x2104bc[_0xca8169(0x14f)][_0xca8169(0xda)][_0xca8169(0x13f)]+_0x2104bc[_0xca8169(0x14f)][_0xca8169(0x15a)][_0xca8169(0x13f)]+_0x2104bc[_0xca8169(0x14f)][_0xca8169(0x13d)]['unchanged']+_0x2104bc['counts']['experimentalArtifacts'][_0xca8169(0x13f)]+_0x2104bc[_0xca8169(0x14f)][_0xca8169(0x109)][_0xca8169(0x13f)]+_0x2104bc[_0xca8169(0x14f)][_0xca8169(0x156)][_0xca8169(0x13f)];console['log'](_0xca8169(0x15c)+_0x2104bc[_0xca8169(0xd1)]+'\x27:'),console[_0xca8169(0x11e)]('\x20\x20'+a4_0x9a357a[_0xca8169(0xbe)]('+\x20'+_0x41f370+_0xca8169(0x151))+_0xca8169(0xb4)+a4_0x9a357a[_0xca8169(0x12c)]('~\x20'+_0x133c47+'\x20changed')+_0xca8169(0xb4)+a4_0x9a357a['dim']('=\x20'+_0x26054d+_0xca8169(0x139))),console[_0xca8169(0x11e)](_0xca8169(0x122)+formatCountSummary(_0x2104bc[_0xca8169(0x14f)][_0xca8169(0xa8)])),console['log'](_0xca8169(0x108)+formatCountSummary(_0x2104bc['counts'][_0xca8169(0x104)])),console[_0xca8169(0x11e)](_0xca8169(0x11c)+formatCountSummary(_0x2104bc[_0xca8169(0x14f)][_0xca8169(0x113)])),console[_0xca8169(0x11e)](_0xca8169(0x101)+formatCountSummary(_0x2104bc[_0xca8169(0x14f)][_0xca8169(0xda)])),console['log'](_0xca8169(0x13b)+formatCountSummary(_0x2104bc[_0xca8169(0x14f)]['integrations'])),console[_0xca8169(0x11e)](_0xca8169(0xf4)+formatCountSummary(_0x2104bc[_0xca8169(0x14f)][_0xca8169(0x109)])),console[_0xca8169(0x11e)](_0xca8169(0x135)+formatCountSummary(_0x2104bc[_0xca8169(0x14f)][_0xca8169(0x156)]));const _0x518a28=_0x2104bc[_0xca8169(0x14f)][_0xca8169(0x13d)][_0xca8169(0x10a)]>0x0||_0x2104bc[_0xca8169(0x14f)][_0xca8169(0x164)][_0xca8169(0x10a)]>0x0;_0x518a28&&(console[_0xca8169(0x11e)](_0xca8169(0x134)+formatCountSummary(_0x2104bc[_0xca8169(0x14f)][_0xca8169(0x13d)])),console['log'](_0xca8169(0x148)+formatCountSummary(_0x2104bc[_0xca8169(0x14f)][_0xca8169(0x164)])));console[_0xca8169(0x11e)](_0xca8169(0xe7)+a4_0x9a357a['cyan'](_0x2104bc[_0xca8169(0x10c)])),displayDiffs(_0x2104bc[_0xca8169(0xa8)],_0x2104bc['knowledgeBases'],_0x2104bc['textKnowledgeBases'],_0x2104bc[_0xca8169(0xda)],_0x2104bc[_0xca8169(0x15a)],_0x2104bc[_0xca8169(0x13d)],_0x2104bc[_0xca8169(0x164)],_0x2104bc['formInterfaces'],_0x2104bc[_0xca8169(0x156)]);if(_0x1e55e5)return console[_0xca8169(0x11e)](a4_0x9a357a['yellow'](_0xca8169(0x12b))),0x0;if(_0x41f370===0x0&&_0x133c47===0x0)return console['log'](a4_0x9a357a['green'](_0xca8169(0xa9))),saveSessionContext({'llm_project':_0x2104bc['projectName']},_0x3cb9fe[_0xca8169(0xcd)]),console[_0xca8169(0x11e)](a4_0x9a357a['green'](_0xca8169(0xd5)+a4_0x9a357a[_0xca8169(0xec)](_0xca8169(0xbf))+'\x20=\x20'+a4_0x9a357a[_0xca8169(0xb8)](_0x2104bc[_0xca8169(0xd1)]))),0x0;if(!_0xb909ee&&!_0x46ecc2){if(!isInteractive())return console[_0xca8169(0xbc)](a4_0x9a357a[_0xca8169(0xe8)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xca8169(0xbc)](a4_0x9a357a[_0xca8169(0xec)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x13e470=await confirmKey('\x0aWrite\x20'+(_0x41f370+_0x133c47)+_0xca8169(0x141));if(!_0x13e470)return console[_0xca8169(0x11e)](a4_0x9a357a[_0xca8169(0x12c)](_0xca8169(0xfc)),_0xca8169(0x127)),0x1;}const {data:_0x174cb9}=await withSpinner(_0xca8169(0xe1),()=>_0x5a53ae['llm'][_0xca8169(0xe5)](_0x2b4497,_0x490187,{'force':_0x46ecc2}));return console['log'](a4_0x9a357a[_0xca8169(0xbe)]('\x0a✔\x20Pulled\x20'+(_0x41f370+_0x133c47)+_0xca8169(0xdf)+_0x174cb9[_0xca8169(0x10c)])),saveSessionContext({'llm_project':_0x174cb9['projectName']},_0x3cb9fe[_0xca8169(0xcd)]),console['log'](a4_0x9a357a['green'](_0xca8169(0xd5)+a4_0x9a357a[_0xca8169(0xec)]('llm_project')+_0xca8169(0xaf)+a4_0x9a357a[_0xca8169(0xb8)](_0x174cb9[_0xca8169(0xd1)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x1fa6a3(0x154)]=a4_0x1fa6a3(0x13c);[a4_0x1fa6a3(0xc8)]=a4_0x1fa6a3(0xc1);async[a4_0x1fa6a3(0xc9)](_0x21a866){const _0x1ec453=a4_0x1fa6a3,{options:_0x3a35ad,args:_0x1ab2a8,tdx:_0x535c89}=_0x21a866,_0x43d752=_0x1ab2a8[0x0],_0x466908=_0x3a35ad['name'],_0x2354d9=_0x3a35ad[_0x1ec453(0xf5)],_0x5bbe56=_0x3a35ad['yes'],_0x2b0b73=_0x3a35ad[_0x1ec453(0xc4)],_0xd42669=_0x3a35ad[_0x1ec453(0x11b)];let _0x1582cb;const _0x589f6b=findAgentConfigPath(process[_0x1ec453(0x116)]());if(_0x43d752){const _0x19135a=a4_0x1af64f[_0x1ec453(0xdb)](_0x43d752,_0x1ec453(0x131));existsSync(_0x19135a)?(_0x1582cb=_0x43d752,console[_0x1ec453(0x11e)](a4_0x9a357a[_0x1ec453(0xec)](_0x1ec453(0x10e)+_0x43d752))):_0x1582cb=_0x43d752;}else{if(_0x589f6b)_0x1582cb=a4_0x1af64f['dirname'](_0x589f6b),console[_0x1ec453(0x11e)](a4_0x9a357a[_0x1ec453(0xec)](_0x1ec453(0x149)+_0x1582cb));else{if(_0xd42669){const _0x4a614f=sanitizeForFilesystem(_0xd42669);let _0x494700=_0x4a614f,_0x200cec=a4_0x1af64f[_0x1ec453(0xdb)](process[_0x1ec453(0x116)](),_0x1ec453(0xa8),_0x4a614f,_0x1ec453(0x131));if(!existsSync(_0x200cec)){const _0x15517f=normalizeName(_0xd42669),_0x1df8a2=a4_0x1af64f[_0x1ec453(0xdb)](process[_0x1ec453(0x116)](),'agents',_0x15517f,_0x1ec453(0x131));existsSync(_0x1df8a2)&&(_0x494700=_0x15517f,_0x200cec=_0x1df8a2);}if(existsSync(_0x200cec))_0x1582cb=a4_0x1af64f['dirname'](_0x200cec),console[_0x1ec453(0x11e)](a4_0x9a357a[_0x1ec453(0xec)]('Using\x20local\x20project:\x20'+_0x1582cb));else{const _0x4524de=_0x3a35ad[_0x1ec453(0xd3)];if(_0x4524de)throw new SDKError(ErrorCode[_0x1ec453(0xff)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0xd42669+_0x1ec453(0x100),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x1ec453(0xe4)+('\x20\x20tdx\x20agent\x20pull\x20'+_0xd42669+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x494700+_0x1ec453(0xab)+(_0x466908||_0x1ec453(0x125))+_0x1ec453(0xcc)+_0x4524de)});_0x1582cb=_0xd42669,console['log'](a4_0x9a357a[_0x1ec453(0xec)]('Using\x20context\x20project:\x20'+_0xd42669));}}}}if(!_0x1582cb)return console['log'](a4_0x9a357a[_0x1ec453(0x12c)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x1ec453(0x11e)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console['log'](_0x1ec453(0x106)),console[_0x1ec453(0x11e)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x466908)throw new SDKError(ErrorCode[_0x1ec453(0x12a)],_0x1ec453(0x162),undefined,{'helpText':_0x1ec453(0xac)});if(!_0x5bbe56&&!_0x2354d9){if(!isInteractive())return console[_0x1ec453(0xbc)](a4_0x9a357a['red'](_0x1ec453(0xfa)),_0x1ec453(0x138)),console[_0x1ec453(0xbc)](a4_0x9a357a[_0x1ec453(0xec)](_0x1ec453(0x165))),0x1;const _0x8a8c80=await confirmKey(_0x1ec453(0x119)+_0x1582cb+_0x1ec453(0x103)+_0x466908+'\x22?');if(!_0x8a8c80)return console[_0x1ec453(0x11e)](a4_0x9a357a[_0x1ec453(0x12c)](_0x1ec453(0xfc))),0x1;}const {data:_0x392c49}=await withSpinner(_0x1ec453(0x132)+_0x1582cb+_0x1ec453(0xbb)+_0x466908+'\x22...',()=>_0x535c89['llm'][_0x1ec453(0x145)](_0x1582cb,_0x466908,{'dryRun':_0x2354d9}));if(_0x2354d9){console[_0x1ec453(0x11e)](a4_0x9a357a[_0x1ec453(0x12c)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x1ec453(0x11e)](_0x1ec453(0x15b)+_0x392c49[_0x1ec453(0x117)]),console[_0x1ec453(0x11e)](_0x1ec453(0xb7)+_0x466908),console[_0x1ec453(0x11e)](_0x1ec453(0xf8)),console[_0x1ec453(0x11e)](_0x1ec453(0x122)+_0x392c49[_0x1ec453(0x14f)][_0x1ec453(0xa8)]['created']),console[_0x1ec453(0x11e)](_0x1ec453(0x108)+_0x392c49[_0x1ec453(0x14f)][_0x1ec453(0x104)][_0x1ec453(0x140)]),console['log'](_0x1ec453(0x101)+_0x392c49[_0x1ec453(0x14f)]['prompts'][_0x1ec453(0x140)]),console['log'](_0x1ec453(0xf4)+_0x392c49[_0x1ec453(0x14f)][_0x1ec453(0x109)][_0x1ec453(0x140)]),console['log'](_0x1ec453(0x135)+_0x392c49['counts'][_0x1ec453(0x156)][_0x1ec453(0x140)]);const _0x5a1d57=_0x392c49['counts'][_0x1ec453(0x13d)][_0x1ec453(0x140)]>0x0||_0x392c49[_0x1ec453(0x14f)][_0x1ec453(0x164)][_0x1ec453(0x140)]>0x0;return _0x5a1d57&&(console[_0x1ec453(0x11e)](_0x1ec453(0x134)+_0x392c49['counts'][_0x1ec453(0x13d)][_0x1ec453(0x140)]),console[_0x1ec453(0x11e)](_0x1ec453(0x148)+_0x392c49[_0x1ec453(0x14f)][_0x1ec453(0x164)][_0x1ec453(0x140)])),0x0;}const _0x96f4bd=_0x392c49[_0x1ec453(0x14f)]['agents'][_0x1ec453(0xf0)]>0x0||_0x392c49[_0x1ec453(0x14f)][_0x1ec453(0x104)][_0x1ec453(0xf0)]>0x0||_0x392c49[_0x1ec453(0x14f)][_0x1ec453(0xda)][_0x1ec453(0xf0)]>0x0||_0x392c49[_0x1ec453(0x14f)][_0x1ec453(0x109)][_0x1ec453(0xf0)]>0x0||_0x392c49['counts'][_0x1ec453(0x156)][_0x1ec453(0xf0)]>0x0||_0x392c49[_0x1ec453(0x14f)]['experimentalKnowledgeBases'][_0x1ec453(0xf0)]>0x0||_0x392c49[_0x1ec453(0x14f)][_0x1ec453(0x164)][_0x1ec453(0xf0)]>0x0;_0x96f4bd?console['log'](a4_0x9a357a['yellow'](_0x1ec453(0xce))):console[_0x1ec453(0x11e)](a4_0x9a357a[_0x1ec453(0xbe)](_0x1ec453(0x15e)));console[_0x1ec453(0x11e)](_0x1ec453(0x15b)+_0x392c49[_0x1ec453(0x117)]),console['log']('New\x20project:\x20'+_0x392c49[_0x1ec453(0xc2)]),console[_0x1ec453(0x11e)](_0x1ec453(0xb6)+_0x392c49[_0x1ec453(0x14d)]),console[_0x1ec453(0x11e)](),console['log'](_0x1ec453(0x11a)),console[_0x1ec453(0x11e)]('\x20\x20Agents:\x20'+formatCountSummary(_0x392c49[_0x1ec453(0x14f)]['agents'])),console['log'](_0x1ec453(0x108)+formatCountSummary(_0x392c49[_0x1ec453(0x14f)][_0x1ec453(0x104)])),console[_0x1ec453(0x11e)](_0x1ec453(0x101)+formatCountSummary(_0x392c49[_0x1ec453(0x14f)]['prompts'])),console[_0x1ec453(0x11e)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x392c49[_0x1ec453(0x14f)][_0x1ec453(0x15a)])),console[_0x1ec453(0x11e)](_0x1ec453(0xf4)+formatCountSummary(_0x392c49[_0x1ec453(0x14f)][_0x1ec453(0x109)])),console['log'](_0x1ec453(0x135)+formatCountSummary(_0x392c49[_0x1ec453(0x14f)]['chatInterfaces']));const _0x3139f4=_0x392c49[_0x1ec453(0x14f)][_0x1ec453(0x13d)][_0x1ec453(0x140)]>0x0||_0x392c49[_0x1ec453(0x14f)][_0x1ec453(0x13d)][_0x1ec453(0xd9)]>0x0||_0x392c49[_0x1ec453(0x14f)][_0x1ec453(0x13d)][_0x1ec453(0x13f)]>0x0||_0x392c49[_0x1ec453(0x14f)][_0x1ec453(0x164)][_0x1ec453(0x140)]>0x0||_0x392c49[_0x1ec453(0x14f)][_0x1ec453(0x164)]['updated']>0x0||_0x392c49[_0x1ec453(0x14f)]['experimentalArtifacts'][_0x1ec453(0x13f)]>0x0;_0x3139f4&&(console[_0x1ec453(0x11e)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x392c49['counts'][_0x1ec453(0x13d)])),console[_0x1ec453(0x11e)](_0x1ec453(0x148)+formatCountSummary(_0x392c49[_0x1ec453(0x14f)][_0x1ec453(0x164)])));if(_0x96f4bd){console[_0x1ec453(0x11e)](),console[_0x1ec453(0x11e)](a4_0x9a357a[_0x1ec453(0xe8)](_0x1ec453(0xb2)));for(const _0x3032f2 of _0x392c49[_0x1ec453(0xa8)]){_0x3032f2[_0x1ec453(0xe9)]==='error'&&console['log'](a4_0x9a357a[_0x1ec453(0xe8)](_0x1ec453(0xd8)+_0x3032f2[_0x1ec453(0x10d)]+'\x22:\x20'+_0x3032f2[_0x1ec453(0xbc)]));}for(const _0x5d11d2 of _0x392c49[_0x1ec453(0x104)]){_0x5d11d2[_0x1ec453(0xe9)]===_0x1ec453(0xbc)&&console['log'](a4_0x9a357a[_0x1ec453(0xe8)](_0x1ec453(0xef)+_0x5d11d2['name']+_0x1ec453(0x11f)+_0x5d11d2[_0x1ec453(0xbc)]));}for(const _0x5e6758 of _0x392c49['prompts']){_0x5e6758[_0x1ec453(0xe9)]===_0x1ec453(0xbc)&&console[_0x1ec453(0x11e)](a4_0x9a357a[_0x1ec453(0xe8)](_0x1ec453(0x163)+_0x5e6758['name']+_0x1ec453(0x11f)+_0x5e6758['error']));}for(const _0x10c5e6 of _0x392c49['integrations']){_0x10c5e6['action']===_0x1ec453(0xbc)&&console[_0x1ec453(0x11e)](a4_0x9a357a[_0x1ec453(0xe8)](_0x1ec453(0xde)+_0x10c5e6['name']+_0x1ec453(0x11f)+_0x10c5e6['error']));}for(const _0x4ee259 of _0x392c49[_0x1ec453(0x109)]){_0x4ee259[_0x1ec453(0xe9)]==='error'&&console[_0x1ec453(0x11e)](a4_0x9a357a[_0x1ec453(0xe8)]('\x20\x20Form\x20Interface\x20\x22'+_0x4ee259['name']+_0x1ec453(0x11f)+_0x4ee259[_0x1ec453(0xbc)]));}for(const _0x547603 of _0x392c49[_0x1ec453(0x156)]){_0x547603[_0x1ec453(0xe9)]===_0x1ec453(0xbc)&&console[_0x1ec453(0x11e)](a4_0x9a357a[_0x1ec453(0xe8)](_0x1ec453(0x12d)+_0x547603[_0x1ec453(0x154)]+'\x22:\x20'+_0x547603['error']));}for(const _0x2a0d17 of _0x392c49['experimentalKnowledgeBases']){_0x2a0d17['action']===_0x1ec453(0xbc)&&console[_0x1ec453(0x11e)](a4_0x9a357a['red'](_0x1ec453(0xad)+_0x2a0d17[_0x1ec453(0x154)]+_0x1ec453(0x11f)+_0x2a0d17[_0x1ec453(0xbc)]));}for(const _0x3a7b81 of _0x392c49[_0x1ec453(0x164)]){_0x3a7b81[_0x1ec453(0xe9)]==='error'&&console[_0x1ec453(0x11e)](a4_0x9a357a[_0x1ec453(0xe8)](_0x1ec453(0xcf)+_0x3a7b81[_0x1ec453(0x154)]+_0x1ec453(0x11f)+_0x3a7b81['error']));}return 0x1;}console[_0x1ec453(0x11e)]();const _0x13772d=getLLMProjectUrl(_0x2b0b73,_0x392c49[_0x1ec453(0x14d)]);return console[_0x1ec453(0x11e)](_0x1ec453(0xca)+a4_0x9a357a['cyan'](_0x13772d)),0x0;}}function a4_0x33d7(_0x8b8f36,_0xfec8e5){_0x8b8f36=_0x8b8f36-0xa8;const _0x527c4d=a4_0x527c();let _0x33d76f=_0x527c4d[_0x8b8f36];return _0x33d76f;}export class AgentPushCommand extends BaseCommand{['name']=a4_0x1fa6a3(0x15d);['description']='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x1fa6a3(0xc9)](_0xf569e2){const _0x60bac1=a4_0x1fa6a3,{options:_0x51ebcd,args:_0x3a058c,tdx:_0xd6945}=_0xf569e2;let _0x3ba54f=_0x3a058c[0x0]||process[_0x60bac1(0x116)]();const _0x3db657=_0x51ebcd[_0x60bac1(0xf5)],_0x2e1a64=_0x51ebcd[_0x60bac1(0xd4)],_0x134a7e=_0x51ebcd[_0x60bac1(0xb0)],_0x141e7f=_0x51ebcd[_0x60bac1(0xc4)],_0x2cfcfc=a4_0x1af64f[_0x60bac1(0xdb)](_0x3ba54f,_0x60bac1(0x146)),_0x15e063=existsSync(_0x2cfcfc);if(_0x15e063){const {data:_0x5e6a16}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x3ba54f+_0x60bac1(0xd6),()=>_0xd6945[_0x60bac1(0x167)][_0x60bac1(0xb1)](_0x3ba54f,{'dryRun':_0x3db657,'force':_0x2e1a64}));if(_0x3db657)return console[_0x60bac1(0x11e)](a4_0x9a357a[_0x60bac1(0x12c)](_0x60bac1(0x14c))),console['log']('Would\x20push\x20agent:\x20'+_0x5e6a16[_0x60bac1(0x10d)]),0x0;if(_0x5e6a16[_0x60bac1(0xe9)]===_0x60bac1(0xbc))return console[_0x60bac1(0x11e)](a4_0x9a357a['red']('Failed\x20to\x20push\x20agent:\x20'+_0x5e6a16[_0x60bac1(0xbc)])),0x1;console[_0x60bac1(0x11e)](a4_0x9a357a[_0x60bac1(0xbe)](_0x60bac1(0x143)+_0x5e6a16[_0x60bac1(0xe9)]+_0x60bac1(0x126))),console[_0x60bac1(0x11e)](_0x60bac1(0x10b)+_0x5e6a16[_0x60bac1(0x10d)]);if(_0x5e6a16[_0x60bac1(0x12f)]&&_0x5e6a16['projectId']){const _0x4b4cb2=getLLMAgentChatUrl(_0x141e7f,_0x5e6a16[_0x60bac1(0xc0)],_0x5e6a16[_0x60bac1(0x12f)]);console[_0x60bac1(0x11e)]('Chat:\x20'+a4_0x9a357a[_0x60bac1(0xb8)](_0x4b4cb2));}return 0x0;}const _0x1d9edf=_0x51ebcd[_0x60bac1(0x11b)],_0x36c7b9=resolveProjectFromContext(_0x3ba54f,_0x1d9edf);if(_0x36c7b9['found'])_0x3ba54f=_0x36c7b9[_0x60bac1(0x129)],_0x36c7b9[_0x60bac1(0x118)]===_0x60bac1(0xcb)&&console[_0x60bac1(0x11e)](a4_0x9a357a[_0x60bac1(0xec)](_0x60bac1(0xea)+_0x3ba54f));else{let _0x1b1dea=_0x60bac1(0xd7);_0x36c7b9[_0x60bac1(0xc7)]===_0x60bac1(0x137)&&(_0x1b1dea=_0x36c7b9['message']+_0x60bac1(0xfb)+_0x36c7b9[_0x60bac1(0x11b)]+_0x60bac1(0x121));throw new SDKError(ErrorCode[_0x60bac1(0xff)],_0x36c7b9['reason']===_0x60bac1(0x110)?_0x36c7b9[_0x60bac1(0xed)]:_0x60bac1(0x14e)+_0x3ba54f,undefined,{'helpText':_0x1b1dea});}const {data:_0x4ddbf4}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0xd6945[_0x60bac1(0x167)][_0x60bac1(0xc3)](_0x3ba54f,{'dryRun':!![]})),_0xfbb96a=_0x4ddbf4[_0x60bac1(0x14f)][_0x60bac1(0xa8)][_0x60bac1(0xf0)]>0x0;if(_0xfbb96a){console[_0x60bac1(0x11e)](a4_0x9a357a[_0x60bac1(0xe8)](_0x60bac1(0x105)));for(const _0x5e5fca of _0x4ddbf4[_0x60bac1(0xa8)]){_0x5e5fca[_0x60bac1(0xe9)]===_0x60bac1(0xbc)&&console['log'](a4_0x9a357a[_0x60bac1(0xe8)](_0x60bac1(0xd8)+_0x5e5fca[_0x60bac1(0x10d)]+'\x22:\x20'+_0x5e5fca[_0x60bac1(0xbc)]));}return 0x1;}const _0x2949a5=_0x4ddbf4[_0x60bac1(0x14f)][_0x60bac1(0xa8)][_0x60bac1(0x140)]+_0x4ddbf4[_0x60bac1(0x14f)][_0x60bac1(0x104)][_0x60bac1(0x140)]+_0x4ddbf4[_0x60bac1(0x14f)][_0x60bac1(0x113)][_0x60bac1(0x140)]+_0x4ddbf4[_0x60bac1(0x14f)][_0x60bac1(0xda)][_0x60bac1(0x140)]+_0x4ddbf4[_0x60bac1(0x14f)][_0x60bac1(0x15a)][_0x60bac1(0x140)]+_0x4ddbf4[_0x60bac1(0x14f)][_0x60bac1(0x13d)][_0x60bac1(0x140)]+_0x4ddbf4[_0x60bac1(0x14f)][_0x60bac1(0x164)][_0x60bac1(0x140)]+_0x4ddbf4['counts'][_0x60bac1(0x109)][_0x60bac1(0x140)]+_0x4ddbf4[_0x60bac1(0x14f)][_0x60bac1(0x156)][_0x60bac1(0x140)],_0x26c906=_0x4ddbf4['counts'][_0x60bac1(0xa8)][_0x60bac1(0xd9)]+_0x4ddbf4['counts'][_0x60bac1(0x104)]['updated']+_0x4ddbf4[_0x60bac1(0x14f)][_0x60bac1(0x113)][_0x60bac1(0xd9)]+_0x4ddbf4['counts'][_0x60bac1(0xda)][_0x60bac1(0xd9)]+_0x4ddbf4['counts'][_0x60bac1(0x15a)]['updated']+_0x4ddbf4[_0x60bac1(0x14f)][_0x60bac1(0x13d)]['updated']+_0x4ddbf4[_0x60bac1(0x14f)][_0x60bac1(0x164)]['updated']+_0x4ddbf4[_0x60bac1(0x14f)][_0x60bac1(0x109)]['updated']+_0x4ddbf4['counts'][_0x60bac1(0x156)][_0x60bac1(0xd9)],_0x4a92be=_0x4ddbf4[_0x60bac1(0x14f)]['agents'][_0x60bac1(0x13f)]+_0x4ddbf4[_0x60bac1(0x14f)][_0x60bac1(0x104)][_0x60bac1(0x13f)]+_0x4ddbf4['counts'][_0x60bac1(0x113)][_0x60bac1(0x13f)]+_0x4ddbf4[_0x60bac1(0x14f)][_0x60bac1(0xda)][_0x60bac1(0x13f)]+_0x4ddbf4['counts'][_0x60bac1(0x15a)][_0x60bac1(0x13f)]+_0x4ddbf4[_0x60bac1(0x14f)][_0x60bac1(0x13d)][_0x60bac1(0x13f)]+_0x4ddbf4[_0x60bac1(0x14f)]['experimentalArtifacts'][_0x60bac1(0x13f)]+_0x4ddbf4[_0x60bac1(0x14f)]['formInterfaces']['unchanged']+_0x4ddbf4[_0x60bac1(0x14f)][_0x60bac1(0x156)][_0x60bac1(0x13f)];console[_0x60bac1(0x11e)](_0x60bac1(0xf2)+_0x4ddbf4[_0x60bac1(0xd1)]+'\x27:'),console[_0x60bac1(0x11e)]('\x20\x20'+a4_0x9a357a['green']('+\x20'+_0x2949a5+_0x60bac1(0x151))+'\x20|\x20'+a4_0x9a357a[_0x60bac1(0x12c)]('~\x20'+_0x26c906+_0x60bac1(0x107))+'\x20|\x20'+a4_0x9a357a[_0x60bac1(0xec)]('=\x20'+_0x4a92be+_0x60bac1(0x139))),console[_0x60bac1(0x11e)]('\x20\x20Agents:\x20'+formatCountSummary(_0x4ddbf4[_0x60bac1(0x14f)][_0x60bac1(0xa8)])),console[_0x60bac1(0x11e)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4ddbf4[_0x60bac1(0x14f)][_0x60bac1(0x104)])),console[_0x60bac1(0x11e)](_0x60bac1(0x11c)+formatCountSummary(_0x4ddbf4['counts'][_0x60bac1(0x113)])),console[_0x60bac1(0x11e)](_0x60bac1(0x101)+formatCountSummary(_0x4ddbf4[_0x60bac1(0x14f)]['prompts'])),console[_0x60bac1(0x11e)](_0x60bac1(0x13b)+formatCountSummary(_0x4ddbf4['counts'][_0x60bac1(0x15a)])),console[_0x60bac1(0x11e)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x4ddbf4['counts']['formInterfaces'])),console[_0x60bac1(0x11e)](_0x60bac1(0x135)+formatCountSummary(_0x4ddbf4[_0x60bac1(0x14f)]['chatInterfaces']));const _0x46fa83=_0x4ddbf4['counts'][_0x60bac1(0x13d)]['created']>0x0||_0x4ddbf4['counts'][_0x60bac1(0x13d)][_0x60bac1(0xd9)]>0x0||_0x4ddbf4['counts']['experimentalKnowledgeBases']['unchanged']>0x0||_0x4ddbf4[_0x60bac1(0x14f)][_0x60bac1(0x164)][_0x60bac1(0x140)]>0x0||_0x4ddbf4['counts']['experimentalArtifacts'][_0x60bac1(0xd9)]>0x0||_0x4ddbf4[_0x60bac1(0x14f)][_0x60bac1(0x164)][_0x60bac1(0x13f)]>0x0;_0x46fa83&&(console[_0x60bac1(0x11e)](_0x60bac1(0x134)+formatCountSummary(_0x4ddbf4[_0x60bac1(0x14f)][_0x60bac1(0x13d)])),console[_0x60bac1(0x11e)](_0x60bac1(0x148)+formatCountSummary(_0x4ddbf4['counts'][_0x60bac1(0x164)])));console[_0x60bac1(0x11e)](_0x60bac1(0xe6)+a4_0x9a357a['cyan'](_0x3ba54f)),displayDiffs(_0x4ddbf4[_0x60bac1(0xa8)],_0x4ddbf4['knowledgeBases'],_0x4ddbf4[_0x60bac1(0x113)],_0x4ddbf4[_0x60bac1(0xda)],_0x4ddbf4[_0x60bac1(0x15a)],_0x4ddbf4['experimentalKnowledgeBases'],_0x4ddbf4[_0x60bac1(0x164)],_0x4ddbf4[_0x60bac1(0x109)],_0x4ddbf4['chatInterfaces']);if(_0x3db657)return console[_0x60bac1(0x11e)](a4_0x9a357a[_0x60bac1(0x12c)](_0x60bac1(0x15f))),0x0;if(_0x2949a5===0x0&&_0x26c906===0x0){console[_0x60bac1(0x11e)](a4_0x9a357a['green'](_0x60bac1(0x128)));const _0x5741d3=getLLMProjectUrl(_0x141e7f,_0x4ddbf4[_0x60bac1(0xc0)]);return console[_0x60bac1(0x11e)](_0x60bac1(0xca)+a4_0x9a357a['cyan'](_0x5741d3)),0x0;}if(!_0x134a7e&&!_0x2e1a64){if(!isInteractive())return console[_0x60bac1(0xbc)](a4_0x9a357a[_0x60bac1(0xe8)](_0x60bac1(0xfa)),_0x60bac1(0x138)),console[_0x60bac1(0xbc)](a4_0x9a357a['dim'](_0x60bac1(0x165))),0x1;const _0x13bf04=await confirmKey(_0x60bac1(0x161)+(_0x2949a5+_0x26c906)+_0x60bac1(0xe0));if(!_0x13bf04)return console[_0x60bac1(0x11e)](a4_0x9a357a['yellow'](_0x60bac1(0xfc)),_0x60bac1(0x142)),0x1;}const {data:_0xc9d6a1}=await withSpinner(_0x60bac1(0xeb),()=>_0xd6945[_0x60bac1(0x167)][_0x60bac1(0xc3)](_0x3ba54f,{'force':_0x2e1a64})),_0x1587b2=_0xc9d6a1[_0x60bac1(0x14f)][_0x60bac1(0xa8)]['errors']>0x0||_0xc9d6a1[_0x60bac1(0x14f)]['knowledgeBases'][_0x60bac1(0xf0)]>0x0||_0xc9d6a1[_0x60bac1(0x14f)][_0x60bac1(0x113)][_0x60bac1(0xf0)]>0x0||_0xc9d6a1[_0x60bac1(0x14f)][_0x60bac1(0xda)]['errors']>0x0||_0xc9d6a1[_0x60bac1(0x14f)][_0x60bac1(0x109)][_0x60bac1(0xf0)]>0x0||_0xc9d6a1['counts'][_0x60bac1(0x156)][_0x60bac1(0xf0)]>0x0;if(_0x1587b2){console[_0x60bac1(0x11e)](a4_0x9a357a[_0x60bac1(0x12c)](_0x60bac1(0x159))),console[_0x60bac1(0x11e)](),console['log'](a4_0x9a357a[_0x60bac1(0xe8)]('Errors:'));for(const _0x400cb2 of _0xc9d6a1[_0x60bac1(0xa8)]){_0x400cb2[_0x60bac1(0xe9)]==='error'&&console[_0x60bac1(0x11e)](a4_0x9a357a[_0x60bac1(0xe8)](_0x60bac1(0xd8)+_0x400cb2[_0x60bac1(0x10d)]+_0x60bac1(0x11f)+_0x400cb2['error']));}for(const _0x108836 of _0xc9d6a1['knowledgeBases']){_0x108836['action']==='error'&&console[_0x60bac1(0x11e)](a4_0x9a357a[_0x60bac1(0xe8)](_0x60bac1(0xef)+_0x108836[_0x60bac1(0x154)]+_0x60bac1(0x11f)+_0x108836[_0x60bac1(0xbc)]));}for(const _0x290afc of _0xc9d6a1[_0x60bac1(0x113)]){_0x290afc[_0x60bac1(0xe9)]===_0x60bac1(0xbc)&&console['log'](a4_0x9a357a[_0x60bac1(0xe8)](_0x60bac1(0x112)+_0x290afc[_0x60bac1(0x154)]+_0x60bac1(0x11f)+_0x290afc['error']));}for(const _0x45d2b2 of _0xc9d6a1[_0x60bac1(0xda)]){_0x45d2b2['action']==='error'&&console[_0x60bac1(0x11e)](a4_0x9a357a[_0x60bac1(0xe8)](_0x60bac1(0x163)+_0x45d2b2['name']+_0x60bac1(0x11f)+_0x45d2b2['error']));}for(const _0x52390a of _0xc9d6a1['integrations']){_0x52390a['action']==='error'&&console['log'](a4_0x9a357a[_0x60bac1(0xe8)]('\x20\x20Integration\x20\x22'+_0x52390a['name']+_0x60bac1(0x11f)+_0x52390a[_0x60bac1(0xbc)]));}for(const _0x223845 of _0xc9d6a1[_0x60bac1(0x109)]){_0x223845[_0x60bac1(0xe9)]===_0x60bac1(0xbc)&&console['log'](a4_0x9a357a[_0x60bac1(0xe8)]('\x20\x20Form\x20Interface\x20\x22'+_0x223845[_0x60bac1(0x154)]+_0x60bac1(0x11f)+_0x223845[_0x60bac1(0xbc)]));}for(const _0xf5658d of _0xc9d6a1['chatInterfaces']){_0xf5658d[_0x60bac1(0xe9)]==='error'&&console['log'](a4_0x9a357a[_0x60bac1(0xe8)](_0x60bac1(0x12d)+_0xf5658d[_0x60bac1(0x154)]+'\x22:\x20'+_0xf5658d[_0x60bac1(0xbc)]));}return 0x1;}console[_0x60bac1(0x11e)](a4_0x9a357a[_0x60bac1(0xbe)]('\x0a✔\x20Pushed\x20'+(_0x2949a5+_0x26c906)+_0x60bac1(0xfe)+_0xc9d6a1[_0x60bac1(0xd1)]+'\x27'));const _0x225fb3=getLLMProjectUrl(_0x141e7f,_0xc9d6a1[_0x60bac1(0xc0)]);return console['log']('Project:\x20'+a4_0x9a357a[_0x60bac1(0xb8)](_0x225fb3)),0x0;}}
1
+ const a4_0x3a9015=a4_0x266b;(function(_0x33f280,_0x5210e3){const _0x209c10=a4_0x266b,_0x57a306=_0x33f280();while(!![]){try{const _0x127d8f=parseInt(_0x209c10(0x15e))/0x1*(-parseInt(_0x209c10(0x142))/0x2)+-parseInt(_0x209c10(0x1da))/0x3+-parseInt(_0x209c10(0x187))/0x4*(parseInt(_0x209c10(0x19c))/0x5)+-parseInt(_0x209c10(0x16d))/0x6*(-parseInt(_0x209c10(0x144))/0x7)+parseInt(_0x209c10(0x1bc))/0x8+parseInt(_0x209c10(0x1c2))/0x9+-parseInt(_0x209c10(0x1d1))/0xa*(-parseInt(_0x209c10(0x1d4))/0xb);if(_0x127d8f===_0x5210e3)break;else _0x57a306['push'](_0x57a306['shift']());}catch(_0x463fbb){_0x57a306['push'](_0x57a306['shift']());}}}(a4_0x365c,0xcd95f));import a4_0x3b372a from'chalk';import a4_0x316358 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';function a4_0x266b(_0x566e19,_0xf84771){_0x566e19=_0x566e19-0x123;const _0x365ce9=a4_0x365c();let _0x266be6=_0x365ce9[_0x566e19];return _0x266be6;}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x2a8b45){const _0x269cd3=a4_0x266b,_0x412493=[];if(_0x2a8b45[_0x269cd3(0x1cc)]!==undefined)_0x412493[_0x269cd3(0x13a)](_0x2a8b45[_0x269cd3(0x1cc)]+_0x269cd3(0x19e));if(_0x2a8b45[_0x269cd3(0x178)]!==undefined&&_0x2a8b45[_0x269cd3(0x178)]>0x0)_0x412493[_0x269cd3(0x13a)](a4_0x3b372a[_0x269cd3(0x168)](_0x2a8b45[_0x269cd3(0x178)]+'\x20new'));if(_0x2a8b45[_0x269cd3(0x12c)]!==undefined&&_0x2a8b45[_0x269cd3(0x12c)]>0x0)_0x412493[_0x269cd3(0x13a)](a4_0x3b372a[_0x269cd3(0x168)](_0x2a8b45[_0x269cd3(0x12c)]+_0x269cd3(0x1ca)));if(_0x2a8b45[_0x269cd3(0x1e0)]!==undefined&&_0x2a8b45[_0x269cd3(0x1e0)]>0x0)_0x412493[_0x269cd3(0x13a)](a4_0x3b372a['yellow'](_0x2a8b45[_0x269cd3(0x1e0)]+_0x269cd3(0x1b7)));if(_0x2a8b45['unchanged']!==undefined&&_0x2a8b45[_0x269cd3(0x193)]>0x0)_0x412493['push'](a4_0x3b372a['gray'](_0x2a8b45[_0x269cd3(0x193)]+'\x20unchanged'));if(_0x2a8b45[_0x269cd3(0x1ac)]!==undefined&&_0x2a8b45['errors']>0x0)_0x412493['push'](a4_0x3b372a[_0x269cd3(0x155)](_0x2a8b45[_0x269cd3(0x1ac)]+'\x20errors'));return _0x412493[_0x269cd3(0x180)](',\x20');}function displayDiffs(_0x28f160,_0x467812,_0x4760b0,_0x10b585,_0x1edec3,_0x479c1f,_0x264fa4,_0x4d1739,_0x32ae87){const _0x1fa51c=a4_0x266b;for(const _0x4cd660 of _0x28f160){if(_0x4cd660[_0x1fa51c(0x14c)]){const _0x18bb9a=_0x4cd660['agentName']||_0x4cd660['name'];console['log'](_0x1fa51c(0x130)+_0x18bb9a+'\x27:'),console[_0x1fa51c(0x138)]('─'[_0x1fa51c(0x196)](0x3c)),console['log'](_0x4cd660[_0x1fa51c(0x14c)]),console[_0x1fa51c(0x138)]('─'[_0x1fa51c(0x196)](0x3c));}}for(const _0xfef9da of _0x467812){_0xfef9da['diff']&&(console[_0x1fa51c(0x138)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0xfef9da[_0x1fa51c(0x149)]+'\x27:'),console[_0x1fa51c(0x138)]('─'[_0x1fa51c(0x196)](0x3c)),console[_0x1fa51c(0x138)](_0xfef9da['diff']),console['log']('─'[_0x1fa51c(0x196)](0x3c)));}for(const _0x213d2e of _0x4760b0){_0x213d2e[_0x1fa51c(0x14c)]&&(console[_0x1fa51c(0x138)](_0x1fa51c(0x1a6)+_0x213d2e[_0x1fa51c(0x149)]+'\x27:'),console[_0x1fa51c(0x138)]('─'['repeat'](0x3c)),console[_0x1fa51c(0x138)](_0x213d2e[_0x1fa51c(0x14c)]),console[_0x1fa51c(0x138)]('─'[_0x1fa51c(0x196)](0x3c)));}for(const _0x5d4390 of _0x10b585){_0x5d4390[_0x1fa51c(0x14c)]&&(console['log'](_0x1fa51c(0x190)+_0x5d4390[_0x1fa51c(0x149)]+'\x27:'),console[_0x1fa51c(0x138)]('─'[_0x1fa51c(0x196)](0x3c)),console[_0x1fa51c(0x138)](_0x5d4390[_0x1fa51c(0x14c)]),console[_0x1fa51c(0x138)]('─'['repeat'](0x3c)));}for(const _0x123517 of _0x1edec3){_0x123517[_0x1fa51c(0x14c)]&&(console[_0x1fa51c(0x138)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x123517[_0x1fa51c(0x149)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x1fa51c(0x138)](_0x123517[_0x1fa51c(0x14c)]),console[_0x1fa51c(0x138)]('─'[_0x1fa51c(0x196)](0x3c)));}for(const _0x5e2f6e of _0x479c1f){_0x5e2f6e[_0x1fa51c(0x14c)]&&(console[_0x1fa51c(0x138)](_0x1fa51c(0x169)+_0x5e2f6e[_0x1fa51c(0x149)]+'\x27:'),console['log']('─'[_0x1fa51c(0x196)](0x3c)),console[_0x1fa51c(0x138)](_0x5e2f6e[_0x1fa51c(0x14c)]),console[_0x1fa51c(0x138)]('─'[_0x1fa51c(0x196)](0x3c)));}for(const _0x1a2269 of _0x264fa4){_0x1a2269[_0x1fa51c(0x14c)]&&(console[_0x1fa51c(0x138)](_0x1fa51c(0x13f)+_0x1a2269['name']+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x1fa51c(0x138)](_0x1a2269[_0x1fa51c(0x14c)]),console[_0x1fa51c(0x138)]('─'[_0x1fa51c(0x196)](0x3c)));}for(const _0xcdd73f of _0x4d1739){_0xcdd73f[_0x1fa51c(0x14c)]&&(console[_0x1fa51c(0x138)](_0x1fa51c(0x1bf)+_0xcdd73f['name']+'\x27:'),console[_0x1fa51c(0x138)]('─'['repeat'](0x3c)),console[_0x1fa51c(0x138)](_0xcdd73f[_0x1fa51c(0x14c)]),console[_0x1fa51c(0x138)]('─'[_0x1fa51c(0x196)](0x3c)));}for(const _0x22d8b6 of _0x32ae87){_0x22d8b6[_0x1fa51c(0x14c)]&&(console['log'](_0x1fa51c(0x16c)+_0x22d8b6[_0x1fa51c(0x149)]+'\x27:'),console[_0x1fa51c(0x138)]('─'['repeat'](0x3c)),console[_0x1fa51c(0x138)](_0x22d8b6[_0x1fa51c(0x14c)]),console[_0x1fa51c(0x138)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x3a9015(0x149)]='agent:pull';['description']='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x3a9015(0x1be)](_0x213dd0){const _0xa3c958=a4_0x3a9015,{options:_0x44d7e8,args:_0x2f7ce8,tdx:_0x5a9bfd}=_0x213dd0,_0x190899=_0x2f7ce8[0x0],_0x288985=_0x2f7ce8[0x1],_0x5aa4c3=_0x44d7e8[_0xa3c958(0x1df)],_0x1a1988=_0x44d7e8[_0xa3c958(0x19d)],_0x28f8c5=_0x44d7e8[_0xa3c958(0x19b)],_0x11c315=_0x44d7e8[_0xa3c958(0x174)],_0x190787=_0x44d7e8[_0xa3c958(0x1aa)],_0x1f8e3b=_0x44d7e8['agent'];let _0x3d8ef8;if(_0x190899){const _0x358c19=a4_0x316358[_0xa3c958(0x180)](_0x190899,_0xa3c958(0x13d));if(existsSync(_0x358c19))try{const _0x4ed2dc=JSON['parse'](readFileSync(_0x358c19,_0xa3c958(0x176)));_0x4ed2dc[_0xa3c958(0x189)]&&(_0x3d8ef8={'llm_project':_0x4ed2dc[_0xa3c958(0x189)]});}catch{}}const _0x1b26dc=findAgentConfigPath(process[_0xa3c958(0x170)]());let _0x10fab7;if(_0x1b26dc)try{const _0x4fa559=JSON['parse'](readFileSync(_0x1b26dc,_0xa3c958(0x176)));_0x4fa559[_0xa3c958(0x189)]&&(_0x10fab7={'llm_project':_0x4fa559[_0xa3c958(0x189)]});}catch{}const _0x283e06=resolveAgentPullArgs({'arg':_0x190899,'agentNameArg':_0x288985,'agentFlag':_0x1f8e3b,'contextProject':_0x190787,'argDirConfig':_0x3d8ef8,'cwdConfigPath':_0x1b26dc||undefined,'cwdConfig':_0x10fab7}),{projectNameOrId:_0x10e3e7,targetAgentName:_0x351535,existingOutputDir:_0x252474,source:_0x339d20}=_0x283e06;if(_0x339d20===_0xa3c958(0x1bb))console['log'](a4_0x3b372a['dim']('Using\x20project\x20from\x20'+a4_0x316358[_0xa3c958(0x180)](_0x190899,_0xa3c958(0x13d))+':\x20'+_0x10e3e7));else{if(_0x339d20===_0xa3c958(0x12e))console['log'](a4_0x3b372a[_0xa3c958(0x164)](_0xa3c958(0x154)+_0x10e3e7));else _0x339d20===_0xa3c958(0x153)&&console[_0xa3c958(0x138)](a4_0x3b372a[_0xa3c958(0x164)](_0xa3c958(0x1a7)+_0x10e3e7));}if(!_0x10e3e7)return _0x1f8e3b?(console[_0xa3c958(0x138)](a4_0x3b372a[_0xa3c958(0x141)](_0xa3c958(0x185))),console[_0xa3c958(0x138)](_0xa3c958(0x139)),console[_0xa3c958(0x138)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0xa3c958(0x138)](a4_0x3b372a[_0xa3c958(0x141)](_0xa3c958(0x1b2))),console[_0xa3c958(0x138)](_0xa3c958(0x157)),console[_0xa3c958(0x138)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0xa3c958(0x138)]('\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'),console[_0xa3c958(0x138)]('\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[_0xa3c958(0x138)]('\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(_0x351535){const {data:_0x143be0}=await withSpinner('Pulling\x20agent\x20\x22'+_0x351535+_0xa3c958(0x12f)+_0x10e3e7+'\x22...',()=>_0x5a9bfd[_0xa3c958(0x123)][_0xa3c958(0x15f)](_0x10e3e7,_0x351535,_0x5aa4c3,{'dryRun':_0x1a1988,'force':_0x28f8c5}));if(_0x1a1988)return console['log'](a4_0x3b372a['yellow'](_0xa3c958(0x19a))),console[_0xa3c958(0x138)]('Would\x20pull\x20agent:\x20'+_0x143be0['agentName']),console[_0xa3c958(0x138)](_0xa3c958(0x1dd)+_0x143be0[_0xa3c958(0x1b5)]),_0x143be0[_0xa3c958(0x14c)]&&(console[_0xa3c958(0x138)](_0xa3c958(0x1a0)),console[_0xa3c958(0x138)]('─'[_0xa3c958(0x196)](0x3c)),console[_0xa3c958(0x138)](_0x143be0['diff']),console[_0xa3c958(0x138)]('─'['repeat'](0x3c))),0x0;return console[_0xa3c958(0x138)](a4_0x3b372a[_0xa3c958(0x168)](_0xa3c958(0x1cd))),console[_0xa3c958(0x138)](_0xa3c958(0x1db)+_0x143be0[_0xa3c958(0x17d)]),console['log']('Output:\x20'+_0x143be0[_0xa3c958(0x1b5)]),console[_0xa3c958(0x138)](_0xa3c958(0x1d8)+(_0x143be0[_0xa3c958(0x183)]?a4_0x3b372a[_0xa3c958(0x168)](_0xa3c958(0x178)):_0x143be0['hasChanges']?a4_0x3b372a['yellow'](_0xa3c958(0x1e0)):a4_0x3b372a[_0xa3c958(0x1bd)]('unchanged'))),0x0;}const _0x23e5af=_0x252474||_0x5aa4c3,{data:_0x270c83}=await withSpinner(_0xa3c958(0x137)+_0x10e3e7+_0xa3c958(0x1d3),()=>_0x5a9bfd['llm'][_0xa3c958(0x18f)](_0x10e3e7,_0x23e5af,{'dryRun':!![]})),_0x43cafd=_0x270c83[_0xa3c958(0x131)]['agents']['new']+_0x270c83[_0xa3c958(0x131)][_0xa3c958(0x17b)][_0xa3c958(0x178)]+_0x270c83['counts'][_0xa3c958(0x127)][_0xa3c958(0x178)]+_0x270c83[_0xa3c958(0x131)][_0xa3c958(0x1d5)][_0xa3c958(0x178)]+_0x270c83[_0xa3c958(0x131)][_0xa3c958(0x175)][_0xa3c958(0x178)]+_0x270c83[_0xa3c958(0x131)][_0xa3c958(0x1b8)][_0xa3c958(0x178)]+_0x270c83['counts'][_0xa3c958(0x1dc)]['new']+_0x270c83['counts'][_0xa3c958(0x17c)]['new']+_0x270c83[_0xa3c958(0x131)][_0xa3c958(0x182)]['new'],_0x13cfe3=_0x270c83[_0xa3c958(0x131)]['agents'][_0xa3c958(0x1e0)]+_0x270c83[_0xa3c958(0x131)][_0xa3c958(0x17b)][_0xa3c958(0x1e0)]+_0x270c83[_0xa3c958(0x131)][_0xa3c958(0x127)][_0xa3c958(0x1e0)]+_0x270c83['counts']['prompts'][_0xa3c958(0x1e0)]+_0x270c83[_0xa3c958(0x131)][_0xa3c958(0x175)][_0xa3c958(0x1e0)]+_0x270c83[_0xa3c958(0x131)][_0xa3c958(0x1b8)][_0xa3c958(0x1e0)]+_0x270c83[_0xa3c958(0x131)][_0xa3c958(0x1dc)][_0xa3c958(0x1e0)]+_0x270c83[_0xa3c958(0x131)][_0xa3c958(0x17c)][_0xa3c958(0x1e0)]+_0x270c83[_0xa3c958(0x131)][_0xa3c958(0x182)][_0xa3c958(0x1e0)],_0x913981=_0x270c83[_0xa3c958(0x131)][_0xa3c958(0x1b6)][_0xa3c958(0x193)]+_0x270c83['counts'][_0xa3c958(0x17b)][_0xa3c958(0x193)]+_0x270c83[_0xa3c958(0x131)][_0xa3c958(0x127)]['unchanged']+_0x270c83[_0xa3c958(0x131)]['prompts']['unchanged']+_0x270c83[_0xa3c958(0x131)][_0xa3c958(0x175)][_0xa3c958(0x193)]+_0x270c83[_0xa3c958(0x131)][_0xa3c958(0x1b8)][_0xa3c958(0x193)]+_0x270c83[_0xa3c958(0x131)][_0xa3c958(0x1dc)][_0xa3c958(0x193)]+_0x270c83[_0xa3c958(0x131)][_0xa3c958(0x17c)]['unchanged']+_0x270c83[_0xa3c958(0x131)]['chatInterfaces'][_0xa3c958(0x193)];console[_0xa3c958(0x138)](_0xa3c958(0x147)+_0x270c83[_0xa3c958(0x14e)]+'\x27:'),console[_0xa3c958(0x138)]('\x20\x20'+a4_0x3b372a[_0xa3c958(0x168)]('+\x20'+_0x43cafd+_0xa3c958(0x13c))+_0xa3c958(0x1c5)+a4_0x3b372a[_0xa3c958(0x141)]('~\x20'+_0x13cfe3+'\x20changed')+'\x20|\x20'+a4_0x3b372a['dim']('=\x20'+_0x913981+_0xa3c958(0x17f))),console[_0xa3c958(0x138)](_0xa3c958(0x186)+formatCountSummary(_0x270c83[_0xa3c958(0x131)][_0xa3c958(0x1b6)])),console[_0xa3c958(0x138)](_0xa3c958(0x125)+formatCountSummary(_0x270c83[_0xa3c958(0x131)]['knowledgeBases'])),console[_0xa3c958(0x138)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x270c83[_0xa3c958(0x131)][_0xa3c958(0x127)])),console[_0xa3c958(0x138)](_0xa3c958(0x160)+formatCountSummary(_0x270c83[_0xa3c958(0x131)][_0xa3c958(0x1d5)])),console[_0xa3c958(0x138)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x270c83[_0xa3c958(0x131)]['integrations'])),console[_0xa3c958(0x138)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x270c83[_0xa3c958(0x131)]['formInterfaces'])),console[_0xa3c958(0x138)](_0xa3c958(0x140)+formatCountSummary(_0x270c83[_0xa3c958(0x131)][_0xa3c958(0x182)]));const _0x1a3e18=_0x270c83['counts'][_0xa3c958(0x1b8)][_0xa3c958(0x1cc)]>0x0||_0x270c83[_0xa3c958(0x131)][_0xa3c958(0x1dc)][_0xa3c958(0x1cc)]>0x0;_0x1a3e18&&(console[_0xa3c958(0x138)](_0xa3c958(0x15a)+formatCountSummary(_0x270c83[_0xa3c958(0x131)]['experimentalKnowledgeBases'])),console['log'](_0xa3c958(0x145)+formatCountSummary(_0x270c83[_0xa3c958(0x131)]['experimentalArtifacts'])));console[_0xa3c958(0x138)](_0xa3c958(0x161)+a4_0x3b372a['cyan'](_0x270c83['outputDir'])),displayDiffs(_0x270c83[_0xa3c958(0x1b6)],_0x270c83[_0xa3c958(0x17b)],_0x270c83[_0xa3c958(0x127)],_0x270c83[_0xa3c958(0x1d5)],_0x270c83[_0xa3c958(0x175)],_0x270c83[_0xa3c958(0x1b8)],_0x270c83[_0xa3c958(0x1dc)],_0x270c83[_0xa3c958(0x17c)],_0x270c83[_0xa3c958(0x182)]);if(_0x1a1988)return console[_0xa3c958(0x138)](a4_0x3b372a['yellow'](_0xa3c958(0x1ae))),0x0;if(_0x43cafd===0x0&&_0x13cfe3===0x0)return console[_0xa3c958(0x138)](a4_0x3b372a[_0xa3c958(0x168)](_0xa3c958(0x148))),saveSessionContext({'llm_project':_0x270c83[_0xa3c958(0x14e)]},_0x44d7e8[_0xa3c958(0x15c)]),console[_0xa3c958(0x138)](a4_0x3b372a['green'](_0xa3c958(0x1c7)+a4_0x3b372a[_0xa3c958(0x164)](_0xa3c958(0x189))+'\x20=\x20'+a4_0x3b372a[_0xa3c958(0x167)](_0x270c83[_0xa3c958(0x14e)]))),0x0;if(!_0x11c315&&!_0x28f8c5){if(!isInteractive())return console[_0xa3c958(0x18b)](a4_0x3b372a[_0xa3c958(0x155)](_0xa3c958(0x12a)),_0xa3c958(0x1b3)),console[_0xa3c958(0x18b)](a4_0x3b372a[_0xa3c958(0x164)](_0xa3c958(0x136))),0x1;const _0x131aaa=await confirmKey('\x0aWrite\x20'+(_0x43cafd+_0x13cfe3)+'\x20files?');if(!_0x131aaa)return console[_0xa3c958(0x138)](a4_0x3b372a[_0xa3c958(0x141)](_0xa3c958(0x1a8)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x11382e}=await withSpinner(_0xa3c958(0x1d2),()=>_0x5a9bfd[_0xa3c958(0x123)]['pullProject'](_0x10e3e7,_0x23e5af,{'force':_0x28f8c5}));return console[_0xa3c958(0x138)](a4_0x3b372a['green'](_0xa3c958(0x1cb)+(_0x43cafd+_0x13cfe3)+'\x20files\x20to\x20'+_0x11382e[_0xa3c958(0x1c9)])),saveSessionContext({'llm_project':_0x11382e['projectName']},_0x44d7e8[_0xa3c958(0x15c)]),console[_0xa3c958(0x138)](a4_0x3b372a[_0xa3c958(0x168)](_0xa3c958(0x1c7)+a4_0x3b372a[_0xa3c958(0x164)](_0xa3c958(0x189))+_0xa3c958(0x19f)+a4_0x3b372a[_0xa3c958(0x167)](_0x11382e[_0xa3c958(0x14e)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x3a9015(0x149)]=a4_0x3a9015(0x1de);[a4_0x3a9015(0x18a)]=a4_0x3a9015(0x166);async['execute'](_0x2c3443){const _0x4f3350=a4_0x3a9015,{options:_0x3bffda,args:_0x6d989d,tdx:_0x1dab5a}=_0x2c3443,_0x3f7731=_0x6d989d[0x0],_0x430825=_0x3bffda['name'],_0x573c25=_0x3bffda[_0x4f3350(0x19d)],_0x4d2c89=_0x3bffda[_0x4f3350(0x174)],_0x1ce017=_0x3bffda[_0x4f3350(0x1c8)],_0x45a9ef=_0x3bffda[_0x4f3350(0x1aa)];let _0x4da935;const _0x136bf9=findAgentConfigPath(process[_0x4f3350(0x170)]());if(_0x3f7731){const _0x5d859d=a4_0x316358['join'](_0x3f7731,_0x4f3350(0x13d));existsSync(_0x5d859d)?(_0x4da935=_0x3f7731,console['log'](a4_0x3b372a[_0x4f3350(0x164)](_0x4f3350(0x1c6)+_0x3f7731))):_0x4da935=_0x3f7731;}else{if(_0x136bf9)_0x4da935=a4_0x316358[_0x4f3350(0x1cf)](_0x136bf9),console['log'](a4_0x3b372a[_0x4f3350(0x164)]('Using\x20current\x20project:\x20'+_0x4da935));else{if(_0x45a9ef){const _0x2562ca=sanitizeForFilesystem(_0x45a9ef);let _0x3f4b90=_0x2562ca,_0x2cd868=a4_0x316358[_0x4f3350(0x180)](process[_0x4f3350(0x170)](),'agents',_0x2562ca,_0x4f3350(0x13d));if(!existsSync(_0x2cd868)){const _0x101f45=normalizeName(_0x45a9ef),_0x10ec35=a4_0x316358[_0x4f3350(0x180)](process[_0x4f3350(0x170)](),_0x4f3350(0x1b6),_0x101f45,'tdx.json');existsSync(_0x10ec35)&&(_0x3f4b90=_0x101f45,_0x2cd868=_0x10ec35);}if(existsSync(_0x2cd868))_0x4da935=a4_0x316358['dirname'](_0x2cd868),console[_0x4f3350(0x138)](a4_0x3b372a[_0x4f3350(0x164)](_0x4f3350(0x1c6)+_0x4da935));else{const _0x2bb20a=_0x3bffda['profile'];if(_0x2bb20a)throw new SDKError(ErrorCode[_0x4f3350(0x1a1)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x45a9ef+_0x4f3350(0x124),undefined,{'helpText':_0x4f3350(0x165)+_0x4f3350(0x194)+(_0x4f3350(0x158)+_0x45a9ef+'\x0a')+(_0x4f3350(0x163)+_0x3f4b90+_0x4f3350(0x172)+(_0x430825||_0x4f3350(0x135))+_0x4f3350(0x17a)+_0x2bb20a)});_0x4da935=_0x45a9ef,console['log'](a4_0x3b372a[_0x4f3350(0x164)](_0x4f3350(0x134)+_0x45a9ef));}}}}if(!_0x4da935)return console[_0x4f3350(0x138)](a4_0x3b372a[_0x4f3350(0x141)](_0x4f3350(0x1ad))),console['log'](_0x4f3350(0x199)),console['log'](_0x4f3350(0x1c4)),console[_0x4f3350(0x138)]('\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'](_0x4f3350(0x129)),0x1;if(!_0x430825)throw new SDKError(ErrorCode[_0x4f3350(0x1c3)],_0x4f3350(0x13b),undefined,{'helpText':_0x4f3350(0x16a)});if(!_0x4d2c89&&!_0x573c25){if(!isInteractive())return console[_0x4f3350(0x18b)](a4_0x3b372a['red']('\x0aError:'),_0x4f3350(0x1b3)),console[_0x4f3350(0x18b)](a4_0x3b372a[_0x4f3350(0x164)](_0x4f3350(0x136))),0x1;const _0x42b1c2=await confirmKey(_0x4f3350(0x1a9)+_0x4da935+_0x4f3350(0x1b0)+_0x430825+'\x22?');if(!_0x42b1c2)return console[_0x4f3350(0x138)](a4_0x3b372a['yellow'](_0x4f3350(0x1a8))),0x1;}const {data:_0x478676}=await withSpinner(_0x4f3350(0x1ba)+_0x4da935+_0x4f3350(0x159)+_0x430825+_0x4f3350(0x1d3),()=>_0x1dab5a['llm'][_0x4f3350(0x146)](_0x4da935,_0x430825,{'dryRun':_0x573c25}));if(_0x573c25){console['log'](a4_0x3b372a[_0x4f3350(0x141)](_0x4f3350(0x1c1))),console[_0x4f3350(0x138)](_0x4f3350(0x18c)+_0x478676[_0x4f3350(0x128)]),console[_0x4f3350(0x138)](_0x4f3350(0x1af)+_0x430825),console[_0x4f3350(0x138)]('Would\x20clone:'),console['log'](_0x4f3350(0x186)+_0x478676[_0x4f3350(0x131)][_0x4f3350(0x1b6)][_0x4f3350(0x12c)]),console['log'](_0x4f3350(0x125)+_0x478676[_0x4f3350(0x131)][_0x4f3350(0x17b)][_0x4f3350(0x12c)]),console[_0x4f3350(0x138)](_0x4f3350(0x160)+_0x478676[_0x4f3350(0x131)][_0x4f3350(0x1d5)][_0x4f3350(0x12c)]),console[_0x4f3350(0x138)](_0x4f3350(0x126)+_0x478676[_0x4f3350(0x131)][_0x4f3350(0x17c)][_0x4f3350(0x12c)]),console[_0x4f3350(0x138)](_0x4f3350(0x140)+_0x478676['counts']['chatInterfaces'][_0x4f3350(0x12c)]);const _0xea3829=_0x478676[_0x4f3350(0x131)][_0x4f3350(0x1b8)][_0x4f3350(0x12c)]>0x0||_0x478676[_0x4f3350(0x131)][_0x4f3350(0x1dc)][_0x4f3350(0x12c)]>0x0;return _0xea3829&&(console[_0x4f3350(0x138)](_0x4f3350(0x15a)+_0x478676[_0x4f3350(0x131)]['experimentalKnowledgeBases']['created']),console[_0x4f3350(0x138)](_0x4f3350(0x145)+_0x478676[_0x4f3350(0x131)][_0x4f3350(0x1dc)][_0x4f3350(0x12c)])),0x0;}const _0x54d8c5=_0x478676[_0x4f3350(0x131)][_0x4f3350(0x1b6)][_0x4f3350(0x1ac)]>0x0||_0x478676['counts'][_0x4f3350(0x17b)][_0x4f3350(0x1ac)]>0x0||_0x478676[_0x4f3350(0x131)][_0x4f3350(0x1d5)][_0x4f3350(0x1ac)]>0x0||_0x478676[_0x4f3350(0x131)][_0x4f3350(0x17c)][_0x4f3350(0x1ac)]>0x0||_0x478676[_0x4f3350(0x131)][_0x4f3350(0x182)]['errors']>0x0||_0x478676[_0x4f3350(0x131)][_0x4f3350(0x1b8)]['errors']>0x0||_0x478676[_0x4f3350(0x131)][_0x4f3350(0x1dc)][_0x4f3350(0x1ac)]>0x0;_0x54d8c5?console['log'](a4_0x3b372a[_0x4f3350(0x141)](_0x4f3350(0x16e))):console['log'](a4_0x3b372a[_0x4f3350(0x168)](_0x4f3350(0x171)));console[_0x4f3350(0x138)](_0x4f3350(0x18c)+_0x478676[_0x4f3350(0x128)]),console[_0x4f3350(0x138)](_0x4f3350(0x1af)+_0x478676[_0x4f3350(0x179)]),console['log'](_0x4f3350(0x1b1)+_0x478676[_0x4f3350(0x1a3)]),console[_0x4f3350(0x138)](),console[_0x4f3350(0x138)](_0x4f3350(0x15b)),console[_0x4f3350(0x138)](_0x4f3350(0x186)+formatCountSummary(_0x478676['counts']['agents'])),console[_0x4f3350(0x138)](_0x4f3350(0x125)+formatCountSummary(_0x478676[_0x4f3350(0x131)][_0x4f3350(0x17b)])),console[_0x4f3350(0x138)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x478676[_0x4f3350(0x131)][_0x4f3350(0x1d5)])),console['log'](_0x4f3350(0x13e)+formatCountSummary(_0x478676[_0x4f3350(0x131)][_0x4f3350(0x175)])),console[_0x4f3350(0x138)](_0x4f3350(0x126)+formatCountSummary(_0x478676[_0x4f3350(0x131)][_0x4f3350(0x17c)])),console[_0x4f3350(0x138)](_0x4f3350(0x140)+formatCountSummary(_0x478676[_0x4f3350(0x131)][_0x4f3350(0x182)]));const _0x19f693=_0x478676[_0x4f3350(0x131)][_0x4f3350(0x1b8)][_0x4f3350(0x12c)]>0x0||_0x478676[_0x4f3350(0x131)]['experimentalKnowledgeBases'][_0x4f3350(0x1e0)]>0x0||_0x478676[_0x4f3350(0x131)]['experimentalKnowledgeBases'][_0x4f3350(0x193)]>0x0||_0x478676[_0x4f3350(0x131)][_0x4f3350(0x1dc)]['created']>0x0||_0x478676[_0x4f3350(0x131)][_0x4f3350(0x1dc)][_0x4f3350(0x1e0)]>0x0||_0x478676['counts'][_0x4f3350(0x1dc)][_0x4f3350(0x193)]>0x0;_0x19f693&&(console['log'](_0x4f3350(0x15a)+formatCountSummary(_0x478676['counts'][_0x4f3350(0x1b8)])),console[_0x4f3350(0x138)](_0x4f3350(0x145)+formatCountSummary(_0x478676[_0x4f3350(0x131)][_0x4f3350(0x1dc)])));if(_0x54d8c5){console[_0x4f3350(0x138)](),console[_0x4f3350(0x138)](a4_0x3b372a[_0x4f3350(0x155)](_0x4f3350(0x132)));for(const _0x59cc23 of _0x478676['agents']){_0x59cc23[_0x4f3350(0x14b)]===_0x4f3350(0x18b)&&console[_0x4f3350(0x138)](a4_0x3b372a['red']('\x20\x20Agent\x20\x22'+_0x59cc23[_0x4f3350(0x17d)]+_0x4f3350(0x17e)+_0x59cc23[_0x4f3350(0x18b)]));}for(const _0x58423b of _0x478676['knowledgeBases']){_0x58423b[_0x4f3350(0x14b)]===_0x4f3350(0x18b)&&console['log'](a4_0x3b372a['red'](_0x4f3350(0x184)+_0x58423b[_0x4f3350(0x149)]+_0x4f3350(0x17e)+_0x58423b[_0x4f3350(0x18b)]));}for(const _0x199e43 of _0x478676[_0x4f3350(0x1d5)]){_0x199e43[_0x4f3350(0x14b)]===_0x4f3350(0x18b)&&console[_0x4f3350(0x138)](a4_0x3b372a['red'](_0x4f3350(0x1d9)+_0x199e43[_0x4f3350(0x149)]+_0x4f3350(0x17e)+_0x199e43['error']));}for(const _0x417309 of _0x478676['integrations']){_0x417309[_0x4f3350(0x14b)]==='error'&&console[_0x4f3350(0x138)](a4_0x3b372a['red'](_0x4f3350(0x14a)+_0x417309[_0x4f3350(0x149)]+_0x4f3350(0x17e)+_0x417309['error']));}for(const _0x57dc33 of _0x478676[_0x4f3350(0x17c)]){_0x57dc33[_0x4f3350(0x14b)]===_0x4f3350(0x18b)&&console['log'](a4_0x3b372a[_0x4f3350(0x155)](_0x4f3350(0x152)+_0x57dc33[_0x4f3350(0x149)]+_0x4f3350(0x17e)+_0x57dc33[_0x4f3350(0x18b)]));}for(const _0x2f3f8f of _0x478676['chatInterfaces']){_0x2f3f8f['action']===_0x4f3350(0x18b)&&console['log'](a4_0x3b372a['red']('\x20\x20Chat\x20Interface\x20\x22'+_0x2f3f8f['name']+_0x4f3350(0x17e)+_0x2f3f8f[_0x4f3350(0x18b)]));}for(const _0x10c0b4 of _0x478676[_0x4f3350(0x1b8)]){_0x10c0b4['action']===_0x4f3350(0x18b)&&console['log'](a4_0x3b372a[_0x4f3350(0x155)](_0x4f3350(0x16b)+_0x10c0b4[_0x4f3350(0x149)]+_0x4f3350(0x17e)+_0x10c0b4['error']));}for(const _0x2900d4 of _0x478676['experimentalArtifacts']){_0x2900d4['action']==='error'&&console[_0x4f3350(0x138)](a4_0x3b372a[_0x4f3350(0x155)](_0x4f3350(0x192)+_0x2900d4[_0x4f3350(0x149)]+_0x4f3350(0x17e)+_0x2900d4[_0x4f3350(0x18b)]));}return 0x1;}console[_0x4f3350(0x138)]();const _0x1b3460=getLLMProjectUrl(_0x1ce017,_0x478676['newProjectId']);return console['log']('Project:\x20'+a4_0x3b372a[_0x4f3350(0x167)](_0x1b3460)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x3a9015(0x149)]=a4_0x3a9015(0x12b);['description']='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x3a9015(0x1be)](_0x16eb35){const _0x1e4686=a4_0x3a9015,{options:_0x949719,args:_0x595f91,tdx:_0x37d630}=_0x16eb35;let _0x2dc9cf=_0x595f91[0x0]||process['cwd']();const _0x568d58=_0x949719[_0x1e4686(0x19d)],_0x3db75b=_0x949719[_0x1e4686(0x19b)],_0x1d275b=_0x949719['yes'],_0x23188e=_0x949719['site'],_0x49aff6=a4_0x316358['join'](_0x2dc9cf,'agent.yml'),_0x23a2d4=existsSync(_0x49aff6);if(_0x23a2d4){const {data:_0x227ab8}=await withSpinner(_0x1e4686(0x18d)+_0x2dc9cf+_0x1e4686(0x1d3),()=>_0x37d630['llm'][_0x1e4686(0x151)](_0x2dc9cf,{'dryRun':_0x568d58,'force':_0x3db75b}));if(_0x568d58)return console[_0x1e4686(0x138)](a4_0x3b372a['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console['log']('Would\x20push\x20agent:\x20'+_0x227ab8[_0x1e4686(0x17d)]),0x0;if(_0x227ab8[_0x1e4686(0x14b)]===_0x1e4686(0x18b))return console[_0x1e4686(0x138)](a4_0x3b372a['red'](_0x1e4686(0x1b9)+_0x227ab8[_0x1e4686(0x18b)])),0x1;console['log'](a4_0x3b372a[_0x1e4686(0x168)](_0x1e4686(0x16f)+_0x227ab8[_0x1e4686(0x14b)]+'\x20successfully')),console[_0x1e4686(0x138)](_0x1e4686(0x1db)+_0x227ab8['agentName']);if(_0x227ab8[_0x1e4686(0x14d)]&&_0x227ab8[_0x1e4686(0x162)]){const _0x586792=getLLMAgentChatUrl(_0x23188e,_0x227ab8['projectId'],_0x227ab8['agentId']);console[_0x1e4686(0x138)](_0x1e4686(0x156)+a4_0x3b372a[_0x1e4686(0x167)](_0x586792));}return 0x0;}const _0x5eb842=_0x949719['llmProject'],_0x548285=resolveProjectFromContext(_0x2dc9cf,_0x5eb842);if(_0x548285[_0x1e4686(0x150)])_0x2dc9cf=_0x548285[_0x1e4686(0x1d6)],_0x548285[_0x1e4686(0x14f)]==='context'&&console[_0x1e4686(0x138)](a4_0x3b372a['dim'](_0x1e4686(0x154)+_0x2dc9cf));else{let _0x3939b5=_0x1e4686(0x195);_0x548285[_0x1e4686(0x143)]===_0x1e4686(0x1c0)&&(_0x3939b5=_0x548285[_0x1e4686(0x1a5)]+_0x1e4686(0x188)+_0x548285['llmProject']+_0x1e4686(0x1d7));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x548285[_0x1e4686(0x143)]===_0x1e4686(0x1ab)?_0x548285['message']:'No\x20tdx.json\x20found\x20in\x20'+_0x2dc9cf,undefined,{'helpText':_0x3939b5});}const {data:_0x1d08cd}=await withSpinner(_0x1e4686(0x1b4),()=>_0x37d630['llm']['pushProject'](_0x2dc9cf,{'dryRun':!![]})),_0x35d717=_0x1d08cd[_0x1e4686(0x131)]['agents'][_0x1e4686(0x1ac)]>0x0;if(_0x35d717){console['log'](a4_0x3b372a[_0x1e4686(0x155)](_0x1e4686(0x191)));for(const _0x28c0d2 of _0x1d08cd['agents']){_0x28c0d2['action']==='error'&&console[_0x1e4686(0x138)](a4_0x3b372a[_0x1e4686(0x155)](_0x1e4686(0x198)+_0x28c0d2[_0x1e4686(0x17d)]+_0x1e4686(0x17e)+_0x28c0d2['error']));}return 0x1;}const _0x2ee123=_0x1d08cd['counts'][_0x1e4686(0x1b6)][_0x1e4686(0x12c)]+_0x1d08cd['counts'][_0x1e4686(0x17b)][_0x1e4686(0x12c)]+_0x1d08cd['counts'][_0x1e4686(0x127)][_0x1e4686(0x12c)]+_0x1d08cd[_0x1e4686(0x131)][_0x1e4686(0x1d5)][_0x1e4686(0x12c)]+_0x1d08cd[_0x1e4686(0x131)][_0x1e4686(0x175)][_0x1e4686(0x12c)]+_0x1d08cd[_0x1e4686(0x131)]['experimentalKnowledgeBases'][_0x1e4686(0x12c)]+_0x1d08cd[_0x1e4686(0x131)][_0x1e4686(0x1dc)][_0x1e4686(0x12c)]+_0x1d08cd['counts'][_0x1e4686(0x17c)][_0x1e4686(0x12c)]+_0x1d08cd[_0x1e4686(0x131)]['chatInterfaces'][_0x1e4686(0x12c)],_0x4546ce=_0x1d08cd['counts'][_0x1e4686(0x1b6)][_0x1e4686(0x1e0)]+_0x1d08cd['counts'][_0x1e4686(0x17b)][_0x1e4686(0x1e0)]+_0x1d08cd[_0x1e4686(0x131)]['textKnowledgeBases'][_0x1e4686(0x1e0)]+_0x1d08cd[_0x1e4686(0x131)][_0x1e4686(0x1d5)][_0x1e4686(0x1e0)]+_0x1d08cd[_0x1e4686(0x131)]['integrations'][_0x1e4686(0x1e0)]+_0x1d08cd[_0x1e4686(0x131)][_0x1e4686(0x1b8)]['updated']+_0x1d08cd[_0x1e4686(0x131)][_0x1e4686(0x1dc)][_0x1e4686(0x1e0)]+_0x1d08cd['counts'][_0x1e4686(0x17c)][_0x1e4686(0x1e0)]+_0x1d08cd[_0x1e4686(0x131)]['chatInterfaces']['updated'],_0x50aee9=_0x1d08cd[_0x1e4686(0x131)]['agents'][_0x1e4686(0x193)]+_0x1d08cd[_0x1e4686(0x131)][_0x1e4686(0x17b)][_0x1e4686(0x193)]+_0x1d08cd[_0x1e4686(0x131)][_0x1e4686(0x127)][_0x1e4686(0x193)]+_0x1d08cd[_0x1e4686(0x131)]['prompts'][_0x1e4686(0x193)]+_0x1d08cd[_0x1e4686(0x131)][_0x1e4686(0x175)]['unchanged']+_0x1d08cd[_0x1e4686(0x131)][_0x1e4686(0x1b8)][_0x1e4686(0x193)]+_0x1d08cd[_0x1e4686(0x131)]['experimentalArtifacts'][_0x1e4686(0x193)]+_0x1d08cd[_0x1e4686(0x131)]['formInterfaces']['unchanged']+_0x1d08cd['counts'][_0x1e4686(0x182)][_0x1e4686(0x193)];console[_0x1e4686(0x138)](_0x1e4686(0x12d)+_0x1d08cd[_0x1e4686(0x14e)]+'\x27:'),console[_0x1e4686(0x138)]('\x20\x20'+a4_0x3b372a[_0x1e4686(0x168)]('+\x20'+_0x2ee123+_0x1e4686(0x13c))+'\x20|\x20'+a4_0x3b372a[_0x1e4686(0x141)]('~\x20'+_0x4546ce+_0x1e4686(0x1d0))+_0x1e4686(0x1c5)+a4_0x3b372a[_0x1e4686(0x164)]('=\x20'+_0x50aee9+'\x20unchanged')),console[_0x1e4686(0x138)]('\x20\x20Agents:\x20'+formatCountSummary(_0x1d08cd[_0x1e4686(0x131)]['agents'])),console[_0x1e4686(0x138)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1d08cd['counts']['knowledgeBases'])),console['log'](_0x1e4686(0x133)+formatCountSummary(_0x1d08cd[_0x1e4686(0x131)]['textKnowledgeBases'])),console[_0x1e4686(0x138)](_0x1e4686(0x160)+formatCountSummary(_0x1d08cd['counts'][_0x1e4686(0x1d5)])),console[_0x1e4686(0x138)](_0x1e4686(0x13e)+formatCountSummary(_0x1d08cd[_0x1e4686(0x131)][_0x1e4686(0x175)])),console[_0x1e4686(0x138)](_0x1e4686(0x126)+formatCountSummary(_0x1d08cd[_0x1e4686(0x131)][_0x1e4686(0x17c)])),console['log'](_0x1e4686(0x140)+formatCountSummary(_0x1d08cd['counts'][_0x1e4686(0x182)]));const _0x24eb25=_0x1d08cd['counts'][_0x1e4686(0x1b8)][_0x1e4686(0x12c)]>0x0||_0x1d08cd['counts'][_0x1e4686(0x1b8)][_0x1e4686(0x1e0)]>0x0||_0x1d08cd[_0x1e4686(0x131)][_0x1e4686(0x1b8)][_0x1e4686(0x193)]>0x0||_0x1d08cd['counts']['experimentalArtifacts'][_0x1e4686(0x12c)]>0x0||_0x1d08cd[_0x1e4686(0x131)][_0x1e4686(0x1dc)][_0x1e4686(0x1e0)]>0x0||_0x1d08cd[_0x1e4686(0x131)][_0x1e4686(0x1dc)][_0x1e4686(0x193)]>0x0;_0x24eb25&&(console[_0x1e4686(0x138)](_0x1e4686(0x15a)+formatCountSummary(_0x1d08cd[_0x1e4686(0x131)][_0x1e4686(0x1b8)])),console[_0x1e4686(0x138)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x1d08cd[_0x1e4686(0x131)][_0x1e4686(0x1dc)])));console[_0x1e4686(0x138)](_0x1e4686(0x1ce)+a4_0x3b372a['cyan'](_0x2dc9cf)),displayDiffs(_0x1d08cd[_0x1e4686(0x1b6)],_0x1d08cd[_0x1e4686(0x17b)],_0x1d08cd[_0x1e4686(0x127)],_0x1d08cd['prompts'],_0x1d08cd[_0x1e4686(0x175)],_0x1d08cd[_0x1e4686(0x1b8)],_0x1d08cd['experimentalArtifacts'],_0x1d08cd[_0x1e4686(0x17c)],_0x1d08cd['chatInterfaces']);if(_0x568d58)return console[_0x1e4686(0x138)](a4_0x3b372a['yellow'](_0x1e4686(0x1a4))),0x0;if(_0x2ee123===0x0&&_0x4546ce===0x0){console[_0x1e4686(0x138)](a4_0x3b372a[_0x1e4686(0x168)](_0x1e4686(0x1a2)));const _0x3e53af=getLLMProjectUrl(_0x23188e,_0x1d08cd[_0x1e4686(0x162)]);return console[_0x1e4686(0x138)]('Project:\x20'+a4_0x3b372a['cyan'](_0x3e53af)),0x0;}if(!_0x1d275b&&!_0x3db75b){if(!isInteractive())return console[_0x1e4686(0x18b)](a4_0x3b372a[_0x1e4686(0x155)](_0x1e4686(0x12a)),_0x1e4686(0x1b3)),console[_0x1e4686(0x18b)](a4_0x3b372a[_0x1e4686(0x164)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x462b29=await confirmKey('\x0aPush\x20'+(_0x2ee123+_0x4546ce)+'\x20resources?');if(!_0x462b29)return console[_0x1e4686(0x138)](a4_0x3b372a['yellow'](_0x1e4686(0x1a8)),'-\x20nothing\x20pushed'),0x1;}const {data:_0xfcba94}=await withSpinner(_0x1e4686(0x18e),()=>_0x37d630[_0x1e4686(0x123)][_0x1e4686(0x197)](_0x2dc9cf,{'force':_0x3db75b})),_0x3ce87a=_0xfcba94['counts']['agents'][_0x1e4686(0x1ac)]>0x0||_0xfcba94[_0x1e4686(0x131)][_0x1e4686(0x17b)]['errors']>0x0||_0xfcba94[_0x1e4686(0x131)]['textKnowledgeBases'][_0x1e4686(0x1ac)]>0x0||_0xfcba94['counts'][_0x1e4686(0x1d5)][_0x1e4686(0x1ac)]>0x0||_0xfcba94[_0x1e4686(0x131)]['formInterfaces'][_0x1e4686(0x1ac)]>0x0||_0xfcba94['counts']['chatInterfaces'][_0x1e4686(0x1ac)]>0x0;if(_0x3ce87a){console['log'](a4_0x3b372a[_0x1e4686(0x141)](_0x1e4686(0x173))),console[_0x1e4686(0x138)](),console['log'](a4_0x3b372a[_0x1e4686(0x155)](_0x1e4686(0x132)));for(const _0x379616 of _0xfcba94['agents']){_0x379616[_0x1e4686(0x14b)]===_0x1e4686(0x18b)&&console['log'](a4_0x3b372a['red']('\x20\x20Agent\x20\x22'+_0x379616[_0x1e4686(0x17d)]+_0x1e4686(0x17e)+_0x379616[_0x1e4686(0x18b)]));}for(const _0x5153ca of _0xfcba94[_0x1e4686(0x17b)]){_0x5153ca[_0x1e4686(0x14b)]===_0x1e4686(0x18b)&&console[_0x1e4686(0x138)](a4_0x3b372a[_0x1e4686(0x155)](_0x1e4686(0x184)+_0x5153ca[_0x1e4686(0x149)]+_0x1e4686(0x17e)+_0x5153ca[_0x1e4686(0x18b)]));}for(const _0x4e1ca8 of _0xfcba94[_0x1e4686(0x127)]){_0x4e1ca8[_0x1e4686(0x14b)]==='error'&&console[_0x1e4686(0x138)](a4_0x3b372a[_0x1e4686(0x155)](_0x1e4686(0x15d)+_0x4e1ca8['name']+_0x1e4686(0x17e)+_0x4e1ca8['error']));}for(const _0x2e4a27 of _0xfcba94[_0x1e4686(0x1d5)]){_0x2e4a27[_0x1e4686(0x14b)]==='error'&&console[_0x1e4686(0x138)](a4_0x3b372a['red'](_0x1e4686(0x1d9)+_0x2e4a27[_0x1e4686(0x149)]+'\x22:\x20'+_0x2e4a27[_0x1e4686(0x18b)]));}for(const _0x21b2de of _0xfcba94[_0x1e4686(0x175)]){_0x21b2de[_0x1e4686(0x14b)]===_0x1e4686(0x18b)&&console[_0x1e4686(0x138)](a4_0x3b372a['red'](_0x1e4686(0x14a)+_0x21b2de[_0x1e4686(0x149)]+_0x1e4686(0x17e)+_0x21b2de['error']));}for(const _0x2594ba of _0xfcba94[_0x1e4686(0x17c)]){_0x2594ba[_0x1e4686(0x14b)]===_0x1e4686(0x18b)&&console['log'](a4_0x3b372a[_0x1e4686(0x155)](_0x1e4686(0x152)+_0x2594ba['name']+'\x22:\x20'+_0x2594ba['error']));}for(const _0x2e52ee of _0xfcba94[_0x1e4686(0x182)]){_0x2e52ee[_0x1e4686(0x14b)]===_0x1e4686(0x18b)&&console[_0x1e4686(0x138)](a4_0x3b372a[_0x1e4686(0x155)](_0x1e4686(0x181)+_0x2e52ee[_0x1e4686(0x149)]+'\x22:\x20'+_0x2e52ee['error']));}return 0x1;}console[_0x1e4686(0x138)](a4_0x3b372a[_0x1e4686(0x168)]('\x0a✔\x20Pushed\x20'+(_0x2ee123+_0x4546ce)+'\x20resources\x20to\x20\x27'+_0xfcba94['projectName']+'\x27'));const _0x30d626=getLLMProjectUrl(_0x23188e,_0xfcba94[_0x1e4686(0x162)]);return console[_0x1e4686(0x138)](_0x1e4686(0x177)+a4_0x3b372a[_0x1e4686(0x167)](_0x30d626)),0x0;}}function a4_0x365c(){const _0x5f10db=['2CamzCR','reason','238VxUdzP','\x20\x20Experimental\x20Artifacts:\x20','cloneProject','\x0aPull\x20summary\x20for\x20\x27','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','name','\x20\x20Integration\x20\x22','action','diff','agentId','projectName','source','found','pushAgent','\x20\x20Form\x20Interface\x20\x22','context','Using\x20project:\x20','red','Chat:\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)','\x20\x20tdx\x20agent\x20pull\x20','\x22\x20to\x20\x22','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Summary:','session','\x20\x20Text\x20Knowledge\x20Base\x20\x22','907213uMYqhR','pullAgent','\x20\x20Prompts:\x20','\x20\x20Target:\x20','projectId','\x20\x20tdx\x20agent\x20clone\x20agents/','dim','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','cyan','green','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x0aChanges\x20to\x20chat\x20interface\x20\x27','240696VLqwsB','Project\x20cloned\x20with\x20errors','Agent\x20','cwd','Project\x20cloned\x20successfully','\x20--name\x20','\x0aProject\x20pushed\x20with\x20errors','yes','integrations','utf-8','Project:\x20','new','newProjectName','\x20--profile\x20','knowledgeBases','formInterfaces','agentName','\x22:\x20','\x20unchanged','join','\x20\x20Chat\x20Interface\x20\x22','chatInterfaces','isNew','\x20\x20Knowledge\x20Base\x20\x22','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x20\x20Agents:\x20','4444656FgOoHY','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','llm_project','description','error','Source:\x20','Pushing\x20agent\x20from\x20\x22','Pushing\x20to\x20project...','pullProject','\x0aChanges\x20to\x20prompt\x20\x27','\x0aErrors\x20found:','\x20\x20Experimental\x20Artifact\x20\x22','unchanged','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','repeat','pushProject','\x20\x20Agent\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Dry\x20run\x20-\x20no\x20files\x20written','force','5aGyEpE','dryRun','\x20total','\x20=\x20','\x0aChanges:','INVALID_ARGUMENT','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','newProjectId','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','message','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Using\x20project\x20from\x20context:\x20','Cancelled','Clone\x20\x22','llmProject','no_context','errors','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','New\x20project:\x20','\x22\x20to\x20new\x20project\x20\x22','New\x20project\x20ID:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Analyzing\x20changes\x20to\x20push...','outputPath','agents','\x20updated','experimentalKnowledgeBases','Failed\x20to\x20push\x20agent:\x20','Cloning\x20\x22','arg-dir','10678888SGxCIw','gray','execute','\x0aChanges\x20to\x20form\x20interface\x20\x27','no_local_folder','Dry\x20run\x20-\x20no\x20changes\x20made','7722612BMxPAU','MISSING_ARGUMENT','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20|\x20','Using\x20local\x20project:\x20','✔\x20Context\x20set:\x20','site','outputDir','\x20created','\x0a✔\x20Pulled\x20','total','Agent\x20pulled\x20successfully','\x20\x20Source:\x20','dirname','\x20changed','1027100vARmUT','Writing\x20files...','\x22...','44fkvrMl','prompts','projectDir','\x27\x20to\x20create\x20the\x20folder\x20structure.','Status:\x20','\x20\x20Prompt\x20\x22','3321771tfNKOt','Agent:\x20','experimentalArtifacts','Output\x20path:\x20','agent:clone','output','updated','llm','\x22\x20to\x20a\x20different\x20profile','\x20\x20Knowledge\x20Bases:\x20','\x20\x20Form\x20Interfaces:\x20','textKnowledgeBases','sourceProjectName','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x0aError:','agent:push','created','\x0aPush\x20summary\x20for\x20\x27','cwd-config','\x22\x20from\x20project\x20\x22','\x0aChanges\x20to\x20agent\x20\x27','counts','Errors:','\x20\x20Text\x20Knowledge\x20Bases:\x20','Using\x20context\x20project:\x20','<new-name>','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Analyzing\x20project\x20\x22','log','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','push','New\x20project\x20name\x20is\x20required','\x20new','tdx.json','\x20\x20Integrations:\x20','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20\x20Chat\x20Interfaces:\x20','yellow'];a4_0x365c=function(){return _0x5f10db;};return a4_0x365c();}
@@ -1 +1 @@
1
- const a5_0x4b9afb=a5_0x3836;(function(_0x419c50,_0x8ce4b9){const _0x4a19ea=a5_0x3836,_0x4a7004=_0x419c50();while(!![]){try{const _0x488e0b=parseInt(_0x4a19ea(0x144))/0x1+parseInt(_0x4a19ea(0x11a))/0x2*(-parseInt(_0x4a19ea(0x171))/0x3)+-parseInt(_0x4a19ea(0x113))/0x4+parseInt(_0x4a19ea(0x16e))/0x5+-parseInt(_0x4a19ea(0x175))/0x6+parseInt(_0x4a19ea(0xee))/0x7+-parseInt(_0x4a19ea(0xef))/0x8*(-parseInt(_0x4a19ea(0xf9))/0x9);if(_0x488e0b===_0x8ce4b9)break;else _0x4a7004['push'](_0x4a7004['shift']());}catch(_0x414497){_0x4a7004['push'](_0x4a7004['shift']());}}}(a5_0x44a7,0x1ccb6));function a5_0x3836(_0x18c384,_0x5ea4a3){_0x18c384=_0x18c384-0xe2;const _0x44a714=a5_0x44a7();let _0x383665=_0x44a714[_0x18c384];return _0x383665;}import*as a5_0x288775 from'node:fs';import*as a5_0x1d665f from'node:path';import a5_0x4f0951 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x44a7(){const _0x47db41=['\x27\x20to\x20create\x20the\x20folder\x20structure.','Cached\x20run\x20is\x20from\x20site\x20\x22','log','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','agentName','Passed:\x20\x20\x20','llm','✗\x20ERROR:\x20','Failed:\x20\x20\x20','\x20\x20-\x20','\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(cached)','\x22:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','no_context','Running\x20agent\x20tests...','\x20-\x20','679590WUqzCY','cyan','dryRun','101823KRRNju','agentDirs','llmProject','now','429570xJNSyz','agent','Duration:\x20','execute','Project\x20path:\x20','map','\x20(new)','Tests\x20found:\x20','context','stop','✗\x20FAIL:\x20','Usage:','rounds','jsonl','resolveProjectId','\x20\x20Site:\x20','Executing\x20new\x20tests...','includes','existsSync','76524gFjDqt','163544wVgQlI','Re-evaluating...','projectDir','conversation_url','join','site','dim','repeat','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','resolveAgentId','63QNvbjs','Total:\x20\x20\x20\x20','testYmlPath','projectName','Conversation\x20URL:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','size','\x20\x20Conversation:\x20','filter','Round\x20','✓\x20PASS:\x20','verbose','No\x20tests\x20found\x20matching:\x20','tsv','status','Running\x20test:\x20','Output\x20written\x20to:\x20','text','Agent:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','split','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.',':\x20Sending\x20user\x20input...','\x20\x20Agent:\x20','\x20\x20Project:\x20','Error\x20writing\x20output\x20file:\x20','500172NvQLSE','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','Either\x20switch\x20to\x20the\x20\x22','404','json','find','10zVvXhA','Test\x20Configuration:','tags','start','conversations','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','...\x20','Errors:\x20\x20\x20','green','...','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Evaluating\x20response...','yellow','not\x20found','Running:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','substring','New\x20tests\x20to\x20execute:\x20','red','output','\x22,\x20but\x20current\x20site\x20is\x20\x22','toLowerCase','utf-8','length','Test\x20Summary','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','multiple_agents','trim','Available\x20tags:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','reason','\x20\x20Evaluating...\x20','tests','resolve','has','isSpinning','message','test.yml','Site:\x20','push','Run\x20\x27tdx\x20agent\x20pull\x20','Cached\x20run\x20from:\x20','194334vVHyVG','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','white','name','some','Round\x201/','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','table','FAIL','testName','No\x20tests\x20found\x20with\x20tags:\x20','Re-evaluation\x20Summary','toISOString','Available\x20tests:\x20','executeReeval','Re-evaluating\x20','ERROR','PASS','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','no_tests','\x20\x20Round\x20','Test\x20','source','Re-evaluating\x20cached\x20test\x20run...','agent:test'];a5_0x44a7=function(){return _0x47db41;};return a5_0x44a7();}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0x4b9afb(0x15c);['description']=a5_0x4b9afb(0x115);async[a5_0x4b9afb(0x178)](_0x205293){const _0x1710e8=a5_0x4b9afb,{options:_0x27a9af,args:_0x18454c,tdx:_0x53e732}=_0x205293,_0x3cf937=_0x18454c[0x0]||'.',_0x26a381=_0x27a9af[_0x1710e8(0x170)],_0x189f19=_0x27a9af,_0x409709=_0x189f19['eval']===![],_0x27ee74=_0x189f19['reeval'],_0xca4962=_0x189f19['name'],_0x3832a1=_0x189f19['tags'],_0x240930=_0x27a9af[_0x1710e8(0xf4)],_0xe0602c=_0x189f19[_0x1710e8(0x12d)];if(_0x27ee74&&_0x409709)return console[_0x1710e8(0x15f)](a5_0x4f0951[_0x1710e8(0x12c)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x364ba9=_0x1710e8(0x14b);if(_0x189f19[_0x1710e8(0x118)])_0x364ba9=_0x1710e8(0x118);else{if(_0x189f19[_0x1710e8(0xe8)])_0x364ba9=_0x1710e8(0xe8);else{if(_0x189f19[_0x1710e8(0x106)])_0x364ba9=_0x1710e8(0x106);else{if(_0x189f19[_0x1710e8(0x14b)])_0x364ba9=_0x1710e8(0x14b);}}}const _0x551a9c=_0x189f19[_0x1710e8(0x173)];let _0x1ac688=_0x3cf937;const _0x2805a7=a5_0x288775[_0x1710e8(0xed)](_0x3cf937),_0x29ee1f=_0x3cf937==='.';if(!_0x2805a7||_0x29ee1f){const _0x2aad3b=resolveProjectFromContext(_0x3cf937,_0x551a9c,{'requireFile':_0x1710e8(0x13f)});if(_0x2aad3b['found'])_0x1ac688=_0x2aad3b[_0x1710e8(0xf1)],_0x2aad3b[_0x1710e8(0x15a)]===_0x1710e8(0xe3)&&console['log'](a5_0x4f0951[_0x1710e8(0xf5)]('Using\x20agent:\x20'+_0x1ac688));else switch(_0x2aad3b[_0x1710e8(0x138)]){case _0x1710e8(0x16b):console[_0x1710e8(0x15f)](a5_0x4f0951[_0x1710e8(0x126)](_0x2aad3b[_0x1710e8(0x13e)])),console['log'](),console[_0x1710e8(0x15f)](_0x1710e8(0xe6)),console[_0x1710e8(0x15f)](_0x1710e8(0x167)),console[_0x1710e8(0x15f)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x1710e8(0x15f)](),console['log'](_0x1710e8(0x14a));return 0x1;case'no_local_folder':console[_0x1710e8(0x15f)](a5_0x4f0951[_0x1710e8(0x126)](_0x2aad3b[_0x1710e8(0x13e)])),console['log'](),console[_0x1710e8(0x15f)](_0x1710e8(0x142)+_0x2aad3b['llmProject']+_0x1710e8(0x15d));return 0x1;case _0x1710e8(0x134):{const _0x1a8861=a5_0x1d665f['basename'](_0x2aad3b[_0x1710e8(0xf1)]);console[_0x1710e8(0x15f)](a5_0x4f0951[_0x1710e8(0x126)](_0x1710e8(0x137)+_0x2aad3b[_0x1710e8(0x173)]+'\x22:'));for(const _0x302c49 of _0x2aad3b[_0x1710e8(0x172)]){console[_0x1710e8(0x15f)](_0x1710e8(0x166)+_0x302c49);}return console[_0x1710e8(0x15f)](),console[_0x1710e8(0x15f)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x1a8861+'/<agent-name>'),0x1;}case _0x1710e8(0x157):console[_0x1710e8(0x15f)](a5_0x4f0951['yellow'](_0x1710e8(0x129)+_0x2aad3b[_0x1710e8(0x173)]+'\x22.')),console['log'](a5_0x4f0951['dim'](_0x1710e8(0x179)+_0x2aad3b[_0x1710e8(0xf1)])),console['log'](),console[_0x1710e8(0x15f)](_0x1710e8(0x10e));return 0x1;}}const {definition:_0xb14f5b,agentInfo:_0x45f7fc}=parseTestFile(_0x1ac688);let _0xeaa8f8=_0xb14f5b[_0x1710e8(0x13a)];if(_0xca4962){const _0x11f81d=_0xca4962[_0x1710e8(0x10d)](',')[_0x1710e8(0x17a)](_0x2d777b=>_0x2d777b['trim']());_0xeaa8f8=_0xb14f5b[_0x1710e8(0x13a)][_0x1710e8(0x101)](_0x12ec76=>_0x11f81d['includes'](_0x12ec76[_0x1710e8(0x147)]));if(_0xeaa8f8[_0x1710e8(0x131)]===0x0)return console[_0x1710e8(0x15f)](a5_0x4f0951[_0x1710e8(0x126)](_0x1710e8(0x105)+_0xca4962)),console[_0x1710e8(0x15f)](a5_0x4f0951[_0x1710e8(0xf5)](_0x1710e8(0x151)+_0xb14f5b[_0x1710e8(0x13a)]['map'](_0x2812bf=>_0x2812bf[_0x1710e8(0x147)])[_0x1710e8(0xf3)](',\x20'))),0x1;}if(_0x3832a1){const _0x48b3ff=_0x3832a1['split'](',')[_0x1710e8(0x17a)](_0x1c000c=>_0x1c000c[_0x1710e8(0x135)]()[_0x1710e8(0x12f)]());_0xeaa8f8=_0xeaa8f8['filter'](_0x16315a=>_0x16315a[_0x1710e8(0x11c)]?.[_0x1710e8(0x148)](_0x1877c4=>_0x48b3ff['includes'](_0x1877c4[_0x1710e8(0x12f)]())));if(_0xeaa8f8[_0x1710e8(0x131)]===0x0){console['log'](a5_0x4f0951[_0x1710e8(0x126)](_0x1710e8(0x14e)+_0x3832a1));const _0x60a35e=new Set();return _0xb14f5b['tests']['forEach'](_0x3e07a8=>_0x3e07a8[_0x1710e8(0x11c)]?.['forEach'](_0x51645d=>_0x60a35e['add'](_0x51645d))),_0x60a35e[_0x1710e8(0xff)]>0x0?console['log'](a5_0x4f0951[_0x1710e8(0xf5)](_0x1710e8(0x136)+[..._0x60a35e]['join'](',\x20'))):console['log'](a5_0x4f0951[_0x1710e8(0xf5)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x27ee74)return this[_0x1710e8(0x152)](_0x205293,{'definition':{'tests':_0xeaa8f8},'agentInfo':_0x45f7fc,'outputFormat':_0x364ba9,'outputFile':_0xe0602c,'testNames':_0xca4962});if(_0x26a381){console['log'](a5_0x4f0951['cyan'](_0x1710e8(0x11b))),console[_0x1710e8(0x15f)](_0x1710e8(0xea)+a5_0x4f0951['white'](_0x240930)),console[_0x1710e8(0x15f)](_0x1710e8(0x111)+a5_0x4f0951[_0x1710e8(0x146)](_0x45f7fc[_0x1710e8(0xfc)])),console[_0x1710e8(0x15f)](_0x1710e8(0x110)+a5_0x4f0951[_0x1710e8(0x146)](_0x45f7fc[_0x1710e8(0x161)])),console[_0x1710e8(0x15f)](),console[_0x1710e8(0x15f)](_0x1710e8(0xe2)+a5_0x4f0951['white'](_0xeaa8f8['length']));for(let _0x3331ba=0x0;_0x3331ba<_0xeaa8f8['length'];_0x3331ba++){const _0x58ba2f=_0xeaa8f8[_0x3331ba],_0x5cd105=_0x58ba2f[_0x1710e8(0xe7)]['length']===0x1?'round':_0x1710e8(0xe7),_0x5d3769=_0x58ba2f[_0x1710e8(0x11c)]?.['length']?'\x20['+_0x58ba2f[_0x1710e8(0x11c)][_0x1710e8(0xf3)](',\x20')+']':'';console[_0x1710e8(0x15f)]('\x20\x20'+(_0x3331ba+0x1)+'.\x20'+a5_0x4f0951['white'](_0x58ba2f[_0x1710e8(0x147)])+'\x20('+_0x58ba2f[_0x1710e8(0xe7)][_0x1710e8(0x131)]+'\x20'+_0x5cd105+')'+a5_0x4f0951['dim'](_0x5d3769));}return 0x0;}let _0x4231ea,_0x398b61;try{_0x4231ea=await _0x53e732['llm'][_0x1710e8(0xe9)](_0x45f7fc[_0x1710e8(0xfc)]);}catch(_0x216b4a){const _0x1a53cf=_0x216b4a instanceof Error?_0x216b4a['message']:String(_0x216b4a);return _0x1a53cf[_0x1710e8(0xec)](_0x1710e8(0x117))||_0x1a53cf[_0x1710e8(0x12f)]()['includes'](_0x1710e8(0x127))?console[_0x1710e8(0x15f)](a5_0x4f0951['red'](_0x1710e8(0x124)+_0x45f7fc[_0x1710e8(0xfc)])):console[_0x1710e8(0x15f)](a5_0x4f0951['red'](_0x1710e8(0x160)+_0x45f7fc[_0x1710e8(0xfc)]+_0x1710e8(0x169)+_0x1a53cf)),0x1;}try{_0x398b61=await _0x53e732['llm'][_0x1710e8(0xf8)](_0x45f7fc['agentName'],_0x4231ea);}catch(_0x5e7d42){const _0x3a1d2f=_0x5e7d42 instanceof Error?_0x5e7d42[_0x1710e8(0x13e)]:String(_0x5e7d42);return _0x3a1d2f['includes'](_0x1710e8(0x117))||_0x3a1d2f[_0x1710e8(0x12f)]()[_0x1710e8(0xec)]('not\x20found')?console[_0x1710e8(0x15f)](a5_0x4f0951[_0x1710e8(0x12c)](_0x1710e8(0x114)+_0x45f7fc[_0x1710e8(0x161)])):console['log'](a5_0x4f0951['red'](_0x1710e8(0x133)+_0x45f7fc[_0x1710e8(0x161)]+_0x1710e8(0x169)+_0x3a1d2f)),0x1;}let _0x5d6e10;if(!_0x409709)try{_0x5d6e10=await setupEvaluatorAgent(_0x53e732[_0x1710e8(0x163)],_0x27a9af[_0x1710e8(0x104)]);}catch(_0x363e2c){const _0x4638c5=_0x363e2c instanceof Error?_0x363e2c[_0x1710e8(0x13e)]:String(_0x363e2c);return console[_0x1710e8(0x15f)](a5_0x4f0951['red'](_0x1710e8(0xfe)+_0x4638c5)),0x1;}console[_0x1710e8(0x15f)](a5_0x4f0951['cyan'](_0x1710e8(0x16c))),console[_0x1710e8(0x15f)](_0x1710e8(0x140)+a5_0x4f0951['white'](_0x240930)),console[_0x1710e8(0x15f)](_0x1710e8(0x10b)+a5_0x4f0951[_0x1710e8(0x146)](_0x45f7fc[_0x1710e8(0xfc)]+'/'+_0x45f7fc[_0x1710e8(0x161)])),console[_0x1710e8(0x15f)]();const _0x4f5c02=[],_0x33b055=[],_0xc284ed=Date[_0x1710e8(0x174)]();for(let _0x41fb5e=0x0;_0x41fb5e<_0xeaa8f8[_0x1710e8(0x131)];_0x41fb5e++){const _0x39a71d=_0xeaa8f8[_0x41fb5e];_0xeaa8f8[_0x1710e8(0x131)]>0x1?console[_0x1710e8(0x15f)](_0x1710e8(0x159)+(_0x41fb5e+0x1)+'/'+_0xeaa8f8['length']+':\x20'+a5_0x4f0951[_0x1710e8(0x146)](_0x39a71d[_0x1710e8(0x147)])):console[_0x1710e8(0x15f)](_0x1710e8(0x108)+a5_0x4f0951[_0x1710e8(0x146)](_0x39a71d[_0x1710e8(0x147)]));const _0x3431f7=createCommandSpinner('Round\x201/'+_0x39a71d[_0x1710e8(0xe7)][_0x1710e8(0x131)]+_0x1710e8(0x10f));_0x3431f7[_0x1710e8(0x11d)]();try{const {result:_0x4f5def,conversation:_0x344fa6}=await runTest(_0x53e732[_0x1710e8(0x163)],_0x39a71d,{'agentId':_0x398b61,'projectId':_0x4231ea,'site':_0x240930,'noEval':_0x409709,'evaluatorId':_0x5d6e10,'onRoundStart':(_0x2d07bd,_0x3e6e14)=>{const _0x536b4a=_0x1710e8;_0x3431f7[_0x536b4a(0x10a)]='Round\x20'+(_0x2d07bd+0x1)+'/'+_0x3e6e14+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x2bc7db,_0x4749c2,_0x1f32df)=>{const _0x531c9c=_0x1710e8,_0x34787c=formatElapsed(_0x4749c2);_0x1f32df?console[_0x531c9c(0x15f)](_0x531c9c(0x158)+(_0x2bc7db+0x1)+'/'+_0x39a71d[_0x531c9c(0xe7)][_0x531c9c(0x131)]+_0x531c9c(0x120)+a5_0x4f0951[_0x531c9c(0x122)]('✓')+'\x20('+_0x34787c+')'):console[_0x531c9c(0x15f)](_0x531c9c(0x158)+(_0x2bc7db+0x1)+'/'+_0x39a71d[_0x531c9c(0xe7)][_0x531c9c(0x131)]+_0x531c9c(0x120)+a5_0x4f0951[_0x531c9c(0x12c)]('✗'));},'onEvaluationStart':()=>{const _0x46e051=_0x1710e8;_0x3431f7[_0x46e051(0x10a)]=_0x46e051(0x125);},'onEvaluationComplete':_0x3b4a54=>{const _0x10902f=_0x1710e8,_0x545e64=formatElapsed(_0x3b4a54);console[_0x10902f(0x15f)]('\x20\x20Evaluating...\x20'+a5_0x4f0951['green']('✓')+'\x20('+_0x545e64+')');}});_0x3431f7[_0x1710e8(0xe4)](),_0x4f5c02['push'](_0x4f5def),_0x33b055[_0x1710e8(0x141)](_0x344fa6);if(_0x4f5def[_0x1710e8(0x107)]===_0x1710e8(0x155))console[_0x1710e8(0x15f)](a5_0x4f0951[_0x1710e8(0x122)](_0x1710e8(0x103)+_0x4f5def[_0x1710e8(0x138)]));else _0x4f5def[_0x1710e8(0x107)]===_0x1710e8(0x14c)?console['log'](a5_0x4f0951[_0x1710e8(0x12c)](_0x1710e8(0xe5)+_0x4f5def[_0x1710e8(0x138)])):console[_0x1710e8(0x15f)](a5_0x4f0951[_0x1710e8(0x12c)](_0x1710e8(0x164)+_0x4f5def['reason']));_0x4f5def[_0x1710e8(0xf2)]&&console[_0x1710e8(0x15f)](a5_0x4f0951[_0x1710e8(0xf5)](_0x1710e8(0xfd)+_0x4f5def[_0x1710e8(0xf2)])),console[_0x1710e8(0x15f)]();}catch(_0x320d7f){_0x3431f7[_0x1710e8(0xe4)]();const _0x37c43c=_0x320d7f instanceof Error?_0x320d7f[_0x1710e8(0x13e)]:String(_0x320d7f);console[_0x1710e8(0x15f)](a5_0x4f0951[_0x1710e8(0x12c)]('✗\x20ERROR:\x20'+_0x37c43c)),console[_0x1710e8(0x15f)](),_0x4f5c02[_0x1710e8(0x141)]({'name':_0x39a71d[_0x1710e8(0x147)],'status':_0x1710e8(0x154),'reason':_0x37c43c,'timestamp':new Date()[_0x1710e8(0x150)](),'duration_ms':0x0});}}const _0x3af50b=Date['now']()-_0xc284ed,_0x162191=_0x4f5c02[_0x1710e8(0x101)](_0x45230a=>_0x45230a[_0x1710e8(0x107)]===_0x1710e8(0x155))[_0x1710e8(0x131)],_0x37f6ff=_0x4f5c02['filter'](_0x1507f4=>_0x1507f4[_0x1710e8(0x107)]==='FAIL')[_0x1710e8(0x131)],_0x6b7a25=_0x4f5c02['filter'](_0xbcc05e=>_0xbcc05e['status']===_0x1710e8(0x154))['length'];console['log']('━'[_0x1710e8(0xf6)](0x3c)),console[_0x1710e8(0x15f)](_0x1710e8(0x132)),console[_0x1710e8(0x15f)]('━'[_0x1710e8(0xf6)](0x3c)),console[_0x1710e8(0x15f)](_0x1710e8(0xfa)+_0x4f5c02[_0x1710e8(0x131)]),console[_0x1710e8(0x15f)](_0x1710e8(0x162)+a5_0x4f0951[_0x1710e8(0x122)](_0x162191)),console[_0x1710e8(0x15f)](_0x1710e8(0x165)+a5_0x4f0951[_0x1710e8(0x12c)](_0x37f6ff));_0x6b7a25>0x0&&console['log'](_0x1710e8(0x121)+a5_0x4f0951[_0x1710e8(0x12c)](_0x6b7a25));console[_0x1710e8(0x15f)](_0x1710e8(0x177)+formatElapsed(_0x3af50b)),console[_0x1710e8(0x15f)]('━'[_0x1710e8(0xf6)](0x3c));const _0x5f15ef=_0x4f5c02[_0x1710e8(0x101)](_0x538580=>_0x538580['status']!==_0x1710e8(0x155));if(_0x5f15ef[_0x1710e8(0x131)]>0x0){console['log'](),console[_0x1710e8(0x15f)]('Failed\x20Tests:');for(const _0x11c7f7 of _0x5f15ef){const _0x38131b=a5_0x4f0951[_0x1710e8(0x12c)]('✗'),_0xa2993=_0x11c7f7['reason'][_0x1710e8(0x131)]>0x32?_0x11c7f7[_0x1710e8(0x138)][_0x1710e8(0x12a)](0x0,0x32)+_0x1710e8(0x123):_0x11c7f7[_0x1710e8(0x138)];console['log']('\x20\x20'+_0x38131b+'\x20'+_0x11c7f7['name']+':\x20'+_0xa2993);}}const _0x5b0009={'summary':{'total':_0x4f5c02[_0x1710e8(0x131)],'passed':_0x162191,'failed':_0x37f6ff,'errors':_0x6b7a25>0x0?_0x6b7a25:undefined,'duration_ms':_0x3af50b},'tests':_0x4f5c02,'agent':{'project':_0x45f7fc[_0x1710e8(0xfc)],'name':_0x45f7fc[_0x1710e8(0x161)],'site':_0x240930},'timestamp':new Date(_0xc284ed)[_0x1710e8(0x150)]()};try{const _0x17cbd6=buildCachedTestRun(_0x33b055,{'site':_0x240930,'projectId':_0x4231ea,'projectName':_0x45f7fc[_0x1710e8(0xfc)],'agentId':_0x398b61,'agentName':_0x45f7fc[_0x1710e8(0x161)],'testYmlPath':a5_0x1d665f[_0x1710e8(0x13b)](_0x45f7fc[_0x1710e8(0xfb)])});saveLastTestRun(_0x17cbd6);}catch{}if(_0x364ba9!=='table'||_0xe0602c){const _0x38882f=formatResults(_0x5b0009,_0x364ba9);if(_0xe0602c)try{a5_0x288775['writeFileSync'](_0xe0602c,_0x38882f,_0x1710e8(0x130)),console[_0x1710e8(0x15f)](),console[_0x1710e8(0x15f)](a5_0x4f0951[_0x1710e8(0xf5)](_0x1710e8(0x109)+_0xe0602c));}catch(_0x2ea217){return console['log'](),console[_0x1710e8(0x15f)](a5_0x4f0951[_0x1710e8(0x12c)](_0x1710e8(0x112)+_0x2ea217)),0x1;}else console['log'](),console[_0x1710e8(0x15f)](_0x38882f);}return _0x5f15ef[_0x1710e8(0x131)]>0x0?0x1:0x0;}async[a5_0x4b9afb(0x152)](_0x4462d2,_0x15c84c){const _0xfd2d37=a5_0x4b9afb,{options:_0x5ca81e,tdx:_0x275edb}=_0x4462d2,{definition:_0x26db78,agentInfo:_0x342cac,outputFormat:_0x4290c4,outputFile:_0x3450a8}=_0x15c84c,_0x575ab8=_0x5ca81e[_0xfd2d37(0xf4)],_0x19b822=loadLastTestRun();if(!_0x19b822)return console[_0xfd2d37(0x15f)](a5_0x4f0951[_0xfd2d37(0x12c)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console['log'](a5_0x4f0951[_0xfd2d37(0xf5)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x19b822[_0xfd2d37(0x176)][_0xfd2d37(0x161)]!==_0x342cac[_0xfd2d37(0x161)])return console[_0xfd2d37(0x15f)](a5_0x4f0951['red'](_0xfd2d37(0x11f)+_0x19b822[_0xfd2d37(0x176)][_0xfd2d37(0x161)]+_0xfd2d37(0x145)+_0x342cac[_0xfd2d37(0x161)]+'\x22.')),console[_0xfd2d37(0x15f)](a5_0x4f0951[_0xfd2d37(0xf5)](_0xfd2d37(0x156))),0x1;const _0x5a6113=new Set(_0x19b822[_0xfd2d37(0x11e)][_0xfd2d37(0x17a)](_0x21e0eb=>_0x21e0eb[_0xfd2d37(0x14d)])),_0x478317=_0x26db78[_0xfd2d37(0x13a)][_0xfd2d37(0x101)](_0x18a863=>!_0x5a6113[_0xfd2d37(0x13c)](_0x18a863[_0xfd2d37(0x147)]));if(_0x478317['length']>0x0&&_0x19b822[_0xfd2d37(0xf4)]!==_0x575ab8)return console['log'](a5_0x4f0951[_0xfd2d37(0x12c)](_0xfd2d37(0xf7))),console[_0xfd2d37(0x15f)](a5_0x4f0951[_0xfd2d37(0xf5)](_0xfd2d37(0x15e)+_0x19b822['site']+_0xfd2d37(0x12e)+_0x575ab8+'\x22.')),console['log'](a5_0x4f0951[_0xfd2d37(0xf5)](_0xfd2d37(0x116)+_0x19b822[_0xfd2d37(0xf4)]+_0xfd2d37(0x10c))),0x1;const _0x2ae669=_0x26db78[_0xfd2d37(0x13a)][_0xfd2d37(0x101)](_0xcef906=>_0x5a6113['has'](_0xcef906[_0xfd2d37(0x147)])),_0x2b78d9=_0x478317;let _0x5ddc5e;try{_0x5ddc5e=await setupEvaluatorAgent(_0x275edb[_0xfd2d37(0x163)],_0x5ca81e['verbose']);}catch(_0x4b01b3){const _0x35c4a6=_0x4b01b3 instanceof Error?_0x4b01b3[_0xfd2d37(0x13e)]:String(_0x4b01b3);return console[_0xfd2d37(0x15f)](a5_0x4f0951[_0xfd2d37(0x12c)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x35c4a6)),0x1;}console['log'](a5_0x4f0951[_0xfd2d37(0x16f)](_0xfd2d37(0x15b))),console['log'](_0xfd2d37(0x143)+a5_0x4f0951['white'](_0x19b822['timestamp'])),console[_0xfd2d37(0x15f)](_0xfd2d37(0x10b)+a5_0x4f0951[_0xfd2d37(0x146)](_0x19b822[_0xfd2d37(0x176)]['projectName']+'/'+_0x19b822[_0xfd2d37(0x176)][_0xfd2d37(0x161)]));_0x2b78d9[_0xfd2d37(0x131)]>0x0&&console[_0xfd2d37(0x15f)](_0xfd2d37(0x12b)+a5_0x4f0951[_0xfd2d37(0x126)](_0x2b78d9['length']));console['log']();const _0x174680=[],_0x3d5493=Date['now'](),_0x25f692=createCommandSpinner(_0xfd2d37(0xf0));if(_0x2ae669[_0xfd2d37(0x131)]>0x0)try{const _0xc8d5d1=await reevaluateFromCache(_0x275edb[_0xfd2d37(0x163)],_0x19b822,{'tests':_0x2ae669},{'evaluatorId':_0x5ddc5e,'onTestStart':(_0x5d8051,_0x2e9ed9,_0x24b811)=>{const _0x244dd6=_0xfd2d37;_0x25f692[_0x244dd6(0x10a)]=_0x244dd6(0x153)+(_0x2e9ed9+0x1)+'/'+_0x24b811+':\x20'+_0x5d8051+_0x244dd6(0x123);if(!_0x25f692[_0x244dd6(0x13d)])_0x25f692[_0x244dd6(0x11d)]();},'onTestComplete':(_0x183199,_0x2b03cc)=>{const _0x12e6bb=_0xfd2d37;_0x25f692['stop']();if(_0x2b03cc['status']===_0x12e6bb(0x155))console[_0x12e6bb(0x15f)](a5_0x4f0951[_0x12e6bb(0x122)](_0x12e6bb(0x103)+_0x183199)+a5_0x4f0951[_0x12e6bb(0xf5)](_0x12e6bb(0x168)));else _0x2b03cc[_0x12e6bb(0x107)]===_0x12e6bb(0x14c)?console[_0x12e6bb(0x15f)](a5_0x4f0951[_0x12e6bb(0x12c)]('✗\x20FAIL:\x20'+_0x183199+_0x12e6bb(0x16d)+_0x2b03cc[_0x12e6bb(0x138)])+a5_0x4f0951[_0x12e6bb(0xf5)](_0x12e6bb(0x168))):console[_0x12e6bb(0x15f)](a5_0x4f0951['red'](_0x12e6bb(0x164)+_0x183199+_0x12e6bb(0x16d)+_0x2b03cc[_0x12e6bb(0x138)]));_0x2b03cc[_0x12e6bb(0xf2)]&&console[_0x12e6bb(0x15f)](a5_0x4f0951['dim'](_0x12e6bb(0x100)+_0x2b03cc[_0x12e6bb(0xf2)])),_0x174680[_0x12e6bb(0x141)](_0x2b03cc);},'onTestSkipped':(_0x292cb7,_0x46af6d)=>{const _0xb2f451=_0xfd2d37;_0x25f692[_0xb2f451(0xe4)](),console[_0xb2f451(0x15f)](a5_0x4f0951['yellow']('⚠\x20SKIPPED:\x20'+_0x292cb7+_0xb2f451(0x16d)+_0x46af6d));}});for(const _0x119401 of _0xc8d5d1){!_0x174680[_0xfd2d37(0x119)](_0x54c1eb=>_0x54c1eb[_0xfd2d37(0x147)]===_0x119401[_0xfd2d37(0x147)])&&_0x174680['push'](_0x119401);}}catch(_0x4509d5){_0x25f692[_0xfd2d37(0xe4)]();const _0x3b3a86=_0x4509d5 instanceof Error?_0x4509d5[_0xfd2d37(0x13e)]:String(_0x4509d5);return console[_0xfd2d37(0x15f)](a5_0x4f0951['red'](_0xfd2d37(0x16a)+_0x3b3a86)),0x1;}_0x25f692[_0xfd2d37(0xe4)]();if(_0x2b78d9[_0xfd2d37(0x131)]>0x0){console[_0xfd2d37(0x15f)](),console[_0xfd2d37(0x15f)](a5_0x4f0951[_0xfd2d37(0x16f)](_0xfd2d37(0xeb)));const {projectId:_0x23d77a,agentId:_0x3b69e3}=_0x19b822[_0xfd2d37(0x176)];for(const _0x25c429 of _0x2b78d9){console['log'](_0xfd2d37(0x128)+a5_0x4f0951[_0xfd2d37(0x146)](_0x25c429[_0xfd2d37(0x147)]));const _0x356e7a=createCommandSpinner(_0xfd2d37(0x149)+_0x25c429[_0xfd2d37(0xe7)]['length']+_0xfd2d37(0x10f));_0x356e7a[_0xfd2d37(0x11d)]();try{const {result:_0x3173eb}=await runTest(_0x275edb[_0xfd2d37(0x163)],_0x25c429,{'agentId':_0x3b69e3,'projectId':_0x23d77a,'site':_0x19b822['site'],'noEval':![],'evaluatorId':_0x5ddc5e,'onRoundStart':(_0x38dec2,_0x5f11b3)=>{const _0x144c5e=_0xfd2d37;_0x356e7a['text']=_0x144c5e(0x102)+(_0x38dec2+0x1)+'/'+_0x5f11b3+_0x144c5e(0x10f);},'onRoundComplete':(_0x28a80a,_0x37cc36,_0x1388da)=>{const _0x24712e=_0xfd2d37,_0x282896=formatElapsed(_0x37cc36);_0x1388da?console[_0x24712e(0x15f)]('\x20\x20Round\x20'+(_0x28a80a+0x1)+'/'+_0x25c429[_0x24712e(0xe7)]['length']+'...\x20'+a5_0x4f0951['green']('✓')+'\x20('+_0x282896+')'):console[_0x24712e(0x15f)]('\x20\x20Round\x20'+(_0x28a80a+0x1)+'/'+_0x25c429['rounds']['length']+'...\x20'+a5_0x4f0951['red']('✗'));},'onEvaluationStart':()=>{_0x356e7a['text']='Evaluating\x20response...';},'onEvaluationComplete':_0x47d949=>{const _0x37ebd9=_0xfd2d37,_0x7c815=formatElapsed(_0x47d949);console[_0x37ebd9(0x15f)](_0x37ebd9(0x139)+a5_0x4f0951[_0x37ebd9(0x122)]('✓')+'\x20('+_0x7c815+')');}});_0x356e7a[_0xfd2d37(0xe4)](),_0x174680[_0xfd2d37(0x141)](_0x3173eb);if(_0x3173eb['status']===_0xfd2d37(0x155))console[_0xfd2d37(0x15f)](a5_0x4f0951['green'](_0xfd2d37(0x103)+_0x3173eb[_0xfd2d37(0x138)])+a5_0x4f0951['dim'](_0xfd2d37(0x17b)));else _0x3173eb[_0xfd2d37(0x107)]==='FAIL'?console[_0xfd2d37(0x15f)](a5_0x4f0951[_0xfd2d37(0x12c)]('✗\x20FAIL:\x20'+_0x3173eb[_0xfd2d37(0x138)])+a5_0x4f0951[_0xfd2d37(0xf5)](_0xfd2d37(0x17b))):console['log'](a5_0x4f0951['red'](_0xfd2d37(0x164)+_0x3173eb[_0xfd2d37(0x138)]));_0x3173eb[_0xfd2d37(0xf2)]&&console[_0xfd2d37(0x15f)](a5_0x4f0951['dim'](_0xfd2d37(0x100)+_0x3173eb[_0xfd2d37(0xf2)]));}catch(_0x2e6387){_0x356e7a[_0xfd2d37(0xe4)]();const _0x16caa1=_0x2e6387 instanceof Error?_0x2e6387[_0xfd2d37(0x13e)]:String(_0x2e6387);console['log'](a5_0x4f0951[_0xfd2d37(0x12c)](_0xfd2d37(0x164)+_0x16caa1)),_0x174680[_0xfd2d37(0x141)]({'name':_0x25c429[_0xfd2d37(0x147)],'status':_0xfd2d37(0x154),'reason':_0x16caa1,'timestamp':new Date()[_0xfd2d37(0x150)](),'duration_ms':0x0});}}}console[_0xfd2d37(0x15f)]();const _0xcdff0d=Date[_0xfd2d37(0x174)]()-_0x3d5493,_0x3c23a2=_0x174680['filter'](_0x507e4a=>_0x507e4a[_0xfd2d37(0x107)]==='PASS')['length'],_0x545b30=_0x174680[_0xfd2d37(0x101)](_0x28e8d8=>_0x28e8d8['status']==='FAIL')[_0xfd2d37(0x131)],_0x4cca88=_0x174680[_0xfd2d37(0x101)](_0x2456e5=>_0x2456e5[_0xfd2d37(0x107)]==='ERROR')[_0xfd2d37(0x131)];console[_0xfd2d37(0x15f)]('━'[_0xfd2d37(0xf6)](0x3c)),console[_0xfd2d37(0x15f)](_0xfd2d37(0x14f)),console['log']('━'[_0xfd2d37(0xf6)](0x3c)),console[_0xfd2d37(0x15f)](_0xfd2d37(0xfa)+_0x174680[_0xfd2d37(0x131)]),console['log'](_0xfd2d37(0x162)+a5_0x4f0951[_0xfd2d37(0x122)](_0x3c23a2)),console[_0xfd2d37(0x15f)](_0xfd2d37(0x165)+a5_0x4f0951[_0xfd2d37(0x12c)](_0x545b30));_0x4cca88>0x0&&console[_0xfd2d37(0x15f)](_0xfd2d37(0x121)+a5_0x4f0951[_0xfd2d37(0x12c)](_0x4cca88));console[_0xfd2d37(0x15f)](_0xfd2d37(0x177)+formatElapsed(_0xcdff0d)),console[_0xfd2d37(0x15f)]('━'[_0xfd2d37(0xf6)](0x3c));const _0x1c3d68={'summary':{'total':_0x174680[_0xfd2d37(0x131)],'passed':_0x3c23a2,'failed':_0x545b30,'errors':_0x4cca88>0x0?_0x4cca88:undefined,'duration_ms':_0xcdff0d},'tests':_0x174680,'agent':{'project':_0x342cac[_0xfd2d37(0xfc)],'name':_0x342cac[_0xfd2d37(0x161)],'site':_0x575ab8},'timestamp':new Date(_0x3d5493)[_0xfd2d37(0x150)]()};if(_0x4290c4!==_0xfd2d37(0x14b)||_0x3450a8){const _0xb35fa6=formatResults(_0x1c3d68,_0x4290c4);if(_0x3450a8)try{a5_0x288775['writeFileSync'](_0x3450a8,_0xb35fa6,_0xfd2d37(0x130)),console[_0xfd2d37(0x15f)](),console[_0xfd2d37(0x15f)](a5_0x4f0951[_0xfd2d37(0xf5)](_0xfd2d37(0x109)+_0x3450a8));}catch(_0x25ed53){return console[_0xfd2d37(0x15f)](),console['log'](a5_0x4f0951[_0xfd2d37(0x12c)](_0xfd2d37(0x112)+_0x25ed53)),0x1;}else console[_0xfd2d37(0x15f)](),console[_0xfd2d37(0x15f)](_0xb35fa6);}const _0x137af1=_0x174680[_0xfd2d37(0x101)](_0x1c1803=>_0x1c1803[_0xfd2d37(0x107)]!==_0xfd2d37(0x155));return _0x137af1['length']>0x0?0x1:0x0;}}
1
+ const a5_0x2e3eb7=a5_0x49ac;(function(_0x4f277c,_0x317fc9){const _0x567d58=a5_0x49ac,_0x29c8c6=_0x4f277c();while(!![]){try{const _0x460d70=-parseInt(_0x567d58(0x1e1))/0x1+-parseInt(_0x567d58(0x220))/0x2*(-parseInt(_0x567d58(0x1e5))/0x3)+-parseInt(_0x567d58(0x218))/0x4+-parseInt(_0x567d58(0x205))/0x5+-parseInt(_0x567d58(0x1f0))/0x6+-parseInt(_0x567d58(0x1e3))/0x7*(-parseInt(_0x567d58(0x1d5))/0x8)+parseInt(_0x567d58(0x20c))/0x9;if(_0x460d70===_0x317fc9)break;else _0x29c8c6['push'](_0x29c8c6['shift']());}catch(_0x269f28){_0x29c8c6['push'](_0x29c8c6['shift']());}}}(a5_0x5bcc,0xdd8e0));import*as a5_0x2b7099 from'node:fs';import*as a5_0x45fe2a from'node:path';import a5_0x9fa30f from'chalk';function a5_0x49ac(_0x1d048f,_0x2e0bf4){_0x1d048f=_0x1d048f-0x1bc;const _0x5bcc17=a5_0x5bcc();let _0x49ac92=_0x5bcc17[_0x1d048f];return _0x49ac92;}import{BaseCommand}from'./command.js';function a5_0x5bcc(){const _0x51f7b9=['writeFileSync','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','799170vrIBET','llm','\x27\x20to\x20create\x20the\x20folder\x20structure.','Either\x20switch\x20to\x20the\x20\x22','FAIL','utf-8','resolveAgentId','ERROR','forEach','text','No\x20tests\x20have\x20tags\x20defined.','testYmlPath','Tests\x20found:\x20','resolveProjectId','Total:\x20\x20\x20\x20','map','executeReeval','green','\x20(cached)','isSpinning','✗\x20ERROR:\x20','8106855ASULDA','now','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','/<agent-name>','Conversation\x20URL:\x20','agentDirs','Passed:\x20\x20\x20','23989401aspbXS','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','timestamp','multiple_agents','some','Run\x20\x27tdx\x20agent\x20pull\x20','projectDir','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','agent','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','✗\x20ERROR:\x20Project\x20not\x20found:\x20','join','5011412DnUkMT','\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\x20-\x20','\x20\x20Round\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','projectName',':\x20Sending\x20user\x20input...','...','4BtxugZ','\x20\x20Evaluating...\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','dryRun','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','find','Executing\x20new\x20tests...','includes','Running\x20test:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','PASS','...\x20','tsv','cyan','Evaluating\x20response...','has','404','filter','output','Test\x20Configuration:','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Site:\x20','\x22:\x20','Re-evaluating\x20','trim','Errors:\x20\x20\x20','\x20(new)','llmProject','conversation_url','⚠\x20SKIPPED:\x20','✗\x20FAIL:\x20','basename','length','\x20\x20Agent:\x20','not\x20found','table','description','toLowerCase','Error\x20writing\x20output\x20file:\x20','Test\x20Summary','Round\x201/','✓\x20PASS:\x20','yellow','found','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','red','log','testName','\x20\x20Conversation:\x20','dim','add','round','Running\x20agent\x20tests...','Re-evaluation\x20Summary','reason','resolve','name','Run\x20tests\x20for\x20an\x20LLM\x20agent','\x20-\x20','status','Test\x20','site','push','\x20\x20Project:\x20','verbose','Duration:\x20','start','stop','reeval','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Output\x20written\x20to:\x20','context','rounds','test.yml','message','size','\x22,\x20but\x20current\x20site\x20is\x20\x22','2344QVLlpI','repeat','Re-evaluating...','\x20\x20Site:\x20','execute','Failed:\x20\x20\x20','tests','tags','no_tests','split','toISOString','No\x20tests\x20found\x20matching:\x20','522165PxViAy','Usage:','17801leHPKI','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','1539726PDVeXG','No\x20tests\x20found\x20with\x20tags:\x20','Round\x20','conversations','\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)','white','Running:\x20','Re-evaluating\x20cached\x20test\x20run...','agentName'];a5_0x5bcc=function(){return _0x51f7b9;};return a5_0x5bcc();}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_0x2e3eb7(0x1c0)]='agent:test';[a5_0x2e3eb7(0x245)]=a5_0x2e3eb7(0x1c1);async[a5_0x2e3eb7(0x1d9)](_0x57c5fe){const _0x15683c=a5_0x2e3eb7,{options:_0x198525,args:_0x404dca,tdx:_0x12ddd5}=_0x57c5fe,_0x4b5609=_0x404dca[0x0]||'.',_0x1bc5f7=_0x198525[_0x15683c(0x224)],_0x1f290e=_0x198525,_0x3529e6=_0x1f290e['eval']===![],_0x3e3483=_0x1f290e[_0x15683c(0x1cc)],_0x4f683f=_0x1f290e[_0x15683c(0x1c0)],_0x3b2d7f=_0x1f290e[_0x15683c(0x1dc)],_0x524e43=_0x198525[_0x15683c(0x1c5)],_0x324225=_0x1f290e[_0x15683c(0x233)];if(_0x3e3483&&_0x3529e6)return console[_0x15683c(0x24f)](a5_0x9fa30f[_0x15683c(0x24e)](_0x15683c(0x1cd))),0x1;let _0x483960=_0x15683c(0x244);if(_0x1f290e['json'])_0x483960='json';else{if(_0x1f290e['jsonl'])_0x483960='jsonl';else{if(_0x1f290e[_0x15683c(0x22d)])_0x483960='tsv';else{if(_0x1f290e['table'])_0x483960='table';}}}const _0x1aa28f=_0x1f290e[_0x15683c(0x23c)];let _0x123806=_0x4b5609;const _0x697eb4=a5_0x2b7099['existsSync'](_0x4b5609),_0x839aee=_0x4b5609==='.';if(!_0x697eb4||_0x839aee){const _0x547dfd=resolveProjectFromContext(_0x4b5609,_0x1aa28f,{'requireFile':_0x15683c(0x1d1)});if(_0x547dfd[_0x15683c(0x24c)])_0x123806=_0x547dfd[_0x15683c(0x212)],_0x547dfd['source']===_0x15683c(0x1cf)&&console[_0x15683c(0x24f)](a5_0x9fa30f[_0x15683c(0x252)]('Using\x20agent:\x20'+_0x123806));else switch(_0x547dfd[_0x15683c(0x1be)]){case'no_context':console[_0x15683c(0x24f)](a5_0x9fa30f[_0x15683c(0x24b)](_0x547dfd['message'])),console['log'](),console[_0x15683c(0x24f)](_0x15683c(0x1e2)),console[_0x15683c(0x24f)](_0x15683c(0x219)),console[_0x15683c(0x24f)](_0x15683c(0x1e9)),console['log'](),console[_0x15683c(0x24f)](_0x15683c(0x215));return 0x1;case'no_local_folder':console[_0x15683c(0x24f)](a5_0x9fa30f[_0x15683c(0x24b)](_0x547dfd['message'])),console['log'](),console['log'](_0x15683c(0x211)+_0x547dfd['llmProject']+_0x15683c(0x1f2));return 0x1;case _0x15683c(0x20f):{const _0x5677a9=a5_0x45fe2a[_0x15683c(0x240)](_0x547dfd[_0x15683c(0x212)]);console[_0x15683c(0x24f)](a5_0x9fa30f['yellow'](_0x15683c(0x223)+_0x547dfd[_0x15683c(0x23c)]+'\x22:'));for(const _0x45736e of _0x547dfd[_0x15683c(0x20a)]){console['log'](_0x15683c(0x21a)+_0x45736e);}return console[_0x15683c(0x24f)](),console['log'](_0x15683c(0x1e4)+_0x5677a9+_0x15683c(0x208)),0x1;}case _0x15683c(0x1dd):console[_0x15683c(0x24f)](a5_0x9fa30f[_0x15683c(0x24b)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x547dfd['llmProject']+'\x22.')),console[_0x15683c(0x24f)](a5_0x9fa30f[_0x15683c(0x252)]('Project\x20path:\x20'+_0x547dfd[_0x15683c(0x212)])),console[_0x15683c(0x24f)](),console[_0x15683c(0x24f)](_0x15683c(0x235));return 0x1;}}const {definition:_0x41e2da,agentInfo:_0x271fdc}=parseTestFile(_0x123806);let _0x7b7ca2=_0x41e2da[_0x15683c(0x1db)];if(_0x4f683f){const _0x1698e1=_0x4f683f[_0x15683c(0x1de)](',')[_0x15683c(0x1ff)](_0x485db9=>_0x485db9[_0x15683c(0x239)]());_0x7b7ca2=_0x41e2da[_0x15683c(0x1db)][_0x15683c(0x232)](_0x87481e=>_0x1698e1['includes'](_0x87481e[_0x15683c(0x1c0)]));if(_0x7b7ca2[_0x15683c(0x241)]===0x0)return console[_0x15683c(0x24f)](a5_0x9fa30f['yellow'](_0x15683c(0x1e0)+_0x4f683f)),console[_0x15683c(0x24f)](a5_0x9fa30f['dim']('Available\x20tests:\x20'+_0x41e2da['tests']['map'](_0x45555d=>_0x45555d[_0x15683c(0x1c0)])['join'](',\x20'))),0x1;}if(_0x3b2d7f){const _0x18eeac=_0x3b2d7f[_0x15683c(0x1de)](',')[_0x15683c(0x1ff)](_0xf509e8=>_0xf509e8[_0x15683c(0x239)]()[_0x15683c(0x246)]());_0x7b7ca2=_0x7b7ca2['filter'](_0x578930=>_0x578930[_0x15683c(0x1dc)]?.[_0x15683c(0x210)](_0x3cc24e=>_0x18eeac[_0x15683c(0x228)](_0x3cc24e[_0x15683c(0x246)]())));if(_0x7b7ca2[_0x15683c(0x241)]===0x0){console[_0x15683c(0x24f)](a5_0x9fa30f[_0x15683c(0x24b)](_0x15683c(0x1e6)+_0x3b2d7f));const _0x347be0=new Set();return _0x41e2da[_0x15683c(0x1db)][_0x15683c(0x1f8)](_0x572dfa=>_0x572dfa[_0x15683c(0x1dc)]?.[_0x15683c(0x1f8)](_0x57a00c=>_0x347be0[_0x15683c(0x253)](_0x57a00c))),_0x347be0[_0x15683c(0x1d3)]>0x0?console[_0x15683c(0x24f)](a5_0x9fa30f[_0x15683c(0x252)]('Available\x20tags:\x20'+[..._0x347be0][_0x15683c(0x217)](',\x20'))):console['log'](a5_0x9fa30f[_0x15683c(0x252)](_0x15683c(0x1fa))),0x1;}}if(_0x3e3483)return this[_0x15683c(0x200)](_0x57c5fe,{'definition':{'tests':_0x7b7ca2},'agentInfo':_0x271fdc,'outputFormat':_0x483960,'outputFile':_0x324225,'testNames':_0x4f683f});if(_0x1bc5f7){console[_0x15683c(0x24f)](a5_0x9fa30f['cyan'](_0x15683c(0x234))),console[_0x15683c(0x24f)](_0x15683c(0x1d8)+a5_0x9fa30f[_0x15683c(0x1ea)](_0x524e43)),console[_0x15683c(0x24f)](_0x15683c(0x1c7)+a5_0x9fa30f[_0x15683c(0x1ea)](_0x271fdc[_0x15683c(0x21d)])),console[_0x15683c(0x24f)](_0x15683c(0x242)+a5_0x9fa30f[_0x15683c(0x1ea)](_0x271fdc[_0x15683c(0x1ed)])),console[_0x15683c(0x24f)](),console[_0x15683c(0x24f)](_0x15683c(0x1fc)+a5_0x9fa30f['white'](_0x7b7ca2['length']));for(let _0x51fe14=0x0;_0x51fe14<_0x7b7ca2[_0x15683c(0x241)];_0x51fe14++){const _0x7c2bea=_0x7b7ca2[_0x51fe14],_0x11dde7=_0x7c2bea[_0x15683c(0x1d0)][_0x15683c(0x241)]===0x1?_0x15683c(0x254):'rounds',_0x168574=_0x7c2bea['tags']?.[_0x15683c(0x241)]?'\x20['+_0x7c2bea['tags']['join'](',\x20')+']':'';console[_0x15683c(0x24f)]('\x20\x20'+(_0x51fe14+0x1)+'.\x20'+a5_0x9fa30f['white'](_0x7c2bea[_0x15683c(0x1c0)])+'\x20('+_0x7c2bea['rounds']['length']+'\x20'+_0x11dde7+')'+a5_0x9fa30f[_0x15683c(0x252)](_0x168574));}return 0x0;}let _0x129b8e,_0x5be543;try{_0x129b8e=await _0x12ddd5[_0x15683c(0x1f1)][_0x15683c(0x1fd)](_0x271fdc['projectName']);}catch(_0x1d6dc6){const _0x8996dc=_0x1d6dc6 instanceof Error?_0x1d6dc6[_0x15683c(0x1d2)]:String(_0x1d6dc6);return _0x8996dc[_0x15683c(0x228)](_0x15683c(0x231))||_0x8996dc[_0x15683c(0x246)]()[_0x15683c(0x228)](_0x15683c(0x243))?console[_0x15683c(0x24f)](a5_0x9fa30f[_0x15683c(0x24e)](_0x15683c(0x216)+_0x271fdc[_0x15683c(0x21d)])):console['log'](a5_0x9fa30f['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x271fdc[_0x15683c(0x21d)]+_0x15683c(0x237)+_0x8996dc)),0x1;}try{_0x5be543=await _0x12ddd5[_0x15683c(0x1f1)][_0x15683c(0x1f6)](_0x271fdc[_0x15683c(0x1ed)],_0x129b8e);}catch(_0x1a2d3e){const _0x45101d=_0x1a2d3e instanceof Error?_0x1a2d3e[_0x15683c(0x1d2)]:String(_0x1a2d3e);return _0x45101d[_0x15683c(0x228)](_0x15683c(0x231))||_0x45101d[_0x15683c(0x246)]()[_0x15683c(0x228)](_0x15683c(0x243))?console[_0x15683c(0x24f)](a5_0x9fa30f[_0x15683c(0x24e)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x271fdc[_0x15683c(0x1ed)])):console[_0x15683c(0x24f)](a5_0x9fa30f[_0x15683c(0x24e)](_0x15683c(0x225)+_0x271fdc[_0x15683c(0x1ed)]+'\x22:\x20'+_0x45101d)),0x1;}let _0x125dbe;if(!_0x3529e6)try{_0x125dbe=await setupEvaluatorAgent(_0x12ddd5[_0x15683c(0x1f1)],_0x198525[_0x15683c(0x1c8)]);}catch(_0x2e1673){const _0x500f03=_0x2e1673 instanceof Error?_0x2e1673[_0x15683c(0x1d2)]:String(_0x2e1673);return console[_0x15683c(0x24f)](a5_0x9fa30f[_0x15683c(0x24e)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x500f03)),0x1;}console[_0x15683c(0x24f)](a5_0x9fa30f[_0x15683c(0x22e)](_0x15683c(0x1bc))),console[_0x15683c(0x24f)](_0x15683c(0x236)+a5_0x9fa30f[_0x15683c(0x1ea)](_0x524e43)),console['log']('Agent:\x20'+a5_0x9fa30f[_0x15683c(0x1ea)](_0x271fdc[_0x15683c(0x21d)]+'/'+_0x271fdc[_0x15683c(0x1ed)])),console[_0x15683c(0x24f)]();const _0xa69177=[],_0x17be36=[],_0x18f302=Date['now']();for(let _0x173df5=0x0;_0x173df5<_0x7b7ca2[_0x15683c(0x241)];_0x173df5++){const _0x3727ff=_0x7b7ca2[_0x173df5];_0x7b7ca2[_0x15683c(0x241)]>0x1?console['log'](_0x15683c(0x1c4)+(_0x173df5+0x1)+'/'+_0x7b7ca2[_0x15683c(0x241)]+':\x20'+a5_0x9fa30f['white'](_0x3727ff[_0x15683c(0x1c0)])):console[_0x15683c(0x24f)](_0x15683c(0x229)+a5_0x9fa30f[_0x15683c(0x1ea)](_0x3727ff[_0x15683c(0x1c0)]));const _0x3f8a6a=createCommandSpinner('Round\x201/'+_0x3727ff['rounds'][_0x15683c(0x241)]+':\x20Sending\x20user\x20input...');_0x3f8a6a['start']();try{const {result:_0x55993f,conversation:_0x3a1df0}=await runTest(_0x12ddd5[_0x15683c(0x1f1)],_0x3727ff,{'agentId':_0x5be543,'projectId':_0x129b8e,'site':_0x524e43,'noEval':_0x3529e6,'evaluatorId':_0x125dbe,'onRoundStart':(_0x471c1f,_0x165ab7)=>{const _0x524488=_0x15683c;_0x3f8a6a[_0x524488(0x1f9)]=_0x524488(0x1e7)+(_0x471c1f+0x1)+'/'+_0x165ab7+_0x524488(0x21e);},'onRoundComplete':(_0x21014f,_0x27c6d4,_0x2e1641)=>{const _0x1c701d=_0x15683c,_0x1e0579=formatElapsed(_0x27c6d4);_0x2e1641?console[_0x1c701d(0x24f)](_0x1c701d(0x21b)+(_0x21014f+0x1)+'/'+_0x3727ff[_0x1c701d(0x1d0)][_0x1c701d(0x241)]+'...\x20'+a5_0x9fa30f[_0x1c701d(0x201)]('✓')+'\x20('+_0x1e0579+')'):console[_0x1c701d(0x24f)](_0x1c701d(0x21b)+(_0x21014f+0x1)+'/'+_0x3727ff[_0x1c701d(0x1d0)]['length']+_0x1c701d(0x22c)+a5_0x9fa30f['red']('✗'));},'onEvaluationStart':()=>{const _0x124b6e=_0x15683c;_0x3f8a6a[_0x124b6e(0x1f9)]=_0x124b6e(0x22f);},'onEvaluationComplete':_0x29a488=>{const _0x44c31e=_0x15683c,_0x42c9a2=formatElapsed(_0x29a488);console[_0x44c31e(0x24f)](_0x44c31e(0x221)+a5_0x9fa30f[_0x44c31e(0x201)]('✓')+'\x20('+_0x42c9a2+')');}});_0x3f8a6a[_0x15683c(0x1cb)](),_0xa69177[_0x15683c(0x1c6)](_0x55993f),_0x17be36[_0x15683c(0x1c6)](_0x3a1df0);if(_0x55993f['status']===_0x15683c(0x22b))console[_0x15683c(0x24f)](a5_0x9fa30f[_0x15683c(0x201)](_0x15683c(0x24a)+_0x55993f[_0x15683c(0x1be)]));else _0x55993f[_0x15683c(0x1c3)]===_0x15683c(0x1f4)?console[_0x15683c(0x24f)](a5_0x9fa30f['red'](_0x15683c(0x23f)+_0x55993f[_0x15683c(0x1be)])):console[_0x15683c(0x24f)](a5_0x9fa30f[_0x15683c(0x24e)](_0x15683c(0x204)+_0x55993f[_0x15683c(0x1be)]));_0x55993f[_0x15683c(0x23d)]&&console[_0x15683c(0x24f)](a5_0x9fa30f['dim'](_0x15683c(0x209)+_0x55993f[_0x15683c(0x23d)])),console[_0x15683c(0x24f)]();}catch(_0x194809){_0x3f8a6a['stop']();const _0x5b4d62=_0x194809 instanceof Error?_0x194809['message']:String(_0x194809);console['log'](a5_0x9fa30f[_0x15683c(0x24e)](_0x15683c(0x204)+_0x5b4d62)),console['log'](),_0xa69177[_0x15683c(0x1c6)]({'name':_0x3727ff[_0x15683c(0x1c0)],'status':_0x15683c(0x1f7),'reason':_0x5b4d62,'timestamp':new Date()[_0x15683c(0x1df)](),'duration_ms':0x0});}}const _0x3dfaf6=Date[_0x15683c(0x206)]()-_0x18f302,_0xd9b0b1=_0xa69177['filter'](_0x5097a2=>_0x5097a2['status']===_0x15683c(0x22b))[_0x15683c(0x241)],_0x1bd3a8=_0xa69177[_0x15683c(0x232)](_0x439db6=>_0x439db6['status']===_0x15683c(0x1f4))[_0x15683c(0x241)],_0x35bdb3=_0xa69177['filter'](_0x43debe=>_0x43debe[_0x15683c(0x1c3)]===_0x15683c(0x1f7))['length'];console[_0x15683c(0x24f)]('━'[_0x15683c(0x1d6)](0x3c)),console[_0x15683c(0x24f)](_0x15683c(0x248)),console[_0x15683c(0x24f)]('━'[_0x15683c(0x1d6)](0x3c)),console[_0x15683c(0x24f)](_0x15683c(0x1fe)+_0xa69177[_0x15683c(0x241)]),console['log'](_0x15683c(0x20b)+a5_0x9fa30f['green'](_0xd9b0b1)),console['log'](_0x15683c(0x1da)+a5_0x9fa30f[_0x15683c(0x24e)](_0x1bd3a8));_0x35bdb3>0x0&&console[_0x15683c(0x24f)]('Errors:\x20\x20\x20'+a5_0x9fa30f[_0x15683c(0x24e)](_0x35bdb3));console[_0x15683c(0x24f)](_0x15683c(0x1c9)+formatElapsed(_0x3dfaf6)),console[_0x15683c(0x24f)]('━'[_0x15683c(0x1d6)](0x3c));const _0x485f42=_0xa69177[_0x15683c(0x232)](_0x293666=>_0x293666['status']!==_0x15683c(0x22b));if(_0x485f42['length']>0x0){console[_0x15683c(0x24f)](),console[_0x15683c(0x24f)]('Failed\x20Tests:');for(const _0x1b45f2 of _0x485f42){const _0x2ae1c3=a5_0x9fa30f[_0x15683c(0x24e)]('✗'),_0x231a12=_0x1b45f2[_0x15683c(0x1be)][_0x15683c(0x241)]>0x32?_0x1b45f2[_0x15683c(0x1be)]['substring'](0x0,0x32)+_0x15683c(0x21f):_0x1b45f2[_0x15683c(0x1be)];console['log']('\x20\x20'+_0x2ae1c3+'\x20'+_0x1b45f2[_0x15683c(0x1c0)]+':\x20'+_0x231a12);}}const _0x9ba14a={'summary':{'total':_0xa69177['length'],'passed':_0xd9b0b1,'failed':_0x1bd3a8,'errors':_0x35bdb3>0x0?_0x35bdb3:undefined,'duration_ms':_0x3dfaf6},'tests':_0xa69177,'agent':{'project':_0x271fdc[_0x15683c(0x21d)],'name':_0x271fdc['agentName'],'site':_0x524e43},'timestamp':new Date(_0x18f302)[_0x15683c(0x1df)]()};try{const _0xbf99f4=buildCachedTestRun(_0x17be36,{'site':_0x524e43,'projectId':_0x129b8e,'projectName':_0x271fdc['projectName'],'agentId':_0x5be543,'agentName':_0x271fdc[_0x15683c(0x1ed)],'testYmlPath':a5_0x45fe2a[_0x15683c(0x1bf)](_0x271fdc[_0x15683c(0x1fb)])});saveLastTestRun(_0xbf99f4);}catch{}if(_0x483960!=='table'||_0x324225){const _0x367396=formatResults(_0x9ba14a,_0x483960);if(_0x324225)try{a5_0x2b7099['writeFileSync'](_0x324225,_0x367396,'utf-8'),console[_0x15683c(0x24f)](),console[_0x15683c(0x24f)](a5_0x9fa30f[_0x15683c(0x252)](_0x15683c(0x1ce)+_0x324225));}catch(_0x5f163e){return console[_0x15683c(0x24f)](),console['log'](a5_0x9fa30f['red'](_0x15683c(0x247)+_0x5f163e)),0x1;}else console[_0x15683c(0x24f)](),console[_0x15683c(0x24f)](_0x367396);}return _0x485f42[_0x15683c(0x241)]>0x0?0x1:0x0;}async[a5_0x2e3eb7(0x200)](_0x59455a,_0x21d75e){const _0x3fe11e=a5_0x2e3eb7,{options:_0x16c750,tdx:_0x5baf5c}=_0x59455a,{definition:_0x576a88,agentInfo:_0x2475b8,outputFormat:_0x42100e,outputFile:_0x4cc354}=_0x21d75e,_0x52baed=_0x16c750[_0x3fe11e(0x1c5)],_0x20ede6=loadLastTestRun();if(!_0x20ede6)return console[_0x3fe11e(0x24f)](a5_0x9fa30f[_0x3fe11e(0x24e)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x3fe11e(0x24f)](a5_0x9fa30f['dim'](_0x3fe11e(0x24d))),0x1;if(_0x20ede6[_0x3fe11e(0x214)][_0x3fe11e(0x1ed)]!==_0x2475b8[_0x3fe11e(0x1ed)])return console[_0x3fe11e(0x24f)](a5_0x9fa30f[_0x3fe11e(0x24e)](_0x3fe11e(0x213)+_0x20ede6[_0x3fe11e(0x214)]['agentName']+_0x3fe11e(0x207)+_0x2475b8['agentName']+'\x22.')),console[_0x3fe11e(0x24f)](a5_0x9fa30f[_0x3fe11e(0x252)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x46d461=new Set(_0x20ede6[_0x3fe11e(0x1e8)]['map'](_0x49f376=>_0x49f376[_0x3fe11e(0x250)])),_0x3b6843=_0x576a88['tests'][_0x3fe11e(0x232)](_0x2e57d0=>!_0x46d461[_0x3fe11e(0x230)](_0x2e57d0[_0x3fe11e(0x1c0)]));if(_0x3b6843[_0x3fe11e(0x241)]>0x0&&_0x20ede6[_0x3fe11e(0x1c5)]!==_0x52baed)return console['log'](a5_0x9fa30f[_0x3fe11e(0x24e)](_0x3fe11e(0x222))),console[_0x3fe11e(0x24f)](a5_0x9fa30f[_0x3fe11e(0x252)](_0x3fe11e(0x21c)+_0x20ede6[_0x3fe11e(0x1c5)]+_0x3fe11e(0x1d4)+_0x52baed+'\x22.')),console[_0x3fe11e(0x24f)](a5_0x9fa30f[_0x3fe11e(0x252)](_0x3fe11e(0x1f3)+_0x20ede6[_0x3fe11e(0x1c5)]+_0x3fe11e(0x22a))),0x1;const _0x1bb279=_0x576a88[_0x3fe11e(0x1db)][_0x3fe11e(0x232)](_0x4c51ef=>_0x46d461[_0x3fe11e(0x230)](_0x4c51ef['name'])),_0x4e7c06=_0x3b6843;let _0x2016c8;try{_0x2016c8=await setupEvaluatorAgent(_0x5baf5c[_0x3fe11e(0x1f1)],_0x16c750[_0x3fe11e(0x1c8)]);}catch(_0x10a1b2){const _0x2ff27b=_0x10a1b2 instanceof Error?_0x10a1b2[_0x3fe11e(0x1d2)]:String(_0x10a1b2);return console['log'](a5_0x9fa30f['red'](_0x3fe11e(0x20d)+_0x2ff27b)),0x1;}console[_0x3fe11e(0x24f)](a5_0x9fa30f[_0x3fe11e(0x22e)](_0x3fe11e(0x1ec))),console[_0x3fe11e(0x24f)]('Cached\x20run\x20from:\x20'+a5_0x9fa30f[_0x3fe11e(0x1ea)](_0x20ede6[_0x3fe11e(0x20e)])),console['log']('Agent:\x20'+a5_0x9fa30f[_0x3fe11e(0x1ea)](_0x20ede6[_0x3fe11e(0x214)][_0x3fe11e(0x21d)]+'/'+_0x20ede6[_0x3fe11e(0x214)][_0x3fe11e(0x1ed)]));_0x4e7c06[_0x3fe11e(0x241)]>0x0&&console[_0x3fe11e(0x24f)]('New\x20tests\x20to\x20execute:\x20'+a5_0x9fa30f['yellow'](_0x4e7c06[_0x3fe11e(0x241)]));console[_0x3fe11e(0x24f)]();const _0x93e3de=[],_0x2d6faf=Date[_0x3fe11e(0x206)](),_0x12c459=createCommandSpinner(_0x3fe11e(0x1d7));if(_0x1bb279[_0x3fe11e(0x241)]>0x0)try{const _0x400f96=await reevaluateFromCache(_0x5baf5c[_0x3fe11e(0x1f1)],_0x20ede6,{'tests':_0x1bb279},{'evaluatorId':_0x2016c8,'onTestStart':(_0x438b9e,_0xfe5110,_0x5c152e)=>{const _0x4845c4=_0x3fe11e;_0x12c459[_0x4845c4(0x1f9)]=_0x4845c4(0x238)+(_0xfe5110+0x1)+'/'+_0x5c152e+':\x20'+_0x438b9e+_0x4845c4(0x21f);if(!_0x12c459[_0x4845c4(0x203)])_0x12c459[_0x4845c4(0x1ca)]();},'onTestComplete':(_0x5c55c6,_0xb2ab21)=>{const _0x460556=_0x3fe11e;_0x12c459[_0x460556(0x1cb)]();if(_0xb2ab21[_0x460556(0x1c3)]===_0x460556(0x22b))console['log'](a5_0x9fa30f[_0x460556(0x201)](_0x460556(0x24a)+_0x5c55c6)+a5_0x9fa30f[_0x460556(0x252)](_0x460556(0x202)));else _0xb2ab21[_0x460556(0x1c3)]==='FAIL'?console[_0x460556(0x24f)](a5_0x9fa30f[_0x460556(0x24e)](_0x460556(0x23f)+_0x5c55c6+_0x460556(0x1c2)+_0xb2ab21[_0x460556(0x1be)])+a5_0x9fa30f[_0x460556(0x252)]('\x20(cached)')):console['log'](a5_0x9fa30f['red'](_0x460556(0x204)+_0x5c55c6+_0x460556(0x1c2)+_0xb2ab21[_0x460556(0x1be)]));_0xb2ab21['conversation_url']&&console['log'](a5_0x9fa30f['dim'](_0x460556(0x251)+_0xb2ab21[_0x460556(0x23d)])),_0x93e3de['push'](_0xb2ab21);},'onTestSkipped':(_0x2e4eba,_0x20d7e0)=>{const _0x214034=_0x3fe11e;_0x12c459[_0x214034(0x1cb)](),console[_0x214034(0x24f)](a5_0x9fa30f[_0x214034(0x24b)](_0x214034(0x23e)+_0x2e4eba+'\x20-\x20'+_0x20d7e0));}});for(const _0x10e520 of _0x400f96){!_0x93e3de[_0x3fe11e(0x226)](_0x538e77=>_0x538e77['name']===_0x10e520[_0x3fe11e(0x1c0)])&&_0x93e3de['push'](_0x10e520);}}catch(_0x3072f9){_0x12c459[_0x3fe11e(0x1cb)]();const _0x27b15e=_0x3072f9 instanceof Error?_0x3072f9[_0x3fe11e(0x1d2)]:String(_0x3072f9);return console[_0x3fe11e(0x24f)](a5_0x9fa30f[_0x3fe11e(0x24e)](_0x3fe11e(0x1ef)+_0x27b15e)),0x1;}_0x12c459[_0x3fe11e(0x1cb)]();if(_0x4e7c06['length']>0x0){console[_0x3fe11e(0x24f)](),console[_0x3fe11e(0x24f)](a5_0x9fa30f['cyan'](_0x3fe11e(0x227)));const {projectId:_0x4f2d36,agentId:_0x55ae9b}=_0x20ede6['agent'];for(const _0x5a7aa4 of _0x4e7c06){console['log'](_0x3fe11e(0x1eb)+a5_0x9fa30f[_0x3fe11e(0x1ea)](_0x5a7aa4['name']));const _0x43c207=createCommandSpinner(_0x3fe11e(0x249)+_0x5a7aa4[_0x3fe11e(0x1d0)][_0x3fe11e(0x241)]+_0x3fe11e(0x21e));_0x43c207[_0x3fe11e(0x1ca)]();try{const {result:_0x49f543}=await runTest(_0x5baf5c[_0x3fe11e(0x1f1)],_0x5a7aa4,{'agentId':_0x55ae9b,'projectId':_0x4f2d36,'site':_0x20ede6[_0x3fe11e(0x1c5)],'noEval':![],'evaluatorId':_0x2016c8,'onRoundStart':(_0x454e0c,_0x1e5804)=>{const _0x2a1c52=_0x3fe11e;_0x43c207[_0x2a1c52(0x1f9)]=_0x2a1c52(0x1e7)+(_0x454e0c+0x1)+'/'+_0x1e5804+_0x2a1c52(0x21e);},'onRoundComplete':(_0x4062b4,_0x352b10,_0x3429c2)=>{const _0x3f4799=_0x3fe11e,_0x379dee=formatElapsed(_0x352b10);_0x3429c2?console[_0x3f4799(0x24f)](_0x3f4799(0x21b)+(_0x4062b4+0x1)+'/'+_0x5a7aa4[_0x3f4799(0x1d0)]['length']+_0x3f4799(0x22c)+a5_0x9fa30f[_0x3f4799(0x201)]('✓')+'\x20('+_0x379dee+')'):console[_0x3f4799(0x24f)](_0x3f4799(0x21b)+(_0x4062b4+0x1)+'/'+_0x5a7aa4[_0x3f4799(0x1d0)]['length']+_0x3f4799(0x22c)+a5_0x9fa30f['red']('✗'));},'onEvaluationStart':()=>{const _0x1e0d2d=_0x3fe11e;_0x43c207[_0x1e0d2d(0x1f9)]=_0x1e0d2d(0x22f);},'onEvaluationComplete':_0x53f416=>{const _0x4a7131=_0x3fe11e,_0x3f44d9=formatElapsed(_0x53f416);console[_0x4a7131(0x24f)](_0x4a7131(0x221)+a5_0x9fa30f[_0x4a7131(0x201)]('✓')+'\x20('+_0x3f44d9+')');}});_0x43c207[_0x3fe11e(0x1cb)](),_0x93e3de[_0x3fe11e(0x1c6)](_0x49f543);if(_0x49f543[_0x3fe11e(0x1c3)]==='PASS')console[_0x3fe11e(0x24f)](a5_0x9fa30f[_0x3fe11e(0x201)]('✓\x20PASS:\x20'+_0x49f543[_0x3fe11e(0x1be)])+a5_0x9fa30f[_0x3fe11e(0x252)]('\x20(new)'));else _0x49f543['status']===_0x3fe11e(0x1f4)?console['log'](a5_0x9fa30f[_0x3fe11e(0x24e)](_0x3fe11e(0x23f)+_0x49f543[_0x3fe11e(0x1be)])+a5_0x9fa30f[_0x3fe11e(0x252)](_0x3fe11e(0x23b))):console[_0x3fe11e(0x24f)](a5_0x9fa30f[_0x3fe11e(0x24e)]('✗\x20ERROR:\x20'+_0x49f543[_0x3fe11e(0x1be)]));_0x49f543['conversation_url']&&console['log'](a5_0x9fa30f[_0x3fe11e(0x252)](_0x3fe11e(0x251)+_0x49f543[_0x3fe11e(0x23d)]));}catch(_0x39fb9f){_0x43c207[_0x3fe11e(0x1cb)]();const _0x38fdd9=_0x39fb9f instanceof Error?_0x39fb9f[_0x3fe11e(0x1d2)]:String(_0x39fb9f);console[_0x3fe11e(0x24f)](a5_0x9fa30f[_0x3fe11e(0x24e)](_0x3fe11e(0x204)+_0x38fdd9)),_0x93e3de[_0x3fe11e(0x1c6)]({'name':_0x5a7aa4[_0x3fe11e(0x1c0)],'status':_0x3fe11e(0x1f7),'reason':_0x38fdd9,'timestamp':new Date()[_0x3fe11e(0x1df)](),'duration_ms':0x0});}}}console[_0x3fe11e(0x24f)]();const _0xcc1a15=Date[_0x3fe11e(0x206)]()-_0x2d6faf,_0x5d7a19=_0x93e3de[_0x3fe11e(0x232)](_0x3a5212=>_0x3a5212[_0x3fe11e(0x1c3)]===_0x3fe11e(0x22b))[_0x3fe11e(0x241)],_0x3d1ecf=_0x93e3de[_0x3fe11e(0x232)](_0x449a60=>_0x449a60['status']===_0x3fe11e(0x1f4))[_0x3fe11e(0x241)],_0x452d7d=_0x93e3de[_0x3fe11e(0x232)](_0x220927=>_0x220927[_0x3fe11e(0x1c3)]==='ERROR')[_0x3fe11e(0x241)];console[_0x3fe11e(0x24f)]('━'['repeat'](0x3c)),console[_0x3fe11e(0x24f)](_0x3fe11e(0x1bd)),console[_0x3fe11e(0x24f)]('━'[_0x3fe11e(0x1d6)](0x3c)),console[_0x3fe11e(0x24f)](_0x3fe11e(0x1fe)+_0x93e3de[_0x3fe11e(0x241)]),console['log'](_0x3fe11e(0x20b)+a5_0x9fa30f[_0x3fe11e(0x201)](_0x5d7a19)),console[_0x3fe11e(0x24f)](_0x3fe11e(0x1da)+a5_0x9fa30f['red'](_0x3d1ecf));_0x452d7d>0x0&&console[_0x3fe11e(0x24f)](_0x3fe11e(0x23a)+a5_0x9fa30f[_0x3fe11e(0x24e)](_0x452d7d));console['log'](_0x3fe11e(0x1c9)+formatElapsed(_0xcc1a15)),console[_0x3fe11e(0x24f)]('━'[_0x3fe11e(0x1d6)](0x3c));const _0x5a1256={'summary':{'total':_0x93e3de['length'],'passed':_0x5d7a19,'failed':_0x3d1ecf,'errors':_0x452d7d>0x0?_0x452d7d:undefined,'duration_ms':_0xcc1a15},'tests':_0x93e3de,'agent':{'project':_0x2475b8[_0x3fe11e(0x21d)],'name':_0x2475b8['agentName'],'site':_0x52baed},'timestamp':new Date(_0x2d6faf)[_0x3fe11e(0x1df)]()};if(_0x42100e!=='table'||_0x4cc354){const _0x26bad2=formatResults(_0x5a1256,_0x42100e);if(_0x4cc354)try{a5_0x2b7099[_0x3fe11e(0x1ee)](_0x4cc354,_0x26bad2,_0x3fe11e(0x1f5)),console[_0x3fe11e(0x24f)](),console[_0x3fe11e(0x24f)](a5_0x9fa30f[_0x3fe11e(0x252)](_0x3fe11e(0x1ce)+_0x4cc354));}catch(_0x504f76){return console[_0x3fe11e(0x24f)](),console[_0x3fe11e(0x24f)](a5_0x9fa30f[_0x3fe11e(0x24e)]('Error\x20writing\x20output\x20file:\x20'+_0x504f76)),0x1;}else console['log'](),console[_0x3fe11e(0x24f)](_0x26bad2);}const _0x6f8cca=_0x93e3de[_0x3fe11e(0x232)](_0x827438=>_0x827438[_0x3fe11e(0x1c3)]!==_0x3fe11e(0x22b));return _0x6f8cca['length']>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x3e81ae=a6_0x34c7;function a6_0x54c5(){const _0x4e3040=['trim','DELETE','Invalid\x20HTTP\x20method:\x20','1000kqNjTB','description','toUpperCase','stack','837082VmSePs','execute','api','method','headers','Results\x20saved\x20to\x20','cdp','includes','toLowerCase','readBodyFromFile','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','Error:\x20','set-cookie','verbose','noColor','status','<\x20HTTP/1.1\x20','GET','workflow','llm','request','file','\x0aStack\x20trace:\x0a','length','indexOf','authorization','set-cookie2','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','18qzBAPG','2946141DYDepA','x-auth-token','log','isArray','5568036PhkRdN','has','message','2066880PGVHvo','\x22.\x20','.\x20Valid\x20methods:\x20','2560901mZAnuG','cookie','substring','error','header','entries','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','proxy-authorization','916955xZJJrR','color','POST','x-trino-user','startsWith','Invalid\x20header\x20format:\x20\x22','172647ILsZlw','output','type','llm-proxy','join','cas','data'];a6_0x54c5=function(){return _0x4e3040;};return a6_0x54c5();}(function(_0x425a08,_0x568516){const _0x41e388=a6_0x34c7,_0x42fc10=_0x425a08();while(!![]){try{const _0x5ade90=parseInt(_0x41e388(0x1df))/0x1+-parseInt(_0x41e388(0x1c0))/0x2+-parseInt(_0x41e388(0x1b9))/0x3+-parseInt(_0x41e388(0x1bd))/0x4+-parseInt(_0x41e388(0x1cb))/0x5*(-parseInt(_0x41e388(0x1b8))/0x6)+parseInt(_0x41e388(0x1c3))/0x7+-parseInt(_0x41e388(0x1db))/0x8*(-parseInt(_0x41e388(0x1d1))/0x9);if(_0x5ade90===_0x568516)break;else _0x42fc10['push'](_0x42fc10['shift']());}catch(_0x2f51da){_0x42fc10['push'](_0x42fc10['shift']());}}}(a6_0x54c5,0xb5835));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';function a6_0x34c7(_0x8db7d1,_0x5f29bf){_0x8db7d1=_0x8db7d1-0x1a1;const _0x54c5f6=a6_0x54c5();let _0x34c7ef=_0x54c5f6[_0x8db7d1];return _0x34c7ef;}import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x3e81ae(0x1b5),a6_0x3e81ae(0x1ca),a6_0x3e81ae(0x1c4),a6_0x3e81ae(0x1a8),a6_0x3e81ae(0x1b6),'x-xsrf-token',a6_0x3e81ae(0x1ba),a6_0x3e81ae(0x1ce)]);function isSensitiveHeader(_0x39bb60){const _0x85ed0a=a6_0x3e81ae;return SENSITIVE_HEADERS[_0x85ed0a(0x1be)](_0x39bb60[_0x85ed0a(0x1a3)]());}function parseHeader(_0xbd93f){const _0x48101d=a6_0x3e81ae,_0x898edc=_0xbd93f[_0x48101d(0x1b4)](':');if(_0x898edc===-0x1)throw new Error(_0x48101d(0x1d0)+_0xbd93f+_0x48101d(0x1c1)+_0x48101d(0x1a5));const _0x270665=_0xbd93f[_0x48101d(0x1c5)](0x0,_0x898edc)['trim'](),_0x414ea4=_0xbd93f[_0x48101d(0x1c5)](_0x898edc+0x1)[_0x48101d(0x1d8)]();if(!_0x270665)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0xbd93f+'\x22');return[_0x270665,_0x414ea4];}export class ApiCommand extends BaseCommand{['name']=a6_0x3e81ae(0x1e1);[a6_0x3e81ae(0x1dc)]=a6_0x3e81ae(0x1c9);['validate'](_0x5302d8){const _0x2f98e7=a6_0x3e81ae,{args:_0x3c2f61,options:_0x4878a3}=_0x5302d8,_0x4d5e66=_0x4878a3;if(_0x3c2f61[_0x2f98e7(0x1b3)]===0x0)return _0x2f98e7(0x1b7);const _0x37f3e7=_0x3c2f61[0x0];if(!_0x37f3e7[_0x2f98e7(0x1cf)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x37f3e7;const _0x38b0ca=_0x4d5e66[_0x2f98e7(0x1d7)],_0x3b14bf=_0x4d5e66[_0x2f98e7(0x1b1)];if(_0x38b0ca&&_0x3b14bf)return _0x2f98e7(0x1a6);const _0x58689f=_0x4d5e66[_0x2f98e7(0x1e2)]||_0x2f98e7(0x1ad),_0x5cf5c0=[_0x2f98e7(0x1ad),_0x2f98e7(0x1cd),'PUT',_0x2f98e7(0x1d9),'PATCH'];if(!_0x5cf5c0[_0x2f98e7(0x1a2)](_0x58689f[_0x2f98e7(0x1dd)]()))return _0x2f98e7(0x1da)+_0x58689f+_0x2f98e7(0x1c2)+_0x5cf5c0[_0x2f98e7(0x1d5)](',\x20');const _0x36690b=_0x4d5e66[_0x2f98e7(0x1d3)]||'td',_0x336d27=['td',_0x2f98e7(0x1a1),_0x2f98e7(0x1ae),'trino',_0x2f98e7(0x1af),_0x2f98e7(0x1d4),_0x2f98e7(0x1d6)];if(!_0x336d27[_0x2f98e7(0x1a2)](_0x36690b))return'Invalid\x20API\x20type:\x20'+_0x36690b+'.\x20Valid\x20types:\x20'+_0x336d27[_0x2f98e7(0x1d5)](',\x20');return undefined;}async[a6_0x3e81ae(0x1e0)](_0x39d6a8){const _0x43c2db=a6_0x3e81ae,{options:_0x44f57f,args:_0x2a80ba,tdx:_0xe2d039}=_0x39d6a8,_0x4fec16=_0x44f57f,_0x4739ce=_0x2a80ba[0x0],_0x4108db=(_0x4fec16[_0x43c2db(0x1e2)]||'GET')['toUpperCase'](),_0x3a9f7e=_0x4fec16[_0x43c2db(0x1d7)],_0x109370=_0x4fec16[_0x43c2db(0x1b1)],_0xaa768=_0x4fec16[_0x43c2db(0x1c7)],_0x494403=_0x4fec16[_0x43c2db(0x1d3)]||'td';try{const _0x55e1c1={};if(_0xaa768){const _0x100443=Array[_0x43c2db(0x1bc)](_0xaa768)?_0xaa768:[_0xaa768];for(const _0x118096 of _0x100443){const [_0x1536fd,_0x1d7216]=parseHeader(_0x118096);_0x55e1c1[_0x1536fd]=_0x1d7216;}}let _0x494143;if(_0x3a9f7e)_0x494143=_0x3a9f7e;else{if(_0x109370)try{_0x494143=RawAPI[_0x43c2db(0x1a4)](_0x109370);}catch(_0x1ee33c){return console[_0x43c2db(0x1c6)](_0x43c2db(0x1a7)+(_0x1ee33c instanceof Error?_0x1ee33c[_0x43c2db(0x1bf)]:String(_0x1ee33c))),0x1;}}const _0x505ed0={'method':_0x4108db,'apiType':_0x494403,'includeHeaders':_0x44f57f[_0x43c2db(0x1a9)]};_0x494143&&(_0x505ed0['body']=_0x494143);Object['keys'](_0x55e1c1)[_0x43c2db(0x1b3)]>0x0&&(_0x505ed0[_0x43c2db(0x1e3)]=_0x55e1c1);if(_0x44f57f[_0x43c2db(0x1a9)]){const _0x1976fe=resolveSite(_0x44f57f['site']),_0xfd5ffb=getEndpoint(_0x1976fe,_0x494403),_0x1336a3=''+_0xfd5ffb+_0x4739ce;console['error']('>\x20'+_0x4108db+'\x20'+_0x1336a3);const _0x3d8e69=getAuthHeaders(_0x1976fe),_0xb66105={..._0x3d8e69,..._0x55e1c1};for(const [_0x1fd1e9,_0x382ce0]of Object[_0x43c2db(0x1c8)](_0xb66105)){!isSensitiveHeader(_0x1fd1e9)&&console[_0x43c2db(0x1c6)]('>\x20'+_0x1fd1e9+':\x20'+_0x382ce0);}_0x494143&&console[_0x43c2db(0x1c6)]('>'),console[_0x43c2db(0x1c6)]('');}const _0x4ad41a=await _0xe2d039['api'][_0x43c2db(0x1b0)](_0x4739ce,_0x505ed0);if(_0x44f57f[_0x43c2db(0x1a9)]&&_0x4ad41a[_0x43c2db(0x1e3)]){console[_0x43c2db(0x1c6)](_0x43c2db(0x1ac)+_0x4ad41a[_0x43c2db(0x1ab)]);for(const [_0x2a8657,_0x2eb4f4]of Object[_0x43c2db(0x1c8)](_0x4ad41a[_0x43c2db(0x1e3)])){!isSensitiveHeader(_0x2a8657)&&console[_0x43c2db(0x1c6)]('<\x20'+_0x2a8657+':\x20'+_0x2eb4f4);}console[_0x43c2db(0x1c6)]('');}const _0xb918b2=Boolean(_0x44f57f[_0x43c2db(0x1d2)]),_0x44dd4a={'color':_0x44f57f[_0x43c2db(0x1cc)],'noColor':_0x44f57f[_0x43c2db(0x1aa)]||_0xb918b2&&!_0x44f57f['color']},_0x1c6f14=colorizeJSON(_0x4ad41a[_0x43c2db(0x1d7)],_0x44dd4a);return _0x44f57f[_0x43c2db(0x1d2)]?(writeFileSync(_0x44f57f[_0x43c2db(0x1d2)],_0x1c6f14),console['error'](_0x43c2db(0x1e4)+_0x44f57f['output'])):console[_0x43c2db(0x1bb)](_0x1c6f14),0x0;}catch(_0x259515){return _0x259515 instanceof Error?(console[_0x43c2db(0x1c6)](_0x43c2db(0x1a7)+_0x259515[_0x43c2db(0x1bf)]),_0x44f57f['verbose']&&_0x259515[_0x43c2db(0x1de)]&&console[_0x43c2db(0x1c6)](_0x43c2db(0x1b2)+_0x259515[_0x43c2db(0x1de)])):console['error'](_0x43c2db(0x1a7)+String(_0x259515)),0x1;}}}
1
+ const a6_0x212c3b=a6_0x89e7;(function(_0x140770,_0x10f9ca){const _0x737ec2=a6_0x89e7,_0x304712=_0x140770();while(!![]){try{const _0x5dc0be=-parseInt(_0x737ec2(0x171))/0x1*(parseInt(_0x737ec2(0x176))/0x2)+-parseInt(_0x737ec2(0x181))/0x3*(-parseInt(_0x737ec2(0x185))/0x4)+parseInt(_0x737ec2(0x19b))/0x5+-parseInt(_0x737ec2(0x1a1))/0x6+parseInt(_0x737ec2(0x161))/0x7+-parseInt(_0x737ec2(0x16d))/0x8*(-parseInt(_0x737ec2(0x186))/0x9)+-parseInt(_0x737ec2(0x1a7))/0xa;if(_0x5dc0be===_0x10f9ca)break;else _0x304712['push'](_0x304712['shift']());}catch(_0x109202){_0x304712['push'](_0x304712['shift']());}}}(a6_0x18a8,0xbe7de));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization',a6_0x212c3b(0x198),a6_0x212c3b(0x188),a6_0x212c3b(0x180),a6_0x212c3b(0x191),a6_0x212c3b(0x164),'x-auth-token',a6_0x212c3b(0x1a2)]);function isSensitiveHeader(_0x22a796){const _0x2106f1=a6_0x212c3b;return SENSITIVE_HEADERS[_0x2106f1(0x17c)](_0x22a796['toLowerCase']());}function parseHeader(_0x549e5b){const _0xd1d144=a6_0x212c3b,_0x4e76ca=_0x549e5b[_0xd1d144(0x18b)](':');if(_0x4e76ca===-0x1)throw new Error(_0xd1d144(0x167)+_0x549e5b+_0xd1d144(0x169)+_0xd1d144(0x18a));const _0x202a46=_0x549e5b[_0xd1d144(0x170)](0x0,_0x4e76ca)['trim'](),_0x2292d5=_0x549e5b[_0xd1d144(0x170)](_0x4e76ca+0x1)[_0xd1d144(0x177)]();if(!_0x202a46)throw new Error(_0xd1d144(0x1ab)+_0x549e5b+'\x22');return[_0x202a46,_0x2292d5];}function a6_0x89e7(_0x14172a,_0x1dda9b){_0x14172a=_0x14172a-0x161;const _0x18a839=a6_0x18a8();let _0x89e70=_0x18a839[_0x14172a];return _0x89e70;}function a6_0x18a8(){const _0x414331=['2703741MBqUsX','cdp','method','cas','4WQDaVF','9bPacps','Invalid\x20HTTP\x20method:\x20','cookie','output','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','indexOf','PATCH','includes','llm','isArray','api','set-cookie2','data','DELETE','length','readBodyFromFile','type','site','proxy-authorization','.\x20Valid\x20types:\x20','verbose','7588345YrfIrG','name','POST','workflow','GET','toUpperCase','8453580ABMOEd','x-trino-user','PUT','keys','log','execute','10851130uMwhte','join','headers','entries','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','6109320rRMGye','llm-proxy','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','x-xsrf-token','message','trino','Invalid\x20header\x20format:\x20\x22','stack','\x22.\x20','color','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','\x0aStack\x20trace:\x0a','4053656KEbUYT','startsWith','status','substring','107pkAhag','Endpoint\x20must\x20start\x20with\x20/:\x20','validate','Results\x20saved\x20to\x20','file','9796DqnpZw','trim','body','Invalid\x20API\x20type:\x20','Error:\x20','error','has','description','.\x20Valid\x20methods:\x20','<\x20HTTP/1.1\x20','set-cookie'];a6_0x18a8=function(){return _0x414331;};return a6_0x18a8();}export class ApiCommand extends BaseCommand{[a6_0x212c3b(0x19c)]=a6_0x212c3b(0x190);[a6_0x212c3b(0x17d)]=a6_0x212c3b(0x16b);[a6_0x212c3b(0x173)](_0x2a4693){const _0x3605f7=a6_0x212c3b,{args:_0x263fd9,options:_0x4d08a5}=_0x2a4693,_0x4e58bb=_0x4d08a5;if(_0x263fd9[_0x3605f7(0x194)]===0x0)return _0x3605f7(0x163);const _0x192fe1=_0x263fd9[0x0];if(!_0x192fe1[_0x3605f7(0x16e)]('/'))return _0x3605f7(0x172)+_0x192fe1;const _0x2cb397=_0x4e58bb[_0x3605f7(0x192)],_0x39ce2e=_0x4e58bb['file'];if(_0x2cb397&&_0x39ce2e)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x872947=_0x4e58bb[_0x3605f7(0x183)]||_0x3605f7(0x19f),_0x313372=['GET',_0x3605f7(0x19d),_0x3605f7(0x1a3),_0x3605f7(0x193),_0x3605f7(0x18c)];if(!_0x313372[_0x3605f7(0x18d)](_0x872947['toUpperCase']()))return _0x3605f7(0x187)+_0x872947+_0x3605f7(0x17e)+_0x313372[_0x3605f7(0x1a8)](',\x20');const _0x28d8e0=_0x4e58bb['type']||'td',_0x12f7d4=['td',_0x3605f7(0x182),_0x3605f7(0x19e),_0x3605f7(0x166),_0x3605f7(0x18e),_0x3605f7(0x162),_0x3605f7(0x184)];if(!_0x12f7d4[_0x3605f7(0x18d)](_0x28d8e0))return _0x3605f7(0x179)+_0x28d8e0+_0x3605f7(0x199)+_0x12f7d4['join'](',\x20');return undefined;}async[a6_0x212c3b(0x1a6)](_0x2ba87e){const _0x18701c=a6_0x212c3b,{options:_0x4849e2,args:_0x323aeb,tdx:_0x45054e}=_0x2ba87e,_0x3889ed=_0x4849e2,_0x37e954=_0x323aeb[0x0],_0x45875f=(_0x3889ed[_0x18701c(0x183)]||_0x18701c(0x19f))[_0x18701c(0x1a0)](),_0x4bc2cf=_0x3889ed[_0x18701c(0x192)],_0x19481d=_0x3889ed[_0x18701c(0x175)],_0x23d729=_0x3889ed['header'],_0x299566=_0x3889ed[_0x18701c(0x196)]||'td';try{const _0x5a089b={};if(_0x23d729){const _0x393a21=Array[_0x18701c(0x18f)](_0x23d729)?_0x23d729:[_0x23d729];for(const _0x5b99a9 of _0x393a21){const [_0xeb9c7,_0x4d9fbe]=parseHeader(_0x5b99a9);_0x5a089b[_0xeb9c7]=_0x4d9fbe;}}let _0x150509;if(_0x4bc2cf)_0x150509=_0x4bc2cf;else{if(_0x19481d)try{_0x150509=RawAPI[_0x18701c(0x195)](_0x19481d);}catch(_0x1c4ac9){return console[_0x18701c(0x17b)](_0x18701c(0x17a)+(_0x1c4ac9 instanceof Error?_0x1c4ac9[_0x18701c(0x165)]:String(_0x1c4ac9))),0x1;}}const _0x43504d={'method':_0x45875f,'apiType':_0x299566,'includeHeaders':_0x4849e2[_0x18701c(0x19a)]};_0x150509&&(_0x43504d[_0x18701c(0x178)]=_0x150509);Object[_0x18701c(0x1a4)](_0x5a089b)['length']>0x0&&(_0x43504d[_0x18701c(0x1a9)]=_0x5a089b);if(_0x4849e2['verbose']){const _0x2fe64e=resolveSite(_0x4849e2[_0x18701c(0x197)]),_0x5f4825=getEndpoint(_0x2fe64e,_0x299566),_0x39dede=''+_0x5f4825+_0x37e954;console[_0x18701c(0x17b)]('>\x20'+_0x45875f+'\x20'+_0x39dede);const _0x3b488c=getAuthHeaders(_0x2fe64e),_0x1576ce={..._0x3b488c,..._0x5a089b};for(const [_0x32e525,_0x458ab0]of Object[_0x18701c(0x1aa)](_0x1576ce)){!isSensitiveHeader(_0x32e525)&&console[_0x18701c(0x17b)]('>\x20'+_0x32e525+':\x20'+_0x458ab0);}_0x150509&&console[_0x18701c(0x17b)]('>'),console[_0x18701c(0x17b)]('');}const _0x49f9b7=await _0x45054e[_0x18701c(0x190)]['request'](_0x37e954,_0x43504d);if(_0x4849e2[_0x18701c(0x19a)]&&_0x49f9b7[_0x18701c(0x1a9)]){console['error'](_0x18701c(0x17f)+_0x49f9b7[_0x18701c(0x16f)]);for(const [_0x5e1dab,_0xa4e058]of Object[_0x18701c(0x1aa)](_0x49f9b7['headers'])){!isSensitiveHeader(_0x5e1dab)&&console[_0x18701c(0x17b)]('<\x20'+_0x5e1dab+':\x20'+_0xa4e058);}console[_0x18701c(0x17b)]('');}const _0x245247=Boolean(_0x4849e2[_0x18701c(0x189)]),_0x47fea8={'color':_0x4849e2[_0x18701c(0x16a)],'noColor':_0x4849e2['noColor']||_0x245247&&!_0x4849e2[_0x18701c(0x16a)]},_0x55b981=colorizeJSON(_0x49f9b7['data'],_0x47fea8);return _0x4849e2['output']?(writeFileSync(_0x4849e2['output'],_0x55b981),console['error'](_0x18701c(0x174)+_0x4849e2['output'])):console[_0x18701c(0x1a5)](_0x55b981),0x0;}catch(_0x247fe9){return _0x247fe9 instanceof Error?(console[_0x18701c(0x17b)](_0x18701c(0x17a)+_0x247fe9[_0x18701c(0x165)]),_0x4849e2['verbose']&&_0x247fe9[_0x18701c(0x168)]&&console[_0x18701c(0x17b)](_0x18701c(0x16c)+_0x247fe9[_0x18701c(0x168)])):console[_0x18701c(0x17b)](_0x18701c(0x17a)+String(_0x247fe9)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x6e8559=a7_0x5cf4;function a7_0x2530(){const _0x5c0c85=['\x20removed\x20from\x20keychain','Remove\x20API\x20key\x20from\x20system\x20keychain','green','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','2544132TaCzsm','description','access_token','8696jJPiBh','✓\x20Default\x20site\x20set\x20to\x20','tdx\x20profile:\x20','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','trim','auth:clear','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','✓\x20Signed\x20in\x20successfully','jobs','/oauth/authorize','✓\x20Authentication\x20successful\x0a','14015070BCxBNU','dim','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','\x0aSetup\x20cancelled','apiKey','all','\x20for\x20profile:\x20','apikey','No\x20credentials\x20found\x20in\x20keychain','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','name','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','accountName','User:\x20','System\x20keychain\x20is\x20not\x20available','OAuth\x20tokens','Sign\x20in\x20with\x20browser\x20(recommended)','create','profile','text','first_name','471wlyorI','status','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','email','\x20\x20tdx','message','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','Setup\x20cancelled','\x27\x20registered','error','✗\x20Validation\x20failed:\x20','3152bCGzxK','account_id','\x20\x20(','warn','Read\x20credential\x20from\x20keychain','Name:\x20','us01','/users/initiate_sso\x20(account:\x20','Setting\x20up\x20authentication\x20for\x20site:\x20','\x20\x20user_id:','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','execute','200013cBaiok','log','logLevel','N/A','tdx:\x20auth\x20setup','bold','Setup\x20API\x20key\x20authentication\x20interactively','\x20and\x20','red','5201lXGSLu','auth','766362IiNIeZ','method','join','Choose\x20how\x20to\x20sign\x20in:','ERROR','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','cyan','select','Validating\x20OAuth\x20tokens...','1124265cvhEsy','\x20(profile:\x20','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','site','yellow','last_name','Validating\x20API\x20key...','No\x20credential\x20found','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','/app/mp/ak','Opening\x20browser\x20for\x20authentication...','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','✓\x20Profile\x20\x27','oauth','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','getUserInfo','API\x20key\x20cannot\x20be\x20empty','filter'];a7_0x2530=function(){return _0x5c0c85;};return a7_0x2530();}(function(_0x297128,_0x3c8e7c){const _0x4a067b=a7_0x5cf4,_0x425b40=_0x297128();while(!![]){try{const _0x573711=-parseInt(_0x4a067b(0x22d))/0x1+-parseInt(_0x4a067b(0x1d3))/0x2+parseInt(_0x4a067b(0x216))/0x3*(-parseInt(_0x4a067b(0x1f5))/0x4)+-parseInt(_0x4a067b(0x1dc))/0x5+-parseInt(_0x4a067b(0x1f2))/0x6+-parseInt(_0x4a067b(0x1d1))/0x7*(-parseInt(_0x4a067b(0x221))/0x8)+parseInt(_0x4a067b(0x201))/0x9;if(_0x573711===_0x3c8e7c)break;else _0x425b40['push'](_0x425b40['shift']());}catch(_0x381efd){_0x425b40['push'](_0x425b40['shift']());}}}(a7_0x2530,0x43869));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';function a7_0x5cf4(_0x6af9b8,_0x51ba7a){_0x6af9b8=_0x6af9b8-0x1ca;const _0x2530db=a7_0x2530();let _0x5cf4d6=_0x2530db[_0x6af9b8];return _0x5cf4d6;}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_0x3d0a92 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x295ac4 from'chalk';export async function runOAuthLoginFlow(_0x3ea8c3,_0x1efcb7,_0x16f084,_0x17b85a){const _0x48919a=a7_0x5cf4,_0x4d510a=await isKeychainAvailable();if(!_0x4d510a)throw new Error(_0x48919a(0x22b)+_0x48919a(0x21c));let _0x2cbf50=_0x17b85a?.[_0x48919a(0x20d)];if(!_0x2cbf50){const _0x2856a0=await a7_0x3d0a92({'type':_0x48919a(0x214),'name':'accountName','message':_0x48919a(0x1de)});if(_0x2856a0[_0x48919a(0x20d)]===undefined)throw new Error(_0x48919a(0x21d));_0x2cbf50=_0x2856a0[_0x48919a(0x20d)]['trim']()||undefined;}const _0x38fcef=getConsoleUrl(_0x3ea8c3);console[_0x48919a(0x22e)](_0x48919a(0x1e6));_0x2cbf50?console['log']('\x20\x20'+_0x38fcef+_0x48919a(0x228)+_0x2cbf50+')'):console[_0x48919a(0x22e)]('\x20\x20'+_0x38fcef+_0x48919a(0x1ff));console[_0x48919a(0x22e)](_0x48919a(0x1f8));const _0xa1c0f1=await startOAuthFlow(_0x3ea8c3,{'accountName':_0x2cbf50});console[_0x48919a(0x22e)](_0x48919a(0x1db));const _0x431306=TDX[_0x48919a(0x212)]({'site':_0x3ea8c3,'accessToken':_0xa1c0f1[_0x48919a(0x1f4)],'logLevel':_0x16f084??LogLevel[_0x48919a(0x1d7)]}),_0x54c1a6=await _0x431306[_0x48919a(0x1fe)][_0x48919a(0x1eb)]();console['log'](a7_0x295ac4[_0x48919a(0x1f0)](_0x48919a(0x1fd))),console[_0x48919a(0x22e)]('\x20\x20'+a7_0x295ac4[_0x48919a(0x1d9)](_0x3ea8c3+':'+_0x54c1a6[_0x48919a(0x222)])+_0x48919a(0x22a)+_0x54c1a6['id']+_0x48919a(0x223)+_0x54c1a6[_0x48919a(0x219)]+')');!_0x2cbf50&&(console[_0x48919a(0x22e)](a7_0x295ac4[_0x48919a(0x202)](_0x48919a(0x1fc))),console[_0x48919a(0x22e)](a7_0x295ac4[_0x48919a(0x202)]('\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>')),console[_0x48919a(0x22e)](a7_0x295ac4['dim'](_0x48919a(0x1e4))));await saveOAuthTokens(_0xa1c0f1,_0x1efcb7),console[_0x48919a(0x22e)](_0x48919a(0x1ea)+(_0x1efcb7?_0x48919a(0x1dd)+_0x1efcb7+')':''));if(_0x1efcb7){const _0x2a2626={'site':_0x3ea8c3};saveProfileToUserConfig(_0x1efcb7,_0x2a2626),console[_0x48919a(0x22e)]('✓\x20Profile\x20\x27'+_0x1efcb7+_0x48919a(0x21e));}else saveDefaultSiteToUserConfig(_0x3ea8c3),console['log'](_0x48919a(0x1f6)+_0x3ea8c3);const _0x2861f3=_0x1efcb7?'\x20--profile\x20'+_0x1efcb7:'';console[_0x48919a(0x22e)](),console[_0x48919a(0x22e)](_0x48919a(0x203)),console['log'](_0x48919a(0x21a)+_0x2861f3+_0x48919a(0x20a)),console[_0x48919a(0x22e)](_0x48919a(0x21a)+_0x2861f3+_0x48919a(0x1e7));}export async function promptAuthMethod(){const _0x40dc86=a7_0x5cf4,_0x3a8251=await a7_0x3d0a92({'type':_0x40dc86(0x1da),'name':'method','message':_0x40dc86(0x1d6),'choices':[{'title':_0x40dc86(0x211),'description':_0x40dc86(0x20c),'value':_0x40dc86(0x1e9)},{'title':'Use\x20an\x20API\x20key','description':'For\x20scripts\x20or\x20headless\x20servers','value':_0x40dc86(0x208)}]});return _0x3a8251[_0x40dc86(0x1d4)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x6e8559(0x20b)]='auth:setup';[a7_0x6e8559(0x1f3)]=a7_0x6e8559(0x1ce);async[a7_0x6e8559(0x22c)](_0x36a411){const _0x101267=a7_0x6e8559,{options:_0x6af320}=_0x36a411,_0x4b7357=_0x6af320[_0x101267(0x213)];console['log'](a7_0x295ac4[_0x101267(0x1cd)](_0x101267(0x1cc)));const _0x436216=_0x6af320[_0x101267(0x1df)]||_0x101267(0x227),_0x372577=await promptSiteSelection(_0x436216,_0x4b7357,_0x101267(0x21d));if(!_0x372577)return 0x1;const _0x53059c=resolveSite(_0x372577),_0x4fc6f9=await promptAuthMethod();if(!_0x4fc6f9)return console[_0x101267(0x22e)](_0x101267(0x204)),0x1;if(_0x4fc6f9===_0x101267(0x1e9)){const {accountName:_0x8c7d0}=_0x6af320;return await runOAuthLoginFlow(_0x53059c,_0x4b7357,_0x6af320['logLevel']??LogLevel[_0x101267(0x1d7)],{'accountName':_0x8c7d0}),0x0;}console[_0x101267(0x22e)](_0x101267(0x229)+_0x53059c),console[_0x101267(0x22e)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x101267(0x22e)]('\x20\x20'+getConsoleUrl(_0x53059c,_0x101267(0x1e5)));const _0x38654f=await a7_0x3d0a92({'type':'password','name':_0x101267(0x205),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x1116a6=>{const _0xc59c8d=_0x101267;if(!_0x1116a6||!_0x1116a6[_0xc59c8d(0x1f9)]())return _0xc59c8d(0x1ec);return!![];}});if(!_0x38654f[_0x101267(0x205)])return console[_0x101267(0x22e)](_0x101267(0x204)),0x1;const _0x3ef420=_0x38654f[_0x101267(0x205)];console[_0x101267(0x22e)](_0x101267(0x1e2));try{const _0x4f0c06=TDX['create']({'site':_0x53059c,'apiKey':_0x3ef420[_0x101267(0x1f9)](),'logLevel':_0x6af320[_0x101267(0x1ca)]??LogLevel[_0x101267(0x1d7)]}),_0x3ee512=await _0x4f0c06[_0x101267(0x1fe)]['getUserInfo']();console[_0x101267(0x22e)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x3ee512[_0x101267(0x219)]+')');const _0x5890ea=await isKeychainAvailable();_0x5890ea?(await saveAPIKeyAsync(_0x3ef420[_0x101267(0x1f9)](),_0x53059c,_0x4b7357),console[_0x101267(0x22e)](_0x101267(0x1d8)+(_0x4b7357?_0x101267(0x1dd)+_0x4b7357+')':''))):(console[_0x101267(0x224)](a7_0x295ac4['yellow'](_0x101267(0x1fb))),console[_0x101267(0x224)](a7_0x295ac4[_0x101267(0x1e0)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x4b7357){const _0x5b3f27={'site':_0x53059c};saveProfileToUserConfig(_0x4b7357,_0x5b3f27),console[_0x101267(0x22e)](_0x101267(0x1e8)+_0x4b7357+_0x101267(0x21e));}else saveDefaultSiteToUserConfig(_0x53059c),console['log'](_0x101267(0x1f6)+_0x53059c);const _0x2ed688=_0x4b7357?'\x20--profile\x20'+_0x4b7357:'';return console[_0x101267(0x22e)](),console['log']('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log']('\x20\x20tdx'+_0x2ed688+_0x101267(0x20a)),console[_0x101267(0x22e)](_0x101267(0x21a)+_0x2ed688+_0x101267(0x1e7)),0x0;}catch(_0x4587b4){if(_0x4587b4 instanceof HTTPClientError&&_0x4587b4[_0x101267(0x217)]===0x191)return printAuthError(_0x4587b4),0x1;return console['error'](a7_0x295ac4['red'](_0x101267(0x220)+(_0x4587b4 instanceof Error?_0x4587b4[_0x101267(0x21b)]:String(_0x4587b4)))),console[_0x101267(0x21f)](_0x101267(0x1f1)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x6e8559(0x20b)]=a7_0x6e8559(0x1d2);[a7_0x6e8559(0x1f3)]=a7_0x6e8559(0x218);async['execute'](_0x502f43){const _0x2a914e=a7_0x6e8559,{options:_0x5e1ec6,tdx:_0x34b06d}=_0x502f43,_0x59f19a=_0x5e1ec6['site'],_0x480649=_0x5e1ec6[_0x2a914e(0x213)],_0x2d3bd0=_0x480649?_0x480649:_0x2a914e(0x1cb);console[_0x2a914e(0x22e)](_0x2a914e(0x1f7)+_0x2d3bd0+'\x20(site:\x20'+_0x59f19a+')');const _0x34a358=await getOAuthTokens(_0x480649);if(_0x34a358)console[_0x2a914e(0x22e)]('Credential\x20type:\x20OAuth'),console[_0x2a914e(0x22e)](_0x2a914e(0x225)+(_0x480649?_0x2a914e(0x1dd)+_0x480649+')':''));else{const _0xf76b93=await resolveAPIKeyAsync(_0x59f19a,_0x480649);if(_0xf76b93){const {source:_0x268976,isDeprecated:_0x2c06d3}=_0xf76b93,_0x4ddbbb='Read\x20credential\x20from\x20'+_0x268976;console[_0x2a914e(0x22e)](_0x2c06d3?a7_0x295ac4[_0x2a914e(0x1e0)](_0x4ddbbb):_0x4ddbbb);}else console[_0x2a914e(0x22e)](a7_0x295ac4[_0x2a914e(0x1e0)](_0x2a914e(0x1e3)));}try{const _0x32b85f=await _0x34b06d[_0x2a914e(0x1fe)][_0x2a914e(0x1eb)]();return console['log'](a7_0x295ac4['green'](_0x2a914e(0x200))),console[_0x2a914e(0x22e)](_0x2a914e(0x20e)+_0x32b85f[_0x2a914e(0x219)]),(_0x32b85f[_0x2a914e(0x215)]||_0x32b85f[_0x2a914e(0x1e1)])&&console[_0x2a914e(0x22e)](_0x2a914e(0x226)+[_0x32b85f[_0x2a914e(0x215)],_0x32b85f[_0x2a914e(0x1e1)]][_0x2a914e(0x1ed)](Boolean)[_0x2a914e(0x1d5)]('\x20')),0x0;}catch(_0x38e2c1){return _0x38e2c1 instanceof HTTPClientError&&_0x38e2c1[_0x2a914e(0x217)]===0x191?printAuthError(_0x38e2c1,!![],_0x480649):console[_0x2a914e(0x21f)](a7_0x295ac4[_0x2a914e(0x1d0)](_0x2a914e(0x220)+(_0x38e2c1 instanceof Error?_0x38e2c1['message']:String(_0x38e2c1)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x6e8559(0x1fa);['description']=a7_0x6e8559(0x1ef);async['execute'](_0x5d4024){const _0x2a9fc1=a7_0x6e8559,{options:_0x105f90}=_0x5d4024,_0x20c63e=_0x105f90[_0x2a9fc1(0x213)];console['log'](a7_0x295ac4['bold']('tdx:\x20auth\x20clear'));const _0x76d1d1=await isKeychainAvailable();if(!_0x76d1d1)return console[_0x2a9fc1(0x21f)](a7_0x295ac4['red'](_0x2a9fc1(0x20f))),0x1;const [_0x3ef1e3,_0x53ac85]=await Promise[_0x2a9fc1(0x206)]([deleteKeychainAPIKey(_0x20c63e),deleteOAuthTokens(_0x20c63e)]);if(_0x3ef1e3||_0x53ac85){clearCredentialCache();const _0x16903e=[_0x3ef1e3&&'API\x20key',_0x53ac85&&_0x2a9fc1(0x210)][_0x2a9fc1(0x1ed)](Boolean)[_0x2a9fc1(0x1d5)](_0x2a9fc1(0x1cf));return console[_0x2a9fc1(0x22e)]('✓\x20'+_0x16903e+_0x2a9fc1(0x1ee)+(_0x20c63e?_0x2a9fc1(0x1dd)+_0x20c63e+')':'')),0x0;}else return console[_0x2a9fc1(0x22e)](_0x2a9fc1(0x209)+(_0x20c63e?_0x2a9fc1(0x207)+_0x20c63e:'')),0x1;}}
1
+ const a7_0x45f50e=a7_0x4f9c;(function(_0x2dda49,_0x2f378f){const _0x4a2e27=a7_0x4f9c,_0xb8da95=_0x2dda49();while(!![]){try{const _0x51181f=parseInt(_0x4a2e27(0x204))/0x1+-parseInt(_0x4a2e27(0x1f0))/0x2+-parseInt(_0x4a2e27(0x219))/0x3+parseInt(_0x4a2e27(0x22a))/0x4+parseInt(_0x4a2e27(0x22e))/0x5*(-parseInt(_0x4a2e27(0x218))/0x6)+-parseInt(_0x4a2e27(0x1ed))/0x7*(-parseInt(_0x4a2e27(0x22d))/0x8)+parseInt(_0x4a2e27(0x20f))/0x9;if(_0x51181f===_0x2f378f)break;else _0xb8da95['push'](_0xb8da95['shift']());}catch(_0x3a895b){_0xb8da95['push'](_0xb8da95['shift']());}}}(a7_0x1cca,0xa39a4));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_0x4f9c(_0x59f1a0,_0x1e27df){_0x59f1a0=_0x59f1a0-0x1d4;const _0x1ccaed=a7_0x1cca();let _0x4f9c95=_0x1ccaed[_0x59f1a0];return _0x4f9c95;}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_0x80053d from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x1a708c from'chalk';export async function runOAuthLoginFlow(_0x378e78,_0x4cc123,_0x433a7d,_0x1f0dc0){const _0x43f7c5=a7_0x4f9c,_0x306f8d=await isKeychainAvailable();if(!_0x306f8d)throw new Error(_0x43f7c5(0x212)+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');let _0x5503dc=_0x1f0dc0?.['accountName'];if(!_0x5503dc){const _0x5a11e3=await a7_0x80053d({'type':_0x43f7c5(0x214),'name':_0x43f7c5(0x211),'message':_0x43f7c5(0x1e9)});if(_0x5a11e3[_0x43f7c5(0x211)]===undefined)throw new Error(_0x43f7c5(0x20a));_0x5503dc=_0x5a11e3[_0x43f7c5(0x211)][_0x43f7c5(0x1e3)]()||undefined;}const _0x375d38=getConsoleUrl(_0x378e78);console[_0x43f7c5(0x20d)](_0x43f7c5(0x229));_0x5503dc?console['log']('\x20\x20'+_0x375d38+_0x43f7c5(0x233)+_0x5503dc+')'):console[_0x43f7c5(0x20d)]('\x20\x20'+_0x375d38+_0x43f7c5(0x232));console[_0x43f7c5(0x20d)]('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0x5029a4=await startOAuthFlow(_0x378e78,{'accountName':_0x5503dc});console[_0x43f7c5(0x20d)](_0x43f7c5(0x1ea));const _0x5845c1=TDX[_0x43f7c5(0x235)]({'site':_0x378e78,'accessToken':_0x5029a4[_0x43f7c5(0x1d6)],'logLevel':_0x433a7d??LogLevel[_0x43f7c5(0x1ec)]}),_0x4fd3d0=await _0x5845c1[_0x43f7c5(0x1e4)][_0x43f7c5(0x222)]();console[_0x43f7c5(0x20d)](a7_0x1a708c[_0x43f7c5(0x220)]('✓\x20Signed\x20in\x20successfully')),console[_0x43f7c5(0x20d)]('\x20\x20'+a7_0x1a708c[_0x43f7c5(0x20c)](_0x378e78+':'+_0x4fd3d0[_0x43f7c5(0x1dd)])+_0x43f7c5(0x1e8)+_0x4fd3d0['id']+_0x43f7c5(0x1dc)+_0x4fd3d0[_0x43f7c5(0x1f9)]+')');!_0x5503dc&&(console['log'](a7_0x1a708c[_0x43f7c5(0x1ef)](_0x43f7c5(0x228))),console[_0x43f7c5(0x20d)](a7_0x1a708c[_0x43f7c5(0x1ef)]('\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>')),console[_0x43f7c5(0x20d)](a7_0x1a708c[_0x43f7c5(0x1ef)](_0x43f7c5(0x207))));await saveOAuthTokens(_0x5029a4,_0x4cc123),console['log']('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x4cc123?_0x43f7c5(0x224)+_0x4cc123+')':''));if(_0x4cc123){const _0x182012={'site':_0x378e78};saveProfileToUserConfig(_0x4cc123,_0x182012),console[_0x43f7c5(0x20d)](_0x43f7c5(0x1f1)+_0x4cc123+_0x43f7c5(0x1fe));}else saveDefaultSiteToUserConfig(_0x378e78),console[_0x43f7c5(0x20d)](_0x43f7c5(0x21a)+_0x378e78);const _0x382c24=_0x4cc123?'\x20--profile\x20'+_0x4cc123:'';console[_0x43f7c5(0x20d)](),console[_0x43f7c5(0x20d)](_0x43f7c5(0x1db)),console['log']('\x20\x20tdx'+_0x382c24+_0x43f7c5(0x215)),console[_0x43f7c5(0x20d)](_0x43f7c5(0x205)+_0x382c24+_0x43f7c5(0x227));}export async function promptAuthMethod(){const _0x101af0=a7_0x4f9c,_0x39a803=await a7_0x80053d({'type':'select','name':_0x101af0(0x21f),'message':_0x101af0(0x1da),'choices':[{'title':_0x101af0(0x1eb),'description':_0x101af0(0x1fa),'value':_0x101af0(0x20b)},{'title':_0x101af0(0x1f8),'description':'For\x20scripts\x20or\x20headless\x20servers','value':_0x101af0(0x1fc)}]});return _0x39a803[_0x101af0(0x21f)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x45f50e(0x200)]=a7_0x45f50e(0x20e);[a7_0x45f50e(0x1df)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x45f50e(0x209)](_0x5c44c0){const _0x45b18f=a7_0x45f50e,{options:_0xa8b6fb}=_0x5c44c0,_0x4a55f2=_0xa8b6fb[_0x45b18f(0x1f5)];console[_0x45b18f(0x20d)](a7_0x1a708c[_0x45b18f(0x231)]('tdx:\x20auth\x20setup'));const _0x4b73c4=_0xa8b6fb['site']||_0x45b18f(0x210),_0x4f97ae=await promptSiteSelection(_0x4b73c4,_0x4a55f2,'Setup\x20cancelled');if(!_0x4f97ae)return 0x1;const _0x4389a2=resolveSite(_0x4f97ae),_0x449005=await promptAuthMethod();if(!_0x449005)return console[_0x45b18f(0x20d)]('\x0aSetup\x20cancelled'),0x1;if(_0x449005===_0x45b18f(0x20b)){const {accountName:_0xc8f661}=_0xa8b6fb;return await runOAuthLoginFlow(_0x4389a2,_0x4a55f2,_0xa8b6fb[_0x45b18f(0x21c)]??LogLevel[_0x45b18f(0x1ec)],{'accountName':_0xc8f661}),0x0;}console[_0x45b18f(0x20d)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x4389a2),console[_0x45b18f(0x20d)](_0x45b18f(0x208)),console[_0x45b18f(0x20d)]('\x20\x20'+getConsoleUrl(_0x4389a2,_0x45b18f(0x226)));const _0x139e5a=await a7_0x80053d({'type':_0x45b18f(0x201),'name':'apiKey','message':_0x45b18f(0x221),'validate':_0x3b6fd2=>{const _0x16f8f9=_0x45b18f;if(!_0x3b6fd2||!_0x3b6fd2[_0x16f8f9(0x1e3)]())return _0x16f8f9(0x21d);return!![];}});if(!_0x139e5a[_0x45b18f(0x22c)])return console[_0x45b18f(0x20d)](_0x45b18f(0x1e7)),0x1;const _0x4f3eb2=_0x139e5a['apiKey'];console[_0x45b18f(0x20d)]('Validating\x20API\x20key...');try{const _0x146f95=TDX[_0x45b18f(0x235)]({'site':_0x4389a2,'apiKey':_0x4f3eb2[_0x45b18f(0x1e3)](),'logLevel':_0xa8b6fb[_0x45b18f(0x21c)]??LogLevel[_0x45b18f(0x1ec)]}),_0x2c73d2=await _0x146f95['jobs'][_0x45b18f(0x222)]();console['log'](_0x45b18f(0x1d9)+_0x2c73d2[_0x45b18f(0x1f9)]+')');const _0x503ab4=await isKeychainAvailable();_0x503ab4?(await saveAPIKeyAsync(_0x4f3eb2[_0x45b18f(0x1e3)](),_0x4389a2,_0x4a55f2),console['log']('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x4a55f2?'\x20(profile:\x20'+_0x4a55f2+')':''))):(console[_0x45b18f(0x223)](a7_0x1a708c['yellow'](_0x45b18f(0x1f2))),console[_0x45b18f(0x223)](a7_0x1a708c[_0x45b18f(0x234)](_0x45b18f(0x1e6))));if(_0x4a55f2){const _0x18c8a={'site':_0x4389a2};saveProfileToUserConfig(_0x4a55f2,_0x18c8a),console[_0x45b18f(0x20d)](_0x45b18f(0x1f1)+_0x4a55f2+_0x45b18f(0x1fe));}else saveDefaultSiteToUserConfig(_0x4389a2),console[_0x45b18f(0x20d)](_0x45b18f(0x21a)+_0x4389a2);const _0x13b410=_0x4a55f2?_0x45b18f(0x217)+_0x4a55f2:'';return console['log'](),console['log'](_0x45b18f(0x1db)),console[_0x45b18f(0x20d)](_0x45b18f(0x205)+_0x13b410+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x45b18f(0x20d)](_0x45b18f(0x205)+_0x13b410+_0x45b18f(0x227)),0x0;}catch(_0x2aa622){if(_0x2aa622 instanceof HTTPClientError&&_0x2aa622[_0x45b18f(0x22b)]===0x191)return printAuthError(_0x2aa622),0x1;return console[_0x45b18f(0x1d8)](a7_0x1a708c['red'](_0x45b18f(0x22f)+(_0x2aa622 instanceof Error?_0x2aa622[_0x45b18f(0x1d5)]:String(_0x2aa622)))),console[_0x45b18f(0x1d8)](_0x45b18f(0x1e2)),0x1;}}}function a7_0x1cca(){const _0x52c4d9=['trim','jobs','tdx\x20profile:\x20','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','\x0aSetup\x20cancelled','\x20\x20user_id:','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','Validating\x20OAuth\x20tokens...','Sign\x20in\x20with\x20browser\x20(recommended)','ERROR','329882ARurrZ','red','dim','873042gLuwLb','✓\x20Profile\x20\x27','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Remove\x20API\x20key\x20from\x20system\x20keychain','Name:\x20','profile','first_name','site','Use\x20an\x20API\x20key','email','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','filter','apikey','all','\x27\x20registered','\x20(site:\x20','name','password','join','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','103837pLvgjK','\x20\x20tdx','No\x20credential\x20found','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','You\x20can\x20find\x20your\x20API\x20key\x20at:','execute','Setup\x20cancelled','oauth','cyan','log','auth:setup','17789274FolZhZ','us01','accountName','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','\x20and\x20','text','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','last_name','\x20--profile\x20','90MXFqhl','2374008MhBete','✓\x20Default\x20site\x20set\x20to\x20','N/A','logLevel','API\x20key\x20cannot\x20be\x20empty','Read\x20credential\x20from\x20','method','green','Enter\x20your\x20TD\x20API\x20key:','getUserInfo','warn','\x20(profile:\x20','Read\x20credential\x20from\x20keychain','/app/mp/ak','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','Opening\x20browser\x20for\x20authentication...','1705092uBjEPc','status','apiKey','16aMJOrC','234325BjUDiH','✗\x20Validation\x20failed:\x20','\x20for\x20profile:\x20','bold','/oauth/authorize','/users/initiate_sso\x20(account:\x20','yellow','create','No\x20credentials\x20found\x20in\x20keychain','message','access_token','\x20removed\x20from\x20keychain','error','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','Choose\x20how\x20to\x20sign\x20in:','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','\x20\x20(','account_id','Credential\x20type:\x20OAuth','description','System\x20keychain\x20is\x20not\x20available','API\x20key','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'];a7_0x1cca=function(){return _0x52c4d9;};return a7_0x1cca();}export class AuthStatusCommand extends BaseCommand{['name']='auth';[a7_0x45f50e(0x1df)]=a7_0x45f50e(0x203);async[a7_0x45f50e(0x209)](_0x5ce3a6){const _0x20e099=a7_0x45f50e,{options:_0x43088c,tdx:_0x385eef}=_0x5ce3a6,_0x2d27ff=_0x43088c[_0x20e099(0x1f7)],_0x2fc55a=_0x43088c['profile'],_0xadbe0b=_0x2fc55a?_0x2fc55a:_0x20e099(0x21b);console[_0x20e099(0x20d)](_0x20e099(0x1e5)+_0xadbe0b+_0x20e099(0x1ff)+_0x2d27ff+')');const _0x1fed28=await getOAuthTokens(_0x2fc55a);if(_0x1fed28)console[_0x20e099(0x20d)](_0x20e099(0x1de)),console[_0x20e099(0x20d)](_0x20e099(0x225)+(_0x2fc55a?_0x20e099(0x224)+_0x2fc55a+')':''));else{const _0x2fd00b=await resolveAPIKeyAsync(_0x2d27ff,_0x2fc55a);if(_0x2fd00b){const {source:_0x4c77cf,isDeprecated:_0x40e565}=_0x2fd00b,_0x26911f=_0x20e099(0x21e)+_0x4c77cf;console[_0x20e099(0x20d)](_0x40e565?a7_0x1a708c[_0x20e099(0x234)](_0x26911f):_0x26911f);}else console[_0x20e099(0x20d)](a7_0x1a708c[_0x20e099(0x234)](_0x20e099(0x206)));}try{const _0x5a1ca2=await _0x385eef[_0x20e099(0x1e4)][_0x20e099(0x222)]();return console[_0x20e099(0x20d)](a7_0x1a708c[_0x20e099(0x220)]('✓\x20Authentication\x20successful\x0a')),console[_0x20e099(0x20d)]('User:\x20'+_0x5a1ca2[_0x20e099(0x1f9)]),(_0x5a1ca2[_0x20e099(0x1f6)]||_0x5a1ca2[_0x20e099(0x216)])&&console[_0x20e099(0x20d)](_0x20e099(0x1f4)+[_0x5a1ca2[_0x20e099(0x1f6)],_0x5a1ca2[_0x20e099(0x216)]][_0x20e099(0x1fb)](Boolean)[_0x20e099(0x202)]('\x20')),0x0;}catch(_0x3ce030){return _0x3ce030 instanceof HTTPClientError&&_0x3ce030[_0x20e099(0x22b)]===0x191?printAuthError(_0x3ce030,!![],_0x2fc55a):console['error'](a7_0x1a708c[_0x20e099(0x1ee)](_0x20e099(0x22f)+(_0x3ce030 instanceof Error?_0x3ce030[_0x20e099(0x1d5)]:String(_0x3ce030)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x45f50e(0x200)]='auth:clear';[a7_0x45f50e(0x1df)]=a7_0x45f50e(0x1f3);async['execute'](_0x45d526){const _0x296c45=a7_0x45f50e,{options:_0x3b5014}=_0x45d526,_0x16d8f0=_0x3b5014['profile'];console[_0x296c45(0x20d)](a7_0x1a708c[_0x296c45(0x231)]('tdx:\x20auth\x20clear'));const _0x48c919=await isKeychainAvailable();if(!_0x48c919)return console[_0x296c45(0x1d8)](a7_0x1a708c['red'](_0x296c45(0x1e0))),0x1;const [_0x2a5d33,_0x436094]=await Promise[_0x296c45(0x1fd)]([deleteKeychainAPIKey(_0x16d8f0),deleteOAuthTokens(_0x16d8f0)]);if(_0x2a5d33||_0x436094){clearCredentialCache();const _0x308d85=[_0x2a5d33&&_0x296c45(0x1e1),_0x436094&&'OAuth\x20tokens'][_0x296c45(0x1fb)](Boolean)['join'](_0x296c45(0x213));return console['log']('✓\x20'+_0x308d85+_0x296c45(0x1d7)+(_0x16d8f0?_0x296c45(0x224)+_0x16d8f0+')':'')),0x0;}else return console[_0x296c45(0x20d)](_0x296c45(0x1d4)+(_0x16d8f0?_0x296c45(0x230)+_0x16d8f0:'')),0x1;}}