@treasuredata/tdx 2026.4.0 → 2026.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/frontmatter.js +1 -1
  182. package/dist/sdk/workspace/git.js +1 -1
  183. package/dist/sdk/workspace/index.js +1 -1
  184. package/dist/sdk/workspace/templates.js +1 -1
  185. package/dist/sdk/workspace/weekly.js +1 -1
  186. package/dist/sdk/workspace/wikilinks.js +1 -1
  187. package/dist/test-utils/command-runner.js +1 -1
  188. package/dist/test-utils/factories.js +1 -1
  189. package/dist/test-utils/fixtures.js +1 -1
  190. package/dist/test-utils/http-mock.js +1 -1
  191. package/dist/test-utils/index.js +1 -1
  192. package/dist/utils/async.js +1 -1
  193. package/dist/utils/colors.js +1 -1
  194. package/dist/utils/diff.js +1 -1
  195. package/dist/utils/file-permissions.js +1 -1
  196. package/dist/utils/file-reader.js +1 -1
  197. package/dist/utils/github-releases.js +1 -1
  198. package/dist/utils/global-cache.js +1 -1
  199. package/dist/utils/json-loader.js +1 -1
  200. package/dist/utils/local-cache.js +1 -1
  201. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  202. package/dist/utils/logger/formatters/index.js +1 -1
  203. package/dist/utils/logger/handlers/console-handler.js +1 -1
  204. package/dist/utils/logger/handlers/file-handler.js +1 -1
  205. package/dist/utils/logger/handlers/index.js +1 -1
  206. package/dist/utils/logger/handlers/null-handler.js +1 -1
  207. package/dist/utils/logger/index.js +1 -1
  208. package/dist/utils/logger/logger.js +1 -1
  209. package/dist/utils/logger/types.js +1 -1
  210. package/dist/utils/option-validation.js +1 -1
  211. package/dist/utils/process.js +1 -1
  212. package/dist/utils/prompt.js +1 -1
  213. package/dist/utils/spinner.js +1 -1
  214. package/dist/utils/sse-parser.js +1 -1
  215. package/dist/utils/string-utils.js +1 -1
  216. package/dist/utils/table-ref-parser.js +1 -1
  217. package/dist/utils/tdx-logger.js +1 -1
  218. package/dist/utils/version-check.js +1 -1
  219. package/package.json +1 -1
