@treasuredata/tdx 2026.3.31 → 2026.3.33

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 (256) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.d.ts +1 -1
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli-categories.js.map +1 -1
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +1 -1
  8. package/dist/cli.js.map +1 -1
  9. package/dist/commands/activations.js +1 -1
  10. package/dist/commands/agent-command.js +1 -1
  11. package/dist/commands/agent-test-command.js +1 -1
  12. package/dist/commands/api-command.js +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/auth-login-command.js +1 -1
  15. package/dist/commands/cas-command.js +1 -1
  16. package/dist/commands/cas-segment-command.js +1 -1
  17. package/dist/commands/chat-command.js +1 -1
  18. package/dist/commands/claude-command.js +1 -1
  19. package/dist/commands/claude-statusline-command.js +1 -1
  20. package/dist/commands/claude-usage-command.js +1 -1
  21. package/dist/commands/command.js +1 -1
  22. package/dist/commands/connection-command.js +1 -1
  23. package/dist/commands/databases.js +1 -1
  24. package/dist/commands/delivery-command.js +1 -1
  25. package/dist/commands/describe.js +1 -1
  26. package/dist/commands/engage-campaign-pull-command.js +1 -1
  27. package/dist/commands/engage-campaign-push-command.js +1 -1
  28. package/dist/commands/engage-campaign-validate-command.js +1 -1
  29. package/dist/commands/engage-command.js +1 -1
  30. package/dist/commands/engage-template-pull-command.js +1 -1
  31. package/dist/commands/engage-template-push-command.js +1 -1
  32. package/dist/commands/engage-template-validate-command.js +1 -1
  33. package/dist/commands/job-command.js +1 -1
  34. package/dist/commands/journey-command.js +1 -1
  35. package/dist/commands/journey-validate-command.js +1 -1
  36. package/dist/commands/llm-command.js +1 -1
  37. package/dist/commands/mcp-command.js +1 -1
  38. package/dist/commands/parent-segment-command.js +1 -1
  39. package/dist/commands/policy-command.js +1 -1
  40. package/dist/commands/profile-command.js +1 -1
  41. package/dist/commands/profiles-command.js +1 -1
  42. package/dist/commands/query-command.js +1 -1
  43. package/dist/commands/schedule-command.js +1 -1
  44. package/dist/commands/segment-command.js +1 -1
  45. package/dist/commands/segment-create-command.js +1 -1
  46. package/dist/commands/segment-fields-command.js +1 -1
  47. package/dist/commands/segment-pull-command.js +1 -1
  48. package/dist/commands/segment-push-command.js +1 -1
  49. package/dist/commands/segment-update-command.js +1 -1
  50. package/dist/commands/segment-use-command.js +1 -1
  51. package/dist/commands/segment-validate-command.js +1 -1
  52. package/dist/commands/segments.js +1 -1
  53. package/dist/commands/show.js +1 -1
  54. package/dist/commands/status-command.js +1 -1
  55. package/dist/commands/tables.js +1 -1
  56. package/dist/commands/unset-command.js +1 -1
  57. package/dist/commands/upgrade-command.js +1 -1
  58. package/dist/commands/use-command.js +1 -1
  59. package/dist/commands/user-command.js +1 -1
  60. package/dist/commands/work-command.d.ts +34 -0
  61. package/dist/commands/work-command.d.ts.map +1 -0
  62. package/dist/commands/work-command.js +1 -0
  63. package/dist/commands/work-command.js.map +1 -0
  64. package/dist/commands/workflow-command.js +1 -1
  65. package/dist/core/auth.js +1 -1
  66. package/dist/core/command-output.js +1 -1
  67. package/dist/core/config.js +1 -1
  68. package/dist/core/connection-cache.js +1 -1
  69. package/dist/core/constants.js +1 -1
  70. package/dist/core/credential-cache.js +1 -1
  71. package/dist/core/global-context.js +1 -1
  72. package/dist/core/keychain.js +1 -1
  73. package/dist/core/oauth-keychain.js +1 -1
  74. package/dist/core/oauth.js +1 -1
  75. package/dist/core/profile.js +1 -1
  76. package/dist/core/project-config.d.ts +2 -0
  77. package/dist/core/project-config.d.ts.map +1 -1
  78. package/dist/core/project-config.js +1 -1
  79. package/dist/core/project-config.js.map +1 -1
  80. package/dist/core/session.js +1 -1
  81. package/dist/core/user-cache.js +1 -1
  82. package/dist/core/version.js +1 -1
  83. package/dist/index.js +1 -1
  84. package/dist/mcp/server.js +1 -1
  85. package/dist/mcp/tools/index.js +1 -1
  86. package/dist/mcp/tools/tdx-run.js +1 -1
  87. package/dist/mcp/tools/tdx-search.js +1 -1
  88. package/dist/mcp/utils.js +1 -1
  89. package/dist/proxy/claude-usage-tracker.js +1 -1
  90. package/dist/proxy/passthrough-server.js +1 -1
  91. package/dist/proxy/sse-usage-parser.js +1 -1
  92. package/dist/sdk/agent/agent-config.js +1 -1
  93. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  94. package/dist/sdk/agent/agent-yaml.js +1 -1
  95. package/dist/sdk/agent/test/evaluator.js +1 -1
  96. package/dist/sdk/agent/test/executor.js +1 -1
  97. package/dist/sdk/agent/test/index.js +1 -1
  98. package/dist/sdk/agent/test/output.js +1 -1
  99. package/dist/sdk/agent/test/parser.js +1 -1
  100. package/dist/sdk/agent/tool-target-registry.js +1 -1
  101. package/dist/sdk/api.js +1 -1
  102. package/dist/sdk/cas/cas-api-client.js +1 -1
  103. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  104. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  105. package/dist/sdk/cas/index.js +1 -1
  106. package/dist/sdk/cas/pull-workflow.js +1 -1
  107. package/dist/sdk/cas/push-workflow.js +1 -1
  108. package/dist/sdk/client/cdp-api-client.js +1 -1
  109. package/dist/sdk/client/delivery-api-client.js +1 -1
  110. package/dist/sdk/client/endpoints.js +1 -1
  111. package/dist/sdk/client/engage-api-client.js +1 -1
  112. package/dist/sdk/client/http-client.js +1 -1
  113. package/dist/sdk/client/llm-api-client.js +1 -1
  114. package/dist/sdk/client/oauth-refresh.js +1 -1
  115. package/dist/sdk/client/rate-limiter.js +1 -1
  116. package/dist/sdk/client/td-api-client.js +1 -1
  117. package/dist/sdk/client/trino-api-client.js +1 -1
  118. package/dist/sdk/client/workflow-client.js +1 -1
  119. package/dist/sdk/connection-validator.js +1 -1
  120. package/dist/sdk/connection.js +1 -1
  121. package/dist/sdk/delivery.js +1 -1
  122. package/dist/sdk/engage/campaign-pull.js +1 -1
  123. package/dist/sdk/engage/campaign-push.js +1 -1
  124. package/dist/sdk/engage/campaign-validator.js +1 -1
  125. package/dist/sdk/engage/campaign-yaml.js +1 -1
  126. package/dist/sdk/engage/template-pull.js +1 -1
  127. package/dist/sdk/engage/template-push.js +1 -1
  128. package/dist/sdk/engage/template-validator.js +1 -1
  129. package/dist/sdk/engage/template-yaml.js +1 -1
  130. package/dist/sdk/engage/types/campaign-def.js +1 -1
  131. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  132. package/dist/sdk/engage/types/template-schema.js +1 -1
  133. package/dist/sdk/engage.js +1 -1
  134. package/dist/sdk/errors.js +1 -1
  135. package/dist/sdk/index.d.ts +1 -0
  136. package/dist/sdk/index.d.ts.map +1 -1
  137. package/dist/sdk/index.js +1 -1
  138. package/dist/sdk/index.js.map +1 -1
  139. package/dist/sdk/io/index.js +1 -1
  140. package/dist/sdk/io/node-filesystem.js +1 -1
  141. package/dist/sdk/job.js +1 -1
  142. package/dist/sdk/journey.js +1 -1
  143. package/dist/sdk/llm/chat-cache.js +1 -1
  144. package/dist/sdk/llm/index.js +1 -1
  145. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  146. package/dist/sdk/llm/model-factors.js +1 -1
  147. package/dist/sdk/personalization.js +1 -1
  148. package/dist/sdk/policy.js +1 -1
  149. package/dist/sdk/query/index.js +1 -1
  150. package/dist/sdk/query/sql-parser.js +1 -1
  151. package/dist/sdk/realtime.js +1 -1
  152. package/dist/sdk/schedule.js +1 -1
  153. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  154. package/dist/sdk/segment/fields-display.js +1 -1
  155. package/dist/sdk/segment/file-discovery.js +1 -1
  156. package/dist/sdk/segment/journey-utils.js +1 -1
  157. package/dist/sdk/segment/journey-validator.js +1 -1
  158. package/dist/sdk/segment/journey-yaml.js +1 -1
  159. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  160. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  161. package/dist/sdk/segment/pull-workflow.js +1 -1
  162. package/dist/sdk/segment/push-recovery.js +1 -1
  163. package/dist/sdk/segment/push-workflow.js +1 -1
  164. package/dist/sdk/segment/resolution-context.js +1 -1
  165. package/dist/sdk/segment/segment-path-parser.js +1 -1
  166. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  167. package/dist/sdk/segment/segment-validator.js +1 -1
  168. package/dist/sdk/segment/target-resolution.js +1 -1
  169. package/dist/sdk/segment/tdx-config.js +1 -1
  170. package/dist/sdk/segment/types/activation-schema.js +1 -1
  171. package/dist/sdk/segment/types/journey-def.js +1 -1
  172. package/dist/sdk/segment/types/journey-schema.js +1 -1
  173. package/dist/sdk/segment/types/segment-def.js +1 -1
  174. package/dist/sdk/segment/types/segment-schema.js +1 -1
  175. package/dist/sdk/segment/validate-files.js +1 -1
  176. package/dist/sdk/segment/yaml-validator.js +1 -1
  177. package/dist/sdk/segment.js +1 -1
  178. package/dist/sdk/types/index.d.ts +2 -0
  179. package/dist/sdk/types/index.d.ts.map +1 -1
  180. package/dist/sdk/types/index.js +1 -1
  181. package/dist/sdk/types/index.js.map +1 -1
  182. package/dist/sdk/types/progress.js +1 -1
  183. package/dist/sdk/types/workspace.d.ts +169 -0
  184. package/dist/sdk/types/workspace.d.ts.map +1 -0
  185. package/dist/sdk/types/workspace.js +1 -0
  186. package/dist/sdk/types/workspace.js.map +1 -0
  187. package/dist/sdk/user.js +1 -1
  188. package/dist/sdk/util/format-detector.js +1 -1
  189. package/dist/sdk/util/formatters.js +1 -1
  190. package/dist/sdk/util/index.js +1 -1
  191. package/dist/sdk/util/paginate.js +1 -1
  192. package/dist/sdk/util/tree-formatter.js +1 -1
  193. package/dist/sdk/workflow/archive-validation.js +1 -1
  194. package/dist/sdk/workflow/clone-workflow.js +1 -1
  195. package/dist/sdk/workflow/index.js +1 -1
  196. package/dist/sdk/workflow/pull-workflow.js +1 -1
  197. package/dist/sdk/workflow/push-workflow.js +1 -1
  198. package/dist/sdk/workflow/tdx-config.js +1 -1
  199. package/dist/sdk/workflow/workflow-utils.js +1 -1
  200. package/dist/sdk/workspace/frontmatter.d.ts +28 -0
  201. package/dist/sdk/workspace/frontmatter.d.ts.map +1 -0
  202. package/dist/sdk/workspace/frontmatter.js +1 -0
  203. package/dist/sdk/workspace/frontmatter.js.map +1 -0
  204. package/dist/sdk/workspace/git.d.ts +70 -0
  205. package/dist/sdk/workspace/git.d.ts.map +1 -0
  206. package/dist/sdk/workspace/git.js +1 -0
  207. package/dist/sdk/workspace/git.js.map +1 -0
  208. package/dist/sdk/workspace/index.d.ts +166 -0
  209. package/dist/sdk/workspace/index.d.ts.map +1 -0
  210. package/dist/sdk/workspace/index.js +1 -0
  211. package/dist/sdk/workspace/index.js.map +1 -0
  212. package/dist/sdk/workspace/templates.d.ts +17 -0
  213. package/dist/sdk/workspace/templates.d.ts.map +1 -0
  214. package/dist/sdk/workspace/templates.js +1 -0
  215. package/dist/sdk/workspace/templates.js.map +1 -0
  216. package/dist/sdk/workspace/weekly.d.ts +49 -0
  217. package/dist/sdk/workspace/weekly.d.ts.map +1 -0
  218. package/dist/sdk/workspace/weekly.js +1 -0
  219. package/dist/sdk/workspace/weekly.js.map +1 -0
  220. package/dist/sdk/workspace/wikilinks.d.ts +49 -0
  221. package/dist/sdk/workspace/wikilinks.d.ts.map +1 -0
  222. package/dist/sdk/workspace/wikilinks.js +1 -0
  223. package/dist/sdk/workspace/wikilinks.js.map +1 -0
  224. package/dist/test-utils/command-runner.js +1 -1
  225. package/dist/test-utils/factories.js +1 -1
  226. package/dist/test-utils/fixtures.js +1 -1
  227. package/dist/test-utils/http-mock.js +1 -1
  228. package/dist/test-utils/index.js +1 -1
  229. package/dist/utils/async.js +1 -1
  230. package/dist/utils/colors.js +1 -1
  231. package/dist/utils/diff.js +1 -1
  232. package/dist/utils/file-permissions.js +1 -1
  233. package/dist/utils/file-reader.js +1 -1
  234. package/dist/utils/github-releases.js +1 -1
  235. package/dist/utils/global-cache.js +1 -1
  236. package/dist/utils/json-loader.js +1 -1
  237. package/dist/utils/local-cache.js +1 -1
  238. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  239. package/dist/utils/logger/formatters/index.js +1 -1
  240. package/dist/utils/logger/handlers/console-handler.js +1 -1
  241. package/dist/utils/logger/handlers/file-handler.js +1 -1
  242. package/dist/utils/logger/handlers/index.js +1 -1
  243. package/dist/utils/logger/handlers/null-handler.js +1 -1
  244. package/dist/utils/logger/index.js +1 -1
  245. package/dist/utils/logger/logger.js +1 -1
  246. package/dist/utils/logger/types.js +1 -1
  247. package/dist/utils/option-validation.js +1 -1
  248. package/dist/utils/process.js +1 -1
  249. package/dist/utils/prompt.js +1 -1
  250. package/dist/utils/spinner.js +1 -1
  251. package/dist/utils/sse-parser.js +1 -1
  252. package/dist/utils/string-utils.js +1 -1
  253. package/dist/utils/table-ref-parser.js +1 -1
  254. package/dist/utils/tdx-logger.js +1 -1
  255. package/dist/utils/version-check.js +1 -1
  256. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x3c189d=a3_0x3f33;(function(_0x46251f,_0x5e37bd){const _0x99a197=a3_0x3f33,_0x2d4b50=_0x46251f();while(!![]){try{const _0xbe29fc=-parseInt(_0x99a197(0xfa))/0x1*(-parseInt(_0x99a197(0x111))/0x2)+-parseInt(_0x99a197(0x10a))/0x3+-parseInt(_0x99a197(0x10d))/0x4*(-parseInt(_0x99a197(0x102))/0x5)+-parseInt(_0x99a197(0x11a))/0x6+-parseInt(_0x99a197(0x10f))/0x7+parseInt(_0x99a197(0x116))/0x8*(-parseInt(_0x99a197(0x113))/0x9)+parseInt(_0x99a197(0x114))/0xa;if(_0xbe29fc===_0x5e37bd)break;else _0x2d4b50['push'](_0x2d4b50['shift']());}catch(_0x251379){_0x2d4b50['push'](_0x2d4b50['shift']());}}}(a3_0x5a46,0xade9b));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_0x5a46(){const _0x51bc15=['message','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','activations','1037424ZIFDbg','resolveParentId','List\x20activations\x20for\x20a\x20segment','4lyxCHQ','verbose','4426401PdUsWM','Listing\x20activations\x20for\x20segment\x20\x27','1749538DxKaGU','Resolving\x20child\x20segment\x20\x27','7515531FJbmkT','23107430tjnaog','Error:\x20Segment\x20name\x20is\x20required','8qnJUly','Child\x20name:\x20','length','description','4170066zxGcQt','1fcEjJo','error','segment','data','execute','\x20activation','Error:\x20','Resolved\x20parent\x20ID:\x20','175280UCYVbc','cause','\x27...','✔\x20Found\x20'];a3_0x5a46=function(){return _0x51bc15;};return a3_0x5a46();}function a3_0x3f33(_0x58cc70,_0x3b1abe){_0x58cc70=_0x58cc70-0xfa;const _0x5a4688=a3_0x5a46();let _0x3f33bc=_0x5a4688[_0x58cc70];return _0x3f33bc;}export class ActivationsCommand extends BaseCommand{['name']=a3_0x3c189d(0x109);[a3_0x3c189d(0x119)]=a3_0x3c189d(0x10c);async[a3_0x3c189d(0xfe)](_0x5d94f0){const _0x4a59c3=a3_0x3c189d,{options:_0x538e86,args:_0x2b3c29,tdx:_0x454995}=_0x5d94f0;if(_0x2b3c29[_0x4a59c3(0x118)]===0x0)return console[_0x4a59c3(0xfb)](_0x4a59c3(0x115)),console[_0x4a59c3(0xfb)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x26964d,childId:_0x50ef74}=parseSegmentRef(_0x2b3c29[0x0]);if(!_0x50ef74)return console[_0x4a59c3(0xfb)](_0x4a59c3(0x107)),console[_0x4a59c3(0xfb)](_0x4a59c3(0x108)),0x1;_0x538e86[_0x4a59c3(0x10e)]&&(console['error']('Site:\x20'+_0x538e86['site']),console[_0x4a59c3(0xfb)]('Parent\x20name:\x20'+_0x26964d),console[_0x4a59c3(0xfb)](_0x4a59c3(0x117)+_0x50ef74));const _0x48690d=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x26964d+'\x27...',()=>_0x454995[_0x4a59c3(0xfc)][_0x4a59c3(0x10b)](_0x26964d),{'verbose':_0x538e86['verbose']}),_0x138d3e=_0x48690d[_0x4a59c3(0xfd)];_0x538e86[_0x4a59c3(0x10e)]&&console[_0x4a59c3(0xfb)](_0x4a59c3(0x101)+_0x138d3e);const _0xd67263=await withSpinner(_0x4a59c3(0x112)+_0x50ef74+'\x27...',()=>_0x454995[_0x4a59c3(0xfc)]['resolveSegmentId'](_0x138d3e,_0x50ef74),{'verbose':_0x538e86['verbose']}),_0x97fce6=_0xd67263[_0x4a59c3(0xfd)];_0x538e86['verbose']&&console['error']('Resolved\x20child\x20ID:\x20'+_0x97fce6);const _0x22b4bc=await withSpinner(_0x4a59c3(0x110)+_0x50ef74+_0x4a59c3(0x104),()=>_0x454995[_0x4a59c3(0xfc)]['listActivations'](_0x138d3e,_0x97fce6),{'verbose':_0x538e86[_0x4a59c3(0x10e)]}),_0x39f448=_0x22b4bc[_0x4a59c3(0xfd)];return console['error'](_0x4a59c3(0x105)+_0x39f448[_0x4a59c3(0x118)]+_0x4a59c3(0xff)+(_0x39f448['length']!==0x1?'s':'')),await handleSDKOutput(_0x39f448,_0x538e86),0x0;}catch(_0xfcb557){if(_0xfcb557 instanceof SDKError)return console[_0x4a59c3(0xfb)](_0x4a59c3(0x100)+_0xfcb557[_0x4a59c3(0x106)]),_0xfcb557[_0x4a59c3(0x103)]&&console[_0x4a59c3(0xfb)]('\x20\x20Cause:\x20'+_0xfcb557['cause']),0x1;throw _0xfcb557;}}}
