@treasuredata/tdx 2026.7.0 → 2026.7.2

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 (283) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/cas-command.d.ts +20 -0
  13. package/dist/commands/cas-command.d.ts.map +1 -1
  14. package/dist/commands/cas-command.js +1 -1
  15. package/dist/commands/cas-command.js.map +1 -1
  16. package/dist/commands/cas-segment-command.d.ts +24 -0
  17. package/dist/commands/cas-segment-command.d.ts.map +1 -1
  18. package/dist/commands/cas-segment-command.js +1 -1
  19. package/dist/commands/cas-segment-command.js.map +1 -1
  20. package/dist/commands/chat-command.js +1 -1
  21. package/dist/commands/claude-command.js +1 -1
  22. package/dist/commands/claude-statusline-command.js +1 -1
  23. package/dist/commands/claude-usage-command.js +1 -1
  24. package/dist/commands/command.js +1 -1
  25. package/dist/commands/connection-command.js +1 -1
  26. package/dist/commands/databases.js +1 -1
  27. package/dist/commands/delivery-command.js +1 -1
  28. package/dist/commands/describe.js +1 -1
  29. package/dist/commands/engage-campaign-pull-command.js +1 -1
  30. package/dist/commands/engage-campaign-push-command.js +1 -1
  31. package/dist/commands/engage-campaign-validate-command.js +1 -1
  32. package/dist/commands/engage-command.js +1 -1
  33. package/dist/commands/engage-template-pull-command.js +1 -1
  34. package/dist/commands/engage-template-push-command.js +1 -1
  35. package/dist/commands/engage-template-validate-command.js +1 -1
  36. package/dist/commands/job-command.js +1 -1
  37. package/dist/commands/journey-command.js +1 -1
  38. package/dist/commands/journey-validate-command.js +1 -1
  39. package/dist/commands/llm-command.js +1 -1
  40. package/dist/commands/mcp-command.js +1 -1
  41. package/dist/commands/parent-segment-command.js +1 -1
  42. package/dist/commands/policy-command.js +1 -1
  43. package/dist/commands/profile-command.js +1 -1
  44. package/dist/commands/profiles-command.js +1 -1
  45. package/dist/commands/query-command.js +1 -1
  46. package/dist/commands/schedule-command.js +1 -1
  47. package/dist/commands/segment-command.js +1 -1
  48. package/dist/commands/segment-create-command.js +1 -1
  49. package/dist/commands/segment-fields-command.js +1 -1
  50. package/dist/commands/segment-move-command.js +1 -1
  51. package/dist/commands/segment-pull-command.js +1 -1
  52. package/dist/commands/segment-push-command.js +1 -1
  53. package/dist/commands/segment-update-command.js +1 -1
  54. package/dist/commands/segment-use-command.js +1 -1
  55. package/dist/commands/segment-validate-command.js +1 -1
  56. package/dist/commands/segments.js +1 -1
  57. package/dist/commands/show.js +1 -1
  58. package/dist/commands/status-command.js +1 -1
  59. package/dist/commands/table-deleted.js +1 -1
  60. package/dist/commands/tables.js +1 -1
  61. package/dist/commands/unset-command.js +1 -1
  62. package/dist/commands/upgrade-command.js +1 -1
  63. package/dist/commands/use-command.js +1 -1
  64. package/dist/commands/user-command.js +1 -1
  65. package/dist/commands/work-command.js +1 -1
  66. package/dist/commands/workflow-command.js +1 -1
  67. package/dist/core/auth.js +1 -1
  68. package/dist/core/command-output.js +1 -1
  69. package/dist/core/config.js +1 -1
  70. package/dist/core/connection-cache.js +1 -1
  71. package/dist/core/constants.js +1 -1
  72. package/dist/core/credential-cache.js +1 -1
  73. package/dist/core/global-context.js +1 -1
  74. package/dist/core/keychain.js +1 -1
  75. package/dist/core/oauth-keychain.js +1 -1
  76. package/dist/core/oauth.js +1 -1
  77. package/dist/core/profile.js +1 -1
  78. package/dist/core/project-config.js +1 -1
  79. package/dist/core/session.js +1 -1
  80. package/dist/core/user-cache.js +1 -1
  81. package/dist/core/version.js +1 -1
  82. package/dist/index.js +1 -1
  83. package/dist/mcp/server.js +1 -1
  84. package/dist/mcp/tools/index.js +1 -1
  85. package/dist/mcp/tools/tdx-run.js +1 -1
  86. package/dist/mcp/tools/tdx-search.js +1 -1
  87. package/dist/mcp/tools/work-create-item.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.d.ts +83 -3
  103. package/dist/sdk/cas/cas-api-client.d.ts.map +1 -1
  104. package/dist/sdk/cas/cas-api-client.js +1 -1
  105. package/dist/sdk/cas/cas-api-client.js.map +1 -1
  106. package/dist/sdk/cas/cas-audience-schema.d.ts +149 -0
  107. package/dist/sdk/cas/cas-audience-schema.d.ts.map +1 -0
  108. package/dist/sdk/cas/cas-audience-schema.js +1 -0
  109. package/dist/sdk/cas/cas-audience-schema.js.map +1 -0
  110. package/dist/sdk/cas/cas-audience-validator.d.ts +57 -0
  111. package/dist/sdk/cas/cas-audience-validator.d.ts.map +1 -0
  112. package/dist/sdk/cas/cas-audience-validator.js +1 -0
  113. package/dist/sdk/cas/cas-audience-validator.js.map +1 -0
  114. package/dist/sdk/cas/cas-audience-yaml.d.ts +32 -1
  115. package/dist/sdk/cas/cas-audience-yaml.d.ts.map +1 -1
  116. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  117. package/dist/sdk/cas/cas-audience-yaml.js.map +1 -1
  118. package/dist/sdk/cas/cas-segment-yaml.d.ts +30 -2
  119. package/dist/sdk/cas/cas-segment-yaml.d.ts.map +1 -1
  120. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  121. package/dist/sdk/cas/cas-segment-yaml.js.map +1 -1
  122. package/dist/sdk/cas/index.d.ts +21 -0
  123. package/dist/sdk/cas/index.d.ts.map +1 -1
  124. package/dist/sdk/cas/index.js +1 -1
  125. package/dist/sdk/cas/index.js.map +1 -1
  126. package/dist/sdk/cas/pull-workflow.js +1 -1
  127. package/dist/sdk/cas/push-workflow.d.ts +131 -0
  128. package/dist/sdk/cas/push-workflow.d.ts.map +1 -1
  129. package/dist/sdk/cas/push-workflow.js +1 -1
  130. package/dist/sdk/cas/push-workflow.js.map +1 -1
  131. package/dist/sdk/cas/types.d.ts +33 -4
  132. package/dist/sdk/cas/types.d.ts.map +1 -1
  133. package/dist/sdk/cas/validate-files.d.ts +64 -0
  134. package/dist/sdk/cas/validate-files.d.ts.map +1 -0
  135. package/dist/sdk/cas/validate-files.js +1 -0
  136. package/dist/sdk/cas/validate-files.js.map +1 -0
  137. package/dist/sdk/client/cdp-api-client.js +1 -1
  138. package/dist/sdk/client/delivery-api-client.js +1 -1
  139. package/dist/sdk/client/endpoints.d.ts +11 -1
  140. package/dist/sdk/client/endpoints.d.ts.map +1 -1
  141. package/dist/sdk/client/endpoints.js +1 -1
  142. package/dist/sdk/client/endpoints.js.map +1 -1
  143. package/dist/sdk/client/engage-api-client.js +1 -1
  144. package/dist/sdk/client/http-client.d.ts +1 -0
  145. package/dist/sdk/client/http-client.d.ts.map +1 -1
  146. package/dist/sdk/client/http-client.js +1 -1
  147. package/dist/sdk/client/http-client.js.map +1 -1
  148. package/dist/sdk/client/llm-api-client.js +1 -1
  149. package/dist/sdk/client/oauth-refresh.js +1 -1
  150. package/dist/sdk/client/rate-limiter.js +1 -1
  151. package/dist/sdk/client/td-api-client.js +1 -1
  152. package/dist/sdk/client/trino-api-client.js +1 -1
  153. package/dist/sdk/client/workflow-client.js +1 -1
  154. package/dist/sdk/connection-validator.js +1 -1
  155. package/dist/sdk/connection.js +1 -1
  156. package/dist/sdk/delivery.js +1 -1
  157. package/dist/sdk/engage/campaign-pull.js +1 -1
  158. package/dist/sdk/engage/campaign-push.js +1 -1
  159. package/dist/sdk/engage/campaign-validator.js +1 -1
  160. package/dist/sdk/engage/campaign-yaml.js +1 -1
  161. package/dist/sdk/engage/template-pull.js +1 -1
  162. package/dist/sdk/engage/template-push.js +1 -1
  163. package/dist/sdk/engage/template-validator.js +1 -1
  164. package/dist/sdk/engage/template-yaml.js +1 -1
  165. package/dist/sdk/engage/types/campaign-def.js +1 -1
  166. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  167. package/dist/sdk/engage/types/template-schema.js +1 -1
  168. package/dist/sdk/engage.js +1 -1
  169. package/dist/sdk/errors.d.ts +20 -0
  170. package/dist/sdk/errors.d.ts.map +1 -1
  171. package/dist/sdk/errors.js +1 -1
  172. package/dist/sdk/errors.js.map +1 -1
  173. package/dist/sdk/index.js +1 -1
  174. package/dist/sdk/io/index.js +1 -1
  175. package/dist/sdk/io/node-filesystem.js +1 -1
  176. package/dist/sdk/job.js +1 -1
  177. package/dist/sdk/journey.js +1 -1
  178. package/dist/sdk/llm/chat-cache.js +1 -1
  179. package/dist/sdk/llm/index.js +1 -1
  180. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  181. package/dist/sdk/llm/model-factors.js +1 -1
  182. package/dist/sdk/llm/user-settings.js +1 -1
  183. package/dist/sdk/personalization.js +1 -1
  184. package/dist/sdk/policy.js +1 -1
  185. package/dist/sdk/query/deleted-table-validation.js +1 -1
  186. package/dist/sdk/query/index.js +1 -1
  187. package/dist/sdk/query/sql-parser.js +1 -1
  188. package/dist/sdk/realtime.js +1 -1
  189. package/dist/sdk/schedule.js +1 -1
  190. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  191. package/dist/sdk/segment/fields-display.js +1 -1
  192. package/dist/sdk/segment/file-discovery.js +1 -1
  193. package/dist/sdk/segment/journey-utils.js +1 -1
  194. package/dist/sdk/segment/journey-validator.js +1 -1
  195. package/dist/sdk/segment/journey-yaml.js +1 -1
  196. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  197. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  198. package/dist/sdk/segment/pull-workflow.js +1 -1
  199. package/dist/sdk/segment/push-recovery.js +1 -1
  200. package/dist/sdk/segment/push-workflow.js +1 -1
  201. package/dist/sdk/segment/resolution-context.d.ts +16 -7
  202. package/dist/sdk/segment/resolution-context.d.ts.map +1 -1
  203. package/dist/sdk/segment/resolution-context.js +1 -1
  204. package/dist/sdk/segment/resolution-context.js.map +1 -1
  205. package/dist/sdk/segment/segment-path-parser.js +1 -1
  206. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  207. package/dist/sdk/segment/segment-validator.js +1 -1
  208. package/dist/sdk/segment/target-resolution.js +1 -1
  209. package/dist/sdk/segment/tdx-config.js +1 -1
  210. package/dist/sdk/segment/types/activation-schema.js +1 -1
  211. package/dist/sdk/segment/types/journey-def.js +1 -1
  212. package/dist/sdk/segment/types/journey-schema.js +1 -1
  213. package/dist/sdk/segment/types/segment-def.js +1 -1
  214. package/dist/sdk/segment/types/segment-schema.js +1 -1
  215. package/dist/sdk/segment/validate-files.js +1 -1
  216. package/dist/sdk/segment/yaml-validator.d.ts +1 -1
  217. package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
  218. package/dist/sdk/segment/yaml-validator.js +1 -1
  219. package/dist/sdk/segment/yaml-validator.js.map +1 -1
  220. package/dist/sdk/segment.js +1 -1
  221. package/dist/sdk/types/cas.d.ts +99 -26
  222. package/dist/sdk/types/cas.d.ts.map +1 -1
  223. package/dist/sdk/types/index.d.ts +1 -1
  224. package/dist/sdk/types/index.d.ts.map +1 -1
  225. package/dist/sdk/types/index.js +1 -1
  226. package/dist/sdk/types/index.js.map +1 -1
  227. package/dist/sdk/types/progress.js +1 -1
  228. package/dist/sdk/types/workspace.js +1 -1
  229. package/dist/sdk/user.js +1 -1
  230. package/dist/sdk/util/format-detector.js +1 -1
  231. package/dist/sdk/util/formatters.js +1 -1
  232. package/dist/sdk/util/index.js +1 -1
  233. package/dist/sdk/util/paginate.js +1 -1
  234. package/dist/sdk/util/tree-formatter.js +1 -1
  235. package/dist/sdk/util/tree-search.js +1 -1
  236. package/dist/sdk/workflow/archive-validation.js +1 -1
  237. package/dist/sdk/workflow/clone-workflow.js +1 -1
  238. package/dist/sdk/workflow/index.js +1 -1
  239. package/dist/sdk/workflow/pull-workflow.js +1 -1
  240. package/dist/sdk/workflow/push-workflow.js +1 -1
  241. package/dist/sdk/workflow/task-graph.js +1 -1
  242. package/dist/sdk/workflow/tdx-config.js +1 -1
  243. package/dist/sdk/workflow/workflow-utils.js +1 -1
  244. package/dist/sdk/workspace/access-tracker.js +1 -1
  245. package/dist/sdk/workspace/frontmatter.js +1 -1
  246. package/dist/sdk/workspace/git.js +1 -1
  247. package/dist/sdk/workspace/index.js +1 -1
  248. package/dist/sdk/workspace/templates.js +1 -1
  249. package/dist/sdk/workspace/weekly.js +1 -1
  250. package/dist/sdk/workspace/wikilinks.js +1 -1
  251. package/dist/test-utils/command-runner.js +1 -1
  252. package/dist/test-utils/factories.js +1 -1
  253. package/dist/test-utils/fixtures.js +1 -1
  254. package/dist/test-utils/http-mock.js +1 -1
  255. package/dist/test-utils/index.js +1 -1
  256. package/dist/utils/async.js +1 -1
  257. package/dist/utils/colors.js +1 -1
  258. package/dist/utils/diff.js +1 -1
  259. package/dist/utils/file-permissions.js +1 -1
  260. package/dist/utils/file-reader.js +1 -1
  261. package/dist/utils/github-releases.js +1 -1
  262. package/dist/utils/global-cache.js +1 -1
  263. package/dist/utils/json-loader.js +1 -1
  264. package/dist/utils/local-cache.js +1 -1
  265. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  266. package/dist/utils/logger/formatters/index.js +1 -1
  267. package/dist/utils/logger/handlers/console-handler.js +1 -1
  268. package/dist/utils/logger/handlers/file-handler.js +1 -1
  269. package/dist/utils/logger/handlers/index.js +1 -1
  270. package/dist/utils/logger/handlers/null-handler.js +1 -1
  271. package/dist/utils/logger/index.js +1 -1
  272. package/dist/utils/logger/logger.js +1 -1
  273. package/dist/utils/logger/types.js +1 -1
  274. package/dist/utils/option-validation.js +1 -1
  275. package/dist/utils/process.js +1 -1
  276. package/dist/utils/prompt.js +1 -1
  277. package/dist/utils/spinner.js +1 -1
  278. package/dist/utils/sse-parser.js +1 -1
  279. package/dist/utils/string-utils.js +1 -1
  280. package/dist/utils/table-ref-parser.js +1 -1
  281. package/dist/utils/tdx-logger.js +1 -1
  282. package/dist/utils/version-check.js +1 -1
  283. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x3e0504=a3_0x1fa1;function a3_0x1fa1(_0x465d0d,_0x59966a){_0x465d0d=_0x465d0d-0x1de;const _0x145dbc=a3_0x145d();let _0x1fa1f0=_0x145dbc[_0x465d0d];return _0x1fa1f0;}(function(_0x3d0e65,_0x5224dc){const _0x142c8e=a3_0x1fa1,_0x1374cd=_0x3d0e65();while(!![]){try{const _0x4095ca=parseInt(_0x142c8e(0x1ed))/0x1+parseInt(_0x142c8e(0x1eb))/0x2*(parseInt(_0x142c8e(0x1fd))/0x3)+-parseInt(_0x142c8e(0x1fe))/0x4+parseInt(_0x142c8e(0x1f8))/0x5*(-parseInt(_0x142c8e(0x1ec))/0x6)+parseInt(_0x142c8e(0x1e5))/0x7*(parseInt(_0x142c8e(0x1e4))/0x8)+-parseInt(_0x142c8e(0x1fb))/0x9+parseInt(_0x142c8e(0x1de))/0xa;if(_0x4095ca===_0x5224dc)break;else _0x1374cd['push'](_0x1374cd['shift']());}catch(_0x1523e1){_0x1374cd['push'](_0x1374cd['shift']());}}}(a3_0x145d,0x89508));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a3_0x145d(){const _0x50b5b8=['10PlKGdg','site','resolveParentId','8108226mcpPQi','length','440988gSvVmO','2697420YmZEWN','Resolved\x20parent\x20ID:\x20','\x27...','error','Resolved\x20child\x20ID:\x20','493530yPiJgg','cause','verbose','Site:\x20','execute','message','3661096VDdLsb','14SBxjkI','\x20\x20Cause:\x20','Resolving\x20child\x20segment\x20\x27','data','Child\x20name:\x20','List\x20activations\x20for\x20a\x20segment','4cHrWwh','451896RlwsbR','1029722pxPqlo','resolveSegmentId','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','name','✔\x20Found\x20','Resolving\x20parent\x20segment\x20\x27','Error:\x20Segment\x20name\x20is\x20required','segment','Parent\x20name:\x20','Listing\x20activations\x20for\x20segment\x20\x27'];a3_0x145d=function(){return _0x50b5b8;};return a3_0x145d();}import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x3e0504(0x1f1)]='activations';['description']=a3_0x3e0504(0x1ea);async[a3_0x3e0504(0x1e2)](_0x2d7175){const _0x46bd52=a3_0x3e0504,{options:_0x3002a8,args:_0x170970,tdx:_0x10c052}=_0x2d7175;if(_0x170970['length']===0x0)return console['error'](_0x46bd52(0x1f4)),console[_0x46bd52(0x201)](_0x46bd52(0x1f0)),0x1;try{const {parentId:_0x2b023a,childId:_0x5d7194}=parseSegmentRef(_0x170970[0x0]);if(!_0x5d7194)return console['error'](_0x46bd52(0x1ef)),console[_0x46bd52(0x201)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x3002a8[_0x46bd52(0x1e0)]&&(console[_0x46bd52(0x201)](_0x46bd52(0x1e1)+_0x3002a8[_0x46bd52(0x1f9)]),console[_0x46bd52(0x201)](_0x46bd52(0x1f6)+_0x2b023a),console[_0x46bd52(0x201)](_0x46bd52(0x1e9)+_0x5d7194));const _0x4f616d=await withSpinner(_0x46bd52(0x1f3)+_0x2b023a+_0x46bd52(0x200),()=>_0x10c052['segment'][_0x46bd52(0x1fa)](_0x2b023a),{'verbose':_0x3002a8[_0x46bd52(0x1e0)]}),_0x55215d=_0x4f616d[_0x46bd52(0x1e8)];_0x3002a8[_0x46bd52(0x1e0)]&&console[_0x46bd52(0x201)](_0x46bd52(0x1ff)+_0x55215d);const _0x3bc2a3=await withSpinner(_0x46bd52(0x1e7)+_0x5d7194+_0x46bd52(0x200),()=>_0x10c052[_0x46bd52(0x1f5)][_0x46bd52(0x1ee)](_0x55215d,_0x5d7194),{'verbose':_0x3002a8['verbose']}),_0x53ef27=_0x3bc2a3[_0x46bd52(0x1e8)];_0x3002a8[_0x46bd52(0x1e0)]&&console[_0x46bd52(0x201)](_0x46bd52(0x202)+_0x53ef27);const _0x5583af=await withSpinner(_0x46bd52(0x1f7)+_0x5d7194+'\x27...',()=>_0x10c052['segment']['listActivations'](_0x55215d,_0x53ef27),{'verbose':_0x3002a8[_0x46bd52(0x1e0)]}),_0x4804e6=_0x5583af[_0x46bd52(0x1e8)];return console[_0x46bd52(0x201)](_0x46bd52(0x1f2)+_0x4804e6['length']+'\x20activation'+(_0x4804e6[_0x46bd52(0x1fc)]!==0x1?'s':'')),await handleSDKOutput(_0x4804e6,_0x3002a8),0x0;}catch(_0x1ffe71){if(_0x1ffe71 instanceof SDKError)return console[_0x46bd52(0x201)]('Error:\x20'+_0x1ffe71[_0x46bd52(0x1e3)]),_0x1ffe71[_0x46bd52(0x1df)]&&console[_0x46bd52(0x201)](_0x46bd52(0x1e6)+_0x1ffe71['cause']),0x1;throw _0x1ffe71;}}}