@@ -1 +1 @@
1
- const a3_0x51bfe8=a3_0x239b;(function(_0x404635,_0x8c096a){const _0x43195d=a3_0x239b,_0x2b4090=_0x404635();while(!![]){try{const _0x52359e=parseInt(_0x43195d(0x171))/0x1*(parseInt(_0x43195d(0x15a))/0x2)+-parseInt(_0x43195d(0x156))/0x3*(-parseInt(_0x43195d(0x166))/0x4)+parseInt(_0x43195d(0x15d))/0x5*(-parseInt(_0x43195d(0x150))/0x6)+-parseInt(_0x43195d(0x168))/0x7*(parseInt(_0x43195d(0x15e))/0x8)+-parseInt(_0x43195d(0x170))/0x9+parseInt(_0x43195d(0x159))/0xa+parseInt(_0x43195d(0x151))/0xb;if(_0x52359e===_0x8c096a)break;else _0x2b4090['push'](_0x2b4090['shift']());}catch(_0x1c7fb2){_0x2b4090['push'](_0x2b4090['shift']());}}}(a3_0x5351,0xd3244));import{BaseCommand}from'./command.js';function a3_0x5351(){const _0x4f81b5=['6142610tQwsix','3410LkuOve','✔\x20Found\x20','name','8534410IscUNT','16MqUrfg','\x27...','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Error:\x20Segment\x20name\x20is\x20required','segment','resolveSegmentId','Child\x20name:\x20','1684LuKQvo','length','703388TshKWs','verbose','execute','message','Site:\x20','Error:\x20','site','Listing\x20activations\x20for\x20segment\x20\x27','13400262YDBLtx','254cahgIY','description','\x20\x20Cause:\x20','Resolving\x20parent\x20segment\x20\x27','listActivations','6FzlLdk','32740488YVzpfe','cause','resolveParentId','data','activations','1695ZxhczV','\x20activation','error'];a3_0x5351=function(){return _0x4f81b5;};return a3_0x5351();}function a3_0x239b(_0x37ccfc,_0x4f38e0){_0x37ccfc=_0x37ccfc-0x14d;const _0x53511d=a3_0x5351();let _0x239b1a=_0x53511d[_0x37ccfc];return _0x239b1a;}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_0x51bfe8(0x15c)]=a3_0x51bfe8(0x155);[a3_0x51bfe8(0x172)]='List\x20activations\x20for\x20a\x20segment';async[a3_0x51bfe8(0x16a)](_0x35042e){const _0xc95e30=a3_0x51bfe8,{options:_0x7ca4c,args:_0x4dbbe0,tdx:_0x4410ae}=_0x35042e;if(_0x4dbbe0[_0xc95e30(0x167)]===0x0)return console[_0xc95e30(0x158)](_0xc95e30(0x162)),console[_0xc95e30(0x158)](_0xc95e30(0x161)),0x1;try{const {parentId:_0x274612,childId:_0x414aa9}=parseSegmentRef(_0x4dbbe0[0x0]);if(!_0x414aa9)return console[_0xc95e30(0x158)](_0xc95e30(0x160)),console[_0xc95e30(0x158)](_0xc95e30(0x161)),0x1;_0x7ca4c['verbose']&&(console[_0xc95e30(0x158)](_0xc95e30(0x16c)+_0x7ca4c[_0xc95e30(0x16e)]),console['error']('Parent\x20name:\x20'+_0x274612),console[_0xc95e30(0x158)](_0xc95e30(0x165)+_0x414aa9));const _0x40da18=await withSpinner(_0xc95e30(0x14e)+_0x274612+'\x27...',()=>_0x4410ae[_0xc95e30(0x163)][_0xc95e30(0x153)](_0x274612),{'verbose':_0x7ca4c[_0xc95e30(0x169)]}),_0x4fc8de=_0x40da18[_0xc95e30(0x154)];_0x7ca4c[_0xc95e30(0x169)]&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x4fc8de);const _0x55305e=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x414aa9+_0xc95e30(0x15f),()=>_0x4410ae[_0xc95e30(0x163)][_0xc95e30(0x164)](_0x4fc8de,_0x414aa9),{'verbose':_0x7ca4c[_0xc95e30(0x169)]}),_0x33b9e2=_0x55305e[_0xc95e30(0x154)];_0x7ca4c[_0xc95e30(0x169)]&&console[_0xc95e30(0x158)]('Resolved\x20child\x20ID:\x20'+_0x33b9e2);const _0x31eda0=await withSpinner(_0xc95e30(0x16f)+_0x414aa9+_0xc95e30(0x15f),()=>_0x4410ae[_0xc95e30(0x163)][_0xc95e30(0x14f)](_0x4fc8de,_0x33b9e2),{'verbose':_0x7ca4c['verbose']}),_0x12b2c9=_0x31eda0[_0xc95e30(0x154)];return console[_0xc95e30(0x158)](_0xc95e30(0x15b)+_0x12b2c9[_0xc95e30(0x167)]+_0xc95e30(0x157)+(_0x12b2c9[_0xc95e30(0x167)]!==0x1?'s':'')),await handleSDKOutput(_0x12b2c9,_0x7ca4c),0x0;}catch(_0x852033){if(_0x852033 instanceof SDKError)return console[_0xc95e30(0x158)](_0xc95e30(0x16d)+_0x852033[_0xc95e30(0x16b)]),_0x852033['cause']&&console[_0xc95e30(0x158)](_0xc95e30(0x14d)+_0x852033[_0xc95e30(0x152)]),0x1;throw _0x852033;}}}
1
+ const a3_0x5536a6=a3_0x4be7;(function(_0x16cbda,_0x3c85c7){const _0x145b28=a3_0x4be7,_0x86830c=_0x16cbda();while(!![]){try{const _0x4558b8=parseInt(_0x145b28(0x19c))/0x1*(parseInt(_0x145b28(0x191))/0x2)+-parseInt(_0x145b28(0x1ac))/0x3*(parseInt(_0x145b28(0x19e))/0x4)+parseInt(_0x145b28(0x19b))/0x5*(parseInt(_0x145b28(0x1a7))/0x6)+parseInt(_0x145b28(0x1b1))/0x7+parseInt(_0x145b28(0x1b3))/0x8*(parseInt(_0x145b28(0x1a6))/0x9)+parseInt(_0x145b28(0x199))/0xa+-parseInt(_0x145b28(0x190))/0xb;if(_0x4558b8===_0x3c85c7)break;else _0x86830c['push'](_0x86830c['shift']());}catch(_0x45c26e){_0x86830c['push'](_0x86830c['shift']());}}}(a3_0x51a4,0xda340));import{BaseCommand}from'./command.js';function a3_0x4be7(_0xa66f3d,_0xb4dfc){_0xa66f3d=_0xa66f3d-0x18f;const _0x51a494=a3_0x51a4();let _0x4be79c=_0x51a494[_0xa66f3d];return _0x4be79c;}import{SDKError}from'../sdk/index.js';function a3_0x51a4(){const _0x303727=['data','30MYRoYo','2QQYdVb','Resolved\x20child\x20ID:\x20','111380KgkCxT','Error:\x20Segment\x20name\x20is\x20required','segment','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','Resolving\x20child\x20segment\x20\x27','Resolved\x20parent\x20ID:\x20','name','verbose','36HOTjKK','1256214EpphjR','Site:\x20','Error:\x20','✔\x20Found\x20','activations','51hYUFCV','Parent\x20name:\x20','\x20\x20Cause:\x20','List\x20activations\x20for\x20a\x20segment','description','7535402dOKlve','Child\x20name:\x20','1595504imozxy','resolveParentId','44831457quXYlX','1142968IJkwYg','length','cause','error','\x27...','resolveSegmentId','message','site','11692920YqLNId'];a3_0x51a4=function(){return _0x303727;};return a3_0x51a4();}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_0x5536a6(0x1a4)]=a3_0x5536a6(0x1ab);[a3_0x5536a6(0x1b0)]=a3_0x5536a6(0x1af);async['execute'](_0x57644c){const _0x3324a9=a3_0x5536a6,{options:_0x566868,args:_0x16416b,tdx:_0x2fc2f7}=_0x57644c;if(_0x16416b[_0x3324a9(0x192)]===0x0)return console[_0x3324a9(0x194)](_0x3324a9(0x19f)),console[_0x3324a9(0x194)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x11d6d4,childId:_0x4d980c}=parseSegmentRef(_0x16416b[0x0]);if(!_0x4d980c)return console[_0x3324a9(0x194)](_0x3324a9(0x1a1)),console[_0x3324a9(0x194)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x566868[_0x3324a9(0x1a5)]&&(console['error'](_0x3324a9(0x1a8)+_0x566868[_0x3324a9(0x198)]),console[_0x3324a9(0x194)](_0x3324a9(0x1ad)+_0x11d6d4),console[_0x3324a9(0x194)](_0x3324a9(0x1b2)+_0x4d980c));const _0x4f958a=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x11d6d4+_0x3324a9(0x195),()=>_0x2fc2f7['segment'][_0x3324a9(0x18f)](_0x11d6d4),{'verbose':_0x566868[_0x3324a9(0x1a5)]}),_0x12aa1e=_0x4f958a[_0x3324a9(0x19a)];_0x566868[_0x3324a9(0x1a5)]&&console[_0x3324a9(0x194)](_0x3324a9(0x1a3)+_0x12aa1e);const _0x3add72=await withSpinner(_0x3324a9(0x1a2)+_0x4d980c+_0x3324a9(0x195),()=>_0x2fc2f7['segment'][_0x3324a9(0x196)](_0x12aa1e,_0x4d980c),{'verbose':_0x566868[_0x3324a9(0x1a5)]}),_0x792891=_0x3add72['data'];_0x566868[_0x3324a9(0x1a5)]&&console[_0x3324a9(0x194)](_0x3324a9(0x19d)+_0x792891);const _0x29d280=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x4d980c+_0x3324a9(0x195),()=>_0x2fc2f7[_0x3324a9(0x1a0)]['listActivations'](_0x12aa1e,_0x792891),{'verbose':_0x566868[_0x3324a9(0x1a5)]}),_0xda9feb=_0x29d280[_0x3324a9(0x19a)];return console['error'](_0x3324a9(0x1aa)+_0xda9feb[_0x3324a9(0x192)]+'\x20activation'+(_0xda9feb[_0x3324a9(0x192)]!==0x1?'s':'')),await handleSDKOutput(_0xda9feb,_0x566868),0x0;}catch(_0x118876){if(_0x118876 instanceof SDKError)return console['error'](_0x3324a9(0x1a9)+_0x118876[_0x3324a9(0x197)]),_0x118876['cause']&&console['error'](_0x3324a9(0x1ae)+_0x118876[_0x3324a9(0x193)]),0x1;throw _0x118876;}}}
@@ -1 +1 @@
1
- const a4_0x2b11ae=a4_0x5a01;function a4_0x7a2c(){const _0x2471ad=['\x20|\x20','Output\x20path:\x20','output','\x0aChanges\x20to\x20form\x20interface\x20\x27','\x20\x20Knowledge\x20Base\x20\x22','\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','\x20updated','Source:\x20','14633820vXIcVh','\x20\x20tdx\x20agent\x20clone\x20agents/','1TtJrXe','\x20\x20Knowledge\x20Bases:\x20','outputPath','\x20new','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\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','updated','\x22...','948143CFyYYd','834867dsxgVM','Dry\x20run\x20-\x20no\x20changes\x20made','message','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20\x20Agent\x20\x22','Analyzing\x20project\x20\x22','1689110fXPxFw','integrations','\x20\x20Chat\x20Interfaces:\x20','Project\x20cloned\x20with\x20errors','pullProject','dim','\x0a✔\x20Pushed\x20','110ntflDU','red','profile','utf-8','\x20\x20Prompt\x20\x22','errors','\x20errors','\x20=\x20','\x0a✔\x20Pulled\x20','\x22\x20to\x20a\x20different\x20profile','New\x20project\x20name\x20is\x20required','-\x20no\x20files\x20written','repeat','no_local_folder','Using\x20context\x20project:\x20','88tGHvIe','green','agent:pull','force','no_context','Agent\x20','yes','\x20\x20Experimental\x20Artifacts:\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20\x20Integrations:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20\x20Target:\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','New\x20project:\x20','textKnowledgeBases','agent','\x20resources?','gray','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','projectDir','\x20unchanged','\x22\x20from\x20project\x20\x22','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','projectId','log','✔\x20Context\x20set:\x20','push','Errors:','experimentalArtifacts','cwd','INVALID_ARGUMENT','agentId','\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)','Writing\x20files...','\x0aProject\x20pushed\x20with\x20errors','\x0aChanges\x20to\x20prompt\x20\x27','Pulling\x20agent\x20\x22','llmProject','isNew','cloneProject','\x0aErrors\x20found:','agent:push','source','counts','parse','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20created','Using\x20project\x20from\x20context:\x20','Output:\x20','Using\x20project:\x20','56AIAMQA','\x22:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x0aChanges\x20to\x20chat\x20interface\x20\x27','new','pushProject','Would\x20pull\x20agent:\x20','hasChanges','\x22\x20to\x20\x22','found','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20--profile\x20','25062ZWQxts','\x0aChanges\x20to\x20integration\x20\x27','Using\x20current\x20project:\x20','agentName','total','12802410ULcOEL','description','\x20\x20Agents:\x20','Cancelled','tdx.json','action','\x20\x20tdx\x20agent\x20pull\x20','Cloning\x20\x22','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aWrite\x20','\x20\x20Form\x20Interface\x20\x22','join','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x20changed','\x20\x20Source:\x20','pushAgent','\x20\x20Experimental\x20Artifact\x20\x22','dirname','pullAgent','\x0aPush\x20summary\x20for\x20\x27','Agent:\x20','created','cyan','<new-name>','Project:\x20','MISSING_ARGUMENT','Using\x20project\x20from\x20','chatInterfaces','arg-dir','Project\x20cloned\x20successfully','experimentalKnowledgeBases','sourceProjectName','\x20files\x20to\x20','unchanged','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)','\x22\x20to\x20new\x20project\x20\x22','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Would\x20clone:','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','agent:clone','newProjectId','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','name','dryRun','Would\x20push\x20agent:\x20','\x20\x20Integration\x20\x22','\x0aError:','diff','formInterfaces','54054YDXgyC','Cannot\x20clone\x20from\x20context\x20project\x20\x22','yellow','\x20successfully','\x0aPush\x20','knowledgeBases','prompts','Using\x20local\x20project:\x20','\x20resources\x20to\x20\x27','context','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x20files?','Summary:','Agent\x20pulled\x20successfully','Pushing\x20agent\x20from\x20\x22','Status:\x20','session','error','\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','llm_project','reason','Analyzing\x20changes\x20to\x20push...','Clone\x20\x22','site','\x20\x20Prompts:\x20','projectName','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x0aChanges\x20to\x20agent\x20\x27','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','llm','\x20\x20Form\x20Interfaces:\x20','agent.yml','\x20total','agents','10cxgSfo','outputDir'];a4_0x7a2c=function(){return _0x2471ad;};return a4_0x7a2c();}(function(_0xb37ea6,_0x2d87bb){const _0x5e4cc6=a4_0x5a01,_0x34fc80=_0xb37ea6();while(!![]){try{const _0x411318=parseInt(_0x5e4cc6(0x166))/0x1*(parseInt(_0x5e4cc6(0x175))/0x2)+parseInt(_0x5e4cc6(0x137))/0x3*(parseInt(_0x5e4cc6(0x18b))/0x4)+-parseInt(_0x5e4cc6(0x15a))/0x5*(parseInt(_0x5e4cc6(0x1c9))/0x6)+parseInt(_0x5e4cc6(0x16e))/0x7*(-parseInt(_0x5e4cc6(0x1bd))/0x8)+-parseInt(_0x5e4cc6(0x1ce))/0x9+parseInt(_0x5e4cc6(0x17c))/0xa*(parseInt(_0x5e4cc6(0x16f))/0xb)+parseInt(_0x5e4cc6(0x164))/0xc;if(_0x411318===_0x2d87bb)break;else _0x34fc80['push'](_0x34fc80['shift']());}catch(_0x154681){_0x34fc80['push'](_0x34fc80['shift']());}}}(a4_0x7a2c,0xdfb5c));import a4_0x45c783 from'chalk';import a4_0x5ccdf9 from'path';function a4_0x5a01(_0x295706,_0x18933e){_0x295706=_0x295706-0x134;const _0x7a2c76=a4_0x7a2c();let _0x5a01df=_0x7a2c76[_0x295706];return _0x5a01df;}import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x1bffe5){const _0x5939ae=a4_0x5a01,_0x1ed510=[];if(_0x1bffe5['total']!==undefined)_0x1ed510[_0x5939ae(0x1a5)](_0x1bffe5[_0x5939ae(0x1cd)]+_0x5939ae(0x158));if(_0x1bffe5[_0x5939ae(0x1c1)]!==undefined&&_0x1bffe5[_0x5939ae(0x1c1)]>0x0)_0x1ed510[_0x5939ae(0x1a5)](a4_0x45c783['green'](_0x1bffe5[_0x5939ae(0x1c1)]+_0x5939ae(0x169)));if(_0x1bffe5[_0x5939ae(0x1e3)]!==undefined&&_0x1bffe5[_0x5939ae(0x1e3)]>0x0)_0x1ed510[_0x5939ae(0x1a5)](a4_0x45c783['green'](_0x1bffe5[_0x5939ae(0x1e3)]+_0x5939ae(0x1b9)));if(_0x1bffe5[_0x5939ae(0x16c)]!==undefined&&_0x1bffe5['updated']>0x0)_0x1ed510[_0x5939ae(0x1a5)](a4_0x45c783[_0x5939ae(0x139)](_0x1bffe5[_0x5939ae(0x16c)]+_0x5939ae(0x162)));if(_0x1bffe5[_0x5939ae(0x1ef)]!==undefined&&_0x1bffe5[_0x5939ae(0x1ef)]>0x0)_0x1ed510['push'](a4_0x45c783[_0x5939ae(0x19c)](_0x1bffe5[_0x5939ae(0x1ef)]+'\x20unchanged'));if(_0x1bffe5['errors']!==undefined&&_0x1bffe5[_0x5939ae(0x181)]>0x0)_0x1ed510[_0x5939ae(0x1a5)](a4_0x45c783[_0x5939ae(0x17d)](_0x1bffe5[_0x5939ae(0x181)]+_0x5939ae(0x182)));return _0x1ed510[_0x5939ae(0x1d9)](',\x20');}function displayDiffs(_0x4b76ce,_0x477c69,_0x1c3447,_0x51cb97,_0xec5cd3,_0x2fa0ba,_0x2d6c69,_0x1bf6cf,_0xa8140f){const _0x1e2738=a4_0x5a01;for(const _0x413124 of _0x4b76ce){if(_0x413124[_0x1e2738(0x135)]){const _0xa03aa1=_0x413124[_0x1e2738(0x1cc)]||_0x413124[_0x1e2738(0x1fa)];console[_0x1e2738(0x1a3)](_0x1e2738(0x152)+_0xa03aa1+'\x27:'),console['log']('─'[_0x1e2738(0x188)](0x3c)),console[_0x1e2738(0x1a3)](_0x413124['diff']),console[_0x1e2738(0x1a3)]('─'[_0x1e2738(0x188)](0x3c));}}for(const _0x2d867f of _0x477c69){_0x2d867f['diff']&&(console[_0x1e2738(0x1a3)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x2d867f[_0x1e2738(0x1fa)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x1e2738(0x1a3)](_0x2d867f['diff']),console[_0x1e2738(0x1a3)]('─'[_0x1e2738(0x188)](0x3c)));}for(const _0x2abd43 of _0x1c3447){_0x2abd43['diff']&&(console[_0x1e2738(0x1a3)](_0x1e2738(0x1f9)+_0x2abd43[_0x1e2738(0x1fa)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console['log'](_0x2abd43[_0x1e2738(0x135)]),console['log']('─'[_0x1e2738(0x188)](0x3c)));}for(const _0x34ff57 of _0x51cb97){_0x34ff57[_0x1e2738(0x135)]&&(console['log'](_0x1e2738(0x1ae)+_0x34ff57[_0x1e2738(0x1fa)]+'\x27:'),console['log']('─'[_0x1e2738(0x188)](0x3c)),console[_0x1e2738(0x1a3)](_0x34ff57[_0x1e2738(0x135)]),console['log']('─'['repeat'](0x3c)));}for(const _0xc45551 of _0xec5cd3){_0xc45551[_0x1e2738(0x135)]&&(console[_0x1e2738(0x1a3)](_0x1e2738(0x1ca)+_0xc45551[_0x1e2738(0x1fa)]+'\x27:'),console[_0x1e2738(0x1a3)]('─'['repeat'](0x3c)),console[_0x1e2738(0x1a3)](_0xc45551['diff']),console['log']('─'['repeat'](0x3c)));}for(const _0x28e79d of _0x2fa0ba){_0x28e79d[_0x1e2738(0x135)]&&(console[_0x1e2738(0x1a3)](_0x1e2738(0x19d)+_0x28e79d[_0x1e2738(0x1fa)]+'\x27:'),console[_0x1e2738(0x1a3)]('─'[_0x1e2738(0x188)](0x3c)),console['log'](_0x28e79d[_0x1e2738(0x135)]),console[_0x1e2738(0x1a3)]('─'[_0x1e2738(0x188)](0x3c)));}for(const _0x4a1bf7 of _0x2d6c69){_0x4a1bf7['diff']&&(console[_0x1e2738(0x1a3)](_0x1e2738(0x1f2)+_0x4a1bf7[_0x1e2738(0x1fa)]+'\x27:'),console[_0x1e2738(0x1a3)]('─'['repeat'](0x3c)),console[_0x1e2738(0x1a3)](_0x4a1bf7[_0x1e2738(0x135)]),console[_0x1e2738(0x1a3)]('─'[_0x1e2738(0x188)](0x3c)));}for(const _0x32c726 of _0x1bf6cf){_0x32c726[_0x1e2738(0x135)]&&(console[_0x1e2738(0x1a3)](_0x1e2738(0x15f)+_0x32c726[_0x1e2738(0x1fa)]+'\x27:'),console[_0x1e2738(0x1a3)]('─'[_0x1e2738(0x188)](0x3c)),console['log'](_0x32c726[_0x1e2738(0x135)]),console[_0x1e2738(0x1a3)]('─'[_0x1e2738(0x188)](0x3c)));}for(const _0x450477 of _0xa8140f){_0x450477[_0x1e2738(0x135)]&&(console[_0x1e2738(0x1a3)](_0x1e2738(0x1c0)+_0x450477['name']+'\x27:'),console['log']('─'[_0x1e2738(0x188)](0x3c)),console[_0x1e2738(0x1a3)](_0x450477[_0x1e2738(0x135)]),console[_0x1e2738(0x1a3)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x2b11ae(0x1fa)]=a4_0x2b11ae(0x18d);[a4_0x2b11ae(0x1cf)]=a4_0x2b11ae(0x1a1);async['execute'](_0xcbfd16){const _0x1d3100=a4_0x2b11ae,{options:_0x2082c9,args:_0x3fc263,tdx:_0x4048c7}=_0xcbfd16,_0x365097=_0x3fc263[0x0],_0x3b0755=_0x3fc263[0x1],_0x5ce52f=_0x2082c9[_0x1d3100(0x15e)],_0x5188e3=_0x2082c9[_0x1d3100(0x1fb)],_0x3e91ce=_0x2082c9['force'],_0x4c001e=_0x2082c9[_0x1d3100(0x191)],_0x2fe608=_0x2082c9['llmProject'],_0x17b831=_0x2082c9[_0x1d3100(0x19a)];let _0x293f78;if(_0x365097){const _0x167406=a4_0x5ccdf9[_0x1d3100(0x1d9)](_0x365097,'tdx.json');if(existsSync(_0x167406))try{const _0x3db4aa=JSON[_0x1d3100(0x1b7)](readFileSync(_0x167406,_0x1d3100(0x17f)));_0x3db4aa[_0x1d3100(0x14a)]&&(_0x293f78={'llm_project':_0x3db4aa[_0x1d3100(0x14a)]});}catch{}}const _0x44964b=findAgentConfigPath(process['cwd']());let _0x3245e5;if(_0x44964b)try{const _0x2a4909=JSON[_0x1d3100(0x1b7)](readFileSync(_0x44964b,_0x1d3100(0x17f)));_0x2a4909[_0x1d3100(0x14a)]&&(_0x3245e5={'llm_project':_0x2a4909[_0x1d3100(0x14a)]});}catch{}const _0x4dd07c=resolveAgentPullArgs({'arg':_0x365097,'agentNameArg':_0x3b0755,'agentFlag':_0x17b831,'contextProject':_0x2fe608,'argDirConfig':_0x293f78,'cwdConfigPath':_0x44964b||undefined,'cwdConfig':_0x3245e5}),{projectNameOrId:_0x5b8ec0,targetAgentName:_0x4d0afd,existingOutputDir:_0x326355,source:_0x257578}=_0x4dd07c;if(_0x257578===_0x1d3100(0x1ea))console[_0x1d3100(0x1a3)](a4_0x45c783[_0x1d3100(0x17a)](_0x1d3100(0x1e8)+a4_0x5ccdf9[_0x1d3100(0x1d9)](_0x365097,_0x1d3100(0x1d2))+':\x20'+_0x5b8ec0));else{if(_0x257578==='cwd-config')console[_0x1d3100(0x1a3)](a4_0x45c783[_0x1d3100(0x17a)](_0x1d3100(0x1bc)+_0x5b8ec0));else _0x257578===_0x1d3100(0x140)&&console['log'](a4_0x45c783[_0x1d3100(0x17a)](_0x1d3100(0x1ba)+_0x5b8ec0));}if(!_0x5b8ec0)return _0x17b831?(console[_0x1d3100(0x1a3)](a4_0x45c783[_0x1d3100(0x139)](_0x1d3100(0x141))),console['log']('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console['log'](_0x1d3100(0x1da))):(console[_0x1d3100(0x1a3)](a4_0x45c783[_0x1d3100(0x139)](_0x1d3100(0x1bf))),console['log'](_0x1d3100(0x1f0)),console[_0x1d3100(0x1a3)](_0x1d3100(0x161)),console[_0x1d3100(0x1a3)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console['log'](_0x1d3100(0x16b)),console[_0x1d3100(0x1a3)](_0x1d3100(0x149))),0x1;if(_0x4d0afd){const {data:_0x2d52c0}=await withSpinner(_0x1d3100(0x1af)+_0x4d0afd+_0x1d3100(0x1a0)+_0x5b8ec0+_0x1d3100(0x16d),()=>_0x4048c7[_0x1d3100(0x155)][_0x1d3100(0x1e0)](_0x5b8ec0,_0x4d0afd,_0x5ce52f,{'dryRun':_0x5188e3,'force':_0x3e91ce}));if(_0x5188e3)return console['log'](a4_0x45c783[_0x1d3100(0x139)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x1d3100(0x1a3)](_0x1d3100(0x1c3)+_0x2d52c0['agentName']),console[_0x1d3100(0x1a3)](_0x1d3100(0x15d)+_0x2d52c0[_0x1d3100(0x168)]),_0x2d52c0[_0x1d3100(0x135)]&&(console[_0x1d3100(0x1a3)]('\x0aChanges:'),console[_0x1d3100(0x1a3)]('─'['repeat'](0x3c)),console[_0x1d3100(0x1a3)](_0x2d52c0[_0x1d3100(0x135)]),console['log']('─'[_0x1d3100(0x188)](0x3c))),0x0;return console['log'](a4_0x45c783['green'](_0x1d3100(0x144))),console[_0x1d3100(0x1a3)](_0x1d3100(0x1e2)+_0x2d52c0[_0x1d3100(0x1cc)]),console[_0x1d3100(0x1a3)](_0x1d3100(0x1bb)+_0x2d52c0[_0x1d3100(0x168)]),console['log'](_0x1d3100(0x146)+(_0x2d52c0[_0x1d3100(0x1b1)]?a4_0x45c783[_0x1d3100(0x18c)](_0x1d3100(0x1c1)):_0x2d52c0[_0x1d3100(0x1c4)]?a4_0x45c783[_0x1d3100(0x139)](_0x1d3100(0x16c)):a4_0x45c783[_0x1d3100(0x19c)](_0x1d3100(0x1ef)))),0x0;}const _0x5bf36f=_0x326355||_0x5ce52f,{data:_0x4669df}=await withSpinner(_0x1d3100(0x174)+_0x5b8ec0+_0x1d3100(0x16d),()=>_0x4048c7[_0x1d3100(0x155)][_0x1d3100(0x179)](_0x5b8ec0,_0x5bf36f,{'dryRun':!![]})),_0x56809c=_0x4669df[_0x1d3100(0x1b6)][_0x1d3100(0x159)][_0x1d3100(0x1c1)]+_0x4669df[_0x1d3100(0x1b6)][_0x1d3100(0x13c)][_0x1d3100(0x1c1)]+_0x4669df['counts'][_0x1d3100(0x199)]['new']+_0x4669df[_0x1d3100(0x1b6)][_0x1d3100(0x13d)][_0x1d3100(0x1c1)]+_0x4669df['counts'][_0x1d3100(0x176)][_0x1d3100(0x1c1)]+_0x4669df['counts']['experimentalKnowledgeBases'][_0x1d3100(0x1c1)]+_0x4669df['counts'][_0x1d3100(0x1a7)]['new']+_0x4669df[_0x1d3100(0x1b6)][_0x1d3100(0x136)][_0x1d3100(0x1c1)]+_0x4669df['counts'][_0x1d3100(0x1e9)][_0x1d3100(0x1c1)],_0x17cdfb=_0x4669df['counts'][_0x1d3100(0x159)]['updated']+_0x4669df[_0x1d3100(0x1b6)][_0x1d3100(0x13c)][_0x1d3100(0x16c)]+_0x4669df['counts'][_0x1d3100(0x199)]['updated']+_0x4669df[_0x1d3100(0x1b6)][_0x1d3100(0x13d)][_0x1d3100(0x16c)]+_0x4669df[_0x1d3100(0x1b6)]['integrations'][_0x1d3100(0x16c)]+_0x4669df[_0x1d3100(0x1b6)]['experimentalKnowledgeBases']['updated']+_0x4669df[_0x1d3100(0x1b6)]['experimentalArtifacts'][_0x1d3100(0x16c)]+_0x4669df[_0x1d3100(0x1b6)][_0x1d3100(0x136)][_0x1d3100(0x16c)]+_0x4669df[_0x1d3100(0x1b6)]['chatInterfaces']['updated'],_0x3ca426=_0x4669df['counts']['agents'][_0x1d3100(0x1ef)]+_0x4669df['counts']['knowledgeBases'][_0x1d3100(0x1ef)]+_0x4669df[_0x1d3100(0x1b6)][_0x1d3100(0x199)][_0x1d3100(0x1ef)]+_0x4669df[_0x1d3100(0x1b6)][_0x1d3100(0x13d)][_0x1d3100(0x1ef)]+_0x4669df[_0x1d3100(0x1b6)][_0x1d3100(0x176)][_0x1d3100(0x1ef)]+_0x4669df['counts'][_0x1d3100(0x1ec)][_0x1d3100(0x1ef)]+_0x4669df[_0x1d3100(0x1b6)][_0x1d3100(0x1a7)]['unchanged']+_0x4669df[_0x1d3100(0x1b6)][_0x1d3100(0x136)][_0x1d3100(0x1ef)]+_0x4669df['counts']['chatInterfaces'][_0x1d3100(0x1ef)];console[_0x1d3100(0x1a3)]('\x0aPull\x20summary\x20for\x20\x27'+_0x4669df[_0x1d3100(0x150)]+'\x27:'),console[_0x1d3100(0x1a3)]('\x20\x20'+a4_0x45c783['green']('+\x20'+_0x56809c+'\x20new')+_0x1d3100(0x15c)+a4_0x45c783['yellow']('~\x20'+_0x17cdfb+_0x1d3100(0x1db))+_0x1d3100(0x15c)+a4_0x45c783[_0x1d3100(0x17a)]('=\x20'+_0x3ca426+_0x1d3100(0x19f))),console['log'](_0x1d3100(0x1d0)+formatCountSummary(_0x4669df['counts'][_0x1d3100(0x159)])),console[_0x1d3100(0x1a3)](_0x1d3100(0x167)+formatCountSummary(_0x4669df[_0x1d3100(0x1b6)]['knowledgeBases'])),console[_0x1d3100(0x1a3)](_0x1d3100(0x1b8)+formatCountSummary(_0x4669df[_0x1d3100(0x1b6)][_0x1d3100(0x199)])),console['log'](_0x1d3100(0x14f)+formatCountSummary(_0x4669df[_0x1d3100(0x1b6)][_0x1d3100(0x13d)])),console[_0x1d3100(0x1a3)](_0x1d3100(0x194)+formatCountSummary(_0x4669df[_0x1d3100(0x1b6)]['integrations'])),console[_0x1d3100(0x1a3)](_0x1d3100(0x156)+formatCountSummary(_0x4669df[_0x1d3100(0x1b6)][_0x1d3100(0x136)])),console[_0x1d3100(0x1a3)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x4669df[_0x1d3100(0x1b6)][_0x1d3100(0x1e9)]));const _0x1350c3=_0x4669df[_0x1d3100(0x1b6)]['experimentalKnowledgeBases']['total']>0x0||_0x4669df[_0x1d3100(0x1b6)]['experimentalArtifacts']['total']>0x0;_0x1350c3&&(console[_0x1d3100(0x1a3)](_0x1d3100(0x1f4)+formatCountSummary(_0x4669df['counts'][_0x1d3100(0x1ec)])),console[_0x1d3100(0x1a3)](_0x1d3100(0x192)+formatCountSummary(_0x4669df[_0x1d3100(0x1b6)][_0x1d3100(0x1a7)])));console[_0x1d3100(0x1a3)](_0x1d3100(0x196)+a4_0x45c783[_0x1d3100(0x1e4)](_0x4669df[_0x1d3100(0x15b)])),displayDiffs(_0x4669df['agents'],_0x4669df[_0x1d3100(0x13c)],_0x4669df[_0x1d3100(0x199)],_0x4669df[_0x1d3100(0x13d)],_0x4669df[_0x1d3100(0x176)],_0x4669df[_0x1d3100(0x1ec)],_0x4669df[_0x1d3100(0x1a7)],_0x4669df[_0x1d3100(0x136)],_0x4669df['chatInterfaces']);if(_0x5188e3)return console['log'](a4_0x45c783[_0x1d3100(0x139)](_0x1d3100(0x151))),0x0;if(_0x56809c===0x0&&_0x17cdfb===0x0)return console[_0x1d3100(0x1a3)](a4_0x45c783['green'](_0x1d3100(0x1d6))),saveSessionContext({'llm_project':_0x4669df[_0x1d3100(0x150)]},_0x2082c9['session']),console[_0x1d3100(0x1a3)](a4_0x45c783[_0x1d3100(0x18c)](_0x1d3100(0x1a4)+a4_0x45c783[_0x1d3100(0x17a)](_0x1d3100(0x14a))+_0x1d3100(0x183)+a4_0x45c783[_0x1d3100(0x1e4)](_0x4669df[_0x1d3100(0x150)]))),0x0;if(!_0x4c001e&&!_0x3e91ce){if(!isInteractive())return console[_0x1d3100(0x148)](a4_0x45c783[_0x1d3100(0x17d)]('\x0aError:'),_0x1d3100(0x1f3)),console[_0x1d3100(0x148)](a4_0x45c783['dim'](_0x1d3100(0x153))),0x1;const _0x1fe22e=await confirmKey(_0x1d3100(0x1d7)+(_0x56809c+_0x17cdfb)+_0x1d3100(0x142));if(!_0x1fe22e)return console[_0x1d3100(0x1a3)](a4_0x45c783[_0x1d3100(0x139)]('Cancelled'),_0x1d3100(0x187)),0x1;}const {data:_0x115419}=await withSpinner(_0x1d3100(0x1ac),()=>_0x4048c7[_0x1d3100(0x155)]['pullProject'](_0x5b8ec0,_0x5bf36f,{'force':_0x3e91ce}));return console[_0x1d3100(0x1a3)](a4_0x45c783[_0x1d3100(0x18c)](_0x1d3100(0x184)+(_0x56809c+_0x17cdfb)+_0x1d3100(0x1ee)+_0x115419[_0x1d3100(0x15b)])),saveSessionContext({'llm_project':_0x115419[_0x1d3100(0x150)]},_0x2082c9[_0x1d3100(0x147)]),console[_0x1d3100(0x1a3)](a4_0x45c783[_0x1d3100(0x18c)]('✔\x20Context\x20set:\x20'+a4_0x45c783['dim'](_0x1d3100(0x14a))+_0x1d3100(0x183)+a4_0x45c783[_0x1d3100(0x1e4)](_0x115419[_0x1d3100(0x150)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x2b11ae(0x1fa)]=a4_0x2b11ae(0x1f7);[a4_0x2b11ae(0x1cf)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async['execute'](_0x13c29e){const _0x155c78=a4_0x2b11ae,{options:_0x32b865,args:_0x270442,tdx:_0xbc963}=_0x13c29e,_0x2ab517=_0x270442[0x0],_0x2b1e5a=_0x32b865[_0x155c78(0x1fa)],_0x30e2f3=_0x32b865[_0x155c78(0x1fb)],_0x1db6e1=_0x32b865[_0x155c78(0x191)],_0x477f16=_0x32b865[_0x155c78(0x14e)],_0x5e85dc=_0x32b865[_0x155c78(0x1b0)];let _0x35281e;const _0x31dbe3=findAgentConfigPath(process[_0x155c78(0x1a8)]());if(_0x2ab517){const _0x319d71=a4_0x5ccdf9[_0x155c78(0x1d9)](_0x2ab517,_0x155c78(0x1d2));existsSync(_0x319d71)?(_0x35281e=_0x2ab517,console[_0x155c78(0x1a3)](a4_0x45c783[_0x155c78(0x17a)]('Using\x20local\x20project:\x20'+_0x2ab517))):_0x35281e=_0x2ab517;}else{if(_0x31dbe3)_0x35281e=a4_0x5ccdf9[_0x155c78(0x1df)](_0x31dbe3),console[_0x155c78(0x1a3)](a4_0x45c783[_0x155c78(0x17a)](_0x155c78(0x1cb)+_0x35281e));else{if(_0x5e85dc){const _0x2bf269=sanitizeForFilesystem(_0x5e85dc);let _0x283f91=_0x2bf269,_0x4908b2=a4_0x5ccdf9[_0x155c78(0x1d9)](process[_0x155c78(0x1a8)](),_0x155c78(0x159),_0x2bf269,_0x155c78(0x1d2));if(!existsSync(_0x4908b2)){const _0xf88b17=normalizeName(_0x5e85dc),_0xfe115b=a4_0x5ccdf9['join'](process[_0x155c78(0x1a8)](),_0x155c78(0x159),_0xf88b17,_0x155c78(0x1d2));existsSync(_0xfe115b)&&(_0x283f91=_0xf88b17,_0x4908b2=_0xfe115b);}if(existsSync(_0x4908b2))_0x35281e=a4_0x5ccdf9[_0x155c78(0x1df)](_0x4908b2),console['log'](a4_0x45c783[_0x155c78(0x17a)](_0x155c78(0x13e)+_0x35281e));else{const _0x266ebd=_0x32b865[_0x155c78(0x17e)];if(_0x266ebd)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x155c78(0x138)+_0x5e85dc+_0x155c78(0x185),undefined,{'helpText':_0x155c78(0x16a)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x155c78(0x1d4)+_0x5e85dc+'\x0a')+(_0x155c78(0x165)+_0x283f91+'\x20--name\x20'+(_0x2b1e5a||_0x155c78(0x1e5))+_0x155c78(0x1c8)+_0x266ebd)});_0x35281e=_0x5e85dc,console[_0x155c78(0x1a3)](a4_0x45c783[_0x155c78(0x17a)](_0x155c78(0x18a)+_0x5e85dc));}}}}if(!_0x35281e)return console[_0x155c78(0x1a3)](a4_0x45c783[_0x155c78(0x139)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x155c78(0x1a3)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x155c78(0x1a3)](_0x155c78(0x1c7)),console['log'](_0x155c78(0x1ab)),console[_0x155c78(0x1a3)](_0x155c78(0x154)),0x1;if(!_0x2b1e5a)throw new SDKError(ErrorCode[_0x155c78(0x1e7)],_0x155c78(0x186),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x1db6e1&&!_0x30e2f3){if(!isInteractive())return console[_0x155c78(0x148)](a4_0x45c783[_0x155c78(0x17d)](_0x155c78(0x134)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x155c78(0x148)](a4_0x45c783[_0x155c78(0x17a)](_0x155c78(0x153))),0x1;const _0x579c46=await confirmKey(_0x155c78(0x14d)+_0x35281e+_0x155c78(0x1f1)+_0x2b1e5a+'\x22?');if(!_0x579c46)return console[_0x155c78(0x1a3)](a4_0x45c783['yellow'](_0x155c78(0x1d1))),0x1;}const {data:_0x19fcf1}=await withSpinner(_0x155c78(0x1d5)+_0x35281e+_0x155c78(0x1c5)+_0x2b1e5a+_0x155c78(0x16d),()=>_0xbc963[_0x155c78(0x155)][_0x155c78(0x1b2)](_0x35281e,_0x2b1e5a,{'dryRun':_0x30e2f3}));if(_0x30e2f3){console[_0x155c78(0x1a3)](a4_0x45c783[_0x155c78(0x139)](_0x155c78(0x170))),console[_0x155c78(0x1a3)](_0x155c78(0x163)+_0x19fcf1[_0x155c78(0x1ed)]),console[_0x155c78(0x1a3)](_0x155c78(0x198)+_0x2b1e5a),console[_0x155c78(0x1a3)](_0x155c78(0x1f5)),console[_0x155c78(0x1a3)](_0x155c78(0x1d0)+_0x19fcf1[_0x155c78(0x1b6)][_0x155c78(0x159)]['created']),console[_0x155c78(0x1a3)](_0x155c78(0x167)+_0x19fcf1['counts'][_0x155c78(0x13c)]['created']),console[_0x155c78(0x1a3)](_0x155c78(0x14f)+_0x19fcf1['counts'][_0x155c78(0x13d)]['created']),console['log'](_0x155c78(0x156)+_0x19fcf1[_0x155c78(0x1b6)]['formInterfaces']['created']),console[_0x155c78(0x1a3)](_0x155c78(0x177)+_0x19fcf1[_0x155c78(0x1b6)][_0x155c78(0x1e9)]['created']);const _0x2ac7d9=_0x19fcf1['counts']['experimentalKnowledgeBases']['created']>0x0||_0x19fcf1[_0x155c78(0x1b6)][_0x155c78(0x1a7)][_0x155c78(0x1e3)]>0x0;return _0x2ac7d9&&(console[_0x155c78(0x1a3)](_0x155c78(0x1f4)+_0x19fcf1[_0x155c78(0x1b6)][_0x155c78(0x1ec)][_0x155c78(0x1e3)]),console[_0x155c78(0x1a3)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x19fcf1[_0x155c78(0x1b6)][_0x155c78(0x1a7)][_0x155c78(0x1e3)])),0x0;}const _0x44bb0a=_0x19fcf1[_0x155c78(0x1b6)][_0x155c78(0x159)][_0x155c78(0x181)]>0x0||_0x19fcf1[_0x155c78(0x1b6)][_0x155c78(0x13c)]['errors']>0x0||_0x19fcf1['counts'][_0x155c78(0x13d)][_0x155c78(0x181)]>0x0||_0x19fcf1[_0x155c78(0x1b6)][_0x155c78(0x136)][_0x155c78(0x181)]>0x0||_0x19fcf1[_0x155c78(0x1b6)][_0x155c78(0x1e9)][_0x155c78(0x181)]>0x0||_0x19fcf1[_0x155c78(0x1b6)][_0x155c78(0x1ec)][_0x155c78(0x181)]>0x0||_0x19fcf1[_0x155c78(0x1b6)][_0x155c78(0x1a7)][_0x155c78(0x181)]>0x0;_0x44bb0a?console[_0x155c78(0x1a3)](a4_0x45c783['yellow'](_0x155c78(0x178))):console[_0x155c78(0x1a3)](a4_0x45c783[_0x155c78(0x18c)](_0x155c78(0x1eb)));console['log']('Source:\x20'+_0x19fcf1[_0x155c78(0x1ed)]),console[_0x155c78(0x1a3)](_0x155c78(0x198)+_0x19fcf1['newProjectName']),console[_0x155c78(0x1a3)]('New\x20project\x20ID:\x20'+_0x19fcf1[_0x155c78(0x1f8)]),console[_0x155c78(0x1a3)](),console[_0x155c78(0x1a3)](_0x155c78(0x143)),console[_0x155c78(0x1a3)]('\x20\x20Agents:\x20'+formatCountSummary(_0x19fcf1[_0x155c78(0x1b6)][_0x155c78(0x159)])),console[_0x155c78(0x1a3)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x19fcf1[_0x155c78(0x1b6)][_0x155c78(0x13c)])),console[_0x155c78(0x1a3)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x19fcf1[_0x155c78(0x1b6)]['prompts'])),console['log'](_0x155c78(0x194)+formatCountSummary(_0x19fcf1['counts'][_0x155c78(0x176)])),console[_0x155c78(0x1a3)](_0x155c78(0x156)+formatCountSummary(_0x19fcf1['counts']['formInterfaces'])),console[_0x155c78(0x1a3)](_0x155c78(0x177)+formatCountSummary(_0x19fcf1['counts']['chatInterfaces']));const _0x2bdc50=_0x19fcf1['counts'][_0x155c78(0x1ec)][_0x155c78(0x1e3)]>0x0||_0x19fcf1['counts'][_0x155c78(0x1ec)][_0x155c78(0x16c)]>0x0||_0x19fcf1[_0x155c78(0x1b6)][_0x155c78(0x1ec)][_0x155c78(0x1ef)]>0x0||_0x19fcf1[_0x155c78(0x1b6)]['experimentalArtifacts'][_0x155c78(0x1e3)]>0x0||_0x19fcf1[_0x155c78(0x1b6)][_0x155c78(0x1a7)][_0x155c78(0x16c)]>0x0||_0x19fcf1['counts']['experimentalArtifacts'][_0x155c78(0x1ef)]>0x0;_0x2bdc50&&(console[_0x155c78(0x1a3)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x19fcf1['counts'][_0x155c78(0x1ec)])),console[_0x155c78(0x1a3)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x19fcf1['counts'][_0x155c78(0x1a7)])));if(_0x44bb0a){console[_0x155c78(0x1a3)](),console[_0x155c78(0x1a3)](a4_0x45c783[_0x155c78(0x17d)](_0x155c78(0x1a6)));for(const _0x497f84 of _0x19fcf1['agents']){_0x497f84[_0x155c78(0x1d3)]===_0x155c78(0x148)&&console[_0x155c78(0x1a3)](a4_0x45c783[_0x155c78(0x17d)](_0x155c78(0x173)+_0x497f84[_0x155c78(0x1cc)]+_0x155c78(0x1be)+_0x497f84[_0x155c78(0x148)]));}for(const _0x2dd379 of _0x19fcf1[_0x155c78(0x13c)]){_0x2dd379['action']===_0x155c78(0x148)&&console['log'](a4_0x45c783[_0x155c78(0x17d)](_0x155c78(0x160)+_0x2dd379['name']+'\x22:\x20'+_0x2dd379[_0x155c78(0x148)]));}for(const _0x9db3cb of _0x19fcf1[_0x155c78(0x13d)]){_0x9db3cb[_0x155c78(0x1d3)]===_0x155c78(0x148)&&console[_0x155c78(0x1a3)](a4_0x45c783[_0x155c78(0x17d)](_0x155c78(0x180)+_0x9db3cb[_0x155c78(0x1fa)]+'\x22:\x20'+_0x9db3cb[_0x155c78(0x148)]));}for(const _0x304b4e of _0x19fcf1[_0x155c78(0x176)]){_0x304b4e['action']==='error'&&console[_0x155c78(0x1a3)](a4_0x45c783['red'](_0x155c78(0x1fd)+_0x304b4e[_0x155c78(0x1fa)]+_0x155c78(0x1be)+_0x304b4e[_0x155c78(0x148)]));}for(const _0x207d32 of _0x19fcf1[_0x155c78(0x136)]){_0x207d32[_0x155c78(0x1d3)]===_0x155c78(0x148)&&console[_0x155c78(0x1a3)](a4_0x45c783['red'](_0x155c78(0x1d8)+_0x207d32[_0x155c78(0x1fa)]+_0x155c78(0x1be)+_0x207d32['error']));}for(const _0x30cf16 of _0x19fcf1[_0x155c78(0x1e9)]){_0x30cf16[_0x155c78(0x1d3)]==='error'&&console[_0x155c78(0x1a3)](a4_0x45c783[_0x155c78(0x17d)]('\x20\x20Chat\x20Interface\x20\x22'+_0x30cf16['name']+'\x22:\x20'+_0x30cf16['error']));}for(const _0x280e09 of _0x19fcf1[_0x155c78(0x1ec)]){_0x280e09[_0x155c78(0x1d3)]==='error'&&console[_0x155c78(0x1a3)](a4_0x45c783['red']('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x280e09[_0x155c78(0x1fa)]+'\x22:\x20'+_0x280e09[_0x155c78(0x148)]));}for(const _0xcf197e of _0x19fcf1['experimentalArtifacts']){_0xcf197e[_0x155c78(0x1d3)]===_0x155c78(0x148)&&console[_0x155c78(0x1a3)](a4_0x45c783['red'](_0x155c78(0x1de)+_0xcf197e[_0x155c78(0x1fa)]+_0x155c78(0x1be)+_0xcf197e[_0x155c78(0x148)]));}return 0x1;}console[_0x155c78(0x1a3)]();const _0x2b4a8b=getLLMProjectUrl(_0x477f16,_0x19fcf1[_0x155c78(0x1f8)]);return console[_0x155c78(0x1a3)]('Project:\x20'+a4_0x45c783[_0x155c78(0x1e4)](_0x2b4a8b)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x2b11ae(0x1fa)]=a4_0x2b11ae(0x1b4);[a4_0x2b11ae(0x1cf)]=a4_0x2b11ae(0x197);async['execute'](_0x51be2e){const _0xe7947=a4_0x2b11ae,{options:_0x449069,args:_0x81558d,tdx:_0x48c76b}=_0x51be2e;let _0x2a7f79=_0x81558d[0x0]||process[_0xe7947(0x1a8)]();const _0x55abcd=_0x449069[_0xe7947(0x1fb)],_0x16587e=_0x449069[_0xe7947(0x18e)],_0x1ada1b=_0x449069[_0xe7947(0x191)],_0x2d9a86=_0x449069[_0xe7947(0x14e)],_0x5c48e7=a4_0x5ccdf9['join'](_0x2a7f79,_0xe7947(0x157)),_0x129495=existsSync(_0x5c48e7);if(_0x129495){const {data:_0x32e965}=await withSpinner(_0xe7947(0x145)+_0x2a7f79+_0xe7947(0x16d),()=>_0x48c76b[_0xe7947(0x155)][_0xe7947(0x1dd)](_0x2a7f79,{'dryRun':_0x55abcd,'force':_0x16587e}));if(_0x55abcd)return console['log'](a4_0x45c783['yellow'](_0xe7947(0x170))),console['log'](_0xe7947(0x1fc)+_0x32e965[_0xe7947(0x1cc)]),0x0;if(_0x32e965[_0xe7947(0x1d3)]===_0xe7947(0x148))return console['log'](a4_0x45c783[_0xe7947(0x17d)]('Failed\x20to\x20push\x20agent:\x20'+_0x32e965[_0xe7947(0x148)])),0x1;console[_0xe7947(0x1a3)](a4_0x45c783['green'](_0xe7947(0x190)+_0x32e965[_0xe7947(0x1d3)]+_0xe7947(0x13a))),console[_0xe7947(0x1a3)](_0xe7947(0x1e2)+_0x32e965[_0xe7947(0x1cc)]);if(_0x32e965[_0xe7947(0x1aa)]&&_0x32e965[_0xe7947(0x1a2)]){const _0xff86e8=getLLMAgentChatUrl(_0x2d9a86,_0x32e965[_0xe7947(0x1a2)],_0x32e965['agentId']);console[_0xe7947(0x1a3)]('Chat:\x20'+a4_0x45c783[_0xe7947(0x1e4)](_0xff86e8));}return 0x0;}const _0x3360b4=_0x449069[_0xe7947(0x1b0)],_0x3c23ab=resolveProjectFromContext(_0x2a7f79,_0x3360b4);if(_0x3c23ab[_0xe7947(0x1c6)])_0x2a7f79=_0x3c23ab[_0xe7947(0x19e)],_0x3c23ab[_0xe7947(0x1b5)]===_0xe7947(0x140)&&console[_0xe7947(0x1a3)](a4_0x45c783[_0xe7947(0x17a)](_0xe7947(0x1bc)+_0x2a7f79));else{let _0x33f109=_0xe7947(0x1f6);_0x3c23ab[_0xe7947(0x14b)]===_0xe7947(0x189)&&(_0x33f109=_0x3c23ab['message']+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x3c23ab[_0xe7947(0x1b0)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0xe7947(0x1a9)],_0x3c23ab['reason']===_0xe7947(0x18f)?_0x3c23ab[_0xe7947(0x171)]:'No\x20tdx.json\x20found\x20in\x20'+_0x2a7f79,undefined,{'helpText':_0x33f109});}const {data:_0x50c5a7}=await withSpinner(_0xe7947(0x14c),()=>_0x48c76b[_0xe7947(0x155)][_0xe7947(0x1c2)](_0x2a7f79,{'dryRun':!![]})),_0x29c3df=_0x50c5a7[_0xe7947(0x1b6)]['agents'][_0xe7947(0x181)]>0x0;if(_0x29c3df){console[_0xe7947(0x1a3)](a4_0x45c783[_0xe7947(0x17d)](_0xe7947(0x1b3)));for(const _0x2eba1b of _0x50c5a7[_0xe7947(0x159)]){_0x2eba1b[_0xe7947(0x1d3)]==='error'&&console[_0xe7947(0x1a3)](a4_0x45c783[_0xe7947(0x17d)]('\x20\x20Agent\x20\x22'+_0x2eba1b['agentName']+'\x22:\x20'+_0x2eba1b[_0xe7947(0x148)]));}return 0x1;}const _0x2cdf11=_0x50c5a7[_0xe7947(0x1b6)][_0xe7947(0x159)][_0xe7947(0x1e3)]+_0x50c5a7['counts'][_0xe7947(0x13c)][_0xe7947(0x1e3)]+_0x50c5a7['counts']['textKnowledgeBases'][_0xe7947(0x1e3)]+_0x50c5a7[_0xe7947(0x1b6)][_0xe7947(0x13d)]['created']+_0x50c5a7[_0xe7947(0x1b6)][_0xe7947(0x176)][_0xe7947(0x1e3)]+_0x50c5a7['counts'][_0xe7947(0x1ec)][_0xe7947(0x1e3)]+_0x50c5a7['counts'][_0xe7947(0x1a7)][_0xe7947(0x1e3)]+_0x50c5a7[_0xe7947(0x1b6)][_0xe7947(0x136)][_0xe7947(0x1e3)]+_0x50c5a7[_0xe7947(0x1b6)]['chatInterfaces']['created'],_0x1761c7=_0x50c5a7[_0xe7947(0x1b6)][_0xe7947(0x159)][_0xe7947(0x16c)]+_0x50c5a7[_0xe7947(0x1b6)][_0xe7947(0x13c)][_0xe7947(0x16c)]+_0x50c5a7['counts'][_0xe7947(0x199)][_0xe7947(0x16c)]+_0x50c5a7[_0xe7947(0x1b6)][_0xe7947(0x13d)][_0xe7947(0x16c)]+_0x50c5a7[_0xe7947(0x1b6)][_0xe7947(0x176)][_0xe7947(0x16c)]+_0x50c5a7['counts'][_0xe7947(0x1ec)][_0xe7947(0x16c)]+_0x50c5a7['counts'][_0xe7947(0x1a7)]['updated']+_0x50c5a7[_0xe7947(0x1b6)][_0xe7947(0x136)][_0xe7947(0x16c)]+_0x50c5a7[_0xe7947(0x1b6)]['chatInterfaces']['updated'],_0x21e531=_0x50c5a7[_0xe7947(0x1b6)][_0xe7947(0x159)][_0xe7947(0x1ef)]+_0x50c5a7[_0xe7947(0x1b6)]['knowledgeBases'][_0xe7947(0x1ef)]+_0x50c5a7[_0xe7947(0x1b6)][_0xe7947(0x199)][_0xe7947(0x1ef)]+_0x50c5a7[_0xe7947(0x1b6)][_0xe7947(0x13d)]['unchanged']+_0x50c5a7[_0xe7947(0x1b6)][_0xe7947(0x176)][_0xe7947(0x1ef)]+_0x50c5a7[_0xe7947(0x1b6)]['experimentalKnowledgeBases'][_0xe7947(0x1ef)]+_0x50c5a7[_0xe7947(0x1b6)][_0xe7947(0x1a7)]['unchanged']+_0x50c5a7[_0xe7947(0x1b6)]['formInterfaces'][_0xe7947(0x1ef)]+_0x50c5a7['counts']['chatInterfaces'][_0xe7947(0x1ef)];console[_0xe7947(0x1a3)](_0xe7947(0x1e1)+_0x50c5a7[_0xe7947(0x150)]+'\x27:'),console[_0xe7947(0x1a3)]('\x20\x20'+a4_0x45c783[_0xe7947(0x18c)]('+\x20'+_0x2cdf11+'\x20new')+_0xe7947(0x15c)+a4_0x45c783[_0xe7947(0x139)]('~\x20'+_0x1761c7+_0xe7947(0x1db))+_0xe7947(0x15c)+a4_0x45c783[_0xe7947(0x17a)]('=\x20'+_0x21e531+_0xe7947(0x19f))),console['log'](_0xe7947(0x1d0)+formatCountSummary(_0x50c5a7[_0xe7947(0x1b6)][_0xe7947(0x159)])),console[_0xe7947(0x1a3)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x50c5a7['counts'][_0xe7947(0x13c)])),console[_0xe7947(0x1a3)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x50c5a7['counts'][_0xe7947(0x199)])),console[_0xe7947(0x1a3)](_0xe7947(0x14f)+formatCountSummary(_0x50c5a7[_0xe7947(0x1b6)][_0xe7947(0x13d)])),console['log'](_0xe7947(0x194)+formatCountSummary(_0x50c5a7[_0xe7947(0x1b6)]['integrations'])),console[_0xe7947(0x1a3)](_0xe7947(0x156)+formatCountSummary(_0x50c5a7['counts'][_0xe7947(0x136)])),console[_0xe7947(0x1a3)](_0xe7947(0x177)+formatCountSummary(_0x50c5a7[_0xe7947(0x1b6)][_0xe7947(0x1e9)]));const _0x598320=_0x50c5a7[_0xe7947(0x1b6)][_0xe7947(0x1ec)]['created']>0x0||_0x50c5a7[_0xe7947(0x1b6)][_0xe7947(0x1ec)]['updated']>0x0||_0x50c5a7[_0xe7947(0x1b6)][_0xe7947(0x1ec)][_0xe7947(0x1ef)]>0x0||_0x50c5a7[_0xe7947(0x1b6)][_0xe7947(0x1a7)][_0xe7947(0x1e3)]>0x0||_0x50c5a7[_0xe7947(0x1b6)][_0xe7947(0x1a7)]['updated']>0x0||_0x50c5a7[_0xe7947(0x1b6)][_0xe7947(0x1a7)]['unchanged']>0x0;_0x598320&&(console[_0xe7947(0x1a3)](_0xe7947(0x1f4)+formatCountSummary(_0x50c5a7[_0xe7947(0x1b6)]['experimentalKnowledgeBases'])),console['log'](_0xe7947(0x192)+formatCountSummary(_0x50c5a7[_0xe7947(0x1b6)][_0xe7947(0x1a7)])));console[_0xe7947(0x1a3)](_0xe7947(0x1dc)+a4_0x45c783['cyan'](_0x2a7f79)),displayDiffs(_0x50c5a7[_0xe7947(0x159)],_0x50c5a7[_0xe7947(0x13c)],_0x50c5a7[_0xe7947(0x199)],_0x50c5a7[_0xe7947(0x13d)],_0x50c5a7[_0xe7947(0x176)],_0x50c5a7['experimentalKnowledgeBases'],_0x50c5a7[_0xe7947(0x1a7)],_0x50c5a7[_0xe7947(0x136)],_0x50c5a7[_0xe7947(0x1e9)]);if(_0x55abcd)return console[_0xe7947(0x1a3)](a4_0x45c783[_0xe7947(0x139)](_0xe7947(0x195))),0x0;if(_0x2cdf11===0x0&&_0x1761c7===0x0){console['log'](a4_0x45c783[_0xe7947(0x18c)](_0xe7947(0x193)));const _0x2f5aa3=getLLMProjectUrl(_0x2d9a86,_0x50c5a7[_0xe7947(0x1a2)]);return console[_0xe7947(0x1a3)](_0xe7947(0x1e6)+a4_0x45c783[_0xe7947(0x1e4)](_0x2f5aa3)),0x0;}if(!_0x1ada1b&&!_0x16587e){if(!isInteractive())return console[_0xe7947(0x148)](a4_0x45c783['red'](_0xe7947(0x134)),_0xe7947(0x1f3)),console[_0xe7947(0x148)](a4_0x45c783['dim'](_0xe7947(0x153))),0x1;const _0x4940a2=await confirmKey(_0xe7947(0x13b)+(_0x2cdf11+_0x1761c7)+_0xe7947(0x19b));if(!_0x4940a2)return console[_0xe7947(0x1a3)](a4_0x45c783[_0xe7947(0x139)](_0xe7947(0x1d1)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x3cf580}=await withSpinner('Pushing\x20to\x20project...',()=>_0x48c76b[_0xe7947(0x155)][_0xe7947(0x1c2)](_0x2a7f79,{'force':_0x16587e})),_0x418386=_0x3cf580['counts'][_0xe7947(0x159)][_0xe7947(0x181)]>0x0||_0x3cf580[_0xe7947(0x1b6)][_0xe7947(0x13c)]['errors']>0x0||_0x3cf580['counts'][_0xe7947(0x199)]['errors']>0x0||_0x3cf580[_0xe7947(0x1b6)][_0xe7947(0x13d)]['errors']>0x0||_0x3cf580['counts']['formInterfaces']['errors']>0x0||_0x3cf580['counts'][_0xe7947(0x1e9)][_0xe7947(0x181)]>0x0;if(_0x418386){console[_0xe7947(0x1a3)](a4_0x45c783['yellow'](_0xe7947(0x1ad))),console['log'](),console['log'](a4_0x45c783[_0xe7947(0x17d)](_0xe7947(0x1a6)));for(const _0x5caa77 of _0x3cf580[_0xe7947(0x159)]){_0x5caa77[_0xe7947(0x1d3)]===_0xe7947(0x148)&&console[_0xe7947(0x1a3)](a4_0x45c783[_0xe7947(0x17d)]('\x20\x20Agent\x20\x22'+_0x5caa77['agentName']+_0xe7947(0x1be)+_0x5caa77[_0xe7947(0x148)]));}for(const _0x5c4046 of _0x3cf580[_0xe7947(0x13c)]){_0x5c4046['action']===_0xe7947(0x148)&&console['log'](a4_0x45c783[_0xe7947(0x17d)](_0xe7947(0x160)+_0x5c4046[_0xe7947(0x1fa)]+_0xe7947(0x1be)+_0x5c4046[_0xe7947(0x148)]));}for(const _0x1c29bc of _0x3cf580[_0xe7947(0x199)]){_0x1c29bc['action']===_0xe7947(0x148)&&console[_0xe7947(0x1a3)](a4_0x45c783['red'](_0xe7947(0x172)+_0x1c29bc[_0xe7947(0x1fa)]+_0xe7947(0x1be)+_0x1c29bc[_0xe7947(0x148)]));}for(const _0x28d621 of _0x3cf580['prompts']){_0x28d621[_0xe7947(0x1d3)]===_0xe7947(0x148)&&console['log'](a4_0x45c783[_0xe7947(0x17d)](_0xe7947(0x180)+_0x28d621[_0xe7947(0x1fa)]+_0xe7947(0x1be)+_0x28d621[_0xe7947(0x148)]));}for(const _0x10a3a1 of _0x3cf580[_0xe7947(0x176)]){_0x10a3a1[_0xe7947(0x1d3)]==='error'&&console[_0xe7947(0x1a3)](a4_0x45c783['red'](_0xe7947(0x1fd)+_0x10a3a1[_0xe7947(0x1fa)]+_0xe7947(0x1be)+_0x10a3a1['error']));}for(const _0x21a105 of _0x3cf580[_0xe7947(0x136)]){_0x21a105['action']===_0xe7947(0x148)&&console[_0xe7947(0x1a3)](a4_0x45c783[_0xe7947(0x17d)](_0xe7947(0x1d8)+_0x21a105[_0xe7947(0x1fa)]+_0xe7947(0x1be)+_0x21a105[_0xe7947(0x148)]));}for(const _0x2e62c7 of _0x3cf580[_0xe7947(0x1e9)]){_0x2e62c7['action']==='error'&&console[_0xe7947(0x1a3)](a4_0x45c783[_0xe7947(0x17d)]('\x20\x20Chat\x20Interface\x20\x22'+_0x2e62c7[_0xe7947(0x1fa)]+_0xe7947(0x1be)+_0x2e62c7[_0xe7947(0x148)]));}return 0x1;}console[_0xe7947(0x1a3)](a4_0x45c783[_0xe7947(0x18c)](_0xe7947(0x17b)+(_0x2cdf11+_0x1761c7)+_0xe7947(0x13f)+_0x3cf580[_0xe7947(0x150)]+'\x27'));const _0x4cd2ca=getLLMProjectUrl(_0x2d9a86,_0x3cf580[_0xe7947(0x1a2)]);return console[_0xe7947(0x1a3)](_0xe7947(0x1e6)+a4_0x45c783[_0xe7947(0x1e4)](_0x4cd2ca)),0x0;}}
1
+ const a4_0x199530=a4_0x53e7;function a4_0x36eb(){const _0x1a9a6c=['name','agent:push','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','pushProject','✔\x20Context\x20set:\x20','\x20\x20Form\x20Interfaces:\x20','projectDir','\x0aErrors\x20found:','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','No\x20tdx.json\x20found\x20in\x20','agents','\x0aPush\x20summary\x20for\x20\x27','yellow','llm_project','\x20\x20Form\x20Interface\x20\x22','Cloning\x20\x22','\x22...','found','\x20created','outputDir','counts','push','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','cyan','\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)','\x20new','repeat','yes','Cancelled','\x0aChanges\x20to\x20agent\x20\x27','Agent\x20pulled\x20successfully','Would\x20pull\x20agent:\x20','\x0aChanges\x20to\x20form\x20interface\x20\x27','sourceProjectName','\x0aChanges\x20to\x20integration\x20\x27','integrations','\x20\x20Chat\x20Interfaces:\x20','newProjectId','join','prompts','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','source','\x0aPull\x20summary\x20for\x20\x27','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x20resources\x20to\x20\x27','llmProject','\x20\x20Knowledge\x20Bases:\x20','Status:\x20','Failed\x20to\x20push\x20agent:\x20','\x20\x20Prompt\x20\x22','created','reason','agentName','\x20\x20Agent\x20\x22','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','diff','utf-8','New\x20project:\x20','Using\x20project\x20from\x20','\x20unchanged','description','Pushing\x20agent\x20from\x20\x22','Pulling\x20agent\x20\x22','Dry\x20run\x20-\x20no\x20files\x20written','7676720WARfPB','390DghAxa','\x20\x20Integrations:\x20','agentId','textKnowledgeBases','context','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Project\x20cloned\x20successfully','\x0aChanges:','formInterfaces','\x0aProject\x20pushed\x20with\x20errors','\x20updated','\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','\x20\x20Prompts:\x20','site','Output:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','5351988oJdibc','no_local_folder','Project:\x20','profile','total','force','\x20\x20Chat\x20Interface\x20\x22','263842TkRuIH','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','new','parse','experimentalArtifacts','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','updated','\x0aPush\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','Using\x20local\x20project:\x20','errors','Agent:\x20','99aKGZqM','dirname','9002154ZQFeYF','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x27\x20to\x20create\x20the\x20folder\x20structure.','Using\x20project:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20\x20tdx\x20agent\x20pull\x20','\x20|\x20','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','error','execute','green','Summary:','\x20successfully','\x20=\x20','\x20\x20Knowledge\x20Base\x20\x22','\x20files?','dim','projectId','Using\x20project\x20from\x20context:\x20','\x20\x20Agents:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','message','Output\x20path:\x20','New\x20project\x20ID:\x20','experimentalKnowledgeBases','Using\x20context\x20project:\x20','llm','Agent\x20','\x0a✔\x20Pushed\x20','Errors:','unchanged','hasChanges','\x22:\x20','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','\x20\x20Experimental\x20Artifact\x20\x22','Source:\x20','-\x20no\x20files\x20written','Analyzing\x20changes\x20to\x20push...','tdx.json','\x20changed','-\x20nothing\x20pushed','\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','INVALID_ARGUMENT','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','Would\x20clone:','action','chatInterfaces','outputPath','\x20files\x20to\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','log','\x20\x20Integration\x20\x22','<new-name>','pullProject','Analyzing\x20project\x20\x22','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Text\x20Knowledge\x20Base\x20\x22','red','agent:pull','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','dryRun','\x0aWrite\x20','newProjectName','30572sBOkcI','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20\x20Experimental\x20Artifacts:\x20','1537563BtbNFP','Writing\x20files...','\x22\x20from\x20project\x20\x22','\x0aChanges\x20to\x20chat\x20interface\x20\x27','cwd','arg-dir','3445180CIOswC','\x0aError:','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','agent','Project\x20cloned\x20with\x20errors','projectName','\x20--name\x20','knowledgeBases','Dry\x20run\x20-\x20no\x20changes\x20made','2NVOkaU'];a4_0x36eb=function(){return _0x1a9a6c;};return a4_0x36eb();}(function(_0x191aa5,_0x3dbaad){const _0x2c4652=a4_0x53e7,_0x1e0031=_0x191aa5();while(!![]){try{const _0x3c13c9=parseInt(_0x2c4652(0x1aa))/0x1+-parseInt(_0x2c4652(0x20a))/0x2*(-parseInt(_0x2c4652(0x1fb))/0x3)+-parseInt(_0x2c4652(0x1f8))/0x4*(-parseInt(_0x2c4652(0x192))/0x5)+parseInt(_0x2c4652(0x1a3))/0x6+parseInt(_0x2c4652(0x1b8))/0x7+parseInt(_0x2c4652(0x191))/0x8+-parseInt(_0x2c4652(0x1b6))/0x9*(parseInt(_0x2c4652(0x201))/0xa);if(_0x3c13c9===_0x3dbaad)break;else _0x1e0031['push'](_0x1e0031['shift']());}catch(_0x307b85){_0x1e0031['push'](_0x1e0031['shift']());}}}(a4_0x36eb,0xafe2d));import a4_0x4e69c3 from'chalk';import a4_0x159861 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';function a4_0x53e7(_0x38a947,_0x4dc51b){_0x38a947=_0x38a947-0x177;const _0x36ebf5=a4_0x36eb();let _0x53e774=_0x36ebf5[_0x38a947];return _0x53e774;}import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x318c1c){const _0x43e801=a4_0x53e7,_0x46b4a3=[];if(_0x318c1c['total']!==undefined)_0x46b4a3[_0x43e801(0x220)](_0x318c1c[_0x43e801(0x1a7)]+'\x20total');if(_0x318c1c['new']!==undefined&&_0x318c1c[_0x43e801(0x1ac)]>0x0)_0x46b4a3[_0x43e801(0x220)](a4_0x4e69c3[_0x43e801(0x1c3)](_0x318c1c[_0x43e801(0x1ac)]+_0x43e801(0x224)));if(_0x318c1c['created']!==undefined&&_0x318c1c[_0x43e801(0x183)]>0x0)_0x46b4a3[_0x43e801(0x220)](a4_0x4e69c3[_0x43e801(0x1c3)](_0x318c1c[_0x43e801(0x183)]+_0x43e801(0x21d)));if(_0x318c1c[_0x43e801(0x1b0)]!==undefined&&_0x318c1c['updated']>0x0)_0x46b4a3[_0x43e801(0x220)](a4_0x4e69c3[_0x43e801(0x217)](_0x318c1c[_0x43e801(0x1b0)]+_0x43e801(0x19d)));if(_0x318c1c[_0x43e801(0x1d7)]!==undefined&&_0x318c1c[_0x43e801(0x1d7)]>0x0)_0x46b4a3['push'](a4_0x4e69c3['gray'](_0x318c1c[_0x43e801(0x1d7)]+_0x43e801(0x18c)));if(_0x318c1c['errors']!==undefined&&_0x318c1c[_0x43e801(0x1b4)]>0x0)_0x46b4a3[_0x43e801(0x220)](a4_0x4e69c3[_0x43e801(0x1f2)](_0x318c1c[_0x43e801(0x1b4)]+'\x20errors'));return _0x46b4a3['join'](',\x20');}function displayDiffs(_0x1d3374,_0x4019e8,_0xe68a66,_0x59e2d2,_0x4479f4,_0x378f8e,_0x5bd859,_0x272529,_0x4484b3){const _0x4f9c3c=a4_0x53e7;for(const _0x4b423f of _0x1d3374){if(_0x4b423f[_0x4f9c3c(0x188)]){const _0x2532d8=_0x4b423f[_0x4f9c3c(0x185)]||_0x4b423f[_0x4f9c3c(0x20b)];console[_0x4f9c3c(0x1eb)](_0x4f9c3c(0x228)+_0x2532d8+'\x27:'),console[_0x4f9c3c(0x1eb)]('─'[_0x4f9c3c(0x225)](0x3c)),console[_0x4f9c3c(0x1eb)](_0x4b423f[_0x4f9c3c(0x188)]),console[_0x4f9c3c(0x1eb)]('─'[_0x4f9c3c(0x225)](0x3c));}}for(const _0x4fb3ef of _0x4019e8){_0x4fb3ef[_0x4f9c3c(0x188)]&&(console[_0x4f9c3c(0x1eb)](_0x4f9c3c(0x198)+_0x4fb3ef['name']+'\x27:'),console[_0x4f9c3c(0x1eb)]('─'['repeat'](0x3c)),console[_0x4f9c3c(0x1eb)](_0x4fb3ef[_0x4f9c3c(0x188)]),console[_0x4f9c3c(0x1eb)]('─'[_0x4f9c3c(0x225)](0x3c)));}for(const _0xe65090 of _0xe68a66){_0xe65090[_0x4f9c3c(0x188)]&&(console[_0x4f9c3c(0x1eb)](_0x4f9c3c(0x1a2)+_0xe65090[_0x4f9c3c(0x20b)]+'\x27:'),console[_0x4f9c3c(0x1eb)]('─'[_0x4f9c3c(0x225)](0x3c)),console[_0x4f9c3c(0x1eb)](_0xe65090[_0x4f9c3c(0x188)]),console[_0x4f9c3c(0x1eb)]('─'[_0x4f9c3c(0x225)](0x3c)));}for(const _0x1d0a63 of _0x59e2d2){_0x1d0a63[_0x4f9c3c(0x188)]&&(console[_0x4f9c3c(0x1eb)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x1d0a63[_0x4f9c3c(0x20b)]+'\x27:'),console[_0x4f9c3c(0x1eb)]('─'[_0x4f9c3c(0x225)](0x3c)),console[_0x4f9c3c(0x1eb)](_0x1d0a63[_0x4f9c3c(0x188)]),console['log']('─'[_0x4f9c3c(0x225)](0x3c)));}for(const _0x4150e0 of _0x4479f4){_0x4150e0[_0x4f9c3c(0x188)]&&(console[_0x4f9c3c(0x1eb)](_0x4f9c3c(0x22d)+_0x4150e0[_0x4f9c3c(0x20b)]+'\x27:'),console[_0x4f9c3c(0x1eb)]('─'['repeat'](0x3c)),console[_0x4f9c3c(0x1eb)](_0x4150e0[_0x4f9c3c(0x188)]),console['log']('─'[_0x4f9c3c(0x225)](0x3c)));}for(const _0x18fd81 of _0x378f8e){_0x18fd81[_0x4f9c3c(0x188)]&&(console['log']('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x18fd81['name']+'\x27:'),console[_0x4f9c3c(0x1eb)]('─'['repeat'](0x3c)),console[_0x4f9c3c(0x1eb)](_0x18fd81['diff']),console[_0x4f9c3c(0x1eb)]('─'[_0x4f9c3c(0x225)](0x3c)));}for(const _0x492aac of _0x5bd859){_0x492aac['diff']&&(console[_0x4f9c3c(0x1eb)](_0x4f9c3c(0x187)+_0x492aac['name']+'\x27:'),console[_0x4f9c3c(0x1eb)]('─'[_0x4f9c3c(0x225)](0x3c)),console[_0x4f9c3c(0x1eb)](_0x492aac[_0x4f9c3c(0x188)]),console[_0x4f9c3c(0x1eb)]('─'['repeat'](0x3c)));}for(const _0x3e53e5 of _0x272529){_0x3e53e5['diff']&&(console[_0x4f9c3c(0x1eb)](_0x4f9c3c(0x22b)+_0x3e53e5[_0x4f9c3c(0x20b)]+'\x27:'),console['log']('─'[_0x4f9c3c(0x225)](0x3c)),console[_0x4f9c3c(0x1eb)](_0x3e53e5[_0x4f9c3c(0x188)]),console[_0x4f9c3c(0x1eb)]('─'[_0x4f9c3c(0x225)](0x3c)));}for(const _0x46873a of _0x4484b3){_0x46873a['diff']&&(console['log'](_0x4f9c3c(0x1fe)+_0x46873a[_0x4f9c3c(0x20b)]+'\x27:'),console[_0x4f9c3c(0x1eb)]('─'[_0x4f9c3c(0x225)](0x3c)),console[_0x4f9c3c(0x1eb)](_0x46873a[_0x4f9c3c(0x188)]),console[_0x4f9c3c(0x1eb)]('─'[_0x4f9c3c(0x225)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x199530(0x20b)]=a4_0x199530(0x1f3);[a4_0x199530(0x18d)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async['execute'](_0x11cf07){const _0xff20da=a4_0x199530,{options:_0x23c072,args:_0x7435ed,tdx:_0x53aa24}=_0x11cf07,_0x145558=_0x7435ed[0x0],_0x506e76=_0x7435ed[0x1],_0x2616cd=_0x23c072['output'],_0x300167=_0x23c072[_0xff20da(0x1f5)],_0x577621=_0x23c072[_0xff20da(0x1a8)],_0x321ad7=_0x23c072['yes'],_0x34f5a7=_0x23c072[_0xff20da(0x17e)],_0x1b1bb6=_0x23c072[_0xff20da(0x204)];let _0x9ca064;if(_0x145558){const _0x1de510=a4_0x159861[_0xff20da(0x177)](_0x145558,'tdx.json');if(existsSync(_0x1de510))try{const _0x59e722=JSON[_0xff20da(0x1ad)](readFileSync(_0x1de510,_0xff20da(0x189)));_0x59e722[_0xff20da(0x218)]&&(_0x9ca064={'llm_project':_0x59e722[_0xff20da(0x218)]});}catch{}}const _0x3d7d54=findAgentConfigPath(process['cwd']());let _0x16ecee;if(_0x3d7d54)try{const _0x36481f=JSON[_0xff20da(0x1ad)](readFileSync(_0x3d7d54,_0xff20da(0x189)));_0x36481f[_0xff20da(0x218)]&&(_0x16ecee={'llm_project':_0x36481f[_0xff20da(0x218)]});}catch{}const _0xdcd62f=resolveAgentPullArgs({'arg':_0x145558,'agentNameArg':_0x506e76,'agentFlag':_0x1b1bb6,'contextProject':_0x34f5a7,'argDirConfig':_0x9ca064,'cwdConfigPath':_0x3d7d54||undefined,'cwdConfig':_0x16ecee}),{projectNameOrId:_0x5e410f,targetAgentName:_0x2060a1,existingOutputDir:_0x7f88e9,source:_0xfe67f6}=_0xdcd62f;if(_0xfe67f6===_0xff20da(0x200))console[_0xff20da(0x1eb)](a4_0x4e69c3[_0xff20da(0x1c9)](_0xff20da(0x18b)+a4_0x159861[_0xff20da(0x177)](_0x145558,_0xff20da(0x1df))+':\x20'+_0x5e410f));else{if(_0xfe67f6==='cwd-config')console[_0xff20da(0x1eb)](a4_0x4e69c3['dim'](_0xff20da(0x1bb)+_0x5e410f));else _0xfe67f6==='context'&&console[_0xff20da(0x1eb)](a4_0x4e69c3[_0xff20da(0x1c9)](_0xff20da(0x1cb)+_0x5e410f));}if(!_0x5e410f)return _0x1b1bb6?(console[_0xff20da(0x1eb)](a4_0x4e69c3['yellow'](_0xff20da(0x17c))),console[_0xff20da(0x1eb)](_0xff20da(0x1f0)),console[_0xff20da(0x1eb)](_0xff20da(0x1e4))):(console[_0xff20da(0x1eb)](a4_0x4e69c3[_0xff20da(0x217)](_0xff20da(0x1cd))),console[_0xff20da(0x1eb)](_0xff20da(0x1da)),console[_0xff20da(0x1eb)](_0xff20da(0x1b2)),console[_0xff20da(0x1eb)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console['log'](_0xff20da(0x1e2)),console[_0xff20da(0x1eb)](_0xff20da(0x19e))),0x1;if(_0x2060a1){const {data:_0x1e27be}=await withSpinner(_0xff20da(0x18f)+_0x2060a1+_0xff20da(0x1fd)+_0x5e410f+_0xff20da(0x21b),()=>_0x53aa24[_0xff20da(0x1d3)]['pullAgent'](_0x5e410f,_0x2060a1,_0x2616cd,{'dryRun':_0x300167,'force':_0x577621}));if(_0x300167)return console[_0xff20da(0x1eb)](a4_0x4e69c3[_0xff20da(0x217)](_0xff20da(0x190))),console[_0xff20da(0x1eb)](_0xff20da(0x22a)+_0x1e27be['agentName']),console['log'](_0xff20da(0x1cf)+_0x1e27be['outputPath']),_0x1e27be[_0xff20da(0x188)]&&(console[_0xff20da(0x1eb)](_0xff20da(0x19a)),console[_0xff20da(0x1eb)]('─'[_0xff20da(0x225)](0x3c)),console[_0xff20da(0x1eb)](_0x1e27be[_0xff20da(0x188)]),console[_0xff20da(0x1eb)]('─'[_0xff20da(0x225)](0x3c))),0x0;return console[_0xff20da(0x1eb)](a4_0x4e69c3['green'](_0xff20da(0x229))),console['log'](_0xff20da(0x1b5)+_0x1e27be[_0xff20da(0x185)]),console['log'](_0xff20da(0x1a1)+_0x1e27be[_0xff20da(0x1e8)]),console[_0xff20da(0x1eb)](_0xff20da(0x180)+(_0x1e27be['isNew']?a4_0x4e69c3[_0xff20da(0x1c3)](_0xff20da(0x1ac)):_0x1e27be[_0xff20da(0x1d8)]?a4_0x4e69c3[_0xff20da(0x217)](_0xff20da(0x1b0)):a4_0x4e69c3['gray'](_0xff20da(0x1d7)))),0x0;}const _0x367c7a=_0x7f88e9||_0x2616cd,{data:_0x5ce92c}=await withSpinner(_0xff20da(0x1ef)+_0x5e410f+'\x22...',()=>_0x53aa24[_0xff20da(0x1d3)][_0xff20da(0x1ee)](_0x5e410f,_0x367c7a,{'dryRun':!![]})),_0x2bc41d=_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x215)][_0xff20da(0x1ac)]+_0x5ce92c[_0xff20da(0x21f)]['knowledgeBases'][_0xff20da(0x1ac)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x195)][_0xff20da(0x1ac)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x178)][_0xff20da(0x1ac)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x22e)][_0xff20da(0x1ac)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x1d1)]['new']+_0x5ce92c['counts'][_0xff20da(0x1ae)][_0xff20da(0x1ac)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x19b)][_0xff20da(0x1ac)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x1e7)][_0xff20da(0x1ac)],_0x282c89=_0x5ce92c[_0xff20da(0x21f)]['agents'][_0xff20da(0x1b0)]+_0x5ce92c[_0xff20da(0x21f)]['knowledgeBases'][_0xff20da(0x1b0)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x195)][_0xff20da(0x1b0)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x178)][_0xff20da(0x1b0)]+_0x5ce92c[_0xff20da(0x21f)]['integrations'][_0xff20da(0x1b0)]+_0x5ce92c[_0xff20da(0x21f)]['experimentalKnowledgeBases'][_0xff20da(0x1b0)]+_0x5ce92c[_0xff20da(0x21f)]['experimentalArtifacts'][_0xff20da(0x1b0)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x19b)][_0xff20da(0x1b0)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x1e7)][_0xff20da(0x1b0)],_0xf8d98d=_0x5ce92c['counts'][_0xff20da(0x215)][_0xff20da(0x1d7)]+_0x5ce92c[_0xff20da(0x21f)]['knowledgeBases'][_0xff20da(0x1d7)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x195)][_0xff20da(0x1d7)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x178)][_0xff20da(0x1d7)]+_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x22e)][_0xff20da(0x1d7)]+_0x5ce92c['counts'][_0xff20da(0x1d1)][_0xff20da(0x1d7)]+_0x5ce92c['counts'][_0xff20da(0x1ae)][_0xff20da(0x1d7)]+_0x5ce92c[_0xff20da(0x21f)]['formInterfaces'][_0xff20da(0x1d7)]+_0x5ce92c[_0xff20da(0x21f)]['chatInterfaces']['unchanged'];console[_0xff20da(0x1eb)](_0xff20da(0x17b)+_0x5ce92c[_0xff20da(0x206)]+'\x27:'),console[_0xff20da(0x1eb)]('\x20\x20'+a4_0x4e69c3[_0xff20da(0x1c3)]('+\x20'+_0x2bc41d+'\x20new')+_0xff20da(0x1be)+a4_0x4e69c3[_0xff20da(0x217)]('~\x20'+_0x282c89+_0xff20da(0x1e0))+_0xff20da(0x1be)+a4_0x4e69c3[_0xff20da(0x1c9)]('=\x20'+_0xf8d98d+_0xff20da(0x18c))),console[_0xff20da(0x1eb)]('\x20\x20Agents:\x20'+formatCountSummary(_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x215)])),console[_0xff20da(0x1eb)](_0xff20da(0x17f)+formatCountSummary(_0x5ce92c['counts'][_0xff20da(0x208)])),console[_0xff20da(0x1eb)](_0xff20da(0x1bf)+formatCountSummary(_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x195)])),console[_0xff20da(0x1eb)](_0xff20da(0x19f)+formatCountSummary(_0x5ce92c['counts'][_0xff20da(0x178)])),console['log'](_0xff20da(0x193)+formatCountSummary(_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x22e)])),console[_0xff20da(0x1eb)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x19b)])),console['log']('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x1e7)]));const _0x347d06=_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x1d1)][_0xff20da(0x1a7)]>0x0||_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x1ae)]['total']>0x0;_0x347d06&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x1d1)])),console[_0xff20da(0x1eb)](_0xff20da(0x1fa)+formatCountSummary(_0x5ce92c[_0xff20da(0x21f)][_0xff20da(0x1ae)])));console[_0xff20da(0x1eb)]('\x20\x20Target:\x20'+a4_0x4e69c3[_0xff20da(0x222)](_0x5ce92c[_0xff20da(0x21e)])),displayDiffs(_0x5ce92c[_0xff20da(0x215)],_0x5ce92c[_0xff20da(0x208)],_0x5ce92c[_0xff20da(0x195)],_0x5ce92c[_0xff20da(0x178)],_0x5ce92c[_0xff20da(0x22e)],_0x5ce92c[_0xff20da(0x1d1)],_0x5ce92c[_0xff20da(0x1ae)],_0x5ce92c[_0xff20da(0x19b)],_0x5ce92c[_0xff20da(0x1e7)]);if(_0x300167)return console['log'](a4_0x4e69c3['yellow'](_0xff20da(0x1bc))),0x0;if(_0x2bc41d===0x0&&_0x282c89===0x0)return console[_0xff20da(0x1eb)](a4_0x4e69c3[_0xff20da(0x1c3)](_0xff20da(0x1c0))),saveSessionContext({'llm_project':_0x5ce92c['projectName']},_0x23c072['session']),console['log'](a4_0x4e69c3['green'](_0xff20da(0x20f)+a4_0x4e69c3[_0xff20da(0x1c9)]('llm_project')+'\x20=\x20'+a4_0x4e69c3[_0xff20da(0x222)](_0x5ce92c['projectName']))),0x0;if(!_0x321ad7&&!_0x577621){if(!isInteractive())return console[_0xff20da(0x1c1)](a4_0x4e69c3[_0xff20da(0x1f2)]('\x0aError:'),_0xff20da(0x1b9)),console[_0xff20da(0x1c1)](a4_0x4e69c3['dim'](_0xff20da(0x197))),0x1;const _0x1e0499=await confirmKey(_0xff20da(0x1f6)+(_0x2bc41d+_0x282c89)+_0xff20da(0x1c8));if(!_0x1e0499)return console[_0xff20da(0x1eb)](a4_0x4e69c3[_0xff20da(0x217)]('Cancelled'),_0xff20da(0x1dd)),0x1;}const {data:_0x14fd91}=await withSpinner(_0xff20da(0x1fc),()=>_0x53aa24[_0xff20da(0x1d3)][_0xff20da(0x1ee)](_0x5e410f,_0x367c7a,{'force':_0x577621}));return console[_0xff20da(0x1eb)](a4_0x4e69c3[_0xff20da(0x1c3)]('\x0a✔\x20Pulled\x20'+(_0x2bc41d+_0x282c89)+_0xff20da(0x1e9)+_0x14fd91[_0xff20da(0x21e)])),saveSessionContext({'llm_project':_0x14fd91[_0xff20da(0x206)]},_0x23c072['session']),console[_0xff20da(0x1eb)](a4_0x4e69c3[_0xff20da(0x1c3)](_0xff20da(0x20f)+a4_0x4e69c3[_0xff20da(0x1c9)](_0xff20da(0x218))+_0xff20da(0x1c6)+a4_0x4e69c3['cyan'](_0x14fd91[_0xff20da(0x206)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x199530(0x20b)]='agent:clone';[a4_0x199530(0x18d)]=a4_0x199530(0x203);async[a4_0x199530(0x1c2)](_0x15fdea){const _0x4084d9=a4_0x199530,{options:_0x4fa235,args:_0x47c93f,tdx:_0x17a07a}=_0x15fdea,_0x54589d=_0x47c93f[0x0],_0x3dc604=_0x4fa235[_0x4084d9(0x20b)],_0x598d8a=_0x4fa235[_0x4084d9(0x1f5)],_0x1e315c=_0x4fa235[_0x4084d9(0x226)],_0x4892bc=_0x4fa235[_0x4084d9(0x1a0)],_0x4e7cda=_0x4fa235[_0x4084d9(0x17e)];let _0x768dea;const _0x45ec3b=findAgentConfigPath(process['cwd']());if(_0x54589d){const _0x542973=a4_0x159861[_0x4084d9(0x177)](_0x54589d,_0x4084d9(0x1df));existsSync(_0x542973)?(_0x768dea=_0x54589d,console[_0x4084d9(0x1eb)](a4_0x4e69c3[_0x4084d9(0x1c9)](_0x4084d9(0x1b3)+_0x54589d))):_0x768dea=_0x54589d;}else{if(_0x45ec3b)_0x768dea=a4_0x159861[_0x4084d9(0x1b7)](_0x45ec3b),console[_0x4084d9(0x1eb)](a4_0x4e69c3[_0x4084d9(0x1c9)]('Using\x20current\x20project:\x20'+_0x768dea));else{if(_0x4e7cda){const _0x2f9a5a=sanitizeForFilesystem(_0x4e7cda);let _0x4567ac=_0x2f9a5a,_0x364ed7=a4_0x159861['join'](process[_0x4084d9(0x1ff)](),_0x4084d9(0x215),_0x2f9a5a,_0x4084d9(0x1df));if(!existsSync(_0x364ed7)){const _0x44876a=normalizeName(_0x4e7cda),_0xbc504e=a4_0x159861[_0x4084d9(0x177)](process[_0x4084d9(0x1ff)](),_0x4084d9(0x215),_0x44876a,_0x4084d9(0x1df));existsSync(_0xbc504e)&&(_0x4567ac=_0x44876a,_0x364ed7=_0xbc504e);}if(existsSync(_0x364ed7))_0x768dea=a4_0x159861[_0x4084d9(0x1b7)](_0x364ed7),console[_0x4084d9(0x1eb)](a4_0x4e69c3[_0x4084d9(0x1c9)](_0x4084d9(0x1b3)+_0x768dea));else{const _0x3653ea=_0x4fa235[_0x4084d9(0x1a6)];if(_0x3653ea)throw new SDKError(ErrorCode[_0x4084d9(0x1e3)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x4e7cda+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x4084d9(0x1ab)+_0x4084d9(0x1f9)+(_0x4084d9(0x1bd)+_0x4e7cda+'\x0a')+(_0x4084d9(0x1ea)+_0x4567ac+_0x4084d9(0x207)+(_0x3dc604||_0x4084d9(0x1ed))+'\x20--profile\x20'+_0x3653ea)});_0x768dea=_0x4e7cda,console['log'](a4_0x4e69c3[_0x4084d9(0x1c9)](_0x4084d9(0x1d2)+_0x4e7cda));}}}}if(!_0x768dea)return console[_0x4084d9(0x1eb)](a4_0x4e69c3['yellow']('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x4084d9(0x1eb)](_0x4084d9(0x179)),console[_0x4084d9(0x1eb)](_0x4084d9(0x20d)),console[_0x4084d9(0x1eb)](_0x4084d9(0x223)),console['log']('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x3dc604)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x1e315c&&!_0x598d8a){if(!isInteractive())return console['error'](a4_0x4e69c3[_0x4084d9(0x1f2)](_0x4084d9(0x202)),_0x4084d9(0x1b9)),console[_0x4084d9(0x1c1)](a4_0x4e69c3[_0x4084d9(0x1c9)](_0x4084d9(0x197))),0x1;const _0x53f5bf=await confirmKey('Clone\x20\x22'+_0x768dea+'\x22\x20to\x20new\x20project\x20\x22'+_0x3dc604+'\x22?');if(!_0x53f5bf)return console['log'](a4_0x4e69c3[_0x4084d9(0x217)](_0x4084d9(0x227))),0x1;}const {data:_0x9eb3f1}=await withSpinner(_0x4084d9(0x21a)+_0x768dea+'\x22\x20to\x20\x22'+_0x3dc604+_0x4084d9(0x21b),()=>_0x17a07a['llm']['cloneProject'](_0x768dea,_0x3dc604,{'dryRun':_0x598d8a}));if(_0x598d8a){console['log'](a4_0x4e69c3['yellow'](_0x4084d9(0x209))),console['log'](_0x4084d9(0x1dc)+_0x9eb3f1['sourceProjectName']),console[_0x4084d9(0x1eb)]('New\x20project:\x20'+_0x3dc604),console[_0x4084d9(0x1eb)](_0x4084d9(0x1e5)),console[_0x4084d9(0x1eb)](_0x4084d9(0x1cc)+_0x9eb3f1[_0x4084d9(0x21f)]['agents'][_0x4084d9(0x183)]),console[_0x4084d9(0x1eb)](_0x4084d9(0x17f)+_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x208)]['created']),console[_0x4084d9(0x1eb)]('\x20\x20Prompts:\x20'+_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x178)][_0x4084d9(0x183)]),console[_0x4084d9(0x1eb)](_0x4084d9(0x210)+_0x9eb3f1[_0x4084d9(0x21f)]['formInterfaces']['created']),console[_0x4084d9(0x1eb)](_0x4084d9(0x22f)+_0x9eb3f1['counts'][_0x4084d9(0x1e7)][_0x4084d9(0x183)]);const _0x2cdf24=_0x9eb3f1[_0x4084d9(0x21f)]['experimentalKnowledgeBases'][_0x4084d9(0x183)]>0x0||_0x9eb3f1['counts']['experimentalArtifacts'][_0x4084d9(0x183)]>0x0;return _0x2cdf24&&(console[_0x4084d9(0x1eb)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x1d1)][_0x4084d9(0x183)]),console['log'](_0x4084d9(0x1fa)+_0x9eb3f1['counts'][_0x4084d9(0x1ae)][_0x4084d9(0x183)])),0x0;}const _0x5ce740=_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x215)][_0x4084d9(0x1b4)]>0x0||_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x208)][_0x4084d9(0x1b4)]>0x0||_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x178)][_0x4084d9(0x1b4)]>0x0||_0x9eb3f1[_0x4084d9(0x21f)]['formInterfaces']['errors']>0x0||_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x1e7)][_0x4084d9(0x1b4)]>0x0||_0x9eb3f1['counts'][_0x4084d9(0x1d1)][_0x4084d9(0x1b4)]>0x0||_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x1ae)][_0x4084d9(0x1b4)]>0x0;_0x5ce740?console[_0x4084d9(0x1eb)](a4_0x4e69c3[_0x4084d9(0x217)](_0x4084d9(0x205))):console[_0x4084d9(0x1eb)](a4_0x4e69c3['green'](_0x4084d9(0x199)));console[_0x4084d9(0x1eb)](_0x4084d9(0x1dc)+_0x9eb3f1[_0x4084d9(0x22c)]),console['log'](_0x4084d9(0x18a)+_0x9eb3f1[_0x4084d9(0x1f7)]),console['log'](_0x4084d9(0x1d0)+_0x9eb3f1['newProjectId']),console['log'](),console[_0x4084d9(0x1eb)](_0x4084d9(0x1c4)),console['log'](_0x4084d9(0x1cc)+formatCountSummary(_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x215)])),console[_0x4084d9(0x1eb)](_0x4084d9(0x17f)+formatCountSummary(_0x9eb3f1['counts'][_0x4084d9(0x208)])),console[_0x4084d9(0x1eb)](_0x4084d9(0x19f)+formatCountSummary(_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x178)])),console[_0x4084d9(0x1eb)](_0x4084d9(0x193)+formatCountSummary(_0x9eb3f1['counts']['integrations'])),console[_0x4084d9(0x1eb)](_0x4084d9(0x210)+formatCountSummary(_0x9eb3f1['counts'][_0x4084d9(0x19b)])),console[_0x4084d9(0x1eb)](_0x4084d9(0x22f)+formatCountSummary(_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x1e7)]));const _0x338a9b=_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x1d1)][_0x4084d9(0x183)]>0x0||_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x1d1)]['updated']>0x0||_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x1d1)][_0x4084d9(0x1d7)]>0x0||_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x1ae)][_0x4084d9(0x183)]>0x0||_0x9eb3f1[_0x4084d9(0x21f)]['experimentalArtifacts']['updated']>0x0||_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x1ae)]['unchanged']>0x0;_0x338a9b&&(console[_0x4084d9(0x1eb)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x1d1)])),console[_0x4084d9(0x1eb)](_0x4084d9(0x1fa)+formatCountSummary(_0x9eb3f1[_0x4084d9(0x21f)][_0x4084d9(0x1ae)])));if(_0x5ce740){console['log'](),console[_0x4084d9(0x1eb)](a4_0x4e69c3[_0x4084d9(0x1f2)](_0x4084d9(0x1d6)));for(const _0x4f6e17 of _0x9eb3f1['agents']){_0x4f6e17[_0x4084d9(0x1e6)]==='error'&&console[_0x4084d9(0x1eb)](a4_0x4e69c3['red'](_0x4084d9(0x186)+_0x4f6e17[_0x4084d9(0x185)]+'\x22:\x20'+_0x4f6e17['error']));}for(const _0x1ab20c of _0x9eb3f1[_0x4084d9(0x208)]){_0x1ab20c[_0x4084d9(0x1e6)]===_0x4084d9(0x1c1)&&console[_0x4084d9(0x1eb)](a4_0x4e69c3['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x1ab20c[_0x4084d9(0x20b)]+_0x4084d9(0x1d9)+_0x1ab20c[_0x4084d9(0x1c1)]));}for(const _0x261c45 of _0x9eb3f1[_0x4084d9(0x178)]){_0x261c45[_0x4084d9(0x1e6)]===_0x4084d9(0x1c1)&&console[_0x4084d9(0x1eb)](a4_0x4e69c3[_0x4084d9(0x1f2)](_0x4084d9(0x182)+_0x261c45['name']+'\x22:\x20'+_0x261c45['error']));}for(const _0x5b5c60 of _0x9eb3f1[_0x4084d9(0x22e)]){_0x5b5c60[_0x4084d9(0x1e6)]===_0x4084d9(0x1c1)&&console['log'](a4_0x4e69c3['red'](_0x4084d9(0x1ec)+_0x5b5c60[_0x4084d9(0x20b)]+_0x4084d9(0x1d9)+_0x5b5c60[_0x4084d9(0x1c1)]));}for(const _0x42d178 of _0x9eb3f1[_0x4084d9(0x19b)]){_0x42d178[_0x4084d9(0x1e6)]===_0x4084d9(0x1c1)&&console[_0x4084d9(0x1eb)](a4_0x4e69c3[_0x4084d9(0x1f2)](_0x4084d9(0x219)+_0x42d178['name']+_0x4084d9(0x1d9)+_0x42d178['error']));}for(const _0x3fc0ba of _0x9eb3f1[_0x4084d9(0x1e7)]){_0x3fc0ba['action']===_0x4084d9(0x1c1)&&console[_0x4084d9(0x1eb)](a4_0x4e69c3['red'](_0x4084d9(0x1a9)+_0x3fc0ba[_0x4084d9(0x20b)]+_0x4084d9(0x1d9)+_0x3fc0ba[_0x4084d9(0x1c1)]));}for(const _0x335a04 of _0x9eb3f1[_0x4084d9(0x1d1)]){_0x335a04[_0x4084d9(0x1e6)]===_0x4084d9(0x1c1)&&console[_0x4084d9(0x1eb)](a4_0x4e69c3[_0x4084d9(0x1f2)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x335a04[_0x4084d9(0x20b)]+'\x22:\x20'+_0x335a04[_0x4084d9(0x1c1)]));}for(const _0x326a1b of _0x9eb3f1[_0x4084d9(0x1ae)]){_0x326a1b[_0x4084d9(0x1e6)]==='error'&&console[_0x4084d9(0x1eb)](a4_0x4e69c3[_0x4084d9(0x1f2)](_0x4084d9(0x1db)+_0x326a1b[_0x4084d9(0x20b)]+_0x4084d9(0x1d9)+_0x326a1b[_0x4084d9(0x1c1)]));}return 0x1;}console[_0x4084d9(0x1eb)]();const _0x1e4c08=getLLMProjectUrl(_0x4892bc,_0x9eb3f1[_0x4084d9(0x230)]);return console['log'](_0x4084d9(0x1a5)+a4_0x4e69c3['cyan'](_0x1e4c08)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x199530(0x20b)]=a4_0x199530(0x20c);['description']=a4_0x199530(0x221);async[a4_0x199530(0x1c2)](_0x35f2a4){const _0x4fa01c=a4_0x199530,{options:_0x2b0300,args:_0x58e47c,tdx:_0x3fa027}=_0x35f2a4;let _0x267b76=_0x58e47c[0x0]||process[_0x4fa01c(0x1ff)]();const _0xf871b4=_0x2b0300[_0x4fa01c(0x1f5)],_0x44878e=_0x2b0300[_0x4fa01c(0x1a8)],_0xacbea6=_0x2b0300[_0x4fa01c(0x226)],_0x14ea7c=_0x2b0300['site'],_0x1edcb4=a4_0x159861[_0x4fa01c(0x177)](_0x267b76,'agent.yml'),_0x58e181=existsSync(_0x1edcb4);if(_0x58e181){const {data:_0x34535d}=await withSpinner(_0x4fa01c(0x18e)+_0x267b76+_0x4fa01c(0x21b),()=>_0x3fa027['llm']['pushAgent'](_0x267b76,{'dryRun':_0xf871b4,'force':_0x44878e}));if(_0xf871b4)return console[_0x4fa01c(0x1eb)](a4_0x4e69c3['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x4fa01c(0x1eb)]('Would\x20push\x20agent:\x20'+_0x34535d[_0x4fa01c(0x185)]),0x0;if(_0x34535d[_0x4fa01c(0x1e6)]===_0x4fa01c(0x1c1))return console[_0x4fa01c(0x1eb)](a4_0x4e69c3[_0x4fa01c(0x1f2)](_0x4fa01c(0x181)+_0x34535d['error'])),0x1;console['log'](a4_0x4e69c3[_0x4fa01c(0x1c3)](_0x4fa01c(0x1d4)+_0x34535d[_0x4fa01c(0x1e6)]+_0x4fa01c(0x1c5))),console['log'](_0x4fa01c(0x1b5)+_0x34535d[_0x4fa01c(0x185)]);if(_0x34535d[_0x4fa01c(0x194)]&&_0x34535d[_0x4fa01c(0x1ca)]){const _0x528ed8=getLLMAgentChatUrl(_0x14ea7c,_0x34535d[_0x4fa01c(0x1ca)],_0x34535d['agentId']);console[_0x4fa01c(0x1eb)]('Chat:\x20'+a4_0x4e69c3[_0x4fa01c(0x222)](_0x528ed8));}return 0x0;}const _0x57fddf=_0x2b0300['llmProject'],_0x19aa37=resolveProjectFromContext(_0x267b76,_0x57fddf);if(_0x19aa37[_0x4fa01c(0x21c)])_0x267b76=_0x19aa37[_0x4fa01c(0x211)],_0x19aa37[_0x4fa01c(0x17a)]===_0x4fa01c(0x196)&&console[_0x4fa01c(0x1eb)](a4_0x4e69c3[_0x4fa01c(0x1c9)]('Using\x20project:\x20'+_0x267b76));else{let _0x238b35='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x19aa37['reason']===_0x4fa01c(0x1a4)&&(_0x238b35=_0x19aa37[_0x4fa01c(0x1ce)]+_0x4fa01c(0x1f4)+_0x19aa37[_0x4fa01c(0x17e)]+_0x4fa01c(0x1ba));throw new SDKError(ErrorCode[_0x4fa01c(0x1e3)],_0x19aa37[_0x4fa01c(0x184)]==='no_context'?_0x19aa37[_0x4fa01c(0x1ce)]:_0x4fa01c(0x214)+_0x267b76,undefined,{'helpText':_0x238b35});}const {data:_0x29b36e}=await withSpinner(_0x4fa01c(0x1de),()=>_0x3fa027[_0x4fa01c(0x1d3)][_0x4fa01c(0x20e)](_0x267b76,{'dryRun':!![]})),_0x34df17=_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x215)][_0x4fa01c(0x1b4)]>0x0;if(_0x34df17){console['log'](a4_0x4e69c3[_0x4fa01c(0x1f2)](_0x4fa01c(0x212)));for(const _0x2cf630 of _0x29b36e[_0x4fa01c(0x215)]){_0x2cf630[_0x4fa01c(0x1e6)]===_0x4fa01c(0x1c1)&&console[_0x4fa01c(0x1eb)](a4_0x4e69c3[_0x4fa01c(0x1f2)]('\x20\x20Agent\x20\x22'+_0x2cf630[_0x4fa01c(0x185)]+_0x4fa01c(0x1d9)+_0x2cf630[_0x4fa01c(0x1c1)]));}return 0x1;}const _0x9bdad8=_0x29b36e[_0x4fa01c(0x21f)]['agents']['created']+_0x29b36e[_0x4fa01c(0x21f)]['knowledgeBases']['created']+_0x29b36e['counts'][_0x4fa01c(0x195)]['created']+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x178)]['created']+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x22e)][_0x4fa01c(0x183)]+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x1d1)][_0x4fa01c(0x183)]+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x1ae)]['created']+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x19b)][_0x4fa01c(0x183)]+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x1e7)]['created'],_0x3eef71=_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x215)]['updated']+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x208)]['updated']+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x195)][_0x4fa01c(0x1b0)]+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x178)][_0x4fa01c(0x1b0)]+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x22e)][_0x4fa01c(0x1b0)]+_0x29b36e['counts'][_0x4fa01c(0x1d1)][_0x4fa01c(0x1b0)]+_0x29b36e[_0x4fa01c(0x21f)]['experimentalArtifacts'][_0x4fa01c(0x1b0)]+_0x29b36e[_0x4fa01c(0x21f)]['formInterfaces']['updated']+_0x29b36e['counts'][_0x4fa01c(0x1e7)][_0x4fa01c(0x1b0)],_0x564137=_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x215)][_0x4fa01c(0x1d7)]+_0x29b36e[_0x4fa01c(0x21f)]['knowledgeBases'][_0x4fa01c(0x1d7)]+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x195)]['unchanged']+_0x29b36e['counts']['prompts'][_0x4fa01c(0x1d7)]+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x22e)]['unchanged']+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x1d1)][_0x4fa01c(0x1d7)]+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x1ae)][_0x4fa01c(0x1d7)]+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x19b)][_0x4fa01c(0x1d7)]+_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x1e7)][_0x4fa01c(0x1d7)];console[_0x4fa01c(0x1eb)](_0x4fa01c(0x216)+_0x29b36e[_0x4fa01c(0x206)]+'\x27:'),console[_0x4fa01c(0x1eb)]('\x20\x20'+a4_0x4e69c3[_0x4fa01c(0x1c3)]('+\x20'+_0x9bdad8+_0x4fa01c(0x224))+_0x4fa01c(0x1be)+a4_0x4e69c3[_0x4fa01c(0x217)]('~\x20'+_0x3eef71+_0x4fa01c(0x1e0))+_0x4fa01c(0x1be)+a4_0x4e69c3[_0x4fa01c(0x1c9)]('=\x20'+_0x564137+_0x4fa01c(0x18c))),console[_0x4fa01c(0x1eb)](_0x4fa01c(0x1cc)+formatCountSummary(_0x29b36e['counts'][_0x4fa01c(0x215)])),console[_0x4fa01c(0x1eb)](_0x4fa01c(0x17f)+formatCountSummary(_0x29b36e['counts'][_0x4fa01c(0x208)])),console[_0x4fa01c(0x1eb)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x195)])),console['log'](_0x4fa01c(0x19f)+formatCountSummary(_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x178)])),console[_0x4fa01c(0x1eb)](_0x4fa01c(0x193)+formatCountSummary(_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x22e)])),console[_0x4fa01c(0x1eb)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x19b)])),console[_0x4fa01c(0x1eb)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x29b36e[_0x4fa01c(0x21f)]['chatInterfaces']));const _0x2906b6=_0x29b36e[_0x4fa01c(0x21f)]['experimentalKnowledgeBases'][_0x4fa01c(0x183)]>0x0||_0x29b36e['counts'][_0x4fa01c(0x1d1)][_0x4fa01c(0x1b0)]>0x0||_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x1d1)][_0x4fa01c(0x1d7)]>0x0||_0x29b36e['counts'][_0x4fa01c(0x1ae)][_0x4fa01c(0x183)]>0x0||_0x29b36e['counts'][_0x4fa01c(0x1ae)][_0x4fa01c(0x1b0)]>0x0||_0x29b36e[_0x4fa01c(0x21f)]['experimentalArtifacts'][_0x4fa01c(0x1d7)]>0x0;_0x2906b6&&(console[_0x4fa01c(0x1eb)](_0x4fa01c(0x1af)+formatCountSummary(_0x29b36e[_0x4fa01c(0x21f)][_0x4fa01c(0x1d1)])),console[_0x4fa01c(0x1eb)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x29b36e['counts'][_0x4fa01c(0x1ae)])));console[_0x4fa01c(0x1eb)]('\x20\x20Source:\x20'+a4_0x4e69c3[_0x4fa01c(0x222)](_0x267b76)),displayDiffs(_0x29b36e['agents'],_0x29b36e['knowledgeBases'],_0x29b36e[_0x4fa01c(0x195)],_0x29b36e[_0x4fa01c(0x178)],_0x29b36e['integrations'],_0x29b36e['experimentalKnowledgeBases'],_0x29b36e[_0x4fa01c(0x1ae)],_0x29b36e[_0x4fa01c(0x19b)],_0x29b36e['chatInterfaces']);if(_0xf871b4)return console[_0x4fa01c(0x1eb)](a4_0x4e69c3[_0x4fa01c(0x217)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x9bdad8===0x0&&_0x3eef71===0x0){console[_0x4fa01c(0x1eb)](a4_0x4e69c3['green'](_0x4fa01c(0x213)));const _0x40d21e=getLLMProjectUrl(_0x14ea7c,_0x29b36e[_0x4fa01c(0x1ca)]);return console['log'](_0x4fa01c(0x1a5)+a4_0x4e69c3[_0x4fa01c(0x222)](_0x40d21e)),0x0;}if(!_0xacbea6&&!_0x44878e){if(!isInteractive())return console[_0x4fa01c(0x1c1)](a4_0x4e69c3['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4fa01c(0x1c1)](a4_0x4e69c3[_0x4fa01c(0x1c9)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3ae0c1=await confirmKey(_0x4fa01c(0x1b1)+(_0x9bdad8+_0x3eef71)+'\x20resources?');if(!_0x3ae0c1)return console[_0x4fa01c(0x1eb)](a4_0x4e69c3['yellow'](_0x4fa01c(0x227)),_0x4fa01c(0x1e1)),0x1;}const {data:_0x4c5bdd}=await withSpinner('Pushing\x20to\x20project...',()=>_0x3fa027[_0x4fa01c(0x1d3)][_0x4fa01c(0x20e)](_0x267b76,{'force':_0x44878e})),_0x1ba7ac=_0x4c5bdd[_0x4fa01c(0x21f)][_0x4fa01c(0x215)]['errors']>0x0||_0x4c5bdd[_0x4fa01c(0x21f)]['knowledgeBases'][_0x4fa01c(0x1b4)]>0x0||_0x4c5bdd[_0x4fa01c(0x21f)]['textKnowledgeBases'][_0x4fa01c(0x1b4)]>0x0||_0x4c5bdd['counts']['prompts'][_0x4fa01c(0x1b4)]>0x0||_0x4c5bdd[_0x4fa01c(0x21f)][_0x4fa01c(0x19b)][_0x4fa01c(0x1b4)]>0x0||_0x4c5bdd[_0x4fa01c(0x21f)][_0x4fa01c(0x1e7)][_0x4fa01c(0x1b4)]>0x0;if(_0x1ba7ac){console[_0x4fa01c(0x1eb)](a4_0x4e69c3['yellow'](_0x4fa01c(0x19c))),console['log'](),console[_0x4fa01c(0x1eb)](a4_0x4e69c3['red']('Errors:'));for(const _0x1365da of _0x4c5bdd[_0x4fa01c(0x215)]){_0x1365da[_0x4fa01c(0x1e6)]===_0x4fa01c(0x1c1)&&console[_0x4fa01c(0x1eb)](a4_0x4e69c3['red']('\x20\x20Agent\x20\x22'+_0x1365da[_0x4fa01c(0x185)]+_0x4fa01c(0x1d9)+_0x1365da[_0x4fa01c(0x1c1)]));}for(const _0x3359c9 of _0x4c5bdd['knowledgeBases']){_0x3359c9[_0x4fa01c(0x1e6)]==='error'&&console[_0x4fa01c(0x1eb)](a4_0x4e69c3[_0x4fa01c(0x1f2)](_0x4fa01c(0x1c7)+_0x3359c9[_0x4fa01c(0x20b)]+_0x4fa01c(0x1d9)+_0x3359c9[_0x4fa01c(0x1c1)]));}for(const _0x96afff of _0x4c5bdd[_0x4fa01c(0x195)]){_0x96afff[_0x4fa01c(0x1e6)]===_0x4fa01c(0x1c1)&&console['log'](a4_0x4e69c3['red'](_0x4fa01c(0x1f1)+_0x96afff[_0x4fa01c(0x20b)]+_0x4fa01c(0x1d9)+_0x96afff[_0x4fa01c(0x1c1)]));}for(const _0x448791 of _0x4c5bdd[_0x4fa01c(0x178)]){_0x448791[_0x4fa01c(0x1e6)]===_0x4fa01c(0x1c1)&&console[_0x4fa01c(0x1eb)](a4_0x4e69c3[_0x4fa01c(0x1f2)](_0x4fa01c(0x182)+_0x448791['name']+'\x22:\x20'+_0x448791['error']));}for(const _0x416d87 of _0x4c5bdd[_0x4fa01c(0x22e)]){_0x416d87[_0x4fa01c(0x1e6)]==='error'&&console[_0x4fa01c(0x1eb)](a4_0x4e69c3[_0x4fa01c(0x1f2)](_0x4fa01c(0x1ec)+_0x416d87['name']+_0x4fa01c(0x1d9)+_0x416d87[_0x4fa01c(0x1c1)]));}for(const _0x37e465 of _0x4c5bdd[_0x4fa01c(0x19b)]){_0x37e465[_0x4fa01c(0x1e6)]===_0x4fa01c(0x1c1)&&console[_0x4fa01c(0x1eb)](a4_0x4e69c3[_0x4fa01c(0x1f2)](_0x4fa01c(0x219)+_0x37e465['name']+_0x4fa01c(0x1d9)+_0x37e465[_0x4fa01c(0x1c1)]));}for(const _0x500616 of _0x4c5bdd[_0x4fa01c(0x1e7)]){_0x500616[_0x4fa01c(0x1e6)]===_0x4fa01c(0x1c1)&&console['log'](a4_0x4e69c3[_0x4fa01c(0x1f2)](_0x4fa01c(0x1a9)+_0x500616[_0x4fa01c(0x20b)]+_0x4fa01c(0x1d9)+_0x500616[_0x4fa01c(0x1c1)]));}return 0x1;}console[_0x4fa01c(0x1eb)](a4_0x4e69c3[_0x4fa01c(0x1c3)](_0x4fa01c(0x1d5)+(_0x9bdad8+_0x3eef71)+_0x4fa01c(0x17d)+_0x4c5bdd[_0x4fa01c(0x206)]+'\x27'));const _0x441c03=getLLMProjectUrl(_0x14ea7c,_0x4c5bdd[_0x4fa01c(0x1ca)]);return console[_0x4fa01c(0x1eb)](_0x4fa01c(0x1a5)+a4_0x4e69c3[_0x4fa01c(0x222)](_0x441c03)),0x0;}}
@@ -1 +1 @@
1
- const a5_0x885273=a5_0x38df;(function(_0x11efae,_0x24c1c0){const _0x21142a=a5_0x38df,_0x404ab1=_0x11efae();while(!![]){try{const _0x5b8c1a=parseInt(_0x21142a(0x178))/0x1*(-parseInt(_0x21142a(0x181))/0x2)+-parseInt(_0x21142a(0xef))/0x3+parseInt(_0x21142a(0x10f))/0x4*(-parseInt(_0x21142a(0xf0))/0x5)+-parseInt(_0x21142a(0x12d))/0x6+parseInt(_0x21142a(0x14a))/0x7*(parseInt(_0x21142a(0x17b))/0x8)+parseInt(_0x21142a(0x15e))/0x9*(-parseInt(_0x21142a(0x174))/0xa)+parseInt(_0x21142a(0x118))/0xb*(parseInt(_0x21142a(0xf9))/0xc);if(_0x5b8c1a===_0x24c1c0)break;else _0x404ab1['push'](_0x404ab1['shift']());}catch(_0x1d5310){_0x404ab1['push'](_0x404ab1['shift']());}}}(a5_0x17de,0x25806));import*as a5_0x142156 from'node:fs';import*as a5_0x2c2174 from'node:path';import a5_0x324547 from'chalk';function a5_0x38df(_0x302274,_0x4436d6){_0x302274=_0x302274-0xef;const _0x17de3c=a5_0x17de();let _0x38df38=_0x17de3c[_0x302274];return _0x38df38;}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{['name']='agent:test';['description']='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x885273(0xfc)](_0x4e5596){const _0x4cd51a=a5_0x885273,{options:_0x45a7c0,args:_0xfaf71c,tdx:_0x3adc8b}=_0x4e5596,_0x364c1b=_0xfaf71c[0x0]||'.',_0x16d6ba=_0x45a7c0[_0x4cd51a(0x149)],_0x45f5b5=_0x45a7c0,_0x1e6a69=_0x45f5b5[_0x4cd51a(0xf1)]===![],_0x214205=_0x45f5b5[_0x4cd51a(0x167)],_0x237619=_0x45f5b5['name'],_0x54b62e=_0x45f5b5[_0x4cd51a(0x109)],_0x31dead=_0x45a7c0['site'],_0x3f6a2d=_0x45f5b5[_0x4cd51a(0x170)];if(_0x214205&&_0x1e6a69)return console['log'](a5_0x324547[_0x4cd51a(0x160)](_0x4cd51a(0x17a))),0x1;let _0x5654af=_0x4cd51a(0x127);if(_0x45f5b5['json'])_0x5654af=_0x4cd51a(0x102);else{if(_0x45f5b5[_0x4cd51a(0xf4)])_0x5654af=_0x4cd51a(0xf4);else{if(_0x45f5b5[_0x4cd51a(0x12a)])_0x5654af=_0x4cd51a(0x12a);else{if(_0x45f5b5[_0x4cd51a(0x127)])_0x5654af=_0x4cd51a(0x127);}}}const _0x554958=_0x45f5b5[_0x4cd51a(0x162)];let _0x1df8a4=_0x364c1b;const _0x2e238c=a5_0x142156['existsSync'](_0x364c1b),_0x359b87=_0x364c1b==='.';if(!_0x2e238c||_0x359b87){const _0x25e082=resolveProjectFromContext(_0x364c1b,_0x554958,{'requireFile':_0x4cd51a(0x14e)});if(_0x25e082[_0x4cd51a(0x12e)])_0x1df8a4=_0x25e082['projectDir'],_0x25e082[_0x4cd51a(0x169)]==='context'&&console['log'](a5_0x324547[_0x4cd51a(0x10a)](_0x4cd51a(0x14b)+_0x1df8a4));else switch(_0x25e082[_0x4cd51a(0x13a)]){case _0x4cd51a(0x117):console[_0x4cd51a(0x17c)](a5_0x324547[_0x4cd51a(0x157)](_0x25e082[_0x4cd51a(0x11b)])),console['log'](),console['log']('Usage:'),console['log'](_0x4cd51a(0x11e)),console['log'](_0x4cd51a(0x113)),console[_0x4cd51a(0x17c)](),console[_0x4cd51a(0x17c)](_0x4cd51a(0x122));return 0x1;case _0x4cd51a(0x112):console[_0x4cd51a(0x17c)](a5_0x324547[_0x4cd51a(0x157)](_0x25e082[_0x4cd51a(0x11b)])),console[_0x4cd51a(0x17c)](),console[_0x4cd51a(0x17c)](_0x4cd51a(0xff)+_0x25e082['llmProject']+_0x4cd51a(0x110));return 0x1;case _0x4cd51a(0x16f):{const _0x19db18=a5_0x2c2174[_0x4cd51a(0x108)](_0x25e082[_0x4cd51a(0x15b)]);console[_0x4cd51a(0x17c)](a5_0x324547['yellow'](_0x4cd51a(0x11d)+_0x25e082[_0x4cd51a(0x162)]+'\x22:'));for(const _0x475525 of _0x25e082[_0x4cd51a(0x179)]){console[_0x4cd51a(0x17c)](_0x4cd51a(0x138)+_0x475525);}return console[_0x4cd51a(0x17c)](),console[_0x4cd51a(0x17c)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x19db18+_0x4cd51a(0x114)),0x1;}case _0x4cd51a(0x14d):console[_0x4cd51a(0x17c)](a5_0x324547[_0x4cd51a(0x157)](_0x4cd51a(0x13b)+_0x25e082['llmProject']+'\x22.')),console[_0x4cd51a(0x17c)](a5_0x324547[_0x4cd51a(0x10a)](_0x4cd51a(0x120)+_0x25e082[_0x4cd51a(0x15b)])),console[_0x4cd51a(0x17c)](),console[_0x4cd51a(0x17c)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x37eabe,agentInfo:_0x37aae6}=parseTestFile(_0x1df8a4);let _0x292dba=_0x37eabe[_0x4cd51a(0x107)];if(_0x237619){const _0x2e66a1=_0x237619[_0x4cd51a(0x126)](',')[_0x4cd51a(0x180)](_0x34b54f=>_0x34b54f[_0x4cd51a(0xf2)]());_0x292dba=_0x37eabe[_0x4cd51a(0x107)]['filter'](_0x16c140=>_0x2e66a1[_0x4cd51a(0x15f)](_0x16c140[_0x4cd51a(0xfd)]));if(_0x292dba[_0x4cd51a(0x158)]===0x0)return console[_0x4cd51a(0x17c)](a5_0x324547[_0x4cd51a(0x157)]('No\x20tests\x20found\x20matching:\x20'+_0x237619)),console[_0x4cd51a(0x17c)](a5_0x324547[_0x4cd51a(0x10a)](_0x4cd51a(0x11a)+_0x37eabe[_0x4cd51a(0x107)][_0x4cd51a(0x180)](_0xb4f5a0=>_0xb4f5a0[_0x4cd51a(0xfd)])[_0x4cd51a(0x155)](',\x20'))),0x1;}if(_0x54b62e){const _0xebba82=_0x54b62e[_0x4cd51a(0x126)](',')['map'](_0x120c97=>_0x120c97['trim']()[_0x4cd51a(0x10c)]());_0x292dba=_0x292dba[_0x4cd51a(0x176)](_0x3e38ee=>_0x3e38ee['tags']?.['some'](_0x22dc3d=>_0xebba82[_0x4cd51a(0x15f)](_0x22dc3d['toLowerCase']())));if(_0x292dba['length']===0x0){console['log'](a5_0x324547[_0x4cd51a(0x157)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x54b62e));const _0x5cd190=new Set();return _0x37eabe[_0x4cd51a(0x107)]['forEach'](_0x3243a6=>_0x3243a6['tags']?.[_0x4cd51a(0x13f)](_0x49ab43=>_0x5cd190[_0x4cd51a(0x131)](_0x49ab43))),_0x5cd190[_0x4cd51a(0x171)]>0x0?console['log'](a5_0x324547[_0x4cd51a(0x10a)]('Available\x20tags:\x20'+[..._0x5cd190][_0x4cd51a(0x155)](',\x20'))):console[_0x4cd51a(0x17c)](a5_0x324547[_0x4cd51a(0x10a)](_0x4cd51a(0x101))),0x1;}}if(_0x214205)return this['executeReeval'](_0x4e5596,{'definition':{'tests':_0x292dba},'agentInfo':_0x37aae6,'outputFormat':_0x5654af,'outputFile':_0x3f6a2d,'testNames':_0x237619});if(_0x16d6ba){console[_0x4cd51a(0x17c)](a5_0x324547[_0x4cd51a(0x13d)](_0x4cd51a(0x172))),console[_0x4cd51a(0x17c)](_0x4cd51a(0x145)+a5_0x324547[_0x4cd51a(0x10d)](_0x31dead)),console[_0x4cd51a(0x17c)](_0x4cd51a(0x124)+a5_0x324547['white'](_0x37aae6[_0x4cd51a(0x15a)])),console[_0x4cd51a(0x17c)](_0x4cd51a(0xfa)+a5_0x324547[_0x4cd51a(0x10d)](_0x37aae6[_0x4cd51a(0x121)])),console['log'](),console[_0x4cd51a(0x17c)](_0x4cd51a(0x16d)+a5_0x324547[_0x4cd51a(0x10d)](_0x292dba['length']));for(let _0x36285d=0x0;_0x36285d<_0x292dba[_0x4cd51a(0x158)];_0x36285d++){const _0x1c0423=_0x292dba[_0x36285d],_0x4cd85f=_0x1c0423[_0x4cd51a(0x16e)][_0x4cd51a(0x158)]===0x1?_0x4cd51a(0x132):'rounds',_0x2c6c42=_0x1c0423['tags']?.[_0x4cd51a(0x158)]?'\x20['+_0x1c0423['tags'][_0x4cd51a(0x155)](',\x20')+']':'';console[_0x4cd51a(0x17c)]('\x20\x20'+(_0x36285d+0x1)+'.\x20'+a5_0x324547['white'](_0x1c0423[_0x4cd51a(0xfd)])+'\x20('+_0x1c0423[_0x4cd51a(0x16e)][_0x4cd51a(0x158)]+'\x20'+_0x4cd85f+')'+a5_0x324547['dim'](_0x2c6c42));}return 0x0;}let _0x438eb1,_0x47f8d7;try{_0x438eb1=await _0x3adc8b[_0x4cd51a(0x130)][_0x4cd51a(0x116)](_0x37aae6[_0x4cd51a(0x15a)]);}catch(_0x4e29bc){const _0x58b0d8=_0x4e29bc instanceof Error?_0x4e29bc[_0x4cd51a(0x11b)]:String(_0x4e29bc);return _0x58b0d8['includes']('404')||_0x58b0d8[_0x4cd51a(0x10c)]()[_0x4cd51a(0x15f)](_0x4cd51a(0x119))?console[_0x4cd51a(0x17c)](a5_0x324547[_0x4cd51a(0x160)](_0x4cd51a(0x173)+_0x37aae6[_0x4cd51a(0x15a)])):console[_0x4cd51a(0x17c)](a5_0x324547[_0x4cd51a(0x160)](_0x4cd51a(0x137)+_0x37aae6[_0x4cd51a(0x15a)]+_0x4cd51a(0x111)+_0x58b0d8)),0x1;}try{_0x47f8d7=await _0x3adc8b['llm'][_0x4cd51a(0x165)](_0x37aae6[_0x4cd51a(0x121)],_0x438eb1);}catch(_0x3e6f12){const _0x31265d=_0x3e6f12 instanceof Error?_0x3e6f12[_0x4cd51a(0x11b)]:String(_0x3e6f12);return _0x31265d[_0x4cd51a(0x15f)]('404')||_0x31265d[_0x4cd51a(0x10c)]()[_0x4cd51a(0x15f)](_0x4cd51a(0x119))?console[_0x4cd51a(0x17c)](a5_0x324547[_0x4cd51a(0x160)](_0x4cd51a(0x100)+_0x37aae6[_0x4cd51a(0x121)])):console['log'](a5_0x324547[_0x4cd51a(0x160)](_0x4cd51a(0x146)+_0x37aae6[_0x4cd51a(0x121)]+_0x4cd51a(0x111)+_0x31265d)),0x1;}let _0x256d1a;if(!_0x1e6a69)try{_0x256d1a=await setupEvaluatorAgent(_0x3adc8b[_0x4cd51a(0x130)],_0x45a7c0[_0x4cd51a(0x152)]);}catch(_0x589036){const _0x4cb9b2=_0x589036 instanceof Error?_0x589036[_0x4cd51a(0x11b)]:String(_0x589036);return console['log'](a5_0x324547['red'](_0x4cd51a(0x17f)+_0x4cb9b2)),0x1;}console['log'](a5_0x324547[_0x4cd51a(0x13d)](_0x4cd51a(0xf7))),console['log']('Site:\x20'+a5_0x324547['white'](_0x31dead)),console[_0x4cd51a(0x17c)](_0x4cd51a(0x168)+a5_0x324547[_0x4cd51a(0x10d)](_0x37aae6[_0x4cd51a(0x15a)]+'/'+_0x37aae6[_0x4cd51a(0x121)])),console[_0x4cd51a(0x17c)]();const _0x4217b1=[],_0x21b7fa=[],_0x240487=Date[_0x4cd51a(0x143)]();for(let _0xe0b759=0x0;_0xe0b759<_0x292dba[_0x4cd51a(0x158)];_0xe0b759++){const _0x19119a=_0x292dba[_0xe0b759];_0x292dba['length']>0x1?console[_0x4cd51a(0x17c)](_0x4cd51a(0x140)+(_0xe0b759+0x1)+'/'+_0x292dba[_0x4cd51a(0x158)]+':\x20'+a5_0x324547[_0x4cd51a(0x10d)](_0x19119a[_0x4cd51a(0xfd)])):console[_0x4cd51a(0x17c)]('Running\x20test:\x20'+a5_0x324547[_0x4cd51a(0x10d)](_0x19119a[_0x4cd51a(0xfd)]));const _0x5d02a6=createCommandSpinner('Round\x201/'+_0x19119a[_0x4cd51a(0x16e)]['length']+_0x4cd51a(0x16c));_0x5d02a6[_0x4cd51a(0xf8)]();try{const {result:_0x5de4eb,conversation:_0x46184e}=await runTest(_0x3adc8b[_0x4cd51a(0x130)],_0x19119a,{'agentId':_0x47f8d7,'projectId':_0x438eb1,'site':_0x31dead,'noEval':_0x1e6a69,'evaluatorId':_0x256d1a,'onRoundStart':(_0x2bca90,_0x17c421)=>{const _0xa89c03=_0x4cd51a;_0x5d02a6[_0xa89c03(0x17d)]=_0xa89c03(0x16a)+(_0x2bca90+0x1)+'/'+_0x17c421+_0xa89c03(0x16c);},'onRoundComplete':(_0x447e29,_0xd3ba94,_0x1fd3aa)=>{const _0x466703=_0x4cd51a,_0x4bd0db=formatElapsed(_0xd3ba94);_0x1fd3aa?console[_0x466703(0x17c)](_0x466703(0x12b)+(_0x447e29+0x1)+'/'+_0x19119a[_0x466703(0x16e)][_0x466703(0x158)]+'...\x20'+a5_0x324547[_0x466703(0x14c)]('✓')+'\x20('+_0x4bd0db+')'):console[_0x466703(0x17c)](_0x466703(0x12b)+(_0x447e29+0x1)+'/'+_0x19119a[_0x466703(0x16e)][_0x466703(0x158)]+'...\x20'+a5_0x324547['red']('✗'));},'onEvaluationStart':()=>{const _0xf0c161=_0x4cd51a;_0x5d02a6[_0xf0c161(0x17d)]=_0xf0c161(0x105);},'onEvaluationComplete':_0x10ecda=>{const _0xc9daec=_0x4cd51a,_0x1daeec=formatElapsed(_0x10ecda);console[_0xc9daec(0x17c)](_0xc9daec(0x10b)+a5_0x324547[_0xc9daec(0x14c)]('✓')+'\x20('+_0x1daeec+')');}});_0x5d02a6[_0x4cd51a(0x133)](),_0x4217b1[_0x4cd51a(0xfe)](_0x5de4eb),_0x21b7fa[_0x4cd51a(0xfe)](_0x46184e);if(_0x5de4eb['status']==='PASS')console[_0x4cd51a(0x17c)](a5_0x324547[_0x4cd51a(0x14c)](_0x4cd51a(0x12f)+_0x5de4eb[_0x4cd51a(0x13a)]));else _0x5de4eb[_0x4cd51a(0x11f)]===_0x4cd51a(0x153)?console['log'](a5_0x324547[_0x4cd51a(0x160)](_0x4cd51a(0x184)+_0x5de4eb[_0x4cd51a(0x13a)])):console[_0x4cd51a(0x17c)](a5_0x324547[_0x4cd51a(0x160)](_0x4cd51a(0x136)+_0x5de4eb['reason']));_0x5de4eb[_0x4cd51a(0x142)]&&console[_0x4cd51a(0x17c)](a5_0x324547[_0x4cd51a(0x10a)](_0x4cd51a(0x14f)+_0x5de4eb[_0x4cd51a(0x142)])),console['log']();}catch(_0x1c5514){_0x5d02a6[_0x4cd51a(0x133)]();const _0x3db063=_0x1c5514 instanceof Error?_0x1c5514[_0x4cd51a(0x11b)]:String(_0x1c5514);console['log'](a5_0x324547[_0x4cd51a(0x160)](_0x4cd51a(0x136)+_0x3db063)),console['log'](),_0x4217b1['push']({'name':_0x19119a[_0x4cd51a(0xfd)],'status':_0x4cd51a(0x12c),'reason':_0x3db063,'timestamp':new Date()[_0x4cd51a(0x139)](),'duration_ms':0x0});}}const _0x308628=Date[_0x4cd51a(0x143)]()-_0x240487,_0x4a8833=_0x4217b1[_0x4cd51a(0x176)](_0xf47a3b=>_0xf47a3b[_0x4cd51a(0x11f)]==='PASS')['length'],_0x31448e=_0x4217b1[_0x4cd51a(0x176)](_0x1e171c=>_0x1e171c[_0x4cd51a(0x11f)]===_0x4cd51a(0x153))['length'],_0x493b47=_0x4217b1['filter'](_0x169003=>_0x169003[_0x4cd51a(0x11f)]===_0x4cd51a(0x12c))[_0x4cd51a(0x158)];console['log']('━'[_0x4cd51a(0x125)](0x3c)),console[_0x4cd51a(0x17c)](_0x4cd51a(0x156)),console[_0x4cd51a(0x17c)]('━'[_0x4cd51a(0x125)](0x3c)),console['log'](_0x4cd51a(0x159)+_0x4217b1[_0x4cd51a(0x158)]),console[_0x4cd51a(0x17c)](_0x4cd51a(0x166)+a5_0x324547[_0x4cd51a(0x14c)](_0x4a8833)),console[_0x4cd51a(0x17c)](_0x4cd51a(0x187)+a5_0x324547[_0x4cd51a(0x160)](_0x31448e));_0x493b47>0x0&&console[_0x4cd51a(0x17c)](_0x4cd51a(0x103)+a5_0x324547['red'](_0x493b47));console['log']('Duration:\x20'+formatElapsed(_0x308628)),console['log']('━'[_0x4cd51a(0x125)](0x3c));const _0x1f5f59=_0x4217b1[_0x4cd51a(0x176)](_0x19213f=>_0x19213f[_0x4cd51a(0x11f)]!==_0x4cd51a(0x163));if(_0x1f5f59[_0x4cd51a(0x158)]>0x0){console[_0x4cd51a(0x17c)](),console[_0x4cd51a(0x17c)](_0x4cd51a(0xf3));for(const _0x561c3e of _0x1f5f59){const _0xd999aa=a5_0x324547[_0x4cd51a(0x160)]('✗'),_0x19e752=_0x561c3e[_0x4cd51a(0x13a)][_0x4cd51a(0x158)]>0x32?_0x561c3e[_0x4cd51a(0x13a)][_0x4cd51a(0x182)](0x0,0x32)+_0x4cd51a(0x144):_0x561c3e[_0x4cd51a(0x13a)];console['log']('\x20\x20'+_0xd999aa+'\x20'+_0x561c3e[_0x4cd51a(0xfd)]+':\x20'+_0x19e752);}}const _0x239a41={'summary':{'total':_0x4217b1[_0x4cd51a(0x158)],'passed':_0x4a8833,'failed':_0x31448e,'errors':_0x493b47>0x0?_0x493b47:undefined,'duration_ms':_0x308628},'tests':_0x4217b1,'agent':{'project':_0x37aae6[_0x4cd51a(0x15a)],'name':_0x37aae6[_0x4cd51a(0x121)],'site':_0x31dead},'timestamp':new Date(_0x240487)[_0x4cd51a(0x139)]()};try{const _0x5ddce7=buildCachedTestRun(_0x21b7fa,{'site':_0x31dead,'projectId':_0x438eb1,'projectName':_0x37aae6[_0x4cd51a(0x15a)],'agentId':_0x47f8d7,'agentName':_0x37aae6[_0x4cd51a(0x121)],'testYmlPath':a5_0x2c2174['resolve'](_0x37aae6[_0x4cd51a(0x161)])});saveLastTestRun(_0x5ddce7);}catch{}if(_0x5654af!==_0x4cd51a(0x127)||_0x3f6a2d){const _0x1f1708=formatResults(_0x239a41,_0x5654af);if(_0x3f6a2d)try{a5_0x142156[_0x4cd51a(0x128)](_0x3f6a2d,_0x1f1708,'utf-8'),console['log'](),console[_0x4cd51a(0x17c)](a5_0x324547[_0x4cd51a(0x10a)](_0x4cd51a(0x10e)+_0x3f6a2d));}catch(_0x3ea38c){return console[_0x4cd51a(0x17c)](),console[_0x4cd51a(0x17c)](a5_0x324547[_0x4cd51a(0x160)](_0x4cd51a(0x185)+_0x3ea38c)),0x1;}else console['log'](),console['log'](_0x1f1708);}return _0x1f5f59[_0x4cd51a(0x158)]>0x0?0x1:0x0;}async[a5_0x885273(0x151)](_0x5f05c3,_0x48dcfb){const _0x10272f=a5_0x885273,{options:_0x15b604,tdx:_0x5048a8}=_0x5f05c3,{definition:_0x1fc014,agentInfo:_0x566ab5,outputFormat:_0x53ae3a,outputFile:_0x26151f}=_0x48dcfb,_0x6beece=_0x15b604[_0x10272f(0x148)],_0x5ccf1b=loadLastTestRun();if(!_0x5ccf1b)return console[_0x10272f(0x17c)](a5_0x324547[_0x10272f(0x160)](_0x10272f(0x16b))),console['log'](a5_0x324547[_0x10272f(0x10a)](_0x10272f(0x175))),0x1;if(_0x5ccf1b['agent'][_0x10272f(0x121)]!==_0x566ab5[_0x10272f(0x121)])return console[_0x10272f(0x17c)](a5_0x324547['red']('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x5ccf1b[_0x10272f(0x17e)][_0x10272f(0x121)]+_0x10272f(0x147)+_0x566ab5['agentName']+'\x22.')),console[_0x10272f(0x17c)](a5_0x324547[_0x10272f(0x10a)](_0x10272f(0xf6))),0x1;const _0x4a939f=new Set(_0x5ccf1b[_0x10272f(0x150)]['map'](_0x318c44=>_0x318c44[_0x10272f(0x115)])),_0x54347c=_0x1fc014[_0x10272f(0x107)][_0x10272f(0x176)](_0x51e741=>!_0x4a939f['has'](_0x51e741[_0x10272f(0xfd)]));if(_0x54347c[_0x10272f(0x158)]>0x0&&_0x5ccf1b[_0x10272f(0x148)]!==_0x6beece)return console['log'](a5_0x324547[_0x10272f(0x160)](_0x10272f(0x129))),console[_0x10272f(0x17c)](a5_0x324547[_0x10272f(0x10a)](_0x10272f(0x186)+_0x5ccf1b[_0x10272f(0x148)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x6beece+'\x22.')),console[_0x10272f(0x17c)](a5_0x324547['dim'](_0x10272f(0x11c)+_0x5ccf1b[_0x10272f(0x148)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x45213f=_0x1fc014[_0x10272f(0x107)]['filter'](_0x1ea29c=>_0x4a939f[_0x10272f(0x177)](_0x1ea29c[_0x10272f(0xfd)])),_0x243476=_0x54347c;let _0x39a436;try{_0x39a436=await setupEvaluatorAgent(_0x5048a8[_0x10272f(0x130)],_0x15b604[_0x10272f(0x152)]);}catch(_0x656a4f){const _0x454af0=_0x656a4f instanceof Error?_0x656a4f[_0x10272f(0x11b)]:String(_0x656a4f);return console[_0x10272f(0x17c)](a5_0x324547[_0x10272f(0x160)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x454af0)),0x1;}console[_0x10272f(0x17c)](a5_0x324547['cyan'](_0x10272f(0x141))),console[_0x10272f(0x17c)](_0x10272f(0x15d)+a5_0x324547[_0x10272f(0x10d)](_0x5ccf1b['timestamp'])),console[_0x10272f(0x17c)](_0x10272f(0x168)+a5_0x324547['white'](_0x5ccf1b[_0x10272f(0x17e)][_0x10272f(0x15a)]+'/'+_0x5ccf1b['agent'][_0x10272f(0x121)]));_0x243476[_0x10272f(0x158)]>0x0&&console['log'](_0x10272f(0x134)+a5_0x324547[_0x10272f(0x157)](_0x243476['length']));console[_0x10272f(0x17c)]();const _0x1dba09=[],_0xca450c=Date['now'](),_0x34968f=createCommandSpinner(_0x10272f(0x106));if(_0x45213f[_0x10272f(0x158)]>0x0)try{const _0x289a4d=await reevaluateFromCache(_0x5048a8[_0x10272f(0x130)],_0x5ccf1b,{'tests':_0x45213f},{'evaluatorId':_0x39a436,'onTestStart':(_0x1933df,_0xf68509,_0x487b18)=>{const _0x346c28=_0x10272f;_0x34968f['text']='Re-evaluating\x20'+(_0xf68509+0x1)+'/'+_0x487b18+':\x20'+_0x1933df+'...';if(!_0x34968f['isSpinning'])_0x34968f[_0x346c28(0xf8)]();},'onTestComplete':(_0xbec6b9,_0x41ff64)=>{const _0x43966f=_0x10272f;_0x34968f['stop']();if(_0x41ff64[_0x43966f(0x11f)]===_0x43966f(0x163))console['log'](a5_0x324547['green'](_0x43966f(0x12f)+_0xbec6b9)+a5_0x324547['dim'](_0x43966f(0x104)));else _0x41ff64['status']===_0x43966f(0x153)?console[_0x43966f(0x17c)](a5_0x324547['red'](_0x43966f(0x184)+_0xbec6b9+_0x43966f(0x154)+_0x41ff64['reason'])+a5_0x324547['dim'](_0x43966f(0x104))):console[_0x43966f(0x17c)](a5_0x324547[_0x43966f(0x160)]('✗\x20ERROR:\x20'+_0xbec6b9+_0x43966f(0x154)+_0x41ff64['reason']));_0x41ff64[_0x43966f(0x142)]&&console[_0x43966f(0x17c)](a5_0x324547[_0x43966f(0x10a)](_0x43966f(0x13e)+_0x41ff64[_0x43966f(0x142)])),_0x1dba09[_0x43966f(0xfe)](_0x41ff64);},'onTestSkipped':(_0x11ad08,_0x1b0c87)=>{const _0x34e060=_0x10272f;_0x34968f[_0x34e060(0x133)](),console[_0x34e060(0x17c)](a5_0x324547[_0x34e060(0x157)](_0x34e060(0x15c)+_0x11ad08+'\x20-\x20'+_0x1b0c87));}});for(const _0x4d571e of _0x289a4d){!_0x1dba09[_0x10272f(0x123)](_0xd7834b=>_0xd7834b[_0x10272f(0xfd)]===_0x4d571e[_0x10272f(0xfd)])&&_0x1dba09['push'](_0x4d571e);}}catch(_0x57eb2b){_0x34968f[_0x10272f(0x133)]();const _0x691410=_0x57eb2b instanceof Error?_0x57eb2b[_0x10272f(0x11b)]:String(_0x57eb2b);return console['log'](a5_0x324547[_0x10272f(0x160)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x691410)),0x1;}_0x34968f['stop']();if(_0x243476[_0x10272f(0x158)]>0x0){console['log'](),console[_0x10272f(0x17c)](a5_0x324547[_0x10272f(0x13d)](_0x10272f(0x164)));const {projectId:_0x27e3b2,agentId:_0x51b171}=_0x5ccf1b['agent'];for(const _0x4a85f6 of _0x243476){console[_0x10272f(0x17c)]('Running:\x20'+a5_0x324547[_0x10272f(0x10d)](_0x4a85f6[_0x10272f(0xfd)]));const _0x5ee940=createCommandSpinner(_0x10272f(0xf5)+_0x4a85f6[_0x10272f(0x16e)][_0x10272f(0x158)]+_0x10272f(0x16c));_0x5ee940[_0x10272f(0xf8)]();try{const {result:_0x4e737b}=await runTest(_0x5048a8['llm'],_0x4a85f6,{'agentId':_0x51b171,'projectId':_0x27e3b2,'site':_0x5ccf1b[_0x10272f(0x148)],'noEval':![],'evaluatorId':_0x39a436,'onRoundStart':(_0x4138f6,_0xfc3d6e)=>{const _0x47d37d=_0x10272f;_0x5ee940[_0x47d37d(0x17d)]=_0x47d37d(0x16a)+(_0x4138f6+0x1)+'/'+_0xfc3d6e+_0x47d37d(0x16c);},'onRoundComplete':(_0x1f8647,_0x5cd7b9,_0x1ebdda)=>{const _0xf11427=_0x10272f,_0x1fcb53=formatElapsed(_0x5cd7b9);_0x1ebdda?console[_0xf11427(0x17c)](_0xf11427(0x12b)+(_0x1f8647+0x1)+'/'+_0x4a85f6[_0xf11427(0x16e)]['length']+'...\x20'+a5_0x324547[_0xf11427(0x14c)]('✓')+'\x20('+_0x1fcb53+')'):console[_0xf11427(0x17c)](_0xf11427(0x12b)+(_0x1f8647+0x1)+'/'+_0x4a85f6['rounds'][_0xf11427(0x158)]+_0xf11427(0x135)+a5_0x324547[_0xf11427(0x160)]('✗'));},'onEvaluationStart':()=>{const _0x36d370=_0x10272f;_0x5ee940[_0x36d370(0x17d)]=_0x36d370(0x105);},'onEvaluationComplete':_0x553eab=>{const _0x5bd931=_0x10272f,_0x54cb7d=formatElapsed(_0x553eab);console[_0x5bd931(0x17c)]('\x20\x20Evaluating...\x20'+a5_0x324547[_0x5bd931(0x14c)]('✓')+'\x20('+_0x54cb7d+')');}});_0x5ee940['stop'](),_0x1dba09['push'](_0x4e737b);if(_0x4e737b[_0x10272f(0x11f)]===_0x10272f(0x163))console['log'](a5_0x324547['green'](_0x10272f(0x12f)+_0x4e737b[_0x10272f(0x13a)])+a5_0x324547[_0x10272f(0x10a)](_0x10272f(0x183)));else _0x4e737b[_0x10272f(0x11f)]==='FAIL'?console[_0x10272f(0x17c)](a5_0x324547['red'](_0x10272f(0x184)+_0x4e737b[_0x10272f(0x13a)])+a5_0x324547[_0x10272f(0x10a)](_0x10272f(0x183))):console[_0x10272f(0x17c)](a5_0x324547[_0x10272f(0x160)]('✗\x20ERROR:\x20'+_0x4e737b['reason']));_0x4e737b[_0x10272f(0x142)]&&console[_0x10272f(0x17c)](a5_0x324547['dim'](_0x10272f(0x13e)+_0x4e737b['conversation_url']));}catch(_0x7bc057){_0x5ee940[_0x10272f(0x133)]();const _0x549e43=_0x7bc057 instanceof Error?_0x7bc057['message']:String(_0x7bc057);console[_0x10272f(0x17c)](a5_0x324547['red']('✗\x20ERROR:\x20'+_0x549e43)),_0x1dba09[_0x10272f(0xfe)]({'name':_0x4a85f6[_0x10272f(0xfd)],'status':'ERROR','reason':_0x549e43,'timestamp':new Date()[_0x10272f(0x139)](),'duration_ms':0x0});}}}console[_0x10272f(0x17c)]();const _0x4c445c=Date[_0x10272f(0x143)]()-_0xca450c,_0x519d73=_0x1dba09[_0x10272f(0x176)](_0x20d1d7=>_0x20d1d7[_0x10272f(0x11f)]===_0x10272f(0x163))['length'],_0x5379d1=_0x1dba09['filter'](_0x5afd66=>_0x5afd66[_0x10272f(0x11f)]===_0x10272f(0x153))[_0x10272f(0x158)],_0x4d1b3a=_0x1dba09['filter'](_0x45ee3a=>_0x45ee3a[_0x10272f(0x11f)]===_0x10272f(0x12c))['length'];console['log']('━'[_0x10272f(0x125)](0x3c)),console[_0x10272f(0x17c)](_0x10272f(0x13c)),console[_0x10272f(0x17c)]('━'['repeat'](0x3c)),console[_0x10272f(0x17c)](_0x10272f(0x159)+_0x1dba09[_0x10272f(0x158)]),console['log'](_0x10272f(0x166)+a5_0x324547[_0x10272f(0x14c)](_0x519d73)),console[_0x10272f(0x17c)](_0x10272f(0x187)+a5_0x324547[_0x10272f(0x160)](_0x5379d1));_0x4d1b3a>0x0&&console['log'](_0x10272f(0x103)+a5_0x324547[_0x10272f(0x160)](_0x4d1b3a));console['log']('Duration:\x20'+formatElapsed(_0x4c445c)),console[_0x10272f(0x17c)]('━'[_0x10272f(0x125)](0x3c));const _0x36bed7={'summary':{'total':_0x1dba09[_0x10272f(0x158)],'passed':_0x519d73,'failed':_0x5379d1,'errors':_0x4d1b3a>0x0?_0x4d1b3a:undefined,'duration_ms':_0x4c445c},'tests':_0x1dba09,'agent':{'project':_0x566ab5[_0x10272f(0x15a)],'name':_0x566ab5[_0x10272f(0x121)],'site':_0x6beece},'timestamp':new Date(_0xca450c)['toISOString']()};if(_0x53ae3a!=='table'||_0x26151f){const _0xef8368=formatResults(_0x36bed7,_0x53ae3a);if(_0x26151f)try{a5_0x142156['writeFileSync'](_0x26151f,_0xef8368,_0x10272f(0xfb)),console[_0x10272f(0x17c)](),console[_0x10272f(0x17c)](a5_0x324547[_0x10272f(0x10a)](_0x10272f(0x10e)+_0x26151f));}catch(_0x42ff8f){return console[_0x10272f(0x17c)](),console[_0x10272f(0x17c)](a5_0x324547[_0x10272f(0x160)]('Error\x20writing\x20output\x20file:\x20'+_0x42ff8f)),0x1;}else console[_0x10272f(0x17c)](),console[_0x10272f(0x17c)](_0xef8368);}const _0x567944=_0x1dba09['filter'](_0x289409=>_0x289409[_0x10272f(0x11f)]!==_0x10272f(0x163));return _0x567944[_0x10272f(0x158)]>0x0?0x1:0x0;}}function a5_0x17de(){const _0x2252e6=['\x20\x20-\x20','toISOString','reason','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Re-evaluation\x20Summary','cyan','\x20\x20Conversation:\x20','forEach','Test\x20','Re-evaluating\x20cached\x20test\x20run...','conversation_url','now','...','\x20\x20Site:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','site','dryRun','32662sbqxXp','Using\x20agent:\x20','green','no_tests','test.yml','Conversation\x20URL:\x20','conversations','executeReeval','verbose','FAIL','\x20-\x20','join','Test\x20Summary','yellow','length','Total:\x20\x20\x20\x20','projectName','projectDir','⚠\x20SKIPPED:\x20','Cached\x20run\x20from:\x20','38277wyJynk','includes','red','testYmlPath','llmProject','PASS','Executing\x20new\x20tests...','resolveAgentId','Passed:\x20\x20\x20','reeval','Agent:\x20','source','Round\x20','Error:\x20No\x20previous\x20test\x20run\x20found.',':\x20Sending\x20user\x20input...','Tests\x20found:\x20','rounds','multiple_agents','output','size','Test\x20Configuration:','✗\x20ERROR:\x20Project\x20not\x20found:\x20','160FRxhhd','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','filter','has','1MWLvAZ','agentDirs','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','200SQdbKz','log','text','agent','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','map','358502rLmWFf','substring','\x20(new)','✗\x20FAIL:\x20','Error\x20writing\x20output\x20file:\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','Failed:\x20\x20\x20','76269ZAlgBb','10sKUerA','eval','trim','Failed\x20Tests:','jsonl','Round\x201/','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Running\x20agent\x20tests...','start','636WXtMaT','\x20\x20Agent:\x20','utf-8','execute','name','push','Run\x20\x27tdx\x20agent\x20pull\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','No\x20tests\x20have\x20tags\x20defined.','json','Errors:\x20\x20\x20','\x20(cached)','Evaluating\x20response...','Re-evaluating...','tests','basename','tags','dim','\x20\x20Evaluating...\x20','toLowerCase','white','Output\x20written\x20to:\x20','77036xTjNDj','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x22:\x20','no_local_folder','\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)','/<agent-name>','testName','resolveProjectId','no_context','91861JWzeJI','not\x20found','Available\x20tests:\x20','message','Either\x20switch\x20to\x20the\x20\x22','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\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','status','Project\x20path:\x20','agentName','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','find','\x20\x20Project:\x20','repeat','split','table','writeFileSync','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','tsv','\x20\x20Round\x20','ERROR','566442hzIJUt','found','✓\x20PASS:\x20','llm','add','round','stop','New\x20tests\x20to\x20execute:\x20','...\x20','✗\x20ERROR:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'];a5_0x17de=function(){return _0x2252e6;};return a5_0x17de();}
1
+ const a5_0x288ad2=a5_0x5f02;(function(_0x203cec,_0x61f7b2){const _0x5c8186=a5_0x5f02,_0x459a42=_0x203cec();while(!![]){try{const _0x555b48=-parseInt(_0x5c8186(0x14c))/0x1+parseInt(_0x5c8186(0x11a))/0x2+-parseInt(_0x5c8186(0x10f))/0x3+parseInt(_0x5c8186(0x112))/0x4*(-parseInt(_0x5c8186(0x125))/0x5)+parseInt(_0x5c8186(0xec))/0x6*(parseInt(_0x5c8186(0xd7))/0x7)+parseInt(_0x5c8186(0x103))/0x8*(-parseInt(_0x5c8186(0xf4))/0x9)+parseInt(_0x5c8186(0xd1))/0xa*(parseInt(_0x5c8186(0xfc))/0xb);if(_0x555b48===_0x61f7b2)break;else _0x459a42['push'](_0x459a42['shift']());}catch(_0x11b700){_0x459a42['push'](_0x459a42['shift']());}}}(a5_0x8f17,0xc9952));import*as a5_0x4f2e51 from'node:fs';import*as a5_0x36f54c from'node:path';import a5_0x3be005 from'chalk';import{BaseCommand}from'./command.js';function a5_0x8f17(){const _0xe0cb14=['projectName','No\x20tests\x20have\x20tags\x20defined.','context','filter','timestamp','FAIL','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','not\x20found','PASS','agent:test','utf-8','Failed:\x20\x20\x20','Errors:\x20\x20\x20','Available\x20tags:\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','length','606nyjVwl','white','toISOString','\x20(cached)','execute','tests','Re-evaluation\x20Summary','✓\x20PASS:\x20','4788FVJvvk','has','Conversation\x20URL:\x20','push','some','round','agentName','\x20\x20Site:\x20','24641518hgJTFo','status','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','test.yml','dim','reason','trim','8696KfKoLq','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','\x20\x20-\x20','includes','Re-evaluating\x20','✗\x20FAIL:\x20','\x22:\x20','\x20(new)','green','find','basename','Project\x20path:\x20','3673389LBALCz','Error:\x20No\x20previous\x20test\x20run\x20found.','substring','52KYADqX','yellow','jsonl','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','tags','\x20\x20Conversation:\x20','Either\x20switch\x20to\x20the\x20\x22','Duration:\x20','570832Awowlq','\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)','repeat','Cached\x20run\x20is\x20from\x20site\x20\x22','name','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Test\x20Summary','\x20\x20Round\x20','\x20-\x20','20285BXYNCh','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','✗\x20ERROR:\x20','resolveAgentId','resolve','Agent:\x20','Output\x20written\x20to:\x20','cyan','toLowerCase','New\x20tests\x20to\x20execute:\x20','red','Passed:\x20\x20\x20','writeFileSync','\x20\x20Agent:\x20','...','Round\x201/','\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','stop','Tests\x20found:\x20','join','Test\x20Configuration:','map','/<agent-name>','eval','\x22,\x20but\x20current\x20site\x20is\x20\x22','...\x20','agent','Running\x20test:\x20','log','Total:\x20\x20\x20\x20','rounds','dryRun','conversation_url','\x27\x20to\x20create\x20the\x20folder\x20structure.','message','split','forEach','ERROR','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','812671GuKjlO','llmProject','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','executeReeval','text',':\x20Sending\x20user\x20input...','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','tsv','\x20\x20Project:\x20','404','site','projectDir','add','Run\x20\x27tdx\x20agent\x20pull\x20','table','No\x20tests\x20found\x20matching:\x20','description','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Usage:','llm','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Failed\x20Tests:','⚠\x20SKIPPED:\x20','start','now','Using\x20agent:\x20','\x20\x20Evaluating...\x20','Re-evaluating\x20cached\x20test\x20run...','Running\x20agent\x20tests...','10sSEjLd','testYmlPath','Site:\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','Evaluating\x20response...','No\x20tests\x20found\x20with\x20tags:\x20','67109AWxJiR','Available\x20tests:\x20','Re-evaluating...','reeval','Round\x20'];a5_0x8f17=function(){return _0xe0cb14;};return a5_0x8f17();}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x5f02(_0x406a77,_0x5be7f3){_0x406a77=_0x406a77-0xc7;const _0x8f1700=a5_0x8f17();let _0x5f029f=_0x8f1700[_0x406a77];return _0x5f029f;}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x288ad2(0x11e)]=a5_0x288ad2(0xe5);[a5_0x288ad2(0x15c)]=a5_0x288ad2(0xd4);async[a5_0x288ad2(0xf0)](_0x5a3406){const _0x5241a7=a5_0x288ad2,{options:_0x22dc0f,args:_0x1eb205,tdx:_0x48b81c}=_0x5a3406,_0x1fb218=_0x1eb205[0x0]||'.',_0x8030bd=_0x22dc0f[_0x5241a7(0x144)],_0x89587f=_0x22dc0f,_0x25d824=_0x89587f[_0x5241a7(0x13c)]===![],_0x3a1b6e=_0x89587f[_0x5241a7(0xda)],_0xe9ba32=_0x89587f[_0x5241a7(0x11e)],_0x237838=_0x89587f[_0x5241a7(0x116)],_0x45d3a4=_0x22dc0f[_0x5241a7(0x156)],_0x52c471=_0x89587f['output'];if(_0x3a1b6e&&_0x25d824)return console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x12f)](_0x5241a7(0x14e))),0x1;let _0x41e362='table';if(_0x89587f['json'])_0x41e362='json';else{if(_0x89587f[_0x5241a7(0x114)])_0x41e362='jsonl';else{if(_0x89587f[_0x5241a7(0x153)])_0x41e362=_0x5241a7(0x153);else{if(_0x89587f[_0x5241a7(0x15a)])_0x41e362=_0x5241a7(0x15a);}}}const _0x302d96=_0x89587f[_0x5241a7(0x14d)];let _0x57e864=_0x1fb218;const _0x28fd48=a5_0x4f2e51['existsSync'](_0x1fb218),_0x43515c=_0x1fb218==='.';if(!_0x28fd48||_0x43515c){const _0x108390=resolveProjectFromContext(_0x1fb218,_0x302d96,{'requireFile':_0x5241a7(0xff)});if(_0x108390['found'])_0x57e864=_0x108390[_0x5241a7(0x157)],_0x108390['source']===_0x5241a7(0xde)&&console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x100)](_0x5241a7(0xcd)+_0x57e864));else switch(_0x108390[_0x5241a7(0x101)]){case'no_context':console[_0x5241a7(0x141)](a5_0x3be005['yellow'](_0x108390[_0x5241a7(0x147)])),console[_0x5241a7(0x141)](),console[_0x5241a7(0x141)](_0x5241a7(0x15f)),console[_0x5241a7(0x141)](_0x5241a7(0x135)),console['log'](_0x5241a7(0x11b)),console[_0x5241a7(0x141)](),console['log'](_0x5241a7(0xc8));return 0x1;case'no_local_folder':console['log'](a5_0x3be005['yellow'](_0x108390['message'])),console[_0x5241a7(0x141)](),console['log'](_0x5241a7(0x159)+_0x108390[_0x5241a7(0x14d)]+_0x5241a7(0x146));return 0x1;case'multiple_agents':{const _0x5d7b6b=a5_0x36f54c[_0x5241a7(0x10d)](_0x108390[_0x5241a7(0x157)]);console[_0x5241a7(0x141)](a5_0x3be005['yellow'](_0x5241a7(0x15e)+_0x108390[_0x5241a7(0x14d)]+'\x22:'));for(const _0x52ad4f of _0x108390['agentDirs']){console[_0x5241a7(0x141)](_0x5241a7(0x105)+_0x52ad4f);}return console[_0x5241a7(0x141)](),console['log'](_0x5241a7(0x126)+_0x5d7b6b+_0x5241a7(0x13b)),0x1;}case'no_tests':console['log'](a5_0x3be005['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x108390[_0x5241a7(0x14d)]+'\x22.')),console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x100)](_0x5241a7(0x10e)+_0x108390[_0x5241a7(0x157)])),console[_0x5241a7(0x141)](),console['log'](_0x5241a7(0xea));return 0x1;}}const {definition:_0x43a75b,agentInfo:_0x287cea}=parseTestFile(_0x57e864);let _0x36e891=_0x43a75b[_0x5241a7(0xf1)];if(_0xe9ba32){const _0x1f7617=_0xe9ba32[_0x5241a7(0x148)](',')['map'](_0x3f31c7=>_0x3f31c7['trim']());_0x36e891=_0x43a75b[_0x5241a7(0xf1)][_0x5241a7(0xdf)](_0x401f0d=>_0x1f7617['includes'](_0x401f0d[_0x5241a7(0x11e)]));if(_0x36e891[_0x5241a7(0xeb)]===0x0)return console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x113)](_0x5241a7(0x15b)+_0xe9ba32)),console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x100)](_0x5241a7(0xd8)+_0x43a75b[_0x5241a7(0xf1)]['map'](_0x450d6b=>_0x450d6b[_0x5241a7(0x11e)])[_0x5241a7(0x138)](',\x20'))),0x1;}if(_0x237838){const _0x579a3a=_0x237838[_0x5241a7(0x148)](',')['map'](_0x68cf68=>_0x68cf68[_0x5241a7(0x102)]()[_0x5241a7(0x12d)]());_0x36e891=_0x36e891[_0x5241a7(0xdf)](_0x161b33=>_0x161b33[_0x5241a7(0x116)]?.[_0x5241a7(0xf8)](_0x3a9a36=>_0x579a3a[_0x5241a7(0x106)](_0x3a9a36[_0x5241a7(0x12d)]())));if(_0x36e891[_0x5241a7(0xeb)]===0x0){console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x113)](_0x5241a7(0xd6)+_0x237838));const _0x20bd35=new Set();return _0x43a75b[_0x5241a7(0xf1)][_0x5241a7(0x149)](_0x4f6c91=>_0x4f6c91[_0x5241a7(0x116)]?.[_0x5241a7(0x149)](_0x4c7438=>_0x20bd35[_0x5241a7(0x158)](_0x4c7438))),_0x20bd35['size']>0x0?console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x100)](_0x5241a7(0xe9)+[..._0x20bd35][_0x5241a7(0x138)](',\x20'))):console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x100)](_0x5241a7(0xdd))),0x1;}}if(_0x3a1b6e)return this[_0x5241a7(0x14f)](_0x5a3406,{'definition':{'tests':_0x36e891},'agentInfo':_0x287cea,'outputFormat':_0x41e362,'outputFile':_0x52c471,'testNames':_0xe9ba32});if(_0x8030bd){console['log'](a5_0x3be005[_0x5241a7(0x12c)](_0x5241a7(0x139))),console['log'](_0x5241a7(0xfb)+a5_0x3be005[_0x5241a7(0xed)](_0x45d3a4)),console[_0x5241a7(0x141)](_0x5241a7(0x154)+a5_0x3be005[_0x5241a7(0xed)](_0x287cea[_0x5241a7(0xdc)])),console[_0x5241a7(0x141)](_0x5241a7(0x132)+a5_0x3be005[_0x5241a7(0xed)](_0x287cea[_0x5241a7(0xfa)])),console[_0x5241a7(0x141)](),console[_0x5241a7(0x141)](_0x5241a7(0x137)+a5_0x3be005[_0x5241a7(0xed)](_0x36e891[_0x5241a7(0xeb)]));for(let _0x58b496=0x0;_0x58b496<_0x36e891[_0x5241a7(0xeb)];_0x58b496++){const _0x55c8a1=_0x36e891[_0x58b496],_0x20cb24=_0x55c8a1[_0x5241a7(0x143)][_0x5241a7(0xeb)]===0x1?_0x5241a7(0xf9):_0x5241a7(0x143),_0x27b2a3=_0x55c8a1['tags']?.[_0x5241a7(0xeb)]?'\x20['+_0x55c8a1['tags'][_0x5241a7(0x138)](',\x20')+']':'';console[_0x5241a7(0x141)]('\x20\x20'+(_0x58b496+0x1)+'.\x20'+a5_0x3be005[_0x5241a7(0xed)](_0x55c8a1['name'])+'\x20('+_0x55c8a1[_0x5241a7(0x143)][_0x5241a7(0xeb)]+'\x20'+_0x20cb24+')'+a5_0x3be005[_0x5241a7(0x100)](_0x27b2a3));}return 0x0;}let _0x8fb466,_0x3cfec8;try{_0x8fb466=await _0x48b81c[_0x5241a7(0xc7)]['resolveProjectId'](_0x287cea[_0x5241a7(0xdc)]);}catch(_0x21cb59){const _0x1bd43c=_0x21cb59 instanceof Error?_0x21cb59[_0x5241a7(0x147)]:String(_0x21cb59);return _0x1bd43c[_0x5241a7(0x106)]('404')||_0x1bd43c[_0x5241a7(0x12d)]()[_0x5241a7(0x106)](_0x5241a7(0xe3))?console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x12f)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x287cea[_0x5241a7(0xdc)])):console[_0x5241a7(0x141)](a5_0x3be005['red'](_0x5241a7(0xe2)+_0x287cea[_0x5241a7(0xdc)]+_0x5241a7(0x109)+_0x1bd43c)),0x1;}try{_0x3cfec8=await _0x48b81c['llm'][_0x5241a7(0x128)](_0x287cea[_0x5241a7(0xfa)],_0x8fb466);}catch(_0x58fce6){const _0xe95e45=_0x58fce6 instanceof Error?_0x58fce6['message']:String(_0x58fce6);return _0xe95e45[_0x5241a7(0x106)](_0x5241a7(0x155))||_0xe95e45[_0x5241a7(0x12d)]()[_0x5241a7(0x106)]('not\x20found')?console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x12f)](_0x5241a7(0x115)+_0x287cea['agentName'])):console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x12f)](_0x5241a7(0x120)+_0x287cea[_0x5241a7(0xfa)]+_0x5241a7(0x109)+_0xe95e45)),0x1;}let _0x55d927;if(!_0x25d824)try{_0x55d927=await setupEvaluatorAgent(_0x48b81c[_0x5241a7(0xc7)],_0x22dc0f['verbose']);}catch(_0x1804c1){const _0x505b43=_0x1804c1 instanceof Error?_0x1804c1[_0x5241a7(0x147)]:String(_0x1804c1);return console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x12f)](_0x5241a7(0x152)+_0x505b43)),0x1;}console['log'](a5_0x3be005[_0x5241a7(0x12c)](_0x5241a7(0xd0))),console[_0x5241a7(0x141)](_0x5241a7(0xd3)+a5_0x3be005[_0x5241a7(0xed)](_0x45d3a4)),console['log'](_0x5241a7(0x12a)+a5_0x3be005[_0x5241a7(0xed)](_0x287cea[_0x5241a7(0xdc)]+'/'+_0x287cea[_0x5241a7(0xfa)])),console[_0x5241a7(0x141)]();const _0x101f6c=[],_0x5c985e=[],_0x76928c=Date[_0x5241a7(0xcc)]();for(let _0x105425=0x0;_0x105425<_0x36e891[_0x5241a7(0xeb)];_0x105425++){const _0x4855f3=_0x36e891[_0x105425];_0x36e891[_0x5241a7(0xeb)]>0x1?console['log']('Test\x20'+(_0x105425+0x1)+'/'+_0x36e891[_0x5241a7(0xeb)]+':\x20'+a5_0x3be005[_0x5241a7(0xed)](_0x4855f3[_0x5241a7(0x11e)])):console[_0x5241a7(0x141)](_0x5241a7(0x140)+a5_0x3be005[_0x5241a7(0xed)](_0x4855f3[_0x5241a7(0x11e)]));const _0x2022b8=createCommandSpinner(_0x5241a7(0x134)+_0x4855f3[_0x5241a7(0x143)]['length']+_0x5241a7(0x151));_0x2022b8[_0x5241a7(0xcb)]();try{const {result:_0x2d4328,conversation:_0x1ad108}=await runTest(_0x48b81c[_0x5241a7(0xc7)],_0x4855f3,{'agentId':_0x3cfec8,'projectId':_0x8fb466,'site':_0x45d3a4,'noEval':_0x25d824,'evaluatorId':_0x55d927,'onRoundStart':(_0x4bf3e4,_0x351245)=>{const _0x59c252=_0x5241a7;_0x2022b8['text']=_0x59c252(0xdb)+(_0x4bf3e4+0x1)+'/'+_0x351245+_0x59c252(0x151);},'onRoundComplete':(_0x5886ef,_0x3d93ec,_0x55a36f)=>{const _0x274d83=_0x5241a7,_0x957014=formatElapsed(_0x3d93ec);_0x55a36f?console[_0x274d83(0x141)](_0x274d83(0x123)+(_0x5886ef+0x1)+'/'+_0x4855f3[_0x274d83(0x143)]['length']+_0x274d83(0x13e)+a5_0x3be005['green']('✓')+'\x20('+_0x957014+')'):console['log'](_0x274d83(0x123)+(_0x5886ef+0x1)+'/'+_0x4855f3[_0x274d83(0x143)][_0x274d83(0xeb)]+'...\x20'+a5_0x3be005[_0x274d83(0x12f)]('✗'));},'onEvaluationStart':()=>{const _0xef914f=_0x5241a7;_0x2022b8[_0xef914f(0x150)]=_0xef914f(0xd5);},'onEvaluationComplete':_0x2da938=>{const _0x2dbb58=_0x5241a7,_0x137835=formatElapsed(_0x2da938);console[_0x2dbb58(0x141)](_0x2dbb58(0xce)+a5_0x3be005[_0x2dbb58(0x10b)]('✓')+'\x20('+_0x137835+')');}});_0x2022b8['stop'](),_0x101f6c[_0x5241a7(0xf7)](_0x2d4328),_0x5c985e['push'](_0x1ad108);if(_0x2d4328['status']===_0x5241a7(0xe4))console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x10b)](_0x5241a7(0xf3)+_0x2d4328[_0x5241a7(0x101)]));else _0x2d4328[_0x5241a7(0xfd)]===_0x5241a7(0xe1)?console['log'](a5_0x3be005[_0x5241a7(0x12f)](_0x5241a7(0x108)+_0x2d4328[_0x5241a7(0x101)])):console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x12f)](_0x5241a7(0x127)+_0x2d4328[_0x5241a7(0x101)]));_0x2d4328[_0x5241a7(0x145)]&&console['log'](a5_0x3be005[_0x5241a7(0x100)](_0x5241a7(0xf6)+_0x2d4328[_0x5241a7(0x145)])),console[_0x5241a7(0x141)]();}catch(_0x4787d0){_0x2022b8[_0x5241a7(0x136)]();const _0x4c0d95=_0x4787d0 instanceof Error?_0x4787d0['message']:String(_0x4787d0);console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x12f)](_0x5241a7(0x127)+_0x4c0d95)),console[_0x5241a7(0x141)](),_0x101f6c[_0x5241a7(0xf7)]({'name':_0x4855f3[_0x5241a7(0x11e)],'status':_0x5241a7(0x14a),'reason':_0x4c0d95,'timestamp':new Date()[_0x5241a7(0xee)](),'duration_ms':0x0});}}const _0x36b81f=Date[_0x5241a7(0xcc)]()-_0x76928c,_0xe37d37=_0x101f6c[_0x5241a7(0xdf)](_0x3bcc27=>_0x3bcc27[_0x5241a7(0xfd)]===_0x5241a7(0xe4))[_0x5241a7(0xeb)],_0x58a349=_0x101f6c[_0x5241a7(0xdf)](_0x191a05=>_0x191a05[_0x5241a7(0xfd)]===_0x5241a7(0xe1))[_0x5241a7(0xeb)],_0x394510=_0x101f6c[_0x5241a7(0xdf)](_0xe798b2=>_0xe798b2['status']==='ERROR')[_0x5241a7(0xeb)];console[_0x5241a7(0x141)]('━'[_0x5241a7(0x11c)](0x3c)),console[_0x5241a7(0x141)](_0x5241a7(0x122)),console[_0x5241a7(0x141)]('━'[_0x5241a7(0x11c)](0x3c)),console[_0x5241a7(0x141)]('Total:\x20\x20\x20\x20'+_0x101f6c[_0x5241a7(0xeb)]),console[_0x5241a7(0x141)](_0x5241a7(0x130)+a5_0x3be005['green'](_0xe37d37)),console[_0x5241a7(0x141)](_0x5241a7(0xe7)+a5_0x3be005['red'](_0x58a349));_0x394510>0x0&&console[_0x5241a7(0x141)]('Errors:\x20\x20\x20'+a5_0x3be005['red'](_0x394510));console[_0x5241a7(0x141)](_0x5241a7(0x119)+formatElapsed(_0x36b81f)),console[_0x5241a7(0x141)]('━'[_0x5241a7(0x11c)](0x3c));const _0x298b8c=_0x101f6c['filter'](_0x576701=>_0x576701[_0x5241a7(0xfd)]!==_0x5241a7(0xe4));if(_0x298b8c[_0x5241a7(0xeb)]>0x0){console[_0x5241a7(0x141)](),console[_0x5241a7(0x141)](_0x5241a7(0xc9));for(const _0x3cb89a of _0x298b8c){const _0x2d0eb7=a5_0x3be005[_0x5241a7(0x12f)]('✗'),_0x2a2e23=_0x3cb89a[_0x5241a7(0x101)][_0x5241a7(0xeb)]>0x32?_0x3cb89a[_0x5241a7(0x101)][_0x5241a7(0x111)](0x0,0x32)+_0x5241a7(0x133):_0x3cb89a[_0x5241a7(0x101)];console[_0x5241a7(0x141)]('\x20\x20'+_0x2d0eb7+'\x20'+_0x3cb89a[_0x5241a7(0x11e)]+':\x20'+_0x2a2e23);}}const _0x4f489f={'summary':{'total':_0x101f6c[_0x5241a7(0xeb)],'passed':_0xe37d37,'failed':_0x58a349,'errors':_0x394510>0x0?_0x394510:undefined,'duration_ms':_0x36b81f},'tests':_0x101f6c,'agent':{'project':_0x287cea[_0x5241a7(0xdc)],'name':_0x287cea['agentName'],'site':_0x45d3a4},'timestamp':new Date(_0x76928c)[_0x5241a7(0xee)]()};try{const _0xa491f6=buildCachedTestRun(_0x5c985e,{'site':_0x45d3a4,'projectId':_0x8fb466,'projectName':_0x287cea[_0x5241a7(0xdc)],'agentId':_0x3cfec8,'agentName':_0x287cea[_0x5241a7(0xfa)],'testYmlPath':a5_0x36f54c[_0x5241a7(0x129)](_0x287cea[_0x5241a7(0xd2)])});saveLastTestRun(_0xa491f6);}catch{}if(_0x41e362!==_0x5241a7(0x15a)||_0x52c471){const _0x8f43c7=formatResults(_0x4f489f,_0x41e362);if(_0x52c471)try{a5_0x4f2e51[_0x5241a7(0x131)](_0x52c471,_0x8f43c7,_0x5241a7(0xe6)),console['log'](),console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x100)](_0x5241a7(0x12b)+_0x52c471));}catch(_0x34b059){return console[_0x5241a7(0x141)](),console[_0x5241a7(0x141)](a5_0x3be005[_0x5241a7(0x12f)]('Error\x20writing\x20output\x20file:\x20'+_0x34b059)),0x1;}else console[_0x5241a7(0x141)](),console[_0x5241a7(0x141)](_0x8f43c7);}return _0x298b8c[_0x5241a7(0xeb)]>0x0?0x1:0x0;}async['executeReeval'](_0x5a19e7,_0x1e3cc2){const _0x3ebbaa=a5_0x288ad2,{options:_0x228a1c,tdx:_0xa112e}=_0x5a19e7,{definition:_0x486b30,agentInfo:_0x202005,outputFormat:_0x29cfb5,outputFile:_0x137657}=_0x1e3cc2,_0x206304=_0x228a1c[_0x3ebbaa(0x156)],_0x51ff7d=loadLastTestRun();if(!_0x51ff7d)return console[_0x3ebbaa(0x141)](a5_0x3be005['red'](_0x3ebbaa(0x110))),console[_0x3ebbaa(0x141)](a5_0x3be005['dim'](_0x3ebbaa(0x14b))),0x1;if(_0x51ff7d[_0x3ebbaa(0x13f)]['agentName']!==_0x202005['agentName'])return console['log'](a5_0x3be005[_0x3ebbaa(0x12f)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x51ff7d['agent']['agentName']+_0x3ebbaa(0xfe)+_0x202005[_0x3ebbaa(0xfa)]+'\x22.')),console[_0x3ebbaa(0x141)](a5_0x3be005[_0x3ebbaa(0x100)](_0x3ebbaa(0x15d))),0x1;const _0x4d8f88=new Set(_0x51ff7d['conversations'][_0x3ebbaa(0x13a)](_0x59ca60=>_0x59ca60['testName'])),_0x239f30=_0x486b30['tests'][_0x3ebbaa(0xdf)](_0x3b4029=>!_0x4d8f88[_0x3ebbaa(0xf5)](_0x3b4029[_0x3ebbaa(0x11e)]));if(_0x239f30[_0x3ebbaa(0xeb)]>0x0&&_0x51ff7d[_0x3ebbaa(0x156)]!==_0x206304)return console[_0x3ebbaa(0x141)](a5_0x3be005[_0x3ebbaa(0x12f)](_0x3ebbaa(0x11f))),console[_0x3ebbaa(0x141)](a5_0x3be005[_0x3ebbaa(0x100)](_0x3ebbaa(0x11d)+_0x51ff7d[_0x3ebbaa(0x156)]+_0x3ebbaa(0x13d)+_0x206304+'\x22.')),console['log'](a5_0x3be005[_0x3ebbaa(0x100)](_0x3ebbaa(0x118)+_0x51ff7d[_0x3ebbaa(0x156)]+_0x3ebbaa(0x121))),0x1;const _0x4efb53=_0x486b30[_0x3ebbaa(0xf1)][_0x3ebbaa(0xdf)](_0x3badd7=>_0x4d8f88[_0x3ebbaa(0xf5)](_0x3badd7[_0x3ebbaa(0x11e)])),_0x2203f6=_0x239f30;let _0x248c7b;try{_0x248c7b=await setupEvaluatorAgent(_0xa112e[_0x3ebbaa(0xc7)],_0x228a1c['verbose']);}catch(_0x233060){const _0x1761d1=_0x233060 instanceof Error?_0x233060[_0x3ebbaa(0x147)]:String(_0x233060);return console['log'](a5_0x3be005['red'](_0x3ebbaa(0x152)+_0x1761d1)),0x1;}console[_0x3ebbaa(0x141)](a5_0x3be005[_0x3ebbaa(0x12c)](_0x3ebbaa(0xcf))),console[_0x3ebbaa(0x141)]('Cached\x20run\x20from:\x20'+a5_0x3be005['white'](_0x51ff7d[_0x3ebbaa(0xe0)])),console[_0x3ebbaa(0x141)]('Agent:\x20'+a5_0x3be005[_0x3ebbaa(0xed)](_0x51ff7d[_0x3ebbaa(0x13f)][_0x3ebbaa(0xdc)]+'/'+_0x51ff7d['agent'][_0x3ebbaa(0xfa)]));_0x2203f6[_0x3ebbaa(0xeb)]>0x0&&console['log'](_0x3ebbaa(0x12e)+a5_0x3be005['yellow'](_0x2203f6[_0x3ebbaa(0xeb)]));console[_0x3ebbaa(0x141)]();const _0x4a292f=[],_0x519034=Date[_0x3ebbaa(0xcc)](),_0x109668=createCommandSpinner(_0x3ebbaa(0xd9));if(_0x4efb53[_0x3ebbaa(0xeb)]>0x0)try{const _0x386ec2=await reevaluateFromCache(_0xa112e[_0x3ebbaa(0xc7)],_0x51ff7d,{'tests':_0x4efb53},{'evaluatorId':_0x248c7b,'onTestStart':(_0x34799c,_0x5713c1,_0x21159f)=>{const _0x2d25ab=_0x3ebbaa;_0x109668[_0x2d25ab(0x150)]=_0x2d25ab(0x107)+(_0x5713c1+0x1)+'/'+_0x21159f+':\x20'+_0x34799c+_0x2d25ab(0x133);if(!_0x109668['isSpinning'])_0x109668[_0x2d25ab(0xcb)]();},'onTestComplete':(_0xb5ef73,_0x93ff46)=>{const _0x595244=_0x3ebbaa;_0x109668[_0x595244(0x136)]();if(_0x93ff46['status']===_0x595244(0xe4))console[_0x595244(0x141)](a5_0x3be005[_0x595244(0x10b)](_0x595244(0xf3)+_0xb5ef73)+a5_0x3be005[_0x595244(0x100)]('\x20(cached)'));else _0x93ff46[_0x595244(0xfd)]===_0x595244(0xe1)?console[_0x595244(0x141)](a5_0x3be005['red']('✗\x20FAIL:\x20'+_0xb5ef73+_0x595244(0x124)+_0x93ff46[_0x595244(0x101)])+a5_0x3be005[_0x595244(0x100)](_0x595244(0xef))):console[_0x595244(0x141)](a5_0x3be005[_0x595244(0x12f)](_0x595244(0x127)+_0xb5ef73+_0x595244(0x124)+_0x93ff46[_0x595244(0x101)]));_0x93ff46['conversation_url']&&console['log'](a5_0x3be005['dim'](_0x595244(0x117)+_0x93ff46['conversation_url'])),_0x4a292f[_0x595244(0xf7)](_0x93ff46);},'onTestSkipped':(_0x31e81b,_0xc01899)=>{const _0x2d9858=_0x3ebbaa;_0x109668['stop'](),console[_0x2d9858(0x141)](a5_0x3be005[_0x2d9858(0x113)](_0x2d9858(0xca)+_0x31e81b+'\x20-\x20'+_0xc01899));}});for(const _0x180403 of _0x386ec2){!_0x4a292f[_0x3ebbaa(0x10c)](_0x2d75a0=>_0x2d75a0[_0x3ebbaa(0x11e)]===_0x180403[_0x3ebbaa(0x11e)])&&_0x4a292f[_0x3ebbaa(0xf7)](_0x180403);}}catch(_0x3abedb){_0x109668['stop']();const _0x27814a=_0x3abedb instanceof Error?_0x3abedb['message']:String(_0x3abedb);return console[_0x3ebbaa(0x141)](a5_0x3be005[_0x3ebbaa(0x12f)](_0x3ebbaa(0x104)+_0x27814a)),0x1;}_0x109668[_0x3ebbaa(0x136)]();if(_0x2203f6[_0x3ebbaa(0xeb)]>0x0){console['log'](),console[_0x3ebbaa(0x141)](a5_0x3be005[_0x3ebbaa(0x12c)]('Executing\x20new\x20tests...'));const {projectId:_0x5db8ed,agentId:_0x52fd70}=_0x51ff7d[_0x3ebbaa(0x13f)];for(const _0x3a1240 of _0x2203f6){console['log']('Running:\x20'+a5_0x3be005[_0x3ebbaa(0xed)](_0x3a1240['name']));const _0x4e67d7=createCommandSpinner(_0x3ebbaa(0x134)+_0x3a1240[_0x3ebbaa(0x143)]['length']+_0x3ebbaa(0x151));_0x4e67d7[_0x3ebbaa(0xcb)]();try{const {result:_0x43f4ef}=await runTest(_0xa112e[_0x3ebbaa(0xc7)],_0x3a1240,{'agentId':_0x52fd70,'projectId':_0x5db8ed,'site':_0x51ff7d['site'],'noEval':![],'evaluatorId':_0x248c7b,'onRoundStart':(_0x150e59,_0x46204c)=>{const _0x559463=_0x3ebbaa;_0x4e67d7['text']=_0x559463(0xdb)+(_0x150e59+0x1)+'/'+_0x46204c+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x1d7bb0,_0x565848,_0x40eb87)=>{const _0x34700d=_0x3ebbaa,_0xf0e3ab=formatElapsed(_0x565848);_0x40eb87?console[_0x34700d(0x141)](_0x34700d(0x123)+(_0x1d7bb0+0x1)+'/'+_0x3a1240[_0x34700d(0x143)][_0x34700d(0xeb)]+'...\x20'+a5_0x3be005[_0x34700d(0x10b)]('✓')+'\x20('+_0xf0e3ab+')'):console[_0x34700d(0x141)](_0x34700d(0x123)+(_0x1d7bb0+0x1)+'/'+_0x3a1240[_0x34700d(0x143)][_0x34700d(0xeb)]+_0x34700d(0x13e)+a5_0x3be005[_0x34700d(0x12f)]('✗'));},'onEvaluationStart':()=>{const _0x167f08=_0x3ebbaa;_0x4e67d7[_0x167f08(0x150)]='Evaluating\x20response...';},'onEvaluationComplete':_0x440962=>{const _0x390ac5=_0x3ebbaa,_0x59ea6e=formatElapsed(_0x440962);console[_0x390ac5(0x141)](_0x390ac5(0xce)+a5_0x3be005[_0x390ac5(0x10b)]('✓')+'\x20('+_0x59ea6e+')');}});_0x4e67d7[_0x3ebbaa(0x136)](),_0x4a292f['push'](_0x43f4ef);if(_0x43f4ef[_0x3ebbaa(0xfd)]===_0x3ebbaa(0xe4))console[_0x3ebbaa(0x141)](a5_0x3be005['green']('✓\x20PASS:\x20'+_0x43f4ef[_0x3ebbaa(0x101)])+a5_0x3be005[_0x3ebbaa(0x100)](_0x3ebbaa(0x10a)));else _0x43f4ef['status']==='FAIL'?console['log'](a5_0x3be005[_0x3ebbaa(0x12f)](_0x3ebbaa(0x108)+_0x43f4ef[_0x3ebbaa(0x101)])+a5_0x3be005['dim'](_0x3ebbaa(0x10a))):console[_0x3ebbaa(0x141)](a5_0x3be005[_0x3ebbaa(0x12f)](_0x3ebbaa(0x127)+_0x43f4ef[_0x3ebbaa(0x101)]));_0x43f4ef[_0x3ebbaa(0x145)]&&console[_0x3ebbaa(0x141)](a5_0x3be005[_0x3ebbaa(0x100)](_0x3ebbaa(0x117)+_0x43f4ef['conversation_url']));}catch(_0x295196){_0x4e67d7[_0x3ebbaa(0x136)]();const _0x54c7ce=_0x295196 instanceof Error?_0x295196[_0x3ebbaa(0x147)]:String(_0x295196);console[_0x3ebbaa(0x141)](a5_0x3be005[_0x3ebbaa(0x12f)]('✗\x20ERROR:\x20'+_0x54c7ce)),_0x4a292f['push']({'name':_0x3a1240[_0x3ebbaa(0x11e)],'status':_0x3ebbaa(0x14a),'reason':_0x54c7ce,'timestamp':new Date()[_0x3ebbaa(0xee)](),'duration_ms':0x0});}}}console['log']();const _0x51656a=Date[_0x3ebbaa(0xcc)]()-_0x519034,_0x5a6589=_0x4a292f[_0x3ebbaa(0xdf)](_0x59f40a=>_0x59f40a[_0x3ebbaa(0xfd)]==='PASS')['length'],_0x99d149=_0x4a292f[_0x3ebbaa(0xdf)](_0xc84dcc=>_0xc84dcc[_0x3ebbaa(0xfd)]===_0x3ebbaa(0xe1))[_0x3ebbaa(0xeb)],_0x3e1e4a=_0x4a292f[_0x3ebbaa(0xdf)](_0x491e08=>_0x491e08[_0x3ebbaa(0xfd)]==='ERROR')['length'];console[_0x3ebbaa(0x141)]('━'[_0x3ebbaa(0x11c)](0x3c)),console[_0x3ebbaa(0x141)](_0x3ebbaa(0xf2)),console[_0x3ebbaa(0x141)]('━'[_0x3ebbaa(0x11c)](0x3c)),console[_0x3ebbaa(0x141)](_0x3ebbaa(0x142)+_0x4a292f[_0x3ebbaa(0xeb)]),console[_0x3ebbaa(0x141)](_0x3ebbaa(0x130)+a5_0x3be005[_0x3ebbaa(0x10b)](_0x5a6589)),console[_0x3ebbaa(0x141)]('Failed:\x20\x20\x20'+a5_0x3be005[_0x3ebbaa(0x12f)](_0x99d149));_0x3e1e4a>0x0&&console['log'](_0x3ebbaa(0xe8)+a5_0x3be005[_0x3ebbaa(0x12f)](_0x3e1e4a));console[_0x3ebbaa(0x141)](_0x3ebbaa(0x119)+formatElapsed(_0x51656a)),console[_0x3ebbaa(0x141)]('━'[_0x3ebbaa(0x11c)](0x3c));const _0x2189b6={'summary':{'total':_0x4a292f[_0x3ebbaa(0xeb)],'passed':_0x5a6589,'failed':_0x99d149,'errors':_0x3e1e4a>0x0?_0x3e1e4a:undefined,'duration_ms':_0x51656a},'tests':_0x4a292f,'agent':{'project':_0x202005[_0x3ebbaa(0xdc)],'name':_0x202005['agentName'],'site':_0x206304},'timestamp':new Date(_0x519034)[_0x3ebbaa(0xee)]()};if(_0x29cfb5!=='table'||_0x137657){const _0x4bc716=formatResults(_0x2189b6,_0x29cfb5);if(_0x137657)try{a5_0x4f2e51[_0x3ebbaa(0x131)](_0x137657,_0x4bc716,_0x3ebbaa(0xe6)),console[_0x3ebbaa(0x141)](),console['log'](a5_0x3be005['dim'](_0x3ebbaa(0x12b)+_0x137657));}catch(_0x344c3c){return console[_0x3ebbaa(0x141)](),console[_0x3ebbaa(0x141)](a5_0x3be005['red']('Error\x20writing\x20output\x20file:\x20'+_0x344c3c)),0x1;}else console['log'](),console['log'](_0x4bc716);}const _0x37f5d9=_0x4a292f[_0x3ebbaa(0xdf)](_0x443cde=>_0x443cde[_0x3ebbaa(0xfd)]!=='PASS');return _0x37f5d9[_0x3ebbaa(0xeb)]>0x0?0x1:0x0;}}
@@ -1 +1 @@
1
- const a6_0x5e1656=a6_0x64b3;(function(_0x36b4e3,_0x3941f6){const _0x2a42c3=a6_0x64b3,_0x31bf67=_0x36b4e3();while(!![]){try{const _0x388a45=-parseInt(_0x2a42c3(0x125))/0x1+-parseInt(_0x2a42c3(0x143))/0x2*(parseInt(_0x2a42c3(0x14b))/0x3)+-parseInt(_0x2a42c3(0x136))/0x4+parseInt(_0x2a42c3(0x121))/0x5+-parseInt(_0x2a42c3(0x13f))/0x6+-parseInt(_0x2a42c3(0x11e))/0x7*(-parseInt(_0x2a42c3(0x12a))/0x8)+-parseInt(_0x2a42c3(0x131))/0x9*(-parseInt(_0x2a42c3(0x12b))/0xa);if(_0x388a45===_0x3941f6)break;else _0x31bf67['push'](_0x31bf67['shift']());}catch(_0xe463f8){_0x31bf67['push'](_0x31bf67['shift']());}}}(a6_0x4edd,0x3f200));import{BaseCommand}from'./command.js';function a6_0x64b3(_0x20813a,_0x2bb867){_0x20813a=_0x20813a-0x116;const _0x4edd25=a6_0x4edd();let _0x64b372=_0x4edd25[_0x20813a];return _0x64b372;}import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';function a6_0x4edd(){const _0x29ebc4=['.\x20Valid\x20types:\x20','substring','description','request','1596OCDnrh','Endpoint\x20must\x20start\x20with\x20/:\x20','validate','1200050hYEEVc','authorization','cookie','keys','342438BcYWIK','indexOf','proxy-authorization','PATCH','Invalid\x20header\x20format:\x20\x22','8672dFaJKs','290WwACkx','DELETE','color','log','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','<\x20HTTP/1.1\x20','277713eHZYeu','POST','Invalid\x20HTTP\x20method:\x20','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','3028uAuPus','message','body','workflow','method','length','entries','Error:\x20','x-trino-user','1744680bqPEKV','join','PUT','toUpperCase','32632WxKiuT','verbose','llm','headers','isArray','GET','toLowerCase','\x0aStack\x20trace:\x0a','90sOpiQy','output','startsWith','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','readBodyFromFile','x-xsrf-token','.\x20Valid\x20methods:\x20','includes','has','data','trim','error','status','x-auth-token','type','trino','api'];a6_0x4edd=function(){return _0x29ebc4;};return a6_0x4edd();}import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x5e1656(0x122),a6_0x5e1656(0x127),a6_0x5e1656(0x123),'set-cookie','set-cookie2',a6_0x5e1656(0x150),a6_0x5e1656(0x116),a6_0x5e1656(0x13e)]);function isSensitiveHeader(_0x11b4e0){const _0x378736=a6_0x5e1656;return SENSITIVE_HEADERS[_0x378736(0x153)](_0x11b4e0[_0x378736(0x149)]());}function parseHeader(_0x7611e2){const _0x2d4ed1=a6_0x5e1656,_0x423acc=_0x7611e2[_0x2d4ed1(0x126)](':');if(_0x423acc===-0x1)throw new Error(_0x2d4ed1(0x129)+_0x7611e2+'\x22.\x20'+_0x2d4ed1(0x14e));const _0x5e2dc4=_0x7611e2['substring'](0x0,_0x423acc)['trim'](),_0x37dc9b=_0x7611e2[_0x2d4ed1(0x11b)](_0x423acc+0x1)[_0x2d4ed1(0x155)]();if(!_0x5e2dc4)throw new Error(_0x2d4ed1(0x12f)+_0x7611e2+'\x22');return[_0x5e2dc4,_0x37dc9b];}export class ApiCommand extends BaseCommand{['name']=a6_0x5e1656(0x119);[a6_0x5e1656(0x11c)]=a6_0x5e1656(0x135);[a6_0x5e1656(0x120)](_0x193fdf){const _0x18c0cc=a6_0x5e1656,{args:_0x3e91ea,options:_0x31a94b}=_0x193fdf,_0xcd7208=_0x31a94b;if(_0x3e91ea[_0x18c0cc(0x13b)]===0x0)return _0x18c0cc(0x134);const _0x3bdaaf=_0x3e91ea[0x0];if(!_0x3bdaaf[_0x18c0cc(0x14d)]('/'))return _0x18c0cc(0x11f)+_0x3bdaaf;const _0x1fc660=_0xcd7208[_0x18c0cc(0x154)],_0x20535b=_0xcd7208['file'];if(_0x1fc660&&_0x20535b)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x5936e6=_0xcd7208[_0x18c0cc(0x13a)]||'GET',_0x4c622d=[_0x18c0cc(0x148),_0x18c0cc(0x132),_0x18c0cc(0x141),_0x18c0cc(0x12c),_0x18c0cc(0x128)];if(!_0x4c622d[_0x18c0cc(0x152)](_0x5936e6['toUpperCase']()))return _0x18c0cc(0x133)+_0x5936e6+_0x18c0cc(0x151)+_0x4c622d[_0x18c0cc(0x140)](',\x20');const _0x5ce09f=_0xcd7208[_0x18c0cc(0x117)]||'td',_0x4a4693=['td','cdp',_0x18c0cc(0x139),_0x18c0cc(0x118),_0x18c0cc(0x145),'llm-proxy','cas'];if(!_0x4a4693[_0x18c0cc(0x152)](_0x5ce09f))return'Invalid\x20API\x20type:\x20'+_0x5ce09f+_0x18c0cc(0x11a)+_0x4a4693[_0x18c0cc(0x140)](',\x20');return undefined;}async['execute'](_0x59f63f){const _0x3cf216=a6_0x5e1656,{options:_0x4e26b6,args:_0x2a1442,tdx:_0x2349e2}=_0x59f63f,_0x30afce=_0x4e26b6,_0x771aa0=_0x2a1442[0x0],_0x4e8607=(_0x30afce[_0x3cf216(0x13a)]||_0x3cf216(0x148))[_0x3cf216(0x142)](),_0xdd4d7f=_0x30afce[_0x3cf216(0x154)],_0x562802=_0x30afce['file'],_0x35533d=_0x30afce['header'],_0x4509f6=_0x30afce[_0x3cf216(0x117)]||'td';try{const _0x5b883c={};if(_0x35533d){const _0x3516de=Array[_0x3cf216(0x147)](_0x35533d)?_0x35533d:[_0x35533d];for(const _0x33153b of _0x3516de){const [_0x1ddab0,_0x35280c]=parseHeader(_0x33153b);_0x5b883c[_0x1ddab0]=_0x35280c;}}let _0x341d88;if(_0xdd4d7f)_0x341d88=_0xdd4d7f;else{if(_0x562802)try{_0x341d88=RawAPI[_0x3cf216(0x14f)](_0x562802);}catch(_0x42b180){return console['error'](_0x3cf216(0x13d)+(_0x42b180 instanceof Error?_0x42b180[_0x3cf216(0x137)]:String(_0x42b180))),0x1;}}const _0x345cc1={'method':_0x4e8607,'apiType':_0x4509f6,'includeHeaders':_0x4e26b6[_0x3cf216(0x144)]};_0x341d88&&(_0x345cc1[_0x3cf216(0x138)]=_0x341d88);Object[_0x3cf216(0x124)](_0x5b883c)['length']>0x0&&(_0x345cc1[_0x3cf216(0x146)]=_0x5b883c);if(_0x4e26b6[_0x3cf216(0x144)]){const _0x180d77=resolveSite(_0x4e26b6['site']),_0x13fca4=getEndpoint(_0x180d77,_0x4509f6),_0x324ada=''+_0x13fca4+_0x771aa0;console[_0x3cf216(0x156)]('>\x20'+_0x4e8607+'\x20'+_0x324ada);const _0x50511e=getAuthHeaders(_0x180d77),_0x1a86bf={..._0x50511e,..._0x5b883c};for(const [_0x4ba7b7,_0x1bdb3d]of Object[_0x3cf216(0x13c)](_0x1a86bf)){!isSensitiveHeader(_0x4ba7b7)&&console[_0x3cf216(0x156)]('>\x20'+_0x4ba7b7+':\x20'+_0x1bdb3d);}_0x341d88&&console[_0x3cf216(0x156)]('>'),console[_0x3cf216(0x156)]('');}const _0x41fcca=await _0x2349e2[_0x3cf216(0x119)][_0x3cf216(0x11d)](_0x771aa0,_0x345cc1);if(_0x4e26b6['verbose']&&_0x41fcca['headers']){console[_0x3cf216(0x156)](_0x3cf216(0x130)+_0x41fcca[_0x3cf216(0x157)]);for(const [_0x5758ca,_0x382e77]of Object['entries'](_0x41fcca[_0x3cf216(0x146)])){!isSensitiveHeader(_0x5758ca)&&console[_0x3cf216(0x156)]('<\x20'+_0x5758ca+':\x20'+_0x382e77);}console[_0x3cf216(0x156)]('');}const _0xa5c4c2=Boolean(_0x4e26b6['output']),_0x13dc16={'color':_0x4e26b6[_0x3cf216(0x12d)],'noColor':_0x4e26b6['noColor']||_0xa5c4c2&&!_0x4e26b6[_0x3cf216(0x12d)]},_0x453403=colorizeJSON(_0x41fcca['data'],_0x13dc16);return _0x4e26b6[_0x3cf216(0x14c)]?(writeFileSync(_0x4e26b6[_0x3cf216(0x14c)],_0x453403),console[_0x3cf216(0x156)]('Results\x20saved\x20to\x20'+_0x4e26b6[_0x3cf216(0x14c)])):console[_0x3cf216(0x12e)](_0x453403),0x0;}catch(_0x229c0a){return _0x229c0a instanceof Error?(console[_0x3cf216(0x156)](_0x3cf216(0x13d)+_0x229c0a[_0x3cf216(0x137)]),_0x4e26b6[_0x3cf216(0x144)]&&_0x229c0a['stack']&&console[_0x3cf216(0x156)](_0x3cf216(0x14a)+_0x229c0a['stack'])):console[_0x3cf216(0x156)](_0x3cf216(0x13d)+String(_0x229c0a)),0x1;}}}
1
+ const a6_0x31991b=a6_0x6311;(function(_0x430792,_0x321cb4){const _0x173d63=a6_0x6311,_0x5f2439=_0x430792();while(!![]){try{const _0x469e55=parseInt(_0x173d63(0x15b))/0x1+parseInt(_0x173d63(0x137))/0x2+-parseInt(_0x173d63(0x154))/0x3*(parseInt(_0x173d63(0x146))/0x4)+parseInt(_0x173d63(0x15f))/0x5*(parseInt(_0x173d63(0x14c))/0x6)+-parseInt(_0x173d63(0x147))/0x7+-parseInt(_0x173d63(0x149))/0x8*(-parseInt(_0x173d63(0x135))/0x9)+-parseInt(_0x173d63(0x132))/0xa*(parseInt(_0x173d63(0x131))/0xb);if(_0x469e55===_0x321cb4)break;else _0x5f2439['push'](_0x5f2439['shift']());}catch(_0x2e46e7){_0x5f2439['push'](_0x5f2439['shift']());}}}(a6_0x10da,0x4379e));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a6_0x10da(){const _0x2ae865=['method','data','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','x-auth-token','request','set-cookie2','log','llm','verbose','headers','DELETE','POST','PATCH','type','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','substring','Results\x20saved\x20to\x20','33waWKpd','392730XAgfVU','output','message','9yUFjle','cookie','1063006CTWdlV','GET','Error:\x20','api','x-xsrf-token','\x22.\x20','stack','noColor','body','file','name','join','entries','.\x20Valid\x20types:\x20','error','1969048BgqBDi','3221624OKrxaY','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','2570448DCZvTd','proxy-authorization','.\x20Valid\x20methods:\x20','2862uDOyVc','length','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','trino','trim','status','Invalid\x20header\x20format:\x20\x22','\x0aStack\x20trace:\x0a','3HKJKye','Endpoint\x20must\x20start\x20with\x20/:\x20','startsWith','color','cas','set-cookie','x-trino-user','489116kimcNO','site','cdp','header','50DosUqG','toLowerCase','toUpperCase','workflow','includes'];a6_0x10da=function(){return _0x2ae865;};return a6_0x10da();}import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';function a6_0x6311(_0x218561,_0x28b693){_0x218561=_0x218561-0x125;const _0x10da86=a6_0x10da();let _0x6311d7=_0x10da86[_0x218561];return _0x6311d7;}const SENSITIVE_HEADERS=new Set(['authorization',a6_0x31991b(0x14a),a6_0x31991b(0x136),a6_0x31991b(0x159),a6_0x31991b(0x125),a6_0x31991b(0x13b),a6_0x31991b(0x167),a6_0x31991b(0x15a)]);function isSensitiveHeader(_0x14941a){const _0xce48a8=a6_0x31991b;return SENSITIVE_HEADERS['has'](_0x14941a[_0xce48a8(0x160)]());}function parseHeader(_0x4db85b){const _0x42b5db=a6_0x31991b,_0x38c2b8=_0x4db85b['indexOf'](':');if(_0x38c2b8===-0x1)throw new Error(_0x42b5db(0x152)+_0x4db85b+_0x42b5db(0x13c)+_0x42b5db(0x166));const _0x2aa86e=_0x4db85b[_0x42b5db(0x12f)](0x0,_0x38c2b8)['trim'](),_0xe6c4e9=_0x4db85b[_0x42b5db(0x12f)](_0x38c2b8+0x1)[_0x42b5db(0x150)]();if(!_0x2aa86e)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x4db85b+'\x22');return[_0x2aa86e,_0xe6c4e9];}export class ApiCommand extends BaseCommand{[a6_0x31991b(0x141)]=a6_0x31991b(0x13a);['description']=a6_0x31991b(0x12e);['validate'](_0x3a3a3a){const _0x53b76a=a6_0x31991b,{args:_0x3264cc,options:_0x80c99}=_0x3a3a3a,_0x2b734b=_0x80c99;if(_0x3264cc[_0x53b76a(0x14d)]===0x0)return _0x53b76a(0x14e);const _0x15dbb4=_0x3264cc[0x0];if(!_0x15dbb4[_0x53b76a(0x156)]('/'))return _0x53b76a(0x155)+_0x15dbb4;const _0x16deaf=_0x2b734b[_0x53b76a(0x165)],_0x3010d3=_0x2b734b[_0x53b76a(0x140)];if(_0x16deaf&&_0x3010d3)return _0x53b76a(0x148);const _0x19f6e3=_0x2b734b['method']||'GET',_0x4351f5=['GET',_0x53b76a(0x12b),'PUT',_0x53b76a(0x12a),_0x53b76a(0x12c)];if(!_0x4351f5[_0x53b76a(0x163)](_0x19f6e3[_0x53b76a(0x161)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x19f6e3+_0x53b76a(0x14b)+_0x4351f5[_0x53b76a(0x142)](',\x20');const _0x5a11e2=_0x2b734b[_0x53b76a(0x12d)]||'td',_0x2d9522=['td',_0x53b76a(0x15d),_0x53b76a(0x162),_0x53b76a(0x14f),_0x53b76a(0x127),'llm-proxy',_0x53b76a(0x158)];if(!_0x2d9522[_0x53b76a(0x163)](_0x5a11e2))return'Invalid\x20API\x20type:\x20'+_0x5a11e2+_0x53b76a(0x144)+_0x2d9522[_0x53b76a(0x142)](',\x20');return undefined;}async['execute'](_0x521d81){const _0x1b7863=a6_0x31991b,{options:_0x943b31,args:_0xf2127b,tdx:_0x813bc8}=_0x521d81,_0x414901=_0x943b31,_0x5cb20e=_0xf2127b[0x0],_0xdb0d5=(_0x414901[_0x1b7863(0x164)]||_0x1b7863(0x138))[_0x1b7863(0x161)](),_0x4b805c=_0x414901[_0x1b7863(0x165)],_0x42212b=_0x414901[_0x1b7863(0x140)],_0x4165c4=_0x414901[_0x1b7863(0x15e)],_0x26eafd=_0x414901[_0x1b7863(0x12d)]||'td';try{const _0xad697d={};if(_0x4165c4){const _0x12d7f2=Array['isArray'](_0x4165c4)?_0x4165c4:[_0x4165c4];for(const _0x104634 of _0x12d7f2){const [_0xd8d3db,_0x26c77a]=parseHeader(_0x104634);_0xad697d[_0xd8d3db]=_0x26c77a;}}let _0x2a047f;if(_0x4b805c)_0x2a047f=_0x4b805c;else{if(_0x42212b)try{_0x2a047f=RawAPI['readBodyFromFile'](_0x42212b);}catch(_0x2a62b5){return console[_0x1b7863(0x145)](_0x1b7863(0x139)+(_0x2a62b5 instanceof Error?_0x2a62b5[_0x1b7863(0x134)]:String(_0x2a62b5))),0x1;}}const _0x5bb2d7={'method':_0xdb0d5,'apiType':_0x26eafd,'includeHeaders':_0x943b31[_0x1b7863(0x128)]};_0x2a047f&&(_0x5bb2d7[_0x1b7863(0x13f)]=_0x2a047f);Object['keys'](_0xad697d)[_0x1b7863(0x14d)]>0x0&&(_0x5bb2d7[_0x1b7863(0x129)]=_0xad697d);if(_0x943b31[_0x1b7863(0x128)]){const _0x10cef8=resolveSite(_0x943b31[_0x1b7863(0x15c)]),_0x4d8f1a=getEndpoint(_0x10cef8,_0x26eafd),_0x593252=''+_0x4d8f1a+_0x5cb20e;console[_0x1b7863(0x145)]('>\x20'+_0xdb0d5+'\x20'+_0x593252);const _0x47d822=getAuthHeaders(_0x10cef8),_0x5c4bf3={..._0x47d822,..._0xad697d};for(const [_0x54f7fc,_0x2509f3]of Object['entries'](_0x5c4bf3)){!isSensitiveHeader(_0x54f7fc)&&console[_0x1b7863(0x145)]('>\x20'+_0x54f7fc+':\x20'+_0x2509f3);}_0x2a047f&&console[_0x1b7863(0x145)]('>'),console[_0x1b7863(0x145)]('');}const _0x520d17=await _0x813bc8[_0x1b7863(0x13a)][_0x1b7863(0x168)](_0x5cb20e,_0x5bb2d7);if(_0x943b31['verbose']&&_0x520d17['headers']){console[_0x1b7863(0x145)]('<\x20HTTP/1.1\x20'+_0x520d17[_0x1b7863(0x151)]);for(const [_0x148258,_0x3f3be8]of Object[_0x1b7863(0x143)](_0x520d17['headers'])){!isSensitiveHeader(_0x148258)&&console[_0x1b7863(0x145)]('<\x20'+_0x148258+':\x20'+_0x3f3be8);}console['error']('');}const _0x86edf9=Boolean(_0x943b31[_0x1b7863(0x133)]),_0xf9d880={'color':_0x943b31[_0x1b7863(0x157)],'noColor':_0x943b31[_0x1b7863(0x13e)]||_0x86edf9&&!_0x943b31[_0x1b7863(0x157)]},_0x212e93=colorizeJSON(_0x520d17['data'],_0xf9d880);return _0x943b31[_0x1b7863(0x133)]?(writeFileSync(_0x943b31[_0x1b7863(0x133)],_0x212e93),console[_0x1b7863(0x145)](_0x1b7863(0x130)+_0x943b31[_0x1b7863(0x133)])):console[_0x1b7863(0x126)](_0x212e93),0x0;}catch(_0x27bcf8){return _0x27bcf8 instanceof Error?(console[_0x1b7863(0x145)](_0x1b7863(0x139)+_0x27bcf8[_0x1b7863(0x134)]),_0x943b31[_0x1b7863(0x128)]&&_0x27bcf8[_0x1b7863(0x13d)]&&console['error'](_0x1b7863(0x153)+_0x27bcf8[_0x1b7863(0x13d)])):console[_0x1b7863(0x145)](_0x1b7863(0x139)+String(_0x27bcf8)),0x1;}}}
@@ -1 +1 @@
1
- const a7_0x2b3900=a7_0x4f93;(function(_0x52e4bc,_0x54bc53){const _0x3f99f0=a7_0x4f93,_0x26cb16=_0x52e4bc();while(!![]){try{const _0x31a1f8=parseInt(_0x3f99f0(0x236))/0x1*(parseInt(_0x3f99f0(0x20c))/0x2)+parseInt(_0x3f99f0(0x1fd))/0x3*(-parseInt(_0x3f99f0(0x241))/0x4)+-parseInt(_0x3f99f0(0x209))/0x5+parseInt(_0x3f99f0(0x23b))/0x6*(-parseInt(_0x3f99f0(0x21d))/0x7)+parseInt(_0x3f99f0(0x22b))/0x8*(-parseInt(_0x3f99f0(0x20f))/0x9)+parseInt(_0x3f99f0(0x221))/0xa+parseInt(_0x3f99f0(0x1f6))/0xb;if(_0x31a1f8===_0x54bc53)break;else _0x26cb16['push'](_0x26cb16['shift']());}catch(_0x8ad77a){_0x26cb16['push'](_0x26cb16['shift']());}}}(a7_0x391a,0xa82e5));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_0x58290a from'prompts';function a7_0x4f93(_0x4bcd1b,_0x9dd687){_0x4bcd1b=_0x4bcd1b-0x1e7;const _0x391aab=a7_0x391a();let _0x4f930f=_0x391aab[_0x4bcd1b];return _0x4f930f;}import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x7c180e from'chalk';export async function runOAuthLoginFlow(_0x32d3b0,_0x3a6016,_0x43a463,_0x2758b7){const _0x99a797=a7_0x4f93,_0x2b36c4=await isKeychainAvailable();if(!_0x2b36c4)throw new Error(_0x99a797(0x203)+_0x99a797(0x1fe));let _0x4b3e25=_0x2758b7?.[_0x99a797(0x242)];if(!_0x4b3e25){const _0x168045=await a7_0x58290a({'type':_0x99a797(0x232),'name':_0x99a797(0x242),'message':_0x99a797(0x233)});if(_0x168045[_0x99a797(0x242)]===undefined)throw new Error('Setup\x20cancelled');_0x4b3e25=_0x168045[_0x99a797(0x242)][_0x99a797(0x204)]()||undefined;}const _0x537e32=getConsoleUrl(_0x32d3b0);console['log']('Opening\x20browser\x20for\x20authentication...');_0x4b3e25?console[_0x99a797(0x1f2)]('\x20\x20'+_0x537e32+'/users/initiate_sso\x20(account:\x20'+_0x4b3e25+')'):console[_0x99a797(0x1f2)]('\x20\x20'+_0x537e32+_0x99a797(0x1f0));console['log'](_0x99a797(0x218));const _0x248cab=await startOAuthFlow(_0x32d3b0,{'accountName':_0x4b3e25});console['log'](_0x99a797(0x243));const _0xbc6be6=TDX['create']({'site':_0x32d3b0,'accessToken':_0x248cab['access_token'],'logLevel':_0x43a463??LogLevel[_0x99a797(0x22e)]}),_0x1722d0=await _0xbc6be6[_0x99a797(0x21f)]['getUserInfo']();console[_0x99a797(0x1f2)](a7_0x7c180e['green'](_0x99a797(0x20d))),console['log']('\x20\x20'+a7_0x7c180e[_0x99a797(0x238)](_0x32d3b0+':'+_0x1722d0['account_id'])+_0x99a797(0x212)+_0x1722d0['id']+_0x99a797(0x240)+_0x1722d0[_0x99a797(0x23f)]+')');!_0x4b3e25&&(console[_0x99a797(0x1f2)](a7_0x7c180e[_0x99a797(0x230)]('\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:')),console['log'](a7_0x7c180e['dim'](_0x99a797(0x23d))),console['log'](a7_0x7c180e[_0x99a797(0x230)]('\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions')));await saveOAuthTokens(_0x248cab,_0x3a6016),console[_0x99a797(0x1f2)](_0x99a797(0x227)+(_0x3a6016?_0x99a797(0x23e)+_0x3a6016+')':''));if(_0x3a6016){const _0x461536={'site':_0x32d3b0};saveProfileToUserConfig(_0x3a6016,_0x461536),console['log'](_0x99a797(0x21e)+_0x3a6016+_0x99a797(0x207));}else saveDefaultSiteToUserConfig(_0x32d3b0),console[_0x99a797(0x1f2)](_0x99a797(0x1e8)+_0x32d3b0);const _0x494b31=_0x3a6016?'\x20--profile\x20'+_0x3a6016:'';console['log'](),console[_0x99a797(0x1f2)](_0x99a797(0x1e7)),console[_0x99a797(0x1f2)](_0x99a797(0x1f8)+_0x494b31+_0x99a797(0x21b)),console['log'](_0x99a797(0x1f8)+_0x494b31+_0x99a797(0x1f7));}export async function promptAuthMethod(){const _0x3ebf50=a7_0x4f93,_0x1f8384=await a7_0x58290a({'type':_0x3ebf50(0x224),'name':_0x3ebf50(0x1f4),'message':_0x3ebf50(0x231),'choices':[{'title':_0x3ebf50(0x245),'description':_0x3ebf50(0x205),'value':_0x3ebf50(0x1ef)},{'title':_0x3ebf50(0x237),'description':_0x3ebf50(0x1ee),'value':_0x3ebf50(0x1f5)}]});return _0x1f8384[_0x3ebf50(0x1f4)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x2b3900(0x246)]=a7_0x2b3900(0x22a);[a7_0x2b3900(0x229)]='Setup\x20API\x20key\x20authentication\x20interactively';async['execute'](_0x1d7bc9){const _0x12fbab=a7_0x2b3900,{options:_0x32bdcf}=_0x1d7bc9,_0x59b3e5=_0x32bdcf['profile'];console['log'](a7_0x7c180e[_0x12fbab(0x1f1)](_0x12fbab(0x216)));const _0xe03158=_0x32bdcf[_0x12fbab(0x208)]||'us01',_0x46581d=await promptSiteSelection(_0xe03158,_0x59b3e5,'Setup\x20cancelled');if(!_0x46581d)return 0x1;const _0x410a91=resolveSite(_0x46581d),_0x50735c=await promptAuthMethod();if(!_0x50735c)return console[_0x12fbab(0x1f2)](_0x12fbab(0x1eb)),0x1;if(_0x50735c==='oauth'){const {accountName:_0xde6de6}=_0x32bdcf;return await runOAuthLoginFlow(_0x410a91,_0x59b3e5,_0x32bdcf[_0x12fbab(0x226)]??LogLevel[_0x12fbab(0x22e)],{'accountName':_0xde6de6}),0x0;}console[_0x12fbab(0x1f2)](_0x12fbab(0x22f)+_0x410a91),console[_0x12fbab(0x1f2)](_0x12fbab(0x228)),console[_0x12fbab(0x1f2)]('\x20\x20'+getConsoleUrl(_0x410a91,'/app/mp/ak'));const _0x48d3e1=await a7_0x58290a({'type':_0x12fbab(0x247),'name':_0x12fbab(0x210),'message':_0x12fbab(0x214),'validate':_0x20646a=>{const _0x2e6419=_0x12fbab;if(!_0x20646a||!_0x20646a[_0x2e6419(0x204)]())return _0x2e6419(0x244);return!![];}});if(!_0x48d3e1[_0x12fbab(0x210)])return console[_0x12fbab(0x1f2)]('\x0aSetup\x20cancelled'),0x1;const _0x16d630=_0x48d3e1[_0x12fbab(0x210)];console[_0x12fbab(0x1f2)](_0x12fbab(0x234));try{const _0x28e016=TDX[_0x12fbab(0x23c)]({'site':_0x410a91,'apiKey':_0x16d630[_0x12fbab(0x204)](),'logLevel':_0x32bdcf[_0x12fbab(0x226)]??LogLevel[_0x12fbab(0x22e)]}),_0x106952=await _0x28e016[_0x12fbab(0x21f)]['getUserInfo']();console['log'](_0x12fbab(0x201)+_0x106952[_0x12fbab(0x23f)]+')');const _0x524273=await isKeychainAvailable();_0x524273?(await saveAPIKeyAsync(_0x16d630[_0x12fbab(0x204)](),_0x410a91,_0x59b3e5),console[_0x12fbab(0x1f2)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x59b3e5?'\x20(profile:\x20'+_0x59b3e5+')':''))):(console[_0x12fbab(0x200)](a7_0x7c180e['yellow'](_0x12fbab(0x206))),console[_0x12fbab(0x200)](a7_0x7c180e[_0x12fbab(0x1f9)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x59b3e5){const _0x3ad25a={'site':_0x410a91};saveProfileToUserConfig(_0x59b3e5,_0x3ad25a),console['log'](_0x12fbab(0x21e)+_0x59b3e5+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x410a91),console['log'](_0x12fbab(0x1e8)+_0x410a91);const _0x548347=_0x59b3e5?'\x20--profile\x20'+_0x59b3e5:'';return console[_0x12fbab(0x1f2)](),console[_0x12fbab(0x1f2)](_0x12fbab(0x1e7)),console[_0x12fbab(0x1f2)](_0x12fbab(0x1f8)+_0x548347+_0x12fbab(0x21b)),console[_0x12fbab(0x1f2)](_0x12fbab(0x1f8)+_0x548347+_0x12fbab(0x1f7)),0x0;}catch(_0x3546b0){if(_0x3546b0 instanceof HTTPClientError&&_0x3546b0[_0x12fbab(0x22c)]===0x191)return printAuthError(_0x3546b0),0x1;return console[_0x12fbab(0x1f3)](a7_0x7c180e[_0x12fbab(0x1ff)](_0x12fbab(0x220)+(_0x3546b0 instanceof Error?_0x3546b0[_0x12fbab(0x219)]:String(_0x3546b0)))),console['error'](_0x12fbab(0x1fb)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x2b3900(0x246)]=a7_0x2b3900(0x1fa);['description']=a7_0x2b3900(0x215);async[a7_0x2b3900(0x223)](_0x5cf613){const _0x3bf939=a7_0x2b3900,{options:_0x4d9818,tdx:_0x380cb0}=_0x5cf613,_0x42a762=_0x4d9818['site'],_0x2565a1=_0x4d9818['profile'],_0x2ca9ce=_0x2565a1?_0x2565a1:_0x3bf939(0x235);console[_0x3bf939(0x1f2)]('tdx\x20profile:\x20'+_0x2ca9ce+_0x3bf939(0x21c)+_0x42a762+')');const _0x236a0a=await getOAuthTokens(_0x2565a1);if(_0x236a0a)console[_0x3bf939(0x1f2)](_0x3bf939(0x1ed)),console[_0x3bf939(0x1f2)]('Read\x20credential\x20from\x20keychain'+(_0x2565a1?'\x20(profile:\x20'+_0x2565a1+')':''));else{const _0x1ae09b=await resolveAPIKeyAsync(_0x42a762,_0x2565a1);if(_0x1ae09b){const {source:_0x43b303,isDeprecated:_0x895de3}=_0x1ae09b,_0x3f8610=_0x3bf939(0x225)+_0x43b303;console['log'](_0x895de3?a7_0x7c180e['yellow'](_0x3f8610):_0x3f8610);}else console['log'](a7_0x7c180e[_0x3bf939(0x1f9)](_0x3bf939(0x1fc)));}try{const _0x3abf3c=await _0x380cb0[_0x3bf939(0x21f)]['getUserInfo']();return console[_0x3bf939(0x1f2)](a7_0x7c180e[_0x3bf939(0x211)]('✓\x20Authentication\x20successful\x0a')),console[_0x3bf939(0x1f2)](_0x3bf939(0x213)+_0x3abf3c['email']),(_0x3abf3c[_0x3bf939(0x1e9)]||_0x3abf3c[_0x3bf939(0x20b)])&&console['log'](_0x3bf939(0x222)+[_0x3abf3c['first_name'],_0x3abf3c[_0x3bf939(0x20b)]][_0x3bf939(0x22d)](Boolean)[_0x3bf939(0x1ec)]('\x20')),0x0;}catch(_0x552250){return _0x552250 instanceof HTTPClientError&&_0x552250[_0x3bf939(0x22c)]===0x191?printAuthError(_0x552250,!![],_0x2565a1):console[_0x3bf939(0x1f3)](a7_0x7c180e[_0x3bf939(0x1ff)](_0x3bf939(0x220)+(_0x552250 instanceof Error?_0x552250[_0x3bf939(0x219)]:String(_0x552250)))),0x1;}}}function a7_0x391a(){const _0x56ff5e=['7CbzBtu','✓\x20Profile\x20\x27','jobs','✗\x20Validation\x20failed:\x20','11544000fiZDVG','Name:\x20','execute','select','Read\x20credential\x20from\x20','logLevel','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','You\x20can\x20find\x20your\x20API\x20key\x20at:','description','auth:setup','8kEgNKW','status','filter','ERROR','Setting\x20up\x20authentication\x20for\x20site:\x20','dim','Choose\x20how\x20to\x20sign\x20in:','text','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','Validating\x20API\x20key...','N/A','875899FNwlzy','Use\x20an\x20API\x20key','cyan','No\x20credentials\x20found\x20in\x20keychain','System\x20keychain\x20is\x20not\x20available','2981604Ztifom','create','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','\x20(profile:\x20','email','\x20\x20(','5348604IRpFYz','accountName','Validating\x20OAuth\x20tokens...','API\x20key\x20cannot\x20be\x20empty','Sign\x20in\x20with\x20browser\x20(recommended)','name','password','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','✓\x20Default\x20site\x20set\x20to\x20','first_name','\x20for\x20profile:\x20','\x0aSetup\x20cancelled','join','Credential\x20type:\x20OAuth','For\x20scripts\x20or\x20headless\x20servers','oauth','/oauth/authorize','bold','log','error','method','apikey','15637545SDzilV','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','\x20\x20tdx','yellow','auth','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','No\x20credential\x20found','3bsrJIR','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','red','warn','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','OAuth\x20tokens','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','trim','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','\x27\x20registered','site','4461405KdgVkN','auth:clear','last_name','2WzEumn','✓\x20Signed\x20in\x20successfully','all','329931AbdFKE','apiKey','green','\x20\x20user_id:','User:\x20','Enter\x20your\x20TD\x20API\x20key:','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','tdx:\x20auth\x20setup','\x20and\x20','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','message','\x20removed\x20from\x20keychain','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20(site:\x20'];a7_0x391a=function(){return _0x56ff5e;};return a7_0x391a();}export class AuthClearCommand extends BaseCommand{[a7_0x2b3900(0x246)]=a7_0x2b3900(0x20a);['description']='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x2b3900(0x223)](_0x18f647){const _0x487c72=a7_0x2b3900,{options:_0x109ac8}=_0x18f647,_0x3cdfc7=_0x109ac8['profile'];console[_0x487c72(0x1f2)](a7_0x7c180e[_0x487c72(0x1f1)]('tdx:\x20auth\x20clear'));const _0x19c347=await isKeychainAvailable();if(!_0x19c347)return console[_0x487c72(0x1f3)](a7_0x7c180e[_0x487c72(0x1ff)](_0x487c72(0x23a))),0x1;const [_0x1f2e69,_0x2e9809]=await Promise[_0x487c72(0x20e)]([deleteKeychainAPIKey(_0x3cdfc7),deleteOAuthTokens(_0x3cdfc7)]);if(_0x1f2e69||_0x2e9809){clearCredentialCache();const _0x11b222=[_0x1f2e69&&'API\x20key',_0x2e9809&&_0x487c72(0x202)][_0x487c72(0x22d)](Boolean)[_0x487c72(0x1ec)](_0x487c72(0x217));return console[_0x487c72(0x1f2)]('✓\x20'+_0x11b222+_0x487c72(0x21a)+(_0x3cdfc7?'\x20(profile:\x20'+_0x3cdfc7+')':'')),0x0;}else return console[_0x487c72(0x1f2)](_0x487c72(0x239)+(_0x3cdfc7?_0x487c72(0x1ea)+_0x3cdfc7:'')),0x1;}}
1
+ const a7_0x1893b4=a7_0x214b;(function(_0xa26d62,_0x36c948){const _0x435580=a7_0x214b,_0x16915f=_0xa26d62();while(!![]){try{const _0x2c2fdc=parseInt(_0x435580(0x153))/0x1+parseInt(_0x435580(0x129))/0x2+-parseInt(_0x435580(0x119))/0x3+-parseInt(_0x435580(0x166))/0x4*(-parseInt(_0x435580(0x171))/0x5)+parseInt(_0x435580(0x168))/0x6+-parseInt(_0x435580(0x135))/0x7*(parseInt(_0x435580(0x142))/0x8)+-parseInt(_0x435580(0x137))/0x9;if(_0x2c2fdc===_0x36c948)break;else _0x16915f['push'](_0x16915f['shift']());}catch(_0x21bfa2){_0x16915f['push'](_0x16915f['shift']());}}}(a7_0xd146,0xd46eb));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';function a7_0x214b(_0x443d31,_0x588d54){_0x443d31=_0x443d31-0x113;const _0xd14600=a7_0xd146();let _0x214b1b=_0xd14600[_0x443d31];return _0x214b1b;}import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x28025a from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';function a7_0xd146(){const _0x5e63cd=['auth:setup','Remove\x20API\x20key\x20from\x20system\x20keychain','\x20(profile:\x20','status','auth:clear','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Setting\x20up\x20authentication\x20for\x20site:\x20','No\x20credential\x20found','select','\x20\x20tdx','\x20\x20(','warn','API\x20key\x20cannot\x20be\x20empty','all','green','Read\x20credential\x20from\x20','44EfVsSh','last_name','2006286zmaTsP','apikey','Sign\x20in\x20with\x20browser\x20(recommended)','Use\x20an\x20API\x20key','tdx:\x20auth\x20clear','/app/mp/ak','logLevel','API\x20key','us01','743310fMesXS','execute','account_id','\x27\x20registered','cyan','✓\x20Profile\x20\x27','text','✓\x20Default\x20site\x20set\x20to\x20','access_token','5015172ktTLGL','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','description','Credential\x20type:\x20OAuth','✓\x20Signed\x20in\x20successfully','Choose\x20how\x20to\x20sign\x20in:','trim','Validating\x20API\x20key...','\x0aSetup\x20cancelled','\x20\x20user_id:','Opening\x20browser\x20for\x20authentication...','method','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','tdx\x20profile:\x20','dim','✗\x20Validation\x20failed:\x20','1794924bIeAGG','profile','email','tdx:\x20auth\x20setup','join','yellow','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','/oauth/authorize','red','System\x20keychain\x20is\x20not\x20available','apiKey','You\x20can\x20find\x20your\x20API\x20key\x20at:','14bMrmCH','message','6105078XWbKEv','Setup\x20cancelled','ERROR','Read\x20credential\x20from\x20keychain','✓\x20Authentication\x20successful\x0a','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','\x20--profile\x20','filter','log','error','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','411816TJjYDZ','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','oauth','name','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','\x20and\x20','getUserInfo','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','jobs','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','N/A','accountName','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','For\x20scripts\x20or\x20headless\x20servers','create','bold','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','456018NOKWGT','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.'];a7_0xd146=function(){return _0x5e63cd;};return a7_0xd146();}import a7_0x3086a0 from'chalk';export async function runOAuthLoginFlow(_0x2217a1,_0x2e8239,_0x55ceed,_0x48608c){const _0x31a2db=a7_0x214b,_0x26ae7c=await isKeychainAvailable();if(!_0x26ae7c)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+_0x31a2db(0x155));let _0x3b2b76=_0x48608c?.[_0x31a2db(0x14d)];if(!_0x3b2b76){const _0x4c801f=await a7_0x28025a({'type':_0x31a2db(0x116),'name':'accountName','message':'Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):'});if(_0x4c801f[_0x31a2db(0x14d)]===undefined)throw new Error('Setup\x20cancelled');_0x3b2b76=_0x4c801f['accountName'][_0x31a2db(0x11f)]()||undefined;}const _0x1626d2=getConsoleUrl(_0x2217a1);console['log'](_0x31a2db(0x123));_0x3b2b76?console[_0x31a2db(0x13f)]('\x20\x20'+_0x1626d2+'/users/initiate_sso\x20(account:\x20'+_0x3b2b76+')'):console[_0x31a2db(0x13f)]('\x20\x20'+_0x1626d2+_0x31a2db(0x130));console['log'](_0x31a2db(0x146));const _0x1603ec=await startOAuthFlow(_0x2217a1,{'accountName':_0x3b2b76});console[_0x31a2db(0x13f)]('Validating\x20OAuth\x20tokens...');const _0x1cdeae=TDX[_0x31a2db(0x150)]({'site':_0x2217a1,'accessToken':_0x1603ec[_0x31a2db(0x118)],'logLevel':_0x55ceed??LogLevel[_0x31a2db(0x139)]}),_0x1c425e=await _0x1cdeae[_0x31a2db(0x14a)][_0x31a2db(0x148)]();console[_0x31a2db(0x13f)](a7_0x3086a0[_0x31a2db(0x164)](_0x31a2db(0x11d))),console['log']('\x20\x20'+a7_0x3086a0[_0x31a2db(0x114)](_0x2217a1+':'+_0x1c425e[_0x31a2db(0x173)])+_0x31a2db(0x122)+_0x1c425e['id']+_0x31a2db(0x160)+_0x1c425e[_0x31a2db(0x12b)]+')');!_0x3b2b76&&(console['log'](a7_0x3086a0[_0x31a2db(0x127)]('\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:')),console[_0x31a2db(0x13f)](a7_0x3086a0[_0x31a2db(0x127)](_0x31a2db(0x152))),console[_0x31a2db(0x13f)](a7_0x3086a0[_0x31a2db(0x127)](_0x31a2db(0x125))));await saveOAuthTokens(_0x1603ec,_0x2e8239),console['log'](_0x31a2db(0x13c)+(_0x2e8239?'\x20(profile:\x20'+_0x2e8239+')':''));if(_0x2e8239){const _0x2a7798={'site':_0x2217a1};saveProfileToUserConfig(_0x2e8239,_0x2a7798),console[_0x31a2db(0x13f)](_0x31a2db(0x115)+_0x2e8239+_0x31a2db(0x113));}else saveDefaultSiteToUserConfig(_0x2217a1),console[_0x31a2db(0x13f)](_0x31a2db(0x117)+_0x2217a1);const _0x3181c6=_0x2e8239?_0x31a2db(0x13d)+_0x2e8239:'';console[_0x31a2db(0x13f)](),console[_0x31a2db(0x13f)](_0x31a2db(0x14b)),console[_0x31a2db(0x13f)](_0x31a2db(0x15f)+_0x3181c6+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x31a2db(0x13f)]('\x20\x20tdx'+_0x3181c6+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export async function promptAuthMethod(){const _0x3de034=a7_0x214b,_0x5a074d=await a7_0x28025a({'type':_0x3de034(0x15e),'name':_0x3de034(0x124),'message':_0x3de034(0x11e),'choices':[{'title':_0x3de034(0x16a),'description':_0x3de034(0x143),'value':'oauth'},{'title':_0x3de034(0x16b),'description':_0x3de034(0x14f),'value':_0x3de034(0x169)}]});return _0x5a074d[_0x3de034(0x124)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x1893b4(0x145)]=a7_0x1893b4(0x156);['description']='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x1893b4(0x172)](_0x4fe430){const _0x49b78a=a7_0x1893b4,{options:_0x4e2424}=_0x4fe430,_0x2a1f8e=_0x4e2424['profile'];console[_0x49b78a(0x13f)](a7_0x3086a0[_0x49b78a(0x151)](_0x49b78a(0x12c)));const _0x2712cf=_0x4e2424['site']||_0x49b78a(0x170),_0x1639d8=await promptSiteSelection(_0x2712cf,_0x2a1f8e,_0x49b78a(0x138));if(!_0x1639d8)return 0x1;const _0x4a471f=resolveSite(_0x1639d8),_0x162217=await promptAuthMethod();if(!_0x162217)return console[_0x49b78a(0x13f)](_0x49b78a(0x121)),0x1;if(_0x162217===_0x49b78a(0x144)){const {accountName:_0xeff82e}=_0x4e2424;return await runOAuthLoginFlow(_0x4a471f,_0x2a1f8e,_0x4e2424[_0x49b78a(0x16e)]??LogLevel[_0x49b78a(0x139)],{'accountName':_0xeff82e}),0x0;}console[_0x49b78a(0x13f)](_0x49b78a(0x15c)+_0x4a471f),console['log'](_0x49b78a(0x134)),console[_0x49b78a(0x13f)]('\x20\x20'+getConsoleUrl(_0x4a471f,_0x49b78a(0x16d)));const _0x59df91=await a7_0x28025a({'type':'password','name':_0x49b78a(0x133),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0xebd357=>{const _0x2ed4dc=_0x49b78a;if(!_0xebd357||!_0xebd357[_0x2ed4dc(0x11f)]())return _0x2ed4dc(0x162);return!![];}});if(!_0x59df91['apiKey'])return console[_0x49b78a(0x13f)](_0x49b78a(0x121)),0x1;const _0xdb493d=_0x59df91['apiKey'];console[_0x49b78a(0x13f)](_0x49b78a(0x120));try{const _0x554207=TDX[_0x49b78a(0x150)]({'site':_0x4a471f,'apiKey':_0xdb493d[_0x49b78a(0x11f)](),'logLevel':_0x4e2424[_0x49b78a(0x16e)]??LogLevel['ERROR']}),_0x4d7f19=await _0x554207[_0x49b78a(0x14a)]['getUserInfo']();console[_0x49b78a(0x13f)](_0x49b78a(0x12f)+_0x4d7f19[_0x49b78a(0x12b)]+')');const _0x157e5c=await isKeychainAvailable();_0x157e5c?(await saveAPIKeyAsync(_0xdb493d['trim'](),_0x4a471f,_0x2a1f8e),console[_0x49b78a(0x13f)](_0x49b78a(0x11a)+(_0x2a1f8e?_0x49b78a(0x158)+_0x2a1f8e+')':''))):(console[_0x49b78a(0x161)](a7_0x3086a0[_0x49b78a(0x12e)](_0x49b78a(0x15b))),console[_0x49b78a(0x161)](a7_0x3086a0['yellow'](_0x49b78a(0x141))));if(_0x2a1f8e){const _0x38db90={'site':_0x4a471f};saveProfileToUserConfig(_0x2a1f8e,_0x38db90),console['log'](_0x49b78a(0x115)+_0x2a1f8e+_0x49b78a(0x113));}else saveDefaultSiteToUserConfig(_0x4a471f),console[_0x49b78a(0x13f)](_0x49b78a(0x117)+_0x4a471f);const _0x2694ed=_0x2a1f8e?_0x49b78a(0x13d)+_0x2a1f8e:'';return console[_0x49b78a(0x13f)](),console[_0x49b78a(0x13f)](_0x49b78a(0x14b)),console[_0x49b78a(0x13f)](_0x49b78a(0x15f)+_0x2694ed+_0x49b78a(0x154)),console[_0x49b78a(0x13f)](_0x49b78a(0x15f)+_0x2694ed+_0x49b78a(0x14e)),0x0;}catch(_0x52e16a){if(_0x52e16a instanceof HTTPClientError&&_0x52e16a[_0x49b78a(0x159)]===0x191)return printAuthError(_0x52e16a),0x1;return console[_0x49b78a(0x140)](a7_0x3086a0[_0x49b78a(0x131)](_0x49b78a(0x128)+(_0x52e16a instanceof Error?_0x52e16a[_0x49b78a(0x136)]:String(_0x52e16a)))),console[_0x49b78a(0x140)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x1893b4(0x145)]='auth';[a7_0x1893b4(0x11b)]=a7_0x1893b4(0x149);async['execute'](_0x107e2c){const _0x21bfd6=a7_0x1893b4,{options:_0x365ddf,tdx:_0x491011}=_0x107e2c,_0x144269=_0x365ddf['site'],_0x143bc9=_0x365ddf[_0x21bfd6(0x12a)],_0x4c077c=_0x143bc9?_0x143bc9:_0x21bfd6(0x14c);console['log'](_0x21bfd6(0x126)+_0x4c077c+'\x20(site:\x20'+_0x144269+')');const _0x1731fb=await getOAuthTokens(_0x143bc9);if(_0x1731fb)console[_0x21bfd6(0x13f)](_0x21bfd6(0x11c)),console[_0x21bfd6(0x13f)](_0x21bfd6(0x13a)+(_0x143bc9?_0x21bfd6(0x158)+_0x143bc9+')':''));else{const _0x52170b=await resolveAPIKeyAsync(_0x144269,_0x143bc9);if(_0x52170b){const {source:_0x420cfa,isDeprecated:_0x147058}=_0x52170b,_0x3c1bc0=_0x21bfd6(0x165)+_0x420cfa;console[_0x21bfd6(0x13f)](_0x147058?a7_0x3086a0[_0x21bfd6(0x12e)](_0x3c1bc0):_0x3c1bc0);}else console[_0x21bfd6(0x13f)](a7_0x3086a0[_0x21bfd6(0x12e)](_0x21bfd6(0x15d)));}try{const _0x49e2a8=await _0x491011[_0x21bfd6(0x14a)][_0x21bfd6(0x148)]();return console[_0x21bfd6(0x13f)](a7_0x3086a0[_0x21bfd6(0x164)](_0x21bfd6(0x13b))),console[_0x21bfd6(0x13f)]('User:\x20'+_0x49e2a8[_0x21bfd6(0x12b)]),(_0x49e2a8['first_name']||_0x49e2a8['last_name'])&&console[_0x21bfd6(0x13f)]('Name:\x20'+[_0x49e2a8['first_name'],_0x49e2a8[_0x21bfd6(0x167)]]['filter'](Boolean)[_0x21bfd6(0x12d)]('\x20')),0x0;}catch(_0x4d3522){return _0x4d3522 instanceof HTTPClientError&&_0x4d3522[_0x21bfd6(0x159)]===0x191?printAuthError(_0x4d3522,!![],_0x143bc9):console[_0x21bfd6(0x140)](a7_0x3086a0['red']('✗\x20Validation\x20failed:\x20'+(_0x4d3522 instanceof Error?_0x4d3522['message']:String(_0x4d3522)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x1893b4(0x145)]=a7_0x1893b4(0x15a);[a7_0x1893b4(0x11b)]=a7_0x1893b4(0x157);async['execute'](_0x2c9bc0){const _0x272416=a7_0x1893b4,{options:_0x2fcc78}=_0x2c9bc0,_0x1b41cb=_0x2fcc78[_0x272416(0x12a)];console[_0x272416(0x13f)](a7_0x3086a0[_0x272416(0x151)](_0x272416(0x16c)));const _0x1ab44d=await isKeychainAvailable();if(!_0x1ab44d)return console['error'](a7_0x3086a0[_0x272416(0x131)](_0x272416(0x132))),0x1;const [_0x30163f,_0x3f5f14]=await Promise[_0x272416(0x163)]([deleteKeychainAPIKey(_0x1b41cb),deleteOAuthTokens(_0x1b41cb)]);if(_0x30163f||_0x3f5f14){clearCredentialCache();const _0x230ad3=[_0x30163f&&_0x272416(0x16f),_0x3f5f14&&'OAuth\x20tokens'][_0x272416(0x13e)](Boolean)[_0x272416(0x12d)](_0x272416(0x147));return console[_0x272416(0x13f)]('✓\x20'+_0x230ad3+'\x20removed\x20from\x20keychain'+(_0x1b41cb?'\x20(profile:\x20'+_0x1b41cb+')':'')),0x0;}else return console['log']('No\x20credentials\x20found\x20in\x20keychain'+(_0x1b41cb?'\x20for\x20profile:\x20'+_0x1b41cb:'')),0x1;}}