@treasuredata/tdx 2026.3.51 → 2026.3.53

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 (232) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.d.ts.map +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/server.js.map +1 -1
  76. package/dist/mcp/tools/index.d.ts +2 -0
  77. package/dist/mcp/tools/index.d.ts.map +1 -1
  78. package/dist/mcp/tools/index.js +1 -1
  79. package/dist/mcp/tools/index.js.map +1 -1
  80. package/dist/mcp/tools/tdx-run.js +1 -1
  81. package/dist/mcp/tools/tdx-search.js +1 -1
  82. package/dist/mcp/tools/work-create-item.d.ts +50 -0
  83. package/dist/mcp/tools/work-create-item.d.ts.map +1 -0
  84. package/dist/mcp/tools/work-create-item.js +1 -0
  85. package/dist/mcp/tools/work-create-item.js.map +1 -0
  86. package/dist/mcp/utils.js +1 -1
  87. package/dist/proxy/claude-usage-tracker.js +1 -1
  88. package/dist/proxy/passthrough-server.js +1 -1
  89. package/dist/proxy/sse-usage-parser.js +1 -1
  90. package/dist/sdk/agent/agent-config.js +1 -1
  91. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  92. package/dist/sdk/agent/agent-yaml.js +1 -1
  93. package/dist/sdk/agent/test/evaluator.js +1 -1
  94. package/dist/sdk/agent/test/executor.js +1 -1
  95. package/dist/sdk/agent/test/index.js +1 -1
  96. package/dist/sdk/agent/test/output.js +1 -1
  97. package/dist/sdk/agent/test/parser.js +1 -1
  98. package/dist/sdk/agent/tool-target-registry.js +1 -1
  99. package/dist/sdk/api.js +1 -1
  100. package/dist/sdk/cas/cas-api-client.js +1 -1
  101. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  102. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  103. package/dist/sdk/cas/index.js +1 -1
  104. package/dist/sdk/cas/pull-workflow.js +1 -1
  105. package/dist/sdk/cas/push-workflow.js +1 -1
  106. package/dist/sdk/client/cdp-api-client.js +1 -1
  107. package/dist/sdk/client/delivery-api-client.js +1 -1
  108. package/dist/sdk/client/endpoints.js +1 -1
  109. package/dist/sdk/client/engage-api-client.js +1 -1
  110. package/dist/sdk/client/http-client.js +1 -1
  111. package/dist/sdk/client/llm-api-client.js +1 -1
  112. package/dist/sdk/client/oauth-refresh.js +1 -1
  113. package/dist/sdk/client/rate-limiter.js +1 -1
  114. package/dist/sdk/client/td-api-client.js +1 -1
  115. package/dist/sdk/client/trino-api-client.js +1 -1
  116. package/dist/sdk/client/workflow-client.js +1 -1
  117. package/dist/sdk/connection-validator.js +1 -1
  118. package/dist/sdk/connection.js +1 -1
  119. package/dist/sdk/delivery.js +1 -1
  120. package/dist/sdk/engage/campaign-pull.js +1 -1
  121. package/dist/sdk/engage/campaign-push.js +1 -1
  122. package/dist/sdk/engage/campaign-validator.js +1 -1
  123. package/dist/sdk/engage/campaign-yaml.js +1 -1
  124. package/dist/sdk/engage/template-pull.js +1 -1
  125. package/dist/sdk/engage/template-push.js +1 -1
  126. package/dist/sdk/engage/template-validator.js +1 -1
  127. package/dist/sdk/engage/template-yaml.js +1 -1
  128. package/dist/sdk/engage/types/campaign-def.js +1 -1
  129. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  130. package/dist/sdk/engage/types/template-schema.js +1 -1
  131. package/dist/sdk/engage.js +1 -1
  132. package/dist/sdk/errors.js +1 -1
  133. package/dist/sdk/index.js +1 -1
  134. package/dist/sdk/io/index.js +1 -1
  135. package/dist/sdk/io/node-filesystem.js +1 -1
  136. package/dist/sdk/job.js +1 -1
  137. package/dist/sdk/journey.js +1 -1
  138. package/dist/sdk/llm/chat-cache.js +1 -1
  139. package/dist/sdk/llm/index.js +1 -1
  140. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  141. package/dist/sdk/llm/model-factors.js +1 -1
  142. package/dist/sdk/personalization.js +1 -1
  143. package/dist/sdk/policy.js +1 -1
  144. package/dist/sdk/query/index.js +1 -1
  145. package/dist/sdk/query/sql-parser.js +1 -1
  146. package/dist/sdk/realtime.js +1 -1
  147. package/dist/sdk/schedule.js +1 -1
  148. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  149. package/dist/sdk/segment/fields-display.js +1 -1
  150. package/dist/sdk/segment/file-discovery.js +1 -1
  151. package/dist/sdk/segment/journey-utils.js +1 -1
  152. package/dist/sdk/segment/journey-validator.js +1 -1
  153. package/dist/sdk/segment/journey-yaml.js +1 -1
  154. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  155. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  156. package/dist/sdk/segment/pull-workflow.js +1 -1
  157. package/dist/sdk/segment/push-recovery.js +1 -1
  158. package/dist/sdk/segment/push-workflow.js +1 -1
  159. package/dist/sdk/segment/resolution-context.js +1 -1
  160. package/dist/sdk/segment/segment-path-parser.js +1 -1
  161. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  162. package/dist/sdk/segment/segment-validator.js +1 -1
  163. package/dist/sdk/segment/target-resolution.js +1 -1
  164. package/dist/sdk/segment/tdx-config.js +1 -1
  165. package/dist/sdk/segment/types/activation-schema.js +1 -1
  166. package/dist/sdk/segment/types/journey-def.js +1 -1
  167. package/dist/sdk/segment/types/journey-schema.js +1 -1
  168. package/dist/sdk/segment/types/segment-def.js +1 -1
  169. package/dist/sdk/segment/types/segment-schema.js +1 -1
  170. package/dist/sdk/segment/validate-files.js +1 -1
  171. package/dist/sdk/segment/yaml-validator.js +1 -1
  172. package/dist/sdk/segment.js +1 -1
  173. package/dist/sdk/types/index.js +1 -1
  174. package/dist/sdk/types/progress.js +1 -1
  175. package/dist/sdk/types/workspace.d.ts +15 -0
  176. package/dist/sdk/types/workspace.d.ts.map +1 -1
  177. package/dist/sdk/types/workspace.js +1 -1
  178. package/dist/sdk/user.js +1 -1
  179. package/dist/sdk/util/format-detector.js +1 -1
  180. package/dist/sdk/util/formatters.js +1 -1
  181. package/dist/sdk/util/index.js +1 -1
  182. package/dist/sdk/util/paginate.js +1 -1
  183. package/dist/sdk/util/tree-formatter.js +1 -1
  184. package/dist/sdk/workflow/archive-validation.js +1 -1
  185. package/dist/sdk/workflow/clone-workflow.js +1 -1
  186. package/dist/sdk/workflow/index.js +1 -1
  187. package/dist/sdk/workflow/pull-workflow.js +1 -1
  188. package/dist/sdk/workflow/push-workflow.js +1 -1
  189. package/dist/sdk/workflow/tdx-config.js +1 -1
  190. package/dist/sdk/workflow/workflow-utils.js +1 -1
  191. package/dist/sdk/workspace/frontmatter.js +1 -1
  192. package/dist/sdk/workspace/git.js +1 -1
  193. package/dist/sdk/workspace/index.d.ts +14 -2
  194. package/dist/sdk/workspace/index.d.ts.map +1 -1
  195. package/dist/sdk/workspace/index.js +1 -1
  196. package/dist/sdk/workspace/index.js.map +1 -1
  197. package/dist/sdk/workspace/templates.js +1 -1
  198. package/dist/sdk/workspace/weekly.js +1 -1
  199. package/dist/sdk/workspace/wikilinks.js +1 -1
  200. package/dist/test-utils/command-runner.js +1 -1
  201. package/dist/test-utils/factories.js +1 -1
  202. package/dist/test-utils/fixtures.js +1 -1
  203. package/dist/test-utils/http-mock.js +1 -1
  204. package/dist/test-utils/index.js +1 -1
  205. package/dist/utils/async.js +1 -1
  206. package/dist/utils/colors.js +1 -1
  207. package/dist/utils/diff.js +1 -1
  208. package/dist/utils/file-permissions.js +1 -1
  209. package/dist/utils/file-reader.js +1 -1
  210. package/dist/utils/github-releases.js +1 -1
  211. package/dist/utils/global-cache.js +1 -1
  212. package/dist/utils/json-loader.js +1 -1
  213. package/dist/utils/local-cache.js +1 -1
  214. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  215. package/dist/utils/logger/formatters/index.js +1 -1
  216. package/dist/utils/logger/handlers/console-handler.js +1 -1
  217. package/dist/utils/logger/handlers/file-handler.js +1 -1
  218. package/dist/utils/logger/handlers/index.js +1 -1
  219. package/dist/utils/logger/handlers/null-handler.js +1 -1
  220. package/dist/utils/logger/index.js +1 -1
  221. package/dist/utils/logger/logger.js +1 -1
  222. package/dist/utils/logger/types.js +1 -1
  223. package/dist/utils/option-validation.js +1 -1
  224. package/dist/utils/process.js +1 -1
  225. package/dist/utils/prompt.js +1 -1
  226. package/dist/utils/spinner.js +1 -1
  227. package/dist/utils/sse-parser.js +1 -1
  228. package/dist/utils/string-utils.js +1 -1
  229. package/dist/utils/table-ref-parser.js +1 -1
  230. package/dist/utils/tdx-logger.js +1 -1
  231. package/dist/utils/version-check.js +1 -1
  232. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x341469=a3_0x17bd;(function(_0x575494,_0xe7b82d){const _0x1cc451=a3_0x17bd,_0x41b1db=_0x575494();while(!![]){try{const _0x3148cc=parseInt(_0x1cc451(0x19b))/0x1+parseInt(_0x1cc451(0x190))/0x2*(-parseInt(_0x1cc451(0x1ab))/0x3)+parseInt(_0x1cc451(0x1a3))/0x4*(-parseInt(_0x1cc451(0x1a2))/0x5)+-parseInt(_0x1cc451(0x1a4))/0x6+-parseInt(_0x1cc451(0x1a1))/0x7*(parseInt(_0x1cc451(0x1a0))/0x8)+parseInt(_0x1cc451(0x192))/0x9+parseInt(_0x1cc451(0x19f))/0xa;if(_0x3148cc===_0xe7b82d)break;else _0x41b1db['push'](_0x41b1db['shift']());}catch(_0x185af2){_0x41b1db['push'](_0x41b1db['shift']());}}}(a3_0x5003,0xb559f));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a3_0x17bd(_0xf8cf1a,_0x55d6c1){_0xf8cf1a=_0xf8cf1a-0x188;const _0x5003b3=a3_0x5003();let _0x17bd4f=_0x5003b3[_0xf8cf1a];return _0x17bd4f;}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0x5003(){const _0xb53642=['1910zUUKAw','Listing\x20activations\x20for\x20segment\x20\x27','4437774qktyLc','\x20\x20Cause:\x20','Child\x20name:\x20','Resolving\x20child\x20segment\x20\x27','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','✔\x20Found\x20','Error:\x20','segment','\x27...','1197143HCyfzn','activations','listActivations','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','24827890hRIIAG','14648TjvDBn','3626HhfUJO','41215kikZKc','148OOvzUr','5067174EqQpDn','List\x20activations\x20for\x20a\x20segment','cause','verbose','length','data','Error:\x20Segment\x20name\x20is\x20required','4185eMCKyA','description','error','name','execute','message','site','Resolving\x20parent\x20segment\x20\x27','\x20activation','resolveSegmentId','Resolved\x20child\x20ID:\x20'];a3_0x5003=function(){return _0xb53642;};return a3_0x5003();}export class ActivationsCommand extends BaseCommand{[a3_0x341469(0x188)]=a3_0x341469(0x19c);[a3_0x341469(0x1ac)]=a3_0x341469(0x1a5);async[a3_0x341469(0x189)](_0x39bb40){const _0x1b7b41=a3_0x341469,{options:_0x203f7a,args:_0x34fcd5,tdx:_0x1d862e}=_0x39bb40;if(_0x34fcd5['length']===0x0)return console[_0x1b7b41(0x1ad)](_0x1b7b41(0x1aa)),console[_0x1b7b41(0x1ad)](_0x1b7b41(0x19e)),0x1;try{const {parentId:_0x1d1de0,childId:_0x4977f2}=parseSegmentRef(_0x34fcd5[0x0]);if(!_0x4977f2)return console[_0x1b7b41(0x1ad)](_0x1b7b41(0x196)),console[_0x1b7b41(0x1ad)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x203f7a[_0x1b7b41(0x1a7)]&&(console[_0x1b7b41(0x1ad)]('Site:\x20'+_0x203f7a[_0x1b7b41(0x18b)]),console['error']('Parent\x20name:\x20'+_0x1d1de0),console['error'](_0x1b7b41(0x194)+_0x4977f2));const _0xe5c045=await withSpinner(_0x1b7b41(0x18c)+_0x1d1de0+_0x1b7b41(0x19a),()=>_0x1d862e['segment']['resolveParentId'](_0x1d1de0),{'verbose':_0x203f7a[_0x1b7b41(0x1a7)]}),_0x467d23=_0xe5c045[_0x1b7b41(0x1a9)];_0x203f7a['verbose']&&console[_0x1b7b41(0x1ad)]('Resolved\x20parent\x20ID:\x20'+_0x467d23);const _0x2b1a64=await withSpinner(_0x1b7b41(0x195)+_0x4977f2+_0x1b7b41(0x19a),()=>_0x1d862e[_0x1b7b41(0x199)][_0x1b7b41(0x18e)](_0x467d23,_0x4977f2),{'verbose':_0x203f7a[_0x1b7b41(0x1a7)]}),_0x27eb5c=_0x2b1a64[_0x1b7b41(0x1a9)];_0x203f7a['verbose']&&console[_0x1b7b41(0x1ad)](_0x1b7b41(0x18f)+_0x27eb5c);const _0x4f5bfe=await withSpinner(_0x1b7b41(0x191)+_0x4977f2+'\x27...',()=>_0x1d862e[_0x1b7b41(0x199)][_0x1b7b41(0x19d)](_0x467d23,_0x27eb5c),{'verbose':_0x203f7a[_0x1b7b41(0x1a7)]}),_0x2a86a2=_0x4f5bfe[_0x1b7b41(0x1a9)];return console[_0x1b7b41(0x1ad)](_0x1b7b41(0x197)+_0x2a86a2['length']+_0x1b7b41(0x18d)+(_0x2a86a2[_0x1b7b41(0x1a8)]!==0x1?'s':'')),await handleSDKOutput(_0x2a86a2,_0x203f7a),0x0;}catch(_0x1fea54){if(_0x1fea54 instanceof SDKError)return console['error'](_0x1b7b41(0x198)+_0x1fea54[_0x1b7b41(0x18a)]),_0x1fea54[_0x1b7b41(0x1a6)]&&console[_0x1b7b41(0x1ad)](_0x1b7b41(0x193)+_0x1fea54[_0x1b7b41(0x1a6)]),0x1;throw _0x1fea54;}}}
1
+ const a3_0x40b079=a3_0x9d2a;function a3_0x9d2a(_0x518c7e,_0x196956){_0x518c7e=_0x518c7e-0x197;const _0x192340=a3_0x1923();let _0x9d2a94=_0x192340[_0x518c7e];return _0x9d2a94;}(function(_0x144d58,_0x1904d3){const _0x281dec=a3_0x9d2a,_0x52dbac=_0x144d58();while(!![]){try{const _0xc55670=parseInt(_0x281dec(0x1b8))/0x1+parseInt(_0x281dec(0x1ac))/0x2+-parseInt(_0x281dec(0x1b3))/0x3+parseInt(_0x281dec(0x1a5))/0x4+parseInt(_0x281dec(0x1af))/0x5*(-parseInt(_0x281dec(0x19d))/0x6)+-parseInt(_0x281dec(0x1a6))/0x7*(parseInt(_0x281dec(0x1a0))/0x8)+parseInt(_0x281dec(0x19c))/0x9*(parseInt(_0x281dec(0x1ab))/0xa);if(_0xc55670===_0x1904d3)break;else _0x52dbac['push'](_0x52dbac['shift']());}catch(_0x46d989){_0x52dbac['push'](_0x52dbac['shift']());}}}(a3_0x1923,0xaeffe));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0x1923(){const _0x27c2a2=['1349284ynvIyy','Resolving\x20child\x20segment\x20\x27','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','15JDgSsO','\x27...','site','Error:\x20Segment\x20name\x20is\x20required','2388708Imhime','resolveSegmentId','segment','resolveParentId','\x20\x20Cause:\x20','1068312pQcaUa','listActivations','activations','data','Site:\x20','cause','\x20activation','Resolved\x20parent\x20ID:\x20','2529HkVkew','105636ViXOge','verbose','message','232Ohvcqw','length','Error:\x20','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Resolving\x20parent\x20segment\x20\x27','3992716mOrxyB','283892HkGKQo','Parent\x20name:\x20','description','name','error','30KuOzaF'];a3_0x1923=function(){return _0x27c2a2;};return a3_0x1923();}export class ActivationsCommand extends BaseCommand{[a3_0x40b079(0x1a9)]=a3_0x40b079(0x1ba);[a3_0x40b079(0x1a8)]='List\x20activations\x20for\x20a\x20segment';async['execute'](_0x5e5475){const _0x368a00=a3_0x40b079,{options:_0x94c632,args:_0x1582e7,tdx:_0x1d5db8}=_0x5e5475;if(_0x1582e7['length']===0x0)return console[_0x368a00(0x1aa)](_0x368a00(0x1b2)),console[_0x368a00(0x1aa)](_0x368a00(0x1a3)),0x1;try{const {parentId:_0x60ff24,childId:_0x19b265}=parseSegmentRef(_0x1582e7[0x0]);if(!_0x19b265)return console['error'](_0x368a00(0x1ae)),console[_0x368a00(0x1aa)](_0x368a00(0x1a3)),0x1;_0x94c632[_0x368a00(0x19e)]&&(console[_0x368a00(0x1aa)](_0x368a00(0x198)+_0x94c632[_0x368a00(0x1b1)]),console[_0x368a00(0x1aa)](_0x368a00(0x1a7)+_0x60ff24),console[_0x368a00(0x1aa)]('Child\x20name:\x20'+_0x19b265));const _0xa6d8f8=await withSpinner(_0x368a00(0x1a4)+_0x60ff24+_0x368a00(0x1b0),()=>_0x1d5db8[_0x368a00(0x1b5)][_0x368a00(0x1b6)](_0x60ff24),{'verbose':_0x94c632[_0x368a00(0x19e)]}),_0x1014a0=_0xa6d8f8[_0x368a00(0x197)];_0x94c632[_0x368a00(0x19e)]&&console[_0x368a00(0x1aa)](_0x368a00(0x19b)+_0x1014a0);const _0x2f678e=await withSpinner(_0x368a00(0x1ad)+_0x19b265+'\x27...',()=>_0x1d5db8['segment'][_0x368a00(0x1b4)](_0x1014a0,_0x19b265),{'verbose':_0x94c632['verbose']}),_0x3a3fbf=_0x2f678e[_0x368a00(0x197)];_0x94c632[_0x368a00(0x19e)]&&console['error']('Resolved\x20child\x20ID:\x20'+_0x3a3fbf);const _0x17ee5e=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x19b265+_0x368a00(0x1b0),()=>_0x1d5db8[_0x368a00(0x1b5)][_0x368a00(0x1b9)](_0x1014a0,_0x3a3fbf),{'verbose':_0x94c632[_0x368a00(0x19e)]}),_0x668497=_0x17ee5e[_0x368a00(0x197)];return console[_0x368a00(0x1aa)]('✔\x20Found\x20'+_0x668497[_0x368a00(0x1a1)]+_0x368a00(0x19a)+(_0x668497[_0x368a00(0x1a1)]!==0x1?'s':'')),await handleSDKOutput(_0x668497,_0x94c632),0x0;}catch(_0x4a6146){if(_0x4a6146 instanceof SDKError)return console[_0x368a00(0x1aa)](_0x368a00(0x1a2)+_0x4a6146[_0x368a00(0x19f)]),_0x4a6146[_0x368a00(0x199)]&&console['error'](_0x368a00(0x1b7)+_0x4a6146['cause']),0x1;throw _0x4a6146;}}}
@@ -1 +1 @@
1
- const a4_0x2cf123=a4_0x3781;(function(_0x4a9e55,_0x1bcae8){const _0x484717=a4_0x3781,_0x24b7b3=_0x4a9e55();while(!![]){try{const _0x3a816f=-parseInt(_0x484717(0x1f8))/0x1*(-parseInt(_0x484717(0x1a1))/0x2)+-parseInt(_0x484717(0x1fc))/0x3*(parseInt(_0x484717(0x18c))/0x4)+parseInt(_0x484717(0x175))/0x5*(-parseInt(_0x484717(0x15f))/0x6)+-parseInt(_0x484717(0x18f))/0x7*(-parseInt(_0x484717(0x188))/0x8)+parseInt(_0x484717(0x1fa))/0x9*(parseInt(_0x484717(0x1c9))/0xa)+-parseInt(_0x484717(0x186))/0xb*(parseInt(_0x484717(0x1ce))/0xc)+parseInt(_0x484717(0x187))/0xd;if(_0x3a816f===_0x1bcae8)break;else _0x24b7b3['push'](_0x24b7b3['shift']());}catch(_0x4408c4){_0x24b7b3['push'](_0x24b7b3['shift']());}}}(a4_0x1bdd,0xacf3e));import a4_0x49142b from'chalk';import a4_0x25d706 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(_0x198df7){const _0x171141=a4_0x3781,_0x4ffc71=[];if(_0x198df7[_0x171141(0x173)]!==undefined)_0x4ffc71['push'](_0x198df7[_0x171141(0x173)]+_0x171141(0x1bc));if(_0x198df7[_0x171141(0x189)]!==undefined&&_0x198df7[_0x171141(0x189)]>0x0)_0x4ffc71[_0x171141(0x1e2)](a4_0x49142b['green'](_0x198df7[_0x171141(0x189)]+_0x171141(0x1e8)));if(_0x198df7[_0x171141(0x1e5)]!==undefined&&_0x198df7['created']>0x0)_0x4ffc71[_0x171141(0x1e2)](a4_0x49142b[_0x171141(0x17b)](_0x198df7[_0x171141(0x1e5)]+_0x171141(0x1d3)));if(_0x198df7[_0x171141(0x1f2)]!==undefined&&_0x198df7[_0x171141(0x1f2)]>0x0)_0x4ffc71[_0x171141(0x1e2)](a4_0x49142b['yellow'](_0x198df7['updated']+_0x171141(0x1ee)));if(_0x198df7['unchanged']!==undefined&&_0x198df7['unchanged']>0x0)_0x4ffc71[_0x171141(0x1e2)](a4_0x49142b[_0x171141(0x1d1)](_0x198df7[_0x171141(0x20e)]+_0x171141(0x18b)));if(_0x198df7[_0x171141(0x161)]!==undefined&&_0x198df7['errors']>0x0)_0x4ffc71['push'](a4_0x49142b[_0x171141(0x1a0)](_0x198df7[_0x171141(0x161)]+'\x20errors'));return _0x4ffc71[_0x171141(0x1d8)](',\x20');}function displayDiffs(_0x5f0674,_0xbce532,_0xb3616f,_0x5d3712,_0x5dbf31,_0x273e37,_0x46a78d){const _0x4d1c10=a4_0x3781;for(const _0x344c09 of _0x5f0674){if(_0x344c09[_0x4d1c10(0x1a6)]){const _0x4cc422=_0x344c09[_0x4d1c10(0x166)]||_0x344c09[_0x4d1c10(0x16c)];console[_0x4d1c10(0x178)](_0x4d1c10(0x212)+_0x4cc422+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x4d1c10(0x178)](_0x344c09[_0x4d1c10(0x1a6)]),console[_0x4d1c10(0x178)]('─'[_0x4d1c10(0x199)](0x3c));}}for(const _0x1f1c61 of _0xbce532){_0x1f1c61[_0x4d1c10(0x1a6)]&&(console[_0x4d1c10(0x178)](_0x4d1c10(0x182)+_0x1f1c61[_0x4d1c10(0x16c)]+'\x27:'),console[_0x4d1c10(0x178)]('─'['repeat'](0x3c)),console[_0x4d1c10(0x178)](_0x1f1c61[_0x4d1c10(0x1a6)]),console[_0x4d1c10(0x178)]('─'['repeat'](0x3c)));}for(const _0x17f229 of _0xb3616f){_0x17f229['diff']&&(console[_0x4d1c10(0x178)](_0x4d1c10(0x1bd)+_0x17f229[_0x4d1c10(0x16c)]+'\x27:'),console[_0x4d1c10(0x178)]('─'[_0x4d1c10(0x199)](0x3c)),console['log'](_0x17f229[_0x4d1c10(0x1a6)]),console[_0x4d1c10(0x178)]('─'[_0x4d1c10(0x199)](0x3c)));}for(const _0x15b541 of _0x5d3712){_0x15b541[_0x4d1c10(0x1a6)]&&(console['log']('\x0aChanges\x20to\x20prompt\x20\x27'+_0x15b541[_0x4d1c10(0x16c)]+'\x27:'),console[_0x4d1c10(0x178)]('─'[_0x4d1c10(0x199)](0x3c)),console[_0x4d1c10(0x178)](_0x15b541[_0x4d1c10(0x1a6)]),console[_0x4d1c10(0x178)]('─'[_0x4d1c10(0x199)](0x3c)));}for(const _0x327382 of _0x5dbf31){_0x327382['diff']&&(console[_0x4d1c10(0x178)](_0x4d1c10(0x16f)+_0x327382[_0x4d1c10(0x16c)]+'\x27:'),console['log']('─'[_0x4d1c10(0x199)](0x3c)),console[_0x4d1c10(0x178)](_0x327382[_0x4d1c10(0x1a6)]),console[_0x4d1c10(0x178)]('─'[_0x4d1c10(0x199)](0x3c)));}for(const _0x14d0c of _0x273e37){_0x14d0c[_0x4d1c10(0x1a6)]&&(console['log']('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x14d0c[_0x4d1c10(0x16c)]+'\x27:'),console['log']('─'[_0x4d1c10(0x199)](0x3c)),console['log'](_0x14d0c[_0x4d1c10(0x1a6)]),console['log']('─'[_0x4d1c10(0x199)](0x3c)));}for(const _0x36d7f5 of _0x46a78d){_0x36d7f5['diff']&&(console[_0x4d1c10(0x178)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x36d7f5[_0x4d1c10(0x16c)]+'\x27:'),console['log']('─'[_0x4d1c10(0x199)](0x3c)),console[_0x4d1c10(0x178)](_0x36d7f5[_0x4d1c10(0x1a6)]),console[_0x4d1c10(0x178)]('─'[_0x4d1c10(0x199)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x2cf123(0x20a);['description']=a4_0x2cf123(0x216);async['execute'](_0xc9d371){const _0x184c2a=a4_0x2cf123,{options:_0x18e63b,args:_0x3616ae,tdx:_0x5a0be2}=_0xc9d371,_0x5d2d19=_0x3616ae[0x0],_0x230609=_0x3616ae[0x1],_0x568530=_0x18e63b[_0x184c2a(0x1ad)],_0x1acead=_0x18e63b[_0x184c2a(0x1c7)],_0xdae34c=_0x18e63b[_0x184c2a(0x1c4)],_0x982aa3=_0x18e63b[_0x184c2a(0x1ae)],_0x53f050=_0x18e63b[_0x184c2a(0x1ac)],_0x45a03c=_0x18e63b['agent'];let _0x16913;if(_0x5d2d19){const _0x40acae=a4_0x25d706['join'](_0x5d2d19,'tdx.json');if(existsSync(_0x40acae))try{const _0x1f1f97=JSON[_0x184c2a(0x19a)](readFileSync(_0x40acae,_0x184c2a(0x17f)));_0x1f1f97[_0x184c2a(0x1b4)]&&(_0x16913={'llm_project':_0x1f1f97[_0x184c2a(0x1b4)]});}catch{}}const _0x2ca36c=findAgentConfigPath(process[_0x184c2a(0x196)]());let _0x29bb3d;if(_0x2ca36c)try{const _0x379d4c=JSON[_0x184c2a(0x19a)](readFileSync(_0x2ca36c,_0x184c2a(0x17f)));_0x379d4c['llm_project']&&(_0x29bb3d={'llm_project':_0x379d4c['llm_project']});}catch{}const _0xc9c546=resolveAgentPullArgs({'arg':_0x5d2d19,'agentNameArg':_0x230609,'agentFlag':_0x45a03c,'contextProject':_0x53f050,'argDirConfig':_0x16913,'cwdConfigPath':_0x2ca36c||undefined,'cwdConfig':_0x29bb3d}),{projectNameOrId:_0x1599d1,targetAgentName:_0x3ee344,existingOutputDir:_0x4d1eb6,source:_0x46e0b6}=_0xc9c546;if(_0x46e0b6===_0x184c2a(0x209))console[_0x184c2a(0x178)](a4_0x49142b[_0x184c2a(0x195)](_0x184c2a(0x1ea)+a4_0x25d706[_0x184c2a(0x1d8)](_0x5d2d19,'tdx.json')+':\x20'+_0x1599d1));else{if(_0x46e0b6===_0x184c2a(0x205))console[_0x184c2a(0x178)](a4_0x49142b[_0x184c2a(0x195)](_0x184c2a(0x201)+_0x1599d1));else _0x46e0b6===_0x184c2a(0x1e6)&&console[_0x184c2a(0x178)](a4_0x49142b['dim'](_0x184c2a(0x19e)+_0x1599d1));}if(!_0x1599d1)return _0x45a03c?(console[_0x184c2a(0x178)](a4_0x49142b[_0x184c2a(0x206)](_0x184c2a(0x1c3))),console[_0x184c2a(0x178)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0x184c2a(0x178)](_0x184c2a(0x1ec))):(console[_0x184c2a(0x178)](a4_0x49142b[_0x184c2a(0x206)](_0x184c2a(0x1af))),console[_0x184c2a(0x178)](_0x184c2a(0x1be)),console['log'](_0x184c2a(0x181)),console[_0x184c2a(0x178)]('\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[_0x184c2a(0x178)](_0x184c2a(0x18a)),console['log'](_0x184c2a(0x1e3))),0x1;if(_0x3ee344){const {data:_0x311ced}=await withSpinner('Pulling\x20agent\x20\x22'+_0x3ee344+_0x184c2a(0x1e4)+_0x1599d1+_0x184c2a(0x1d9),()=>_0x5a0be2[_0x184c2a(0x1a3)][_0x184c2a(0x20d)](_0x1599d1,_0x3ee344,_0x568530,{'dryRun':_0x1acead,'force':_0xdae34c}));if(_0x1acead)return console[_0x184c2a(0x178)](a4_0x49142b[_0x184c2a(0x206)](_0x184c2a(0x16a))),console[_0x184c2a(0x178)](_0x184c2a(0x180)+_0x311ced[_0x184c2a(0x166)]),console[_0x184c2a(0x178)](_0x184c2a(0x176)+_0x311ced[_0x184c2a(0x185)]),_0x311ced[_0x184c2a(0x1a6)]&&(console['log'](_0x184c2a(0x208)),console[_0x184c2a(0x178)]('─'['repeat'](0x3c)),console[_0x184c2a(0x178)](_0x311ced[_0x184c2a(0x1a6)]),console[_0x184c2a(0x178)]('─'[_0x184c2a(0x199)](0x3c))),0x0;return console['log'](a4_0x49142b[_0x184c2a(0x17b)](_0x184c2a(0x1f1))),console[_0x184c2a(0x178)]('Agent:\x20'+_0x311ced[_0x184c2a(0x166)]),console['log'](_0x184c2a(0x1f3)+_0x311ced[_0x184c2a(0x185)]),console[_0x184c2a(0x178)]('Status:\x20'+(_0x311ced['isNew']?a4_0x49142b[_0x184c2a(0x17b)]('new'):_0x311ced[_0x184c2a(0x17c)]?a4_0x49142b[_0x184c2a(0x206)]('updated'):a4_0x49142b[_0x184c2a(0x1d1)](_0x184c2a(0x20e)))),0x0;}const _0x3bca2e=_0x4d1eb6||_0x568530,{data:_0xfbbab9}=await withSpinner(_0x184c2a(0x1e9)+_0x1599d1+_0x184c2a(0x1d9),()=>_0x5a0be2[_0x184c2a(0x1a3)][_0x184c2a(0x17e)](_0x1599d1,_0x3bca2e,{'dryRun':!![]})),_0x337300=_0xfbbab9[_0x184c2a(0x1c5)][_0x184c2a(0x1d7)][_0x184c2a(0x189)]+_0xfbbab9[_0x184c2a(0x1c5)][_0x184c2a(0x1d4)][_0x184c2a(0x189)]+_0xfbbab9['counts'][_0x184c2a(0x18d)][_0x184c2a(0x189)]+_0xfbbab9[_0x184c2a(0x1c5)][_0x184c2a(0x1f6)]['new']+_0xfbbab9[_0x184c2a(0x1c5)]['integrations'][_0x184c2a(0x189)]+_0xfbbab9[_0x184c2a(0x1c5)][_0x184c2a(0x211)]['new']+_0xfbbab9[_0x184c2a(0x1c5)][_0x184c2a(0x16d)]['new'],_0x29d477=_0xfbbab9[_0x184c2a(0x1c5)][_0x184c2a(0x1d7)][_0x184c2a(0x1f2)]+_0xfbbab9['counts'][_0x184c2a(0x1d4)][_0x184c2a(0x1f2)]+_0xfbbab9[_0x184c2a(0x1c5)][_0x184c2a(0x18d)][_0x184c2a(0x1f2)]+_0xfbbab9['counts'][_0x184c2a(0x1f6)][_0x184c2a(0x1f2)]+_0xfbbab9['counts'][_0x184c2a(0x1a7)]['updated']+_0xfbbab9['counts'][_0x184c2a(0x211)]['updated']+_0xfbbab9[_0x184c2a(0x1c5)][_0x184c2a(0x16d)]['updated'],_0x2cadcb=_0xfbbab9[_0x184c2a(0x1c5)][_0x184c2a(0x1d7)]['unchanged']+_0xfbbab9[_0x184c2a(0x1c5)][_0x184c2a(0x1d4)][_0x184c2a(0x20e)]+_0xfbbab9['counts']['textKnowledgeBases']['unchanged']+_0xfbbab9[_0x184c2a(0x1c5)][_0x184c2a(0x1f6)][_0x184c2a(0x20e)]+_0xfbbab9['counts']['integrations'][_0x184c2a(0x20e)]+_0xfbbab9[_0x184c2a(0x1c5)]['experimentalKnowledgeBases'][_0x184c2a(0x20e)]+_0xfbbab9[_0x184c2a(0x1c5)][_0x184c2a(0x16d)][_0x184c2a(0x20e)];console[_0x184c2a(0x178)](_0x184c2a(0x1bb)+_0xfbbab9[_0x184c2a(0x19c)]+'\x27:'),console[_0x184c2a(0x178)]('\x20\x20'+a4_0x49142b[_0x184c2a(0x17b)]('+\x20'+_0x337300+_0x184c2a(0x1e8))+_0x184c2a(0x19f)+a4_0x49142b[_0x184c2a(0x206)]('~\x20'+_0x29d477+_0x184c2a(0x1c0))+'\x20|\x20'+a4_0x49142b['dim']('=\x20'+_0x2cadcb+_0x184c2a(0x18b))),console[_0x184c2a(0x178)]('\x20\x20Agents:\x20'+formatCountSummary(_0xfbbab9[_0x184c2a(0x1c5)][_0x184c2a(0x1d7)])),console[_0x184c2a(0x178)](_0x184c2a(0x218)+formatCountSummary(_0xfbbab9['counts'][_0x184c2a(0x1d4)])),console[_0x184c2a(0x178)](_0x184c2a(0x1c1)+formatCountSummary(_0xfbbab9[_0x184c2a(0x1c5)][_0x184c2a(0x18d)])),console[_0x184c2a(0x178)]('\x20\x20Prompts:\x20'+formatCountSummary(_0xfbbab9[_0x184c2a(0x1c5)][_0x184c2a(0x1f6)])),console[_0x184c2a(0x178)](_0x184c2a(0x168)+formatCountSummary(_0xfbbab9[_0x184c2a(0x1c5)][_0x184c2a(0x1a7)]));const _0x3da218=_0xfbbab9['counts']['experimentalKnowledgeBases']['total']>0x0||_0xfbbab9['counts']['experimentalArtifacts'][_0x184c2a(0x173)]>0x0;_0x3da218&&(console['log'](_0x184c2a(0x179)+formatCountSummary(_0xfbbab9['counts'][_0x184c2a(0x211)])),console[_0x184c2a(0x178)](_0x184c2a(0x1ff)+formatCountSummary(_0xfbbab9[_0x184c2a(0x1c5)][_0x184c2a(0x16d)])));console['log'](_0x184c2a(0x1cc)+a4_0x49142b[_0x184c2a(0x1b1)](_0xfbbab9[_0x184c2a(0x190)])),displayDiffs(_0xfbbab9[_0x184c2a(0x1d7)],_0xfbbab9['knowledgeBases'],_0xfbbab9[_0x184c2a(0x18d)],_0xfbbab9[_0x184c2a(0x1f6)],_0xfbbab9[_0x184c2a(0x1a7)],_0xfbbab9[_0x184c2a(0x211)],_0xfbbab9[_0x184c2a(0x16d)]);if(_0x1acead)return console[_0x184c2a(0x178)](a4_0x49142b['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x337300===0x0&&_0x29d477===0x0)return console['log'](a4_0x49142b[_0x184c2a(0x17b)](_0x184c2a(0x1b8))),saveSessionContext({'llm_project':_0xfbbab9[_0x184c2a(0x19c)]},_0x18e63b[_0x184c2a(0x1da)]),console[_0x184c2a(0x178)](a4_0x49142b[_0x184c2a(0x17b)](_0x184c2a(0x207)+a4_0x49142b[_0x184c2a(0x195)](_0x184c2a(0x1b4))+_0x184c2a(0x194)+a4_0x49142b[_0x184c2a(0x1b1)](_0xfbbab9['projectName']))),0x0;if(!_0x982aa3&&!_0xdae34c){if(!isInteractive())return console['error'](a4_0x49142b[_0x184c2a(0x1a0)](_0x184c2a(0x160)),_0x184c2a(0x1b9)),console['error'](a4_0x49142b[_0x184c2a(0x195)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x23713c=await confirmKey(_0x184c2a(0x198)+(_0x337300+_0x29d477)+_0x184c2a(0x1f7));if(!_0x23713c)return console[_0x184c2a(0x178)](a4_0x49142b[_0x184c2a(0x206)]('Cancelled'),_0x184c2a(0x16b)),0x1;}const {data:_0x1a8a92}=await withSpinner(_0x184c2a(0x219),()=>_0x5a0be2[_0x184c2a(0x1a3)]['pullProject'](_0x1599d1,_0x3bca2e,{'force':_0xdae34c}));return console['log'](a4_0x49142b['green'](_0x184c2a(0x15e)+(_0x337300+_0x29d477)+_0x184c2a(0x1dc)+_0x1a8a92[_0x184c2a(0x190)])),saveSessionContext({'llm_project':_0x1a8a92['projectName']},_0x18e63b[_0x184c2a(0x1da)]),console[_0x184c2a(0x178)](a4_0x49142b[_0x184c2a(0x17b)](_0x184c2a(0x207)+a4_0x49142b['dim'](_0x184c2a(0x1b4))+_0x184c2a(0x194)+a4_0x49142b[_0x184c2a(0x1b1)](_0x1a8a92[_0x184c2a(0x19c)]))),0x0;}}function a4_0x3781(_0x1677d4,_0x363e6f){_0x1677d4=_0x1677d4-0x15b;const _0x1bddcf=a4_0x1bdd();let _0x3781a2=_0x1bddcf[_0x1677d4];return _0x3781a2;}function a4_0x1bdd(){const _0x10a301=['✔\x20Context\x20set:\x20','\x0aChanges:','arg-dir','agent:pull','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x22\x20to\x20new\x20project\x20\x22','pullAgent','unchanged','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x0aPush\x20','experimentalKnowledgeBases','\x0aChanges\x20to\x20agent\x20\x27','Agent:\x20','execute','reason','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20\x20Knowledge\x20Bases:\x20','Writing\x20files...','<new-name>','\x20\x20Integration\x20\x22','New\x20project:\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x0a✔\x20Pulled\x20','143328IBQTLA','\x0aError:','errors','New\x20project\x20name\x20is\x20required','\x20\x20Prompts:\x20','\x20\x20Experimental\x20Artifact\x20\x22','no_context','agentName','\x20\x20Agents:\x20','\x20\x20Integrations:\x20','description','Dry\x20run\x20-\x20no\x20files\x20written','-\x20no\x20files\x20written','name','experimentalArtifacts','New\x20project\x20ID:\x20','\x0aChanges\x20to\x20integration\x20\x27','\x20\x20tdx\x20agent\x20clone\x20agents/','action','agentId','total','Pushing\x20to\x20project...','270Ykpuvz','Output\x20path:\x20','Cancelled','log','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Summary:','green','hasChanges','sourceProjectName','pullProject','utf-8','Would\x20pull\x20agent:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Failed\x20to\x20push\x20agent:\x20','agent:push','outputPath','1583186joRjVF','10223239KmXQnI','5864GloVus','new','\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','\x20unchanged','4JTncRI','textKnowledgeBases','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','11823EYtYou','outputDir','\x20\x20Agent\x20\x22','site','\x20--profile\x20','\x20=\x20','dim','cwd','Using\x20local\x20project:\x20','\x0aWrite\x20','repeat','parse','projectDir','projectName','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Using\x20project\x20from\x20context:\x20','\x20|\x20','red','282OjyEyY','\x27\x20to\x20create\x20the\x20folder\x20structure.','llm','pushProject','Project:\x20','diff','integrations','Project\x20cloned\x20successfully','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','tdx.json','Errors:','llmProject','output','yes','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','message','cyan','Dry\x20run\x20-\x20no\x20changes\x20made','Would\x20push\x20agent:\x20','llm_project','projectId','\x20\x20Prompt\x20\x22','INVALID_ARGUMENT','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Using\x20context\x20project:\x20','\x0aPull\x20summary\x20for\x20\x27','\x20total','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','\x20--name\x20','\x20changed','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','force','counts','Analyzing\x20changes\x20to\x20push...','dryRun','\x22\x20to\x20a\x20different\x20profile','429930ePthrO','\x20\x20Knowledge\x20Base\x20\x22','\x0aErrors\x20found:','\x20\x20Target:\x20','No\x20tdx.json\x20found\x20in\x20','24zkSLTO','cloneProject','no_local_folder','gray','dirname','\x20created','knowledgeBases','\x0aPush\x20summary\x20for\x20\x27','-\x20nothing\x20pushed','agents','join','\x22...','session','agent.yml','\x20files\x20to\x20','MISSING_ARGUMENT','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','newProjectId','\x0a✔\x20Pushed\x20','push','\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','\x22\x20from\x20project\x20\x22','created','context','\x22\x20to\x20\x22','\x20new','Analyzing\x20project\x20\x22','Using\x20project\x20from\x20','\x20resources?','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','Pushing\x20agent\x20from\x20\x22','\x20updated','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','newProjectName','Agent\x20pulled\x20successfully','updated','Output:\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x0aProject\x20pushed\x20with\x20errors','prompts','\x20files?','490puLRRK','error','63JHiyiR','Source:\x20','324789CoJCKs','\x20\x20tdx\x20agent\x20pull\x20','Using\x20current\x20project:\x20','\x20\x20Experimental\x20Artifacts:\x20','Project\x20cloned\x20with\x20errors','Using\x20project:\x20','Would\x20clone:','Cloning\x20\x22','\x22:\x20','cwd-config','yellow'];a4_0x1bdd=function(){return _0x10a301;};return a4_0x1bdd();}export class AgentCloneCommand extends BaseCommand{['name']='agent:clone';[a4_0x2cf123(0x169)]=a4_0x2cf123(0x18e);async[a4_0x2cf123(0x214)](_0x340ead){const _0x1cfd8c=a4_0x2cf123,{options:_0x2fcd1a,args:_0x260e1b,tdx:_0x393ea2}=_0x340ead,_0x9f6929=_0x260e1b[0x0],_0x3ac942=_0x2fcd1a[_0x1cfd8c(0x16c)],_0x25d309=_0x2fcd1a[_0x1cfd8c(0x1c7)],_0x1adb31=_0x2fcd1a[_0x1cfd8c(0x1ae)],_0x30162c=_0x2fcd1a[_0x1cfd8c(0x192)],_0x196c29=_0x2fcd1a[_0x1cfd8c(0x1ac)];let _0x2a0633;const _0x580f1d=findAgentConfigPath(process[_0x1cfd8c(0x196)]());if(_0x9f6929){const _0x392ec7=a4_0x25d706['join'](_0x9f6929,_0x1cfd8c(0x1aa));existsSync(_0x392ec7)?(_0x2a0633=_0x9f6929,console['log'](a4_0x49142b[_0x1cfd8c(0x195)](_0x1cfd8c(0x197)+_0x9f6929))):_0x2a0633=_0x9f6929;}else{if(_0x580f1d)_0x2a0633=a4_0x25d706[_0x1cfd8c(0x1d2)](_0x580f1d),console[_0x1cfd8c(0x178)](a4_0x49142b[_0x1cfd8c(0x195)](_0x1cfd8c(0x1fe)+_0x2a0633));else{if(_0x196c29){const _0x219042=sanitizeForFilesystem(_0x196c29);let _0x564d83=_0x219042,_0x27ef50=a4_0x25d706[_0x1cfd8c(0x1d8)](process[_0x1cfd8c(0x196)](),_0x1cfd8c(0x1d7),_0x219042,_0x1cfd8c(0x1aa));if(!existsSync(_0x27ef50)){const _0x25d98b=normalizeName(_0x196c29),_0x27c982=a4_0x25d706[_0x1cfd8c(0x1d8)](process['cwd'](),_0x1cfd8c(0x1d7),_0x25d98b,_0x1cfd8c(0x1aa));existsSync(_0x27c982)&&(_0x564d83=_0x25d98b,_0x27ef50=_0x27c982);}if(existsSync(_0x27ef50))_0x2a0633=a4_0x25d706[_0x1cfd8c(0x1d2)](_0x27ef50),console['log'](a4_0x49142b[_0x1cfd8c(0x195)](_0x1cfd8c(0x197)+_0x2a0633));else{const _0x10f665=_0x2fcd1a['profile'];if(_0x10f665)throw new SDKError(ErrorCode[_0x1cfd8c(0x1b7)],_0x1cfd8c(0x1f4)+_0x196c29+_0x1cfd8c(0x1c8),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x1cfd8c(0x217)+(_0x1cfd8c(0x1fd)+_0x196c29+'\x0a')+(_0x1cfd8c(0x170)+_0x564d83+_0x1cfd8c(0x1bf)+(_0x3ac942||_0x1cfd8c(0x21a))+_0x1cfd8c(0x193)+_0x10f665)});_0x2a0633=_0x196c29,console[_0x1cfd8c(0x178)](a4_0x49142b[_0x1cfd8c(0x195)](_0x1cfd8c(0x1ba)+_0x196c29));}}}}if(!_0x2a0633)return console[_0x1cfd8c(0x178)](a4_0x49142b[_0x1cfd8c(0x206)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x1cfd8c(0x178)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x1cfd8c(0x178)](_0x1cfd8c(0x15d)),console[_0x1cfd8c(0x178)]('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console[_0x1cfd8c(0x178)](_0x1cfd8c(0x20f)),0x1;if(!_0x3ac942)throw new SDKError(ErrorCode[_0x1cfd8c(0x1dd)],_0x1cfd8c(0x162),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x1adb31&&!_0x25d309){if(!isInteractive())return console[_0x1cfd8c(0x1f9)](a4_0x49142b[_0x1cfd8c(0x1a0)](_0x1cfd8c(0x160)),_0x1cfd8c(0x1b9)),console[_0x1cfd8c(0x1f9)](a4_0x49142b[_0x1cfd8c(0x195)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x12760b=await confirmKey('Clone\x20\x22'+_0x2a0633+_0x1cfd8c(0x20c)+_0x3ac942+'\x22?');if(!_0x12760b)return console['log'](a4_0x49142b['yellow'](_0x1cfd8c(0x177))),0x1;}const {data:_0x47ddda}=await withSpinner(_0x1cfd8c(0x203)+_0x2a0633+_0x1cfd8c(0x1e7)+_0x3ac942+_0x1cfd8c(0x1d9),()=>_0x393ea2[_0x1cfd8c(0x1a3)][_0x1cfd8c(0x1cf)](_0x2a0633,_0x3ac942,{'dryRun':_0x25d309}));if(_0x25d309){console[_0x1cfd8c(0x178)](a4_0x49142b[_0x1cfd8c(0x206)](_0x1cfd8c(0x1b2))),console[_0x1cfd8c(0x178)](_0x1cfd8c(0x1fb)+_0x47ddda[_0x1cfd8c(0x17d)]),console[_0x1cfd8c(0x178)](_0x1cfd8c(0x15c)+_0x3ac942),console[_0x1cfd8c(0x178)](_0x1cfd8c(0x202)),console[_0x1cfd8c(0x178)](_0x1cfd8c(0x167)+_0x47ddda[_0x1cfd8c(0x1c5)][_0x1cfd8c(0x1d7)]['created']),console[_0x1cfd8c(0x178)]('\x20\x20Knowledge\x20Bases:\x20'+_0x47ddda[_0x1cfd8c(0x1c5)]['knowledgeBases'][_0x1cfd8c(0x1e5)]),console[_0x1cfd8c(0x178)]('\x20\x20Prompts:\x20'+_0x47ddda[_0x1cfd8c(0x1c5)][_0x1cfd8c(0x1f6)]['created']);const _0x3e6c83=_0x47ddda[_0x1cfd8c(0x1c5)][_0x1cfd8c(0x211)][_0x1cfd8c(0x1e5)]>0x0||_0x47ddda[_0x1cfd8c(0x1c5)][_0x1cfd8c(0x16d)]['created']>0x0;return _0x3e6c83&&(console[_0x1cfd8c(0x178)](_0x1cfd8c(0x179)+_0x47ddda['counts']['experimentalKnowledgeBases'][_0x1cfd8c(0x1e5)]),console[_0x1cfd8c(0x178)](_0x1cfd8c(0x1ff)+_0x47ddda[_0x1cfd8c(0x1c5)][_0x1cfd8c(0x16d)][_0x1cfd8c(0x1e5)])),0x0;}const _0x2e06f8=_0x47ddda[_0x1cfd8c(0x1c5)]['agents'][_0x1cfd8c(0x161)]>0x0||_0x47ddda[_0x1cfd8c(0x1c5)][_0x1cfd8c(0x1d4)][_0x1cfd8c(0x161)]>0x0||_0x47ddda[_0x1cfd8c(0x1c5)][_0x1cfd8c(0x1f6)][_0x1cfd8c(0x161)]>0x0||_0x47ddda[_0x1cfd8c(0x1c5)][_0x1cfd8c(0x211)][_0x1cfd8c(0x161)]>0x0||_0x47ddda[_0x1cfd8c(0x1c5)]['experimentalArtifacts']['errors']>0x0;_0x2e06f8?console[_0x1cfd8c(0x178)](a4_0x49142b['yellow'](_0x1cfd8c(0x200))):console[_0x1cfd8c(0x178)](a4_0x49142b[_0x1cfd8c(0x17b)](_0x1cfd8c(0x1a8)));console[_0x1cfd8c(0x178)]('Source:\x20'+_0x47ddda['sourceProjectName']),console['log'](_0x1cfd8c(0x15c)+_0x47ddda[_0x1cfd8c(0x1f0)]),console[_0x1cfd8c(0x178)](_0x1cfd8c(0x16e)+_0x47ddda[_0x1cfd8c(0x1e0)]),console[_0x1cfd8c(0x178)](),console[_0x1cfd8c(0x178)](_0x1cfd8c(0x17a)),console[_0x1cfd8c(0x178)](_0x1cfd8c(0x167)+formatCountSummary(_0x47ddda[_0x1cfd8c(0x1c5)][_0x1cfd8c(0x1d7)])),console['log'](_0x1cfd8c(0x218)+formatCountSummary(_0x47ddda[_0x1cfd8c(0x1c5)][_0x1cfd8c(0x1d4)])),console['log'](_0x1cfd8c(0x163)+formatCountSummary(_0x47ddda['counts'][_0x1cfd8c(0x1f6)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x47ddda[_0x1cfd8c(0x1c5)]['integrations']));const _0x107d1a=_0x47ddda[_0x1cfd8c(0x1c5)]['experimentalKnowledgeBases'][_0x1cfd8c(0x1e5)]>0x0||_0x47ddda[_0x1cfd8c(0x1c5)]['experimentalKnowledgeBases'][_0x1cfd8c(0x1f2)]>0x0||_0x47ddda[_0x1cfd8c(0x1c5)][_0x1cfd8c(0x211)][_0x1cfd8c(0x20e)]>0x0||_0x47ddda['counts'][_0x1cfd8c(0x16d)][_0x1cfd8c(0x1e5)]>0x0||_0x47ddda[_0x1cfd8c(0x1c5)][_0x1cfd8c(0x16d)][_0x1cfd8c(0x1f2)]>0x0||_0x47ddda[_0x1cfd8c(0x1c5)][_0x1cfd8c(0x16d)][_0x1cfd8c(0x20e)]>0x0;_0x107d1a&&(console[_0x1cfd8c(0x178)](_0x1cfd8c(0x179)+formatCountSummary(_0x47ddda[_0x1cfd8c(0x1c5)][_0x1cfd8c(0x211)])),console[_0x1cfd8c(0x178)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x47ddda[_0x1cfd8c(0x1c5)]['experimentalArtifacts'])));if(_0x2e06f8){console['log'](),console[_0x1cfd8c(0x178)](a4_0x49142b[_0x1cfd8c(0x1a0)](_0x1cfd8c(0x1ab)));for(const _0x44c03e of _0x47ddda[_0x1cfd8c(0x1d7)]){_0x44c03e[_0x1cfd8c(0x171)]===_0x1cfd8c(0x1f9)&&console[_0x1cfd8c(0x178)](a4_0x49142b['red']('\x20\x20Agent\x20\x22'+_0x44c03e[_0x1cfd8c(0x166)]+_0x1cfd8c(0x204)+_0x44c03e['error']));}for(const _0x1e914a of _0x47ddda[_0x1cfd8c(0x1d4)]){_0x1e914a[_0x1cfd8c(0x171)]===_0x1cfd8c(0x1f9)&&console[_0x1cfd8c(0x178)](a4_0x49142b[_0x1cfd8c(0x1a0)](_0x1cfd8c(0x1ca)+_0x1e914a['name']+'\x22:\x20'+_0x1e914a[_0x1cfd8c(0x1f9)]));}for(const _0x563c2e of _0x47ddda[_0x1cfd8c(0x1f6)]){_0x563c2e[_0x1cfd8c(0x171)]===_0x1cfd8c(0x1f9)&&console[_0x1cfd8c(0x178)](a4_0x49142b[_0x1cfd8c(0x1a0)](_0x1cfd8c(0x1b6)+_0x563c2e[_0x1cfd8c(0x16c)]+_0x1cfd8c(0x204)+_0x563c2e['error']));}for(const _0x1c0d2f of _0x47ddda['integrations']){_0x1c0d2f[_0x1cfd8c(0x171)]==='error'&&console[_0x1cfd8c(0x178)](a4_0x49142b[_0x1cfd8c(0x1a0)](_0x1cfd8c(0x15b)+_0x1c0d2f['name']+_0x1cfd8c(0x204)+_0x1c0d2f[_0x1cfd8c(0x1f9)]));}for(const _0x3aa3e6 of _0x47ddda[_0x1cfd8c(0x211)]){_0x3aa3e6[_0x1cfd8c(0x171)]==='error'&&console[_0x1cfd8c(0x178)](a4_0x49142b['red'](_0x1cfd8c(0x1ef)+_0x3aa3e6[_0x1cfd8c(0x16c)]+_0x1cfd8c(0x204)+_0x3aa3e6['error']));}for(const _0x59864c of _0x47ddda['experimentalArtifacts']){_0x59864c[_0x1cfd8c(0x171)]===_0x1cfd8c(0x1f9)&&console[_0x1cfd8c(0x178)](a4_0x49142b[_0x1cfd8c(0x1a0)](_0x1cfd8c(0x164)+_0x59864c[_0x1cfd8c(0x16c)]+_0x1cfd8c(0x204)+_0x59864c[_0x1cfd8c(0x1f9)]));}return 0x1;}console[_0x1cfd8c(0x178)]();const _0x1031b5=getLLMProjectUrl(_0x30162c,_0x47ddda['newProjectId']);return console[_0x1cfd8c(0x178)](_0x1cfd8c(0x1a5)+a4_0x49142b['cyan'](_0x1031b5)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x2cf123(0x16c)]=a4_0x2cf123(0x184);[a4_0x2cf123(0x169)]=a4_0x2cf123(0x19d);async[a4_0x2cf123(0x214)](_0x2e943c){const _0x7b5b19=a4_0x2cf123,{options:_0x55bb55,args:_0x2c6bc3,tdx:_0x543231}=_0x2e943c;let _0x849359=_0x2c6bc3[0x0]||process[_0x7b5b19(0x196)]();const _0x178d62=_0x55bb55['dryRun'],_0x389362=_0x55bb55[_0x7b5b19(0x1c4)],_0x3ae5d3=_0x55bb55[_0x7b5b19(0x1ae)],_0x45affc=_0x55bb55[_0x7b5b19(0x192)],_0x188b58=a4_0x25d706[_0x7b5b19(0x1d8)](_0x849359,_0x7b5b19(0x1db)),_0x4dee1f=existsSync(_0x188b58);if(_0x4dee1f){const {data:_0x3d28fb}=await withSpinner(_0x7b5b19(0x1ed)+_0x849359+'\x22...',()=>_0x543231['llm']['pushAgent'](_0x849359,{'dryRun':_0x178d62,'force':_0x389362}));if(_0x178d62)return console['log'](a4_0x49142b['yellow'](_0x7b5b19(0x1b2))),console[_0x7b5b19(0x178)](_0x7b5b19(0x1b3)+_0x3d28fb[_0x7b5b19(0x166)]),0x0;if(_0x3d28fb[_0x7b5b19(0x171)]===_0x7b5b19(0x1f9))return console['log'](a4_0x49142b['red'](_0x7b5b19(0x183)+_0x3d28fb[_0x7b5b19(0x1f9)])),0x1;console['log'](a4_0x49142b['green']('Agent\x20'+_0x3d28fb[_0x7b5b19(0x171)]+'\x20successfully')),console[_0x7b5b19(0x178)](_0x7b5b19(0x213)+_0x3d28fb['agentName']);if(_0x3d28fb[_0x7b5b19(0x172)]&&_0x3d28fb[_0x7b5b19(0x1b5)]){const _0x30de33=getLLMAgentChatUrl(_0x45affc,_0x3d28fb[_0x7b5b19(0x1b5)],_0x3d28fb['agentId']);console[_0x7b5b19(0x178)]('Chat:\x20'+a4_0x49142b[_0x7b5b19(0x1b1)](_0x30de33));}return 0x0;}const _0x159ee=_0x55bb55[_0x7b5b19(0x1ac)],_0x545af4=resolveProjectFromContext(_0x849359,_0x159ee);if(_0x545af4['found'])_0x849359=_0x545af4[_0x7b5b19(0x19b)],_0x545af4['source']==='context'&&console[_0x7b5b19(0x178)](a4_0x49142b[_0x7b5b19(0x195)](_0x7b5b19(0x201)+_0x849359));else{let _0x4d149b=_0x7b5b19(0x1de);_0x545af4[_0x7b5b19(0x215)]===_0x7b5b19(0x1d0)&&(_0x4d149b=_0x545af4[_0x7b5b19(0x1b0)]+_0x7b5b19(0x1c2)+_0x545af4['llmProject']+_0x7b5b19(0x1a2));throw new SDKError(ErrorCode[_0x7b5b19(0x1b7)],_0x545af4[_0x7b5b19(0x215)]===_0x7b5b19(0x165)?_0x545af4['message']:_0x7b5b19(0x1cd)+_0x849359,undefined,{'helpText':_0x4d149b});}const {data:_0x67e6d8}=await withSpinner(_0x7b5b19(0x1c6),()=>_0x543231[_0x7b5b19(0x1a3)][_0x7b5b19(0x1a4)](_0x849359,{'dryRun':!![]})),_0x541d9c=_0x67e6d8[_0x7b5b19(0x1c5)][_0x7b5b19(0x1d7)][_0x7b5b19(0x161)]>0x0;if(_0x541d9c){console[_0x7b5b19(0x178)](a4_0x49142b[_0x7b5b19(0x1a0)](_0x7b5b19(0x1cb)));for(const _0x39f1a3 of _0x67e6d8['agents']){_0x39f1a3[_0x7b5b19(0x171)]==='error'&&console['log'](a4_0x49142b[_0x7b5b19(0x1a0)]('\x20\x20Agent\x20\x22'+_0x39f1a3[_0x7b5b19(0x166)]+_0x7b5b19(0x204)+_0x39f1a3[_0x7b5b19(0x1f9)]));}return 0x1;}const _0x366791=_0x67e6d8[_0x7b5b19(0x1c5)][_0x7b5b19(0x1d7)]['created']+_0x67e6d8['counts'][_0x7b5b19(0x1d4)][_0x7b5b19(0x1e5)]+_0x67e6d8[_0x7b5b19(0x1c5)][_0x7b5b19(0x18d)]['created']+_0x67e6d8['counts'][_0x7b5b19(0x1f6)][_0x7b5b19(0x1e5)]+_0x67e6d8[_0x7b5b19(0x1c5)][_0x7b5b19(0x1a7)][_0x7b5b19(0x1e5)]+_0x67e6d8[_0x7b5b19(0x1c5)][_0x7b5b19(0x211)]['created']+_0x67e6d8['counts']['experimentalArtifacts'][_0x7b5b19(0x1e5)],_0x11376a=_0x67e6d8[_0x7b5b19(0x1c5)][_0x7b5b19(0x1d7)][_0x7b5b19(0x1f2)]+_0x67e6d8[_0x7b5b19(0x1c5)][_0x7b5b19(0x1d4)][_0x7b5b19(0x1f2)]+_0x67e6d8['counts'][_0x7b5b19(0x18d)][_0x7b5b19(0x1f2)]+_0x67e6d8[_0x7b5b19(0x1c5)][_0x7b5b19(0x1f6)][_0x7b5b19(0x1f2)]+_0x67e6d8[_0x7b5b19(0x1c5)]['integrations'][_0x7b5b19(0x1f2)]+_0x67e6d8[_0x7b5b19(0x1c5)][_0x7b5b19(0x211)][_0x7b5b19(0x1f2)]+_0x67e6d8[_0x7b5b19(0x1c5)][_0x7b5b19(0x16d)][_0x7b5b19(0x1f2)],_0x2b7e12=_0x67e6d8['counts'][_0x7b5b19(0x1d7)][_0x7b5b19(0x20e)]+_0x67e6d8[_0x7b5b19(0x1c5)]['knowledgeBases']['unchanged']+_0x67e6d8['counts'][_0x7b5b19(0x18d)][_0x7b5b19(0x20e)]+_0x67e6d8[_0x7b5b19(0x1c5)][_0x7b5b19(0x1f6)]['unchanged']+_0x67e6d8[_0x7b5b19(0x1c5)][_0x7b5b19(0x1a7)]['unchanged']+_0x67e6d8['counts'][_0x7b5b19(0x211)]['unchanged']+_0x67e6d8[_0x7b5b19(0x1c5)][_0x7b5b19(0x16d)][_0x7b5b19(0x20e)];console[_0x7b5b19(0x178)](_0x7b5b19(0x1d5)+_0x67e6d8[_0x7b5b19(0x19c)]+'\x27:'),console['log']('\x20\x20'+a4_0x49142b[_0x7b5b19(0x17b)]('+\x20'+_0x366791+_0x7b5b19(0x1e8))+_0x7b5b19(0x19f)+a4_0x49142b[_0x7b5b19(0x206)]('~\x20'+_0x11376a+_0x7b5b19(0x1c0))+'\x20|\x20'+a4_0x49142b[_0x7b5b19(0x195)]('=\x20'+_0x2b7e12+_0x7b5b19(0x18b))),console[_0x7b5b19(0x178)](_0x7b5b19(0x167)+formatCountSummary(_0x67e6d8[_0x7b5b19(0x1c5)][_0x7b5b19(0x1d7)])),console[_0x7b5b19(0x178)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x67e6d8[_0x7b5b19(0x1c5)][_0x7b5b19(0x1d4)])),console[_0x7b5b19(0x178)](_0x7b5b19(0x1c1)+formatCountSummary(_0x67e6d8[_0x7b5b19(0x1c5)][_0x7b5b19(0x18d)])),console[_0x7b5b19(0x178)](_0x7b5b19(0x163)+formatCountSummary(_0x67e6d8['counts'][_0x7b5b19(0x1f6)])),console[_0x7b5b19(0x178)](_0x7b5b19(0x168)+formatCountSummary(_0x67e6d8[_0x7b5b19(0x1c5)][_0x7b5b19(0x1a7)]));const _0x116af9=_0x67e6d8[_0x7b5b19(0x1c5)][_0x7b5b19(0x211)][_0x7b5b19(0x1e5)]>0x0||_0x67e6d8[_0x7b5b19(0x1c5)][_0x7b5b19(0x211)][_0x7b5b19(0x1f2)]>0x0||_0x67e6d8[_0x7b5b19(0x1c5)][_0x7b5b19(0x211)][_0x7b5b19(0x20e)]>0x0||_0x67e6d8[_0x7b5b19(0x1c5)][_0x7b5b19(0x16d)][_0x7b5b19(0x1e5)]>0x0||_0x67e6d8[_0x7b5b19(0x1c5)][_0x7b5b19(0x16d)][_0x7b5b19(0x1f2)]>0x0||_0x67e6d8[_0x7b5b19(0x1c5)]['experimentalArtifacts'][_0x7b5b19(0x20e)]>0x0;_0x116af9&&(console[_0x7b5b19(0x178)](_0x7b5b19(0x179)+formatCountSummary(_0x67e6d8[_0x7b5b19(0x1c5)][_0x7b5b19(0x211)])),console[_0x7b5b19(0x178)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x67e6d8[_0x7b5b19(0x1c5)][_0x7b5b19(0x16d)])));console[_0x7b5b19(0x178)]('\x20\x20Source:\x20'+a4_0x49142b[_0x7b5b19(0x1b1)](_0x849359)),displayDiffs(_0x67e6d8[_0x7b5b19(0x1d7)],_0x67e6d8[_0x7b5b19(0x1d4)],_0x67e6d8['textKnowledgeBases'],_0x67e6d8[_0x7b5b19(0x1f6)],_0x67e6d8['integrations'],_0x67e6d8['experimentalKnowledgeBases'],_0x67e6d8[_0x7b5b19(0x16d)]);if(_0x178d62)return console['log'](a4_0x49142b[_0x7b5b19(0x206)](_0x7b5b19(0x1a9))),0x0;if(_0x366791===0x0&&_0x11376a===0x0){console[_0x7b5b19(0x178)](a4_0x49142b['green']('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x55453a=getLLMProjectUrl(_0x45affc,_0x67e6d8[_0x7b5b19(0x1b5)]);return console[_0x7b5b19(0x178)](_0x7b5b19(0x1a5)+a4_0x49142b[_0x7b5b19(0x1b1)](_0x55453a)),0x0;}if(!_0x3ae5d3&&!_0x389362){if(!isInteractive())return console[_0x7b5b19(0x1f9)](a4_0x49142b['red'](_0x7b5b19(0x160)),_0x7b5b19(0x1b9)),console[_0x7b5b19(0x1f9)](a4_0x49142b[_0x7b5b19(0x195)](_0x7b5b19(0x1df))),0x1;const _0x40362d=await confirmKey(_0x7b5b19(0x210)+(_0x366791+_0x11376a)+_0x7b5b19(0x1eb));if(!_0x40362d)return console[_0x7b5b19(0x178)](a4_0x49142b['yellow'](_0x7b5b19(0x177)),_0x7b5b19(0x1d6)),0x1;}const {data:_0x134436}=await withSpinner(_0x7b5b19(0x174),()=>_0x543231[_0x7b5b19(0x1a3)][_0x7b5b19(0x1a4)](_0x849359,{'force':_0x389362})),_0x39de35=_0x134436[_0x7b5b19(0x1c5)][_0x7b5b19(0x1d7)][_0x7b5b19(0x161)]>0x0||_0x134436[_0x7b5b19(0x1c5)][_0x7b5b19(0x1d4)][_0x7b5b19(0x161)]>0x0||_0x134436[_0x7b5b19(0x1c5)][_0x7b5b19(0x18d)][_0x7b5b19(0x161)]>0x0||_0x134436[_0x7b5b19(0x1c5)]['prompts'][_0x7b5b19(0x161)]>0x0;if(_0x39de35){console[_0x7b5b19(0x178)](a4_0x49142b[_0x7b5b19(0x206)](_0x7b5b19(0x1f5))),console[_0x7b5b19(0x178)](),console[_0x7b5b19(0x178)](a4_0x49142b[_0x7b5b19(0x1a0)]('Errors:'));for(const _0x13ca08 of _0x134436[_0x7b5b19(0x1d7)]){_0x13ca08[_0x7b5b19(0x171)]===_0x7b5b19(0x1f9)&&console[_0x7b5b19(0x178)](a4_0x49142b[_0x7b5b19(0x1a0)](_0x7b5b19(0x191)+_0x13ca08[_0x7b5b19(0x166)]+_0x7b5b19(0x204)+_0x13ca08[_0x7b5b19(0x1f9)]));}for(const _0x5065e4 of _0x134436[_0x7b5b19(0x1d4)]){_0x5065e4[_0x7b5b19(0x171)]===_0x7b5b19(0x1f9)&&console[_0x7b5b19(0x178)](a4_0x49142b['red'](_0x7b5b19(0x1ca)+_0x5065e4[_0x7b5b19(0x16c)]+_0x7b5b19(0x204)+_0x5065e4[_0x7b5b19(0x1f9)]));}for(const _0x2b7242 of _0x134436[_0x7b5b19(0x18d)]){_0x2b7242[_0x7b5b19(0x171)]===_0x7b5b19(0x1f9)&&console[_0x7b5b19(0x178)](a4_0x49142b['red'](_0x7b5b19(0x20b)+_0x2b7242[_0x7b5b19(0x16c)]+_0x7b5b19(0x204)+_0x2b7242[_0x7b5b19(0x1f9)]));}for(const _0x1c9d4a of _0x134436[_0x7b5b19(0x1f6)]){_0x1c9d4a[_0x7b5b19(0x171)]===_0x7b5b19(0x1f9)&&console[_0x7b5b19(0x178)](a4_0x49142b[_0x7b5b19(0x1a0)](_0x7b5b19(0x1b6)+_0x1c9d4a[_0x7b5b19(0x16c)]+'\x22:\x20'+_0x1c9d4a[_0x7b5b19(0x1f9)]));}for(const _0x3a4137 of _0x134436[_0x7b5b19(0x1a7)]){_0x3a4137['action']==='error'&&console[_0x7b5b19(0x178)](a4_0x49142b[_0x7b5b19(0x1a0)]('\x20\x20Integration\x20\x22'+_0x3a4137[_0x7b5b19(0x16c)]+_0x7b5b19(0x204)+_0x3a4137[_0x7b5b19(0x1f9)]));}return 0x1;}console[_0x7b5b19(0x178)](a4_0x49142b[_0x7b5b19(0x17b)](_0x7b5b19(0x1e1)+(_0x366791+_0x11376a)+'\x20resources\x20to\x20\x27'+_0x134436[_0x7b5b19(0x19c)]+'\x27'));const _0x35cb9e=getLLMProjectUrl(_0x45affc,_0x134436['projectId']);return console['log']('Project:\x20'+a4_0x49142b[_0x7b5b19(0x1b1)](_0x35cb9e)),0x0;}}
1
+ const a4_0x5044ec=a4_0x2b0f;(function(_0x12b013,_0x50a683){const _0x2d4df7=a4_0x2b0f,_0x2e7ef9=_0x12b013();while(!![]){try{const _0x48eaf6=-parseInt(_0x2d4df7(0x1cb))/0x1*(-parseInt(_0x2d4df7(0x1f7))/0x2)+-parseInt(_0x2d4df7(0x157))/0x3+parseInt(_0x2d4df7(0x151))/0x4*(parseInt(_0x2d4df7(0x1ef))/0x5)+-parseInt(_0x2d4df7(0x155))/0x6+parseInt(_0x2d4df7(0x1d2))/0x7+parseInt(_0x2d4df7(0x15c))/0x8*(parseInt(_0x2d4df7(0x1a0))/0x9)+-parseInt(_0x2d4df7(0x17b))/0xa*(parseInt(_0x2d4df7(0x153))/0xb);if(_0x48eaf6===_0x50a683)break;else _0x2e7ef9['push'](_0x2e7ef9['shift']());}catch(_0x1875a9){_0x2e7ef9['push'](_0x2e7ef9['shift']());}}}(a4_0x4209,0x7525c));import a4_0x4a1a27 from'chalk';function a4_0x4209(){const _0x390ebc=['Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Using\x20local\x20project:\x20','\x22...','\x20new','isNew','agentName','updated','Output\x20path:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','no_context','Dry\x20run\x20-\x20no\x20changes\x20made','repeat','Would\x20clone:','Failed\x20to\x20push\x20agent:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x20\x20Source:\x20','Writing\x20files...','\x20\x20tdx\x20agent\x20pull\x20','error','Source:\x20','\x20files?','source','1480lIdpkX','push','\x22\x20to\x20\x22','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','join','\x20changed','\x20resources\x20to\x20\x27','-\x20no\x20files\x20written','612902YiTuWx','Status:\x20','Analyzing\x20changes\x20to\x20push...','agents','\x20\x20Prompt\x20\x22','output','description','\x0aError:','\x20\x20Knowledge\x20Base\x20\x22','llm','Using\x20project:\x20','log','Cannot\x20clone\x20from\x20context\x20project\x20\x22','outputPath','9472oMlSWx','profile','47949MRinXM','cwd-config','3089250NfEZPf','Agent:\x20','847062jUiJYP','Project:\x20','\x20files\x20to\x20','\x20created','dirname','856kwBWDR','site','New\x20project\x20name\x20is\x20required','\x0aPush\x20summary\x20for\x20\x27','<new-name>','outputDir','\x20resources?','total','\x20\x20Experimental\x20Artifact\x20\x22','agent.yml','Errors:','green','newProjectName','red','\x20\x20Experimental\x20Artifacts:\x20','agent:push','Analyzing\x20project\x20\x22','action','MISSING_ARGUMENT','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','new','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','projectName','\x20\x20Agents:\x20','Using\x20project\x20from\x20','Summary:','✔\x20Context\x20set:\x20','\x22\x20from\x20project\x20\x22','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x20\x20Integration\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','2220qwsYNc','unchanged','errors','llm_project','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)','Pushing\x20agent\x20from\x20\x22','no_local_folder','\x20|\x20','llmProject','newProjectId','pushProject','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','utf-8','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','message','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','context','Cancelled','agent','-\x20nothing\x20pushed','integrations','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20\x20Prompts:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','prompts','hasChanges','Clone\x20\x22','pullAgent','\x0aChanges\x20to\x20agent\x20\x27','New\x20project\x20ID:\x20','Project\x20cloned\x20successfully','Agent\x20','Dry\x20run\x20-\x20no\x20files\x20written','Pushing\x20to\x20project...','\x22:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','yes','43731OJkGVf','Chat:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','arg-dir','Using\x20context\x20project:\x20','dim','pullProject','execute','New\x20project:\x20','tdx.json','experimentalKnowledgeBases','reason','projectId','\x0aChanges\x20to\x20prompt\x20\x27','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aWrite\x20','name','\x20=\x20','Project\x20cloned\x20with\x20errors','\x20\x20Knowledge\x20Bases:\x20','cyan','counts','parse','\x0aErrors\x20found:','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20--profile\x20','textKnowledgeBases','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','force','yellow','sourceProjectName','\x0aChanges\x20to\x20integration\x20\x27','agent:clone','diff','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','\x20\x20Agent\x20\x22','found','\x20successfully','experimentalArtifacts','cwd','Using\x20current\x20project:\x20','3NfOkSA','\x20\x20Text\x20Knowledge\x20Bases:\x20','gray','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x0aPull\x20summary\x20for\x20\x27','\x20\x20Integrations:\x20','Would\x20pull\x20agent:\x20','731983ocyIzV','\x20unchanged','agentId','\x20errors','knowledgeBases','created','session'];a4_0x4209=function(){return _0x390ebc;};return a4_0x4209();}import a4_0x5c7fd4 from'path';import{existsSync,readFileSync}from'fs';function a4_0x2b0f(_0x306be4,_0x54d2b9){_0x306be4=_0x306be4-0x150;const _0x4209e0=a4_0x4209();let _0x2b0f3d=_0x4209e0[_0x306be4];return _0x2b0f3d;}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(_0x41ab3e){const _0x16257b=a4_0x2b0f,_0x2e484c=[];if(_0x41ab3e[_0x16257b(0x163)]!==undefined)_0x2e484c[_0x16257b(0x1f0)](_0x41ab3e[_0x16257b(0x163)]+'\x20total');if(_0x41ab3e[_0x16257b(0x170)]!==undefined&&_0x41ab3e[_0x16257b(0x170)]>0x0)_0x2e484c[_0x16257b(0x1f0)](a4_0x4a1a27[_0x16257b(0x167)](_0x41ab3e[_0x16257b(0x170)]+_0x16257b(0x1dc)));if(_0x41ab3e[_0x16257b(0x1d7)]!==undefined&&_0x41ab3e['created']>0x0)_0x2e484c['push'](a4_0x4a1a27['green'](_0x41ab3e[_0x16257b(0x1d7)]+_0x16257b(0x15a)));if(_0x41ab3e[_0x16257b(0x1df)]!==undefined&&_0x41ab3e[_0x16257b(0x1df)]>0x0)_0x2e484c[_0x16257b(0x1f0)](a4_0x4a1a27[_0x16257b(0x1bd)](_0x41ab3e['updated']+'\x20updated'));if(_0x41ab3e[_0x16257b(0x17c)]!==undefined&&_0x41ab3e[_0x16257b(0x17c)]>0x0)_0x2e484c[_0x16257b(0x1f0)](a4_0x4a1a27[_0x16257b(0x1cd)](_0x41ab3e[_0x16257b(0x17c)]+_0x16257b(0x1d3)));if(_0x41ab3e[_0x16257b(0x17d)]!==undefined&&_0x41ab3e[_0x16257b(0x17d)]>0x0)_0x2e484c[_0x16257b(0x1f0)](a4_0x4a1a27[_0x16257b(0x169)](_0x41ab3e[_0x16257b(0x17d)]+_0x16257b(0x1d5)));return _0x2e484c[_0x16257b(0x1f3)](',\x20');}function displayDiffs(_0x11c84c,_0x274027,_0x5b4fac,_0x81a56,_0x164992,_0x375832,_0x193d99){const _0x1b4af5=a4_0x2b0f;for(const _0x459c68 of _0x11c84c){if(_0x459c68['diff']){const _0x4447d4=_0x459c68[_0x1b4af5(0x1de)]||_0x459c68[_0x1b4af5(0x1b0)];console[_0x1b4af5(0x202)](_0x1b4af5(0x197)+_0x4447d4+'\x27:'),console[_0x1b4af5(0x202)]('─'[_0x1b4af5(0x1e4)](0x3c)),console['log'](_0x459c68[_0x1b4af5(0x1c1)]),console['log']('─'[_0x1b4af5(0x1e4)](0x3c));}}for(const _0x501e5f of _0x274027){_0x501e5f[_0x1b4af5(0x1c1)]&&(console[_0x1b4af5(0x202)](_0x1b4af5(0x19e)+_0x501e5f[_0x1b4af5(0x1b0)]+'\x27:'),console[_0x1b4af5(0x202)]('─'[_0x1b4af5(0x1e4)](0x3c)),console['log'](_0x501e5f[_0x1b4af5(0x1c1)]),console['log']('─'[_0x1b4af5(0x1e4)](0x3c)));}for(const _0x42ec96 of _0x5b4fac){_0x42ec96[_0x1b4af5(0x1c1)]&&(console[_0x1b4af5(0x202)](_0x1b4af5(0x171)+_0x42ec96[_0x1b4af5(0x1b0)]+'\x27:'),console[_0x1b4af5(0x202)]('─'['repeat'](0x3c)),console['log'](_0x42ec96[_0x1b4af5(0x1c1)]),console[_0x1b4af5(0x202)]('─'['repeat'](0x3c)));}for(const _0x18ea81 of _0x81a56){_0x18ea81[_0x1b4af5(0x1c1)]&&(console[_0x1b4af5(0x202)](_0x1b4af5(0x1ad)+_0x18ea81[_0x1b4af5(0x1b0)]+'\x27:'),console[_0x1b4af5(0x202)]('─'[_0x1b4af5(0x1e4)](0x3c)),console[_0x1b4af5(0x202)](_0x18ea81[_0x1b4af5(0x1c1)]),console[_0x1b4af5(0x202)]('─'[_0x1b4af5(0x1e4)](0x3c)));}for(const _0x5e7fc6 of _0x164992){_0x5e7fc6[_0x1b4af5(0x1c1)]&&(console[_0x1b4af5(0x202)](_0x1b4af5(0x1bf)+_0x5e7fc6[_0x1b4af5(0x1b0)]+'\x27:'),console['log']('─'[_0x1b4af5(0x1e4)](0x3c)),console[_0x1b4af5(0x202)](_0x5e7fc6['diff']),console[_0x1b4af5(0x202)]('─'[_0x1b4af5(0x1e4)](0x3c)));}for(const _0x115dad of _0x375832){_0x115dad[_0x1b4af5(0x1c1)]&&(console[_0x1b4af5(0x202)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x115dad[_0x1b4af5(0x1b0)]+'\x27:'),console[_0x1b4af5(0x202)]('─'[_0x1b4af5(0x1e4)](0x3c)),console['log'](_0x115dad[_0x1b4af5(0x1c1)]),console['log']('─'[_0x1b4af5(0x1e4)](0x3c)));}for(const _0x5615c5 of _0x193d99){_0x5615c5[_0x1b4af5(0x1c1)]&&(console['log'](_0x1b4af5(0x186)+_0x5615c5[_0x1b4af5(0x1b0)]+'\x27:'),console[_0x1b4af5(0x202)]('─'[_0x1b4af5(0x1e4)](0x3c)),console[_0x1b4af5(0x202)](_0x5615c5[_0x1b4af5(0x1c1)]),console[_0x1b4af5(0x202)]('─'[_0x1b4af5(0x1e4)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x5044ec(0x1b0)]='agent:pull';[a4_0x5044ec(0x1fd)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x5044ec(0x1a7)](_0x5c9da2){const _0x5ddb03=a4_0x5044ec,{options:_0x339aff,args:_0x39bef9,tdx:_0x5009ce}=_0x5c9da2,_0x334185=_0x39bef9[0x0],_0x5087fe=_0x39bef9[0x1],_0x11f800=_0x339aff[_0x5ddb03(0x1fc)],_0x591ba8=_0x339aff['dryRun'],_0x2d5154=_0x339aff[_0x5ddb03(0x1bc)],_0x2d3392=_0x339aff['yes'],_0x15faab=_0x339aff['llmProject'],_0x46b704=_0x339aff[_0x5ddb03(0x18d)];let _0x5aef5e;if(_0x334185){const _0x177094=a4_0x5c7fd4[_0x5ddb03(0x1f3)](_0x334185,_0x5ddb03(0x1a9));if(existsSync(_0x177094))try{const _0x370cfb=JSON[_0x5ddb03(0x1b6)](readFileSync(_0x177094,_0x5ddb03(0x187)));_0x370cfb[_0x5ddb03(0x17e)]&&(_0x5aef5e={'llm_project':_0x370cfb[_0x5ddb03(0x17e)]});}catch{}}const _0x2b7716=findAgentConfigPath(process[_0x5ddb03(0x1c9)]());let _0x251bc7;if(_0x2b7716)try{const _0x4d02cf=JSON[_0x5ddb03(0x1b6)](readFileSync(_0x2b7716,_0x5ddb03(0x187)));_0x4d02cf[_0x5ddb03(0x17e)]&&(_0x251bc7={'llm_project':_0x4d02cf[_0x5ddb03(0x17e)]});}catch{}const _0x4720d8=resolveAgentPullArgs({'arg':_0x334185,'agentNameArg':_0x5087fe,'agentFlag':_0x46b704,'contextProject':_0x15faab,'argDirConfig':_0x5aef5e,'cwdConfigPath':_0x2b7716||undefined,'cwdConfig':_0x251bc7}),{projectNameOrId:_0x136cfd,targetAgentName:_0x2c4a96,existingOutputDir:_0x2d5db8,source:_0x584b9b}=_0x4720d8;if(_0x584b9b===_0x5ddb03(0x1a3))console[_0x5ddb03(0x202)](a4_0x4a1a27[_0x5ddb03(0x1a5)](_0x5ddb03(0x174)+a4_0x5c7fd4['join'](_0x334185,_0x5ddb03(0x1a9))+':\x20'+_0x136cfd));else{if(_0x584b9b===_0x5ddb03(0x154))console[_0x5ddb03(0x202)](a4_0x4a1a27['dim']('Using\x20project:\x20'+_0x136cfd));else _0x584b9b===_0x5ddb03(0x18b)&&console['log'](a4_0x4a1a27[_0x5ddb03(0x1a5)]('Using\x20project\x20from\x20context:\x20'+_0x136cfd));}if(!_0x136cfd)return _0x46b704?(console[_0x5ddb03(0x202)](a4_0x4a1a27[_0x5ddb03(0x1bd)](_0x5ddb03(0x1e7))),console[_0x5ddb03(0x202)](_0x5ddb03(0x16f)),console['log']('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console['log'](a4_0x4a1a27['yellow']('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x5ddb03(0x202)](_0x5ddb03(0x17f)),console[_0x5ddb03(0x202)](_0x5ddb03(0x190)),console['log'](_0x5ddb03(0x1c4)),console[_0x5ddb03(0x202)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project'),console[_0x5ddb03(0x202)](_0x5ddb03(0x17a))),0x1;if(_0x2c4a96){const {data:_0x1032c8}=await withSpinner('Pulling\x20agent\x20\x22'+_0x2c4a96+_0x5ddb03(0x177)+_0x136cfd+_0x5ddb03(0x1db),()=>_0x5009ce[_0x5ddb03(0x200)][_0x5ddb03(0x196)](_0x136cfd,_0x2c4a96,_0x11f800,{'dryRun':_0x591ba8,'force':_0x2d5154}));if(_0x591ba8)return console[_0x5ddb03(0x202)](a4_0x4a1a27[_0x5ddb03(0x1bd)](_0x5ddb03(0x19b))),console['log'](_0x5ddb03(0x1d1)+_0x1032c8[_0x5ddb03(0x1de)]),console[_0x5ddb03(0x202)](_0x5ddb03(0x1e0)+_0x1032c8[_0x5ddb03(0x150)]),_0x1032c8[_0x5ddb03(0x1c1)]&&(console['log']('\x0aChanges:'),console[_0x5ddb03(0x202)]('─'[_0x5ddb03(0x1e4)](0x3c)),console[_0x5ddb03(0x202)](_0x1032c8[_0x5ddb03(0x1c1)]),console[_0x5ddb03(0x202)]('─'['repeat'](0x3c))),0x0;return console[_0x5ddb03(0x202)](a4_0x4a1a27[_0x5ddb03(0x167)]('Agent\x20pulled\x20successfully')),console[_0x5ddb03(0x202)](_0x5ddb03(0x156)+_0x1032c8['agentName']),console[_0x5ddb03(0x202)]('Output:\x20'+_0x1032c8[_0x5ddb03(0x150)]),console[_0x5ddb03(0x202)](_0x5ddb03(0x1f8)+(_0x1032c8[_0x5ddb03(0x1dd)]?a4_0x4a1a27[_0x5ddb03(0x167)](_0x5ddb03(0x170)):_0x1032c8[_0x5ddb03(0x194)]?a4_0x4a1a27['yellow']('updated'):a4_0x4a1a27[_0x5ddb03(0x1cd)](_0x5ddb03(0x17c)))),0x0;}const _0x10d4aa=_0x2d5db8||_0x11f800,{data:_0x139791}=await withSpinner(_0x5ddb03(0x16c)+_0x136cfd+_0x5ddb03(0x1db),()=>_0x5009ce['llm'][_0x5ddb03(0x1a6)](_0x136cfd,_0x10d4aa,{'dryRun':!![]})),_0x470f56=_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x1fa)][_0x5ddb03(0x170)]+_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x1d6)][_0x5ddb03(0x170)]+_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x1ba)][_0x5ddb03(0x170)]+_0x139791['counts'][_0x5ddb03(0x193)][_0x5ddb03(0x170)]+_0x139791[_0x5ddb03(0x1b5)]['integrations'][_0x5ddb03(0x170)]+_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x1aa)][_0x5ddb03(0x170)]+_0x139791['counts'][_0x5ddb03(0x1c8)][_0x5ddb03(0x170)],_0x58028d=_0x139791['counts']['agents'][_0x5ddb03(0x1df)]+_0x139791['counts'][_0x5ddb03(0x1d6)][_0x5ddb03(0x1df)]+_0x139791['counts'][_0x5ddb03(0x1ba)][_0x5ddb03(0x1df)]+_0x139791['counts'][_0x5ddb03(0x193)]['updated']+_0x139791['counts'][_0x5ddb03(0x18f)][_0x5ddb03(0x1df)]+_0x139791[_0x5ddb03(0x1b5)]['experimentalKnowledgeBases'][_0x5ddb03(0x1df)]+_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x1c8)][_0x5ddb03(0x1df)],_0x850cd2=_0x139791['counts'][_0x5ddb03(0x1fa)][_0x5ddb03(0x17c)]+_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x1d6)][_0x5ddb03(0x17c)]+_0x139791[_0x5ddb03(0x1b5)]['textKnowledgeBases']['unchanged']+_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x193)][_0x5ddb03(0x17c)]+_0x139791[_0x5ddb03(0x1b5)]['integrations']['unchanged']+_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x1aa)][_0x5ddb03(0x17c)]+_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x1c8)][_0x5ddb03(0x17c)];console['log'](_0x5ddb03(0x1cf)+_0x139791[_0x5ddb03(0x172)]+'\x27:'),console[_0x5ddb03(0x202)]('\x20\x20'+a4_0x4a1a27[_0x5ddb03(0x167)]('+\x20'+_0x470f56+_0x5ddb03(0x1dc))+_0x5ddb03(0x182)+a4_0x4a1a27[_0x5ddb03(0x1bd)]('~\x20'+_0x58028d+_0x5ddb03(0x1f4))+'\x20|\x20'+a4_0x4a1a27[_0x5ddb03(0x1a5)]('=\x20'+_0x850cd2+_0x5ddb03(0x1d3))),console[_0x5ddb03(0x202)]('\x20\x20Agents:\x20'+formatCountSummary(_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x1fa)])),console[_0x5ddb03(0x202)](_0x5ddb03(0x1b3)+formatCountSummary(_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x1d6)])),console[_0x5ddb03(0x202)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x1ba)])),console[_0x5ddb03(0x202)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x193)])),console['log'](_0x5ddb03(0x1d0)+formatCountSummary(_0x139791['counts'][_0x5ddb03(0x18f)]));const _0x529ccb=_0x139791['counts']['experimentalKnowledgeBases'][_0x5ddb03(0x163)]>0x0||_0x139791[_0x5ddb03(0x1b5)]['experimentalArtifacts']['total']>0x0;_0x529ccb&&(console[_0x5ddb03(0x202)](_0x5ddb03(0x1bb)+formatCountSummary(_0x139791['counts']['experimentalKnowledgeBases'])),console[_0x5ddb03(0x202)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x139791[_0x5ddb03(0x1b5)]['experimentalArtifacts'])));console[_0x5ddb03(0x202)]('\x20\x20Target:\x20'+a4_0x4a1a27['cyan'](_0x139791[_0x5ddb03(0x161)])),displayDiffs(_0x139791[_0x5ddb03(0x1fa)],_0x139791[_0x5ddb03(0x1d6)],_0x139791[_0x5ddb03(0x1ba)],_0x139791[_0x5ddb03(0x193)],_0x139791[_0x5ddb03(0x18f)],_0x139791[_0x5ddb03(0x1aa)],_0x139791[_0x5ddb03(0x1c8)]);if(_0x591ba8)return console[_0x5ddb03(0x202)](a4_0x4a1a27[_0x5ddb03(0x1bd)](_0x5ddb03(0x1e1))),0x0;if(_0x470f56===0x0&&_0x58028d===0x0)return console[_0x5ddb03(0x202)](a4_0x4a1a27[_0x5ddb03(0x167)](_0x5ddb03(0x1ae))),saveSessionContext({'llm_project':_0x139791[_0x5ddb03(0x172)]},_0x339aff[_0x5ddb03(0x1d8)]),console[_0x5ddb03(0x202)](a4_0x4a1a27[_0x5ddb03(0x167)]('✔\x20Context\x20set:\x20'+a4_0x4a1a27[_0x5ddb03(0x1a5)](_0x5ddb03(0x17e))+_0x5ddb03(0x1b1)+a4_0x4a1a27[_0x5ddb03(0x1b4)](_0x139791[_0x5ddb03(0x172)]))),0x0;if(!_0x2d3392&&!_0x2d5154){if(!isInteractive())return console[_0x5ddb03(0x1eb)](a4_0x4a1a27[_0x5ddb03(0x169)]('\x0aError:'),_0x5ddb03(0x1a2)),console['error'](a4_0x4a1a27[_0x5ddb03(0x1a5)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4d5726=await confirmKey(_0x5ddb03(0x1af)+(_0x470f56+_0x58028d)+_0x5ddb03(0x1ed));if(!_0x4d5726)return console['log'](a4_0x4a1a27[_0x5ddb03(0x1bd)]('Cancelled'),_0x5ddb03(0x1f6)),0x1;}const {data:_0x5c0a4b}=await withSpinner(_0x5ddb03(0x1e9),()=>_0x5009ce[_0x5ddb03(0x200)][_0x5ddb03(0x1a6)](_0x136cfd,_0x10d4aa,{'force':_0x2d5154}));return console[_0x5ddb03(0x202)](a4_0x4a1a27[_0x5ddb03(0x167)]('\x0a✔\x20Pulled\x20'+(_0x470f56+_0x58028d)+_0x5ddb03(0x159)+_0x5c0a4b[_0x5ddb03(0x161)])),saveSessionContext({'llm_project':_0x5c0a4b[_0x5ddb03(0x172)]},_0x339aff[_0x5ddb03(0x1d8)]),console['log'](a4_0x4a1a27[_0x5ddb03(0x167)](_0x5ddb03(0x176)+a4_0x4a1a27[_0x5ddb03(0x1a5)](_0x5ddb03(0x17e))+_0x5ddb03(0x1b1)+a4_0x4a1a27[_0x5ddb03(0x1b4)](_0x5c0a4b[_0x5ddb03(0x172)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x5044ec(0x1b0)]=a4_0x5044ec(0x1c0);[a4_0x5044ec(0x1fd)]=a4_0x5044ec(0x18a);async[a4_0x5044ec(0x1a7)](_0x10e981){const _0x2c3d7a=a4_0x5044ec,{options:_0x4ff4db,args:_0x570b02,tdx:_0x49997e}=_0x10e981,_0x44ebfd=_0x570b02[0x0],_0xbf99d8=_0x4ff4db[_0x2c3d7a(0x1b0)],_0x5f23da=_0x4ff4db['dryRun'],_0x55bb99=_0x4ff4db['yes'],_0x5c9904=_0x4ff4db['site'],_0x17d424=_0x4ff4db[_0x2c3d7a(0x183)];let _0xef6ca4;const _0x363be2=findAgentConfigPath(process[_0x2c3d7a(0x1c9)]());if(_0x44ebfd){const _0x4e1f74=a4_0x5c7fd4['join'](_0x44ebfd,_0x2c3d7a(0x1a9));existsSync(_0x4e1f74)?(_0xef6ca4=_0x44ebfd,console[_0x2c3d7a(0x202)](a4_0x4a1a27[_0x2c3d7a(0x1a5)](_0x2c3d7a(0x1da)+_0x44ebfd))):_0xef6ca4=_0x44ebfd;}else{if(_0x363be2)_0xef6ca4=a4_0x5c7fd4[_0x2c3d7a(0x15b)](_0x363be2),console[_0x2c3d7a(0x202)](a4_0x4a1a27[_0x2c3d7a(0x1a5)](_0x2c3d7a(0x1ca)+_0xef6ca4));else{if(_0x17d424){const _0x37c712=sanitizeForFilesystem(_0x17d424);let _0x342b28=_0x37c712,_0xe8b451=a4_0x5c7fd4['join'](process[_0x2c3d7a(0x1c9)](),_0x2c3d7a(0x1fa),_0x37c712,'tdx.json');if(!existsSync(_0xe8b451)){const _0x10cab0=normalizeName(_0x17d424),_0x44b4a9=a4_0x5c7fd4[_0x2c3d7a(0x1f3)](process['cwd'](),'agents',_0x10cab0,'tdx.json');existsSync(_0x44b4a9)&&(_0x342b28=_0x10cab0,_0xe8b451=_0x44b4a9);}if(existsSync(_0xe8b451))_0xef6ca4=a4_0x5c7fd4[_0x2c3d7a(0x15b)](_0xe8b451),console['log'](a4_0x4a1a27['dim'](_0x2c3d7a(0x1da)+_0xef6ca4));else{const _0x42c395=_0x4ff4db[_0x2c3d7a(0x152)];if(_0x42c395)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2c3d7a(0x203)+_0x17d424+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x2c3d7a(0x192)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x2c3d7a(0x1ea)+_0x17d424+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x342b28+'\x20--name\x20'+(_0xbf99d8||_0x2c3d7a(0x160))+_0x2c3d7a(0x1b9)+_0x42c395)});_0xef6ca4=_0x17d424,console[_0x2c3d7a(0x202)](a4_0x4a1a27[_0x2c3d7a(0x1a5)](_0x2c3d7a(0x1a4)+_0x17d424));}}}}if(!_0xef6ca4)return console[_0x2c3d7a(0x202)](a4_0x4a1a27[_0x2c3d7a(0x1bd)](_0x2c3d7a(0x188))),console[_0x2c3d7a(0x202)](_0x2c3d7a(0x1c3)),console[_0x2c3d7a(0x202)](_0x2c3d7a(0x1ce)),console[_0x2c3d7a(0x202)]('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console[_0x2c3d7a(0x202)](_0x2c3d7a(0x1f2)),0x1;if(!_0xbf99d8)throw new SDKError(ErrorCode[_0x2c3d7a(0x16e)],_0x2c3d7a(0x15e),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x55bb99&&!_0x5f23da){if(!isInteractive())return console[_0x2c3d7a(0x1eb)](a4_0x4a1a27['red']('\x0aError:'),_0x2c3d7a(0x1a2)),console[_0x2c3d7a(0x1eb)](a4_0x4a1a27['dim'](_0x2c3d7a(0x1d9))),0x1;const _0x5d3add=await confirmKey(_0x2c3d7a(0x195)+_0xef6ca4+'\x22\x20to\x20new\x20project\x20\x22'+_0xbf99d8+'\x22?');if(!_0x5d3add)return console[_0x2c3d7a(0x202)](a4_0x4a1a27[_0x2c3d7a(0x1bd)](_0x2c3d7a(0x18c))),0x1;}const {data:_0x1b10c7}=await withSpinner('Cloning\x20\x22'+_0xef6ca4+_0x2c3d7a(0x1f1)+_0xbf99d8+_0x2c3d7a(0x1db),()=>_0x49997e[_0x2c3d7a(0x200)]['cloneProject'](_0xef6ca4,_0xbf99d8,{'dryRun':_0x5f23da}));if(_0x5f23da){console[_0x2c3d7a(0x202)](a4_0x4a1a27[_0x2c3d7a(0x1bd)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x2c3d7a(0x202)](_0x2c3d7a(0x1ec)+_0x1b10c7[_0x2c3d7a(0x1be)]),console[_0x2c3d7a(0x202)](_0x2c3d7a(0x1a8)+_0xbf99d8),console[_0x2c3d7a(0x202)](_0x2c3d7a(0x1e5)),console['log'](_0x2c3d7a(0x173)+_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x1fa)][_0x2c3d7a(0x1d7)]),console['log'](_0x2c3d7a(0x1b3)+_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x1d6)][_0x2c3d7a(0x1d7)]),console[_0x2c3d7a(0x202)]('\x20\x20Prompts:\x20'+_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x193)][_0x2c3d7a(0x1d7)]);const _0xd4ba6b=_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x1aa)][_0x2c3d7a(0x1d7)]>0x0||_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x1c8)]['created']>0x0;return _0xd4ba6b&&(console[_0x2c3d7a(0x202)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x1b10c7['counts'][_0x2c3d7a(0x1aa)][_0x2c3d7a(0x1d7)]),console[_0x2c3d7a(0x202)](_0x2c3d7a(0x16a)+_0x1b10c7[_0x2c3d7a(0x1b5)]['experimentalArtifacts'][_0x2c3d7a(0x1d7)])),0x0;}const _0x4b452b=_0x1b10c7['counts'][_0x2c3d7a(0x1fa)][_0x2c3d7a(0x17d)]>0x0||_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x1d6)]['errors']>0x0||_0x1b10c7[_0x2c3d7a(0x1b5)]['prompts'][_0x2c3d7a(0x17d)]>0x0||_0x1b10c7[_0x2c3d7a(0x1b5)]['experimentalKnowledgeBases'][_0x2c3d7a(0x17d)]>0x0||_0x1b10c7['counts'][_0x2c3d7a(0x1c8)][_0x2c3d7a(0x17d)]>0x0;_0x4b452b?console[_0x2c3d7a(0x202)](a4_0x4a1a27[_0x2c3d7a(0x1bd)](_0x2c3d7a(0x1b2))):console[_0x2c3d7a(0x202)](a4_0x4a1a27[_0x2c3d7a(0x167)](_0x2c3d7a(0x199)));console[_0x2c3d7a(0x202)](_0x2c3d7a(0x1ec)+_0x1b10c7[_0x2c3d7a(0x1be)]),console[_0x2c3d7a(0x202)](_0x2c3d7a(0x1a8)+_0x1b10c7[_0x2c3d7a(0x168)]),console[_0x2c3d7a(0x202)](_0x2c3d7a(0x198)+_0x1b10c7[_0x2c3d7a(0x184)]),console[_0x2c3d7a(0x202)](),console[_0x2c3d7a(0x202)](_0x2c3d7a(0x175)),console[_0x2c3d7a(0x202)](_0x2c3d7a(0x173)+formatCountSummary(_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x1fa)])),console[_0x2c3d7a(0x202)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1b10c7['counts']['knowledgeBases'])),console['log'](_0x2c3d7a(0x191)+formatCountSummary(_0x1b10c7[_0x2c3d7a(0x1b5)]['prompts'])),console[_0x2c3d7a(0x202)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x18f)]));const _0x58799a=_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x1aa)]['created']>0x0||_0x1b10c7['counts'][_0x2c3d7a(0x1aa)][_0x2c3d7a(0x1df)]>0x0||_0x1b10c7['counts']['experimentalKnowledgeBases'][_0x2c3d7a(0x17c)]>0x0||_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x1c8)]['created']>0x0||_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x1c8)][_0x2c3d7a(0x1df)]>0x0||_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x1c8)][_0x2c3d7a(0x17c)]>0x0;_0x58799a&&(console[_0x2c3d7a(0x202)](_0x2c3d7a(0x1bb)+formatCountSummary(_0x1b10c7[_0x2c3d7a(0x1b5)]['experimentalKnowledgeBases'])),console[_0x2c3d7a(0x202)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x1c8)])));if(_0x4b452b){console['log'](),console[_0x2c3d7a(0x202)](a4_0x4a1a27[_0x2c3d7a(0x169)](_0x2c3d7a(0x166)));for(const _0x332c9c of _0x1b10c7[_0x2c3d7a(0x1fa)]){_0x332c9c[_0x2c3d7a(0x16d)]==='error'&&console['log'](a4_0x4a1a27[_0x2c3d7a(0x169)]('\x20\x20Agent\x20\x22'+_0x332c9c[_0x2c3d7a(0x1de)]+_0x2c3d7a(0x19d)+_0x332c9c['error']));}for(const _0xb60ac5 of _0x1b10c7['knowledgeBases']){_0xb60ac5['action']===_0x2c3d7a(0x1eb)&&console[_0x2c3d7a(0x202)](a4_0x4a1a27[_0x2c3d7a(0x169)](_0x2c3d7a(0x1ff)+_0xb60ac5[_0x2c3d7a(0x1b0)]+_0x2c3d7a(0x19d)+_0xb60ac5[_0x2c3d7a(0x1eb)]));}for(const _0x456f6f of _0x1b10c7[_0x2c3d7a(0x193)]){_0x456f6f[_0x2c3d7a(0x16d)]===_0x2c3d7a(0x1eb)&&console[_0x2c3d7a(0x202)](a4_0x4a1a27[_0x2c3d7a(0x169)]('\x20\x20Prompt\x20\x22'+_0x456f6f[_0x2c3d7a(0x1b0)]+_0x2c3d7a(0x19d)+_0x456f6f['error']));}for(const _0x6193ef of _0x1b10c7[_0x2c3d7a(0x18f)]){_0x6193ef['action']==='error'&&console['log'](a4_0x4a1a27[_0x2c3d7a(0x169)](_0x2c3d7a(0x179)+_0x6193ef[_0x2c3d7a(0x1b0)]+'\x22:\x20'+_0x6193ef[_0x2c3d7a(0x1eb)]));}for(const _0x2bce71 of _0x1b10c7[_0x2c3d7a(0x1aa)]){_0x2bce71[_0x2c3d7a(0x16d)]===_0x2c3d7a(0x1eb)&&console['log'](a4_0x4a1a27[_0x2c3d7a(0x169)](_0x2c3d7a(0x1b8)+_0x2bce71[_0x2c3d7a(0x1b0)]+_0x2c3d7a(0x19d)+_0x2bce71[_0x2c3d7a(0x1eb)]));}for(const _0x5b938b of _0x1b10c7[_0x2c3d7a(0x1c8)]){_0x5b938b[_0x2c3d7a(0x16d)]==='error'&&console['log'](a4_0x4a1a27[_0x2c3d7a(0x169)](_0x2c3d7a(0x164)+_0x5b938b[_0x2c3d7a(0x1b0)]+_0x2c3d7a(0x19d)+_0x5b938b[_0x2c3d7a(0x1eb)]));}return 0x1;}console[_0x2c3d7a(0x202)]();const _0x1729a8=getLLMProjectUrl(_0x5c9904,_0x1b10c7[_0x2c3d7a(0x184)]);return console['log'](_0x2c3d7a(0x158)+a4_0x4a1a27[_0x2c3d7a(0x1b4)](_0x1729a8)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x5044ec(0x1b0)]=a4_0x5044ec(0x16b);[a4_0x5044ec(0x1fd)]=a4_0x5044ec(0x1c2);async[a4_0x5044ec(0x1a7)](_0x32a8ae){const _0x39a7f2=a4_0x5044ec,{options:_0xede39d,args:_0x5d04e0,tdx:_0x1ed647}=_0x32a8ae;let _0x349e72=_0x5d04e0[0x0]||process[_0x39a7f2(0x1c9)]();const _0x44bec0=_0xede39d['dryRun'],_0x24476a=_0xede39d['force'],_0x20b32f=_0xede39d[_0x39a7f2(0x19f)],_0x2f3de8=_0xede39d[_0x39a7f2(0x15d)],_0x16f8ff=a4_0x5c7fd4['join'](_0x349e72,_0x39a7f2(0x165)),_0x1b514c=existsSync(_0x16f8ff);if(_0x1b514c){const {data:_0xd6a308}=await withSpinner(_0x39a7f2(0x180)+_0x349e72+_0x39a7f2(0x1db),()=>_0x1ed647['llm']['pushAgent'](_0x349e72,{'dryRun':_0x44bec0,'force':_0x24476a}));if(_0x44bec0)return console['log'](a4_0x4a1a27[_0x39a7f2(0x1bd)](_0x39a7f2(0x1e3))),console[_0x39a7f2(0x202)]('Would\x20push\x20agent:\x20'+_0xd6a308[_0x39a7f2(0x1de)]),0x0;if(_0xd6a308['action']===_0x39a7f2(0x1eb))return console[_0x39a7f2(0x202)](a4_0x4a1a27[_0x39a7f2(0x169)](_0x39a7f2(0x1e6)+_0xd6a308[_0x39a7f2(0x1eb)])),0x1;console['log'](a4_0x4a1a27[_0x39a7f2(0x167)](_0x39a7f2(0x19a)+_0xd6a308[_0x39a7f2(0x16d)]+_0x39a7f2(0x1c7))),console[_0x39a7f2(0x202)](_0x39a7f2(0x156)+_0xd6a308[_0x39a7f2(0x1de)]);if(_0xd6a308[_0x39a7f2(0x1d4)]&&_0xd6a308['projectId']){const _0x37e732=getLLMAgentChatUrl(_0x2f3de8,_0xd6a308['projectId'],_0xd6a308[_0x39a7f2(0x1d4)]);console[_0x39a7f2(0x202)](_0x39a7f2(0x1a1)+a4_0x4a1a27['cyan'](_0x37e732));}return 0x0;}const _0x2d6f4f=_0xede39d['llmProject'],_0xfbf4f9=resolveProjectFromContext(_0x349e72,_0x2d6f4f);if(_0xfbf4f9[_0x39a7f2(0x1c6)])_0x349e72=_0xfbf4f9['projectDir'],_0xfbf4f9[_0x39a7f2(0x1ee)]==='context'&&console[_0x39a7f2(0x202)](a4_0x4a1a27['dim'](_0x39a7f2(0x201)+_0x349e72));else{let _0x332af7='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0xfbf4f9[_0x39a7f2(0x1ab)]===_0x39a7f2(0x181)&&(_0x332af7=_0xfbf4f9[_0x39a7f2(0x189)]+_0x39a7f2(0x178)+_0xfbf4f9[_0x39a7f2(0x183)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xfbf4f9[_0x39a7f2(0x1ab)]===_0x39a7f2(0x1e2)?_0xfbf4f9[_0x39a7f2(0x189)]:'No\x20tdx.json\x20found\x20in\x20'+_0x349e72,undefined,{'helpText':_0x332af7});}const {data:_0x3f8f4f}=await withSpinner(_0x39a7f2(0x1f9),()=>_0x1ed647[_0x39a7f2(0x200)][_0x39a7f2(0x185)](_0x349e72,{'dryRun':!![]})),_0x5eec60=_0x3f8f4f['counts'][_0x39a7f2(0x1fa)][_0x39a7f2(0x17d)]>0x0;if(_0x5eec60){console['log'](a4_0x4a1a27[_0x39a7f2(0x169)](_0x39a7f2(0x1b7)));for(const _0x101b02 of _0x3f8f4f['agents']){_0x101b02['action']===_0x39a7f2(0x1eb)&&console['log'](a4_0x4a1a27['red'](_0x39a7f2(0x1c5)+_0x101b02['agentName']+_0x39a7f2(0x19d)+_0x101b02[_0x39a7f2(0x1eb)]));}return 0x1;}const _0x1ba934=_0x3f8f4f[_0x39a7f2(0x1b5)]['agents'][_0x39a7f2(0x1d7)]+_0x3f8f4f['counts'][_0x39a7f2(0x1d6)][_0x39a7f2(0x1d7)]+_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1ba)]['created']+_0x3f8f4f[_0x39a7f2(0x1b5)]['prompts'][_0x39a7f2(0x1d7)]+_0x3f8f4f[_0x39a7f2(0x1b5)]['integrations'][_0x39a7f2(0x1d7)]+_0x3f8f4f['counts'][_0x39a7f2(0x1aa)][_0x39a7f2(0x1d7)]+_0x3f8f4f[_0x39a7f2(0x1b5)]['experimentalArtifacts'][_0x39a7f2(0x1d7)],_0x4e7e65=_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1fa)][_0x39a7f2(0x1df)]+_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1d6)]['updated']+_0x3f8f4f['counts'][_0x39a7f2(0x1ba)][_0x39a7f2(0x1df)]+_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x193)][_0x39a7f2(0x1df)]+_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x18f)][_0x39a7f2(0x1df)]+_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1aa)][_0x39a7f2(0x1df)]+_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1c8)][_0x39a7f2(0x1df)],_0x561353=_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1fa)][_0x39a7f2(0x17c)]+_0x3f8f4f['counts']['knowledgeBases'][_0x39a7f2(0x17c)]+_0x3f8f4f['counts']['textKnowledgeBases'][_0x39a7f2(0x17c)]+_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x193)][_0x39a7f2(0x17c)]+_0x3f8f4f['counts'][_0x39a7f2(0x18f)][_0x39a7f2(0x17c)]+_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1aa)][_0x39a7f2(0x17c)]+_0x3f8f4f[_0x39a7f2(0x1b5)]['experimentalArtifacts'][_0x39a7f2(0x17c)];console[_0x39a7f2(0x202)](_0x39a7f2(0x15f)+_0x3f8f4f[_0x39a7f2(0x172)]+'\x27:'),console[_0x39a7f2(0x202)]('\x20\x20'+a4_0x4a1a27[_0x39a7f2(0x167)]('+\x20'+_0x1ba934+'\x20new')+_0x39a7f2(0x182)+a4_0x4a1a27[_0x39a7f2(0x1bd)]('~\x20'+_0x4e7e65+_0x39a7f2(0x1f4))+_0x39a7f2(0x182)+a4_0x4a1a27['dim']('=\x20'+_0x561353+_0x39a7f2(0x1d3))),console[_0x39a7f2(0x202)]('\x20\x20Agents:\x20'+formatCountSummary(_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1fa)])),console['log'](_0x39a7f2(0x1b3)+formatCountSummary(_0x3f8f4f[_0x39a7f2(0x1b5)]['knowledgeBases'])),console[_0x39a7f2(0x202)](_0x39a7f2(0x1cc)+formatCountSummary(_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1ba)])),console[_0x39a7f2(0x202)](_0x39a7f2(0x191)+formatCountSummary(_0x3f8f4f['counts'][_0x39a7f2(0x193)])),console[_0x39a7f2(0x202)](_0x39a7f2(0x1d0)+formatCountSummary(_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x18f)]));const _0xf5f2a7=_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1aa)][_0x39a7f2(0x1d7)]>0x0||_0x3f8f4f['counts'][_0x39a7f2(0x1aa)][_0x39a7f2(0x1df)]>0x0||_0x3f8f4f['counts'][_0x39a7f2(0x1aa)][_0x39a7f2(0x17c)]>0x0||_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1c8)][_0x39a7f2(0x1d7)]>0x0||_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1c8)][_0x39a7f2(0x1df)]>0x0||_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1c8)]['unchanged']>0x0;_0xf5f2a7&&(console[_0x39a7f2(0x202)](_0x39a7f2(0x1bb)+formatCountSummary(_0x3f8f4f[_0x39a7f2(0x1b5)]['experimentalKnowledgeBases'])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x3f8f4f[_0x39a7f2(0x1b5)]['experimentalArtifacts'])));console[_0x39a7f2(0x202)](_0x39a7f2(0x1e8)+a4_0x4a1a27[_0x39a7f2(0x1b4)](_0x349e72)),displayDiffs(_0x3f8f4f[_0x39a7f2(0x1fa)],_0x3f8f4f['knowledgeBases'],_0x3f8f4f[_0x39a7f2(0x1ba)],_0x3f8f4f[_0x39a7f2(0x193)],_0x3f8f4f[_0x39a7f2(0x18f)],_0x3f8f4f[_0x39a7f2(0x1aa)],_0x3f8f4f[_0x39a7f2(0x1c8)]);if(_0x44bec0)return console['log'](a4_0x4a1a27[_0x39a7f2(0x1bd)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x1ba934===0x0&&_0x4e7e65===0x0){console[_0x39a7f2(0x202)](a4_0x4a1a27[_0x39a7f2(0x167)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x2c692e=getLLMProjectUrl(_0x2f3de8,_0x3f8f4f[_0x39a7f2(0x1ac)]);return console[_0x39a7f2(0x202)](_0x39a7f2(0x158)+a4_0x4a1a27['cyan'](_0x2c692e)),0x0;}if(!_0x20b32f&&!_0x24476a){if(!isInteractive())return console[_0x39a7f2(0x1eb)](a4_0x4a1a27[_0x39a7f2(0x169)](_0x39a7f2(0x1fe)),_0x39a7f2(0x1a2)),console[_0x39a7f2(0x1eb)](a4_0x4a1a27[_0x39a7f2(0x1a5)](_0x39a7f2(0x1d9))),0x1;const _0x1b2b6e=await confirmKey('\x0aPush\x20'+(_0x1ba934+_0x4e7e65)+_0x39a7f2(0x162));if(!_0x1b2b6e)return console[_0x39a7f2(0x202)](a4_0x4a1a27[_0x39a7f2(0x1bd)](_0x39a7f2(0x18c)),_0x39a7f2(0x18e)),0x1;}const {data:_0x2a6823}=await withSpinner(_0x39a7f2(0x19c),()=>_0x1ed647[_0x39a7f2(0x200)][_0x39a7f2(0x185)](_0x349e72,{'force':_0x24476a})),_0x4cddab=_0x2a6823[_0x39a7f2(0x1b5)][_0x39a7f2(0x1fa)][_0x39a7f2(0x17d)]>0x0||_0x2a6823[_0x39a7f2(0x1b5)]['knowledgeBases']['errors']>0x0||_0x2a6823[_0x39a7f2(0x1b5)][_0x39a7f2(0x1ba)][_0x39a7f2(0x17d)]>0x0||_0x2a6823['counts'][_0x39a7f2(0x193)][_0x39a7f2(0x17d)]>0x0;if(_0x4cddab){console['log'](a4_0x4a1a27[_0x39a7f2(0x1bd)]('\x0aProject\x20pushed\x20with\x20errors')),console['log'](),console[_0x39a7f2(0x202)](a4_0x4a1a27[_0x39a7f2(0x169)](_0x39a7f2(0x166)));for(const _0x1e121c of _0x2a6823[_0x39a7f2(0x1fa)]){_0x1e121c[_0x39a7f2(0x16d)]==='error'&&console[_0x39a7f2(0x202)](a4_0x4a1a27[_0x39a7f2(0x169)](_0x39a7f2(0x1c5)+_0x1e121c[_0x39a7f2(0x1de)]+'\x22:\x20'+_0x1e121c[_0x39a7f2(0x1eb)]));}for(const _0x41c345 of _0x2a6823['knowledgeBases']){_0x41c345[_0x39a7f2(0x16d)]===_0x39a7f2(0x1eb)&&console[_0x39a7f2(0x202)](a4_0x4a1a27['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x41c345[_0x39a7f2(0x1b0)]+_0x39a7f2(0x19d)+_0x41c345[_0x39a7f2(0x1eb)]));}for(const _0x50f3d1 of _0x2a6823['textKnowledgeBases']){_0x50f3d1[_0x39a7f2(0x16d)]===_0x39a7f2(0x1eb)&&console['log'](a4_0x4a1a27[_0x39a7f2(0x169)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x50f3d1['name']+_0x39a7f2(0x19d)+_0x50f3d1[_0x39a7f2(0x1eb)]));}for(const _0x3d4222 of _0x2a6823['prompts']){_0x3d4222[_0x39a7f2(0x16d)]===_0x39a7f2(0x1eb)&&console[_0x39a7f2(0x202)](a4_0x4a1a27[_0x39a7f2(0x169)](_0x39a7f2(0x1fb)+_0x3d4222[_0x39a7f2(0x1b0)]+_0x39a7f2(0x19d)+_0x3d4222[_0x39a7f2(0x1eb)]));}for(const _0xc0be95 of _0x2a6823[_0x39a7f2(0x18f)]){_0xc0be95[_0x39a7f2(0x16d)]==='error'&&console['log'](a4_0x4a1a27[_0x39a7f2(0x169)](_0x39a7f2(0x179)+_0xc0be95['name']+'\x22:\x20'+_0xc0be95[_0x39a7f2(0x1eb)]));}return 0x1;}console[_0x39a7f2(0x202)](a4_0x4a1a27[_0x39a7f2(0x167)]('\x0a✔\x20Pushed\x20'+(_0x1ba934+_0x4e7e65)+_0x39a7f2(0x1f5)+_0x2a6823[_0x39a7f2(0x172)]+'\x27'));const _0x52f245=getLLMProjectUrl(_0x2f3de8,_0x2a6823[_0x39a7f2(0x1ac)]);return console[_0x39a7f2(0x202)](_0x39a7f2(0x158)+a4_0x4a1a27['cyan'](_0x52f245)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x3dc0f4=a5_0x45fc;(function(_0x1b5393,_0x4401c8){const _0x4797d0=a5_0x45fc,_0x5c621d=_0x1b5393();while(!![]){try{const _0xdba719=-parseInt(_0x4797d0(0x197))/0x1+-parseInt(_0x4797d0(0x195))/0x2*(-parseInt(_0x4797d0(0x185))/0x3)+-parseInt(_0x4797d0(0x1be))/0x4+-parseInt(_0x4797d0(0x171))/0x5*(parseInt(_0x4797d0(0x194))/0x6)+-parseInt(_0x4797d0(0x1ae))/0x7+parseInt(_0x4797d0(0x17d))/0x8+parseInt(_0x4797d0(0x14d))/0x9;if(_0xdba719===_0x4401c8)break;else _0x5c621d['push'](_0x5c621d['shift']());}catch(_0x54263e){_0x5c621d['push'](_0x5c621d['shift']());}}}(a5_0x5471,0xe50e0));function a5_0x45fc(_0x602d61,_0x59deee){_0x602d61=_0x602d61-0x143;const _0x54714b=a5_0x5471();let _0x45fcec=_0x54714b[_0x602d61];return _0x45fcec;}import*as a5_0x191d8 from'node:fs';import*as a5_0x46110d from'node:path';function a5_0x5471(){const _0x1cb784=['tsv','Output\x20written\x20to:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','no_context','red','Agent:\x20','\x22:\x20','multiple_agents','\x20-\x20','conversations','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Passed:\x20\x20\x20','push','basename','Round\x201/','context','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Conversation\x20URL:\x20','Running\x20test:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','✓\x20PASS:\x20','1211685FTRoHg','includes','\x20\x20Round\x20','tags','split','white','agent:test','Run\x20\x27tdx\x20agent\x20pull\x20','\x20\x20Project:\x20','has','Total:\x20\x20\x20\x20','forEach','1598984ZZgVpQ','Running\x20agent\x20tests...','New\x20tests\x20to\x20execute:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','status','tests','toLowerCase','size','4804569MmKSfs','resolveProjectId','site','PASS','stop','writeFileSync','...','utf-8','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','repeat','Available\x20tags:\x20','projectDir','timestamp','rounds','llm','30leYbYe','2DVFHib','jsonl','1667900AibOSS','\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',':\x20Sending\x20user\x20input...','Error\x20writing\x20output\x20file:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','FAIL','llmProject','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','reason','text','Test\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Either\x20switch\x20to\x20the\x20\x22','\x20(cached)','\x20\x20-\x20','Using\x20agent:\x20','json','Test\x20Configuration:','No\x20tests\x20found\x20matching:\x20','Tests\x20found:\x20','green','1262324NrMtqT','some','Run\x20tests\x20for\x20an\x20LLM\x20agent','projectName','now','message','no_local_folder','filter','yellow','source','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Evaluating\x20response...','cyan','\x20\x20Evaluating...\x20','agent','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','4019724GIeRzT','substring','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','\x20(new)','testYmlPath','no_tests','agentDirs','find','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','length','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','execute','404','agentName','not\x20found','✗\x20FAIL:\x20','resolve','Errors:\x20\x20\x20','verbose','Round\x20','toISOString','dim','\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)','test.yml','Available\x20tests:\x20','Duration:\x20','✗\x20ERROR:\x20','\x20\x20Site:\x20','table','name','dryRun','eval','Re-evaluating...','executeReeval','Re-evaluation\x20Summary','description','28814940KJCvTY','ERROR','add','Cached\x20run\x20is\x20from\x20site\x20\x22','testName','Re-evaluating\x20','join','/<agent-name>','map','...\x20','existsSync','Failed:\x20\x20\x20','conversation_url','log','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'];a5_0x5471=function(){return _0x1cb784;};return a5_0x5471();}import a5_0x142b9a from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x3dc0f4(0x146)]=a5_0x3dc0f4(0x177);[a5_0x3dc0f4(0x14c)]=a5_0x3dc0f4(0x1b0);async[a5_0x3dc0f4(0x1c9)](_0x409f74){const _0x260ad2=a5_0x3dc0f4,{options:_0x28d8b4,args:_0xaa0f2c,tdx:_0x4a5811}=_0x409f74,_0x59a2a2=_0xaa0f2c[0x0]||'.',_0x77fc04=_0x28d8b4[_0x260ad2(0x147)],_0x28f4e4=_0x28d8b4,_0x2b4237=_0x28f4e4[_0x260ad2(0x148)]===![],_0x291516=_0x28f4e4['reeval'],_0x366423=_0x28f4e4['name'],_0x3fdf61=_0x28f4e4['tags'],_0xf88064=_0x28d8b4[_0x260ad2(0x187)],_0x4036d0=_0x28f4e4['output'];if(_0x291516&&_0x2b4237)return console[_0x260ad2(0x15a)](a5_0x142b9a[_0x260ad2(0x160)](_0x260ad2(0x1b8))),0x1;let _0x13d851=_0x260ad2(0x145);if(_0x28f4e4[_0x260ad2(0x1a9)])_0x13d851=_0x260ad2(0x1a9);else{if(_0x28f4e4[_0x260ad2(0x196)])_0x13d851=_0x260ad2(0x196);else{if(_0x28f4e4[_0x260ad2(0x15c)])_0x13d851=_0x260ad2(0x15c);else{if(_0x28f4e4[_0x260ad2(0x145)])_0x13d851=_0x260ad2(0x145);}}}const _0x5a5963=_0x28f4e4[_0x260ad2(0x19e)];let _0x4bde22=_0x59a2a2;const _0x182140=a5_0x191d8[_0x260ad2(0x157)](_0x59a2a2),_0xb38dee=_0x59a2a2==='.';if(!_0x182140||_0xb38dee){const _0x4abcac=resolveProjectFromContext(_0x59a2a2,_0x5a5963,{'requireFile':_0x260ad2(0x1d5)});if(_0x4abcac['found'])_0x4bde22=_0x4abcac[_0x260ad2(0x190)],_0x4abcac[_0x260ad2(0x1b7)]===_0x260ad2(0x16b)&&console[_0x260ad2(0x15a)](a5_0x142b9a[_0x260ad2(0x1d3)](_0x260ad2(0x1a8)+_0x4bde22));else switch(_0x4abcac['reason']){case _0x260ad2(0x15f):console[_0x260ad2(0x15a)](a5_0x142b9a[_0x260ad2(0x1b6)](_0x4abcac[_0x260ad2(0x1b3)])),console[_0x260ad2(0x15a)](),console['log']('Usage:'),console['log'](_0x260ad2(0x198)),console[_0x260ad2(0x15a)](_0x260ad2(0x1d4)),console[_0x260ad2(0x15a)](),console['log'](_0x260ad2(0x19c));return 0x1;case _0x260ad2(0x1b4):console[_0x260ad2(0x15a)](a5_0x142b9a['yellow'](_0x4abcac['message'])),console['log'](),console[_0x260ad2(0x15a)](_0x260ad2(0x178)+_0x4abcac['llmProject']+_0x260ad2(0x180));return 0x1;case _0x260ad2(0x163):{const _0x591d40=a5_0x46110d[_0x260ad2(0x169)](_0x4abcac[_0x260ad2(0x190)]);console[_0x260ad2(0x15a)](a5_0x142b9a[_0x260ad2(0x1b6)](_0x260ad2(0x15b)+_0x4abcac[_0x260ad2(0x19e)]+'\x22:'));for(const _0x18d6c8 of _0x4abcac[_0x260ad2(0x1c4)]){console['log'](_0x260ad2(0x1a7)+_0x18d6c8);}return console[_0x260ad2(0x15a)](),console['log']('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x591d40+_0x260ad2(0x154)),0x1;}case _0x260ad2(0x1c3):console[_0x260ad2(0x15a)](a5_0x142b9a[_0x260ad2(0x1b6)](_0x260ad2(0x18d)+_0x4abcac[_0x260ad2(0x19e)]+'\x22.')),console[_0x260ad2(0x15a)](a5_0x142b9a[_0x260ad2(0x1d3)]('Project\x20path:\x20'+_0x4abcac[_0x260ad2(0x190)])),console['log'](),console[_0x260ad2(0x15a)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0xb92bb7,agentInfo:_0x5620b4}=parseTestFile(_0x4bde22);let _0x5af6d6=_0xb92bb7[_0x260ad2(0x182)];if(_0x366423){const _0x57b1f5=_0x366423['split'](',')['map'](_0x2cb216=>_0x2cb216['trim']());_0x5af6d6=_0xb92bb7['tests']['filter'](_0x8c8cb2=>_0x57b1f5[_0x260ad2(0x172)](_0x8c8cb2[_0x260ad2(0x146)]));if(_0x5af6d6[_0x260ad2(0x1c7)]===0x0)return console[_0x260ad2(0x15a)](a5_0x142b9a[_0x260ad2(0x1b6)](_0x260ad2(0x1ab)+_0x366423)),console[_0x260ad2(0x15a)](a5_0x142b9a[_0x260ad2(0x1d3)](_0x260ad2(0x1d6)+_0xb92bb7['tests'][_0x260ad2(0x155)](_0x5dd9a5=>_0x5dd9a5['name'])[_0x260ad2(0x153)](',\x20'))),0x1;}if(_0x3fdf61){const _0x83daa5=_0x3fdf61[_0x260ad2(0x175)](',')[_0x260ad2(0x155)](_0xb3a762=>_0xb3a762['trim']()['toLowerCase']());_0x5af6d6=_0x5af6d6[_0x260ad2(0x1b5)](_0x3f81da=>_0x3f81da[_0x260ad2(0x174)]?.[_0x260ad2(0x1af)](_0x70c33b=>_0x83daa5[_0x260ad2(0x172)](_0x70c33b[_0x260ad2(0x183)]())));if(_0x5af6d6[_0x260ad2(0x1c7)]===0x0){console[_0x260ad2(0x15a)](a5_0x142b9a['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x3fdf61));const _0x5acd0b=new Set();return _0xb92bb7[_0x260ad2(0x182)][_0x260ad2(0x17c)](_0x1872b6=>_0x1872b6['tags']?.[_0x260ad2(0x17c)](_0x351135=>_0x5acd0b[_0x260ad2(0x14f)](_0x351135))),_0x5acd0b[_0x260ad2(0x184)]>0x0?console[_0x260ad2(0x15a)](a5_0x142b9a[_0x260ad2(0x1d3)](_0x260ad2(0x18f)+[..._0x5acd0b][_0x260ad2(0x153)](',\x20'))):console[_0x260ad2(0x15a)](a5_0x142b9a[_0x260ad2(0x1d3)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x291516)return this[_0x260ad2(0x14a)](_0x409f74,{'definition':{'tests':_0x5af6d6},'agentInfo':_0x5620b4,'outputFormat':_0x13d851,'outputFile':_0x4036d0,'testNames':_0x366423});if(_0x77fc04){console[_0x260ad2(0x15a)](a5_0x142b9a[_0x260ad2(0x1ba)](_0x260ad2(0x1aa))),console[_0x260ad2(0x15a)](_0x260ad2(0x144)+a5_0x142b9a[_0x260ad2(0x176)](_0xf88064)),console[_0x260ad2(0x15a)](_0x260ad2(0x179)+a5_0x142b9a[_0x260ad2(0x176)](_0x5620b4[_0x260ad2(0x1b1)])),console[_0x260ad2(0x15a)]('\x20\x20Agent:\x20'+a5_0x142b9a[_0x260ad2(0x176)](_0x5620b4[_0x260ad2(0x1cb)])),console[_0x260ad2(0x15a)](),console[_0x260ad2(0x15a)](_0x260ad2(0x1ac)+a5_0x142b9a[_0x260ad2(0x176)](_0x5af6d6[_0x260ad2(0x1c7)]));for(let _0x38b681=0x0;_0x38b681<_0x5af6d6[_0x260ad2(0x1c7)];_0x38b681++){const _0x4e7c37=_0x5af6d6[_0x38b681],_0x11536d=_0x4e7c37['rounds']['length']===0x1?'round':'rounds',_0x4edac9=_0x4e7c37[_0x260ad2(0x174)]?.[_0x260ad2(0x1c7)]?'\x20['+_0x4e7c37[_0x260ad2(0x174)][_0x260ad2(0x153)](',\x20')+']':'';console['log']('\x20\x20'+(_0x38b681+0x1)+'.\x20'+a5_0x142b9a[_0x260ad2(0x176)](_0x4e7c37[_0x260ad2(0x146)])+'\x20('+_0x4e7c37[_0x260ad2(0x192)][_0x260ad2(0x1c7)]+'\x20'+_0x11536d+')'+a5_0x142b9a[_0x260ad2(0x1d3)](_0x4edac9));}return 0x0;}let _0xf3a964,_0x574aaa;try{_0xf3a964=await _0x4a5811['llm'][_0x260ad2(0x186)](_0x5620b4['projectName']);}catch(_0x945be0){const _0x260887=_0x945be0 instanceof Error?_0x945be0[_0x260ad2(0x1b3)]:String(_0x945be0);return _0x260887[_0x260ad2(0x172)](_0x260ad2(0x1ca))||_0x260887[_0x260ad2(0x183)]()['includes']('not\x20found')?console[_0x260ad2(0x15a)](a5_0x142b9a[_0x260ad2(0x160)](_0x260ad2(0x1a4)+_0x5620b4['projectName'])):console[_0x260ad2(0x15a)](a5_0x142b9a[_0x260ad2(0x160)](_0x260ad2(0x19f)+_0x5620b4['projectName']+'\x22:\x20'+_0x260887)),0x1;}try{_0x574aaa=await _0x4a5811[_0x260ad2(0x193)]['resolveAgentId'](_0x5620b4[_0x260ad2(0x1cb)],_0xf3a964);}catch(_0x320dea){const _0x27629b=_0x320dea instanceof Error?_0x320dea[_0x260ad2(0x1b3)]:String(_0x320dea);return _0x27629b[_0x260ad2(0x172)]('404')||_0x27629b[_0x260ad2(0x183)]()[_0x260ad2(0x172)](_0x260ad2(0x1cc))?console[_0x260ad2(0x15a)](a5_0x142b9a[_0x260ad2(0x160)](_0x260ad2(0x1bd)+_0x5620b4[_0x260ad2(0x1cb)])):console[_0x260ad2(0x15a)](a5_0x142b9a[_0x260ad2(0x160)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x5620b4[_0x260ad2(0x1cb)]+_0x260ad2(0x162)+_0x27629b)),0x1;}let _0x47c173;if(!_0x2b4237)try{_0x47c173=await setupEvaluatorAgent(_0x4a5811[_0x260ad2(0x193)],_0x28d8b4[_0x260ad2(0x1d0)]);}catch(_0x416f20){const _0x13bbef=_0x416f20 instanceof Error?_0x416f20[_0x260ad2(0x1b3)]:String(_0x416f20);return console['log'](a5_0x142b9a['red'](_0x260ad2(0x15e)+_0x13bbef)),0x1;}console[_0x260ad2(0x15a)](a5_0x142b9a[_0x260ad2(0x1ba)](_0x260ad2(0x17e))),console[_0x260ad2(0x15a)]('Site:\x20'+a5_0x142b9a['white'](_0xf88064)),console['log'](_0x260ad2(0x161)+a5_0x142b9a[_0x260ad2(0x176)](_0x5620b4[_0x260ad2(0x1b1)]+'/'+_0x5620b4[_0x260ad2(0x1cb)])),console[_0x260ad2(0x15a)]();const _0x2b88b9=[],_0x4a57fb=[],_0x3eff84=Date[_0x260ad2(0x1b2)]();for(let _0x5097cc=0x0;_0x5097cc<_0x5af6d6['length'];_0x5097cc++){const _0x1a2904=_0x5af6d6[_0x5097cc];_0x5af6d6[_0x260ad2(0x1c7)]>0x1?console['log'](_0x260ad2(0x1a3)+(_0x5097cc+0x1)+'/'+_0x5af6d6[_0x260ad2(0x1c7)]+':\x20'+a5_0x142b9a['white'](_0x1a2904[_0x260ad2(0x146)])):console['log'](_0x260ad2(0x16e)+a5_0x142b9a[_0x260ad2(0x176)](_0x1a2904['name']));const _0x154963=createCommandSpinner(_0x260ad2(0x16a)+_0x1a2904[_0x260ad2(0x192)][_0x260ad2(0x1c7)]+':\x20Sending\x20user\x20input...');_0x154963['start']();try{const {result:_0x49c67e,conversation:_0x122784}=await runTest(_0x4a5811[_0x260ad2(0x193)],_0x1a2904,{'agentId':_0x574aaa,'projectId':_0xf3a964,'site':_0xf88064,'noEval':_0x2b4237,'evaluatorId':_0x47c173,'onRoundStart':(_0x5e032a,_0x36a8f1)=>{const _0x14cfac=_0x260ad2;_0x154963[_0x14cfac(0x1a2)]=_0x14cfac(0x1d1)+(_0x5e032a+0x1)+'/'+_0x36a8f1+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x307a2d,_0x4ff25,_0x55d0d0)=>{const _0xd1cecc=_0x260ad2,_0x76be2a=formatElapsed(_0x4ff25);_0x55d0d0?console[_0xd1cecc(0x15a)]('\x20\x20Round\x20'+(_0x307a2d+0x1)+'/'+_0x1a2904[_0xd1cecc(0x192)][_0xd1cecc(0x1c7)]+'...\x20'+a5_0x142b9a['green']('✓')+'\x20('+_0x76be2a+')'):console[_0xd1cecc(0x15a)](_0xd1cecc(0x173)+(_0x307a2d+0x1)+'/'+_0x1a2904['rounds']['length']+_0xd1cecc(0x156)+a5_0x142b9a['red']('✗'));},'onEvaluationStart':()=>{const _0x25cf7c=_0x260ad2;_0x154963[_0x25cf7c(0x1a2)]=_0x25cf7c(0x1b9);},'onEvaluationComplete':_0x12d51c=>{const _0x3f49c6=_0x260ad2,_0x1d15fd=formatElapsed(_0x12d51c);console[_0x3f49c6(0x15a)](_0x3f49c6(0x1bb)+a5_0x142b9a[_0x3f49c6(0x1ad)]('✓')+'\x20('+_0x1d15fd+')');}});_0x154963[_0x260ad2(0x189)](),_0x2b88b9['push'](_0x49c67e),_0x4a57fb['push'](_0x122784);if(_0x49c67e[_0x260ad2(0x181)]==='PASS')console[_0x260ad2(0x15a)](a5_0x142b9a[_0x260ad2(0x1ad)](_0x260ad2(0x170)+_0x49c67e['reason']));else _0x49c67e[_0x260ad2(0x181)]==='FAIL'?console[_0x260ad2(0x15a)](a5_0x142b9a[_0x260ad2(0x160)]('✗\x20FAIL:\x20'+_0x49c67e[_0x260ad2(0x1a1)])):console['log'](a5_0x142b9a[_0x260ad2(0x160)](_0x260ad2(0x143)+_0x49c67e[_0x260ad2(0x1a1)]));_0x49c67e[_0x260ad2(0x159)]&&console[_0x260ad2(0x15a)](a5_0x142b9a[_0x260ad2(0x1d3)](_0x260ad2(0x16d)+_0x49c67e[_0x260ad2(0x159)])),console[_0x260ad2(0x15a)]();}catch(_0x42ef5a){_0x154963[_0x260ad2(0x189)]();const _0xe5886f=_0x42ef5a instanceof Error?_0x42ef5a[_0x260ad2(0x1b3)]:String(_0x42ef5a);console[_0x260ad2(0x15a)](a5_0x142b9a[_0x260ad2(0x160)](_0x260ad2(0x143)+_0xe5886f)),console[_0x260ad2(0x15a)](),_0x2b88b9[_0x260ad2(0x168)]({'name':_0x1a2904[_0x260ad2(0x146)],'status':'ERROR','reason':_0xe5886f,'timestamp':new Date()[_0x260ad2(0x1d2)](),'duration_ms':0x0});}}const _0x1b084a=Date[_0x260ad2(0x1b2)]()-_0x3eff84,_0x14dce3=_0x2b88b9[_0x260ad2(0x1b5)](_0x5429a5=>_0x5429a5[_0x260ad2(0x181)]==='PASS')[_0x260ad2(0x1c7)],_0x587a6c=_0x2b88b9[_0x260ad2(0x1b5)](_0x1bfa75=>_0x1bfa75[_0x260ad2(0x181)]===_0x260ad2(0x19d))[_0x260ad2(0x1c7)],_0xd3e01b=_0x2b88b9[_0x260ad2(0x1b5)](_0x44be76=>_0x44be76[_0x260ad2(0x181)]===_0x260ad2(0x14e))[_0x260ad2(0x1c7)];console[_0x260ad2(0x15a)]('━'[_0x260ad2(0x18e)](0x3c)),console[_0x260ad2(0x15a)]('Test\x20Summary'),console['log']('━'[_0x260ad2(0x18e)](0x3c)),console['log'](_0x260ad2(0x17b)+_0x2b88b9[_0x260ad2(0x1c7)]),console[_0x260ad2(0x15a)](_0x260ad2(0x167)+a5_0x142b9a[_0x260ad2(0x1ad)](_0x14dce3)),console['log'](_0x260ad2(0x158)+a5_0x142b9a['red'](_0x587a6c));_0xd3e01b>0x0&&console[_0x260ad2(0x15a)](_0x260ad2(0x1cf)+a5_0x142b9a[_0x260ad2(0x160)](_0xd3e01b));console[_0x260ad2(0x15a)](_0x260ad2(0x1d7)+formatElapsed(_0x1b084a)),console[_0x260ad2(0x15a)]('━'[_0x260ad2(0x18e)](0x3c));const _0xee407=_0x2b88b9[_0x260ad2(0x1b5)](_0x23fe84=>_0x23fe84[_0x260ad2(0x181)]!==_0x260ad2(0x188));if(_0xee407[_0x260ad2(0x1c7)]>0x0){console['log'](),console[_0x260ad2(0x15a)]('Failed\x20Tests:');for(const _0x1e53b2 of _0xee407){const _0x6e3307=a5_0x142b9a['red']('✗'),_0x2495f6=_0x1e53b2[_0x260ad2(0x1a1)][_0x260ad2(0x1c7)]>0x32?_0x1e53b2[_0x260ad2(0x1a1)][_0x260ad2(0x1bf)](0x0,0x32)+_0x260ad2(0x18b):_0x1e53b2[_0x260ad2(0x1a1)];console[_0x260ad2(0x15a)]('\x20\x20'+_0x6e3307+'\x20'+_0x1e53b2['name']+':\x20'+_0x2495f6);}}const _0x2682dd={'summary':{'total':_0x2b88b9[_0x260ad2(0x1c7)],'passed':_0x14dce3,'failed':_0x587a6c,'errors':_0xd3e01b>0x0?_0xd3e01b:undefined,'duration_ms':_0x1b084a},'tests':_0x2b88b9,'agent':{'project':_0x5620b4[_0x260ad2(0x1b1)],'name':_0x5620b4['agentName'],'site':_0xf88064},'timestamp':new Date(_0x3eff84)['toISOString']()};try{const _0x423003=buildCachedTestRun(_0x4a57fb,{'site':_0xf88064,'projectId':_0xf3a964,'projectName':_0x5620b4[_0x260ad2(0x1b1)],'agentId':_0x574aaa,'agentName':_0x5620b4['agentName'],'testYmlPath':a5_0x46110d[_0x260ad2(0x1ce)](_0x5620b4[_0x260ad2(0x1c2)])});saveLastTestRun(_0x423003);}catch{}if(_0x13d851!==_0x260ad2(0x145)||_0x4036d0){const _0x438314=formatResults(_0x2682dd,_0x13d851);if(_0x4036d0)try{a5_0x191d8[_0x260ad2(0x18a)](_0x4036d0,_0x438314,_0x260ad2(0x18c)),console['log'](),console[_0x260ad2(0x15a)](a5_0x142b9a[_0x260ad2(0x1d3)](_0x260ad2(0x15d)+_0x4036d0));}catch(_0x408170){return console[_0x260ad2(0x15a)](),console[_0x260ad2(0x15a)](a5_0x142b9a[_0x260ad2(0x160)](_0x260ad2(0x19a)+_0x408170)),0x1;}else console[_0x260ad2(0x15a)](),console[_0x260ad2(0x15a)](_0x438314);}return _0xee407[_0x260ad2(0x1c7)]>0x0?0x1:0x0;}async[a5_0x3dc0f4(0x14a)](_0x552518,_0x1fea80){const _0x23c982=a5_0x3dc0f4,{options:_0x36e405,tdx:_0x492b64}=_0x552518,{definition:_0x1a1dfb,agentInfo:_0x2371cf,outputFormat:_0x40e695,outputFile:_0x4689b9}=_0x1fea80,_0x2407dd=_0x36e405[_0x23c982(0x187)],_0xeef832=loadLastTestRun();if(!_0xeef832)return console[_0x23c982(0x15a)](a5_0x142b9a['red']('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x23c982(0x15a)](a5_0x142b9a[_0x23c982(0x1d3)](_0x23c982(0x1a0))),0x1;if(_0xeef832[_0x23c982(0x1bc)]['agentName']!==_0x2371cf['agentName'])return console[_0x23c982(0x15a)](a5_0x142b9a[_0x23c982(0x160)](_0x23c982(0x1c8)+_0xeef832[_0x23c982(0x1bc)][_0x23c982(0x1cb)]+_0x23c982(0x16c)+_0x2371cf[_0x23c982(0x1cb)]+'\x22.')),console[_0x23c982(0x15a)](a5_0x142b9a[_0x23c982(0x1d3)](_0x23c982(0x1c0))),0x1;const _0x2b3f45=new Set(_0xeef832[_0x23c982(0x165)][_0x23c982(0x155)](_0x2d2542=>_0x2d2542[_0x23c982(0x151)])),_0x37a047=_0x1a1dfb[_0x23c982(0x182)][_0x23c982(0x1b5)](_0x504790=>!_0x2b3f45[_0x23c982(0x17a)](_0x504790['name']));if(_0x37a047[_0x23c982(0x1c7)]>0x0&&_0xeef832[_0x23c982(0x187)]!==_0x2407dd)return console[_0x23c982(0x15a)](a5_0x142b9a[_0x23c982(0x160)](_0x23c982(0x166))),console[_0x23c982(0x15a)](a5_0x142b9a[_0x23c982(0x1d3)](_0x23c982(0x150)+_0xeef832['site']+_0x23c982(0x19b)+_0x2407dd+'\x22.')),console[_0x23c982(0x15a)](a5_0x142b9a[_0x23c982(0x1d3)](_0x23c982(0x1a5)+_0xeef832['site']+_0x23c982(0x1c6))),0x1;const _0x3154ce=_0x1a1dfb['tests'][_0x23c982(0x1b5)](_0x171e7b=>_0x2b3f45['has'](_0x171e7b[_0x23c982(0x146)])),_0x47f662=_0x37a047;let _0x351168;try{_0x351168=await setupEvaluatorAgent(_0x492b64['llm'],_0x36e405['verbose']);}catch(_0x248103){const _0x3d1442=_0x248103 instanceof Error?_0x248103[_0x23c982(0x1b3)]:String(_0x248103);return console[_0x23c982(0x15a)](a5_0x142b9a[_0x23c982(0x160)](_0x23c982(0x15e)+_0x3d1442)),0x1;}console['log'](a5_0x142b9a[_0x23c982(0x1ba)]('Re-evaluating\x20cached\x20test\x20run...')),console['log']('Cached\x20run\x20from:\x20'+a5_0x142b9a[_0x23c982(0x176)](_0xeef832[_0x23c982(0x191)])),console[_0x23c982(0x15a)]('Agent:\x20'+a5_0x142b9a['white'](_0xeef832[_0x23c982(0x1bc)][_0x23c982(0x1b1)]+'/'+_0xeef832[_0x23c982(0x1bc)][_0x23c982(0x1cb)]));_0x47f662[_0x23c982(0x1c7)]>0x0&&console['log'](_0x23c982(0x17f)+a5_0x142b9a['yellow'](_0x47f662[_0x23c982(0x1c7)]));console[_0x23c982(0x15a)]();const _0x2fedeb=[],_0x25f4df=Date['now'](),_0x467ebe=createCommandSpinner(_0x23c982(0x149));if(_0x3154ce[_0x23c982(0x1c7)]>0x0)try{const _0x5f074b=await reevaluateFromCache(_0x492b64['llm'],_0xeef832,{'tests':_0x3154ce},{'evaluatorId':_0x351168,'onTestStart':(_0x2a03a3,_0x4e288b,_0x247ec2)=>{const _0x572e0f=_0x23c982;_0x467ebe['text']=_0x572e0f(0x152)+(_0x4e288b+0x1)+'/'+_0x247ec2+':\x20'+_0x2a03a3+_0x572e0f(0x18b);if(!_0x467ebe['isSpinning'])_0x467ebe['start']();},'onTestComplete':(_0x20fd23,_0x1f9ea5)=>{const _0x506a75=_0x23c982;_0x467ebe[_0x506a75(0x189)]();if(_0x1f9ea5[_0x506a75(0x181)]===_0x506a75(0x188))console[_0x506a75(0x15a)](a5_0x142b9a[_0x506a75(0x1ad)](_0x506a75(0x170)+_0x20fd23)+a5_0x142b9a['dim'](_0x506a75(0x1a6)));else _0x1f9ea5[_0x506a75(0x181)]==='FAIL'?console[_0x506a75(0x15a)](a5_0x142b9a[_0x506a75(0x160)](_0x506a75(0x1cd)+_0x20fd23+_0x506a75(0x164)+_0x1f9ea5[_0x506a75(0x1a1)])+a5_0x142b9a[_0x506a75(0x1d3)]('\x20(cached)')):console['log'](a5_0x142b9a['red'](_0x506a75(0x143)+_0x20fd23+'\x20-\x20'+_0x1f9ea5[_0x506a75(0x1a1)]));_0x1f9ea5['conversation_url']&&console[_0x506a75(0x15a)](a5_0x142b9a['dim']('\x20\x20Conversation:\x20'+_0x1f9ea5['conversation_url'])),_0x2fedeb[_0x506a75(0x168)](_0x1f9ea5);},'onTestSkipped':(_0xb4b685,_0x367c84)=>{const _0x55234b=_0x23c982;_0x467ebe['stop'](),console[_0x55234b(0x15a)](a5_0x142b9a[_0x55234b(0x1b6)]('⚠\x20SKIPPED:\x20'+_0xb4b685+_0x55234b(0x164)+_0x367c84));}});for(const _0x3f4513 of _0x5f074b){!_0x2fedeb[_0x23c982(0x1c5)](_0x8ceeae=>_0x8ceeae[_0x23c982(0x146)]===_0x3f4513['name'])&&_0x2fedeb[_0x23c982(0x168)](_0x3f4513);}}catch(_0x3dfbfb){_0x467ebe[_0x23c982(0x189)]();const _0x5a148f=_0x3dfbfb instanceof Error?_0x3dfbfb[_0x23c982(0x1b3)]:String(_0x3dfbfb);return console[_0x23c982(0x15a)](a5_0x142b9a[_0x23c982(0x160)](_0x23c982(0x16f)+_0x5a148f)),0x1;}_0x467ebe['stop']();if(_0x47f662[_0x23c982(0x1c7)]>0x0){console[_0x23c982(0x15a)](),console[_0x23c982(0x15a)](a5_0x142b9a[_0x23c982(0x1ba)]('Executing\x20new\x20tests...'));const {projectId:_0x3c230a,agentId:_0x3064dd}=_0xeef832[_0x23c982(0x1bc)];for(const _0x19d002 of _0x47f662){console[_0x23c982(0x15a)]('Running:\x20'+a5_0x142b9a[_0x23c982(0x176)](_0x19d002['name']));const _0x582204=createCommandSpinner(_0x23c982(0x16a)+_0x19d002[_0x23c982(0x192)][_0x23c982(0x1c7)]+_0x23c982(0x199));_0x582204['start']();try{const {result:_0x39a056}=await runTest(_0x492b64[_0x23c982(0x193)],_0x19d002,{'agentId':_0x3064dd,'projectId':_0x3c230a,'site':_0xeef832['site'],'noEval':![],'evaluatorId':_0x351168,'onRoundStart':(_0x3a607e,_0x5855cb)=>{const _0x1d0949=_0x23c982;_0x582204[_0x1d0949(0x1a2)]='Round\x20'+(_0x3a607e+0x1)+'/'+_0x5855cb+_0x1d0949(0x199);},'onRoundComplete':(_0x228e75,_0x55ed74,_0x4bbc5c)=>{const _0x3bdd49=_0x23c982,_0x484af9=formatElapsed(_0x55ed74);_0x4bbc5c?console['log']('\x20\x20Round\x20'+(_0x228e75+0x1)+'/'+_0x19d002['rounds'][_0x3bdd49(0x1c7)]+'...\x20'+a5_0x142b9a[_0x3bdd49(0x1ad)]('✓')+'\x20('+_0x484af9+')'):console[_0x3bdd49(0x15a)](_0x3bdd49(0x173)+(_0x228e75+0x1)+'/'+_0x19d002['rounds']['length']+_0x3bdd49(0x156)+a5_0x142b9a[_0x3bdd49(0x160)]('✗'));},'onEvaluationStart':()=>{const _0x1caa9d=_0x23c982;_0x582204[_0x1caa9d(0x1a2)]=_0x1caa9d(0x1b9);},'onEvaluationComplete':_0x4a108c=>{const _0x555f8e=_0x23c982,_0x14357f=formatElapsed(_0x4a108c);console[_0x555f8e(0x15a)](_0x555f8e(0x1bb)+a5_0x142b9a['green']('✓')+'\x20('+_0x14357f+')');}});_0x582204['stop'](),_0x2fedeb['push'](_0x39a056);if(_0x39a056[_0x23c982(0x181)]===_0x23c982(0x188))console[_0x23c982(0x15a)](a5_0x142b9a[_0x23c982(0x1ad)](_0x23c982(0x170)+_0x39a056['reason'])+a5_0x142b9a[_0x23c982(0x1d3)]('\x20(new)'));else _0x39a056[_0x23c982(0x181)]===_0x23c982(0x19d)?console[_0x23c982(0x15a)](a5_0x142b9a[_0x23c982(0x160)](_0x23c982(0x1cd)+_0x39a056[_0x23c982(0x1a1)])+a5_0x142b9a[_0x23c982(0x1d3)](_0x23c982(0x1c1))):console[_0x23c982(0x15a)](a5_0x142b9a['red'](_0x23c982(0x143)+_0x39a056[_0x23c982(0x1a1)]));_0x39a056['conversation_url']&&console['log'](a5_0x142b9a[_0x23c982(0x1d3)]('\x20\x20Conversation:\x20'+_0x39a056['conversation_url']));}catch(_0x5ce424){_0x582204[_0x23c982(0x189)]();const _0x4b5e42=_0x5ce424 instanceof Error?_0x5ce424['message']:String(_0x5ce424);console[_0x23c982(0x15a)](a5_0x142b9a[_0x23c982(0x160)](_0x23c982(0x143)+_0x4b5e42)),_0x2fedeb[_0x23c982(0x168)]({'name':_0x19d002['name'],'status':'ERROR','reason':_0x4b5e42,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console['log']();const _0x23ab12=Date[_0x23c982(0x1b2)]()-_0x25f4df,_0xc901c4=_0x2fedeb[_0x23c982(0x1b5)](_0x496d46=>_0x496d46['status']===_0x23c982(0x188))[_0x23c982(0x1c7)],_0x56ca43=_0x2fedeb[_0x23c982(0x1b5)](_0x5de069=>_0x5de069[_0x23c982(0x181)]===_0x23c982(0x19d))['length'],_0x55b0ab=_0x2fedeb[_0x23c982(0x1b5)](_0x2af94c=>_0x2af94c[_0x23c982(0x181)]===_0x23c982(0x14e))[_0x23c982(0x1c7)];console['log']('━'['repeat'](0x3c)),console['log'](_0x23c982(0x14b)),console[_0x23c982(0x15a)]('━'[_0x23c982(0x18e)](0x3c)),console[_0x23c982(0x15a)](_0x23c982(0x17b)+_0x2fedeb['length']),console[_0x23c982(0x15a)]('Passed:\x20\x20\x20'+a5_0x142b9a['green'](_0xc901c4)),console[_0x23c982(0x15a)]('Failed:\x20\x20\x20'+a5_0x142b9a[_0x23c982(0x160)](_0x56ca43));_0x55b0ab>0x0&&console[_0x23c982(0x15a)](_0x23c982(0x1cf)+a5_0x142b9a['red'](_0x55b0ab));console[_0x23c982(0x15a)]('Duration:\x20'+formatElapsed(_0x23ab12)),console[_0x23c982(0x15a)]('━'[_0x23c982(0x18e)](0x3c));const _0x355814={'summary':{'total':_0x2fedeb['length'],'passed':_0xc901c4,'failed':_0x56ca43,'errors':_0x55b0ab>0x0?_0x55b0ab:undefined,'duration_ms':_0x23ab12},'tests':_0x2fedeb,'agent':{'project':_0x2371cf[_0x23c982(0x1b1)],'name':_0x2371cf[_0x23c982(0x1cb)],'site':_0x2407dd},'timestamp':new Date(_0x25f4df)[_0x23c982(0x1d2)]()};if(_0x40e695!=='table'||_0x4689b9){const _0x523d7a=formatResults(_0x355814,_0x40e695);if(_0x4689b9)try{a5_0x191d8[_0x23c982(0x18a)](_0x4689b9,_0x523d7a,_0x23c982(0x18c)),console[_0x23c982(0x15a)](),console[_0x23c982(0x15a)](a5_0x142b9a[_0x23c982(0x1d3)](_0x23c982(0x15d)+_0x4689b9));}catch(_0x484b03){return console['log'](),console[_0x23c982(0x15a)](a5_0x142b9a[_0x23c982(0x160)]('Error\x20writing\x20output\x20file:\x20'+_0x484b03)),0x1;}else console[_0x23c982(0x15a)](),console[_0x23c982(0x15a)](_0x523d7a);}const _0x814caa=_0x2fedeb[_0x23c982(0x1b5)](_0x2454ac=>_0x2454ac[_0x23c982(0x181)]!=='PASS');return _0x814caa[_0x23c982(0x1c7)]>0x0?0x1:0x0;}}
1
+ const a5_0x1a4011=a5_0x5385;(function(_0x1dac9d,_0x128495){const _0x2b0ed5=a5_0x5385,_0x361afd=_0x1dac9d();while(!![]){try{const _0x4a7c70=parseInt(_0x2b0ed5(0x171))/0x1+-parseInt(_0x2b0ed5(0x190))/0x2+-parseInt(_0x2b0ed5(0x1b8))/0x3*(-parseInt(_0x2b0ed5(0x19c))/0x4)+-parseInt(_0x2b0ed5(0x16b))/0x5*(-parseInt(_0x2b0ed5(0x1a9))/0x6)+parseInt(_0x2b0ed5(0x1dd))/0x7*(-parseInt(_0x2b0ed5(0x1c6))/0x8)+-parseInt(_0x2b0ed5(0x1f5))/0x9+parseInt(_0x2b0ed5(0x1a3))/0xa;if(_0x4a7c70===_0x128495)break;else _0x361afd['push'](_0x361afd['shift']());}catch(_0x3cca98){_0x361afd['push'](_0x361afd['shift']());}}}(a5_0x7157,0x2fbab));function a5_0x7157(){const _0x3fb487=['dim',':\x20Sending\x20user\x20input...','6AHyvjP','Round\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Evaluating\x20response...','has','now','testName','/<agent-name>','No\x20tests\x20have\x20tags\x20defined.','red','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Available\x20tags:\x20','\x20(cached)','toLowerCase','Output\x20written\x20to:\x20','6KQeVai','Cached\x20run\x20is\x20from\x20site\x20\x22','white','Re-evaluation\x20Summary','executeReeval','log','Running\x20test:\x20','\x20\x20Conversation:\x20','Duration:\x20','not\x20found','\x20-\x20','rounds','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','llm','104wpwILc','tags','filter','resolve','Run\x20\x27tdx\x20agent\x20pull\x20','agentDirs','found','Error\x20writing\x20output\x20file:\x20','No\x20tests\x20found\x20matching:\x20','Failed\x20Tests:','\x22,\x20but\x20current\x20site\x20is\x20\x22','FAIL','reeval','conversations','round','PASS','Project\x20path:\x20','find','verbose','agent','green','toISOString','...\x20','2443WUBMGp','json','substring','Running\x20agent\x20tests...','isSpinning','repeat','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','message','\x20\x20-\x20','writeFileSync','name','\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)','table','Run\x20tests\x20for\x20an\x20LLM\x20agent','Executing\x20new\x20tests...','size','some','✓\x20PASS:\x20','Total:\x20\x20\x20\x20','resolveAgentId','timestamp','join','add','\x20\x20Round\x20','3042378VxReWE','test.yml','status','tsv','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','length','\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','conversation_url','Cached\x20run\x20from:\x20','New\x20tests\x20to\x20execute:\x20','\x20(new)','yellow','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','agent:test','Test\x20Configuration:','ERROR','includes','tests','\x20\x20Agent:\x20','Agent:\x20','dryRun','basename','792415OILVGO','Tests\x20found:\x20','split','reason','no_context','cyan','18812FbkkeB','existsSync','Round\x201/','\x20\x20Evaluating...\x20','projectName','Using\x20agent:\x20','\x22:\x20','agentName','Conversation\x20URL:\x20','trim','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','no_tests','✗\x20ERROR:\x20','testYmlPath','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','stop','utf-8','Test\x20','Running:\x20','description','Available\x20tests:\x20','llmProject','404','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','map','start','Either\x20switch\x20to\x20the\x20\x22','Site:\x20','Usage:','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','256564pRprPP','forEach','push','execute','Error:\x20No\x20previous\x20test\x20run\x20found.','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','context','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','multiple_agents','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','text','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','108096eLsIxQ','output','Test\x20Summary','projectDir','Failed:\x20\x20\x20','...','jsonl','4350170BEQnnP','Passed:\x20\x20\x20','site','✗\x20FAIL:\x20'];a5_0x7157=function(){return _0x3fb487;};return a5_0x7157();}import*as a5_0xb6ee80 from'node:fs';import*as a5_0x4f828f from'node:path';function a5_0x5385(_0x5a054,_0x524705){_0x5a054=_0x5a054-0x156;const _0x7157d1=a5_0x7157();let _0x5385c7=_0x7157d1[_0x5a054];return _0x5385c7;}import a5_0x2fb5d0 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x1a4011(0x1e7)]=a5_0x1a4011(0x162);[a5_0x1a4011(0x184)]=a5_0x1a4011(0x1ea);async[a5_0x1a4011(0x193)](_0x39df46){const _0x1b6575=a5_0x1a4011,{options:_0x4d2fe3,args:_0x1cf9ef,tdx:_0x58e263}=_0x39df46,_0x48eec4=_0x1cf9ef[0x0]||'.',_0x441862=_0x4d2fe3[_0x1b6575(0x169)],_0x3a38db=_0x4d2fe3,_0xc6b0e4=_0x3a38db['eval']===![],_0x14b7a1=_0x3a38db[_0x1b6575(0x1d2)],_0x378a19=_0x3a38db[_0x1b6575(0x1e7)],_0x5dd44f=_0x3a38db[_0x1b6575(0x1c7)],_0x363548=_0x4d2fe3[_0x1b6575(0x1a5)],_0x285f38=_0x3a38db[_0x1b6575(0x19d)];if(_0x14b7a1&&_0xc6b0e4)return console['log'](a5_0x2fb5d0[_0x1b6575(0x1b2)](_0x1b6575(0x1b3))),0x1;let _0x40e66d=_0x1b6575(0x1e9);if(_0x3a38db[_0x1b6575(0x1de)])_0x40e66d=_0x1b6575(0x1de);else{if(_0x3a38db[_0x1b6575(0x1a2)])_0x40e66d=_0x1b6575(0x1a2);else{if(_0x3a38db[_0x1b6575(0x158)])_0x40e66d=_0x1b6575(0x158);else{if(_0x3a38db[_0x1b6575(0x1e9)])_0x40e66d=_0x1b6575(0x1e9);}}}const _0x26f27a=_0x3a38db[_0x1b6575(0x186)];let _0x54b096=_0x48eec4;const _0x488f24=a5_0xb6ee80[_0x1b6575(0x172)](_0x48eec4),_0x2428b3=_0x48eec4==='.';if(!_0x488f24||_0x2428b3){const _0x49cd50=resolveProjectFromContext(_0x48eec4,_0x26f27a,{'requireFile':_0x1b6575(0x156)});if(_0x49cd50[_0x1b6575(0x1cc)])_0x54b096=_0x49cd50[_0x1b6575(0x19f)],_0x49cd50['source']===_0x1b6575(0x196)&&console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x1a7)](_0x1b6575(0x176)+_0x54b096));else switch(_0x49cd50[_0x1b6575(0x16e)]){case _0x1b6575(0x16f):console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x160)](_0x49cd50[_0x1b6575(0x1e4)])),console['log'](),console['log'](_0x1b6575(0x18e)),console['log'](_0x1b6575(0x15b)),console[_0x1b6575(0x1bd)](_0x1b6575(0x1e8)),console[_0x1b6575(0x1bd)](),console[_0x1b6575(0x1bd)](_0x1b6575(0x17f));return 0x1;case'no_local_folder':console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x160)](_0x49cd50[_0x1b6575(0x1e4)])),console[_0x1b6575(0x1bd)](),console[_0x1b6575(0x1bd)](_0x1b6575(0x1ca)+_0x49cd50['llmProject']+_0x1b6575(0x188));return 0x1;case _0x1b6575(0x198):{const _0x4ac640=a5_0x4f828f[_0x1b6575(0x16a)](_0x49cd50[_0x1b6575(0x19f)]);console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x160)](_0x1b6575(0x159)+_0x49cd50['llmProject']+'\x22:'));for(const _0x1df174 of _0x49cd50[_0x1b6575(0x1cb)]){console['log'](_0x1b6575(0x1e5)+_0x1df174);}return console[_0x1b6575(0x1bd)](),console[_0x1b6575(0x1bd)](_0x1b6575(0x1e3)+_0x4ac640+_0x1b6575(0x1b0)),0x1;}case _0x1b6575(0x17c):console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x160)](_0x1b6575(0x197)+_0x49cd50[_0x1b6575(0x186)]+'\x22.')),console[_0x1b6575(0x1bd)](a5_0x2fb5d0['dim'](_0x1b6575(0x1d6)+_0x49cd50[_0x1b6575(0x19f)])),console[_0x1b6575(0x1bd)](),console[_0x1b6575(0x1bd)](_0x1b6575(0x17b));return 0x1;}}const {definition:_0xa7b1e4,agentInfo:_0x202ba4}=parseTestFile(_0x54b096);let _0xd821bc=_0xa7b1e4['tests'];if(_0x378a19){const _0x2fd3a4=_0x378a19[_0x1b6575(0x16d)](',')[_0x1b6575(0x18a)](_0x96ac50=>_0x96ac50[_0x1b6575(0x17a)]());_0xd821bc=_0xa7b1e4[_0x1b6575(0x166)][_0x1b6575(0x1c8)](_0x447315=>_0x2fd3a4[_0x1b6575(0x165)](_0x447315[_0x1b6575(0x1e7)]));if(_0xd821bc['length']===0x0)return console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x160)](_0x1b6575(0x1ce)+_0x378a19)),console[_0x1b6575(0x1bd)](a5_0x2fb5d0['dim'](_0x1b6575(0x185)+_0xa7b1e4[_0x1b6575(0x166)][_0x1b6575(0x18a)](_0x1faa1b=>_0x1faa1b[_0x1b6575(0x1e7)])[_0x1b6575(0x1f2)](',\x20'))),0x1;}if(_0x5dd44f){const _0x2ccad7=_0x5dd44f[_0x1b6575(0x16d)](',')[_0x1b6575(0x18a)](_0x2a1766=>_0x2a1766[_0x1b6575(0x17a)]()[_0x1b6575(0x1b6)]());_0xd821bc=_0xd821bc['filter'](_0x9dd6c9=>_0x9dd6c9['tags']?.[_0x1b6575(0x1ed)](_0x87996d=>_0x2ccad7[_0x1b6575(0x165)](_0x87996d[_0x1b6575(0x1b6)]())));if(_0xd821bc['length']===0x0){console['log'](a5_0x2fb5d0['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x5dd44f));const _0x3dca16=new Set();return _0xa7b1e4[_0x1b6575(0x166)][_0x1b6575(0x191)](_0xafffcd=>_0xafffcd[_0x1b6575(0x1c7)]?.['forEach'](_0x43c98a=>_0x3dca16[_0x1b6575(0x1f3)](_0x43c98a))),_0x3dca16[_0x1b6575(0x1ec)]>0x0?console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x1a7)](_0x1b6575(0x1b4)+[..._0x3dca16]['join'](',\x20'))):console['log'](a5_0x2fb5d0[_0x1b6575(0x1a7)](_0x1b6575(0x1b1))),0x1;}}if(_0x14b7a1)return this[_0x1b6575(0x1bc)](_0x39df46,{'definition':{'tests':_0xd821bc},'agentInfo':_0x202ba4,'outputFormat':_0x40e66d,'outputFile':_0x285f38,'testNames':_0x378a19});if(_0x441862){console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x170)](_0x1b6575(0x163))),console[_0x1b6575(0x1bd)]('\x20\x20Site:\x20'+a5_0x2fb5d0[_0x1b6575(0x1ba)](_0x363548)),console[_0x1b6575(0x1bd)]('\x20\x20Project:\x20'+a5_0x2fb5d0[_0x1b6575(0x1ba)](_0x202ba4['projectName'])),console[_0x1b6575(0x1bd)](_0x1b6575(0x167)+a5_0x2fb5d0[_0x1b6575(0x1ba)](_0x202ba4['agentName'])),console['log'](),console[_0x1b6575(0x1bd)](_0x1b6575(0x16c)+a5_0x2fb5d0[_0x1b6575(0x1ba)](_0xd821bc[_0x1b6575(0x15a)]));for(let _0x555646=0x0;_0x555646<_0xd821bc[_0x1b6575(0x15a)];_0x555646++){const _0x5afbc3=_0xd821bc[_0x555646],_0x1a9c91=_0x5afbc3[_0x1b6575(0x1c3)][_0x1b6575(0x15a)]===0x1?_0x1b6575(0x1d4):_0x1b6575(0x1c3),_0x51d671=_0x5afbc3[_0x1b6575(0x1c7)]?.[_0x1b6575(0x15a)]?'\x20['+_0x5afbc3['tags'][_0x1b6575(0x1f2)](',\x20')+']':'';console['log']('\x20\x20'+(_0x555646+0x1)+'.\x20'+a5_0x2fb5d0['white'](_0x5afbc3['name'])+'\x20('+_0x5afbc3[_0x1b6575(0x1c3)]['length']+'\x20'+_0x1a9c91+')'+a5_0x2fb5d0[_0x1b6575(0x1a7)](_0x51d671));}return 0x0;}let _0x44ed9e,_0x2acaec;try{_0x44ed9e=await _0x58e263[_0x1b6575(0x1c5)]['resolveProjectId'](_0x202ba4[_0x1b6575(0x175)]);}catch(_0x4e6f21){const _0x156526=_0x4e6f21 instanceof Error?_0x4e6f21[_0x1b6575(0x1e4)]:String(_0x4e6f21);return _0x156526[_0x1b6575(0x165)]('404')||_0x156526[_0x1b6575(0x1b6)]()[_0x1b6575(0x165)]('not\x20found')?console['log'](a5_0x2fb5d0[_0x1b6575(0x1b2)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x202ba4[_0x1b6575(0x175)])):console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x1b2)](_0x1b6575(0x1c4)+_0x202ba4[_0x1b6575(0x175)]+_0x1b6575(0x177)+_0x156526)),0x1;}try{_0x2acaec=await _0x58e263['llm'][_0x1b6575(0x1f0)](_0x202ba4[_0x1b6575(0x178)],_0x44ed9e);}catch(_0x24808a){const _0x18bf7a=_0x24808a instanceof Error?_0x24808a[_0x1b6575(0x1e4)]:String(_0x24808a);return _0x18bf7a[_0x1b6575(0x165)](_0x1b6575(0x187))||_0x18bf7a[_0x1b6575(0x1b6)]()[_0x1b6575(0x165)](_0x1b6575(0x1c1))?console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x1b2)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x202ba4[_0x1b6575(0x178)])):console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x1b2)](_0x1b6575(0x195)+_0x202ba4[_0x1b6575(0x178)]+'\x22:\x20'+_0x18bf7a)),0x1;}let _0x57db1f;if(!_0xc6b0e4)try{_0x57db1f=await setupEvaluatorAgent(_0x58e263[_0x1b6575(0x1c5)],_0x4d2fe3[_0x1b6575(0x1d8)]);}catch(_0x52f7cb){const _0x1b6638=_0x52f7cb instanceof Error?_0x52f7cb[_0x1b6575(0x1e4)]:String(_0x52f7cb);return console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x1b2)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x1b6638)),0x1;}console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x170)](_0x1b6575(0x1e0))),console[_0x1b6575(0x1bd)](_0x1b6575(0x18d)+a5_0x2fb5d0[_0x1b6575(0x1ba)](_0x363548)),console[_0x1b6575(0x1bd)]('Agent:\x20'+a5_0x2fb5d0[_0x1b6575(0x1ba)](_0x202ba4[_0x1b6575(0x175)]+'/'+_0x202ba4[_0x1b6575(0x178)])),console[_0x1b6575(0x1bd)]();const _0x15ef1e=[],_0x534a09=[],_0x1cf9fa=Date[_0x1b6575(0x1ae)]();for(let _0x203560=0x0;_0x203560<_0xd821bc[_0x1b6575(0x15a)];_0x203560++){const _0x62dfdb=_0xd821bc[_0x203560];_0xd821bc[_0x1b6575(0x15a)]>0x1?console[_0x1b6575(0x1bd)](_0x1b6575(0x182)+(_0x203560+0x1)+'/'+_0xd821bc[_0x1b6575(0x15a)]+':\x20'+a5_0x2fb5d0[_0x1b6575(0x1ba)](_0x62dfdb['name'])):console['log'](_0x1b6575(0x1be)+a5_0x2fb5d0[_0x1b6575(0x1ba)](_0x62dfdb[_0x1b6575(0x1e7)]));const _0x31f5ef=createCommandSpinner(_0x1b6575(0x173)+_0x62dfdb[_0x1b6575(0x1c3)][_0x1b6575(0x15a)]+':\x20Sending\x20user\x20input...');_0x31f5ef[_0x1b6575(0x18b)]();try{const {result:_0x50d5a7,conversation:_0x518d5d}=await runTest(_0x58e263[_0x1b6575(0x1c5)],_0x62dfdb,{'agentId':_0x2acaec,'projectId':_0x44ed9e,'site':_0x363548,'noEval':_0xc6b0e4,'evaluatorId':_0x57db1f,'onRoundStart':(_0x1203de,_0x5a68a0)=>{const _0x49ed3b=_0x1b6575;_0x31f5ef[_0x49ed3b(0x19a)]=_0x49ed3b(0x1aa)+(_0x1203de+0x1)+'/'+_0x5a68a0+_0x49ed3b(0x1a8);},'onRoundComplete':(_0x4a103d,_0x2908d7,_0xb93012)=>{const _0x158e1b=_0x1b6575,_0x1599fe=formatElapsed(_0x2908d7);_0xb93012?console[_0x158e1b(0x1bd)](_0x158e1b(0x1f4)+(_0x4a103d+0x1)+'/'+_0x62dfdb[_0x158e1b(0x1c3)][_0x158e1b(0x15a)]+_0x158e1b(0x1dc)+a5_0x2fb5d0[_0x158e1b(0x1da)]('✓')+'\x20('+_0x1599fe+')'):console[_0x158e1b(0x1bd)]('\x20\x20Round\x20'+(_0x4a103d+0x1)+'/'+_0x62dfdb[_0x158e1b(0x1c3)][_0x158e1b(0x15a)]+_0x158e1b(0x1dc)+a5_0x2fb5d0[_0x158e1b(0x1b2)]('✗'));},'onEvaluationStart':()=>{const _0x23ce61=_0x1b6575;_0x31f5ef[_0x23ce61(0x19a)]=_0x23ce61(0x1ac);},'onEvaluationComplete':_0xed7d0f=>{const _0x58ca5c=_0x1b6575,_0x2d5948=formatElapsed(_0xed7d0f);console[_0x58ca5c(0x1bd)](_0x58ca5c(0x174)+a5_0x2fb5d0[_0x58ca5c(0x1da)]('✓')+'\x20('+_0x2d5948+')');}});_0x31f5ef['stop'](),_0x15ef1e['push'](_0x50d5a7),_0x534a09['push'](_0x518d5d);if(_0x50d5a7['status']===_0x1b6575(0x1d5))console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x1da)](_0x1b6575(0x1ee)+_0x50d5a7[_0x1b6575(0x16e)]));else _0x50d5a7[_0x1b6575(0x157)]===_0x1b6575(0x1d1)?console['log'](a5_0x2fb5d0['red'](_0x1b6575(0x1a6)+_0x50d5a7['reason'])):console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x1b2)]('✗\x20ERROR:\x20'+_0x50d5a7[_0x1b6575(0x16e)]));_0x50d5a7[_0x1b6575(0x15c)]&&console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x1a7)](_0x1b6575(0x179)+_0x50d5a7[_0x1b6575(0x15c)])),console[_0x1b6575(0x1bd)]();}catch(_0x1448d1){_0x31f5ef[_0x1b6575(0x180)]();const _0x21c3bb=_0x1448d1 instanceof Error?_0x1448d1[_0x1b6575(0x1e4)]:String(_0x1448d1);console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x1b2)](_0x1b6575(0x17d)+_0x21c3bb)),console[_0x1b6575(0x1bd)](),_0x15ef1e[_0x1b6575(0x192)]({'name':_0x62dfdb['name'],'status':_0x1b6575(0x164),'reason':_0x21c3bb,'timestamp':new Date()[_0x1b6575(0x1db)](),'duration_ms':0x0});}}const _0x61f5fb=Date[_0x1b6575(0x1ae)]()-_0x1cf9fa,_0x33ab96=_0x15ef1e[_0x1b6575(0x1c8)](_0x465aa8=>_0x465aa8['status']==='PASS')['length'],_0xfd3424=_0x15ef1e['filter'](_0x3d7b28=>_0x3d7b28[_0x1b6575(0x157)]===_0x1b6575(0x1d1))[_0x1b6575(0x15a)],_0x542a4a=_0x15ef1e[_0x1b6575(0x1c8)](_0xe7e156=>_0xe7e156[_0x1b6575(0x157)]===_0x1b6575(0x164))[_0x1b6575(0x15a)];console['log']('━'[_0x1b6575(0x1e2)](0x3c)),console[_0x1b6575(0x1bd)](_0x1b6575(0x19e)),console['log']('━'[_0x1b6575(0x1e2)](0x3c)),console[_0x1b6575(0x1bd)]('Total:\x20\x20\x20\x20'+_0x15ef1e[_0x1b6575(0x15a)]),console['log'](_0x1b6575(0x1a4)+a5_0x2fb5d0[_0x1b6575(0x1da)](_0x33ab96)),console[_0x1b6575(0x1bd)](_0x1b6575(0x1a0)+a5_0x2fb5d0[_0x1b6575(0x1b2)](_0xfd3424));_0x542a4a>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x2fb5d0[_0x1b6575(0x1b2)](_0x542a4a));console[_0x1b6575(0x1bd)](_0x1b6575(0x1c0)+formatElapsed(_0x61f5fb)),console[_0x1b6575(0x1bd)]('━'['repeat'](0x3c));const _0x499882=_0x15ef1e[_0x1b6575(0x1c8)](_0x3847d4=>_0x3847d4[_0x1b6575(0x157)]!==_0x1b6575(0x1d5));if(_0x499882[_0x1b6575(0x15a)]>0x0){console[_0x1b6575(0x1bd)](),console['log'](_0x1b6575(0x1cf));for(const _0x281583 of _0x499882){const _0x53b992=a5_0x2fb5d0[_0x1b6575(0x1b2)]('✗'),_0xe5a2a9=_0x281583[_0x1b6575(0x16e)]['length']>0x32?_0x281583[_0x1b6575(0x16e)][_0x1b6575(0x1df)](0x0,0x32)+_0x1b6575(0x1a1):_0x281583[_0x1b6575(0x16e)];console['log']('\x20\x20'+_0x53b992+'\x20'+_0x281583['name']+':\x20'+_0xe5a2a9);}}const _0x51954e={'summary':{'total':_0x15ef1e[_0x1b6575(0x15a)],'passed':_0x33ab96,'failed':_0xfd3424,'errors':_0x542a4a>0x0?_0x542a4a:undefined,'duration_ms':_0x61f5fb},'tests':_0x15ef1e,'agent':{'project':_0x202ba4[_0x1b6575(0x175)],'name':_0x202ba4[_0x1b6575(0x178)],'site':_0x363548},'timestamp':new Date(_0x1cf9fa)[_0x1b6575(0x1db)]()};try{const _0x1f2d01=buildCachedTestRun(_0x534a09,{'site':_0x363548,'projectId':_0x44ed9e,'projectName':_0x202ba4[_0x1b6575(0x175)],'agentId':_0x2acaec,'agentName':_0x202ba4[_0x1b6575(0x178)],'testYmlPath':a5_0x4f828f[_0x1b6575(0x1c9)](_0x202ba4[_0x1b6575(0x17e)])});saveLastTestRun(_0x1f2d01);}catch{}if(_0x40e66d!==_0x1b6575(0x1e9)||_0x285f38){const _0x4e9b8b=formatResults(_0x51954e,_0x40e66d);if(_0x285f38)try{a5_0xb6ee80[_0x1b6575(0x1e6)](_0x285f38,_0x4e9b8b,'utf-8'),console[_0x1b6575(0x1bd)](),console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x1a7)](_0x1b6575(0x1b7)+_0x285f38));}catch(_0xe4f16a){return console[_0x1b6575(0x1bd)](),console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x1b2)](_0x1b6575(0x1cd)+_0xe4f16a)),0x1;}else console[_0x1b6575(0x1bd)](),console[_0x1b6575(0x1bd)](_0x4e9b8b);}return _0x499882[_0x1b6575(0x15a)]>0x0?0x1:0x0;}async[a5_0x1a4011(0x1bc)](_0x12312f,_0x5afd5c){const _0x57bd4f=a5_0x1a4011,{options:_0x49ade9,tdx:_0x5cd5fb}=_0x12312f,{definition:_0x3c4cc7,agentInfo:_0xa2a16,outputFormat:_0x5c9eaf,outputFile:_0x44a228}=_0x5afd5c,_0x19d496=_0x49ade9[_0x57bd4f(0x1a5)],_0x4386ce=loadLastTestRun();if(!_0x4386ce)return console['log'](a5_0x2fb5d0['red'](_0x57bd4f(0x194))),console[_0x57bd4f(0x1bd)](a5_0x2fb5d0[_0x57bd4f(0x1a7)](_0x57bd4f(0x1ab))),0x1;if(_0x4386ce['agent']['agentName']!==_0xa2a16[_0x57bd4f(0x178)])return console[_0x57bd4f(0x1bd)](a5_0x2fb5d0[_0x57bd4f(0x1b2)](_0x57bd4f(0x18f)+_0x4386ce[_0x57bd4f(0x1d9)][_0x57bd4f(0x178)]+_0x57bd4f(0x189)+_0xa2a16[_0x57bd4f(0x178)]+'\x22.')),console[_0x57bd4f(0x1bd)](a5_0x2fb5d0[_0x57bd4f(0x1a7)](_0x57bd4f(0x199))),0x1;const _0x4ae66d=new Set(_0x4386ce[_0x57bd4f(0x1d3)][_0x57bd4f(0x18a)](_0x522d1e=>_0x522d1e[_0x57bd4f(0x1af)])),_0x114cd=_0x3c4cc7[_0x57bd4f(0x166)][_0x57bd4f(0x1c8)](_0xbcafc9=>!_0x4ae66d[_0x57bd4f(0x1ad)](_0xbcafc9[_0x57bd4f(0x1e7)]));if(_0x114cd[_0x57bd4f(0x15a)]>0x0&&_0x4386ce[_0x57bd4f(0x1a5)]!==_0x19d496)return console[_0x57bd4f(0x1bd)](a5_0x2fb5d0['red'](_0x57bd4f(0x19b))),console[_0x57bd4f(0x1bd)](a5_0x2fb5d0[_0x57bd4f(0x1a7)](_0x57bd4f(0x1b9)+_0x4386ce[_0x57bd4f(0x1a5)]+_0x57bd4f(0x1d0)+_0x19d496+'\x22.')),console['log'](a5_0x2fb5d0[_0x57bd4f(0x1a7)](_0x57bd4f(0x18c)+_0x4386ce[_0x57bd4f(0x1a5)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x4ee4dc=_0x3c4cc7[_0x57bd4f(0x166)][_0x57bd4f(0x1c8)](_0x264d93=>_0x4ae66d[_0x57bd4f(0x1ad)](_0x264d93[_0x57bd4f(0x1e7)])),_0x44bb03=_0x114cd;let _0x25c839;try{_0x25c839=await setupEvaluatorAgent(_0x5cd5fb[_0x57bd4f(0x1c5)],_0x49ade9['verbose']);}catch(_0x395a6e){const _0x3da2fc=_0x395a6e instanceof Error?_0x395a6e[_0x57bd4f(0x1e4)]:String(_0x395a6e);return console[_0x57bd4f(0x1bd)](a5_0x2fb5d0[_0x57bd4f(0x1b2)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x3da2fc)),0x1;}console[_0x57bd4f(0x1bd)](a5_0x2fb5d0['cyan']('Re-evaluating\x20cached\x20test\x20run...')),console[_0x57bd4f(0x1bd)](_0x57bd4f(0x15d)+a5_0x2fb5d0['white'](_0x4386ce[_0x57bd4f(0x1f1)])),console[_0x57bd4f(0x1bd)](_0x57bd4f(0x168)+a5_0x2fb5d0[_0x57bd4f(0x1ba)](_0x4386ce['agent'][_0x57bd4f(0x175)]+'/'+_0x4386ce[_0x57bd4f(0x1d9)][_0x57bd4f(0x178)]));_0x44bb03[_0x57bd4f(0x15a)]>0x0&&console[_0x57bd4f(0x1bd)](_0x57bd4f(0x15e)+a5_0x2fb5d0['yellow'](_0x44bb03[_0x57bd4f(0x15a)]));console['log']();const _0x3a0d7e=[],_0x248c81=Date['now'](),_0x2d8051=createCommandSpinner('Re-evaluating...');if(_0x4ee4dc[_0x57bd4f(0x15a)]>0x0)try{const _0x998e74=await reevaluateFromCache(_0x5cd5fb[_0x57bd4f(0x1c5)],_0x4386ce,{'tests':_0x4ee4dc},{'evaluatorId':_0x25c839,'onTestStart':(_0xfa72d8,_0x4d700b,_0x3e9298)=>{const _0xfe6c3b=_0x57bd4f;_0x2d8051[_0xfe6c3b(0x19a)]='Re-evaluating\x20'+(_0x4d700b+0x1)+'/'+_0x3e9298+':\x20'+_0xfa72d8+'...';if(!_0x2d8051[_0xfe6c3b(0x1e1)])_0x2d8051[_0xfe6c3b(0x18b)]();},'onTestComplete':(_0x277201,_0x4988e1)=>{const _0xed92d0=_0x57bd4f;_0x2d8051[_0xed92d0(0x180)]();if(_0x4988e1[_0xed92d0(0x157)]===_0xed92d0(0x1d5))console['log'](a5_0x2fb5d0[_0xed92d0(0x1da)]('✓\x20PASS:\x20'+_0x277201)+a5_0x2fb5d0['dim'](_0xed92d0(0x1b5)));else _0x4988e1[_0xed92d0(0x157)]===_0xed92d0(0x1d1)?console[_0xed92d0(0x1bd)](a5_0x2fb5d0['red'](_0xed92d0(0x1a6)+_0x277201+'\x20-\x20'+_0x4988e1[_0xed92d0(0x16e)])+a5_0x2fb5d0[_0xed92d0(0x1a7)](_0xed92d0(0x1b5))):console[_0xed92d0(0x1bd)](a5_0x2fb5d0[_0xed92d0(0x1b2)]('✗\x20ERROR:\x20'+_0x277201+_0xed92d0(0x1c2)+_0x4988e1['reason']));_0x4988e1[_0xed92d0(0x15c)]&&console[_0xed92d0(0x1bd)](a5_0x2fb5d0[_0xed92d0(0x1a7)](_0xed92d0(0x1bf)+_0x4988e1['conversation_url'])),_0x3a0d7e[_0xed92d0(0x192)](_0x4988e1);},'onTestSkipped':(_0x467339,_0x313603)=>{const _0x18cf56=_0x57bd4f;_0x2d8051['stop'](),console[_0x18cf56(0x1bd)](a5_0x2fb5d0[_0x18cf56(0x160)]('⚠\x20SKIPPED:\x20'+_0x467339+'\x20-\x20'+_0x313603));}});for(const _0x1945e6 of _0x998e74){!_0x3a0d7e[_0x57bd4f(0x1d7)](_0x4a5e05=>_0x4a5e05['name']===_0x1945e6[_0x57bd4f(0x1e7)])&&_0x3a0d7e[_0x57bd4f(0x192)](_0x1945e6);}}catch(_0xc1f343){_0x2d8051[_0x57bd4f(0x180)]();const _0xad4dee=_0xc1f343 instanceof Error?_0xc1f343['message']:String(_0xc1f343);return console[_0x57bd4f(0x1bd)](a5_0x2fb5d0[_0x57bd4f(0x1b2)](_0x57bd4f(0x161)+_0xad4dee)),0x1;}_0x2d8051[_0x57bd4f(0x180)]();if(_0x44bb03[_0x57bd4f(0x15a)]>0x0){console[_0x57bd4f(0x1bd)](),console[_0x57bd4f(0x1bd)](a5_0x2fb5d0[_0x57bd4f(0x170)](_0x57bd4f(0x1eb)));const {projectId:_0x145141,agentId:_0x3ad939}=_0x4386ce[_0x57bd4f(0x1d9)];for(const _0x3f09d9 of _0x44bb03){console[_0x57bd4f(0x1bd)](_0x57bd4f(0x183)+a5_0x2fb5d0['white'](_0x3f09d9[_0x57bd4f(0x1e7)]));const _0x1b0d14=createCommandSpinner(_0x57bd4f(0x173)+_0x3f09d9[_0x57bd4f(0x1c3)][_0x57bd4f(0x15a)]+_0x57bd4f(0x1a8));_0x1b0d14[_0x57bd4f(0x18b)]();try{const {result:_0x50336d}=await runTest(_0x5cd5fb[_0x57bd4f(0x1c5)],_0x3f09d9,{'agentId':_0x3ad939,'projectId':_0x145141,'site':_0x4386ce[_0x57bd4f(0x1a5)],'noEval':![],'evaluatorId':_0x25c839,'onRoundStart':(_0x4b1f4c,_0x49d6b2)=>{const _0x337dde=_0x57bd4f;_0x1b0d14[_0x337dde(0x19a)]=_0x337dde(0x1aa)+(_0x4b1f4c+0x1)+'/'+_0x49d6b2+_0x337dde(0x1a8);},'onRoundComplete':(_0x42278e,_0x1491ce,_0x56e03b)=>{const _0x3a662a=_0x57bd4f,_0x393a1c=formatElapsed(_0x1491ce);_0x56e03b?console['log'](_0x3a662a(0x1f4)+(_0x42278e+0x1)+'/'+_0x3f09d9['rounds']['length']+'...\x20'+a5_0x2fb5d0[_0x3a662a(0x1da)]('✓')+'\x20('+_0x393a1c+')'):console['log']('\x20\x20Round\x20'+(_0x42278e+0x1)+'/'+_0x3f09d9['rounds'][_0x3a662a(0x15a)]+_0x3a662a(0x1dc)+a5_0x2fb5d0['red']('✗'));},'onEvaluationStart':()=>{const _0xafca2c=_0x57bd4f;_0x1b0d14[_0xafca2c(0x19a)]=_0xafca2c(0x1ac);},'onEvaluationComplete':_0xaf952d=>{const _0x33b7e9=_0x57bd4f,_0x393623=formatElapsed(_0xaf952d);console[_0x33b7e9(0x1bd)](_0x33b7e9(0x174)+a5_0x2fb5d0[_0x33b7e9(0x1da)]('✓')+'\x20('+_0x393623+')');}});_0x1b0d14[_0x57bd4f(0x180)](),_0x3a0d7e[_0x57bd4f(0x192)](_0x50336d);if(_0x50336d[_0x57bd4f(0x157)]===_0x57bd4f(0x1d5))console['log'](a5_0x2fb5d0[_0x57bd4f(0x1da)]('✓\x20PASS:\x20'+_0x50336d[_0x57bd4f(0x16e)])+a5_0x2fb5d0[_0x57bd4f(0x1a7)](_0x57bd4f(0x15f)));else _0x50336d[_0x57bd4f(0x157)]===_0x57bd4f(0x1d1)?console['log'](a5_0x2fb5d0[_0x57bd4f(0x1b2)](_0x57bd4f(0x1a6)+_0x50336d[_0x57bd4f(0x16e)])+a5_0x2fb5d0[_0x57bd4f(0x1a7)](_0x57bd4f(0x15f))):console['log'](a5_0x2fb5d0[_0x57bd4f(0x1b2)]('✗\x20ERROR:\x20'+_0x50336d[_0x57bd4f(0x16e)]));_0x50336d[_0x57bd4f(0x15c)]&&console[_0x57bd4f(0x1bd)](a5_0x2fb5d0[_0x57bd4f(0x1a7)]('\x20\x20Conversation:\x20'+_0x50336d[_0x57bd4f(0x15c)]));}catch(_0x322774){_0x1b0d14[_0x57bd4f(0x180)]();const _0x543334=_0x322774 instanceof Error?_0x322774[_0x57bd4f(0x1e4)]:String(_0x322774);console[_0x57bd4f(0x1bd)](a5_0x2fb5d0[_0x57bd4f(0x1b2)]('✗\x20ERROR:\x20'+_0x543334)),_0x3a0d7e['push']({'name':_0x3f09d9[_0x57bd4f(0x1e7)],'status':'ERROR','reason':_0x543334,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x57bd4f(0x1bd)]();const _0x30c215=Date['now']()-_0x248c81,_0x786df4=_0x3a0d7e[_0x57bd4f(0x1c8)](_0x3603b2=>_0x3603b2[_0x57bd4f(0x157)]===_0x57bd4f(0x1d5))[_0x57bd4f(0x15a)],_0x2301f0=_0x3a0d7e['filter'](_0x331503=>_0x331503[_0x57bd4f(0x157)]===_0x57bd4f(0x1d1))[_0x57bd4f(0x15a)],_0x326dda=_0x3a0d7e[_0x57bd4f(0x1c8)](_0x2636d3=>_0x2636d3[_0x57bd4f(0x157)]===_0x57bd4f(0x164))[_0x57bd4f(0x15a)];console[_0x57bd4f(0x1bd)]('━'[_0x57bd4f(0x1e2)](0x3c)),console['log'](_0x57bd4f(0x1bb)),console['log']('━'['repeat'](0x3c)),console[_0x57bd4f(0x1bd)](_0x57bd4f(0x1ef)+_0x3a0d7e[_0x57bd4f(0x15a)]),console[_0x57bd4f(0x1bd)](_0x57bd4f(0x1a4)+a5_0x2fb5d0[_0x57bd4f(0x1da)](_0x786df4)),console['log'](_0x57bd4f(0x1a0)+a5_0x2fb5d0[_0x57bd4f(0x1b2)](_0x2301f0));_0x326dda>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x2fb5d0[_0x57bd4f(0x1b2)](_0x326dda));console['log']('Duration:\x20'+formatElapsed(_0x30c215)),console[_0x57bd4f(0x1bd)]('━'[_0x57bd4f(0x1e2)](0x3c));const _0x2719ec={'summary':{'total':_0x3a0d7e[_0x57bd4f(0x15a)],'passed':_0x786df4,'failed':_0x2301f0,'errors':_0x326dda>0x0?_0x326dda:undefined,'duration_ms':_0x30c215},'tests':_0x3a0d7e,'agent':{'project':_0xa2a16[_0x57bd4f(0x175)],'name':_0xa2a16[_0x57bd4f(0x178)],'site':_0x19d496},'timestamp':new Date(_0x248c81)[_0x57bd4f(0x1db)]()};if(_0x5c9eaf!==_0x57bd4f(0x1e9)||_0x44a228){const _0x36fcb8=formatResults(_0x2719ec,_0x5c9eaf);if(_0x44a228)try{a5_0xb6ee80[_0x57bd4f(0x1e6)](_0x44a228,_0x36fcb8,_0x57bd4f(0x181)),console[_0x57bd4f(0x1bd)](),console[_0x57bd4f(0x1bd)](a5_0x2fb5d0[_0x57bd4f(0x1a7)](_0x57bd4f(0x1b7)+_0x44a228));}catch(_0x1d4938){return console[_0x57bd4f(0x1bd)](),console[_0x57bd4f(0x1bd)](a5_0x2fb5d0[_0x57bd4f(0x1b2)](_0x57bd4f(0x1cd)+_0x1d4938)),0x1;}else console[_0x57bd4f(0x1bd)](),console['log'](_0x36fcb8);}const _0x4869c2=_0x3a0d7e[_0x57bd4f(0x1c8)](_0x2f158a=>_0x2f158a[_0x57bd4f(0x157)]!=='PASS');return _0x4869c2['length']>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x38341f=a6_0x3c6d;(function(_0x2fdc6e,_0x185473){const _0x273a1f=a6_0x3c6d,_0xb19352=_0x2fdc6e();while(!![]){try{const _0x4a4d55=parseInt(_0x273a1f(0x171))/0x1*(parseInt(_0x273a1f(0x14f))/0x2)+parseInt(_0x273a1f(0x16a))/0x3+-parseInt(_0x273a1f(0x140))/0x4*(parseInt(_0x273a1f(0x145))/0x5)+-parseInt(_0x273a1f(0x13b))/0x6+-parseInt(_0x273a1f(0x13c))/0x7*(-parseInt(_0x273a1f(0x141))/0x8)+parseInt(_0x273a1f(0x172))/0x9*(-parseInt(_0x273a1f(0x13a))/0xa)+parseInt(_0x273a1f(0x133))/0xb;if(_0x4a4d55===_0x185473)break;else _0xb19352['push'](_0xb19352['shift']());}catch(_0x2340b8){_0xb19352['push'](_0xb19352['shift']());}}}(a6_0x5326,0xd0eec));function a6_0x3c6d(_0x4b384b,_0x31e10b){_0x4b384b=_0x4b384b-0x12d;const _0x5326c0=a6_0x5326();let _0x3c6d24=_0x5326c0[_0x4b384b];return _0x3c6d24;}import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a6_0x5326(){const _0xd67251=['1405sRyGFL','Error:\x20','name','trim','toLowerCase','includes','startsWith','x-auth-token','status','stack','2163562fOFSNh','.\x20Valid\x20methods:\x20','noColor','headers','authorization','llm','Endpoint\x20must\x20start\x20with\x20/:\x20','.\x20Valid\x20types:\x20','error','type','cdp','has','verbose','data','execute','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','join','length','Invalid\x20API\x20type:\x20','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','cas','header','color','entries','file','output','3427647qqtnHR','<\x20HTTP/1.1\x20','keys','\x22.\x20','readBodyFromFile','DELETE','Invalid\x20header\x20format:\x20\x22','1uajiqD','11909943gBeXQs','set-cookie2','toUpperCase','log','substring','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','description','indexOf','GET','1890350camAGI','\x0aStack\x20trace:\x0a','trino','PUT','validate','set-cookie','api','10IQeOig','6083694smyKcC','518ZJOvBb','isArray','x-xsrf-token','message','3704pANiAG','114280ouGtDK','proxy-authorization','site','Results\x20saved\x20to\x20'];a6_0x5326=function(){return _0xd67251;};return a6_0x5326();}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_0x38341f(0x153),a6_0x38341f(0x142),'cookie',a6_0x38341f(0x138),a6_0x38341f(0x173),a6_0x38341f(0x13e),a6_0x38341f(0x14c),'x-trino-user']);function isSensitiveHeader(_0x39f23a){const _0x49be57=a6_0x38341f;return SENSITIVE_HEADERS[_0x49be57(0x15a)](_0x39f23a[_0x49be57(0x149)]());}function parseHeader(_0x68a0df){const _0x2b098d=a6_0x38341f,_0x39bb8a=_0x68a0df[_0x2b098d(0x131)](':');if(_0x39bb8a===-0x1)throw new Error(_0x2b098d(0x170)+_0x68a0df+_0x2b098d(0x16d)+_0x2b098d(0x12f));const _0x5d126f=_0x68a0df[_0x2b098d(0x12e)](0x0,_0x39bb8a)[_0x2b098d(0x148)](),_0x8574b=_0x68a0df[_0x2b098d(0x12e)](_0x39bb8a+0x1)[_0x2b098d(0x148)]();if(!_0x5d126f)throw new Error(_0x2b098d(0x15f)+_0x68a0df+'\x22');return[_0x5d126f,_0x8574b];}export class ApiCommand extends BaseCommand{[a6_0x38341f(0x147)]='api';[a6_0x38341f(0x130)]=a6_0x38341f(0x15e);[a6_0x38341f(0x137)](_0x27035d){const _0x1867d0=a6_0x38341f,{args:_0x4b51f9,options:_0x458f18}=_0x27035d,_0x304058=_0x458f18;if(_0x4b51f9[_0x1867d0(0x161)]===0x0)return _0x1867d0(0x163);const _0x5e4cb1=_0x4b51f9[0x0];if(!_0x5e4cb1[_0x1867d0(0x14b)]('/'))return _0x1867d0(0x155)+_0x5e4cb1;const _0x11944d=_0x304058[_0x1867d0(0x15c)],_0x10e673=_0x304058['file'];if(_0x11944d&&_0x10e673)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x4a8725=_0x304058['method']||_0x1867d0(0x132),_0x53e317=[_0x1867d0(0x132),'POST',_0x1867d0(0x136),_0x1867d0(0x16f),'PATCH'];if(!_0x53e317[_0x1867d0(0x14a)](_0x4a8725[_0x1867d0(0x174)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x4a8725+_0x1867d0(0x150)+_0x53e317['join'](',\x20');const _0x5b5672=_0x304058[_0x1867d0(0x158)]||'td',_0x3f8a4a=['td',_0x1867d0(0x159),'workflow',_0x1867d0(0x135),_0x1867d0(0x154),'llm-proxy',_0x1867d0(0x164)];if(!_0x3f8a4a[_0x1867d0(0x14a)](_0x5b5672))return _0x1867d0(0x162)+_0x5b5672+_0x1867d0(0x156)+_0x3f8a4a[_0x1867d0(0x160)](',\x20');return undefined;}async[a6_0x38341f(0x15d)](_0xd6885b){const _0xf3850e=a6_0x38341f,{options:_0x5564b9,args:_0x380841,tdx:_0x461dcc}=_0xd6885b,_0x43715a=_0x5564b9,_0xfa980d=_0x380841[0x0],_0x2450d0=(_0x43715a['method']||'GET')['toUpperCase'](),_0x4be7bd=_0x43715a['data'],_0xbd85a=_0x43715a[_0xf3850e(0x168)],_0x5a7cb9=_0x43715a[_0xf3850e(0x165)],_0x25baab=_0x43715a[_0xf3850e(0x158)]||'td';try{const _0x1eda96={};if(_0x5a7cb9){const _0x541752=Array[_0xf3850e(0x13d)](_0x5a7cb9)?_0x5a7cb9:[_0x5a7cb9];for(const _0x644a7b of _0x541752){const [_0x281a40,_0x4cb196]=parseHeader(_0x644a7b);_0x1eda96[_0x281a40]=_0x4cb196;}}let _0xdea818;if(_0x4be7bd)_0xdea818=_0x4be7bd;else{if(_0xbd85a)try{_0xdea818=RawAPI[_0xf3850e(0x16e)](_0xbd85a);}catch(_0x5750e2){return console[_0xf3850e(0x157)](_0xf3850e(0x146)+(_0x5750e2 instanceof Error?_0x5750e2[_0xf3850e(0x13f)]:String(_0x5750e2))),0x1;}}const _0x21fda6={'method':_0x2450d0,'apiType':_0x25baab,'includeHeaders':_0x5564b9[_0xf3850e(0x15b)]};_0xdea818&&(_0x21fda6['body']=_0xdea818);Object[_0xf3850e(0x16c)](_0x1eda96)[_0xf3850e(0x161)]>0x0&&(_0x21fda6[_0xf3850e(0x152)]=_0x1eda96);if(_0x5564b9[_0xf3850e(0x15b)]){const _0x29ceda=resolveSite(_0x5564b9[_0xf3850e(0x143)]),_0xb11f8c=getEndpoint(_0x29ceda,_0x25baab),_0x506d4b=''+_0xb11f8c+_0xfa980d;console[_0xf3850e(0x157)]('>\x20'+_0x2450d0+'\x20'+_0x506d4b);const _0x32b9bf=getAuthHeaders(_0x29ceda),_0x5d4117={..._0x32b9bf,..._0x1eda96};for(const [_0x4b01e3,_0x47f865]of Object[_0xf3850e(0x167)](_0x5d4117)){!isSensitiveHeader(_0x4b01e3)&&console[_0xf3850e(0x157)]('>\x20'+_0x4b01e3+':\x20'+_0x47f865);}_0xdea818&&console[_0xf3850e(0x157)]('>'),console[_0xf3850e(0x157)]('');}const _0x1786fa=await _0x461dcc[_0xf3850e(0x139)]['request'](_0xfa980d,_0x21fda6);if(_0x5564b9[_0xf3850e(0x15b)]&&_0x1786fa[_0xf3850e(0x152)]){console[_0xf3850e(0x157)](_0xf3850e(0x16b)+_0x1786fa[_0xf3850e(0x14d)]);for(const [_0xf45284,_0xeb7ab6]of Object['entries'](_0x1786fa[_0xf3850e(0x152)])){!isSensitiveHeader(_0xf45284)&&console['error']('<\x20'+_0xf45284+':\x20'+_0xeb7ab6);}console['error']('');}const _0x2ff707=Boolean(_0x5564b9[_0xf3850e(0x169)]),_0x528e19={'color':_0x5564b9[_0xf3850e(0x166)],'noColor':_0x5564b9[_0xf3850e(0x151)]||_0x2ff707&&!_0x5564b9['color']},_0x31e210=colorizeJSON(_0x1786fa[_0xf3850e(0x15c)],_0x528e19);return _0x5564b9['output']?(writeFileSync(_0x5564b9[_0xf3850e(0x169)],_0x31e210),console[_0xf3850e(0x157)](_0xf3850e(0x144)+_0x5564b9[_0xf3850e(0x169)])):console[_0xf3850e(0x12d)](_0x31e210),0x0;}catch(_0x3f6606){return _0x3f6606 instanceof Error?(console[_0xf3850e(0x157)](_0xf3850e(0x146)+_0x3f6606['message']),_0x5564b9[_0xf3850e(0x15b)]&&_0x3f6606[_0xf3850e(0x14e)]&&console['error'](_0xf3850e(0x134)+_0x3f6606[_0xf3850e(0x14e)])):console[_0xf3850e(0x157)](_0xf3850e(0x146)+String(_0x3f6606)),0x1;}}}
1
+ const a6_0x4f7ba3=a6_0x3d97;(function(_0x4ddc8f,_0x47110d){const _0x122d57=a6_0x3d97,_0x55cb75=_0x4ddc8f();while(!![]){try{const _0xdf1b80=parseInt(_0x122d57(0xe8))/0x1*(-parseInt(_0x122d57(0xee))/0x2)+-parseInt(_0x122d57(0x108))/0x3+-parseInt(_0x122d57(0x10f))/0x4+-parseInt(_0x122d57(0xf6))/0x5+parseInt(_0x122d57(0x121))/0x6*(-parseInt(_0x122d57(0x100))/0x7)+-parseInt(_0x122d57(0x117))/0x8*(parseInt(_0x122d57(0x105))/0x9)+parseInt(_0x122d57(0x10b))/0xa;if(_0xdf1b80===_0x47110d)break;else _0x55cb75['push'](_0x55cb75['shift']());}catch(_0x1b7fe2){_0x55cb75['push'](_0x55cb75['shift']());}}}(a6_0xc34c,0x6317d));import{BaseCommand}from'./command.js';function a6_0x3d97(_0x173cdc,_0x90b48f){_0x173cdc=_0x173cdc-0xe6;const _0xc34cfa=a6_0xc34c();let _0x3d9732=_0xc34cfa[_0x173cdc];return _0x3d9732;}import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';function a6_0xc34c(){const _0x5c5e07=['304402PrRTtR','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','has','trim','data','423261zbzpAT','readBodyFromFile','cdp','672819TaaQSa','llm','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','31507240faUfwO','Error:\x20','output','set-cookie','2987060rdGSeQ','api','.\x20Valid\x20methods:\x20','body','headers','includes','keys','message','136PdOVto','request','status','substring','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','entries','file','PUT','Results\x20saved\x20to\x20','GET','6eYvtqp','Endpoint\x20must\x20start\x20with\x20/:\x20','\x22.\x20','toUpperCase','type','43eiMRXU','length','join','toLowerCase','color','name','23468lRhKQB','method','proxy-authorization','\x0aStack\x20trace:\x0a','workflow','x-auth-token','execute','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','2131300QtqHTA','x-xsrf-token','indexOf','x-trino-user','error','stack','verbose','.\x20Valid\x20types:\x20','authorization','cookie'];a6_0xc34c=function(){return _0x5c5e07;};return a6_0xc34c();}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x4f7ba3(0xfe),a6_0x4f7ba3(0xf0),a6_0x4f7ba3(0xff),a6_0x4f7ba3(0x10e),'set-cookie2',a6_0x4f7ba3(0xf7),a6_0x4f7ba3(0xf3),a6_0x4f7ba3(0xf9)]);function isSensitiveHeader(_0x5eba75){const _0x27f1bd=a6_0x4f7ba3;return SENSITIVE_HEADERS[_0x27f1bd(0x102)](_0x5eba75[_0x27f1bd(0xeb)]());}function parseHeader(_0x530629){const _0x2862e9=a6_0x4f7ba3,_0xbefdc7=_0x530629[_0x2862e9(0xf8)](':');if(_0xbefdc7===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x530629+_0x2862e9(0x123)+_0x2862e9(0x101));const _0x48292e=_0x530629[_0x2862e9(0x11a)](0x0,_0xbefdc7)['trim'](),_0x42363c=_0x530629[_0x2862e9(0x11a)](_0xbefdc7+0x1)[_0x2862e9(0x103)]();if(!_0x48292e)throw new Error(_0x2862e9(0xf5)+_0x530629+'\x22');return[_0x48292e,_0x42363c];}export class ApiCommand extends BaseCommand{[a6_0x4f7ba3(0xed)]=a6_0x4f7ba3(0x110);['description']='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';['validate'](_0x1273cc){const _0x3d5654=a6_0x4f7ba3,{args:_0x46c384,options:_0x5afa80}=_0x1273cc,_0x48bcaf=_0x5afa80;if(_0x46c384[_0x3d5654(0xe9)]===0x0)return _0x3d5654(0x10a);const _0x482178=_0x46c384[0x0];if(!_0x482178['startsWith']('/'))return _0x3d5654(0x122)+_0x482178;const _0x2aa9fb=_0x48bcaf[_0x3d5654(0x104)],_0x55d0d5=_0x48bcaf[_0x3d5654(0x11d)];if(_0x2aa9fb&&_0x55d0d5)return _0x3d5654(0x11b);const _0x531b46=_0x48bcaf[_0x3d5654(0xef)]||_0x3d5654(0x120),_0x453291=['GET','POST',_0x3d5654(0x11e),'DELETE','PATCH'];if(!_0x453291[_0x3d5654(0x114)](_0x531b46[_0x3d5654(0xe6)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x531b46+_0x3d5654(0x111)+_0x453291[_0x3d5654(0xea)](',\x20');const _0x2aab80=_0x48bcaf[_0x3d5654(0xe7)]||'td',_0x29247a=['td',_0x3d5654(0x107),_0x3d5654(0xf2),'trino',_0x3d5654(0x109),'llm-proxy','cas'];if(!_0x29247a['includes'](_0x2aab80))return'Invalid\x20API\x20type:\x20'+_0x2aab80+_0x3d5654(0xfd)+_0x29247a[_0x3d5654(0xea)](',\x20');return undefined;}async[a6_0x4f7ba3(0xf4)](_0xf99210){const _0xadabb7=a6_0x4f7ba3,{options:_0x57ea2f,args:_0xa8ee8,tdx:_0x14e74e}=_0xf99210,_0x1a628e=_0x57ea2f,_0x49a34a=_0xa8ee8[0x0],_0x26b2f4=(_0x1a628e['method']||_0xadabb7(0x120))[_0xadabb7(0xe6)](),_0x490744=_0x1a628e[_0xadabb7(0x104)],_0x209d5a=_0x1a628e[_0xadabb7(0x11d)],_0x3dd7d1=_0x1a628e['header'],_0x31c5bc=_0x1a628e[_0xadabb7(0xe7)]||'td';try{const _0x4a1b2f={};if(_0x3dd7d1){const _0x1c5074=Array['isArray'](_0x3dd7d1)?_0x3dd7d1:[_0x3dd7d1];for(const _0x261dd5 of _0x1c5074){const [_0x549e0c,_0x41539b]=parseHeader(_0x261dd5);_0x4a1b2f[_0x549e0c]=_0x41539b;}}let _0x359f63;if(_0x490744)_0x359f63=_0x490744;else{if(_0x209d5a)try{_0x359f63=RawAPI[_0xadabb7(0x106)](_0x209d5a);}catch(_0x2918ce){return console[_0xadabb7(0xfa)](_0xadabb7(0x10c)+(_0x2918ce instanceof Error?_0x2918ce[_0xadabb7(0x116)]:String(_0x2918ce))),0x1;}}const _0x1e8043={'method':_0x26b2f4,'apiType':_0x31c5bc,'includeHeaders':_0x57ea2f[_0xadabb7(0xfc)]};_0x359f63&&(_0x1e8043[_0xadabb7(0x112)]=_0x359f63);Object[_0xadabb7(0x115)](_0x4a1b2f)[_0xadabb7(0xe9)]>0x0&&(_0x1e8043[_0xadabb7(0x113)]=_0x4a1b2f);if(_0x57ea2f[_0xadabb7(0xfc)]){const _0x3411c5=resolveSite(_0x57ea2f['site']),_0x10e2ea=getEndpoint(_0x3411c5,_0x31c5bc),_0x5f581c=''+_0x10e2ea+_0x49a34a;console[_0xadabb7(0xfa)]('>\x20'+_0x26b2f4+'\x20'+_0x5f581c);const _0x35d1ba=getAuthHeaders(_0x3411c5),_0x536440={..._0x35d1ba,..._0x4a1b2f};for(const [_0x428489,_0x514b5f]of Object[_0xadabb7(0x11c)](_0x536440)){!isSensitiveHeader(_0x428489)&&console['error']('>\x20'+_0x428489+':\x20'+_0x514b5f);}_0x359f63&&console[_0xadabb7(0xfa)]('>'),console[_0xadabb7(0xfa)]('');}const _0x5dd09f=await _0x14e74e[_0xadabb7(0x110)][_0xadabb7(0x118)](_0x49a34a,_0x1e8043);if(_0x57ea2f['verbose']&&_0x5dd09f['headers']){console[_0xadabb7(0xfa)]('<\x20HTTP/1.1\x20'+_0x5dd09f[_0xadabb7(0x119)]);for(const [_0x2eeb0e,_0x3c0482]of Object[_0xadabb7(0x11c)](_0x5dd09f[_0xadabb7(0x113)])){!isSensitiveHeader(_0x2eeb0e)&&console['error']('<\x20'+_0x2eeb0e+':\x20'+_0x3c0482);}console[_0xadabb7(0xfa)]('');}const _0x35d6b5=Boolean(_0x57ea2f[_0xadabb7(0x10d)]),_0x2f9581={'color':_0x57ea2f[_0xadabb7(0xec)],'noColor':_0x57ea2f['noColor']||_0x35d6b5&&!_0x57ea2f[_0xadabb7(0xec)]},_0xd0d647=colorizeJSON(_0x5dd09f[_0xadabb7(0x104)],_0x2f9581);return _0x57ea2f[_0xadabb7(0x10d)]?(writeFileSync(_0x57ea2f['output'],_0xd0d647),console[_0xadabb7(0xfa)](_0xadabb7(0x11f)+_0x57ea2f[_0xadabb7(0x10d)])):console['log'](_0xd0d647),0x0;}catch(_0x26ef2f){return _0x26ef2f instanceof Error?(console['error'](_0xadabb7(0x10c)+_0x26ef2f[_0xadabb7(0x116)]),_0x57ea2f['verbose']&&_0x26ef2f[_0xadabb7(0xfb)]&&console[_0xadabb7(0xfa)](_0xadabb7(0xf1)+_0x26ef2f[_0xadabb7(0xfb)])):console['error'](_0xadabb7(0x10c)+String(_0x26ef2f)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x467cbf=a7_0x3556;(function(_0x20206a,_0x2a619b){const _0x3159d7=a7_0x3556,_0x294c53=_0x20206a();while(!![]){try{const _0x2a72dd=-parseInt(_0x3159d7(0x170))/0x1*(parseInt(_0x3159d7(0x17a))/0x2)+parseInt(_0x3159d7(0x1a7))/0x3*(-parseInt(_0x3159d7(0x152))/0x4)+parseInt(_0x3159d7(0x16e))/0x5+-parseInt(_0x3159d7(0x1b3))/0x6+-parseInt(_0x3159d7(0x15b))/0x7*(-parseInt(_0x3159d7(0x175))/0x8)+-parseInt(_0x3159d7(0x195))/0x9*(parseInt(_0x3159d7(0x17f))/0xa)+parseInt(_0x3159d7(0x196))/0xb;if(_0x2a72dd===_0x2a619b)break;else _0x294c53['push'](_0x294c53['shift']());}catch(_0x2874ad){_0x294c53['push'](_0x294c53['shift']());}}}(a7_0xedbe,0xa92d9));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_0x3556(_0x5d45d6,_0x63224f){_0x5d45d6=_0x5d45d6-0x151;const _0xedbe1b=a7_0xedbe();let _0x3556a4=_0xedbe1b[_0x5d45d6];return _0x3556a4;}function a7_0xedbe(){const _0x302c24=['N/A','email','account_id','accountName','first_name','create','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','\x20\x20user_id:','✓\x20Signed\x20in\x20successfully','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','\x20--profile\x20','For\x20scripts\x20or\x20headless\x20servers','oauth','site','yellow','27ykjwUG','15752594rDbwON','Setting\x20up\x20authentication\x20for\x20site:\x20','tdx:\x20auth\x20clear','Sign\x20in\x20with\x20browser\x20(recommended)','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','auth:clear','filter','jobs','tdx\x20profile:\x20','✓\x20Default\x20site\x20set\x20to\x20','message','\x20(profile:\x20','Validating\x20API\x20key...','cyan','auth:setup','✗\x20Validation\x20failed:\x20','/app/mp/ak','6dNagRt','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','description','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','red','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','\x0aSetup\x20cancelled','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','Setup\x20cancelled','auth','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','7857810HrYPvD','select','last_name','apiKey','480796FFNBgu','method','API\x20key','No\x20credentials\x20found\x20in\x20keychain','API\x20key\x20cannot\x20be\x20empty','Read\x20credential\x20from\x20','/oauth/authorize','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','trim','7259ggowDK','\x20removed\x20from\x20keychain','log','Opening\x20browser\x20for\x20authentication...','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','bold','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','ERROR','Validating\x20OAuth\x20tokens...','all','getUserInfo','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','/users/initiate_sso\x20(account:\x20','\x27\x20registered','\x20\x20tdx','profile','error','status','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','6602860xmxDgA','join','5ninnTC','Remove\x20API\x20key\x20from\x20system\x20keychain','apikey','warn','green','7432ZrOFvE','password','execute','\x20\x20(','✓\x20Profile\x20\x27','545614SHDatT','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','Setup\x20API\x20key\x20authentication\x20interactively','✓\x20Authentication\x20successful\x0a','Name:\x20','363260hVFEvc','\x20(site:\x20','Read\x20credential\x20from\x20keychain','\x20and\x20','logLevel','name','dim'];a7_0xedbe=function(){return _0x302c24;};return a7_0xedbe();}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_0xf3497f 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_0x44c843 from'chalk';export async function runOAuthLoginFlow(_0xec7993,_0x379b96,_0x8f7584,_0x5ef8fa){const _0x2b6d66=a7_0x3556,_0x521f75=await isKeychainAvailable();if(!_0x521f75)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+_0x2b6d66(0x1ad));let _0x38e400=_0x5ef8fa?.['accountName'];if(!_0x38e400){const _0x206dc5=await a7_0xf3497f({'type':'text','name':_0x2b6d66(0x189),'message':_0x2b6d66(0x1b2)});if(_0x206dc5[_0x2b6d66(0x189)]===undefined)throw new Error(_0x2b6d66(0x1b0));_0x38e400=_0x206dc5[_0x2b6d66(0x189)][_0x2b6d66(0x15a)]()||undefined;}const _0x1930e4=getConsoleUrl(_0xec7993);console[_0x2b6d66(0x15d)](_0x2b6d66(0x15e));_0x38e400?console['log']('\x20\x20'+_0x1930e4+_0x2b6d66(0x167)+_0x38e400+')'):console[_0x2b6d66(0x15d)]('\x20\x20'+_0x1930e4+_0x2b6d66(0x158));console[_0x2b6d66(0x15d)]('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0x375d22=await startOAuthFlow(_0xec7993,{'accountName':_0x38e400});console['log'](_0x2b6d66(0x163));const _0x35d7b5=TDX['create']({'site':_0xec7993,'accessToken':_0x375d22['access_token'],'logLevel':_0x8f7584??LogLevel[_0x2b6d66(0x162)]}),_0x524500=await _0x35d7b5['jobs'][_0x2b6d66(0x165)]();console[_0x2b6d66(0x15d)](a7_0x44c843[_0x2b6d66(0x174)](_0x2b6d66(0x18e))),console[_0x2b6d66(0x15d)]('\x20\x20'+a7_0x44c843[_0x2b6d66(0x1a3)](_0xec7993+':'+_0x524500[_0x2b6d66(0x188)])+_0x2b6d66(0x18d)+_0x524500['id']+_0x2b6d66(0x178)+_0x524500[_0x2b6d66(0x187)]+')');!_0x38e400&&(console[_0x2b6d66(0x15d)](a7_0x44c843[_0x2b6d66(0x185)](_0x2b6d66(0x161))),console[_0x2b6d66(0x15d)](a7_0x44c843[_0x2b6d66(0x185)](_0x2b6d66(0x159))),console[_0x2b6d66(0x15d)](a7_0x44c843['dim'](_0x2b6d66(0x1aa))));await saveOAuthTokens(_0x375d22,_0x379b96),console[_0x2b6d66(0x15d)](_0x2b6d66(0x18c)+(_0x379b96?_0x2b6d66(0x1a1)+_0x379b96+')':''));if(_0x379b96){const _0x4af509={'site':_0xec7993};saveProfileToUserConfig(_0x379b96,_0x4af509),console[_0x2b6d66(0x15d)]('✓\x20Profile\x20\x27'+_0x379b96+_0x2b6d66(0x168));}else saveDefaultSiteToUserConfig(_0xec7993),console[_0x2b6d66(0x15d)](_0x2b6d66(0x19f)+_0xec7993);const _0x17a35e=_0x379b96?_0x2b6d66(0x190)+_0x379b96:'';console[_0x2b6d66(0x15d)](),console[_0x2b6d66(0x15d)](_0x2b6d66(0x17b)),console['log']('\x20\x20tdx'+_0x17a35e+_0x2b6d66(0x19a)),console[_0x2b6d66(0x15d)](_0x2b6d66(0x169)+_0x17a35e+_0x2b6d66(0x166));}export async function promptAuthMethod(){const _0x80d5e6=a7_0x3556,_0x4d3403=await a7_0xf3497f({'type':_0x80d5e6(0x1b4),'name':_0x80d5e6(0x153),'message':'Choose\x20how\x20to\x20sign\x20in:','choices':[{'title':_0x80d5e6(0x199),'description':_0x80d5e6(0x18f),'value':_0x80d5e6(0x192)},{'title':'Use\x20an\x20API\x20key','description':_0x80d5e6(0x191),'value':_0x80d5e6(0x172)}]});return _0x4d3403[_0x80d5e6(0x153)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x467cbf(0x184)]=a7_0x467cbf(0x1a4);[a7_0x467cbf(0x1a9)]=a7_0x467cbf(0x17c);async[a7_0x467cbf(0x177)](_0x589b2b){const _0x48f9dd=a7_0x467cbf,{options:_0x408f48}=_0x589b2b,_0xb61693=_0x408f48[_0x48f9dd(0x16a)];console[_0x48f9dd(0x15d)](a7_0x44c843[_0x48f9dd(0x160)]('tdx:\x20auth\x20setup'));const _0x58378a=_0x408f48[_0x48f9dd(0x193)]||'us01',_0xcc2574=await promptSiteSelection(_0x58378a,_0xb61693,'Setup\x20cancelled');if(!_0xcc2574)return 0x1;const _0x3691da=resolveSite(_0xcc2574),_0xaf2740=await promptAuthMethod();if(!_0xaf2740)return console[_0x48f9dd(0x15d)](_0x48f9dd(0x1ae)),0x1;if(_0xaf2740==='oauth'){const {accountName:_0x158dce}=_0x408f48;return await runOAuthLoginFlow(_0x3691da,_0xb61693,_0x408f48[_0x48f9dd(0x183)]??LogLevel[_0x48f9dd(0x162)],{'accountName':_0x158dce}),0x0;}console[_0x48f9dd(0x15d)](_0x48f9dd(0x197)+_0x3691da),console[_0x48f9dd(0x15d)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x48f9dd(0x15d)]('\x20\x20'+getConsoleUrl(_0x3691da,_0x48f9dd(0x1a6)));const _0x153467=await a7_0xf3497f({'type':_0x48f9dd(0x176),'name':_0x48f9dd(0x151),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x995da6=>{const _0x46af91=_0x48f9dd;if(!_0x995da6||!_0x995da6[_0x46af91(0x15a)]())return _0x46af91(0x156);return!![];}});if(!_0x153467['apiKey'])return console[_0x48f9dd(0x15d)](_0x48f9dd(0x1ae)),0x1;const _0x167b2b=_0x153467['apiKey'];console[_0x48f9dd(0x15d)](_0x48f9dd(0x1a2));try{const _0x10d50f=TDX[_0x48f9dd(0x18b)]({'site':_0x3691da,'apiKey':_0x167b2b[_0x48f9dd(0x15a)](),'logLevel':_0x408f48[_0x48f9dd(0x183)]??LogLevel[_0x48f9dd(0x162)]}),_0xe4ce5a=await _0x10d50f[_0x48f9dd(0x19d)][_0x48f9dd(0x165)]();console[_0x48f9dd(0x15d)](_0x48f9dd(0x16d)+_0xe4ce5a[_0x48f9dd(0x187)]+')');const _0x41aebf=await isKeychainAvailable();_0x41aebf?(await saveAPIKeyAsync(_0x167b2b[_0x48f9dd(0x15a)](),_0x3691da,_0xb61693),console[_0x48f9dd(0x15d)](_0x48f9dd(0x1af)+(_0xb61693?_0x48f9dd(0x1a1)+_0xb61693+')':''))):(console['warn'](a7_0x44c843['yellow'](_0x48f9dd(0x15f))),console[_0x48f9dd(0x173)](a7_0x44c843['yellow']('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0xb61693){const _0x5dc24f={'site':_0x3691da};saveProfileToUserConfig(_0xb61693,_0x5dc24f),console['log'](_0x48f9dd(0x179)+_0xb61693+_0x48f9dd(0x168));}else saveDefaultSiteToUserConfig(_0x3691da),console['log'](_0x48f9dd(0x19f)+_0x3691da);const _0x3587cf=_0xb61693?_0x48f9dd(0x190)+_0xb61693:'';return console[_0x48f9dd(0x15d)](),console[_0x48f9dd(0x15d)](_0x48f9dd(0x17b)),console[_0x48f9dd(0x15d)](_0x48f9dd(0x169)+_0x3587cf+_0x48f9dd(0x19a)),console['log'](_0x48f9dd(0x169)+_0x3587cf+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x36a87a){if(_0x36a87a instanceof HTTPClientError&&_0x36a87a['status']===0x191)return printAuthError(_0x36a87a),0x1;return console['error'](a7_0x44c843['red'](_0x48f9dd(0x1a5)+(_0x36a87a instanceof Error?_0x36a87a[_0x48f9dd(0x1a0)]:String(_0x36a87a)))),console[_0x48f9dd(0x16b)](_0x48f9dd(0x1a8)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x467cbf(0x184)]=a7_0x467cbf(0x1b1);[a7_0x467cbf(0x1a9)]=a7_0x467cbf(0x1ac);async[a7_0x467cbf(0x177)](_0x4d750a){const _0x31c8f2=a7_0x467cbf,{options:_0x4ddc3f,tdx:_0x33aafc}=_0x4d750a,_0xfc2f0b=_0x4ddc3f[_0x31c8f2(0x193)],_0x241a10=_0x4ddc3f['profile'],_0x591e88=_0x241a10?_0x241a10:_0x31c8f2(0x186);console[_0x31c8f2(0x15d)](_0x31c8f2(0x19e)+_0x591e88+_0x31c8f2(0x180)+_0xfc2f0b+')');const _0x3794c8=await getOAuthTokens(_0x241a10);if(_0x3794c8)console[_0x31c8f2(0x15d)]('Credential\x20type:\x20OAuth'),console[_0x31c8f2(0x15d)](_0x31c8f2(0x181)+(_0x241a10?_0x31c8f2(0x1a1)+_0x241a10+')':''));else{const _0x228a6b=await resolveAPIKeyAsync(_0xfc2f0b,_0x241a10);if(_0x228a6b){const {source:_0xdf5088,isDeprecated:_0x2a7d00}=_0x228a6b,_0xf40721=_0x31c8f2(0x157)+_0xdf5088;console[_0x31c8f2(0x15d)](_0x2a7d00?a7_0x44c843[_0x31c8f2(0x194)](_0xf40721):_0xf40721);}else console[_0x31c8f2(0x15d)](a7_0x44c843[_0x31c8f2(0x194)]('No\x20credential\x20found'));}try{const _0x52d48d=await _0x33aafc['jobs'][_0x31c8f2(0x165)]();return console['log'](a7_0x44c843[_0x31c8f2(0x174)](_0x31c8f2(0x17d))),console[_0x31c8f2(0x15d)]('User:\x20'+_0x52d48d['email']),(_0x52d48d[_0x31c8f2(0x18a)]||_0x52d48d['last_name'])&&console[_0x31c8f2(0x15d)](_0x31c8f2(0x17e)+[_0x52d48d[_0x31c8f2(0x18a)],_0x52d48d[_0x31c8f2(0x1b5)]][_0x31c8f2(0x19c)](Boolean)[_0x31c8f2(0x16f)]('\x20')),0x0;}catch(_0x2c19dd){return _0x2c19dd instanceof HTTPClientError&&_0x2c19dd[_0x31c8f2(0x16c)]===0x191?printAuthError(_0x2c19dd,!![],_0x241a10):console[_0x31c8f2(0x16b)](a7_0x44c843[_0x31c8f2(0x1ab)]('✗\x20Validation\x20failed:\x20'+(_0x2c19dd instanceof Error?_0x2c19dd[_0x31c8f2(0x1a0)]:String(_0x2c19dd)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x467cbf(0x19b);[a7_0x467cbf(0x1a9)]=a7_0x467cbf(0x171);async[a7_0x467cbf(0x177)](_0x3aa1a5){const _0x226511=a7_0x467cbf,{options:_0x130aa1}=_0x3aa1a5,_0x2369b5=_0x130aa1[_0x226511(0x16a)];console[_0x226511(0x15d)](a7_0x44c843[_0x226511(0x160)](_0x226511(0x198)));const _0x2138b0=await isKeychainAvailable();if(!_0x2138b0)return console[_0x226511(0x16b)](a7_0x44c843['red']('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x212b72,_0x42b9e2]=await Promise[_0x226511(0x164)]([deleteKeychainAPIKey(_0x2369b5),deleteOAuthTokens(_0x2369b5)]);if(_0x212b72||_0x42b9e2){clearCredentialCache();const _0x533fa8=[_0x212b72&&_0x226511(0x154),_0x42b9e2&&'OAuth\x20tokens'][_0x226511(0x19c)](Boolean)[_0x226511(0x16f)](_0x226511(0x182));return console[_0x226511(0x15d)]('✓\x20'+_0x533fa8+_0x226511(0x15c)+(_0x2369b5?_0x226511(0x1a1)+_0x2369b5+')':'')),0x0;}else return console[_0x226511(0x15d)](_0x226511(0x155)+(_0x2369b5?'\x20for\x20profile:\x20'+_0x2369b5:'')),0x1;}}
1
+ const a7_0xa90106=a7_0x184d;(function(_0xbbd38d,_0xf6ece9){const _0x8fa208=a7_0x184d,_0x350b88=_0xbbd38d();while(!![]){try{const _0x5684a9=-parseInt(_0x8fa208(0xc3))/0x1+parseInt(_0x8fa208(0xcc))/0x2*(-parseInt(_0x8fa208(0xd4))/0x3)+-parseInt(_0x8fa208(0xe2))/0x4+-parseInt(_0x8fa208(0xdb))/0x5+parseInt(_0x8fa208(0xe5))/0x6+-parseInt(_0x8fa208(0xe1))/0x7+parseInt(_0x8fa208(0xd9))/0x8;if(_0x5684a9===_0xf6ece9)break;else _0x350b88['push'](_0x350b88['shift']());}catch(_0x5e94b4){_0x350b88['push'](_0x350b88['shift']());}}}(a7_0x7361,0x86c84));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_0x7361(){const _0x4fd93b=['warn','✓\x20Profile\x20\x27','✓\x20Default\x20site\x20set\x20to\x20','No\x20credential\x20found','tdx:\x20auth\x20clear','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','Setup\x20cancelled','Validating\x20OAuth\x20tokens...','jobs','message','\x20(site:\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20and\x20','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','Credential\x20type:\x20OAuth','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','first_name','Opening\x20browser\x20for\x20authentication...','System\x20keychain\x20is\x20not\x20available','\x20\x20(','email','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','\x20for\x20profile:\x20','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','\x20\x20user_id:','/app/mp/ak','bold','For\x20scripts\x20or\x20headless\x20servers','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','last_name','join','apikey','871566HBKshx','\x20removed\x20from\x20keychain','yellow','password','Sign\x20in\x20with\x20browser\x20(recommended)','Setup\x20API\x20key\x20authentication\x20interactively','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','ERROR','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','48EUbiiA','log','name','trim','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','\x20(profile:\x20','Setting\x20up\x20authentication\x20for\x20site:\x20','111831EZPoho','/oauth/authorize','dim','site','✓\x20Signed\x20in\x20successfully','27551056BiHlac','No\x20credentials\x20found\x20in\x20keychain','933690GCSTVV','cyan','logLevel','description','\x20--profile\x20','Validating\x20API\x20key...','2557058yGyxLz','4228436YdHRRV','us01','select','2901246kaapXK','auth:clear','OAuth\x20tokens','execute','tdx\x20profile:\x20','profile','Remove\x20API\x20key\x20from\x20system\x20keychain','all','account_id','Choose\x20how\x20to\x20sign\x20in:','\x20\x20tdx','Read\x20credential\x20from\x20','error','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','auth:setup','tdx:\x20auth\x20setup','status','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','getUserInfo','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','✗\x20Validation\x20failed:\x20','apiKey','oauth','accountName','create','method','\x27\x20registered'];a7_0x7361=function(){return _0x4fd93b;};return a7_0x7361();}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_0x46d234 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';function a7_0x184d(_0x23c1d8,_0x3e871a){_0x23c1d8=_0x23c1d8-0xa6;const _0x7361a3=a7_0x7361();let _0x184df0=_0x7361a3[_0x23c1d8];return _0x184df0;}import a7_0x4316fc from'chalk';export async function runOAuthLoginFlow(_0x505256,_0x9810f8,_0x5382ec,_0x14b6c8){const _0x2a8a05=a7_0x184d,_0x5e434e=await isKeychainAvailable();if(!_0x5e434e)throw new Error(_0x2a8a05(0xf7)+_0x2a8a05(0xb2));let _0x27bfad=_0x14b6c8?.[_0x2a8a05(0xfd)];if(!_0x27bfad){const _0x40008a=await a7_0x46d234({'type':'text','name':_0x2a8a05(0xfd),'message':'Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):'});if(_0x40008a[_0x2a8a05(0xfd)]===undefined)throw new Error(_0x2a8a05(0xa9));_0x27bfad=_0x40008a[_0x2a8a05(0xfd)]['trim']()||undefined;}const _0x3fe372=getConsoleUrl(_0x505256);console[_0x2a8a05(0xcd)](_0x2a8a05(0xb4));_0x27bfad?console[_0x2a8a05(0xcd)]('\x20\x20'+_0x3fe372+'/users/initiate_sso\x20(account:\x20'+_0x27bfad+')'):console[_0x2a8a05(0xcd)]('\x20\x20'+_0x3fe372+_0x2a8a05(0xd5));console['log'](_0x2a8a05(0xba));const _0x36143f=await startOAuthFlow(_0x505256,{'accountName':_0x27bfad});console[_0x2a8a05(0xcd)](_0x2a8a05(0xaa));const _0x36400b=TDX['create']({'site':_0x505256,'accessToken':_0x36143f['access_token'],'logLevel':_0x5382ec??LogLevel[_0x2a8a05(0xca)]}),_0x5d789f=await _0x36400b[_0x2a8a05(0xab)][_0x2a8a05(0xf8)]();console[_0x2a8a05(0xcd)](a7_0x4316fc['green'](_0x2a8a05(0xd8))),console['log']('\x20\x20'+a7_0x4316fc[_0x2a8a05(0xdc)](_0x505256+':'+_0x5d789f[_0x2a8a05(0xed)])+_0x2a8a05(0xbb)+_0x5d789f['id']+_0x2a8a05(0xb6)+_0x5d789f[_0x2a8a05(0xb7)]+')');!_0x27bfad&&(console[_0x2a8a05(0xcd)](a7_0x4316fc[_0x2a8a05(0xd6)](_0x2a8a05(0xa8))),console[_0x2a8a05(0xcd)](a7_0x4316fc[_0x2a8a05(0xd6)](_0x2a8a05(0xb8))),console['log'](a7_0x4316fc['dim']('\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions')));await saveOAuthTokens(_0x36143f,_0x9810f8),console[_0x2a8a05(0xcd)](_0x2a8a05(0xd0)+(_0x9810f8?_0x2a8a05(0xd2)+_0x9810f8+')':''));if(_0x9810f8){const _0x39833b={'site':_0x505256};saveProfileToUserConfig(_0x9810f8,_0x39833b),console[_0x2a8a05(0xcd)]('✓\x20Profile\x20\x27'+_0x9810f8+_0x2a8a05(0x100));}else saveDefaultSiteToUserConfig(_0x505256),console[_0x2a8a05(0xcd)](_0x2a8a05(0x103)+_0x505256);const _0x5c1d6c=_0x9810f8?_0x2a8a05(0xdf)+_0x9810f8:'';console[_0x2a8a05(0xcd)](),console[_0x2a8a05(0xcd)](_0x2a8a05(0xf3)),console[_0x2a8a05(0xcd)](_0x2a8a05(0xef)+_0x5c1d6c+_0x2a8a05(0xc9)),console[_0x2a8a05(0xcd)](_0x2a8a05(0xef)+_0x5c1d6c+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export async function promptAuthMethod(){const _0x1b88ca=a7_0x184d,_0xb3d879=await a7_0x46d234({'type':_0x1b88ca(0xe4),'name':_0x1b88ca(0xff),'message':_0x1b88ca(0xee),'choices':[{'title':_0x1b88ca(0xc7),'description':'Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','value':_0x1b88ca(0xfc)},{'title':'Use\x20an\x20API\x20key','description':_0x1b88ca(0xbe),'value':_0x1b88ca(0xc2)}]});return _0xb3d879[_0x1b88ca(0xff)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0xa90106(0xce)]=a7_0xa90106(0xf4);['description']=a7_0xa90106(0xc8);async[a7_0xa90106(0xe8)](_0x498220){const _0x4c3ff1=a7_0xa90106,{options:_0x34afe2}=_0x498220,_0x13144c=_0x34afe2[_0x4c3ff1(0xea)];console['log'](a7_0x4316fc[_0x4c3ff1(0xbd)](_0x4c3ff1(0xf5)));const _0x2c89ca=_0x34afe2[_0x4c3ff1(0xd7)]||_0x4c3ff1(0xe3),_0x1ef27b=await promptSiteSelection(_0x2c89ca,_0x13144c,_0x4c3ff1(0xa9));if(!_0x1ef27b)return 0x1;const _0x186242=resolveSite(_0x1ef27b),_0x4b893e=await promptAuthMethod();if(!_0x4b893e)return console[_0x4c3ff1(0xcd)]('\x0aSetup\x20cancelled'),0x1;if(_0x4b893e==='oauth'){const {accountName:_0x470c87}=_0x34afe2;return await runOAuthLoginFlow(_0x186242,_0x13144c,_0x34afe2[_0x4c3ff1(0xdd)]??LogLevel['ERROR'],{'accountName':_0x470c87}),0x0;}console[_0x4c3ff1(0xcd)](_0x4c3ff1(0xd3)+_0x186242),console['log'](_0x4c3ff1(0xae)),console[_0x4c3ff1(0xcd)]('\x20\x20'+getConsoleUrl(_0x186242,_0x4c3ff1(0xbc)));const _0x45efff=await a7_0x46d234({'type':_0x4c3ff1(0xc6),'name':'apiKey','message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x59fdfc=>{if(!_0x59fdfc||!_0x59fdfc['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x45efff[_0x4c3ff1(0xfb)])return console['log']('\x0aSetup\x20cancelled'),0x1;const _0x4cdef6=_0x45efff['apiKey'];console[_0x4c3ff1(0xcd)](_0x4c3ff1(0xe0));try{const _0x531c69=TDX[_0x4c3ff1(0xfe)]({'site':_0x186242,'apiKey':_0x4cdef6[_0x4c3ff1(0xcf)](),'logLevel':_0x34afe2['logLevel']??LogLevel[_0x4c3ff1(0xca)]}),_0x12ab75=await _0x531c69[_0x4c3ff1(0xab)][_0x4c3ff1(0xf8)]();console['log'](_0x4c3ff1(0xb0)+_0x12ab75[_0x4c3ff1(0xb7)]+')');const _0x494e86=await isKeychainAvailable();_0x494e86?(await saveAPIKeyAsync(_0x4cdef6['trim'](),_0x186242,_0x13144c),console['log'](_0x4c3ff1(0xf2)+(_0x13144c?_0x4c3ff1(0xd2)+_0x13144c+')':''))):(console[_0x4c3ff1(0x101)](a7_0x4316fc['yellow']('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x4c3ff1(0x101)](a7_0x4316fc[_0x4c3ff1(0xc5)](_0x4c3ff1(0xd1))));if(_0x13144c){const _0x71f433={'site':_0x186242};saveProfileToUserConfig(_0x13144c,_0x71f433),console['log'](_0x4c3ff1(0x102)+_0x13144c+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x186242),console['log'](_0x4c3ff1(0x103)+_0x186242);const _0x4a0aba=_0x13144c?_0x4c3ff1(0xdf)+_0x13144c:'';return console[_0x4c3ff1(0xcd)](),console[_0x4c3ff1(0xcd)](_0x4c3ff1(0xf3)),console[_0x4c3ff1(0xcd)](_0x4c3ff1(0xef)+_0x4a0aba+_0x4c3ff1(0xc9)),console['log'](_0x4c3ff1(0xef)+_0x4a0aba+_0x4c3ff1(0xbf)),0x0;}catch(_0x3260ce){if(_0x3260ce instanceof HTTPClientError&&_0x3260ce[_0x4c3ff1(0xf6)]===0x191)return printAuthError(_0x3260ce),0x1;return console[_0x4c3ff1(0xf1)](a7_0x4316fc['red'](_0x4c3ff1(0xfa)+(_0x3260ce instanceof Error?_0x3260ce[_0x4c3ff1(0xac)]:String(_0x3260ce)))),console['error'](_0x4c3ff1(0xf9)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0xa90106(0xce)]='auth';[a7_0xa90106(0xde)]=a7_0xa90106(0xcb);async['execute'](_0x2cd591){const _0x4666f1=a7_0xa90106,{options:_0xc22406,tdx:_0x3d9a3e}=_0x2cd591,_0x2c1352=_0xc22406[_0x4666f1(0xd7)],_0x25e92b=_0xc22406['profile'],_0x256f9c=_0x25e92b?_0x25e92b:'N/A';console[_0x4666f1(0xcd)](_0x4666f1(0xe9)+_0x256f9c+_0x4666f1(0xad)+_0x2c1352+')');const _0x263189=await getOAuthTokens(_0x25e92b);if(_0x263189)console[_0x4666f1(0xcd)](_0x4666f1(0xb1)),console[_0x4666f1(0xcd)]('Read\x20credential\x20from\x20keychain'+(_0x25e92b?_0x4666f1(0xd2)+_0x25e92b+')':''));else{const _0x340027=await resolveAPIKeyAsync(_0x2c1352,_0x25e92b);if(_0x340027){const {source:_0x381daf,isDeprecated:_0x2ade3e}=_0x340027,_0x8ec17e=_0x4666f1(0xf0)+_0x381daf;console[_0x4666f1(0xcd)](_0x2ade3e?a7_0x4316fc[_0x4666f1(0xc5)](_0x8ec17e):_0x8ec17e);}else console[_0x4666f1(0xcd)](a7_0x4316fc['yellow'](_0x4666f1(0xa6)));}try{const _0x41ff92=await _0x3d9a3e['jobs'][_0x4666f1(0xf8)]();return console[_0x4666f1(0xcd)](a7_0x4316fc['green']('✓\x20Authentication\x20successful\x0a')),console[_0x4666f1(0xcd)]('User:\x20'+_0x41ff92[_0x4666f1(0xb7)]),(_0x41ff92[_0x4666f1(0xb3)]||_0x41ff92[_0x4666f1(0xc0)])&&console[_0x4666f1(0xcd)]('Name:\x20'+[_0x41ff92[_0x4666f1(0xb3)],_0x41ff92['last_name']]['filter'](Boolean)[_0x4666f1(0xc1)]('\x20')),0x0;}catch(_0x26d780){return _0x26d780 instanceof HTTPClientError&&_0x26d780[_0x4666f1(0xf6)]===0x191?printAuthError(_0x26d780,!![],_0x25e92b):console[_0x4666f1(0xf1)](a7_0x4316fc['red']('✗\x20Validation\x20failed:\x20'+(_0x26d780 instanceof Error?_0x26d780[_0x4666f1(0xac)]:String(_0x26d780)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0xa90106(0xce)]=a7_0xa90106(0xe6);['description']=a7_0xa90106(0xeb);async[a7_0xa90106(0xe8)](_0x42fe3f){const _0x1058b4=a7_0xa90106,{options:_0x531110}=_0x42fe3f,_0x18d83b=_0x531110[_0x1058b4(0xea)];console[_0x1058b4(0xcd)](a7_0x4316fc[_0x1058b4(0xbd)](_0x1058b4(0xa7)));const _0x255783=await isKeychainAvailable();if(!_0x255783)return console['error'](a7_0x4316fc['red'](_0x1058b4(0xb5))),0x1;const [_0x20e20a,_0x52fb63]=await Promise[_0x1058b4(0xec)]([deleteKeychainAPIKey(_0x18d83b),deleteOAuthTokens(_0x18d83b)]);if(_0x20e20a||_0x52fb63){clearCredentialCache();const _0x1929af=[_0x20e20a&&'API\x20key',_0x52fb63&&_0x1058b4(0xe7)]['filter'](Boolean)['join'](_0x1058b4(0xaf));return console[_0x1058b4(0xcd)]('✓\x20'+_0x1929af+_0x1058b4(0xc4)+(_0x18d83b?_0x1058b4(0xd2)+_0x18d83b+')':'')),0x0;}else return console[_0x1058b4(0xcd)](_0x1058b4(0xda)+(_0x18d83b?_0x1058b4(0xb9)+_0x18d83b:'')),0x1;}}