@treasuredata/tdx 2026.4.22 → 2026.4.23

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 (224) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.d.ts +7 -0
  81. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  82. package/dist/proxy/passthrough-server.js +1 -1
  83. package/dist/proxy/passthrough-server.js.map +1 -1
  84. package/dist/proxy/sse-usage-parser.js +1 -1
  85. package/dist/sdk/agent/agent-config.js +1 -1
  86. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  87. package/dist/sdk/agent/agent-yaml.js +1 -1
  88. package/dist/sdk/agent/test/evaluator.js +1 -1
  89. package/dist/sdk/agent/test/executor.js +1 -1
  90. package/dist/sdk/agent/test/index.js +1 -1
  91. package/dist/sdk/agent/test/output.js +1 -1
  92. package/dist/sdk/agent/test/parser.js +1 -1
  93. package/dist/sdk/agent/tool-target-registry.js +1 -1
  94. package/dist/sdk/api.js +1 -1
  95. package/dist/sdk/cas/cas-api-client.js +1 -1
  96. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  97. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  98. package/dist/sdk/cas/index.js +1 -1
  99. package/dist/sdk/cas/pull-workflow.js +1 -1
  100. package/dist/sdk/cas/push-workflow.js +1 -1
  101. package/dist/sdk/client/cdp-api-client.js +1 -1
  102. package/dist/sdk/client/delivery-api-client.js +1 -1
  103. package/dist/sdk/client/endpoints.js +1 -1
  104. package/dist/sdk/client/engage-api-client.js +1 -1
  105. package/dist/sdk/client/http-client.js +1 -1
  106. package/dist/sdk/client/llm-api-client.js +1 -1
  107. package/dist/sdk/client/oauth-refresh.js +1 -1
  108. package/dist/sdk/client/rate-limiter.js +1 -1
  109. package/dist/sdk/client/td-api-client.js +1 -1
  110. package/dist/sdk/client/trino-api-client.js +1 -1
  111. package/dist/sdk/client/workflow-client.js +1 -1
  112. package/dist/sdk/connection-validator.js +1 -1
  113. package/dist/sdk/connection.js +1 -1
  114. package/dist/sdk/delivery.js +1 -1
  115. package/dist/sdk/engage/campaign-pull.js +1 -1
  116. package/dist/sdk/engage/campaign-push.js +1 -1
  117. package/dist/sdk/engage/campaign-validator.js +1 -1
  118. package/dist/sdk/engage/campaign-yaml.js +1 -1
  119. package/dist/sdk/engage/template-pull.js +1 -1
  120. package/dist/sdk/engage/template-push.js +1 -1
  121. package/dist/sdk/engage/template-validator.js +1 -1
  122. package/dist/sdk/engage/template-yaml.js +1 -1
  123. package/dist/sdk/engage/types/campaign-def.js +1 -1
  124. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  125. package/dist/sdk/engage/types/template-schema.js +1 -1
  126. package/dist/sdk/engage.js +1 -1
  127. package/dist/sdk/errors.js +1 -1
  128. package/dist/sdk/index.js +1 -1
  129. package/dist/sdk/io/index.js +1 -1
  130. package/dist/sdk/io/node-filesystem.js +1 -1
  131. package/dist/sdk/job.js +1 -1
  132. package/dist/sdk/journey.js +1 -1
  133. package/dist/sdk/llm/chat-cache.js +1 -1
  134. package/dist/sdk/llm/index.js +1 -1
  135. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  136. package/dist/sdk/llm/model-factors.js +1 -1
  137. package/dist/sdk/personalization.js +1 -1
  138. package/dist/sdk/policy.js +1 -1
  139. package/dist/sdk/query/index.js +1 -1
  140. package/dist/sdk/query/sql-parser.js +1 -1
  141. package/dist/sdk/realtime.js +1 -1
  142. package/dist/sdk/schedule.js +1 -1
  143. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  144. package/dist/sdk/segment/fields-display.js +1 -1
  145. package/dist/sdk/segment/file-discovery.js +1 -1
  146. package/dist/sdk/segment/journey-utils.js +1 -1
  147. package/dist/sdk/segment/journey-validator.js +1 -1
  148. package/dist/sdk/segment/journey-yaml.js +1 -1
  149. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  150. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  151. package/dist/sdk/segment/pull-workflow.js +1 -1
  152. package/dist/sdk/segment/push-recovery.js +1 -1
  153. package/dist/sdk/segment/push-workflow.js +1 -1
  154. package/dist/sdk/segment/resolution-context.js +1 -1
  155. package/dist/sdk/segment/segment-path-parser.js +1 -1
  156. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  157. package/dist/sdk/segment/segment-validator.js +1 -1
  158. package/dist/sdk/segment/target-resolution.js +1 -1
  159. package/dist/sdk/segment/tdx-config.js +1 -1
  160. package/dist/sdk/segment/types/activation-schema.js +1 -1
  161. package/dist/sdk/segment/types/journey-def.js +1 -1
  162. package/dist/sdk/segment/types/journey-schema.js +1 -1
  163. package/dist/sdk/segment/types/segment-def.js +1 -1
  164. package/dist/sdk/segment/types/segment-schema.js +1 -1
  165. package/dist/sdk/segment/validate-files.js +1 -1
  166. package/dist/sdk/segment/yaml-validator.js +1 -1
  167. package/dist/sdk/segment.js +1 -1
  168. package/dist/sdk/types/index.js +1 -1
  169. package/dist/sdk/types/progress.js +1 -1
  170. package/dist/sdk/types/workspace.js +1 -1
  171. package/dist/sdk/user.js +1 -1
  172. package/dist/sdk/util/format-detector.js +1 -1
  173. package/dist/sdk/util/formatters.js +1 -1
  174. package/dist/sdk/util/index.js +1 -1
  175. package/dist/sdk/util/paginate.js +1 -1
  176. package/dist/sdk/util/tree-formatter.js +1 -1
  177. package/dist/sdk/workflow/archive-validation.js +1 -1
  178. package/dist/sdk/workflow/clone-workflow.js +1 -1
  179. package/dist/sdk/workflow/index.js +1 -1
  180. package/dist/sdk/workflow/pull-workflow.js +1 -1
  181. package/dist/sdk/workflow/push-workflow.js +1 -1
  182. package/dist/sdk/workflow/task-graph.js +1 -1
  183. package/dist/sdk/workflow/tdx-config.js +1 -1
  184. package/dist/sdk/workflow/workflow-utils.js +1 -1
  185. package/dist/sdk/workspace/access-tracker.js +1 -1
  186. package/dist/sdk/workspace/frontmatter.js +1 -1
  187. package/dist/sdk/workspace/git.js +1 -1
  188. package/dist/sdk/workspace/index.js +1 -1
  189. package/dist/sdk/workspace/templates.js +1 -1
  190. package/dist/sdk/workspace/weekly.js +1 -1
  191. package/dist/sdk/workspace/wikilinks.js +1 -1
  192. package/dist/test-utils/command-runner.js +1 -1
  193. package/dist/test-utils/factories.js +1 -1
  194. package/dist/test-utils/fixtures.js +1 -1
  195. package/dist/test-utils/http-mock.js +1 -1
  196. package/dist/test-utils/index.js +1 -1
  197. package/dist/utils/async.js +1 -1
  198. package/dist/utils/colors.js +1 -1
  199. package/dist/utils/diff.js +1 -1
  200. package/dist/utils/file-permissions.js +1 -1
  201. package/dist/utils/file-reader.js +1 -1
  202. package/dist/utils/github-releases.js +1 -1
  203. package/dist/utils/global-cache.js +1 -1
  204. package/dist/utils/json-loader.js +1 -1
  205. package/dist/utils/local-cache.js +1 -1
  206. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  207. package/dist/utils/logger/formatters/index.js +1 -1
  208. package/dist/utils/logger/handlers/console-handler.js +1 -1
  209. package/dist/utils/logger/handlers/file-handler.js +1 -1
  210. package/dist/utils/logger/handlers/index.js +1 -1
  211. package/dist/utils/logger/handlers/null-handler.js +1 -1
  212. package/dist/utils/logger/index.js +1 -1
  213. package/dist/utils/logger/logger.js +1 -1
  214. package/dist/utils/logger/types.js +1 -1
  215. package/dist/utils/option-validation.js +1 -1
  216. package/dist/utils/process.js +1 -1
  217. package/dist/utils/prompt.js +1 -1
  218. package/dist/utils/spinner.js +1 -1
  219. package/dist/utils/sse-parser.js +1 -1
  220. package/dist/utils/string-utils.js +1 -1
  221. package/dist/utils/table-ref-parser.js +1 -1
  222. package/dist/utils/tdx-logger.js +1 -1
  223. package/dist/utils/version-check.js +1 -1
  224. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x4ef6c4=a3_0x2e43;(function(_0x4c0ef6,_0x458487){const _0x484ce4=a3_0x2e43,_0x5bf65c=_0x4c0ef6();while(!![]){try{const _0x30f132=-parseInt(_0x484ce4(0xc3))/0x1*(parseInt(_0x484ce4(0xbd))/0x2)+parseInt(_0x484ce4(0xd2))/0x3*(-parseInt(_0x484ce4(0xc8))/0x4)+parseInt(_0x484ce4(0xbe))/0x5+parseInt(_0x484ce4(0xc1))/0x6*(-parseInt(_0x484ce4(0xd6))/0x7)+-parseInt(_0x484ce4(0xc9))/0x8+parseInt(_0x484ce4(0xcd))/0x9+parseInt(_0x484ce4(0xc6))/0xa;if(_0x30f132===_0x458487)break;else _0x5bf65c['push'](_0x5bf65c['shift']());}catch(_0x46eb0a){_0x5bf65c['push'](_0x5bf65c['shift']());}}}(a3_0x468f,0x2478e));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_0x468f(){const _0x35f288=['118MAnZNy','1481105IPDEdF','verbose','site','54822iRJPHj','Resolved\x20child\x20ID:\x20','257tGtsAE','Listing\x20activations\x20for\x20segment\x20\x27','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','567050GLDBgO','segment','52kKmkLB','808352DdNWpw','Site:\x20','Error:\x20Segment\x20name\x20is\x20required','listActivations','2383065KGWLeD','activations','name','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','description','49629BsreQP','data','length','List\x20activations\x20for\x20a\x20segment','105yCDzGD','Parent\x20name:\x20','cause','message','Error:\x20','Resolving\x20parent\x20segment\x20\x27','Child\x20name:\x20','error','\x27...','\x20activation'];a3_0x468f=function(){return _0x35f288;};return a3_0x468f();}function a3_0x2e43(_0x3365fd,_0x360ec1){_0x3365fd=_0x3365fd-0xb5;const _0x468fd5=a3_0x468f();let _0x2e4390=_0x468fd5[_0x3365fd];return _0x2e4390;}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x4ef6c4(0xcf)]=a3_0x4ef6c4(0xce);[a3_0x4ef6c4(0xd1)]=a3_0x4ef6c4(0xd5);async['execute'](_0x1fc29d){const _0x54cc4f=a3_0x4ef6c4,{options:_0x37a3c5,args:_0x441d5a,tdx:_0x4257b0}=_0x1fc29d;if(_0x441d5a[_0x54cc4f(0xd4)]===0x0)return console[_0x54cc4f(0xba)](_0x54cc4f(0xcb)),console['error'](_0x54cc4f(0xc5)),0x1;try{const {parentId:_0x8f73d5,childId:_0x24faf0}=parseSegmentRef(_0x441d5a[0x0]);if(!_0x24faf0)return console[_0x54cc4f(0xba)](_0x54cc4f(0xd0)),console[_0x54cc4f(0xba)](_0x54cc4f(0xc5)),0x1;_0x37a3c5[_0x54cc4f(0xbf)]&&(console['error'](_0x54cc4f(0xca)+_0x37a3c5[_0x54cc4f(0xc0)]),console[_0x54cc4f(0xba)](_0x54cc4f(0xd7)+_0x8f73d5),console[_0x54cc4f(0xba)](_0x54cc4f(0xb9)+_0x24faf0));const _0x34c17f=await withSpinner(_0x54cc4f(0xb8)+_0x8f73d5+_0x54cc4f(0xbb),()=>_0x4257b0['segment']['resolveParentId'](_0x8f73d5),{'verbose':_0x37a3c5['verbose']}),_0x128e6b=_0x34c17f['data'];_0x37a3c5[_0x54cc4f(0xbf)]&&console[_0x54cc4f(0xba)]('Resolved\x20parent\x20ID:\x20'+_0x128e6b);const _0x389d73=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x24faf0+_0x54cc4f(0xbb),()=>_0x4257b0[_0x54cc4f(0xc7)]['resolveSegmentId'](_0x128e6b,_0x24faf0),{'verbose':_0x37a3c5[_0x54cc4f(0xbf)]}),_0x453a4c=_0x389d73[_0x54cc4f(0xd3)];_0x37a3c5[_0x54cc4f(0xbf)]&&console[_0x54cc4f(0xba)](_0x54cc4f(0xc2)+_0x453a4c);const _0x3410f7=await withSpinner(_0x54cc4f(0xc4)+_0x24faf0+_0x54cc4f(0xbb),()=>_0x4257b0[_0x54cc4f(0xc7)][_0x54cc4f(0xcc)](_0x128e6b,_0x453a4c),{'verbose':_0x37a3c5[_0x54cc4f(0xbf)]}),_0xf8ad8f=_0x3410f7['data'];return console['error']('✔\x20Found\x20'+_0xf8ad8f[_0x54cc4f(0xd4)]+_0x54cc4f(0xbc)+(_0xf8ad8f['length']!==0x1?'s':'')),await handleSDKOutput(_0xf8ad8f,_0x37a3c5),0x0;}catch(_0x45aa0d){if(_0x45aa0d instanceof SDKError)return console['error'](_0x54cc4f(0xb7)+_0x45aa0d[_0x54cc4f(0xb6)]),_0x45aa0d[_0x54cc4f(0xb5)]&&console[_0x54cc4f(0xba)]('\x20\x20Cause:\x20'+_0x45aa0d[_0x54cc4f(0xb5)]),0x1;throw _0x45aa0d;}}}