1
+ const a3_0x1e7dbf=a3_0x39f0;(function(_0xa7aa28,_0x2c0f85){const _0x12be3a=a3_0x39f0,_0x315d16=_0xa7aa28();while(!![]){try{const _0x3c2348=-parseInt(_0x12be3a(0x138))/0x1+parseInt(_0x12be3a(0x14b))/0x2+parseInt(_0x12be3a(0x146))/0x3*(-parseInt(_0x12be3a(0x139))/0x4)+parseInt(_0x12be3a(0x148))/0x5+-parseInt(_0x12be3a(0x150))/0x6*(-parseInt(_0x12be3a(0x14e))/0x7)+parseInt(_0x12be3a(0x154))/0x8+parseInt(_0x12be3a(0x13f))/0x9*(-parseInt(_0x12be3a(0x155))/0xa);if(_0x3c2348===_0x2c0f85)break;else _0x315d16['push'](_0x315d16['shift']());}catch(_0x20e7f2){_0x315d16['push'](_0x315d16['shift']());}}}(a3_0xbf41,0x8dfbc));import{BaseCommand}from'./command.js';function a3_0x39f0(_0x2696c0,_0x224aff){_0x2696c0=_0x2696c0-0x134;const _0xbf411d=a3_0xbf41();let _0x39f0a3=_0xbf411d[_0x2696c0];return _0x39f0a3;}function a3_0xbf41(){const _0x2ab2fe=['5959904oXEZDR','47110PjRbxL','Error:\x20','error','Resolving\x20parent\x20segment\x20\x27','List\x20activations\x20for\x20a\x20segment','resolveParentId','692136bjDNhS','4eruXys','\x27...','Site:\x20','Resolved\x20parent\x20ID:\x20','verbose','name','2349zVyPVA','\x20\x20Cause:\x20','site','Resolving\x20child\x20segment\x20\x27','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Error:\x20Segment\x20name\x20is\x20required','cause','497334TNxTDc','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','753335KCfahx','segment','description','1515248dSEDjQ','message','Parent\x20name:\x20','21IEWfko','execute','2031540YDdZLS','data','length','listActivations'];a3_0xbf41=function(){return _0x2ab2fe;};return a3_0xbf41();}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_0x1e7dbf(0x13e)]='activations';[a3_0x1e7dbf(0x14a)]=a3_0x1e7dbf(0x136);async[a3_0x1e7dbf(0x14f)](_0x5ac2b1){const _0x1dbc30=a3_0x1e7dbf,{options:_0x1ea6e2,args:_0x5c4884,tdx:_0x2a4322}=_0x5ac2b1;if(_0x5c4884['length']===0x0)return console[_0x1dbc30(0x134)](_0x1dbc30(0x144)),console[_0x1dbc30(0x134)](_0x1dbc30(0x143)),0x1;try{const {parentId:_0x2d5455,childId:_0x39d44f}=parseSegmentRef(_0x5c4884[0x0]);if(!_0x39d44f)return console[_0x1dbc30(0x134)](_0x1dbc30(0x147)),console[_0x1dbc30(0x134)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x1ea6e2[_0x1dbc30(0x13d)]&&(console[_0x1dbc30(0x134)](_0x1dbc30(0x13b)+_0x1ea6e2[_0x1dbc30(0x141)]),console[_0x1dbc30(0x134)](_0x1dbc30(0x14d)+_0x2d5455),console[_0x1dbc30(0x134)]('Child\x20name:\x20'+_0x39d44f));const _0xf15c71=await withSpinner(_0x1dbc30(0x135)+_0x2d5455+'\x27...',()=>_0x2a4322[_0x1dbc30(0x149)][_0x1dbc30(0x137)](_0x2d5455),{'verbose':_0x1ea6e2[_0x1dbc30(0x13d)]}),_0x5e938f=_0xf15c71[_0x1dbc30(0x151)];_0x1ea6e2[_0x1dbc30(0x13d)]&&console['error'](_0x1dbc30(0x13c)+_0x5e938f);const _0x8346c3=await withSpinner(_0x1dbc30(0x142)+_0x39d44f+_0x1dbc30(0x13a),()=>_0x2a4322[_0x1dbc30(0x149)]['resolveSegmentId'](_0x5e938f,_0x39d44f),{'verbose':_0x1ea6e2[_0x1dbc30(0x13d)]}),_0x5f199c=_0x8346c3[_0x1dbc30(0x151)];_0x1ea6e2['verbose']&&console['error']('Resolved\x20child\x20ID:\x20'+_0x5f199c);const _0xf67f86=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x39d44f+'\x27...',()=>_0x2a4322[_0x1dbc30(0x149)][_0x1dbc30(0x153)](_0x5e938f,_0x5f199c),{'verbose':_0x1ea6e2[_0x1dbc30(0x13d)]}),_0x314c01=_0xf67f86[_0x1dbc30(0x151)];return console['error']('✔\x20Found\x20'+_0x314c01[_0x1dbc30(0x152)]+'\x20activation'+(_0x314c01[_0x1dbc30(0x152)]!==0x1?'s':'')),await handleSDKOutput(_0x314c01,_0x1ea6e2),0x0;}catch(_0x105cae){if(_0x105cae instanceof SDKError)return console['error'](_0x1dbc30(0x156)+_0x105cae[_0x1dbc30(0x14c)]),_0x105cae[_0x1dbc30(0x145)]&&console[_0x1dbc30(0x134)](_0x1dbc30(0x140)+_0x105cae[_0x1dbc30(0x145)]),0x1;throw _0x105cae;}}}
@@ -1 +1 @@
1
- const a4_0x4c125e=a4_0x2cd7;(function(_0x904995,_0x550a62){const _0x574409=a4_0x2cd7,_0x10a9b6=_0x904995();while(!![]){try{const _0x2bd82d=parseInt(_0x574409(0x1fa))/0x1+-parseInt(_0x574409(0x1a1))/0x2+parseInt(_0x574409(0x1b9))/0x3+parseInt(_0x574409(0x19b))/0x4*(-parseInt(_0x574409(0x1b4))/0x5)+parseInt(_0x574409(0x1d0))/0x6*(-parseInt(_0x574409(0x23f))/0x7)+-parseInt(_0x574409(0x1c6))/0x8+-parseInt(_0x574409(0x1bc))/0x9*(-parseInt(_0x574409(0x24d))/0xa);if(_0x2bd82d===_0x550a62)break;else _0x10a9b6['push'](_0x10a9b6['shift']());}catch(_0x1f339a){_0x10a9b6['push'](_0x10a9b6['shift']());}}}(a4_0x2f3d,0x3202b));function a4_0x2f3d(){const _0x1e0294=['\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','llm_project','created','action','New\x20project\x20ID:\x20','60zaBahN','<new-name>','llmProject','\x20\x20Chat\x20Interface\x20\x22','\x20unchanged','profile','559612rXzOWh','Would\x20clone:','\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','\x0aPush\x20','isNew','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)','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','cyan','source','agent.yml','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20\x20Prompt\x20\x22','\x0aChanges\x20to\x20chat\x20interface\x20\x27','\x20\x20Agents:\x20','yellow','unchanged','\x0aPull\x20summary\x20for\x20\x27','Cancelled','parse','84135vkUUpb','\x0aChanges\x20to\x20agent\x20\x27','MISSING_ARGUMENT','\x20successfully','Chat:\x20','1064325HGcJQi','\x20\x20Form\x20Interface\x20\x22','agentName','99ytFiIz','newProjectId','experimentalKnowledgeBases','agent:push','formInterfaces','cwd','\x0a✔\x20Pushed\x20','Project:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Pushing\x20to\x20project...','3202664vMjjMs','-\x20no\x20files\x20written','\x20\x20Integration\x20\x22','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Agent:\x20','repeat','no_context','log','llm','Analyzing\x20project\x20\x22','1577802UNMxrA','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','push','\x20\x20tdx\x20agent\x20clone\x20agents/','green','\x0aError:','output','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x0aWrite\x20','Errors:','\x22\x20to\x20a\x20different\x20profile','utf-8','Using\x20project\x20from\x20','Using\x20context\x20project:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','pullProject','\x20\x20Knowledge\x20Base\x20\x22','\x20updated','agentId','tdx.json','Agent\x20pulled\x20successfully','gray','cwd-config','Would\x20pull\x20agent:\x20','knowledgeBases','Writing\x20files...','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','✔\x20Context\x20set:\x20','outputPath','experimentalArtifacts','Project\x20cloned\x20with\x20errors','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','agent','Clone\x20\x22','\x20resources\x20to\x20\x27','Agent\x20','Pulling\x20agent\x20\x22','\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','\x20errors','New\x20project:\x20','reason','244746RFeTrW','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','agent:clone','\x20\x20Text\x20Knowledge\x20Bases:\x20','newProjectName','\x20changed','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Would\x20push\x20agent:\x20','INVALID_ARGUMENT','pushAgent','cloneProject','arg-dir','Cloning\x20\x22','projectId','\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','dirname','join','\x0aProject\x20pushed\x20with\x20errors','updated','\x20|\x20','total','\x20\x20Experimental\x20Artifacts:\x20','\x22\x20from\x20project\x20\x22','error','\x22...','no_local_folder','\x22\x20to\x20\x22','agent:pull','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','No\x20tdx.json\x20found\x20in\x20','Analyzing\x20changes\x20to\x20push...','projectName','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','diff','\x20\x20Agent\x20\x22','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20files?','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x22:\x20','force','\x0aErrors\x20found:','\x20\x20Form\x20Interfaces:\x20','prompts','Dry\x20run\x20-\x20no\x20files\x20written','outputDir','textKnowledgeBases','chatInterfaces','Source:\x20','agents','dim','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','\x20\x20Integrations:\x20','Dry\x20run\x20-\x20no\x20changes\x20made','\x20files\x20to\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','site','integrations','Using\x20local\x20project:\x20','\x20created','Using\x20project:\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','session','\x20\x20Experimental\x20Artifact\x20\x22','\x0aChanges\x20to\x20form\x20interface\x20\x27','\x20new','7nXiZAy','found','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','dryRun','description','\x20\x20Knowledge\x20Bases:\x20','Using\x20current\x20project:\x20','\x20--profile\x20','-\x20nothing\x20pushed','Using\x20project\x20from\x20context:\x20','context','pullAgent','\x0aChanges\x20to\x20integration\x20\x27','execute','728030SYFAnG','\x20\x20Chat\x20Interfaces:\x20','\x20--name\x20','errors','name','yes','Status:\x20','\x20\x20Prompts:\x20','Failed\x20to\x20push\x20agent:\x20','projectDir','sourceProjectName','New\x20project\x20name\x20is\x20required','\x20=\x20','red','Output:\x20','new','counts','\x0a✔\x20Pulled\x20','pushProject'];a4_0x2f3d=function(){return _0x1e0294;};return a4_0x2f3d();}import a4_0x33fb22 from'chalk';import a4_0x4d86e7 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x458aac){const _0x15d70c=a4_0x2cd7,_0x1606fb=[];if(_0x458aac[_0x15d70c(0x20f)]!==undefined)_0x1606fb[_0x15d70c(0x1d3)](_0x458aac[_0x15d70c(0x20f)]+'\x20total');if(_0x458aac[_0x15d70c(0x25c)]!==undefined&&_0x458aac['new']>0x0)_0x1606fb[_0x15d70c(0x1d3)](a4_0x33fb22[_0x15d70c(0x1d5)](_0x458aac[_0x15d70c(0x25c)]+'\x20new'));if(_0x458aac['created']!==undefined&&_0x458aac[_0x15d70c(0x198)]>0x0)_0x1606fb['push'](a4_0x33fb22['green'](_0x458aac[_0x15d70c(0x198)]+_0x15d70c(0x238)));if(_0x458aac[_0x15d70c(0x20d)]!==undefined&&_0x458aac['updated']>0x0)_0x1606fb[_0x15d70c(0x1d3)](a4_0x33fb22['yellow'](_0x458aac[_0x15d70c(0x20d)]+_0x15d70c(0x1e2)));if(_0x458aac[_0x15d70c(0x1b0)]!==undefined&&_0x458aac[_0x15d70c(0x1b0)]>0x0)_0x1606fb[_0x15d70c(0x1d3)](a4_0x33fb22[_0x15d70c(0x1e6)](_0x458aac[_0x15d70c(0x1b0)]+'\x20unchanged'));if(_0x458aac[_0x15d70c(0x250)]!==undefined&&_0x458aac[_0x15d70c(0x250)]>0x0)_0x1606fb[_0x15d70c(0x1d3)](a4_0x33fb22[_0x15d70c(0x25a)](_0x458aac['errors']+_0x15d70c(0x1f7)));return _0x1606fb[_0x15d70c(0x20b)](',\x20');}function displayDiffs(_0x57580e,_0x283f5c,_0x571d17,_0x3f1fb5,_0x18a7fc,_0x50cd5a,_0x1e818c,_0xec6c24,_0x158554){const _0x453bc7=a4_0x2cd7;for(const _0x411d4b of _0x57580e){if(_0x411d4b[_0x453bc7(0x21c)]){const _0x54d699=_0x411d4b['agentName']||_0x411d4b['name'];console[_0x453bc7(0x1cd)](_0x453bc7(0x1b5)+_0x54d699+'\x27:'),console['log']('─'[_0x453bc7(0x1cb)](0x3c)),console['log'](_0x411d4b[_0x453bc7(0x21c)]),console[_0x453bc7(0x1cd)]('─'[_0x453bc7(0x1cb)](0x3c));}}for(const _0x324b4f of _0x283f5c){_0x324b4f['diff']&&(console['log'](_0x453bc7(0x217)+_0x324b4f[_0x453bc7(0x251)]+'\x27:'),console['log']('─'[_0x453bc7(0x1cb)](0x3c)),console[_0x453bc7(0x1cd)](_0x324b4f[_0x453bc7(0x21c)]),console[_0x453bc7(0x1cd)]('─'['repeat'](0x3c)));}for(const _0x3887a7 of _0x571d17){_0x3887a7[_0x453bc7(0x21c)]&&(console[_0x453bc7(0x1cd)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x3887a7[_0x453bc7(0x251)]+'\x27:'),console[_0x453bc7(0x1cd)]('─'['repeat'](0x3c)),console[_0x453bc7(0x1cd)](_0x3887a7['diff']),console[_0x453bc7(0x1cd)]('─'[_0x453bc7(0x1cb)](0x3c)));}for(const _0x275ff9 of _0x3f1fb5){_0x275ff9['diff']&&(console['log']('\x0aChanges\x20to\x20prompt\x20\x27'+_0x275ff9[_0x453bc7(0x251)]+'\x27:'),console[_0x453bc7(0x1cd)]('─'[_0x453bc7(0x1cb)](0x3c)),console[_0x453bc7(0x1cd)](_0x275ff9[_0x453bc7(0x21c)]),console[_0x453bc7(0x1cd)]('─'[_0x453bc7(0x1cb)](0x3c)));}for(const _0x578948 of _0x18a7fc){_0x578948[_0x453bc7(0x21c)]&&(console[_0x453bc7(0x1cd)](_0x453bc7(0x24b)+_0x578948[_0x453bc7(0x251)]+'\x27:'),console[_0x453bc7(0x1cd)]('─'[_0x453bc7(0x1cb)](0x3c)),console[_0x453bc7(0x1cd)](_0x578948[_0x453bc7(0x21c)]),console[_0x453bc7(0x1cd)]('─'[_0x453bc7(0x1cb)](0x3c)));}for(const _0x20f3fd of _0x50cd5a){_0x20f3fd[_0x453bc7(0x21c)]&&(console[_0x453bc7(0x1cd)](_0x453bc7(0x21e)+_0x20f3fd['name']+'\x27:'),console[_0x453bc7(0x1cd)]('─'[_0x453bc7(0x1cb)](0x3c)),console[_0x453bc7(0x1cd)](_0x20f3fd['diff']),console[_0x453bc7(0x1cd)]('─'[_0x453bc7(0x1cb)](0x3c)));}for(const _0x2a35f3 of _0x1e818c){_0x2a35f3[_0x453bc7(0x21c)]&&(console[_0x453bc7(0x1cd)](_0x453bc7(0x1f0)+_0x2a35f3[_0x453bc7(0x251)]+'\x27:'),console[_0x453bc7(0x1cd)]('─'['repeat'](0x3c)),console[_0x453bc7(0x1cd)](_0x2a35f3[_0x453bc7(0x21c)]),console['log']('─'[_0x453bc7(0x1cb)](0x3c)));}for(const _0x2d38e7 of _0xec6c24){_0x2d38e7['diff']&&(console[_0x453bc7(0x1cd)](_0x453bc7(0x23d)+_0x2d38e7[_0x453bc7(0x251)]+'\x27:'),console[_0x453bc7(0x1cd)]('─'['repeat'](0x3c)),console['log'](_0x2d38e7[_0x453bc7(0x21c)]),console[_0x453bc7(0x1cd)]('─'[_0x453bc7(0x1cb)](0x3c)));}for(const _0x473518 of _0x158554){_0x473518[_0x453bc7(0x21c)]&&(console[_0x453bc7(0x1cd)](_0x453bc7(0x1ad)+_0x473518[_0x453bc7(0x251)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x453bc7(0x1cd)](_0x473518[_0x453bc7(0x21c)]),console['log']('─'[_0x453bc7(0x1cb)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x4c125e(0x251)]=a4_0x4c125e(0x216);[a4_0x4c125e(0x243)]=a4_0x4c125e(0x222);async[a4_0x4c125e(0x24c)](_0x310ee1){const _0x15daf5=a4_0x4c125e,{options:_0x304cbf,args:_0x2817b7,tdx:_0x514160}=_0x310ee1,_0x4490f4=_0x2817b7[0x0],_0x1d3232=_0x2817b7[0x1],_0xd416f8=_0x304cbf[_0x15daf5(0x1d7)],_0x2e702f=_0x304cbf[_0x15daf5(0x242)],_0x549fbd=_0x304cbf[_0x15daf5(0x225)],_0x3ed8bb=_0x304cbf[_0x15daf5(0x252)],_0xb6f952=_0x304cbf[_0x15daf5(0x19d)],_0x5b2b71=_0x304cbf[_0x15daf5(0x1f1)];let _0x3f8c6f;if(_0x4490f4){const _0xa5f3f6=a4_0x4d86e7['join'](_0x4490f4,'tdx.json');if(existsSync(_0xa5f3f6))try{const _0x48d650=JSON['parse'](readFileSync(_0xa5f3f6,_0x15daf5(0x1dc)));_0x48d650['llm_project']&&(_0x3f8c6f={'llm_project':_0x48d650[_0x15daf5(0x197)]});}catch{}}const _0x55be06=findAgentConfigPath(process[_0x15daf5(0x1c1)]());let _0x19812b;if(_0x55be06)try{const _0x56afa2=JSON[_0x15daf5(0x1b3)](readFileSync(_0x55be06,'utf-8'));_0x56afa2['llm_project']&&(_0x19812b={'llm_project':_0x56afa2['llm_project']});}catch{}const _0x513cf8=resolveAgentPullArgs({'arg':_0x4490f4,'agentNameArg':_0x1d3232,'agentFlag':_0x5b2b71,'contextProject':_0xb6f952,'argDirConfig':_0x3f8c6f,'cwdConfigPath':_0x55be06||undefined,'cwdConfig':_0x19812b}),{projectNameOrId:_0x8b0410,targetAgentName:_0x182fee,existingOutputDir:_0x46266a,source:_0x35278b}=_0x513cf8;if(_0x35278b===_0x15daf5(0x206))console['log'](a4_0x33fb22[_0x15daf5(0x22f)](_0x15daf5(0x1dd)+a4_0x4d86e7[_0x15daf5(0x20b)](_0x4490f4,_0x15daf5(0x1e4))+':\x20'+_0x8b0410));else{if(_0x35278b===_0x15daf5(0x1e7))console['log'](a4_0x33fb22[_0x15daf5(0x22f)]('Using\x20project:\x20'+_0x8b0410));else _0x35278b===_0x15daf5(0x249)&&console['log'](a4_0x33fb22[_0x15daf5(0x22f)](_0x15daf5(0x248)+_0x8b0410));}if(!_0x8b0410)return _0x5b2b71?(console['log'](a4_0x33fb22[_0x15daf5(0x1af)](_0x15daf5(0x201))),console[_0x15daf5(0x1cd)](_0x15daf5(0x1d2)),console[_0x15daf5(0x1cd)](_0x15daf5(0x1fb))):(console[_0x15daf5(0x1cd)](a4_0x33fb22['yellow'](_0x15daf5(0x1c9))),console['log'](_0x15daf5(0x1a6)),console[_0x15daf5(0x1cd)]('\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[_0x15daf5(0x1cd)](_0x15daf5(0x209)),console[_0x15daf5(0x1cd)](_0x15daf5(0x1f6)),console[_0x15daf5(0x1cd)](_0x15daf5(0x1a3))),0x1;if(_0x182fee){const {data:_0x3301a2}=await withSpinner(_0x15daf5(0x1f5)+_0x182fee+_0x15daf5(0x211)+_0x8b0410+_0x15daf5(0x213),()=>_0x514160[_0x15daf5(0x1ce)][_0x15daf5(0x24a)](_0x8b0410,_0x182fee,_0xd416f8,{'dryRun':_0x2e702f,'force':_0x549fbd}));if(_0x2e702f)return console[_0x15daf5(0x1cd)](a4_0x33fb22[_0x15daf5(0x1af)](_0x15daf5(0x229))),console[_0x15daf5(0x1cd)](_0x15daf5(0x1e8)+_0x3301a2[_0x15daf5(0x1bb)]),console[_0x15daf5(0x1cd)]('Output\x20path:\x20'+_0x3301a2['outputPath']),_0x3301a2[_0x15daf5(0x21c)]&&(console[_0x15daf5(0x1cd)]('\x0aChanges:'),console['log']('─'[_0x15daf5(0x1cb)](0x3c)),console[_0x15daf5(0x1cd)](_0x3301a2[_0x15daf5(0x21c)]),console[_0x15daf5(0x1cd)]('─'[_0x15daf5(0x1cb)](0x3c))),0x0;return console[_0x15daf5(0x1cd)](a4_0x33fb22['green'](_0x15daf5(0x1e5))),console[_0x15daf5(0x1cd)](_0x15daf5(0x1ca)+_0x3301a2[_0x15daf5(0x1bb)]),console[_0x15daf5(0x1cd)](_0x15daf5(0x25b)+_0x3301a2[_0x15daf5(0x1ed)]),console[_0x15daf5(0x1cd)](_0x15daf5(0x253)+(_0x3301a2[_0x15daf5(0x1a5)]?a4_0x33fb22[_0x15daf5(0x1d5)]('new'):_0x3301a2['hasChanges']?a4_0x33fb22[_0x15daf5(0x1af)](_0x15daf5(0x20d)):a4_0x33fb22[_0x15daf5(0x1e6)](_0x15daf5(0x1b0)))),0x0;}const _0x4c5b71=_0x46266a||_0xd416f8,{data:_0x240957}=await withSpinner(_0x15daf5(0x1cf)+_0x8b0410+_0x15daf5(0x213),()=>_0x514160[_0x15daf5(0x1ce)][_0x15daf5(0x1e0)](_0x8b0410,_0x4c5b71,{'dryRun':!![]})),_0x25f69d=_0x240957['counts']['agents'][_0x15daf5(0x25c)]+_0x240957[_0x15daf5(0x25d)]['knowledgeBases'][_0x15daf5(0x25c)]+_0x240957[_0x15daf5(0x25d)]['textKnowledgeBases']['new']+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x228)][_0x15daf5(0x25c)]+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x236)][_0x15daf5(0x25c)]+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x1be)][_0x15daf5(0x25c)]+_0x240957['counts'][_0x15daf5(0x1ee)]['new']+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x1c0)][_0x15daf5(0x25c)]+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x22c)]['new'],_0xb66799=_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x22e)][_0x15daf5(0x20d)]+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x1e9)][_0x15daf5(0x20d)]+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x22b)][_0x15daf5(0x20d)]+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x228)][_0x15daf5(0x20d)]+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x236)][_0x15daf5(0x20d)]+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x1be)][_0x15daf5(0x20d)]+_0x240957[_0x15daf5(0x25d)]['experimentalArtifacts']['updated']+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x1c0)][_0x15daf5(0x20d)]+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x22c)]['updated'],_0x3ae8cf=_0x240957['counts'][_0x15daf5(0x22e)][_0x15daf5(0x1b0)]+_0x240957['counts']['knowledgeBases'][_0x15daf5(0x1b0)]+_0x240957['counts']['textKnowledgeBases'][_0x15daf5(0x1b0)]+_0x240957['counts'][_0x15daf5(0x228)][_0x15daf5(0x1b0)]+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x236)][_0x15daf5(0x1b0)]+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x1be)][_0x15daf5(0x1b0)]+_0x240957['counts'][_0x15daf5(0x1ee)][_0x15daf5(0x1b0)]+_0x240957[_0x15daf5(0x25d)]['formInterfaces'][_0x15daf5(0x1b0)]+_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x22c)]['unchanged'];console[_0x15daf5(0x1cd)](_0x15daf5(0x1b1)+_0x240957[_0x15daf5(0x21a)]+'\x27:'),console['log']('\x20\x20'+a4_0x33fb22[_0x15daf5(0x1d5)]('+\x20'+_0x25f69d+_0x15daf5(0x23e))+_0x15daf5(0x20e)+a4_0x33fb22[_0x15daf5(0x1af)]('~\x20'+_0xb66799+'\x20changed')+_0x15daf5(0x20e)+a4_0x33fb22[_0x15daf5(0x22f)]('=\x20'+_0x3ae8cf+_0x15daf5(0x19f))),console['log'](_0x15daf5(0x1ae)+formatCountSummary(_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x22e)])),console[_0x15daf5(0x1cd)](_0x15daf5(0x244)+formatCountSummary(_0x240957['counts'][_0x15daf5(0x1e9)])),console[_0x15daf5(0x1cd)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x22b)])),console[_0x15daf5(0x1cd)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x228)])),console[_0x15daf5(0x1cd)](_0x15daf5(0x231)+formatCountSummary(_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x236)])),console[_0x15daf5(0x1cd)](_0x15daf5(0x227)+formatCountSummary(_0x240957[_0x15daf5(0x25d)]['formInterfaces'])),console['log'](_0x15daf5(0x24e)+formatCountSummary(_0x240957['counts'][_0x15daf5(0x22c)]));const _0x35c596=_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x1be)][_0x15daf5(0x20f)]>0x0||_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x1ee)]['total']>0x0;_0x35c596&&(console[_0x15daf5(0x1cd)](_0x15daf5(0x23a)+formatCountSummary(_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x1be)])),console[_0x15daf5(0x1cd)](_0x15daf5(0x210)+formatCountSummary(_0x240957[_0x15daf5(0x25d)][_0x15daf5(0x1ee)])));console[_0x15daf5(0x1cd)]('\x20\x20Target:\x20'+a4_0x33fb22[_0x15daf5(0x1a8)](_0x240957['outputDir'])),displayDiffs(_0x240957[_0x15daf5(0x22e)],_0x240957[_0x15daf5(0x1e9)],_0x240957['textKnowledgeBases'],_0x240957[_0x15daf5(0x228)],_0x240957[_0x15daf5(0x236)],_0x240957[_0x15daf5(0x1be)],_0x240957['experimentalArtifacts'],_0x240957[_0x15daf5(0x1c0)],_0x240957['chatInterfaces']);if(_0x2e702f)return console[_0x15daf5(0x1cd)](a4_0x33fb22[_0x15daf5(0x1af)](_0x15daf5(0x1d1))),0x0;if(_0x25f69d===0x0&&_0xb66799===0x0)return console[_0x15daf5(0x1cd)](a4_0x33fb22['green'](_0x15daf5(0x1eb))),saveSessionContext({'llm_project':_0x240957[_0x15daf5(0x21a)]},_0x304cbf[_0x15daf5(0x23b)]),console[_0x15daf5(0x1cd)](a4_0x33fb22[_0x15daf5(0x1d5)](_0x15daf5(0x1ec)+a4_0x33fb22[_0x15daf5(0x22f)](_0x15daf5(0x197))+'\x20=\x20'+a4_0x33fb22['cyan'](_0x240957[_0x15daf5(0x21a)]))),0x0;if(!_0x3ed8bb&&!_0x549fbd){if(!isInteractive())return console[_0x15daf5(0x212)](a4_0x33fb22[_0x15daf5(0x25a)](_0x15daf5(0x1d6)),_0x15daf5(0x1df)),console[_0x15daf5(0x212)](a4_0x33fb22[_0x15daf5(0x22f)](_0x15daf5(0x1c4))),0x1;const _0x38cdd7=await confirmKey(_0x15daf5(0x1d9)+(_0x25f69d+_0xb66799)+_0x15daf5(0x220));if(!_0x38cdd7)return console[_0x15daf5(0x1cd)](a4_0x33fb22['yellow'](_0x15daf5(0x1b2)),_0x15daf5(0x1c7)),0x1;}const {data:_0x2e1965}=await withSpinner(_0x15daf5(0x1ea),()=>_0x514160['llm'][_0x15daf5(0x1e0)](_0x8b0410,_0x4c5b71,{'force':_0x549fbd}));return console[_0x15daf5(0x1cd)](a4_0x33fb22[_0x15daf5(0x1d5)](_0x15daf5(0x25e)+(_0x25f69d+_0xb66799)+_0x15daf5(0x233)+_0x2e1965[_0x15daf5(0x22a)])),saveSessionContext({'llm_project':_0x2e1965['projectName']},_0x304cbf[_0x15daf5(0x23b)]),console['log'](a4_0x33fb22['green'](_0x15daf5(0x1ec)+a4_0x33fb22[_0x15daf5(0x22f)]('llm_project')+_0x15daf5(0x259)+a4_0x33fb22[_0x15daf5(0x1a8)](_0x2e1965['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x4c125e(0x251)]=a4_0x4c125e(0x1fd);[a4_0x4c125e(0x243)]=a4_0x4c125e(0x21b);async['execute'](_0xeaf8e9){const _0x341cac=a4_0x4c125e,{options:_0x3465a3,args:_0xbca9a1,tdx:_0xe8b7a9}=_0xeaf8e9,_0x3cad6f=_0xbca9a1[0x0],_0xf3c0d3=_0x3465a3['name'],_0x2cd610=_0x3465a3[_0x341cac(0x242)],_0x379e7f=_0x3465a3[_0x341cac(0x252)],_0x5c443c=_0x3465a3[_0x341cac(0x235)],_0x4b932b=_0x3465a3['llmProject'];let _0x7034b5;const _0x42d67c=findAgentConfigPath(process[_0x341cac(0x1c1)]());if(_0x3cad6f){const _0x390c43=a4_0x4d86e7[_0x341cac(0x20b)](_0x3cad6f,_0x341cac(0x1e4));existsSync(_0x390c43)?(_0x7034b5=_0x3cad6f,console['log'](a4_0x33fb22[_0x341cac(0x22f)](_0x341cac(0x237)+_0x3cad6f))):_0x7034b5=_0x3cad6f;}else{if(_0x42d67c)_0x7034b5=a4_0x4d86e7['dirname'](_0x42d67c),console[_0x341cac(0x1cd)](a4_0x33fb22[_0x341cac(0x22f)](_0x341cac(0x245)+_0x7034b5));else{if(_0x4b932b){const _0x42cc18=sanitizeForFilesystem(_0x4b932b);let _0x321871=_0x42cc18,_0x31319a=a4_0x4d86e7['join'](process[_0x341cac(0x1c1)](),_0x341cac(0x22e),_0x42cc18,_0x341cac(0x1e4));if(!existsSync(_0x31319a)){const _0x5a2d68=normalizeName(_0x4b932b),_0x4625bd=a4_0x4d86e7['join'](process['cwd'](),'agents',_0x5a2d68,'tdx.json');existsSync(_0x4625bd)&&(_0x321871=_0x5a2d68,_0x31319a=_0x4625bd);}if(existsSync(_0x31319a))_0x7034b5=a4_0x4d86e7[_0x341cac(0x20a)](_0x31319a),console['log'](a4_0x33fb22[_0x341cac(0x22f)](_0x341cac(0x237)+_0x7034b5));else{const _0x596f43=_0x3465a3[_0x341cac(0x1a0)];if(_0x596f43)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x4b932b+_0x341cac(0x1db),undefined,{'helpText':_0x341cac(0x1fc)+_0x341cac(0x1d8)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x4b932b+'\x0a')+(_0x341cac(0x1d4)+_0x321871+_0x341cac(0x24f)+(_0xf3c0d3||_0x341cac(0x19c))+_0x341cac(0x246)+_0x596f43)});_0x7034b5=_0x4b932b,console[_0x341cac(0x1cd)](a4_0x33fb22[_0x341cac(0x22f)](_0x341cac(0x1de)+_0x4b932b));}}}}if(!_0x7034b5)return console[_0x341cac(0x1cd)](a4_0x33fb22[_0x341cac(0x1af)](_0x341cac(0x223))),console[_0x341cac(0x1cd)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x341cac(0x1cd)](_0x341cac(0x230)),console[_0x341cac(0x1cd)](_0x341cac(0x260)),0x1;if(!_0xf3c0d3)throw new SDKError(ErrorCode[_0x341cac(0x1b6)],_0x341cac(0x258),undefined,{'helpText':_0x341cac(0x21f)});if(!_0x379e7f&&!_0x2cd610){if(!isInteractive())return console[_0x341cac(0x212)](a4_0x33fb22['red'](_0x341cac(0x1d6)),_0x341cac(0x1df)),console[_0x341cac(0x212)](a4_0x33fb22[_0x341cac(0x22f)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4aa6d0=await confirmKey(_0x341cac(0x1f2)+_0x7034b5+'\x22\x20to\x20new\x20project\x20\x22'+_0xf3c0d3+'\x22?');if(!_0x4aa6d0)return console['log'](a4_0x33fb22['yellow']('Cancelled')),0x1;}const {data:_0x348264}=await withSpinner(_0x341cac(0x207)+_0x7034b5+_0x341cac(0x215)+_0xf3c0d3+_0x341cac(0x213),()=>_0xe8b7a9['llm'][_0x341cac(0x205)](_0x7034b5,_0xf3c0d3,{'dryRun':_0x2cd610}));if(_0x2cd610){console[_0x341cac(0x1cd)](a4_0x33fb22[_0x341cac(0x1af)](_0x341cac(0x232))),console[_0x341cac(0x1cd)](_0x341cac(0x22d)+_0x348264[_0x341cac(0x257)]),console[_0x341cac(0x1cd)](_0x341cac(0x1f8)+_0xf3c0d3),console[_0x341cac(0x1cd)](_0x341cac(0x1a2)),console['log'](_0x341cac(0x1ae)+_0x348264[_0x341cac(0x25d)][_0x341cac(0x22e)][_0x341cac(0x198)]),console[_0x341cac(0x1cd)](_0x341cac(0x244)+_0x348264[_0x341cac(0x25d)]['knowledgeBases'][_0x341cac(0x198)]),console[_0x341cac(0x1cd)]('\x20\x20Prompts:\x20'+_0x348264[_0x341cac(0x25d)][_0x341cac(0x228)][_0x341cac(0x198)]),console[_0x341cac(0x1cd)](_0x341cac(0x227)+_0x348264[_0x341cac(0x25d)][_0x341cac(0x1c0)][_0x341cac(0x198)]),console[_0x341cac(0x1cd)](_0x341cac(0x24e)+_0x348264[_0x341cac(0x25d)][_0x341cac(0x22c)][_0x341cac(0x198)]);const _0x5d72f5=_0x348264['counts'][_0x341cac(0x1be)]['created']>0x0||_0x348264[_0x341cac(0x25d)][_0x341cac(0x1ee)]['created']>0x0;return _0x5d72f5&&(console['log'](_0x341cac(0x23a)+_0x348264['counts'][_0x341cac(0x1be)][_0x341cac(0x198)]),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+_0x348264[_0x341cac(0x25d)][_0x341cac(0x1ee)]['created'])),0x0;}const _0x5ab19d=_0x348264['counts'][_0x341cac(0x22e)][_0x341cac(0x250)]>0x0||_0x348264[_0x341cac(0x25d)][_0x341cac(0x1e9)][_0x341cac(0x250)]>0x0||_0x348264['counts'][_0x341cac(0x228)][_0x341cac(0x250)]>0x0||_0x348264[_0x341cac(0x25d)][_0x341cac(0x1c0)][_0x341cac(0x250)]>0x0||_0x348264[_0x341cac(0x25d)]['chatInterfaces']['errors']>0x0||_0x348264['counts'][_0x341cac(0x1be)]['errors']>0x0||_0x348264[_0x341cac(0x25d)][_0x341cac(0x1ee)]['errors']>0x0;_0x5ab19d?console[_0x341cac(0x1cd)](a4_0x33fb22[_0x341cac(0x1af)](_0x341cac(0x1ef))):console['log'](a4_0x33fb22[_0x341cac(0x1d5)]('Project\x20cloned\x20successfully'));console[_0x341cac(0x1cd)]('Source:\x20'+_0x348264['sourceProjectName']),console[_0x341cac(0x1cd)]('New\x20project:\x20'+_0x348264[_0x341cac(0x1ff)]),console[_0x341cac(0x1cd)](_0x341cac(0x19a)+_0x348264[_0x341cac(0x1bd)]),console[_0x341cac(0x1cd)](),console[_0x341cac(0x1cd)]('Summary:'),console[_0x341cac(0x1cd)](_0x341cac(0x1ae)+formatCountSummary(_0x348264['counts'][_0x341cac(0x22e)])),console[_0x341cac(0x1cd)](_0x341cac(0x244)+formatCountSummary(_0x348264[_0x341cac(0x25d)]['knowledgeBases'])),console[_0x341cac(0x1cd)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x348264['counts'][_0x341cac(0x228)])),console[_0x341cac(0x1cd)](_0x341cac(0x231)+formatCountSummary(_0x348264[_0x341cac(0x25d)][_0x341cac(0x236)])),console[_0x341cac(0x1cd)](_0x341cac(0x227)+formatCountSummary(_0x348264[_0x341cac(0x25d)][_0x341cac(0x1c0)])),console[_0x341cac(0x1cd)](_0x341cac(0x24e)+formatCountSummary(_0x348264[_0x341cac(0x25d)][_0x341cac(0x22c)]));const _0x182464=_0x348264[_0x341cac(0x25d)][_0x341cac(0x1be)][_0x341cac(0x198)]>0x0||_0x348264[_0x341cac(0x25d)][_0x341cac(0x1be)][_0x341cac(0x20d)]>0x0||_0x348264[_0x341cac(0x25d)][_0x341cac(0x1be)][_0x341cac(0x1b0)]>0x0||_0x348264[_0x341cac(0x25d)]['experimentalArtifacts'][_0x341cac(0x198)]>0x0||_0x348264[_0x341cac(0x25d)][_0x341cac(0x1ee)]['updated']>0x0||_0x348264[_0x341cac(0x25d)][_0x341cac(0x1ee)][_0x341cac(0x1b0)]>0x0;_0x182464&&(console[_0x341cac(0x1cd)](_0x341cac(0x23a)+formatCountSummary(_0x348264[_0x341cac(0x25d)][_0x341cac(0x1be)])),console[_0x341cac(0x1cd)](_0x341cac(0x210)+formatCountSummary(_0x348264[_0x341cac(0x25d)][_0x341cac(0x1ee)])));if(_0x5ab19d){console[_0x341cac(0x1cd)](),console[_0x341cac(0x1cd)](a4_0x33fb22[_0x341cac(0x25a)]('Errors:'));for(const _0x2a747b of _0x348264['agents']){_0x2a747b[_0x341cac(0x199)]===_0x341cac(0x212)&&console['log'](a4_0x33fb22[_0x341cac(0x25a)](_0x341cac(0x21d)+_0x2a747b[_0x341cac(0x1bb)]+_0x341cac(0x224)+_0x2a747b['error']));}for(const _0x125245 of _0x348264['knowledgeBases']){_0x125245[_0x341cac(0x199)]===_0x341cac(0x212)&&console[_0x341cac(0x1cd)](a4_0x33fb22[_0x341cac(0x25a)](_0x341cac(0x1e1)+_0x125245[_0x341cac(0x251)]+_0x341cac(0x224)+_0x125245[_0x341cac(0x212)]));}for(const _0x384d15 of _0x348264[_0x341cac(0x228)]){_0x384d15[_0x341cac(0x199)]===_0x341cac(0x212)&&console[_0x341cac(0x1cd)](a4_0x33fb22[_0x341cac(0x25a)](_0x341cac(0x1ac)+_0x384d15[_0x341cac(0x251)]+_0x341cac(0x224)+_0x384d15['error']));}for(const _0x1f9ff2 of _0x348264[_0x341cac(0x236)]){_0x1f9ff2[_0x341cac(0x199)]===_0x341cac(0x212)&&console[_0x341cac(0x1cd)](a4_0x33fb22['red'](_0x341cac(0x1c8)+_0x1f9ff2[_0x341cac(0x251)]+_0x341cac(0x224)+_0x1f9ff2[_0x341cac(0x212)]));}for(const _0x4eabe1 of _0x348264[_0x341cac(0x1c0)]){_0x4eabe1[_0x341cac(0x199)]===_0x341cac(0x212)&&console['log'](a4_0x33fb22[_0x341cac(0x25a)](_0x341cac(0x1ba)+_0x4eabe1[_0x341cac(0x251)]+_0x341cac(0x224)+_0x4eabe1['error']));}for(const _0x3a22e8 of _0x348264[_0x341cac(0x22c)]){_0x3a22e8['action']===_0x341cac(0x212)&&console[_0x341cac(0x1cd)](a4_0x33fb22[_0x341cac(0x25a)]('\x20\x20Chat\x20Interface\x20\x22'+_0x3a22e8[_0x341cac(0x251)]+_0x341cac(0x224)+_0x3a22e8[_0x341cac(0x212)]));}for(const _0x468015 of _0x348264[_0x341cac(0x1be)]){_0x468015[_0x341cac(0x199)]===_0x341cac(0x212)&&console[_0x341cac(0x1cd)](a4_0x33fb22[_0x341cac(0x25a)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x468015[_0x341cac(0x251)]+_0x341cac(0x224)+_0x468015['error']));}for(const _0x5c8ee0 of _0x348264[_0x341cac(0x1ee)]){_0x5c8ee0['action']==='error'&&console[_0x341cac(0x1cd)](a4_0x33fb22['red'](_0x341cac(0x23c)+_0x5c8ee0['name']+_0x341cac(0x224)+_0x5c8ee0[_0x341cac(0x212)]));}return 0x1;}console[_0x341cac(0x1cd)]();const _0x4b6cbf=getLLMProjectUrl(_0x5c443c,_0x348264[_0x341cac(0x1bd)]);return console[_0x341cac(0x1cd)](_0x341cac(0x1c3)+a4_0x33fb22['cyan'](_0x4b6cbf)),0x0;}}function a4_0x2cd7(_0x46c460,_0x2a21a3){_0x46c460=_0x46c460-0x197;const _0x2f3da4=a4_0x2f3d();let _0x2cd70d=_0x2f3da4[_0x46c460];return _0x2cd70d;}export class AgentPushCommand extends BaseCommand{[a4_0x4c125e(0x251)]=a4_0x4c125e(0x1bf);['description']=a4_0x4c125e(0x241);async[a4_0x4c125e(0x24c)](_0x5e794e){const _0x129dc8=a4_0x4c125e,{options:_0x30f429,args:_0x4de8bb,tdx:_0xcb1243}=_0x5e794e;let _0x1ad73d=_0x4de8bb[0x0]||process['cwd']();const _0x3d8fa2=_0x30f429['dryRun'],_0xb96e92=_0x30f429[_0x129dc8(0x225)],_0x1b68e7=_0x30f429['yes'],_0x5c9106=_0x30f429[_0x129dc8(0x235)],_0x4f72ad=a4_0x4d86e7[_0x129dc8(0x20b)](_0x1ad73d,_0x129dc8(0x1aa)),_0x1a71ba=existsSync(_0x4f72ad);if(_0x1a71ba){const {data:_0xb8f1b0}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x1ad73d+_0x129dc8(0x213),()=>_0xcb1243[_0x129dc8(0x1ce)][_0x129dc8(0x204)](_0x1ad73d,{'dryRun':_0x3d8fa2,'force':_0xb96e92}));if(_0x3d8fa2)return console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x1af)](_0x129dc8(0x232))),console[_0x129dc8(0x1cd)](_0x129dc8(0x202)+_0xb8f1b0[_0x129dc8(0x1bb)]),0x0;if(_0xb8f1b0[_0x129dc8(0x199)]===_0x129dc8(0x212))return console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x25a)](_0x129dc8(0x255)+_0xb8f1b0[_0x129dc8(0x212)])),0x1;console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x1d5)](_0x129dc8(0x1f4)+_0xb8f1b0[_0x129dc8(0x199)]+_0x129dc8(0x1b7))),console[_0x129dc8(0x1cd)](_0x129dc8(0x1ca)+_0xb8f1b0['agentName']);if(_0xb8f1b0[_0x129dc8(0x1e3)]&&_0xb8f1b0[_0x129dc8(0x208)]){const _0x9df479=getLLMAgentChatUrl(_0x5c9106,_0xb8f1b0[_0x129dc8(0x208)],_0xb8f1b0[_0x129dc8(0x1e3)]);console[_0x129dc8(0x1cd)](_0x129dc8(0x1b8)+a4_0x33fb22[_0x129dc8(0x1a8)](_0x9df479));}return 0x0;}const _0x33307f=_0x30f429[_0x129dc8(0x19d)],_0x2143e7=resolveProjectFromContext(_0x1ad73d,_0x33307f);if(_0x2143e7[_0x129dc8(0x240)])_0x1ad73d=_0x2143e7[_0x129dc8(0x256)],_0x2143e7[_0x129dc8(0x1a9)]===_0x129dc8(0x249)&&console[_0x129dc8(0x1cd)](a4_0x33fb22['dim'](_0x129dc8(0x239)+_0x1ad73d));else{let _0x4709c1=_0x129dc8(0x1a7);_0x2143e7[_0x129dc8(0x1f9)]===_0x129dc8(0x214)&&(_0x4709c1=_0x2143e7['message']+_0x129dc8(0x221)+_0x2143e7[_0x129dc8(0x19d)]+_0x129dc8(0x234));throw new SDKError(ErrorCode[_0x129dc8(0x203)],_0x2143e7[_0x129dc8(0x1f9)]===_0x129dc8(0x1cc)?_0x2143e7['message']:_0x129dc8(0x218)+_0x1ad73d,undefined,{'helpText':_0x4709c1});}const {data:_0x3c217b}=await withSpinner(_0x129dc8(0x219),()=>_0xcb1243[_0x129dc8(0x1ce)]['pushProject'](_0x1ad73d,{'dryRun':!![]})),_0x10d080=_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x22e)][_0x129dc8(0x250)]>0x0;if(_0x10d080){console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x25a)](_0x129dc8(0x226)));for(const _0x113424 of _0x3c217b['agents']){_0x113424[_0x129dc8(0x199)]===_0x129dc8(0x212)&&console['log'](a4_0x33fb22[_0x129dc8(0x25a)](_0x129dc8(0x21d)+_0x113424[_0x129dc8(0x1bb)]+_0x129dc8(0x224)+_0x113424[_0x129dc8(0x212)]));}return 0x1;}const _0x5a04ba=_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x22e)][_0x129dc8(0x198)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1e9)][_0x129dc8(0x198)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x22b)][_0x129dc8(0x198)]+_0x3c217b['counts']['prompts'][_0x129dc8(0x198)]+_0x3c217b[_0x129dc8(0x25d)]['integrations'][_0x129dc8(0x198)]+_0x3c217b['counts']['experimentalKnowledgeBases'][_0x129dc8(0x198)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1ee)]['created']+_0x3c217b[_0x129dc8(0x25d)]['formInterfaces']['created']+_0x3c217b[_0x129dc8(0x25d)]['chatInterfaces']['created'],_0x5c3e7d=_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x22e)][_0x129dc8(0x20d)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1e9)][_0x129dc8(0x20d)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x22b)]['updated']+_0x3c217b[_0x129dc8(0x25d)]['prompts']['updated']+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x236)][_0x129dc8(0x20d)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1be)]['updated']+_0x3c217b[_0x129dc8(0x25d)]['experimentalArtifacts'][_0x129dc8(0x20d)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1c0)][_0x129dc8(0x20d)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x22c)][_0x129dc8(0x20d)],_0x3f7164=_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x22e)][_0x129dc8(0x1b0)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1e9)][_0x129dc8(0x1b0)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x22b)][_0x129dc8(0x1b0)]+_0x3c217b['counts'][_0x129dc8(0x228)][_0x129dc8(0x1b0)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x236)]['unchanged']+_0x3c217b[_0x129dc8(0x25d)]['experimentalKnowledgeBases'][_0x129dc8(0x1b0)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1ee)][_0x129dc8(0x1b0)]+_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1c0)]['unchanged']+_0x3c217b['counts']['chatInterfaces'][_0x129dc8(0x1b0)];console[_0x129dc8(0x1cd)]('\x0aPush\x20summary\x20for\x20\x27'+_0x3c217b['projectName']+'\x27:'),console[_0x129dc8(0x1cd)]('\x20\x20'+a4_0x33fb22[_0x129dc8(0x1d5)]('+\x20'+_0x5a04ba+_0x129dc8(0x23e))+_0x129dc8(0x20e)+a4_0x33fb22['yellow']('~\x20'+_0x5c3e7d+_0x129dc8(0x200))+_0x129dc8(0x20e)+a4_0x33fb22[_0x129dc8(0x22f)]('=\x20'+_0x3f7164+_0x129dc8(0x19f))),console[_0x129dc8(0x1cd)](_0x129dc8(0x1ae)+formatCountSummary(_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x22e)])),console['log'](_0x129dc8(0x244)+formatCountSummary(_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1e9)])),console[_0x129dc8(0x1cd)](_0x129dc8(0x1fe)+formatCountSummary(_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x22b)])),console['log'](_0x129dc8(0x254)+formatCountSummary(_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x228)])),console[_0x129dc8(0x1cd)](_0x129dc8(0x231)+formatCountSummary(_0x3c217b['counts'][_0x129dc8(0x236)])),console[_0x129dc8(0x1cd)](_0x129dc8(0x227)+formatCountSummary(_0x3c217b['counts'][_0x129dc8(0x1c0)])),console['log'](_0x129dc8(0x24e)+formatCountSummary(_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x22c)]));const _0x48cf31=_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1be)][_0x129dc8(0x198)]>0x0||_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1be)][_0x129dc8(0x20d)]>0x0||_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1be)][_0x129dc8(0x1b0)]>0x0||_0x3c217b[_0x129dc8(0x25d)]['experimentalArtifacts'][_0x129dc8(0x198)]>0x0||_0x3c217b['counts'][_0x129dc8(0x1ee)][_0x129dc8(0x20d)]>0x0||_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1ee)][_0x129dc8(0x1b0)]>0x0;_0x48cf31&&(console['log'](_0x129dc8(0x23a)+formatCountSummary(_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1be)])),console[_0x129dc8(0x1cd)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x3c217b[_0x129dc8(0x25d)][_0x129dc8(0x1ee)])));console[_0x129dc8(0x1cd)]('\x20\x20Source:\x20'+a4_0x33fb22['cyan'](_0x1ad73d)),displayDiffs(_0x3c217b[_0x129dc8(0x22e)],_0x3c217b['knowledgeBases'],_0x3c217b['textKnowledgeBases'],_0x3c217b[_0x129dc8(0x228)],_0x3c217b[_0x129dc8(0x236)],_0x3c217b[_0x129dc8(0x1be)],_0x3c217b[_0x129dc8(0x1ee)],_0x3c217b[_0x129dc8(0x1c0)],_0x3c217b['chatInterfaces']);if(_0x3d8fa2)return console['log'](a4_0x33fb22['yellow'](_0x129dc8(0x1ab))),0x0;if(_0x5a04ba===0x0&&_0x5c3e7d===0x0){console[_0x129dc8(0x1cd)](a4_0x33fb22['green']('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x2de877=getLLMProjectUrl(_0x5c9106,_0x3c217b[_0x129dc8(0x208)]);return console[_0x129dc8(0x1cd)](_0x129dc8(0x1c3)+a4_0x33fb22[_0x129dc8(0x1a8)](_0x2de877)),0x0;}if(!_0x1b68e7&&!_0xb96e92){if(!isInteractive())return console[_0x129dc8(0x212)](a4_0x33fb22[_0x129dc8(0x25a)](_0x129dc8(0x1d6)),_0x129dc8(0x1df)),console['error'](a4_0x33fb22[_0x129dc8(0x22f)](_0x129dc8(0x1c4))),0x1;const _0x21d5a0=await confirmKey(_0x129dc8(0x1a4)+(_0x5a04ba+_0x5c3e7d)+'\x20resources?');if(!_0x21d5a0)return console[_0x129dc8(0x1cd)](a4_0x33fb22['yellow']('Cancelled'),_0x129dc8(0x247)),0x1;}const {data:_0x3631ec}=await withSpinner(_0x129dc8(0x1c5),()=>_0xcb1243[_0x129dc8(0x1ce)][_0x129dc8(0x25f)](_0x1ad73d,{'force':_0xb96e92})),_0x461485=_0x3631ec[_0x129dc8(0x25d)]['agents']['errors']>0x0||_0x3631ec[_0x129dc8(0x25d)][_0x129dc8(0x1e9)]['errors']>0x0||_0x3631ec['counts']['textKnowledgeBases']['errors']>0x0||_0x3631ec[_0x129dc8(0x25d)][_0x129dc8(0x228)][_0x129dc8(0x250)]>0x0||_0x3631ec[_0x129dc8(0x25d)][_0x129dc8(0x1c0)][_0x129dc8(0x250)]>0x0||_0x3631ec['counts'][_0x129dc8(0x22c)][_0x129dc8(0x250)]>0x0;if(_0x461485){console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x1af)](_0x129dc8(0x20c))),console[_0x129dc8(0x1cd)](),console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x25a)](_0x129dc8(0x1da)));for(const _0x315e9c of _0x3631ec[_0x129dc8(0x22e)]){_0x315e9c['action']===_0x129dc8(0x212)&&console[_0x129dc8(0x1cd)](a4_0x33fb22['red']('\x20\x20Agent\x20\x22'+_0x315e9c['agentName']+'\x22:\x20'+_0x315e9c['error']));}for(const _0x50ab99 of _0x3631ec[_0x129dc8(0x1e9)]){_0x50ab99[_0x129dc8(0x199)]===_0x129dc8(0x212)&&console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x25a)](_0x129dc8(0x1e1)+_0x50ab99[_0x129dc8(0x251)]+_0x129dc8(0x224)+_0x50ab99[_0x129dc8(0x212)]));}for(const _0x2f09e0 of _0x3631ec[_0x129dc8(0x22b)]){_0x2f09e0[_0x129dc8(0x199)]===_0x129dc8(0x212)&&console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x25a)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x2f09e0[_0x129dc8(0x251)]+'\x22:\x20'+_0x2f09e0[_0x129dc8(0x212)]));}for(const _0x5e4bb6 of _0x3631ec[_0x129dc8(0x228)]){_0x5e4bb6[_0x129dc8(0x199)]===_0x129dc8(0x212)&&console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x25a)](_0x129dc8(0x1ac)+_0x5e4bb6[_0x129dc8(0x251)]+_0x129dc8(0x224)+_0x5e4bb6[_0x129dc8(0x212)]));}for(const _0x5a9e8f of _0x3631ec['integrations']){_0x5a9e8f[_0x129dc8(0x199)]==='error'&&console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x25a)](_0x129dc8(0x1c8)+_0x5a9e8f['name']+'\x22:\x20'+_0x5a9e8f['error']));}for(const _0x2eb24d of _0x3631ec[_0x129dc8(0x1c0)]){_0x2eb24d[_0x129dc8(0x199)]===_0x129dc8(0x212)&&console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x25a)](_0x129dc8(0x1ba)+_0x2eb24d[_0x129dc8(0x251)]+_0x129dc8(0x224)+_0x2eb24d[_0x129dc8(0x212)]));}for(const _0x39532a of _0x3631ec['chatInterfaces']){_0x39532a['action']===_0x129dc8(0x212)&&console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x25a)](_0x129dc8(0x19e)+_0x39532a[_0x129dc8(0x251)]+_0x129dc8(0x224)+_0x39532a['error']));}return 0x1;}console[_0x129dc8(0x1cd)](a4_0x33fb22[_0x129dc8(0x1d5)](_0x129dc8(0x1c2)+(_0x5a04ba+_0x5c3e7d)+_0x129dc8(0x1f3)+_0x3631ec[_0x129dc8(0x21a)]+'\x27'));const _0x5e2c58=getLLMProjectUrl(_0x5c9106,_0x3631ec[_0x129dc8(0x208)]);return console[_0x129dc8(0x1cd)](_0x129dc8(0x1c3)+a4_0x33fb22[_0x129dc8(0x1a8)](_0x5e2c58)),0x0;}}
1
+ const a4_0x549600=a4_0xbb5b;(function(_0x237890,_0x1db34c){const _0x50bbb9=a4_0xbb5b,_0x232ce2=_0x237890();while(!![]){try{const _0x5cded7=parseInt(_0x50bbb9(0x15c))/0x1*(parseInt(_0x50bbb9(0x1af))/0x2)+parseInt(_0x50bbb9(0x11d))/0x3+-parseInt(_0x50bbb9(0x120))/0x4+-parseInt(_0x50bbb9(0x17c))/0x5+parseInt(_0x50bbb9(0x14b))/0x6+parseInt(_0x50bbb9(0x13e))/0x7+-parseInt(_0x50bbb9(0x195))/0x8;if(_0x5cded7===_0x1db34c)break;else _0x232ce2['push'](_0x232ce2['shift']());}catch(_0xb6d205){_0x232ce2['push'](_0x232ce2['shift']());}}}(a4_0x368c,0xbe9ae));function a4_0xbb5b(_0xfa9cf0,_0x32c5a9){_0xfa9cf0=_0xfa9cf0-0xf0;const _0x368ccd=a4_0x368c();let _0xbb5b98=_0x368ccd[_0xfa9cf0];return _0xbb5b98;}import a4_0x14909e from'chalk';import a4_0x5c659c from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a4_0x368c(){const _0x16397d=['llm','description','pullAgent','Project:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','session','\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','repeat','no_context','Agent\x20','arg-dir','\x20resources\x20to\x20\x27','Dry\x20run\x20-\x20no\x20files\x20written','Dry\x20run\x20-\x20no\x20changes\x20made','\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','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','hasChanges','unchanged','log','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','2410842UaTpfz','Failed\x20to\x20push\x20agent:\x20','tdx.json','llmProject','isNew','\x20\x20Agent\x20\x22','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','context','Would\x20push\x20agent:\x20','agent:clone','\x22\x20to\x20\x22','9246180ivkpYJ','experimentalArtifacts','\x20changed','\x20|\x20','New\x20project\x20name\x20is\x20required','Cancelled','\x20\x20Knowledge\x20Base\x20\x22','Summary:','\x20\x20Experimental\x20Artifacts:\x20','Clone\x20\x22','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)','updated','\x20\x20Knowledge\x20Bases:\x20','projectDir','agent:push','textKnowledgeBases','Chat:\x20','365281isKrlv','counts','\x27\x20to\x20create\x20the\x20folder\x20structure.','pushAgent','Source:\x20','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','execute','\x0aChanges\x20to\x20agent\x20\x27','\x20\x20Form\x20Interface\x20\x22','Using\x20local\x20project:\x20','dim','outputPath','agent','Using\x20project\x20from\x20context:\x20','\x0aPull\x20summary\x20for\x20\x27','error','\x0aChanges:','cloneProject','\x20--profile\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','pullProject','parse','created','\x20\x20Text\x20Knowledge\x20Bases:\x20','INVALID_ARGUMENT','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','green','experimentalKnowledgeBases','\x20\x20Prompts:\x20','reason','\x0aProject\x20pushed\x20with\x20errors','-\x20nothing\x20pushed','7348375vGCBOY','Status:\x20','\x20\x20Prompt\x20\x22','Output\x20path:\x20','<new-name>','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20\x20Agents:\x20','\x20\x20Chat\x20Interfaces:\x20','formInterfaces','yellow','\x0aPush\x20summary\x20for\x20\x27','\x20\x20Integration\x20\x22','\x0a✔\x20Pulled\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','total','\x20\x20Text\x20Knowledge\x20Base\x20\x22','gray','new','✔\x20Context\x20set:\x20','Would\x20pull\x20agent:\x20','errors','\x20resources?','red','\x20\x20Integrations:\x20','\x0aPush\x20','3145328nPGPoq','dryRun','\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)','\x22\x20to\x20new\x20project\x20\x22','prompts','cyan','New\x20project\x20ID:\x20','output','\x20\x20Form\x20Interfaces:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x22:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Pushing\x20to\x20project...','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','New\x20project:\x20','\x0aChanges\x20to\x20integration\x20\x27','Writing\x20files...','projectName','Using\x20project:\x20','\x20\x20Source:\x20','Cloning\x20\x22','Cannot\x20clone\x20from\x20context\x20project\x20\x22','name','Output:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','sourceProjectName','4kdklKy','integrations','\x20unchanged','Would\x20clone:','cwd-config','\x0aErrors\x20found:','diff','pushProject','found','message','\x20updated','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','No\x20tdx.json\x20found\x20in\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Analyzing\x20changes\x20to\x20push...','action','cwd','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','dirname','Pushing\x20agent\x20from\x20\x22','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20files?','projectId','\x22...','llm_project','force','agents','agentId','Pulling\x20agent\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','yes','no_local_folder','chatInterfaces','\x20--name\x20','\x22\x20to\x20a\x20different\x20profile','Errors:','knowledgeBases','Using\x20context\x20project:\x20','-\x20no\x20files\x20written','\x20files\x20to\x20','join','push','\x20\x20Chat\x20Interface\x20\x22','\x0aChanges\x20to\x20form\x20interface\x20\x27','Analyzing\x20project\x20\x22','Using\x20current\x20project:\x20','site','1527471oqTVFQ','\x20errors','agentName','1926384eCXtGU','Agent\x20pulled\x20successfully','\x0aError:','MISSING_ARGUMENT','\x20new','\x0a✔\x20Pushed\x20','agent:pull','outputDir','newProjectId','\x20\x20tdx\x20agent\x20clone\x20agents/'];a4_0x368c=function(){return _0x16397d;};return a4_0x368c();}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(_0x1a7f3a){const _0x1cf49d=a4_0xbb5b,_0x215791=[];if(_0x1a7f3a[_0x1cf49d(0x18a)]!==undefined)_0x215791[_0x1cf49d(0x117)](_0x1a7f3a['total']+'\x20total');if(_0x1a7f3a['new']!==undefined&&_0x1a7f3a[_0x1cf49d(0x18d)]>0x0)_0x215791['push'](a4_0x14909e[_0x1cf49d(0x176)](_0x1a7f3a[_0x1cf49d(0x18d)]+_0x1cf49d(0x124)));if(_0x1a7f3a[_0x1cf49d(0x172)]!==undefined&&_0x1a7f3a[_0x1cf49d(0x172)]>0x0)_0x215791[_0x1cf49d(0x117)](a4_0x14909e[_0x1cf49d(0x176)](_0x1a7f3a['created']+'\x20created'));if(_0x1a7f3a[_0x1cf49d(0x156)]!==undefined&&_0x1a7f3a[_0x1cf49d(0x156)]>0x0)_0x215791[_0x1cf49d(0x117)](a4_0x14909e[_0x1cf49d(0x185)](_0x1a7f3a[_0x1cf49d(0x156)]+_0x1cf49d(0xf7)));if(_0x1a7f3a[_0x1cf49d(0x13b)]!==undefined&&_0x1a7f3a[_0x1cf49d(0x13b)]>0x0)_0x215791[_0x1cf49d(0x117)](a4_0x14909e[_0x1cf49d(0x18c)](_0x1a7f3a['unchanged']+'\x20unchanged'));if(_0x1a7f3a['errors']!==undefined&&_0x1a7f3a['errors']>0x0)_0x215791['push'](a4_0x14909e[_0x1cf49d(0x192)](_0x1a7f3a[_0x1cf49d(0x190)]+_0x1cf49d(0x11e)));return _0x215791[_0x1cf49d(0x116)](',\x20');}function displayDiffs(_0x48adb1,_0x298635,_0x49f943,_0x553da2,_0xdb380d,_0x58803c,_0x3a8075,_0x5ce417,_0x15d04b){const _0x1c7a80=a4_0xbb5b;for(const _0x250a0f of _0x48adb1){if(_0x250a0f[_0x1c7a80(0xf3)]){const _0x594773=_0x250a0f['agentName']||_0x250a0f[_0x1c7a80(0x1ab)];console[_0x1c7a80(0x13c)](_0x1c7a80(0x163)+_0x594773+'\x27:'),console[_0x1c7a80(0x13c)]('─'[_0x1c7a80(0x131)](0x3c)),console[_0x1c7a80(0x13c)](_0x250a0f[_0x1c7a80(0xf3)]),console[_0x1c7a80(0x13c)]('─'[_0x1c7a80(0x131)](0x3c));}}for(const _0x52a0d0 of _0x298635){_0x52a0d0[_0x1c7a80(0xf3)]&&(console['log'](_0x1c7a80(0x146)+_0x52a0d0[_0x1c7a80(0x1ab)]+'\x27:'),console[_0x1c7a80(0x13c)]('─'[_0x1c7a80(0x131)](0x3c)),console['log'](_0x52a0d0['diff']),console[_0x1c7a80(0x13c)]('─'[_0x1c7a80(0x131)](0x3c)));}for(const _0x55cd40 of _0x49f943){_0x55cd40[_0x1c7a80(0xf3)]&&(console[_0x1c7a80(0x13c)](_0x1c7a80(0x101)+_0x55cd40[_0x1c7a80(0x1ab)]+'\x27:'),console['log']('─'[_0x1c7a80(0x131)](0x3c)),console[_0x1c7a80(0x13c)](_0x55cd40[_0x1c7a80(0xf3)]),console[_0x1c7a80(0x13c)]('─'[_0x1c7a80(0x131)](0x3c)));}for(const _0xead8ae of _0x553da2){_0xead8ae['diff']&&(console[_0x1c7a80(0x13c)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0xead8ae[_0x1c7a80(0x1ab)]+'\x27:'),console[_0x1c7a80(0x13c)]('─'['repeat'](0x3c)),console[_0x1c7a80(0x13c)](_0xead8ae[_0x1c7a80(0xf3)]),console[_0x1c7a80(0x13c)]('─'['repeat'](0x3c)));}for(const _0xbf9ef8 of _0xdb380d){_0xbf9ef8['diff']&&(console['log'](_0x1c7a80(0x1a4)+_0xbf9ef8[_0x1c7a80(0x1ab)]+'\x27:'),console[_0x1c7a80(0x13c)]('─'[_0x1c7a80(0x131)](0x3c)),console[_0x1c7a80(0x13c)](_0xbf9ef8[_0x1c7a80(0xf3)]),console['log']('─'[_0x1c7a80(0x131)](0x3c)));}for(const _0x3a7922 of _0x58803c){_0x3a7922[_0x1c7a80(0xf3)]&&(console['log'](_0x1c7a80(0x181)+_0x3a7922[_0x1c7a80(0x1ab)]+'\x27:'),console['log']('─'[_0x1c7a80(0x131)](0x3c)),console[_0x1c7a80(0x13c)](_0x3a7922[_0x1c7a80(0xf3)]),console[_0x1c7a80(0x13c)]('─'[_0x1c7a80(0x131)](0x3c)));}for(const _0x3cfe72 of _0x3a8075){_0x3cfe72[_0x1c7a80(0xf3)]&&(console[_0x1c7a80(0x13c)](_0x1c7a80(0x161)+_0x3cfe72['name']+'\x27:'),console[_0x1c7a80(0x13c)]('─'[_0x1c7a80(0x131)](0x3c)),console[_0x1c7a80(0x13c)](_0x3cfe72[_0x1c7a80(0xf3)]),console[_0x1c7a80(0x13c)]('─'[_0x1c7a80(0x131)](0x3c)));}for(const _0x273c32 of _0x5ce417){_0x273c32[_0x1c7a80(0xf3)]&&(console['log'](_0x1c7a80(0x119)+_0x273c32['name']+'\x27:'),console['log']('─'['repeat'](0x3c)),console['log'](_0x273c32[_0x1c7a80(0xf3)]),console['log']('─'[_0x1c7a80(0x131)](0x3c)));}for(const _0x3238fd of _0x15d04b){_0x3238fd[_0x1c7a80(0xf3)]&&(console[_0x1c7a80(0x13c)]('\x0aChanges\x20to\x20chat\x20interface\x20\x27'+_0x3238fd[_0x1c7a80(0x1ab)]+'\x27:'),console['log']('─'[_0x1c7a80(0x131)](0x3c)),console[_0x1c7a80(0x13c)](_0x3238fd['diff']),console['log']('─'[_0x1c7a80(0x131)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x549600(0x1ab)]=a4_0x549600(0x126);['description']=a4_0x549600(0x189);async[a4_0x549600(0x162)](_0x1a3c3e){const _0x3771f6=a4_0x549600,{options:_0xb4d88e,args:_0x5c0082,tdx:_0x4d8a1d}=_0x1a3c3e,_0x1c91dd=_0x5c0082[0x0],_0x517391=_0x5c0082[0x1],_0x2d5d89=_0xb4d88e[_0x3771f6(0x19c)],_0x43fea9=_0xb4d88e['dryRun'],_0xe07cb5=_0xb4d88e['force'],_0x4e1ffa=_0xb4d88e[_0x3771f6(0x10c)],_0x1612a4=_0xb4d88e[_0x3771f6(0x141)],_0x470c63=_0xb4d88e[_0x3771f6(0x168)];let _0x2f9e32;if(_0x1c91dd){const _0x3de12c=a4_0x5c659c[_0x3771f6(0x116)](_0x1c91dd,_0x3771f6(0x140));if(existsSync(_0x3de12c))try{const _0x48ed40=JSON[_0x3771f6(0x171)](readFileSync(_0x3de12c,'utf-8'));_0x48ed40[_0x3771f6(0x106)]&&(_0x2f9e32={'llm_project':_0x48ed40[_0x3771f6(0x106)]});}catch{}}const _0x51c181=findAgentConfigPath(process[_0x3771f6(0xfd)]());let _0x243a6b;if(_0x51c181)try{const _0x1049f1=JSON[_0x3771f6(0x171)](readFileSync(_0x51c181,'utf-8'));_0x1049f1['llm_project']&&(_0x243a6b={'llm_project':_0x1049f1[_0x3771f6(0x106)]});}catch{}const _0x25789=resolveAgentPullArgs({'arg':_0x1c91dd,'agentNameArg':_0x517391,'agentFlag':_0x470c63,'contextProject':_0x1612a4,'argDirConfig':_0x2f9e32,'cwdConfigPath':_0x51c181||undefined,'cwdConfig':_0x243a6b}),{projectNameOrId:_0x516cac,targetAgentName:_0x2be31e,existingOutputDir:_0x4bd334,source:_0x18574b}=_0x25789;if(_0x18574b===_0x3771f6(0x134))console['log'](a4_0x14909e[_0x3771f6(0x166)]('Using\x20project\x20from\x20'+a4_0x5c659c['join'](_0x1c91dd,_0x3771f6(0x140))+':\x20'+_0x516cac));else{if(_0x18574b===_0x3771f6(0xf1))console[_0x3771f6(0x13c)](a4_0x14909e['dim'](_0x3771f6(0x1a7)+_0x516cac));else _0x18574b===_0x3771f6(0x147)&&console[_0x3771f6(0x13c)](a4_0x14909e['dim'](_0x3771f6(0x169)+_0x516cac));}if(!_0x516cac)return _0x470c63?(console['log'](a4_0x14909e[_0x3771f6(0x185)](_0x3771f6(0xfa))),console[_0x3771f6(0x13c)](_0x3771f6(0x144)),console[_0x3771f6(0x13c)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console['log'](a4_0x14909e[_0x3771f6(0x185)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x3771f6(0x13c)](_0x3771f6(0x155)),console[_0x3771f6(0x13c)](_0x3771f6(0x130)),console['log']('\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[_0x3771f6(0x13c)](_0x3771f6(0x138)),console['log'](_0x3771f6(0x10b))),0x1;if(_0x2be31e){const {data:_0x15a0ca}=await withSpinner(_0x3771f6(0x10a)+_0x2be31e+'\x22\x20from\x20project\x20\x22'+_0x516cac+_0x3771f6(0x105),()=>_0x4d8a1d['llm'][_0x3771f6(0x12c)](_0x516cac,_0x2be31e,_0x2d5d89,{'dryRun':_0x43fea9,'force':_0xe07cb5}));if(_0x43fea9)return console[_0x3771f6(0x13c)](a4_0x14909e[_0x3771f6(0x185)](_0x3771f6(0x136))),console[_0x3771f6(0x13c)](_0x3771f6(0x18f)+_0x15a0ca['agentName']),console[_0x3771f6(0x13c)](_0x3771f6(0x17f)+_0x15a0ca[_0x3771f6(0x167)]),_0x15a0ca['diff']&&(console[_0x3771f6(0x13c)](_0x3771f6(0x16c)),console['log']('─'[_0x3771f6(0x131)](0x3c)),console[_0x3771f6(0x13c)](_0x15a0ca[_0x3771f6(0xf3)]),console[_0x3771f6(0x13c)]('─'[_0x3771f6(0x131)](0x3c))),0x0;return console[_0x3771f6(0x13c)](a4_0x14909e['green'](_0x3771f6(0x121))),console['log']('Agent:\x20'+_0x15a0ca[_0x3771f6(0x11f)]),console[_0x3771f6(0x13c)](_0x3771f6(0x1ac)+_0x15a0ca[_0x3771f6(0x167)]),console['log'](_0x3771f6(0x17d)+(_0x15a0ca[_0x3771f6(0x142)]?a4_0x14909e[_0x3771f6(0x176)](_0x3771f6(0x18d)):_0x15a0ca[_0x3771f6(0x13a)]?a4_0x14909e[_0x3771f6(0x185)](_0x3771f6(0x156)):a4_0x14909e[_0x3771f6(0x18c)](_0x3771f6(0x13b)))),0x0;}const _0x4af933=_0x4bd334||_0x2d5d89,{data:_0x45ab5b}=await withSpinner(_0x3771f6(0x11a)+_0x516cac+_0x3771f6(0x105),()=>_0x4d8a1d[_0x3771f6(0x12a)][_0x3771f6(0x170)](_0x516cac,_0x4af933,{'dryRun':!![]})),_0x584d32=_0x45ab5b[_0x3771f6(0x15d)]['agents'][_0x3771f6(0x18d)]+_0x45ab5b[_0x3771f6(0x15d)][_0x3771f6(0x112)][_0x3771f6(0x18d)]+_0x45ab5b[_0x3771f6(0x15d)][_0x3771f6(0x15a)][_0x3771f6(0x18d)]+_0x45ab5b[_0x3771f6(0x15d)][_0x3771f6(0x199)]['new']+_0x45ab5b[_0x3771f6(0x15d)][_0x3771f6(0x1b0)][_0x3771f6(0x18d)]+_0x45ab5b[_0x3771f6(0x15d)][_0x3771f6(0x177)][_0x3771f6(0x18d)]+_0x45ab5b['counts']['experimentalArtifacts'][_0x3771f6(0x18d)]+_0x45ab5b[_0x3771f6(0x15d)][_0x3771f6(0x184)][_0x3771f6(0x18d)]+_0x45ab5b[_0x3771f6(0x15d)]['chatInterfaces'][_0x3771f6(0x18d)],_0xbdf60b=_0x45ab5b[_0x3771f6(0x15d)]['agents']['updated']+_0x45ab5b[_0x3771f6(0x15d)][_0x3771f6(0x112)][_0x3771f6(0x156)]+_0x45ab5b[_0x3771f6(0x15d)][_0x3771f6(0x15a)][_0x3771f6(0x156)]+_0x45ab5b[_0x3771f6(0x15d)]['prompts'][_0x3771f6(0x156)]+_0x45ab5b['counts']['integrations'][_0x3771f6(0x156)]+_0x45ab5b[_0x3771f6(0x15d)][_0x3771f6(0x177)][_0x3771f6(0x156)]+_0x45ab5b[_0x3771f6(0x15d)][_0x3771f6(0x14c)][_0x3771f6(0x156)]+_0x45ab5b['counts'][_0x3771f6(0x184)][_0x3771f6(0x156)]+_0x45ab5b[_0x3771f6(0x15d)][_0x3771f6(0x10e)]['updated'],_0x311131=_0x45ab5b[_0x3771f6(0x15d)][_0x3771f6(0x108)]['unchanged']+_0x45ab5b[_0x3771f6(0x15d)][_0x3771f6(0x112)]['unchanged']+_0x45ab5b[_0x3771f6(0x15d)]['textKnowledgeBases']['unchanged']+_0x45ab5b[_0x3771f6(0x15d)]['prompts'][_0x3771f6(0x13b)]+_0x45ab5b[_0x3771f6(0x15d)][_0x3771f6(0x1b0)][_0x3771f6(0x13b)]+_0x45ab5b[_0x3771f6(0x15d)]['experimentalKnowledgeBases'][_0x3771f6(0x13b)]+_0x45ab5b[_0x3771f6(0x15d)][_0x3771f6(0x14c)][_0x3771f6(0x13b)]+_0x45ab5b[_0x3771f6(0x15d)][_0x3771f6(0x184)][_0x3771f6(0x13b)]+_0x45ab5b[_0x3771f6(0x15d)][_0x3771f6(0x10e)][_0x3771f6(0x13b)];console['log'](_0x3771f6(0x16a)+_0x45ab5b[_0x3771f6(0x1a6)]+'\x27:'),console[_0x3771f6(0x13c)]('\x20\x20'+a4_0x14909e[_0x3771f6(0x176)]('+\x20'+_0x584d32+_0x3771f6(0x124))+_0x3771f6(0x14e)+a4_0x14909e[_0x3771f6(0x185)]('~\x20'+_0xbdf60b+_0x3771f6(0x14d))+_0x3771f6(0x14e)+a4_0x14909e[_0x3771f6(0x166)]('=\x20'+_0x311131+_0x3771f6(0x1b1))),console['log'](_0x3771f6(0x182)+formatCountSummary(_0x45ab5b[_0x3771f6(0x15d)][_0x3771f6(0x108)])),console[_0x3771f6(0x13c)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x45ab5b[_0x3771f6(0x15d)][_0x3771f6(0x112)])),console[_0x3771f6(0x13c)](_0x3771f6(0x173)+formatCountSummary(_0x45ab5b[_0x3771f6(0x15d)][_0x3771f6(0x15a)])),console['log'](_0x3771f6(0x178)+formatCountSummary(_0x45ab5b[_0x3771f6(0x15d)][_0x3771f6(0x199)])),console[_0x3771f6(0x13c)](_0x3771f6(0x193)+formatCountSummary(_0x45ab5b[_0x3771f6(0x15d)][_0x3771f6(0x1b0)])),console[_0x3771f6(0x13c)](_0x3771f6(0x19d)+formatCountSummary(_0x45ab5b[_0x3771f6(0x15d)]['formInterfaces'])),console[_0x3771f6(0x13c)](_0x3771f6(0x183)+formatCountSummary(_0x45ab5b['counts'][_0x3771f6(0x10e)]));const _0x1c0160=_0x45ab5b[_0x3771f6(0x15d)]['experimentalKnowledgeBases'][_0x3771f6(0x18a)]>0x0||_0x45ab5b['counts'][_0x3771f6(0x14c)][_0x3771f6(0x18a)]>0x0;_0x1c0160&&(console[_0x3771f6(0x13c)](_0x3771f6(0x13d)+formatCountSummary(_0x45ab5b[_0x3771f6(0x15d)][_0x3771f6(0x177)])),console[_0x3771f6(0x13c)](_0x3771f6(0x153)+formatCountSummary(_0x45ab5b['counts']['experimentalArtifacts'])));console[_0x3771f6(0x13c)]('\x20\x20Target:\x20'+a4_0x14909e['cyan'](_0x45ab5b[_0x3771f6(0x127)])),displayDiffs(_0x45ab5b[_0x3771f6(0x108)],_0x45ab5b['knowledgeBases'],_0x45ab5b[_0x3771f6(0x15a)],_0x45ab5b[_0x3771f6(0x199)],_0x45ab5b[_0x3771f6(0x1b0)],_0x45ab5b['experimentalKnowledgeBases'],_0x45ab5b['experimentalArtifacts'],_0x45ab5b[_0x3771f6(0x184)],_0x45ab5b[_0x3771f6(0x10e)]);if(_0x43fea9)return console[_0x3771f6(0x13c)](a4_0x14909e['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x584d32===0x0&&_0xbdf60b===0x0)return console[_0x3771f6(0x13c)](a4_0x14909e[_0x3771f6(0x176)](_0x3771f6(0x1ad))),saveSessionContext({'llm_project':_0x45ab5b['projectName']},_0xb4d88e[_0x3771f6(0x12f)]),console[_0x3771f6(0x13c)](a4_0x14909e[_0x3771f6(0x176)](_0x3771f6(0x18e)+a4_0x14909e[_0x3771f6(0x166)](_0x3771f6(0x106))+'\x20=\x20'+a4_0x14909e['cyan'](_0x45ab5b[_0x3771f6(0x1a6)]))),0x0;if(!_0x4e1ffa&&!_0xe07cb5){if(!isInteractive())return console[_0x3771f6(0x16b)](a4_0x14909e[_0x3771f6(0x192)](_0x3771f6(0x122)),_0x3771f6(0x16f)),console[_0x3771f6(0x16b)](a4_0x14909e[_0x3771f6(0x166)](_0x3771f6(0x1a2))),0x1;const _0x3165ea=await confirmKey('\x0aWrite\x20'+(_0x584d32+_0xbdf60b)+_0x3771f6(0x103));if(!_0x3165ea)return console['log'](a4_0x14909e[_0x3771f6(0x185)](_0x3771f6(0x150)),_0x3771f6(0x114)),0x1;}const {data:_0x536720}=await withSpinner(_0x3771f6(0x1a5),()=>_0x4d8a1d['llm']['pullProject'](_0x516cac,_0x4af933,{'force':_0xe07cb5}));return console[_0x3771f6(0x13c)](a4_0x14909e['green'](_0x3771f6(0x188)+(_0x584d32+_0xbdf60b)+_0x3771f6(0x115)+_0x536720[_0x3771f6(0x127)])),saveSessionContext({'llm_project':_0x536720[_0x3771f6(0x1a6)]},_0xb4d88e[_0x3771f6(0x12f)]),console['log'](a4_0x14909e[_0x3771f6(0x176)]('✔\x20Context\x20set:\x20'+a4_0x14909e[_0x3771f6(0x166)](_0x3771f6(0x106))+'\x20=\x20'+a4_0x14909e['cyan'](_0x536720[_0x3771f6(0x1a6)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x549600(0x149);[a4_0x549600(0x12b)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async['execute'](_0x9ad7f1){const _0x296461=a4_0x549600,{options:_0x3c9ad2,args:_0x2a7af4,tdx:_0x33effe}=_0x9ad7f1,_0x4848cb=_0x2a7af4[0x0],_0xbac38a=_0x3c9ad2['name'],_0x5e81dd=_0x3c9ad2[_0x296461(0x196)],_0x4cf257=_0x3c9ad2['yes'],_0x4b6f9c=_0x3c9ad2[_0x296461(0x11c)],_0x2d0769=_0x3c9ad2['llmProject'];let _0x1d1ecd;const _0x1d5670=findAgentConfigPath(process[_0x296461(0xfd)]());if(_0x4848cb){const _0x4ddc95=a4_0x5c659c[_0x296461(0x116)](_0x4848cb,_0x296461(0x140));existsSync(_0x4ddc95)?(_0x1d1ecd=_0x4848cb,console[_0x296461(0x13c)](a4_0x14909e[_0x296461(0x166)](_0x296461(0x165)+_0x4848cb))):_0x1d1ecd=_0x4848cb;}else{if(_0x1d5670)_0x1d1ecd=a4_0x5c659c[_0x296461(0xff)](_0x1d5670),console['log'](a4_0x14909e[_0x296461(0x166)](_0x296461(0x11b)+_0x1d1ecd));else{if(_0x2d0769){const _0x196572=sanitizeForFilesystem(_0x2d0769);let _0x1785be=_0x196572,_0x4294f6=a4_0x5c659c[_0x296461(0x116)](process[_0x296461(0xfd)](),_0x296461(0x108),_0x196572,_0x296461(0x140));if(!existsSync(_0x4294f6)){const _0x1ee782=normalizeName(_0x2d0769),_0x38c8e5=a4_0x5c659c[_0x296461(0x116)](process[_0x296461(0xfd)](),_0x296461(0x108),_0x1ee782,_0x296461(0x140));existsSync(_0x38c8e5)&&(_0x1785be=_0x1ee782,_0x4294f6=_0x38c8e5);}if(existsSync(_0x4294f6))_0x1d1ecd=a4_0x5c659c[_0x296461(0xff)](_0x4294f6),console[_0x296461(0x13c)](a4_0x14909e[_0x296461(0x166)](_0x296461(0x165)+_0x1d1ecd));else{const _0xd2c73=_0x3c9ad2['profile'];if(_0xd2c73)throw new SDKError(ErrorCode[_0x296461(0x174)],_0x296461(0x1aa)+_0x2d0769+_0x296461(0x110),undefined,{'helpText':_0x296461(0x19e)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+('\x20\x20tdx\x20agent\x20pull\x20'+_0x2d0769+'\x0a')+(_0x296461(0x129)+_0x1785be+_0x296461(0x10f)+(_0xbac38a||_0x296461(0x180))+_0x296461(0x16e)+_0xd2c73)});_0x1d1ecd=_0x2d0769,console[_0x296461(0x13c)](a4_0x14909e[_0x296461(0x166)](_0x296461(0x113)+_0x2d0769));}}}}if(!_0x1d1ecd)return console[_0x296461(0x13c)](a4_0x14909e['yellow'](_0x296461(0x175))),console['log'](_0x296461(0xfe)),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console['log'](_0x296461(0x197)),console[_0x296461(0x13c)](_0x296461(0x102)),0x1;if(!_0xbac38a)throw new SDKError(ErrorCode[_0x296461(0x123)],_0x296461(0x14f),undefined,{'helpText':_0x296461(0x12e)});if(!_0x4cf257&&!_0x5e81dd){if(!isInteractive())return console[_0x296461(0x16b)](a4_0x14909e[_0x296461(0x192)](_0x296461(0x122)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x296461(0x16b)](a4_0x14909e['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4fc380=await confirmKey(_0x296461(0x154)+_0x1d1ecd+_0x296461(0x198)+_0xbac38a+'\x22?');if(!_0x4fc380)return console['log'](a4_0x14909e[_0x296461(0x185)](_0x296461(0x150))),0x1;}const {data:_0x1f9dfd}=await withSpinner(_0x296461(0x1a9)+_0x1d1ecd+_0x296461(0x14a)+_0xbac38a+_0x296461(0x105),()=>_0x33effe[_0x296461(0x12a)][_0x296461(0x16d)](_0x1d1ecd,_0xbac38a,{'dryRun':_0x5e81dd}));if(_0x5e81dd){console[_0x296461(0x13c)](a4_0x14909e[_0x296461(0x185)](_0x296461(0x137))),console[_0x296461(0x13c)](_0x296461(0x160)+_0x1f9dfd[_0x296461(0x1ae)]),console[_0x296461(0x13c)](_0x296461(0x1a3)+_0xbac38a),console['log'](_0x296461(0xf0)),console[_0x296461(0x13c)](_0x296461(0x182)+_0x1f9dfd['counts'][_0x296461(0x108)][_0x296461(0x172)]),console[_0x296461(0x13c)]('\x20\x20Knowledge\x20Bases:\x20'+_0x1f9dfd[_0x296461(0x15d)][_0x296461(0x112)]['created']),console['log']('\x20\x20Prompts:\x20'+_0x1f9dfd[_0x296461(0x15d)][_0x296461(0x199)]['created']),console['log']('\x20\x20Form\x20Interfaces:\x20'+_0x1f9dfd[_0x296461(0x15d)][_0x296461(0x184)][_0x296461(0x172)]),console[_0x296461(0x13c)](_0x296461(0x183)+_0x1f9dfd[_0x296461(0x15d)]['chatInterfaces'][_0x296461(0x172)]);const _0xd05ac4=_0x1f9dfd[_0x296461(0x15d)][_0x296461(0x177)][_0x296461(0x172)]>0x0||_0x1f9dfd[_0x296461(0x15d)]['experimentalArtifacts']['created']>0x0;return _0xd05ac4&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x1f9dfd[_0x296461(0x15d)]['experimentalKnowledgeBases'][_0x296461(0x172)]),console['log'](_0x296461(0x153)+_0x1f9dfd[_0x296461(0x15d)][_0x296461(0x14c)][_0x296461(0x172)])),0x0;}const _0x82cd22=_0x1f9dfd[_0x296461(0x15d)][_0x296461(0x108)][_0x296461(0x190)]>0x0||_0x1f9dfd[_0x296461(0x15d)][_0x296461(0x112)][_0x296461(0x190)]>0x0||_0x1f9dfd[_0x296461(0x15d)][_0x296461(0x199)][_0x296461(0x190)]>0x0||_0x1f9dfd[_0x296461(0x15d)][_0x296461(0x184)][_0x296461(0x190)]>0x0||_0x1f9dfd[_0x296461(0x15d)][_0x296461(0x10e)][_0x296461(0x190)]>0x0||_0x1f9dfd[_0x296461(0x15d)][_0x296461(0x177)][_0x296461(0x190)]>0x0||_0x1f9dfd[_0x296461(0x15d)][_0x296461(0x14c)][_0x296461(0x190)]>0x0;_0x82cd22?console[_0x296461(0x13c)](a4_0x14909e[_0x296461(0x185)]('Project\x20cloned\x20with\x20errors')):console[_0x296461(0x13c)](a4_0x14909e[_0x296461(0x176)]('Project\x20cloned\x20successfully'));console[_0x296461(0x13c)](_0x296461(0x160)+_0x1f9dfd[_0x296461(0x1ae)]),console[_0x296461(0x13c)](_0x296461(0x1a3)+_0x1f9dfd['newProjectName']),console[_0x296461(0x13c)](_0x296461(0x19b)+_0x1f9dfd[_0x296461(0x128)]),console[_0x296461(0x13c)](),console[_0x296461(0x13c)](_0x296461(0x152)),console[_0x296461(0x13c)](_0x296461(0x182)+formatCountSummary(_0x1f9dfd[_0x296461(0x15d)][_0x296461(0x108)])),console[_0x296461(0x13c)](_0x296461(0x157)+formatCountSummary(_0x1f9dfd[_0x296461(0x15d)][_0x296461(0x112)])),console[_0x296461(0x13c)](_0x296461(0x178)+formatCountSummary(_0x1f9dfd[_0x296461(0x15d)]['prompts'])),console['log'](_0x296461(0x193)+formatCountSummary(_0x1f9dfd[_0x296461(0x15d)][_0x296461(0x1b0)])),console[_0x296461(0x13c)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x1f9dfd[_0x296461(0x15d)][_0x296461(0x184)])),console['log']('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x1f9dfd[_0x296461(0x15d)][_0x296461(0x10e)]));const _0x359edf=_0x1f9dfd[_0x296461(0x15d)][_0x296461(0x177)][_0x296461(0x172)]>0x0||_0x1f9dfd['counts'][_0x296461(0x177)][_0x296461(0x156)]>0x0||_0x1f9dfd[_0x296461(0x15d)][_0x296461(0x177)]['unchanged']>0x0||_0x1f9dfd[_0x296461(0x15d)][_0x296461(0x14c)][_0x296461(0x172)]>0x0||_0x1f9dfd[_0x296461(0x15d)][_0x296461(0x14c)][_0x296461(0x156)]>0x0||_0x1f9dfd[_0x296461(0x15d)]['experimentalArtifacts'][_0x296461(0x13b)]>0x0;_0x359edf&&(console[_0x296461(0x13c)](_0x296461(0x13d)+formatCountSummary(_0x1f9dfd[_0x296461(0x15d)]['experimentalKnowledgeBases'])),console[_0x296461(0x13c)](_0x296461(0x153)+formatCountSummary(_0x1f9dfd['counts'][_0x296461(0x14c)])));if(_0x82cd22){console['log'](),console[_0x296461(0x13c)](a4_0x14909e['red'](_0x296461(0x111)));for(const _0x7115b2 of _0x1f9dfd[_0x296461(0x108)]){_0x7115b2[_0x296461(0xfc)]==='error'&&console[_0x296461(0x13c)](a4_0x14909e[_0x296461(0x192)](_0x296461(0x143)+_0x7115b2[_0x296461(0x11f)]+_0x296461(0x19f)+_0x7115b2[_0x296461(0x16b)]));}for(const _0x367bf3 of _0x1f9dfd[_0x296461(0x112)]){_0x367bf3['action']===_0x296461(0x16b)&&console['log'](a4_0x14909e['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x367bf3[_0x296461(0x1ab)]+_0x296461(0x19f)+_0x367bf3[_0x296461(0x16b)]));}for(const _0x3b7022 of _0x1f9dfd[_0x296461(0x199)]){_0x3b7022[_0x296461(0xfc)]==='error'&&console[_0x296461(0x13c)](a4_0x14909e['red'](_0x296461(0x17e)+_0x3b7022[_0x296461(0x1ab)]+'\x22:\x20'+_0x3b7022['error']));}for(const _0x41cbcd of _0x1f9dfd[_0x296461(0x1b0)]){_0x41cbcd[_0x296461(0xfc)]===_0x296461(0x16b)&&console[_0x296461(0x13c)](a4_0x14909e['red'](_0x296461(0x187)+_0x41cbcd[_0x296461(0x1ab)]+_0x296461(0x19f)+_0x41cbcd[_0x296461(0x16b)]));}for(const _0x3d6ac9 of _0x1f9dfd[_0x296461(0x184)]){_0x3d6ac9[_0x296461(0xfc)]==='error'&&console[_0x296461(0x13c)](a4_0x14909e[_0x296461(0x192)](_0x296461(0x164)+_0x3d6ac9[_0x296461(0x1ab)]+_0x296461(0x19f)+_0x3d6ac9[_0x296461(0x16b)]));}for(const _0x5d2341 of _0x1f9dfd['chatInterfaces']){_0x5d2341['action']===_0x296461(0x16b)&&console[_0x296461(0x13c)](a4_0x14909e[_0x296461(0x192)](_0x296461(0x118)+_0x5d2341['name']+_0x296461(0x19f)+_0x5d2341['error']));}for(const _0x1101da of _0x1f9dfd[_0x296461(0x177)]){_0x1101da[_0x296461(0xfc)]===_0x296461(0x16b)&&console[_0x296461(0x13c)](a4_0x14909e[_0x296461(0x192)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x1101da[_0x296461(0x1ab)]+_0x296461(0x19f)+_0x1101da[_0x296461(0x16b)]));}for(const _0x140d2c of _0x1f9dfd[_0x296461(0x14c)]){_0x140d2c['action']===_0x296461(0x16b)&&console[_0x296461(0x13c)](a4_0x14909e[_0x296461(0x192)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x140d2c['name']+_0x296461(0x19f)+_0x140d2c['error']));}return 0x1;}console['log']();const _0x555739=getLLMProjectUrl(_0x4b6f9c,_0x1f9dfd[_0x296461(0x128)]);return console[_0x296461(0x13c)](_0x296461(0x12d)+a4_0x14909e[_0x296461(0x19a)](_0x555739)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x549600(0x1ab)]=a4_0x549600(0x159);[a4_0x549600(0x12b)]=a4_0x549600(0x145);async[a4_0x549600(0x162)](_0x4e9b23){const _0x2de2b6=a4_0x549600,{options:_0xc579b9,args:_0x15c8d5,tdx:_0x4f93fd}=_0x4e9b23;let _0xa4b359=_0x15c8d5[0x0]||process[_0x2de2b6(0xfd)]();const _0x4ef801=_0xc579b9[_0x2de2b6(0x196)],_0x4419e1=_0xc579b9[_0x2de2b6(0x107)],_0x497221=_0xc579b9[_0x2de2b6(0x10c)],_0x29b86e=_0xc579b9[_0x2de2b6(0x11c)],_0x5e560b=a4_0x5c659c[_0x2de2b6(0x116)](_0xa4b359,'agent.yml'),_0x206c1a=existsSync(_0x5e560b);if(_0x206c1a){const {data:_0x2d62a8}=await withSpinner(_0x2de2b6(0x100)+_0xa4b359+_0x2de2b6(0x105),()=>_0x4f93fd[_0x2de2b6(0x12a)][_0x2de2b6(0x15f)](_0xa4b359,{'dryRun':_0x4ef801,'force':_0x4419e1}));if(_0x4ef801)return console[_0x2de2b6(0x13c)](a4_0x14909e[_0x2de2b6(0x185)](_0x2de2b6(0x137))),console['log'](_0x2de2b6(0x148)+_0x2d62a8['agentName']),0x0;if(_0x2d62a8[_0x2de2b6(0xfc)]===_0x2de2b6(0x16b))return console[_0x2de2b6(0x13c)](a4_0x14909e[_0x2de2b6(0x192)](_0x2de2b6(0x13f)+_0x2d62a8['error'])),0x1;console['log'](a4_0x14909e[_0x2de2b6(0x176)](_0x2de2b6(0x133)+_0x2d62a8['action']+'\x20successfully')),console[_0x2de2b6(0x13c)]('Agent:\x20'+_0x2d62a8['agentName']);if(_0x2d62a8['agentId']&&_0x2d62a8['projectId']){const _0x45d584=getLLMAgentChatUrl(_0x29b86e,_0x2d62a8[_0x2de2b6(0x104)],_0x2d62a8[_0x2de2b6(0x109)]);console['log'](_0x2de2b6(0x15b)+a4_0x14909e['cyan'](_0x45d584));}return 0x0;}const _0x5152ee=_0xc579b9[_0x2de2b6(0x141)],_0x2978fa=resolveProjectFromContext(_0xa4b359,_0x5152ee);if(_0x2978fa[_0x2de2b6(0xf5)])_0xa4b359=_0x2978fa[_0x2de2b6(0x158)],_0x2978fa['source']==='context'&&console[_0x2de2b6(0x13c)](a4_0x14909e['dim'](_0x2de2b6(0x1a7)+_0xa4b359));else{let _0xe35fca='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x2978fa[_0x2de2b6(0x179)]===_0x2de2b6(0x10d)&&(_0xe35fca=_0x2978fa[_0x2de2b6(0xf6)]+_0x2de2b6(0x1a0)+_0x2978fa[_0x2de2b6(0x141)]+_0x2de2b6(0x15e));throw new SDKError(ErrorCode[_0x2de2b6(0x174)],_0x2978fa[_0x2de2b6(0x179)]===_0x2de2b6(0x132)?_0x2978fa[_0x2de2b6(0xf6)]:_0x2de2b6(0xf9)+_0xa4b359,undefined,{'helpText':_0xe35fca});}const {data:_0x2a05aa}=await withSpinner(_0x2de2b6(0xfb),()=>_0x4f93fd[_0x2de2b6(0x12a)]['pushProject'](_0xa4b359,{'dryRun':!![]})),_0x4872aa=_0x2a05aa[_0x2de2b6(0x15d)][_0x2de2b6(0x108)][_0x2de2b6(0x190)]>0x0;if(_0x4872aa){console['log'](a4_0x14909e[_0x2de2b6(0x192)](_0x2de2b6(0xf2)));for(const _0x637304 of _0x2a05aa[_0x2de2b6(0x108)]){_0x637304[_0x2de2b6(0xfc)]===_0x2de2b6(0x16b)&&console['log'](a4_0x14909e[_0x2de2b6(0x192)](_0x2de2b6(0x143)+_0x637304['agentName']+_0x2de2b6(0x19f)+_0x637304[_0x2de2b6(0x16b)]));}return 0x1;}const _0x49bd72=_0x2a05aa[_0x2de2b6(0x15d)][_0x2de2b6(0x108)]['created']+_0x2a05aa[_0x2de2b6(0x15d)][_0x2de2b6(0x112)][_0x2de2b6(0x172)]+_0x2a05aa[_0x2de2b6(0x15d)][_0x2de2b6(0x15a)][_0x2de2b6(0x172)]+_0x2a05aa[_0x2de2b6(0x15d)][_0x2de2b6(0x199)][_0x2de2b6(0x172)]+_0x2a05aa[_0x2de2b6(0x15d)]['integrations'][_0x2de2b6(0x172)]+_0x2a05aa[_0x2de2b6(0x15d)][_0x2de2b6(0x177)][_0x2de2b6(0x172)]+_0x2a05aa[_0x2de2b6(0x15d)][_0x2de2b6(0x14c)][_0x2de2b6(0x172)]+_0x2a05aa[_0x2de2b6(0x15d)][_0x2de2b6(0x184)][_0x2de2b6(0x172)]+_0x2a05aa[_0x2de2b6(0x15d)][_0x2de2b6(0x10e)][_0x2de2b6(0x172)],_0x32908c=_0x2a05aa[_0x2de2b6(0x15d)]['agents'][_0x2de2b6(0x156)]+_0x2a05aa[_0x2de2b6(0x15d)]['knowledgeBases'][_0x2de2b6(0x156)]+_0x2a05aa['counts'][_0x2de2b6(0x15a)][_0x2de2b6(0x156)]+_0x2a05aa[_0x2de2b6(0x15d)]['prompts'][_0x2de2b6(0x156)]+_0x2a05aa[_0x2de2b6(0x15d)]['integrations'][_0x2de2b6(0x156)]+_0x2a05aa[_0x2de2b6(0x15d)][_0x2de2b6(0x177)][_0x2de2b6(0x156)]+_0x2a05aa[_0x2de2b6(0x15d)][_0x2de2b6(0x14c)]['updated']+_0x2a05aa[_0x2de2b6(0x15d)]['formInterfaces'][_0x2de2b6(0x156)]+_0x2a05aa['counts'][_0x2de2b6(0x10e)][_0x2de2b6(0x156)],_0x104a8a=_0x2a05aa[_0x2de2b6(0x15d)]['agents'][_0x2de2b6(0x13b)]+_0x2a05aa[_0x2de2b6(0x15d)]['knowledgeBases']['unchanged']+_0x2a05aa['counts'][_0x2de2b6(0x15a)][_0x2de2b6(0x13b)]+_0x2a05aa[_0x2de2b6(0x15d)][_0x2de2b6(0x199)][_0x2de2b6(0x13b)]+_0x2a05aa[_0x2de2b6(0x15d)][_0x2de2b6(0x1b0)][_0x2de2b6(0x13b)]+_0x2a05aa['counts'][_0x2de2b6(0x177)][_0x2de2b6(0x13b)]+_0x2a05aa[_0x2de2b6(0x15d)][_0x2de2b6(0x14c)][_0x2de2b6(0x13b)]+_0x2a05aa[_0x2de2b6(0x15d)][_0x2de2b6(0x184)][_0x2de2b6(0x13b)]+_0x2a05aa[_0x2de2b6(0x15d)]['chatInterfaces']['unchanged'];console['log'](_0x2de2b6(0x186)+_0x2a05aa[_0x2de2b6(0x1a6)]+'\x27:'),console['log']('\x20\x20'+a4_0x14909e['green']('+\x20'+_0x49bd72+_0x2de2b6(0x124))+_0x2de2b6(0x14e)+a4_0x14909e['yellow']('~\x20'+_0x32908c+'\x20changed')+_0x2de2b6(0x14e)+a4_0x14909e[_0x2de2b6(0x166)]('=\x20'+_0x104a8a+_0x2de2b6(0x1b1))),console[_0x2de2b6(0x13c)](_0x2de2b6(0x182)+formatCountSummary(_0x2a05aa['counts'][_0x2de2b6(0x108)])),console[_0x2de2b6(0x13c)](_0x2de2b6(0x157)+formatCountSummary(_0x2a05aa[_0x2de2b6(0x15d)][_0x2de2b6(0x112)])),console[_0x2de2b6(0x13c)](_0x2de2b6(0x173)+formatCountSummary(_0x2a05aa[_0x2de2b6(0x15d)][_0x2de2b6(0x15a)])),console[_0x2de2b6(0x13c)](_0x2de2b6(0x178)+formatCountSummary(_0x2a05aa[_0x2de2b6(0x15d)][_0x2de2b6(0x199)])),console[_0x2de2b6(0x13c)](_0x2de2b6(0x193)+formatCountSummary(_0x2a05aa['counts'][_0x2de2b6(0x1b0)])),console['log'](_0x2de2b6(0x19d)+formatCountSummary(_0x2a05aa[_0x2de2b6(0x15d)]['formInterfaces'])),console[_0x2de2b6(0x13c)](_0x2de2b6(0x183)+formatCountSummary(_0x2a05aa['counts'][_0x2de2b6(0x10e)]));const _0xd2e867=_0x2a05aa[_0x2de2b6(0x15d)]['experimentalKnowledgeBases'][_0x2de2b6(0x172)]>0x0||_0x2a05aa['counts']['experimentalKnowledgeBases']['updated']>0x0||_0x2a05aa['counts'][_0x2de2b6(0x177)][_0x2de2b6(0x13b)]>0x0||_0x2a05aa[_0x2de2b6(0x15d)][_0x2de2b6(0x14c)][_0x2de2b6(0x172)]>0x0||_0x2a05aa['counts'][_0x2de2b6(0x14c)][_0x2de2b6(0x156)]>0x0||_0x2a05aa['counts']['experimentalArtifacts'][_0x2de2b6(0x13b)]>0x0;_0xd2e867&&(console[_0x2de2b6(0x13c)](_0x2de2b6(0x13d)+formatCountSummary(_0x2a05aa['counts'][_0x2de2b6(0x177)])),console[_0x2de2b6(0x13c)](_0x2de2b6(0x153)+formatCountSummary(_0x2a05aa[_0x2de2b6(0x15d)]['experimentalArtifacts'])));console[_0x2de2b6(0x13c)](_0x2de2b6(0x1a8)+a4_0x14909e[_0x2de2b6(0x19a)](_0xa4b359)),displayDiffs(_0x2a05aa['agents'],_0x2a05aa[_0x2de2b6(0x112)],_0x2a05aa[_0x2de2b6(0x15a)],_0x2a05aa[_0x2de2b6(0x199)],_0x2a05aa[_0x2de2b6(0x1b0)],_0x2a05aa[_0x2de2b6(0x177)],_0x2a05aa[_0x2de2b6(0x14c)],_0x2a05aa[_0x2de2b6(0x184)],_0x2a05aa[_0x2de2b6(0x10e)]);if(_0x4ef801)return console[_0x2de2b6(0x13c)](a4_0x14909e['yellow'](_0x2de2b6(0xf8))),0x0;if(_0x49bd72===0x0&&_0x32908c===0x0){console[_0x2de2b6(0x13c)](a4_0x14909e[_0x2de2b6(0x176)](_0x2de2b6(0x139)));const _0x55b298=getLLMProjectUrl(_0x29b86e,_0x2a05aa[_0x2de2b6(0x104)]);return console[_0x2de2b6(0x13c)](_0x2de2b6(0x12d)+a4_0x14909e[_0x2de2b6(0x19a)](_0x55b298)),0x0;}if(!_0x497221&&!_0x4419e1){if(!isInteractive())return console[_0x2de2b6(0x16b)](a4_0x14909e[_0x2de2b6(0x192)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2de2b6(0x16b)](a4_0x14909e[_0x2de2b6(0x166)](_0x2de2b6(0x1a2))),0x1;const _0x1e8cf6=await confirmKey(_0x2de2b6(0x194)+(_0x49bd72+_0x32908c)+_0x2de2b6(0x191));if(!_0x1e8cf6)return console[_0x2de2b6(0x13c)](a4_0x14909e[_0x2de2b6(0x185)](_0x2de2b6(0x150)),_0x2de2b6(0x17b)),0x1;}const {data:_0x1ed29e}=await withSpinner(_0x2de2b6(0x1a1),()=>_0x4f93fd[_0x2de2b6(0x12a)][_0x2de2b6(0xf4)](_0xa4b359,{'force':_0x4419e1})),_0x2575dc=_0x1ed29e[_0x2de2b6(0x15d)][_0x2de2b6(0x108)][_0x2de2b6(0x190)]>0x0||_0x1ed29e[_0x2de2b6(0x15d)][_0x2de2b6(0x112)][_0x2de2b6(0x190)]>0x0||_0x1ed29e[_0x2de2b6(0x15d)][_0x2de2b6(0x15a)][_0x2de2b6(0x190)]>0x0||_0x1ed29e['counts'][_0x2de2b6(0x199)][_0x2de2b6(0x190)]>0x0||_0x1ed29e[_0x2de2b6(0x15d)][_0x2de2b6(0x184)][_0x2de2b6(0x190)]>0x0||_0x1ed29e[_0x2de2b6(0x15d)][_0x2de2b6(0x10e)]['errors']>0x0;if(_0x2575dc){console[_0x2de2b6(0x13c)](a4_0x14909e[_0x2de2b6(0x185)](_0x2de2b6(0x17a))),console['log'](),console[_0x2de2b6(0x13c)](a4_0x14909e['red'](_0x2de2b6(0x111)));for(const _0xdb8265 of _0x1ed29e['agents']){_0xdb8265[_0x2de2b6(0xfc)]==='error'&&console['log'](a4_0x14909e['red']('\x20\x20Agent\x20\x22'+_0xdb8265['agentName']+'\x22:\x20'+_0xdb8265[_0x2de2b6(0x16b)]));}for(const _0x30dfd9 of _0x1ed29e[_0x2de2b6(0x112)]){_0x30dfd9[_0x2de2b6(0xfc)]===_0x2de2b6(0x16b)&&console[_0x2de2b6(0x13c)](a4_0x14909e[_0x2de2b6(0x192)](_0x2de2b6(0x151)+_0x30dfd9[_0x2de2b6(0x1ab)]+_0x2de2b6(0x19f)+_0x30dfd9[_0x2de2b6(0x16b)]));}for(const _0x524a32 of _0x1ed29e[_0x2de2b6(0x15a)]){_0x524a32[_0x2de2b6(0xfc)]===_0x2de2b6(0x16b)&&console['log'](a4_0x14909e[_0x2de2b6(0x192)](_0x2de2b6(0x18b)+_0x524a32['name']+_0x2de2b6(0x19f)+_0x524a32[_0x2de2b6(0x16b)]));}for(const _0x264c3e of _0x1ed29e[_0x2de2b6(0x199)]){_0x264c3e[_0x2de2b6(0xfc)]==='error'&&console[_0x2de2b6(0x13c)](a4_0x14909e[_0x2de2b6(0x192)](_0x2de2b6(0x17e)+_0x264c3e[_0x2de2b6(0x1ab)]+_0x2de2b6(0x19f)+_0x264c3e[_0x2de2b6(0x16b)]));}for(const _0x313948 of _0x1ed29e[_0x2de2b6(0x1b0)]){_0x313948[_0x2de2b6(0xfc)]===_0x2de2b6(0x16b)&&console[_0x2de2b6(0x13c)](a4_0x14909e['red'](_0x2de2b6(0x187)+_0x313948['name']+_0x2de2b6(0x19f)+_0x313948['error']));}for(const _0xd129a1 of _0x1ed29e[_0x2de2b6(0x184)]){_0xd129a1[_0x2de2b6(0xfc)]===_0x2de2b6(0x16b)&&console[_0x2de2b6(0x13c)](a4_0x14909e[_0x2de2b6(0x192)](_0x2de2b6(0x164)+_0xd129a1['name']+_0x2de2b6(0x19f)+_0xd129a1[_0x2de2b6(0x16b)]));}for(const _0x25f29f of _0x1ed29e[_0x2de2b6(0x10e)]){_0x25f29f[_0x2de2b6(0xfc)]===_0x2de2b6(0x16b)&&console[_0x2de2b6(0x13c)](a4_0x14909e[_0x2de2b6(0x192)](_0x2de2b6(0x118)+_0x25f29f[_0x2de2b6(0x1ab)]+_0x2de2b6(0x19f)+_0x25f29f[_0x2de2b6(0x16b)]));}return 0x1;}console[_0x2de2b6(0x13c)](a4_0x14909e[_0x2de2b6(0x176)](_0x2de2b6(0x125)+(_0x49bd72+_0x32908c)+_0x2de2b6(0x135)+_0x1ed29e[_0x2de2b6(0x1a6)]+'\x27'));const _0x48efb1=getLLMProjectUrl(_0x29b86e,_0x1ed29e[_0x2de2b6(0x104)]);return console['log'](_0x2de2b6(0x12d)+a4_0x14909e[_0x2de2b6(0x19a)](_0x48efb1)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x57d988=a5_0xbe34;(function(_0x421457,_0x2d290f){const _0x54625c=a5_0xbe34,_0x43d4a3=_0x421457();while(!![]){try{const _0x3bd55b=-parseInt(_0x54625c(0x226))/0x1*(-parseInt(_0x54625c(0x1ee))/0x2)+parseInt(_0x54625c(0x224))/0x3*(parseInt(_0x54625c(0x1cf))/0x4)+-parseInt(_0x54625c(0x1a5))/0x5+-parseInt(_0x54625c(0x1ab))/0x6+-parseInt(_0x54625c(0x1a1))/0x7+-parseInt(_0x54625c(0x228))/0x8*(-parseInt(_0x54625c(0x215))/0x9)+parseInt(_0x54625c(0x20d))/0xa;if(_0x3bd55b===_0x2d290f)break;else _0x43d4a3['push'](_0x43d4a3['shift']());}catch(_0x3e7904){_0x43d4a3['push'](_0x43d4a3['shift']());}}}(a5_0x7285,0x8d9a6));function a5_0xbe34(_0x4652a2,_0x194a5c){_0x4652a2=_0x4652a2-0x1a0;const _0x728559=a5_0x7285();let _0xbe341f=_0x728559[_0x4652a2];return _0xbe341f;}import*as a5_0x92ec42 from'node:fs';import*as a5_0x4cec4 from'node:path';import a5_0x45049c 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_0x7285(){const _0xbcc4ba=['multiple_agents','agent:test','some','round','✗\x20FAIL:\x20','tags','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','ERROR','No\x20tests\x20found\x20matching:\x20','verbose','length','executeReeval','Passed:\x20\x20\x20','10552420BZWGFo','agentDirs','conversation_url','not\x20found','✗\x20ERROR:\x20','⚠\x20SKIPPED:\x20','white','Duration:\x20','9rwxDgG','agentName','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','includes','...','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','dryRun','filter','no_context','Total:\x20\x20\x20\x20','toLowerCase','Re-evaluating\x20','map','push','Either\x20switch\x20to\x20the\x20\x22','9zSLYkg','Available\x20tags:\x20','42XXwyhf','Cached\x20run\x20from:\x20','995128Gqmdwn','dim','Re-evaluating...','tests','size','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','PASS','Executing\x20new\x20tests...','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','✓\x20PASS:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','\x27\x20to\x20create\x20the\x20folder\x20structure.','Running:\x20','Available\x20tests:\x20','rounds','message','Usage:','1879612RyPwJV','Run\x20tests\x20for\x20an\x20LLM\x20agent','jsonl','agent','4323995zdUlJu','reeval','text','FAIL','stop','split','5319414jzZjrU','\x20\x20Evaluating...\x20','repeat','test.yml','Running\x20test:\x20','description','red','Round\x201/','No\x20tests\x20have\x20tags\x20defined.','isSpinning','/<agent-name>','add','Round\x20','Re-evaluation\x20Summary','conversations','forEach','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Evaluating\x20response...','trim','\x22:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','tsv','Error\x20writing\x20output\x20file:\x20','join','toISOString','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','testYmlPath','execute','writeFileSync','yellow','Test\x20Summary','now','resolveProjectId',':\x20Sending\x20user\x20input...','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Conversation\x20URL:\x20','516692WsTPFj','\x20\x20Round\x20','site','green','existsSync','has','name','Agent:\x20','llmProject','source','Output\x20written\x20to:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','...\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','404','Cached\x20run\x20is\x20from\x20site\x20\x22','llm','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','table','\x20\x20Project:\x20','New\x20tests\x20to\x20execute:\x20','\x20-\x20','Errors:\x20\x20\x20','reason','Re-evaluating\x20cached\x20test\x20run...','\x20(new)','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','start','\x20\x20Conversation:\x20','\x20\x20Agent:\x20','status','49178hIbUBt','Project\x20path:\x20','Running\x20agent\x20tests...','\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)','projectName','substring','\x20\x20-\x20','Using\x20agent:\x20','Failed:\x20\x20\x20','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','json','log','Failed\x20Tests:','testName','\x22,\x20but\x20current\x20site\x20is\x20\x22','projectDir','no_local_folder','Tests\x20found:\x20'];a5_0x7285=function(){return _0xbcc4ba;};return a5_0x7285();}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x57d988(0x1d5)]=a5_0x57d988(0x201);[a5_0x57d988(0x1b0)]=a5_0x57d988(0x1a2);async[a5_0x57d988(0x1c6)](_0x1099e9){const _0x3e899e=a5_0x57d988,{options:_0x13c360,args:_0x573045,tdx:_0x5e46fc}=_0x1099e9,_0x41f389=_0x573045[0x0]||'.',_0xa62562=_0x13c360[_0x3e899e(0x21b)],_0x1dad33=_0x13c360,_0x529cc4=_0x1dad33['eval']===![],_0x5affbb=_0x1dad33[_0x3e899e(0x1a6)],_0x46280d=_0x1dad33[_0x3e899e(0x1d5)],_0x5721e1=_0x1dad33[_0x3e899e(0x205)],_0x442b97=_0x13c360['site'],_0x566e86=_0x1dad33['output'];if(_0x5affbb&&_0x529cc4)return console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1b1)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x1b0afa='table';if(_0x1dad33[_0x3e899e(0x1f8)])_0x1b0afa=_0x3e899e(0x1f8);else{if(_0x1dad33[_0x3e899e(0x1a3)])_0x1b0afa=_0x3e899e(0x1a3);else{if(_0x1dad33[_0x3e899e(0x1c0)])_0x1b0afa=_0x3e899e(0x1c0);else{if(_0x1dad33[_0x3e899e(0x1e1)])_0x1b0afa=_0x3e899e(0x1e1);}}}const _0x4732a0=_0x1dad33[_0x3e899e(0x1d7)];let _0x540d29=_0x41f389;const _0x553dca=a5_0x92ec42[_0x3e899e(0x1d3)](_0x41f389),_0x3cdc02=_0x41f389==='.';if(!_0x553dca||_0x3cdc02){const _0x496c08=resolveProjectFromContext(_0x41f389,_0x4732a0,{'requireFile':_0x3e899e(0x1ae)});if(_0x496c08['found'])_0x540d29=_0x496c08[_0x3e899e(0x1fd)],_0x496c08[_0x3e899e(0x1d8)]==='context'&&console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x229)](_0x3e899e(0x1f5)+_0x540d29));else switch(_0x496c08[_0x3e899e(0x1e6)]){case _0x3e899e(0x21d):console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1c8)](_0x496c08['message'])),console[_0x3e899e(0x1f9)](),console['log'](_0x3e899e(0x1a0)),console[_0x3e899e(0x1f9)](_0x3e899e(0x1f7)),console[_0x3e899e(0x1f9)](_0x3e899e(0x1f1)),console[_0x3e899e(0x1f9)](),console['log'](_0x3e899e(0x1da));return 0x1;case _0x3e899e(0x1fe):console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1c8)](_0x496c08['message'])),console['log'](),console[_0x3e899e(0x1f9)](_0x3e899e(0x1bf)+_0x496c08['llmProject']+_0x3e899e(0x233));return 0x1;case _0x3e899e(0x200):{const _0x529b00=a5_0x4cec4['basename'](_0x496c08['projectDir']);console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1c8)](_0x3e899e(0x21a)+_0x496c08[_0x3e899e(0x1d7)]+'\x22:'));for(const _0x1ca9be of _0x496c08[_0x3e899e(0x20e)]){console['log'](_0x3e899e(0x1f4)+_0x1ca9be);}return console[_0x3e899e(0x1f9)](),console[_0x3e899e(0x1f9)](_0x3e899e(0x230)+_0x529b00+_0x3e899e(0x1b5)),0x1;}case'no_tests':console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1c8)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x496c08[_0x3e899e(0x1d7)]+'\x22.')),console[_0x3e899e(0x1f9)](a5_0x45049c['dim'](_0x3e899e(0x1ef)+_0x496c08[_0x3e899e(0x1fd)])),console['log'](),console['log'](_0x3e899e(0x1c4));return 0x1;}}const {definition:_0x57959c,agentInfo:_0x101998}=parseTestFile(_0x540d29);let _0x5f00f3=_0x57959c[_0x3e899e(0x22b)];if(_0x46280d){const _0x5b5f80=_0x46280d['split'](',')[_0x3e899e(0x221)](_0x4c3e2f=>_0x4c3e2f[_0x3e899e(0x1bd)]());_0x5f00f3=_0x57959c[_0x3e899e(0x22b)][_0x3e899e(0x21c)](_0x2099c3=>_0x5b5f80[_0x3e899e(0x218)](_0x2099c3[_0x3e899e(0x1d5)]));if(_0x5f00f3[_0x3e899e(0x20a)]===0x0)return console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1c8)](_0x3e899e(0x208)+_0x46280d)),console[_0x3e899e(0x1f9)](a5_0x45049c['dim'](_0x3e899e(0x235)+_0x57959c['tests'][_0x3e899e(0x221)](_0x54f011=>_0x54f011['name'])[_0x3e899e(0x1c2)](',\x20'))),0x1;}if(_0x5721e1){const _0x4ba23f=_0x5721e1[_0x3e899e(0x1aa)](',')[_0x3e899e(0x221)](_0x46b8bb=>_0x46b8bb['trim']()['toLowerCase']());_0x5f00f3=_0x5f00f3[_0x3e899e(0x21c)](_0x13e587=>_0x13e587[_0x3e899e(0x205)]?.[_0x3e899e(0x202)](_0x1b5c51=>_0x4ba23f['includes'](_0x1b5c51[_0x3e899e(0x21f)]())));if(_0x5f00f3['length']===0x0){console[_0x3e899e(0x1f9)](a5_0x45049c['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x5721e1));const _0x258641=new Set();return _0x57959c[_0x3e899e(0x22b)][_0x3e899e(0x1ba)](_0x4731b6=>_0x4731b6[_0x3e899e(0x205)]?.[_0x3e899e(0x1ba)](_0x19b14e=>_0x258641[_0x3e899e(0x1b6)](_0x19b14e))),_0x258641[_0x3e899e(0x22c)]>0x0?console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x229)](_0x3e899e(0x225)+[..._0x258641][_0x3e899e(0x1c2)](',\x20'))):console['log'](a5_0x45049c['dim'](_0x3e899e(0x1b3))),0x1;}}if(_0x5affbb)return this['executeReeval'](_0x1099e9,{'definition':{'tests':_0x5f00f3},'agentInfo':_0x101998,'outputFormat':_0x1b0afa,'outputFile':_0x566e86,'testNames':_0x46280d});if(_0xa62562){console[_0x3e899e(0x1f9)](a5_0x45049c['cyan']('Test\x20Configuration:')),console[_0x3e899e(0x1f9)]('\x20\x20Site:\x20'+a5_0x45049c[_0x3e899e(0x213)](_0x442b97)),console[_0x3e899e(0x1f9)](_0x3e899e(0x1e2)+a5_0x45049c['white'](_0x101998['projectName'])),console[_0x3e899e(0x1f9)](_0x3e899e(0x1ec)+a5_0x45049c[_0x3e899e(0x213)](_0x101998[_0x3e899e(0x216)])),console[_0x3e899e(0x1f9)](),console[_0x3e899e(0x1f9)](_0x3e899e(0x1ff)+a5_0x45049c[_0x3e899e(0x213)](_0x5f00f3[_0x3e899e(0x20a)]));for(let _0x446af4=0x0;_0x446af4<_0x5f00f3[_0x3e899e(0x20a)];_0x446af4++){const _0xeda331=_0x5f00f3[_0x446af4],_0x145d96=_0xeda331['rounds'][_0x3e899e(0x20a)]===0x1?_0x3e899e(0x203):_0x3e899e(0x236),_0x1838f5=_0xeda331[_0x3e899e(0x205)]?.['length']?'\x20['+_0xeda331[_0x3e899e(0x205)][_0x3e899e(0x1c2)](',\x20')+']':'';console[_0x3e899e(0x1f9)]('\x20\x20'+(_0x446af4+0x1)+'.\x20'+a5_0x45049c['white'](_0xeda331['name'])+'\x20('+_0xeda331[_0x3e899e(0x236)]['length']+'\x20'+_0x145d96+')'+a5_0x45049c[_0x3e899e(0x229)](_0x1838f5));}return 0x0;}let _0x2e7ff1,_0x31aab7;try{_0x2e7ff1=await _0x5e46fc['llm'][_0x3e899e(0x1cb)](_0x101998['projectName']);}catch(_0x13a09d){const _0x438dae=_0x13a09d instanceof Error?_0x13a09d['message']:String(_0x13a09d);return _0x438dae[_0x3e899e(0x218)](_0x3e899e(0x1dd))||_0x438dae[_0x3e899e(0x21f)]()[_0x3e899e(0x218)](_0x3e899e(0x210))?console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1b1)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x101998['projectName'])):console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1b1)](_0x3e899e(0x217)+_0x101998[_0x3e899e(0x1f2)]+_0x3e899e(0x1be)+_0x438dae)),0x1;}try{_0x31aab7=await _0x5e46fc[_0x3e899e(0x1df)]['resolveAgentId'](_0x101998[_0x3e899e(0x216)],_0x2e7ff1);}catch(_0x43064a){const _0x42c496=_0x43064a instanceof Error?_0x43064a[_0x3e899e(0x237)]:String(_0x43064a);return _0x42c496[_0x3e899e(0x218)](_0x3e899e(0x1dd))||_0x42c496[_0x3e899e(0x21f)]()[_0x3e899e(0x218)](_0x3e899e(0x210))?console['log'](a5_0x45049c[_0x3e899e(0x1b1)](_0x3e899e(0x1e9)+_0x101998[_0x3e899e(0x216)])):console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1b1)](_0x3e899e(0x1dc)+_0x101998[_0x3e899e(0x216)]+_0x3e899e(0x1be)+_0x42c496)),0x1;}let _0x20d5d2;if(!_0x529cc4)try{_0x20d5d2=await setupEvaluatorAgent(_0x5e46fc[_0x3e899e(0x1df)],_0x13c360[_0x3e899e(0x209)]);}catch(_0x183909){const _0x2ef45e=_0x183909 instanceof Error?_0x183909[_0x3e899e(0x237)]:String(_0x183909);return console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1b1)](_0x3e899e(0x1cd)+_0x2ef45e)),0x1;}console[_0x3e899e(0x1f9)](a5_0x45049c['cyan'](_0x3e899e(0x1f0))),console[_0x3e899e(0x1f9)]('Site:\x20'+a5_0x45049c[_0x3e899e(0x213)](_0x442b97)),console[_0x3e899e(0x1f9)]('Agent:\x20'+a5_0x45049c[_0x3e899e(0x213)](_0x101998['projectName']+'/'+_0x101998['agentName'])),console[_0x3e899e(0x1f9)]();const _0x5dc517=[],_0x936e57=[],_0x16a589=Date['now']();for(let _0xdb8dff=0x0;_0xdb8dff<_0x5f00f3[_0x3e899e(0x20a)];_0xdb8dff++){const _0x5953cb=_0x5f00f3[_0xdb8dff];_0x5f00f3[_0x3e899e(0x20a)]>0x1?console[_0x3e899e(0x1f9)]('Test\x20'+(_0xdb8dff+0x1)+'/'+_0x5f00f3[_0x3e899e(0x20a)]+':\x20'+a5_0x45049c[_0x3e899e(0x213)](_0x5953cb[_0x3e899e(0x1d5)])):console[_0x3e899e(0x1f9)](_0x3e899e(0x1af)+a5_0x45049c['white'](_0x5953cb[_0x3e899e(0x1d5)]));const _0x2e570a=createCommandSpinner(_0x3e899e(0x1b2)+_0x5953cb[_0x3e899e(0x236)][_0x3e899e(0x20a)]+_0x3e899e(0x1cc));_0x2e570a['start']();try{const {result:_0x34ecdb,conversation:_0x33edc2}=await runTest(_0x5e46fc[_0x3e899e(0x1df)],_0x5953cb,{'agentId':_0x31aab7,'projectId':_0x2e7ff1,'site':_0x442b97,'noEval':_0x529cc4,'evaluatorId':_0x20d5d2,'onRoundStart':(_0x3b3519,_0x58b078)=>{const _0x3c3963=_0x3e899e;_0x2e570a['text']=_0x3c3963(0x1b7)+(_0x3b3519+0x1)+'/'+_0x58b078+_0x3c3963(0x1cc);},'onRoundComplete':(_0x31f68a,_0x400c25,_0x54c501)=>{const _0x41fdeb=_0x3e899e,_0x32d15b=formatElapsed(_0x400c25);_0x54c501?console[_0x41fdeb(0x1f9)](_0x41fdeb(0x1d0)+(_0x31f68a+0x1)+'/'+_0x5953cb['rounds'][_0x41fdeb(0x20a)]+_0x41fdeb(0x1db)+a5_0x45049c[_0x41fdeb(0x1d2)]('✓')+'\x20('+_0x32d15b+')'):console[_0x41fdeb(0x1f9)]('\x20\x20Round\x20'+(_0x31f68a+0x1)+'/'+_0x5953cb['rounds'][_0x41fdeb(0x20a)]+_0x41fdeb(0x1db)+a5_0x45049c[_0x41fdeb(0x1b1)]('✗'));},'onEvaluationStart':()=>{const _0x1f55a0=_0x3e899e;_0x2e570a[_0x1f55a0(0x1a7)]=_0x1f55a0(0x1bc);},'onEvaluationComplete':_0x3142fb=>{const _0x4ebfd0=_0x3e899e,_0x519e35=formatElapsed(_0x3142fb);console[_0x4ebfd0(0x1f9)](_0x4ebfd0(0x1ac)+a5_0x45049c[_0x4ebfd0(0x1d2)]('✓')+'\x20('+_0x519e35+')');}});_0x2e570a['stop'](),_0x5dc517[_0x3e899e(0x222)](_0x34ecdb),_0x936e57[_0x3e899e(0x222)](_0x33edc2);if(_0x34ecdb[_0x3e899e(0x1ed)]===_0x3e899e(0x22e))console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1d2)](_0x3e899e(0x231)+_0x34ecdb[_0x3e899e(0x1e6)]));else _0x34ecdb[_0x3e899e(0x1ed)]===_0x3e899e(0x1a8)?console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1b1)](_0x3e899e(0x204)+_0x34ecdb['reason'])):console['log'](a5_0x45049c['red'](_0x3e899e(0x211)+_0x34ecdb[_0x3e899e(0x1e6)]));_0x34ecdb[_0x3e899e(0x20f)]&&console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x229)](_0x3e899e(0x1ce)+_0x34ecdb[_0x3e899e(0x20f)])),console[_0x3e899e(0x1f9)]();}catch(_0x2ae243){_0x2e570a[_0x3e899e(0x1a9)]();const _0x338b2d=_0x2ae243 instanceof Error?_0x2ae243[_0x3e899e(0x237)]:String(_0x2ae243);console[_0x3e899e(0x1f9)](a5_0x45049c[_0x3e899e(0x1b1)]('✗\x20ERROR:\x20'+_0x338b2d)),console[_0x3e899e(0x1f9)](),_0x5dc517[_0x3e899e(0x222)]({'name':_0x5953cb[_0x3e899e(0x1d5)],'status':'ERROR','reason':_0x338b2d,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x5c9f61=Date[_0x3e899e(0x1ca)]()-_0x16a589,_0x49a35a=_0x5dc517[_0x3e899e(0x21c)](_0x18c195=>_0x18c195[_0x3e899e(0x1ed)]===_0x3e899e(0x22e))['length'],_0x5d3589=_0x5dc517[_0x3e899e(0x21c)](_0x16c88a=>_0x16c88a[_0x3e899e(0x1ed)]===_0x3e899e(0x1a8))['length'],_0xc72983=_0x5dc517[_0x3e899e(0x21c)](_0x4707b1=>_0x4707b1[_0x3e899e(0x1ed)]===_0x3e899e(0x207))['length'];console[_0x3e899e(0x1f9)]('━'[_0x3e899e(0x1ad)](0x3c)),console['log'](_0x3e899e(0x1c9)),console['log']('━'['repeat'](0x3c)),console[_0x3e899e(0x1f9)](_0x3e899e(0x21e)+_0x5dc517[_0x3e899e(0x20a)]),console[_0x3e899e(0x1f9)]('Passed:\x20\x20\x20'+a5_0x45049c[_0x3e899e(0x1d2)](_0x49a35a)),console[_0x3e899e(0x1f9)](_0x3e899e(0x1f6)+a5_0x45049c['red'](_0x5d3589));_0xc72983>0x0&&console[_0x3e899e(0x1f9)](_0x3e899e(0x1e5)+a5_0x45049c[_0x3e899e(0x1b1)](_0xc72983));console[_0x3e899e(0x1f9)](_0x3e899e(0x214)+formatElapsed(_0x5c9f61)),console[_0x3e899e(0x1f9)]('━'['repeat'](0x3c));const _0x4056c8=_0x5dc517[_0x3e899e(0x21c)](_0x219d6c=>_0x219d6c[_0x3e899e(0x1ed)]!=='PASS');if(_0x4056c8[_0x3e899e(0x20a)]>0x0){console[_0x3e899e(0x1f9)](),console[_0x3e899e(0x1f9)](_0x3e899e(0x1fa));for(const _0x280069 of _0x4056c8){const _0x13b6db=a5_0x45049c[_0x3e899e(0x1b1)]('✗'),_0x1ccea9=_0x280069[_0x3e899e(0x1e6)][_0x3e899e(0x20a)]>0x32?_0x280069[_0x3e899e(0x1e6)][_0x3e899e(0x1f3)](0x0,0x32)+_0x3e899e(0x219):_0x280069[_0x3e899e(0x1e6)];console[_0x3e899e(0x1f9)]('\x20\x20'+_0x13b6db+'\x20'+_0x280069[_0x3e899e(0x1d5)]+':\x20'+_0x1ccea9);}}const _0x4717a4={'summary':{'total':_0x5dc517[_0x3e899e(0x20a)],'passed':_0x49a35a,'failed':_0x5d3589,'errors':_0xc72983>0x0?_0xc72983:undefined,'duration_ms':_0x5c9f61},'tests':_0x5dc517,'agent':{'project':_0x101998[_0x3e899e(0x1f2)],'name':_0x101998[_0x3e899e(0x216)],'site':_0x442b97},'timestamp':new Date(_0x16a589)[_0x3e899e(0x1c3)]()};try{const _0x41e87f=buildCachedTestRun(_0x936e57,{'site':_0x442b97,'projectId':_0x2e7ff1,'projectName':_0x101998[_0x3e899e(0x1f2)],'agentId':_0x31aab7,'agentName':_0x101998[_0x3e899e(0x216)],'testYmlPath':a5_0x4cec4['resolve'](_0x101998[_0x3e899e(0x1c5)])});saveLastTestRun(_0x41e87f);}catch{}if(_0x1b0afa!=='table'||_0x566e86){const _0x440740=formatResults(_0x4717a4,_0x1b0afa);if(_0x566e86)try{a5_0x92ec42[_0x3e899e(0x1c7)](_0x566e86,_0x440740,'utf-8'),console['log'](),console['log'](a5_0x45049c[_0x3e899e(0x229)](_0x3e899e(0x1d9)+_0x566e86));}catch(_0x25bf4d){return console[_0x3e899e(0x1f9)](),console[_0x3e899e(0x1f9)](a5_0x45049c['red'](_0x3e899e(0x1c1)+_0x25bf4d)),0x1;}else console[_0x3e899e(0x1f9)](),console[_0x3e899e(0x1f9)](_0x440740);}return _0x4056c8['length']>0x0?0x1:0x0;}async[a5_0x57d988(0x20b)](_0x45be3a,_0x5d89a7){const _0x5d7c46=a5_0x57d988,{options:_0x4efa2d,tdx:_0x1203a4}=_0x45be3a,{definition:_0x19c067,agentInfo:_0x946e4a,outputFormat:_0x15e3f9,outputFile:_0x3c2aae}=_0x5d89a7,_0x143d09=_0x4efa2d[_0x5d7c46(0x1d1)],_0xdfc70f=loadLastTestRun();if(!_0xdfc70f)return console['log'](a5_0x45049c[_0x5d7c46(0x1b1)](_0x5d7c46(0x232))),console['log'](a5_0x45049c['dim']('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0xdfc70f[_0x5d7c46(0x1a4)][_0x5d7c46(0x216)]!==_0x946e4a[_0x5d7c46(0x216)])return console[_0x5d7c46(0x1f9)](a5_0x45049c[_0x5d7c46(0x1b1)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0xdfc70f[_0x5d7c46(0x1a4)]['agentName']+_0x5d7c46(0x22d)+_0x946e4a['agentName']+'\x22.')),console[_0x5d7c46(0x1f9)](a5_0x45049c[_0x5d7c46(0x229)](_0x5d7c46(0x206))),0x1;const _0x31efbd=new Set(_0xdfc70f[_0x5d7c46(0x1b9)][_0x5d7c46(0x221)](_0x1e34aa=>_0x1e34aa[_0x5d7c46(0x1fb)])),_0x3fab56=_0x19c067[_0x5d7c46(0x22b)][_0x5d7c46(0x21c)](_0x30bf81=>!_0x31efbd['has'](_0x30bf81[_0x5d7c46(0x1d5)]));if(_0x3fab56[_0x5d7c46(0x20a)]>0x0&&_0xdfc70f[_0x5d7c46(0x1d1)]!==_0x143d09)return console[_0x5d7c46(0x1f9)](a5_0x45049c['red']('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x5d7c46(0x1f9)](a5_0x45049c[_0x5d7c46(0x229)](_0x5d7c46(0x1de)+_0xdfc70f['site']+_0x5d7c46(0x1fc)+_0x143d09+'\x22.')),console[_0x5d7c46(0x1f9)](a5_0x45049c['dim'](_0x5d7c46(0x223)+_0xdfc70f[_0x5d7c46(0x1d1)]+_0x5d7c46(0x1bb))),0x1;const _0x41af17=_0x19c067['tests']['filter'](_0xeca62c=>_0x31efbd[_0x5d7c46(0x1d4)](_0xeca62c[_0x5d7c46(0x1d5)])),_0x1429c7=_0x3fab56;let _0xd292e7;try{_0xd292e7=await setupEvaluatorAgent(_0x1203a4['llm'],_0x4efa2d[_0x5d7c46(0x209)]);}catch(_0x4d33ad){const _0x3de088=_0x4d33ad instanceof Error?_0x4d33ad[_0x5d7c46(0x237)]:String(_0x4d33ad);return console[_0x5d7c46(0x1f9)](a5_0x45049c[_0x5d7c46(0x1b1)](_0x5d7c46(0x1cd)+_0x3de088)),0x1;}console['log'](a5_0x45049c['cyan'](_0x5d7c46(0x1e7))),console[_0x5d7c46(0x1f9)](_0x5d7c46(0x227)+a5_0x45049c[_0x5d7c46(0x213)](_0xdfc70f['timestamp'])),console[_0x5d7c46(0x1f9)](_0x5d7c46(0x1d6)+a5_0x45049c['white'](_0xdfc70f[_0x5d7c46(0x1a4)][_0x5d7c46(0x1f2)]+'/'+_0xdfc70f[_0x5d7c46(0x1a4)][_0x5d7c46(0x216)]));_0x1429c7[_0x5d7c46(0x20a)]>0x0&&console[_0x5d7c46(0x1f9)](_0x5d7c46(0x1e3)+a5_0x45049c[_0x5d7c46(0x1c8)](_0x1429c7[_0x5d7c46(0x20a)]));console[_0x5d7c46(0x1f9)]();const _0x16f238=[],_0x5725af=Date['now'](),_0x4368f4=createCommandSpinner(_0x5d7c46(0x22a));if(_0x41af17['length']>0x0)try{const _0x1a51cb=await reevaluateFromCache(_0x1203a4[_0x5d7c46(0x1df)],_0xdfc70f,{'tests':_0x41af17},{'evaluatorId':_0xd292e7,'onTestStart':(_0x57a16b,_0x2293f7,_0x54de3d)=>{const _0x35c8e2=_0x5d7c46;_0x4368f4[_0x35c8e2(0x1a7)]=_0x35c8e2(0x220)+(_0x2293f7+0x1)+'/'+_0x54de3d+':\x20'+_0x57a16b+_0x35c8e2(0x219);if(!_0x4368f4[_0x35c8e2(0x1b4)])_0x4368f4['start']();},'onTestComplete':(_0x208dab,_0x1d6fca)=>{const _0x1e509f=_0x5d7c46;_0x4368f4[_0x1e509f(0x1a9)]();if(_0x1d6fca['status']==='PASS')console[_0x1e509f(0x1f9)](a5_0x45049c[_0x1e509f(0x1d2)](_0x1e509f(0x231)+_0x208dab)+a5_0x45049c[_0x1e509f(0x229)]('\x20(cached)'));else _0x1d6fca['status']===_0x1e509f(0x1a8)?console[_0x1e509f(0x1f9)](a5_0x45049c['red'](_0x1e509f(0x204)+_0x208dab+_0x1e509f(0x1e4)+_0x1d6fca[_0x1e509f(0x1e6)])+a5_0x45049c[_0x1e509f(0x229)]('\x20(cached)')):console[_0x1e509f(0x1f9)](a5_0x45049c[_0x1e509f(0x1b1)]('✗\x20ERROR:\x20'+_0x208dab+_0x1e509f(0x1e4)+_0x1d6fca['reason']));_0x1d6fca[_0x1e509f(0x20f)]&&console[_0x1e509f(0x1f9)](a5_0x45049c['dim'](_0x1e509f(0x1eb)+_0x1d6fca['conversation_url'])),_0x16f238[_0x1e509f(0x222)](_0x1d6fca);},'onTestSkipped':(_0x1ded10,_0x3c4359)=>{const _0x3f4819=_0x5d7c46;_0x4368f4['stop'](),console[_0x3f4819(0x1f9)](a5_0x45049c[_0x3f4819(0x1c8)](_0x3f4819(0x212)+_0x1ded10+'\x20-\x20'+_0x3c4359));}});for(const _0x598383 of _0x1a51cb){!_0x16f238['find'](_0x1c2484=>_0x1c2484[_0x5d7c46(0x1d5)]===_0x598383['name'])&&_0x16f238[_0x5d7c46(0x222)](_0x598383);}}catch(_0x4604d0){_0x4368f4['stop']();const _0x33e9e6=_0x4604d0 instanceof Error?_0x4604d0[_0x5d7c46(0x237)]:String(_0x4604d0);return console['log'](a5_0x45049c['red'](_0x5d7c46(0x1e0)+_0x33e9e6)),0x1;}_0x4368f4[_0x5d7c46(0x1a9)]();if(_0x1429c7[_0x5d7c46(0x20a)]>0x0){console['log'](),console[_0x5d7c46(0x1f9)](a5_0x45049c['cyan'](_0x5d7c46(0x22f)));const {projectId:_0x4f78aa,agentId:_0x3e37a5}=_0xdfc70f[_0x5d7c46(0x1a4)];for(const _0x4f4948 of _0x1429c7){console['log'](_0x5d7c46(0x234)+a5_0x45049c[_0x5d7c46(0x213)](_0x4f4948[_0x5d7c46(0x1d5)]));const _0x4b8718=createCommandSpinner('Round\x201/'+_0x4f4948[_0x5d7c46(0x236)][_0x5d7c46(0x20a)]+_0x5d7c46(0x1cc));_0x4b8718[_0x5d7c46(0x1ea)]();try{const {result:_0x53139d}=await runTest(_0x1203a4[_0x5d7c46(0x1df)],_0x4f4948,{'agentId':_0x3e37a5,'projectId':_0x4f78aa,'site':_0xdfc70f[_0x5d7c46(0x1d1)],'noEval':![],'evaluatorId':_0xd292e7,'onRoundStart':(_0x29435e,_0x3ab6e7)=>{const _0x2e7972=_0x5d7c46;_0x4b8718[_0x2e7972(0x1a7)]=_0x2e7972(0x1b7)+(_0x29435e+0x1)+'/'+_0x3ab6e7+_0x2e7972(0x1cc);},'onRoundComplete':(_0x9f5692,_0x10d3dd,_0x1861be)=>{const _0x4c70b3=_0x5d7c46,_0x14d6a1=formatElapsed(_0x10d3dd);_0x1861be?console['log'](_0x4c70b3(0x1d0)+(_0x9f5692+0x1)+'/'+_0x4f4948['rounds'][_0x4c70b3(0x20a)]+'...\x20'+a5_0x45049c[_0x4c70b3(0x1d2)]('✓')+'\x20('+_0x14d6a1+')'):console[_0x4c70b3(0x1f9)](_0x4c70b3(0x1d0)+(_0x9f5692+0x1)+'/'+_0x4f4948[_0x4c70b3(0x236)][_0x4c70b3(0x20a)]+_0x4c70b3(0x1db)+a5_0x45049c[_0x4c70b3(0x1b1)]('✗'));},'onEvaluationStart':()=>{const _0x42b138=_0x5d7c46;_0x4b8718[_0x42b138(0x1a7)]=_0x42b138(0x1bc);},'onEvaluationComplete':_0x7edd35=>{const _0xb8dada=_0x5d7c46,_0x1d3532=formatElapsed(_0x7edd35);console[_0xb8dada(0x1f9)](_0xb8dada(0x1ac)+a5_0x45049c['green']('✓')+'\x20('+_0x1d3532+')');}});_0x4b8718[_0x5d7c46(0x1a9)](),_0x16f238[_0x5d7c46(0x222)](_0x53139d);if(_0x53139d[_0x5d7c46(0x1ed)]===_0x5d7c46(0x22e))console[_0x5d7c46(0x1f9)](a5_0x45049c[_0x5d7c46(0x1d2)](_0x5d7c46(0x231)+_0x53139d[_0x5d7c46(0x1e6)])+a5_0x45049c[_0x5d7c46(0x229)](_0x5d7c46(0x1e8)));else _0x53139d[_0x5d7c46(0x1ed)]===_0x5d7c46(0x1a8)?console['log'](a5_0x45049c[_0x5d7c46(0x1b1)](_0x5d7c46(0x204)+_0x53139d[_0x5d7c46(0x1e6)])+a5_0x45049c[_0x5d7c46(0x229)]('\x20(new)')):console[_0x5d7c46(0x1f9)](a5_0x45049c[_0x5d7c46(0x1b1)](_0x5d7c46(0x211)+_0x53139d[_0x5d7c46(0x1e6)]));_0x53139d['conversation_url']&&console[_0x5d7c46(0x1f9)](a5_0x45049c[_0x5d7c46(0x229)](_0x5d7c46(0x1eb)+_0x53139d['conversation_url']));}catch(_0x1d4636){_0x4b8718[_0x5d7c46(0x1a9)]();const _0xc4a727=_0x1d4636 instanceof Error?_0x1d4636['message']:String(_0x1d4636);console['log'](a5_0x45049c[_0x5d7c46(0x1b1)](_0x5d7c46(0x211)+_0xc4a727)),_0x16f238[_0x5d7c46(0x222)]({'name':_0x4f4948[_0x5d7c46(0x1d5)],'status':'ERROR','reason':_0xc4a727,'timestamp':new Date()[_0x5d7c46(0x1c3)](),'duration_ms':0x0});}}}console['log']();const _0x11cf94=Date[_0x5d7c46(0x1ca)]()-_0x5725af,_0x500bb7=_0x16f238['filter'](_0x56e493=>_0x56e493['status']===_0x5d7c46(0x22e))[_0x5d7c46(0x20a)],_0x1ed37c=_0x16f238['filter'](_0x5db452=>_0x5db452[_0x5d7c46(0x1ed)]===_0x5d7c46(0x1a8))['length'],_0x2d0055=_0x16f238[_0x5d7c46(0x21c)](_0x25b218=>_0x25b218[_0x5d7c46(0x1ed)]===_0x5d7c46(0x207))[_0x5d7c46(0x20a)];console['log']('━'['repeat'](0x3c)),console['log'](_0x5d7c46(0x1b8)),console[_0x5d7c46(0x1f9)]('━'['repeat'](0x3c)),console[_0x5d7c46(0x1f9)]('Total:\x20\x20\x20\x20'+_0x16f238[_0x5d7c46(0x20a)]),console[_0x5d7c46(0x1f9)](_0x5d7c46(0x20c)+a5_0x45049c[_0x5d7c46(0x1d2)](_0x500bb7)),console[_0x5d7c46(0x1f9)](_0x5d7c46(0x1f6)+a5_0x45049c[_0x5d7c46(0x1b1)](_0x1ed37c));_0x2d0055>0x0&&console['log'](_0x5d7c46(0x1e5)+a5_0x45049c['red'](_0x2d0055));console['log']('Duration:\x20'+formatElapsed(_0x11cf94)),console[_0x5d7c46(0x1f9)]('━'[_0x5d7c46(0x1ad)](0x3c));const _0x1c1513={'summary':{'total':_0x16f238[_0x5d7c46(0x20a)],'passed':_0x500bb7,'failed':_0x1ed37c,'errors':_0x2d0055>0x0?_0x2d0055:undefined,'duration_ms':_0x11cf94},'tests':_0x16f238,'agent':{'project':_0x946e4a[_0x5d7c46(0x1f2)],'name':_0x946e4a['agentName'],'site':_0x143d09},'timestamp':new Date(_0x5725af)[_0x5d7c46(0x1c3)]()};if(_0x15e3f9!==_0x5d7c46(0x1e1)||_0x3c2aae){const _0xe94d78=formatResults(_0x1c1513,_0x15e3f9);if(_0x3c2aae)try{a5_0x92ec42[_0x5d7c46(0x1c7)](_0x3c2aae,_0xe94d78,'utf-8'),console[_0x5d7c46(0x1f9)](),console[_0x5d7c46(0x1f9)](a5_0x45049c['dim'](_0x5d7c46(0x1d9)+_0x3c2aae));}catch(_0x3d8247){return console['log'](),console['log'](a5_0x45049c['red'](_0x5d7c46(0x1c1)+_0x3d8247)),0x1;}else console[_0x5d7c46(0x1f9)](),console[_0x5d7c46(0x1f9)](_0xe94d78);}const _0x508dbd=_0x16f238[_0x5d7c46(0x21c)](_0x41e18a=>_0x41e18a[_0x5d7c46(0x1ed)]!==_0x5d7c46(0x22e));return _0x508dbd[_0x5d7c46(0x20a)]>0x0?0x1:0x0;}}
1
+ const a5_0x59e40d=a5_0x1291;(function(_0x1004f0,_0x16ff86){const _0x534663=a5_0x1291,_0x1749d6=_0x1004f0();while(!![]){try{const _0x1a3b62=-parseInt(_0x534663(0x103))/0x1+-parseInt(_0x534663(0xf1))/0x2+-parseInt(_0x534663(0x129))/0x3*(-parseInt(_0x534663(0x171))/0x4)+-parseInt(_0x534663(0x17f))/0x5+-parseInt(_0x534663(0x10c))/0x6*(-parseInt(_0x534663(0x153))/0x7)+parseInt(_0x534663(0x115))/0x8*(-parseInt(_0x534663(0x178))/0x9)+-parseInt(_0x534663(0xfe))/0xa*(-parseInt(_0x534663(0x18a))/0xb);if(_0x1a3b62===_0x16ff86)break;else _0x1749d6['push'](_0x1749d6['shift']());}catch(_0x3ec389){_0x1749d6['push'](_0x1749d6['shift']());}}}(a5_0x8bc7,0xe90e1));import*as a5_0x4f20cc from'node:fs';import*as a5_0x588f49 from'node:path';import a5_0x3977bb from'chalk';function a5_0x8bc7(){const _0xa492e3=['✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Errors:\x20\x20\x20','Duration:\x20','Available\x20tests:\x20','reason','61916gMeKrj','tsv','execute','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Round\x201/','Run\x20tests\x20for\x20an\x20LLM\x20agent','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','14670rpIodO','Usage:','Re-evaluation\x20Summary','Using\x20agent:\x20','no_local_folder','filter','length','6181985PaOQzN','Cached\x20run\x20is\x20from\x20site\x20\x22','\x20\x20Project:\x20','Total:\x20\x20\x20\x20','PASS','FAIL','ERROR','description','projectDir','✗\x20ERROR:\x20','\x20-\x20','2373569JNdgMJ','Tests\x20found:\x20','name','projectName','Round\x20','testName','rounds','Output\x20written\x20to:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','433256GlHLzM','Running\x20test:\x20','/<agent-name>','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','output','agentDirs','Agent:\x20','start','Running:\x20','jsonl','resolveAgentId','\x20\x20Evaluating...\x20','\x20\x20Agent:\x20','120XYOGJn','conversation_url',':\x20Sending\x20user\x20input...','eval','isSpinning','698542MkjFND','now','trim','Either\x20switch\x20to\x20the\x20\x22','no_context','text','\x20\x20Round\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','executeReeval','821454tZSwJf','repeat','toISOString','log','has','basename','red','reeval','cyan','7024Pmhkjj','writeFileSync','✗\x20ERROR:\x20Project\x20not\x20found:\x20','⚠\x20SKIPPED:\x20','Site:\x20','stop','✗\x20FAIL:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','no_tests','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','split','Error:\x20No\x20previous\x20test\x20run\x20found.','dryRun','llmProject','timestamp','toLowerCase','Conversation\x20URL:\x20','...','351enluGZ','site','No\x20tests\x20found\x20with\x20tags:\x20','No\x20tests\x20have\x20tags\x20defined.','\x27\x20to\x20create\x20the\x20folder\x20structure.','source','Run\x20\x27tdx\x20agent\x20pull\x20','agent:test','yellow','Project\x20path:\x20','found','tags','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Error\x20writing\x20output\x20file:\x20','\x20\x20Site:\x20','\x22:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','test.yml','forEach','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','join','No\x20tests\x20found\x20matching:\x20','Re-evaluating\x20','push','404','resolveProjectId','Failed\x20Tests:','includes','white','green','table','find','Test\x20Summary','map','dim','json','verbose','conversations','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','Passed:\x20\x20\x20','\x20\x20Conversation:\x20','✓\x20PASS:\x20','7tuExvw','agentName','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','\x20(cached)','...\x20','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','add','Cached\x20run\x20from:\x20','not\x20found','\x20(new)','tests','context','message','\x22,\x20but\x20current\x20site\x20is\x20\x22','agent','\x20\x20-\x20','llm','Failed:\x20\x20\x20','status','Re-evaluating...','Executing\x20new\x20tests...','Running\x20agent\x20tests...','Evaluating\x20response...'];a5_0x8bc7=function(){return _0xa492e3;};return a5_0x8bc7();}function a5_0x1291(_0xa7532b,_0x353668){_0xa7532b=_0xa7532b-0xec;const _0x8bc7a8=a5_0x8bc7();let _0x129198=_0x8bc7a8[_0xa7532b];return _0x129198;}import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x59e40d(0x18c)]=a5_0x59e40d(0x130);[a5_0x59e40d(0x186)]=a5_0x59e40d(0x176);async[a5_0x59e40d(0x173)](_0x149e51){const _0x370e32=a5_0x59e40d,{options:_0x237bb5,args:_0x292dc3,tdx:_0x206005}=_0x149e51,_0x471b5d=_0x292dc3[0x0]||'.',_0x1f0a8d=_0x237bb5[_0x370e32(0x123)],_0x17170d=_0x237bb5,_0x13121c=_0x17170d[_0x370e32(0x101)]===![],_0x211e61=_0x17170d[_0x370e32(0x113)],_0x54d23e=_0x17170d[_0x370e32(0x18c)],_0x8ec1c4=_0x17170d[_0x370e32(0x134)],_0x16c1c6=_0x237bb5['site'],_0x26e110=_0x17170d[_0x370e32(0xf5)];if(_0x211e61&&_0x13121c)return console['log'](a5_0x3977bb[_0x370e32(0x112)](_0x370e32(0x11c))),0x1;let _0x237446=_0x370e32(0x147);if(_0x17170d['json'])_0x237446=_0x370e32(0x14c);else{if(_0x17170d[_0x370e32(0xfa)])_0x237446='jsonl';else{if(_0x17170d[_0x370e32(0x172)])_0x237446=_0x370e32(0x172);else{if(_0x17170d[_0x370e32(0x147)])_0x237446=_0x370e32(0x147);}}}const _0x388f02=_0x17170d[_0x370e32(0x124)];let _0x496b69=_0x471b5d;const _0x15f31c=a5_0x4f20cc['existsSync'](_0x471b5d),_0x541b99=_0x471b5d==='.';if(!_0x15f31c||_0x541b99){const _0x165642=resolveProjectFromContext(_0x471b5d,_0x388f02,{'requireFile':_0x370e32(0x13a)});if(_0x165642[_0x370e32(0x133)])_0x496b69=_0x165642[_0x370e32(0x187)],_0x165642[_0x370e32(0x12e)]===_0x370e32(0x15f)&&console[_0x370e32(0x10f)](a5_0x3977bb['dim'](_0x370e32(0x17b)+_0x496b69));else switch(_0x165642[_0x370e32(0x170)]){case _0x370e32(0x107):console['log'](a5_0x3977bb['yellow'](_0x165642[_0x370e32(0x160)])),console['log'](),console[_0x370e32(0x10f)](_0x370e32(0x179)),console[_0x370e32(0x10f)](_0x370e32(0x159)),console[_0x370e32(0x10f)](_0x370e32(0x14f)),console['log'](),console[_0x370e32(0x10f)](_0x370e32(0xf4));return 0x1;case _0x370e32(0x17c):console[_0x370e32(0x10f)](a5_0x3977bb[_0x370e32(0x131)](_0x165642[_0x370e32(0x160)])),console[_0x370e32(0x10f)](),console[_0x370e32(0x10f)](_0x370e32(0x12f)+_0x165642[_0x370e32(0x124)]+_0x370e32(0x12d));return 0x1;case'multiple_agents':{const _0x554bfe=a5_0x588f49[_0x370e32(0x111)](_0x165642[_0x370e32(0x187)]);console[_0x370e32(0x10f)](a5_0x3977bb[_0x370e32(0x131)](_0x370e32(0x16c)+_0x165642[_0x370e32(0x124)]+'\x22:'));for(const _0x49dd0c of _0x165642[_0x370e32(0xf6)]){console['log'](_0x370e32(0x163)+_0x49dd0c);}return console['log'](),console[_0x370e32(0x10f)](_0x370e32(0x156)+_0x554bfe+_0x370e32(0xf3)),0x1;}case _0x370e32(0x11d):console[_0x370e32(0x10f)](a5_0x3977bb[_0x370e32(0x131)](_0x370e32(0x139)+_0x165642[_0x370e32(0x124)]+'\x22.')),console['log'](a5_0x3977bb[_0x370e32(0x14b)](_0x370e32(0x132)+_0x165642[_0x370e32(0x187)])),console[_0x370e32(0x10f)](),console['log'](_0x370e32(0x11f));return 0x1;}}const {definition:_0x3cb7e4,agentInfo:_0x1670a9}=parseTestFile(_0x496b69);let _0x370cd3=_0x3cb7e4['tests'];if(_0x54d23e){const _0x4270ae=_0x54d23e[_0x370e32(0x121)](',')[_0x370e32(0x14a)](_0x21ae4d=>_0x21ae4d['trim']());_0x370cd3=_0x3cb7e4[_0x370e32(0x15e)][_0x370e32(0x17d)](_0x4f569a=>_0x4270ae['includes'](_0x4f569a[_0x370e32(0x18c)]));if(_0x370cd3[_0x370e32(0x17e)]===0x0)return console[_0x370e32(0x10f)](a5_0x3977bb[_0x370e32(0x131)](_0x370e32(0x13e)+_0x54d23e)),console[_0x370e32(0x10f)](a5_0x3977bb['dim'](_0x370e32(0x16f)+_0x3cb7e4[_0x370e32(0x15e)]['map'](_0x579d5c=>_0x579d5c[_0x370e32(0x18c)])[_0x370e32(0x13d)](',\x20'))),0x1;}if(_0x8ec1c4){const _0x2c15f3=_0x8ec1c4[_0x370e32(0x121)](',')[_0x370e32(0x14a)](_0x495046=>_0x495046[_0x370e32(0x105)]()[_0x370e32(0x126)]());_0x370cd3=_0x370cd3[_0x370e32(0x17d)](_0x249cfe=>_0x249cfe['tags']?.['some'](_0x5cb2d9=>_0x2c15f3[_0x370e32(0x144)](_0x5cb2d9[_0x370e32(0x126)]())));if(_0x370cd3[_0x370e32(0x17e)]===0x0){console['log'](a5_0x3977bb[_0x370e32(0x131)](_0x370e32(0x12b)+_0x8ec1c4));const _0x10f009=new Set();return _0x3cb7e4[_0x370e32(0x15e)]['forEach'](_0x377f85=>_0x377f85[_0x370e32(0x134)]?.[_0x370e32(0x13b)](_0x340381=>_0x10f009[_0x370e32(0x15a)](_0x340381))),_0x10f009['size']>0x0?console[_0x370e32(0x10f)](a5_0x3977bb[_0x370e32(0x14b)]('Available\x20tags:\x20'+[..._0x10f009]['join'](',\x20'))):console[_0x370e32(0x10f)](a5_0x3977bb['dim'](_0x370e32(0x12c))),0x1;}}if(_0x211e61)return this[_0x370e32(0x10b)](_0x149e51,{'definition':{'tests':_0x370cd3},'agentInfo':_0x1670a9,'outputFormat':_0x237446,'outputFile':_0x26e110,'testNames':_0x54d23e});if(_0x1f0a8d){console[_0x370e32(0x10f)](a5_0x3977bb[_0x370e32(0x114)]('Test\x20Configuration:')),console['log'](_0x370e32(0x137)+a5_0x3977bb['white'](_0x16c1c6)),console[_0x370e32(0x10f)](_0x370e32(0x181)+a5_0x3977bb[_0x370e32(0x145)](_0x1670a9[_0x370e32(0x18d)])),console[_0x370e32(0x10f)](_0x370e32(0xfd)+a5_0x3977bb[_0x370e32(0x145)](_0x1670a9[_0x370e32(0x154)])),console[_0x370e32(0x10f)](),console[_0x370e32(0x10f)](_0x370e32(0x18b)+a5_0x3977bb[_0x370e32(0x145)](_0x370cd3[_0x370e32(0x17e)]));for(let _0x362ea8=0x0;_0x362ea8<_0x370cd3[_0x370e32(0x17e)];_0x362ea8++){const _0x29b3f3=_0x370cd3[_0x362ea8],_0x25069d=_0x29b3f3[_0x370e32(0xee)]['length']===0x1?'round':_0x370e32(0xee),_0x19a289=_0x29b3f3['tags']?.[_0x370e32(0x17e)]?'\x20['+_0x29b3f3['tags']['join'](',\x20')+']':'';console[_0x370e32(0x10f)]('\x20\x20'+(_0x362ea8+0x1)+'.\x20'+a5_0x3977bb[_0x370e32(0x145)](_0x29b3f3['name'])+'\x20('+_0x29b3f3[_0x370e32(0xee)][_0x370e32(0x17e)]+'\x20'+_0x25069d+')'+a5_0x3977bb[_0x370e32(0x14b)](_0x19a289));}return 0x0;}let _0x2669f1,_0x70075f;try{_0x2669f1=await _0x206005[_0x370e32(0x164)][_0x370e32(0x142)](_0x1670a9[_0x370e32(0x18d)]);}catch(_0x50d5c8){const _0x3cbe2d=_0x50d5c8 instanceof Error?_0x50d5c8['message']:String(_0x50d5c8);return _0x3cbe2d['includes'](_0x370e32(0x141))||_0x3cbe2d[_0x370e32(0x126)]()[_0x370e32(0x144)](_0x370e32(0x15c))?console[_0x370e32(0x10f)](a5_0x3977bb[_0x370e32(0x112)](_0x370e32(0x117)+_0x1670a9[_0x370e32(0x18d)])):console['log'](a5_0x3977bb['red'](_0x370e32(0x16b)+_0x1670a9[_0x370e32(0x18d)]+'\x22:\x20'+_0x3cbe2d)),0x1;}try{_0x70075f=await _0x206005[_0x370e32(0x164)][_0x370e32(0xfb)](_0x1670a9[_0x370e32(0x154)],_0x2669f1);}catch(_0x15e543){const _0x25cba2=_0x15e543 instanceof Error?_0x15e543[_0x370e32(0x160)]:String(_0x15e543);return _0x25cba2[_0x370e32(0x144)]('404')||_0x25cba2['toLowerCase']()[_0x370e32(0x144)](_0x370e32(0x15c))?console[_0x370e32(0x10f)](a5_0x3977bb[_0x370e32(0x112)](_0x370e32(0xf0)+_0x1670a9[_0x370e32(0x154)])):console[_0x370e32(0x10f)](a5_0x3977bb[_0x370e32(0x112)](_0x370e32(0x174)+_0x1670a9[_0x370e32(0x154)]+_0x370e32(0x138)+_0x25cba2)),0x1;}let _0x480bf7;if(!_0x13121c)try{_0x480bf7=await setupEvaluatorAgent(_0x206005[_0x370e32(0x164)],_0x237bb5[_0x370e32(0x14d)]);}catch(_0x391981){const _0x21a9f6=_0x391981 instanceof Error?_0x391981['message']:String(_0x391981);return console[_0x370e32(0x10f)](a5_0x3977bb[_0x370e32(0x112)](_0x370e32(0x120)+_0x21a9f6)),0x1;}console[_0x370e32(0x10f)](a5_0x3977bb['cyan'](_0x370e32(0x169))),console[_0x370e32(0x10f)](_0x370e32(0x119)+a5_0x3977bb[_0x370e32(0x145)](_0x16c1c6)),console[_0x370e32(0x10f)](_0x370e32(0xf7)+a5_0x3977bb['white'](_0x1670a9[_0x370e32(0x18d)]+'/'+_0x1670a9[_0x370e32(0x154)])),console[_0x370e32(0x10f)]();const _0x5f0ec5=[],_0x22e3cf=[],_0xddeedd=Date[_0x370e32(0x104)]();for(let _0x24043e=0x0;_0x24043e<_0x370cd3[_0x370e32(0x17e)];_0x24043e++){const _0x2eafad=_0x370cd3[_0x24043e];_0x370cd3[_0x370e32(0x17e)]>0x1?console[_0x370e32(0x10f)]('Test\x20'+(_0x24043e+0x1)+'/'+_0x370cd3[_0x370e32(0x17e)]+':\x20'+a5_0x3977bb[_0x370e32(0x145)](_0x2eafad['name'])):console[_0x370e32(0x10f)](_0x370e32(0xf2)+a5_0x3977bb[_0x370e32(0x145)](_0x2eafad['name']));const _0x1144af=createCommandSpinner('Round\x201/'+_0x2eafad['rounds'][_0x370e32(0x17e)]+':\x20Sending\x20user\x20input...');_0x1144af[_0x370e32(0xf8)]();try{const {result:_0x1cc082,conversation:_0x1c99c9}=await runTest(_0x206005[_0x370e32(0x164)],_0x2eafad,{'agentId':_0x70075f,'projectId':_0x2669f1,'site':_0x16c1c6,'noEval':_0x13121c,'evaluatorId':_0x480bf7,'onRoundStart':(_0x1949b5,_0x3aa529)=>{const _0x21e212=_0x370e32;_0x1144af[_0x21e212(0x108)]='Round\x20'+(_0x1949b5+0x1)+'/'+_0x3aa529+_0x21e212(0x100);},'onRoundComplete':(_0x12da23,_0xbdf9dd,_0x3eaff7)=>{const _0x301d58=_0x370e32,_0x246d4b=formatElapsed(_0xbdf9dd);_0x3eaff7?console[_0x301d58(0x10f)]('\x20\x20Round\x20'+(_0x12da23+0x1)+'/'+_0x2eafad[_0x301d58(0xee)]['length']+_0x301d58(0x158)+a5_0x3977bb[_0x301d58(0x146)]('✓')+'\x20('+_0x246d4b+')'):console[_0x301d58(0x10f)]('\x20\x20Round\x20'+(_0x12da23+0x1)+'/'+_0x2eafad[_0x301d58(0xee)][_0x301d58(0x17e)]+'...\x20'+a5_0x3977bb[_0x301d58(0x112)]('✗'));},'onEvaluationStart':()=>{const _0x2a1e44=_0x370e32;_0x1144af[_0x2a1e44(0x108)]='Evaluating\x20response...';},'onEvaluationComplete':_0x2b632c=>{const _0x51eb23=_0x370e32,_0x76ebcb=formatElapsed(_0x2b632c);console[_0x51eb23(0x10f)]('\x20\x20Evaluating...\x20'+a5_0x3977bb[_0x51eb23(0x146)]('✓')+'\x20('+_0x76ebcb+')');}});_0x1144af[_0x370e32(0x11a)](),_0x5f0ec5[_0x370e32(0x140)](_0x1cc082),_0x22e3cf['push'](_0x1c99c9);if(_0x1cc082[_0x370e32(0x166)]===_0x370e32(0x183))console[_0x370e32(0x10f)](a5_0x3977bb[_0x370e32(0x146)]('✓\x20PASS:\x20'+_0x1cc082[_0x370e32(0x170)]));else _0x1cc082[_0x370e32(0x166)]===_0x370e32(0x184)?console[_0x370e32(0x10f)](a5_0x3977bb[_0x370e32(0x112)](_0x370e32(0x11b)+_0x1cc082[_0x370e32(0x170)])):console[_0x370e32(0x10f)](a5_0x3977bb['red'](_0x370e32(0x188)+_0x1cc082[_0x370e32(0x170)]));_0x1cc082['conversation_url']&&console[_0x370e32(0x10f)](a5_0x3977bb[_0x370e32(0x14b)](_0x370e32(0x127)+_0x1cc082[_0x370e32(0xff)])),console[_0x370e32(0x10f)]();}catch(_0x532684){_0x1144af[_0x370e32(0x11a)]();const _0x5bf0da=_0x532684 instanceof Error?_0x532684[_0x370e32(0x160)]:String(_0x532684);console[_0x370e32(0x10f)](a5_0x3977bb[_0x370e32(0x112)](_0x370e32(0x188)+_0x5bf0da)),console['log'](),_0x5f0ec5['push']({'name':_0x2eafad[_0x370e32(0x18c)],'status':_0x370e32(0x185),'reason':_0x5bf0da,'timestamp':new Date()[_0x370e32(0x10e)](),'duration_ms':0x0});}}const _0x42876f=Date[_0x370e32(0x104)]()-_0xddeedd,_0x2da889=_0x5f0ec5[_0x370e32(0x17d)](_0x2cc5fe=>_0x2cc5fe[_0x370e32(0x166)]===_0x370e32(0x183))['length'],_0x486fa5=_0x5f0ec5[_0x370e32(0x17d)](_0xf86cf6=>_0xf86cf6[_0x370e32(0x166)]===_0x370e32(0x184))[_0x370e32(0x17e)],_0x3cafc4=_0x5f0ec5[_0x370e32(0x17d)](_0x493ed2=>_0x493ed2[_0x370e32(0x166)]===_0x370e32(0x185))['length'];console[_0x370e32(0x10f)]('━'[_0x370e32(0x10d)](0x3c)),console[_0x370e32(0x10f)](_0x370e32(0x149)),console[_0x370e32(0x10f)]('━'[_0x370e32(0x10d)](0x3c)),console[_0x370e32(0x10f)](_0x370e32(0x182)+_0x5f0ec5[_0x370e32(0x17e)]),console[_0x370e32(0x10f)]('Passed:\x20\x20\x20'+a5_0x3977bb[_0x370e32(0x146)](_0x2da889)),console['log'](_0x370e32(0x165)+a5_0x3977bb[_0x370e32(0x112)](_0x486fa5));_0x3cafc4>0x0&&console[_0x370e32(0x10f)](_0x370e32(0x16d)+a5_0x3977bb[_0x370e32(0x112)](_0x3cafc4));console[_0x370e32(0x10f)]('Duration:\x20'+formatElapsed(_0x42876f)),console['log']('━'['repeat'](0x3c));const _0x4307c1=_0x5f0ec5[_0x370e32(0x17d)](_0x499ee5=>_0x499ee5[_0x370e32(0x166)]!==_0x370e32(0x183));if(_0x4307c1[_0x370e32(0x17e)]>0x0){console[_0x370e32(0x10f)](),console[_0x370e32(0x10f)](_0x370e32(0x143));for(const _0x436ae7 of _0x4307c1){const _0x42b975=a5_0x3977bb['red']('✗'),_0x31b367=_0x436ae7[_0x370e32(0x170)]['length']>0x32?_0x436ae7[_0x370e32(0x170)]['substring'](0x0,0x32)+_0x370e32(0x128):_0x436ae7[_0x370e32(0x170)];console['log']('\x20\x20'+_0x42b975+'\x20'+_0x436ae7[_0x370e32(0x18c)]+':\x20'+_0x31b367);}}const _0x508d5a={'summary':{'total':_0x5f0ec5[_0x370e32(0x17e)],'passed':_0x2da889,'failed':_0x486fa5,'errors':_0x3cafc4>0x0?_0x3cafc4:undefined,'duration_ms':_0x42876f},'tests':_0x5f0ec5,'agent':{'project':_0x1670a9[_0x370e32(0x18d)],'name':_0x1670a9['agentName'],'site':_0x16c1c6},'timestamp':new Date(_0xddeedd)[_0x370e32(0x10e)]()};try{const _0x1d50e9=buildCachedTestRun(_0x22e3cf,{'site':_0x16c1c6,'projectId':_0x2669f1,'projectName':_0x1670a9[_0x370e32(0x18d)],'agentId':_0x70075f,'agentName':_0x1670a9[_0x370e32(0x154)],'testYmlPath':a5_0x588f49['resolve'](_0x1670a9['testYmlPath'])});saveLastTestRun(_0x1d50e9);}catch{}if(_0x237446!==_0x370e32(0x147)||_0x26e110){const _0x4a4511=formatResults(_0x508d5a,_0x237446);if(_0x26e110)try{a5_0x4f20cc[_0x370e32(0x116)](_0x26e110,_0x4a4511,'utf-8'),console[_0x370e32(0x10f)](),console[_0x370e32(0x10f)](a5_0x3977bb[_0x370e32(0x14b)](_0x370e32(0xef)+_0x26e110));}catch(_0x24178f){return console[_0x370e32(0x10f)](),console['log'](a5_0x3977bb[_0x370e32(0x112)](_0x370e32(0x136)+_0x24178f)),0x1;}else console[_0x370e32(0x10f)](),console[_0x370e32(0x10f)](_0x4a4511);}return _0x4307c1[_0x370e32(0x17e)]>0x0?0x1:0x0;}async[a5_0x59e40d(0x10b)](_0x5e065b,_0x1212f6){const _0x83ec1b=a5_0x59e40d,{options:_0x507d16,tdx:_0x223dd9}=_0x5e065b,{definition:_0x26bc5b,agentInfo:_0x56f29a,outputFormat:_0x1f6ddd,outputFile:_0x46dbf1}=_0x1212f6,_0x29b42c=_0x507d16['site'],_0x2e8a6b=loadLastTestRun();if(!_0x2e8a6b)return console[_0x83ec1b(0x10f)](a5_0x3977bb[_0x83ec1b(0x112)](_0x83ec1b(0x122))),console[_0x83ec1b(0x10f)](a5_0x3977bb['dim'](_0x83ec1b(0x10a))),0x1;if(_0x2e8a6b[_0x83ec1b(0x162)][_0x83ec1b(0x154)]!==_0x56f29a[_0x83ec1b(0x154)])return console[_0x83ec1b(0x10f)](a5_0x3977bb[_0x83ec1b(0x112)](_0x83ec1b(0x13c)+_0x2e8a6b['agent'][_0x83ec1b(0x154)]+_0x83ec1b(0x155)+_0x56f29a[_0x83ec1b(0x154)]+'\x22.')),console[_0x83ec1b(0x10f)](a5_0x3977bb[_0x83ec1b(0x14b)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x39bdfb=new Set(_0x2e8a6b[_0x83ec1b(0x14e)]['map'](_0x110b4c=>_0x110b4c[_0x83ec1b(0xed)])),_0x402c3d=_0x26bc5b[_0x83ec1b(0x15e)]['filter'](_0x2f6111=>!_0x39bdfb['has'](_0x2f6111['name']));if(_0x402c3d[_0x83ec1b(0x17e)]>0x0&&_0x2e8a6b[_0x83ec1b(0x12a)]!==_0x29b42c)return console[_0x83ec1b(0x10f)](a5_0x3977bb['red'](_0x83ec1b(0x177))),console[_0x83ec1b(0x10f)](a5_0x3977bb[_0x83ec1b(0x14b)](_0x83ec1b(0x180)+_0x2e8a6b['site']+_0x83ec1b(0x161)+_0x29b42c+'\x22.')),console[_0x83ec1b(0x10f)](a5_0x3977bb['dim'](_0x83ec1b(0x106)+_0x2e8a6b[_0x83ec1b(0x12a)]+_0x83ec1b(0x135))),0x1;const _0x38a02a=_0x26bc5b['tests']['filter'](_0x44a80c=>_0x39bdfb[_0x83ec1b(0x110)](_0x44a80c['name'])),_0x5a9e5b=_0x402c3d;let _0x2cbdc7;try{_0x2cbdc7=await setupEvaluatorAgent(_0x223dd9[_0x83ec1b(0x164)],_0x507d16[_0x83ec1b(0x14d)]);}catch(_0x1478fc){const _0x4428dd=_0x1478fc instanceof Error?_0x1478fc[_0x83ec1b(0x160)]:String(_0x1478fc);return console['log'](a5_0x3977bb['red'](_0x83ec1b(0x120)+_0x4428dd)),0x1;}console[_0x83ec1b(0x10f)](a5_0x3977bb[_0x83ec1b(0x114)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x83ec1b(0x10f)](_0x83ec1b(0x15b)+a5_0x3977bb[_0x83ec1b(0x145)](_0x2e8a6b[_0x83ec1b(0x125)])),console[_0x83ec1b(0x10f)](_0x83ec1b(0xf7)+a5_0x3977bb[_0x83ec1b(0x145)](_0x2e8a6b[_0x83ec1b(0x162)][_0x83ec1b(0x18d)]+'/'+_0x2e8a6b['agent'][_0x83ec1b(0x154)]));_0x5a9e5b[_0x83ec1b(0x17e)]>0x0&&console[_0x83ec1b(0x10f)]('New\x20tests\x20to\x20execute:\x20'+a5_0x3977bb[_0x83ec1b(0x131)](_0x5a9e5b[_0x83ec1b(0x17e)]));console[_0x83ec1b(0x10f)]();const _0x5598d0=[],_0x4b5cdd=Date[_0x83ec1b(0x104)](),_0x1286e9=createCommandSpinner(_0x83ec1b(0x167));if(_0x38a02a[_0x83ec1b(0x17e)]>0x0)try{const _0x3a8d7=await reevaluateFromCache(_0x223dd9[_0x83ec1b(0x164)],_0x2e8a6b,{'tests':_0x38a02a},{'evaluatorId':_0x2cbdc7,'onTestStart':(_0x277cb8,_0x50f9e5,_0x4337ce)=>{const _0x486573=_0x83ec1b;_0x1286e9[_0x486573(0x108)]=_0x486573(0x13f)+(_0x50f9e5+0x1)+'/'+_0x4337ce+':\x20'+_0x277cb8+_0x486573(0x128);if(!_0x1286e9[_0x486573(0x102)])_0x1286e9[_0x486573(0xf8)]();},'onTestComplete':(_0x45c4f0,_0xd844f9)=>{const _0x2de68b=_0x83ec1b;_0x1286e9[_0x2de68b(0x11a)]();if(_0xd844f9[_0x2de68b(0x166)]===_0x2de68b(0x183))console[_0x2de68b(0x10f)](a5_0x3977bb[_0x2de68b(0x146)]('✓\x20PASS:\x20'+_0x45c4f0)+a5_0x3977bb[_0x2de68b(0x14b)](_0x2de68b(0x157)));else _0xd844f9[_0x2de68b(0x166)]==='FAIL'?console[_0x2de68b(0x10f)](a5_0x3977bb[_0x2de68b(0x112)](_0x2de68b(0x11b)+_0x45c4f0+_0x2de68b(0x189)+_0xd844f9[_0x2de68b(0x170)])+a5_0x3977bb[_0x2de68b(0x14b)]('\x20(cached)')):console[_0x2de68b(0x10f)](a5_0x3977bb[_0x2de68b(0x112)]('✗\x20ERROR:\x20'+_0x45c4f0+'\x20-\x20'+_0xd844f9[_0x2de68b(0x170)]));_0xd844f9[_0x2de68b(0xff)]&&console[_0x2de68b(0x10f)](a5_0x3977bb[_0x2de68b(0x14b)](_0x2de68b(0x151)+_0xd844f9[_0x2de68b(0xff)])),_0x5598d0[_0x2de68b(0x140)](_0xd844f9);},'onTestSkipped':(_0x231bd4,_0x2adea6)=>{const _0x206e98=_0x83ec1b;_0x1286e9[_0x206e98(0x11a)](),console[_0x206e98(0x10f)](a5_0x3977bb[_0x206e98(0x131)](_0x206e98(0x118)+_0x231bd4+_0x206e98(0x189)+_0x2adea6));}});for(const _0x1f0870 of _0x3a8d7){!_0x5598d0[_0x83ec1b(0x148)](_0x5eb925=>_0x5eb925[_0x83ec1b(0x18c)]===_0x1f0870[_0x83ec1b(0x18c)])&&_0x5598d0['push'](_0x1f0870);}}catch(_0xaef82b){_0x1286e9['stop']();const _0x296237=_0xaef82b instanceof Error?_0xaef82b[_0x83ec1b(0x160)]:String(_0xaef82b);return console[_0x83ec1b(0x10f)](a5_0x3977bb['red'](_0x83ec1b(0x11e)+_0x296237)),0x1;}_0x1286e9['stop']();if(_0x5a9e5b[_0x83ec1b(0x17e)]>0x0){console[_0x83ec1b(0x10f)](),console[_0x83ec1b(0x10f)](a5_0x3977bb[_0x83ec1b(0x114)](_0x83ec1b(0x168)));const {projectId:_0x365fce,agentId:_0x96f245}=_0x2e8a6b[_0x83ec1b(0x162)];for(const _0x145d06 of _0x5a9e5b){console[_0x83ec1b(0x10f)](_0x83ec1b(0xf9)+a5_0x3977bb[_0x83ec1b(0x145)](_0x145d06[_0x83ec1b(0x18c)]));const _0x34a1a4=createCommandSpinner(_0x83ec1b(0x175)+_0x145d06['rounds'][_0x83ec1b(0x17e)]+_0x83ec1b(0x100));_0x34a1a4[_0x83ec1b(0xf8)]();try{const {result:_0x31292b}=await runTest(_0x223dd9[_0x83ec1b(0x164)],_0x145d06,{'agentId':_0x96f245,'projectId':_0x365fce,'site':_0x2e8a6b[_0x83ec1b(0x12a)],'noEval':![],'evaluatorId':_0x2cbdc7,'onRoundStart':(_0x54dcbd,_0x4d1458)=>{const _0xc31af1=_0x83ec1b;_0x34a1a4[_0xc31af1(0x108)]=_0xc31af1(0xec)+(_0x54dcbd+0x1)+'/'+_0x4d1458+_0xc31af1(0x100);},'onRoundComplete':(_0x2e52bb,_0x4088d9,_0x23f15d)=>{const _0x41b615=_0x83ec1b,_0x288ee1=formatElapsed(_0x4088d9);_0x23f15d?console[_0x41b615(0x10f)](_0x41b615(0x109)+(_0x2e52bb+0x1)+'/'+_0x145d06['rounds']['length']+_0x41b615(0x158)+a5_0x3977bb['green']('✓')+'\x20('+_0x288ee1+')'):console[_0x41b615(0x10f)](_0x41b615(0x109)+(_0x2e52bb+0x1)+'/'+_0x145d06[_0x41b615(0xee)][_0x41b615(0x17e)]+_0x41b615(0x158)+a5_0x3977bb[_0x41b615(0x112)]('✗'));},'onEvaluationStart':()=>{const _0x2d05a6=_0x83ec1b;_0x34a1a4['text']=_0x2d05a6(0x16a);},'onEvaluationComplete':_0x2a09cf=>{const _0x2aab55=_0x83ec1b,_0x536e5d=formatElapsed(_0x2a09cf);console[_0x2aab55(0x10f)](_0x2aab55(0xfc)+a5_0x3977bb['green']('✓')+'\x20('+_0x536e5d+')');}});_0x34a1a4[_0x83ec1b(0x11a)](),_0x5598d0[_0x83ec1b(0x140)](_0x31292b);if(_0x31292b[_0x83ec1b(0x166)]===_0x83ec1b(0x183))console[_0x83ec1b(0x10f)](a5_0x3977bb[_0x83ec1b(0x146)](_0x83ec1b(0x152)+_0x31292b[_0x83ec1b(0x170)])+a5_0x3977bb[_0x83ec1b(0x14b)](_0x83ec1b(0x15d)));else _0x31292b[_0x83ec1b(0x166)]==='FAIL'?console[_0x83ec1b(0x10f)](a5_0x3977bb['red']('✗\x20FAIL:\x20'+_0x31292b[_0x83ec1b(0x170)])+a5_0x3977bb[_0x83ec1b(0x14b)](_0x83ec1b(0x15d))):console['log'](a5_0x3977bb[_0x83ec1b(0x112)](_0x83ec1b(0x188)+_0x31292b[_0x83ec1b(0x170)]));_0x31292b[_0x83ec1b(0xff)]&&console[_0x83ec1b(0x10f)](a5_0x3977bb[_0x83ec1b(0x14b)](_0x83ec1b(0x151)+_0x31292b[_0x83ec1b(0xff)]));}catch(_0x353f0a){_0x34a1a4['stop']();const _0x108e43=_0x353f0a instanceof Error?_0x353f0a[_0x83ec1b(0x160)]:String(_0x353f0a);console[_0x83ec1b(0x10f)](a5_0x3977bb[_0x83ec1b(0x112)](_0x83ec1b(0x188)+_0x108e43)),_0x5598d0[_0x83ec1b(0x140)]({'name':_0x145d06[_0x83ec1b(0x18c)],'status':'ERROR','reason':_0x108e43,'timestamp':new Date()[_0x83ec1b(0x10e)](),'duration_ms':0x0});}}}console[_0x83ec1b(0x10f)]();const _0x2f2a0a=Date[_0x83ec1b(0x104)]()-_0x4b5cdd,_0x5deaed=_0x5598d0['filter'](_0x131f58=>_0x131f58['status']==='PASS')[_0x83ec1b(0x17e)],_0xe0f781=_0x5598d0['filter'](_0x650eee=>_0x650eee[_0x83ec1b(0x166)]===_0x83ec1b(0x184))['length'],_0x3c6a82=_0x5598d0[_0x83ec1b(0x17d)](_0x14e086=>_0x14e086[_0x83ec1b(0x166)]===_0x83ec1b(0x185))[_0x83ec1b(0x17e)];console[_0x83ec1b(0x10f)]('━'[_0x83ec1b(0x10d)](0x3c)),console[_0x83ec1b(0x10f)](_0x83ec1b(0x17a)),console[_0x83ec1b(0x10f)]('━'[_0x83ec1b(0x10d)](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x5598d0[_0x83ec1b(0x17e)]),console[_0x83ec1b(0x10f)](_0x83ec1b(0x150)+a5_0x3977bb[_0x83ec1b(0x146)](_0x5deaed)),console[_0x83ec1b(0x10f)]('Failed:\x20\x20\x20'+a5_0x3977bb[_0x83ec1b(0x112)](_0xe0f781));_0x3c6a82>0x0&&console[_0x83ec1b(0x10f)]('Errors:\x20\x20\x20'+a5_0x3977bb[_0x83ec1b(0x112)](_0x3c6a82));console[_0x83ec1b(0x10f)](_0x83ec1b(0x16e)+formatElapsed(_0x2f2a0a)),console['log']('━'[_0x83ec1b(0x10d)](0x3c));const _0x212b1d={'summary':{'total':_0x5598d0[_0x83ec1b(0x17e)],'passed':_0x5deaed,'failed':_0xe0f781,'errors':_0x3c6a82>0x0?_0x3c6a82:undefined,'duration_ms':_0x2f2a0a},'tests':_0x5598d0,'agent':{'project':_0x56f29a[_0x83ec1b(0x18d)],'name':_0x56f29a[_0x83ec1b(0x154)],'site':_0x29b42c},'timestamp':new Date(_0x4b5cdd)[_0x83ec1b(0x10e)]()};if(_0x1f6ddd!=='table'||_0x46dbf1){const _0x505b8f=formatResults(_0x212b1d,_0x1f6ddd);if(_0x46dbf1)try{a5_0x4f20cc[_0x83ec1b(0x116)](_0x46dbf1,_0x505b8f,'utf-8'),console[_0x83ec1b(0x10f)](),console[_0x83ec1b(0x10f)](a5_0x3977bb[_0x83ec1b(0x14b)](_0x83ec1b(0xef)+_0x46dbf1));}catch(_0x2381be){return console[_0x83ec1b(0x10f)](),console['log'](a5_0x3977bb[_0x83ec1b(0x112)](_0x83ec1b(0x136)+_0x2381be)),0x1;}else console['log'](),console[_0x83ec1b(0x10f)](_0x505b8f);}const _0x2bf77c=_0x5598d0[_0x83ec1b(0x17d)](_0x123281=>_0x123281[_0x83ec1b(0x166)]!=='PASS');return _0x2bf77c[_0x83ec1b(0x17e)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x2b27f1=a6_0x1519;(function(_0x5d4b90,_0xc4c87e){const _0x4ea721=a6_0x1519,_0x97a358=_0x5d4b90();while(!![]){try{const _0x330e77=-parseInt(_0x4ea721(0x121))/0x1+-parseInt(_0x4ea721(0xf8))/0x2*(parseInt(_0x4ea721(0x11e))/0x3)+parseInt(_0x4ea721(0xfb))/0x4+parseInt(_0x4ea721(0x124))/0x5+-parseInt(_0x4ea721(0xf3))/0x6+-parseInt(_0x4ea721(0x12b))/0x7+parseInt(_0x4ea721(0xf0))/0x8*(parseInt(_0x4ea721(0x114))/0x9);if(_0x330e77===_0xc4c87e)break;else _0x97a358['push'](_0x97a358['shift']());}catch(_0x47c9a9){_0x97a358['push'](_0x97a358['shift']());}}}(a6_0xbc5b,0xcb162));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a6_0x1519(_0x36545f,_0x1decdd){_0x36545f=_0x36545f-0xea;const _0xbc5bbd=a6_0xbc5b();let _0x151912=_0xbc5bbd[_0x36545f];return _0x151912;}import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x2b27f1(0x12e),a6_0x2b27f1(0x11b),a6_0x2b27f1(0x109),a6_0x2b27f1(0xeb),a6_0x2b27f1(0x100),a6_0x2b27f1(0xef),a6_0x2b27f1(0x111),'x-trino-user']);function isSensitiveHeader(_0x221640){const _0x17d1fb=a6_0x2b27f1;return SENSITIVE_HEADERS[_0x17d1fb(0x11f)](_0x221640[_0x17d1fb(0x106)]());}function parseHeader(_0x199905){const _0x164db2=a6_0x2b27f1,_0x3c0df3=_0x199905['indexOf'](':');if(_0x3c0df3===-0x1)throw new Error(_0x164db2(0x101)+_0x199905+'\x22.\x20'+_0x164db2(0xea));const _0x5c4b2d=_0x199905[_0x164db2(0xf9)](0x0,_0x3c0df3)['trim'](),_0xc7848=_0x199905[_0x164db2(0xf9)](_0x3c0df3+0x1)['trim']();if(!_0x5c4b2d)throw new Error(_0x164db2(0x123)+_0x199905+'\x22');return[_0x5c4b2d,_0xc7848];}export class ApiCommand extends BaseCommand{[a6_0x2b27f1(0xf7)]=a6_0x2b27f1(0xf5);[a6_0x2b27f1(0xec)]=a6_0x2b27f1(0x122);['validate'](_0xeb2cfd){const _0x5cf1b5=a6_0x2b27f1,{args:_0x175e7d,options:_0x1b9a42}=_0xeb2cfd,_0xf1618=_0x1b9a42;if(_0x175e7d[_0x5cf1b5(0x10e)]===0x0)return _0x5cf1b5(0x113);const _0x376b95=_0x175e7d[0x0];if(!_0x376b95[_0x5cf1b5(0x112)]('/'))return _0x5cf1b5(0x126)+_0x376b95;const _0x432b23=_0xf1618[_0x5cf1b5(0xf2)],_0x200cc5=_0xf1618[_0x5cf1b5(0x118)];if(_0x432b23&&_0x200cc5)return _0x5cf1b5(0x12a);const _0x2f3d4e=_0xf1618[_0x5cf1b5(0xfd)]||_0x5cf1b5(0x119),_0x27275b=['GET',_0x5cf1b5(0x127),_0x5cf1b5(0x12c),'DELETE','PATCH'];if(!_0x27275b[_0x5cf1b5(0x10c)](_0x2f3d4e[_0x5cf1b5(0x120)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x2f3d4e+_0x5cf1b5(0x104)+_0x27275b[_0x5cf1b5(0x11a)](',\x20');const _0x166186=_0xf1618[_0x5cf1b5(0x108)]||'td',_0x262ecc=['td',_0x5cf1b5(0x116),_0x5cf1b5(0x10f),_0x5cf1b5(0x10d),_0x5cf1b5(0xee),_0x5cf1b5(0x102),'cas'];if(!_0x262ecc[_0x5cf1b5(0x10c)](_0x166186))return _0x5cf1b5(0x125)+_0x166186+_0x5cf1b5(0x117)+_0x262ecc[_0x5cf1b5(0x11a)](',\x20');return undefined;}async[a6_0x2b27f1(0x110)](_0x4b970d){const _0x55a3da=a6_0x2b27f1,{options:_0x5295a2,args:_0x1eb60f,tdx:_0x942173}=_0x4b970d,_0x3c6f3d=_0x5295a2,_0x48b819=_0x1eb60f[0x0],_0x1b813a=(_0x3c6f3d[_0x55a3da(0xfd)]||_0x55a3da(0x119))[_0x55a3da(0x120)](),_0x1d205a=_0x3c6f3d[_0x55a3da(0xf2)],_0x15082e=_0x3c6f3d['file'],_0x5cd9f6=_0x3c6f3d[_0x55a3da(0xfa)],_0x547ae6=_0x3c6f3d['type']||'td';try{const _0x4b55cf={};if(_0x5cd9f6){const _0x44da3c=Array[_0x55a3da(0xf1)](_0x5cd9f6)?_0x5cd9f6:[_0x5cd9f6];for(const _0x523be0 of _0x44da3c){const [_0x435dbb,_0x3acccd]=parseHeader(_0x523be0);_0x4b55cf[_0x435dbb]=_0x3acccd;}}let _0x22eddd;if(_0x1d205a)_0x22eddd=_0x1d205a;else{if(_0x15082e)try{_0x22eddd=RawAPI[_0x55a3da(0x11d)](_0x15082e);}catch(_0x25347d){return console['error']('Error:\x20'+(_0x25347d instanceof Error?_0x25347d[_0x55a3da(0xf4)]:String(_0x25347d))),0x1;}}const _0x359be1={'method':_0x1b813a,'apiType':_0x547ae6,'includeHeaders':_0x5295a2[_0x55a3da(0xff)]};_0x22eddd&&(_0x359be1[_0x55a3da(0x105)]=_0x22eddd);Object['keys'](_0x4b55cf)['length']>0x0&&(_0x359be1[_0x55a3da(0x115)]=_0x4b55cf);if(_0x5295a2[_0x55a3da(0xff)]){const _0x28b017=resolveSite(_0x5295a2[_0x55a3da(0x107)]),_0x4eed1d=getEndpoint(_0x28b017,_0x547ae6),_0x2d4378=''+_0x4eed1d+_0x48b819;console['error']('>\x20'+_0x1b813a+'\x20'+_0x2d4378);const _0x2e7fdd=getAuthHeaders(_0x28b017),_0x303f83={..._0x2e7fdd,..._0x4b55cf};for(const [_0x5b4ac5,_0x4413bb]of Object[_0x55a3da(0x103)](_0x303f83)){!isSensitiveHeader(_0x5b4ac5)&&console['error']('>\x20'+_0x5b4ac5+':\x20'+_0x4413bb);}_0x22eddd&&console[_0x55a3da(0xfe)]('>'),console['error']('');}const _0x3a502d=await _0x942173[_0x55a3da(0xf5)]['request'](_0x48b819,_0x359be1);if(_0x5295a2['verbose']&&_0x3a502d[_0x55a3da(0x115)]){console[_0x55a3da(0xfe)](_0x55a3da(0x10b)+_0x3a502d[_0x55a3da(0x11c)]);for(const [_0x87bb8b,_0x4ebbe3]of Object[_0x55a3da(0x103)](_0x3a502d['headers'])){!isSensitiveHeader(_0x87bb8b)&&console[_0x55a3da(0xfe)]('<\x20'+_0x87bb8b+':\x20'+_0x4ebbe3);}console[_0x55a3da(0xfe)]('');}const _0x370e1e=Boolean(_0x5295a2[_0x55a3da(0x12d)]),_0x103d2f={'color':_0x5295a2['color'],'noColor':_0x5295a2[_0x55a3da(0xf6)]||_0x370e1e&&!_0x5295a2[_0x55a3da(0x128)]},_0x4ef592=colorizeJSON(_0x3a502d['data'],_0x103d2f);return _0x5295a2[_0x55a3da(0x12d)]?(writeFileSync(_0x5295a2[_0x55a3da(0x12d)],_0x4ef592),console[_0x55a3da(0xfe)](_0x55a3da(0xfc)+_0x5295a2[_0x55a3da(0x12d)])):console[_0x55a3da(0x10a)](_0x4ef592),0x0;}catch(_0x40f8c5){return _0x40f8c5 instanceof Error?(console[_0x55a3da(0xfe)](_0x55a3da(0xed)+_0x40f8c5['message']),_0x5295a2[_0x55a3da(0xff)]&&_0x40f8c5[_0x55a3da(0x129)]&&console[_0x55a3da(0xfe)]('\x0aStack\x20trace:\x0a'+_0x40f8c5[_0x55a3da(0x129)])):console['error'](_0x55a3da(0xed)+String(_0x40f8c5)),0x1;}}}function a6_0xbc5b(){const _0x1eaf30=['output','authorization','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','set-cookie','description','Error:\x20','llm','x-xsrf-token','7096UDLiIi','isArray','data','7125606TZJuVW','message','api','noColor','name','2mbhwlL','substring','header','2751232vvsUxl','Results\x20saved\x20to\x20','method','error','verbose','set-cookie2','Invalid\x20header\x20format:\x20\x22','llm-proxy','entries','.\x20Valid\x20methods:\x20','body','toLowerCase','site','type','cookie','log','<\x20HTTP/1.1\x20','includes','trino','length','workflow','execute','x-auth-token','startsWith','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','34947mJOqmU','headers','cdp','.\x20Valid\x20types:\x20','file','GET','join','proxy-authorization','status','readBodyFromFile','2908302zsTRMR','has','toUpperCase','1491038eSNWTz','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','7170450PCcLJS','Invalid\x20API\x20type:\x20','Endpoint\x20must\x20start\x20with\x20/:\x20','POST','color','stack','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','7603428KeIkxF','PUT'];a6_0xbc5b=function(){return _0x1eaf30;};return a6_0xbc5b();}
1
+ const a6_0x62b1a9=a6_0x1542;(function(_0xa7ae56,_0x1dd6dc){const _0x5d0ad9=a6_0x1542,_0x164367=_0xa7ae56();while(!![]){try{const _0x208f20=parseInt(_0x5d0ad9(0x1a2))/0x1*(-parseInt(_0x5d0ad9(0x19e))/0x2)+parseInt(_0x5d0ad9(0x1bb))/0x3+parseInt(_0x5d0ad9(0x195))/0x4*(parseInt(_0x5d0ad9(0x19f))/0x5)+-parseInt(_0x5d0ad9(0x1a8))/0x6+-parseInt(_0x5d0ad9(0x182))/0x7+-parseInt(_0x5d0ad9(0x1a4))/0x8+parseInt(_0x5d0ad9(0x1be))/0x9*(parseInt(_0x5d0ad9(0x1b6))/0xa);if(_0x208f20===_0x1dd6dc)break;else _0x164367['push'](_0x164367['shift']());}catch(_0x5263d5){_0x164367['push'](_0x164367['shift']());}}}(a6_0x19b0,0x8ff48));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';function a6_0x1542(_0xc4484a,_0x4a8637){_0xc4484a=_0xc4484a-0x181;const _0x19b0ad=a6_0x19b0();let _0x15420d=_0x19b0ad[_0xc4484a];return _0x15420d;}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization',a6_0x62b1a9(0x194),a6_0x62b1a9(0x1c6),a6_0x62b1a9(0x183),a6_0x62b1a9(0x184),'x-xsrf-token',a6_0x62b1a9(0x1c8),a6_0x62b1a9(0x19a)]);function isSensitiveHeader(_0x2702a4){return SENSITIVE_HEADERS['has'](_0x2702a4['toLowerCase']());}function parseHeader(_0xee85f0){const _0xe62c24=a6_0x62b1a9,_0x484cc2=_0xee85f0[_0xe62c24(0x1b0)](':');if(_0x484cc2===-0x1)throw new Error(_0xe62c24(0x186)+_0xee85f0+_0xe62c24(0x18f)+_0xe62c24(0x1ae));const _0x10af29=_0xee85f0[_0xe62c24(0x1a9)](0x0,_0x484cc2)['trim'](),_0x515348=_0xee85f0[_0xe62c24(0x1a9)](_0x484cc2+0x1)['trim']();if(!_0x10af29)throw new Error(_0xe62c24(0x1ac)+_0xee85f0+'\x22');return[_0x10af29,_0x515348];}export class ApiCommand extends BaseCommand{[a6_0x62b1a9(0x1c2)]=a6_0x62b1a9(0x1a0);[a6_0x62b1a9(0x1bc)]=a6_0x62b1a9(0x1ad);[a6_0x62b1a9(0x18b)](_0x58710a){const _0x58479e=a6_0x62b1a9,{args:_0x53b4f1,options:_0x3651e4}=_0x58710a,_0x29b901=_0x3651e4;if(_0x53b4f1[_0x58479e(0x1c5)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0xed5782=_0x53b4f1[0x0];if(!_0xed5782[_0x58479e(0x191)]('/'))return _0x58479e(0x19d)+_0xed5782;const _0x4d3a6a=_0x29b901[_0x58479e(0x190)],_0xf39939=_0x29b901['file'];if(_0x4d3a6a&&_0xf39939)return _0x58479e(0x1a1);const _0xb9dc3=_0x29b901[_0x58479e(0x1b9)]||_0x58479e(0x1b8),_0x4237af=[_0x58479e(0x1b8),_0x58479e(0x1b2),'PUT',_0x58479e(0x1c1),_0x58479e(0x1a3)];if(!_0x4237af[_0x58479e(0x1c3)](_0xb9dc3[_0x58479e(0x197)]()))return'Invalid\x20HTTP\x20method:\x20'+_0xb9dc3+'.\x20Valid\x20methods:\x20'+_0x4237af['join'](',\x20');const _0x313666=_0x29b901['type']||'td',_0x514f81=['td',_0x58479e(0x1c7),_0x58479e(0x18a),_0x58479e(0x18d),_0x58479e(0x185),_0x58479e(0x1a5),_0x58479e(0x1c4)];if(!_0x514f81[_0x58479e(0x1c3)](_0x313666))return _0x58479e(0x1b3)+_0x313666+_0x58479e(0x192)+_0x514f81[_0x58479e(0x1b7)](',\x20');return undefined;}async[a6_0x62b1a9(0x1b5)](_0x577cc1){const _0x27539d=a6_0x62b1a9,{options:_0x2956fb,args:_0x58ac68,tdx:_0x4f89e}=_0x577cc1,_0x1e5b34=_0x2956fb,_0x461085=_0x58ac68[0x0],_0x36a9e5=(_0x1e5b34[_0x27539d(0x1b9)]||_0x27539d(0x1b8))['toUpperCase'](),_0xe97af2=_0x1e5b34[_0x27539d(0x190)],_0x12c6cf=_0x1e5b34[_0x27539d(0x1aa)],_0x4ec8e5=_0x1e5b34[_0x27539d(0x193)],_0x389b24=_0x1e5b34[_0x27539d(0x1c0)]||'td';try{const _0x2aec32={};if(_0x4ec8e5){const _0x505ad0=Array[_0x27539d(0x188)](_0x4ec8e5)?_0x4ec8e5:[_0x4ec8e5];for(const _0x3ae2b1 of _0x505ad0){const [_0x2167d4,_0x3ee3f3]=parseHeader(_0x3ae2b1);_0x2aec32[_0x2167d4]=_0x3ee3f3;}}let _0x363fe7;if(_0xe97af2)_0x363fe7=_0xe97af2;else{if(_0x12c6cf)try{_0x363fe7=RawAPI['readBodyFromFile'](_0x12c6cf);}catch(_0x1fd900){return console['error'](_0x27539d(0x18e)+(_0x1fd900 instanceof Error?_0x1fd900[_0x27539d(0x199)]:String(_0x1fd900))),0x1;}}const _0x2003a2={'method':_0x36a9e5,'apiType':_0x389b24,'includeHeaders':_0x2956fb[_0x27539d(0x1bd)]};_0x363fe7&&(_0x2003a2[_0x27539d(0x189)]=_0x363fe7);Object[_0x27539d(0x1a6)](_0x2aec32)['length']>0x0&&(_0x2003a2[_0x27539d(0x1ab)]=_0x2aec32);if(_0x2956fb[_0x27539d(0x1bd)]){const _0x37a1a6=resolveSite(_0x2956fb[_0x27539d(0x1ba)]),_0x26ac66=getEndpoint(_0x37a1a6,_0x389b24),_0x2be344=''+_0x26ac66+_0x461085;console['error']('>\x20'+_0x36a9e5+'\x20'+_0x2be344);const _0x5284ab=getAuthHeaders(_0x37a1a6),_0x57d6f2={..._0x5284ab,..._0x2aec32};for(const [_0x49ced0,_0x5bc6ce]of Object[_0x27539d(0x181)](_0x57d6f2)){!isSensitiveHeader(_0x49ced0)&&console[_0x27539d(0x1bf)]('>\x20'+_0x49ced0+':\x20'+_0x5bc6ce);}_0x363fe7&&console[_0x27539d(0x1bf)]('>'),console[_0x27539d(0x1bf)]('');}const _0x1055fa=await _0x4f89e[_0x27539d(0x1a0)][_0x27539d(0x198)](_0x461085,_0x2003a2);if(_0x2956fb[_0x27539d(0x1bd)]&&_0x1055fa[_0x27539d(0x1ab)]){console[_0x27539d(0x1bf)](_0x27539d(0x196)+_0x1055fa[_0x27539d(0x19b)]);for(const [_0x2f6544,_0xa6e631]of Object[_0x27539d(0x181)](_0x1055fa[_0x27539d(0x1ab)])){!isSensitiveHeader(_0x2f6544)&&console['error']('<\x20'+_0x2f6544+':\x20'+_0xa6e631);}console['error']('');}const _0x270152=Boolean(_0x2956fb[_0x27539d(0x18c)]),_0x141088={'color':_0x2956fb[_0x27539d(0x187)],'noColor':_0x2956fb[_0x27539d(0x19c)]||_0x270152&&!_0x2956fb[_0x27539d(0x187)]},_0x39d6d0=colorizeJSON(_0x1055fa[_0x27539d(0x190)],_0x141088);return _0x2956fb[_0x27539d(0x18c)]?(writeFileSync(_0x2956fb[_0x27539d(0x18c)],_0x39d6d0),console[_0x27539d(0x1bf)](_0x27539d(0x1af)+_0x2956fb[_0x27539d(0x18c)])):console[_0x27539d(0x1a7)](_0x39d6d0),0x0;}catch(_0x3ac4b){return _0x3ac4b instanceof Error?(console[_0x27539d(0x1bf)](_0x27539d(0x18e)+_0x3ac4b[_0x27539d(0x199)]),_0x2956fb['verbose']&&_0x3ac4b['stack']&&console[_0x27539d(0x1bf)](_0x27539d(0x1b4)+_0x3ac4b[_0x27539d(0x1b1)])):console[_0x27539d(0x1bf)](_0x27539d(0x18e)+String(_0x3ac4b)),0x1;}}}function a6_0x19b0(){const _0x2be4a6=['PATCH','7286056oTAkxk','llm-proxy','keys','log','1292070VGMqlw','substring','file','headers','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','Results\x20saved\x20to\x20','indexOf','stack','POST','Invalid\x20API\x20type:\x20','\x0aStack\x20trace:\x0a','execute','1545590uDFrMD','join','GET','method','site','914472kApqVK','description','verbose','162VZidyx','error','type','DELETE','name','includes','cas','length','cookie','cdp','x-auth-token','entries','5103490sMWpaF','set-cookie','set-cookie2','llm','Invalid\x20header\x20format:\x20\x22','color','isArray','body','workflow','validate','output','trino','Error:\x20','\x22.\x20','data','startsWith','.\x20Valid\x20types:\x20','header','proxy-authorization','994388FBsecR','<\x20HTTP/1.1\x20','toUpperCase','request','message','x-trino-user','status','noColor','Endpoint\x20must\x20start\x20with\x20/:\x20','1781342xtokTw','5SyZAfm','api','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','1DdFPvj'];a6_0x19b0=function(){return _0x2be4a6;};return a6_0x19b0();}
@@ -1 +1 @@
1
- const a7_0x4b3b1d=a7_0xa0a9;(function(_0x51b351,_0x352b8e){const _0x5075f0=a7_0xa0a9,_0x5ad430=_0x51b351();while(!![]){try{const _0x2682b1=parseInt(_0x5075f0(0xcd))/0x1+parseInt(_0x5075f0(0x108))/0x2+parseInt(_0x5075f0(0x110))/0x3+-parseInt(_0x5075f0(0xc6))/0x4+-parseInt(_0x5075f0(0xde))/0x5+parseInt(_0x5075f0(0x116))/0x6*(parseInt(_0x5075f0(0xca))/0x7)+-parseInt(_0x5075f0(0xed))/0x8;if(_0x2682b1===_0x352b8e)break;else _0x5ad430['push'](_0x5ad430['shift']());}catch(_0x4d34de){_0x5ad430['push'](_0x5ad430['shift']());}}}(a7_0x35ad,0x8a900));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';function a7_0xa0a9(_0x147ea9,_0x4b7e29){_0x147ea9=_0x147ea9-0xc2;const _0x35ad29=a7_0x35ad();let _0xa0a996=_0x35ad29[_0x147ea9];return _0xa0a996;}import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';function a7_0x35ad(){const _0x4b49bc=['2598426JTkXYy','OAuth\x20tokens','Use\x20an\x20API\x20key','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','Choose\x20how\x20to\x20sign\x20in:','Setup\x20cancelled','auth:setup','first_name','password','accountName','Remove\x20API\x20key\x20from\x20system\x20keychain','/users/initiate_sso\x20(account:\x20','User:\x20','filter','name','1968924qpmMtX','Credential\x20type:\x20OAuth','last_name','jobs','7zEEoxR','apikey','For\x20scripts\x20or\x20headless\x20servers','897231SyLnYf','API\x20key','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','trim','error','bold','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','\x20(profile:\x20','/app/mp/ak','oauth','description','red','profile','warn','\x20\x20tdx','tdx:\x20auth\x20setup','N/A','5532580yQqYyv','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Read\x20credential\x20from\x20keychain','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','select','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','auth:clear','No\x20credentials\x20found\x20in\x20keychain','Setting\x20up\x20authentication\x20for\x20site:\x20','✓\x20Authentication\x20successful\x0a','tdx:\x20auth\x20clear','log','dim','status','1677160dIqHwG','\x0aSetup\x20cancelled','✓\x20Default\x20site\x20set\x20to\x20','auth','\x20and\x20','logLevel','You\x20can\x20find\x20your\x20API\x20key\x20at:','cyan','ERROR','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20\x20(','Enter\x20your\x20TD\x20API\x20key:','Validating\x20API\x20key...','Setup\x20API\x20key\x20authentication\x20interactively','method','Validating\x20OAuth\x20tokens...','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Read\x20credential\x20from\x20','✓\x20Profile\x20\x27','yellow','join','execute','✓\x20Signed\x20in\x20successfully','access_token','email','site','apiKey','439792zgaJig','create','Sign\x20in\x20with\x20browser\x20(recommended)','tdx\x20profile:\x20','\x27\x20registered','getUserInfo','\x20--profile\x20','all','2477238xQIPYE','us01','\x20removed\x20from\x20keychain','message','✗\x20Validation\x20failed:\x20','green'];a7_0x35ad=function(){return _0x4b49bc;};return a7_0x35ad();}import{promptSiteSelection}from'../core/constants.js';import a7_0x537fae 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_0x8cfce1 from'chalk';export async function runOAuthLoginFlow(_0x2eec96,_0x1533cb,_0x470ef7,_0x3e2707){const _0x3453f4=a7_0xa0a9,_0x29e4bc=await isKeychainAvailable();if(!_0x29e4bc)throw new Error(_0x3453f4(0xfd)+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');let _0x4451f2=_0x3e2707?.[_0x3453f4(0x11f)];if(!_0x4451f2){const _0x1f1def=await a7_0x537fae({'type':'text','name':_0x3453f4(0x11f),'message':_0x3453f4(0xd3)});if(_0x1f1def['accountName']===undefined)throw new Error(_0x3453f4(0x11b));_0x4451f2=_0x1f1def['accountName'][_0x3453f4(0xd0)]()||undefined;}const _0x78bde8=getConsoleUrl(_0x2eec96);console[_0x3453f4(0xea)]('Opening\x20browser\x20for\x20authentication...');_0x4451f2?console['log']('\x20\x20'+_0x78bde8+_0x3453f4(0xc2)+_0x4451f2+')'):console['log']('\x20\x20'+_0x78bde8+'/oauth/authorize');console[_0x3453f4(0xea)](_0x3453f4(0xe4));const _0x531477=await startOAuthFlow(_0x2eec96,{'accountName':_0x4451f2});console[_0x3453f4(0xea)](_0x3453f4(0xfc));const _0x1f382e=TDX[_0x3453f4(0x109)]({'site':_0x2eec96,'accessToken':_0x531477[_0x3453f4(0x104)],'logLevel':_0x470ef7??LogLevel[_0x3453f4(0xf5)]}),_0x1f45a3=await _0x1f382e['jobs'][_0x3453f4(0x10d)]();console[_0x3453f4(0xea)](a7_0x8cfce1[_0x3453f4(0x115)](_0x3453f4(0x103))),console[_0x3453f4(0xea)]('\x20\x20'+a7_0x8cfce1[_0x3453f4(0xf4)](_0x2eec96+':'+_0x1f45a3['account_id'])+'\x20\x20user_id:'+_0x1f45a3['id']+_0x3453f4(0xf7)+_0x1f45a3[_0x3453f4(0x105)]+')');!_0x4451f2&&(console[_0x3453f4(0xea)](a7_0x8cfce1['dim']('\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:')),console[_0x3453f4(0xea)](a7_0x8cfce1[_0x3453f4(0xeb)]('\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>')),console['log'](a7_0x8cfce1[_0x3453f4(0xeb)]('\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions')));await saveOAuthTokens(_0x531477,_0x1533cb),console[_0x3453f4(0xea)]('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x1533cb?'\x20(profile:\x20'+_0x1533cb+')':''));if(_0x1533cb){const _0xf03fdf={'site':_0x2eec96};saveProfileToUserConfig(_0x1533cb,_0xf03fdf),console['log'](_0x3453f4(0xff)+_0x1533cb+_0x3453f4(0x10c));}else saveDefaultSiteToUserConfig(_0x2eec96),console[_0x3453f4(0xea)](_0x3453f4(0xef)+_0x2eec96);const _0xe57577=_0x1533cb?_0x3453f4(0x10e)+_0x1533cb:'';console[_0x3453f4(0xea)](),console[_0x3453f4(0xea)](_0x3453f4(0x119)),console[_0x3453f4(0xea)](_0x3453f4(0xdb)+_0xe57577+_0x3453f4(0xf6)),console[_0x3453f4(0xea)](_0x3453f4(0xdb)+_0xe57577+_0x3453f4(0xdf));}export async function promptAuthMethod(){const _0x54a540=a7_0xa0a9,_0xd2bd7f=await a7_0x537fae({'type':_0x54a540(0xe2),'name':_0x54a540(0xfb),'message':_0x54a540(0x11a),'choices':[{'title':_0x54a540(0x10a),'description':_0x54a540(0xe1),'value':_0x54a540(0xd6)},{'title':_0x54a540(0x118),'description':_0x54a540(0xcc),'value':_0x54a540(0xcb)}]});return _0xd2bd7f[_0x54a540(0xfb)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x4b3b1d(0xc5)]=a7_0x4b3b1d(0x11c);[a7_0x4b3b1d(0xd7)]=a7_0x4b3b1d(0xfa);async[a7_0x4b3b1d(0x102)](_0xbd49){const _0x5d39f9=a7_0x4b3b1d,{options:_0x1af209}=_0xbd49,_0x5752c4=_0x1af209[_0x5d39f9(0xd9)];console[_0x5d39f9(0xea)](a7_0x8cfce1[_0x5d39f9(0xd2)](_0x5d39f9(0xdc)));const _0x361930=_0x1af209[_0x5d39f9(0x106)]||_0x5d39f9(0x111),_0x2c8572=await promptSiteSelection(_0x361930,_0x5752c4,_0x5d39f9(0x11b));if(!_0x2c8572)return 0x1;const _0x1f8d94=resolveSite(_0x2c8572),_0x116630=await promptAuthMethod();if(!_0x116630)return console['log'](_0x5d39f9(0xee)),0x1;if(_0x116630===_0x5d39f9(0xd6)){const {accountName:_0x15f141}=_0x1af209;return await runOAuthLoginFlow(_0x1f8d94,_0x5752c4,_0x1af209[_0x5d39f9(0xf2)]??LogLevel['ERROR'],{'accountName':_0x15f141}),0x0;}console['log'](_0x5d39f9(0xe7)+_0x1f8d94),console[_0x5d39f9(0xea)](_0x5d39f9(0xf3)),console[_0x5d39f9(0xea)]('\x20\x20'+getConsoleUrl(_0x1f8d94,_0x5d39f9(0xd5)));const _0x3ae7d5=await a7_0x537fae({'type':_0x5d39f9(0x11e),'name':'apiKey','message':_0x5d39f9(0xf8),'validate':_0x5acdc2=>{const _0x265a63=_0x5d39f9;if(!_0x5acdc2||!_0x5acdc2[_0x265a63(0xd0)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x3ae7d5[_0x5d39f9(0x107)])return console[_0x5d39f9(0xea)]('\x0aSetup\x20cancelled'),0x1;const _0x11ebe9=_0x3ae7d5[_0x5d39f9(0x107)];console[_0x5d39f9(0xea)](_0x5d39f9(0xf9));try{const _0x3b5285=TDX[_0x5d39f9(0x109)]({'site':_0x1f8d94,'apiKey':_0x11ebe9['trim'](),'logLevel':_0x1af209[_0x5d39f9(0xf2)]??LogLevel[_0x5d39f9(0xf5)]}),_0x37ea83=await _0x3b5285[_0x5d39f9(0xc9)]['getUserInfo']();console[_0x5d39f9(0xea)](_0x5d39f9(0xe3)+_0x37ea83[_0x5d39f9(0x105)]+')');const _0x868680=await isKeychainAvailable();_0x868680?(await saveAPIKeyAsync(_0x11ebe9['trim'](),_0x1f8d94,_0x5752c4),console['log']('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x5752c4?_0x5d39f9(0xd4)+_0x5752c4+')':''))):(console[_0x5d39f9(0xda)](a7_0x8cfce1['yellow']('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x5d39f9(0xda)](a7_0x8cfce1['yellow']('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x5752c4){const _0x13a776={'site':_0x1f8d94};saveProfileToUserConfig(_0x5752c4,_0x13a776),console[_0x5d39f9(0xea)](_0x5d39f9(0xff)+_0x5752c4+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x1f8d94),console[_0x5d39f9(0xea)](_0x5d39f9(0xef)+_0x1f8d94);const _0x309b91=_0x5752c4?'\x20--profile\x20'+_0x5752c4:'';return console[_0x5d39f9(0xea)](),console[_0x5d39f9(0xea)](_0x5d39f9(0x119)),console[_0x5d39f9(0xea)](_0x5d39f9(0xdb)+_0x309b91+_0x5d39f9(0xf6)),console['log']('\x20\x20tdx'+_0x309b91+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x493754){if(_0x493754 instanceof HTTPClientError&&_0x493754[_0x5d39f9(0xec)]===0x191)return printAuthError(_0x493754),0x1;return console[_0x5d39f9(0xd1)](a7_0x8cfce1[_0x5d39f9(0xd8)](_0x5d39f9(0x114)+(_0x493754 instanceof Error?_0x493754[_0x5d39f9(0x113)]:String(_0x493754)))),console[_0x5d39f9(0xd1)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x4b3b1d(0xc5)]=a7_0x4b3b1d(0xf0);[a7_0x4b3b1d(0xd7)]=a7_0x4b3b1d(0xcf);async[a7_0x4b3b1d(0x102)](_0x52caf1){const _0x581745=a7_0x4b3b1d,{options:_0x30399f,tdx:_0x2af592}=_0x52caf1,_0x5c19c3=_0x30399f[_0x581745(0x106)],_0x2c67c6=_0x30399f[_0x581745(0xd9)],_0x5866c4=_0x2c67c6?_0x2c67c6:_0x581745(0xdd);console[_0x581745(0xea)](_0x581745(0x10b)+_0x5866c4+'\x20(site:\x20'+_0x5c19c3+')');const _0x25663c=await getOAuthTokens(_0x2c67c6);if(_0x25663c)console['log'](_0x581745(0xc7)),console[_0x581745(0xea)](_0x581745(0xe0)+(_0x2c67c6?_0x581745(0xd4)+_0x2c67c6+')':''));else{const _0xd5b2f6=await resolveAPIKeyAsync(_0x5c19c3,_0x2c67c6);if(_0xd5b2f6){const {source:_0x5d5a25,isDeprecated:_0x321e8e}=_0xd5b2f6,_0x547d01=_0x581745(0xfe)+_0x5d5a25;console[_0x581745(0xea)](_0x321e8e?a7_0x8cfce1['yellow'](_0x547d01):_0x547d01);}else console['log'](a7_0x8cfce1[_0x581745(0x100)]('No\x20credential\x20found'));}try{const _0x4df442=await _0x2af592['jobs'][_0x581745(0x10d)]();return console[_0x581745(0xea)](a7_0x8cfce1[_0x581745(0x115)](_0x581745(0xe8))),console[_0x581745(0xea)](_0x581745(0xc3)+_0x4df442['email']),(_0x4df442[_0x581745(0x11d)]||_0x4df442['last_name'])&&console[_0x581745(0xea)]('Name:\x20'+[_0x4df442[_0x581745(0x11d)],_0x4df442[_0x581745(0xc8)]]['filter'](Boolean)[_0x581745(0x101)]('\x20')),0x0;}catch(_0x1f6281){return _0x1f6281 instanceof HTTPClientError&&_0x1f6281['status']===0x191?printAuthError(_0x1f6281,!![],_0x2c67c6):console['error'](a7_0x8cfce1[_0x581745(0xd8)](_0x581745(0x114)+(_0x1f6281 instanceof Error?_0x1f6281[_0x581745(0x113)]:String(_0x1f6281)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x4b3b1d(0xc5)]=a7_0x4b3b1d(0xe5);['description']=a7_0x4b3b1d(0x120);async['execute'](_0x50371a){const _0x13820d=a7_0x4b3b1d,{options:_0x218948}=_0x50371a,_0x1561bd=_0x218948['profile'];console['log'](a7_0x8cfce1[_0x13820d(0xd2)](_0x13820d(0xe9)));const _0x2a6a98=await isKeychainAvailable();if(!_0x2a6a98)return console[_0x13820d(0xd1)](a7_0x8cfce1[_0x13820d(0xd8)]('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x709938,_0x256b54]=await Promise[_0x13820d(0x10f)]([deleteKeychainAPIKey(_0x1561bd),deleteOAuthTokens(_0x1561bd)]);if(_0x709938||_0x256b54){clearCredentialCache();const _0x373ef9=[_0x709938&&_0x13820d(0xce),_0x256b54&&_0x13820d(0x117)][_0x13820d(0xc4)](Boolean)[_0x13820d(0x101)](_0x13820d(0xf1));return console[_0x13820d(0xea)]('✓\x20'+_0x373ef9+_0x13820d(0x112)+(_0x1561bd?_0x13820d(0xd4)+_0x1561bd+')':'')),0x0;}else return console[_0x13820d(0xea)](_0x13820d(0xe6)+(_0x1561bd?'\x20for\x20profile:\x20'+_0x1561bd:'')),0x1;}}
1
+ const a7_0x184ffe=a7_0x1831;(function(_0x4638fa,_0x2354e){const _0x2ae388=a7_0x1831,_0x247b60=_0x4638fa();while(!![]){try{const _0x571491=parseInt(_0x2ae388(0xcd))/0x1*(parseInt(_0x2ae388(0xcc))/0x2)+parseInt(_0x2ae388(0xdc))/0x3+parseInt(_0x2ae388(0xbe))/0x4*(parseInt(_0x2ae388(0xd9))/0x5)+-parseInt(_0x2ae388(0x9b))/0x6*(-parseInt(_0x2ae388(0x7a))/0x7)+-parseInt(_0x2ae388(0xc6))/0x8*(parseInt(_0x2ae388(0x92))/0x9)+-parseInt(_0x2ae388(0x7d))/0xa+parseInt(_0x2ae388(0xb0))/0xb;if(_0x571491===_0x2354e)break;else _0x247b60['push'](_0x247b60['shift']());}catch(_0xaa5550){_0x247b60['push'](_0x247b60['shift']());}}}(a7_0x3f9a,0x9cefc));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';function a7_0x1831(_0x51b5c7,_0x28f49d){_0x51b5c7=_0x51b5c7-0x7a;const _0x3f9a10=a7_0x3f9a();let _0x1831b9=_0x3f9a10[_0x51b5c7];return _0x1831b9;}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x54666c from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a7_0x3f9a(){const _0x1ebcd5=['For\x20scripts\x20or\x20headless\x20servers','auth:clear','green','\x20for\x20profile:\x20','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','log','all','oauth','execute','apiKey','dim','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','\x20--profile\x20','Use\x20an\x20API\x20key','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','error','getUserInfo','4753665GMfEDL','Validating\x20OAuth\x20tokens...','/users/initiate_sso\x20(account:\x20','✓\x20Signed\x20in\x20successfully','Setting\x20up\x20authentication\x20for\x20site:\x20','\x20removed\x20from\x20keychain','\x20\x20tdx','✓\x20Profile\x20\x27','create','1047390AKLdmP','N/A','red','tdx\x20profile:\x20','Name:\x20','No\x20credential\x20found','Remove\x20API\x20key\x20from\x20system\x20keychain','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','auth','status','accountName','Validating\x20API\x20key...','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','trim','\x20\x20(','/oauth/authorize','us01','site','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','\x0aSetup\x20cancelled','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','1462252eFAalz','account_id','yellow','first_name','tdx:\x20auth\x20setup','ERROR','API\x20key','✗\x20Validation\x20failed:\x20','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','\x27\x20registered','method','select','✓\x20Default\x20site\x20set\x20to\x20','Read\x20credential\x20from\x20','2116OTmNMg','User:\x20','jobs','last_name','\x20and\x20','description','join','name','16Ynoxkr','Credential\x20type:\x20OAuth','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','No\x20credentials\x20found\x20in\x20keychain','text','bold','794YPuQei','2881MVqEXl','password','profile','logLevel','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','filter','auth:setup','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','cyan','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Choose\x20how\x20to\x20sign\x20in:','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','4260JPHpXx','email','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','235038cebMQP','\x20(profile:\x20','Enter\x20your\x20TD\x20API\x20key:','21IUkNsW','message','\x20\x20user_id:','6302560lmhcyI','OAuth\x20tokens','Setup\x20cancelled','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.'];a7_0x3f9a=function(){return _0x1ebcd5;};return a7_0x3f9a();}import{LogLevel}from'../utils/tdx-logger.js';import a7_0xb544ba from'chalk';export async function runOAuthLoginFlow(_0x43df37,_0x41fef2,_0x277d2c,_0x2e5acf){const _0x1dde51=a7_0x1831,_0x5be6ee=await isKeychainAvailable();if(!_0x5be6ee)throw new Error(_0x1dde51(0xd4)+_0x1dde51(0x80));let _0x248f09=_0x2e5acf?.[_0x1dde51(0xa5)];if(!_0x248f09){const _0x4efd8c=await a7_0x54666c({'type':_0x1dde51(0xca),'name':_0x1dde51(0xa5),'message':_0x1dde51(0xa7)});if(_0x4efd8c[_0x1dde51(0xa5)]===undefined)throw new Error(_0x1dde51(0x7f));_0x248f09=_0x4efd8c['accountName']['trim']()||undefined;}const _0x2a67f1=getConsoleUrl(_0x43df37);console[_0x1dde51(0x86)]('Opening\x20browser\x20for\x20authentication...');_0x248f09?console['log']('\x20\x20'+_0x2a67f1+_0x1dde51(0x94)+_0x248f09+')'):console[_0x1dde51(0x86)]('\x20\x20'+_0x2a67f1+_0x1dde51(0xaa));console[_0x1dde51(0x86)]('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0x495bfd=await startOAuthFlow(_0x43df37,{'accountName':_0x248f09});console[_0x1dde51(0x86)](_0x1dde51(0x93));const _0x27cd76=TDX[_0x1dde51(0x9a)]({'site':_0x43df37,'accessToken':_0x495bfd['access_token'],'logLevel':_0x277d2c??LogLevel[_0x1dde51(0xb5)]}),_0x536260=await _0x27cd76['jobs']['getUserInfo']();console[_0x1dde51(0x86)](a7_0xb544ba[_0x1dde51(0x83)](_0x1dde51(0x95))),console[_0x1dde51(0x86)]('\x20\x20'+a7_0xb544ba[_0x1dde51(0xd5)](_0x43df37+':'+_0x536260[_0x1dde51(0xb1)])+_0x1dde51(0x7c)+_0x536260['id']+_0x1dde51(0xa9)+_0x536260['email']+')');!_0x248f09&&(console['log'](a7_0xb544ba[_0x1dde51(0x8b)](_0x1dde51(0xd8))),console[_0x1dde51(0x86)](a7_0xb544ba['dim'](_0x1dde51(0x85))),console[_0x1dde51(0x86)](a7_0xb544ba['dim']('\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions')));await saveOAuthTokens(_0x495bfd,_0x41fef2),console[_0x1dde51(0x86)](_0x1dde51(0x8f)+(_0x41fef2?_0x1dde51(0xdd)+_0x41fef2+')':''));if(_0x41fef2){const _0x987424={'site':_0x43df37};saveProfileToUserConfig(_0x41fef2,_0x987424),console[_0x1dde51(0x86)](_0x1dde51(0x99)+_0x41fef2+_0x1dde51(0xb9));}else saveDefaultSiteToUserConfig(_0x43df37),console[_0x1dde51(0x86)](_0x1dde51(0xbc)+_0x43df37);const _0x1bc6f3=_0x41fef2?'\x20--profile\x20'+_0x41fef2:'';console[_0x1dde51(0x86)](),console['log'](_0x1dde51(0xaf)),console['log']('\x20\x20tdx'+_0x1bc6f3+_0x1dde51(0xc8)),console[_0x1dde51(0x86)](_0x1dde51(0x98)+_0x1bc6f3+_0x1dde51(0xd6));}export async function promptAuthMethod(){const _0x19454e=a7_0x1831,_0x48576c=await a7_0x54666c({'type':_0x19454e(0xbb),'name':_0x19454e(0xba),'message':_0x19454e(0xd7),'choices':[{'title':'Sign\x20in\x20with\x20browser\x20(recommended)','description':'Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','value':_0x19454e(0x88)},{'title':_0x19454e(0x8e),'description':_0x19454e(0x81),'value':'apikey'}]});return _0x48576c[_0x19454e(0xba)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x184ffe(0xc5)]=a7_0x184ffe(0xd3);[a7_0x184ffe(0xc3)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x184ffe(0x89)](_0x1f0374){const _0x486495=a7_0x184ffe,{options:_0x4a83e9}=_0x1f0374,_0x1017bf=_0x4a83e9[_0x486495(0xcf)];console['log'](a7_0xb544ba[_0x486495(0xcb)](_0x486495(0xb4)));const _0x4c466f=_0x4a83e9[_0x486495(0xac)]||_0x486495(0xab),_0x488e9e=await promptSiteSelection(_0x4c466f,_0x1017bf,_0x486495(0x7f));if(!_0x488e9e)return 0x1;const _0x360619=resolveSite(_0x488e9e),_0x1331dc=await promptAuthMethod();if(!_0x1331dc)return console[_0x486495(0x86)](_0x486495(0xae)),0x1;if(_0x1331dc==='oauth'){const {accountName:_0x6a3b79}=_0x4a83e9;return await runOAuthLoginFlow(_0x360619,_0x1017bf,_0x4a83e9[_0x486495(0xd0)]??LogLevel[_0x486495(0xb5)],{'accountName':_0x6a3b79}),0x0;}console[_0x486495(0x86)](_0x486495(0x96)+_0x360619),console['log']('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x486495(0x86)]('\x20\x20'+getConsoleUrl(_0x360619,'/app/mp/ak'));const _0x5c009a=await a7_0x54666c({'type':_0x486495(0xce),'name':'apiKey','message':_0x486495(0xde),'validate':_0x16cf7b=>{if(!_0x16cf7b||!_0x16cf7b['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x5c009a[_0x486495(0x8a)])return console['log'](_0x486495(0xae)),0x1;const _0x57f3ea=_0x5c009a[_0x486495(0x8a)];console[_0x486495(0x86)](_0x486495(0xa6));try{const _0x96315=TDX[_0x486495(0x9a)]({'site':_0x360619,'apiKey':_0x57f3ea['trim'](),'logLevel':_0x4a83e9[_0x486495(0xd0)]??LogLevel[_0x486495(0xb5)]}),_0x306525=await _0x96315[_0x486495(0xc0)]['getUserInfo']();console[_0x486495(0x86)](_0x486495(0x8c)+_0x306525[_0x486495(0xda)]+')');const _0x5df20a=await isKeychainAvailable();_0x5df20a?(await saveAPIKeyAsync(_0x57f3ea[_0x486495(0xa8)](),_0x360619,_0x1017bf),console['log'](_0x486495(0xdb)+(_0x1017bf?_0x486495(0xdd)+_0x1017bf+')':''))):(console['warn'](a7_0xb544ba[_0x486495(0xb2)](_0x486495(0xa2))),console['warn'](a7_0xb544ba[_0x486495(0xb2)](_0x486495(0xd1))));if(_0x1017bf){const _0x2c5c4a={'site':_0x360619};saveProfileToUserConfig(_0x1017bf,_0x2c5c4a),console[_0x486495(0x86)](_0x486495(0x99)+_0x1017bf+_0x486495(0xb9));}else saveDefaultSiteToUserConfig(_0x360619),console[_0x486495(0x86)](_0x486495(0xbc)+_0x360619);const _0x13775b=_0x1017bf?_0x486495(0x8d)+_0x1017bf:'';return console[_0x486495(0x86)](),console[_0x486495(0x86)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log']('\x20\x20tdx'+_0x13775b+_0x486495(0xc8)),console[_0x486495(0x86)](_0x486495(0x98)+_0x13775b+_0x486495(0xd6)),0x0;}catch(_0x38115b){if(_0x38115b instanceof HTTPClientError&&_0x38115b[_0x486495(0xa4)]===0x191)return printAuthError(_0x38115b),0x1;return console[_0x486495(0x90)](a7_0xb544ba[_0x486495(0x9d)]('✗\x20Validation\x20failed:\x20'+(_0x38115b instanceof Error?_0x38115b[_0x486495(0x7b)]:String(_0x38115b)))),console[_0x486495(0x90)](_0x486495(0xb8)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x184ffe(0xc5)]=a7_0x184ffe(0xa3);[a7_0x184ffe(0xc3)]=a7_0x184ffe(0xad);async['execute'](_0x57bae0){const _0x51c913=a7_0x184ffe,{options:_0x3aad37,tdx:_0x135047}=_0x57bae0,_0x12607c=_0x3aad37[_0x51c913(0xac)],_0x3f12c7=_0x3aad37['profile'],_0x4871cb=_0x3f12c7?_0x3f12c7:_0x51c913(0x9c);console[_0x51c913(0x86)](_0x51c913(0x9e)+_0x4871cb+'\x20(site:\x20'+_0x12607c+')');const _0x326694=await getOAuthTokens(_0x3f12c7);if(_0x326694)console[_0x51c913(0x86)](_0x51c913(0xc7)),console[_0x51c913(0x86)]('Read\x20credential\x20from\x20keychain'+(_0x3f12c7?_0x51c913(0xdd)+_0x3f12c7+')':''));else{const _0xa5a5b7=await resolveAPIKeyAsync(_0x12607c,_0x3f12c7);if(_0xa5a5b7){const {source:_0x37030a,isDeprecated:_0x1b4a0f}=_0xa5a5b7,_0x156f2d=_0x51c913(0xbd)+_0x37030a;console[_0x51c913(0x86)](_0x1b4a0f?a7_0xb544ba['yellow'](_0x156f2d):_0x156f2d);}else console['log'](a7_0xb544ba['yellow'](_0x51c913(0xa0)));}try{const _0x5f38c9=await _0x135047[_0x51c913(0xc0)][_0x51c913(0x91)]();return console[_0x51c913(0x86)](a7_0xb544ba[_0x51c913(0x83)]('✓\x20Authentication\x20successful\x0a')),console[_0x51c913(0x86)](_0x51c913(0xbf)+_0x5f38c9[_0x51c913(0xda)]),(_0x5f38c9[_0x51c913(0xb3)]||_0x5f38c9[_0x51c913(0xc1)])&&console[_0x51c913(0x86)](_0x51c913(0x9f)+[_0x5f38c9[_0x51c913(0xb3)],_0x5f38c9[_0x51c913(0xc1)]][_0x51c913(0xd2)](Boolean)[_0x51c913(0xc4)]('\x20')),0x0;}catch(_0x1b72e2){return _0x1b72e2 instanceof HTTPClientError&&_0x1b72e2[_0x51c913(0xa4)]===0x191?printAuthError(_0x1b72e2,!![],_0x3f12c7):console[_0x51c913(0x90)](a7_0xb544ba[_0x51c913(0x9d)](_0x51c913(0xb7)+(_0x1b72e2 instanceof Error?_0x1b72e2[_0x51c913(0x7b)]:String(_0x1b72e2)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x184ffe(0xc5)]=a7_0x184ffe(0x82);['description']=a7_0x184ffe(0xa1);async[a7_0x184ffe(0x89)](_0x3fc635){const _0x522ea6=a7_0x184ffe,{options:_0x56ac89}=_0x3fc635,_0x17e7de=_0x56ac89['profile'];console[_0x522ea6(0x86)](a7_0xb544ba[_0x522ea6(0xcb)]('tdx:\x20auth\x20clear'));const _0x49cfd3=await isKeychainAvailable();if(!_0x49cfd3)return console['error'](a7_0xb544ba['red']('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x29b2bf,_0x5e2a37]=await Promise[_0x522ea6(0x87)]([deleteKeychainAPIKey(_0x17e7de),deleteOAuthTokens(_0x17e7de)]);if(_0x29b2bf||_0x5e2a37){clearCredentialCache();const _0x5a5dde=[_0x29b2bf&&_0x522ea6(0xb6),_0x5e2a37&&_0x522ea6(0x7e)][_0x522ea6(0xd2)](Boolean)[_0x522ea6(0xc4)](_0x522ea6(0xc2));return console[_0x522ea6(0x86)]('✓\x20'+_0x5a5dde+_0x522ea6(0x97)+(_0x17e7de?'\x20(profile:\x20'+_0x17e7de+')':'')),0x0;}else return console[_0x522ea6(0x86)](_0x522ea6(0xc9)+(_0x17e7de?_0x522ea6(0x84)+_0x17e7de:'')),0x1;}}
@@ -8,6 +8,7 @@
8
8
  * tdx cas list # List composable audiences
9
9
  * tdx cas desc <name> # Describe a composable audience
10
10
  * tdx cas pull <name> [--dir <dir>] # Pull audience + segments to YAML
11
+ * tdx cas validate <file_or_dir> # Validate composable audience YAML locally
11
12
  * tdx cas push <file_or_dir> # Push YAML files to API
12
13
  * tdx cas preview <segment_name> # Preview segment query on CDW
13
14
  */
@@ -44,6 +45,25 @@ export declare class CASPushCommand extends BaseCommand {
44
45
  readonly description = "Push YAML files to CAS API";
45
46
  execute(context: CommandContext): Promise<number>;
46
47
  }
48
+ /**
49
+ * Validate composable audience YAML files locally
50
+ *
51
+ * Scope mirrors `tdx ps validate` at the parent-segment/audience level, not `tdx sg validate`
52
+ * (child segment) — composable segment YAML files are classified but not deeply validated,
53
+ * since there's no schema for composable segment rules yet. Unlike `tdx ps validate`, this
54
+ * cannot run live queries against the customer's CDW (Snowflake/Databricks/BigQuery) — TD has
55
+ * no access path to those tables outside of an actual `tdx cas push`. It checks: YAML shape
56
+ * (Zod schema), semantic rules (duplicate names, catalog requirements, behavior columns), and
57
+ * — for connections that resolve to a registered connector — that the platform is supported.
58
+ * A `connection:` value is not required to resolve there: Snowflake typically references a
59
+ * federated query config (zero-copy config) and Databricks/BigQuery typically references an
60
+ * authentication, both separate resources from connectors with their own ID namespaces.
61
+ */
62
+ export declare class CASValidateCommand extends BaseCommand {
63
+ readonly name = "cas:validate";
64
+ readonly description = "Validate composable audience YAML files locally";
65
+ execute(context: CommandContext): Promise<number>;
66
+ }
47
67
  /**
48
68
  * Preview segment query on CDW
49
69
  */
@@ -1 +1 @@
1
- {"version":3,"file":"cas-command.d.ts","sourceRoot":"","sources":["../../src/commands/cas-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAehE;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,+BAA+B;IAE7C,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAmCxD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,oCAAoC;IAElD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAuDxD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,4CAA4C;IAE1D,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAuFxD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,gCAAgC;IAE9C,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CA8ExD;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,WAAW,6CAA6C;IAE3D,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CA0DxD"}
1
+ {"version":3,"file":"cas-command.d.ts","sourceRoot":"","sources":["../../src/commands/cas-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAqBhE;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,+BAA+B;IAE7C,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAmCxD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,oCAAoC;IAElD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAuDxD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,4CAA4C;IAE1D,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAuFxD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,gCAAgC;IAE9C,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAmNxD;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;IACjD,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,WAAW,qDAAqD;IAEnE,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CA2FxD;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,WAAW,6CAA6C;IAE3D,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CA0DxD"}