1
+ const a3_0x4b59f2=a3_0x380d;function a3_0x4294(){const _0x304855=['2548648ZMBwvH','Child\x20name:\x20','site','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Error:\x20','data','Resolved\x20child\x20ID:\x20','443264sdxzGs','\x27...','execute','error','cause','message','name','Resolving\x20parent\x20segment\x20\x27','6tzjOQG','length','✔\x20Found\x20','description','17648070iBxlJa','9WfuRsH','resolveSegmentId','verbose','\x20\x20Cause:\x20','\x20activation','listActivations','140qtKPiu','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','9575363RsKkDf','238365AWKDlP','63009HJiraW','segment','4270crkTTP'];a3_0x4294=function(){return _0x304855;};return a3_0x4294();}(function(_0x2283ce,_0x25566a){const _0x4e42d6=a3_0x380d,_0x1ef883=_0x2283ce();while(!![]){try{const _0xe3ede6=parseInt(_0x4e42d6(0x113))/0x1+parseInt(_0x4e42d6(0x10d))/0x2*(parseInt(_0x4e42d6(0x111))/0x3)+parseInt(_0x4e42d6(0x11b))/0x4+parseInt(_0x4e42d6(0x110))/0x5+-parseInt(_0x4e42d6(0x102))/0x6*(-parseInt(_0x4e42d6(0x10f))/0x7)+-parseInt(_0x4e42d6(0x114))/0x8*(parseInt(_0x4e42d6(0x107))/0x9)+-parseInt(_0x4e42d6(0x106))/0xa;if(_0xe3ede6===_0x25566a)break;else _0x1ef883['push'](_0x1ef883['shift']());}catch(_0x565667){_0x1ef883['push'](_0x1ef883['shift']());}}}(a3_0x4294,0xdfff2));function a3_0x380d(_0x4cc426,_0x5555ec){_0x4cc426=_0x4cc426-0xfb;const _0x429483=a3_0x4294();let _0x380df1=_0x429483[_0x4cc426];return _0x380df1;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x4b59f2(0x100)]='activations';[a3_0x4b59f2(0x105)]='List\x20activations\x20for\x20a\x20segment';async[a3_0x4b59f2(0xfc)](_0x5f22d4){const _0x2b273a=a3_0x4b59f2,{options:_0x38f2c4,args:_0x27edda,tdx:_0x5c566e}=_0x5f22d4;if(_0x27edda[_0x2b273a(0x103)]===0x0)return console[_0x2b273a(0xfd)]('Error:\x20Segment\x20name\x20is\x20required'),console[_0x2b273a(0xfd)](_0x2b273a(0x117)),0x1;try{const {parentId:_0x5baf58,childId:_0x58021e}=parseSegmentRef(_0x27edda[0x0]);if(!_0x58021e)return console[_0x2b273a(0xfd)](_0x2b273a(0x10e)),console['error'](_0x2b273a(0x117)),0x1;_0x38f2c4[_0x2b273a(0x109)]&&(console[_0x2b273a(0xfd)]('Site:\x20'+_0x38f2c4[_0x2b273a(0x116)]),console[_0x2b273a(0xfd)]('Parent\x20name:\x20'+_0x5baf58),console['error'](_0x2b273a(0x115)+_0x58021e));const _0x1b4322=await withSpinner(_0x2b273a(0x101)+_0x5baf58+_0x2b273a(0xfb),()=>_0x5c566e[_0x2b273a(0x112)]['resolveParentId'](_0x5baf58),{'verbose':_0x38f2c4[_0x2b273a(0x109)]}),_0x2ce1b6=_0x1b4322['data'];_0x38f2c4[_0x2b273a(0x109)]&&console[_0x2b273a(0xfd)]('Resolved\x20parent\x20ID:\x20'+_0x2ce1b6);const _0xe88cce=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x58021e+'\x27...',()=>_0x5c566e[_0x2b273a(0x112)][_0x2b273a(0x108)](_0x2ce1b6,_0x58021e),{'verbose':_0x38f2c4['verbose']}),_0x5f3dc4=_0xe88cce[_0x2b273a(0x119)];_0x38f2c4[_0x2b273a(0x109)]&&console['error'](_0x2b273a(0x11a)+_0x5f3dc4);const _0x598480=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x58021e+'\x27...',()=>_0x5c566e[_0x2b273a(0x112)][_0x2b273a(0x10c)](_0x2ce1b6,_0x5f3dc4),{'verbose':_0x38f2c4[_0x2b273a(0x109)]}),_0x294728=_0x598480[_0x2b273a(0x119)];return console[_0x2b273a(0xfd)](_0x2b273a(0x104)+_0x294728['length']+_0x2b273a(0x10b)+(_0x294728['length']!==0x1?'s':'')),await handleSDKOutput(_0x294728,_0x38f2c4),0x0;}catch(_0x37aaee){if(_0x37aaee instanceof SDKError)return console[_0x2b273a(0xfd)](_0x2b273a(0x118)+_0x37aaee[_0x2b273a(0xff)]),_0x37aaee[_0x2b273a(0xfe)]&&console['error'](_0x2b273a(0x10a)+_0x37aaee[_0x2b273a(0xfe)]),0x1;throw _0x37aaee;}}}
@@ -1 +1 @@
1
- const a4_0x515c36=a4_0x58c7;(function(_0x4eca64,_0x31ff08){const _0x54e95c=a4_0x58c7,_0x2f2276=_0x4eca64();while(!![]){try{const _0x3875bf=-parseInt(_0x54e95c(0x14b))/0x1*(-parseInt(_0x54e95c(0x171))/0x2)+-parseInt(_0x54e95c(0xc2))/0x3*(-parseInt(_0x54e95c(0xc6))/0x4)+-parseInt(_0x54e95c(0x13c))/0x5*(-parseInt(_0x54e95c(0xe3))/0x6)+-parseInt(_0x54e95c(0xc3))/0x7+-parseInt(_0x54e95c(0xe7))/0x8+-parseInt(_0x54e95c(0x121))/0x9+parseInt(_0x54e95c(0x166))/0xa*(parseInt(_0x54e95c(0x11d))/0xb);if(_0x3875bf===_0x31ff08)break;else _0x2f2276['push'](_0x2f2276['shift']());}catch(_0x4aee71){_0x2f2276['push'](_0x2f2276['shift']());}}}(a4_0x1f60,0x3a894));import a4_0x4c76cc from'chalk';import a4_0x5362d8 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';function a4_0x1f60(){const _0x5dd8cd=['Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','error','yellow','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20\x20Target:\x20','\x22\x20to\x20a\x20different\x20profile','\x0aChanges\x20to\x20prompt\x20\x27','description','no_local_folder','11aXMBPC','\x20--name\x20','dryRun','\x20resources\x20to\x20\x27','3380796nWzVUa','green','\x22:\x20','source','\x20\x20Text\x20Knowledge\x20Bases:\x20','Source:\x20','llm','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Pushing\x20agent\x20from\x20\x22','experimentalArtifacts','\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','prompts','arg-dir','Project\x20cloned\x20successfully','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x27\x20to\x20create\x20the\x20folder\x20structure.','Using\x20project\x20from\x20context:\x20','cyan','join','Cannot\x20clone\x20from\x20context\x20project\x20\x22','reason','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20|\x20','counts','updated','log','572095kgLejG','Agent\x20pulled\x20successfully','Using\x20current\x20project:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','Pushing\x20to\x20project...','agentId','message','Output\x20path:\x20','outputDir','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','agent.yml','projectDir','created','Using\x20local\x20project:\x20','\x0aChanges\x20to\x20integration\x20\x27','29ssIIlB','\x20\x20Knowledge\x20Base\x20\x22','outputPath','\x20new','execute','\x22\x20to\x20new\x20project\x20\x22','\x20\x20Integrations:\x20','\x0aPull\x20summary\x20for\x20\x27','llmProject','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Analyzing\x20project\x20\x22','push','context','new','errors','\x22\x20from\x20project\x20\x22','✔\x20Context\x20set:\x20','Summary:','gray','\x20unchanged','yes','\x20total','\x20\x20Integration\x20\x22','Using\x20project\x20from\x20','\x0a✔\x20Pushed\x20','Agent:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','3618570aYrzVM','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','<new-name>','MISSING_ARGUMENT','\x20\x20Knowledge\x20Bases:\x20','site','projectName','hasChanges','Errors:','integrations','Dry\x20run\x20-\x20no\x20files\x20written','3032LsVLCx','cwd-config','\x20\x20Agents:\x20','Analyzing\x20changes\x20to\x20push...','session','\x20changed','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','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)','name','\x20\x20Prompts:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','cwd','Failed\x20to\x20push\x20agent:\x20','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','tdx.json','\x20resources?','969954Ctunfv','3133228wkqprb','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Would\x20push\x20agent:\x20','4ckWrNi','dim','Cloning\x20\x22','\x20updated','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20Prompt\x20\x22','Pulling\x20agent\x20\x22','Project\x20cloned\x20with\x20errors','\x0aError:','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20=\x20','\x0aProject\x20pushed\x20with\x20errors','projectId','Chat:\x20','action','diff','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','New\x20project:\x20','INVALID_ARGUMENT','\x0aPush\x20summary\x20for\x20\x27','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','force','Project:\x20','red','Output:\x20','llm_project','\x20\x20Source:\x20','knowledgeBases','agent','24yywyJB','Writing\x20files...','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','output','990424KkBBOl','New\x20project\x20name\x20is\x20required','Would\x20clone:','sourceProjectName','Using\x20context\x20project:\x20','Using\x20project:\x20','total','pullAgent','\x20\x20Agent\x20\x22','parse','newProjectId','dirname','\x20\x20Experimental\x20Artifacts:\x20','pushProject','\x20\x20tdx\x20agent\x20pull\x20','agents','Agent\x20','\x20files?','Clone\x20\x22','pullProject','\x0aWrite\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','agent:clone','-\x20no\x20files\x20written','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','repeat','unchanged','agent:push','agentName','experimentalKnowledgeBases','textKnowledgeBases','\x20--profile\x20','No\x20tdx.json\x20found\x20in\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x22...','Status:\x20','\x22\x20to\x20\x22','no_context','Cancelled','\x20\x20Experimental\x20Artifact\x20\x22','\x20files\x20to\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','agent:pull'];a4_0x1f60=function(){return _0x5dd8cd;};return a4_0x1f60();}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(_0x54feb9){const _0x5427aa=a4_0x58c7,_0x32b14f=[];if(_0x54feb9[_0x5427aa(0xed)]!==undefined)_0x32b14f[_0x5427aa(0x156)](_0x54feb9['total']+_0x5427aa(0x160));if(_0x54feb9[_0x5427aa(0x158)]!==undefined&&_0x54feb9['new']>0x0)_0x32b14f[_0x5427aa(0x156)](a4_0x4c76cc[_0x5427aa(0x122)](_0x54feb9['new']+_0x5427aa(0x14e)));if(_0x54feb9[_0x5427aa(0x148)]!==undefined&&_0x54feb9['created']>0x0)_0x32b14f['push'](a4_0x4c76cc['green'](_0x54feb9['created']+'\x20created'));if(_0x54feb9[_0x5427aa(0x13a)]!==undefined&&_0x54feb9[_0x5427aa(0x13a)]>0x0)_0x32b14f['push'](a4_0x4c76cc[_0x5427aa(0x116)](_0x54feb9['updated']+_0x5427aa(0xc9)));if(_0x54feb9['unchanged']!==undefined&&_0x54feb9[_0x5427aa(0x101)]>0x0)_0x32b14f[_0x5427aa(0x156)](a4_0x4c76cc[_0x5427aa(0x15d)](_0x54feb9['unchanged']+_0x5427aa(0x15e)));if(_0x54feb9['errors']!==undefined&&_0x54feb9[_0x5427aa(0x159)]>0x0)_0x32b14f[_0x5427aa(0x156)](a4_0x4c76cc[_0x5427aa(0xdd)](_0x54feb9[_0x5427aa(0x159)]+'\x20errors'));return _0x32b14f[_0x5427aa(0x134)](',\x20');}function a4_0x58c7(_0x4519be,_0x2699d6){_0x4519be=_0x4519be-0xb8;const _0x1f60dc=a4_0x1f60();let _0x58c7d8=_0x1f60dc[_0x4519be];return _0x58c7d8;}function displayDiffs(_0x1207b4,_0x23caea,_0x24412a,_0x2b10ea,_0x187a80,_0xd05dd2,_0x10dc0f){const _0x44aec9=a4_0x58c7;for(const _0x3d37e5 of _0x1207b4){if(_0x3d37e5['diff']){const _0x2b450=_0x3d37e5[_0x44aec9(0x103)]||_0x3d37e5['name'];console[_0x44aec9(0x13b)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x2b450+'\x27:'),console[_0x44aec9(0x13b)]('─'[_0x44aec9(0x100)](0x3c)),console[_0x44aec9(0x13b)](_0x3d37e5[_0x44aec9(0xd5)]),console[_0x44aec9(0x13b)]('─'[_0x44aec9(0x100)](0x3c));}}for(const _0x22c755 of _0x23caea){_0x22c755[_0x44aec9(0xd5)]&&(console[_0x44aec9(0x13b)](_0x44aec9(0x165)+_0x22c755['name']+'\x27:'),console[_0x44aec9(0x13b)]('─'[_0x44aec9(0x100)](0x3c)),console[_0x44aec9(0x13b)](_0x22c755[_0x44aec9(0xd5)]),console['log']('─'[_0x44aec9(0x100)](0x3c)));}for(const _0x12267f of _0x24412a){_0x12267f['diff']&&(console[_0x44aec9(0x13b)](_0x44aec9(0x145)+_0x12267f[_0x44aec9(0xb9)]+'\x27:'),console[_0x44aec9(0x13b)]('─'['repeat'](0x3c)),console[_0x44aec9(0x13b)](_0x12267f[_0x44aec9(0xd5)]),console[_0x44aec9(0x13b)]('─'['repeat'](0x3c)));}for(const _0x4e0fef of _0x2b10ea){_0x4e0fef['diff']&&(console['log'](_0x44aec9(0x11a)+_0x4e0fef[_0x44aec9(0xb9)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x44aec9(0x13b)](_0x4e0fef[_0x44aec9(0xd5)]),console['log']('─'['repeat'](0x3c)));}for(const _0x54adc4 of _0x187a80){_0x54adc4[_0x44aec9(0xd5)]&&(console['log'](_0x44aec9(0x14a)+_0x54adc4['name']+'\x27:'),console[_0x44aec9(0x13b)]('─'[_0x44aec9(0x100)](0x3c)),console[_0x44aec9(0x13b)](_0x54adc4['diff']),console[_0x44aec9(0x13b)]('─'[_0x44aec9(0x100)](0x3c)));}for(const _0x37ffef of _0xd05dd2){_0x37ffef[_0x44aec9(0xd5)]&&(console[_0x44aec9(0x13b)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x37ffef[_0x44aec9(0xb9)]+'\x27:'),console[_0x44aec9(0x13b)]('─'[_0x44aec9(0x100)](0x3c)),console[_0x44aec9(0x13b)](_0x37ffef['diff']),console[_0x44aec9(0x13b)]('─'['repeat'](0x3c)));}for(const _0x1d7370 of _0x10dc0f){_0x1d7370[_0x44aec9(0xd5)]&&(console['log'](_0x44aec9(0xbf)+_0x1d7370[_0x44aec9(0xb9)]+'\x27:'),console[_0x44aec9(0x13b)]('─'[_0x44aec9(0x100)](0x3c)),console[_0x44aec9(0x13b)](_0x1d7370[_0x44aec9(0xd5)]),console[_0x44aec9(0x13b)]('─'[_0x44aec9(0x100)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x515c36(0xb9)]=a4_0x515c36(0x113);['description']=a4_0x515c36(0x112);async[a4_0x515c36(0x14f)](_0x1b5d3d){const _0x6410fe=a4_0x515c36,{options:_0x541f91,args:_0x19773a,tdx:_0x32d8b9}=_0x1b5d3d,_0xd35e8b=_0x19773a[0x0],_0x106ec6=_0x19773a[0x1],_0x13fa8d=_0x541f91[_0x6410fe(0xe6)],_0x4853f1=_0x541f91[_0x6410fe(0x11f)],_0x258ba0=_0x541f91[_0x6410fe(0xdb)],_0x29a729=_0x541f91[_0x6410fe(0x15f)],_0x3024ce=_0x541f91[_0x6410fe(0x153)],_0x58e08b=_0x541f91[_0x6410fe(0xe2)];let _0x39ba67;if(_0xd35e8b){const _0x37a07d=a4_0x5362d8[_0x6410fe(0x134)](_0xd35e8b,_0x6410fe(0xc0));if(existsSync(_0x37a07d))try{const _0x4b16df=JSON['parse'](readFileSync(_0x37a07d,'utf-8'));_0x4b16df['llm_project']&&(_0x39ba67={'llm_project':_0x4b16df[_0x6410fe(0xdf)]});}catch{}}const _0x106412=findAgentConfigPath(process[_0x6410fe(0xbd)]());let _0x1517c7;if(_0x106412)try{const _0x4d8a1a=JSON[_0x6410fe(0xf0)](readFileSync(_0x106412,'utf-8'));_0x4d8a1a[_0x6410fe(0xdf)]&&(_0x1517c7={'llm_project':_0x4d8a1a[_0x6410fe(0xdf)]});}catch{}const _0x193a4d=resolveAgentPullArgs({'arg':_0xd35e8b,'agentNameArg':_0x106ec6,'agentFlag':_0x58e08b,'contextProject':_0x3024ce,'argDirConfig':_0x39ba67,'cwdConfigPath':_0x106412||undefined,'cwdConfig':_0x1517c7}),{projectNameOrId:_0x3a1c07,targetAgentName:_0x147c67,existingOutputDir:_0x5bccf4,source:_0x40de5e}=_0x193a4d;if(_0x40de5e===_0x6410fe(0x12d))console['log'](a4_0x4c76cc[_0x6410fe(0xc7)](_0x6410fe(0x162)+a4_0x5362d8[_0x6410fe(0x134)](_0xd35e8b,_0x6410fe(0xc0))+':\x20'+_0x3a1c07));else{if(_0x40de5e===_0x6410fe(0x172))console[_0x6410fe(0x13b)](a4_0x4c76cc[_0x6410fe(0xc7)](_0x6410fe(0xec)+_0x3a1c07));else _0x40de5e===_0x6410fe(0x157)&&console['log'](a4_0x4c76cc[_0x6410fe(0xc7)](_0x6410fe(0x132)+_0x3a1c07));}if(!_0x3a1c07)return _0x58e08b?(console[_0x6410fe(0x13b)](a4_0x4c76cc[_0x6410fe(0x116)]('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console['log'](_0x6410fe(0xda)),console['log'](_0x6410fe(0x12f))):(console[_0x6410fe(0x13b)](a4_0x4c76cc[_0x6410fe(0x116)](_0x6410fe(0x111))),console[_0x6410fe(0x13b)](_0x6410fe(0xb8)),console[_0x6410fe(0x13b)](_0x6410fe(0x130)),console[_0x6410fe(0x13b)](_0x6410fe(0x12b)),console[_0x6410fe(0x13b)]('\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['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x147c67){const {data:_0x331f98}=await withSpinner(_0x6410fe(0xcc)+_0x147c67+_0x6410fe(0x15a)+_0x3a1c07+_0x6410fe(0x109),()=>_0x32d8b9[_0x6410fe(0x127)][_0x6410fe(0xee)](_0x3a1c07,_0x147c67,_0x13fa8d,{'dryRun':_0x4853f1,'force':_0x258ba0}));if(_0x4853f1)return console[_0x6410fe(0x13b)](a4_0x4c76cc[_0x6410fe(0x116)](_0x6410fe(0x170))),console['log']('Would\x20pull\x20agent:\x20'+_0x331f98[_0x6410fe(0x103)]),console[_0x6410fe(0x13b)](_0x6410fe(0x143)+_0x331f98[_0x6410fe(0x14d)]),_0x331f98[_0x6410fe(0xd5)]&&(console[_0x6410fe(0x13b)]('\x0aChanges:'),console[_0x6410fe(0x13b)]('─'['repeat'](0x3c)),console[_0x6410fe(0x13b)](_0x331f98[_0x6410fe(0xd5)]),console[_0x6410fe(0x13b)]('─'['repeat'](0x3c))),0x0;return console[_0x6410fe(0x13b)](a4_0x4c76cc[_0x6410fe(0x122)](_0x6410fe(0x13d))),console['log'](_0x6410fe(0x164)+_0x331f98[_0x6410fe(0x103)]),console['log'](_0x6410fe(0xde)+_0x331f98[_0x6410fe(0x14d)]),console['log'](_0x6410fe(0x10a)+(_0x331f98['isNew']?a4_0x4c76cc[_0x6410fe(0x122)](_0x6410fe(0x158)):_0x331f98[_0x6410fe(0x16d)]?a4_0x4c76cc[_0x6410fe(0x116)](_0x6410fe(0x13a)):a4_0x4c76cc[_0x6410fe(0x15d)]('unchanged'))),0x0;}const _0x3358f4=_0x5bccf4||_0x13fa8d,{data:_0x18508f}=await withSpinner(_0x6410fe(0x155)+_0x3a1c07+_0x6410fe(0x109),()=>_0x32d8b9[_0x6410fe(0x127)][_0x6410fe(0xfa)](_0x3a1c07,_0x3358f4,{'dryRun':!![]})),_0x2959d2=_0x18508f['counts'][_0x6410fe(0xf6)][_0x6410fe(0x158)]+_0x18508f[_0x6410fe(0x139)]['knowledgeBases'][_0x6410fe(0x158)]+_0x18508f[_0x6410fe(0x139)]['textKnowledgeBases']['new']+_0x18508f[_0x6410fe(0x139)]['prompts'][_0x6410fe(0x158)]+_0x18508f[_0x6410fe(0x139)]['integrations'][_0x6410fe(0x158)]+_0x18508f[_0x6410fe(0x139)][_0x6410fe(0x104)][_0x6410fe(0x158)]+_0x18508f[_0x6410fe(0x139)][_0x6410fe(0x12a)][_0x6410fe(0x158)],_0x4d7a68=_0x18508f['counts']['agents'][_0x6410fe(0x13a)]+_0x18508f['counts']['knowledgeBases'][_0x6410fe(0x13a)]+_0x18508f[_0x6410fe(0x139)]['textKnowledgeBases'][_0x6410fe(0x13a)]+_0x18508f[_0x6410fe(0x139)][_0x6410fe(0x12c)]['updated']+_0x18508f[_0x6410fe(0x139)][_0x6410fe(0x16f)][_0x6410fe(0x13a)]+_0x18508f['counts'][_0x6410fe(0x104)][_0x6410fe(0x13a)]+_0x18508f['counts'][_0x6410fe(0x12a)][_0x6410fe(0x13a)],_0x3b5d01=_0x18508f[_0x6410fe(0x139)]['agents']['unchanged']+_0x18508f[_0x6410fe(0x139)][_0x6410fe(0xe1)][_0x6410fe(0x101)]+_0x18508f[_0x6410fe(0x139)][_0x6410fe(0x105)][_0x6410fe(0x101)]+_0x18508f[_0x6410fe(0x139)][_0x6410fe(0x12c)][_0x6410fe(0x101)]+_0x18508f['counts'][_0x6410fe(0x16f)][_0x6410fe(0x101)]+_0x18508f[_0x6410fe(0x139)][_0x6410fe(0x104)][_0x6410fe(0x101)]+_0x18508f[_0x6410fe(0x139)]['experimentalArtifacts'][_0x6410fe(0x101)];console[_0x6410fe(0x13b)](_0x6410fe(0x152)+_0x18508f['projectName']+'\x27:'),console[_0x6410fe(0x13b)]('\x20\x20'+a4_0x4c76cc['green']('+\x20'+_0x2959d2+_0x6410fe(0x14e))+_0x6410fe(0x138)+a4_0x4c76cc[_0x6410fe(0x116)]('~\x20'+_0x4d7a68+_0x6410fe(0x176))+_0x6410fe(0x138)+a4_0x4c76cc[_0x6410fe(0xc7)]('=\x20'+_0x3b5d01+_0x6410fe(0x15e))),console[_0x6410fe(0x13b)](_0x6410fe(0x173)+formatCountSummary(_0x18508f['counts']['agents'])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x18508f[_0x6410fe(0x139)][_0x6410fe(0xe1)])),console[_0x6410fe(0x13b)](_0x6410fe(0x125)+formatCountSummary(_0x18508f[_0x6410fe(0x139)]['textKnowledgeBases'])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x18508f[_0x6410fe(0x139)][_0x6410fe(0x12c)])),console['log'](_0x6410fe(0x151)+formatCountSummary(_0x18508f[_0x6410fe(0x139)][_0x6410fe(0x16f)]));const _0x536b5b=_0x18508f[_0x6410fe(0x139)][_0x6410fe(0x104)][_0x6410fe(0xed)]>0x0||_0x18508f['counts'][_0x6410fe(0x12a)][_0x6410fe(0xed)]>0x0;_0x536b5b&&(console[_0x6410fe(0x13b)](_0x6410fe(0xd6)+formatCountSummary(_0x18508f[_0x6410fe(0x139)][_0x6410fe(0x104)])),console[_0x6410fe(0x13b)](_0x6410fe(0xf3)+formatCountSummary(_0x18508f[_0x6410fe(0x139)][_0x6410fe(0x12a)])));console[_0x6410fe(0x13b)](_0x6410fe(0x118)+a4_0x4c76cc[_0x6410fe(0x133)](_0x18508f[_0x6410fe(0x144)])),displayDiffs(_0x18508f[_0x6410fe(0xf6)],_0x18508f[_0x6410fe(0xe1)],_0x18508f[_0x6410fe(0x105)],_0x18508f['prompts'],_0x18508f[_0x6410fe(0x16f)],_0x18508f[_0x6410fe(0x104)],_0x18508f[_0x6410fe(0x12a)]);if(_0x4853f1)return console[_0x6410fe(0x13b)](a4_0x4c76cc[_0x6410fe(0x116)](_0x6410fe(0xe5))),0x0;if(_0x2959d2===0x0&&_0x4d7a68===0x0)return console[_0x6410fe(0x13b)](a4_0x4c76cc[_0x6410fe(0x122)](_0x6410fe(0x167))),saveSessionContext({'llm_project':_0x18508f[_0x6410fe(0x16c)]},_0x541f91[_0x6410fe(0x175)]),console[_0x6410fe(0x13b)](a4_0x4c76cc[_0x6410fe(0x122)](_0x6410fe(0x15b)+a4_0x4c76cc[_0x6410fe(0xc7)]('llm_project')+_0x6410fe(0xd0)+a4_0x4c76cc[_0x6410fe(0x133)](_0x18508f['projectName']))),0x0;if(!_0x29a729&&!_0x258ba0){if(!isInteractive())return console[_0x6410fe(0x115)](a4_0x4c76cc[_0x6410fe(0xdd)]('\x0aError:'),_0x6410fe(0x177)),console[_0x6410fe(0x115)](a4_0x4c76cc[_0x6410fe(0xc7)](_0x6410fe(0xbc))),0x1;const _0x4c7cb2=await confirmKey(_0x6410fe(0xfb)+(_0x2959d2+_0x4d7a68)+_0x6410fe(0xf8));if(!_0x4c7cb2)return console[_0x6410fe(0x13b)](a4_0x4c76cc[_0x6410fe(0x116)](_0x6410fe(0x10d)),_0x6410fe(0xfe)),0x1;}const {data:_0x18eb0c}=await withSpinner(_0x6410fe(0xe4),()=>_0x32d8b9['llm']['pullProject'](_0x3a1c07,_0x3358f4,{'force':_0x258ba0}));return console[_0x6410fe(0x13b)](a4_0x4c76cc[_0x6410fe(0x122)]('\x0a✔\x20Pulled\x20'+(_0x2959d2+_0x4d7a68)+_0x6410fe(0x10f)+_0x18eb0c['outputDir'])),saveSessionContext({'llm_project':_0x18eb0c['projectName']},_0x541f91['session']),console[_0x6410fe(0x13b)](a4_0x4c76cc[_0x6410fe(0x122)](_0x6410fe(0x15b)+a4_0x4c76cc[_0x6410fe(0xc7)](_0x6410fe(0xdf))+_0x6410fe(0xd0)+a4_0x4c76cc[_0x6410fe(0x133)](_0x18eb0c[_0x6410fe(0x16c)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x515c36(0xfd);[a4_0x515c36(0x11b)]=a4_0x515c36(0xca);async['execute'](_0x48625d){const _0x3dd45c=a4_0x515c36,{options:_0x5d8aaa,args:_0x5380dc,tdx:_0x511d59}=_0x48625d,_0x58373b=_0x5380dc[0x0],_0x46e66a=_0x5d8aaa[_0x3dd45c(0xb9)],_0x5b85d1=_0x5d8aaa[_0x3dd45c(0x11f)],_0x1e7bcd=_0x5d8aaa[_0x3dd45c(0x15f)],_0x13e6ce=_0x5d8aaa[_0x3dd45c(0x16b)],_0x2d5a24=_0x5d8aaa[_0x3dd45c(0x153)];let _0x75a5f9;const _0x568685=findAgentConfigPath(process[_0x3dd45c(0xbd)]());if(_0x58373b){const _0x310789=a4_0x5362d8[_0x3dd45c(0x134)](_0x58373b,_0x3dd45c(0xc0));existsSync(_0x310789)?(_0x75a5f9=_0x58373b,console[_0x3dd45c(0x13b)](a4_0x4c76cc[_0x3dd45c(0xc7)](_0x3dd45c(0x149)+_0x58373b))):_0x75a5f9=_0x58373b;}else{if(_0x568685)_0x75a5f9=a4_0x5362d8[_0x3dd45c(0xf2)](_0x568685),console[_0x3dd45c(0x13b)](a4_0x4c76cc[_0x3dd45c(0xc7)](_0x3dd45c(0x13e)+_0x75a5f9));else{if(_0x2d5a24){const _0x53f76a=sanitizeForFilesystem(_0x2d5a24);let _0x7587fb=_0x53f76a,_0x187932=a4_0x5362d8[_0x3dd45c(0x134)](process['cwd'](),_0x3dd45c(0xf6),_0x53f76a,'tdx.json');if(!existsSync(_0x187932)){const _0x1b9d64=normalizeName(_0x2d5a24),_0x196185=a4_0x5362d8[_0x3dd45c(0x134)](process['cwd'](),_0x3dd45c(0xf6),_0x1b9d64,_0x3dd45c(0xc0));existsSync(_0x196185)&&(_0x7587fb=_0x1b9d64,_0x187932=_0x196185);}if(existsSync(_0x187932))_0x75a5f9=a4_0x5362d8[_0x3dd45c(0xf2)](_0x187932),console[_0x3dd45c(0x13b)](a4_0x4c76cc[_0x3dd45c(0xc7)]('Using\x20local\x20project:\x20'+_0x75a5f9));else{const _0x296824=_0x5d8aaa['profile'];if(_0x296824)throw new SDKError(ErrorCode[_0x3dd45c(0xd8)],_0x3dd45c(0x135)+_0x2d5a24+_0x3dd45c(0x119),undefined,{'helpText':_0x3dd45c(0xcf)+_0x3dd45c(0xbb)+(_0x3dd45c(0xf5)+_0x2d5a24+'\x0a')+(_0x3dd45c(0x13f)+_0x7587fb+_0x3dd45c(0x11e)+(_0x46e66a||_0x3dd45c(0x168))+_0x3dd45c(0x106)+_0x296824)});_0x75a5f9=_0x2d5a24,console['log'](a4_0x4c76cc['dim'](_0x3dd45c(0xeb)+_0x2d5a24));}}}}if(!_0x75a5f9)return console['log'](a4_0x4c76cc[_0x3dd45c(0x116)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console['log'](_0x3dd45c(0x154)),console[_0x3dd45c(0x13b)](_0x3dd45c(0x110)),console[_0x3dd45c(0x13b)]('\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[_0x3dd45c(0x13b)](_0x3dd45c(0xfc)),0x1;if(!_0x46e66a)throw new SDKError(ErrorCode[_0x3dd45c(0x169)],_0x3dd45c(0xe8),undefined,{'helpText':_0x3dd45c(0x114)});if(!_0x1e7bcd&&!_0x5b85d1){if(!isInteractive())return console[_0x3dd45c(0x115)](a4_0x4c76cc['red'](_0x3dd45c(0xce)),_0x3dd45c(0x177)),console[_0x3dd45c(0x115)](a4_0x4c76cc[_0x3dd45c(0xc7)](_0x3dd45c(0xbc))),0x1;const _0x1b745b=await confirmKey(_0x3dd45c(0xf9)+_0x75a5f9+_0x3dd45c(0x150)+_0x46e66a+'\x22?');if(!_0x1b745b)return console[_0x3dd45c(0x13b)](a4_0x4c76cc[_0x3dd45c(0x116)](_0x3dd45c(0x10d))),0x1;}const {data:_0x19a921}=await withSpinner(_0x3dd45c(0xc8)+_0x75a5f9+_0x3dd45c(0x10b)+_0x46e66a+_0x3dd45c(0x109),()=>_0x511d59[_0x3dd45c(0x127)]['cloneProject'](_0x75a5f9,_0x46e66a,{'dryRun':_0x5b85d1}));if(_0x5b85d1){console['log'](a4_0x4c76cc[_0x3dd45c(0x116)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x3dd45c(0x13b)](_0x3dd45c(0x126)+_0x19a921[_0x3dd45c(0xea)]),console[_0x3dd45c(0x13b)](_0x3dd45c(0xd7)+_0x46e66a),console[_0x3dd45c(0x13b)](_0x3dd45c(0xe9)),console[_0x3dd45c(0x13b)](_0x3dd45c(0x173)+_0x19a921[_0x3dd45c(0x139)][_0x3dd45c(0xf6)]['created']),console['log'](_0x3dd45c(0x16a)+_0x19a921[_0x3dd45c(0x139)][_0x3dd45c(0xe1)]['created']),console['log'](_0x3dd45c(0xba)+_0x19a921[_0x3dd45c(0x139)]['prompts']['created']);const _0x35e0a0=_0x19a921[_0x3dd45c(0x139)][_0x3dd45c(0x104)][_0x3dd45c(0x148)]>0x0||_0x19a921[_0x3dd45c(0x139)][_0x3dd45c(0x12a)][_0x3dd45c(0x148)]>0x0;return _0x35e0a0&&(console[_0x3dd45c(0x13b)](_0x3dd45c(0xd6)+_0x19a921[_0x3dd45c(0x139)][_0x3dd45c(0x104)][_0x3dd45c(0x148)]),console[_0x3dd45c(0x13b)](_0x3dd45c(0xf3)+_0x19a921['counts'][_0x3dd45c(0x12a)][_0x3dd45c(0x148)])),0x0;}const _0x8b789e=_0x19a921['counts'][_0x3dd45c(0xf6)][_0x3dd45c(0x159)]>0x0||_0x19a921['counts'][_0x3dd45c(0xe1)][_0x3dd45c(0x159)]>0x0||_0x19a921[_0x3dd45c(0x139)]['prompts'][_0x3dd45c(0x159)]>0x0||_0x19a921['counts'][_0x3dd45c(0x104)][_0x3dd45c(0x159)]>0x0||_0x19a921[_0x3dd45c(0x139)][_0x3dd45c(0x12a)]['errors']>0x0;_0x8b789e?console[_0x3dd45c(0x13b)](a4_0x4c76cc['yellow'](_0x3dd45c(0xcd))):console[_0x3dd45c(0x13b)](a4_0x4c76cc[_0x3dd45c(0x122)](_0x3dd45c(0x12e)));console['log'](_0x3dd45c(0x126)+_0x19a921[_0x3dd45c(0xea)]),console['log'](_0x3dd45c(0xd7)+_0x19a921['newProjectName']),console[_0x3dd45c(0x13b)]('New\x20project\x20ID:\x20'+_0x19a921[_0x3dd45c(0xf1)]),console[_0x3dd45c(0x13b)](),console[_0x3dd45c(0x13b)](_0x3dd45c(0x15c)),console['log'](_0x3dd45c(0x173)+formatCountSummary(_0x19a921['counts']['agents'])),console[_0x3dd45c(0x13b)](_0x3dd45c(0x16a)+formatCountSummary(_0x19a921[_0x3dd45c(0x139)]['knowledgeBases'])),console['log'](_0x3dd45c(0xba)+formatCountSummary(_0x19a921['counts']['prompts'])),console['log'](_0x3dd45c(0x151)+formatCountSummary(_0x19a921[_0x3dd45c(0x139)]['integrations']));const _0x11a84a=_0x19a921[_0x3dd45c(0x139)][_0x3dd45c(0x104)]['created']>0x0||_0x19a921[_0x3dd45c(0x139)][_0x3dd45c(0x104)][_0x3dd45c(0x13a)]>0x0||_0x19a921[_0x3dd45c(0x139)][_0x3dd45c(0x104)][_0x3dd45c(0x101)]>0x0||_0x19a921[_0x3dd45c(0x139)][_0x3dd45c(0x12a)][_0x3dd45c(0x148)]>0x0||_0x19a921[_0x3dd45c(0x139)]['experimentalArtifacts']['updated']>0x0||_0x19a921[_0x3dd45c(0x139)][_0x3dd45c(0x12a)][_0x3dd45c(0x101)]>0x0;_0x11a84a&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x19a921[_0x3dd45c(0x139)][_0x3dd45c(0x104)])),console[_0x3dd45c(0x13b)](_0x3dd45c(0xf3)+formatCountSummary(_0x19a921['counts'][_0x3dd45c(0x12a)])));if(_0x8b789e){console['log'](),console['log'](a4_0x4c76cc[_0x3dd45c(0xdd)](_0x3dd45c(0x16e)));for(const _0x3cdd6f of _0x19a921[_0x3dd45c(0xf6)]){_0x3cdd6f[_0x3dd45c(0xd4)]===_0x3dd45c(0x115)&&console[_0x3dd45c(0x13b)](a4_0x4c76cc[_0x3dd45c(0xdd)]('\x20\x20Agent\x20\x22'+_0x3cdd6f[_0x3dd45c(0x103)]+_0x3dd45c(0x123)+_0x3cdd6f[_0x3dd45c(0x115)]));}for(const _0x584403 of _0x19a921[_0x3dd45c(0xe1)]){_0x584403[_0x3dd45c(0xd4)]===_0x3dd45c(0x115)&&console[_0x3dd45c(0x13b)](a4_0x4c76cc[_0x3dd45c(0xdd)](_0x3dd45c(0x14c)+_0x584403[_0x3dd45c(0xb9)]+_0x3dd45c(0x123)+_0x584403[_0x3dd45c(0x115)]));}for(const _0x1562b7 of _0x19a921[_0x3dd45c(0x12c)]){_0x1562b7['action']===_0x3dd45c(0x115)&&console[_0x3dd45c(0x13b)](a4_0x4c76cc[_0x3dd45c(0xdd)](_0x3dd45c(0xcb)+_0x1562b7['name']+_0x3dd45c(0x123)+_0x1562b7[_0x3dd45c(0x115)]));}for(const _0x2149c2 of _0x19a921[_0x3dd45c(0x16f)]){_0x2149c2[_0x3dd45c(0xd4)]==='error'&&console[_0x3dd45c(0x13b)](a4_0x4c76cc[_0x3dd45c(0xdd)]('\x20\x20Integration\x20\x22'+_0x2149c2[_0x3dd45c(0xb9)]+'\x22:\x20'+_0x2149c2[_0x3dd45c(0x115)]));}for(const _0x3a6abc of _0x19a921[_0x3dd45c(0x104)]){_0x3a6abc[_0x3dd45c(0xd4)]==='error'&&console[_0x3dd45c(0x13b)](a4_0x4c76cc[_0x3dd45c(0xdd)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x3a6abc['name']+'\x22:\x20'+_0x3a6abc['error']));}for(const _0x2bac51 of _0x19a921[_0x3dd45c(0x12a)]){_0x2bac51[_0x3dd45c(0xd4)]==='error'&&console[_0x3dd45c(0x13b)](a4_0x4c76cc[_0x3dd45c(0xdd)](_0x3dd45c(0x10e)+_0x2bac51[_0x3dd45c(0xb9)]+'\x22:\x20'+_0x2bac51[_0x3dd45c(0x115)]));}return 0x1;}console['log']();const _0x346227=getLLMProjectUrl(_0x13e6ce,_0x19a921[_0x3dd45c(0xf1)]);return console['log']('Project:\x20'+a4_0x4c76cc[_0x3dd45c(0x133)](_0x346227)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x515c36(0xb9)]=a4_0x515c36(0x102);[a4_0x515c36(0x11b)]=a4_0x515c36(0x128);async[a4_0x515c36(0x14f)](_0x4e0547){const _0x49999b=a4_0x515c36,{options:_0x203e60,args:_0x23340e,tdx:_0x3cd22a}=_0x4e0547;let _0x49644e=_0x23340e[0x0]||process[_0x49999b(0xbd)]();const _0x308576=_0x203e60['dryRun'],_0x186c98=_0x203e60[_0x49999b(0xdb)],_0x4d00cb=_0x203e60[_0x49999b(0x15f)],_0x75335d=_0x203e60[_0x49999b(0x16b)],_0x5f140e=a4_0x5362d8[_0x49999b(0x134)](_0x49644e,_0x49999b(0x146)),_0x3088cd=existsSync(_0x5f140e);if(_0x3088cd){const {data:_0x4d6c9e}=await withSpinner(_0x49999b(0x129)+_0x49644e+_0x49999b(0x109),()=>_0x3cd22a[_0x49999b(0x127)]['pushAgent'](_0x49644e,{'dryRun':_0x308576,'force':_0x186c98}));if(_0x308576)return console[_0x49999b(0x13b)](a4_0x4c76cc[_0x49999b(0x116)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x49999b(0x13b)](_0x49999b(0xc5)+_0x4d6c9e[_0x49999b(0x103)]),0x0;if(_0x4d6c9e[_0x49999b(0xd4)]===_0x49999b(0x115))return console[_0x49999b(0x13b)](a4_0x4c76cc[_0x49999b(0xdd)](_0x49999b(0xbe)+_0x4d6c9e[_0x49999b(0x115)])),0x1;console[_0x49999b(0x13b)](a4_0x4c76cc[_0x49999b(0x122)](_0x49999b(0xf7)+_0x4d6c9e[_0x49999b(0xd4)]+'\x20successfully')),console[_0x49999b(0x13b)](_0x49999b(0x164)+_0x4d6c9e['agentName']);if(_0x4d6c9e[_0x49999b(0x141)]&&_0x4d6c9e[_0x49999b(0xd2)]){const _0x55d5a5=getLLMAgentChatUrl(_0x75335d,_0x4d6c9e['projectId'],_0x4d6c9e[_0x49999b(0x141)]);console[_0x49999b(0x13b)](_0x49999b(0xd3)+a4_0x4c76cc[_0x49999b(0x133)](_0x55d5a5));}return 0x0;}const _0x15a401=_0x203e60[_0x49999b(0x153)],_0x4ce582=resolveProjectFromContext(_0x49644e,_0x15a401);if(_0x4ce582['found'])_0x49644e=_0x4ce582[_0x49999b(0x147)],_0x4ce582[_0x49999b(0x124)]==='context'&&console[_0x49999b(0x13b)](a4_0x4c76cc['dim'](_0x49999b(0xec)+_0x49644e));else{let _0x47b285=_0x49999b(0xff);_0x4ce582[_0x49999b(0x136)]===_0x49999b(0x11c)&&(_0x47b285=_0x4ce582['message']+_0x49999b(0xc4)+_0x4ce582[_0x49999b(0x153)]+_0x49999b(0x131));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4ce582['reason']===_0x49999b(0x10c)?_0x4ce582[_0x49999b(0x142)]:_0x49999b(0x107)+_0x49644e,undefined,{'helpText':_0x47b285});}const {data:_0x267772}=await withSpinner(_0x49999b(0x174),()=>_0x3cd22a[_0x49999b(0x127)]['pushProject'](_0x49644e,{'dryRun':!![]})),_0x45fd0e=_0x267772['counts'][_0x49999b(0xf6)]['errors']>0x0;if(_0x45fd0e){console[_0x49999b(0x13b)](a4_0x4c76cc[_0x49999b(0xdd)]('\x0aErrors\x20found:'));for(const _0x4de905 of _0x267772[_0x49999b(0xf6)]){_0x4de905[_0x49999b(0xd4)]==='error'&&console[_0x49999b(0x13b)](a4_0x4c76cc[_0x49999b(0xdd)]('\x20\x20Agent\x20\x22'+_0x4de905['agentName']+_0x49999b(0x123)+_0x4de905['error']));}return 0x1;}const _0x5b012d=_0x267772[_0x49999b(0x139)][_0x49999b(0xf6)]['created']+_0x267772['counts']['knowledgeBases']['created']+_0x267772[_0x49999b(0x139)][_0x49999b(0x105)][_0x49999b(0x148)]+_0x267772[_0x49999b(0x139)][_0x49999b(0x12c)][_0x49999b(0x148)]+_0x267772[_0x49999b(0x139)][_0x49999b(0x16f)][_0x49999b(0x148)]+_0x267772[_0x49999b(0x139)][_0x49999b(0x104)]['created']+_0x267772['counts'][_0x49999b(0x12a)][_0x49999b(0x148)],_0x3e743d=_0x267772[_0x49999b(0x139)][_0x49999b(0xf6)]['updated']+_0x267772[_0x49999b(0x139)][_0x49999b(0xe1)][_0x49999b(0x13a)]+_0x267772['counts'][_0x49999b(0x105)][_0x49999b(0x13a)]+_0x267772['counts'][_0x49999b(0x12c)][_0x49999b(0x13a)]+_0x267772[_0x49999b(0x139)][_0x49999b(0x16f)][_0x49999b(0x13a)]+_0x267772[_0x49999b(0x139)][_0x49999b(0x104)][_0x49999b(0x13a)]+_0x267772['counts'][_0x49999b(0x12a)][_0x49999b(0x13a)],_0x4f0235=_0x267772['counts'][_0x49999b(0xf6)][_0x49999b(0x101)]+_0x267772['counts']['knowledgeBases'][_0x49999b(0x101)]+_0x267772[_0x49999b(0x139)][_0x49999b(0x105)][_0x49999b(0x101)]+_0x267772[_0x49999b(0x139)][_0x49999b(0x12c)]['unchanged']+_0x267772[_0x49999b(0x139)][_0x49999b(0x16f)][_0x49999b(0x101)]+_0x267772[_0x49999b(0x139)][_0x49999b(0x104)][_0x49999b(0x101)]+_0x267772['counts']['experimentalArtifacts'][_0x49999b(0x101)];console[_0x49999b(0x13b)](_0x49999b(0xd9)+_0x267772['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x4c76cc[_0x49999b(0x122)]('+\x20'+_0x5b012d+_0x49999b(0x14e))+'\x20|\x20'+a4_0x4c76cc['yellow']('~\x20'+_0x3e743d+_0x49999b(0x176))+_0x49999b(0x138)+a4_0x4c76cc[_0x49999b(0xc7)]('=\x20'+_0x4f0235+'\x20unchanged')),console[_0x49999b(0x13b)](_0x49999b(0x173)+formatCountSummary(_0x267772[_0x49999b(0x139)][_0x49999b(0xf6)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x267772[_0x49999b(0x139)]['knowledgeBases'])),console[_0x49999b(0x13b)](_0x49999b(0x125)+formatCountSummary(_0x267772[_0x49999b(0x139)][_0x49999b(0x105)])),console[_0x49999b(0x13b)](_0x49999b(0xba)+formatCountSummary(_0x267772['counts'][_0x49999b(0x12c)])),console[_0x49999b(0x13b)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x267772['counts']['integrations']));const _0x40d900=_0x267772[_0x49999b(0x139)][_0x49999b(0x104)]['created']>0x0||_0x267772['counts'][_0x49999b(0x104)][_0x49999b(0x13a)]>0x0||_0x267772[_0x49999b(0x139)][_0x49999b(0x104)][_0x49999b(0x101)]>0x0||_0x267772[_0x49999b(0x139)][_0x49999b(0x12a)]['created']>0x0||_0x267772['counts'][_0x49999b(0x12a)][_0x49999b(0x13a)]>0x0||_0x267772[_0x49999b(0x139)][_0x49999b(0x12a)][_0x49999b(0x101)]>0x0;_0x40d900&&(console[_0x49999b(0x13b)](_0x49999b(0xd6)+formatCountSummary(_0x267772[_0x49999b(0x139)][_0x49999b(0x104)])),console[_0x49999b(0x13b)](_0x49999b(0xf3)+formatCountSummary(_0x267772[_0x49999b(0x139)][_0x49999b(0x12a)])));console[_0x49999b(0x13b)](_0x49999b(0xe0)+a4_0x4c76cc[_0x49999b(0x133)](_0x49644e)),displayDiffs(_0x267772[_0x49999b(0xf6)],_0x267772['knowledgeBases'],_0x267772['textKnowledgeBases'],_0x267772['prompts'],_0x267772[_0x49999b(0x16f)],_0x267772[_0x49999b(0x104)],_0x267772[_0x49999b(0x12a)]);if(_0x308576)return console[_0x49999b(0x13b)](a4_0x4c76cc[_0x49999b(0x116)](_0x49999b(0x137))),0x0;if(_0x5b012d===0x0&&_0x3e743d===0x0){console['log'](a4_0x4c76cc[_0x49999b(0x122)](_0x49999b(0x117)));const _0x1f7a95=getLLMProjectUrl(_0x75335d,_0x267772[_0x49999b(0xd2)]);return console['log'](_0x49999b(0xdc)+a4_0x4c76cc['cyan'](_0x1f7a95)),0x0;}if(!_0x4d00cb&&!_0x186c98){if(!isInteractive())return console['error'](a4_0x4c76cc[_0x49999b(0xdd)](_0x49999b(0xce)),_0x49999b(0x177)),console['error'](a4_0x4c76cc['dim'](_0x49999b(0xbc))),0x1;const _0x5b59ff=await confirmKey('\x0aPush\x20'+(_0x5b012d+_0x3e743d)+_0x49999b(0xc1));if(!_0x5b59ff)return console[_0x49999b(0x13b)](a4_0x4c76cc['yellow'](_0x49999b(0x10d)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x308c92}=await withSpinner(_0x49999b(0x140),()=>_0x3cd22a[_0x49999b(0x127)][_0x49999b(0xf4)](_0x49644e,{'force':_0x186c98})),_0xfaef92=_0x308c92[_0x49999b(0x139)][_0x49999b(0xf6)][_0x49999b(0x159)]>0x0||_0x308c92[_0x49999b(0x139)][_0x49999b(0xe1)][_0x49999b(0x159)]>0x0||_0x308c92['counts']['textKnowledgeBases'][_0x49999b(0x159)]>0x0||_0x308c92[_0x49999b(0x139)][_0x49999b(0x12c)][_0x49999b(0x159)]>0x0;if(_0xfaef92){console[_0x49999b(0x13b)](a4_0x4c76cc['yellow'](_0x49999b(0xd1))),console['log'](),console['log'](a4_0x4c76cc[_0x49999b(0xdd)]('Errors:'));for(const _0x2b8221 of _0x308c92['agents']){_0x2b8221[_0x49999b(0xd4)]===_0x49999b(0x115)&&console['log'](a4_0x4c76cc[_0x49999b(0xdd)](_0x49999b(0xef)+_0x2b8221[_0x49999b(0x103)]+_0x49999b(0x123)+_0x2b8221['error']));}for(const _0x4e6fdd of _0x308c92['knowledgeBases']){_0x4e6fdd[_0x49999b(0xd4)]==='error'&&console['log'](a4_0x4c76cc['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x4e6fdd[_0x49999b(0xb9)]+'\x22:\x20'+_0x4e6fdd[_0x49999b(0x115)]));}for(const _0x24103e of _0x308c92[_0x49999b(0x105)]){_0x24103e['action']===_0x49999b(0x115)&&console['log'](a4_0x4c76cc['red'](_0x49999b(0x108)+_0x24103e[_0x49999b(0xb9)]+_0x49999b(0x123)+_0x24103e[_0x49999b(0x115)]));}for(const _0xeaec45 of _0x308c92[_0x49999b(0x12c)]){_0xeaec45[_0x49999b(0xd4)]===_0x49999b(0x115)&&console[_0x49999b(0x13b)](a4_0x4c76cc[_0x49999b(0xdd)](_0x49999b(0xcb)+_0xeaec45[_0x49999b(0xb9)]+'\x22:\x20'+_0xeaec45['error']));}for(const _0x105c78 of _0x308c92['integrations']){_0x105c78[_0x49999b(0xd4)]===_0x49999b(0x115)&&console['log'](a4_0x4c76cc[_0x49999b(0xdd)](_0x49999b(0x161)+_0x105c78[_0x49999b(0xb9)]+_0x49999b(0x123)+_0x105c78[_0x49999b(0x115)]));}return 0x1;}console['log'](a4_0x4c76cc[_0x49999b(0x122)](_0x49999b(0x163)+(_0x5b012d+_0x3e743d)+_0x49999b(0x120)+_0x308c92[_0x49999b(0x16c)]+'\x27'));const _0x33d6c9=getLLMProjectUrl(_0x75335d,_0x308c92[_0x49999b(0xd2)]);return console[_0x49999b(0x13b)](_0x49999b(0xdc)+a4_0x4c76cc[_0x49999b(0x133)](_0x33d6c9)),0x0;}}
1
+ const a4_0x510263=a4_0x1a6c;(function(_0x1f5499,_0x31da62){const _0x457bb9=a4_0x1a6c,_0x57cf1b=_0x1f5499();while(!![]){try{const _0x264ed3=-parseInt(_0x457bb9(0x189))/0x1+parseInt(_0x457bb9(0x14e))/0x2*(-parseInt(_0x457bb9(0x181))/0x3)+-parseInt(_0x457bb9(0x168))/0x4*(parseInt(_0x457bb9(0x167))/0x5)+parseInt(_0x457bb9(0x1b9))/0x6+-parseInt(_0x457bb9(0x1ce))/0x7+-parseInt(_0x457bb9(0x154))/0x8+parseInt(_0x457bb9(0x1ab))/0x9;if(_0x264ed3===_0x31da62)break;else _0x57cf1b['push'](_0x57cf1b['shift']());}catch(_0x36d1bc){_0x57cf1b['push'](_0x57cf1b['shift']());}}}(a4_0xa958,0x357f6));import a4_0x445426 from'chalk';import a4_0x136a8c from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a4_0x1a6c(_0x129725,_0x4aba77){_0x129725=_0x129725-0x148;const _0xa958cb=a4_0xa958();let _0x1a6cee=_0xa958cb[_0x129725];return _0x1a6cee;}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(_0x446a82){const _0x4219ec=a4_0x1a6c,_0x4e2921=[];if(_0x446a82['total']!==undefined)_0x4e2921[_0x4219ec(0x180)](_0x446a82[_0x4219ec(0x1c2)]+_0x4219ec(0x156));if(_0x446a82[_0x4219ec(0x1af)]!==undefined&&_0x446a82[_0x4219ec(0x1af)]>0x0)_0x4e2921[_0x4219ec(0x180)](a4_0x445426[_0x4219ec(0x179)](_0x446a82[_0x4219ec(0x1af)]+_0x4219ec(0x18e)));if(_0x446a82[_0x4219ec(0x174)]!==undefined&&_0x446a82['created']>0x0)_0x4e2921['push'](a4_0x445426['green'](_0x446a82['created']+_0x4219ec(0x195)));if(_0x446a82[_0x4219ec(0x18d)]!==undefined&&_0x446a82[_0x4219ec(0x18d)]>0x0)_0x4e2921[_0x4219ec(0x180)](a4_0x445426[_0x4219ec(0x1e5)](_0x446a82[_0x4219ec(0x18d)]+_0x4219ec(0x1f0)));if(_0x446a82['unchanged']!==undefined&&_0x446a82['unchanged']>0x0)_0x4e2921['push'](a4_0x445426['gray'](_0x446a82[_0x4219ec(0x15a)]+_0x4219ec(0x1b2)));if(_0x446a82[_0x4219ec(0x18f)]!==undefined&&_0x446a82[_0x4219ec(0x18f)]>0x0)_0x4e2921[_0x4219ec(0x180)](a4_0x445426[_0x4219ec(0x15e)](_0x446a82[_0x4219ec(0x18f)]+_0x4219ec(0x1a7)));return _0x4e2921[_0x4219ec(0x1a5)](',\x20');}function displayDiffs(_0x48d9b1,_0xf26a66,_0x26a3dc,_0x42282b,_0x3c7b29,_0x1e2f3b,_0x11138a){const _0x7baeea=a4_0x1a6c;for(const _0x9afd4 of _0x48d9b1){if(_0x9afd4[_0x7baeea(0x159)]){const _0x3c67bb=_0x9afd4[_0x7baeea(0x1f5)]||_0x9afd4[_0x7baeea(0x1e1)];console[_0x7baeea(0x1a1)](_0x7baeea(0x166)+_0x3c67bb+'\x27:'),console[_0x7baeea(0x1a1)]('─'['repeat'](0x3c)),console['log'](_0x9afd4[_0x7baeea(0x159)]),console[_0x7baeea(0x1a1)]('─'['repeat'](0x3c));}}for(const _0x47eb98 of _0xf26a66){_0x47eb98[_0x7baeea(0x159)]&&(console['log'](_0x7baeea(0x188)+_0x47eb98['name']+'\x27:'),console[_0x7baeea(0x1a1)]('─'[_0x7baeea(0x187)](0x3c)),console[_0x7baeea(0x1a1)](_0x47eb98[_0x7baeea(0x159)]),console[_0x7baeea(0x1a1)]('─'[_0x7baeea(0x187)](0x3c)));}for(const _0x2741c5 of _0x26a3dc){_0x2741c5[_0x7baeea(0x159)]&&(console['log'](_0x7baeea(0x1d8)+_0x2741c5['name']+'\x27:'),console['log']('─'[_0x7baeea(0x187)](0x3c)),console[_0x7baeea(0x1a1)](_0x2741c5[_0x7baeea(0x159)]),console['log']('─'[_0x7baeea(0x187)](0x3c)));}for(const _0x40586f of _0x42282b){_0x40586f[_0x7baeea(0x159)]&&(console[_0x7baeea(0x1a1)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x40586f['name']+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x7baeea(0x1a1)](_0x40586f[_0x7baeea(0x159)]),console['log']('─'[_0x7baeea(0x187)](0x3c)));}for(const _0x472d86 of _0x3c7b29){_0x472d86['diff']&&(console[_0x7baeea(0x1a1)](_0x7baeea(0x14d)+_0x472d86['name']+'\x27:'),console['log']('─'[_0x7baeea(0x187)](0x3c)),console[_0x7baeea(0x1a1)](_0x472d86[_0x7baeea(0x159)]),console[_0x7baeea(0x1a1)]('─'[_0x7baeea(0x187)](0x3c)));}for(const _0x5be350 of _0x1e2f3b){_0x5be350[_0x7baeea(0x159)]&&(console[_0x7baeea(0x1a1)](_0x7baeea(0x1ef)+_0x5be350[_0x7baeea(0x1e1)]+'\x27:'),console[_0x7baeea(0x1a1)]('─'[_0x7baeea(0x187)](0x3c)),console[_0x7baeea(0x1a1)](_0x5be350['diff']),console[_0x7baeea(0x1a1)]('─'['repeat'](0x3c)));}for(const _0x3c5652 of _0x11138a){_0x3c5652[_0x7baeea(0x159)]&&(console[_0x7baeea(0x1a1)](_0x7baeea(0x191)+_0x3c5652[_0x7baeea(0x1e1)]+'\x27:'),console[_0x7baeea(0x1a1)]('─'[_0x7baeea(0x187)](0x3c)),console['log'](_0x3c5652[_0x7baeea(0x159)]),console['log']('─'[_0x7baeea(0x187)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x510263(0x1e1)]=a4_0x510263(0x1c0);['description']='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x510263(0x182)](_0x335a57){const _0x3dc69d=a4_0x510263,{options:_0x2ba470,args:_0x1c701e,tdx:_0x3aa443}=_0x335a57,_0xcbdd02=_0x1c701e[0x0],_0x388abd=_0x1c701e[0x1],_0x184959=_0x2ba470['output'],_0x1c46f1=_0x2ba470[_0x3dc69d(0x1e6)],_0x2cd582=_0x2ba470['force'],_0x344dfe=_0x2ba470[_0x3dc69d(0x1d5)],_0x56f7fe=_0x2ba470[_0x3dc69d(0x17a)],_0x2012e2=_0x2ba470[_0x3dc69d(0x158)];let _0x4980d8;if(_0xcbdd02){const _0x4100d0=a4_0x136a8c[_0x3dc69d(0x1a5)](_0xcbdd02,'tdx.json');if(existsSync(_0x4100d0))try{const _0x979f79=JSON['parse'](readFileSync(_0x4100d0,_0x3dc69d(0x186)));_0x979f79[_0x3dc69d(0x1de)]&&(_0x4980d8={'llm_project':_0x979f79[_0x3dc69d(0x1de)]});}catch{}}const _0x43238f=findAgentConfigPath(process[_0x3dc69d(0x169)]());let _0x1e3ccf;if(_0x43238f)try{const _0x3cdcd0=JSON['parse'](readFileSync(_0x43238f,'utf-8'));_0x3cdcd0[_0x3dc69d(0x1de)]&&(_0x1e3ccf={'llm_project':_0x3cdcd0[_0x3dc69d(0x1de)]});}catch{}const _0x20a341=resolveAgentPullArgs({'arg':_0xcbdd02,'agentNameArg':_0x388abd,'agentFlag':_0x2012e2,'contextProject':_0x56f7fe,'argDirConfig':_0x4980d8,'cwdConfigPath':_0x43238f||undefined,'cwdConfig':_0x1e3ccf}),{projectNameOrId:_0x38c312,targetAgentName:_0x432c7c,existingOutputDir:_0x69bd11,source:_0x2d1950}=_0x20a341;if(_0x2d1950==='arg-dir')console[_0x3dc69d(0x1a1)](a4_0x445426[_0x3dc69d(0x1c6)](_0x3dc69d(0x1d2)+a4_0x136a8c[_0x3dc69d(0x1a5)](_0xcbdd02,_0x3dc69d(0x1a9))+':\x20'+_0x38c312));else{if(_0x2d1950===_0x3dc69d(0x17c))console[_0x3dc69d(0x1a1)](a4_0x445426[_0x3dc69d(0x1c6)](_0x3dc69d(0x170)+_0x38c312));else _0x2d1950===_0x3dc69d(0x1ac)&&console[_0x3dc69d(0x1a1)](a4_0x445426[_0x3dc69d(0x1c6)](_0x3dc69d(0x150)+_0x38c312));}if(!_0x38c312)return _0x2012e2?(console['log'](a4_0x445426[_0x3dc69d(0x1e5)](_0x3dc69d(0x1bf))),console['log'](_0x3dc69d(0x16d)),console[_0x3dc69d(0x1a1)](_0x3dc69d(0x184))):(console['log'](a4_0x445426['yellow'](_0x3dc69d(0x18b))),console[_0x3dc69d(0x1a1)]('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[_0x3dc69d(0x1a1)]('\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[_0x3dc69d(0x1a1)]('\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[_0x3dc69d(0x1a1)]('\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[_0x3dc69d(0x1a1)]('\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(_0x432c7c){const {data:_0x181f22}=await withSpinner('Pulling\x20agent\x20\x22'+_0x432c7c+_0x3dc69d(0x19e)+_0x38c312+_0x3dc69d(0x18c),()=>_0x3aa443[_0x3dc69d(0x1cf)]['pullAgent'](_0x38c312,_0x432c7c,_0x184959,{'dryRun':_0x1c46f1,'force':_0x2cd582}));if(_0x1c46f1)return console[_0x3dc69d(0x1a1)](a4_0x445426[_0x3dc69d(0x1e5)](_0x3dc69d(0x17b))),console['log'](_0x3dc69d(0x17d)+_0x181f22[_0x3dc69d(0x1f5)]),console['log']('Output\x20path:\x20'+_0x181f22[_0x3dc69d(0x1e7)]),_0x181f22[_0x3dc69d(0x159)]&&(console['log'](_0x3dc69d(0x194)),console[_0x3dc69d(0x1a1)]('─'[_0x3dc69d(0x187)](0x3c)),console['log'](_0x181f22[_0x3dc69d(0x159)]),console[_0x3dc69d(0x1a1)]('─'[_0x3dc69d(0x187)](0x3c))),0x0;return console[_0x3dc69d(0x1a1)](a4_0x445426[_0x3dc69d(0x179)]('Agent\x20pulled\x20successfully')),console[_0x3dc69d(0x1a1)](_0x3dc69d(0x15d)+_0x181f22[_0x3dc69d(0x1f5)]),console[_0x3dc69d(0x1a1)]('Output:\x20'+_0x181f22[_0x3dc69d(0x1e7)]),console['log']('Status:\x20'+(_0x181f22[_0x3dc69d(0x1a6)]?a4_0x445426[_0x3dc69d(0x179)](_0x3dc69d(0x1af)):_0x181f22[_0x3dc69d(0x1d0)]?a4_0x445426['yellow']('updated'):a4_0x445426[_0x3dc69d(0x1d9)]('unchanged'))),0x0;}const _0x3f00dc=_0x69bd11||_0x184959,{data:_0x289515}=await withSpinner('Analyzing\x20project\x20\x22'+_0x38c312+_0x3dc69d(0x18c),()=>_0x3aa443[_0x3dc69d(0x1cf)][_0x3dc69d(0x173)](_0x38c312,_0x3f00dc,{'dryRun':!![]})),_0x385175=_0x289515['counts'][_0x3dc69d(0x177)]['new']+_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x149)][_0x3dc69d(0x1af)]+_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x1c7)]['new']+_0x289515['counts'][_0x3dc69d(0x1bc)]['new']+_0x289515['counts']['integrations'][_0x3dc69d(0x1af)]+_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x151)][_0x3dc69d(0x1af)]+_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x196)]['new'],_0x11fed4=_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x177)]['updated']+_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x149)][_0x3dc69d(0x18d)]+_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x1c7)][_0x3dc69d(0x18d)]+_0x289515['counts'][_0x3dc69d(0x1bc)]['updated']+_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x1da)][_0x3dc69d(0x18d)]+_0x289515['counts']['experimentalKnowledgeBases'][_0x3dc69d(0x18d)]+_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x196)][_0x3dc69d(0x18d)],_0x314105=_0x289515['counts'][_0x3dc69d(0x177)]['unchanged']+_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x149)][_0x3dc69d(0x15a)]+_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x1c7)][_0x3dc69d(0x15a)]+_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x1bc)]['unchanged']+_0x289515['counts']['integrations']['unchanged']+_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x151)][_0x3dc69d(0x15a)]+_0x289515[_0x3dc69d(0x19a)]['experimentalArtifacts']['unchanged'];console[_0x3dc69d(0x1a1)](_0x3dc69d(0x1db)+_0x289515[_0x3dc69d(0x19f)]+'\x27:'),console['log']('\x20\x20'+a4_0x445426['green']('+\x20'+_0x385175+_0x3dc69d(0x18e))+_0x3dc69d(0x176)+a4_0x445426[_0x3dc69d(0x1e5)]('~\x20'+_0x11fed4+_0x3dc69d(0x1d4))+_0x3dc69d(0x176)+a4_0x445426[_0x3dc69d(0x1c6)]('=\x20'+_0x314105+_0x3dc69d(0x1b2))),console[_0x3dc69d(0x1a1)](_0x3dc69d(0x164)+formatCountSummary(_0x289515['counts'][_0x3dc69d(0x177)])),console[_0x3dc69d(0x1a1)](_0x3dc69d(0x1b5)+formatCountSummary(_0x289515['counts'][_0x3dc69d(0x149)])),console[_0x3dc69d(0x1a1)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x289515[_0x3dc69d(0x19a)]['textKnowledgeBases'])),console[_0x3dc69d(0x1a1)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x289515['counts']['prompts'])),console[_0x3dc69d(0x1a1)](_0x3dc69d(0x1e0)+formatCountSummary(_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x1da)]));const _0x533c70=_0x289515['counts'][_0x3dc69d(0x151)][_0x3dc69d(0x1c2)]>0x0||_0x289515['counts']['experimentalArtifacts'][_0x3dc69d(0x1c2)]>0x0;_0x533c70&&(console[_0x3dc69d(0x1a1)](_0x3dc69d(0x1ed)+formatCountSummary(_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x151)])),console[_0x3dc69d(0x1a1)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x289515[_0x3dc69d(0x19a)][_0x3dc69d(0x196)])));console[_0x3dc69d(0x1a1)]('\x20\x20Target:\x20'+a4_0x445426['cyan'](_0x289515[_0x3dc69d(0x16c)])),displayDiffs(_0x289515[_0x3dc69d(0x177)],_0x289515[_0x3dc69d(0x149)],_0x289515[_0x3dc69d(0x1c7)],_0x289515[_0x3dc69d(0x1bc)],_0x289515['integrations'],_0x289515[_0x3dc69d(0x151)],_0x289515[_0x3dc69d(0x196)]);if(_0x1c46f1)return console['log'](a4_0x445426[_0x3dc69d(0x1e5)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x385175===0x0&&_0x11fed4===0x0)return console[_0x3dc69d(0x1a1)](a4_0x445426[_0x3dc69d(0x179)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x289515[_0x3dc69d(0x19f)]},_0x2ba470[_0x3dc69d(0x1e4)]),console[_0x3dc69d(0x1a1)](a4_0x445426[_0x3dc69d(0x179)](_0x3dc69d(0x1ae)+a4_0x445426[_0x3dc69d(0x1c6)](_0x3dc69d(0x1de))+_0x3dc69d(0x1dd)+a4_0x445426[_0x3dc69d(0x14a)](_0x289515['projectName']))),0x0;if(!_0x344dfe&&!_0x2cd582){if(!isInteractive())return console[_0x3dc69d(0x163)](a4_0x445426['red'](_0x3dc69d(0x153)),_0x3dc69d(0x175)),console[_0x3dc69d(0x163)](a4_0x445426[_0x3dc69d(0x1c6)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2db189=await confirmKey('\x0aWrite\x20'+(_0x385175+_0x11fed4)+_0x3dc69d(0x1c8));if(!_0x2db189)return console[_0x3dc69d(0x1a1)](a4_0x445426[_0x3dc69d(0x1e5)](_0x3dc69d(0x199)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x5ca0f1}=await withSpinner(_0x3dc69d(0x1e8),()=>_0x3aa443[_0x3dc69d(0x1cf)]['pullProject'](_0x38c312,_0x3f00dc,{'force':_0x2cd582}));return console[_0x3dc69d(0x1a1)](a4_0x445426['green']('\x0a✔\x20Pulled\x20'+(_0x385175+_0x11fed4)+'\x20files\x20to\x20'+_0x5ca0f1[_0x3dc69d(0x16c)])),saveSessionContext({'llm_project':_0x5ca0f1[_0x3dc69d(0x19f)]},_0x2ba470[_0x3dc69d(0x1e4)]),console[_0x3dc69d(0x1a1)](a4_0x445426['green'](_0x3dc69d(0x1ae)+a4_0x445426[_0x3dc69d(0x1c6)](_0x3dc69d(0x1de))+_0x3dc69d(0x1dd)+a4_0x445426[_0x3dc69d(0x14a)](_0x5ca0f1[_0x3dc69d(0x19f)]))),0x0;}}function a4_0xa958(){const _0x57b688=['reason','agentName','description','\x22\x20to\x20new\x20project\x20\x22','knowledgeBases','cyan','projectId','\x20\x20Source:\x20','\x0aChanges\x20to\x20integration\x20\x27','122HaOoeE','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Using\x20project\x20from\x20context:\x20','experimentalKnowledgeBases','newProjectId','\x0aError:','278568uIKIiK','\x20--profile\x20','\x20total','\x20resources\x20to\x20\x27','agent','diff','unchanged','\x20\x20Integration\x20\x22','No\x20tdx.json\x20found\x20in\x20','Agent:\x20','red','\x27\x20to\x20create\x20the\x20folder\x20structure.','agent:clone','no_local_folder','found','error','\x20\x20Agents:\x20','New\x20project\x20name\x20is\x20required','\x0aChanges\x20to\x20agent\x20\x27','2990ePwMnV','1856ChnZqO','cwd','\x22\x20to\x20\x22','\x20\x20Experimental\x20Artifacts:\x20','outputDir','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x20resources?','\x0aPush\x20summary\x20for\x20\x27','Using\x20project:\x20','newProjectName','Errors:','pullProject','created','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20|\x20','agents','action','green','llmProject','Dry\x20run\x20-\x20no\x20files\x20written','cwd-config','Would\x20pull\x20agent:\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','<new-name>','push','16662gSbysG','execute','Source:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','message','utf-8','repeat','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','436638CvLgml','INVALID_ARGUMENT','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x22...','updated','\x20new','errors','agentId','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Cloning\x20\x22','\x0aChanges:','\x20created','experimentalArtifacts','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Using\x20current\x20project:\x20','Cancelled','counts','Using\x20local\x20project:\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x0a✔\x20Pushed\x20','\x22\x20from\x20project\x20\x22','projectName','Would\x20clone:','log','\x0aProject\x20pushed\x20with\x20errors','Using\x20context\x20project:\x20','Pushing\x20to\x20project...','join','isNew','\x20errors','\x20\x20tdx\x20agent\x20clone\x20agents/','tdx.json','source','9467973IHwSKW','context','\x20successfully','✔\x20Context\x20set:\x20','new','force','Dry\x20run\x20-\x20no\x20changes\x20made','\x20unchanged','pushProject','\x20--name\x20','\x20\x20Knowledge\x20Bases:\x20','\x20\x20Knowledge\x20Base\x20\x22','\x20\x20Prompts:\x20','New\x20project:\x20','2062590bnsGPb','agent:push','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','prompts','Project:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','agent:pull','\x20\x20tdx\x20agent\x20pull\x20','total','MISSING_ARGUMENT','Project\x20cloned\x20with\x20errors','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','dim','textKnowledgeBases','\x20files?','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x0aPush\x20','Failed\x20to\x20push\x20agent:\x20','agent.yml','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','622377bMnFwF','llm','hasChanges','projectDir','Using\x20project\x20from\x20','Chat:\x20','\x20changed','yes','sourceProjectName','site','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','gray','integrations','\x0aPull\x20summary\x20for\x20\x27','\x22:\x20','\x20=\x20','llm_project','\x20\x20Agent\x20\x22','\x20\x20Integrations:\x20','name','Analyzing\x20changes\x20to\x20push...','cloneProject','session','yellow','dryRun','outputPath','Writing\x20files...','Would\x20push\x20agent:\x20','-\x20nothing\x20pushed','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x0aErrors\x20found:','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20updated','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20\x20Prompt\x20\x22'];a4_0xa958=function(){return _0x57b688;};return a4_0xa958();}export class AgentCloneCommand extends BaseCommand{[a4_0x510263(0x1e1)]=a4_0x510263(0x160);['description']=a4_0x510263(0x19c);async[a4_0x510263(0x182)](_0x16d846){const _0x2acfae=a4_0x510263,{options:_0x1a623b,args:_0x25e6ce,tdx:_0x20dfc7}=_0x16d846,_0x1497c7=_0x25e6ce[0x0],_0x241c54=_0x1a623b['name'],_0x9b8871=_0x1a623b[_0x2acfae(0x1e6)],_0x3783a1=_0x1a623b[_0x2acfae(0x1d5)],_0x3ef4e9=_0x1a623b[_0x2acfae(0x1d7)],_0x3a8c90=_0x1a623b[_0x2acfae(0x17a)];let _0x15eced;const _0x2ffb01=findAgentConfigPath(process[_0x2acfae(0x169)]());if(_0x1497c7){const _0x12ca12=a4_0x136a8c[_0x2acfae(0x1a5)](_0x1497c7,'tdx.json');existsSync(_0x12ca12)?(_0x15eced=_0x1497c7,console[_0x2acfae(0x1a1)](a4_0x445426['dim'](_0x2acfae(0x19b)+_0x1497c7))):_0x15eced=_0x1497c7;}else{if(_0x2ffb01)_0x15eced=a4_0x136a8c['dirname'](_0x2ffb01),console[_0x2acfae(0x1a1)](a4_0x445426['dim'](_0x2acfae(0x198)+_0x15eced));else{if(_0x3a8c90){const _0x5c2e91=sanitizeForFilesystem(_0x3a8c90);let _0x45f7f8=_0x5c2e91,_0x392b69=a4_0x136a8c[_0x2acfae(0x1a5)](process['cwd'](),'agents',_0x5c2e91,_0x2acfae(0x1a9));if(!existsSync(_0x392b69)){const _0x300448=normalizeName(_0x3a8c90),_0x1bc4ad=a4_0x136a8c[_0x2acfae(0x1a5)](process[_0x2acfae(0x169)](),_0x2acfae(0x177),_0x300448,_0x2acfae(0x1a9));existsSync(_0x1bc4ad)&&(_0x45f7f8=_0x300448,_0x392b69=_0x1bc4ad);}if(existsSync(_0x392b69))_0x15eced=a4_0x136a8c['dirname'](_0x392b69),console[_0x2acfae(0x1a1)](a4_0x445426['dim'](_0x2acfae(0x19b)+_0x15eced));else{const _0x463435=_0x1a623b['profile'];if(_0x463435)throw new SDKError(ErrorCode[_0x2acfae(0x18a)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x3a8c90+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x2acfae(0x1ee)+_0x2acfae(0x192)+(_0x2acfae(0x1c1)+_0x3a8c90+'\x0a')+(_0x2acfae(0x1a8)+_0x45f7f8+_0x2acfae(0x1b4)+(_0x241c54||_0x2acfae(0x17f))+_0x2acfae(0x155)+_0x463435)});_0x15eced=_0x3a8c90,console[_0x2acfae(0x1a1)](a4_0x445426[_0x2acfae(0x1c6)](_0x2acfae(0x1a3)+_0x3a8c90));}}}}if(!_0x15eced)return console[_0x2acfae(0x1a1)](a4_0x445426[_0x2acfae(0x1e5)](_0x2acfae(0x197))),console['log'](_0x2acfae(0x1bb)),console['log'](_0x2acfae(0x14f)),console[_0x2acfae(0x1a1)]('\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[_0x2acfae(0x1a1)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x241c54)throw new SDKError(ErrorCode[_0x2acfae(0x1c3)],_0x2acfae(0x165),undefined,{'helpText':_0x2acfae(0x1be)});if(!_0x3783a1&&!_0x9b8871){if(!isInteractive())return console[_0x2acfae(0x163)](a4_0x445426[_0x2acfae(0x15e)](_0x2acfae(0x153)),_0x2acfae(0x175)),console[_0x2acfae(0x163)](a4_0x445426[_0x2acfae(0x1c6)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2e6349=await confirmKey('Clone\x20\x22'+_0x15eced+_0x2acfae(0x148)+_0x241c54+'\x22?');if(!_0x2e6349)return console[_0x2acfae(0x1a1)](a4_0x445426[_0x2acfae(0x1e5)](_0x2acfae(0x199))),0x1;}const {data:_0xe60f99}=await withSpinner(_0x2acfae(0x193)+_0x15eced+_0x2acfae(0x16a)+_0x241c54+_0x2acfae(0x18c),()=>_0x20dfc7[_0x2acfae(0x1cf)][_0x2acfae(0x1e3)](_0x15eced,_0x241c54,{'dryRun':_0x9b8871}));if(_0x9b8871){console[_0x2acfae(0x1a1)](a4_0x445426[_0x2acfae(0x1e5)](_0x2acfae(0x1b1))),console[_0x2acfae(0x1a1)](_0x2acfae(0x183)+_0xe60f99[_0x2acfae(0x1d6)]),console[_0x2acfae(0x1a1)](_0x2acfae(0x1b8)+_0x241c54),console['log'](_0x2acfae(0x1a0)),console[_0x2acfae(0x1a1)](_0x2acfae(0x164)+_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x177)][_0x2acfae(0x174)]),console[_0x2acfae(0x1a1)]('\x20\x20Knowledge\x20Bases:\x20'+_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x149)]['created']),console[_0x2acfae(0x1a1)](_0x2acfae(0x1b7)+_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x1bc)]['created']);const _0x1c7863=_0xe60f99['counts'][_0x2acfae(0x151)]['created']>0x0||_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x196)][_0x2acfae(0x174)]>0x0;return _0x1c7863&&(console[_0x2acfae(0x1a1)](_0x2acfae(0x1ed)+_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x151)][_0x2acfae(0x174)]),console['log'](_0x2acfae(0x16b)+_0xe60f99['counts'][_0x2acfae(0x196)]['created'])),0x0;}const _0xa1948b=_0xe60f99['counts']['agents'][_0x2acfae(0x18f)]>0x0||_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x149)]['errors']>0x0||_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x1bc)][_0x2acfae(0x18f)]>0x0||_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x151)][_0x2acfae(0x18f)]>0x0||_0xe60f99['counts']['experimentalArtifacts'][_0x2acfae(0x18f)]>0x0;_0xa1948b?console[_0x2acfae(0x1a1)](a4_0x445426['yellow'](_0x2acfae(0x1c4))):console[_0x2acfae(0x1a1)](a4_0x445426[_0x2acfae(0x179)]('Project\x20cloned\x20successfully'));console[_0x2acfae(0x1a1)](_0x2acfae(0x183)+_0xe60f99[_0x2acfae(0x1d6)]),console['log'](_0x2acfae(0x1b8)+_0xe60f99[_0x2acfae(0x171)]),console[_0x2acfae(0x1a1)]('New\x20project\x20ID:\x20'+_0xe60f99['newProjectId']),console[_0x2acfae(0x1a1)](),console['log']('Summary:'),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0xe60f99[_0x2acfae(0x19a)]['agents'])),console[_0x2acfae(0x1a1)](_0x2acfae(0x1b5)+formatCountSummary(_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x149)])),console[_0x2acfae(0x1a1)](_0x2acfae(0x1b7)+formatCountSummary(_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x1bc)])),console['log'](_0x2acfae(0x1e0)+formatCountSummary(_0xe60f99[_0x2acfae(0x19a)]['integrations']));const _0x1cb136=_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x151)]['created']>0x0||_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x151)][_0x2acfae(0x18d)]>0x0||_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x151)][_0x2acfae(0x15a)]>0x0||_0xe60f99[_0x2acfae(0x19a)]['experimentalArtifacts']['created']>0x0||_0xe60f99[_0x2acfae(0x19a)]['experimentalArtifacts'][_0x2acfae(0x18d)]>0x0||_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x196)][_0x2acfae(0x15a)]>0x0;_0x1cb136&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0xe60f99['counts'][_0x2acfae(0x151)])),console[_0x2acfae(0x1a1)](_0x2acfae(0x16b)+formatCountSummary(_0xe60f99[_0x2acfae(0x19a)][_0x2acfae(0x196)])));if(_0xa1948b){console[_0x2acfae(0x1a1)](),console[_0x2acfae(0x1a1)](a4_0x445426[_0x2acfae(0x15e)](_0x2acfae(0x172)));for(const _0x518f87 of _0xe60f99['agents']){_0x518f87[_0x2acfae(0x178)]===_0x2acfae(0x163)&&console[_0x2acfae(0x1a1)](a4_0x445426[_0x2acfae(0x15e)](_0x2acfae(0x1df)+_0x518f87[_0x2acfae(0x1f5)]+'\x22:\x20'+_0x518f87['error']));}for(const _0x5b8357 of _0xe60f99[_0x2acfae(0x149)]){_0x5b8357[_0x2acfae(0x178)]==='error'&&console[_0x2acfae(0x1a1)](a4_0x445426[_0x2acfae(0x15e)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x5b8357[_0x2acfae(0x1e1)]+'\x22:\x20'+_0x5b8357[_0x2acfae(0x163)]));}for(const _0xb68eea of _0xe60f99['prompts']){_0xb68eea[_0x2acfae(0x178)]===_0x2acfae(0x163)&&console['log'](a4_0x445426[_0x2acfae(0x15e)](_0x2acfae(0x1f3)+_0xb68eea[_0x2acfae(0x1e1)]+_0x2acfae(0x1dc)+_0xb68eea[_0x2acfae(0x163)]));}for(const _0x4e2ab4 of _0xe60f99[_0x2acfae(0x1da)]){_0x4e2ab4[_0x2acfae(0x178)]===_0x2acfae(0x163)&&console[_0x2acfae(0x1a1)](a4_0x445426[_0x2acfae(0x15e)]('\x20\x20Integration\x20\x22'+_0x4e2ab4[_0x2acfae(0x1e1)]+_0x2acfae(0x1dc)+_0x4e2ab4[_0x2acfae(0x163)]));}for(const _0x412ba7 of _0xe60f99[_0x2acfae(0x151)]){_0x412ba7[_0x2acfae(0x178)]==='error'&&console[_0x2acfae(0x1a1)](a4_0x445426[_0x2acfae(0x15e)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x412ba7[_0x2acfae(0x1e1)]+_0x2acfae(0x1dc)+_0x412ba7[_0x2acfae(0x163)]));}for(const _0x3f8788 of _0xe60f99[_0x2acfae(0x196)]){_0x3f8788[_0x2acfae(0x178)]===_0x2acfae(0x163)&&console[_0x2acfae(0x1a1)](a4_0x445426[_0x2acfae(0x15e)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x3f8788[_0x2acfae(0x1e1)]+_0x2acfae(0x1dc)+_0x3f8788[_0x2acfae(0x163)]));}return 0x1;}console[_0x2acfae(0x1a1)]();const _0x56e50b=getLLMProjectUrl(_0x3ef4e9,_0xe60f99[_0x2acfae(0x152)]);return console[_0x2acfae(0x1a1)](_0x2acfae(0x1bd)+a4_0x445426[_0x2acfae(0x14a)](_0x56e50b)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x510263(0x1ba);[a4_0x510263(0x1f6)]=a4_0x510263(0x17e);async['execute'](_0x25a94f){const _0x450c62=a4_0x510263,{options:_0x554009,args:_0x1f8062,tdx:_0x41be47}=_0x25a94f;let _0x3ab062=_0x1f8062[0x0]||process[_0x450c62(0x169)]();const _0x1acde6=_0x554009[_0x450c62(0x1e6)],_0x30da85=_0x554009[_0x450c62(0x1b0)],_0x1c0577=_0x554009[_0x450c62(0x1d5)],_0x341779=_0x554009['site'],_0x575273=a4_0x136a8c['join'](_0x3ab062,_0x450c62(0x1cc)),_0x3a2a7e=existsSync(_0x575273);if(_0x3a2a7e){const {data:_0xf7972a}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x3ab062+_0x450c62(0x18c),()=>_0x41be47[_0x450c62(0x1cf)]['pushAgent'](_0x3ab062,{'dryRun':_0x1acde6,'force':_0x30da85}));if(_0x1acde6)return console[_0x450c62(0x1a1)](a4_0x445426['yellow'](_0x450c62(0x1b1))),console['log'](_0x450c62(0x1e9)+_0xf7972a['agentName']),0x0;if(_0xf7972a[_0x450c62(0x178)]===_0x450c62(0x163))return console[_0x450c62(0x1a1)](a4_0x445426[_0x450c62(0x15e)](_0x450c62(0x1cb)+_0xf7972a[_0x450c62(0x163)])),0x1;console[_0x450c62(0x1a1)](a4_0x445426[_0x450c62(0x179)]('Agent\x20'+_0xf7972a[_0x450c62(0x178)]+_0x450c62(0x1ad))),console[_0x450c62(0x1a1)]('Agent:\x20'+_0xf7972a[_0x450c62(0x1f5)]);if(_0xf7972a[_0x450c62(0x190)]&&_0xf7972a[_0x450c62(0x14b)]){const _0x1159a1=getLLMAgentChatUrl(_0x341779,_0xf7972a[_0x450c62(0x14b)],_0xf7972a[_0x450c62(0x190)]);console[_0x450c62(0x1a1)](_0x450c62(0x1d3)+a4_0x445426['cyan'](_0x1159a1));}return 0x0;}const _0x4b4c01=_0x554009[_0x450c62(0x17a)],_0x5d1bd9=resolveProjectFromContext(_0x3ab062,_0x4b4c01);if(_0x5d1bd9[_0x450c62(0x162)])_0x3ab062=_0x5d1bd9[_0x450c62(0x1d1)],_0x5d1bd9[_0x450c62(0x1aa)]===_0x450c62(0x1ac)&&console['log'](a4_0x445426[_0x450c62(0x1c6)](_0x450c62(0x170)+_0x3ab062));else{let _0xc77612=_0x450c62(0x1eb);_0x5d1bd9[_0x450c62(0x1f4)]===_0x450c62(0x161)&&(_0xc77612=_0x5d1bd9[_0x450c62(0x185)]+_0x450c62(0x1cd)+_0x5d1bd9[_0x450c62(0x17a)]+_0x450c62(0x15f));throw new SDKError(ErrorCode[_0x450c62(0x18a)],_0x5d1bd9[_0x450c62(0x1f4)]==='no_context'?_0x5d1bd9[_0x450c62(0x185)]:_0x450c62(0x15c)+_0x3ab062,undefined,{'helpText':_0xc77612});}const {data:_0x5ca7f0}=await withSpinner(_0x450c62(0x1e2),()=>_0x41be47[_0x450c62(0x1cf)][_0x450c62(0x1b3)](_0x3ab062,{'dryRun':!![]})),_0x357404=_0x5ca7f0['counts'][_0x450c62(0x177)][_0x450c62(0x18f)]>0x0;if(_0x357404){console[_0x450c62(0x1a1)](a4_0x445426[_0x450c62(0x15e)](_0x450c62(0x1ec)));for(const _0x7e054f of _0x5ca7f0[_0x450c62(0x177)]){_0x7e054f['action']===_0x450c62(0x163)&&console[_0x450c62(0x1a1)](a4_0x445426[_0x450c62(0x15e)](_0x450c62(0x1df)+_0x7e054f[_0x450c62(0x1f5)]+_0x450c62(0x1dc)+_0x7e054f[_0x450c62(0x163)]));}return 0x1;}const _0x1d2ae3=_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x177)][_0x450c62(0x174)]+_0x5ca7f0[_0x450c62(0x19a)]['knowledgeBases']['created']+_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x1c7)][_0x450c62(0x174)]+_0x5ca7f0[_0x450c62(0x19a)]['prompts'][_0x450c62(0x174)]+_0x5ca7f0[_0x450c62(0x19a)]['integrations']['created']+_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x151)][_0x450c62(0x174)]+_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x196)][_0x450c62(0x174)],_0x545f19=_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x177)]['updated']+_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x149)][_0x450c62(0x18d)]+_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x1c7)][_0x450c62(0x18d)]+_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x1bc)]['updated']+_0x5ca7f0['counts'][_0x450c62(0x1da)][_0x450c62(0x18d)]+_0x5ca7f0[_0x450c62(0x19a)]['experimentalKnowledgeBases'][_0x450c62(0x18d)]+_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x196)][_0x450c62(0x18d)],_0x2d3f5e=_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x177)]['unchanged']+_0x5ca7f0['counts'][_0x450c62(0x149)]['unchanged']+_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x1c7)][_0x450c62(0x15a)]+_0x5ca7f0['counts'][_0x450c62(0x1bc)]['unchanged']+_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x1da)]['unchanged']+_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x151)]['unchanged']+_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x196)][_0x450c62(0x15a)];console[_0x450c62(0x1a1)](_0x450c62(0x16f)+_0x5ca7f0['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x445426[_0x450c62(0x179)]('+\x20'+_0x1d2ae3+_0x450c62(0x18e))+_0x450c62(0x176)+a4_0x445426[_0x450c62(0x1e5)]('~\x20'+_0x545f19+_0x450c62(0x1d4))+'\x20|\x20'+a4_0x445426[_0x450c62(0x1c6)]('=\x20'+_0x2d3f5e+'\x20unchanged')),console[_0x450c62(0x1a1)](_0x450c62(0x164)+formatCountSummary(_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x177)])),console[_0x450c62(0x1a1)](_0x450c62(0x1b5)+formatCountSummary(_0x5ca7f0['counts'][_0x450c62(0x149)])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x1c7)])),console[_0x450c62(0x1a1)](_0x450c62(0x1b7)+formatCountSummary(_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x1bc)])),console[_0x450c62(0x1a1)](_0x450c62(0x1e0)+formatCountSummary(_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x1da)]));const _0x2a2d0c=_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x151)][_0x450c62(0x174)]>0x0||_0x5ca7f0[_0x450c62(0x19a)]['experimentalKnowledgeBases']['updated']>0x0||_0x5ca7f0[_0x450c62(0x19a)]['experimentalKnowledgeBases']['unchanged']>0x0||_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x196)][_0x450c62(0x174)]>0x0||_0x5ca7f0['counts']['experimentalArtifacts']['updated']>0x0||_0x5ca7f0['counts']['experimentalArtifacts']['unchanged']>0x0;_0x2a2d0c&&(console[_0x450c62(0x1a1)](_0x450c62(0x1ed)+formatCountSummary(_0x5ca7f0['counts']['experimentalKnowledgeBases'])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x5ca7f0[_0x450c62(0x19a)][_0x450c62(0x196)])));console[_0x450c62(0x1a1)](_0x450c62(0x14c)+a4_0x445426['cyan'](_0x3ab062)),displayDiffs(_0x5ca7f0[_0x450c62(0x177)],_0x5ca7f0[_0x450c62(0x149)],_0x5ca7f0['textKnowledgeBases'],_0x5ca7f0['prompts'],_0x5ca7f0['integrations'],_0x5ca7f0[_0x450c62(0x151)],_0x5ca7f0[_0x450c62(0x196)]);if(_0x1acde6)return console['log'](a4_0x445426[_0x450c62(0x1e5)](_0x450c62(0x1c9))),0x0;if(_0x1d2ae3===0x0&&_0x545f19===0x0){console[_0x450c62(0x1a1)](a4_0x445426['green'](_0x450c62(0x1c5)));const _0x320fdc=getLLMProjectUrl(_0x341779,_0x5ca7f0[_0x450c62(0x14b)]);return console[_0x450c62(0x1a1)](_0x450c62(0x1bd)+a4_0x445426[_0x450c62(0x14a)](_0x320fdc)),0x0;}if(!_0x1c0577&&!_0x30da85){if(!isInteractive())return console[_0x450c62(0x163)](a4_0x445426['red'](_0x450c62(0x153)),_0x450c62(0x175)),console['error'](a4_0x445426['dim'](_0x450c62(0x1f1))),0x1;const _0x135b07=await confirmKey(_0x450c62(0x1ca)+(_0x1d2ae3+_0x545f19)+_0x450c62(0x16e));if(!_0x135b07)return console['log'](a4_0x445426[_0x450c62(0x1e5)]('Cancelled'),_0x450c62(0x1ea)),0x1;}const {data:_0x236a53}=await withSpinner(_0x450c62(0x1a4),()=>_0x41be47[_0x450c62(0x1cf)][_0x450c62(0x1b3)](_0x3ab062,{'force':_0x30da85})),_0x2bb048=_0x236a53[_0x450c62(0x19a)][_0x450c62(0x177)][_0x450c62(0x18f)]>0x0||_0x236a53[_0x450c62(0x19a)][_0x450c62(0x149)][_0x450c62(0x18f)]>0x0||_0x236a53[_0x450c62(0x19a)][_0x450c62(0x1c7)][_0x450c62(0x18f)]>0x0||_0x236a53[_0x450c62(0x19a)][_0x450c62(0x1bc)][_0x450c62(0x18f)]>0x0;if(_0x2bb048){console[_0x450c62(0x1a1)](a4_0x445426[_0x450c62(0x1e5)](_0x450c62(0x1a2))),console[_0x450c62(0x1a1)](),console[_0x450c62(0x1a1)](a4_0x445426[_0x450c62(0x15e)](_0x450c62(0x172)));for(const _0x2e41a5 of _0x236a53['agents']){_0x2e41a5[_0x450c62(0x178)]===_0x450c62(0x163)&&console[_0x450c62(0x1a1)](a4_0x445426['red'](_0x450c62(0x1df)+_0x2e41a5[_0x450c62(0x1f5)]+_0x450c62(0x1dc)+_0x2e41a5[_0x450c62(0x163)]));}for(const _0x42fb3d of _0x236a53['knowledgeBases']){_0x42fb3d[_0x450c62(0x178)]===_0x450c62(0x163)&&console[_0x450c62(0x1a1)](a4_0x445426[_0x450c62(0x15e)](_0x450c62(0x1b6)+_0x42fb3d['name']+_0x450c62(0x1dc)+_0x42fb3d['error']));}for(const _0x487e78 of _0x236a53[_0x450c62(0x1c7)]){_0x487e78[_0x450c62(0x178)]===_0x450c62(0x163)&&console[_0x450c62(0x1a1)](a4_0x445426[_0x450c62(0x15e)](_0x450c62(0x1f2)+_0x487e78['name']+'\x22:\x20'+_0x487e78[_0x450c62(0x163)]));}for(const _0x22b2ab of _0x236a53[_0x450c62(0x1bc)]){_0x22b2ab[_0x450c62(0x178)]===_0x450c62(0x163)&&console['log'](a4_0x445426['red'](_0x450c62(0x1f3)+_0x22b2ab[_0x450c62(0x1e1)]+_0x450c62(0x1dc)+_0x22b2ab[_0x450c62(0x163)]));}for(const _0x267d88 of _0x236a53[_0x450c62(0x1da)]){_0x267d88['action']==='error'&&console[_0x450c62(0x1a1)](a4_0x445426[_0x450c62(0x15e)](_0x450c62(0x15b)+_0x267d88[_0x450c62(0x1e1)]+_0x450c62(0x1dc)+_0x267d88[_0x450c62(0x163)]));}return 0x1;}console[_0x450c62(0x1a1)](a4_0x445426[_0x450c62(0x179)](_0x450c62(0x19d)+(_0x1d2ae3+_0x545f19)+_0x450c62(0x157)+_0x236a53[_0x450c62(0x19f)]+'\x27'));const _0x216599=getLLMProjectUrl(_0x341779,_0x236a53[_0x450c62(0x14b)]);return console[_0x450c62(0x1a1)](_0x450c62(0x1bd)+a4_0x445426[_0x450c62(0x14a)](_0x216599)),0x0;}}
@@ -1 +1 @@
1
- function a5_0x479a(){const _0x547462=['Site:\x20','Failed:\x20\x20\x20','Executing\x20new\x20tests...','eval','tags','Running\x20test:\x20','dryRun','red','execute','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Re-evaluation\x20Summary','basename','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','\x20\x20Site:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','agent','verbose','Agent:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','\x22:\x20','no_tests','3136QDZppy','round','push','Cached\x20run\x20is\x20from\x20site\x20\x22','output','Re-evaluating...','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','1422WUUaEu','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','\x20\x20Conversation:\x20','not\x20found','test.yml','Error\x20writing\x20output\x20file:\x20','has','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','description','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','\x20\x20-\x20','writeFileSync','map','utf-8','toISOString','404','now','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','site','find','Using\x20agent:\x20','4638bFmjTq','agent:test','forEach','size','Running\x20agent\x20tests...','split','845702rBtALH','9418770EFsMdB','\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','yellow','2023xFsjFf','no_local_folder','✗\x20FAIL:\x20','cyan','FAIL','989110ncibqQ','rounds','\x20\x20Evaluating...\x20','jsonl','log','...\x20','Either\x20switch\x20to\x20the\x20\x22','Available\x20tags:\x20','\x20\x20Round\x20','5885vUJpFR','includes','timestamp','filter','492BhQcpu','Total:\x20\x20\x20\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','toLowerCase','/<agent-name>','\x20\x20Agent:\x20','\x20-\x20','testName','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','tsv','Run\x20tests\x20for\x20an\x20LLM\x20agent','reason','Test\x20Summary','length','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','projectName','substring','Round\x201/','31904NNthnl','stop','executeReeval','dim','resolve','No\x20tests\x20have\x20tags\x20defined.','Passed:\x20\x20\x20','name','Round\x20','Test\x20Configuration:','context','\x20(cached)','PASS','add','message','agentDirs','green','white','projectDir','llm','Re-evaluating\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','isSpinning','llmProject','Run\x20\x27tdx\x20agent\x20pull\x20','start','Failed\x20Tests:','resolveAgentId','...','status','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','31IkNCIn','source','✗\x20ERROR:\x20Project\x20not\x20found:\x20','text','✓\x20PASS:\x20',':\x20Sending\x20user\x20input...','repeat','table','22qcwoeO','some','json','✗\x20ERROR:\x20','tests','\x22,\x20but\x20current\x20site\x20is\x20\x22','\x20(new)','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Errors:\x20\x20\x20','Tests\x20found:\x20','conversation_url','Error:\x20No\x20previous\x20test\x20run\x20found.','No\x20tests\x20found\x20with\x20tags:\x20','trim','ERROR','join','agentName','16138WfGJwH','Conversation\x20URL:\x20'];a5_0x479a=function(){return _0x547462;};return a5_0x479a();}const a5_0x34ce8d=a5_0x4a29;(function(_0x5568dd,_0x3c18bd){const _0x2ab620=a5_0x4a29,_0x33e82f=_0x5568dd();while(!![]){try{const _0x4bee22=parseInt(_0x2ab620(0x241))/0x1*(-parseInt(_0x2ab620(0x25a))/0x2)+-parseInt(_0x2ab620(0x1f3))/0x3*(parseInt(_0x2ab620(0x271))/0x4)+parseInt(_0x2ab620(0x20b))/0x5*(-parseInt(_0x2ab620(0x278))/0x6)+parseInt(_0x2ab620(0x1fd))/0x7*(-parseInt(_0x2ab620(0x222))/0x8)+parseInt(_0x2ab620(0x1fa))/0x9+-parseInt(_0x2ab620(0x202))/0xa*(parseInt(_0x2ab620(0x249))/0xb)+-parseInt(_0x2ab620(0x20f))/0xc*(-parseInt(_0x2ab620(0x1f9))/0xd);if(_0x4bee22===_0x3c18bd)break;else _0x33e82f['push'](_0x33e82f['shift']());}catch(_0xcf71a5){_0x33e82f['push'](_0x33e82f['shift']());}}}(a5_0x479a,0x97e9e));import*as a5_0x2424ec from'node:fs';import*as a5_0x8edcf9 from'node:path';import a5_0x3f085d from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x4a29(_0x2c8a57,_0x473a0b){_0x2c8a57=_0x2c8a57-0x1e6;const _0x479ab6=a5_0x479a();let _0x4a2996=_0x479ab6[_0x2c8a57];return _0x4a2996;}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x34ce8d(0x229)]=a5_0x34ce8d(0x1f4);[a5_0x34ce8d(0x1e6)]=a5_0x34ce8d(0x21a);async[a5_0x34ce8d(0x264)](_0x3d19de){const _0x51fb47=a5_0x34ce8d,{options:_0x2e0451,args:_0x1344ad,tdx:_0x339337}=_0x3d19de,_0x3ec1c0=_0x1344ad[0x0]||'.',_0x3f96a2=_0x2e0451[_0x51fb47(0x262)],_0x3ecbbe=_0x2e0451,_0x1167ec=_0x3ecbbe[_0x51fb47(0x25f)]===![],_0x3555c4=_0x3ecbbe['reeval'],_0x4e1f44=_0x3ecbbe[_0x51fb47(0x229)],_0x1fc391=_0x3ecbbe[_0x51fb47(0x260)],_0x3b88fb=_0x2e0451['site'],_0x50da0f=_0x3ecbbe[_0x51fb47(0x275)];if(_0x3555c4&&_0x1167ec)return console['log'](a5_0x3f085d[_0x51fb47(0x263)](_0x51fb47(0x26a))),0x1;let _0x4fe691=_0x51fb47(0x248);if(_0x3ecbbe[_0x51fb47(0x24b)])_0x4fe691='json';else{if(_0x3ecbbe[_0x51fb47(0x205)])_0x4fe691=_0x51fb47(0x205);else{if(_0x3ecbbe[_0x51fb47(0x219)])_0x4fe691=_0x51fb47(0x219);else{if(_0x3ecbbe[_0x51fb47(0x248)])_0x4fe691=_0x51fb47(0x248);}}}const _0x3d898d=_0x3ecbbe[_0x51fb47(0x239)];let _0x23c783=_0x3ec1c0;const _0x425d48=a5_0x2424ec['existsSync'](_0x3ec1c0),_0x9f918f=_0x3ec1c0==='.';if(!_0x425d48||_0x9f918f){const _0x26a8ed=resolveProjectFromContext(_0x3ec1c0,_0x3d898d,{'requireFile':_0x51fb47(0x27c)});if(_0x26a8ed['found'])_0x23c783=_0x26a8ed[_0x51fb47(0x234)],_0x26a8ed[_0x51fb47(0x242)]===_0x51fb47(0x22c)&&console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x225)](_0x51fb47(0x1f2)+_0x23c783));else switch(_0x26a8ed[_0x51fb47(0x21b)]){case'no_context':console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x1fc)](_0x26a8ed[_0x51fb47(0x230)])),console[_0x51fb47(0x206)](),console[_0x51fb47(0x206)]('Usage:'),console['log'](_0x51fb47(0x1fb)),console[_0x51fb47(0x206)](_0x51fb47(0x237)),console[_0x51fb47(0x206)](),console[_0x51fb47(0x206)](_0x51fb47(0x212));return 0x1;case _0x51fb47(0x1fe):console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x1fc)](_0x26a8ed[_0x51fb47(0x230)])),console[_0x51fb47(0x206)](),console[_0x51fb47(0x206)](_0x51fb47(0x23a)+_0x26a8ed['llmProject']+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case'multiple_agents':{const _0x5b5d14=a5_0x8edcf9[_0x51fb47(0x267)](_0x26a8ed[_0x51fb47(0x234)]);console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x1fc)](_0x51fb47(0x218)+_0x26a8ed[_0x51fb47(0x239)]+'\x22:'));for(const _0x13f84f of _0x26a8ed[_0x51fb47(0x231)]){console[_0x51fb47(0x206)](_0x51fb47(0x1e8)+_0x13f84f);}return console[_0x51fb47(0x206)](),console['log']('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x5b5d14+_0x51fb47(0x214)),0x1;}case _0x51fb47(0x270):console[_0x51fb47(0x206)](a5_0x3f085d['yellow'](_0x51fb47(0x21e)+_0x26a8ed[_0x51fb47(0x239)]+'\x22.')),console['log'](a5_0x3f085d[_0x51fb47(0x225)]('Project\x20path:\x20'+_0x26a8ed[_0x51fb47(0x234)])),console['log'](),console[_0x51fb47(0x206)](_0x51fb47(0x277));return 0x1;}}const {definition:_0x405533,agentInfo:_0x1949d1}=parseTestFile(_0x23c783);let _0xf331ad=_0x405533[_0x51fb47(0x24d)];if(_0x4e1f44){const _0x9cc017=_0x4e1f44[_0x51fb47(0x1f8)](',')[_0x51fb47(0x1ea)](_0x39f8df=>_0x39f8df[_0x51fb47(0x256)]());_0xf331ad=_0x405533['tests']['filter'](_0x5a3b3f=>_0x9cc017[_0x51fb47(0x20c)](_0x5a3b3f[_0x51fb47(0x229)]));if(_0xf331ad[_0x51fb47(0x21d)]===0x0)return console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x1fc)]('No\x20tests\x20found\x20matching:\x20'+_0x4e1f44)),console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x225)]('Available\x20tests:\x20'+_0x405533['tests'][_0x51fb47(0x1ea)](_0x40a40c=>_0x40a40c[_0x51fb47(0x229)])[_0x51fb47(0x258)](',\x20'))),0x1;}if(_0x1fc391){const _0x31e34a=_0x1fc391[_0x51fb47(0x1f8)](',')[_0x51fb47(0x1ea)](_0x1dced8=>_0x1dced8[_0x51fb47(0x256)]()[_0x51fb47(0x213)]());_0xf331ad=_0xf331ad[_0x51fb47(0x20e)](_0x5c922c=>_0x5c922c['tags']?.[_0x51fb47(0x24a)](_0x33b9ec=>_0x31e34a[_0x51fb47(0x20c)](_0x33b9ec[_0x51fb47(0x213)]())));if(_0xf331ad[_0x51fb47(0x21d)]===0x0){console['log'](a5_0x3f085d[_0x51fb47(0x1fc)](_0x51fb47(0x255)+_0x1fc391));const _0x11e2a3=new Set();return _0x405533[_0x51fb47(0x24d)][_0x51fb47(0x1f5)](_0x44985b=>_0x44985b[_0x51fb47(0x260)]?.[_0x51fb47(0x1f5)](_0x4a31f3=>_0x11e2a3[_0x51fb47(0x22f)](_0x4a31f3))),_0x11e2a3[_0x51fb47(0x1f6)]>0x0?console['log'](a5_0x3f085d['dim'](_0x51fb47(0x209)+[..._0x11e2a3][_0x51fb47(0x258)](',\x20'))):console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x225)](_0x51fb47(0x227))),0x1;}}if(_0x3555c4)return this[_0x51fb47(0x224)](_0x3d19de,{'definition':{'tests':_0xf331ad},'agentInfo':_0x1949d1,'outputFormat':_0x4fe691,'outputFile':_0x50da0f,'testNames':_0x4e1f44});if(_0x3f96a2){console[_0x51fb47(0x206)](a5_0x3f085d['cyan'](_0x51fb47(0x22b))),console[_0x51fb47(0x206)](_0x51fb47(0x269)+a5_0x3f085d[_0x51fb47(0x233)](_0x3b88fb)),console[_0x51fb47(0x206)]('\x20\x20Project:\x20'+a5_0x3f085d[_0x51fb47(0x233)](_0x1949d1['projectName'])),console[_0x51fb47(0x206)](_0x51fb47(0x215)+a5_0x3f085d[_0x51fb47(0x233)](_0x1949d1[_0x51fb47(0x259)])),console['log'](),console[_0x51fb47(0x206)](_0x51fb47(0x252)+a5_0x3f085d[_0x51fb47(0x233)](_0xf331ad[_0x51fb47(0x21d)]));for(let _0x4d956d=0x0;_0x4d956d<_0xf331ad[_0x51fb47(0x21d)];_0x4d956d++){const _0x2ec82d=_0xf331ad[_0x4d956d],_0x8ff889=_0x2ec82d['rounds']['length']===0x1?_0x51fb47(0x272):_0x51fb47(0x203),_0x7edef1=_0x2ec82d[_0x51fb47(0x260)]?.[_0x51fb47(0x21d)]?'\x20['+_0x2ec82d[_0x51fb47(0x260)][_0x51fb47(0x258)](',\x20')+']':'';console[_0x51fb47(0x206)]('\x20\x20'+(_0x4d956d+0x1)+'.\x20'+a5_0x3f085d[_0x51fb47(0x233)](_0x2ec82d[_0x51fb47(0x229)])+'\x20('+_0x2ec82d[_0x51fb47(0x203)][_0x51fb47(0x21d)]+'\x20'+_0x8ff889+')'+a5_0x3f085d[_0x51fb47(0x225)](_0x7edef1));}return 0x0;}let _0x2dccc3,_0x52fcdf;try{_0x2dccc3=await _0x339337[_0x51fb47(0x235)]['resolveProjectId'](_0x1949d1[_0x51fb47(0x21f)]);}catch(_0x1a6a10){const _0x570222=_0x1a6a10 instanceof Error?_0x1a6a10[_0x51fb47(0x230)]:String(_0x1a6a10);return _0x570222[_0x51fb47(0x20c)](_0x51fb47(0x1ed))||_0x570222[_0x51fb47(0x213)]()[_0x51fb47(0x20c)]('not\x20found')?console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x263)](_0x51fb47(0x243)+_0x1949d1[_0x51fb47(0x21f)])):console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x263)](_0x51fb47(0x1ef)+_0x1949d1['projectName']+_0x51fb47(0x26f)+_0x570222)),0x1;}try{_0x52fcdf=await _0x339337[_0x51fb47(0x235)][_0x51fb47(0x23d)](_0x1949d1[_0x51fb47(0x259)],_0x2dccc3);}catch(_0x1c4b72){const _0xa8afe8=_0x1c4b72 instanceof Error?_0x1c4b72[_0x51fb47(0x230)]:String(_0x1c4b72);return _0xa8afe8[_0x51fb47(0x20c)](_0x51fb47(0x1ed))||_0xa8afe8['toLowerCase']()[_0x51fb47(0x20c)](_0x51fb47(0x27b))?console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x263)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x1949d1[_0x51fb47(0x259)])):console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x263)](_0x51fb47(0x27f)+_0x1949d1[_0x51fb47(0x259)]+'\x22:\x20'+_0xa8afe8)),0x1;}let _0x197204;if(!_0x1167ec)try{_0x197204=await setupEvaluatorAgent(_0x339337[_0x51fb47(0x235)],_0x2e0451[_0x51fb47(0x26c)]);}catch(_0x179760){const _0x1623fd=_0x179760 instanceof Error?_0x179760[_0x51fb47(0x230)]:String(_0x179760);return console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x263)](_0x51fb47(0x1e7)+_0x1623fd)),0x1;}console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x200)](_0x51fb47(0x1f7))),console['log'](_0x51fb47(0x25c)+a5_0x3f085d[_0x51fb47(0x233)](_0x3b88fb)),console[_0x51fb47(0x206)](_0x51fb47(0x26d)+a5_0x3f085d[_0x51fb47(0x233)](_0x1949d1[_0x51fb47(0x21f)]+'/'+_0x1949d1[_0x51fb47(0x259)])),console[_0x51fb47(0x206)]();const _0x2f6afe=[],_0x39febf=[],_0x3ddda5=Date[_0x51fb47(0x1ee)]();for(let _0x3465be=0x0;_0x3465be<_0xf331ad['length'];_0x3465be++){const _0x38e407=_0xf331ad[_0x3465be];_0xf331ad['length']>0x1?console[_0x51fb47(0x206)]('Test\x20'+(_0x3465be+0x1)+'/'+_0xf331ad[_0x51fb47(0x21d)]+':\x20'+a5_0x3f085d['white'](_0x38e407['name'])):console[_0x51fb47(0x206)](_0x51fb47(0x261)+a5_0x3f085d['white'](_0x38e407[_0x51fb47(0x229)]));const _0x22f267=createCommandSpinner(_0x51fb47(0x221)+_0x38e407[_0x51fb47(0x203)][_0x51fb47(0x21d)]+_0x51fb47(0x246));_0x22f267[_0x51fb47(0x23b)]();try{const {result:_0x44cf6a,conversation:_0x546494}=await runTest(_0x339337[_0x51fb47(0x235)],_0x38e407,{'agentId':_0x52fcdf,'projectId':_0x2dccc3,'site':_0x3b88fb,'noEval':_0x1167ec,'evaluatorId':_0x197204,'onRoundStart':(_0x46c0cf,_0x373804)=>{const _0x143111=_0x51fb47;_0x22f267[_0x143111(0x244)]='Round\x20'+(_0x46c0cf+0x1)+'/'+_0x373804+_0x143111(0x246);},'onRoundComplete':(_0x4afde2,_0x1c1213,_0xa7083b)=>{const _0x1e73ad=_0x51fb47,_0x81e9b0=formatElapsed(_0x1c1213);_0xa7083b?console[_0x1e73ad(0x206)](_0x1e73ad(0x20a)+(_0x4afde2+0x1)+'/'+_0x38e407['rounds']['length']+_0x1e73ad(0x207)+a5_0x3f085d[_0x1e73ad(0x232)]('✓')+'\x20('+_0x81e9b0+')'):console['log']('\x20\x20Round\x20'+(_0x4afde2+0x1)+'/'+_0x38e407['rounds'][_0x1e73ad(0x21d)]+'...\x20'+a5_0x3f085d['red']('✗'));},'onEvaluationStart':()=>{const _0x1e8d4e=_0x51fb47;_0x22f267[_0x1e8d4e(0x244)]='Evaluating\x20response...';},'onEvaluationComplete':_0x509867=>{const _0x41635e=_0x51fb47,_0x2c1e43=formatElapsed(_0x509867);console[_0x41635e(0x206)](_0x41635e(0x204)+a5_0x3f085d['green']('✓')+'\x20('+_0x2c1e43+')');}});_0x22f267['stop'](),_0x2f6afe['push'](_0x44cf6a),_0x39febf[_0x51fb47(0x273)](_0x546494);if(_0x44cf6a[_0x51fb47(0x23f)]===_0x51fb47(0x22e))console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x232)](_0x51fb47(0x245)+_0x44cf6a[_0x51fb47(0x21b)]));else _0x44cf6a['status']===_0x51fb47(0x201)?console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x263)](_0x51fb47(0x1ff)+_0x44cf6a[_0x51fb47(0x21b)])):console[_0x51fb47(0x206)](a5_0x3f085d['red']('✗\x20ERROR:\x20'+_0x44cf6a[_0x51fb47(0x21b)]));_0x44cf6a[_0x51fb47(0x253)]&&console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x225)](_0x51fb47(0x25b)+_0x44cf6a['conversation_url'])),console['log']();}catch(_0x4dac49){_0x22f267['stop']();const _0x4a41d9=_0x4dac49 instanceof Error?_0x4dac49[_0x51fb47(0x230)]:String(_0x4dac49);console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x263)](_0x51fb47(0x24c)+_0x4a41d9)),console['log'](),_0x2f6afe[_0x51fb47(0x273)]({'name':_0x38e407[_0x51fb47(0x229)],'status':'ERROR','reason':_0x4a41d9,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0xdb96ed=Date[_0x51fb47(0x1ee)]()-_0x3ddda5,_0x11610f=_0x2f6afe[_0x51fb47(0x20e)](_0xd80314=>_0xd80314[_0x51fb47(0x23f)]===_0x51fb47(0x22e))[_0x51fb47(0x21d)],_0x52f354=_0x2f6afe[_0x51fb47(0x20e)](_0x449da0=>_0x449da0[_0x51fb47(0x23f)]===_0x51fb47(0x201))[_0x51fb47(0x21d)],_0x11de50=_0x2f6afe[_0x51fb47(0x20e)](_0x15c1c1=>_0x15c1c1['status']===_0x51fb47(0x257))[_0x51fb47(0x21d)];console[_0x51fb47(0x206)]('━'['repeat'](0x3c)),console[_0x51fb47(0x206)](_0x51fb47(0x21c)),console[_0x51fb47(0x206)]('━'[_0x51fb47(0x247)](0x3c)),console['log'](_0x51fb47(0x210)+_0x2f6afe[_0x51fb47(0x21d)]),console['log'](_0x51fb47(0x228)+a5_0x3f085d['green'](_0x11610f)),console[_0x51fb47(0x206)]('Failed:\x20\x20\x20'+a5_0x3f085d[_0x51fb47(0x263)](_0x52f354));_0x11de50>0x0&&console[_0x51fb47(0x206)](_0x51fb47(0x251)+a5_0x3f085d[_0x51fb47(0x263)](_0x11de50));console[_0x51fb47(0x206)]('Duration:\x20'+formatElapsed(_0xdb96ed)),console['log']('━'[_0x51fb47(0x247)](0x3c));const _0x3ed721=_0x2f6afe['filter'](_0x4ddd52=>_0x4ddd52[_0x51fb47(0x23f)]!==_0x51fb47(0x22e));if(_0x3ed721[_0x51fb47(0x21d)]>0x0){console['log'](),console[_0x51fb47(0x206)](_0x51fb47(0x23c));for(const _0x184757 of _0x3ed721){const _0xa6dd41=a5_0x3f085d[_0x51fb47(0x263)]('✗'),_0x567bec=_0x184757[_0x51fb47(0x21b)][_0x51fb47(0x21d)]>0x32?_0x184757['reason'][_0x51fb47(0x220)](0x0,0x32)+_0x51fb47(0x23e):_0x184757['reason'];console[_0x51fb47(0x206)]('\x20\x20'+_0xa6dd41+'\x20'+_0x184757[_0x51fb47(0x229)]+':\x20'+_0x567bec);}}const _0x50f520={'summary':{'total':_0x2f6afe['length'],'passed':_0x11610f,'failed':_0x52f354,'errors':_0x11de50>0x0?_0x11de50:undefined,'duration_ms':_0xdb96ed},'tests':_0x2f6afe,'agent':{'project':_0x1949d1[_0x51fb47(0x21f)],'name':_0x1949d1[_0x51fb47(0x259)],'site':_0x3b88fb},'timestamp':new Date(_0x3ddda5)[_0x51fb47(0x1ec)]()};try{const _0x2badcd=buildCachedTestRun(_0x39febf,{'site':_0x3b88fb,'projectId':_0x2dccc3,'projectName':_0x1949d1['projectName'],'agentId':_0x52fcdf,'agentName':_0x1949d1['agentName'],'testYmlPath':a5_0x8edcf9[_0x51fb47(0x226)](_0x1949d1['testYmlPath'])});saveLastTestRun(_0x2badcd);}catch{}if(_0x4fe691!=='table'||_0x50da0f){const _0x57a996=formatResults(_0x50f520,_0x4fe691);if(_0x50da0f)try{a5_0x2424ec['writeFileSync'](_0x50da0f,_0x57a996,'utf-8'),console['log'](),console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x225)]('Output\x20written\x20to:\x20'+_0x50da0f));}catch(_0x1aee51){return console[_0x51fb47(0x206)](),console[_0x51fb47(0x206)](a5_0x3f085d[_0x51fb47(0x263)]('Error\x20writing\x20output\x20file:\x20'+_0x1aee51)),0x1;}else console[_0x51fb47(0x206)](),console[_0x51fb47(0x206)](_0x57a996);}return _0x3ed721[_0x51fb47(0x21d)]>0x0?0x1:0x0;}async[a5_0x34ce8d(0x224)](_0x4bb85e,_0x2fa416){const _0x45ec12=a5_0x34ce8d,{options:_0x375bad,tdx:_0x350f02}=_0x4bb85e,{definition:_0x2d6c2b,agentInfo:_0x3a51f1,outputFormat:_0x53447b,outputFile:_0x5d9efa}=_0x2fa416,_0x8130ae=_0x375bad[_0x45ec12(0x1f0)],_0x20c104=loadLastTestRun();if(!_0x20c104)return console['log'](a5_0x3f085d[_0x45ec12(0x263)](_0x45ec12(0x254))),console[_0x45ec12(0x206)](a5_0x3f085d[_0x45ec12(0x225)](_0x45ec12(0x268))),0x1;if(_0x20c104['agent'][_0x45ec12(0x259)]!==_0x3a51f1[_0x45ec12(0x259)])return console[_0x45ec12(0x206)](a5_0x3f085d[_0x45ec12(0x263)](_0x45ec12(0x240)+_0x20c104[_0x45ec12(0x26b)][_0x45ec12(0x259)]+_0x45ec12(0x211)+_0x3a51f1[_0x45ec12(0x259)]+'\x22.')),console[_0x45ec12(0x206)](a5_0x3f085d[_0x45ec12(0x225)](_0x45ec12(0x265))),0x1;const _0x17a5b3=new Set(_0x20c104['conversations'][_0x45ec12(0x1ea)](_0xdfd952=>_0xdfd952[_0x45ec12(0x217)])),_0xaacf9d=_0x2d6c2b[_0x45ec12(0x24d)]['filter'](_0x22b300=>!_0x17a5b3[_0x45ec12(0x27e)](_0x22b300[_0x45ec12(0x229)]));if(_0xaacf9d[_0x45ec12(0x21d)]>0x0&&_0x20c104[_0x45ec12(0x1f0)]!==_0x8130ae)return console[_0x45ec12(0x206)](a5_0x3f085d[_0x45ec12(0x263)](_0x45ec12(0x26e))),console[_0x45ec12(0x206)](a5_0x3f085d['dim'](_0x45ec12(0x274)+_0x20c104[_0x45ec12(0x1f0)]+_0x45ec12(0x24e)+_0x8130ae+'\x22.')),console[_0x45ec12(0x206)](a5_0x3f085d['dim'](_0x45ec12(0x208)+_0x20c104[_0x45ec12(0x1f0)]+_0x45ec12(0x250))),0x1;const _0x188d8d=_0x2d6c2b[_0x45ec12(0x24d)][_0x45ec12(0x20e)](_0x3aa2c6=>_0x17a5b3[_0x45ec12(0x27e)](_0x3aa2c6[_0x45ec12(0x229)])),_0x4514ab=_0xaacf9d;let _0x4195a0;try{_0x4195a0=await setupEvaluatorAgent(_0x350f02[_0x45ec12(0x235)],_0x375bad['verbose']);}catch(_0x542d49){const _0x6e37c4=_0x542d49 instanceof Error?_0x542d49[_0x45ec12(0x230)]:String(_0x542d49);return console[_0x45ec12(0x206)](a5_0x3f085d[_0x45ec12(0x263)](_0x45ec12(0x1e7)+_0x6e37c4)),0x1;}console[_0x45ec12(0x206)](a5_0x3f085d[_0x45ec12(0x200)]('Re-evaluating\x20cached\x20test\x20run...')),console['log']('Cached\x20run\x20from:\x20'+a5_0x3f085d['white'](_0x20c104[_0x45ec12(0x20d)])),console['log'](_0x45ec12(0x26d)+a5_0x3f085d[_0x45ec12(0x233)](_0x20c104[_0x45ec12(0x26b)][_0x45ec12(0x21f)]+'/'+_0x20c104[_0x45ec12(0x26b)][_0x45ec12(0x259)]));_0x4514ab[_0x45ec12(0x21d)]>0x0&&console[_0x45ec12(0x206)]('New\x20tests\x20to\x20execute:\x20'+a5_0x3f085d['yellow'](_0x4514ab[_0x45ec12(0x21d)]));console[_0x45ec12(0x206)]();const _0x732246=[],_0x29ca44=Date[_0x45ec12(0x1ee)](),_0x5d0321=createCommandSpinner(_0x45ec12(0x276));if(_0x188d8d[_0x45ec12(0x21d)]>0x0)try{const _0x53b9a2=await reevaluateFromCache(_0x350f02[_0x45ec12(0x235)],_0x20c104,{'tests':_0x188d8d},{'evaluatorId':_0x4195a0,'onTestStart':(_0x140c6f,_0x515c5f,_0x105d25)=>{const _0x1c47cc=_0x45ec12;_0x5d0321['text']=_0x1c47cc(0x236)+(_0x515c5f+0x1)+'/'+_0x105d25+':\x20'+_0x140c6f+_0x1c47cc(0x23e);if(!_0x5d0321[_0x1c47cc(0x238)])_0x5d0321['start']();},'onTestComplete':(_0x86a05a,_0xd6595c)=>{const _0x3eaf13=_0x45ec12;_0x5d0321[_0x3eaf13(0x223)]();if(_0xd6595c[_0x3eaf13(0x23f)]===_0x3eaf13(0x22e))console[_0x3eaf13(0x206)](a5_0x3f085d[_0x3eaf13(0x232)](_0x3eaf13(0x245)+_0x86a05a)+a5_0x3f085d[_0x3eaf13(0x225)](_0x3eaf13(0x22d)));else _0xd6595c['status']===_0x3eaf13(0x201)?console[_0x3eaf13(0x206)](a5_0x3f085d[_0x3eaf13(0x263)]('✗\x20FAIL:\x20'+_0x86a05a+_0x3eaf13(0x216)+_0xd6595c['reason'])+a5_0x3f085d['dim'](_0x3eaf13(0x22d))):console[_0x3eaf13(0x206)](a5_0x3f085d[_0x3eaf13(0x263)]('✗\x20ERROR:\x20'+_0x86a05a+_0x3eaf13(0x216)+_0xd6595c[_0x3eaf13(0x21b)]));_0xd6595c['conversation_url']&&console['log'](a5_0x3f085d[_0x3eaf13(0x225)](_0x3eaf13(0x27a)+_0xd6595c['conversation_url'])),_0x732246['push'](_0xd6595c);},'onTestSkipped':(_0x14a0e1,_0x128ad6)=>{const _0x323350=_0x45ec12;_0x5d0321[_0x323350(0x223)](),console['log'](a5_0x3f085d[_0x323350(0x1fc)]('⚠\x20SKIPPED:\x20'+_0x14a0e1+_0x323350(0x216)+_0x128ad6));}});for(const _0x320a9b of _0x53b9a2){!_0x732246[_0x45ec12(0x1f1)](_0x3f1140=>_0x3f1140['name']===_0x320a9b[_0x45ec12(0x229)])&&_0x732246[_0x45ec12(0x273)](_0x320a9b);}}catch(_0x309619){_0x5d0321['stop']();const _0x2bfaab=_0x309619 instanceof Error?_0x309619[_0x45ec12(0x230)]:String(_0x309619);return console['log'](a5_0x3f085d[_0x45ec12(0x263)](_0x45ec12(0x279)+_0x2bfaab)),0x1;}_0x5d0321[_0x45ec12(0x223)]();if(_0x4514ab['length']>0x0){console[_0x45ec12(0x206)](),console[_0x45ec12(0x206)](a5_0x3f085d[_0x45ec12(0x200)](_0x45ec12(0x25e)));const {projectId:_0x3db99a,agentId:_0x29f51f}=_0x20c104[_0x45ec12(0x26b)];for(const _0x49c6da of _0x4514ab){console[_0x45ec12(0x206)]('Running:\x20'+a5_0x3f085d[_0x45ec12(0x233)](_0x49c6da[_0x45ec12(0x229)]));const _0xb9dd0=createCommandSpinner(_0x45ec12(0x221)+_0x49c6da[_0x45ec12(0x203)]['length']+_0x45ec12(0x246));_0xb9dd0[_0x45ec12(0x23b)]();try{const {result:_0x4b2fda}=await runTest(_0x350f02[_0x45ec12(0x235)],_0x49c6da,{'agentId':_0x29f51f,'projectId':_0x3db99a,'site':_0x20c104[_0x45ec12(0x1f0)],'noEval':![],'evaluatorId':_0x4195a0,'onRoundStart':(_0x5a8ea1,_0x584160)=>{const _0x27cfb8=_0x45ec12;_0xb9dd0[_0x27cfb8(0x244)]=_0x27cfb8(0x22a)+(_0x5a8ea1+0x1)+'/'+_0x584160+_0x27cfb8(0x246);},'onRoundComplete':(_0x57745e,_0x5cb1fd,_0x457913)=>{const _0x53879e=_0x45ec12,_0x16e683=formatElapsed(_0x5cb1fd);_0x457913?console[_0x53879e(0x206)](_0x53879e(0x20a)+(_0x57745e+0x1)+'/'+_0x49c6da[_0x53879e(0x203)][_0x53879e(0x21d)]+_0x53879e(0x207)+a5_0x3f085d[_0x53879e(0x232)]('✓')+'\x20('+_0x16e683+')'):console[_0x53879e(0x206)](_0x53879e(0x20a)+(_0x57745e+0x1)+'/'+_0x49c6da[_0x53879e(0x203)][_0x53879e(0x21d)]+_0x53879e(0x207)+a5_0x3f085d[_0x53879e(0x263)]('✗'));},'onEvaluationStart':()=>{const _0x917815=_0x45ec12;_0xb9dd0[_0x917815(0x244)]='Evaluating\x20response...';},'onEvaluationComplete':_0x3be3ec=>{const _0xebec3e=_0x45ec12,_0x1df616=formatElapsed(_0x3be3ec);console[_0xebec3e(0x206)](_0xebec3e(0x204)+a5_0x3f085d[_0xebec3e(0x232)]('✓')+'\x20('+_0x1df616+')');}});_0xb9dd0['stop'](),_0x732246[_0x45ec12(0x273)](_0x4b2fda);if(_0x4b2fda[_0x45ec12(0x23f)]==='PASS')console[_0x45ec12(0x206)](a5_0x3f085d['green']('✓\x20PASS:\x20'+_0x4b2fda[_0x45ec12(0x21b)])+a5_0x3f085d['dim'](_0x45ec12(0x24f)));else _0x4b2fda[_0x45ec12(0x23f)]==='FAIL'?console[_0x45ec12(0x206)](a5_0x3f085d[_0x45ec12(0x263)]('✗\x20FAIL:\x20'+_0x4b2fda[_0x45ec12(0x21b)])+a5_0x3f085d['dim'](_0x45ec12(0x24f))):console[_0x45ec12(0x206)](a5_0x3f085d['red'](_0x45ec12(0x24c)+_0x4b2fda[_0x45ec12(0x21b)]));_0x4b2fda[_0x45ec12(0x253)]&&console[_0x45ec12(0x206)](a5_0x3f085d[_0x45ec12(0x225)](_0x45ec12(0x27a)+_0x4b2fda[_0x45ec12(0x253)]));}catch(_0x4ae4fa){_0xb9dd0['stop']();const _0xd3a12e=_0x4ae4fa instanceof Error?_0x4ae4fa['message']:String(_0x4ae4fa);console[_0x45ec12(0x206)](a5_0x3f085d[_0x45ec12(0x263)](_0x45ec12(0x24c)+_0xd3a12e)),_0x732246[_0x45ec12(0x273)]({'name':_0x49c6da['name'],'status':_0x45ec12(0x257),'reason':_0xd3a12e,'timestamp':new Date()[_0x45ec12(0x1ec)](),'duration_ms':0x0});}}}console['log']();const _0x20735c=Date[_0x45ec12(0x1ee)]()-_0x29ca44,_0x16bfb5=_0x732246[_0x45ec12(0x20e)](_0x35c360=>_0x35c360[_0x45ec12(0x23f)]==='PASS')[_0x45ec12(0x21d)],_0x643415=_0x732246['filter'](_0x2ba48c=>_0x2ba48c[_0x45ec12(0x23f)]==='FAIL')[_0x45ec12(0x21d)],_0x3b8aee=_0x732246[_0x45ec12(0x20e)](_0x58f41c=>_0x58f41c[_0x45ec12(0x23f)]===_0x45ec12(0x257))[_0x45ec12(0x21d)];console[_0x45ec12(0x206)]('━'[_0x45ec12(0x247)](0x3c)),console[_0x45ec12(0x206)](_0x45ec12(0x266)),console[_0x45ec12(0x206)]('━'['repeat'](0x3c)),console[_0x45ec12(0x206)](_0x45ec12(0x210)+_0x732246[_0x45ec12(0x21d)]),console[_0x45ec12(0x206)](_0x45ec12(0x228)+a5_0x3f085d[_0x45ec12(0x232)](_0x16bfb5)),console[_0x45ec12(0x206)](_0x45ec12(0x25d)+a5_0x3f085d['red'](_0x643415));_0x3b8aee>0x0&&console[_0x45ec12(0x206)](_0x45ec12(0x251)+a5_0x3f085d[_0x45ec12(0x263)](_0x3b8aee));console[_0x45ec12(0x206)]('Duration:\x20'+formatElapsed(_0x20735c)),console[_0x45ec12(0x206)]('━'['repeat'](0x3c));const _0x2f319a={'summary':{'total':_0x732246[_0x45ec12(0x21d)],'passed':_0x16bfb5,'failed':_0x643415,'errors':_0x3b8aee>0x0?_0x3b8aee:undefined,'duration_ms':_0x20735c},'tests':_0x732246,'agent':{'project':_0x3a51f1[_0x45ec12(0x21f)],'name':_0x3a51f1[_0x45ec12(0x259)],'site':_0x8130ae},'timestamp':new Date(_0x29ca44)[_0x45ec12(0x1ec)]()};if(_0x53447b!==_0x45ec12(0x248)||_0x5d9efa){const _0xf83dbd=formatResults(_0x2f319a,_0x53447b);if(_0x5d9efa)try{a5_0x2424ec[_0x45ec12(0x1e9)](_0x5d9efa,_0xf83dbd,_0x45ec12(0x1eb)),console[_0x45ec12(0x206)](),console[_0x45ec12(0x206)](a5_0x3f085d[_0x45ec12(0x225)]('Output\x20written\x20to:\x20'+_0x5d9efa));}catch(_0x593fbb){return console[_0x45ec12(0x206)](),console[_0x45ec12(0x206)](a5_0x3f085d[_0x45ec12(0x263)](_0x45ec12(0x27d)+_0x593fbb)),0x1;}else console[_0x45ec12(0x206)](),console[_0x45ec12(0x206)](_0xf83dbd);}const _0xadb0bd=_0x732246[_0x45ec12(0x20e)](_0x1cedd8=>_0x1cedd8['status']!=='PASS');return _0xadb0bd[_0x45ec12(0x21d)]>0x0?0x1:0x0;}}
1
+ const a5_0x5761d3=a5_0x2092;(function(_0xc86420,_0x2327a2){const _0x117060=a5_0x2092,_0x51902f=_0xc86420();while(!![]){try{const _0x4a7839=parseInt(_0x117060(0x137))/0x1+-parseInt(_0x117060(0x191))/0x2+-parseInt(_0x117060(0x121))/0x3+parseInt(_0x117060(0x185))/0x4+-parseInt(_0x117060(0x14a))/0x5+parseInt(_0x117060(0x136))/0x6*(-parseInt(_0x117060(0x150))/0x7)+parseInt(_0x117060(0x15a))/0x8;if(_0x4a7839===_0x2327a2)break;else _0x51902f['push'](_0x51902f['shift']());}catch(_0x2117ff){_0x51902f['push'](_0x51902f['shift']());}}}(a5_0x3eb2,0x434b5));import*as a5_0x3d2886 from'node:fs';import*as a5_0x37492f from'node:path';import a5_0x5a9672 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x2092(_0x1e156e,_0x52a20d){_0x1e156e=_0x1e156e-0x10e;const _0x3eb207=a5_0x3eb2();let _0x2092ec=_0x3eb207[_0x1e156e];return _0x2092ec;}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x3eb2(){const _0x1db96a=['Round\x20','includes','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','join','Test\x20Configuration:','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','has','forEach','tests','find','timestamp','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','status','rounds','yellow','Round\x201/','eval','multiple_agents','Tests\x20found:\x20','agent:test','Usage:','not\x20found','FAIL','testName','json','map','Conversation\x20URL:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','context','Error:\x20No\x20previous\x20test\x20run\x20found.','No\x20tests\x20have\x20tags\x20defined.','Executing\x20new\x20tests...','\x20\x20Evaluating...\x20','llm','772710kjUkQd','Output\x20written\x20to:\x20','conversation_url','no_local_folder','length','filter','Failed\x20Tests:','Re-evaluating\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','existsSync','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','projectDir','executeReeval','Running\x20agent\x20tests...','\x20\x20Site:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','Project\x20path:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','message','\x20\x20Conversation:\x20','✗\x20ERROR:\x20','18EkdCBb','360562ulLrqk','push','red','Agent:\x20','conversations','Evaluating\x20response...','Test\x20Summary','\x20-\x20','\x20\x20-\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Passed:\x20\x20\x20','PASS','No\x20tests\x20found\x20with\x20tags:\x20','substring','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','\x20\x20Project:\x20','ERROR','\x20(new)','1299325zoDijC','repeat','resolve','start','Using\x20agent:\x20',':\x20Sending\x20user\x20input...','1255625RKwhgb','agentDirs','Error\x20writing\x20output\x20file:\x20','agentName','add','dim','Cached\x20run\x20is\x20from\x20site\x20\x22','Available\x20tags:\x20','\x20\x20Agent:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','4477520vpkWAH','name','toISOString','cyan','isSpinning','tags','reeval','output','...','\x22:\x20','✓\x20PASS:\x20','\x20\x20Round\x20','Re-evaluating...','⚠\x20SKIPPED:\x20','trim','green','size','Total:\x20\x20\x20\x20','reason','\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)','No\x20tests\x20found\x20matching:\x20','projectName','jsonl','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','agent','basename','llmProject','source','split','Re-evaluating\x20cached\x20test\x20run...','\x20(cached)','404','✗\x20FAIL:\x20','verbose','text','Failed:\x20\x20\x20','Re-evaluation\x20Summary','Errors:\x20\x20\x20','Duration:\x20','tsv','round','log','1848856nvuGQu','Available\x20tests:\x20','writeFileSync','dryRun','site','Test\x20','Running\x20test:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','stop','...\x20','table','now','102538mEwJUF','toLowerCase','found','white','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.'];a5_0x3eb2=function(){return _0x1db96a;};return a5_0x3eb2();}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x5761d3(0x15b)]=a5_0x5761d3(0x112);['description']=a5_0x5761d3(0x172);async['execute'](_0x57882e){const _0x2cb4c6=a5_0x5761d3,{options:_0x5c9851,args:_0x1e3bd0,tdx:_0x5bb689}=_0x57882e,_0x4c9995=_0x1e3bd0[0x0]||'.',_0x526065=_0x5c9851[_0x2cb4c6(0x188)],_0x5a1b16=_0x5c9851,_0x364772=_0x5a1b16[_0x2cb4c6(0x10f)]===![],_0x44d0f2=_0x5a1b16[_0x2cb4c6(0x160)],_0x2e8fcd=_0x5a1b16[_0x2cb4c6(0x15b)],_0x46ef4e=_0x5a1b16[_0x2cb4c6(0x15f)],_0x3ebbba=_0x5c9851[_0x2cb4c6(0x189)],_0xa6d9a5=_0x5a1b16[_0x2cb4c6(0x161)];if(_0x44d0f2&&_0x364772)return console[_0x2cb4c6(0x184)](a5_0x5a9672['red'](_0x2cb4c6(0x129))),0x1;let _0x2e663a='table';if(_0x5a1b16[_0x2cb4c6(0x117)])_0x2e663a=_0x2cb4c6(0x117);else{if(_0x5a1b16['jsonl'])_0x2e663a=_0x2cb4c6(0x170);else{if(_0x5a1b16['tsv'])_0x2e663a=_0x2cb4c6(0x182);else{if(_0x5a1b16[_0x2cb4c6(0x18f)])_0x2e663a=_0x2cb4c6(0x18f);}}}const _0xc3ea2d=_0x5a1b16[_0x2cb4c6(0x175)];let _0x4440d8=_0x4c9995;const _0xd7de44=a5_0x3d2886[_0x2cb4c6(0x12a)](_0x4c9995),_0x4485ee=_0x4c9995==='.';if(!_0xd7de44||_0x4485ee){const _0x356125=resolveProjectFromContext(_0x4c9995,_0xc3ea2d,{'requireFile':'test.yml'});if(_0x356125[_0x2cb4c6(0x193)])_0x4440d8=_0x356125['projectDir'],_0x356125[_0x2cb4c6(0x176)]===_0x2cb4c6(0x11b)&&console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x155)](_0x2cb4c6(0x14e)+_0x4440d8));else switch(_0x356125[_0x2cb4c6(0x16c)]){case'no_context':console['log'](a5_0x5a9672['yellow'](_0x356125[_0x2cb4c6(0x133)])),console[_0x2cb4c6(0x184)](),console[_0x2cb4c6(0x184)](_0x2cb4c6(0x113)),console[_0x2cb4c6(0x184)]('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console[_0x2cb4c6(0x184)](_0x2cb4c6(0x16d)),console[_0x2cb4c6(0x184)](),console[_0x2cb4c6(0x184)](_0x2cb4c6(0x141));return 0x1;case _0x2cb4c6(0x124):console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x1a5)](_0x356125[_0x2cb4c6(0x133)])),console[_0x2cb4c6(0x184)](),console[_0x2cb4c6(0x184)](_0x2cb4c6(0x130)+_0x356125['llmProject']+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x2cb4c6(0x110):{const _0x2e2214=a5_0x37492f[_0x2cb4c6(0x174)](_0x356125[_0x2cb4c6(0x12c)]);console[_0x2cb4c6(0x184)](a5_0x5a9672['yellow']('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x356125[_0x2cb4c6(0x175)]+'\x22:'));for(const _0x305a3b of _0x356125[_0x2cb4c6(0x151)]){console[_0x2cb4c6(0x184)](_0x2cb4c6(0x13f)+_0x305a3b);}return console[_0x2cb4c6(0x184)](),console[_0x2cb4c6(0x184)](_0x2cb4c6(0x1a2)+_0x2e2214+'/<agent-name>'),0x1;}case'no_tests':console['log'](a5_0x5a9672['yellow'](_0x2cb4c6(0x140)+_0x356125[_0x2cb4c6(0x175)]+'\x22.')),console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x155)](_0x2cb4c6(0x131)+_0x356125[_0x2cb4c6(0x12c)])),console[_0x2cb4c6(0x184)](),console[_0x2cb4c6(0x184)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x3fb918,agentInfo:_0x18324e}=parseTestFile(_0x4440d8);let _0x7f314b=_0x3fb918[_0x2cb4c6(0x19f)];if(_0x2e8fcd){const _0x31936d=_0x2e8fcd[_0x2cb4c6(0x177)](',')[_0x2cb4c6(0x118)](_0x4ffba3=>_0x4ffba3[_0x2cb4c6(0x168)]());_0x7f314b=_0x3fb918[_0x2cb4c6(0x19f)][_0x2cb4c6(0x126)](_0x5e38de=>_0x31936d[_0x2cb4c6(0x198)](_0x5e38de[_0x2cb4c6(0x15b)]));if(_0x7f314b[_0x2cb4c6(0x125)]===0x0)return console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x1a5)](_0x2cb4c6(0x16e)+_0x2e8fcd)),console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x155)](_0x2cb4c6(0x186)+_0x3fb918[_0x2cb4c6(0x19f)][_0x2cb4c6(0x118)](_0x34c8bb=>_0x34c8bb[_0x2cb4c6(0x15b)])[_0x2cb4c6(0x19a)](',\x20'))),0x1;}if(_0x46ef4e){const _0x377652=_0x46ef4e[_0x2cb4c6(0x177)](',')[_0x2cb4c6(0x118)](_0x890182=>_0x890182[_0x2cb4c6(0x168)]()[_0x2cb4c6(0x192)]());_0x7f314b=_0x7f314b[_0x2cb4c6(0x126)](_0x3e384b=>_0x3e384b[_0x2cb4c6(0x15f)]?.['some'](_0x101d29=>_0x377652[_0x2cb4c6(0x198)](_0x101d29['toLowerCase']())));if(_0x7f314b[_0x2cb4c6(0x125)]===0x0){console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x1a5)](_0x2cb4c6(0x144)+_0x46ef4e));const _0x322bc7=new Set();return _0x3fb918[_0x2cb4c6(0x19f)][_0x2cb4c6(0x19e)](_0x45c7bf=>_0x45c7bf['tags']?.['forEach'](_0x47b827=>_0x322bc7[_0x2cb4c6(0x154)](_0x47b827))),_0x322bc7[_0x2cb4c6(0x16a)]>0x0?console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x155)](_0x2cb4c6(0x157)+[..._0x322bc7][_0x2cb4c6(0x19a)](',\x20'))):console[_0x2cb4c6(0x184)](a5_0x5a9672['dim'](_0x2cb4c6(0x11d))),0x1;}}if(_0x44d0f2)return this[_0x2cb4c6(0x12d)](_0x57882e,{'definition':{'tests':_0x7f314b},'agentInfo':_0x18324e,'outputFormat':_0x2e663a,'outputFile':_0xa6d9a5,'testNames':_0x2e8fcd});if(_0x526065){console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x15d)](_0x2cb4c6(0x19b))),console[_0x2cb4c6(0x184)](_0x2cb4c6(0x12f)+a5_0x5a9672[_0x2cb4c6(0x194)](_0x3ebbba)),console[_0x2cb4c6(0x184)](_0x2cb4c6(0x147)+a5_0x5a9672['white'](_0x18324e['projectName'])),console['log'](_0x2cb4c6(0x158)+a5_0x5a9672[_0x2cb4c6(0x194)](_0x18324e['agentName'])),console[_0x2cb4c6(0x184)](),console[_0x2cb4c6(0x184)](_0x2cb4c6(0x111)+a5_0x5a9672['white'](_0x7f314b[_0x2cb4c6(0x125)]));for(let _0x558aec=0x0;_0x558aec<_0x7f314b[_0x2cb4c6(0x125)];_0x558aec++){const _0x149ae0=_0x7f314b[_0x558aec],_0x667743=_0x149ae0['rounds'][_0x2cb4c6(0x125)]===0x1?_0x2cb4c6(0x183):_0x2cb4c6(0x1a4),_0x51b99e=_0x149ae0[_0x2cb4c6(0x15f)]?.[_0x2cb4c6(0x125)]?'\x20['+_0x149ae0[_0x2cb4c6(0x15f)][_0x2cb4c6(0x19a)](',\x20')+']':'';console[_0x2cb4c6(0x184)]('\x20\x20'+(_0x558aec+0x1)+'.\x20'+a5_0x5a9672['white'](_0x149ae0[_0x2cb4c6(0x15b)])+'\x20('+_0x149ae0[_0x2cb4c6(0x1a4)][_0x2cb4c6(0x125)]+'\x20'+_0x667743+')'+a5_0x5a9672[_0x2cb4c6(0x155)](_0x51b99e));}return 0x0;}let _0x44b91e,_0x573078;try{_0x44b91e=await _0x5bb689[_0x2cb4c6(0x120)]['resolveProjectId'](_0x18324e[_0x2cb4c6(0x16f)]);}catch(_0x11891a){const _0x8bc621=_0x11891a instanceof Error?_0x11891a[_0x2cb4c6(0x133)]:String(_0x11891a);return _0x8bc621[_0x2cb4c6(0x198)](_0x2cb4c6(0x17a))||_0x8bc621[_0x2cb4c6(0x192)]()['includes'](_0x2cb4c6(0x114))?console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x139)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x18324e[_0x2cb4c6(0x16f)])):console[_0x2cb4c6(0x184)](a5_0x5a9672['red'](_0x2cb4c6(0x199)+_0x18324e[_0x2cb4c6(0x16f)]+_0x2cb4c6(0x163)+_0x8bc621)),0x1;}try{_0x573078=await _0x5bb689[_0x2cb4c6(0x120)]['resolveAgentId'](_0x18324e[_0x2cb4c6(0x153)],_0x44b91e);}catch(_0x20dd2b){const _0x50842f=_0x20dd2b instanceof Error?_0x20dd2b[_0x2cb4c6(0x133)]:String(_0x20dd2b);return _0x50842f[_0x2cb4c6(0x198)](_0x2cb4c6(0x17a))||_0x50842f[_0x2cb4c6(0x192)]()[_0x2cb4c6(0x198)](_0x2cb4c6(0x114))?console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x139)](_0x2cb4c6(0x132)+_0x18324e[_0x2cb4c6(0x153)])):console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x139)](_0x2cb4c6(0x146)+_0x18324e[_0x2cb4c6(0x153)]+'\x22:\x20'+_0x50842f)),0x1;}let _0x558b93;if(!_0x364772)try{_0x558b93=await setupEvaluatorAgent(_0x5bb689[_0x2cb4c6(0x120)],_0x5c9851[_0x2cb4c6(0x17c)]);}catch(_0x423918){const _0x129118=_0x423918 instanceof Error?_0x423918[_0x2cb4c6(0x133)]:String(_0x423918);return console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x139)](_0x2cb4c6(0x19c)+_0x129118)),0x1;}console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x15d)](_0x2cb4c6(0x12e))),console[_0x2cb4c6(0x184)]('Site:\x20'+a5_0x5a9672[_0x2cb4c6(0x194)](_0x3ebbba)),console['log'](_0x2cb4c6(0x13a)+a5_0x5a9672[_0x2cb4c6(0x194)](_0x18324e[_0x2cb4c6(0x16f)]+'/'+_0x18324e[_0x2cb4c6(0x153)])),console[_0x2cb4c6(0x184)]();const _0x135888=[],_0x5ac905=[],_0x3cf174=Date[_0x2cb4c6(0x190)]();for(let _0x3ac27c=0x0;_0x3ac27c<_0x7f314b[_0x2cb4c6(0x125)];_0x3ac27c++){const _0x1ae015=_0x7f314b[_0x3ac27c];_0x7f314b[_0x2cb4c6(0x125)]>0x1?console['log'](_0x2cb4c6(0x18a)+(_0x3ac27c+0x1)+'/'+_0x7f314b['length']+':\x20'+a5_0x5a9672[_0x2cb4c6(0x194)](_0x1ae015['name'])):console[_0x2cb4c6(0x184)](_0x2cb4c6(0x18b)+a5_0x5a9672[_0x2cb4c6(0x194)](_0x1ae015[_0x2cb4c6(0x15b)]));const _0x2bc988=createCommandSpinner(_0x2cb4c6(0x10e)+_0x1ae015['rounds'][_0x2cb4c6(0x125)]+_0x2cb4c6(0x14f));_0x2bc988['start']();try{const {result:_0x32b2b5,conversation:_0x5863c8}=await runTest(_0x5bb689[_0x2cb4c6(0x120)],_0x1ae015,{'agentId':_0x573078,'projectId':_0x44b91e,'site':_0x3ebbba,'noEval':_0x364772,'evaluatorId':_0x558b93,'onRoundStart':(_0x5e9de8,_0x56f2b9)=>{_0x2bc988['text']='Round\x20'+(_0x5e9de8+0x1)+'/'+_0x56f2b9+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x20b038,_0x532be5,_0x472a4f)=>{const _0x27ee6a=_0x2cb4c6,_0x58f2cf=formatElapsed(_0x532be5);_0x472a4f?console[_0x27ee6a(0x184)]('\x20\x20Round\x20'+(_0x20b038+0x1)+'/'+_0x1ae015['rounds'][_0x27ee6a(0x125)]+_0x27ee6a(0x18e)+a5_0x5a9672[_0x27ee6a(0x169)]('✓')+'\x20('+_0x58f2cf+')'):console['log']('\x20\x20Round\x20'+(_0x20b038+0x1)+'/'+_0x1ae015['rounds'][_0x27ee6a(0x125)]+_0x27ee6a(0x18e)+a5_0x5a9672['red']('✗'));},'onEvaluationStart':()=>{const _0x15089b=_0x2cb4c6;_0x2bc988[_0x15089b(0x17d)]='Evaluating\x20response...';},'onEvaluationComplete':_0x206a26=>{const _0x566c28=_0x2cb4c6,_0x4e4ab4=formatElapsed(_0x206a26);console[_0x566c28(0x184)](_0x566c28(0x11f)+a5_0x5a9672['green']('✓')+'\x20('+_0x4e4ab4+')');}});_0x2bc988[_0x2cb4c6(0x18d)](),_0x135888[_0x2cb4c6(0x138)](_0x32b2b5),_0x5ac905[_0x2cb4c6(0x138)](_0x5863c8);if(_0x32b2b5['status']==='PASS')console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x169)](_0x2cb4c6(0x164)+_0x32b2b5[_0x2cb4c6(0x16c)]));else _0x32b2b5[_0x2cb4c6(0x1a3)]===_0x2cb4c6(0x115)?console[_0x2cb4c6(0x184)](a5_0x5a9672['red'](_0x2cb4c6(0x17b)+_0x32b2b5[_0x2cb4c6(0x16c)])):console[_0x2cb4c6(0x184)](a5_0x5a9672['red'](_0x2cb4c6(0x135)+_0x32b2b5['reason']));_0x32b2b5[_0x2cb4c6(0x123)]&&console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x155)](_0x2cb4c6(0x119)+_0x32b2b5[_0x2cb4c6(0x123)])),console[_0x2cb4c6(0x184)]();}catch(_0x1e9cb4){_0x2bc988[_0x2cb4c6(0x18d)]();const _0x45c157=_0x1e9cb4 instanceof Error?_0x1e9cb4['message']:String(_0x1e9cb4);console[_0x2cb4c6(0x184)](a5_0x5a9672['red']('✗\x20ERROR:\x20'+_0x45c157)),console[_0x2cb4c6(0x184)](),_0x135888[_0x2cb4c6(0x138)]({'name':_0x1ae015[_0x2cb4c6(0x15b)],'status':_0x2cb4c6(0x148),'reason':_0x45c157,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x23416a=Date['now']()-_0x3cf174,_0x4d075b=_0x135888[_0x2cb4c6(0x126)](_0x50a1fd=>_0x50a1fd['status']===_0x2cb4c6(0x143))[_0x2cb4c6(0x125)],_0x922323=_0x135888[_0x2cb4c6(0x126)](_0x305cc4=>_0x305cc4[_0x2cb4c6(0x1a3)]==='FAIL')[_0x2cb4c6(0x125)],_0x22c5ac=_0x135888[_0x2cb4c6(0x126)](_0x1cedda=>_0x1cedda[_0x2cb4c6(0x1a3)]===_0x2cb4c6(0x148))[_0x2cb4c6(0x125)];console['log']('━'[_0x2cb4c6(0x14b)](0x3c)),console['log'](_0x2cb4c6(0x13d)),console['log']('━'[_0x2cb4c6(0x14b)](0x3c)),console[_0x2cb4c6(0x184)](_0x2cb4c6(0x16b)+_0x135888[_0x2cb4c6(0x125)]),console['log'](_0x2cb4c6(0x142)+a5_0x5a9672[_0x2cb4c6(0x169)](_0x4d075b)),console[_0x2cb4c6(0x184)](_0x2cb4c6(0x17e)+a5_0x5a9672[_0x2cb4c6(0x139)](_0x922323));_0x22c5ac>0x0&&console[_0x2cb4c6(0x184)](_0x2cb4c6(0x180)+a5_0x5a9672[_0x2cb4c6(0x139)](_0x22c5ac));console['log'](_0x2cb4c6(0x181)+formatElapsed(_0x23416a)),console['log']('━'[_0x2cb4c6(0x14b)](0x3c));const _0x1abc8d=_0x135888['filter'](_0x22ef7e=>_0x22ef7e[_0x2cb4c6(0x1a3)]!==_0x2cb4c6(0x143));if(_0x1abc8d['length']>0x0){console[_0x2cb4c6(0x184)](),console['log'](_0x2cb4c6(0x127));for(const _0x5c7b5c of _0x1abc8d){const _0x631bc3=a5_0x5a9672[_0x2cb4c6(0x139)]('✗'),_0x39d585=_0x5c7b5c[_0x2cb4c6(0x16c)][_0x2cb4c6(0x125)]>0x32?_0x5c7b5c['reason'][_0x2cb4c6(0x145)](0x0,0x32)+'...':_0x5c7b5c[_0x2cb4c6(0x16c)];console['log']('\x20\x20'+_0x631bc3+'\x20'+_0x5c7b5c[_0x2cb4c6(0x15b)]+':\x20'+_0x39d585);}}const _0x116547={'summary':{'total':_0x135888[_0x2cb4c6(0x125)],'passed':_0x4d075b,'failed':_0x922323,'errors':_0x22c5ac>0x0?_0x22c5ac:undefined,'duration_ms':_0x23416a},'tests':_0x135888,'agent':{'project':_0x18324e['projectName'],'name':_0x18324e[_0x2cb4c6(0x153)],'site':_0x3ebbba},'timestamp':new Date(_0x3cf174)[_0x2cb4c6(0x15c)]()};try{const _0x2783ad=buildCachedTestRun(_0x5ac905,{'site':_0x3ebbba,'projectId':_0x44b91e,'projectName':_0x18324e[_0x2cb4c6(0x16f)],'agentId':_0x573078,'agentName':_0x18324e[_0x2cb4c6(0x153)],'testYmlPath':a5_0x37492f[_0x2cb4c6(0x14c)](_0x18324e['testYmlPath'])});saveLastTestRun(_0x2783ad);}catch{}if(_0x2e663a!==_0x2cb4c6(0x18f)||_0xa6d9a5){const _0x433a6d=formatResults(_0x116547,_0x2e663a);if(_0xa6d9a5)try{a5_0x3d2886['writeFileSync'](_0xa6d9a5,_0x433a6d,'utf-8'),console[_0x2cb4c6(0x184)](),console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x155)](_0x2cb4c6(0x122)+_0xa6d9a5));}catch(_0x1ea725){return console[_0x2cb4c6(0x184)](),console[_0x2cb4c6(0x184)](a5_0x5a9672[_0x2cb4c6(0x139)](_0x2cb4c6(0x152)+_0x1ea725)),0x1;}else console[_0x2cb4c6(0x184)](),console['log'](_0x433a6d);}return _0x1abc8d['length']>0x0?0x1:0x0;}async['executeReeval'](_0x11a3f6,_0x3e34ad){const _0x338331=a5_0x5761d3,{options:_0x5eefb1,tdx:_0x2516da}=_0x11a3f6,{definition:_0x51e198,agentInfo:_0x55a050,outputFormat:_0x8656f4,outputFile:_0x12c3b2}=_0x3e34ad,_0x216d15=_0x5eefb1[_0x338331(0x189)],_0x3878f1=loadLastTestRun();if(!_0x3878f1)return console[_0x338331(0x184)](a5_0x5a9672['red'](_0x338331(0x11c))),console[_0x338331(0x184)](a5_0x5a9672[_0x338331(0x155)](_0x338331(0x11a))),0x1;if(_0x3878f1[_0x338331(0x173)][_0x338331(0x153)]!==_0x55a050[_0x338331(0x153)])return console[_0x338331(0x184)](a5_0x5a9672[_0x338331(0x139)](_0x338331(0x12b)+_0x3878f1[_0x338331(0x173)][_0x338331(0x153)]+_0x338331(0x18c)+_0x55a050['agentName']+'\x22.')),console[_0x338331(0x184)](a5_0x5a9672['dim'](_0x338331(0x195))),0x1;const _0xaa93e7=new Set(_0x3878f1[_0x338331(0x13b)][_0x338331(0x118)](_0x2f56bb=>_0x2f56bb[_0x338331(0x116)])),_0x2fd751=_0x51e198[_0x338331(0x19f)][_0x338331(0x126)](_0x5dd52c=>!_0xaa93e7[_0x338331(0x19d)](_0x5dd52c[_0x338331(0x15b)]));if(_0x2fd751['length']>0x0&&_0x3878f1[_0x338331(0x189)]!==_0x216d15)return console['log'](a5_0x5a9672['red'](_0x338331(0x196))),console['log'](a5_0x5a9672[_0x338331(0x155)](_0x338331(0x156)+_0x3878f1[_0x338331(0x189)]+_0x338331(0x159)+_0x216d15+'\x22.')),console[_0x338331(0x184)](a5_0x5a9672[_0x338331(0x155)]('Either\x20switch\x20to\x20the\x20\x22'+_0x3878f1[_0x338331(0x189)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x395102=_0x51e198['tests'][_0x338331(0x126)](_0x377c3a=>_0xaa93e7[_0x338331(0x19d)](_0x377c3a['name'])),_0x5216e1=_0x2fd751;let _0x1e7d3c;try{_0x1e7d3c=await setupEvaluatorAgent(_0x2516da[_0x338331(0x120)],_0x5eefb1[_0x338331(0x17c)]);}catch(_0x2b1def){const _0x4f7718=_0x2b1def instanceof Error?_0x2b1def[_0x338331(0x133)]:String(_0x2b1def);return console['log'](a5_0x5a9672['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x4f7718)),0x1;}console['log'](a5_0x5a9672[_0x338331(0x15d)](_0x338331(0x178))),console[_0x338331(0x184)]('Cached\x20run\x20from:\x20'+a5_0x5a9672[_0x338331(0x194)](_0x3878f1[_0x338331(0x1a1)])),console['log'](_0x338331(0x13a)+a5_0x5a9672[_0x338331(0x194)](_0x3878f1[_0x338331(0x173)]['projectName']+'/'+_0x3878f1['agent'][_0x338331(0x153)]));_0x5216e1[_0x338331(0x125)]>0x0&&console['log']('New\x20tests\x20to\x20execute:\x20'+a5_0x5a9672[_0x338331(0x1a5)](_0x5216e1[_0x338331(0x125)]));console[_0x338331(0x184)]();const _0x495579=[],_0x104401=Date[_0x338331(0x190)](),_0x32bbcd=createCommandSpinner(_0x338331(0x166));if(_0x395102[_0x338331(0x125)]>0x0)try{const _0x59c43b=await reevaluateFromCache(_0x2516da[_0x338331(0x120)],_0x3878f1,{'tests':_0x395102},{'evaluatorId':_0x1e7d3c,'onTestStart':(_0x31b465,_0x1693e5,_0x3b353a)=>{const _0x127c6c=_0x338331;_0x32bbcd[_0x127c6c(0x17d)]=_0x127c6c(0x128)+(_0x1693e5+0x1)+'/'+_0x3b353a+':\x20'+_0x31b465+_0x127c6c(0x162);if(!_0x32bbcd[_0x127c6c(0x15e)])_0x32bbcd[_0x127c6c(0x14d)]();},'onTestComplete':(_0x80bbc0,_0x1418c9)=>{const _0x1ba6d4=_0x338331;_0x32bbcd[_0x1ba6d4(0x18d)]();if(_0x1418c9[_0x1ba6d4(0x1a3)]===_0x1ba6d4(0x143))console['log'](a5_0x5a9672['green']('✓\x20PASS:\x20'+_0x80bbc0)+a5_0x5a9672[_0x1ba6d4(0x155)](_0x1ba6d4(0x179)));else _0x1418c9[_0x1ba6d4(0x1a3)]===_0x1ba6d4(0x115)?console[_0x1ba6d4(0x184)](a5_0x5a9672[_0x1ba6d4(0x139)](_0x1ba6d4(0x17b)+_0x80bbc0+_0x1ba6d4(0x13e)+_0x1418c9[_0x1ba6d4(0x16c)])+a5_0x5a9672[_0x1ba6d4(0x155)]('\x20(cached)')):console[_0x1ba6d4(0x184)](a5_0x5a9672[_0x1ba6d4(0x139)](_0x1ba6d4(0x135)+_0x80bbc0+_0x1ba6d4(0x13e)+_0x1418c9[_0x1ba6d4(0x16c)]));_0x1418c9[_0x1ba6d4(0x123)]&&console[_0x1ba6d4(0x184)](a5_0x5a9672[_0x1ba6d4(0x155)](_0x1ba6d4(0x134)+_0x1418c9[_0x1ba6d4(0x123)])),_0x495579[_0x1ba6d4(0x138)](_0x1418c9);},'onTestSkipped':(_0x3af71c,_0x572b1a)=>{const _0x5c26ae=_0x338331;_0x32bbcd['stop'](),console['log'](a5_0x5a9672['yellow'](_0x5c26ae(0x167)+_0x3af71c+_0x5c26ae(0x13e)+_0x572b1a));}});for(const _0x53f802 of _0x59c43b){!_0x495579[_0x338331(0x1a0)](_0x159883=>_0x159883[_0x338331(0x15b)]===_0x53f802[_0x338331(0x15b)])&&_0x495579['push'](_0x53f802);}}catch(_0x2f4fce){_0x32bbcd[_0x338331(0x18d)]();const _0x10bf32=_0x2f4fce instanceof Error?_0x2f4fce['message']:String(_0x2f4fce);return console[_0x338331(0x184)](a5_0x5a9672[_0x338331(0x139)](_0x338331(0x171)+_0x10bf32)),0x1;}_0x32bbcd[_0x338331(0x18d)]();if(_0x5216e1['length']>0x0){console[_0x338331(0x184)](),console[_0x338331(0x184)](a5_0x5a9672[_0x338331(0x15d)](_0x338331(0x11e)));const {projectId:_0x1da13f,agentId:_0x3e6aa0}=_0x3878f1['agent'];for(const _0x39e20b of _0x5216e1){console['log']('Running:\x20'+a5_0x5a9672[_0x338331(0x194)](_0x39e20b['name']));const _0x27806c=createCommandSpinner(_0x338331(0x10e)+_0x39e20b[_0x338331(0x1a4)][_0x338331(0x125)]+_0x338331(0x14f));_0x27806c[_0x338331(0x14d)]();try{const {result:_0x575a6d}=await runTest(_0x2516da[_0x338331(0x120)],_0x39e20b,{'agentId':_0x3e6aa0,'projectId':_0x1da13f,'site':_0x3878f1['site'],'noEval':![],'evaluatorId':_0x1e7d3c,'onRoundStart':(_0x5aff8b,_0x21d030)=>{const _0x14d643=_0x338331;_0x27806c[_0x14d643(0x17d)]=_0x14d643(0x197)+(_0x5aff8b+0x1)+'/'+_0x21d030+_0x14d643(0x14f);},'onRoundComplete':(_0x1c0382,_0x31836a,_0xf2b726)=>{const _0x120821=_0x338331,_0x49e111=formatElapsed(_0x31836a);_0xf2b726?console[_0x120821(0x184)](_0x120821(0x165)+(_0x1c0382+0x1)+'/'+_0x39e20b['rounds']['length']+'...\x20'+a5_0x5a9672[_0x120821(0x169)]('✓')+'\x20('+_0x49e111+')'):console[_0x120821(0x184)](_0x120821(0x165)+(_0x1c0382+0x1)+'/'+_0x39e20b[_0x120821(0x1a4)][_0x120821(0x125)]+_0x120821(0x18e)+a5_0x5a9672[_0x120821(0x139)]('✗'));},'onEvaluationStart':()=>{const _0x4f70a4=_0x338331;_0x27806c[_0x4f70a4(0x17d)]=_0x4f70a4(0x13c);},'onEvaluationComplete':_0x446688=>{const _0x85acad=_0x338331,_0x28c3cd=formatElapsed(_0x446688);console[_0x85acad(0x184)]('\x20\x20Evaluating...\x20'+a5_0x5a9672[_0x85acad(0x169)]('✓')+'\x20('+_0x28c3cd+')');}});_0x27806c['stop'](),_0x495579[_0x338331(0x138)](_0x575a6d);if(_0x575a6d[_0x338331(0x1a3)]===_0x338331(0x143))console['log'](a5_0x5a9672['green'](_0x338331(0x164)+_0x575a6d[_0x338331(0x16c)])+a5_0x5a9672['dim'](_0x338331(0x149)));else _0x575a6d[_0x338331(0x1a3)]===_0x338331(0x115)?console[_0x338331(0x184)](a5_0x5a9672['red']('✗\x20FAIL:\x20'+_0x575a6d['reason'])+a5_0x5a9672[_0x338331(0x155)](_0x338331(0x149))):console[_0x338331(0x184)](a5_0x5a9672['red'](_0x338331(0x135)+_0x575a6d['reason']));_0x575a6d[_0x338331(0x123)]&&console[_0x338331(0x184)](a5_0x5a9672[_0x338331(0x155)](_0x338331(0x134)+_0x575a6d[_0x338331(0x123)]));}catch(_0x236dc6){_0x27806c[_0x338331(0x18d)]();const _0x374dbc=_0x236dc6 instanceof Error?_0x236dc6[_0x338331(0x133)]:String(_0x236dc6);console[_0x338331(0x184)](a5_0x5a9672[_0x338331(0x139)](_0x338331(0x135)+_0x374dbc)),_0x495579[_0x338331(0x138)]({'name':_0x39e20b[_0x338331(0x15b)],'status':_0x338331(0x148),'reason':_0x374dbc,'timestamp':new Date()[_0x338331(0x15c)](),'duration_ms':0x0});}}}console[_0x338331(0x184)]();const _0x5ad5be=Date[_0x338331(0x190)]()-_0x104401,_0x15fa54=_0x495579['filter'](_0x5e1aa3=>_0x5e1aa3[_0x338331(0x1a3)]===_0x338331(0x143))[_0x338331(0x125)],_0x5f3056=_0x495579['filter'](_0x157d14=>_0x157d14[_0x338331(0x1a3)]===_0x338331(0x115))[_0x338331(0x125)],_0x297c0c=_0x495579[_0x338331(0x126)](_0x274d55=>_0x274d55['status']===_0x338331(0x148))[_0x338331(0x125)];console[_0x338331(0x184)]('━'[_0x338331(0x14b)](0x3c)),console[_0x338331(0x184)](_0x338331(0x17f)),console[_0x338331(0x184)]('━'[_0x338331(0x14b)](0x3c)),console[_0x338331(0x184)](_0x338331(0x16b)+_0x495579[_0x338331(0x125)]),console['log'](_0x338331(0x142)+a5_0x5a9672[_0x338331(0x169)](_0x15fa54)),console['log'](_0x338331(0x17e)+a5_0x5a9672['red'](_0x5f3056));_0x297c0c>0x0&&console[_0x338331(0x184)]('Errors:\x20\x20\x20'+a5_0x5a9672[_0x338331(0x139)](_0x297c0c));console[_0x338331(0x184)](_0x338331(0x181)+formatElapsed(_0x5ad5be)),console[_0x338331(0x184)]('━'[_0x338331(0x14b)](0x3c));const _0x5828e3={'summary':{'total':_0x495579['length'],'passed':_0x15fa54,'failed':_0x5f3056,'errors':_0x297c0c>0x0?_0x297c0c:undefined,'duration_ms':_0x5ad5be},'tests':_0x495579,'agent':{'project':_0x55a050[_0x338331(0x16f)],'name':_0x55a050[_0x338331(0x153)],'site':_0x216d15},'timestamp':new Date(_0x104401)['toISOString']()};if(_0x8656f4!==_0x338331(0x18f)||_0x12c3b2){const _0x173942=formatResults(_0x5828e3,_0x8656f4);if(_0x12c3b2)try{a5_0x3d2886[_0x338331(0x187)](_0x12c3b2,_0x173942,'utf-8'),console[_0x338331(0x184)](),console[_0x338331(0x184)](a5_0x5a9672['dim'](_0x338331(0x122)+_0x12c3b2));}catch(_0x10a9cd){return console[_0x338331(0x184)](),console[_0x338331(0x184)](a5_0x5a9672['red'](_0x338331(0x152)+_0x10a9cd)),0x1;}else console['log'](),console[_0x338331(0x184)](_0x173942);}const _0x430f6b=_0x495579['filter'](_0x4729d6=>_0x4729d6[_0x338331(0x1a3)]!==_0x338331(0x143));return _0x430f6b['length']>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0xefcba=a6_0x5ca7;(function(_0x23e2b3,_0x55ef7d){const _0x2da5f5=a6_0x5ca7,_0x4b896a=_0x23e2b3();while(!![]){try{const _0x1908f0=-parseInt(_0x2da5f5(0x1ba))/0x1*(parseInt(_0x2da5f5(0x1c3))/0x2)+parseInt(_0x2da5f5(0x1b1))/0x3*(-parseInt(_0x2da5f5(0x1d7))/0x4)+-parseInt(_0x2da5f5(0x1a6))/0x5+-parseInt(_0x2da5f5(0x1b4))/0x6*(-parseInt(_0x2da5f5(0x1ca))/0x7)+-parseInt(_0x2da5f5(0x19d))/0x8*(-parseInt(_0x2da5f5(0x19a))/0x9)+parseInt(_0x2da5f5(0x1ac))/0xa*(parseInt(_0x2da5f5(0x1c8))/0xb)+parseInt(_0x2da5f5(0x1d8))/0xc*(-parseInt(_0x2da5f5(0x1d1))/0xd);if(_0x1908f0===_0x55ef7d)break;else _0x4b896a['push'](_0x4b896a['shift']());}catch(_0x4789b7){_0x4b896a['push'](_0x4b896a['shift']());}}}(a6_0x30c8,0x22ee1));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';function a6_0x30c8(){const _0x13396c=['DELETE','body','\x22.\x20','keys','description','285310HhylGi','api','join','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','header','560mVYvGF','output','POST','verbose','startsWith','80463FdmYTQ','indexOf','Invalid\x20header\x20format:\x20\x22','6ivnSdv','validate','PUT','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','cdp','3254vuVRxN','method','authorization','.\x20Valid\x20methods:\x20','log','proxy-authorization','type','trim','message','16shgzXd','readBodyFromFile','data','file','Endpoint\x20must\x20start\x20with\x20/:\x20','7502uDtXIT','substring','1143338MkASuu','set-cookie','Invalid\x20HTTP\x20method:\x20','.\x20Valid\x20types:\x20','status','execute','trino','26dHCiQJ','request','headers','includes','isArray','noColor','4yzSIGc','144636JPCFNk','entries','length','error','\x0aStack\x20trace:\x0a','stack','llm-proxy','Error:\x20','GET','toUpperCase','72aBQgHZ','site','color','75568jtnqeA','PATCH','cookie','x-trino-user'];a6_0x30c8=function(){return _0x13396c;};return a6_0x30c8();}function a6_0x5ca7(_0x5e652,_0x1f9abb){_0x5e652=_0x5e652-0x199;const _0x30c892=a6_0x30c8();let _0x5ca7ac=_0x30c892[_0x5e652];return _0x5ca7ac;}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0xefcba(0x1bc),a6_0xefcba(0x1bf),a6_0xefcba(0x19f),a6_0xefcba(0x1cb),'set-cookie2','x-xsrf-token','x-auth-token',a6_0xefcba(0x1a0)]);function isSensitiveHeader(_0x3d652a){return SENSITIVE_HEADERS['has'](_0x3d652a['toLowerCase']());}function parseHeader(_0x4f2e90){const _0x835c6f=a6_0xefcba,_0x4ef187=_0x4f2e90[_0x835c6f(0x1b2)](':');if(_0x4ef187===-0x1)throw new Error(_0x835c6f(0x1b3)+_0x4f2e90+_0x835c6f(0x1a3)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x22f1bf=_0x4f2e90[_0x835c6f(0x1c9)](0x0,_0x4ef187)[_0x835c6f(0x1c1)](),_0xea452f=_0x4f2e90[_0x835c6f(0x1c9)](_0x4ef187+0x1)[_0x835c6f(0x1c1)]();if(!_0x22f1bf)throw new Error(_0x835c6f(0x1b7)+_0x4f2e90+'\x22');return[_0x22f1bf,_0xea452f];}export class ApiCommand extends BaseCommand{['name']=a6_0xefcba(0x1a7);[a6_0xefcba(0x1a5)]=a6_0xefcba(0x1a9);[a6_0xefcba(0x1b5)](_0x5b1bd){const _0x106172=a6_0xefcba,{args:_0x457f72,options:_0x5dadb9}=_0x5b1bd,_0x4c52e2=_0x5dadb9;if(_0x457f72[_0x106172(0x1da)]===0x0)return _0x106172(0x1aa);const _0xc6e3af=_0x457f72[0x0];if(!_0xc6e3af[_0x106172(0x1b0)]('/'))return _0x106172(0x1c7)+_0xc6e3af;const _0x3fc91f=_0x4c52e2[_0x106172(0x1c5)],_0x4f25b5=_0x4c52e2[_0x106172(0x1c6)];if(_0x3fc91f&&_0x4f25b5)return _0x106172(0x1b8);const _0xb9ddb5=_0x4c52e2[_0x106172(0x1bb)]||_0x106172(0x1e0),_0x2c96ac=[_0x106172(0x1e0),_0x106172(0x1ae),_0x106172(0x1b6),_0x106172(0x1a1),_0x106172(0x19e)];if(!_0x2c96ac[_0x106172(0x1d4)](_0xb9ddb5[_0x106172(0x199)]()))return _0x106172(0x1cc)+_0xb9ddb5+_0x106172(0x1bd)+_0x2c96ac[_0x106172(0x1a8)](',\x20');const _0x5272d9=_0x4c52e2[_0x106172(0x1c0)]||'td',_0x1e71bb=['td',_0x106172(0x1b9),'workflow',_0x106172(0x1d0),'llm',_0x106172(0x1de),'cas'];if(!_0x1e71bb['includes'](_0x5272d9))return'Invalid\x20API\x20type:\x20'+_0x5272d9+_0x106172(0x1cd)+_0x1e71bb[_0x106172(0x1a8)](',\x20');return undefined;}async[a6_0xefcba(0x1cf)](_0x39f7b8){const _0x220870=a6_0xefcba,{options:_0xfeb60a,args:_0x5eb525,tdx:_0x32060b}=_0x39f7b8,_0x424dd2=_0xfeb60a,_0xa903ef=_0x5eb525[0x0],_0x5686a8=(_0x424dd2[_0x220870(0x1bb)]||_0x220870(0x1e0))[_0x220870(0x199)](),_0x3581cc=_0x424dd2[_0x220870(0x1c5)],_0x18bef6=_0x424dd2[_0x220870(0x1c6)],_0x272201=_0x424dd2[_0x220870(0x1ab)],_0x37a224=_0x424dd2['type']||'td';try{const _0x4efe26={};if(_0x272201){const _0x4303be=Array[_0x220870(0x1d5)](_0x272201)?_0x272201:[_0x272201];for(const _0x22d423 of _0x4303be){const [_0x2a1864,_0x3ca5d4]=parseHeader(_0x22d423);_0x4efe26[_0x2a1864]=_0x3ca5d4;}}let _0x11ccbb;if(_0x3581cc)_0x11ccbb=_0x3581cc;else{if(_0x18bef6)try{_0x11ccbb=RawAPI[_0x220870(0x1c4)](_0x18bef6);}catch(_0x28d0e1){return console[_0x220870(0x1db)]('Error:\x20'+(_0x28d0e1 instanceof Error?_0x28d0e1[_0x220870(0x1c2)]:String(_0x28d0e1))),0x1;}}const _0x72d73e={'method':_0x5686a8,'apiType':_0x37a224,'includeHeaders':_0xfeb60a[_0x220870(0x1af)]};_0x11ccbb&&(_0x72d73e[_0x220870(0x1a2)]=_0x11ccbb);Object[_0x220870(0x1a4)](_0x4efe26)['length']>0x0&&(_0x72d73e[_0x220870(0x1d3)]=_0x4efe26);if(_0xfeb60a[_0x220870(0x1af)]){const _0x152188=resolveSite(_0xfeb60a[_0x220870(0x19b)]),_0x5c34ca=getEndpoint(_0x152188,_0x37a224),_0x176238=''+_0x5c34ca+_0xa903ef;console[_0x220870(0x1db)]('>\x20'+_0x5686a8+'\x20'+_0x176238);const _0x29a3aa=getAuthHeaders(_0x152188),_0x19b80e={..._0x29a3aa,..._0x4efe26};for(const [_0x3ad92a,_0x9c4747]of Object[_0x220870(0x1d9)](_0x19b80e)){!isSensitiveHeader(_0x3ad92a)&&console[_0x220870(0x1db)]('>\x20'+_0x3ad92a+':\x20'+_0x9c4747);}_0x11ccbb&&console[_0x220870(0x1db)]('>'),console[_0x220870(0x1db)]('');}const _0x125444=await _0x32060b[_0x220870(0x1a7)][_0x220870(0x1d2)](_0xa903ef,_0x72d73e);if(_0xfeb60a[_0x220870(0x1af)]&&_0x125444['headers']){console[_0x220870(0x1db)]('<\x20HTTP/1.1\x20'+_0x125444[_0x220870(0x1ce)]);for(const [_0x5e46ad,_0x4213a3]of Object[_0x220870(0x1d9)](_0x125444['headers'])){!isSensitiveHeader(_0x5e46ad)&&console[_0x220870(0x1db)]('<\x20'+_0x5e46ad+':\x20'+_0x4213a3);}console[_0x220870(0x1db)]('');}const _0x2afa7e=Boolean(_0xfeb60a[_0x220870(0x1ad)]),_0x9a54e4={'color':_0xfeb60a[_0x220870(0x19c)],'noColor':_0xfeb60a[_0x220870(0x1d6)]||_0x2afa7e&&!_0xfeb60a[_0x220870(0x19c)]},_0x3ce57d=colorizeJSON(_0x125444[_0x220870(0x1c5)],_0x9a54e4);return _0xfeb60a[_0x220870(0x1ad)]?(writeFileSync(_0xfeb60a[_0x220870(0x1ad)],_0x3ce57d),console[_0x220870(0x1db)]('Results\x20saved\x20to\x20'+_0xfeb60a[_0x220870(0x1ad)])):console[_0x220870(0x1be)](_0x3ce57d),0x0;}catch(_0x36b06e){return _0x36b06e instanceof Error?(console['error'](_0x220870(0x1df)+_0x36b06e[_0x220870(0x1c2)]),_0xfeb60a[_0x220870(0x1af)]&&_0x36b06e[_0x220870(0x1dd)]&&console[_0x220870(0x1db)](_0x220870(0x1dc)+_0x36b06e[_0x220870(0x1dd)])):console[_0x220870(0x1db)](_0x220870(0x1df)+String(_0x36b06e)),0x1;}}}
1
+ const a6_0x1d93c4=a6_0x3077;(function(_0x38e43b,_0x18889d){const _0x3f6595=a6_0x3077,_0x2e8c17=_0x38e43b();while(!![]){try{const _0x302206=-parseInt(_0x3f6595(0x1a1))/0x1+parseInt(_0x3f6595(0x1b0))/0x2*(parseInt(_0x3f6595(0x191))/0x3)+parseInt(_0x3f6595(0x1c8))/0x4+parseInt(_0x3f6595(0x19d))/0x5*(parseInt(_0x3f6595(0x18f))/0x6)+-parseInt(_0x3f6595(0x1bb))/0x7*(parseInt(_0x3f6595(0x1c2))/0x8)+parseInt(_0x3f6595(0x1b8))/0x9+parseInt(_0x3f6595(0x1b7))/0xa;if(_0x302206===_0x18889d)break;else _0x2e8c17['push'](_0x2e8c17['shift']());}catch(_0x490dfc){_0x2e8c17['push'](_0x2e8c17['shift']());}}}(a6_0x5b41,0x6a3e5));import{BaseCommand}from'./command.js';function a6_0x3077(_0x3638b0,_0x28e24e){_0x3638b0=_0x3638b0-0x18b;const _0x5b41de=a6_0x5b41();let _0x3077fc=_0x5b41de[_0x3638b0];return _0x3077fc;}import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';function a6_0x5b41(){const _0xafefe5=['api','join','method','POST','substring','entries','cdp','stack','noColor','50045kgGLvk','workflow','.\x20Valid\x20types:\x20','GET','295183vRVpod','x-xsrf-token','output','error','Endpoint\x20must\x20start\x20with\x20/:\x20','data','trim','Error:\x20','name','.\x20Valid\x20methods:\x20','execute','PATCH','verbose','file','cas','6218cOVjMC','\x22.\x20','request','Invalid\x20header\x20format:\x20\x22','log','description','message','508240gEFvTs','4197393AnIdlK','headers','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','294ztKGmc','length','toUpperCase','color','llm-proxy','keys','body','143552qATsws','includes','header','cookie','Invalid\x20API\x20type:\x20','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','1886596CbEhrU','Invalid\x20HTTP\x20method:\x20','set-cookie2','llm','trino','authorization','x-auth-token','PUT','\x0aStack\x20trace:\x0a','DELETE','status','Results\x20saved\x20to\x20','indexOf','has','144WhwzxZ','type','246hhIVav','site','validate'];a6_0x5b41=function(){return _0xafefe5;};return a6_0x5b41();}import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x1d93c4(0x1cd),'proxy-authorization',a6_0x1d93c4(0x1c5),'set-cookie',a6_0x1d93c4(0x1ca),a6_0x1d93c4(0x1a2),a6_0x1d93c4(0x1ce),'x-trino-user']);function isSensitiveHeader(_0x2dd6f2){const _0x15a1f1=a6_0x1d93c4;return SENSITIVE_HEADERS[_0x15a1f1(0x18e)](_0x2dd6f2['toLowerCase']());}function parseHeader(_0x26286c){const _0x275b62=a6_0x1d93c4,_0xf00d08=_0x26286c[_0x275b62(0x18d)](':');if(_0xf00d08===-0x1)throw new Error(_0x275b62(0x1b3)+_0x26286c+_0x275b62(0x1b1)+_0x275b62(0x1ba));const _0x15a93c=_0x26286c[_0x275b62(0x198)](0x0,_0xf00d08)['trim'](),_0x4af59d=_0x26286c['substring'](_0xf00d08+0x1)[_0x275b62(0x1a7)]();if(!_0x15a93c)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x26286c+'\x22');return[_0x15a93c,_0x4af59d];}export class ApiCommand extends BaseCommand{[a6_0x1d93c4(0x1a9)]=a6_0x1d93c4(0x194);[a6_0x1d93c4(0x1b5)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x1d93c4(0x193)](_0x2cef2f){const _0x5ad92d=a6_0x1d93c4,{args:_0x1fcf5c,options:_0x309571}=_0x2cef2f,_0x466ec0=_0x309571;if(_0x1fcf5c[_0x5ad92d(0x1bc)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x5d5c83=_0x1fcf5c[0x0];if(!_0x5d5c83['startsWith']('/'))return _0x5ad92d(0x1a5)+_0x5d5c83;const _0x22390c=_0x466ec0[_0x5ad92d(0x1a6)],_0x2d0486=_0x466ec0['file'];if(_0x22390c&&_0x2d0486)return _0x5ad92d(0x1c7);const _0x289e6d=_0x466ec0[_0x5ad92d(0x196)]||_0x5ad92d(0x1a0),_0x39682f=['GET',_0x5ad92d(0x197),_0x5ad92d(0x1cf),_0x5ad92d(0x1d1),_0x5ad92d(0x1ac)];if(!_0x39682f['includes'](_0x289e6d[_0x5ad92d(0x1bd)]()))return _0x5ad92d(0x1c9)+_0x289e6d+_0x5ad92d(0x1aa)+_0x39682f[_0x5ad92d(0x195)](',\x20');const _0x27dea3=_0x466ec0[_0x5ad92d(0x190)]||'td',_0x1fb6a6=['td',_0x5ad92d(0x19a),_0x5ad92d(0x19e),_0x5ad92d(0x1cc),_0x5ad92d(0x1cb),_0x5ad92d(0x1bf),_0x5ad92d(0x1af)];if(!_0x1fb6a6[_0x5ad92d(0x1c3)](_0x27dea3))return _0x5ad92d(0x1c6)+_0x27dea3+_0x5ad92d(0x19f)+_0x1fb6a6[_0x5ad92d(0x195)](',\x20');return undefined;}async[a6_0x1d93c4(0x1ab)](_0x1ccd00){const _0x19674a=a6_0x1d93c4,{options:_0x3d9c48,args:_0x478f0e,tdx:_0x3910a6}=_0x1ccd00,_0x4027de=_0x3d9c48,_0x21ff69=_0x478f0e[0x0],_0x2b0312=(_0x4027de[_0x19674a(0x196)]||_0x19674a(0x1a0))['toUpperCase'](),_0x28d023=_0x4027de[_0x19674a(0x1a6)],_0x211055=_0x4027de[_0x19674a(0x1ae)],_0x41a11e=_0x4027de[_0x19674a(0x1c4)],_0x313ee7=_0x4027de[_0x19674a(0x190)]||'td';try{const _0x2cf1ae={};if(_0x41a11e){const _0x549578=Array['isArray'](_0x41a11e)?_0x41a11e:[_0x41a11e];for(const _0x164f0a of _0x549578){const [_0x395499,_0x237633]=parseHeader(_0x164f0a);_0x2cf1ae[_0x395499]=_0x237633;}}let _0x55aae9;if(_0x28d023)_0x55aae9=_0x28d023;else{if(_0x211055)try{_0x55aae9=RawAPI['readBodyFromFile'](_0x211055);}catch(_0x5f47fe){return console[_0x19674a(0x1a4)](_0x19674a(0x1a8)+(_0x5f47fe instanceof Error?_0x5f47fe[_0x19674a(0x1b6)]:String(_0x5f47fe))),0x1;}}const _0x3f3b8d={'method':_0x2b0312,'apiType':_0x313ee7,'includeHeaders':_0x3d9c48['verbose']};_0x55aae9&&(_0x3f3b8d[_0x19674a(0x1c1)]=_0x55aae9);Object[_0x19674a(0x1c0)](_0x2cf1ae)[_0x19674a(0x1bc)]>0x0&&(_0x3f3b8d[_0x19674a(0x1b9)]=_0x2cf1ae);if(_0x3d9c48[_0x19674a(0x1ad)]){const _0x2bd153=resolveSite(_0x3d9c48[_0x19674a(0x192)]),_0x429167=getEndpoint(_0x2bd153,_0x313ee7),_0x1e0df5=''+_0x429167+_0x21ff69;console[_0x19674a(0x1a4)]('>\x20'+_0x2b0312+'\x20'+_0x1e0df5);const _0x3d9a7d=getAuthHeaders(_0x2bd153),_0x48230c={..._0x3d9a7d,..._0x2cf1ae};for(const [_0x405843,_0x2dad9c]of Object['entries'](_0x48230c)){!isSensitiveHeader(_0x405843)&&console['error']('>\x20'+_0x405843+':\x20'+_0x2dad9c);}_0x55aae9&&console[_0x19674a(0x1a4)]('>'),console['error']('');}const _0x6b63f7=await _0x3910a6['api'][_0x19674a(0x1b2)](_0x21ff69,_0x3f3b8d);if(_0x3d9c48[_0x19674a(0x1ad)]&&_0x6b63f7[_0x19674a(0x1b9)]){console[_0x19674a(0x1a4)]('<\x20HTTP/1.1\x20'+_0x6b63f7[_0x19674a(0x18b)]);for(const [_0x55255f,_0x56d6d2]of Object[_0x19674a(0x199)](_0x6b63f7[_0x19674a(0x1b9)])){!isSensitiveHeader(_0x55255f)&&console[_0x19674a(0x1a4)]('<\x20'+_0x55255f+':\x20'+_0x56d6d2);}console[_0x19674a(0x1a4)]('');}const _0x58fd33=Boolean(_0x3d9c48['output']),_0x888aba={'color':_0x3d9c48['color'],'noColor':_0x3d9c48[_0x19674a(0x19c)]||_0x58fd33&&!_0x3d9c48[_0x19674a(0x1be)]},_0xbb46f0=colorizeJSON(_0x6b63f7[_0x19674a(0x1a6)],_0x888aba);return _0x3d9c48[_0x19674a(0x1a3)]?(writeFileSync(_0x3d9c48[_0x19674a(0x1a3)],_0xbb46f0),console[_0x19674a(0x1a4)](_0x19674a(0x18c)+_0x3d9c48['output'])):console[_0x19674a(0x1b4)](_0xbb46f0),0x0;}catch(_0x1f2c28){return _0x1f2c28 instanceof Error?(console[_0x19674a(0x1a4)]('Error:\x20'+_0x1f2c28[_0x19674a(0x1b6)]),_0x3d9c48[_0x19674a(0x1ad)]&&_0x1f2c28[_0x19674a(0x19b)]&&console[_0x19674a(0x1a4)](_0x19674a(0x1d0)+_0x1f2c28[_0x19674a(0x19b)])):console['error'](_0x19674a(0x1a8)+String(_0x1f2c28)),0x1;}}}
@@ -1 +1 @@
1
- function a7_0x319e(_0x3b0769,_0x568ea4){_0x3b0769=_0x3b0769-0x11d;const _0x375790=a7_0x3757();let _0x319edf=_0x375790[_0x3b0769];return _0x319edf;}const a7_0x79c795=a7_0x319e;(function(_0x1ff869,_0x115f55){const _0x4188fa=a7_0x319e,_0x1f2c17=_0x1ff869();while(!![]){try{const _0x336e05=parseInt(_0x4188fa(0x123))/0x1+parseInt(_0x4188fa(0x14c))/0x2*(-parseInt(_0x4188fa(0x133))/0x3)+parseInt(_0x4188fa(0x169))/0x4*(parseInt(_0x4188fa(0x151))/0x5)+-parseInt(_0x4188fa(0x15f))/0x6+-parseInt(_0x4188fa(0x125))/0x7+-parseInt(_0x4188fa(0x154))/0x8*(-parseInt(_0x4188fa(0x157))/0x9)+parseInt(_0x4188fa(0x15e))/0xa;if(_0x336e05===_0x115f55)break;else _0x1f2c17['push'](_0x1f2c17['shift']());}catch(_0x1794fe){_0x1f2c17['push'](_0x1f2c17['shift']());}}}(a7_0x3757,0xee021));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}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_0x3757(){const _0x31b361=['profile','API\x20key','bold','message','78115ZHuNqK','\x20for\x20profile:\x20','all','1992ultVzg','✓\x20Authentication\x20successful\x0a','\x20and\x20','69903IObteV','Read\x20credential\x20from\x20keychain','\x20--profile\x20','yellow','apikey','create','filter','8425020wTqtis','11509182qFSGKr','site','jobs','Name:\x20','✗\x20Validation\x20failed:\x20','warn','\x20(site:\x20','Setting\x20up\x20authentication\x20for\x20site:\x20','ERROR','User:\x20','4yMXVby','/app/mp/ak','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','\x20\x20tdx','status','us01','join','getUserInfo','1233370DbkBir','description','7287812JFdgqO','oauth','Enter\x20your\x20TD\x20API\x20key:','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','✓\x20Default\x20site\x20set\x20to\x20','email','method','tdx:\x20auth\x20clear','API\x20key\x20cannot\x20be\x20empty','\x0aSetup\x20cancelled','first_name','log','apiKey','execute','91284IuHpzn','password','name','auth','\x20removed\x20from\x20keychain','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','✓\x20Profile\x20\x27','Setup\x20cancelled','red','green','trim','No\x20credential\x20found','You\x20can\x20find\x20your\x20API\x20key\x20at:','OAuth\x20(browser\x20login)','Remove\x20API\x20key\x20from\x20system\x20keychain','\x20(profile:\x20','Choose\x20authentication\x20method:','N/A','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','Validating\x20API\x20key...','No\x20credentials\x20found\x20in\x20keychain','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','logLevel','last_name','error','6Llybzb'];a7_0x3757=function(){return _0x31b361;};return a7_0x3757();}import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x46a943 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_0x142e9d from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x79c795(0x135)]='auth:setup';['description']='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x79c795(0x132)](_0xa4fcaa){const _0x16c6f5=a7_0x79c795,{options:_0x123027}=_0xa4fcaa,_0x2d94a5=_0x123027['profile'];console[_0x16c6f5(0x130)](a7_0x142e9d[_0x16c6f5(0x14f)]('tdx:\x20auth\x20setup'));const _0x316e26=_0x123027[_0x16c6f5(0x160)]||_0x16c6f5(0x120),_0x3e2a54=await promptSiteSelection(_0x316e26,_0x2d94a5,_0x16c6f5(0x13a));if(!_0x3e2a54)return 0x1;const _0x48cc04=resolveSite(_0x3e2a54);if(isOAuthSupported(_0x48cc04)){const _0xf933d1=await a7_0x46a943({'type':'select','name':'method','message':_0x16c6f5(0x143),'choices':[{'title':_0x16c6f5(0x140),'value':_0x16c6f5(0x126)},{'title':'API\x20Key','value':_0x16c6f5(0x15b)}]});if(!_0xf933d1[_0x16c6f5(0x12b)])return console[_0x16c6f5(0x130)](_0x16c6f5(0x12e)),0x1;if(_0xf933d1[_0x16c6f5(0x12b)]===_0x16c6f5(0x126))return await runOAuthLoginFlow(_0x48cc04,_0x2d94a5,_0x123027['logLevel']??LogLevel[_0x16c6f5(0x167)]),0x0;}console[_0x16c6f5(0x130)](_0x16c6f5(0x166)+_0x48cc04),console[_0x16c6f5(0x130)](_0x16c6f5(0x13f)),console['log']('\x20\x20'+getConsoleUrl(_0x48cc04,_0x16c6f5(0x16a)));const _0x23290b=await a7_0x46a943({'type':_0x16c6f5(0x134),'name':_0x16c6f5(0x131),'message':_0x16c6f5(0x127),'validate':_0x2f17a8=>{const _0x431198=_0x16c6f5;if(!_0x2f17a8||!_0x2f17a8['trim']())return _0x431198(0x12d);return!![];}});if(!_0x23290b['apiKey'])return console[_0x16c6f5(0x130)](_0x16c6f5(0x12e)),0x1;const _0x2bb515=_0x23290b[_0x16c6f5(0x131)];console[_0x16c6f5(0x130)](_0x16c6f5(0x146));try{const _0x5d840a=TDX[_0x16c6f5(0x15c)]({'site':_0x48cc04,'apiKey':_0x2bb515[_0x16c6f5(0x13d)](),'logLevel':_0x123027[_0x16c6f5(0x149)]??LogLevel[_0x16c6f5(0x167)]}),_0x2ba6cb=await _0x5d840a[_0x16c6f5(0x161)]['getUserInfo']();console[_0x16c6f5(0x130)](_0x16c6f5(0x148)+_0x2ba6cb['email']+')');const _0x66c229=await isKeychainAvailable();_0x66c229?(await saveAPIKeyAsync(_0x2bb515['trim'](),_0x48cc04,_0x2d94a5),console[_0x16c6f5(0x130)](_0x16c6f5(0x145)+(_0x2d94a5?'\x20(profile:\x20'+_0x2d94a5+')':''))):(console['warn'](a7_0x142e9d[_0x16c6f5(0x15a)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x16c6f5(0x164)](a7_0x142e9d[_0x16c6f5(0x15a)](_0x16c6f5(0x128))));if(_0x2d94a5){const _0x2c21b3={'site':_0x48cc04};saveProfileToUserConfig(_0x2d94a5,_0x2c21b3),console[_0x16c6f5(0x130)](_0x16c6f5(0x139)+_0x2d94a5+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x48cc04),console[_0x16c6f5(0x130)](_0x16c6f5(0x129)+_0x48cc04);const _0x37f3da=_0x2d94a5?_0x16c6f5(0x159)+_0x2d94a5:'';return console[_0x16c6f5(0x130)](),console[_0x16c6f5(0x130)](_0x16c6f5(0x11d)),console['log'](_0x16c6f5(0x11e)+_0x37f3da+_0x16c6f5(0x138)),console['log'](_0x16c6f5(0x11e)+_0x37f3da+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x47b17a){if(_0x47b17a instanceof HTTPClientError&&_0x47b17a['status']===0x191)return printAuthError(_0x47b17a),0x1;return console[_0x16c6f5(0x14b)](a7_0x142e9d[_0x16c6f5(0x13b)]('✗\x20Validation\x20failed:\x20'+(_0x47b17a instanceof Error?_0x47b17a[_0x16c6f5(0x150)]:String(_0x47b17a)))),console[_0x16c6f5(0x14b)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x79c795(0x135)]=a7_0x79c795(0x136);[a7_0x79c795(0x124)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async['execute'](_0x46608c){const _0x58553f=a7_0x79c795,{options:_0x217236,tdx:_0x4368fc}=_0x46608c,_0x1f5d54=_0x217236[_0x58553f(0x160)],_0x2b74af=_0x217236[_0x58553f(0x14d)],_0x48d561=_0x2b74af?_0x2b74af:_0x58553f(0x144);console[_0x58553f(0x130)]('tdx\x20profile:\x20'+_0x48d561+_0x58553f(0x165)+_0x1f5d54+')');const _0x4bee05=await getOAuthTokens(_0x2b74af);if(_0x4bee05)console[_0x58553f(0x130)]('Credential\x20type:\x20OAuth'),console[_0x58553f(0x130)](_0x58553f(0x158)+(_0x2b74af?_0x58553f(0x142)+_0x2b74af+')':''));else{const _0x30d59b=await resolveAPIKeyAsync(_0x1f5d54,_0x2b74af);if(_0x30d59b){const {source:_0x27cbd9,isDeprecated:_0x19122e}=_0x30d59b,_0x4466d9='Read\x20credential\x20from\x20'+_0x27cbd9;console['log'](_0x19122e?a7_0x142e9d[_0x58553f(0x15a)](_0x4466d9):_0x4466d9);}else console[_0x58553f(0x130)](a7_0x142e9d['yellow'](_0x58553f(0x13e)));}try{const _0x46ff47=await _0x4368fc['jobs'][_0x58553f(0x122)]();return console[_0x58553f(0x130)](a7_0x142e9d[_0x58553f(0x13c)](_0x58553f(0x155))),console[_0x58553f(0x130)](_0x58553f(0x168)+_0x46ff47[_0x58553f(0x12a)]),(_0x46ff47[_0x58553f(0x12f)]||_0x46ff47['last_name'])&&console['log'](_0x58553f(0x162)+[_0x46ff47[_0x58553f(0x12f)],_0x46ff47[_0x58553f(0x14a)]][_0x58553f(0x15d)](Boolean)[_0x58553f(0x121)]('\x20')),0x0;}catch(_0x5d9758){return _0x5d9758 instanceof HTTPClientError&&_0x5d9758[_0x58553f(0x11f)]===0x191?printAuthError(_0x5d9758,!![],_0x2b74af):console[_0x58553f(0x14b)](a7_0x142e9d[_0x58553f(0x13b)](_0x58553f(0x163)+(_0x5d9758 instanceof Error?_0x5d9758['message']:String(_0x5d9758)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x79c795(0x135)]='auth:clear';[a7_0x79c795(0x124)]=a7_0x79c795(0x141);async[a7_0x79c795(0x132)](_0x3b7505){const _0x4fb6a3=a7_0x79c795,{options:_0x4323ca}=_0x3b7505,_0x13706f=_0x4323ca[_0x4fb6a3(0x14d)];console[_0x4fb6a3(0x130)](a7_0x142e9d[_0x4fb6a3(0x14f)](_0x4fb6a3(0x12c)));const _0x3a4dfb=await isKeychainAvailable();if(!_0x3a4dfb)return console['error'](a7_0x142e9d[_0x4fb6a3(0x13b)]('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x447c1c,_0x5da999]=await Promise[_0x4fb6a3(0x153)]([deleteKeychainAPIKey(_0x13706f),deleteOAuthTokens(_0x13706f)]);if(_0x447c1c||_0x5da999){clearCredentialCache();const _0xe7f742=[_0x447c1c&&_0x4fb6a3(0x14e),_0x5da999&&'OAuth\x20tokens'][_0x4fb6a3(0x15d)](Boolean)[_0x4fb6a3(0x121)](_0x4fb6a3(0x156));return console[_0x4fb6a3(0x130)]('✓\x20'+_0xe7f742+_0x4fb6a3(0x137)+(_0x13706f?_0x4fb6a3(0x142)+_0x13706f+')':'')),0x0;}else return console[_0x4fb6a3(0x130)](_0x4fb6a3(0x147)+(_0x13706f?_0x4fb6a3(0x152)+_0x13706f:'')),0x1;}}
1
+ const a7_0x72534e=a7_0x4d92;(function(_0x2f9d27,_0x110a75){const _0x31e45e=a7_0x4d92,_0x4a2967=_0x2f9d27();while(!![]){try{const _0x38052c=parseInt(_0x31e45e(0xd5))/0x1*(parseInt(_0x31e45e(0xea))/0x2)+-parseInt(_0x31e45e(0xe1))/0x3*(parseInt(_0x31e45e(0xee))/0x4)+parseInt(_0x31e45e(0xdb))/0x5+-parseInt(_0x31e45e(0xf1))/0x6+parseInt(_0x31e45e(0xcc))/0x7*(-parseInt(_0x31e45e(0xfd))/0x8)+parseInt(_0x31e45e(0xd8))/0x9*(-parseInt(_0x31e45e(0xf5))/0xa)+-parseInt(_0x31e45e(0xf7))/0xb;if(_0x38052c===_0x110a75)break;else _0x4a2967['push'](_0x4a2967['shift']());}catch(_0x2466f7){_0x4a2967['push'](_0x4a2967['shift']());}}}(a7_0x1e02,0x8ee37));import{BaseCommand,printAuthError}from'./command.js';function a7_0x1e02(){const _0x48c17b=['getUserInfo','Name:\x20','30xADjgd','Choose\x20authentication\x20method:','2405722QYSZdO','OAuth\x20tokens','password','✓\x20Authentication\x20successful\x0a','✗\x20Validation\x20failed:\x20','logLevel','28192TSTzKw','last_name','Remove\x20API\x20key\x20from\x20system\x20keychain','status','\x20removed\x20from\x20keychain','first_name','tdx:\x20auth\x20setup','join','apikey','filter','log','auth:clear','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','System\x20keychain\x20is\x20not\x20available','red','all','apiKey','auth:setup','Setup\x20API\x20key\x20authentication\x20interactively','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','method','You\x20can\x20find\x20your\x20API\x20key\x20at:','ERROR','auth','trim','Read\x20credential\x20from\x20','yellow','Credential\x20type:\x20OAuth','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','\x20--profile\x20','execute','791GhltjX','\x20\x20tdx','Validating\x20API\x20key...','profile','tdx:\x20auth\x20clear','\x20(profile:\x20','Read\x20credential\x20from\x20keychain','\x27\x20registered','warn','5CSdoZf','message','\x0aSetup\x20cancelled','309609QNBNYp','/app/mp/ak','us01','5736660CZhlQg','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','error','\x20and\x20','bold','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','267183ocRypf','Setting\x20up\x20authentication\x20for\x20site:\x20','API\x20key\x20cannot\x20be\x20empty','jobs','green','N/A','name','Setup\x20cancelled','\x20(site:\x20','453046nFtoop','User:\x20','description','✓\x20Profile\x20\x27','4YoqHOd','site','No\x20credentials\x20found\x20in\x20keychain','5312988AtgqkR','Enter\x20your\x20TD\x20API\x20key:'];a7_0x1e02=function(){return _0x48c17b;};return a7_0x1e02();}import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a7_0x4d92(_0x5bded1,_0x4261a2){_0x5bded1=_0x5bded1-0xaf;const _0x1e02fd=a7_0x1e02();let _0x4d9212=_0x1e02fd[_0x5bded1];return _0x4d9212;}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x578d53 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_0x38b4c8 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x72534e(0xe7)]=a7_0x72534e(0xbe);['description']=a7_0x72534e(0xbf);async['execute'](_0x185973){const _0x34c75e=a7_0x72534e,{options:_0x117693}=_0x185973,_0x5a242a=_0x117693[_0x34c75e(0xcf)];console[_0x34c75e(0xb6)](a7_0x38b4c8[_0x34c75e(0xdf)](_0x34c75e(0xb2)));const _0x36fc51=_0x117693[_0x34c75e(0xef)]||_0x34c75e(0xda),_0x53f87e=await promptSiteSelection(_0x36fc51,_0x5a242a,_0x34c75e(0xe8));if(!_0x53f87e)return 0x1;const _0x820e05=resolveSite(_0x53f87e);if(isOAuthSupported(_0x820e05)){const _0x4c8cc=await a7_0x578d53({'type':'select','name':_0x34c75e(0xc1),'message':_0x34c75e(0xf6),'choices':[{'title':'OAuth\x20(browser\x20login)','value':'oauth'},{'title':'API\x20Key','value':_0x34c75e(0xb4)}]});if(!_0x4c8cc[_0x34c75e(0xc1)])return console['log'](_0x34c75e(0xd7)),0x1;if(_0x4c8cc[_0x34c75e(0xc1)]==='oauth')return await runOAuthLoginFlow(_0x820e05,_0x5a242a,_0x117693[_0x34c75e(0xfc)]??LogLevel[_0x34c75e(0xc3)]),0x0;}console['log'](_0x34c75e(0xe2)+_0x820e05),console[_0x34c75e(0xb6)](_0x34c75e(0xc2)),console['log']('\x20\x20'+getConsoleUrl(_0x820e05,_0x34c75e(0xd9)));const _0x596af5=await a7_0x578d53({'type':_0x34c75e(0xf9),'name':_0x34c75e(0xbd),'message':_0x34c75e(0xf2),'validate':_0x59ee1c=>{const _0x3d7e3b=_0x34c75e;if(!_0x59ee1c||!_0x59ee1c[_0x3d7e3b(0xc5)]())return _0x3d7e3b(0xe3);return!![];}});if(!_0x596af5['apiKey'])return console[_0x34c75e(0xb6)](_0x34c75e(0xd7)),0x1;const _0x2ad081=_0x596af5[_0x34c75e(0xbd)];console[_0x34c75e(0xb6)](_0x34c75e(0xce));try{const _0x2bac77=TDX['create']({'site':_0x820e05,'apiKey':_0x2ad081[_0x34c75e(0xc5)](),'logLevel':_0x117693[_0x34c75e(0xfc)]??LogLevel['ERROR']}),_0x34555c=await _0x2bac77['jobs'][_0x34c75e(0xf3)]();console[_0x34c75e(0xb6)](_0x34c75e(0xe0)+_0x34555c['email']+')');const _0x552e3a=await isKeychainAvailable();_0x552e3a?(await saveAPIKeyAsync(_0x2ad081[_0x34c75e(0xc5)](),_0x820e05,_0x5a242a),console[_0x34c75e(0xb6)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x5a242a?'\x20(profile:\x20'+_0x5a242a+')':''))):(console[_0x34c75e(0xd4)](a7_0x38b4c8[_0x34c75e(0xc7)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x34c75e(0xd4)](a7_0x38b4c8['yellow'](_0x34c75e(0xc9))));if(_0x5a242a){const _0x373eb2={'site':_0x820e05};saveProfileToUserConfig(_0x5a242a,_0x373eb2),console[_0x34c75e(0xb6)](_0x34c75e(0xed)+_0x5a242a+_0x34c75e(0xd3));}else saveDefaultSiteToUserConfig(_0x820e05),console['log']('✓\x20Default\x20site\x20set\x20to\x20'+_0x820e05);const _0x304fa6=_0x5a242a?_0x34c75e(0xca)+_0x5a242a:'';return console['log'](),console[_0x34c75e(0xb6)](_0x34c75e(0xdc)),console['log'](_0x34c75e(0xcd)+_0x304fa6+_0x34c75e(0xc0)),console[_0x34c75e(0xb6)]('\x20\x20tdx'+_0x304fa6+_0x34c75e(0xb8)),0x0;}catch(_0x1f455c){if(_0x1f455c instanceof HTTPClientError&&_0x1f455c['status']===0x191)return printAuthError(_0x1f455c),0x1;return console[_0x34c75e(0xdd)](a7_0x38b4c8['red'](_0x34c75e(0xfb)+(_0x1f455c instanceof Error?_0x1f455c[_0x34c75e(0xd6)]:String(_0x1f455c)))),console[_0x34c75e(0xdd)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x72534e(0xe7)]=a7_0x72534e(0xc4);[a7_0x72534e(0xec)]=a7_0x72534e(0xb9);async[a7_0x72534e(0xcb)](_0x4a1c37){const _0x5f3e7e=a7_0x72534e,{options:_0x802723,tdx:_0x594531}=_0x4a1c37,_0x1b79c8=_0x802723['site'],_0xb5428c=_0x802723[_0x5f3e7e(0xcf)],_0x27c5df=_0xb5428c?_0xb5428c:_0x5f3e7e(0xe6);console[_0x5f3e7e(0xb6)]('tdx\x20profile:\x20'+_0x27c5df+_0x5f3e7e(0xe9)+_0x1b79c8+')');const _0x52f79d=await getOAuthTokens(_0xb5428c);if(_0x52f79d)console['log'](_0x5f3e7e(0xc8)),console[_0x5f3e7e(0xb6)](_0x5f3e7e(0xd2)+(_0xb5428c?_0x5f3e7e(0xd1)+_0xb5428c+')':''));else{const _0x245c00=await resolveAPIKeyAsync(_0x1b79c8,_0xb5428c);if(_0x245c00){const {source:_0x49f166,isDeprecated:_0x2cff20}=_0x245c00,_0x479837=_0x5f3e7e(0xc6)+_0x49f166;console[_0x5f3e7e(0xb6)](_0x2cff20?a7_0x38b4c8['yellow'](_0x479837):_0x479837);}else console[_0x5f3e7e(0xb6)](a7_0x38b4c8[_0x5f3e7e(0xc7)]('No\x20credential\x20found'));}try{const _0x55e9e=await _0x594531[_0x5f3e7e(0xe4)][_0x5f3e7e(0xf3)]();return console[_0x5f3e7e(0xb6)](a7_0x38b4c8[_0x5f3e7e(0xe5)](_0x5f3e7e(0xfa))),console[_0x5f3e7e(0xb6)](_0x5f3e7e(0xeb)+_0x55e9e['email']),(_0x55e9e[_0x5f3e7e(0xb1)]||_0x55e9e[_0x5f3e7e(0xfe)])&&console[_0x5f3e7e(0xb6)](_0x5f3e7e(0xf4)+[_0x55e9e[_0x5f3e7e(0xb1)],_0x55e9e[_0x5f3e7e(0xfe)]][_0x5f3e7e(0xb5)](Boolean)[_0x5f3e7e(0xb3)]('\x20')),0x0;}catch(_0x408446){return _0x408446 instanceof HTTPClientError&&_0x408446[_0x5f3e7e(0xaf)]===0x191?printAuthError(_0x408446,!![],_0xb5428c):console[_0x5f3e7e(0xdd)](a7_0x38b4c8[_0x5f3e7e(0xbb)](_0x5f3e7e(0xfb)+(_0x408446 instanceof Error?_0x408446[_0x5f3e7e(0xd6)]:String(_0x408446)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x72534e(0xe7)]=a7_0x72534e(0xb7);[a7_0x72534e(0xec)]=a7_0x72534e(0xff);async[a7_0x72534e(0xcb)](_0xf3bb2){const _0x27b834=a7_0x72534e,{options:_0x2b67ff}=_0xf3bb2,_0x51aef6=_0x2b67ff[_0x27b834(0xcf)];console[_0x27b834(0xb6)](a7_0x38b4c8[_0x27b834(0xdf)](_0x27b834(0xd0)));const _0x2e4f5e=await isKeychainAvailable();if(!_0x2e4f5e)return console[_0x27b834(0xdd)](a7_0x38b4c8[_0x27b834(0xbb)](_0x27b834(0xba))),0x1;const [_0x4612df,_0x58bf18]=await Promise[_0x27b834(0xbc)]([deleteKeychainAPIKey(_0x51aef6),deleteOAuthTokens(_0x51aef6)]);if(_0x4612df||_0x58bf18){clearCredentialCache();const _0x3d636f=[_0x4612df&&'API\x20key',_0x58bf18&&_0x27b834(0xf8)]['filter'](Boolean)[_0x27b834(0xb3)](_0x27b834(0xde));return console[_0x27b834(0xb6)]('✓\x20'+_0x3d636f+_0x27b834(0xb0)+(_0x51aef6?'\x20(profile:\x20'+_0x51aef6+')':'')),0x0;}else return console[_0x27b834(0xb6)](_0x27b834(0xf0)+(_0x51aef6?'\x20for\x20profile:\x20'+_0x51aef6:'')),0x1;}}
@@ -1 +1 @@
1
- const a8_0x439616=a8_0x2534;(function(_0x53bc03,_0x63f5b7){const _0x4e798b=a8_0x2534,_0x188cfa=_0x53bc03();while(!![]){try{const _0x5e6369=-parseInt(_0x4e798b(0x1ec))/0x1*(parseInt(_0x4e798b(0x1ed))/0x2)+-parseInt(_0x4e798b(0x1e8))/0x3+parseInt(_0x4e798b(0x1ee))/0x4*(parseInt(_0x4e798b(0x209))/0x5)+-parseInt(_0x4e798b(0x1fd))/0x6*(-parseInt(_0x4e798b(0x1ef))/0x7)+parseInt(_0x4e798b(0x20e))/0x8+parseInt(_0x4e798b(0x20c))/0x9*(-parseInt(_0x4e798b(0x208))/0xa)+-parseInt(_0x4e798b(0x1f1))/0xb;if(_0x5e6369===_0x63f5b7)break;else _0x188cfa['push'](_0x188cfa['shift']());}catch(_0x320a7c){_0x188cfa['push'](_0x188cfa['shift']());}}}(a8_0x389c,0x28ba6));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{isKeychainAvailable}from'../core/keychain.js';import{saveOAuthTokens}from'../core/oauth-keychain.js';import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import{TDX}from'../sdk/index.js';function a8_0x389c(){const _0xc54445=['create','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','365211VrTrTQ','getUserInfo','2608984UXoKcf','email','434244VzrQmb','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','bold','logLevel','5ziLjVW','54176MmUolr','288916FFeLAf','1741159sWPbqy','tdx:\x20auth\x20login','665324VEjFoX','name','✓\x20Authentication\x20successful\x20(User:\x20','site','\x20\x20tdx','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','green','log','ERROR','\x20--profile\x20','description','Validating\x20OAuth\x20tokens...','6CDuDLN','execute','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','us01','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','Login\x20cancelled','profile','\x20(profile:\x20','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','Opening\x20browser\x20for\x20authentication...','Login\x20via\x20OAuth\x20(opens\x20browser)','70wTfgRw','15hAVYHX'];a8_0x389c=function(){return _0xc54445;};return a8_0x389c();}import{LogLevel}from'../utils/tdx-logger.js';import a8_0xc862e6 from'chalk';export async function runOAuthLoginFlow(_0x42640d,_0x60c6c7,_0x4985e5){const _0x52e75f=a8_0x2534;if(!isOAuthSupported(_0x42640d))throw new Error('OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20'+_0x42640d+'.\x20'+_0x52e75f(0x205)+_0x52e75f(0x201));const _0x58606a=await isKeychainAvailable();if(!_0x58606a)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+_0x52e75f(0x201));const _0x3b1e30=getConsoleUrl(_0x42640d);console[_0x52e75f(0x1f8)](_0x52e75f(0x206)),console['log']('\x20\x20'+_0x3b1e30+'/oauth/authorize'),console['log']('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0x13a1c9=await startOAuthFlow(_0x42640d);console[_0x52e75f(0x1f8)](_0x52e75f(0x1fc));const _0x2cdea6=TDX[_0x52e75f(0x20a)]({'site':_0x42640d,'accessToken':_0x13a1c9['access_token'],'logLevel':_0x4985e5??LogLevel[_0x52e75f(0x1f9)]}),_0x58e789=await _0x2cdea6['jobs'][_0x52e75f(0x20d)]();console['log'](a8_0xc862e6[_0x52e75f(0x1f7)](_0x52e75f(0x1f3)+_0x58e789[_0x52e75f(0x1e7)]+')')),await saveOAuthTokens(_0x13a1c9,_0x60c6c7),console[_0x52e75f(0x1f8)](_0x52e75f(0x1ff)+(_0x60c6c7?_0x52e75f(0x204)+_0x60c6c7+')':''));if(_0x60c6c7){const _0x26ed50={'site':_0x42640d};saveProfileToUserConfig(_0x60c6c7,_0x26ed50),console['log']('✓\x20Profile\x20\x27'+_0x60c6c7+'\x27\x20registered');}const _0x22dae9=_0x60c6c7?_0x52e75f(0x1fa)+_0x60c6c7:'';console[_0x52e75f(0x1f8)](),console[_0x52e75f(0x1f8)](_0x52e75f(0x1e9)),console['log'](_0x52e75f(0x1f5)+_0x22dae9+_0x52e75f(0x20b)),console['log']('\x20\x20tdx'+_0x22dae9+_0x52e75f(0x1f6));}function a8_0x2534(_0x2229e4,_0x4324de){_0x2229e4=_0x2229e4-0x1e7;const _0x389cb6=a8_0x389c();let _0x253412=_0x389cb6[_0x2229e4];return _0x253412;}export class AuthLoginCommand extends BaseCommand{[a8_0x439616(0x1f2)]='auth:login';[a8_0x439616(0x1fb)]=a8_0x439616(0x207);async[a8_0x439616(0x1fe)](_0x58c6cf){const _0x15d15e=a8_0x439616,{options:_0x27b923}=_0x58c6cf,_0x1144f3=_0x27b923[_0x15d15e(0x203)];console[_0x15d15e(0x1f8)](a8_0xc862e6[_0x15d15e(0x1ea)](_0x15d15e(0x1f0)));const _0xa94c14=_0x27b923[_0x15d15e(0x1f4)]||_0x15d15e(0x200),_0x12636d=await promptSiteSelection(_0xa94c14,_0x1144f3,_0x15d15e(0x202));if(!_0x12636d)return 0x1;const _0x57bc7c=resolveSite(_0x12636d);return console[_0x15d15e(0x1f8)]('Authenticating\x20via\x20OAuth\x20for\x20site:\x20'+_0x57bc7c),await runOAuthLoginFlow(_0x57bc7c,_0x1144f3,_0x27b923[_0x15d15e(0x1eb)]??LogLevel['ERROR']),0x0;}}
1
+ const a8_0x7e80e2=a8_0xb252;(function(_0x34b7ce,_0x1c2928){const _0x444464=a8_0xb252,_0xd5a7b=_0x34b7ce();while(!![]){try{const _0x738b21=-parseInt(_0x444464(0xb0))/0x1*(parseInt(_0x444464(0x97))/0x2)+-parseInt(_0x444464(0xa4))/0x3*(parseInt(_0x444464(0xaa))/0x4)+-parseInt(_0x444464(0xb7))/0x5+-parseInt(_0x444464(0xbc))/0x6+-parseInt(_0x444464(0xb6))/0x7*(-parseInt(_0x444464(0x99))/0x8)+-parseInt(_0x444464(0xc0))/0x9*(-parseInt(_0x444464(0xae))/0xa)+-parseInt(_0x444464(0xb1))/0xb*(-parseInt(_0x444464(0xa9))/0xc);if(_0x738b21===_0x1c2928)break;else _0xd5a7b['push'](_0xd5a7b['shift']());}catch(_0x230c6c){_0xd5a7b['push'](_0xd5a7b['shift']());}}}(a8_0x5a4f,0x3af8e));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';function a8_0x5a4f(){const _0x13ac26=['Opening\x20browser\x20for\x20authentication...','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','execute','\x20\x20tdx','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','\x20--profile\x20','auth:login','1959VGdWtS','✓\x20Profile\x20\x27','ERROR','email','log','72cAwDFA','1812NvSZCm','Login\x20via\x20OAuth\x20(opens\x20browser)','access_token','\x27\x20registered','2696530Lgnvtr','Validating\x20OAuth\x20tokens...','2096hwwxCQ','1651837tkXnfh','Login\x20cancelled','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','bold','3324041LIHpyF','1580225YHOsER','logLevel','getUserInfo','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','\x20(profile:\x20','2690220vkhjYK','profile','/oauth/authorize','jobs','9HafPtf','site','create','✓\x20Authentication\x20successful\x20(User:\x20','name','328OBzmZh','green','8NvnesW'];a8_0x5a4f=function(){return _0x13ac26;};return a8_0x5a4f();}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{isKeychainAvailable}from'../core/keychain.js';import{saveOAuthTokens}from'../core/oauth-keychain.js';import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';function a8_0xb252(_0x477ab2,_0xebad79){_0x477ab2=_0x477ab2-0x95;const _0x5a4f83=a8_0x5a4f();let _0xb25243=_0x5a4f83[_0x477ab2];return _0xb25243;}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x2746ec from'chalk';export async function runOAuthLoginFlow(_0x30c471,_0x5ee588,_0x4a347e){const _0x5818da=a8_0xb252;if(!isOAuthSupported(_0x30c471))throw new Error('OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20'+_0x30c471+'.\x20'+_0x5818da(0x9d)+_0x5818da(0xb3));const _0x5542de=await isKeychainAvailable();if(!_0x5542de)throw new Error(_0x5818da(0x9c)+_0x5818da(0xb3));const _0x3dcc30=getConsoleUrl(_0x30c471);console[_0x5818da(0xa8)](_0x5818da(0x9a)),console[_0x5818da(0xa8)]('\x20\x20'+_0x3dcc30+_0x5818da(0xbe)),console[_0x5818da(0xa8)](_0x5818da(0xb4));const _0x26e019=await startOAuthFlow(_0x30c471);console[_0x5818da(0xa8)](_0x5818da(0xaf));const _0x4669c9=TDX[_0x5818da(0xc2)]({'site':_0x30c471,'accessToken':_0x26e019[_0x5818da(0xac)],'logLevel':_0x4a347e??LogLevel[_0x5818da(0xa6)]}),_0x5db6ee=await _0x4669c9[_0x5818da(0xbf)][_0x5818da(0xb9)]();console[_0x5818da(0xa8)](a8_0x2746ec[_0x5818da(0x98)](_0x5818da(0x95)+_0x5db6ee[_0x5818da(0xa7)]+')')),await saveOAuthTokens(_0x26e019,_0x5ee588),console[_0x5818da(0xa8)]('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x5ee588?_0x5818da(0xbb)+_0x5ee588+')':''));if(_0x5ee588){const _0x45c36d={'site':_0x30c471};saveProfileToUserConfig(_0x5ee588,_0x45c36d),console['log'](_0x5818da(0xa5)+_0x5ee588+_0x5818da(0xad));}const _0x12eed3=_0x5ee588?_0x5818da(0xa2)+_0x5ee588:'';console[_0x5818da(0xa8)](),console[_0x5818da(0xa8)](_0x5818da(0xba)),console[_0x5818da(0xa8)](_0x5818da(0x9f)+_0x12eed3+_0x5818da(0x9b)),console[_0x5818da(0xa8)](_0x5818da(0x9f)+_0x12eed3+_0x5818da(0xa0));}export class AuthLoginCommand extends BaseCommand{[a8_0x7e80e2(0x96)]=a8_0x7e80e2(0xa3);['description']=a8_0x7e80e2(0xab);async[a8_0x7e80e2(0x9e)](_0x3d9c27){const _0x4e674d=a8_0x7e80e2,{options:_0x3025a3}=_0x3d9c27,_0x31b2df=_0x3025a3[_0x4e674d(0xbd)];console[_0x4e674d(0xa8)](a8_0x2746ec[_0x4e674d(0xb5)]('tdx:\x20auth\x20login'));const _0x490e86=_0x3025a3[_0x4e674d(0xc1)]||'us01',_0x16b989=await promptSiteSelection(_0x490e86,_0x31b2df,_0x4e674d(0xb2));if(!_0x16b989)return 0x1;const _0x3f8078=resolveSite(_0x16b989);return console['log'](_0x4e674d(0xa1)+_0x3f8078),await runOAuthLoginFlow(_0x3f8078,_0x31b2df,_0x3025a3[_0x4e674d(0xb8)]??LogLevel['ERROR']),0x0;}}