1
+ const a3_0x2d7eba=a3_0x72ae;(function(_0x2a5160,_0x47e5e2){const _0xdff240=a3_0x72ae,_0x25d6d2=_0x2a5160();while(!![]){try{const _0x33f53c=-parseInt(_0xdff240(0x10b))/0x1*(-parseInt(_0xdff240(0x10e))/0x2)+-parseInt(_0xdff240(0x122))/0x3*(parseInt(_0xdff240(0x100))/0x4)+parseInt(_0xdff240(0x115))/0x5*(-parseInt(_0xdff240(0x10d))/0x6)+parseInt(_0xdff240(0x105))/0x7*(-parseInt(_0xdff240(0x11f))/0x8)+-parseInt(_0xdff240(0x106))/0x9+-parseInt(_0xdff240(0x112))/0xa*(-parseInt(_0xdff240(0x121))/0xb)+parseInt(_0xdff240(0x116))/0xc;if(_0x33f53c===_0x47e5e2)break;else _0x25d6d2['push'](_0x25d6d2['shift']());}catch(_0x3594be){_0x25d6d2['push'](_0x25d6d2['shift']());}}}(a3_0x5d14,0xdf821));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x2d7eba(0x117)]=a3_0x2d7eba(0x11a);[a3_0x2d7eba(0x11e)]=a3_0x2d7eba(0x101);async[a3_0x2d7eba(0xfe)](_0x2199ef){const _0x6528f=a3_0x2d7eba,{options:_0x398052,args:_0x24309c,tdx:_0xb7c670}=_0x2199ef;if(_0x24309c['length']===0x0)return console[_0x6528f(0xff)](_0x6528f(0x120)),console[_0x6528f(0xff)](_0x6528f(0xfd)),0x1;try{const {parentId:_0x29cd94,childId:_0x1caafc}=parseSegmentRef(_0x24309c[0x0]);if(!_0x1caafc)return console['error'](_0x6528f(0x118)),console[_0x6528f(0xff)](_0x6528f(0xfd)),0x1;_0x398052[_0x6528f(0x114)]&&(console['error'](_0x6528f(0x11c)+_0x398052[_0x6528f(0x10a)]),console[_0x6528f(0xff)](_0x6528f(0x10f)+_0x29cd94),console[_0x6528f(0xff)](_0x6528f(0x109)+_0x1caafc));const _0x1802d5=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x29cd94+_0x6528f(0x107),()=>_0xb7c670[_0x6528f(0x104)][_0x6528f(0x11b)](_0x29cd94),{'verbose':_0x398052['verbose']}),_0xa7bd68=_0x1802d5['data'];_0x398052['verbose']&&console[_0x6528f(0xff)](_0x6528f(0x111)+_0xa7bd68);const _0x7e4f5d=await withSpinner(_0x6528f(0x110)+_0x1caafc+_0x6528f(0x107),()=>_0xb7c670[_0x6528f(0x104)][_0x6528f(0x108)](_0xa7bd68,_0x1caafc),{'verbose':_0x398052[_0x6528f(0x114)]}),_0x4f9ced=_0x7e4f5d[_0x6528f(0x119)];_0x398052[_0x6528f(0x114)]&&console[_0x6528f(0xff)]('Resolved\x20child\x20ID:\x20'+_0x4f9ced);const _0xab9ef9=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x1caafc+_0x6528f(0x107),()=>_0xb7c670[_0x6528f(0x104)]['listActivations'](_0xa7bd68,_0x4f9ced),{'verbose':_0x398052[_0x6528f(0x114)]}),_0x1fa05a=_0xab9ef9[_0x6528f(0x119)];return console['error'](_0x6528f(0x102)+_0x1fa05a[_0x6528f(0x103)]+'\x20activation'+(_0x1fa05a[_0x6528f(0x103)]!==0x1?'s':'')),await handleSDKOutput(_0x1fa05a,_0x398052),0x0;}catch(_0x4779db){if(_0x4779db instanceof SDKError)return console[_0x6528f(0xff)](_0x6528f(0x10c)+_0x4779db['message']),_0x4779db[_0x6528f(0x11d)]&&console[_0x6528f(0xff)](_0x6528f(0x113)+_0x4779db[_0x6528f(0x11d)]),0x1;throw _0x4779db;}}}function a3_0x72ae(_0x4fa5a0,_0x12de2f){_0x4fa5a0=_0x4fa5a0-0xfd;const _0x5d1474=a3_0x5d14();let _0x72aee7=_0x5d1474[_0x4fa5a0];return _0x72aee7;}function a3_0x5d14(){const _0x424ea9=['47878620qlWmsR','name','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','data','activations','resolveParentId','Site:\x20','cause','description','9587056MBcCTE','Error:\x20Segment\x20name\x20is\x20required','128381swbSjH','849081UzClFJ','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','execute','error','4IdJquY','List\x20activations\x20for\x20a\x20segment','✔\x20Found\x20','length','segment','7zYyCLG','11581083IIVBFc','\x27...','resolveSegmentId','Child\x20name:\x20','site','17IjNVLf','Error:\x20','6ijfGkE','302Xtdvgt','Parent\x20name:\x20','Resolving\x20child\x20segment\x20\x27','Resolved\x20parent\x20ID:\x20','590owqwUv','\x20\x20Cause:\x20','verbose','4986780sATfHR'];a3_0x5d14=function(){return _0x424ea9;};return a3_0x5d14();}
@@ -1 +1 @@
1
- const a4_0x128688=a4_0xe8fa;(function(_0xc7e1a8,_0xff29bb){const _0x36b54d=a4_0xe8fa,_0x5c01b7=_0xc7e1a8();while(!![]){try{const _0xbaa4a2=-parseInt(_0x36b54d(0x232))/0x1*(-parseInt(_0x36b54d(0x22b))/0x2)+-parseInt(_0x36b54d(0x1b8))/0x3*(-parseInt(_0x36b54d(0x22c))/0x4)+-parseInt(_0x36b54d(0x1e1))/0x5+-parseInt(_0x36b54d(0x1f8))/0x6+parseInt(_0x36b54d(0x1e5))/0x7+-parseInt(_0x36b54d(0x1fa))/0x8*(parseInt(_0x36b54d(0x1b4))/0x9)+parseInt(_0x36b54d(0x1fd))/0xa;if(_0xbaa4a2===_0xff29bb)break;else _0x5c01b7['push'](_0x5c01b7['shift']());}catch(_0x1cb2ed){_0x5c01b7['push'](_0x5c01b7['shift']());}}}(a4_0x3fa1,0x1ff2b));import a4_0x3ab4a1 from'chalk';import a4_0x18183f from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';function a4_0x3fa1(){const _0x3f8017=['message','1208430QYdMiy','\x0aChanges\x20to\x20integration\x20\x27','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\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','1783019wOIPsS','site','Errors:','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x20\x20Form\x20Interfaces:\x20','repeat','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x0a✔\x20Pulled\x20','\x0aChanges:','parse','profile','pullProject','source','\x20|\x20','agents','Summary:','\x20\x20Integrations:\x20','projectDir','Cloning\x20\x22','826584ZspBFo','errors','432616SDKPys','\x20\x20tdx\x20agent\x20pull\x20','projectName','1162580LQTwZZ','Agent\x20','\x20unchanged','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Failed\x20to\x20push\x20agent:\x20','\x0aProject\x20pushed\x20with\x20errors','cwd-config','outputPath','Using\x20project\x20from\x20','textKnowledgeBases','INVALID_ARGUMENT','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Output:\x20','MISSING_ARGUMENT','newProjectId','red','\x0a✔\x20Pushed\x20','utf-8','llmProject','newProjectName','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\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)','join','action','gray','push','integrations','Output\x20path:\x20','\x0aChanges\x20to\x20prompt\x20\x27','\x20\x20Source:\x20','llm','Cancelled','Dry\x20run\x20-\x20no\x20files\x20written','updated','\x20\x20Knowledge\x20Bases:\x20','-\x20nothing\x20pushed','llm_project','Cannot\x20clone\x20from\x20context\x20project\x20\x22','session','\x0aError:','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20created','unchanged','Pulling\x20agent\x20\x22','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','5470tPVftH','390744CDrmrO','\x0aChanges\x20to\x20chat\x20interface\x20\x27','tdx.json','total','agent','Project:\x20','35eLtcMv','Project\x20cloned\x20successfully','counts','\x20\x20Experimental\x20Artifacts:\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','\x22:\x20','new','no_local_folder','diff','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20total','output','Writing\x20files...','dim','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','description','arg-dir','\x20=\x20','agent:pull','\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','\x0aWrite\x20','force','knowledgeBases','Analyzing\x20changes\x20to\x20push...','Clone\x20\x22','\x20\x20Form\x20Interface\x20\x22','\x20\x20Integration\x20\x22','projectId','\x20new','Pushing\x20to\x20project...','\x20successfully','outputDir','pushProject','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','name','Agent\x20pulled\x20successfully','Dry\x20run\x20-\x20no\x20changes\x20made','experimentalKnowledgeBases','chatInterfaces','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20--profile\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','New\x20project\x20name\x20is\x20required','Would\x20clone:','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Would\x20pull\x20agent:\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','dryRun','\x0aPush\x20','\x0aChanges\x20to\x20form\x20interface\x20\x27','error','Chat:\x20','prompts','created','yes','sourceProjectName','\x0aPush\x20summary\x20for\x20\x27','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Using\x20local\x20project:\x20','agent:clone','Pushing\x20agent\x20from\x20\x22','\x20changed','\x20\x20Knowledge\x20Base\x20\x22','no_context','9gbDcks','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','log','cyan','3ZDdacO','dirname','isNew','green','\x20\x20Agent\x20\x22','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','Analyzing\x20project\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','pushAgent','\x20\x20Chat\x20Interfaces:\x20','Using\x20project:\x20','agentName','experimentalArtifacts','\x20\x20Chat\x20Interface\x20\x22','\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\x20Prompts:\x20','\x0aChanges\x20to\x20agent\x20\x27','\x22...','agent.yml','agentId','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','execute','cwd','\x20\x20tdx\x20agent\x20clone\x20agents/','Status:\x20','\x20\x20Prompt\x20\x22','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','<new-name>','formInterfaces','\x20files\x20to\x20','\x20\x20Agents:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x20resources?','✔\x20Context\x20set:\x20','New\x20project:\x20','yellow','cloneProject','Source:\x20','found','context'];a4_0x3fa1=function(){return _0x3f8017;};return a4_0x3fa1();}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(_0x46e5a7){const _0x89bd7d=a4_0xe8fa,_0x3145d9=[];if(_0x46e5a7[_0x89bd7d(0x22f)]!==undefined)_0x3145d9[_0x89bd7d(0x217)](_0x46e5a7[_0x89bd7d(0x22f)]+_0x89bd7d(0x17e));if(_0x46e5a7['new']!==undefined&&_0x46e5a7['new']>0x0)_0x3145d9['push'](a4_0x3ab4a1[_0x89bd7d(0x1bb)](_0x46e5a7[_0x89bd7d(0x17a)]+'\x20new'));if(_0x46e5a7['created']!==undefined&&_0x46e5a7['created']>0x0)_0x3145d9['push'](a4_0x3ab4a1[_0x89bd7d(0x1bb)](_0x46e5a7[_0x89bd7d(0x1a9)]+_0x89bd7d(0x227)));if(_0x46e5a7['updated']!==undefined&&_0x46e5a7[_0x89bd7d(0x21f)]>0x0)_0x3145d9['push'](a4_0x3ab4a1[_0x89bd7d(0x1db)](_0x46e5a7[_0x89bd7d(0x21f)]+'\x20updated'));if(_0x46e5a7[_0x89bd7d(0x228)]!==undefined&&_0x46e5a7['unchanged']>0x0)_0x3145d9['push'](a4_0x3ab4a1[_0x89bd7d(0x216)](_0x46e5a7[_0x89bd7d(0x228)]+_0x89bd7d(0x1ff)));if(_0x46e5a7[_0x89bd7d(0x1f9)]!==undefined&&_0x46e5a7[_0x89bd7d(0x1f9)]>0x0)_0x3145d9[_0x89bd7d(0x217)](a4_0x3ab4a1[_0x89bd7d(0x20c)](_0x46e5a7[_0x89bd7d(0x1f9)]+'\x20errors'));return _0x3145d9[_0x89bd7d(0x214)](',\x20');}function a4_0xe8fa(_0x209b83,_0x17e6e6){_0x209b83=_0x209b83-0x178;const _0x3fa168=a4_0x3fa1();let _0xe8faea=_0x3fa168[_0x209b83];return _0xe8faea;}function displayDiffs(_0x1fafbb,_0x4d5699,_0x1d5326,_0x45b7b2,_0x5c46ad,_0x49df83,_0x24db2a,_0x56ff81,_0x25056f){const _0x2928fa=a4_0xe8fa;for(const _0x4d1d5f of _0x1fafbb){if(_0x4d1d5f['diff']){const _0x15a2f4=_0x4d1d5f['agentName']||_0x4d1d5f[_0x2928fa(0x196)];console[_0x2928fa(0x1b6)](_0x2928fa(0x1c8)+_0x15a2f4+'\x27:'),console[_0x2928fa(0x1b6)]('─'[_0x2928fa(0x1ea)](0x3c)),console[_0x2928fa(0x1b6)](_0x4d1d5f[_0x2928fa(0x17c)]),console[_0x2928fa(0x1b6)]('─'[_0x2928fa(0x1ea)](0x3c));}}for(const _0x485c9d of _0x4d5699){_0x485c9d[_0x2928fa(0x17c)]&&(console['log'](_0x2928fa(0x226)+_0x485c9d[_0x2928fa(0x196)]+'\x27:'),console[_0x2928fa(0x1b6)]('─'[_0x2928fa(0x1ea)](0x3c)),console[_0x2928fa(0x1b6)](_0x485c9d[_0x2928fa(0x17c)]),console['log']('─'['repeat'](0x3c)));}for(const _0xea3c57 of _0x1d5326){_0xea3c57[_0x2928fa(0x17c)]&&(console[_0x2928fa(0x1b6)](_0x2928fa(0x17d)+_0xea3c57[_0x2928fa(0x196)]+'\x27:'),console[_0x2928fa(0x1b6)]('─'['repeat'](0x3c)),console['log'](_0xea3c57[_0x2928fa(0x17c)]),console[_0x2928fa(0x1b6)]('─'['repeat'](0x3c)));}for(const _0x5e8336 of _0x45b7b2){_0x5e8336[_0x2928fa(0x17c)]&&(console[_0x2928fa(0x1b6)](_0x2928fa(0x21a)+_0x5e8336[_0x2928fa(0x196)]+'\x27:'),console[_0x2928fa(0x1b6)]('─'['repeat'](0x3c)),console[_0x2928fa(0x1b6)](_0x5e8336['diff']),console[_0x2928fa(0x1b6)]('─'['repeat'](0x3c)));}for(const _0x38d3a4 of _0x5c46ad){_0x38d3a4[_0x2928fa(0x17c)]&&(console[_0x2928fa(0x1b6)](_0x2928fa(0x1e2)+_0x38d3a4[_0x2928fa(0x196)]+'\x27:'),console['log']('─'[_0x2928fa(0x1ea)](0x3c)),console['log'](_0x38d3a4[_0x2928fa(0x17c)]),console[_0x2928fa(0x1b6)]('─'[_0x2928fa(0x1ea)](0x3c)));}for(const _0x19262d of _0x49df83){_0x19262d[_0x2928fa(0x17c)]&&(console[_0x2928fa(0x1b6)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x19262d['name']+'\x27:'),console[_0x2928fa(0x1b6)]('─'[_0x2928fa(0x1ea)](0x3c)),console[_0x2928fa(0x1b6)](_0x19262d['diff']),console[_0x2928fa(0x1b6)]('─'[_0x2928fa(0x1ea)](0x3c)));}for(const _0x40c482 of _0x24db2a){_0x40c482['diff']&&(console[_0x2928fa(0x1b6)](_0x2928fa(0x208)+_0x40c482[_0x2928fa(0x196)]+'\x27:'),console[_0x2928fa(0x1b6)]('─'[_0x2928fa(0x1ea)](0x3c)),console[_0x2928fa(0x1b6)](_0x40c482['diff']),console['log']('─'[_0x2928fa(0x1ea)](0x3c)));}for(const _0x2ee77e of _0x56ff81){_0x2ee77e[_0x2928fa(0x17c)]&&(console[_0x2928fa(0x1b6)](_0x2928fa(0x1a5)+_0x2ee77e[_0x2928fa(0x196)]+'\x27:'),console[_0x2928fa(0x1b6)]('─'[_0x2928fa(0x1ea)](0x3c)),console[_0x2928fa(0x1b6)](_0x2ee77e[_0x2928fa(0x17c)]),console[_0x2928fa(0x1b6)]('─'[_0x2928fa(0x1ea)](0x3c)));}for(const _0x3a8b36 of _0x25056f){_0x3a8b36[_0x2928fa(0x17c)]&&(console['log'](_0x2928fa(0x22d)+_0x3a8b36[_0x2928fa(0x196)]+'\x27:'),console[_0x2928fa(0x1b6)]('─'[_0x2928fa(0x1ea)](0x3c)),console[_0x2928fa(0x1b6)](_0x3a8b36[_0x2928fa(0x17c)]),console[_0x2928fa(0x1b6)]('─'[_0x2928fa(0x1ea)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x128688(0x186);[a4_0x128688(0x183)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x128688(0x1cd)](_0x328e61){const _0x3a28ce=a4_0x128688,{options:_0x3e75df,args:_0x244f97,tdx:_0x4aa8f2}=_0x328e61,_0x3730ea=_0x244f97[0x0],_0x58c72d=_0x244f97[0x1],_0x207b56=_0x3e75df[_0x3a28ce(0x17f)],_0x2270a1=_0x3e75df[_0x3a28ce(0x1a3)],_0x546f42=_0x3e75df[_0x3a28ce(0x189)],_0x5e365a=_0x3e75df[_0x3a28ce(0x1aa)],_0x2738e9=_0x3e75df[_0x3a28ce(0x20f)],_0x24b761=_0x3e75df[_0x3a28ce(0x230)];let _0x2f1c1f;if(_0x3730ea){const _0x2189e=a4_0x18183f[_0x3a28ce(0x214)](_0x3730ea,_0x3a28ce(0x22e));if(existsSync(_0x2189e))try{const _0x4d1910=JSON['parse'](readFileSync(_0x2189e,_0x3a28ce(0x20e)));_0x4d1910['llm_project']&&(_0x2f1c1f={'llm_project':_0x4d1910[_0x3a28ce(0x222)]});}catch{}}const _0x11c127=findAgentConfigPath(process['cwd']());let _0x131402;if(_0x11c127)try{const _0x19fd80=JSON[_0x3a28ce(0x1ee)](readFileSync(_0x11c127,_0x3a28ce(0x20e)));_0x19fd80[_0x3a28ce(0x222)]&&(_0x131402={'llm_project':_0x19fd80[_0x3a28ce(0x222)]});}catch{}const _0x583354=resolveAgentPullArgs({'arg':_0x3730ea,'agentNameArg':_0x58c72d,'agentFlag':_0x24b761,'contextProject':_0x2738e9,'argDirConfig':_0x2f1c1f,'cwdConfigPath':_0x11c127||undefined,'cwdConfig':_0x131402}),{projectNameOrId:_0x3ac41f,targetAgentName:_0x477a33,existingOutputDir:_0x271ae9,source:_0x988758}=_0x583354;if(_0x988758===_0x3a28ce(0x184))console[_0x3a28ce(0x1b6)](a4_0x3ab4a1[_0x3a28ce(0x181)](_0x3a28ce(0x205)+a4_0x18183f['join'](_0x3730ea,'tdx.json')+':\x20'+_0x3ac41f));else{if(_0x988758===_0x3a28ce(0x203))console[_0x3a28ce(0x1b6)](a4_0x3ab4a1['dim'](_0x3a28ce(0x1c2)+_0x3ac41f));else _0x988758===_0x3a28ce(0x1df)&&console[_0x3a28ce(0x1b6)](a4_0x3ab4a1[_0x3a28ce(0x181)]('Using\x20project\x20from\x20context:\x20'+_0x3ac41f));}if(!_0x3ac41f)return _0x24b761?(console[_0x3a28ce(0x1b6)](a4_0x3ab4a1[_0x3a28ce(0x1db)](_0x3a28ce(0x1d7))),console['log'](_0x3a28ce(0x22a)),console['log'](_0x3a28ce(0x1d2))):(console[_0x3a28ce(0x1b6)](a4_0x3ab4a1[_0x3a28ce(0x1db)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console['log'](_0x3a28ce(0x1bd)),console[_0x3a28ce(0x1b6)](_0x3a28ce(0x178)),console[_0x3a28ce(0x1b6)](_0x3a28ce(0x1c6)),console[_0x3a28ce(0x1b6)](_0x3a28ce(0x1e4)),console[_0x3a28ce(0x1b6)](_0x3a28ce(0x187))),0x1;if(_0x477a33){const {data:_0x254cda}=await withSpinner(_0x3a28ce(0x229)+_0x477a33+'\x22\x20from\x20project\x20\x22'+_0x3ac41f+_0x3a28ce(0x1c9),()=>_0x4aa8f2[_0x3a28ce(0x21c)]['pullAgent'](_0x3ac41f,_0x477a33,_0x207b56,{'dryRun':_0x2270a1,'force':_0x546f42}));if(_0x2270a1)return console[_0x3a28ce(0x1b6)](a4_0x3ab4a1[_0x3a28ce(0x1db)](_0x3a28ce(0x21e))),console[_0x3a28ce(0x1b6)](_0x3a28ce(0x1a1)+_0x254cda['agentName']),console[_0x3a28ce(0x1b6)](_0x3a28ce(0x219)+_0x254cda[_0x3a28ce(0x204)]),_0x254cda[_0x3a28ce(0x17c)]&&(console['log'](_0x3a28ce(0x1ed)),console[_0x3a28ce(0x1b6)]('─'[_0x3a28ce(0x1ea)](0x3c)),console['log'](_0x254cda[_0x3a28ce(0x17c)]),console[_0x3a28ce(0x1b6)]('─'[_0x3a28ce(0x1ea)](0x3c))),0x0;return console[_0x3a28ce(0x1b6)](a4_0x3ab4a1[_0x3a28ce(0x1bb)](_0x3a28ce(0x197))),console['log']('Agent:\x20'+_0x254cda[_0x3a28ce(0x1c3)]),console[_0x3a28ce(0x1b6)](_0x3a28ce(0x209)+_0x254cda[_0x3a28ce(0x204)]),console[_0x3a28ce(0x1b6)](_0x3a28ce(0x1d0)+(_0x254cda[_0x3a28ce(0x1ba)]?a4_0x3ab4a1[_0x3a28ce(0x1bb)]('new'):_0x254cda['hasChanges']?a4_0x3ab4a1[_0x3a28ce(0x1db)]('updated'):a4_0x3ab4a1[_0x3a28ce(0x216)](_0x3a28ce(0x228)))),0x0;}const _0xc64bdf=_0x271ae9||_0x207b56,{data:_0x4b9239}=await withSpinner(_0x3a28ce(0x1be)+_0x3ac41f+_0x3a28ce(0x1c9),()=>_0x4aa8f2[_0x3a28ce(0x21c)][_0x3a28ce(0x1f0)](_0x3ac41f,_0xc64bdf,{'dryRun':!![]})),_0xdedb22=_0x4b9239['counts']['agents']['new']+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x18a)][_0x3a28ce(0x17a)]+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x206)][_0x3a28ce(0x17a)]+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x1a8)][_0x3a28ce(0x17a)]+_0x4b9239['counts']['integrations']['new']+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x199)]['new']+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x1c4)]['new']+_0x4b9239[_0x3a28ce(0x234)]['formInterfaces'][_0x3a28ce(0x17a)]+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x19a)][_0x3a28ce(0x17a)],_0x2866c1=_0x4b9239[_0x3a28ce(0x234)]['agents'][_0x3a28ce(0x21f)]+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x18a)]['updated']+_0x4b9239['counts'][_0x3a28ce(0x206)][_0x3a28ce(0x21f)]+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x1a8)][_0x3a28ce(0x21f)]+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x218)][_0x3a28ce(0x21f)]+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x199)]['updated']+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x1c4)][_0x3a28ce(0x21f)]+_0x4b9239[_0x3a28ce(0x234)]['formInterfaces']['updated']+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x19a)]['updated'],_0x41af55=_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x1f3)][_0x3a28ce(0x228)]+_0x4b9239[_0x3a28ce(0x234)]['knowledgeBases'][_0x3a28ce(0x228)]+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x206)][_0x3a28ce(0x228)]+_0x4b9239['counts'][_0x3a28ce(0x1a8)][_0x3a28ce(0x228)]+_0x4b9239['counts'][_0x3a28ce(0x218)][_0x3a28ce(0x228)]+_0x4b9239['counts'][_0x3a28ce(0x199)][_0x3a28ce(0x228)]+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x1c4)][_0x3a28ce(0x228)]+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x1d4)][_0x3a28ce(0x228)]+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x19a)][_0x3a28ce(0x228)];console[_0x3a28ce(0x1b6)]('\x0aPull\x20summary\x20for\x20\x27'+_0x4b9239[_0x3a28ce(0x1fc)]+'\x27:'),console[_0x3a28ce(0x1b6)]('\x20\x20'+a4_0x3ab4a1[_0x3a28ce(0x1bb)]('+\x20'+_0xdedb22+'\x20new')+_0x3a28ce(0x1f2)+a4_0x3ab4a1[_0x3a28ce(0x1db)]('~\x20'+_0x2866c1+_0x3a28ce(0x1b1))+_0x3a28ce(0x1f2)+a4_0x3ab4a1[_0x3a28ce(0x181)]('=\x20'+_0x41af55+'\x20unchanged')),console[_0x3a28ce(0x1b6)]('\x20\x20Agents:\x20'+formatCountSummary(_0x4b9239[_0x3a28ce(0x234)]['agents'])),console['log'](_0x3a28ce(0x220)+formatCountSummary(_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x18a)])),console[_0x3a28ce(0x1b6)](_0x3a28ce(0x1bf)+formatCountSummary(_0x4b9239['counts'][_0x3a28ce(0x206)])),console['log'](_0x3a28ce(0x1c7)+formatCountSummary(_0x4b9239[_0x3a28ce(0x234)]['prompts'])),console['log'](_0x3a28ce(0x1f5)+formatCountSummary(_0x4b9239['counts'][_0x3a28ce(0x218)])),console['log'](_0x3a28ce(0x1e9)+formatCountSummary(_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x1d4)])),console[_0x3a28ce(0x1b6)](_0x3a28ce(0x1c1)+formatCountSummary(_0x4b9239['counts'][_0x3a28ce(0x19a)]));const _0x51f31d=_0x4b9239[_0x3a28ce(0x234)]['experimentalKnowledgeBases'][_0x3a28ce(0x22f)]>0x0||_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x1c4)][_0x3a28ce(0x22f)]>0x0;_0x51f31d&&(console[_0x3a28ce(0x1b6)](_0x3a28ce(0x195)+formatCountSummary(_0x4b9239['counts'][_0x3a28ce(0x199)])),console[_0x3a28ce(0x1b6)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x1c4)])));console['log']('\x20\x20Target:\x20'+a4_0x3ab4a1[_0x3a28ce(0x1b7)](_0x4b9239[_0x3a28ce(0x193)])),displayDiffs(_0x4b9239[_0x3a28ce(0x1f3)],_0x4b9239[_0x3a28ce(0x18a)],_0x4b9239[_0x3a28ce(0x206)],_0x4b9239[_0x3a28ce(0x1a8)],_0x4b9239[_0x3a28ce(0x218)],_0x4b9239[_0x3a28ce(0x199)],_0x4b9239[_0x3a28ce(0x1c4)],_0x4b9239[_0x3a28ce(0x1d4)],_0x4b9239['chatInterfaces']);if(_0x2270a1)return console[_0x3a28ce(0x1b6)](a4_0x3ab4a1['yellow'](_0x3a28ce(0x19d))),0x0;if(_0xdedb22===0x0&&_0x2866c1===0x0)return console[_0x3a28ce(0x1b6)](a4_0x3ab4a1[_0x3a28ce(0x1bb)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x4b9239['projectName']},_0x3e75df['session']),console['log'](a4_0x3ab4a1[_0x3a28ce(0x1bb)](_0x3a28ce(0x1d9)+a4_0x3ab4a1[_0x3a28ce(0x181)]('llm_project')+_0x3a28ce(0x185)+a4_0x3ab4a1[_0x3a28ce(0x1b7)](_0x4b9239[_0x3a28ce(0x1fc)]))),0x0;if(!_0x5e365a&&!_0x546f42){if(!isInteractive())return console[_0x3a28ce(0x1a6)](a4_0x3ab4a1[_0x3a28ce(0x20c)](_0x3a28ce(0x225)),_0x3a28ce(0x200)),console[_0x3a28ce(0x1a6)](a4_0x3ab4a1[_0x3a28ce(0x181)](_0x3a28ce(0x1e3))),0x1;const _0x4d5736=await confirmKey(_0x3a28ce(0x188)+(_0xdedb22+_0x2866c1)+'\x20files?');if(!_0x4d5736)return console['log'](a4_0x3ab4a1[_0x3a28ce(0x1db)](_0x3a28ce(0x21d)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x346207}=await withSpinner(_0x3a28ce(0x180),()=>_0x4aa8f2[_0x3a28ce(0x21c)][_0x3a28ce(0x1f0)](_0x3ac41f,_0xc64bdf,{'force':_0x546f42}));return console[_0x3a28ce(0x1b6)](a4_0x3ab4a1['green'](_0x3a28ce(0x1ec)+(_0xdedb22+_0x2866c1)+_0x3a28ce(0x1d5)+_0x346207[_0x3a28ce(0x193)])),saveSessionContext({'llm_project':_0x346207[_0x3a28ce(0x1fc)]},_0x3e75df[_0x3a28ce(0x224)]),console[_0x3a28ce(0x1b6)](a4_0x3ab4a1[_0x3a28ce(0x1bb)]('✔\x20Context\x20set:\x20'+a4_0x3ab4a1[_0x3a28ce(0x181)](_0x3a28ce(0x222))+'\x20=\x20'+a4_0x3ab4a1['cyan'](_0x346207[_0x3a28ce(0x1fc)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x128688(0x196)]=a4_0x128688(0x1af);[a4_0x128688(0x183)]=a4_0x128688(0x1eb);async[a4_0x128688(0x1cd)](_0x44158a){const _0x433d43=a4_0x128688,{options:_0x5efbaf,args:_0x1cc6c4,tdx:_0xdaeeb6}=_0x44158a,_0x1b4ef0=_0x1cc6c4[0x0],_0x55009f=_0x5efbaf[_0x433d43(0x196)],_0x2eddc3=_0x5efbaf[_0x433d43(0x1a3)],_0x27476f=_0x5efbaf[_0x433d43(0x1aa)],_0x23776f=_0x5efbaf[_0x433d43(0x1e6)],_0x24a779=_0x5efbaf[_0x433d43(0x20f)];let _0x5a62aa;const _0x38d6ef=findAgentConfigPath(process[_0x433d43(0x1ce)]());if(_0x1b4ef0){const _0x5ad7f9=a4_0x18183f[_0x433d43(0x214)](_0x1b4ef0,_0x433d43(0x22e));existsSync(_0x5ad7f9)?(_0x5a62aa=_0x1b4ef0,console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x181)](_0x433d43(0x1ae)+_0x1b4ef0))):_0x5a62aa=_0x1b4ef0;}else{if(_0x38d6ef)_0x5a62aa=a4_0x18183f[_0x433d43(0x1b9)](_0x38d6ef),console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x181)]('Using\x20current\x20project:\x20'+_0x5a62aa));else{if(_0x24a779){const _0x74a64=sanitizeForFilesystem(_0x24a779);let _0x5c7ad8=_0x74a64,_0x1dd5ad=a4_0x18183f[_0x433d43(0x214)](process[_0x433d43(0x1ce)](),_0x433d43(0x1f3),_0x74a64,'tdx.json');if(!existsSync(_0x1dd5ad)){const _0x16bb4b=normalizeName(_0x24a779),_0x5609dc=a4_0x18183f[_0x433d43(0x214)](process[_0x433d43(0x1ce)](),_0x433d43(0x1f3),_0x16bb4b,'tdx.json');existsSync(_0x5609dc)&&(_0x5c7ad8=_0x16bb4b,_0x1dd5ad=_0x5609dc);}if(existsSync(_0x1dd5ad))_0x5a62aa=a4_0x18183f[_0x433d43(0x1b9)](_0x1dd5ad),console['log'](a4_0x3ab4a1[_0x433d43(0x181)]('Using\x20local\x20project:\x20'+_0x5a62aa));else{const _0x557967=_0x5efbaf[_0x433d43(0x1ef)];if(_0x557967)throw new SDKError(ErrorCode[_0x433d43(0x207)],_0x433d43(0x223)+_0x24a779+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x433d43(0x1b5)+_0x433d43(0x1a0)+(_0x433d43(0x1fb)+_0x24a779+'\x0a')+(_0x433d43(0x1cf)+_0x5c7ad8+'\x20--name\x20'+(_0x55009f||_0x433d43(0x1d3))+_0x433d43(0x19c)+_0x557967)});_0x5a62aa=_0x24a779,console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x181)]('Using\x20context\x20project:\x20'+_0x24a779));}}}}if(!_0x5a62aa)return console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x1db)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x433d43(0x1b6)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x433d43(0x1b6)](_0x433d43(0x1a2)),console[_0x433d43(0x1b6)](_0x433d43(0x213)),console[_0x433d43(0x1b6)](_0x433d43(0x1cc)),0x1;if(!_0x55009f)throw new SDKError(ErrorCode[_0x433d43(0x20a)],_0x433d43(0x19e),undefined,{'helpText':_0x433d43(0x182)});if(!_0x27476f&&!_0x2eddc3){if(!isInteractive())return console[_0x433d43(0x1a6)](a4_0x3ab4a1['red']('\x0aError:'),_0x433d43(0x200)),console[_0x433d43(0x1a6)](a4_0x3ab4a1[_0x433d43(0x181)](_0x433d43(0x1e3))),0x1;const _0x2e0481=await confirmKey(_0x433d43(0x18c)+_0x5a62aa+'\x22\x20to\x20new\x20project\x20\x22'+_0x55009f+'\x22?');if(!_0x2e0481)return console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x1db)](_0x433d43(0x21d))),0x1;}const {data:_0x56a961}=await withSpinner(_0x433d43(0x1f7)+_0x5a62aa+'\x22\x20to\x20\x22'+_0x55009f+_0x433d43(0x1c9),()=>_0xdaeeb6[_0x433d43(0x21c)][_0x433d43(0x1dc)](_0x5a62aa,_0x55009f,{'dryRun':_0x2eddc3}));if(_0x2eddc3){console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x1db)](_0x433d43(0x198))),console[_0x433d43(0x1b6)](_0x433d43(0x1dd)+_0x56a961['sourceProjectName']),console[_0x433d43(0x1b6)]('New\x20project:\x20'+_0x55009f),console[_0x433d43(0x1b6)](_0x433d43(0x19f)),console[_0x433d43(0x1b6)](_0x433d43(0x1d6)+_0x56a961[_0x433d43(0x234)][_0x433d43(0x1f3)][_0x433d43(0x1a9)]),console['log']('\x20\x20Knowledge\x20Bases:\x20'+_0x56a961[_0x433d43(0x234)][_0x433d43(0x18a)]['created']),console[_0x433d43(0x1b6)](_0x433d43(0x1c7)+_0x56a961['counts']['prompts'][_0x433d43(0x1a9)]),console['log'](_0x433d43(0x1e9)+_0x56a961[_0x433d43(0x234)][_0x433d43(0x1d4)][_0x433d43(0x1a9)]),console[_0x433d43(0x1b6)]('\x20\x20Chat\x20Interfaces:\x20'+_0x56a961['counts'][_0x433d43(0x19a)][_0x433d43(0x1a9)]);const _0x16a9a7=_0x56a961[_0x433d43(0x234)]['experimentalKnowledgeBases'][_0x433d43(0x1a9)]>0x0||_0x56a961[_0x433d43(0x234)][_0x433d43(0x1c4)][_0x433d43(0x1a9)]>0x0;return _0x16a9a7&&(console[_0x433d43(0x1b6)](_0x433d43(0x195)+_0x56a961[_0x433d43(0x234)]['experimentalKnowledgeBases'][_0x433d43(0x1a9)]),console[_0x433d43(0x1b6)](_0x433d43(0x235)+_0x56a961[_0x433d43(0x234)]['experimentalArtifacts'][_0x433d43(0x1a9)])),0x0;}const _0x7a71fa=_0x56a961[_0x433d43(0x234)][_0x433d43(0x1f3)]['errors']>0x0||_0x56a961['counts'][_0x433d43(0x18a)][_0x433d43(0x1f9)]>0x0||_0x56a961[_0x433d43(0x234)][_0x433d43(0x1a8)]['errors']>0x0||_0x56a961[_0x433d43(0x234)][_0x433d43(0x1d4)]['errors']>0x0||_0x56a961[_0x433d43(0x234)][_0x433d43(0x19a)]['errors']>0x0||_0x56a961[_0x433d43(0x234)][_0x433d43(0x199)][_0x433d43(0x1f9)]>0x0||_0x56a961[_0x433d43(0x234)]['experimentalArtifacts'][_0x433d43(0x1f9)]>0x0;_0x7a71fa?console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x1db)]('Project\x20cloned\x20with\x20errors')):console[_0x433d43(0x1b6)](a4_0x3ab4a1['green'](_0x433d43(0x233)));console[_0x433d43(0x1b6)](_0x433d43(0x1dd)+_0x56a961[_0x433d43(0x1ab)]),console[_0x433d43(0x1b6)](_0x433d43(0x1da)+_0x56a961[_0x433d43(0x210)]),console[_0x433d43(0x1b6)]('New\x20project\x20ID:\x20'+_0x56a961[_0x433d43(0x20b)]),console[_0x433d43(0x1b6)](),console[_0x433d43(0x1b6)](_0x433d43(0x1f4)),console[_0x433d43(0x1b6)](_0x433d43(0x1d6)+formatCountSummary(_0x56a961[_0x433d43(0x234)][_0x433d43(0x1f3)])),console[_0x433d43(0x1b6)](_0x433d43(0x220)+formatCountSummary(_0x56a961['counts'][_0x433d43(0x18a)])),console[_0x433d43(0x1b6)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x56a961[_0x433d43(0x234)][_0x433d43(0x1a8)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x56a961['counts'][_0x433d43(0x218)])),console['log'](_0x433d43(0x1e9)+formatCountSummary(_0x56a961[_0x433d43(0x234)][_0x433d43(0x1d4)])),console[_0x433d43(0x1b6)](_0x433d43(0x1c1)+formatCountSummary(_0x56a961['counts'][_0x433d43(0x19a)]));const _0x1dd9fa=_0x56a961[_0x433d43(0x234)][_0x433d43(0x199)][_0x433d43(0x1a9)]>0x0||_0x56a961['counts']['experimentalKnowledgeBases'][_0x433d43(0x21f)]>0x0||_0x56a961[_0x433d43(0x234)][_0x433d43(0x199)][_0x433d43(0x228)]>0x0||_0x56a961[_0x433d43(0x234)][_0x433d43(0x1c4)]['created']>0x0||_0x56a961['counts']['experimentalArtifacts'][_0x433d43(0x21f)]>0x0||_0x56a961[_0x433d43(0x234)][_0x433d43(0x1c4)][_0x433d43(0x228)]>0x0;_0x1dd9fa&&(console[_0x433d43(0x1b6)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x56a961[_0x433d43(0x234)][_0x433d43(0x199)])),console[_0x433d43(0x1b6)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x56a961[_0x433d43(0x234)]['experimentalArtifacts'])));if(_0x7a71fa){console[_0x433d43(0x1b6)](),console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x20c)](_0x433d43(0x1e7)));for(const _0x13c439 of _0x56a961[_0x433d43(0x1f3)]){_0x13c439['action']===_0x433d43(0x1a6)&&console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x20c)]('\x20\x20Agent\x20\x22'+_0x13c439[_0x433d43(0x1c3)]+'\x22:\x20'+_0x13c439[_0x433d43(0x1a6)]));}for(const _0x552ddb of _0x56a961['knowledgeBases']){_0x552ddb[_0x433d43(0x215)]===_0x433d43(0x1a6)&&console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x20c)](_0x433d43(0x1b2)+_0x552ddb[_0x433d43(0x196)]+'\x22:\x20'+_0x552ddb[_0x433d43(0x1a6)]));}for(const _0x4215d9 of _0x56a961[_0x433d43(0x1a8)]){_0x4215d9[_0x433d43(0x215)]===_0x433d43(0x1a6)&&console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x20c)](_0x433d43(0x1d1)+_0x4215d9[_0x433d43(0x196)]+_0x433d43(0x179)+_0x4215d9['error']));}for(const _0x35669b of _0x56a961[_0x433d43(0x218)]){_0x35669b[_0x433d43(0x215)]===_0x433d43(0x1a6)&&console['log'](a4_0x3ab4a1['red'](_0x433d43(0x18e)+_0x35669b[_0x433d43(0x196)]+_0x433d43(0x179)+_0x35669b[_0x433d43(0x1a6)]));}for(const _0x264591 of _0x56a961[_0x433d43(0x1d4)]){_0x264591[_0x433d43(0x215)]===_0x433d43(0x1a6)&&console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x20c)]('\x20\x20Form\x20Interface\x20\x22'+_0x264591[_0x433d43(0x196)]+_0x433d43(0x179)+_0x264591[_0x433d43(0x1a6)]));}for(const _0x2fcf10 of _0x56a961['chatInterfaces']){_0x2fcf10[_0x433d43(0x215)]===_0x433d43(0x1a6)&&console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x20c)]('\x20\x20Chat\x20Interface\x20\x22'+_0x2fcf10[_0x433d43(0x196)]+'\x22:\x20'+_0x2fcf10[_0x433d43(0x1a6)]));}for(const _0x39d4d9 of _0x56a961['experimentalKnowledgeBases']){_0x39d4d9[_0x433d43(0x215)]===_0x433d43(0x1a6)&&console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x20c)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x39d4d9[_0x433d43(0x196)]+_0x433d43(0x179)+_0x39d4d9[_0x433d43(0x1a6)]));}for(const _0x77ceda of _0x56a961[_0x433d43(0x1c4)]){_0x77ceda[_0x433d43(0x215)]==='error'&&console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x20c)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x77ceda[_0x433d43(0x196)]+_0x433d43(0x179)+_0x77ceda[_0x433d43(0x1a6)]));}return 0x1;}console[_0x433d43(0x1b6)]();const _0x2c2ccd=getLLMProjectUrl(_0x23776f,_0x56a961[_0x433d43(0x20b)]);return console['log'](_0x433d43(0x231)+a4_0x3ab4a1[_0x433d43(0x1b7)](_0x2c2ccd)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x128688(0x196)]='agent:push';[a4_0x128688(0x183)]=a4_0x128688(0x211);async[a4_0x128688(0x1cd)](_0x28902f){const _0x5dc679=a4_0x128688,{options:_0x1d4186,args:_0x355c5b,tdx:_0x2947d6}=_0x28902f;let _0x272aa8=_0x355c5b[0x0]||process['cwd']();const _0x2f2fa4=_0x1d4186[_0x5dc679(0x1a3)],_0x218b1a=_0x1d4186[_0x5dc679(0x189)],_0xbc38e5=_0x1d4186[_0x5dc679(0x1aa)],_0x460e26=_0x1d4186[_0x5dc679(0x1e6)],_0x875535=a4_0x18183f[_0x5dc679(0x214)](_0x272aa8,_0x5dc679(0x1ca)),_0x4bfc20=existsSync(_0x875535);if(_0x4bfc20){const {data:_0x2beeaf}=await withSpinner(_0x5dc679(0x1b0)+_0x272aa8+_0x5dc679(0x1c9),()=>_0x2947d6[_0x5dc679(0x21c)][_0x5dc679(0x1c0)](_0x272aa8,{'dryRun':_0x2f2fa4,'force':_0x218b1a}));if(_0x2f2fa4)return console['log'](a4_0x3ab4a1['yellow'](_0x5dc679(0x198))),console['log']('Would\x20push\x20agent:\x20'+_0x2beeaf[_0x5dc679(0x1c3)]),0x0;if(_0x2beeaf[_0x5dc679(0x215)]==='error')return console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x20c)](_0x5dc679(0x201)+_0x2beeaf[_0x5dc679(0x1a6)])),0x1;console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x1bb)](_0x5dc679(0x1fe)+_0x2beeaf[_0x5dc679(0x215)]+_0x5dc679(0x192))),console[_0x5dc679(0x1b6)]('Agent:\x20'+_0x2beeaf[_0x5dc679(0x1c3)]);if(_0x2beeaf[_0x5dc679(0x1cb)]&&_0x2beeaf['projectId']){const _0x25e00a=getLLMAgentChatUrl(_0x460e26,_0x2beeaf[_0x5dc679(0x18f)],_0x2beeaf['agentId']);console[_0x5dc679(0x1b6)](_0x5dc679(0x1a7)+a4_0x3ab4a1[_0x5dc679(0x1b7)](_0x25e00a));}return 0x0;}const _0xec269a=_0x1d4186[_0x5dc679(0x20f)],_0x5bbd67=resolveProjectFromContext(_0x272aa8,_0xec269a);if(_0x5bbd67[_0x5dc679(0x1de)])_0x272aa8=_0x5bbd67[_0x5dc679(0x1f6)],_0x5bbd67[_0x5dc679(0x1f1)]==='context'&&console[_0x5dc679(0x1b6)](a4_0x3ab4a1['dim']('Using\x20project:\x20'+_0x272aa8));else{let _0x5344ab=_0x5dc679(0x1e8);_0x5bbd67['reason']===_0x5dc679(0x17b)&&(_0x5344ab=_0x5bbd67[_0x5dc679(0x1e0)]+_0x5dc679(0x1ad)+_0x5bbd67[_0x5dc679(0x20f)]+_0x5dc679(0x19b));throw new SDKError(ErrorCode[_0x5dc679(0x207)],_0x5bbd67['reason']===_0x5dc679(0x1b3)?_0x5bbd67[_0x5dc679(0x1e0)]:'No\x20tdx.json\x20found\x20in\x20'+_0x272aa8,undefined,{'helpText':_0x5344ab});}const {data:_0x139cad}=await withSpinner(_0x5dc679(0x18b),()=>_0x2947d6[_0x5dc679(0x21c)][_0x5dc679(0x194)](_0x272aa8,{'dryRun':!![]})),_0x4d6631=_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1f3)]['errors']>0x0;if(_0x4d6631){console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x20c)]('\x0aErrors\x20found:'));for(const _0x5667e5 of _0x139cad[_0x5dc679(0x1f3)]){_0x5667e5[_0x5dc679(0x215)]===_0x5dc679(0x1a6)&&console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x20c)](_0x5dc679(0x1bc)+_0x5667e5[_0x5dc679(0x1c3)]+_0x5dc679(0x179)+_0x5667e5[_0x5dc679(0x1a6)]));}return 0x1;}const _0x588876=_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1f3)]['created']+_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x18a)]['created']+_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x206)]['created']+_0x139cad['counts'][_0x5dc679(0x1a8)]['created']+_0x139cad['counts'][_0x5dc679(0x218)][_0x5dc679(0x1a9)]+_0x139cad['counts'][_0x5dc679(0x199)][_0x5dc679(0x1a9)]+_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1c4)]['created']+_0x139cad[_0x5dc679(0x234)]['formInterfaces'][_0x5dc679(0x1a9)]+_0x139cad[_0x5dc679(0x234)]['chatInterfaces']['created'],_0xba6db3=_0x139cad[_0x5dc679(0x234)]['agents']['updated']+_0x139cad['counts'][_0x5dc679(0x18a)]['updated']+_0x139cad[_0x5dc679(0x234)]['textKnowledgeBases'][_0x5dc679(0x21f)]+_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1a8)][_0x5dc679(0x21f)]+_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x218)][_0x5dc679(0x21f)]+_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x199)][_0x5dc679(0x21f)]+_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1c4)]['updated']+_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1d4)][_0x5dc679(0x21f)]+_0x139cad['counts'][_0x5dc679(0x19a)][_0x5dc679(0x21f)],_0x8abe07=_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1f3)][_0x5dc679(0x228)]+_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x18a)]['unchanged']+_0x139cad['counts']['textKnowledgeBases'][_0x5dc679(0x228)]+_0x139cad[_0x5dc679(0x234)]['prompts'][_0x5dc679(0x228)]+_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x218)][_0x5dc679(0x228)]+_0x139cad[_0x5dc679(0x234)]['experimentalKnowledgeBases'][_0x5dc679(0x228)]+_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1c4)][_0x5dc679(0x228)]+_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1d4)]['unchanged']+_0x139cad['counts'][_0x5dc679(0x19a)][_0x5dc679(0x228)];console[_0x5dc679(0x1b6)](_0x5dc679(0x1ac)+_0x139cad[_0x5dc679(0x1fc)]+'\x27:'),console['log']('\x20\x20'+a4_0x3ab4a1[_0x5dc679(0x1bb)]('+\x20'+_0x588876+_0x5dc679(0x190))+'\x20|\x20'+a4_0x3ab4a1[_0x5dc679(0x1db)]('~\x20'+_0xba6db3+_0x5dc679(0x1b1))+_0x5dc679(0x1f2)+a4_0x3ab4a1[_0x5dc679(0x181)]('=\x20'+_0x8abe07+'\x20unchanged')),console['log'](_0x5dc679(0x1d6)+formatCountSummary(_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1f3)])),console['log'](_0x5dc679(0x220)+formatCountSummary(_0x139cad['counts']['knowledgeBases'])),console[_0x5dc679(0x1b6)](_0x5dc679(0x1bf)+formatCountSummary(_0x139cad[_0x5dc679(0x234)]['textKnowledgeBases'])),console[_0x5dc679(0x1b6)](_0x5dc679(0x1c7)+formatCountSummary(_0x139cad[_0x5dc679(0x234)]['prompts'])),console[_0x5dc679(0x1b6)](_0x5dc679(0x1f5)+formatCountSummary(_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x218)])),console[_0x5dc679(0x1b6)](_0x5dc679(0x1e9)+formatCountSummary(_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1d4)])),console[_0x5dc679(0x1b6)](_0x5dc679(0x1c1)+formatCountSummary(_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x19a)]));const _0x2f3363=_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x199)][_0x5dc679(0x1a9)]>0x0||_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x199)][_0x5dc679(0x21f)]>0x0||_0x139cad[_0x5dc679(0x234)]['experimentalKnowledgeBases'][_0x5dc679(0x228)]>0x0||_0x139cad['counts']['experimentalArtifacts'][_0x5dc679(0x1a9)]>0x0||_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1c4)][_0x5dc679(0x21f)]>0x0||_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1c4)][_0x5dc679(0x228)]>0x0;_0x2f3363&&(console['log'](_0x5dc679(0x195)+formatCountSummary(_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x199)])),console[_0x5dc679(0x1b6)](_0x5dc679(0x235)+formatCountSummary(_0x139cad['counts']['experimentalArtifacts'])));console[_0x5dc679(0x1b6)](_0x5dc679(0x21b)+a4_0x3ab4a1[_0x5dc679(0x1b7)](_0x272aa8)),displayDiffs(_0x139cad['agents'],_0x139cad['knowledgeBases'],_0x139cad[_0x5dc679(0x206)],_0x139cad[_0x5dc679(0x1a8)],_0x139cad[_0x5dc679(0x218)],_0x139cad[_0x5dc679(0x199)],_0x139cad['experimentalArtifacts'],_0x139cad[_0x5dc679(0x1d4)],_0x139cad[_0x5dc679(0x19a)]);if(_0x2f2fa4)return console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x1db)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x588876===0x0&&_0xba6db3===0x0){console[_0x5dc679(0x1b6)](a4_0x3ab4a1['green'](_0x5dc679(0x212)));const _0x799dfd=getLLMProjectUrl(_0x460e26,_0x139cad[_0x5dc679(0x18f)]);return console[_0x5dc679(0x1b6)](_0x5dc679(0x231)+a4_0x3ab4a1['cyan'](_0x799dfd)),0x0;}if(!_0xbc38e5&&!_0x218b1a){if(!isInteractive())return console[_0x5dc679(0x1a6)](a4_0x3ab4a1['red'](_0x5dc679(0x225)),_0x5dc679(0x200)),console['error'](a4_0x3ab4a1['dim'](_0x5dc679(0x1e3))),0x1;const _0x1dd94f=await confirmKey(_0x5dc679(0x1a4)+(_0x588876+_0xba6db3)+_0x5dc679(0x1d8));if(!_0x1dd94f)return console['log'](a4_0x3ab4a1[_0x5dc679(0x1db)]('Cancelled'),_0x5dc679(0x221)),0x1;}const {data:_0x2b4479}=await withSpinner(_0x5dc679(0x191),()=>_0x2947d6[_0x5dc679(0x21c)][_0x5dc679(0x194)](_0x272aa8,{'force':_0x218b1a})),_0x20f4cd=_0x2b4479[_0x5dc679(0x234)][_0x5dc679(0x1f3)][_0x5dc679(0x1f9)]>0x0||_0x2b4479[_0x5dc679(0x234)]['knowledgeBases'][_0x5dc679(0x1f9)]>0x0||_0x2b4479['counts'][_0x5dc679(0x206)]['errors']>0x0||_0x2b4479[_0x5dc679(0x234)]['prompts'][_0x5dc679(0x1f9)]>0x0||_0x2b4479[_0x5dc679(0x234)][_0x5dc679(0x1d4)]['errors']>0x0||_0x2b4479[_0x5dc679(0x234)]['chatInterfaces'][_0x5dc679(0x1f9)]>0x0;if(_0x20f4cd){console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x1db)](_0x5dc679(0x202))),console[_0x5dc679(0x1b6)](),console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x20c)](_0x5dc679(0x1e7)));for(const _0x1a7924 of _0x2b4479[_0x5dc679(0x1f3)]){_0x1a7924[_0x5dc679(0x215)]===_0x5dc679(0x1a6)&&console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x20c)]('\x20\x20Agent\x20\x22'+_0x1a7924[_0x5dc679(0x1c3)]+_0x5dc679(0x179)+_0x1a7924[_0x5dc679(0x1a6)]));}for(const _0x285fe7 of _0x2b4479[_0x5dc679(0x18a)]){_0x285fe7['action']===_0x5dc679(0x1a6)&&console[_0x5dc679(0x1b6)](a4_0x3ab4a1['red'](_0x5dc679(0x1b2)+_0x285fe7[_0x5dc679(0x196)]+_0x5dc679(0x179)+_0x285fe7[_0x5dc679(0x1a6)]));}for(const _0x2d3f11 of _0x2b4479[_0x5dc679(0x206)]){_0x2d3f11['action']===_0x5dc679(0x1a6)&&console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x20c)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x2d3f11[_0x5dc679(0x196)]+'\x22:\x20'+_0x2d3f11[_0x5dc679(0x1a6)]));}for(const _0x1abe0d of _0x2b4479[_0x5dc679(0x1a8)]){_0x1abe0d[_0x5dc679(0x215)]===_0x5dc679(0x1a6)&&console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x20c)](_0x5dc679(0x1d1)+_0x1abe0d[_0x5dc679(0x196)]+_0x5dc679(0x179)+_0x1abe0d['error']));}for(const _0x3082a0 of _0x2b4479[_0x5dc679(0x218)]){_0x3082a0['action']==='error'&&console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x20c)](_0x5dc679(0x18e)+_0x3082a0[_0x5dc679(0x196)]+_0x5dc679(0x179)+_0x3082a0['error']));}for(const _0x159a2e of _0x2b4479[_0x5dc679(0x1d4)]){_0x159a2e[_0x5dc679(0x215)]==='error'&&console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x20c)](_0x5dc679(0x18d)+_0x159a2e[_0x5dc679(0x196)]+_0x5dc679(0x179)+_0x159a2e[_0x5dc679(0x1a6)]));}for(const _0x36e5a9 of _0x2b4479[_0x5dc679(0x19a)]){_0x36e5a9[_0x5dc679(0x215)]==='error'&&console[_0x5dc679(0x1b6)](a4_0x3ab4a1['red'](_0x5dc679(0x1c5)+_0x36e5a9['name']+_0x5dc679(0x179)+_0x36e5a9[_0x5dc679(0x1a6)]));}return 0x1;}console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x1bb)](_0x5dc679(0x20d)+(_0x588876+_0xba6db3)+'\x20resources\x20to\x20\x27'+_0x2b4479[_0x5dc679(0x1fc)]+'\x27'));const _0x5a70d2=getLLMProjectUrl(_0x460e26,_0x2b4479[_0x5dc679(0x18f)]);return console['log'](_0x5dc679(0x231)+a4_0x3ab4a1['cyan'](_0x5a70d2)),0x0;}}
1
+ const a4_0x449b0d=a4_0xeb21;(function(_0x3e6fa6,_0x3d9dc7){const _0x30dc58=a4_0xeb21,_0x27ff68=_0x3e6fa6();while(!![]){try{const _0x270608=parseInt(_0x30dc58(0x21f))/0x1+parseInt(_0x30dc58(0x233))/0x2*(-parseInt(_0x30dc58(0x247))/0x3)+parseInt(_0x30dc58(0x237))/0x4*(parseInt(_0x30dc58(0x20a))/0x5)+parseInt(_0x30dc58(0x21c))/0x6+parseInt(_0x30dc58(0x207))/0x7+parseInt(_0x30dc58(0x1f0))/0x8+-parseInt(_0x30dc58(0x23b))/0x9*(parseInt(_0x30dc58(0x241))/0xa);if(_0x270608===_0x3d9dc7)break;else _0x27ff68['push'](_0x27ff68['shift']());}catch(_0x517ff9){_0x27ff68['push'](_0x27ff68['shift']());}}}(a4_0x2fcf,0x38708));import a4_0xf8ecc9 from'chalk';function a4_0xeb21(_0x2534a9,_0x46ec54){_0x2534a9=_0x2534a9-0x1cb;const _0x2fcff9=a4_0x2fcf();let _0xeb2155=_0x2fcff9[_0x2534a9];return _0xeb2155;}import a4_0x4037d2 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a4_0x2fcf(){const _0x1648c9=['errors','dirname','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\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','Agent\x20pulled\x20successfully','\x20\x20Prompt\x20\x22','dryRun','Using\x20project:\x20','<new-name>','counts','cwd','\x20\x20Chat\x20Interfaces:\x20','push','join','Dry\x20run\x20-\x20no\x20files\x20written','\x0aPush\x20summary\x20for\x20\x27','Project\x20cloned\x20successfully','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x0a✔\x20Pulled\x20','Project:\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20Agent\x20\x22','Analyzing\x20changes\x20to\x20push...','\x20|\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','error','Project\x20cloned\x20with\x20errors','execute','log','\x0aErrors\x20found:','context','new','Cancelled','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Source:\x20','\x20\x20Experimental\x20Artifacts:\x20','Analyzing\x20project\x20\x22','session','\x22\x20to\x20a\x20different\x20profile','\x20\x20Chat\x20Interface\x20\x22','New\x20project:\x20','projectDir','Output:\x20','agent.yml','yes','llm','Using\x20local\x20project:\x20','agentId','agent','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','integrations','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','utf-8','force','site','Dry\x20run\x20-\x20no\x20changes\x20made','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)','New\x20project\x20name\x20is\x20required','green','INVALID_ARGUMENT','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x22:\x20','red','\x20\x20Knowledge\x20Base\x20\x22','llm_project','\x20\x20Integrations:\x20','\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','projectName','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','tdx.json','No\x20tdx.json\x20found\x20in\x20','2029648nuXprF','agent:pull','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','message','\x20--profile\x20','hasChanges','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','newProjectId','\x0aError:','experimentalKnowledgeBases','Output\x20path:\x20','llmProject','\x20\x20tdx\x20agent\x20clone\x20agents/','pushAgent','Agent\x20','\x20files?','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20\x20Form\x20Interface\x20\x22','\x0a✔\x20Pushed\x20','\x0aPull\x20summary\x20for\x20\x27','description','\x20\x20Knowledge\x20Bases:\x20','\x22\x20to\x20new\x20project\x20\x22','2914527BWmyUI','newProjectName','\x20unchanged','90gRcGFQ','source','chatInterfaces','\x20\x20Integration\x20\x22','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','no_local_folder','\x20\x20Agents:\x20','agentName','pullProject','\x20\x20Source:\x20','Agent:\x20','\x22...','\x22\x20to\x20\x22','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','Writing\x20files...','Would\x20push\x20agent:\x20','\x20successfully','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','1212642RkDgYD','\x0aWrite\x20','diff','279182kitEro','MISSING_ARGUMENT','Summary:','Using\x20context\x20project:\x20','pullAgent','action','textKnowledgeBases','\x20created','created','\x20errors','\x20files\x20to\x20','gray','dim','Using\x20project\x20from\x20','yellow','pushProject','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x0aChanges\x20to\x20prompt\x20\x27','arg-dir','12jtHeqb','\x0aChanges\x20to\x20chat\x20interface\x20\x27','updated','Pulling\x20agent\x20\x22','86672ELGDrw','unchanged','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','cyan','1602khDLmh','sourceProjectName','profile','✔\x20Context\x20set:\x20','\x20\x20Text\x20Knowledge\x20Bases:\x20','Using\x20current\x20project:\x20','69470BLXmpB','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','cloneProject','prompts','formInterfaces','no_context','36819xeCbBC','knowledgeBases','\x20updated','output','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Pushing\x20to\x20project...','\x20resources?','agent:push','agents','\x20\x20Prompts:\x20','Errors:','experimentalArtifacts','\x20changed','Cloning\x20\x22','total','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','name','\x20\x20Form\x20Interfaces:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','Chat:\x20','Failed\x20to\x20push\x20agent:\x20','outputDir','projectId','\x20new','parse','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','repeat','\x0aChanges\x20to\x20agent\x20\x27'];a4_0x2fcf=function(){return _0x1648c9;};return a4_0x2fcf();}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(_0x12170f){const _0x441cfa=a4_0xeb21,_0x254d43=[];if(_0x12170f[_0x441cfa(0x255)]!==undefined)_0x254d43[_0x441cfa(0x26f)](_0x12170f[_0x441cfa(0x255)]+'\x20total');if(_0x12170f[_0x441cfa(0x282)]!==undefined&&_0x12170f[_0x441cfa(0x282)]>0x0)_0x254d43['push'](a4_0xf8ecc9[_0x441cfa(0x1e3)](_0x12170f[_0x441cfa(0x282)]+'\x20new'));if(_0x12170f[_0x441cfa(0x227)]!==undefined&&_0x12170f[_0x441cfa(0x227)]>0x0)_0x254d43[_0x441cfa(0x26f)](a4_0xf8ecc9[_0x441cfa(0x1e3)](_0x12170f[_0x441cfa(0x227)]+_0x441cfa(0x226)));if(_0x12170f['updated']!==undefined&&_0x12170f[_0x441cfa(0x235)]>0x0)_0x254d43[_0x441cfa(0x26f)](a4_0xf8ecc9['yellow'](_0x12170f['updated']+_0x441cfa(0x249)));if(_0x12170f['unchanged']!==undefined&&_0x12170f[_0x441cfa(0x238)]>0x0)_0x254d43[_0x441cfa(0x26f)](a4_0xf8ecc9[_0x441cfa(0x22a)](_0x12170f[_0x441cfa(0x238)]+'\x20unchanged'));if(_0x12170f[_0x441cfa(0x263)]!==undefined&&_0x12170f[_0x441cfa(0x263)]>0x0)_0x254d43[_0x441cfa(0x26f)](a4_0xf8ecc9['red'](_0x12170f[_0x441cfa(0x263)]+_0x441cfa(0x228)));return _0x254d43[_0x441cfa(0x270)](',\x20');}function displayDiffs(_0x135097,_0x135732,_0x1ec859,_0x4c2a33,_0x419f83,_0x105625,_0x5d237b,_0x15b7a3,_0x161edf){const _0x34fff7=a4_0xeb21;for(const _0x5a0f00 of _0x135097){if(_0x5a0f00['diff']){const _0x6b3e22=_0x5a0f00[_0x34fff7(0x211)]||_0x5a0f00['name'];console[_0x34fff7(0x27f)](_0x34fff7(0x262)+_0x6b3e22+'\x27:'),console[_0x34fff7(0x27f)]('─'[_0x34fff7(0x261)](0x3c)),console[_0x34fff7(0x27f)](_0x5a0f00[_0x34fff7(0x21e)]),console[_0x34fff7(0x27f)]('─'[_0x34fff7(0x261)](0x3c));}}for(const _0x27e749 of _0x135732){_0x27e749['diff']&&(console['log'](_0x34fff7(0x1e5)+_0x27e749[_0x34fff7(0x257)]+'\x27:'),console[_0x34fff7(0x27f)]('─'[_0x34fff7(0x261)](0x3c)),console[_0x34fff7(0x27f)](_0x27e749['diff']),console['log']('─'['repeat'](0x3c)));}for(const _0x113817 of _0x1ec859){_0x113817[_0x34fff7(0x21e)]&&(console[_0x34fff7(0x27f)](_0x34fff7(0x20e)+_0x113817['name']+'\x27:'),console[_0x34fff7(0x27f)]('─'['repeat'](0x3c)),console['log'](_0x113817['diff']),console[_0x34fff7(0x27f)]('─'[_0x34fff7(0x261)](0x3c)));}for(const _0x15a21f of _0x4c2a33){_0x15a21f[_0x34fff7(0x21e)]&&(console[_0x34fff7(0x27f)](_0x34fff7(0x231)+_0x15a21f[_0x34fff7(0x257)]+'\x27:'),console[_0x34fff7(0x27f)]('─'['repeat'](0x3c)),console['log'](_0x15a21f['diff']),console[_0x34fff7(0x27f)]('─'['repeat'](0x3c)));}for(const _0x5a08b9 of _0x419f83){_0x5a08b9[_0x34fff7(0x21e)]&&(console[_0x34fff7(0x27f)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x5a08b9[_0x34fff7(0x257)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x34fff7(0x27f)](_0x5a08b9['diff']),console[_0x34fff7(0x27f)]('─'[_0x34fff7(0x261)](0x3c)));}for(const _0x7a9382 of _0x105625){_0x7a9382['diff']&&(console['log'](_0x34fff7(0x1dc)+_0x7a9382['name']+'\x27:'),console[_0x34fff7(0x27f)]('─'['repeat'](0x3c)),console[_0x34fff7(0x27f)](_0x7a9382['diff']),console[_0x34fff7(0x27f)]('─'[_0x34fff7(0x261)](0x3c)));}for(const _0x470eb5 of _0x5d237b){_0x470eb5[_0x34fff7(0x21e)]&&(console[_0x34fff7(0x27f)](_0x34fff7(0x230)+_0x470eb5[_0x34fff7(0x257)]+'\x27:'),console['log']('─'[_0x34fff7(0x261)](0x3c)),console[_0x34fff7(0x27f)](_0x470eb5[_0x34fff7(0x21e)]),console[_0x34fff7(0x27f)]('─'['repeat'](0x3c)));}for(const _0x1144c8 of _0x15b7a3){_0x1144c8['diff']&&(console[_0x34fff7(0x27f)]('\x0aChanges\x20to\x20form\x20interface\x20\x27'+_0x1144c8['name']+'\x27:'),console[_0x34fff7(0x27f)]('─'[_0x34fff7(0x261)](0x3c)),console[_0x34fff7(0x27f)](_0x1144c8[_0x34fff7(0x21e)]),console[_0x34fff7(0x27f)]('─'[_0x34fff7(0x261)](0x3c)));}for(const _0x5e4d11 of _0x161edf){_0x5e4d11['diff']&&(console[_0x34fff7(0x27f)](_0x34fff7(0x234)+_0x5e4d11['name']+'\x27:'),console['log']('─'['repeat'](0x3c)),console['log'](_0x5e4d11[_0x34fff7(0x21e)]),console[_0x34fff7(0x27f)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x449b0d(0x1f1);[a4_0x449b0d(0x204)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x449b0d(0x27e)](_0x43de1e){const _0x29736f=a4_0x449b0d,{options:_0x21ed14,args:_0x498d5a,tdx:_0x188236}=_0x43de1e,_0x52e8a0=_0x498d5a[0x0],_0x3401c7=_0x498d5a[0x1],_0x24d05f=_0x21ed14[_0x29736f(0x24a)],_0x4caaee=_0x21ed14[_0x29736f(0x269)],_0x15c219=_0x21ed14[_0x29736f(0x1de)],_0x501bf0=_0x21ed14['yes'],_0x1d024c=_0x21ed14['llmProject'],_0xe31676=_0x21ed14[_0x29736f(0x1d8)];let _0x1d1b9b;if(_0x52e8a0){const _0x3d1414=a4_0x4037d2[_0x29736f(0x270)](_0x52e8a0,_0x29736f(0x1ee));if(existsSync(_0x3d1414))try{const _0x4b2b87=JSON[_0x29736f(0x25f)](readFileSync(_0x3d1414,_0x29736f(0x1dd)));_0x4b2b87[_0x29736f(0x1e9)]&&(_0x1d1b9b={'llm_project':_0x4b2b87['llm_project']});}catch{}}const _0x38c830=findAgentConfigPath(process[_0x29736f(0x26d)]());let _0x22aaa6;if(_0x38c830)try{const _0x121151=JSON['parse'](readFileSync(_0x38c830,_0x29736f(0x1dd)));_0x121151[_0x29736f(0x1e9)]&&(_0x22aaa6={'llm_project':_0x121151['llm_project']});}catch{}const _0x388f3f=resolveAgentPullArgs({'arg':_0x52e8a0,'agentNameArg':_0x3401c7,'agentFlag':_0xe31676,'contextProject':_0x1d024c,'argDirConfig':_0x1d1b9b,'cwdConfigPath':_0x38c830||undefined,'cwdConfig':_0x22aaa6}),{projectNameOrId:_0x40ce4c,targetAgentName:_0x30a250,existingOutputDir:_0x30c1fe,source:_0x2340b2}=_0x388f3f;if(_0x2340b2===_0x29736f(0x232))console['log'](a4_0xf8ecc9[_0x29736f(0x22b)](_0x29736f(0x22c)+a4_0x4037d2[_0x29736f(0x270)](_0x52e8a0,_0x29736f(0x1ee))+':\x20'+_0x40ce4c));else{if(_0x2340b2==='cwd-config')console['log'](a4_0xf8ecc9[_0x29736f(0x22b)]('Using\x20project:\x20'+_0x40ce4c));else _0x2340b2===_0x29736f(0x281)&&console['log'](a4_0xf8ecc9[_0x29736f(0x22b)]('Using\x20project\x20from\x20context:\x20'+_0x40ce4c));}if(!_0x40ce4c)return _0xe31676?(console[_0x29736f(0x27f)](a4_0xf8ecc9[_0x29736f(0x22d)](_0x29736f(0x27b))),console['log'](_0x29736f(0x22f)),console[_0x29736f(0x27f)](_0x29736f(0x217))):(console[_0x29736f(0x27f)](a4_0xf8ecc9[_0x29736f(0x22d)](_0x29736f(0x260))),console[_0x29736f(0x27f)](_0x29736f(0x1e1)),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x29736f(0x27f)](_0x29736f(0x266)),console[_0x29736f(0x27f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project'),console['log'](_0x29736f(0x1eb))),0x1;if(_0x30a250){const {data:_0x37d61a}=await withSpinner(_0x29736f(0x236)+_0x30a250+'\x22\x20from\x20project\x20\x22'+_0x40ce4c+_0x29736f(0x215),()=>_0x188236[_0x29736f(0x1d5)][_0x29736f(0x223)](_0x40ce4c,_0x30a250,_0x24d05f,{'dryRun':_0x4caaee,'force':_0x15c219}));if(_0x4caaee)return console['log'](a4_0xf8ecc9[_0x29736f(0x22d)](_0x29736f(0x271))),console[_0x29736f(0x27f)]('Would\x20pull\x20agent:\x20'+_0x37d61a['agentName']),console[_0x29736f(0x27f)](_0x29736f(0x1fa)+_0x37d61a['outputPath']),_0x37d61a[_0x29736f(0x21e)]&&(console[_0x29736f(0x27f)]('\x0aChanges:'),console[_0x29736f(0x27f)]('─'[_0x29736f(0x261)](0x3c)),console[_0x29736f(0x27f)](_0x37d61a[_0x29736f(0x21e)]),console[_0x29736f(0x27f)]('─'[_0x29736f(0x261)](0x3c))),0x0;return console[_0x29736f(0x27f)](a4_0xf8ecc9[_0x29736f(0x1e3)](_0x29736f(0x267))),console['log'](_0x29736f(0x214)+_0x37d61a[_0x29736f(0x211)]),console[_0x29736f(0x27f)](_0x29736f(0x1d2)+_0x37d61a['outputPath']),console[_0x29736f(0x27f)]('Status:\x20'+(_0x37d61a['isNew']?a4_0xf8ecc9[_0x29736f(0x1e3)](_0x29736f(0x282)):_0x37d61a[_0x29736f(0x1f5)]?a4_0xf8ecc9['yellow']('updated'):a4_0xf8ecc9['gray'](_0x29736f(0x238)))),0x0;}const _0x2fc83c=_0x30c1fe||_0x24d05f,{data:_0xa96ae2}=await withSpinner(_0x29736f(0x1cc)+_0x40ce4c+_0x29736f(0x215),()=>_0x188236['llm'][_0x29736f(0x212)](_0x40ce4c,_0x2fc83c,{'dryRun':!![]})),_0x15b7d7=_0xa96ae2[_0x29736f(0x26c)]['agents'][_0x29736f(0x282)]+_0xa96ae2[_0x29736f(0x26c)][_0x29736f(0x248)][_0x29736f(0x282)]+_0xa96ae2[_0x29736f(0x26c)]['textKnowledgeBases'][_0x29736f(0x282)]+_0xa96ae2[_0x29736f(0x26c)][_0x29736f(0x244)][_0x29736f(0x282)]+_0xa96ae2[_0x29736f(0x26c)]['integrations'][_0x29736f(0x282)]+_0xa96ae2[_0x29736f(0x26c)][_0x29736f(0x1f9)][_0x29736f(0x282)]+_0xa96ae2[_0x29736f(0x26c)][_0x29736f(0x252)][_0x29736f(0x282)]+_0xa96ae2[_0x29736f(0x26c)][_0x29736f(0x245)][_0x29736f(0x282)]+_0xa96ae2['counts'][_0x29736f(0x20c)][_0x29736f(0x282)],_0x56d5b6=_0xa96ae2['counts'][_0x29736f(0x24f)][_0x29736f(0x235)]+_0xa96ae2[_0x29736f(0x26c)]['knowledgeBases'][_0x29736f(0x235)]+_0xa96ae2[_0x29736f(0x26c)][_0x29736f(0x225)]['updated']+_0xa96ae2[_0x29736f(0x26c)][_0x29736f(0x244)][_0x29736f(0x235)]+_0xa96ae2[_0x29736f(0x26c)][_0x29736f(0x1db)][_0x29736f(0x235)]+_0xa96ae2[_0x29736f(0x26c)][_0x29736f(0x1f9)][_0x29736f(0x235)]+_0xa96ae2[_0x29736f(0x26c)]['experimentalArtifacts'][_0x29736f(0x235)]+_0xa96ae2[_0x29736f(0x26c)]['formInterfaces'][_0x29736f(0x235)]+_0xa96ae2[_0x29736f(0x26c)][_0x29736f(0x20c)]['updated'],_0x2c4052=_0xa96ae2['counts'][_0x29736f(0x24f)][_0x29736f(0x238)]+_0xa96ae2[_0x29736f(0x26c)]['knowledgeBases'][_0x29736f(0x238)]+_0xa96ae2['counts'][_0x29736f(0x225)][_0x29736f(0x238)]+_0xa96ae2['counts']['prompts'][_0x29736f(0x238)]+_0xa96ae2[_0x29736f(0x26c)]['integrations'][_0x29736f(0x238)]+_0xa96ae2['counts'][_0x29736f(0x1f9)][_0x29736f(0x238)]+_0xa96ae2[_0x29736f(0x26c)][_0x29736f(0x252)][_0x29736f(0x238)]+_0xa96ae2[_0x29736f(0x26c)][_0x29736f(0x245)][_0x29736f(0x238)]+_0xa96ae2[_0x29736f(0x26c)][_0x29736f(0x20c)][_0x29736f(0x238)];console['log'](_0x29736f(0x203)+_0xa96ae2['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0xf8ecc9[_0x29736f(0x1e3)]('+\x20'+_0x15b7d7+_0x29736f(0x25e))+'\x20|\x20'+a4_0xf8ecc9[_0x29736f(0x22d)]('~\x20'+_0x56d5b6+_0x29736f(0x253))+_0x29736f(0x27a)+a4_0xf8ecc9['dim']('=\x20'+_0x2c4052+_0x29736f(0x209))),console[_0x29736f(0x27f)](_0x29736f(0x210)+formatCountSummary(_0xa96ae2[_0x29736f(0x26c)][_0x29736f(0x24f)])),console[_0x29736f(0x27f)](_0x29736f(0x205)+formatCountSummary(_0xa96ae2[_0x29736f(0x26c)]['knowledgeBases'])),console[_0x29736f(0x27f)](_0x29736f(0x23f)+formatCountSummary(_0xa96ae2[_0x29736f(0x26c)][_0x29736f(0x225)])),console[_0x29736f(0x27f)](_0x29736f(0x250)+formatCountSummary(_0xa96ae2[_0x29736f(0x26c)][_0x29736f(0x244)])),console[_0x29736f(0x27f)](_0x29736f(0x1ea)+formatCountSummary(_0xa96ae2[_0x29736f(0x26c)]['integrations'])),console[_0x29736f(0x27f)](_0x29736f(0x258)+formatCountSummary(_0xa96ae2['counts'][_0x29736f(0x245)])),console['log'](_0x29736f(0x26e)+formatCountSummary(_0xa96ae2['counts'][_0x29736f(0x20c)]));const _0x3a2cb2=_0xa96ae2[_0x29736f(0x26c)][_0x29736f(0x1f9)][_0x29736f(0x255)]>0x0||_0xa96ae2[_0x29736f(0x26c)]['experimentalArtifacts']['total']>0x0;_0x3a2cb2&&(console[_0x29736f(0x27f)](_0x29736f(0x200)+formatCountSummary(_0xa96ae2[_0x29736f(0x26c)][_0x29736f(0x1f9)])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0xa96ae2[_0x29736f(0x26c)][_0x29736f(0x252)])));console['log']('\x20\x20Target:\x20'+a4_0xf8ecc9[_0x29736f(0x23a)](_0xa96ae2['outputDir'])),displayDiffs(_0xa96ae2[_0x29736f(0x24f)],_0xa96ae2[_0x29736f(0x248)],_0xa96ae2[_0x29736f(0x225)],_0xa96ae2['prompts'],_0xa96ae2[_0x29736f(0x1db)],_0xa96ae2[_0x29736f(0x1f9)],_0xa96ae2['experimentalArtifacts'],_0xa96ae2[_0x29736f(0x245)],_0xa96ae2['chatInterfaces']);if(_0x4caaee)return console[_0x29736f(0x27f)](a4_0xf8ecc9['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x15b7d7===0x0&&_0x56d5b6===0x0)return console[_0x29736f(0x27f)](a4_0xf8ecc9[_0x29736f(0x1e3)](_0x29736f(0x1da))),saveSessionContext({'llm_project':_0xa96ae2['projectName']},_0x21ed14['session']),console[_0x29736f(0x27f)](a4_0xf8ecc9[_0x29736f(0x1e3)](_0x29736f(0x23e)+a4_0xf8ecc9[_0x29736f(0x22b)]('llm_project')+'\x20=\x20'+a4_0xf8ecc9[_0x29736f(0x23a)](_0xa96ae2[_0x29736f(0x1ec)]))),0x0;if(!_0x501bf0&&!_0x15c219){if(!isInteractive())return console[_0x29736f(0x27c)](a4_0xf8ecc9[_0x29736f(0x1e7)](_0x29736f(0x1f8)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x29736f(0x27c)](a4_0xf8ecc9[_0x29736f(0x22b)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3ac9df=await confirmKey(_0x29736f(0x21d)+(_0x15b7d7+_0x56d5b6)+_0x29736f(0x1ff));if(!_0x3ac9df)return console[_0x29736f(0x27f)](a4_0xf8ecc9[_0x29736f(0x22d)](_0x29736f(0x283)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x1940f2}=await withSpinner(_0x29736f(0x218),()=>_0x188236[_0x29736f(0x1d5)][_0x29736f(0x212)](_0x40ce4c,_0x2fc83c,{'force':_0x15c219}));return console[_0x29736f(0x27f)](a4_0xf8ecc9[_0x29736f(0x1e3)](_0x29736f(0x275)+(_0x15b7d7+_0x56d5b6)+_0x29736f(0x229)+_0x1940f2[_0x29736f(0x25c)])),saveSessionContext({'llm_project':_0x1940f2[_0x29736f(0x1ec)]},_0x21ed14[_0x29736f(0x1cd)]),console[_0x29736f(0x27f)](a4_0xf8ecc9[_0x29736f(0x1e3)]('✔\x20Context\x20set:\x20'+a4_0xf8ecc9['dim']('llm_project')+'\x20=\x20'+a4_0xf8ecc9['cyan'](_0x1940f2[_0x29736f(0x1ec)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x449b0d(0x257)]='agent:clone';[a4_0x449b0d(0x204)]=a4_0x449b0d(0x277);async[a4_0x449b0d(0x27e)](_0x35f119){const _0xa03f69=a4_0x449b0d,{options:_0x781ca4,args:_0x423fad,tdx:_0x54aa0e}=_0x35f119,_0x1759c2=_0x423fad[0x0],_0x57a8bc=_0x781ca4[_0xa03f69(0x257)],_0x140537=_0x781ca4[_0xa03f69(0x269)],_0x2d9c61=_0x781ca4[_0xa03f69(0x1d4)],_0x43e1fb=_0x781ca4['site'],_0x4f5030=_0x781ca4[_0xa03f69(0x1fb)];let _0x42a30c;const _0x5783bf=findAgentConfigPath(process[_0xa03f69(0x26d)]());if(_0x1759c2){const _0x449882=a4_0x4037d2[_0xa03f69(0x270)](_0x1759c2,_0xa03f69(0x1ee));existsSync(_0x449882)?(_0x42a30c=_0x1759c2,console[_0xa03f69(0x27f)](a4_0xf8ecc9['dim'](_0xa03f69(0x1d6)+_0x1759c2))):_0x42a30c=_0x1759c2;}else{if(_0x5783bf)_0x42a30c=a4_0x4037d2[_0xa03f69(0x264)](_0x5783bf),console[_0xa03f69(0x27f)](a4_0xf8ecc9[_0xa03f69(0x22b)](_0xa03f69(0x240)+_0x42a30c));else{if(_0x4f5030){const _0x1be573=sanitizeForFilesystem(_0x4f5030);let _0x31200e=_0x1be573,_0xd22fd7=a4_0x4037d2[_0xa03f69(0x270)](process[_0xa03f69(0x26d)](),_0xa03f69(0x24f),_0x1be573,'tdx.json');if(!existsSync(_0xd22fd7)){const _0x5eee3f=normalizeName(_0x4f5030),_0x4fc4c2=a4_0x4037d2[_0xa03f69(0x270)](process['cwd'](),_0xa03f69(0x24f),_0x5eee3f,_0xa03f69(0x1ee));existsSync(_0x4fc4c2)&&(_0x31200e=_0x5eee3f,_0xd22fd7=_0x4fc4c2);}if(existsSync(_0xd22fd7))_0x42a30c=a4_0x4037d2[_0xa03f69(0x264)](_0xd22fd7),console[_0xa03f69(0x27f)](a4_0xf8ecc9['dim'](_0xa03f69(0x1d6)+_0x42a30c));else{const _0x35a52c=_0x781ca4[_0xa03f69(0x23d)];if(_0x35a52c)throw new SDKError(ErrorCode[_0xa03f69(0x1e4)],_0xa03f69(0x284)+_0x4f5030+_0xa03f69(0x1ce),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0xa03f69(0x1f2)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x4f5030+'\x0a')+(_0xa03f69(0x1fc)+_0x31200e+'\x20--name\x20'+(_0x57a8bc||_0xa03f69(0x26b))+_0xa03f69(0x1f4)+_0x35a52c)});_0x42a30c=_0x4f5030,console[_0xa03f69(0x27f)](a4_0xf8ecc9[_0xa03f69(0x22b)](_0xa03f69(0x222)+_0x4f5030));}}}}if(!_0x42a30c)return console[_0xa03f69(0x27f)](a4_0xf8ecc9[_0xa03f69(0x22d)](_0xa03f69(0x1ed))),console[_0xa03f69(0x27f)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0xa03f69(0x27f)](_0xa03f69(0x274)),console[_0xa03f69(0x27f)]('\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[_0xa03f69(0x27f)](_0xa03f69(0x21b)),0x1;if(!_0x57a8bc)throw new SDKError(ErrorCode[_0xa03f69(0x220)],_0xa03f69(0x1e2),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x2d9c61&&!_0x140537){if(!isInteractive())return console[_0xa03f69(0x27c)](a4_0xf8ecc9[_0xa03f69(0x1e7)](_0xa03f69(0x1f8)),_0xa03f69(0x265)),console[_0xa03f69(0x27c)](a4_0xf8ecc9['dim'](_0xa03f69(0x242))),0x1;const _0x2ece2a=await confirmKey('Clone\x20\x22'+_0x42a30c+_0xa03f69(0x206)+_0x57a8bc+'\x22?');if(!_0x2ece2a)return console[_0xa03f69(0x27f)](a4_0xf8ecc9[_0xa03f69(0x22d)](_0xa03f69(0x283))),0x1;}const {data:_0x1bd3d0}=await withSpinner(_0xa03f69(0x254)+_0x42a30c+_0xa03f69(0x216)+_0x57a8bc+_0xa03f69(0x215),()=>_0x54aa0e[_0xa03f69(0x1d5)][_0xa03f69(0x243)](_0x42a30c,_0x57a8bc,{'dryRun':_0x140537}));if(_0x140537){console['log'](a4_0xf8ecc9[_0xa03f69(0x22d)](_0xa03f69(0x1e0))),console['log'](_0xa03f69(0x285)+_0x1bd3d0[_0xa03f69(0x23c)]),console['log'](_0xa03f69(0x1d0)+_0x57a8bc),console['log']('Would\x20clone:'),console[_0xa03f69(0x27f)](_0xa03f69(0x210)+_0x1bd3d0[_0xa03f69(0x26c)][_0xa03f69(0x24f)]['created']),console[_0xa03f69(0x27f)](_0xa03f69(0x205)+_0x1bd3d0[_0xa03f69(0x26c)]['knowledgeBases']['created']),console['log'](_0xa03f69(0x250)+_0x1bd3d0['counts'][_0xa03f69(0x244)][_0xa03f69(0x227)]),console[_0xa03f69(0x27f)](_0xa03f69(0x258)+_0x1bd3d0[_0xa03f69(0x26c)]['formInterfaces'][_0xa03f69(0x227)]),console['log'](_0xa03f69(0x26e)+_0x1bd3d0['counts'][_0xa03f69(0x20c)][_0xa03f69(0x227)]);const _0x4b851f=_0x1bd3d0[_0xa03f69(0x26c)][_0xa03f69(0x1f9)][_0xa03f69(0x227)]>0x0||_0x1bd3d0[_0xa03f69(0x26c)]['experimentalArtifacts']['created']>0x0;return _0x4b851f&&(console[_0xa03f69(0x27f)](_0xa03f69(0x200)+_0x1bd3d0[_0xa03f69(0x26c)]['experimentalKnowledgeBases'][_0xa03f69(0x227)]),console[_0xa03f69(0x27f)](_0xa03f69(0x1cb)+_0x1bd3d0['counts'][_0xa03f69(0x252)]['created'])),0x0;}const _0x4a8e92=_0x1bd3d0[_0xa03f69(0x26c)][_0xa03f69(0x24f)][_0xa03f69(0x263)]>0x0||_0x1bd3d0[_0xa03f69(0x26c)][_0xa03f69(0x248)]['errors']>0x0||_0x1bd3d0['counts']['prompts']['errors']>0x0||_0x1bd3d0[_0xa03f69(0x26c)][_0xa03f69(0x245)][_0xa03f69(0x263)]>0x0||_0x1bd3d0[_0xa03f69(0x26c)][_0xa03f69(0x20c)]['errors']>0x0||_0x1bd3d0['counts']['experimentalKnowledgeBases'][_0xa03f69(0x263)]>0x0||_0x1bd3d0[_0xa03f69(0x26c)][_0xa03f69(0x252)][_0xa03f69(0x263)]>0x0;_0x4a8e92?console[_0xa03f69(0x27f)](a4_0xf8ecc9[_0xa03f69(0x22d)](_0xa03f69(0x27d))):console[_0xa03f69(0x27f)](a4_0xf8ecc9['green'](_0xa03f69(0x273)));console[_0xa03f69(0x27f)](_0xa03f69(0x285)+_0x1bd3d0['sourceProjectName']),console[_0xa03f69(0x27f)]('New\x20project:\x20'+_0x1bd3d0[_0xa03f69(0x208)]),console[_0xa03f69(0x27f)]('New\x20project\x20ID:\x20'+_0x1bd3d0[_0xa03f69(0x1f7)]),console['log'](),console[_0xa03f69(0x27f)](_0xa03f69(0x221)),console[_0xa03f69(0x27f)](_0xa03f69(0x210)+formatCountSummary(_0x1bd3d0[_0xa03f69(0x26c)][_0xa03f69(0x24f)])),console[_0xa03f69(0x27f)](_0xa03f69(0x205)+formatCountSummary(_0x1bd3d0[_0xa03f69(0x26c)][_0xa03f69(0x248)])),console['log'](_0xa03f69(0x250)+formatCountSummary(_0x1bd3d0['counts'][_0xa03f69(0x244)])),console['log'](_0xa03f69(0x1ea)+formatCountSummary(_0x1bd3d0['counts']['integrations'])),console[_0xa03f69(0x27f)](_0xa03f69(0x258)+formatCountSummary(_0x1bd3d0[_0xa03f69(0x26c)][_0xa03f69(0x245)])),console[_0xa03f69(0x27f)](_0xa03f69(0x26e)+formatCountSummary(_0x1bd3d0[_0xa03f69(0x26c)][_0xa03f69(0x20c)]));const _0x5ca654=_0x1bd3d0['counts']['experimentalKnowledgeBases'][_0xa03f69(0x227)]>0x0||_0x1bd3d0[_0xa03f69(0x26c)][_0xa03f69(0x1f9)][_0xa03f69(0x235)]>0x0||_0x1bd3d0[_0xa03f69(0x26c)][_0xa03f69(0x1f9)][_0xa03f69(0x238)]>0x0||_0x1bd3d0[_0xa03f69(0x26c)]['experimentalArtifacts'][_0xa03f69(0x227)]>0x0||_0x1bd3d0[_0xa03f69(0x26c)]['experimentalArtifacts'][_0xa03f69(0x235)]>0x0||_0x1bd3d0[_0xa03f69(0x26c)]['experimentalArtifacts'][_0xa03f69(0x238)]>0x0;_0x5ca654&&(console[_0xa03f69(0x27f)](_0xa03f69(0x200)+formatCountSummary(_0x1bd3d0[_0xa03f69(0x26c)]['experimentalKnowledgeBases'])),console[_0xa03f69(0x27f)](_0xa03f69(0x1cb)+formatCountSummary(_0x1bd3d0['counts'][_0xa03f69(0x252)])));if(_0x4a8e92){console['log'](),console[_0xa03f69(0x27f)](a4_0xf8ecc9[_0xa03f69(0x1e7)](_0xa03f69(0x251)));for(const _0x38b430 of _0x1bd3d0[_0xa03f69(0x24f)]){_0x38b430[_0xa03f69(0x224)]===_0xa03f69(0x27c)&&console[_0xa03f69(0x27f)](a4_0xf8ecc9[_0xa03f69(0x1e7)]('\x20\x20Agent\x20\x22'+_0x38b430[_0xa03f69(0x211)]+_0xa03f69(0x1e6)+_0x38b430['error']));}for(const _0x2385a0 of _0x1bd3d0[_0xa03f69(0x248)]){_0x2385a0['action']===_0xa03f69(0x27c)&&console[_0xa03f69(0x27f)](a4_0xf8ecc9[_0xa03f69(0x1e7)](_0xa03f69(0x1e8)+_0x2385a0[_0xa03f69(0x257)]+'\x22:\x20'+_0x2385a0[_0xa03f69(0x27c)]));}for(const _0x32f3ba of _0x1bd3d0['prompts']){_0x32f3ba[_0xa03f69(0x224)]===_0xa03f69(0x27c)&&console[_0xa03f69(0x27f)](a4_0xf8ecc9[_0xa03f69(0x1e7)](_0xa03f69(0x268)+_0x32f3ba['name']+_0xa03f69(0x1e6)+_0x32f3ba[_0xa03f69(0x27c)]));}for(const _0x4c7a5e of _0x1bd3d0[_0xa03f69(0x1db)]){_0x4c7a5e['action']===_0xa03f69(0x27c)&&console['log'](a4_0xf8ecc9[_0xa03f69(0x1e7)](_0xa03f69(0x20d)+_0x4c7a5e[_0xa03f69(0x257)]+_0xa03f69(0x1e6)+_0x4c7a5e['error']));}for(const _0x27e77d of _0x1bd3d0['formInterfaces']){_0x27e77d[_0xa03f69(0x224)]===_0xa03f69(0x27c)&&console[_0xa03f69(0x27f)](a4_0xf8ecc9['red'](_0xa03f69(0x201)+_0x27e77d['name']+_0xa03f69(0x1e6)+_0x27e77d[_0xa03f69(0x27c)]));}for(const _0x246c13 of _0x1bd3d0['chatInterfaces']){_0x246c13[_0xa03f69(0x224)]==='error'&&console[_0xa03f69(0x27f)](a4_0xf8ecc9[_0xa03f69(0x1e7)](_0xa03f69(0x1cf)+_0x246c13[_0xa03f69(0x257)]+_0xa03f69(0x1e6)+_0x246c13[_0xa03f69(0x27c)]));}for(const _0x297aeb of _0x1bd3d0[_0xa03f69(0x1f9)]){_0x297aeb[_0xa03f69(0x224)]===_0xa03f69(0x27c)&&console['log'](a4_0xf8ecc9[_0xa03f69(0x1e7)](_0xa03f69(0x239)+_0x297aeb[_0xa03f69(0x257)]+_0xa03f69(0x1e6)+_0x297aeb[_0xa03f69(0x27c)]));}for(const _0x4535ca of _0x1bd3d0[_0xa03f69(0x252)]){_0x4535ca[_0xa03f69(0x224)]==='error'&&console[_0xa03f69(0x27f)](a4_0xf8ecc9[_0xa03f69(0x1e7)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x4535ca[_0xa03f69(0x257)]+_0xa03f69(0x1e6)+_0x4535ca[_0xa03f69(0x27c)]));}return 0x1;}console[_0xa03f69(0x27f)]();const _0x549478=getLLMProjectUrl(_0x43e1fb,_0x1bd3d0[_0xa03f69(0x1f7)]);return console['log'](_0xa03f69(0x276)+a4_0xf8ecc9[_0xa03f69(0x23a)](_0x549478)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x449b0d(0x257)]=a4_0x449b0d(0x24e);[a4_0x449b0d(0x204)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async['execute'](_0xdaf25){const _0xc7769b=a4_0x449b0d,{options:_0x329488,args:_0xd35c5a,tdx:_0x4f0d35}=_0xdaf25;let _0x40e245=_0xd35c5a[0x0]||process[_0xc7769b(0x26d)]();const _0x4cf075=_0x329488[_0xc7769b(0x269)],_0x397533=_0x329488[_0xc7769b(0x1de)],_0x1e2371=_0x329488[_0xc7769b(0x1d4)],_0xfdfdc=_0x329488[_0xc7769b(0x1df)],_0x49d13b=a4_0x4037d2[_0xc7769b(0x270)](_0x40e245,_0xc7769b(0x1d3)),_0x4b1d44=existsSync(_0x49d13b);if(_0x4b1d44){const {data:_0x26378d}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x40e245+_0xc7769b(0x215),()=>_0x4f0d35['llm'][_0xc7769b(0x1fd)](_0x40e245,{'dryRun':_0x4cf075,'force':_0x397533}));if(_0x4cf075)return console[_0xc7769b(0x27f)](a4_0xf8ecc9['yellow'](_0xc7769b(0x1e0))),console[_0xc7769b(0x27f)](_0xc7769b(0x219)+_0x26378d[_0xc7769b(0x211)]),0x0;if(_0x26378d[_0xc7769b(0x224)]===_0xc7769b(0x27c))return console['log'](a4_0xf8ecc9[_0xc7769b(0x1e7)](_0xc7769b(0x25b)+_0x26378d['error'])),0x1;console[_0xc7769b(0x27f)](a4_0xf8ecc9['green'](_0xc7769b(0x1fe)+_0x26378d[_0xc7769b(0x224)]+_0xc7769b(0x21a))),console['log'](_0xc7769b(0x214)+_0x26378d['agentName']);if(_0x26378d[_0xc7769b(0x1d7)]&&_0x26378d['projectId']){const _0x2e590e=getLLMAgentChatUrl(_0xfdfdc,_0x26378d[_0xc7769b(0x25d)],_0x26378d[_0xc7769b(0x1d7)]);console[_0xc7769b(0x27f)](_0xc7769b(0x25a)+a4_0xf8ecc9[_0xc7769b(0x23a)](_0x2e590e));}return 0x0;}const _0x9ab2b1=_0x329488[_0xc7769b(0x1fb)],_0x2af5be=resolveProjectFromContext(_0x40e245,_0x9ab2b1);if(_0x2af5be['found'])_0x40e245=_0x2af5be[_0xc7769b(0x1d1)],_0x2af5be[_0xc7769b(0x20b)]===_0xc7769b(0x281)&&console[_0xc7769b(0x27f)](a4_0xf8ecc9[_0xc7769b(0x22b)](_0xc7769b(0x26a)+_0x40e245));else{let _0x266e70=_0xc7769b(0x1f6);_0x2af5be['reason']===_0xc7769b(0x20f)&&(_0x266e70=_0x2af5be['message']+_0xc7769b(0x256)+_0x2af5be[_0xc7769b(0x1fb)]+_0xc7769b(0x1d9));throw new SDKError(ErrorCode[_0xc7769b(0x1e4)],_0x2af5be['reason']===_0xc7769b(0x246)?_0x2af5be[_0xc7769b(0x1f3)]:_0xc7769b(0x1ef)+_0x40e245,undefined,{'helpText':_0x266e70});}const {data:_0x3a9c34}=await withSpinner(_0xc7769b(0x279),()=>_0x4f0d35[_0xc7769b(0x1d5)][_0xc7769b(0x22e)](_0x40e245,{'dryRun':!![]})),_0x15c7ae=_0x3a9c34[_0xc7769b(0x26c)][_0xc7769b(0x24f)][_0xc7769b(0x263)]>0x0;if(_0x15c7ae){console[_0xc7769b(0x27f)](a4_0xf8ecc9[_0xc7769b(0x1e7)](_0xc7769b(0x280)));for(const _0x544df2 of _0x3a9c34[_0xc7769b(0x24f)]){_0x544df2['action']==='error'&&console[_0xc7769b(0x27f)](a4_0xf8ecc9[_0xc7769b(0x1e7)](_0xc7769b(0x278)+_0x544df2[_0xc7769b(0x211)]+_0xc7769b(0x1e6)+_0x544df2['error']));}return 0x1;}const _0x526dc2=_0x3a9c34[_0xc7769b(0x26c)][_0xc7769b(0x24f)]['created']+_0x3a9c34['counts'][_0xc7769b(0x248)][_0xc7769b(0x227)]+_0x3a9c34[_0xc7769b(0x26c)]['textKnowledgeBases']['created']+_0x3a9c34[_0xc7769b(0x26c)][_0xc7769b(0x244)][_0xc7769b(0x227)]+_0x3a9c34[_0xc7769b(0x26c)]['integrations'][_0xc7769b(0x227)]+_0x3a9c34[_0xc7769b(0x26c)]['experimentalKnowledgeBases'][_0xc7769b(0x227)]+_0x3a9c34[_0xc7769b(0x26c)][_0xc7769b(0x252)][_0xc7769b(0x227)]+_0x3a9c34[_0xc7769b(0x26c)][_0xc7769b(0x245)][_0xc7769b(0x227)]+_0x3a9c34['counts'][_0xc7769b(0x20c)][_0xc7769b(0x227)],_0xfa72da=_0x3a9c34['counts'][_0xc7769b(0x24f)]['updated']+_0x3a9c34['counts'][_0xc7769b(0x248)]['updated']+_0x3a9c34[_0xc7769b(0x26c)][_0xc7769b(0x225)]['updated']+_0x3a9c34['counts']['prompts'][_0xc7769b(0x235)]+_0x3a9c34['counts']['integrations'][_0xc7769b(0x235)]+_0x3a9c34[_0xc7769b(0x26c)]['experimentalKnowledgeBases'][_0xc7769b(0x235)]+_0x3a9c34[_0xc7769b(0x26c)][_0xc7769b(0x252)][_0xc7769b(0x235)]+_0x3a9c34[_0xc7769b(0x26c)][_0xc7769b(0x245)][_0xc7769b(0x235)]+_0x3a9c34[_0xc7769b(0x26c)][_0xc7769b(0x20c)][_0xc7769b(0x235)],_0x148ff9=_0x3a9c34[_0xc7769b(0x26c)][_0xc7769b(0x24f)]['unchanged']+_0x3a9c34[_0xc7769b(0x26c)][_0xc7769b(0x248)][_0xc7769b(0x238)]+_0x3a9c34[_0xc7769b(0x26c)]['textKnowledgeBases'][_0xc7769b(0x238)]+_0x3a9c34['counts'][_0xc7769b(0x244)]['unchanged']+_0x3a9c34[_0xc7769b(0x26c)][_0xc7769b(0x1db)][_0xc7769b(0x238)]+_0x3a9c34[_0xc7769b(0x26c)]['experimentalKnowledgeBases'][_0xc7769b(0x238)]+_0x3a9c34[_0xc7769b(0x26c)][_0xc7769b(0x252)][_0xc7769b(0x238)]+_0x3a9c34[_0xc7769b(0x26c)]['formInterfaces'][_0xc7769b(0x238)]+_0x3a9c34[_0xc7769b(0x26c)][_0xc7769b(0x20c)]['unchanged'];console['log'](_0xc7769b(0x272)+_0x3a9c34[_0xc7769b(0x1ec)]+'\x27:'),console[_0xc7769b(0x27f)]('\x20\x20'+a4_0xf8ecc9[_0xc7769b(0x1e3)]('+\x20'+_0x526dc2+_0xc7769b(0x25e))+_0xc7769b(0x27a)+a4_0xf8ecc9[_0xc7769b(0x22d)]('~\x20'+_0xfa72da+_0xc7769b(0x253))+_0xc7769b(0x27a)+a4_0xf8ecc9['dim']('=\x20'+_0x148ff9+_0xc7769b(0x209))),console[_0xc7769b(0x27f)]('\x20\x20Agents:\x20'+formatCountSummary(_0x3a9c34['counts'][_0xc7769b(0x24f)])),console[_0xc7769b(0x27f)](_0xc7769b(0x205)+formatCountSummary(_0x3a9c34[_0xc7769b(0x26c)]['knowledgeBases'])),console['log'](_0xc7769b(0x23f)+formatCountSummary(_0x3a9c34[_0xc7769b(0x26c)][_0xc7769b(0x225)])),console['log'](_0xc7769b(0x250)+formatCountSummary(_0x3a9c34[_0xc7769b(0x26c)][_0xc7769b(0x244)])),console[_0xc7769b(0x27f)](_0xc7769b(0x1ea)+formatCountSummary(_0x3a9c34[_0xc7769b(0x26c)]['integrations'])),console[_0xc7769b(0x27f)](_0xc7769b(0x258)+formatCountSummary(_0x3a9c34[_0xc7769b(0x26c)][_0xc7769b(0x245)])),console['log'](_0xc7769b(0x26e)+formatCountSummary(_0x3a9c34[_0xc7769b(0x26c)][_0xc7769b(0x20c)]));const _0x55bf04=_0x3a9c34[_0xc7769b(0x26c)][_0xc7769b(0x1f9)]['created']>0x0||_0x3a9c34[_0xc7769b(0x26c)][_0xc7769b(0x1f9)][_0xc7769b(0x235)]>0x0||_0x3a9c34['counts'][_0xc7769b(0x1f9)][_0xc7769b(0x238)]>0x0||_0x3a9c34['counts'][_0xc7769b(0x252)][_0xc7769b(0x227)]>0x0||_0x3a9c34[_0xc7769b(0x26c)][_0xc7769b(0x252)][_0xc7769b(0x235)]>0x0||_0x3a9c34[_0xc7769b(0x26c)][_0xc7769b(0x252)][_0xc7769b(0x238)]>0x0;_0x55bf04&&(console[_0xc7769b(0x27f)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3a9c34[_0xc7769b(0x26c)][_0xc7769b(0x1f9)])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x3a9c34[_0xc7769b(0x26c)][_0xc7769b(0x252)])));console[_0xc7769b(0x27f)](_0xc7769b(0x213)+a4_0xf8ecc9[_0xc7769b(0x23a)](_0x40e245)),displayDiffs(_0x3a9c34[_0xc7769b(0x24f)],_0x3a9c34[_0xc7769b(0x248)],_0x3a9c34[_0xc7769b(0x225)],_0x3a9c34[_0xc7769b(0x244)],_0x3a9c34[_0xc7769b(0x1db)],_0x3a9c34['experimentalKnowledgeBases'],_0x3a9c34['experimentalArtifacts'],_0x3a9c34['formInterfaces'],_0x3a9c34[_0xc7769b(0x20c)]);if(_0x4cf075)return console[_0xc7769b(0x27f)](a4_0xf8ecc9['yellow'](_0xc7769b(0x259))),0x0;if(_0x526dc2===0x0&&_0xfa72da===0x0){console[_0xc7769b(0x27f)](a4_0xf8ecc9[_0xc7769b(0x1e3)](_0xc7769b(0x24b)));const _0x3a9abc=getLLMProjectUrl(_0xfdfdc,_0x3a9c34['projectId']);return console[_0xc7769b(0x27f)]('Project:\x20'+a4_0xf8ecc9[_0xc7769b(0x23a)](_0x3a9abc)),0x0;}if(!_0x1e2371&&!_0x397533){if(!isInteractive())return console['error'](a4_0xf8ecc9['red'](_0xc7769b(0x1f8)),_0xc7769b(0x265)),console['error'](a4_0xf8ecc9[_0xc7769b(0x22b)](_0xc7769b(0x242))),0x1;const _0x1b4eb7=await confirmKey('\x0aPush\x20'+(_0x526dc2+_0xfa72da)+_0xc7769b(0x24d));if(!_0x1b4eb7)return console['log'](a4_0xf8ecc9['yellow'](_0xc7769b(0x283)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x4f6283}=await withSpinner(_0xc7769b(0x24c),()=>_0x4f0d35['llm'][_0xc7769b(0x22e)](_0x40e245,{'force':_0x397533})),_0x306b00=_0x4f6283[_0xc7769b(0x26c)][_0xc7769b(0x24f)]['errors']>0x0||_0x4f6283[_0xc7769b(0x26c)][_0xc7769b(0x248)]['errors']>0x0||_0x4f6283[_0xc7769b(0x26c)]['textKnowledgeBases'][_0xc7769b(0x263)]>0x0||_0x4f6283['counts'][_0xc7769b(0x244)][_0xc7769b(0x263)]>0x0||_0x4f6283[_0xc7769b(0x26c)][_0xc7769b(0x245)][_0xc7769b(0x263)]>0x0||_0x4f6283[_0xc7769b(0x26c)][_0xc7769b(0x20c)][_0xc7769b(0x263)]>0x0;if(_0x306b00){console[_0xc7769b(0x27f)](a4_0xf8ecc9[_0xc7769b(0x22d)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0xc7769b(0x27f)](),console[_0xc7769b(0x27f)](a4_0xf8ecc9[_0xc7769b(0x1e7)](_0xc7769b(0x251)));for(const _0xff5894 of _0x4f6283[_0xc7769b(0x24f)]){_0xff5894['action']===_0xc7769b(0x27c)&&console[_0xc7769b(0x27f)](a4_0xf8ecc9[_0xc7769b(0x1e7)](_0xc7769b(0x278)+_0xff5894[_0xc7769b(0x211)]+_0xc7769b(0x1e6)+_0xff5894[_0xc7769b(0x27c)]));}for(const _0x564b34 of _0x4f6283[_0xc7769b(0x248)]){_0x564b34[_0xc7769b(0x224)]==='error'&&console[_0xc7769b(0x27f)](a4_0xf8ecc9[_0xc7769b(0x1e7)](_0xc7769b(0x1e8)+_0x564b34[_0xc7769b(0x257)]+_0xc7769b(0x1e6)+_0x564b34[_0xc7769b(0x27c)]));}for(const _0x5587ac of _0x4f6283[_0xc7769b(0x225)]){_0x5587ac['action']===_0xc7769b(0x27c)&&console[_0xc7769b(0x27f)](a4_0xf8ecc9[_0xc7769b(0x1e7)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x5587ac[_0xc7769b(0x257)]+_0xc7769b(0x1e6)+_0x5587ac[_0xc7769b(0x27c)]));}for(const _0x2cff10 of _0x4f6283['prompts']){_0x2cff10[_0xc7769b(0x224)]===_0xc7769b(0x27c)&&console[_0xc7769b(0x27f)](a4_0xf8ecc9[_0xc7769b(0x1e7)](_0xc7769b(0x268)+_0x2cff10[_0xc7769b(0x257)]+'\x22:\x20'+_0x2cff10['error']));}for(const _0x46f32d of _0x4f6283[_0xc7769b(0x1db)]){_0x46f32d['action']===_0xc7769b(0x27c)&&console[_0xc7769b(0x27f)](a4_0xf8ecc9[_0xc7769b(0x1e7)](_0xc7769b(0x20d)+_0x46f32d[_0xc7769b(0x257)]+_0xc7769b(0x1e6)+_0x46f32d['error']));}for(const _0x13b35d of _0x4f6283['formInterfaces']){_0x13b35d[_0xc7769b(0x224)]===_0xc7769b(0x27c)&&console[_0xc7769b(0x27f)](a4_0xf8ecc9[_0xc7769b(0x1e7)](_0xc7769b(0x201)+_0x13b35d[_0xc7769b(0x257)]+'\x22:\x20'+_0x13b35d[_0xc7769b(0x27c)]));}for(const _0x4d77fb of _0x4f6283[_0xc7769b(0x20c)]){_0x4d77fb[_0xc7769b(0x224)]===_0xc7769b(0x27c)&&console['log'](a4_0xf8ecc9['red'](_0xc7769b(0x1cf)+_0x4d77fb[_0xc7769b(0x257)]+_0xc7769b(0x1e6)+_0x4d77fb['error']));}return 0x1;}console[_0xc7769b(0x27f)](a4_0xf8ecc9['green'](_0xc7769b(0x202)+(_0x526dc2+_0xfa72da)+'\x20resources\x20to\x20\x27'+_0x4f6283[_0xc7769b(0x1ec)]+'\x27'));const _0x4705cf=getLLMProjectUrl(_0xfdfdc,_0x4f6283[_0xc7769b(0x25d)]);return console[_0xc7769b(0x27f)](_0xc7769b(0x276)+a4_0xf8ecc9[_0xc7769b(0x23a)](_0x4705cf)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x8a54d7=a5_0x28bc;(function(_0xe88f86,_0x2116b2){const _0x4623ad=a5_0x28bc,_0x1fedad=_0xe88f86();while(!![]){try{const _0x3aad07=parseInt(_0x4623ad(0x1f1))/0x1+parseInt(_0x4623ad(0x1a2))/0x2*(parseInt(_0x4623ad(0x1c5))/0x3)+parseInt(_0x4623ad(0x1ce))/0x4*(-parseInt(_0x4623ad(0x1bf))/0x5)+parseInt(_0x4623ad(0x1c4))/0x6+-parseInt(_0x4623ad(0x19f))/0x7+parseInt(_0x4623ad(0x1b4))/0x8*(parseInt(_0x4623ad(0x1d7))/0x9)+parseInt(_0x4623ad(0x199))/0xa*(-parseInt(_0x4623ad(0x1d2))/0xb);if(_0x3aad07===_0x2116b2)break;else _0x1fedad['push'](_0x1fedad['shift']());}catch(_0x385ae8){_0x1fedad['push'](_0x1fedad['shift']());}}}(a5_0x50b5,0x6df74));function a5_0x28bc(_0x56c46d,_0x5c8d0e){_0x56c46d=_0x56c46d-0x171;const _0x50b5c3=a5_0x50b5();let _0x28bc16=_0x50b5c3[_0x56c46d];return _0x28bc16;}import*as a5_0x2da925 from'node:fs';import*as a5_0x3ddc4f from'node:path';function a5_0x50b5(){const _0x5ccd6c=['\x20\x20Project:\x20','✗\x20ERROR:\x20','resolveProjectId','tags','\x22,\x20but\x20current\x20site\x20is\x20\x22','forEach','Round\x201/','Using\x20agent:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','dim','dryRun','agentName','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','ERROR','No\x20tests\x20have\x20tags\x20defined.','status','testName','red','PASS','description','502495tUIraq','now','split','Test\x20Configuration:','site','/<agent-name>','Available\x20tags:\x20','tsv','No\x20tests\x20found\x20with\x20tags:\x20','has','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Usage:','verbose','toISOString','\x20\x20Site:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Test\x20Summary','source','text','...','Failed:\x20\x20\x20','Executing\x20new\x20tests...','repeat','Run\x20tests\x20for\x20an\x20LLM\x20agent','stop','no_context','Output\x20written\x20to:\x20','Agent:\x20','map','llm','cyan','FAIL','\x20\x20Evaluating...\x20','yellow','Running\x20test:\x20','Total:\x20\x20\x20\x20','no_tests','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','resolve','\x20-\x20','Re-evaluating...','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','projectDir','utf-8','log','not\x20found','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Cached\x20run\x20from:\x20','Conversation\x20URL:\x20',':\x20Sending\x20user\x20input...','\x20\x20Conversation:\x20','⚠\x20SKIPPED:\x20','Error\x20writing\x20output\x20file:\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','conversation_url','agent:test','rounds','✓\x20PASS:\x20','json','message','69540ymUzXh','Errors:\x20\x20\x20','Round\x20','toLowerCase','Running\x20agent\x20tests...','some','2392383wUxCCq','conversations','Failed\x20Tests:','25272OHCOPr','\x20\x20Round\x20','projectName','no_local_folder','\x20\x20Agent:\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','filter','reason','New\x20tests\x20to\x20execute:\x20','start','push','includes','substring','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Either\x20switch\x20to\x20the\x20\x22','Run\x20\x27tdx\x20agent\x20pull\x20','\x20\x20-\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','136zFVxjo','white','table','agentDirs','executeReeval','basename','Available\x20tests:\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','\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','timestamp','Evaluating\x20response...','5OJioQg','...\x20','trim','\x20(new)','test.yml','2092248hGmdRh','33gzJWUQ','Tests\x20found:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','length','Test\x20','testYmlPath','name','llmProject','green','844964hQLVXW','tests','add','Site:\x20','1067YeMtBv','Error:\x20No\x20previous\x20test\x20run\x20found.','\x20(cached)','\x22:\x20','Passed:\x20\x20\x20','364113HLEogR','✗\x20FAIL:\x20','eval','agent','writeFileSync','Duration:\x20'];a5_0x50b5=function(){return _0x5ccd6c;};return a5_0x50b5();}import a5_0x11c4db 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_0x8a54d7(0x1cb)]=a5_0x8a54d7(0x194);[a5_0x8a54d7(0x1f0)]=a5_0x8a54d7(0x174);async['execute'](_0x8cf3e9){const _0x4cabfe=a5_0x8a54d7,{options:_0x2998fc,args:_0x479d98,tdx:_0x132b09}=_0x8cf3e9,_0x4bc195=_0x479d98[0x0]||'.',_0x47737f=_0x2998fc[_0x4cabfe(0x1e7)],_0x318702=_0x2998fc,_0x2faaf9=_0x318702[_0x4cabfe(0x1d9)]===![],_0x4ec25e=_0x318702['reeval'],_0x205567=_0x318702['name'],_0x3b0d3c=_0x318702[_0x4cabfe(0x1e0)],_0x1d74e8=_0x2998fc[_0x4cabfe(0x1f5)],_0x47566f=_0x318702['output'];if(_0x4ec25e&&_0x2faaf9)return console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x1ee)](_0x4cabfe(0x1fb))),0x1;let _0xffdc17=_0x4cabfe(0x1b6);if(_0x318702[_0x4cabfe(0x197)])_0xffdc17=_0x4cabfe(0x197);else{if(_0x318702['jsonl'])_0xffdc17='jsonl';else{if(_0x318702['tsv'])_0xffdc17=_0x4cabfe(0x1f8);else{if(_0x318702[_0x4cabfe(0x1b6)])_0xffdc17=_0x4cabfe(0x1b6);}}}const _0x572aa4=_0x318702['llmProject'];let _0x3d97ab=_0x4bc195;const _0xc50f14=a5_0x2da925['existsSync'](_0x4bc195),_0x544d4a=_0x4bc195==='.';if(!_0xc50f14||_0x544d4a){const _0x41780a=resolveProjectFromContext(_0x4bc195,_0x572aa4,{'requireFile':_0x4cabfe(0x1c3)});if(_0x41780a['found'])_0x3d97ab=_0x41780a['projectDir'],_0x41780a[_0x4cabfe(0x202)]==='context'&&console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x1e6)](_0x4cabfe(0x1e4)+_0x3d97ab));else switch(_0x41780a[_0x4cabfe(0x1a9)]){case _0x4cabfe(0x176):console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x17e)](_0x41780a[_0x4cabfe(0x198)])),console[_0x4cabfe(0x189)](),console[_0x4cabfe(0x189)](_0x4cabfe(0x1fc)),console['log'](_0x4cabfe(0x1bc)),console[_0x4cabfe(0x189)](_0x4cabfe(0x192)),console[_0x4cabfe(0x189)](),console[_0x4cabfe(0x189)](_0x4cabfe(0x200));return 0x1;case _0x4cabfe(0x1a5):console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x17e)](_0x41780a['message'])),console['log'](),console[_0x4cabfe(0x189)](_0x4cabfe(0x1b1)+_0x41780a[_0x4cabfe(0x1cc)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case'multiple_agents':{const _0x58f6e8=a5_0x3ddc4f[_0x4cabfe(0x1b9)](_0x41780a[_0x4cabfe(0x187)]);console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x17e)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x41780a[_0x4cabfe(0x1cc)]+'\x22:'));for(const _0x53b74b of _0x41780a[_0x4cabfe(0x1b7)]){console[_0x4cabfe(0x189)](_0x4cabfe(0x1b2)+_0x53b74b);}return console[_0x4cabfe(0x189)](),console['log'](_0x4cabfe(0x1a7)+_0x58f6e8+_0x4cabfe(0x1f6)),0x1;}case _0x4cabfe(0x181):console['log'](a5_0x11c4db[_0x4cabfe(0x17e)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x41780a[_0x4cabfe(0x1cc)]+'\x22.')),console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x1e6)]('Project\x20path:\x20'+_0x41780a[_0x4cabfe(0x187)])),console[_0x4cabfe(0x189)](),console[_0x4cabfe(0x189)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x315420,agentInfo:_0x4f92ea}=parseTestFile(_0x3d97ab);let _0x96760b=_0x315420[_0x4cabfe(0x1cf)];if(_0x205567){const _0x4534c3=_0x205567[_0x4cabfe(0x1f3)](',')[_0x4cabfe(0x179)](_0x3d486d=>_0x3d486d[_0x4cabfe(0x1c1)]());_0x96760b=_0x315420[_0x4cabfe(0x1cf)][_0x4cabfe(0x1a8)](_0x562b40=>_0x4534c3[_0x4cabfe(0x1ad)](_0x562b40[_0x4cabfe(0x1cb)]));if(_0x96760b[_0x4cabfe(0x1c8)]===0x0)return console['log'](a5_0x11c4db['yellow']('No\x20tests\x20found\x20matching:\x20'+_0x205567)),console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x1e6)](_0x4cabfe(0x1ba)+_0x315420['tests']['map'](_0x40cae0=>_0x40cae0['name'])['join'](',\x20'))),0x1;}if(_0x3b0d3c){const _0x51d5a2=_0x3b0d3c[_0x4cabfe(0x1f3)](',')['map'](_0x396204=>_0x396204['trim']()[_0x4cabfe(0x19c)]());_0x96760b=_0x96760b[_0x4cabfe(0x1a8)](_0x1992df=>_0x1992df[_0x4cabfe(0x1e0)]?.[_0x4cabfe(0x19e)](_0x1632ff=>_0x51d5a2[_0x4cabfe(0x1ad)](_0x1632ff['toLowerCase']())));if(_0x96760b[_0x4cabfe(0x1c8)]===0x0){console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x17e)](_0x4cabfe(0x1f9)+_0x3b0d3c));const _0x3e26e5=new Set();return _0x315420[_0x4cabfe(0x1cf)]['forEach'](_0x39fa56=>_0x39fa56[_0x4cabfe(0x1e0)]?.[_0x4cabfe(0x1e2)](_0x428e56=>_0x3e26e5[_0x4cabfe(0x1d0)](_0x428e56))),_0x3e26e5['size']>0x0?console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x1e6)](_0x4cabfe(0x1f7)+[..._0x3e26e5]['join'](',\x20'))):console[_0x4cabfe(0x189)](a5_0x11c4db['dim'](_0x4cabfe(0x1eb))),0x1;}}if(_0x4ec25e)return this[_0x4cabfe(0x1b8)](_0x8cf3e9,{'definition':{'tests':_0x96760b},'agentInfo':_0x4f92ea,'outputFormat':_0xffdc17,'outputFile':_0x47566f,'testNames':_0x205567});if(_0x47737f){console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x17b)](_0x4cabfe(0x1f4))),console[_0x4cabfe(0x189)](_0x4cabfe(0x1ff)+a5_0x11c4db['white'](_0x1d74e8)),console[_0x4cabfe(0x189)](_0x4cabfe(0x1dd)+a5_0x11c4db[_0x4cabfe(0x1b5)](_0x4f92ea[_0x4cabfe(0x1a4)])),console[_0x4cabfe(0x189)](_0x4cabfe(0x1a6)+a5_0x11c4db['white'](_0x4f92ea[_0x4cabfe(0x1e8)])),console['log'](),console[_0x4cabfe(0x189)](_0x4cabfe(0x1c6)+a5_0x11c4db[_0x4cabfe(0x1b5)](_0x96760b[_0x4cabfe(0x1c8)]));for(let _0x3f2574=0x0;_0x3f2574<_0x96760b['length'];_0x3f2574++){const _0x4f7d46=_0x96760b[_0x3f2574],_0x5546f1=_0x4f7d46[_0x4cabfe(0x195)][_0x4cabfe(0x1c8)]===0x1?'round':_0x4cabfe(0x195),_0x46ef29=_0x4f7d46[_0x4cabfe(0x1e0)]?.[_0x4cabfe(0x1c8)]?'\x20['+_0x4f7d46[_0x4cabfe(0x1e0)]['join'](',\x20')+']':'';console[_0x4cabfe(0x189)]('\x20\x20'+(_0x3f2574+0x1)+'.\x20'+a5_0x11c4db['white'](_0x4f7d46['name'])+'\x20('+_0x4f7d46[_0x4cabfe(0x195)][_0x4cabfe(0x1c8)]+'\x20'+_0x5546f1+')'+a5_0x11c4db[_0x4cabfe(0x1e6)](_0x46ef29));}return 0x0;}let _0x42578a,_0x36eb65;try{_0x42578a=await _0x132b09[_0x4cabfe(0x17a)][_0x4cabfe(0x1df)](_0x4f92ea[_0x4cabfe(0x1a4)]);}catch(_0x540dde){const _0x4cca5c=_0x540dde instanceof Error?_0x540dde[_0x4cabfe(0x198)]:String(_0x540dde);return _0x4cca5c[_0x4cabfe(0x1ad)]('404')||_0x4cca5c[_0x4cabfe(0x19c)]()[_0x4cabfe(0x1ad)](_0x4cabfe(0x18a))?console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x1ee)](_0x4cabfe(0x1b3)+_0x4f92ea[_0x4cabfe(0x1a4)])):console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x1ee)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x4f92ea[_0x4cabfe(0x1a4)]+_0x4cabfe(0x1d5)+_0x4cca5c)),0x1;}try{_0x36eb65=await _0x132b09[_0x4cabfe(0x17a)]['resolveAgentId'](_0x4f92ea[_0x4cabfe(0x1e8)],_0x42578a);}catch(_0x568780){const _0x2e97be=_0x568780 instanceof Error?_0x568780[_0x4cabfe(0x198)]:String(_0x568780);return _0x2e97be['includes']('404')||_0x2e97be[_0x4cabfe(0x19c)]()[_0x4cabfe(0x1ad)](_0x4cabfe(0x18a))?console[_0x4cabfe(0x189)](a5_0x11c4db['red'](_0x4cabfe(0x1e5)+_0x4f92ea[_0x4cabfe(0x1e8)])):console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x1ee)](_0x4cabfe(0x1af)+_0x4f92ea[_0x4cabfe(0x1e8)]+_0x4cabfe(0x1d5)+_0x2e97be)),0x1;}let _0x55f282;if(!_0x2faaf9)try{_0x55f282=await setupEvaluatorAgent(_0x132b09[_0x4cabfe(0x17a)],_0x2998fc['verbose']);}catch(_0x3c2016){const _0x70d3e1=_0x3c2016 instanceof Error?_0x3c2016['message']:String(_0x3c2016);return console['log'](a5_0x11c4db[_0x4cabfe(0x1ee)](_0x4cabfe(0x182)+_0x70d3e1)),0x1;}console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x17b)](_0x4cabfe(0x19d))),console[_0x4cabfe(0x189)](_0x4cabfe(0x1d1)+a5_0x11c4db[_0x4cabfe(0x1b5)](_0x1d74e8)),console[_0x4cabfe(0x189)]('Agent:\x20'+a5_0x11c4db[_0x4cabfe(0x1b5)](_0x4f92ea['projectName']+'/'+_0x4f92ea[_0x4cabfe(0x1e8)])),console[_0x4cabfe(0x189)]();const _0x39ac5e=[],_0x4a7644=[],_0x39eac6=Date['now']();for(let _0x5330eb=0x0;_0x5330eb<_0x96760b[_0x4cabfe(0x1c8)];_0x5330eb++){const _0x151a7f=_0x96760b[_0x5330eb];_0x96760b[_0x4cabfe(0x1c8)]>0x1?console[_0x4cabfe(0x189)](_0x4cabfe(0x1c9)+(_0x5330eb+0x1)+'/'+_0x96760b[_0x4cabfe(0x1c8)]+':\x20'+a5_0x11c4db['white'](_0x151a7f[_0x4cabfe(0x1cb)])):console[_0x4cabfe(0x189)](_0x4cabfe(0x17f)+a5_0x11c4db[_0x4cabfe(0x1b5)](_0x151a7f[_0x4cabfe(0x1cb)]));const _0x24c968=createCommandSpinner(_0x4cabfe(0x1e3)+_0x151a7f['rounds']['length']+_0x4cabfe(0x18e));_0x24c968[_0x4cabfe(0x1ab)]();try{const {result:_0x5777df,conversation:_0x57f2cf}=await runTest(_0x132b09[_0x4cabfe(0x17a)],_0x151a7f,{'agentId':_0x36eb65,'projectId':_0x42578a,'site':_0x1d74e8,'noEval':_0x2faaf9,'evaluatorId':_0x55f282,'onRoundStart':(_0x56530f,_0x46e7a7)=>{const _0x5ae2fc=_0x4cabfe;_0x24c968[_0x5ae2fc(0x203)]='Round\x20'+(_0x56530f+0x1)+'/'+_0x46e7a7+_0x5ae2fc(0x18e);},'onRoundComplete':(_0x18987a,_0x934ef9,_0x1ed86d)=>{const _0x22f22e=_0x4cabfe,_0x405936=formatElapsed(_0x934ef9);_0x1ed86d?console[_0x22f22e(0x189)]('\x20\x20Round\x20'+(_0x18987a+0x1)+'/'+_0x151a7f['rounds']['length']+'...\x20'+a5_0x11c4db[_0x22f22e(0x1cd)]('✓')+'\x20('+_0x405936+')'):console['log'](_0x22f22e(0x1a3)+(_0x18987a+0x1)+'/'+_0x151a7f[_0x22f22e(0x195)][_0x22f22e(0x1c8)]+_0x22f22e(0x1c0)+a5_0x11c4db[_0x22f22e(0x1ee)]('✗'));},'onEvaluationStart':()=>{_0x24c968['text']='Evaluating\x20response...';},'onEvaluationComplete':_0x4d503e=>{const _0xce1b38=_0x4cabfe,_0x371831=formatElapsed(_0x4d503e);console['log'](_0xce1b38(0x17d)+a5_0x11c4db[_0xce1b38(0x1cd)]('✓')+'\x20('+_0x371831+')');}});_0x24c968[_0x4cabfe(0x175)](),_0x39ac5e[_0x4cabfe(0x1ac)](_0x5777df),_0x4a7644[_0x4cabfe(0x1ac)](_0x57f2cf);if(_0x5777df['status']===_0x4cabfe(0x1ef))console[_0x4cabfe(0x189)](a5_0x11c4db['green'](_0x4cabfe(0x196)+_0x5777df['reason']));else _0x5777df[_0x4cabfe(0x1ec)]===_0x4cabfe(0x17c)?console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x1ee)]('✗\x20FAIL:\x20'+_0x5777df[_0x4cabfe(0x1a9)])):console[_0x4cabfe(0x189)](a5_0x11c4db['red'](_0x4cabfe(0x1de)+_0x5777df[_0x4cabfe(0x1a9)]));_0x5777df[_0x4cabfe(0x193)]&&console['log'](a5_0x11c4db[_0x4cabfe(0x1e6)](_0x4cabfe(0x18d)+_0x5777df[_0x4cabfe(0x193)])),console[_0x4cabfe(0x189)]();}catch(_0x72564d){_0x24c968[_0x4cabfe(0x175)]();const _0x1a7c1b=_0x72564d instanceof Error?_0x72564d[_0x4cabfe(0x198)]:String(_0x72564d);console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x1ee)]('✗\x20ERROR:\x20'+_0x1a7c1b)),console['log'](),_0x39ac5e['push']({'name':_0x151a7f[_0x4cabfe(0x1cb)],'status':_0x4cabfe(0x1ea),'reason':_0x1a7c1b,'timestamp':new Date()[_0x4cabfe(0x1fe)](),'duration_ms':0x0});}}const _0x2cc506=Date['now']()-_0x39eac6,_0x2922b0=_0x39ac5e[_0x4cabfe(0x1a8)](_0x5f4a7f=>_0x5f4a7f['status']===_0x4cabfe(0x1ef))[_0x4cabfe(0x1c8)],_0x58e46c=_0x39ac5e[_0x4cabfe(0x1a8)](_0x3f9998=>_0x3f9998[_0x4cabfe(0x1ec)]===_0x4cabfe(0x17c))['length'],_0x5d07f9=_0x39ac5e[_0x4cabfe(0x1a8)](_0x1f830a=>_0x1f830a['status']===_0x4cabfe(0x1ea))['length'];console[_0x4cabfe(0x189)]('━'[_0x4cabfe(0x173)](0x3c)),console[_0x4cabfe(0x189)](_0x4cabfe(0x201)),console[_0x4cabfe(0x189)]('━'[_0x4cabfe(0x173)](0x3c)),console[_0x4cabfe(0x189)]('Total:\x20\x20\x20\x20'+_0x39ac5e[_0x4cabfe(0x1c8)]),console[_0x4cabfe(0x189)]('Passed:\x20\x20\x20'+a5_0x11c4db[_0x4cabfe(0x1cd)](_0x2922b0)),console[_0x4cabfe(0x189)](_0x4cabfe(0x171)+a5_0x11c4db[_0x4cabfe(0x1ee)](_0x58e46c));_0x5d07f9>0x0&&console[_0x4cabfe(0x189)](_0x4cabfe(0x19a)+a5_0x11c4db[_0x4cabfe(0x1ee)](_0x5d07f9));console[_0x4cabfe(0x189)]('Duration:\x20'+formatElapsed(_0x2cc506)),console['log']('━'['repeat'](0x3c));const _0x509e6c=_0x39ac5e[_0x4cabfe(0x1a8)](_0x36047b=>_0x36047b[_0x4cabfe(0x1ec)]!==_0x4cabfe(0x1ef));if(_0x509e6c[_0x4cabfe(0x1c8)]>0x0){console[_0x4cabfe(0x189)](),console[_0x4cabfe(0x189)](_0x4cabfe(0x1a1));for(const _0xa71b80 of _0x509e6c){const _0x850c48=a5_0x11c4db[_0x4cabfe(0x1ee)]('✗'),_0x750624=_0xa71b80[_0x4cabfe(0x1a9)][_0x4cabfe(0x1c8)]>0x32?_0xa71b80[_0x4cabfe(0x1a9)][_0x4cabfe(0x1ae)](0x0,0x32)+_0x4cabfe(0x204):_0xa71b80[_0x4cabfe(0x1a9)];console[_0x4cabfe(0x189)]('\x20\x20'+_0x850c48+'\x20'+_0xa71b80[_0x4cabfe(0x1cb)]+':\x20'+_0x750624);}}const _0x246274={'summary':{'total':_0x39ac5e[_0x4cabfe(0x1c8)],'passed':_0x2922b0,'failed':_0x58e46c,'errors':_0x5d07f9>0x0?_0x5d07f9:undefined,'duration_ms':_0x2cc506},'tests':_0x39ac5e,'agent':{'project':_0x4f92ea[_0x4cabfe(0x1a4)],'name':_0x4f92ea[_0x4cabfe(0x1e8)],'site':_0x1d74e8},'timestamp':new Date(_0x39eac6)[_0x4cabfe(0x1fe)]()};try{const _0x1f7b57=buildCachedTestRun(_0x4a7644,{'site':_0x1d74e8,'projectId':_0x42578a,'projectName':_0x4f92ea[_0x4cabfe(0x1a4)],'agentId':_0x36eb65,'agentName':_0x4f92ea[_0x4cabfe(0x1e8)],'testYmlPath':a5_0x3ddc4f[_0x4cabfe(0x183)](_0x4f92ea[_0x4cabfe(0x1ca)])});saveLastTestRun(_0x1f7b57);}catch{}if(_0xffdc17!=='table'||_0x47566f){const _0x2ba017=formatResults(_0x246274,_0xffdc17);if(_0x47566f)try{a5_0x2da925[_0x4cabfe(0x1db)](_0x47566f,_0x2ba017,_0x4cabfe(0x188)),console[_0x4cabfe(0x189)](),console['log'](a5_0x11c4db[_0x4cabfe(0x1e6)]('Output\x20written\x20to:\x20'+_0x47566f));}catch(_0x16dc33){return console[_0x4cabfe(0x189)](),console['log'](a5_0x11c4db['red']('Error\x20writing\x20output\x20file:\x20'+_0x16dc33)),0x1;}else console[_0x4cabfe(0x189)](),console[_0x4cabfe(0x189)](_0x2ba017);}return _0x509e6c[_0x4cabfe(0x1c8)]>0x0?0x1:0x0;}async[a5_0x8a54d7(0x1b8)](_0x43f85a,_0xa7b10){const _0x3c575b=a5_0x8a54d7,{options:_0x1a4db1,tdx:_0x144906}=_0x43f85a,{definition:_0x199fdc,agentInfo:_0x249889,outputFormat:_0x25c286,outputFile:_0x395227}=_0xa7b10,_0x514770=_0x1a4db1[_0x3c575b(0x1f5)],_0x15121a=loadLastTestRun();if(!_0x15121a)return console['log'](a5_0x11c4db[_0x3c575b(0x1ee)](_0x3c575b(0x1d3))),console[_0x3c575b(0x189)](a5_0x11c4db['dim'](_0x3c575b(0x1c7))),0x1;if(_0x15121a['agent'][_0x3c575b(0x1e8)]!==_0x249889[_0x3c575b(0x1e8)])return console[_0x3c575b(0x189)](a5_0x11c4db['red'](_0x3c575b(0x1bb)+_0x15121a['agent'][_0x3c575b(0x1e8)]+_0x3c575b(0x1e9)+_0x249889[_0x3c575b(0x1e8)]+'\x22.')),console[_0x3c575b(0x189)](a5_0x11c4db[_0x3c575b(0x1e6)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x1accad=new Set(_0x15121a[_0x3c575b(0x1a0)][_0x3c575b(0x179)](_0x28318c=>_0x28318c[_0x3c575b(0x1ed)])),_0x2ba020=_0x199fdc['tests'][_0x3c575b(0x1a8)](_0x1dbd8b=>!_0x1accad['has'](_0x1dbd8b[_0x3c575b(0x1cb)]));if(_0x2ba020[_0x3c575b(0x1c8)]>0x0&&_0x15121a[_0x3c575b(0x1f5)]!==_0x514770)return console[_0x3c575b(0x189)](a5_0x11c4db['red'](_0x3c575b(0x186))),console[_0x3c575b(0x189)](a5_0x11c4db['dim']('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x15121a[_0x3c575b(0x1f5)]+_0x3c575b(0x1e1)+_0x514770+'\x22.')),console['log'](a5_0x11c4db[_0x3c575b(0x1e6)](_0x3c575b(0x1b0)+_0x15121a[_0x3c575b(0x1f5)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x3dc060=_0x199fdc[_0x3c575b(0x1cf)][_0x3c575b(0x1a8)](_0x5be6f6=>_0x1accad[_0x3c575b(0x1fa)](_0x5be6f6['name'])),_0x24208f=_0x2ba020;let _0x2c3fc9;try{_0x2c3fc9=await setupEvaluatorAgent(_0x144906[_0x3c575b(0x17a)],_0x1a4db1[_0x3c575b(0x1fd)]);}catch(_0x55d0ae){const _0x1849b2=_0x55d0ae instanceof Error?_0x55d0ae['message']:String(_0x55d0ae);return console[_0x3c575b(0x189)](a5_0x11c4db[_0x3c575b(0x1ee)](_0x3c575b(0x182)+_0x1849b2)),0x1;}console[_0x3c575b(0x189)](a5_0x11c4db['cyan']('Re-evaluating\x20cached\x20test\x20run...')),console['log'](_0x3c575b(0x18c)+a5_0x11c4db[_0x3c575b(0x1b5)](_0x15121a[_0x3c575b(0x1bd)])),console[_0x3c575b(0x189)](_0x3c575b(0x178)+a5_0x11c4db['white'](_0x15121a[_0x3c575b(0x1da)][_0x3c575b(0x1a4)]+'/'+_0x15121a[_0x3c575b(0x1da)][_0x3c575b(0x1e8)]));_0x24208f['length']>0x0&&console[_0x3c575b(0x189)](_0x3c575b(0x1aa)+a5_0x11c4db[_0x3c575b(0x17e)](_0x24208f[_0x3c575b(0x1c8)]));console[_0x3c575b(0x189)]();const _0x18e364=[],_0x3fcf5e=Date[_0x3c575b(0x1f2)](),_0x52e5c2=createCommandSpinner(_0x3c575b(0x185));if(_0x3dc060[_0x3c575b(0x1c8)]>0x0)try{const _0x97289e=await reevaluateFromCache(_0x144906[_0x3c575b(0x17a)],_0x15121a,{'tests':_0x3dc060},{'evaluatorId':_0x2c3fc9,'onTestStart':(_0xdd8bbf,_0x19e61b,_0x1fd24b)=>{const _0x56e8a7=_0x3c575b;_0x52e5c2[_0x56e8a7(0x203)]='Re-evaluating\x20'+(_0x19e61b+0x1)+'/'+_0x1fd24b+':\x20'+_0xdd8bbf+'...';if(!_0x52e5c2['isSpinning'])_0x52e5c2['start']();},'onTestComplete':(_0x3d2ba8,_0x8b8773)=>{const _0x31f89e=_0x3c575b;_0x52e5c2[_0x31f89e(0x175)]();if(_0x8b8773[_0x31f89e(0x1ec)]==='PASS')console[_0x31f89e(0x189)](a5_0x11c4db[_0x31f89e(0x1cd)]('✓\x20PASS:\x20'+_0x3d2ba8)+a5_0x11c4db['dim'](_0x31f89e(0x1d4)));else _0x8b8773[_0x31f89e(0x1ec)]===_0x31f89e(0x17c)?console[_0x31f89e(0x189)](a5_0x11c4db[_0x31f89e(0x1ee)](_0x31f89e(0x1d8)+_0x3d2ba8+'\x20-\x20'+_0x8b8773[_0x31f89e(0x1a9)])+a5_0x11c4db[_0x31f89e(0x1e6)](_0x31f89e(0x1d4))):console[_0x31f89e(0x189)](a5_0x11c4db[_0x31f89e(0x1ee)]('✗\x20ERROR:\x20'+_0x3d2ba8+_0x31f89e(0x184)+_0x8b8773[_0x31f89e(0x1a9)]));_0x8b8773[_0x31f89e(0x193)]&&console[_0x31f89e(0x189)](a5_0x11c4db[_0x31f89e(0x1e6)]('\x20\x20Conversation:\x20'+_0x8b8773[_0x31f89e(0x193)])),_0x18e364[_0x31f89e(0x1ac)](_0x8b8773);},'onTestSkipped':(_0x2beb29,_0x3d9c1d)=>{const _0x2bbfbe=_0x3c575b;_0x52e5c2[_0x2bbfbe(0x175)](),console[_0x2bbfbe(0x189)](a5_0x11c4db[_0x2bbfbe(0x17e)](_0x2bbfbe(0x190)+_0x2beb29+_0x2bbfbe(0x184)+_0x3d9c1d));}});for(const _0x550693 of _0x97289e){!_0x18e364['find'](_0x42ee9c=>_0x42ee9c['name']===_0x550693[_0x3c575b(0x1cb)])&&_0x18e364[_0x3c575b(0x1ac)](_0x550693);}}catch(_0x210261){_0x52e5c2['stop']();const _0x816461=_0x210261 instanceof Error?_0x210261[_0x3c575b(0x198)]:String(_0x210261);return console[_0x3c575b(0x189)](a5_0x11c4db[_0x3c575b(0x1ee)](_0x3c575b(0x18b)+_0x816461)),0x1;}_0x52e5c2[_0x3c575b(0x175)]();if(_0x24208f[_0x3c575b(0x1c8)]>0x0){console[_0x3c575b(0x189)](),console['log'](a5_0x11c4db[_0x3c575b(0x17b)](_0x3c575b(0x172)));const {projectId:_0x5cea99,agentId:_0x5ac83f}=_0x15121a[_0x3c575b(0x1da)];for(const _0x39baa3 of _0x24208f){console[_0x3c575b(0x189)]('Running:\x20'+a5_0x11c4db[_0x3c575b(0x1b5)](_0x39baa3[_0x3c575b(0x1cb)]));const _0x3d86b6=createCommandSpinner('Round\x201/'+_0x39baa3['rounds'][_0x3c575b(0x1c8)]+_0x3c575b(0x18e));_0x3d86b6[_0x3c575b(0x1ab)]();try{const {result:_0x24aa1c}=await runTest(_0x144906[_0x3c575b(0x17a)],_0x39baa3,{'agentId':_0x5ac83f,'projectId':_0x5cea99,'site':_0x15121a[_0x3c575b(0x1f5)],'noEval':![],'evaluatorId':_0x2c3fc9,'onRoundStart':(_0x1c4006,_0x3157e5)=>{const _0x151ca2=_0x3c575b;_0x3d86b6[_0x151ca2(0x203)]=_0x151ca2(0x19b)+(_0x1c4006+0x1)+'/'+_0x3157e5+_0x151ca2(0x18e);},'onRoundComplete':(_0x2b8df2,_0x2a7375,_0x1e04cf)=>{const _0x43a705=_0x3c575b,_0x27e1af=formatElapsed(_0x2a7375);_0x1e04cf?console[_0x43a705(0x189)](_0x43a705(0x1a3)+(_0x2b8df2+0x1)+'/'+_0x39baa3['rounds'][_0x43a705(0x1c8)]+'...\x20'+a5_0x11c4db[_0x43a705(0x1cd)]('✓')+'\x20('+_0x27e1af+')'):console['log']('\x20\x20Round\x20'+(_0x2b8df2+0x1)+'/'+_0x39baa3['rounds']['length']+_0x43a705(0x1c0)+a5_0x11c4db[_0x43a705(0x1ee)]('✗'));},'onEvaluationStart':()=>{const _0x35e92b=_0x3c575b;_0x3d86b6['text']=_0x35e92b(0x1be);},'onEvaluationComplete':_0x56b2e0=>{const _0x216357=_0x3c575b,_0x1668b1=formatElapsed(_0x56b2e0);console[_0x216357(0x189)](_0x216357(0x17d)+a5_0x11c4db[_0x216357(0x1cd)]('✓')+'\x20('+_0x1668b1+')');}});_0x3d86b6['stop'](),_0x18e364['push'](_0x24aa1c);if(_0x24aa1c[_0x3c575b(0x1ec)]===_0x3c575b(0x1ef))console['log'](a5_0x11c4db[_0x3c575b(0x1cd)](_0x3c575b(0x196)+_0x24aa1c['reason'])+a5_0x11c4db[_0x3c575b(0x1e6)]('\x20(new)'));else _0x24aa1c[_0x3c575b(0x1ec)]===_0x3c575b(0x17c)?console['log'](a5_0x11c4db[_0x3c575b(0x1ee)]('✗\x20FAIL:\x20'+_0x24aa1c[_0x3c575b(0x1a9)])+a5_0x11c4db['dim'](_0x3c575b(0x1c2))):console[_0x3c575b(0x189)](a5_0x11c4db[_0x3c575b(0x1ee)]('✗\x20ERROR:\x20'+_0x24aa1c['reason']));_0x24aa1c[_0x3c575b(0x193)]&&console[_0x3c575b(0x189)](a5_0x11c4db[_0x3c575b(0x1e6)](_0x3c575b(0x18f)+_0x24aa1c[_0x3c575b(0x193)]));}catch(_0x4e451a){_0x3d86b6[_0x3c575b(0x175)]();const _0x24f4ef=_0x4e451a instanceof Error?_0x4e451a['message']:String(_0x4e451a);console[_0x3c575b(0x189)](a5_0x11c4db[_0x3c575b(0x1ee)](_0x3c575b(0x1de)+_0x24f4ef)),_0x18e364[_0x3c575b(0x1ac)]({'name':_0x39baa3[_0x3c575b(0x1cb)],'status':_0x3c575b(0x1ea),'reason':_0x24f4ef,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x3c575b(0x189)]();const _0x373e44=Date[_0x3c575b(0x1f2)]()-_0x3fcf5e,_0x50e789=_0x18e364[_0x3c575b(0x1a8)](_0x380e6d=>_0x380e6d[_0x3c575b(0x1ec)]==='PASS')[_0x3c575b(0x1c8)],_0x11765f=_0x18e364['filter'](_0x55916f=>_0x55916f[_0x3c575b(0x1ec)]==='FAIL')[_0x3c575b(0x1c8)],_0xa8ce00=_0x18e364[_0x3c575b(0x1a8)](_0x1ade9d=>_0x1ade9d[_0x3c575b(0x1ec)]==='ERROR')[_0x3c575b(0x1c8)];console['log']('━'[_0x3c575b(0x173)](0x3c)),console[_0x3c575b(0x189)]('Re-evaluation\x20Summary'),console['log']('━'[_0x3c575b(0x173)](0x3c)),console[_0x3c575b(0x189)](_0x3c575b(0x180)+_0x18e364[_0x3c575b(0x1c8)]),console[_0x3c575b(0x189)](_0x3c575b(0x1d6)+a5_0x11c4db[_0x3c575b(0x1cd)](_0x50e789)),console[_0x3c575b(0x189)](_0x3c575b(0x171)+a5_0x11c4db[_0x3c575b(0x1ee)](_0x11765f));_0xa8ce00>0x0&&console['log'](_0x3c575b(0x19a)+a5_0x11c4db['red'](_0xa8ce00));console[_0x3c575b(0x189)](_0x3c575b(0x1dc)+formatElapsed(_0x373e44)),console[_0x3c575b(0x189)]('━'[_0x3c575b(0x173)](0x3c));const _0x17aa07={'summary':{'total':_0x18e364[_0x3c575b(0x1c8)],'passed':_0x50e789,'failed':_0x11765f,'errors':_0xa8ce00>0x0?_0xa8ce00:undefined,'duration_ms':_0x373e44},'tests':_0x18e364,'agent':{'project':_0x249889[_0x3c575b(0x1a4)],'name':_0x249889[_0x3c575b(0x1e8)],'site':_0x514770},'timestamp':new Date(_0x3fcf5e)['toISOString']()};if(_0x25c286!==_0x3c575b(0x1b6)||_0x395227){const _0xbde9d6=formatResults(_0x17aa07,_0x25c286);if(_0x395227)try{a5_0x2da925[_0x3c575b(0x1db)](_0x395227,_0xbde9d6,'utf-8'),console[_0x3c575b(0x189)](),console['log'](a5_0x11c4db[_0x3c575b(0x1e6)](_0x3c575b(0x177)+_0x395227));}catch(_0x3f3844){return console[_0x3c575b(0x189)](),console['log'](a5_0x11c4db['red'](_0x3c575b(0x191)+_0x3f3844)),0x1;}else console[_0x3c575b(0x189)](),console[_0x3c575b(0x189)](_0xbde9d6);}const _0xdc81b5=_0x18e364['filter'](_0x3fb314=>_0x3fb314[_0x3c575b(0x1ec)]!==_0x3c575b(0x1ef));return _0xdc81b5[_0x3c575b(0x1c8)]>0x0?0x1:0x0;}}
1
+ const a5_0x437f3c=a5_0x573a;function a5_0x573a(_0x2ff6dc,_0x38ec49){_0x2ff6dc=_0x2ff6dc-0x6e;const _0x30ceb0=a5_0x30ce();let _0x573a0a=_0x30ceb0[_0x2ff6dc];return _0x573a0a;}(function(_0x522942,_0x2e4896){const _0x3e45e6=a5_0x573a,_0x21854f=_0x522942();while(!![]){try{const _0x3f34ef=parseInt(_0x3e45e6(0x74))/0x1*(parseInt(_0x3e45e6(0x82))/0x2)+parseInt(_0x3e45e6(0xfa))/0x3*(-parseInt(_0x3e45e6(0x8b))/0x4)+parseInt(_0x3e45e6(0xea))/0x5*(-parseInt(_0x3e45e6(0x7d))/0x6)+parseInt(_0x3e45e6(0xb6))/0x7+-parseInt(_0x3e45e6(0xfb))/0x8+parseInt(_0x3e45e6(0x93))/0x9*(parseInt(_0x3e45e6(0xa0))/0xa)+-parseInt(_0x3e45e6(0x98))/0xb;if(_0x3f34ef===_0x2e4896)break;else _0x21854f['push'](_0x21854f['shift']());}catch(_0x307640){_0x21854f['push'](_0x21854f['shift']());}}}(a5_0x30ce,0x2cef4));import*as a5_0x25ab01 from'node:fs';import*as a5_0x5afdd6 from'node:path';import a5_0x319647 from'chalk';function a5_0x30ce(){const _0x440eb7=['478474dRAJMw','Agent:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','tests','description','tsv','push','Total:\x20\x20\x20\x20','Tests\x20found:\x20','9152mMLHnP','Duration:\x20','\x20\x20Project:\x20','testName','verbose','\x20\x20Evaluating...\x20','\x20(new)','execute','22086Fmxwqs','no_tests','Run\x20\x27tdx\x20agent\x20pull\x20','site','has','1046155xpXpzt','utf-8','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','projectDir','white','PASS','Round\x201/','404','230pfmDoB','red','json','Test\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','status','tags','reeval','/<agent-name>','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','green','Site:\x20','cyan','includes','yellow','Cached\x20run\x20is\x20from\x20site\x20\x22','Available\x20tags:\x20','timestamp','now','context','executeReeval','writeFileSync','1598149LcLkky','map','repeat','toISOString','Run\x20tests\x20for\x20an\x20LLM\x20agent','FAIL','\x20\x20Site:\x20','\x20-\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','length','rounds','Running:\x20','no_local_folder','found','find','isSpinning','test.yml','text','resolveAgentId','name','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Usage:','llm','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','\x20\x20Agent:\x20','reason','source','Failed:\x20\x20\x20','start','message',':\x20Sending\x20user\x20input...','...\x20','toLowerCase','agent','Output\x20written\x20to:\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','join','Available\x20tests:\x20','Error\x20writing\x20output\x20file:\x20','dim','jsonl','✗\x20FAIL:\x20','\x20\x20Conversation:\x20','some','eval','basename','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','agentName','add','Running\x20agent\x20tests...','Using\x20agent:\x20','not\x20found','43115muWoTR','round','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','llmProject','conversation_url','New\x20tests\x20to\x20execute:\x20','stop','agent:test','Running\x20test:\x20','Cached\x20run\x20from:\x20','projectName','table','...','✗\x20ERROR:\x20','split','\x22,\x20but\x20current\x20site\x20is\x20\x22','12AZiJNG','1333544EsGCWV','filter','trim','\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)','Executing\x20new\x20tests...','Test\x20Summary','\x20(cached)','log','Re-evaluating...','Evaluating\x20response...','Project\x20path:\x20','✓\x20PASS:\x20','1BPEMvQ','\x20\x20Round\x20','output','✗\x20ERROR:\x20Project\x20not\x20found:\x20','substring','ERROR','no_context','\x20\x20-\x20','size','48xDkiUF','resolveProjectId','forEach','Passed:\x20\x20\x20','Errors:\x20\x20\x20'];a5_0x30ce=function(){return _0x440eb7;};return a5_0x30ce();}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_0x437f3c(0xc9)]=a5_0x437f3c(0xf1);[a5_0x437f3c(0x86)]=a5_0x437f3c(0xba);async[a5_0x437f3c(0x92)](_0x1464e6){const _0x236abd=a5_0x437f3c,{options:_0x409643,args:_0x59dc4c,tdx:_0x415489}=_0x1464e6,_0xf021c6=_0x59dc4c[0x0]||'.',_0x10d7ca=_0x409643['dryRun'],_0x2540fd=_0x409643,_0xa40007=_0x2540fd[_0x236abd(0xe2)]===![],_0x51696e=_0x2540fd[_0x236abd(0xa7)],_0x44c9ba=_0x2540fd[_0x236abd(0xc9)],_0x259ca8=_0x2540fd[_0x236abd(0xa6)],_0x5402d0=_0x409643[_0x236abd(0x96)],_0x981844=_0x2540fd[_0x236abd(0x76)];if(_0x51696e&&_0xa40007)return console[_0x236abd(0x6f)](a5_0x319647[_0x236abd(0xa1)](_0x236abd(0x84))),0x1;let _0x51056b='table';if(_0x2540fd[_0x236abd(0xa2)])_0x51056b='json';else{if(_0x2540fd[_0x236abd(0xde)])_0x51056b=_0x236abd(0xde);else{if(_0x2540fd[_0x236abd(0x87)])_0x51056b=_0x236abd(0x87);else{if(_0x2540fd[_0x236abd(0xf5)])_0x51056b=_0x236abd(0xf5);}}}const _0x24c7f6=_0x2540fd[_0x236abd(0xed)];let _0x1989bf=_0xf021c6;const _0x3aa8fb=a5_0x25ab01['existsSync'](_0xf021c6),_0x9246e4=_0xf021c6==='.';if(!_0x3aa8fb||_0x9246e4){const _0x3b2d15=resolveProjectFromContext(_0xf021c6,_0x24c7f6,{'requireFile':_0x236abd(0xc6)});if(_0x3b2d15[_0x236abd(0xc3)])_0x1989bf=_0x3b2d15[_0x236abd(0x9b)],_0x3b2d15[_0x236abd(0xd0)]===_0x236abd(0xb3)&&console[_0x236abd(0x6f)](a5_0x319647['dim'](_0x236abd(0xe8)+_0x1989bf));else switch(_0x3b2d15['reason']){case _0x236abd(0x7a):console['log'](a5_0x319647[_0x236abd(0xae)](_0x3b2d15[_0x236abd(0xd3)])),console[_0x236abd(0x6f)](),console[_0x236abd(0x6f)](_0x236abd(0xcb)),console[_0x236abd(0x6f)]('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console['log'](_0x236abd(0xfe)),console[_0x236abd(0x6f)](),console[_0x236abd(0x6f)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x236abd(0xc2):console[_0x236abd(0x6f)](a5_0x319647[_0x236abd(0xae)](_0x3b2d15[_0x236abd(0xd3)])),console[_0x236abd(0x6f)](),console[_0x236abd(0x6f)](_0x236abd(0x95)+_0x3b2d15[_0x236abd(0xed)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case'multiple_agents':{const _0x8f0b8b=a5_0x5afdd6[_0x236abd(0xe3)](_0x3b2d15['projectDir']);console['log'](a5_0x319647['yellow']('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x3b2d15['llmProject']+'\x22:'));for(const _0x2b174d of _0x3b2d15['agentDirs']){console[_0x236abd(0x6f)](_0x236abd(0x7b)+_0x2b174d);}return console[_0x236abd(0x6f)](),console[_0x236abd(0x6f)](_0x236abd(0xa9)+_0x8f0b8b+_0x236abd(0xa8)),0x1;}case _0x236abd(0x94):console['log'](a5_0x319647['yellow'](_0x236abd(0xe4)+_0x3b2d15[_0x236abd(0xed)]+'\x22.')),console[_0x236abd(0x6f)](a5_0x319647['dim'](_0x236abd(0x72)+_0x3b2d15[_0x236abd(0x9b)])),console[_0x236abd(0x6f)](),console['log'](_0x236abd(0xec));return 0x1;}}const {definition:_0x13e393,agentInfo:_0x1fbdf2}=parseTestFile(_0x1989bf);let _0x3b7703=_0x13e393[_0x236abd(0x85)];if(_0x44c9ba){const _0x599ad2=_0x44c9ba['split'](',')[_0x236abd(0xb7)](_0x372fe1=>_0x372fe1[_0x236abd(0xfd)]());_0x3b7703=_0x13e393[_0x236abd(0x85)][_0x236abd(0xfc)](_0x320714=>_0x599ad2['includes'](_0x320714['name']));if(_0x3b7703[_0x236abd(0xbf)]===0x0)return console[_0x236abd(0x6f)](a5_0x319647[_0x236abd(0xae)]('No\x20tests\x20found\x20matching:\x20'+_0x44c9ba)),console[_0x236abd(0x6f)](a5_0x319647[_0x236abd(0xdd)](_0x236abd(0xdb)+_0x13e393[_0x236abd(0x85)]['map'](_0x80c445=>_0x80c445[_0x236abd(0xc9)])['join'](',\x20'))),0x1;}if(_0x259ca8){const _0x47bbec=_0x259ca8[_0x236abd(0xf8)](',')['map'](_0x44dae7=>_0x44dae7[_0x236abd(0xfd)]()[_0x236abd(0xd6)]());_0x3b7703=_0x3b7703['filter'](_0x443f64=>_0x443f64[_0x236abd(0xa6)]?.[_0x236abd(0xe1)](_0x2dc918=>_0x47bbec['includes'](_0x2dc918[_0x236abd(0xd6)]())));if(_0x3b7703['length']===0x0){console[_0x236abd(0x6f)](a5_0x319647['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x259ca8));const _0x3f5fc9=new Set();return _0x13e393[_0x236abd(0x85)][_0x236abd(0x7f)](_0x250b5a=>_0x250b5a['tags']?.[_0x236abd(0x7f)](_0x5d3219=>_0x3f5fc9[_0x236abd(0xe6)](_0x5d3219))),_0x3f5fc9[_0x236abd(0x7c)]>0x0?console[_0x236abd(0x6f)](a5_0x319647['dim'](_0x236abd(0xb0)+[..._0x3f5fc9][_0x236abd(0xda)](',\x20'))):console['log'](a5_0x319647[_0x236abd(0xdd)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x51696e)return this[_0x236abd(0xb4)](_0x1464e6,{'definition':{'tests':_0x3b7703},'agentInfo':_0x1fbdf2,'outputFormat':_0x51056b,'outputFile':_0x981844,'testNames':_0x44c9ba});if(_0x10d7ca){console['log'](a5_0x319647[_0x236abd(0xac)]('Test\x20Configuration:')),console[_0x236abd(0x6f)](_0x236abd(0xbc)+a5_0x319647[_0x236abd(0x9c)](_0x5402d0)),console[_0x236abd(0x6f)](_0x236abd(0x8d)+a5_0x319647['white'](_0x1fbdf2[_0x236abd(0xf4)])),console['log'](_0x236abd(0xce)+a5_0x319647[_0x236abd(0x9c)](_0x1fbdf2['agentName'])),console[_0x236abd(0x6f)](),console[_0x236abd(0x6f)](_0x236abd(0x8a)+a5_0x319647['white'](_0x3b7703[_0x236abd(0xbf)]));for(let _0xf2e3f7=0x0;_0xf2e3f7<_0x3b7703[_0x236abd(0xbf)];_0xf2e3f7++){const _0x54675f=_0x3b7703[_0xf2e3f7],_0x3fd754=_0x54675f[_0x236abd(0xc0)][_0x236abd(0xbf)]===0x1?_0x236abd(0xeb):_0x236abd(0xc0),_0x502db2=_0x54675f['tags']?.[_0x236abd(0xbf)]?'\x20['+_0x54675f[_0x236abd(0xa6)][_0x236abd(0xda)](',\x20')+']':'';console[_0x236abd(0x6f)]('\x20\x20'+(_0xf2e3f7+0x1)+'.\x20'+a5_0x319647[_0x236abd(0x9c)](_0x54675f[_0x236abd(0xc9)])+'\x20('+_0x54675f[_0x236abd(0xc0)][_0x236abd(0xbf)]+'\x20'+_0x3fd754+')'+a5_0x319647[_0x236abd(0xdd)](_0x502db2));}return 0x0;}let _0x291936,_0x4c1eee;try{_0x291936=await _0x415489[_0x236abd(0xcc)][_0x236abd(0x7e)](_0x1fbdf2[_0x236abd(0xf4)]);}catch(_0x1eec0a){const _0x2967f7=_0x1eec0a instanceof Error?_0x1eec0a[_0x236abd(0xd3)]:String(_0x1eec0a);return _0x2967f7[_0x236abd(0xad)](_0x236abd(0x9f))||_0x2967f7[_0x236abd(0xd6)]()[_0x236abd(0xad)](_0x236abd(0xe9))?console[_0x236abd(0x6f)](a5_0x319647['red'](_0x236abd(0x77)+_0x1fbdf2[_0x236abd(0xf4)])):console[_0x236abd(0x6f)](a5_0x319647[_0x236abd(0xa1)](_0x236abd(0xca)+_0x1fbdf2[_0x236abd(0xf4)]+'\x22:\x20'+_0x2967f7)),0x1;}try{_0x4c1eee=await _0x415489[_0x236abd(0xcc)][_0x236abd(0xc8)](_0x1fbdf2[_0x236abd(0xe5)],_0x291936);}catch(_0x21e5a7){const _0x5c6390=_0x21e5a7 instanceof Error?_0x21e5a7[_0x236abd(0xd3)]:String(_0x21e5a7);return _0x5c6390[_0x236abd(0xad)]('404')||_0x5c6390[_0x236abd(0xd6)]()[_0x236abd(0xad)]('not\x20found')?console['log'](a5_0x319647[_0x236abd(0xa1)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x1fbdf2[_0x236abd(0xe5)])):console['log'](a5_0x319647[_0x236abd(0xa1)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x1fbdf2['agentName']+'\x22:\x20'+_0x5c6390)),0x1;}let _0x1aa8bb;if(!_0xa40007)try{_0x1aa8bb=await setupEvaluatorAgent(_0x415489[_0x236abd(0xcc)],_0x409643[_0x236abd(0x8f)]);}catch(_0x3f69d1){const _0x304ddf=_0x3f69d1 instanceof Error?_0x3f69d1[_0x236abd(0xd3)]:String(_0x3f69d1);return console[_0x236abd(0x6f)](a5_0x319647[_0x236abd(0xa1)](_0x236abd(0xa4)+_0x304ddf)),0x1;}console[_0x236abd(0x6f)](a5_0x319647['cyan'](_0x236abd(0xe7))),console['log'](_0x236abd(0xab)+a5_0x319647['white'](_0x5402d0)),console[_0x236abd(0x6f)]('Agent:\x20'+a5_0x319647[_0x236abd(0x9c)](_0x1fbdf2[_0x236abd(0xf4)]+'/'+_0x1fbdf2[_0x236abd(0xe5)])),console[_0x236abd(0x6f)]();const _0xa90493=[],_0x45918a=[],_0x5836ca=Date[_0x236abd(0xb2)]();for(let _0x305751=0x0;_0x305751<_0x3b7703[_0x236abd(0xbf)];_0x305751++){const _0x49e49c=_0x3b7703[_0x305751];_0x3b7703[_0x236abd(0xbf)]>0x1?console[_0x236abd(0x6f)](_0x236abd(0xa3)+(_0x305751+0x1)+'/'+_0x3b7703[_0x236abd(0xbf)]+':\x20'+a5_0x319647[_0x236abd(0x9c)](_0x49e49c[_0x236abd(0xc9)])):console[_0x236abd(0x6f)](_0x236abd(0xf2)+a5_0x319647['white'](_0x49e49c[_0x236abd(0xc9)]));const _0x23dfdf=createCommandSpinner(_0x236abd(0x9e)+_0x49e49c[_0x236abd(0xc0)]['length']+':\x20Sending\x20user\x20input...');_0x23dfdf[_0x236abd(0xd2)]();try{const {result:_0x376394,conversation:_0x4ef343}=await runTest(_0x415489['llm'],_0x49e49c,{'agentId':_0x4c1eee,'projectId':_0x291936,'site':_0x5402d0,'noEval':_0xa40007,'evaluatorId':_0x1aa8bb,'onRoundStart':(_0x12f35b,_0x5911ec)=>{const _0x27bf9a=_0x236abd;_0x23dfdf[_0x27bf9a(0xc7)]='Round\x20'+(_0x12f35b+0x1)+'/'+_0x5911ec+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0xb0ea6d,_0x29040f,_0x1ecaae)=>{const _0x478218=_0x236abd,_0x23b0b2=formatElapsed(_0x29040f);_0x1ecaae?console[_0x478218(0x6f)](_0x478218(0x75)+(_0xb0ea6d+0x1)+'/'+_0x49e49c[_0x478218(0xc0)][_0x478218(0xbf)]+_0x478218(0xd5)+a5_0x319647[_0x478218(0xaa)]('✓')+'\x20('+_0x23b0b2+')'):console[_0x478218(0x6f)](_0x478218(0x75)+(_0xb0ea6d+0x1)+'/'+_0x49e49c['rounds'][_0x478218(0xbf)]+'...\x20'+a5_0x319647[_0x478218(0xa1)]('✗'));},'onEvaluationStart':()=>{_0x23dfdf['text']='Evaluating\x20response...';},'onEvaluationComplete':_0x2d5e83=>{const _0x527e83=_0x236abd,_0x2a8826=formatElapsed(_0x2d5e83);console['log'](_0x527e83(0x90)+a5_0x319647[_0x527e83(0xaa)]('✓')+'\x20('+_0x2a8826+')');}});_0x23dfdf[_0x236abd(0xf0)](),_0xa90493[_0x236abd(0x88)](_0x376394),_0x45918a[_0x236abd(0x88)](_0x4ef343);if(_0x376394[_0x236abd(0xa5)]===_0x236abd(0x9d))console[_0x236abd(0x6f)](a5_0x319647['green'](_0x236abd(0x73)+_0x376394[_0x236abd(0xcf)]));else _0x376394[_0x236abd(0xa5)]==='FAIL'?console[_0x236abd(0x6f)](a5_0x319647[_0x236abd(0xa1)](_0x236abd(0xdf)+_0x376394[_0x236abd(0xcf)])):console[_0x236abd(0x6f)](a5_0x319647[_0x236abd(0xa1)](_0x236abd(0xf7)+_0x376394['reason']));_0x376394[_0x236abd(0xee)]&&console[_0x236abd(0x6f)](a5_0x319647[_0x236abd(0xdd)]('Conversation\x20URL:\x20'+_0x376394['conversation_url'])),console['log']();}catch(_0x29de96){_0x23dfdf[_0x236abd(0xf0)]();const _0x2e0083=_0x29de96 instanceof Error?_0x29de96[_0x236abd(0xd3)]:String(_0x29de96);console[_0x236abd(0x6f)](a5_0x319647[_0x236abd(0xa1)](_0x236abd(0xf7)+_0x2e0083)),console[_0x236abd(0x6f)](),_0xa90493[_0x236abd(0x88)]({'name':_0x49e49c[_0x236abd(0xc9)],'status':_0x236abd(0x79),'reason':_0x2e0083,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x14bedc=Date['now']()-_0x5836ca,_0x2f849d=_0xa90493[_0x236abd(0xfc)](_0x15d775=>_0x15d775[_0x236abd(0xa5)]===_0x236abd(0x9d))['length'],_0x4ae31f=_0xa90493[_0x236abd(0xfc)](_0x35db25=>_0x35db25[_0x236abd(0xa5)]===_0x236abd(0xbb))['length'],_0x17965e=_0xa90493[_0x236abd(0xfc)](_0x5a2757=>_0x5a2757[_0x236abd(0xa5)]===_0x236abd(0x79))[_0x236abd(0xbf)];console[_0x236abd(0x6f)]('━'['repeat'](0x3c)),console['log'](_0x236abd(0x100)),console[_0x236abd(0x6f)]('━'[_0x236abd(0xb8)](0x3c)),console['log'](_0x236abd(0x89)+_0xa90493[_0x236abd(0xbf)]),console['log'](_0x236abd(0x80)+a5_0x319647[_0x236abd(0xaa)](_0x2f849d)),console[_0x236abd(0x6f)](_0x236abd(0xd1)+a5_0x319647['red'](_0x4ae31f));_0x17965e>0x0&&console[_0x236abd(0x6f)](_0x236abd(0x81)+a5_0x319647[_0x236abd(0xa1)](_0x17965e));console[_0x236abd(0x6f)]('Duration:\x20'+formatElapsed(_0x14bedc)),console[_0x236abd(0x6f)]('━'[_0x236abd(0xb8)](0x3c));const _0x1b37da=_0xa90493[_0x236abd(0xfc)](_0x3975bc=>_0x3975bc[_0x236abd(0xa5)]!==_0x236abd(0x9d));if(_0x1b37da['length']>0x0){console[_0x236abd(0x6f)](),console[_0x236abd(0x6f)]('Failed\x20Tests:');for(const _0x20640f of _0x1b37da){const _0x55a734=a5_0x319647[_0x236abd(0xa1)]('✗'),_0x14b879=_0x20640f[_0x236abd(0xcf)]['length']>0x32?_0x20640f['reason'][_0x236abd(0x78)](0x0,0x32)+_0x236abd(0xf6):_0x20640f[_0x236abd(0xcf)];console[_0x236abd(0x6f)]('\x20\x20'+_0x55a734+'\x20'+_0x20640f[_0x236abd(0xc9)]+':\x20'+_0x14b879);}}const _0x343ed6={'summary':{'total':_0xa90493[_0x236abd(0xbf)],'passed':_0x2f849d,'failed':_0x4ae31f,'errors':_0x17965e>0x0?_0x17965e:undefined,'duration_ms':_0x14bedc},'tests':_0xa90493,'agent':{'project':_0x1fbdf2['projectName'],'name':_0x1fbdf2[_0x236abd(0xe5)],'site':_0x5402d0},'timestamp':new Date(_0x5836ca)[_0x236abd(0xb9)]()};try{const _0x35a3e9=buildCachedTestRun(_0x45918a,{'site':_0x5402d0,'projectId':_0x291936,'projectName':_0x1fbdf2[_0x236abd(0xf4)],'agentId':_0x4c1eee,'agentName':_0x1fbdf2[_0x236abd(0xe5)],'testYmlPath':a5_0x5afdd6['resolve'](_0x1fbdf2['testYmlPath'])});saveLastTestRun(_0x35a3e9);}catch{}if(_0x51056b!=='table'||_0x981844){const _0x2fa134=formatResults(_0x343ed6,_0x51056b);if(_0x981844)try{a5_0x25ab01[_0x236abd(0xb5)](_0x981844,_0x2fa134,_0x236abd(0x99)),console['log'](),console['log'](a5_0x319647['dim'](_0x236abd(0xd8)+_0x981844));}catch(_0x5260f2){return console[_0x236abd(0x6f)](),console['log'](a5_0x319647[_0x236abd(0xa1)](_0x236abd(0xdc)+_0x5260f2)),0x1;}else console['log'](),console[_0x236abd(0x6f)](_0x2fa134);}return _0x1b37da[_0x236abd(0xbf)]>0x0?0x1:0x0;}async[a5_0x437f3c(0xb4)](_0x2ae4c7,_0x226fdd){const _0x266828=a5_0x437f3c,{options:_0x596259,tdx:_0x275372}=_0x2ae4c7,{definition:_0x29cc14,agentInfo:_0x2cac06,outputFormat:_0xc14b02,outputFile:_0x169574}=_0x226fdd,_0x45ddd6=_0x596259['site'],_0x3bdd6b=loadLastTestRun();if(!_0x3bdd6b)return console[_0x266828(0x6f)](a5_0x319647[_0x266828(0xa1)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x266828(0x6f)](a5_0x319647[_0x266828(0xdd)](_0x266828(0xcd))),0x1;if(_0x3bdd6b[_0x266828(0xd7)][_0x266828(0xe5)]!==_0x2cac06[_0x266828(0xe5)])return console[_0x266828(0x6f)](a5_0x319647[_0x266828(0xa1)](_0x266828(0xd9)+_0x3bdd6b[_0x266828(0xd7)][_0x266828(0xe5)]+_0x266828(0xbe)+_0x2cac06[_0x266828(0xe5)]+'\x22.')),console['log'](a5_0x319647['dim'](_0x266828(0x9a))),0x1;const _0x31222f=new Set(_0x3bdd6b['conversations'][_0x266828(0xb7)](_0x31da29=>_0x31da29[_0x266828(0x8e)])),_0x50435c=_0x29cc14[_0x266828(0x85)]['filter'](_0x572276=>!_0x31222f['has'](_0x572276[_0x266828(0xc9)]));if(_0x50435c[_0x266828(0xbf)]>0x0&&_0x3bdd6b[_0x266828(0x96)]!==_0x45ddd6)return console['log'](a5_0x319647[_0x266828(0xa1)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console['log'](a5_0x319647['dim'](_0x266828(0xaf)+_0x3bdd6b[_0x266828(0x96)]+_0x266828(0xf9)+_0x45ddd6+'\x22.')),console[_0x266828(0x6f)](a5_0x319647[_0x266828(0xdd)]('Either\x20switch\x20to\x20the\x20\x22'+_0x3bdd6b[_0x266828(0x96)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x4f6940=_0x29cc14[_0x266828(0x85)][_0x266828(0xfc)](_0x5491a6=>_0x31222f[_0x266828(0x97)](_0x5491a6[_0x266828(0xc9)])),_0x1f64d9=_0x50435c;let _0x5f49c0;try{_0x5f49c0=await setupEvaluatorAgent(_0x275372[_0x266828(0xcc)],_0x596259[_0x266828(0x8f)]);}catch(_0x6c3bb9){const _0x68f2e8=_0x6c3bb9 instanceof Error?_0x6c3bb9[_0x266828(0xd3)]:String(_0x6c3bb9);return console[_0x266828(0x6f)](a5_0x319647[_0x266828(0xa1)](_0x266828(0xa4)+_0x68f2e8)),0x1;}console[_0x266828(0x6f)](a5_0x319647[_0x266828(0xac)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x266828(0x6f)](_0x266828(0xf3)+a5_0x319647[_0x266828(0x9c)](_0x3bdd6b[_0x266828(0xb1)])),console[_0x266828(0x6f)](_0x266828(0x83)+a5_0x319647[_0x266828(0x9c)](_0x3bdd6b[_0x266828(0xd7)][_0x266828(0xf4)]+'/'+_0x3bdd6b[_0x266828(0xd7)][_0x266828(0xe5)]));_0x1f64d9[_0x266828(0xbf)]>0x0&&console[_0x266828(0x6f)](_0x266828(0xef)+a5_0x319647['yellow'](_0x1f64d9[_0x266828(0xbf)]));console[_0x266828(0x6f)]();const _0x18222b=[],_0x826481=Date[_0x266828(0xb2)](),_0x3078d3=createCommandSpinner(_0x266828(0x70));if(_0x4f6940[_0x266828(0xbf)]>0x0)try{const _0x4e1f42=await reevaluateFromCache(_0x275372[_0x266828(0xcc)],_0x3bdd6b,{'tests':_0x4f6940},{'evaluatorId':_0x5f49c0,'onTestStart':(_0x5d6f3c,_0x556bfd,_0x3f4fc6)=>{const _0x2c0957=_0x266828;_0x3078d3[_0x2c0957(0xc7)]='Re-evaluating\x20'+(_0x556bfd+0x1)+'/'+_0x3f4fc6+':\x20'+_0x5d6f3c+'...';if(!_0x3078d3[_0x2c0957(0xc5)])_0x3078d3[_0x2c0957(0xd2)]();},'onTestComplete':(_0x1ce1bb,_0x422f85)=>{const _0x33a011=_0x266828;_0x3078d3[_0x33a011(0xf0)]();if(_0x422f85[_0x33a011(0xa5)]===_0x33a011(0x9d))console[_0x33a011(0x6f)](a5_0x319647[_0x33a011(0xaa)](_0x33a011(0x73)+_0x1ce1bb)+a5_0x319647['dim'](_0x33a011(0x6e)));else _0x422f85[_0x33a011(0xa5)]===_0x33a011(0xbb)?console[_0x33a011(0x6f)](a5_0x319647['red'](_0x33a011(0xdf)+_0x1ce1bb+_0x33a011(0xbd)+_0x422f85[_0x33a011(0xcf)])+a5_0x319647[_0x33a011(0xdd)](_0x33a011(0x6e))):console[_0x33a011(0x6f)](a5_0x319647['red']('✗\x20ERROR:\x20'+_0x1ce1bb+_0x33a011(0xbd)+_0x422f85[_0x33a011(0xcf)]));_0x422f85[_0x33a011(0xee)]&&console['log'](a5_0x319647[_0x33a011(0xdd)](_0x33a011(0xe0)+_0x422f85[_0x33a011(0xee)])),_0x18222b[_0x33a011(0x88)](_0x422f85);},'onTestSkipped':(_0x5841a7,_0x174b4a)=>{const _0x481b6b=_0x266828;_0x3078d3[_0x481b6b(0xf0)](),console[_0x481b6b(0x6f)](a5_0x319647[_0x481b6b(0xae)]('⚠\x20SKIPPED:\x20'+_0x5841a7+_0x481b6b(0xbd)+_0x174b4a));}});for(const _0x3c71e4 of _0x4e1f42){!_0x18222b[_0x266828(0xc4)](_0x3f4783=>_0x3f4783['name']===_0x3c71e4['name'])&&_0x18222b[_0x266828(0x88)](_0x3c71e4);}}catch(_0x37361b){_0x3078d3[_0x266828(0xf0)]();const _0x2de0dd=_0x37361b instanceof Error?_0x37361b[_0x266828(0xd3)]:String(_0x37361b);return console['log'](a5_0x319647['red']('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x2de0dd)),0x1;}_0x3078d3[_0x266828(0xf0)]();if(_0x1f64d9['length']>0x0){console['log'](),console['log'](a5_0x319647['cyan'](_0x266828(0xff)));const {projectId:_0x4926fd,agentId:_0x11ee50}=_0x3bdd6b['agent'];for(const _0x17d206 of _0x1f64d9){console[_0x266828(0x6f)](_0x266828(0xc1)+a5_0x319647[_0x266828(0x9c)](_0x17d206[_0x266828(0xc9)]));const _0x21a686=createCommandSpinner(_0x266828(0x9e)+_0x17d206['rounds'][_0x266828(0xbf)]+_0x266828(0xd4));_0x21a686[_0x266828(0xd2)]();try{const {result:_0x3baecc}=await runTest(_0x275372['llm'],_0x17d206,{'agentId':_0x11ee50,'projectId':_0x4926fd,'site':_0x3bdd6b[_0x266828(0x96)],'noEval':![],'evaluatorId':_0x5f49c0,'onRoundStart':(_0x41162d,_0x425d59)=>{const _0x249299=_0x266828;_0x21a686[_0x249299(0xc7)]='Round\x20'+(_0x41162d+0x1)+'/'+_0x425d59+_0x249299(0xd4);},'onRoundComplete':(_0x22f177,_0x46446f,_0x38f85d)=>{const _0x2cca65=_0x266828,_0xd6fadc=formatElapsed(_0x46446f);_0x38f85d?console['log'](_0x2cca65(0x75)+(_0x22f177+0x1)+'/'+_0x17d206[_0x2cca65(0xc0)][_0x2cca65(0xbf)]+_0x2cca65(0xd5)+a5_0x319647[_0x2cca65(0xaa)]('✓')+'\x20('+_0xd6fadc+')'):console[_0x2cca65(0x6f)]('\x20\x20Round\x20'+(_0x22f177+0x1)+'/'+_0x17d206[_0x2cca65(0xc0)][_0x2cca65(0xbf)]+'...\x20'+a5_0x319647[_0x2cca65(0xa1)]('✗'));},'onEvaluationStart':()=>{const _0xc42e62=_0x266828;_0x21a686['text']=_0xc42e62(0x71);},'onEvaluationComplete':_0x168cd9=>{const _0x29efea=_0x266828,_0x21c209=formatElapsed(_0x168cd9);console[_0x29efea(0x6f)]('\x20\x20Evaluating...\x20'+a5_0x319647['green']('✓')+'\x20('+_0x21c209+')');}});_0x21a686['stop'](),_0x18222b[_0x266828(0x88)](_0x3baecc);if(_0x3baecc['status']===_0x266828(0x9d))console[_0x266828(0x6f)](a5_0x319647[_0x266828(0xaa)]('✓\x20PASS:\x20'+_0x3baecc[_0x266828(0xcf)])+a5_0x319647['dim'](_0x266828(0x91)));else _0x3baecc[_0x266828(0xa5)]==='FAIL'?console[_0x266828(0x6f)](a5_0x319647[_0x266828(0xa1)]('✗\x20FAIL:\x20'+_0x3baecc['reason'])+a5_0x319647[_0x266828(0xdd)](_0x266828(0x91))):console[_0x266828(0x6f)](a5_0x319647[_0x266828(0xa1)]('✗\x20ERROR:\x20'+_0x3baecc[_0x266828(0xcf)]));_0x3baecc['conversation_url']&&console[_0x266828(0x6f)](a5_0x319647[_0x266828(0xdd)](_0x266828(0xe0)+_0x3baecc['conversation_url']));}catch(_0x584888){_0x21a686['stop']();const _0x2250c2=_0x584888 instanceof Error?_0x584888[_0x266828(0xd3)]:String(_0x584888);console['log'](a5_0x319647[_0x266828(0xa1)](_0x266828(0xf7)+_0x2250c2)),_0x18222b[_0x266828(0x88)]({'name':_0x17d206[_0x266828(0xc9)],'status':'ERROR','reason':_0x2250c2,'timestamp':new Date()[_0x266828(0xb9)](),'duration_ms':0x0});}}}console[_0x266828(0x6f)]();const _0x49d56c=Date[_0x266828(0xb2)]()-_0x826481,_0x29c8fc=_0x18222b['filter'](_0xe28d19=>_0xe28d19['status']===_0x266828(0x9d))[_0x266828(0xbf)],_0x5ac31f=_0x18222b[_0x266828(0xfc)](_0x16272d=>_0x16272d[_0x266828(0xa5)]===_0x266828(0xbb))[_0x266828(0xbf)],_0x3bf7fc=_0x18222b[_0x266828(0xfc)](_0x32a128=>_0x32a128[_0x266828(0xa5)]===_0x266828(0x79))['length'];console[_0x266828(0x6f)]('━'['repeat'](0x3c)),console[_0x266828(0x6f)]('Re-evaluation\x20Summary'),console[_0x266828(0x6f)]('━'[_0x266828(0xb8)](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x18222b[_0x266828(0xbf)]),console[_0x266828(0x6f)](_0x266828(0x80)+a5_0x319647[_0x266828(0xaa)](_0x29c8fc)),console['log'](_0x266828(0xd1)+a5_0x319647[_0x266828(0xa1)](_0x5ac31f));_0x3bf7fc>0x0&&console[_0x266828(0x6f)](_0x266828(0x81)+a5_0x319647[_0x266828(0xa1)](_0x3bf7fc));console[_0x266828(0x6f)](_0x266828(0x8c)+formatElapsed(_0x49d56c)),console[_0x266828(0x6f)]('━'[_0x266828(0xb8)](0x3c));const _0x284cce={'summary':{'total':_0x18222b[_0x266828(0xbf)],'passed':_0x29c8fc,'failed':_0x5ac31f,'errors':_0x3bf7fc>0x0?_0x3bf7fc:undefined,'duration_ms':_0x49d56c},'tests':_0x18222b,'agent':{'project':_0x2cac06[_0x266828(0xf4)],'name':_0x2cac06[_0x266828(0xe5)],'site':_0x45ddd6},'timestamp':new Date(_0x826481)[_0x266828(0xb9)]()};if(_0xc14b02!=='table'||_0x169574){const _0x1f1e42=formatResults(_0x284cce,_0xc14b02);if(_0x169574)try{a5_0x25ab01[_0x266828(0xb5)](_0x169574,_0x1f1e42,_0x266828(0x99)),console['log'](),console[_0x266828(0x6f)](a5_0x319647[_0x266828(0xdd)]('Output\x20written\x20to:\x20'+_0x169574));}catch(_0x341941){return console['log'](),console['log'](a5_0x319647[_0x266828(0xa1)](_0x266828(0xdc)+_0x341941)),0x1;}else console[_0x266828(0x6f)](),console[_0x266828(0x6f)](_0x1f1e42);}const _0x5a27e3=_0x18222b[_0x266828(0xfc)](_0x7ba48a=>_0x7ba48a[_0x266828(0xa5)]!==_0x266828(0x9d));return _0x5a27e3[_0x266828(0xbf)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x2695c8=a6_0x9a10;(function(_0x1baeb1,_0x264cd9){const _0x56ca8b=a6_0x9a10,_0x35115f=_0x1baeb1();while(!![]){try{const _0x5d19f6=parseInt(_0x56ca8b(0x131))/0x1+-parseInt(_0x56ca8b(0x123))/0x2+parseInt(_0x56ca8b(0x129))/0x3+parseInt(_0x56ca8b(0x132))/0x4*(parseInt(_0x56ca8b(0x147))/0x5)+parseInt(_0x56ca8b(0x149))/0x6*(-parseInt(_0x56ca8b(0x136))/0x7)+parseInt(_0x56ca8b(0x144))/0x8*(parseInt(_0x56ca8b(0x107))/0x9)+-parseInt(_0x56ca8b(0x146))/0xa*(parseInt(_0x56ca8b(0x120))/0xb);if(_0x5d19f6===_0x264cd9)break;else _0x35115f['push'](_0x35115f['shift']());}catch(_0x58de30){_0x35115f['push'](_0x35115f['shift']());}}}(a6_0x4cc8,0xc673f));import{BaseCommand}from'./command.js';function a6_0x4cc8(){const _0x439471=['method','has','validate','Invalid\x20HTTP\x20method:\x20','POST','x-trino-user','startsWith','PATCH','includes','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','join','llm','workflow','Endpoint\x20must\x20start\x20with\x20/:\x20','api','proxy-authorization','toUpperCase','substring','cdp','11kUXEnb','Error:\x20','Results\x20saved\x20to\x20','2401118fIzDHl','type','<\x20HTTP/1.1\x20','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','trim','verbose','4734735Wqiyfn','\x22.\x20','stack','.\x20Valid\x20methods:\x20','color','.\x20Valid\x20types:\x20','indexOf','headers','1595914nGtwTW','4228WSGCUo','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','request','DELETE','3379145mkklaP','name','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','readBodyFromFile','log','site','x-xsrf-token','error','status','length','file','entries','output','authorization','1384vNEgQB','Invalid\x20header\x20format:\x20\x22','28346470pdLSKI','7610BkuyVw','isArray','6LoVhKp','x-auth-token','execute','trino','28503KCklSM','noColor','Invalid\x20API\x20type:\x20','GET','cas','body'];a6_0x4cc8=function(){return _0x439471;};return a6_0x4cc8();}import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';function a6_0x9a10(_0x2b676d,_0xa15001){_0x2b676d=_0x2b676d-0x104;const _0x4cc80f=a6_0x4cc8();let _0x9a1005=_0x4cc80f[_0x2b676d];return _0x9a1005;}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x2695c8(0x143),a6_0x2695c8(0x11c),'cookie','set-cookie','set-cookie2',a6_0x2695c8(0x13c),a6_0x2695c8(0x104),a6_0x2695c8(0x112)]);function isSensitiveHeader(_0x187b0a){const _0x230e32=a6_0x2695c8;return SENSITIVE_HEADERS[_0x230e32(0x10e)](_0x187b0a['toLowerCase']());}function parseHeader(_0x175476){const _0x59e5fc=a6_0x2695c8,_0x1db91b=_0x175476[_0x59e5fc(0x12f)](':');if(_0x1db91b===-0x1)throw new Error(_0x59e5fc(0x145)+_0x175476+_0x59e5fc(0x12a)+_0x59e5fc(0x138));const _0x32bc59=_0x175476[_0x59e5fc(0x11e)](0x0,_0x1db91b)[_0x59e5fc(0x127)](),_0x343fb8=_0x175476['substring'](_0x1db91b+0x1)[_0x59e5fc(0x127)]();if(!_0x32bc59)throw new Error(_0x59e5fc(0x116)+_0x175476+'\x22');return[_0x32bc59,_0x343fb8];}export class ApiCommand extends BaseCommand{[a6_0x2695c8(0x137)]=a6_0x2695c8(0x11b);['description']=a6_0x2695c8(0x126);[a6_0x2695c8(0x10f)](_0x3d3c45){const _0x2a6b86=a6_0x2695c8,{args:_0x1253e7,options:_0x1aead9}=_0x3d3c45,_0x1480f6=_0x1aead9;if(_0x1253e7[_0x2a6b86(0x13f)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x2b47d0=_0x1253e7[0x0];if(!_0x2b47d0[_0x2a6b86(0x113)]('/'))return _0x2a6b86(0x11a)+_0x2b47d0;const _0x27883c=_0x1480f6['data'],_0x49d967=_0x1480f6[_0x2a6b86(0x140)];if(_0x27883c&&_0x49d967)return _0x2a6b86(0x133);const _0x1e6701=_0x1480f6[_0x2a6b86(0x10d)]||_0x2a6b86(0x10a),_0x1f88bb=[_0x2a6b86(0x10a),_0x2a6b86(0x111),'PUT',_0x2a6b86(0x135),_0x2a6b86(0x114)];if(!_0x1f88bb[_0x2a6b86(0x115)](_0x1e6701[_0x2a6b86(0x11d)]()))return _0x2a6b86(0x110)+_0x1e6701+_0x2a6b86(0x12c)+_0x1f88bb[_0x2a6b86(0x117)](',\x20');const _0x46e910=_0x1480f6[_0x2a6b86(0x124)]||'td',_0xf9e332=['td',_0x2a6b86(0x11f),_0x2a6b86(0x119),_0x2a6b86(0x106),_0x2a6b86(0x118),'llm-proxy',_0x2a6b86(0x10b)];if(!_0xf9e332['includes'](_0x46e910))return _0x2a6b86(0x109)+_0x46e910+_0x2a6b86(0x12e)+_0xf9e332[_0x2a6b86(0x117)](',\x20');return undefined;}async[a6_0x2695c8(0x105)](_0x2e80df){const _0x1589eb=a6_0x2695c8,{options:_0x9e71,args:_0x3352cd,tdx:_0x27b9c1}=_0x2e80df,_0x34d222=_0x9e71,_0x5bf31a=_0x3352cd[0x0],_0x2806bc=(_0x34d222[_0x1589eb(0x10d)]||'GET')[_0x1589eb(0x11d)](),_0xc07812=_0x34d222['data'],_0x4ab04a=_0x34d222[_0x1589eb(0x140)],_0xafebc4=_0x34d222['header'],_0x2da21f=_0x34d222[_0x1589eb(0x124)]||'td';try{const _0x553caa={};if(_0xafebc4){const _0x2d9db5=Array[_0x1589eb(0x148)](_0xafebc4)?_0xafebc4:[_0xafebc4];for(const _0x451079 of _0x2d9db5){const [_0x44b1c5,_0x42a9cd]=parseHeader(_0x451079);_0x553caa[_0x44b1c5]=_0x42a9cd;}}let _0x13048e;if(_0xc07812)_0x13048e=_0xc07812;else{if(_0x4ab04a)try{_0x13048e=RawAPI[_0x1589eb(0x139)](_0x4ab04a);}catch(_0x36b9d7){return console['error'](_0x1589eb(0x121)+(_0x36b9d7 instanceof Error?_0x36b9d7['message']:String(_0x36b9d7))),0x1;}}const _0xdf6182={'method':_0x2806bc,'apiType':_0x2da21f,'includeHeaders':_0x9e71[_0x1589eb(0x128)]};_0x13048e&&(_0xdf6182[_0x1589eb(0x10c)]=_0x13048e);Object['keys'](_0x553caa)[_0x1589eb(0x13f)]>0x0&&(_0xdf6182[_0x1589eb(0x130)]=_0x553caa);if(_0x9e71[_0x1589eb(0x128)]){const _0x559325=resolveSite(_0x9e71[_0x1589eb(0x13b)]),_0x52c4a9=getEndpoint(_0x559325,_0x2da21f),_0x3372cc=''+_0x52c4a9+_0x5bf31a;console['error']('>\x20'+_0x2806bc+'\x20'+_0x3372cc);const _0x24425c=getAuthHeaders(_0x559325),_0x439ec1={..._0x24425c,..._0x553caa};for(const [_0x32ea9e,_0x11d450]of Object[_0x1589eb(0x141)](_0x439ec1)){!isSensitiveHeader(_0x32ea9e)&&console[_0x1589eb(0x13d)]('>\x20'+_0x32ea9e+':\x20'+_0x11d450);}_0x13048e&&console[_0x1589eb(0x13d)]('>'),console[_0x1589eb(0x13d)]('');}const _0x252151=await _0x27b9c1['api'][_0x1589eb(0x134)](_0x5bf31a,_0xdf6182);if(_0x9e71['verbose']&&_0x252151[_0x1589eb(0x130)]){console['error'](_0x1589eb(0x125)+_0x252151[_0x1589eb(0x13e)]);for(const [_0x4669ae,_0x2609da]of Object[_0x1589eb(0x141)](_0x252151[_0x1589eb(0x130)])){!isSensitiveHeader(_0x4669ae)&&console[_0x1589eb(0x13d)]('<\x20'+_0x4669ae+':\x20'+_0x2609da);}console['error']('');}const _0x3b236c=Boolean(_0x9e71[_0x1589eb(0x142)]),_0x29997e={'color':_0x9e71[_0x1589eb(0x12d)],'noColor':_0x9e71[_0x1589eb(0x108)]||_0x3b236c&&!_0x9e71[_0x1589eb(0x12d)]},_0x96fc4f=colorizeJSON(_0x252151['data'],_0x29997e);return _0x9e71[_0x1589eb(0x142)]?(writeFileSync(_0x9e71['output'],_0x96fc4f),console[_0x1589eb(0x13d)](_0x1589eb(0x122)+_0x9e71[_0x1589eb(0x142)])):console[_0x1589eb(0x13a)](_0x96fc4f),0x0;}catch(_0xe8da42){return _0xe8da42 instanceof Error?(console['error'](_0x1589eb(0x121)+_0xe8da42['message']),_0x9e71[_0x1589eb(0x128)]&&_0xe8da42[_0x1589eb(0x12b)]&&console[_0x1589eb(0x13d)]('\x0aStack\x20trace:\x0a'+_0xe8da42[_0x1589eb(0x12b)])):console[_0x1589eb(0x13d)]('Error:\x20'+String(_0xe8da42)),0x1;}}}
1
+ const a6_0x4d682d=a6_0x5622;(function(_0x38bf81,_0x1e6801){const _0x3c2b56=a6_0x5622,_0x6bd3c8=_0x38bf81();while(!![]){try{const _0x2b37bf=-parseInt(_0x3c2b56(0xca))/0x1+parseInt(_0x3c2b56(0xe8))/0x2+-parseInt(_0x3c2b56(0xde))/0x3+parseInt(_0x3c2b56(0xf4))/0x4*(-parseInt(_0x3c2b56(0xfa))/0x5)+parseInt(_0x3c2b56(0xe5))/0x6*(-parseInt(_0x3c2b56(0xd0))/0x7)+-parseInt(_0x3c2b56(0xcb))/0x8*(-parseInt(_0x3c2b56(0xc7))/0x9)+parseInt(_0x3c2b56(0xf6))/0xa*(parseInt(_0x3c2b56(0xf0))/0xb);if(_0x2b37bf===_0x1e6801)break;else _0x6bd3c8['push'](_0x6bd3c8['shift']());}catch(_0x2da4fd){_0x6bd3c8['push'](_0x6bd3c8['shift']());}}}(a6_0x45c0,0xef33a));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';function a6_0x45c0(){const _0x272f71=['Header\x20key\x20cannot\x20be\x20empty:\x20\x22','header','authorization','keys','1176679JNPupD','GET','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','output','PUT','set-cookie2','<\x20HTTP/1.1\x20','body','cdp','data','cookie','PATCH','site','indexOf','5309604WHPghE','cas','toUpperCase','verbose','method','.\x20Valid\x20types:\x20','length','60iybuOT','noColor','execute','2581780GUEYLI','Endpoint\x20must\x20start\x20with\x20/:\x20','\x0aStack\x20trace:\x0a','trino','includes','llm-proxy','Invalid\x20HTTP\x20method:\x20','validate','11haplly','api','headers','type','4Japlgg','readBodyFromFile','37678610qpQTHF','x-trino-user','message','proxy-authorization','5484295HfpmQB','join','file','Results\x20saved\x20to\x20','name','x-auth-token','trim','color','Error:\x20','Invalid\x20header\x20format:\x20\x22','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','error','153xQrbuz','status','.\x20Valid\x20methods:\x20','475192dylJzW','444192FgYitJ'];a6_0x45c0=function(){return _0x272f71;};return a6_0x45c0();}import{resolveSite}from'../core/config.js';function a6_0x5622(_0x5dcf13,_0x437bac){_0x5dcf13=_0x5dcf13-0xc7;const _0x45c08d=a6_0x45c0();let _0x5622f2=_0x45c08d[_0x5dcf13];return _0x5622f2;}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x4d682d(0xce),a6_0x4d682d(0xf9),a6_0x4d682d(0xda),'set-cookie',a6_0x4d682d(0xd5),'x-xsrf-token',a6_0x4d682d(0xff),a6_0x4d682d(0xf7)]);function isSensitiveHeader(_0x1107e1){return SENSITIVE_HEADERS['has'](_0x1107e1['toLowerCase']());}function parseHeader(_0x566bf1){const _0x1b44ec=a6_0x4d682d,_0xc20b87=_0x566bf1[_0x1b44ec(0xdd)](':');if(_0xc20b87===-0x1)throw new Error(_0x1b44ec(0x103)+_0x566bf1+'\x22.\x20'+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x3be624=_0x566bf1['substring'](0x0,_0xc20b87)[_0x1b44ec(0x100)](),_0x2f346a=_0x566bf1['substring'](_0xc20b87+0x1)[_0x1b44ec(0x100)]();if(!_0x3be624)throw new Error(_0x1b44ec(0xcc)+_0x566bf1+'\x22');return[_0x3be624,_0x2f346a];}export class ApiCommand extends BaseCommand{[a6_0x4d682d(0xfe)]=a6_0x4d682d(0xf1);['description']=a6_0x4d682d(0x104);[a6_0x4d682d(0xef)](_0x5fd067){const _0x13d6f6=a6_0x4d682d,{args:_0x4a9296,options:_0x2c13b7}=_0x5fd067,_0x3670b7=_0x2c13b7;if(_0x4a9296['length']===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x4c9570=_0x4a9296[0x0];if(!_0x4c9570['startsWith']('/'))return _0x13d6f6(0xe9)+_0x4c9570;const _0x42eaed=_0x3670b7[_0x13d6f6(0xd9)],_0x216b50=_0x3670b7[_0x13d6f6(0xfc)];if(_0x42eaed&&_0x216b50)return _0x13d6f6(0xd2);const _0x153abf=_0x3670b7[_0x13d6f6(0xe2)]||_0x13d6f6(0xd1),_0x168639=['GET','POST',_0x13d6f6(0xd4),'DELETE',_0x13d6f6(0xdb)];if(!_0x168639[_0x13d6f6(0xec)](_0x153abf[_0x13d6f6(0xe0)]()))return _0x13d6f6(0xee)+_0x153abf+_0x13d6f6(0xc9)+_0x168639['join'](',\x20');const _0x209d7f=_0x3670b7['type']||'td',_0x36ec12=['td',_0x13d6f6(0xd8),'workflow',_0x13d6f6(0xeb),'llm',_0x13d6f6(0xed),_0x13d6f6(0xdf)];if(!_0x36ec12[_0x13d6f6(0xec)](_0x209d7f))return'Invalid\x20API\x20type:\x20'+_0x209d7f+_0x13d6f6(0xe3)+_0x36ec12[_0x13d6f6(0xfb)](',\x20');return undefined;}async[a6_0x4d682d(0xe7)](_0x1bdc0b){const _0xab7846=a6_0x4d682d,{options:_0x2f78c2,args:_0x26a2c2,tdx:_0x4a8f23}=_0x1bdc0b,_0x5d6db4=_0x2f78c2,_0x5b761b=_0x26a2c2[0x0],_0xb7bc84=(_0x5d6db4['method']||_0xab7846(0xd1))[_0xab7846(0xe0)](),_0xf50bb8=_0x5d6db4[_0xab7846(0xd9)],_0x5aec2f=_0x5d6db4[_0xab7846(0xfc)],_0x5a698a=_0x5d6db4[_0xab7846(0xcd)],_0x1961f4=_0x5d6db4[_0xab7846(0xf3)]||'td';try{const _0x4f9501={};if(_0x5a698a){const _0x5b1515=Array['isArray'](_0x5a698a)?_0x5a698a:[_0x5a698a];for(const _0x1886d2 of _0x5b1515){const [_0x292942,_0xea2253]=parseHeader(_0x1886d2);_0x4f9501[_0x292942]=_0xea2253;}}let _0x2d7f8d;if(_0xf50bb8)_0x2d7f8d=_0xf50bb8;else{if(_0x5aec2f)try{_0x2d7f8d=RawAPI[_0xab7846(0xf5)](_0x5aec2f);}catch(_0x51e0a2){return console['error']('Error:\x20'+(_0x51e0a2 instanceof Error?_0x51e0a2[_0xab7846(0xf8)]:String(_0x51e0a2))),0x1;}}const _0x45164b={'method':_0xb7bc84,'apiType':_0x1961f4,'includeHeaders':_0x2f78c2[_0xab7846(0xe1)]};_0x2d7f8d&&(_0x45164b[_0xab7846(0xd7)]=_0x2d7f8d);Object[_0xab7846(0xcf)](_0x4f9501)[_0xab7846(0xe4)]>0x0&&(_0x45164b[_0xab7846(0xf2)]=_0x4f9501);if(_0x2f78c2['verbose']){const _0x35b1c9=resolveSite(_0x2f78c2[_0xab7846(0xdc)]),_0x3d6d82=getEndpoint(_0x35b1c9,_0x1961f4),_0x1afd5d=''+_0x3d6d82+_0x5b761b;console[_0xab7846(0x105)]('>\x20'+_0xb7bc84+'\x20'+_0x1afd5d);const _0x2aa5a3=getAuthHeaders(_0x35b1c9),_0x4f0a42={..._0x2aa5a3,..._0x4f9501};for(const [_0x51105a,_0x16f172]of Object['entries'](_0x4f0a42)){!isSensitiveHeader(_0x51105a)&&console['error']('>\x20'+_0x51105a+':\x20'+_0x16f172);}_0x2d7f8d&&console[_0xab7846(0x105)]('>'),console['error']('');}const _0x47e380=await _0x4a8f23[_0xab7846(0xf1)]['request'](_0x5b761b,_0x45164b);if(_0x2f78c2[_0xab7846(0xe1)]&&_0x47e380[_0xab7846(0xf2)]){console[_0xab7846(0x105)](_0xab7846(0xd6)+_0x47e380[_0xab7846(0xc8)]);for(const [_0x5d3e2f,_0x3dd80f]of Object['entries'](_0x47e380[_0xab7846(0xf2)])){!isSensitiveHeader(_0x5d3e2f)&&console[_0xab7846(0x105)]('<\x20'+_0x5d3e2f+':\x20'+_0x3dd80f);}console[_0xab7846(0x105)]('');}const _0x418573=Boolean(_0x2f78c2[_0xab7846(0xd3)]),_0x50b15c={'color':_0x2f78c2[_0xab7846(0x101)],'noColor':_0x2f78c2[_0xab7846(0xe6)]||_0x418573&&!_0x2f78c2[_0xab7846(0x101)]},_0x5e95f0=colorizeJSON(_0x47e380['data'],_0x50b15c);return _0x2f78c2[_0xab7846(0xd3)]?(writeFileSync(_0x2f78c2[_0xab7846(0xd3)],_0x5e95f0),console[_0xab7846(0x105)](_0xab7846(0xfd)+_0x2f78c2[_0xab7846(0xd3)])):console['log'](_0x5e95f0),0x0;}catch(_0x467211){return _0x467211 instanceof Error?(console[_0xab7846(0x105)](_0xab7846(0x102)+_0x467211['message']),_0x2f78c2[_0xab7846(0xe1)]&&_0x467211['stack']&&console[_0xab7846(0x105)](_0xab7846(0xea)+_0x467211['stack'])):console[_0xab7846(0x105)](_0xab7846(0x102)+String(_0x467211)),0x1;}}}
@@ -1 +1 @@
1
- function a7_0x8ded(){const _0x2062bf=['✓\x20API\x20key\x20is\x20valid\x20(User:\x20','\x20removed\x20from\x20keychain','5HKdObg','first_name','\x20--profile\x20','dim','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','/app/mp/ak','Credential\x20type:\x20OAuth','721896ZkzMGj','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','160741EzMYCb','Sign\x20in\x20with\x20browser\x20(recommended)','Remove\x20API\x20key\x20from\x20system\x20keychain','method','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','3sUphNS','Use\x20an\x20API\x20key','tdx:\x20auth\x20setup','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','message','filter','No\x20credentials\x20found\x20in\x20keychain','access_token','\x20\x20tdx','Setup\x20API\x20key\x20authentication\x20interactively','join','16KrPbvi','status','Validating\x20OAuth\x20tokens...','logLevel','oauth','/users/initiate_sso\x20(account:\x20','email','✓\x20Profile\x20\x27','accountName','auth','366402YCZYoN','169042srTyXu','\x20\x20(','\x20(site:\x20','text','Setting\x20up\x20authentication\x20for\x20site:\x20','log','warn','OAuth\x20tokens','✓\x20Default\x20site\x20set\x20to\x20','User:\x20','\x20\x20user_id:','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','\x27\x20registered','Setup\x20cancelled','all','563046BBaugf','Opening\x20browser\x20for\x20authentication...','yellow','API\x20key\x20cannot\x20be\x20empty','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','apiKey','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','create','\x20for\x20profile:\x20','jobs','No\x20credential\x20found','last_name','For\x20scripts\x20or\x20headless\x20servers','site','cyan','Validating\x20API\x20key...','\x20(profile:\x20','account_id','ERROR','187DPkkyG','profile','Name:\x20','execute','\x0aSetup\x20cancelled','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','760396MLChSA','Choose\x20how\x20to\x20sign\x20in:','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','✗\x20Validation\x20failed:\x20','API\x20key','apikey','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','Enter\x20your\x20TD\x20API\x20key:','N/A','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','getUserInfo','trim','18uCgpsY','name','1191830ZyGxuE','error','description','password','/oauth/authorize'];a7_0x8ded=function(){return _0x2062bf;};return a7_0x8ded();}const a7_0x3273e7=a7_0x1490;(function(_0x3c27cc,_0x51e6dd){const _0x3cdbd9=a7_0x1490,_0xd7212e=_0x3c27cc();while(!![]){try{const _0x52bf24=-parseInt(_0x3cdbd9(0x102))/0x1+parseInt(_0x3cdbd9(0x103))/0x2*(-parseInt(_0x3cdbd9(0xed))/0x3)+-parseInt(_0x3cdbd9(0xc8))/0x4*(parseInt(_0x3cdbd9(0xdd))/0x5)+parseInt(_0x3cdbd9(0x112))/0x6+-parseInt(_0x3cdbd9(0xe7))/0x7*(parseInt(_0x3cdbd9(0xf8))/0x8)+-parseInt(_0x3cdbd9(0xd4))/0x9*(parseInt(_0x3cdbd9(0xd6))/0xa)+parseInt(_0x3cdbd9(0xc2))/0xb*(parseInt(_0x3cdbd9(0xe5))/0xc);if(_0x52bf24===_0x51e6dd)break;else _0xd7212e['push'](_0xd7212e['shift']());}catch(_0x5bcc3e){_0xd7212e['push'](_0xd7212e['shift']());}}}(a7_0x8ded,0x2eaed));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x283533 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_0x486fe5 from'chalk';export async function runOAuthLoginFlow(_0x4144d3,_0x475fb8,_0x9ca134,_0x5c21fe){const _0x5270ed=a7_0x1490,_0x5b55eb=await isKeychainAvailable();if(!_0x5b55eb)throw new Error(_0x5270ed(0xd1)+_0x5270ed(0xb4));let _0x3ce17b=_0x5c21fe?.['accountName'];if(!_0x3ce17b){const _0x18de0a=await a7_0x283533({'type':_0x5270ed(0x106),'name':'accountName','message':_0x5270ed(0xec)});if(_0x18de0a[_0x5270ed(0x100)]===undefined)throw new Error(_0x5270ed(0x110));_0x3ce17b=_0x18de0a['accountName']['trim']()||undefined;}const _0x1ab1fe=getConsoleUrl(_0x4144d3);console[_0x5270ed(0x108)](_0x5270ed(0x113));_0x3ce17b?console[_0x5270ed(0x108)]('\x20\x20'+_0x1ab1fe+_0x5270ed(0xfd)+_0x3ce17b+')'):console[_0x5270ed(0x108)]('\x20\x20'+_0x1ab1fe+_0x5270ed(0xda));console[_0x5270ed(0x108)](_0x5270ed(0xeb));const _0x5672ed=await startOAuthFlow(_0x4144d3,{'accountName':_0x3ce17b});console[_0x5270ed(0x108)](_0x5270ed(0xfa));const _0xebc79a=TDX[_0x5270ed(0xb6)]({'site':_0x4144d3,'accessToken':_0x5672ed[_0x5270ed(0xf4)],'logLevel':_0x9ca134??LogLevel[_0x5270ed(0xc1)]}),_0x3aceff=await _0xebc79a['jobs'][_0x5270ed(0xd2)]();console[_0x5270ed(0x108)](a7_0x486fe5['green']('✓\x20Signed\x20in\x20successfully')),console[_0x5270ed(0x108)]('\x20\x20'+a7_0x486fe5[_0x5270ed(0xbd)](_0x4144d3+':'+_0x3aceff[_0x5270ed(0xc0)])+_0x5270ed(0x10d)+_0x3aceff['id']+_0x5270ed(0x104)+_0x3aceff[_0x5270ed(0xfe)]+')');!_0x3ce17b&&(console['log'](a7_0x486fe5[_0x5270ed(0xe0)](_0x5270ed(0xf0))),console[_0x5270ed(0x108)](a7_0x486fe5['dim']('\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>')),console[_0x5270ed(0x108)](a7_0x486fe5[_0x5270ed(0xe0)]('\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions')));await saveOAuthTokens(_0x5672ed,_0x475fb8),console['log'](_0x5270ed(0xb5)+(_0x475fb8?_0x5270ed(0xbf)+_0x475fb8+')':''));if(_0x475fb8){const _0x2f8b86={'site':_0x4144d3};saveProfileToUserConfig(_0x475fb8,_0x2f8b86),console[_0x5270ed(0x108)](_0x5270ed(0xff)+_0x475fb8+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x4144d3),console[_0x5270ed(0x108)](_0x5270ed(0x10b)+_0x4144d3);const _0x342d36=_0x475fb8?_0x5270ed(0xdf)+_0x475fb8:'';console[_0x5270ed(0x108)](),console[_0x5270ed(0x108)](_0x5270ed(0xca)),console[_0x5270ed(0x108)](_0x5270ed(0xf5)+_0x342d36+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console['log'](_0x5270ed(0xf5)+_0x342d36+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}function a7_0x1490(_0x19ab4f,_0x14f7d4){_0x19ab4f=_0x19ab4f-0xb4;const _0x8dedb6=a7_0x8ded();let _0x149069=_0x8dedb6[_0x19ab4f];return _0x149069;}export async function promptAuthMethod(){const _0x4bb59a=a7_0x1490,_0x7cd792=await a7_0x283533({'type':'select','name':'method','message':_0x4bb59a(0xc9),'choices':[{'title':_0x4bb59a(0xe8),'description':'Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','value':_0x4bb59a(0xfc)},{'title':_0x4bb59a(0xee),'description':_0x4bb59a(0xbb),'value':_0x4bb59a(0xcd)}]});return _0x7cd792[_0x4bb59a(0xea)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x3273e7(0xd5)]='auth:setup';[a7_0x3273e7(0xd8)]=a7_0x3273e7(0xf6);async['execute'](_0x33de93){const _0x753a41=a7_0x3273e7,{options:_0x926058}=_0x33de93,_0x2b83c7=_0x926058[_0x753a41(0xc3)];console[_0x753a41(0x108)](a7_0x486fe5['bold'](_0x753a41(0xef)));const _0x4de7b3=_0x926058['site']||'us01',_0x43ee8b=await promptSiteSelection(_0x4de7b3,_0x2b83c7,_0x753a41(0x110));if(!_0x43ee8b)return 0x1;const _0x121260=resolveSite(_0x43ee8b),_0x331100=await promptAuthMethod();if(!_0x331100)return console[_0x753a41(0x108)](_0x753a41(0xc6)),0x1;if(_0x331100===_0x753a41(0xfc)){const {accountName:_0xc151c1}=_0x926058;return await runOAuthLoginFlow(_0x121260,_0x2b83c7,_0x926058['logLevel']??LogLevel[_0x753a41(0xc1)],{'accountName':_0xc151c1}),0x0;}console['log'](_0x753a41(0x107)+_0x121260),console[_0x753a41(0x108)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x753a41(0x108)]('\x20\x20'+getConsoleUrl(_0x121260,_0x753a41(0xe3)));const _0x30e8d6=await a7_0x283533({'type':_0x753a41(0xd9),'name':_0x753a41(0x117),'message':_0x753a41(0xcf),'validate':_0x173f2b=>{const _0x4c9aa7=_0x753a41;if(!_0x173f2b||!_0x173f2b['trim']())return _0x4c9aa7(0x115);return!![];}});if(!_0x30e8d6['apiKey'])return console[_0x753a41(0x108)](_0x753a41(0xc6)),0x1;const _0xdc41d8=_0x30e8d6[_0x753a41(0x117)];console[_0x753a41(0x108)](_0x753a41(0xbe));try{const _0x330f09=TDX[_0x753a41(0xb6)]({'site':_0x121260,'apiKey':_0xdc41d8[_0x753a41(0xd3)](),'logLevel':_0x926058[_0x753a41(0xfb)]??LogLevel[_0x753a41(0xc1)]}),_0x5b8b67=await _0x330f09[_0x753a41(0xb8)][_0x753a41(0xd2)]();console[_0x753a41(0x108)](_0x753a41(0xdb)+_0x5b8b67[_0x753a41(0xfe)]+')');const _0x1c082a=await isKeychainAvailable();_0x1c082a?(await saveAPIKeyAsync(_0xdc41d8[_0x753a41(0xd3)](),_0x121260,_0x2b83c7),console[_0x753a41(0x108)](_0x753a41(0x116)+(_0x2b83c7?'\x20(profile:\x20'+_0x2b83c7+')':''))):(console[_0x753a41(0x109)](a7_0x486fe5[_0x753a41(0x114)](_0x753a41(0xe2))),console[_0x753a41(0x109)](a7_0x486fe5[_0x753a41(0x114)](_0x753a41(0xce))));if(_0x2b83c7){const _0x38417d={'site':_0x121260};saveProfileToUserConfig(_0x2b83c7,_0x38417d),console[_0x753a41(0x108)](_0x753a41(0xff)+_0x2b83c7+_0x753a41(0x10f));}else saveDefaultSiteToUserConfig(_0x121260),console[_0x753a41(0x108)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x121260);const _0x159d63=_0x2b83c7?_0x753a41(0xdf)+_0x2b83c7:'';return console['log'](),console['log'](_0x753a41(0xca)),console[_0x753a41(0x108)]('\x20\x20tdx'+_0x159d63+_0x753a41(0xe1)),console[_0x753a41(0x108)](_0x753a41(0xf5)+_0x159d63+_0x753a41(0xc7)),0x0;}catch(_0x19ae93){if(_0x19ae93 instanceof HTTPClientError&&_0x19ae93[_0x753a41(0xf9)]===0x191)return printAuthError(_0x19ae93),0x1;return console[_0x753a41(0xd7)](a7_0x486fe5['red'](_0x753a41(0xcb)+(_0x19ae93 instanceof Error?_0x19ae93[_0x753a41(0xf1)]:String(_0x19ae93)))),console[_0x753a41(0xd7)](_0x753a41(0xe6)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x3273e7(0x101);['description']=a7_0x3273e7(0x10e);async[a7_0x3273e7(0xc5)](_0x5405ed){const _0x101da9=a7_0x3273e7,{options:_0x21a54b,tdx:_0x2bd76e}=_0x5405ed,_0x3dd70a=_0x21a54b[_0x101da9(0xbc)],_0x2dd899=_0x21a54b[_0x101da9(0xc3)],_0x381f59=_0x2dd899?_0x2dd899:_0x101da9(0xd0);console[_0x101da9(0x108)]('tdx\x20profile:\x20'+_0x381f59+_0x101da9(0x105)+_0x3dd70a+')');const _0x552a47=await getOAuthTokens(_0x2dd899);if(_0x552a47)console[_0x101da9(0x108)](_0x101da9(0xe4)),console[_0x101da9(0x108)]('Read\x20credential\x20from\x20keychain'+(_0x2dd899?'\x20(profile:\x20'+_0x2dd899+')':''));else{const _0x12c100=await resolveAPIKeyAsync(_0x3dd70a,_0x2dd899);if(_0x12c100){const {source:_0x423f9d,isDeprecated:_0x183246}=_0x12c100,_0x1da8c2='Read\x20credential\x20from\x20'+_0x423f9d;console[_0x101da9(0x108)](_0x183246?a7_0x486fe5[_0x101da9(0x114)](_0x1da8c2):_0x1da8c2);}else console[_0x101da9(0x108)](a7_0x486fe5['yellow'](_0x101da9(0xb9)));}try{const _0x30eb0f=await _0x2bd76e[_0x101da9(0xb8)]['getUserInfo']();return console[_0x101da9(0x108)](a7_0x486fe5['green']('✓\x20Authentication\x20successful\x0a')),console[_0x101da9(0x108)](_0x101da9(0x10c)+_0x30eb0f[_0x101da9(0xfe)]),(_0x30eb0f[_0x101da9(0xde)]||_0x30eb0f[_0x101da9(0xba)])&&console[_0x101da9(0x108)](_0x101da9(0xc4)+[_0x30eb0f[_0x101da9(0xde)],_0x30eb0f[_0x101da9(0xba)]][_0x101da9(0xf2)](Boolean)[_0x101da9(0xf7)]('\x20')),0x0;}catch(_0x392775){return _0x392775 instanceof HTTPClientError&&_0x392775[_0x101da9(0xf9)]===0x191?printAuthError(_0x392775,!![],_0x2dd899):console[_0x101da9(0xd7)](a7_0x486fe5['red'](_0x101da9(0xcb)+(_0x392775 instanceof Error?_0x392775[_0x101da9(0xf1)]:String(_0x392775)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x3273e7(0xd5)]='auth:clear';[a7_0x3273e7(0xd8)]=a7_0x3273e7(0xe9);async[a7_0x3273e7(0xc5)](_0x31a192){const _0x3e4d1d=a7_0x3273e7,{options:_0x9120e6}=_0x31a192,_0x25f54a=_0x9120e6[_0x3e4d1d(0xc3)];console[_0x3e4d1d(0x108)](a7_0x486fe5['bold']('tdx:\x20auth\x20clear'));const _0x5c0006=await isKeychainAvailable();if(!_0x5c0006)return console[_0x3e4d1d(0xd7)](a7_0x486fe5['red']('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x142b0d,_0x374e59]=await Promise[_0x3e4d1d(0x111)]([deleteKeychainAPIKey(_0x25f54a),deleteOAuthTokens(_0x25f54a)]);if(_0x142b0d||_0x374e59){clearCredentialCache();const _0x18774e=[_0x142b0d&&_0x3e4d1d(0xcc),_0x374e59&&_0x3e4d1d(0x10a)][_0x3e4d1d(0xf2)](Boolean)['join']('\x20and\x20');return console[_0x3e4d1d(0x108)]('✓\x20'+_0x18774e+_0x3e4d1d(0xdc)+(_0x25f54a?_0x3e4d1d(0xbf)+_0x25f54a+')':'')),0x0;}else return console[_0x3e4d1d(0x108)](_0x3e4d1d(0xf3)+(_0x25f54a?_0x3e4d1d(0xb7)+_0x25f54a:'')),0x1;}}
1
+ const a7_0x3da688=a7_0x3846;function a7_0x4f72(){const _0x1bd2f6=['✗\x20Validation\x20failed:\x20','/users/initiate_sso\x20(account:\x20','profile','Read\x20credential\x20from\x20keychain','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','cyan','\x20\x20user_id:','58314vsBeSW','Credential\x20type:\x20OAuth','17088GEqduF','301557miICIS','\x20and\x20','Setup\x20cancelled','apiKey','\x20for\x20profile:\x20','Setting\x20up\x20authentication\x20for\x20site:\x20','Use\x20an\x20API\x20key','filter','first_name','818495EIoSil','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','\x20--profile\x20','description','8CfRWcR','log','message','oauth','name','API\x20key\x20cannot\x20be\x20empty','1966426uNolet','/app/mp/ak','No\x20credentials\x20found\x20in\x20keychain','create','bold','No\x20credential\x20found','\x27\x20registered','status','\x20(profile:\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','red','Opening\x20browser\x20for\x20authentication...','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','\x20\x20(','green','jobs','join','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','✓\x20Default\x20site\x20set\x20to\x20','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','site','✓\x20Profile\x20\x27','System\x20keychain\x20is\x20not\x20available','method','execute','auth','\x20\x20tdx','API\x20key','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','accountName','Sign\x20in\x20with\x20browser\x20(recommended)','error','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','1tMjIzX','apikey','42uvCjNI','/oauth/authorize','email','yellow','18XFJlBQ','\x20(site:\x20','516680NBnAhZ','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','621050KkYhlh','last_name','getUserInfo','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','Validating\x20OAuth\x20tokens...','ERROR','Enter\x20your\x20TD\x20API\x20key:','\x20removed\x20from\x20keychain','Validating\x20API\x20key...','account_id','\x0aSetup\x20cancelled','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','N/A','dim','Setup\x20API\x20key\x20authentication\x20interactively','auth:clear','trim','OAuth\x20tokens','logLevel'];a7_0x4f72=function(){return _0x1bd2f6;};return a7_0x4f72();}(function(_0x1b3c6,_0xcfc0c2){const _0x3c30b8=a7_0x3846,_0x1fa713=_0x1b3c6();while(!![]){try{const _0x98d5fa=-parseInt(_0x3c30b8(0x1a6))/0x1*(parseInt(_0x3c30b8(0x1cb))/0x2)+-parseInt(_0x3c30b8(0x1ce))/0x3*(-parseInt(_0x3c30b8(0x17e))/0x4)+-parseInt(_0x3c30b8(0x17a))/0x5+parseInt(_0x3c30b8(0x1cd))/0x6*(-parseInt(_0x3c30b8(0x1a8))/0x7)+parseInt(_0x3c30b8(0x1ae))/0x8*(-parseInt(_0x3c30b8(0x1ac))/0x9)+parseInt(_0x3c30b8(0x1b0))/0xa+parseInt(_0x3c30b8(0x184))/0xb;if(_0x98d5fa===_0xcfc0c2)break;else _0x1fa713['push'](_0x1fa713['shift']());}catch(_0x3e2146){_0x1fa713['push'](_0x1fa713['shift']());}}}(a7_0x4f72,0x1918b));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';function a7_0x3846(_0x5f4f88,_0x2715cc){_0x5f4f88=_0x5f4f88-0x173;const _0x4f72c5=a7_0x4f72();let _0x3846f3=_0x4f72c5[_0x5f4f88];return _0x3846f3;}import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x359ca6 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_0x25c858 from'chalk';export async function runOAuthLoginFlow(_0x51766b,_0x95530f,_0x4d70f6,_0x3d1d5e){const _0x3ebee9=a7_0x3846,_0x5389f5=await isKeychainAvailable();if(!_0x5389f5)throw new Error(_0x3ebee9(0x1af)+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');let _0x821c18=_0x3d1d5e?.['accountName'];if(!_0x821c18){const _0x5e639c=await a7_0x359ca6({'type':'text','name':_0x3ebee9(0x1a2),'message':'Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):'});if(_0x5e639c[_0x3ebee9(0x1a2)]===undefined)throw new Error(_0x3ebee9(0x173));_0x821c18=_0x5e639c[_0x3ebee9(0x1a2)][_0x3ebee9(0x1c1)]()||undefined;}const _0xb0dd1f=getConsoleUrl(_0x51766b);console[_0x3ebee9(0x17f)](_0x3ebee9(0x190));_0x821c18?console[_0x3ebee9(0x17f)]('\x20\x20'+_0xb0dd1f+_0x3ebee9(0x1c5)+_0x821c18+')'):console[_0x3ebee9(0x17f)]('\x20\x20'+_0xb0dd1f+_0x3ebee9(0x1a9));console['log'](_0x3ebee9(0x1b3));const _0x19c662=await startOAuthFlow(_0x51766b,{'accountName':_0x821c18});console['log'](_0x3ebee9(0x1b4));const _0x2bf01a=TDX[_0x3ebee9(0x187)]({'site':_0x51766b,'accessToken':_0x19c662['access_token'],'logLevel':_0x4d70f6??LogLevel[_0x3ebee9(0x1b5)]}),_0x421012=await _0x2bf01a['jobs']['getUserInfo']();console[_0x3ebee9(0x17f)](a7_0x25c858[_0x3ebee9(0x193)]('✓\x20Signed\x20in\x20successfully')),console[_0x3ebee9(0x17f)]('\x20\x20'+a7_0x25c858[_0x3ebee9(0x1c9)](_0x51766b+':'+_0x421012[_0x3ebee9(0x1b9)])+_0x3ebee9(0x1ca)+_0x421012['id']+_0x3ebee9(0x192)+_0x421012['email']+')');!_0x821c18&&(console[_0x3ebee9(0x17f)](a7_0x25c858[_0x3ebee9(0x1be)](_0x3ebee9(0x198))),console['log'](a7_0x25c858[_0x3ebee9(0x1be)](_0x3ebee9(0x18e))),console[_0x3ebee9(0x17f)](a7_0x25c858['dim'](_0x3ebee9(0x1bc))));await saveOAuthTokens(_0x19c662,_0x95530f),console['log']('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x95530f?'\x20(profile:\x20'+_0x95530f+')':''));if(_0x95530f){const _0x1361b2={'site':_0x51766b};saveProfileToUserConfig(_0x95530f,_0x1361b2),console['log'](_0x3ebee9(0x19a)+_0x95530f+_0x3ebee9(0x18a));}else saveDefaultSiteToUserConfig(_0x51766b),console[_0x3ebee9(0x17f)](_0x3ebee9(0x197)+_0x51766b);const _0x33dc38=_0x95530f?_0x3ebee9(0x17c)+_0x95530f:'';console[_0x3ebee9(0x17f)](),console[_0x3ebee9(0x17f)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x3ebee9(0x17f)](_0x3ebee9(0x19f)+_0x33dc38+_0x3ebee9(0x1bb)),console[_0x3ebee9(0x17f)](_0x3ebee9(0x19f)+_0x33dc38+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export async function promptAuthMethod(){const _0x451f1c=a7_0x3846,_0x3b0191=await a7_0x359ca6({'type':'select','name':_0x451f1c(0x19c),'message':'Choose\x20how\x20to\x20sign\x20in:','choices':[{'title':_0x451f1c(0x1a3),'description':_0x451f1c(0x1a5),'value':_0x451f1c(0x181)},{'title':_0x451f1c(0x177),'description':'For\x20scripts\x20or\x20headless\x20servers','value':_0x451f1c(0x1a7)}]});return _0x3b0191[_0x451f1c(0x19c)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x3da688(0x182)]='auth:setup';[a7_0x3da688(0x17d)]=a7_0x3da688(0x1bf);async[a7_0x3da688(0x19d)](_0x2c4187){const _0x316f41=a7_0x3da688,{options:_0x1fb022}=_0x2c4187,_0x315dcd=_0x1fb022[_0x316f41(0x1c6)];console[_0x316f41(0x17f)](a7_0x25c858[_0x316f41(0x188)]('tdx:\x20auth\x20setup'));const _0x5985d8=_0x1fb022[_0x316f41(0x199)]||'us01',_0x27b4ea=await promptSiteSelection(_0x5985d8,_0x315dcd,_0x316f41(0x173));if(!_0x27b4ea)return 0x1;const _0xf5bf37=resolveSite(_0x27b4ea),_0x55fb72=await promptAuthMethod();if(!_0x55fb72)return console[_0x316f41(0x17f)](_0x316f41(0x1ba)),0x1;if(_0x55fb72===_0x316f41(0x181)){const {accountName:_0x3acbc3}=_0x1fb022;return await runOAuthLoginFlow(_0xf5bf37,_0x315dcd,_0x1fb022['logLevel']??LogLevel[_0x316f41(0x1b5)],{'accountName':_0x3acbc3}),0x0;}console['log'](_0x316f41(0x176)+_0xf5bf37),console[_0x316f41(0x17f)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x316f41(0x17f)]('\x20\x20'+getConsoleUrl(_0xf5bf37,_0x316f41(0x185)));const _0x4d4472=await a7_0x359ca6({'type':'password','name':_0x316f41(0x174),'message':_0x316f41(0x1b6),'validate':_0x3ed878=>{const _0x55dce0=_0x316f41;if(!_0x3ed878||!_0x3ed878[_0x55dce0(0x1c1)]())return _0x55dce0(0x183);return!![];}});if(!_0x4d4472['apiKey'])return console[_0x316f41(0x17f)](_0x316f41(0x1ba)),0x1;const _0x5f00bf=_0x4d4472[_0x316f41(0x174)];console[_0x316f41(0x17f)](_0x316f41(0x1b8));try{const _0x576a8d=TDX[_0x316f41(0x187)]({'site':_0xf5bf37,'apiKey':_0x5f00bf['trim'](),'logLevel':_0x1fb022[_0x316f41(0x1c3)]??LogLevel['ERROR']}),_0x47e6c4=await _0x576a8d[_0x316f41(0x194)]['getUserInfo']();console[_0x316f41(0x17f)](_0x316f41(0x17b)+_0x47e6c4['email']+')');const _0x5e85ce=await isKeychainAvailable();_0x5e85ce?(await saveAPIKeyAsync(_0x5f00bf[_0x316f41(0x1c1)](),_0xf5bf37,_0x315dcd),console[_0x316f41(0x17f)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x315dcd?_0x316f41(0x18c)+_0x315dcd+')':''))):(console['warn'](a7_0x25c858[_0x316f41(0x1ab)](_0x316f41(0x196))),console['warn'](a7_0x25c858[_0x316f41(0x1ab)](_0x316f41(0x191))));if(_0x315dcd){const _0x46984f={'site':_0xf5bf37};saveProfileToUserConfig(_0x315dcd,_0x46984f),console[_0x316f41(0x17f)](_0x316f41(0x19a)+_0x315dcd+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0xf5bf37),console[_0x316f41(0x17f)]('✓\x20Default\x20site\x20set\x20to\x20'+_0xf5bf37);const _0xfe022e=_0x315dcd?_0x316f41(0x17c)+_0x315dcd:'';return console[_0x316f41(0x17f)](),console[_0x316f41(0x17f)](_0x316f41(0x18d)),console[_0x316f41(0x17f)](_0x316f41(0x19f)+_0xfe022e+_0x316f41(0x1bb)),console[_0x316f41(0x17f)](_0x316f41(0x19f)+_0xfe022e+_0x316f41(0x1a1)),0x0;}catch(_0x54867f){if(_0x54867f instanceof HTTPClientError&&_0x54867f[_0x316f41(0x18b)]===0x191)return printAuthError(_0x54867f),0x1;return console[_0x316f41(0x1a4)](a7_0x25c858[_0x316f41(0x18f)](_0x316f41(0x1c4)+(_0x54867f instanceof Error?_0x54867f[_0x316f41(0x180)]:String(_0x54867f)))),console[_0x316f41(0x1a4)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x3da688(0x182)]=a7_0x3da688(0x19e);[a7_0x3da688(0x17d)]=a7_0x3da688(0x1c8);async[a7_0x3da688(0x19d)](_0x5eb4c0){const _0x4ed0f6=a7_0x3da688,{options:_0x7e2fa4,tdx:_0x2a629f}=_0x5eb4c0,_0xb31e95=_0x7e2fa4[_0x4ed0f6(0x199)],_0x380df3=_0x7e2fa4['profile'],_0x450f86=_0x380df3?_0x380df3:_0x4ed0f6(0x1bd);console[_0x4ed0f6(0x17f)]('tdx\x20profile:\x20'+_0x450f86+_0x4ed0f6(0x1ad)+_0xb31e95+')');const _0x16c31f=await getOAuthTokens(_0x380df3);if(_0x16c31f)console[_0x4ed0f6(0x17f)](_0x4ed0f6(0x1cc)),console[_0x4ed0f6(0x17f)](_0x4ed0f6(0x1c7)+(_0x380df3?'\x20(profile:\x20'+_0x380df3+')':''));else{const _0x4d8113=await resolveAPIKeyAsync(_0xb31e95,_0x380df3);if(_0x4d8113){const {source:_0x207a3b,isDeprecated:_0x22381e}=_0x4d8113,_0x3f253a='Read\x20credential\x20from\x20'+_0x207a3b;console[_0x4ed0f6(0x17f)](_0x22381e?a7_0x25c858[_0x4ed0f6(0x1ab)](_0x3f253a):_0x3f253a);}else console[_0x4ed0f6(0x17f)](a7_0x25c858[_0x4ed0f6(0x1ab)](_0x4ed0f6(0x189)));}try{const _0x2e2787=await _0x2a629f[_0x4ed0f6(0x194)][_0x4ed0f6(0x1b2)]();return console[_0x4ed0f6(0x17f)](a7_0x25c858[_0x4ed0f6(0x193)]('✓\x20Authentication\x20successful\x0a')),console[_0x4ed0f6(0x17f)]('User:\x20'+_0x2e2787[_0x4ed0f6(0x1aa)]),(_0x2e2787[_0x4ed0f6(0x179)]||_0x2e2787[_0x4ed0f6(0x1b1)])&&console[_0x4ed0f6(0x17f)]('Name:\x20'+[_0x2e2787[_0x4ed0f6(0x179)],_0x2e2787[_0x4ed0f6(0x1b1)]][_0x4ed0f6(0x178)](Boolean)[_0x4ed0f6(0x195)]('\x20')),0x0;}catch(_0x3a052e){return _0x3a052e instanceof HTTPClientError&&_0x3a052e['status']===0x191?printAuthError(_0x3a052e,!![],_0x380df3):console[_0x4ed0f6(0x1a4)](a7_0x25c858['red'](_0x4ed0f6(0x1c4)+(_0x3a052e instanceof Error?_0x3a052e[_0x4ed0f6(0x180)]:String(_0x3a052e)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x3da688(0x182)]=a7_0x3da688(0x1c0);[a7_0x3da688(0x17d)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x3da688(0x19d)](_0x3c66b7){const _0x526f6f=a7_0x3da688,{options:_0x24bd64}=_0x3c66b7,_0x3eafe9=_0x24bd64[_0x526f6f(0x1c6)];console[_0x526f6f(0x17f)](a7_0x25c858[_0x526f6f(0x188)]('tdx:\x20auth\x20clear'));const _0x51e378=await isKeychainAvailable();if(!_0x51e378)return console[_0x526f6f(0x1a4)](a7_0x25c858[_0x526f6f(0x18f)](_0x526f6f(0x19b))),0x1;const [_0x39300c,_0x32ebc4]=await Promise['all']([deleteKeychainAPIKey(_0x3eafe9),deleteOAuthTokens(_0x3eafe9)]);if(_0x39300c||_0x32ebc4){clearCredentialCache();const _0x4ccc74=[_0x39300c&&_0x526f6f(0x1a0),_0x32ebc4&&_0x526f6f(0x1c2)]['filter'](Boolean)[_0x526f6f(0x195)](_0x526f6f(0x1cf));return console['log']('✓\x20'+_0x4ccc74+_0x526f6f(0x1b7)+(_0x3eafe9?_0x526f6f(0x18c)+_0x3eafe9+')':'')),0x0;}else return console['log'](_0x526f6f(0x186)+(_0x3eafe9?_0x526f6f(0x175)+_0x3eafe9:'')),0x1;}}